/* Accounts (accounts.js): what they add to style.css. Status shown as color and shape before words, identity always
   shown side by side: who was invited, and who actually signed in. */

:root { --bad-soft: rgba(255, 59, 48, 0.12); }
@media (prefers-color-scheme: dark) { :root { --bad-soft: rgba(255, 69, 58, 0.18); } }

.mono { font-family: ui-monospace, "SF Mono", Menlo, monospace; letter-spacing: 0.02em; }
.small { font-size: 12.5px !important; }
.wrap { white-space: normal !important; }
.dim { opacity: 0.6; }
.badtext { color: var(--bad); }
.pill.bad { color: var(--bad); background: var(--bad-soft); }
.item.tappable { cursor: pointer; }
.item.tappable:active, .event.tappable:active { background: color-mix(in srgb, var(--text) 7%, transparent); }
.item.tappable:hover { background: color-mix(in srgb, var(--text) 3%, transparent); }
.event.tappable { cursor: pointer; transition: background 0.15s; }
.item .title, .item .detail { display: block; }
.tag { display: inline-block; vertical-align: 1px; margin-left: 4px; padding: 1px 7px; border-radius: 6px; background: var(--surface-2); color: var(--text-2); font-size: 11.5px; font-weight: 600; letter-spacing: 0.01em; }

/* The four numbers at the top of People. */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 18px; }
.stat { position: relative; overflow: hidden; padding: 14px 12px 12px; border-radius: 18px; background: var(--surface); box-shadow: var(--shadow-1); }
.stat b { display: block; font-size: 28px; line-height: 1; font-weight: 700; letter-spacing: -0.03em; }
.stat span { display: block; margin-top: 6px; font-size: 12.5px; font-weight: 600; color: var(--text-2); white-space: nowrap; }
.stat::after { content: ""; position: absolute; top: 12px; right: 12px; width: 8px; height: 8px; border-radius: 50%; }
.stat.good::after { background: var(--good); box-shadow: 0 0 0 4px var(--good-soft); }
.stat.warn::after { background: var(--warn); box-shadow: 0 0 0 4px var(--warn-soft); }
.stat.quiet::after { background: var(--text-3); }
.stat.bad::after { background: var(--bad); box-shadow: 0 0 0 4px var(--bad-soft); }
@media (max-width: 420px) { .stats { gap: 8px; } .stat { padding: 12px 10px 10px; } .stat b { font-size: 24px; } .stat span { font-size: 11.5px; } }

/* A person's avatar with their state as a ring and a dot, like presence in Messages. */
.presence { position: relative; flex: none; border-radius: 50%; }
.presence .avatar { width: 46px; height: 46px; font-size: 17px; }
.presence::after { content: ""; position: absolute; right: -1px; bottom: -1px; width: 13px; height: 13px; border-radius: 50%; border: 2.5px solid var(--surface); background: var(--text-3); }
.presence.good::after { background: var(--good); }
.presence.warn::after { background: var(--warn); }
.presence.bad::after { background: var(--bad); }
.presence.bad .avatar { filter: grayscale(1); opacity: 0.6; }
.account-row-item { min-height: 76px; }
.account-row-item .pill { margin-left: 6px; }
@media (max-width: 420px) { .account-row-item .pill { display: none; } }
.detail.owner { display: flex !important; align-items: center; gap: 4px; color: var(--text); font-size: 14px; }
.detail.owner svg { flex: none; opacity: 0.7; }
.detail.owner.bad b { color: var(--bad); font-weight: 600; }
.detail.owner.warn b { color: var(--warn); font-weight: 600; }

/* Tiles for icons in lists. */
.glyph-tile { width: 36px; height: 36px; border-radius: 11px; flex: none; display: flex; align-items: center; justify-content: center; background: var(--surface-2); color: var(--text-2); }
.glyph-tile svg { width: 19px; height: 19px; }
.glyph-tile.good { background: var(--good-soft); color: var(--good); }
.glyph-tile.warn { background: var(--warn-soft); color: var(--warn); }
.glyph-tile.bad { background: var(--bad-soft); color: var(--bad); }
.glyph-tile.accent { background: var(--accent-soft); color: var(--accent); }
.event .glyph { background: var(--surface-2); color: var(--text-2); }
.event .glyph.good { background: var(--good-soft); color: var(--good); }
.event .glyph.accent { background: var(--accent-soft); color: var(--accent); }
.event .glyph.bad { background: var(--bad-soft); color: var(--bad); }

/* Account sheet. */
.who-head { display: flex; align-items: center; gap: 14px; min-width: 0; }
.who-head h2 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who-head p { display: flex; align-items: center; flex-wrap: wrap; gap: 2px; margin-top: 6px !important; font-size: 14px !important; }
.sheet .section-head { margin-top: 24px; }
.ownership { padding: 0; }
.verdict { display: flex; align-items: center; gap: 10px; padding: 12px 16px; font-weight: 650; font-size: 15px; }
.verdict svg { width: 20px; height: 20px; flex: none; }
.verdict.good { background: var(--good-soft); color: color-mix(in srgb, var(--good) 75%, var(--text)); }
.verdict.warn { background: var(--warn-soft); color: color-mix(in srgb, var(--warn) 75%, var(--text)); }
.verdict.bad { background: var(--bad-soft); color: var(--bad); }
.verdict.quiet { background: var(--surface-2); color: var(--text-2); }
.sides { display: grid; grid-template-columns: 1fr 1fr; }
.side { padding: 14px 16px 16px; min-width: 0; }
.side + .side { box-shadow: inset 1px 0 0 var(--hairline); }
.side .label { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-3); margin-bottom: 8px; }
.side .v { font-weight: 650; font-size: 16.5px; overflow-wrap: anywhere; }
.side .s { margin-top: 3px; font-size: 14px; color: var(--text-2); overflow-wrap: anywhere; }
.side .s .tag { margin-left: 0; }
@media (max-width: 380px) { .sides { grid-template-columns: 1fr; } .side + .side { box-shadow: inset 0 1px 0 var(--hairline); } }
.timeline .item { min-height: 56px; position: relative; }
.timeline .tick { width: 10px; height: 10px; border-radius: 50%; flex: none; margin: 0 13px; background: var(--text-3); position: relative; z-index: 1; }
.timeline .tick.live { background: var(--good); box-shadow: 0 0 0 4px var(--good-soft); }
.timeline .item:not(:last-child)::after { content: ""; position: absolute; left: 33px; top: 50%; height: 100%; width: 2px; background: var(--hairline); }
.timeline .flag { font-size: 14px; }
.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 24px; }
.actions .btn { min-height: 50px; border-radius: 16px; background: var(--surface); box-shadow: var(--shadow-1); }
.actions .btn.danger { background: var(--bad-soft); box-shadow: none; }
.actions .btn.tint { background: var(--accent-soft); box-shadow: none; }
.actions .btn svg { width: 18px; height: 18px; }

/* The code, as tiles. */
.code-tiles { display: flex; justify-content: center; align-items: center; gap: 6px; margin: 6px 0 18px; }
.code-tiles span { display: grid; place-items: center; width: 40px; height: 54px; border-radius: 12px; background: var(--surface); box-shadow: var(--shadow-1);
  font: 650 27px/1 ui-monospace, "SF Mono", Menlo, monospace; }
.code-tiles i { width: 10px; height: 3px; border-radius: 2px; background: var(--text-3); margin: 0 2px; }
.code-tiles.pop span { animation: tile-in 0.55s var(--spring) both; animation-delay: calc(var(--i) * 45ms); }
.code-tiles.used span { color: var(--text-3); }
@keyframes tile-in { from { opacity: 0; transform: translateY(14px) scale(0.8) rotateX(50deg); } }
@media (max-width: 380px) { .code-tiles span { width: 33px; height: 46px; font-size: 22px; } .code-tiles { gap: 4px; } }

/* Features: icons on a person's row, and iOS switches in the account sheet. */
.feats { display: flex; gap: 3px; flex: none; }
.feat { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 7px; background: var(--accent-soft); color: var(--accent); }
@media (max-width: 420px) { .feats { display: none; } }
.toggle-row { cursor: pointer; }
.switch { appearance: none; -webkit-appearance: none; flex: none; position: relative; width: 51px; height: 31px; border-radius: 16px; margin: 0;
  background: color-mix(in srgb, var(--text) 16%, transparent); transition: background 0.25s var(--ease); cursor: pointer; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff;
  box-shadow: 0 3px 8px rgba(0,0,0,.15), 0 1px 1px rgba(0,0,0,.16); transition: transform 0.3s var(--spring); }
.switch:checked { background: var(--good); }
.switch:checked::after { transform: translateX(20px); }
.switch:active::after { width: 33px; }
.switch:checked:active::after { transform: translateX(14px); }
.actions > :only-child { grid-column: 1 / -1; }
@media (max-width: 420px) { .code-tiles span { width: 35px; height: 50px; font-size: 24px; } .code-tiles { gap: 5px; } }
@media (prefers-reduced-motion: reduce) { .code-tiles.pop span { animation: none; } }
.symbols { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.symbol { aspect-ratio: 1; display: grid; place-items: center; border-radius: 14px; background: var(--surface); box-shadow: var(--shadow-1); color: var(--text-2); transition: all .2s var(--spring); }
.symbol svg { width: 22px; height: 22px; }
.symbol.on { background: var(--accent); color: #fff; transform: scale(1.04); }
[hidden] { display: none !important; }

/* An app's icon beside a person's status, the person picker on an account, the invite code on a link. */
.who-head .app-icon { width: 52px; height: 52px; }
.pick { flex: none; max-width: 46%; padding: 7px 10px; border: 0; border-radius: 10px; background: var(--surface); font-size: 15px; font-weight: 600; color: var(--accent); }
.invite-line { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 14.5px; color: var(--text-2); }
.invite-line svg { width: 17px; height: 17px; flex: none; }
.invite-line b { color: var(--text); font-weight: 650; }
.section-head .aside .pill { vertical-align: 2px; }
.presence.accent::after { background: var(--accent); }
