/* CloudScope: one stylesheet, phone first. Desktop adds to it (min-width queries at the bottom). */

:root {
  --font: ui-sans-serif, -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, system-ui, sans-serif;
  --bg: #f5f6fa; --surface: #ffffff; --surface2: #f0f1f6; --raised: #ffffff;
  --line: rgba(17, 20, 40, .09); --line-strong: rgba(17, 20, 40, .16);
  --fg: #0e1120; --mute: #6a6f85;
  --accent: #6366f1; --accent2: #8b5cf6; --accent-fg: #fff; --accent-soft: rgba(99, 102, 241, .12);
  --bad: #e5484d; --bad-soft: rgba(229, 72, 77, .1); --ok: #2fa772;
  --radius: 18px; --radius-sm: 12px;
  --shadow-1: 0 1px 2px rgba(14, 17, 32, .05);
  --shadow-2: 0 24px 60px -16px rgba(14, 17, 32, .28), 0 4px 14px rgba(14, 17, 32, .08);
  --ring: 0 0 0 3px rgba(99, 102, 241, .35);
  --safe-t: env(safe-area-inset-top, 0px); --safe-b: env(safe-area-inset-bottom, 0px);
  --tab: 62px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #08090e; --surface: #10121a; --surface2: #181b26; --raised: #1a1d29;
    --line: rgba(255, 255, 255, .08); --line-strong: rgba(255, 255, 255, .16);
    --fg: #eceef7; --mute: #8d92a8;
    --accent: #7c83ff; --accent2: #a08bff; --accent-fg: #0b0c14; --accent-soft: rgba(124, 131, 255, .16);
    --bad: #ff6b70; --bad-soft: rgba(255, 107, 112, .12); --ok: #4cc38a;
    --shadow-1: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow-2: 0 28px 64px -16px rgba(0, 0, 0, .7), 0 4px 16px rgba(0, 0, 0, .45);
    --ring: 0 0 0 3px rgba(124, 131, 255, .45);
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--fg); font: 15px/1.5 var(--font);
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; text-rendering: optimizeLegibility;
}
h1, h2, h3, h4 { margin: 0; letter-spacing: -.02em; line-height: 1.2; }
p { margin: 0; }
a { color: inherit; }
svg { width: 20px; height: 20px; flex: none; }
.sprite { position: absolute; }
.muted { color: var(--mute); }
.note { color: var(--mute); font-size: 13px; }
.grow { flex: 1; min-width: 0; }
.mono, code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .02em; }
:focus-visible { outline: none; box-shadow: var(--ring); }
::selection { background: var(--accent-soft); }

/* ---------- controls ---------- */

button, .btn {
  font: inherit; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 18px; border-radius: var(--radius-sm); border: 1px solid transparent; cursor: pointer;
  white-space: nowrap; touch-action: manipulation; -webkit-appearance: none; appearance: none; user-select: none;
  transition: background .15s, border-color .15s, box-shadow .2s, transform .08s, opacity .15s;
}
button:active:not(:disabled), .btn:active { transform: scale(.975); }
button:disabled { opacity: .5; cursor: not-allowed; }
.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent2)); color: var(--accent-fg);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .28), 0 8px 18px -8px color-mix(in srgb, var(--accent) 80%, transparent);
}
.primary:hover:not(:disabled) { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .28), 0 10px 24px -8px color-mix(in srgb, var(--accent) 90%, transparent); }
.outline { background: var(--surface); border-color: var(--line-strong); color: var(--fg); font-weight: 550; box-shadow: var(--shadow-1); }
.outline:hover:not(:disabled) { background: var(--surface2); }
.outline.danger { color: var(--bad); }
.danger-fill { background: var(--bad); color: #fff; font-weight: 600; }
.big { height: 50px; width: 100%; font-size: 16px; }
.link { background: none; border: 0; height: auto; min-height: 44px; padding: 8px 12px; color: var(--accent); font-weight: 550; font-size: 14px; }
.link:hover { text-decoration: underline; }

input, select, textarea {
  font: inherit; font-size: 16px; /* 16px or more: below that, iPhone Safari zooms the page when a field is tapped */
  color: var(--fg); background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  height: 48px; padding: 0 14px; width: 100%; -webkit-appearance: none; appearance: none; transition: border-color .15s, box-shadow .15s;
}
textarea { height: auto; padding: 12px 14px; }
select {
  padding-right: 40px; background-repeat: no-repeat; background-position: right 14px center; background-size: 14px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238d92a8' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
}
input::placeholder, textarea::placeholder { color: color-mix(in srgb, var(--mute) 80%, transparent); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring); }
input[readonly] { background: var(--surface2); }
input[aria-invalid="true"] { border-color: var(--bad); box-shadow: 0 0 0 3px var(--bad-soft); }
.lbl { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 550; color: var(--mute); }
.stack { display: flex; flex-direction: column; gap: 14px; }
.error, .field-error { color: var(--bad); font-size: 14px; }
.error:empty, .field-error:empty { display: none; }
.field-error { font-weight: 550; }
.banner-error { color: var(--bad); font-weight: 550; margin-bottom: 12px; }
.banner-error:empty { display: none; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-1); }
.logo { display: block; width: 56px; height: 56px; }
.logo img { display: block; width: 100%; height: 100%; }
.logo.sm { width: 30px; height: 30px; }
.wordmark { font-weight: 750; letter-spacing: -.03em; }

.avatar {
  display: grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: 50%; font-weight: 700; font-size: 15px;
  text-transform: uppercase; color: #fff; background: linear-gradient(135deg, var(--accent), var(--accent2));
}
.avatar.lg { width: 56px; height: 56px; font-size: 22px; }
.avatar.sm { width: 42px; height: 42px; }
.avatar.xs { width: 26px; height: 26px; font-size: 12px; }
.role { font-size: 12.5px; color: var(--mute); }
.role.admin { color: var(--accent); font-weight: 650; }
.who { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; text-align: left; }
.who strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- sign in (also the look of the public share page) ---------- */

.login {
  min-height: 100dvh; display: grid; place-items: center; padding: max(20px, var(--safe-t)) 20px max(20px, var(--safe-b));
  background:
    radial-gradient(60rem 36rem at 12% -10%, color-mix(in srgb, var(--accent) 20%, transparent), transparent 60%),
    radial-gradient(50rem 30rem at 100% 110%, color-mix(in srgb, var(--accent2) 18%, transparent), transparent 60%), var(--bg);
}
.login-card, .shareCard {
  width: 100%; max-width: 420px; padding: 32px 26px 26px; display: flex; flex-direction: column; align-items: stretch; gap: 14px;
  border-radius: 26px; box-shadow: var(--shadow-2);
}
.shareCard { align-items: center; text-align: center; }
.shareCard h1 { font-size: 24px; overflow-wrap: anywhere; }
.share { width: 100%; display: flex; flex-direction: column; gap: 12px; margin-top: 6px; }
.share button { width: 100%; height: 50px; font-size: 16px; }
.login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.login-brand .logo { width: 44px; height: 44px; }
.login-brand .wordmark { font-size: 21px; }
.login-card h1 { font-size: 28px; }
.login-card .link { align-self: center; }
.login-card .error { text-align: center; }

/* ---------- app shell: a bottom tab bar on phones ---------- */

.content { padding: max(18px, var(--safe-t)) 16px calc(var(--tab) + var(--safe-b) + 28px); min-width: 0; }
.side {
  position: fixed; z-index: 20; left: 0; right: 0; bottom: 0; display: flex; align-items: stretch;
  height: calc(var(--tab) + var(--safe-b)); padding: 6px 8px var(--safe-b);
  background: color-mix(in srgb, var(--surface) 92%, transparent); border-top: 1px solid var(--line);
  -webkit-backdrop-filter: saturate(1.6) blur(22px); backdrop-filter: saturate(1.6) blur(22px);
}
.side > a, .side > .tab {
  position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  min-width: 0; height: auto; padding: 4px 0; border-radius: 14px; border: 0; background: none; color: var(--mute);
  font-size: 11.5px; font-weight: 600; text-decoration: none; transition: color .15s;
}
.side > a svg { width: 24px; height: 24px; }
.side > a[aria-current="page"] { color: var(--accent); }
.side > a[aria-current="page"] svg { filter: drop-shadow(0 4px 8px color-mix(in srgb, var(--accent) 45%, transparent)); }
.brand, .label, .me, .side .grow { display: none; }
.dot { position: absolute; top: 5px; left: calc(50% + 8px); width: 10px; height: 10px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 2.5px var(--surface); }
.dot.static { position: static; flex: none; box-shadow: none; }

.head { margin-bottom: 18px; }
.head h2 { font-size: 30px; font-weight: 750; margin-bottom: 4px; }
.bar { display: flex; flex-direction: column; gap: 16px; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; }
.actions.end { justify-content: flex-end; }
.bar .actions { display: grid; grid-template-columns: 1fr 1fr; }
.bar .actions .primary { grid-column: 1 / -1; order: -1; height: 48px; }
.bar .actions .outline { padding: 0 10px; }

.empty { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; padding: 48px 24px; box-shadow: none; border-style: dashed; }
.empty h3 { font-size: 18px; }
.empty p { max-width: 24rem; }
.empty button { margin-top: 10px; }
.badge { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 20px; margin-bottom: 6px; color: var(--accent); background: var(--accent-soft); }
.badge svg { width: 30px; height: 30px; }
.badge.sm { width: 54px; height: 54px; border-radius: 17px; }
.badge.sm svg { width: 26px; height: 26px; }
.badge.bad { color: var(--bad); background: var(--bad-soft); }

/* ---------- files ---------- */

.crumbs { display: flex; align-items: center; gap: 2px; margin: 0 -16px 14px; padding: 0 16px; overflow-x: auto; white-space: nowrap; scrollbar-width: none; color: var(--mute); }
.crumbs::-webkit-scrollbar { display: none; }
.crumbs a { padding: 8px 10px; border-radius: 10px; color: var(--mute); text-decoration: none; font-weight: 550; }
.crumbs a:hover { background: var(--surface2); color: var(--fg); }
.crumbs a:last-child { color: var(--fg); font-weight: 650; }
.crumbs span { opacity: .5; }

.list { overflow: hidden; }
.item { display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; align-items: center; gap: 14px; padding: 10px 14px; min-height: 66px; border-bottom: 1px solid var(--line); transition: background .12s; }
.item:last-child { border-bottom: 0; }
.tile { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 13px; color: var(--tint); background: color-mix(in srgb, var(--tint) 13%, transparent); }
.tile svg { width: 21px; height: 21px; }
.k-folder { --tint: var(--accent); } .k-file { --tint: var(--mute); }
.k-image { --tint: #16a34a; } .k-video { --tint: #db2777; } .k-audio { --tint: #ea580c; } .k-pdf { --tint: #dc2626; }
.k-doc { --tint: #2563eb; } .k-sheet { --tint: #15803d; } .k-archive { --tint: #ca8a04; } .k-code { --tint: #7c3aed; }
.namecell { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; min-width: 0; }
.nameline { display: flex; align-items: center; gap: 8px; min-width: 0; max-width: 100%; }
.name { color: var(--fg); text-decoration: none; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.name:hover { color: var(--accent); }
.sub { color: var(--mute); font-size: 13px; font-variant-numeric: tabular-nums; }
.meta { display: none; color: var(--mute); font-size: 14px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.acts { display: flex; gap: 2px; justify-content: flex-end; align-items: center; }
.icon-btn, a.icon-btn {
  display: inline-grid; place-items: center; width: 42px; height: 42px; padding: 0; border-radius: 12px; border: 0; background: none;
  color: var(--mute); text-decoration: none; transition: background .12s, color .12s;
}
.icon-btn:hover:not(:disabled) { background: var(--surface2); color: var(--accent); }
.icon-btn.del:hover { color: var(--bad); background: var(--bad-soft); }
.icon-btn:disabled { opacity: .3; }
.act-view { display: none; } /* on a phone, tapping the name already opens the file */
.pill {
  flex: none; display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 9px; border-radius: 99px; font-size: 12px; font-weight: 650;
  color: var(--accent); background: var(--accent-soft); border: 0; position: relative;
}
.pill::before { content: ""; position: absolute; inset: -9px -4px; } /* a bigger invisible tap area */
.pill svg { width: 13px; height: 13px; }
.pill.expired { color: var(--bad); background: var(--bad-soft); }
@media (max-width: 759px) { .pill { padding: 0 7px; } .pill .t { display: none; } .pill svg { width: 14px; height: 14px; } } /* icon only: the name matters more */
.empty-row { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 52px 20px; text-align: center; color: var(--mute); }
.empty-row .badge { margin-bottom: 8px; }
.empty-row strong { color: var(--fg); font-size: 17px; }
body.drag .list { outline: 2px dashed var(--accent); outline-offset: 4px; background: var(--accent-soft); }

/* ---------- chat ---------- */

.chat { display: grid; grid-template-columns: 1fr; overflow: hidden; height: calc(100dvh - 240px); min-height: 420px; }
.chat-side { display: flex; flex-direction: column; overflow: auto; min-width: 0; min-height: 0; }
.chat-title { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px 6px; font-size: 12px; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; color: var(--mute); }
.peer { display: flex; align-items: center; gap: 12px; padding: 12px 18px; color: var(--fg); text-decoration: none; transition: background .12s; }
.peer:hover { background: var(--surface2); }
.peer.on { background: var(--accent-soft); }
.pname { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 1.3; }
.pname small { color: var(--mute); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13.5px; }
.pad { padding: 8px 18px; }
.chat-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--surface); }
.chat-empty { margin: auto; border: 0; padding: 32px; }
.chat-head { display: flex; align-items: center; gap: 12px; padding: 10px 12px 10px 8px; border-bottom: 1px solid var(--line); }
.chat-head .grow { display: flex; flex-direction: column; line-height: 1.25; }
.chat-head .outline { height: 40px; padding: 0 14px; }
.enc { color: var(--mute); display: flex; align-items: center; gap: 4px; font-size: 12.5px; }
.enc svg { width: 12px; height: 12px; }
.back { display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; color: var(--accent); }
.banner { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; padding: 12px 16px; background: var(--bad-soft); font-size: 14px; }
.msgs { flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; display: flex; flex-direction: column; gap: 4px; padding: 16px 14px; }
.msg { margin: 0; padding: 9px 14px; border-radius: 20px; max-width: min(80%, 34rem); overflow-wrap: anywhere; white-space: pre-wrap; line-height: 1.4; }
.msg.in { align-self: flex-start; background: var(--surface2); border-bottom-left-radius: 6px; }
.msg.out { align-self: flex-end; color: var(--accent-fg); background: linear-gradient(135deg, var(--accent), var(--accent2)); border-bottom-right-radius: 6px; }
.center { text-align: center; margin: auto; padding: 0 20px; }
.chat-main > .error { padding: 0 16px 8px; margin: 0; }
.compose { display: flex; gap: 10px; align-items: flex-end; padding: 10px 12px calc(10px + var(--safe-b)); border-top: 1px solid var(--line); background: var(--surface); }
.compose-input { flex: 1; resize: none; height: 44px; min-height: 44px; max-height: 140px; padding: 10px 16px; border-radius: 22px; line-height: 1.4; background: var(--surface2); border-color: transparent; }
.compose-input:focus { background: var(--surface); }
.send { flex: none; width: 44px; height: 44px; padding: 0; border-radius: 50%; }
.send svg { width: 22px; height: 22px; }

/* a conversation takes over the whole screen on a phone, sized to what is left above the keyboard */
@media (max-width: 759px) {
  .chat.open { position: fixed; z-index: 40; left: 0; right: 0; top: var(--vvt, 0px); height: var(--vvh, 100dvh); min-height: 0; border: 0; border-radius: 0; box-shadow: none; }
  .chat.open .chat-side { display: none; }
  .chat:not(.open) .chat-main { display: none; }
  .chat-head { padding-top: max(10px, var(--safe-t)); padding-left: calc(8px + env(safe-area-inset-left, 0px)); }
  .chat-head .t { display: none; }
  .chat-head .outline { padding: 0 12px; }
  body.in-chat .side { display: none; }
}

/* ---------- dialogs: a bottom sheet on phones, a card on desktop ---------- */

dialog {
  position: fixed; inset: 0; margin: auto 0 0; width: 100%; max-width: none; max-height: 92dvh; overflow: auto; padding: 0;
  border: 0; border-radius: 26px 26px 0 0; background: var(--raised); color: var(--fg); box-shadow: var(--shadow-2);
  animation: sheet .28s cubic-bezier(.2, .85, .25, 1);
}
dialog::backdrop { background: rgba(6, 8, 18, .5); -webkit-backdrop-filter: blur(5px); backdrop-filter: blur(5px); animation: fade .2s ease-out; }
@keyframes sheet { from { transform: translateY(40px); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }
.dialog { display: flex; flex-direction: column; gap: 14px; padding: 12px 22px calc(22px + var(--safe-b)); }
.dialog::before { content: ""; align-self: center; width: 38px; height: 5px; border-radius: 3px; background: var(--line-strong); margin-bottom: 8px; } /* grabber */
.dialog h3 { font-size: 20px; }
.dialog h4 { margin-top: 8px; font-size: 14px; }
.dialog .actions { margin-top: 4px; }
.dialog .actions > * { flex: 1; }
.dialog .actions .spacer { flex: 0; }
.confirm { align-items: center; text-align: center; gap: 8px; }
.confirm h3 { overflow-wrap: anywhere; }
.confirm p { max-width: 22rem; overflow-wrap: anywhere; white-space: pre-line; }
.confirm .actions { width: 100%; margin-top: 14px; }
.notice { background: var(--accent-soft); border-radius: var(--radius-sm); padding: 12px 14px; font-size: 14px; }
.plist { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; }
.prow { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.prow:last-child { border-bottom: 0; }
.prow .name { font-weight: 600; }
.prow small { display: block; color: var(--mute); }
.codes { display: grid; grid-template-columns: 1fr; gap: 8px 14px; padding: 16px; border: 1px dashed var(--line-strong); border-radius: var(--radius-sm); background: var(--bg); font: 15px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; user-select: all; -webkit-user-select: all; }

/* the account menu */
.acct { gap: 16px; }
.acct-head { display: flex; align-items: center; gap: 14px; }
.acct-head .who strong { font-size: 18px; }
.menu { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; background: var(--surface); }
.menu-item { height: 54px; justify-content: flex-start; gap: 14px; padding: 0 16px; border: 0; border-radius: 0; background: none; color: var(--fg); font-weight: 550; border-bottom: 1px solid var(--line); text-align: left; }
.menu-item:last-child { border-bottom: 0; }
.menu-item:hover { background: var(--surface2); }
.menu-item span { flex: 1; text-align: left; }
.menu-item svg { color: var(--mute); }
.menu-item .chev { width: 16px; height: 16px; opacity: .6; }
.menu-item.danger, .menu-item.danger svg { color: var(--bad); }
.menu-item:focus-visible { box-shadow: inset 0 0 0 2px var(--accent); }
dialog:focus, dialog:focus-visible { outline: none; box-shadow: var(--shadow-2); }

/* ---------- toasts ---------- */

.toasts { position: fixed; z-index: 100; left: 0; right: 0; bottom: calc(var(--tab) + var(--safe-b) + 14px); display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 0 16px; pointer-events: none; }
body.in-chat .toasts { bottom: calc(80px + var(--safe-b)); }
.toast {
  pointer-events: auto; max-width: min(92vw, 30rem); padding: 12px 18px; border-radius: 16px; font-size: 14.5px; font-weight: 550; line-height: 1.35;
  color: var(--bg); background: var(--fg); box-shadow: var(--shadow-2); animation: toast-in .22s cubic-bezier(.2, .85, .25, 1);
}
.toast.error { background: var(--bad); color: #fff; }
.toast.out { opacity: 0; transform: translateY(8px); transition: opacity .2s, transform .2s; }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px) scale(.97); } }

/* ---------- desktop: a sidebar instead of the tab bar ---------- */

@media (min-width: 760px) {
  .app { display: grid; grid-template-columns: 272px minmax(0, 1fr); min-height: 100dvh; }
  .side {
    position: sticky; top: 0; left: auto; right: auto; bottom: auto; z-index: 5; height: 100dvh; flex-direction: column; align-items: stretch; gap: 4px;
    padding: 20px 14px 16px; border-top: 0; border-right: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 70%, transparent);
  }
  .side > a, .side > .tab { flex: none; flex-direction: row; justify-content: flex-start; gap: 12px; height: 44px; padding: 0 14px; font-size: 15px; border-radius: 12px; }
  .side > a svg { width: 21px; height: 21px; filter: none !important; }
  .side > a:hover { background: var(--surface2); color: var(--fg); }
  .side > a[aria-current="page"] { background: var(--accent-soft); color: var(--accent); }
  .tab { display: none !important; }
  .brand { display: flex; align-items: center; gap: 11px; padding: 4px 12px 22px; font-size: 19px; }
  .label { display: block; margin: 0 0 6px; padding: 0 14px; font-size: 11.5px; font-weight: 650; letter-spacing: .09em; text-transform: uppercase; color: var(--mute); opacity: .8; }
  .side .grow { display: block; }
  .dot { top: 50%; left: auto; right: 14px; transform: translateY(-50%); }
  .me {
    display: flex; align-items: center; gap: 12px; width: 100%; height: auto; padding: 10px 12px; font-weight: 400; text-align: left;
    background: var(--surface); border: 1px solid var(--line); border-radius: 16px; color: inherit; box-shadow: var(--shadow-1);
  }
  .me:hover { border-color: var(--line-strong); background: var(--surface2); }
  .me .who { flex: 1; }
  .me .chev { width: 16px; height: 16px; color: var(--mute); }

  .content { padding: 36px clamp(24px, 4vw, 56px) 48px; max-width: 1080px; width: 100%; }
  .head { margin-bottom: 24px; }
  .head h2 { font-size: 34px; }
  .bar { flex-direction: row; justify-content: space-between; align-items: flex-end; }
  .bar .actions { display: flex; }
  .bar .actions .primary { grid-column: auto; order: 3; height: 44px; }
  .bar .actions .outline { padding: 0 16px; }
  .crumbs { margin: 0 0 14px; padding: 0; }

  .item { grid-template-columns: 42px minmax(0, 1fr) 84px 176px; gap: 16px; padding: 10px 18px; min-height: 64px; position: relative; }
  .item .acts { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); padding-left: 28px; background: linear-gradient(90deg, transparent, var(--surface2) 24px); border-radius: 12px; }
  .item .sub { display: none; }
  .meta { display: block; }
  .meta { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
  .meta.size { color: var(--fg); opacity: .75; }
  .acts .icon-btn { width: 38px; height: 38px; }
  .act-view { display: inline-grid; }
  @media (hover: hover) {
    .item .acts { opacity: 0; transition: opacity .12s; }
    .item:hover .acts, .item:focus-within .acts { opacity: 1; }
    .item:hover { background: var(--surface2); }
  }

  .chat { grid-template-columns: 330px 1fr; height: calc(100dvh - 210px); min-height: 480px; }
  .chat-side { border-right: 1px solid var(--line); }
  .chat-head { padding-left: 18px; }
  .back { display: none; }
  .compose { padding-bottom: 12px; }

  dialog { inset: 0; margin: auto; width: min(460px, calc(100vw - 32px)); max-height: min(86dvh, 760px); border-radius: 24px; animation: pop .2s cubic-bezier(.2, .85, .25, 1); }
  dialog:has(.wide), dialog:has(.acct) { width: min(520px, calc(100vw - 32px)); }
  @keyframes pop { from { transform: translateY(10px) scale(.97); opacity: 0; } }
  .dialog { padding: 26px; }
  .dialog::before { display: none; }
  .dialog .actions > * { flex: 0 0 auto; }
  .confirm .actions > * { flex: 1; }
  .codes { grid-template-columns: 1fr 1fr; }
  .toasts { bottom: 28px; }
}

@media (hover: none) { .act-view { display: none !important; } } /* touch screens, even wide ones (iPad): no hover, so no hidden buttons */
@media (hover: none) and (min-width: 760px) { .item { grid-template-columns: 42px minmax(0, 1fr) 84px 176px auto; } .item .acts { position: static; transform: none; padding: 0; background: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { *, ::before, ::backdrop { animation: none !important; transition: none !important; } }

/* ---------- calls ---------- */

.avatar.xl { width: 120px; height: 120px; font-size: 48px; }
.msg.file { padding: 6px; white-space: normal; }
.filebtn { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 48px; padding: 6px 10px; border: 0; border-radius: 14px; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.filebtn:disabled { opacity: .6; }
.filebtn .ico svg { width: 24px; height: 24px; }
.fname { display: flex; flex-direction: column; min-width: 0; }
.fname strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 220px; }
.fname small { opacity: .75; }
.msg.file.shown { padding: 4px; }
.attach-img { display: block; max-width: 100%; max-height: 320px; border-radius: 16px; }
.compose .attach { flex: none; width: 44px; height: 44px; }
.msg.note { align-self: center; max-width: 90%; background: none; color: var(--mute); font-size: 13px; padding: 4px 10px; text-align: center; }
.call-start { color: var(--accent); }
.chat-head .call-start { width: 42px; height: 42px; }
.callslist { overflow: hidden; }
.peer-row { display: flex; align-items: center; gap: 12px; padding: 10px 14px 10px 18px; border-bottom: 1px solid var(--line); }
.peer-row:last-child { border-bottom: 0; }
.peer-row .pname { flex: 1; }
.peer-row > small { white-space: nowrap; }

.call { position: fixed; inset: 0; z-index: 80; display: flex; flex-direction: column; align-items: center; justify-content: center; overflow: hidden;
  background: radial-gradient(60rem 40rem at 50% -10%, #2a2d6b, #07080f 70%); color: #fff; }
.call-remote { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #000; opacity: 0; transition: opacity .3s; }
.call.video[data-mode="live"] .call-remote { opacity: 1; }
.call-center { display: grid; place-items: center; }
.call.video[data-mode="live"] .call-center { display: none; }
.call-top { position: absolute; top: max(22px, calc(var(--safe-t) + 14px)); left: 0; right: 0; display: flex; flex-direction: column; align-items: center; gap: 4px; text-shadow: 0 1px 10px rgba(0, 0, 0, .6); }
.call-top strong { font-size: 22px; letter-spacing: -.02em; }
.call-top span { font-size: 15px; opacity: .85; font-variant-numeric: tabular-nums; }
.call-local { position: absolute; z-index: 2; top: max(86px, calc(var(--safe-t) + 78px)); right: 14px; width: min(28vw, 130px); aspect-ratio: 3 / 4; object-fit: cover;
  border-radius: 16px; background: #111; box-shadow: 0 8px 24px rgba(0, 0, 0, .5); transform: scaleX(-1); }
.call-local.dim { opacity: .25; }
.call-controls { position: absolute; z-index: 3; left: 0; right: 0; bottom: 0; display: flex; justify-content: center; gap: 22px; padding: 20px 20px calc(32px + var(--safe-b)); }
.call-btn { width: 66px; height: 66px; padding: 0; border-radius: 50%; color: #fff; background: rgba(255, 255, 255, .16); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
.call-btn:hover:not(:disabled) { background: rgba(255, 255, 255, .26); }
.call-btn svg { width: 28px; height: 28px; }
.call-btn .off { display: none; }
.call-btn.off { background: #fff; color: #111; }
.call-btn.off .on { display: none; }
.call-btn.off .off { display: block; }
.call-btn.accept { background: #22c55e; }
.call-btn.end { background: #ef4444; }
.call-btn.end svg { transform: rotate(135deg); }
/* which buttons belong to which moment */
.call[data-mode="incoming"] #call-mute, .call[data-mode="incoming"] #call-cam { display: none; }
.call[data-mode="calling"] #call-accept, .call[data-mode="connecting"] #call-accept, .call[data-mode="live"] #call-accept { display: none; }
@media (min-width: 760px) { .call-btn { width: 72px; height: 72px; } .call-local { width: 180px; } }

/* ---------- home dashboard: every list is always on screen ---------- */

.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px; }
.stat { display: flex; flex-direction: column; gap: 2px; padding: 16px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-1); text-decoration: none; transition: border-color .15s, transform .08s; }
.stat:hover { border-color: var(--line-strong); }
.stat:active { transform: scale(.985); }
.stat small { color: var(--mute); font-size: 13px; font-weight: 550; }
.stat strong { font-size: 28px; letter-spacing: -.03em; font-variant-numeric: tabular-nums; line-height: 1.15; }
.stat span { color: var(--mute); font-size: 13px; }
.stat.hot strong { color: var(--accent); }
.home-grid { display: grid; grid-template-columns: 1fr; gap: 16px; }
.panel { overflow: hidden; }
.panel > header { display: flex; justify-content: space-between; align-items: center; padding: 16px 18px 8px; }
.panel h3 { font-size: 16px; }
.panel > header a { color: var(--accent); font-size: 14px; font-weight: 600; text-decoration: none; padding: 6px 0; }
.hrow { display: flex; align-items: center; gap: 12px; padding: 10px 18px; min-height: 60px; color: inherit; text-decoration: none; border-top: 1px solid var(--line); transition: background .12s; }
.hrow:hover { background: var(--surface2); }
.hrow .tile { width: 38px; height: 38px; border-radius: 12px; flex: none; }
.hrow .main { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 1.3; }
.hrow .main strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.hrow .main small { color: var(--mute); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13.5px; }
.hrow > small { color: var(--mute); white-space: nowrap; font-size: 12.5px; }
.hrow .dot.static { flex: none; }
.hempty { padding: 18px; border-top: 1px solid var(--line); color: var(--mute); font-size: 14px; }
@media (min-width: 760px) {
  .stats { grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 20px; }
  .home-grid { grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
}

/* team panel: who can use what */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.menu-item .state { color: var(--mute); font-size: 13px; font-weight: 600; }
.chip { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 16px; border-radius: 22px; border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--mute); font: inherit; font-weight: 600; cursor: pointer; }
.chip input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.chip:has(input:checked), .chip[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.chip:has(input:focus-visible), .chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.chip:disabled, .chip:has(input:disabled) { opacity: .5; cursor: default; }
.trow { display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; align-items: center; gap: 10px 12px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.trow:last-child { border-bottom: 0; }
.trow.off .tname strong { text-decoration: line-through; opacity: .7; }
.tname { display: flex; flex-direction: column; min-width: 0; }
.tname strong { overflow: hidden; text-overflow: ellipsis; }
.tname small { color: var(--mute); }
.trow .chips { grid-column: 1 / -1; }
.tacts { display: flex; align-items: center; gap: 8px; grid-column: 3; grid-row: 1; }
.outline.sm { height: 40px; padding: 0 14px; }
@media (min-width: 760px) { .trow { grid-template-columns: 42px minmax(0, 1fr) auto auto; } .trow .chips { grid-column: 3; grid-row: 1; } .tacts { grid-column: 4; } .chip { min-height: 36px; padding: 0 14px; } }

/* groups */
.avatar.group { background: var(--accent-soft); color: var(--accent); }
.avatar.group svg { width: 22px; height: 22px; }
.msg .who { display: block; margin-bottom: 1px; font-size: 12px; font-weight: 700; opacity: .75; }
.msg.event { align-self: center; max-width: 90%; background: none; color: var(--mute); font-size: 13px; padding: 4px 10px; text-align: center; }
.chat-title .icon-btn { width: 40px; height: 40px; margin: -8px -8px -8px 0; }
@media (max-width: 759px) { .item { gap: 10px; padding-right: 8px; } .item .acts .icon-btn { width: 40px; height: 40px; } } /* four row actions: leave the file name more room */

/* uploads */
.uploads { margin-bottom: 14px; overflow: hidden; }
.up { display: grid; grid-template-columns: minmax(0, 1fr) auto 40px; align-items: center; gap: 2px 10px; padding: 10px 8px 10px 16px; border-bottom: 1px solid var(--line); }
.up:last-child { border-bottom: 0; }
.upname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.upstate { color: var(--mute); font-size: 13px; font-variant-numeric: tabular-nums; }
.up.bad .upstate { color: var(--bad); font-weight: 600; }
.up progress { grid-column: 1 / -1; width: calc(100% - 8px); height: 6px; border: 0; border-radius: 3px; overflow: hidden; background: var(--surface2); accent-color: var(--accent); appearance: none; -webkit-appearance: none; }
.up progress::-webkit-progress-bar { background: var(--surface2); border-radius: 3px; }
.up progress::-webkit-progress-value { background: linear-gradient(90deg, var(--accent), var(--accent2)); border-radius: 3px; transition: width .15s; }
.up progress::-moz-progress-bar { background: var(--accent); border-radius: 3px; }

.search { margin-bottom: 12px; }
@media (min-width: 760px) { .search { max-width: 420px; } }

.prow .tile { width: 38px; height: 38px; border-radius: 12px; flex: none; }
.bar .actions:has(#open-trash) { grid-template-columns: 1fr 1fr 1fr; }
@media (max-width: 420px) { .bar .actions .outline { font-size: 14px; gap: 6px; } .bar .actions .outline svg { width: 18px; height: 18px; } }

/* browsing a shared folder */
.shareCard.browse { max-width: 560px; width: 100%; }
.scrumbs { align-self: stretch; text-align: left; display: flex; flex-wrap: wrap; gap: 4px 6px; font-size: 14px; color: var(--mute); overflow-wrap: anywhere; }
.scrumbs a { color: var(--accent); text-decoration: none; font-weight: 600; }
.sfiles { align-self: stretch; text-align: left; border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; }
.srow { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--line); margin: 0; }
.srow:last-child { border-bottom: 0; }
.sname { flex: 1; min-width: 0; display: flex; flex-direction: column; overflow-wrap: anywhere; color: var(--fg); text-decoration: none; font-weight: 600; }
.sname small { color: var(--mute); font-weight: 400; }
.srow button { width: auto; height: 44px; padding: 0 14px; font-size: 15px; flex: none; }
.sfiles p { padding: 14px; margin: 0; }

.tstore { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.tstore small { color: var(--mute); }
.tstore select.quota { width: auto; min-width: 130px; height: 40px; font-size: 16px; }
@media (min-width: 760px) { .tstore { grid-column: 2 / 4; } }

.self-start { align-self: flex-start; }

.audit { max-height: 260px; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.audit .prow small { color: var(--mute); }

.tmeta { grid-column: 1 / -1; color: var(--mute); margin-top: -4px; }
@media (min-width: 760px) { .tmeta { grid-column: 2 / -1; } }

.troles { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.troles select.role { width: auto; min-width: 120px; height: 44px; font-size: 16px; padding-right: 36px; }
@media (min-width: 760px) { .troles { grid-column: 2 / -1; } .troles select.role { height: 36px; } }

/* the Team page */
.team-grid { display: grid; grid-template-columns: 1fr; gap: 16px; align-items: start; }
.team-grid .card.panel { overflow: hidden; }
.pbody { display: flex; flex-direction: column; gap: 12px; padding: 0 18px 18px; }
.pbody h4 { margin-top: 6px; }
.team-grid .plist { border: 0; border-radius: 0; border-top: 1px solid var(--line); }
.team-grid .plist:empty { display: none; }
.pbody + .plist { margin-top: 0; }
@media (min-width: 900px) { .team-grid { grid-template-columns: 1fr 1fr; gap: 20px; } .team-grid .wide { grid-column: 1 / -1; } }

/* message menu and chat search */
.msg.tap { cursor: pointer; }
.msg.tap:focus-visible, .msgmenu:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.msgmenu { position: relative; border: 0; background: none; color: inherit; opacity: .7; width: 40px; height: 40px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; margin-left: auto; flex: none; cursor: pointer; }
.msg.file { display: flex; align-items: center; gap: 2px; }
.msg.file .filebtn { flex: 1; width: auto; min-width: 0; }
.msg-preview { margin: 0; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--surface2); max-height: 30vh; overflow: auto; overflow-wrap: anywhere; white-space: pre-wrap; }
.dialog .actions.col { flex-direction: column; }
.dialog .actions.col > * { flex: none; width: 100%; height: 48px; }
.chatsearch-wrap { padding: 0 14px 8px; }
.chatsearch { height: 44px; margin: 0; }
.results { display: flex; flex-direction: column; }
.peer.hit .when { color: var(--mute); font-size: 12px; white-space: nowrap; }

/* admin pages: on phones one Admin tab plus a switcher at the top of each page */
.admin-tabs { display: flex; gap: 6px; padding: 4px; margin-bottom: 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.admin-tabs a { flex: 1; text-align: center; padding: 10px 6px; border-radius: 10px; color: var(--mute); font-weight: 600; text-decoration: none; min-height: 44px; display: flex; align-items: center; justify-content: center; }
.admin-tabs a[aria-current="true"] { background: var(--accent-soft); color: var(--accent); }
@media (max-width: 759px) { .side > a[data-route="backup"], .side > a[data-route="activity"], .admin-label { display: none !important; } }
@media (min-width: 760px) { .admin-tabs { display: none; } }
.admin-label { margin-top: 10px; }

/* the activity log */
#audit-filters { margin-bottom: 14px; }
.alog-card { overflow: hidden; margin-bottom: 14px; }
.aday { margin: 0; padding: 14px 18px 6px; font-size: 13px; letter-spacing: .02em; color: var(--mute); text-transform: uppercase; background: var(--surface2); }
.arow { display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 12px; padding: 10px 18px; border-bottom: 1px solid var(--line); line-height: 1.45; }
.arow:last-child { border-bottom: 0; }
.atime { color: var(--mute); font-variant-numeric: tabular-nums; font-size: 14px; }
.atext { overflow-wrap: anywhere; }
.arow.k-security .atext strong, .arow.k-security .atext { }
.arow.k-security { box-shadow: inset 3px 0 0 var(--bad); }
.arow.k-signin { box-shadow: inset 3px 0 0 var(--accent); }
.arow.k-sharing { box-shadow: inset 3px 0 0 #d9a21b; }
.arow.k-backup { box-shadow: inset 3px 0 0 #2e9e6a; }
.arow.k-server { box-shadow: inset 3px 0 0 var(--line-strong); }

.icon-btn.timer.on { color: var(--accent); background: var(--accent-soft); }


/* =====================================================================
   The polish layer: aurora backdrop, big titles, tiles, status banners,
   illustrations, a timeline, and a little motion.
   ===================================================================== */

body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(56rem 34rem at 4% -8%, color-mix(in srgb, var(--accent) 24%, transparent), transparent 62%),
    radial-gradient(48rem 32rem at 104% -4%, color-mix(in srgb, var(--accent2) 20%, transparent), transparent 64%),
    radial-gradient(40rem 26rem at 62% 112%, color-mix(in srgb, var(--ok) 9%, transparent), transparent 62%);
}

.head h2 {
  font-size: clamp(32px, 6.4vw, 44px); font-weight: 800; letter-spacing: -.04em; width: fit-content; max-width: 100%;
  background: linear-gradient(100deg, var(--fg) 0%, var(--fg) 38%, var(--accent) 78%, var(--accent2) 100%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: transparent;
}
.head p.muted { font-size: 15.5px; max-width: 46rem; }

/* things rise into place when a page opens */
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes floaty { 50% { transform: translateY(-7px); } }
@keyframes glow { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--tone, var(--accent)) 45%, transparent); } 100% { box-shadow: 0 0 0 22px transparent; } }
[data-view]:not([hidden]) > * { animation: rise .55s cubic-bezier(.2, .8, .2, 1) both; }
[data-view]:not([hidden]) > *:nth-child(2) { animation-delay: 60ms; }
[data-view]:not([hidden]) > *:nth-child(3) { animation-delay: 120ms; }
[data-view]:not([hidden]) > *:nth-child(4) { animation-delay: 180ms; }
[data-view]:not([hidden]) > *:nth-child(n+5) { animation-delay: 240ms; }
@media (prefers-reduced-motion: reduce) { [data-view]:not([hidden]) > * { animation: none; } .art { animation: none !important; } }

/* cards feel a little more alive */
.card { box-shadow: var(--shadow-1), 0 18px 40px -26px color-mix(in srgb, var(--accent) 38%, rgba(14, 17, 32, .5)); }
@media (prefers-color-scheme: dark) { .card, .fact, .status { background-image: linear-gradient(180deg, rgba(255, 255, 255, .035), transparent 55%); } }
.item, .trow, .prow, .arow { transition: background .15s; }
.item:hover, .trow:hover { background: color-mix(in srgb, var(--accent) 4%, transparent); }
.outline:hover:not(:disabled) { border-color: color-mix(in srgb, var(--accent) 50%, var(--line-strong)); }
.primary { background-size: 160% 100%; background-position: 0 0; transition: background-position .35s, box-shadow .2s, transform .08s; }
.primary:hover:not(:disabled) { background-position: 100% 0; }

/* tiles */
.tone-a { --tone: var(--accent); } .tone-g { --tone: var(--ok); } .tone-y { --tone: #e0a526; } .tone-r { --tone: var(--bad); } .tone-c { --tone: #1fb5c9; }
.hero { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
@media (min-width: 760px) { .hero { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; } }
.fact {
  position: relative; overflow: hidden; display: flex; align-items: center; gap: 12px; padding: 14px; min-width: 0;
  border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line);
  box-shadow: var(--shadow-1), 0 14px 30px -22px color-mix(in srgb, var(--tone) 70%, transparent);
}
.fact::after { content: ""; position: absolute; right: -34px; top: -34px; width: 120px; height: 120px; border-radius: 50%; pointer-events: none;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--tone) 22%, transparent), transparent); }
.fact.wide { grid-column: span 2; }
.tico { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 15px; flex: none; position: relative; z-index: 1;
  color: var(--tone); background: color-mix(in srgb, var(--tone) 15%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--tone) 22%, transparent); }
.tico svg { width: 22px; height: 22px; }
.ttext { display: flex; flex-direction: column; min-width: 0; flex: 1; position: relative; z-index: 1; }
.ttext small { color: var(--mute); font-size: 12.5px; font-weight: 650; letter-spacing: .01em; }
.ttext strong { font-size: 27px; font-weight: 780; letter-spacing: -.035em; font-variant-numeric: tabular-nums; line-height: 1.12; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tsub { color: var(--mute); font-size: 12.5px; }
.meter { display: block; height: 7px; margin-top: 9px; border-radius: 4px; background: color-mix(in srgb, var(--tone) 14%, var(--surface2)); overflow: hidden; }
.meter i { display: block; width: 2%; height: 100%; border-radius: 4px; background: linear-gradient(90deg, var(--tone), color-mix(in srgb, var(--tone) 50%, #fff)); transition: width 1.1s cubic-bezier(.2, .8, .2, 1); }

/* status banner (Backup) */
.status {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding: 18px; margin-bottom: 18px; border-radius: var(--radius);
  border: 1px solid color-mix(in srgb, var(--tone) 38%, var(--line));
  background: linear-gradient(135deg, color-mix(in srgb, var(--tone) 15%, var(--surface)), var(--surface) 70%);
  box-shadow: var(--shadow-1), 0 22px 44px -30px color-mix(in srgb, var(--tone) 80%, transparent);
}
.status h3 { font-size: 21px; letter-spacing: -.03em; margin-bottom: 3px; }
.status p { color: var(--mute); }
.status .grow { min-width: 200px; }
.status .shield { display: grid; place-items: center; width: 68px; height: 68px; border-radius: 22px; flex: none; color: var(--tone);
  background: color-mix(in srgb, var(--tone) 16%, transparent); animation: glow 2.4s ease-out infinite; }
.status.tone-y .shield { animation: none; filter: grayscale(.5) saturate(1.4) hue-rotate(-30deg); }
.status .primary { margin-left: auto; }
@media (max-width: 759px) { .status .primary { width: 100%; margin-left: 0; height: 48px; } }
.art.small { width: 44px; height: 44px; margin: 0; animation: none; filter: none; }
.art.small svg { width: 100%; height: 100%; }

/* illustrations */
.art { width: min(210px, 62%); margin: 0 auto 6px; animation: floaty 6s ease-in-out infinite; filter: drop-shadow(0 20px 28px color-mix(in srgb, var(--accent) 34%, transparent)); }
.art svg { display: block; width: 100%; height: auto; }
.empty-row.wow { padding: 38px 20px 44px; gap: 8px; }
.empty-row.wow strong, .chat-empty.wow h3 { font-size: 20px; letter-spacing: -.02em; }
.empty-row.wow span:not(.badge) { max-width: 26rem; }
.empty-row.wow .primary, .chat-empty.wow .primary { margin-top: 12px; height: 48px; padding: 0 22px; }
.chat-empty.wow { gap: 8px; }

/* the activity timeline */
.arow { grid-template-columns: 34px 50px minmax(0, 1fr); align-items: start; box-shadow: none !important; position: relative; }
.arow::before { content: ""; position: absolute; left: 34px; top: 0; bottom: 0; width: 2px; background: var(--line); }
.arow:first-of-type::before { top: 24px; }
.adot { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; position: relative; z-index: 1; color: var(--tone);
  background: color-mix(in srgb, var(--tone) 16%, var(--surface)); box-shadow: 0 0 0 4px var(--surface), inset 0 0 0 1px color-mix(in srgb, var(--tone) 30%, transparent); }
.adot svg { width: 15px; height: 15px; }
.atext strong { font-weight: 700; }
.alog-card .arow { padding: 11px 18px 11px 14px; }
.aday { position: sticky; top: 0; z-index: 2; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }

/* the chat list and call rows get a little more presence */
.peer { border-radius: 14px; margin: 2px 8px; padding: 10px 12px; }
.peer.on { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 35%, transparent); }
.avatar { box-shadow: 0 6px 16px -6px color-mix(in srgb, var(--accent) 70%, transparent); }

.danger-card { border-color: color-mix(in srgb, var(--bad) 28%, var(--line)); }
.danger-card .panel > header h3, .danger-card header h3 { color: var(--bad); }

/* group calls */
.call-grid { position: absolute; inset: 0; z-index: 1; display: grid; gap: 8px; padding: max(104px, calc(var(--safe-t) + 96px)) 10px calc(130px + var(--safe-b)); grid-template-columns: 1fr; grid-auto-rows: minmax(0, 1fr); background: #0b0c12; }
.call-grid[data-count="2"] { grid-template-rows: repeat(2, minmax(0, 1fr)); }
.call-grid[data-count="3"], .call-grid[data-count="4"] { grid-template-columns: 1fr 1fr; grid-template-rows: repeat(2, minmax(0, 1fr)); }
.call-grid[data-count="5"], .call-grid[data-count="6"] { grid-template-columns: 1fr 1fr; grid-template-rows: repeat(3, minmax(0, 1fr)); }
@media (min-width: 760px) {
  .call-grid { grid-template-columns: 1fr 1fr; padding-top: 90px; }
  .call-grid[data-count="1"] { grid-template-columns: 1fr; }
  .call-grid[data-count="2"] { grid-template-rows: 1fr; }
  .call-grid[data-count="5"], .call-grid[data-count="6"] { grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(2, minmax(0, 1fr)); }
}
.gtile { position: relative; overflow: hidden; border-radius: 18px; background: linear-gradient(135deg, #1a1d2b, #121420); min-height: 0; }
.gtile video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.gtile.novideo video { opacity: 0; }
.gavatar { position: absolute; inset: 0; margin: auto; width: 76px; height: 76px; border-radius: 50%; display: none; place-items: center; font-size: 32px; font-weight: 700; color: #fff; background: linear-gradient(135deg, var(--accent), var(--accent2)); box-shadow: 0 12px 30px -10px rgba(0, 0, 0, .6); }
.gtile.novideo .gavatar { display: grid; }
.gname { position: absolute; left: 10px; bottom: 8px; padding: 3px 10px; border-radius: 999px; font-size: 13px; font-weight: 650; color: #fff; background: rgba(0, 0, 0, .45); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.call.group .call-remote, .call.group .call-center, .call.group .call-local { display: none !important; }
.call.group[data-mode="incoming"] .call-center { display: grid !important; }
.call.group .call-top { z-index: 3; text-shadow: 0 2px 12px rgba(0, 0, 0, .6); }

/* the Backup page: four cards of the same size, each with its own icon and a button at the bottom */
.bk-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-items: stretch; }
@media (min-width: 900px) { .bk-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; } }
.bk-card { display: flex; flex-direction: column; overflow: hidden; padding: 0; }
.cardhead { display: flex; align-items: center; gap: 14px; padding: 18px 18px 10px; }
.cardhead h3 { font-size: 18px; letter-spacing: -.02em; }
.cardhead p { color: var(--mute); font-size: 13.5px; margin-top: 2px; }
.chico { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 15px; flex: none; color: var(--tone);
  background: color-mix(in srgb, var(--tone) 15%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--tone) 24%, transparent); }
.chico svg { width: 22px; height: 22px; }
.bk-card .pbody { flex: 1; display: flex; flex-direction: column; gap: 12px; padding: 4px 18px 18px; }
.bk-card form.stack { flex: 1; display: flex; flex-direction: column; gap: 12px; }
.bk-card .actions.foot { margin-top: auto; padding-top: 4px; }
.bk-card .actions.foot > * { width: 100%; height: 48px; }
.bk-card #replace-pick { width: 100%; height: 48px; border-style: dashed; }
.bk-card .plist { border: 1px solid var(--line); border-radius: var(--radius-sm); }
.danger-card { border-color: color-mix(in srgb, var(--bad) 30%, var(--line)); }
.danger-card .cardhead h3 { color: var(--bad); }

/* Teams: a switcher between "My files" and each team's shared folder */
.spaces { display: flex; gap: 8px; overflow-x: auto; margin: 0 -16px 14px; padding: 2px 16px; scrollbar-width: none; }
.spaces::-webkit-scrollbar { display: none; }
.spaces a { flex: none; display: inline-flex; align-items: center; min-height: 44px; padding: 0 18px; border-radius: 22px; border: 1px solid var(--line-strong);
  color: var(--mute); text-decoration: none; font-weight: 600; background: var(--surface); }
.spaces a[aria-current="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.chico.sm { width: 38px; height: 38px; border-radius: 12px; }
.chico.sm svg { width: 18px; height: 18px; }
.keywarn { color: var(--bad); font-weight: 600; }

/* selecting several files */
.selbar { position: sticky; top: calc(var(--safe-t) + 8px); z-index: 5; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 12px; margin-bottom: 12px;
  border-radius: var(--radius); border: 1px solid var(--accent); background: color-mix(in srgb, var(--accent) 12%, var(--surface)); box-shadow: var(--shadow-1); }
.selbar[hidden] { display: none; }
.selbar strong { margin-right: auto; }
.selbar button { min-height: 44px; }
.picking .item { cursor: pointer; }
.picking .item .acts { visibility: hidden; }
.item .tile { position: relative; cursor: pointer; }
/* the icon turns into a checkbox when you point at it (or while selecting) */
.item .tile::after { content: ""; position: absolute; inset: 0; border-radius: 13px; box-sizing: border-box; display: grid; place-items: center;
  background: var(--surface); border: 2px solid var(--line-strong); opacity: 0; transition: opacity .12s; font-size: 22px; font-weight: 700; line-height: 1; color: #fff; }
@media (hover: hover) { .item:hover .tile::after { opacity: 1; } }
.picking .item .tile::after { opacity: 1; }
.picking .item.picked { background: var(--accent-soft); }
.item.picked .tile::after, .picking .item.picked .tile::after { content: "✓"; opacity: 1; background: var(--accent); border-color: var(--accent); }

.callbar { background: var(--accent-soft); flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: space-between; }
.callbar[hidden] { display: none; }
.callbar .join-call { min-height: 44px; }

#hist-list { max-height: 50vh; overflow-y: auto; border: 1px solid var(--line); border-radius: var(--radius-sm); }
#hist-list[hidden], #hist-empty[hidden] { display: none; }
@media (max-width: 759px) {
  .selbar { gap: 8px; padding: 12px; }
  .selbar strong { flex: 1 0 100%; }
  .selbar button { flex: 1 1 0; padding: 0 8px; }
}

/* People page */
.people .prow { gap: 12px; padding: 12px 16px; min-height: 68px; }
.people .prow.off .name { opacity: .7; }
.people .prow .btn { min-height: 44px; display: inline-flex; align-items: center; gap: 8px; padding: 0 16px; white-space: nowrap; }
.people .prow .btn.disabled, .people .prow .icon-btn:disabled { opacity: .4; pointer-events: none; }
.people .prow small { color: var(--mute); }
@media (max-width: 759px) { .people .prow .btn > span:not(.ico) { display: none; } .people .prow .btn { padding: 0; width: 44px; justify-content: center; } }
.people .prow .btn { text-decoration: none; }
.people .prow .btn svg { flex: none; width: 20px; height: 20px; }
