/* oblakche — интерфейсна тема */

:root {
  --bg: #eef2f9;
  --bg-tint: none;
  --surface: #ffffff;
  --surface-soft: #f6f8fc;
  --surface-sunk: #f1f4fa;

  --text: #232a38;
  --text-soft: #4d5769;
  --muted: #68758b;
  --faint: #aab3c3;

  --line: #e9edf4;
  --line-soft: #f1f4f9;

  --primary: #1f6dff;
  --primary-strong: #1348d8;
  --primary-sky: #42a5ff;
  --primary-soft: #e6efff;
  --primary-tint: #f2f7ff;

  --ink: #0d1b3e;
  --hero: #183f82;

  --success: #2f9f79;
  --success-soft: #e6f6f0;
  --danger: #e0687a;
  --danger-soft: #fdeef1;
  --amber: #efb04b;
  --amber-soft: #fdf3e0;
  --teal: #40a89b;
  --teal-soft: #e6f5f3;

  --shadow-xs: 0 1px 2px rgba(13, 27, 62, .05);
  --shadow-sm: 0 1px 2px rgba(13, 27, 62, .04), 0 3px 10px rgba(13, 27, 62, .05);
  --shadow: 0 1px 2px rgba(13, 27, 62, .03), 0 10px 30px rgba(13, 27, 62, .07);
  --shadow-lg: 0 4px 14px rgba(13, 27, 62, .06), 0 28px 64px rgba(13, 27, 62, .12);
  --shadow-primary: 0 6px 18px rgba(31, 109, 255, .30);
  --shadow-hero: 0 22px 52px rgba(13, 27, 62, .30);

  --r-xs: 11px;
  --r-sm: 14px;
  --r: 20px;
  --r-lg: 28px;

  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
}

* { box-sizing: border-box; }
/* Правилата за display по-долу иначе надделяват над атрибута hidden. */
[hidden] { display: none !important; }
html, body { margin: 0; min-height: 100%; }
body {
  font-size: 16px;
  line-height: 1.5;
  color: var(--text);
  background-color: var(--bg);
  background-image: var(--bg-tint);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; transition: color .15s ease; }
a:hover { color: var(--primary-strong); }
button, input, select { font: inherit; }
button { cursor: pointer; }
h1, h2, h3 { letter-spacing: -.02em; }
.icon { display: block; width: 20px; height: 20px; flex: 0 0 auto; }
.muted { color: var(--muted); }
.grow { min-width: 0; flex: 1; }

:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 6px; }
.button:focus-visible, .icon-button:focus-visible, .nav-link:focus-visible { outline-offset: 3px; }
input:focus-visible, select:focus-visible { outline: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ---------- Скелет ---------- */

.app-shell { display: grid; grid-template-columns: 272px minmax(0, 1fr); gap: 0; min-height: 100vh; padding: 14px; }

.sidebar {
  position: sticky; top: 14px; z-index: 30;
  display: flex; flex-direction: column;
  height: calc(100vh - 28px); padding: 22px 16px 16px;
  border-radius: var(--r-lg);
  color: var(--text-soft);
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow-y: auto;
}

.brand { display: flex; align-items: center; gap: 10px; padding: 2px 6px 26px; color: var(--ink); font-size: 19px; font-weight: 750; letter-spacing: -.035em; }
.brand:hover { color: var(--text); }
.brand-mark { display: block; width: 42px; height: auto; flex: 0 0 auto; }
.brand-mark-lg { width: 72px; }
.brand-logo { display: block; width: 100%; max-width: 260px; height: auto; }
.brand-name { font-weight: 700; letter-spacing: -.03em; }


/* ---------- Превключвател на фирма ---------- */

.company-switch, .company-current { display: block; margin-bottom: 18px; }
.company-switch summary, .company-current {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 11px; border-radius: var(--r-sm);
  background: var(--surface-soft); list-style: none; cursor: pointer;
  transition: background .15s ease, box-shadow .15s ease;
}
.company-current { cursor: default; }
.company-switch summary::-webkit-details-marker { display: none; }
.company-switch summary:hover { background: var(--bg); }
.company-switch[open] summary { background: var(--primary-soft); box-shadow: inset 0 0 0 1px rgba(31, 109, 255, .16); }
.company-switch summary > .icon { width: 17px; height: 17px; color: var(--muted); transform: rotate(90deg); transition: transform .18s ease; }
.company-switch[open] summary > .icon { transform: rotate(-90deg); color: var(--primary); }

.company-avatar {
  display: inline-grid; place-items: center; width: 34px; height: 34px; flex: 0 0 auto;
  border-radius: 11px; color: #fff; font-size: 14px; font-weight: 700; line-height: 1;
  background: var(--primary);
}
.company-avatar.small { width: 26px; height: 26px; border-radius: 9px; font-size: 11px; }

.company-switch-copy { min-width: 0; flex: 1; }
.company-switch-copy strong, .company-switch-copy span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.company-switch-copy strong { color: var(--ink); font-size: 13.5px; font-weight: 650; }
.company-switch-copy span { margin-top: 2px; color: var(--muted); font-size: 11px; }

.company-menu { display: flex; flex-direction: column; gap: 2px; margin-top: 6px; padding: 6px; border-radius: var(--r-sm); background: var(--surface-soft); }
.company-menu form { display: block; }
.company-menu button {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 8px 9px; border: 0; border-radius: var(--r-xs);
  color: var(--text-soft); font-size: 13px; font-weight: 550; text-align: left;
  background: transparent; transition: background .15s ease, color .15s ease;
}
.company-menu button:hover { color: var(--text); background: var(--surface); }
.company-menu button.is-active { color: var(--primary-strong); font-weight: 650; background: var(--surface); box-shadow: var(--shadow-xs); }

.nav { display: flex; flex-direction: column; gap: 3px; }
.nav-link {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 12px; border-radius: var(--r-sm);
  color: var(--text-soft); font-size: 14px; font-weight: 550;
  transition: background .15s ease, color .15s ease;
}
.nav-link > .icon { width: 19px; height: 19px; color: var(--muted); transition: color .15s ease; }
.nav-link:hover { color: var(--text); background: var(--surface-soft); }
.nav-link:hover > .icon { color: var(--text-soft); }
.nav-link.is-active { color: var(--primary-strong); font-weight: 650; background: var(--primary-soft); box-shadow: inset 0 0 0 1px rgba(31, 109, 255, .14); }
.nav-link.is-active > .icon { color: var(--primary); }
.nav-label { padding: 22px 12px 7px; color: var(--faint); font-size: 10px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }

.sidebar-foot { margin-top: auto; padding-top: 22px; }

.sidebar-card {
  display: block;
  padding: 16px; border-radius: var(--r-sm);
  color: var(--text-soft);
  background: var(--primary-soft);
  transition: background .15s ease, color .15s ease;
}
.sidebar-card:hover { color: var(--text-soft); background: var(--surface-soft); }
.sidebar-card > span { display: grid; place-items: center; width: 34px; height: 34px; margin-bottom: 11px; border-radius: 12px; color: var(--primary-strong); background: var(--surface-glass); }
.sidebar-card > span .icon { width: 18px; height: 18px; }
.sidebar-card strong { display: block; margin-bottom: 4px; color: var(--text); font-size: 13px; font-weight: 650; }
.sidebar-card p { margin: 0; font-size: 11.5px; line-height: 1.5; }

.sidebar-user {
  margin-top: 12px; display: flex; align-items: center; gap: 10px;
  padding: 10px; border-radius: var(--r-sm); background: var(--surface-soft);
}
.sidebar-user-copy { min-width: 0; flex: 1; }
.sidebar-user-copy strong, .sidebar-user-copy span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-user-copy strong { font-size: 13px; font-weight: 650; }
.sidebar-user-copy span { margin-top: 2px; color: var(--muted); font-size: 11px; }

.sidebar-backdrop { display: none; }

.main { min-width: 0; padding: 0 26px 48px; }

.topbar {
  position: sticky; top: 0; z-index: 15;
  display: flex; align-items: center; gap: 16px;
  min-height: 80px; margin: 0 -26px 22px -26px; padding: 16px 26px;
  background: var(--topbar-bg);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
}
.topbar h1 { margin: 0; font-size: 31px; font-weight: 700; letter-spacing: -.035em; }
.topbar-copy { min-width: 0; flex: 1; }
.topbar-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.eyebrow { margin: 4px 0 0; color: var(--muted); font-size: 12.5px; font-weight: 450; letter-spacing: 0; text-transform: none; }
.page-content { width: 100%; max-width: 1200px; margin-inline: auto; display: flex; flex-direction: column; gap: 20px; }
@media (min-width: 1001px) {
  .topbar { width: 100%; max-width: 1200px; margin: 0 auto 22px; padding-inline: 0; }
}
.menu-button {
  display: none; width: 42px; height: 42px; padding: 0;
  border: 0; border-radius: var(--r-sm); color: var(--text-soft);
  background: var(--surface); box-shadow: var(--shadow-sm);
}
.menu-button .icon { width: 20px; height: 20px; margin: auto; }

/* ---------- Панели ---------- */

.panel { padding: 24px; border: 0; border-radius: var(--r); background: var(--surface); box-shadow: var(--shadow); }
.panel h2 { margin: 0; font-size: 19px; font-weight: 680; letter-spacing: -.025em; }
.panel-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.panel-header > div { flex: 1 1 160px; min-width: 0; }

.hero {
  position: relative; overflow: hidden;
  display: flex; align-items: center; justify-content: space-between; gap: 40px;
  padding: 38px 42px; border-radius: var(--r-lg);
  color: #fff; background: var(--hero); box-shadow: var(--shadow-hero);
}
.hero::before {
  position: absolute; inset: 0; content: "";
  background: none;
}
.hero::after {
  position: absolute; inset: 0; border-radius: inherit; pointer-events: none; content: "";
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18);
}
.hero > * { position: relative; z-index: 1; }
.hero-copy { min-width: 0; }
.hero-eyebrow { margin: 0 0 8px; color: #9dc0f5; font-size: 12.5px; font-weight: 600; letter-spacing: .02em; }
.hero h2 { margin: 0; font-size: 36px; font-weight: 750; letter-spacing: -.04em; line-height: 1.1; }
.hero-note { margin: 12px 0 0; color: #c6d9f4; font-size: 14px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.hero .button-light { color: var(--ink); background: var(--surface); box-shadow: 0 8px 20px rgba(3, 18, 48, .28); }
.hero .button-light:hover { color: var(--ink); background: var(--surface-soft); }
.hero .button-outline { color: #fff; background: rgba(255, 255, 255, .12); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .3); }
.hero .button-outline:hover { color: #fff; background: rgba(255, 255, 255, .2); }

.meter { position: relative; display: grid; place-items: center; width: 168px; height: 168px; flex: 0 0 auto; }
.meter svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.meter circle { fill: none; stroke-linecap: round; }
.meter .meter-track { stroke: rgba(255, 255, 255, .2); }
.meter .meter-value { stroke: url(#meterFill); transition: stroke-dashoffset .8s ease; }
.meter-copy { position: absolute; display: grid; place-items: center; text-align: center; }
.meter-copy strong { font-size: 30px; font-weight: 750; letter-spacing: -.04em; line-height: 1; }
.meter-copy span { margin-top: 6px; color: #b7cfee; font-size: 11.5px; font-weight: 500; }

.hero-figures { display: flex; gap: 30px; flex: 0 0 auto; }
.hero-figure strong { display: block; font-size: 27px; font-weight: 720; letter-spacing: -.035em; }
.hero-figure span { display: block; margin-top: 5px; color: #a9c6ea; font-size: 12px; }

/* ---------- Статистики ---------- */

.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 16px; }
.stat-card {
  position: relative; overflow: hidden;
  display: flex; flex-direction: column; align-items: flex-start; gap: 14px;
  padding: 22px; border: 0; border-radius: var(--r); background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.stat-card::after {
  position: absolute; inset: 0; border-radius: inherit; pointer-events: none; content: "";
  box-shadow: inset 0 0 0 1px transparent; transition: box-shadow .2s ease;
}
.stat-card div > strong, .stat-card div > span { display: block; }
.stat-card strong { font-size: 32px; font-weight: 700; letter-spacing: -.035em; }
.stat-card div > span { margin-top: 3px; color: var(--muted); font-size: 12.5px; }
.stat-icon { display: inline-grid; place-items: center; width: 44px; height: 44px; flex: 0 0 auto; border-radius: 14px; }
.stat-icon .icon { width: 22px; height: 22px; }
.stat-icon.purple { color: var(--primary); background: var(--primary-soft); }
.stat-icon.blue { color: var(--teal); background: var(--teal-soft); }
.stat-icon.green { color: var(--success); background: var(--success-soft); }
.stat-icon.amber { color: var(--amber-strong); background: var(--amber-soft); }

/* ---------- Мрежи и карти ---------- */

.content-grid { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(300px, .85fr); gap: 20px; align-items: start; }
.folder-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(244px, 1fr)); gap: 16px; }
.folder-grid.compact { grid-template-columns: repeat(auto-fill, minmax(178px, 1fr)); }

.folder-card {
  display: flex; flex-direction: column; gap: 9px; min-width: 0;
  padding: 18px; border: 0; border-radius: var(--r-sm);
  color: var(--text); background: var(--surface-soft);
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.folder-card:hover { color: var(--text); background: var(--surface); border-color: var(--line-hover); }
.folder-card strong { font-size: 14px; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.folder-card small { overflow: hidden; color: var(--muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.folder-card.roomy { gap: 11px; padding: 22px; border-radius: var(--r); background: var(--surface); box-shadow: var(--shadow-sm); }
.folder-card.roomy:hover { background: var(--surface-soft); border-color: var(--line-hover); }
.folder-card.roomy > div { min-width: 0; width: 100%; }
.folder-card.roomy strong, .folder-card.roomy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.folder-card.roomy strong { font-size: 15px; }
.folder-card.roomy .folder-icon { width: 46px; height: 46px; border-radius: 15px; }
.folder-card.roomy .folder-icon .icon { width: 23px; height: 23px; }

.folder-icon { display: inline-grid; place-items: center; width: 42px; height: 42px; flex: 0 0 auto; border-radius: 14px; color: var(--amber-strong); background: var(--amber-soft); }
.folder-icon .icon { width: 22px; height: 22px; }
.folder-icon.large { width: 44px; height: 44px; }
.folder-icon.large .icon { width: 23px; height: 23px; }
.folder-icon.hero-icon { width: 62px; height: 62px; border-radius: 20px; }
.folder-icon.hero-icon .icon { width: 30px; height: 30px; }

/* ---------- Активност ---------- */

.activity-list { display: flex; flex-direction: column; gap: 2px; }
.activity-item { display: flex; align-items: flex-start; gap: 12px; padding: 11px 10px; border-radius: var(--r-sm); transition: background .15s ease; }
.activity-item > div { min-width: 0; }
.activity-item strong { font-size: 13.5px; font-weight: 650; }
.activity-item p { margin: 2px 0 0; color: var(--text-soft); font-size: 12.5px; line-height: 1.45; }
.activity-item small { display: block; margin-top: 4px; color: var(--faint); font-size: 11.5px; }

/* ---------- Форми ---------- */

.split-layout { display: flex; align-items: flex-start; gap: 20px; }
.split-layout > * { min-width: 0; }
.form-panel { width: 340px; flex: 0 0 340px; position: sticky; top: 104px; }
.form-panel h2 { margin-bottom: 0; }
.form-panel > .eyebrow { margin: 5px 0 22px; }
.stack-form { display: flex; flex-direction: column; gap: 15px; }

label { display: flex; flex-direction: column; gap: 7px; color: var(--text-soft); font-size: 12.5px; font-weight: 600; }
.label-row { display: flex; align-items: baseline; gap: 7px; }
input, select {
  width: 100%; min-height: 44px; padding: 10px 13px;
  border: 1px solid transparent; border-radius: var(--r-xs);
  color: var(--text); background: var(--surface-sunk);
  outline: none; transition: background .15s ease, border-color .15s ease, box-shadow .15s ease;
}
input::placeholder { color: var(--faint); }
input:hover, select:hover { background: var(--input-hover); }
input:focus, select:focus { border-color: var(--primary-line); background: var(--surface); box-shadow: 0 0 0 4px rgba(37, 99, 235, .13); }
.label-note { color: var(--faint); font-size: 11px; font-weight: 500; }

/* ---------- Бутони ---------- */

.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 11px 19px;
  border: 1px solid transparent; border-radius: 12px;
  font-size: 13.5px; font-weight: 600; letter-spacing: -.005em;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.button .icon { width: 17px; height: 17px; }
.button-primary { color: #fff; background: var(--action-bg); box-shadow: var(--shadow-primary); }
.button-primary:hover { color: #fff; background: var(--action-hover); }
.button-light { color: var(--primary-strong); background: var(--surface); box-shadow: var(--shadow-sm); }
.button-light:hover { color: var(--primary-strong); background: var(--surface-soft); }
.button-ghost { color: var(--text-soft); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line), var(--shadow-xs); }
.button-ghost:hover { color: var(--text); background: var(--surface-soft); border-color: var(--line-hover); }
.button-danger { color: var(--danger); background: var(--danger-soft); }
.button-danger:hover { color: var(--danger-strong); background: var(--danger-soft); }
.button-wide { width: 100%; }
.button { max-width: 100%; text-align: center; }

.icon-button { width: 34px; height: 34px; padding: 0; border: 0; border-radius: var(--r-xs); color: var(--muted); background: transparent; transition: background .15s ease, color .15s ease; }
.icon-button .icon { width: 18px; height: 18px; margin: auto; }
.icon-button:hover { color: var(--text); background: var(--surface-sunk); }
.icon-button.danger { color: var(--muted); }
.icon-button.danger:hover { color: var(--danger); background: var(--danger-soft); }

/* ---------- Значки ---------- */

.badge {
  display: inline-flex; align-items: center; width: max-content;
  padding: 5px 11px; border-radius: 999px;
  color: var(--primary-strong); font-size: 11.5px; font-weight: 600;
  background: var(--primary-soft); white-space: nowrap;
}
.badge-neutral { color: var(--text-soft); background: var(--surface-sunk); }
.badge-write { color: var(--success-strong); background: var(--success-soft); }
.status { display: inline-flex; align-items: center; gap: 7px; color: var(--text-soft); font-size: 12.5px; font-weight: 550; }
.status::before { width: 8px; height: 8px; border-radius: 50%; content: ""; }
.status.online::before { background: var(--success); box-shadow: 0 0 0 4px var(--success-soft); }
.status.offline::before { background: var(--faint); box-shadow: 0 0 0 4px var(--surface-sunk); }

/* ---------- Таблици ---------- */

.table-wrap { overflow-x: auto; margin: 0 -6px; padding: 0 6px; }
.table-wrap { max-width: 100%; }
table { width: 100%; border-collapse: separate; border-spacing: 0; }
th, td { padding: 14px 12px; text-align: left; font-size: 13px; }
th { color: var(--muted); font-size: 11.5px; font-weight: 600; letter-spacing: .02em; text-transform: none; }
thead th { border-bottom: 1px solid var(--line); }
tbody td { border-bottom: 1px solid var(--line-soft); }
tbody tr:last-child td { border-bottom: 0; }
tbody tr { transition: background .15s ease; }
tbody tr td:first-child { border-radius: var(--r-xs) 0 0 var(--r-xs); }
tbody tr td:last-child { border-radius: 0 var(--r-xs) var(--r-xs) 0; }
.align-right { text-align: right; }

.user-cell { display: flex; align-items: center; gap: 11px; }
.user-cell strong, .user-cell small { display: block; }
.user-cell strong { font-weight: 650; }
.user-cell small { margin-top: 2px; color: var(--muted); font-size: 12px; }

.avatar {
  display: inline-grid; place-items: center; width: 38px; height: 38px; flex: 0 0 auto;
  border-radius: 13px; color: var(--primary-strong); font-size: 14px; font-weight: 700; line-height: 1;
  background: var(--primary-soft);
}
.avatar.small { width: 34px; height: 34px; border-radius: 11px; font-size: 13px; }

.actions-menu { position: relative; display: inline-block; text-align: left; }
.actions-menu summary { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: var(--r-xs); color: var(--muted); list-style: none; cursor: pointer; transition: background .15s ease; }
.actions-menu summary::-webkit-details-marker { display: none; }
.actions-menu summary:hover { background: var(--surface-sunk); }
.actions-menu summary .icon { width: 19px; height: 19px; }
.actions-menu[open] summary { color: var(--text); background: var(--surface-sunk); }
.actions-menu > div { position: absolute; top: calc(100% + 6px); right: 0; z-index: 5; width: 226px; padding: 8px; border-radius: var(--r-sm); background: var(--surface); box-shadow: var(--shadow-lg); }
.actions-menu > div { overflow-y: auto; overscroll-behavior: contain; border: 1px solid var(--line); }
.actions-menu[data-placement="above"] > div { top: auto; bottom: calc(100% + 6px); }
.actions-menu form { display: flex; flex-direction: column; gap: 7px; padding: 4px; }
.actions-menu form + form { margin-top: 4px; padding-top: 10px; border-top: 1px solid var(--line-soft); }
.actions-menu button { min-height: 36px; padding: 8px 10px; border: 0; border-radius: var(--r-xs); color: var(--text-soft); font-size: 13px; font-weight: 550; text-align: left; background: transparent; transition: background .15s ease, color .15s ease; }
.actions-menu button:hover { color: var(--text); background: var(--surface-soft); }
.actions-menu input { min-height: 38px; }

/* ---------- Списък с папки ---------- */

.folder-list { display: flex; flex-direction: column; gap: 4px; }
.folder-row {
  display: grid; grid-template-columns: 44px minmax(0, 1fr) minmax(100px, 180px) 20px; align-items: center; gap: 14px;
  padding: 14px 12px; border-radius: var(--r-sm);
  color: var(--text); transition: background .15s ease, color .15s ease;
}
.folder-row:hover { color: var(--text); background: var(--surface-soft); }
.folder-row-main { min-width: 0; }
.folder-row-main strong, .folder-row-main small { display: block; }
.folder-row-main strong { font-size: 14px; font-weight: 650; }
.folder-row-main small { margin-top: 4px; color: var(--muted); font-size: 12px; }

.usage { width: 180px; max-width: 100%; }
.usage > span { display: block; margin-bottom: 6px; color: var(--muted); font-size: 11.5px; text-align: right; }
.usage progress { display: block; width: 100%; height: 7px; overflow: hidden; border: 0; border-radius: 99px; appearance: none; background: var(--line); }
.usage progress::-webkit-progress-bar { border-radius: 99px; background: var(--line); }
.usage progress::-webkit-progress-value { border-radius: 99px; background: var(--primary); }
.usage progress::-moz-progress-bar { border-radius: 99px; background: var(--primary); }
.chevron { display: grid; place-items: center; color: var(--muted); }
.chevron .icon { width: 19px; height: 19px; }

.folder-hero { display: flex; align-items: center; gap: 20px; }
.folder-hero > div { min-width: 0; flex: 1; }
.folder-hero h2 { margin: 2px 0 0; font-size: 22px; font-weight: 700; }
.folder-hero h2 { overflow-wrap: anywhere; }
.folder-hero .eyebrow { margin: 8px 0 0; font-size: 13px; }
.page-actions { display: flex; justify-content: space-between; gap: 12px; }

.access-list { display: flex; flex-direction: column; gap: 4px; }
.access-item { display: flex; align-items: center; gap: 13px; padding: 12px 10px; border-radius: var(--r-sm); transition: background .15s ease; }
.access-item strong, .access-item small { display: block; }
.access-item strong { font-size: 13.5px; font-weight: 650; }
.access-item small { margin-top: 3px; color: var(--muted); font-size: 12px; }

/* ---------- Файлов браузър ---------- */

.file-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.breadcrumbs { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; color: var(--muted); font-size: 13px; }
.breadcrumbs a { padding: 5px 9px; border-radius: var(--r-xs); color: var(--text-soft); font-weight: 550; transition: background .15s ease, color .15s ease; }
.breadcrumbs a:hover { color: var(--text); background: var(--surface); box-shadow: var(--shadow-xs); }
.breadcrumbs a:last-of-type { color: var(--text); }
.breadcrumbs span { display: grid; place-items: center; color: var(--faint); }
.breadcrumbs span .icon { width: 14px; height: 14px; }
.toolbar-actions { display: flex; gap: 9px; }

.file-panel { padding: 10px 14px 14px; }
.file-list-head, .file-row { display: grid; grid-template-columns: minmax(160px, 1fr) 90px 140px 110px; align-items: center; gap: 12px; }
.file-list-head { padding: 10px 12px; color: var(--muted); font-size: 11.5px; font-weight: 600; text-transform: none; }
.file-row { min-height: 58px; padding: 8px 12px; border-radius: var(--r-sm); color: var(--muted); font-size: 12.5px; transition: background .15s ease; }
.file-row.parent:hover { background: var(--surface-soft); }
.file-row.parent { display: flex; gap: 12px; color: var(--text-soft); font-weight: 550; }
.file-name { display: flex; align-items: center; gap: 13px; min-width: 0; color: var(--text); }
.file-name strong { overflow: hidden; font-size: 13.5px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.file-name-copy { min-width: 0; }
.file-name-copy strong { display: block; }
.mobile-file-caption { display: none; }
.file-row + .file-row { border-top: 1px solid var(--line); }
.file-row { border-radius: 12px; position: relative; cursor: pointer; transition: background .16s ease, box-shadow .16s ease; }
.file-row.is-selected { background: var(--primary-soft); }
@media (hover: hover) and (pointer: fine) {
  .file-row[data-file-path]:hover { background: var(--surface-soft); }
  .file-row.is-selected:hover { background: var(--primary-soft); }
}
.file-creator { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-list-head, .file-row { grid-template-columns: minmax(170px, 1fr) 130px 85px 140px; }
.file-list-head > .align-right, .file-row > .row-actions { display: none; }
.file-selection-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; padding: 4px 0 12px; margin: 0 0 8px; border-bottom: 1px solid var(--line); }
.selection-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; padding-left: 10px; border-left: 1px solid var(--line); }
.mobile-selection-menu { display: none; }
.file-selection-bar > [data-select-mode] { color: var(--primary-strong); background: var(--surface-soft); }
.file-selection-bar .selection-delete:not(:disabled) { color: var(--danger); }
.file-selection-bar .button { width: 42px; min-height: 42px; padding: 10px; border-radius: 12px; }
.file-selection-bar .button:disabled { opacity: .2; cursor: default; box-shadow: none; }
.file-selection-bar .button:disabled:hover { background: transparent; transform: none; }
.file-selection-bar .button[aria-pressed="true"] { color: var(--primary-strong); background: var(--primary-soft); }
.selection-status { margin-left: auto; color: var(--text-soft); font-size: 13px; }
.file-choice { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); display: none; }
.file-choice input, .select-all-control input { width: 18px; height: 18px; min-height: 18px; }
.selection-mode .file-choice { display: block; }
.selection-mode .file-row { padding-left: 44px; }
.select-all-control { display: flex; flex-direction: row; align-items: center; gap: 8px; padding: 8px 0; font-size: 13px; }
.select-all-control input { flex: 0 0 18px; accent-color: var(--primary); }
.file-actions > div { width: min(280px, calc(100vw - 48px)); z-index: 10; }
.file-actions a, .file-actions button { display: flex; align-items: center; gap: 9px; width: 100%; padding: 10px; min-height: 44px; color: var(--text-soft); font-size: 14px; }
.file-actions a:hover { background: var(--surface-soft); border-radius: 10px; }
.file-actions .danger { color: var(--danger-strong); }
.file-menu-info { padding: 8px 10px 14px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.file-menu-info strong, .file-menu-info small { display: block; white-space: normal; overflow-wrap: anywhere; color: var(--text-soft); }
.file-menu-info small { margin-top: 5px; font-size: 12px; }
.file-info-list { margin: 24px 0; }
.file-info-list > div { display: grid; grid-template-columns: 220px minmax(0, 1fr); padding: 14px 0; gap: 20px; border-top: 1px solid var(--line); font-size: 15px; }
.file-info-list dt { color: var(--text-soft); }
.file-info-list dd { margin: 0; font-weight: 550; overflow-wrap: anywhere; }
.file-kind { display: inline-grid; place-items: center; width: 38px; height: 38px; flex: 0 0 auto; border-radius: 12px; color: var(--muted); background: var(--surface-sunk); }
.file-kind .icon { width: 18px; height: 18px; }
.file-kind.folder { color: var(--amber-strong); background: var(--amber-soft); }
.file-kind.doc { color: var(--primary-strong); background: var(--primary-soft); }
.file-kind.pdf { color: var(--rose); background: var(--rose-soft); }
.file-kind.sheet { color: var(--success-strong); background: var(--success-soft); }
.file-kind.slides { color: var(--amber-strong); background: var(--amber-soft); }
.file-kind.image { color: var(--violet); background: var(--violet-soft); }
.file-kind.media { color: var(--orange); background: var(--orange-soft); }
.file-kind.archive { color: var(--text-soft); background: var(--surface-sunk); }
.file-kind.code { color: var(--teal); background: var(--teal-soft); }

/* ---------- Споделени линкове ---------- */

.row-actions { display: flex; align-items: center; justify-content: flex-end; gap: 2px; }
.row-actions form { display: flex; }
.file-row .row-actions .icon-button { opacity: .55; transition: opacity .15s ease, background .15s ease, color .15s ease; }
.file-row:hover .row-actions .icon-button { opacity: 1; }

.event-label { display: inline-flex; align-items: center; gap: 8px; color: var(--text-soft); font-weight: 550; }
/* Иконите в дребния текст на реда трябва да останат в същия ред. */
.user-cell small .icon { display: inline-block; width: 13px; height: 13px; vertical-align: -2px; }
.event-label .icon { width: 16px; height: 16px; color: var(--muted); }

.share-page {
  display: block; min-height: 100vh; padding: 40px 20px 60px;
  background-color: var(--bg);
  background-image: none;
}
.share-page-centered { display: grid; place-items: center; padding: 24px; }
.share-shell { width: min(920px, 100%); margin: 0 auto; }
.share-shell.narrow { width: min(430px, 100%); }
.share-head { display: flex; justify-content: center; margin-bottom: 26px; }
.share-logo { display: block; width: 100%; max-width: 190px; height: auto; }
.share-card { padding: 28px; }
.share-card-head { display: flex; align-items: center; gap: 18px; }
.share-card .file-list-head { margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line-soft); }
.share-card .empty-state { margin-top: 10px; }
.share-card-head h1 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: -.03em; overflow-wrap: anywhere; }
.share-card .empty-state > span { margin-bottom: 12px; }
.share-terms { display: flex; flex-wrap: wrap; gap: 8px 20px; margin: 18px 0 0; padding-top: 16px; border-top: 1px solid var(--line-soft); }
.share-terms span { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: 12.5px; font-weight: 550; }
.share-terms .icon { width: 16px; height: 16px; }
.share-breadcrumbs { margin: 20px 0 6px; }
.share-foot { margin: 22px 0 0; color: var(--faint); font-size: 12px; text-align: center; }
.file-kind.large { width: 52px; height: 52px; border-radius: 16px; }
.file-kind.large .icon { width: 25px; height: 25px; }

@media (max-width: 620px) {
  .share-card-head { align-items: flex-start; flex-direction: column; gap: 14px; }
  .share-card-head .button { width: 100%; }
}

/* ---------- Контакти за помощ ---------- */

.support-box {
  margin-top: 22px; padding: 18px;
  border-radius: var(--r-sm); background: var(--surface-soft);
  text-align: left;
}
.support-box strong { display: block; margin-bottom: 4px; color: var(--ink); font-size: 13.5px; font-weight: 650; }
.support-box p { margin: 0 0 14px; color: var(--muted); font-size: 12.5px; line-height: 1.55; }
.support-box.compact { margin-top: 10px; padding: 0; background: transparent; text-align: center; }

.support-links { display: flex; flex-wrap: wrap; gap: 8px; }
.support-box.compact .support-links { justify-content: center; }
.support-links a {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 9px 13px; border-radius: var(--r-xs);
  color: var(--text-soft); font-size: 13px; font-weight: 600;
  background: var(--surface); box-shadow: inset 0 0 0 1px var(--line), var(--shadow-xs);
  transition: color .15s ease, box-shadow .15s ease;
}
.support-links a:hover { color: var(--primary-strong); box-shadow: inset 0 0 0 1px rgba(31, 109, 255, .28), var(--shadow-sm); }
.support-links a > span { display: grid; place-items: center; color: var(--primary); }
.support-links a .icon { width: 16px; height: 16px; }

@media (max-width: 520px) {
  .support-links { flex-direction: column; }
  .support-links a { justify-content: center; }
}

/* ---------- Трезор за пароли ---------- */

.vault-form { max-width: 420px; margin: 0 auto; }
.vault [data-vault-content] { display: grid; gap: 20px; }
.vault-form .alert { font-weight: 500; line-height: 1.55; }
.vault-recovery-toggle { flex-direction: row; align-items: center; gap: 9px; font-weight: 550; }
.vault-recovery-toggle input { width: auto; min-height: 0; }

.vault-search { position: relative; display: flex; align-items: center; flex: 1; max-width: 380px; }
.vault-search .icon { position: absolute; left: 13px; width: 17px; height: 17px; color: var(--muted); pointer-events: none; }
.vault-search input { padding-left: 40px; }

.vault-row {
  display: flex; align-items: center; gap: 14px;
  padding: 13px 12px; border-radius: var(--r-sm);
  transition: background .15s ease;
}
.vault-row + .vault-row { border-top: 1px solid var(--line-soft); }
.vault-row:hover { background: var(--surface-soft); }
.vault-avatar {
  display: inline-grid; place-items: center; width: 38px; height: 38px; flex: 0 0 auto;
  border-radius: 13px; color: #fff; font-size: 14px; font-weight: 700; line-height: 1;
  background: #68758b;
}
.vault-avatar, .vault-row-actions { flex-shrink: 0; }
.vault-row-main { min-width: 0; flex: 1; }
.vault-row-main strong { display: block; font-size: 14px; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vault-row-main small { display: block; margin-top: 3px; color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vault-row-actions { display: flex; align-items: center; gap: 2px; opacity: .55; transition: opacity .15s ease; }
.vault-row:hover .vault-row-actions { opacity: 1; }
.vault-row-actions .icon-button { font-size: 15px; line-height: 1; }

.vault-password { display: flex; gap: 8px; }
.vault-password input { min-width: 0; flex: 1; font-family: var(--mono); letter-spacing: .01em; }
.vault-password .button { flex: 0 0 auto; padding: 9px 13px; }

.vault-share { margin-top: 6px; padding: 16px; border-radius: var(--r-sm); background: var(--surface-soft); }
.vault-share strong { display: block; margin-bottom: 4px; font-size: 13px; font-weight: 650; }
.vault-share p { margin: 0 0 12px; font-size: 12px; line-height: 1.5; }
.vault-recipient {
  display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 4px 10px;
  padding: 8px 10px; border-radius: var(--r-xs); font-weight: 550;
  transition: background .15s ease;
}
.vault-recipient:hover { background: var(--surface); }
.vault-recipient input { width: auto; min-height: 0; grid-row: span 2; }
.vault-recipient small { grid-column: 2; color: var(--muted); font-size: 11.5px; font-weight: 450; }

#recovery-dialog .copy-field code { background: var(--surface-sunk); font-size: 15px; letter-spacing: .06em; text-align: center; }

/* ---------- Сигурност и двуфакторно влизане ---------- */

.backup-codes { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; margin: 16px 0; }
.backup-codes code {
  padding: 11px 13px; border-radius: var(--r-xs);
  background: var(--surface-glass); font-family: var(--mono);
  font-size: 14px; letter-spacing: .04em; text-align: center;
}

.setup-steps { margin: 0; padding: 0 0 0 22px; counter-reset: step; }
.setup-steps li { margin-bottom: 26px; padding-left: 6px; }
.setup-steps li::marker { color: var(--primary); font-weight: 700; }
.setup-steps strong { display: block; margin-bottom: 6px; font-size: 14px; font-weight: 650; }
.setup-steps p { margin: 0 0 10px; color: var(--muted); font-size: 12.5px; line-height: 1.55; }
.setup-steps .copy-field { margin: 12px 0; }
.setup-steps .copy-field code { background: var(--surface-sunk); font-size: 15px; letter-spacing: .1em; }

.security-list { display: flex; flex-direction: column; gap: 11px; margin: 0 0 20px; padding: 0; list-style: none; }
.security-list li { display: flex; align-items: flex-start; gap: 10px; color: var(--text-soft); font-size: 12.5px; line-height: 1.5; }
.security-list span { display: grid; place-items: center; flex: 0 0 auto; margin-top: 1px; color: var(--success); }
.security-list li:last-child span { color: var(--amber); }
.security-list .icon { width: 15px; height: 15px; }

.otp-input { font-family: var(--mono); font-size: 22px; letter-spacing: .38em; text-align: center; }
.otp-help { margin-top: 18px; }
.otp-help summary { color: var(--muted); font-size: 12.5px; cursor: pointer; }
.otp-help p { margin: 10px 0 0; color: var(--muted); font-size: 12.5px; line-height: 1.55; }

/* ---------- Празни състояния ---------- */

.empty-state { display: grid; place-items: center; padding: 52px 20px; text-align: center; }
.empty-state > span { display: grid; place-items: center; width: 62px; height: 62px; margin-bottom: 14px; border-radius: 20px; color: var(--primary); background: var(--primary-soft); }
.empty-state > span .icon { width: 28px; height: 28px; }
.empty-state h2, .empty-state h3 { margin: 4px 0; font-size: 17px; font-weight: 650; }
.empty-state p { max-width: 460px; margin: 6px 0 18px; color: var(--muted); font-size: 13px; line-height: 1.65; }
.empty-state p:last-child { margin-bottom: 0; }
.empty-state.small { padding: 32px 15px; }

/* ---------- Съобщения ---------- */

.alert { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border: 0; border-radius: var(--r-sm); font-size: 13px; font-weight: 550; box-shadow: var(--shadow-xs); }
.alert-success { color: var(--success-strong); background: var(--success-soft); }
.alert-error { color: var(--danger-strong); background: var(--danger-soft); }

/* ---------- Диалози ---------- */

dialog { width: min(460px, calc(100vw - 30px)); max-height: calc(100dvh - 32px); overflow-y: auto; overscroll-behavior: contain; padding: 26px; border: 0; border-radius: var(--r-lg); box-shadow: var(--shadow-lg); }
dialog::backdrop { background: rgba(35, 42, 56, .32); backdrop-filter: blur(4px); }
.dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 4px; }
.dialog-head h2 { min-width: 0; overflow-wrap: anywhere; margin: 0; font-size: 18px; font-weight: 650; }
.dialog-head > .icon-button { flex-shrink: 0; }
.drop-zone { display: grid; place-items: center; gap: 10px; min-height: 148px; padding: 22px; border: 2px dashed var(--primary-line); border-radius: var(--r-sm); color: var(--primary-strong); background: var(--primary-tint); font-size: 13px; font-weight: 600; text-align: center; cursor: pointer; transition: border-color .15s ease, background .15s ease; }
.drop-icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 15px; color: var(--primary); background: var(--surface); box-shadow: var(--shadow-xs); }
.drop-icon .icon { width: 20px; height: 20px; }
.drop-zone input::file-selector-button { margin-right: 10px; padding: 7px 12px; border: 0; border-radius: 8px; color: var(--primary-strong); background: var(--surface); font-size: 12px; font-weight: 600; cursor: pointer; box-shadow: var(--shadow-xs); }
.drop-zone:hover { border-color: var(--primary-line); background: var(--primary-tint); }
.drop-zone input { width: 100%; min-width: 0; min-height: 0; padding: 0; border: 0; color: var(--muted); background: transparent; font-size: 12px; }
.drop-zone input:hover, .drop-zone input:focus { background: transparent; box-shadow: none; }

/* ---------- Токени ---------- */

.token-reveal { background: var(--primary-soft); box-shadow: var(--shadow); }
.token-reveal .eyebrow { color: var(--primary-strong); font-weight: 600; }
.token-reveal h2 { margin: 2px 0 0; font-size: 20px; }
.token-reveal p:last-child { margin-bottom: 0; color: var(--text-soft); font-size: 13px; }
.copy-field { display: flex; align-items: center; gap: 10px; margin: 16px 0; }
.copy-field code { min-width: 0; flex: 1; overflow-x: auto; padding: 14px 16px; border-radius: var(--r-xs); color: var(--text); background: var(--surface-glass); font-family: var(--mono); font-size: 13px; letter-spacing: .01em; }
.info-box { display: flex; flex-direction: column; gap: 8px; margin-top: 20px; padding: 16px; border-radius: var(--r-sm); background: var(--surface-soft); }
.info-box strong { font-size: 13px; font-weight: 650; }
.info-box code { overflow-wrap: anywhere; color: var(--primary-strong); font-family: var(--mono); font-size: 12.5px; }

/* ---------- Вход ---------- */

.login-page {
  display: grid; min-height: 100vh; place-items: center; padding: 24px;
  background-color: var(--bg);
  background-image: none;
}
.login-shell { display: grid; grid-template-columns: minmax(0, 1fr) 420px; gap: 56px; align-items: center; width: min(1000px, 100%); }
.login-aside { max-width: 420px; padding: 4px; }

.login-aside h2 { margin: 26px 0 12px; font-size: 32px; font-weight: 700; letter-spacing: -.04em; line-height: 1.15; }
.login-aside > p { margin: 0 0 28px; color: var(--text-soft); font-size: 15px; line-height: 1.65; }
.login-points { display: flex; flex-direction: column; gap: 12px; margin: 0; padding: 0; list-style: none; }
.login-points li { display: flex; align-items: center; gap: 12px; color: var(--text-soft); font-size: 13.5px; font-weight: 550; }
.login-points span { display: grid; place-items: center; width: 34px; height: 34px; flex: 0 0 auto; border-radius: 12px; color: var(--primary); background: var(--surface-glass); box-shadow: var(--shadow-xs); }
.login-points span .icon { width: 17px; height: 17px; }
.login-card { width: min(420px, 100%); padding: 40px; border: 0; border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow-lg); }
.login-brand { margin-bottom: 30px; }
.login-card h1 { margin: 4px 0 6px; font-size: 28px; font-weight: 700; letter-spacing: -.035em; }
.login-card > .muted { margin: 0 0 26px; font-size: 13.5px; line-height: 1.6; }
.login-card .alert { margin-bottom: 18px; }
.login-foot { margin: 24px 0 0; color: var(--faint); font-size: 12px; text-align: center; }

/* ---------- Адаптивност ---------- */

@media (max-width: 1040px) {
  .content-grid { grid-template-columns: 1fr; }
  .hero { flex-wrap: wrap; gap: 30px; }
  .split-layout { flex-direction: column; }
  .form-panel { position: static; width: 100%; flex-basis: auto; }
  .login-shell { grid-template-columns: 1fr; gap: 34px; width: min(440px, 100%); }
  .login-aside { max-width: none; }
  .login-aside h2 { font-size: 26px; }
  .login-points { display: none; }
}

@media (max-width: 1000px) {
  .app-shell { display: block; padding: 0; }
  .sidebar {
    position: fixed; top: 0; left: 0; height: 100vh; width: 274px;
    border-radius: 0 var(--r-lg) var(--r-lg) 0;
    transform: translateX(-104%); transition: transform .24s ease;
    box-shadow: var(--shadow-lg);
  }
  .sidebar.is-open { transform: translateX(0); }
  .sidebar-backdrop { position: fixed; inset: 0; z-index: 25; display: block; background: rgba(35, 42, 56, .3); opacity: 0; pointer-events: none; transition: opacity .24s ease; }
  .sidebar-backdrop.is-visible { opacity: 1; pointer-events: auto; }
  .main { padding: 0 16px calc(96px + env(safe-area-inset-bottom)); }
  .topbar { top: 0; min-height: 72px; margin: 0 -16px 16px; padding: 12px 16px; gap: 12px; }
  .topbar h1 { font-size: 21px; }
  .menu-button { display: block; }
  .stat-card { flex-direction: row; align-items: center; gap: 14px; }
  .stat-card > div { min-width: 0; flex: 1; }
  .stat-card strong { font-size: 21px; }
  .hero { align-items: flex-start; flex-direction: column; gap: 28px; padding: 28px 24px; }
  .hero h2 { font-size: 27px; }
  .hero-actions .button { flex: 1; }
  .meter { width: 140px; height: 140px; }
  .hero-figures { gap: 26px; }
  .file-toolbar { align-items: stretch; flex-direction: column; gap: 12px; }
  .toolbar-actions .button { flex: 1; }
  .file-list-head { display: none; }
  .file-row { grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
  .file-row > .file-size, .file-row > .file-modified { display: none; }
  .folder-row .usage { display: none; }
  .page-actions { flex-direction: column; }
  .panel { padding: 18px; }
  .file-panel { padding: 8px 8px 12px; }
  .login-card { padding: 30px 24px; }
  .login-shell { grid-template-columns: 1fr; gap: 0; }
  .login-aside { display: none; }
}

/* Account navbar and mobile navigation */
.account-nav { flex: 0 0 auto; }
.sidebar-foot .account-dropdown { top: auto; bottom: calc(100% + 10px); left: 0; right: auto; width: 100%; }
.sidebar-foot .account-menu summary { padding: 10px; background: var(--surface-soft); }
.sidebar-foot .account-name { flex: 1; }
.sidebar .account-name { display: block; }
.sidebar-foot .account-menu summary > .icon { transform: rotate(-90deg); }
.sidebar-foot .sidebar-card { display: none; }
.mobile-brand, .mobile-page-heading { display: none; }
.account-menu { position: relative; }
.account-menu summary { display: flex; align-items: center; gap: 9px; min-height: 44px; padding: 5px 9px; border-radius: var(--r-sm); background: var(--surface); cursor: pointer; list-style: none; box-shadow: var(--shadow-xs); }
.account-menu summary::-webkit-details-marker { display: none; }
.account-menu summary > .icon { width: 14px; height: 14px; transform: rotate(90deg); color: var(--text-soft); }
.account-menu[open] summary { box-shadow: 0 0 0 2px var(--primary-soft); }
.account-name { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; font-weight: 600; }
.account-dropdown { position: absolute; right: 0; top: calc(100% + 10px); width: min(270px, calc(100vw - 32px)); max-height: calc(100dvh - 126px); overflow-y: auto; padding: 8px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); box-shadow: var(--shadow-lg); }
.account-info { padding: 10px 12px 14px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.account-info strong, .account-info span { display: block; overflow-wrap: anywhere; font-size: 13px; }
.account-info span { margin-top: 4px; font-size: 12px; color: var(--text-soft); }
.account-dropdown a, .account-dropdown button { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 10px 12px; border: 0; border-radius: 10px; color: var(--text-soft); background: transparent; font-size: 13px; text-align: left; }
.account-dropdown a:hover, .account-dropdown button:hover { color: var(--primary-strong); background: var(--surface-soft); }
.mobile-menu-close, .mobile-nav { display: none; }
.menu-button { flex: 0 0 44px; width: 44px; height: 44px; border: 1px solid var(--line); }
.topbar h1 { overflow-wrap: anywhere; }
.help-text { color: var(--text-soft); font-size: 13px; line-height: 1.65; }
.global-file-search { display: flex; align-items: center; gap: 10px; }
.global-file-search input { width: 100%; min-height: 46px; background: var(--surface); }
.global-file-search .button { min-height: 46px; }
.backup-schedule-form { display: flex; flex-direction: column; gap: 18px; }
.schedule-fields { display: flex; align-items: center; flex-wrap: wrap; gap: 18px; }
.schedule-fields label { display: flex; flex-direction: row; align-items: center; gap: 8px; font-size: 13px; }
.schedule-fields input { width: 86px; }
.cron-help { padding: 16px; border-radius: var(--r-sm); background: var(--surface-soft); }
.cron-help summary { cursor: pointer; font-size: 13px; font-weight: 600; }
.cron-help code { display: block; overflow-wrap: anywhere; font-size: 12px; line-height: 1.6; }
.stat-card, .stat-card::after, .activity-item, .access-item, tbody tr { transition: none; }
.file-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.folder-tools { margin: 0; padding: 18px; border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow-xs); }
.folder-tools .file-toolbar { align-items: stretch; flex-direction: column; margin: 0 0 16px; gap: 16px; }
.folder-tools .breadcrumbs { width: 100%; padding: 10px 12px; border-radius: 12px; color: var(--text-soft); background: var(--surface-soft); }
.folder-tools .breadcrumbs a { font-size: 14px; padding: 3px 5px; }
.folder-tools .breadcrumbs a:last-of-type { color: var(--primary-strong); font-weight: 700; }
.folder-tools .breadcrumbs a:last-of-type { background: var(--primary-soft); }
.folder-tools .toolbar-actions { gap: 8px; flex-shrink: 0; }
.folder-tools .toolbar-actions .button { min-height: 44px; white-space: nowrap; }
.folder-info-button { width: 44px; padding: 10px; }
.folder-tools .file-search input, .folder-tools .file-sort select { background: var(--surface-soft); }
.file-tools-controls { display: flex; align-items: center; gap: 10px; flex: 1; }
.file-search { max-width: 340px; flex: 1; }
.file-search input { width: 100%; }
.file-sort { max-width: 200px; }
.file-summary { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; font-size: 12px; color: var(--text-soft); }
.file-summary .usage { width: 160px; }
.file-summary .usage > span { text-align: left; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.backup-list { margin-top: 18px; }
.backup-row { display: flex; align-items: center; gap: 14px; padding: 15px 0; border-top: 1px solid var(--line); }
.backup-row strong, .backup-row small { display: block; overflow-wrap: anywhere; }
.backup-row strong { font-size: 14px; }
.backup-row small { margin-top: 4px; color: var(--text-soft); font-size: 12px; line-height: 1.5; }
.backup-row .button { flex: 0 0 auto; }
.recovery-intro { display: flex; gap: 24px; align-items: center; justify-content: space-between; }
.recovery-intro h2 { margin-top: 12px; }
.recovery-intro form { flex: 0 0 auto; }
.button:disabled { cursor: wait; opacity: .6; }
.file-row .row-actions .icon-button { opacity: 1; }
.check-label { display: flex !important; flex-direction: row; align-items: flex-start; gap: 10px; font-size: 14px; font-weight: 500; line-height: 1.5; }
.check-label input { flex: 0 0 18px; width: 18px; height: 18px; min-height: 18px; padding: 0; margin: 2px 0 0; accent-color: var(--primary); }
dialog:focus-visible { outline: none; }
.drop-zone { position: relative; }
.drop-zone input[type="file"] { position: absolute; width: 1px; height: 1px; min-height: 0; padding: 0; overflow: hidden; clip-path: inset(50%); }
.drop-zone:focus-within { outline: 2px solid var(--primary); outline-offset: 3px; }
.drop-zone small { color: var(--text-soft); font-size: 13px; font-weight: 450; }
.drop-zone.is-dragging { border-color: var(--primary); background: var(--primary-soft); }
.nav-link { font-size: 15px; min-height: 46px; }
.eyebrow, .stat-card div > span, .hero-note { font-size: 14px; }
.button, .stack-form label, .help-text, .check-label, .schedule-fields label { font-size: 14px; }
input, select { font-size: 15px; }
.file-name strong, .folder-card strong, .folder-row-main strong { font-size: 15px; }
.file-row, th, td { font-size: 14px; }
.file-list-head, .backup-row small, .folder-card small, .folder-row-main small, .company-switch-copy span { font-size: 13px; }
.backup-row strong, .account-name, .account-dropdown a, .account-dropdown button { font-size: 14px; }
.menu-is-open { overflow: hidden; }
.page-content[aria-busy="true"] { opacity: .6; pointer-events: none; }
.page-content > .button { align-self: flex-start; }
.account-back { justify-content: flex-start; margin-bottom: 20px; background: var(--surface-soft); }
.profile-summary { display: flex; align-items: center; gap: 18px; }
.profile-summary .avatar { flex: 0 0 64px; width: 64px; height: 64px; font-size: 26px; border-radius: 20px; }
.profile-summary .eyebrow { overflow-wrap: anywhere; margin: 6px 0 10px; }
.profile-summary > div { min-width: 0; }
.profile-summary .badge { max-width: 100%; white-space: normal; }
.panel, .folder-tools { min-width: 0; }
.panel-header { flex-wrap: wrap; gap: 12px; }
.panel-header > div { min-width: 0; }
.stats-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr)); }
.dashboard-hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, .72fr); gap: 32px; padding: 30px; box-shadow: var(--shadow); }
.dashboard-hero h2 { font-size: clamp(24px, 2.5vw, 32px); overflow-wrap: anywhere; }
.dashboard-hero .hero-actions { margin-top: 20px; }
.dashboard-hero .hero-actions .button { flex: 0 1 auto; min-height: 46px; box-shadow: none; white-space: nowrap; }
.hero-members { display: inline-flex; align-items: center; gap: 8px; margin-top: 18px; color: #d3e3fb; font-size: 13px; }
.hero-members .icon { width: 17px; height: 17px; }
.hero-members:hover { color: #fff; text-decoration: underline; }
.dashboard-storage { min-width: 0; padding: 22px; border: 1px solid rgba(255, 255, 255, .2); border-radius: 18px; background: rgba(255, 255, 255, .08); }
.dashboard-storage h3 { margin: 0 0 12px; color: #d3e3fb; font-size: 14px; font-weight: 550; }
.storage-total { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 10px; margin: 0 0 18px; }
.storage-total strong { font-size: 26px; font-weight: 700; line-height: 1.2; }
.storage-total > span { color: #d3e3fb; font-size: 14px; }
.dashboard-storage progress { display: block; width: 100%; height: 8px; border: 0; border-radius: 10px; overflow: hidden; color: #7bc3ff; background: rgba(255, 255, 255, .18); }
.dashboard-storage progress::-webkit-progress-bar { border-radius: 10px; background: rgba(255, 255, 255, .18); }
.dashboard-storage progress::-webkit-progress-value { border-radius: 10px; background: #7bc3ff; }
.dashboard-storage progress::-moz-progress-bar { border-radius: 10px; background: #7bc3ff; }

/* The same capacity thresholds apply to company and folder storage. */
progress.storage-meter.storage-good { --storage-meter-color: #1f6dff; }
html[data-theme="dark"] progress.storage-meter.storage-good,
.dashboard-storage progress.storage-meter.storage-good { --storage-meter-color: #7bc3ff; }
progress.storage-meter.storage-warning { --storage-meter-color: #eab308; }
progress.storage-meter.storage-danger { --storage-meter-color: #ef4444; }
progress.storage-meter.storage-good,
progress.storage-meter.storage-warning,
progress.storage-meter.storage-danger { color: var(--storage-meter-color); accent-color: var(--storage-meter-color); }
progress.storage-meter.storage-good::-webkit-progress-value,
progress.storage-meter.storage-warning::-webkit-progress-value,
progress.storage-meter.storage-danger::-webkit-progress-value { background: var(--storage-meter-color); min-width: 3px; }
progress.storage-meter.storage-good::-moz-progress-bar,
progress.storage-meter.storage-warning::-moz-progress-bar,
progress.storage-meter.storage-danger::-moz-progress-bar { background: var(--storage-meter-color); }
progress.storage-meter[value="0"]::-webkit-progress-value { min-width: 0; }
.storage-caption { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 16px; margin: 12px 0 0; color: #d3e3fb; font-size: 13px; }
.activity-item { padding: 14px 0; border-radius: 0; }
.activity-item + .activity-item { border-top: 1px solid var(--line); }
.activity-item strong { font-size: 14px; }
.activity-item p { color: var(--text-soft); font-size: 14px; }
.activity-item p.activity-detail { margin-top: 5px; color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.activity-item small { color: var(--muted); font-size: 12px; }
@media (max-width: 1200px) {
  .dashboard-hero { grid-template-columns: 1fr; gap: 22px; }
  .dashboard-storage { width: 100%; }
}
@media (max-width: 480px) {
  .dashboard-hero { padding: 22px; }
  .dashboard-storage { padding: 18px; }
  .dashboard-hero .hero-actions { display: grid; grid-template-columns: 1fr; width: 100%; }
}
.folder-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 244px), 1fr)); }
.folder-row-main { min-width: 0; }
.folder-row-main strong, .folder-row-main small { overflow-wrap: break-word; word-break: normal; }
.company-row { grid-template-columns: 34px minmax(0, 1fr) 34px; align-items: start; row-gap: 12px; padding: 18px 12px; border: 1px solid var(--line); }
.company-row > .company-avatar { grid-column: 1; grid-row: 1; }
.company-row > .folder-row-main { grid-column: 2; grid-row: 1; }
.company-row > .actions-menu { grid-column: 3; grid-row: 1; }
.company-row-meta { grid-column: 2; display: flex; flex-wrap: wrap; align-items: center; gap: 12px 22px; min-width: 0; }
.company-row-meta .usage { display: block; width: min(240px, 100%); }
.company-row-meta .usage > span { text-align: left; font-size: 13px; }
.company-row small code { font-size: 12px; overflow-wrap: anywhere; }
.company-host-help { margin-top: 22px; }
.company-host-help code { display: inline; }
.label-row { flex-wrap: wrap; }
.user-cell { min-width: 220px; }
.user-cell > div { min-width: 0; }
.table-wrap table { min-width: 620px; }
.access-item { flex-wrap: wrap; }
.access-item > .grow { flex: 1 1 180px; }
.access-item > form { flex: 0 0 auto; }
.activity-item > div { flex: 1; }
.activity-icon { display: grid; place-items: center; width: 36px; height: 36px; flex: 0 0 36px; border-radius: 12px; color: var(--primary-strong); background: var(--primary-soft); }
.activity-icon .icon { width: 18px; height: 18px; }
.activity-meta { display: flex; flex-wrap: wrap; gap: 3px 12px; margin-top: 4px; color: var(--muted); font-size: 12px; }
.activity-meta time { white-space: nowrap; }
.activity-file { display: inline-block; max-width: 100%; padding: 5px 8px; margin: 8px 0 0; border: 1px solid var(--line); border-radius: 8px; color: var(--primary-strong); background: var(--surface-soft); font-size: 13px; overflow-wrap: anywhere; }
.activity-file:hover { color: var(--primary-strong); border-color: var(--primary-line); background: var(--primary-soft); }
@media (max-width: 1320px) {
  .content-grid { grid-template-columns: 1fr; }
  .split-layout { flex-direction: column; }
  .split-layout > .grow, .split-layout > .form-panel { position: static; width: 100%; flex-basis: auto; }
}
.access-item strong, .access-item small, .folder-row-main strong, .user-cell strong, .user-cell small { overflow-wrap: anywhere; }
.profile-setting { position: relative; display: flex; align-items: center; gap: 16px; padding: 14px 12px; border: 0; border-radius: 12px; color: var(--text); transition: background-color .15s ease; }
.profile-setting:not(:last-child)::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: -3px; height: 1px; background: var(--line); pointer-events: none; }
.profile-setting > div { flex: 1; min-width: 0; }
.profile-setting strong { display: block; font-size: 16px; }
.profile-setting p { margin: 5px 0 0; color: var(--text-soft); font-size: 14px; }
.profile-setting > .icon { color: var(--muted); }
.profile-setting:hover, .profile-setting:focus-visible { color: var(--text); background: var(--surface-soft); }
.profile-setting:hover > .icon, .profile-setting:focus-visible > .icon { color: var(--primary-strong); }
.profile-settings form { margin-top: 20px; }
.global-file-search { padding: 16px; border-radius: var(--r); background: var(--surface); box-shadow: var(--shadow-xs); }
.global-file-search input { background: var(--surface-soft); }
.global-file-search .button { white-space: nowrap; }
.folder-card.roomy { position: relative; border: 1px solid var(--line); }
.folder-card.roomy::after { position: absolute; top: 26px; right: 22px; content: '→'; color: var(--primary); font-size: 22px; }
.folder-card.roomy .badge { align-self: flex-start; }
.folder-tools .file-tools-controls { min-width: 240px; }
.folder-tools .file-search { min-width: 160px; }
.folder-tools .file-sort { flex: 0 0 180px; }
.sort-menu { display: block; width: 100%; }
.sort-menu summary { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; min-height: 46px; height: auto; padding: 11px 14px; border: 1px solid transparent; color: var(--text); background: var(--surface-soft); font-size: 14px; font-weight: 550; }
.sort-menu summary > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sort-menu summary > .icon { width: 16px; height: 16px; transform: rotate(90deg); }
.sort-menu[open] summary { color: var(--primary-strong); border-color: var(--primary-line); background: var(--primary-tint); }
.sort-menu[open] summary > .icon { transform: rotate(-90deg); }
.sort-menu > div { z-index: 20; width: min(260px, calc(100vw - 16px)); padding: 6px; }
.sort-menu button { display: flex; align-items: center; justify-content: space-between; gap: 16px; width: 100%; min-height: 44px; font-size: 14px; }
.sort-menu button > .icon { width: 17px; height: 17px; visibility: hidden; }
.sort-menu button[aria-checked="true"] { color: var(--primary-strong); background: var(--primary-soft); }
.sort-menu button[aria-checked="true"] > .icon { visibility: visible; }
.download-target { display: flex; align-items: center; gap: 12px; padding: 16px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface-soft); }
.download-target > div { min-width: 0; }
.download-target strong { display: block; overflow-wrap: anywhere; font-size: 15px; }
.download-target small { display: block; margin-top: 4px; color: var(--muted); font-size: 13px; }
.dialog-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; }
.dialog-actions .button { min-height: 44px; }
.file-info-dialog { width: min(640px, calc(100vw - 30px)); max-height: calc(100dvh - 32px); overflow-y: auto; }
.file-info-dialog .dialog-head { margin-bottom: 22px; gap: 12px; }
.file-info-dialog .folder-hero { gap: 14px; }
.file-info-dialog .folder-hero > div { min-width: 0; }
.file-info-dialog .folder-hero h2 { overflow-wrap: anywhere; font-size: 20px; }
.file-info-dialog [data-info-content] > .help-text { margin: 18px 0; }
.file-info-dialog .dialog-actions { margin-top: 20px; }
.file-selection-bar .button[data-select-mode] { width: auto; padding: 10px 12px; font-size: 14px; white-space: nowrap; }
.share-option { padding: 14px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface-soft); }
.share-option > label + label { margin-top: 14px; }
.share-option input:not([type="checkbox"]):not([type="hidden"]) { background: var(--surface); }
.share-extra-options summary { color: var(--text-soft); font-size: 14px; cursor: pointer; }
.share-extra-options label { margin-top: 14px; }
.share-privacy-note { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
#share-dialog { max-height: calc(100dvh - 32px); overflow-y: auto; }
.share-protection { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.share-protection > span { padding: 3px 7px; border-radius: 6px; color: var(--text-soft); background: var(--surface-soft); font-size: 12px; }
.backup-overview h2 { margin-top: 0; }
.backup-overview .help-text { margin: 8px 0; }
.backup-schedule-fields { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; align-items: end; gap: 16px; }
.backup-schedule-fields .button { min-height: 44px; }
.saved-backups .backup-list { margin-top: 0; }
.saved-backups .backup-row { display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; gap: 14px; }
.saved-backups .backup-row:first-child { border-top: 0; padding-top: 0; }
.saved-backups .backup-row > .button { margin-left: 0; }
.backup-type { color: var(--text-soft); font-weight: 550; }
.backup-type.automatic { color: var(--primary-strong); }
.backup-recovery-help { margin-top: 18px; }
@media (max-width: 620px) {
  .backup-schedule-fields { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
  .backup-schedule-fields .button { grid-column: 1 / -1; }
  .saved-backups .backup-download { padding: 10px; }
  .backup-download > span { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .sidebar, .sidebar-backdrop, .file-row { transition: none; }
}
@media (max-width: 1200px) and (min-width: 1001px) {
  .file-row, .file-list-head { grid-template-columns: minmax(120px, 1fr) 80px 140px; }
  .file-row > .file-creator, .file-list-head > .file-creator { display: none; }
  .account-name { display: none; }
}
@media (max-width: 1000px) {
  .sidebar { width: 100%; height: 100dvh; border-radius: 0; padding: 24px 20px; transform: translateX(104%); }
  .sidebar.is-open { transform: translateX(0); }
  .sidebar .nav-link { font-size: 17px; min-height: 52px; }
  .sidebar .company-current, .sidebar .company-switch { margin-top: 8px; }
  .sidebar .brand { font-size: 21px; }
  .topbar { background: var(--surface); box-shadow: 0 1px 0 var(--line); }
  .topbar .menu-button { order: 2; margin-left: auto; box-shadow: none; color: var(--text-soft); background: var(--surface-soft); }
  .sidebar .brand { padding-right: 40px; }
  .folder-row { grid-template-columns: 44px minmax(0, 1fr) 20px; }
  .company-row { grid-template-columns: 34px minmax(0, 1fr) 34px; }
  .mobile-menu-close { display: grid; position: absolute; right: 15px; top: 23px; width: 40px; height: 40px; }
  .account-name { display: block; }
  .topbar-copy { display: none; }
  .mobile-brand { display: flex; align-items: center; gap: 9px; color: var(--ink); font-size: 19px; font-weight: 700; }
  .mobile-brand .brand-mark { width: 34px; }
  .mobile-page-heading { display: block; }
  .mobile-page-heading h1 { margin: 4px 0 0; font-size: 24px; overflow-wrap: anywhere; }
  .sidebar-foot { padding-bottom: max(12px, env(safe-area-inset-bottom)); }
  .topbar-copy .eyebrow { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .topbar h1 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 20px; }
  .mobile-nav { position: fixed; bottom: 0; left: 0; right: 0; z-index: 20; display: grid; grid-template-columns: repeat(4, 1fr); padding: 7px 8px calc(8px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--surface); box-shadow: 0 -4px 20px rgba(13,27,62,.06); }
  .mobile-nav-link { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; min-height: 50px; border-radius: 12px; color: var(--text-soft); font-size: 10px; font-weight: 600; }
  .mobile-nav-link.is-active { color: var(--primary-strong); background: var(--primary-soft); }
  .mobile-nav-link .icon { width: 22px; height: 22px; }
  button.mobile-nav-link { border: 0; background: transparent; font-family: inherit; }
  button.mobile-nav-link.is-active { background: var(--primary-soft); }
  .toolbar-actions { flex-wrap: wrap; }
  .folder-tools { padding: 14px; }
  .folder-tools .breadcrumbs { flex-wrap: wrap; gap: 7px; font-size: 13px; }
  .folder-tools .toolbar-actions { display: flex; flex-wrap: nowrap; }
  .folder-tools .toolbar-actions .button { flex: 1; padding: 10px; font-size: 13px; gap: 6px; }
  .folder-tools .toolbar-actions .folder-info-button { flex: 0 0 44px; }
  .folder-tools .file-tools { display: block; }
  .folder-tools .file-tools-controls { display: grid; grid-template-columns: minmax(0, 1fr) 130px; gap: 8px; }
  .folder-tools .file-search { min-width: 0; }
  .folder-tools .file-summary { margin-top: 12px; gap: 8px; }
  .folder-tools .file-summary > a { margin-left: auto; padding: 9px; font-size: 12px; }
  .file-row { padding: 10px 4px; }
  .file-row { grid-template-columns: minmax(0, 1fr) 44px; min-height: 80px; }
  .file-row > .row-actions { display: flex; }
  .file-row > .file-creator { display: none; }
  .file-row .desktop-action { display: none; }
  .file-actions summary { width: 44px; height: 44px; }
  .mobile-file-caption { display: block; color: var(--text-soft); font-size: 12px; font-weight: 450; margin-top: 4px; }
  .file-selection-bar { gap: 8px; padding: 4px 4px 10px; }
  .selection-actions { display: none; }
  .file-selection-bar.has-multiple .mobile-selection-menu { display: block; margin-left: auto; }
  .mobile-selection-menu > summary { width: 44px; height: 44px; }
  .mobile-selection-menu > div { width: min(290px, calc(100vw - 48px)); }
  .file-selection-bar .button { flex-shrink: 0; font-size: 12px; padding: 8px 10px; }
  .file-selection-bar .button .icon { width: 18px; height: 18px; }
  .selection-status { margin: 0 0 0 auto; font-size: 12px; }
  .file-info-list > div { grid-template-columns: 1fr; gap: 5px; }
  .file-row .row-actions .icon-button { width: 32px; min-width: 32px; height: 40px; }
  .file-name { gap: 8px; }
  .file-kind { width: 32px; height: 36px; }
  .file-tools-controls { flex-basis: 100%; }
  .file-search { max-width: none; min-width: 0; }
  .file-sort { max-width: 160px; }
  .backup-row { flex-wrap: wrap; gap: 10px; }
  .backup-row .grow { flex-basis: calc(100% - 50px); }
  .backup-row > form, .backup-row > .button { margin-left: 42px; }
  .recovery-intro { align-items: stretch; flex-direction: column; gap: 12px; }
  .recovery-intro .button { width: 100%; }
  .global-file-search { flex-wrap: wrap; }
  .global-file-search { display: grid; grid-template-columns: minmax(0, 1fr) auto; }
  .global-file-search label { grid-column: 1 / -1; }
  .global-file-search .button-primary { grid-column: 1 / -1; }
  .global-file-search > a { grid-column: 1 / -1; }
  .split-layout > .grow { width: 100%; }
  .access-item { flex-wrap: wrap; }
  .access-item .grow { flex: 1 1 140px; }
  .access-item > form { margin-left: 0; width: 100%; }
  .access-item > form .button { width: 100%; }
  .copy-field { flex-wrap: wrap; }
  .copy-field code { flex-basis: 100%; }
  .mobile-selection-menu button { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; }
  .global-file-search label { flex-basis: calc(100% - 95px); }
  .global-file-search .button { padding: 10px 12px; }
  .schedule-fields { align-items: stretch; flex-direction: column; gap: 12px; }
  .schedule-fields label { flex-wrap: wrap; }
  .schedule-fields .button { width: 100%; }
}
@media (max-width: 420px) {
  .folder-tools .file-tools-controls { grid-template-columns: 1fr; }
  .folder-tools .file-sort { max-width: none; }
}

/* Shared settings and overview controls. */
.avatar { overflow: hidden; flex-shrink: 0; }
.avatar img { display: block; width: 100%; height: 100%; object-fit: cover; }
.sidebar-foot, .account-nav, .account-menu { min-width: 0; max-width: 100%; }
.sidebar-foot .account-menu summary { width: 100%; box-sizing: border-box; border: 1px solid var(--line); border-radius: 14px; }
.sidebar-foot .account-name { min-width: 0; max-width: none; font-size: 14px; }
.account-menu summary > .icon { flex: 0 0 14px; margin-left: auto; }
.dialog-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
dialog { max-height: calc(100dvh - 32px); overflow-y: auto; }
.member-list { display: grid; }
.member-row { display: grid; grid-template-columns: minmax(220px, 1fr) minmax(200px, .9fr) auto 36px; gap: 18px; align-items: center; padding: 20px 0; border-top: 1px solid var(--line); }
.member-row .user-cell { min-width: 0; }
.member-row .user-cell > div { min-width: 0; }
.member-row .user-cell strong, .member-row .user-cell small { white-space: normal; overflow-wrap: anywhere; }
.member-role { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 7px; min-width: 0; }
.member-role > small { width: 100%; color: var(--muted); font-size: 12px; }
.member-role .badge { white-space: normal; }
.platform-role { display: flex; align-items: center; gap: 6px; width: 100%; margin-top: 5px; padding-top: 8px; border-top: 1px dashed var(--line); font-size: 12px; color: var(--muted); }
.platform-role .icon { width: 15px; height: 15px; flex-shrink: 0; }
.permission-options { display: grid; gap: 16px; min-width: 0; padding: 14px 0; border: 0; }
.permission-options legend { padding: 0 0 8px; font-size: 14px; font-weight: 650; }
.permission-options .checkbox-label { align-items: flex-start; font-weight: 500; }
.role-defaults { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.role-defaults > div { padding: 18px; border: 1px solid var(--line); border-radius: 14px; }
.role-defaults p { color: var(--muted); font-size: 14px; line-height: 1.6; }
.role-editor { border-top: 1px solid var(--line); margin-top: 18px; padding-top: 14px; }
.role-editor > summary { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; cursor: pointer; padding: 10px 0; list-style: none; }
.role-editor > summary > span { color: var(--muted); font-size: 13px; }
.role-editor > summary > .icon { margin-left: auto; width: 16px; height: 16px; }
.role-editor[open] > summary > .icon { transform: rotate(90deg); }
.role-delete { margin-top: 16px; }
.field-label { font-size: 14px; font-weight: 650; margin-bottom: -10px; }
.custom-select { display: block; width: 100%; }
.custom-select[hidden] { display: none; }
.custom-select > div { width: min(320px, calc(100vw - 32px)); }
.custom-select summary > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.custom-select summary[aria-invalid="true"] { outline: 2px solid var(--danger); outline-offset: 2px; }
.generator-controls { display: grid; grid-template-columns: 130px minmax(0, 1fr) auto; gap: 22px; align-items: end; margin-bottom: 22px; }
.generator-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.generator-options .checkbox-label { font-weight: 500; }
.generator-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
[data-generated-password] { font-family: ui-monospace, monospace; font-size: 16px; letter-spacing: .04em; }
.files-overview-tools { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 20px; }
.folder-overview-card { display: grid; grid-template-columns: minmax(0, 1fr) 36px; align-items: center; }
.folder-overview-card::after { display: none; }
.folder-card-link { display: flex; align-items: center; gap: 14px; min-width: 0; min-height: 60px; color: var(--text); }
.folder-card-link > div { min-width: 0; }
.folder-overview-card > .badge { grid-column: 1 / -1; }
.section-actions { margin-bottom: 20px; }
@media (max-width: 1320px) {
  .member-row { grid-template-columns: minmax(0, 1fr) minmax(180px, .8fr) 36px; }
  .member-row > .status { grid-column: 2; grid-row: 2; }
  .member-row > .actions-menu { grid-column: 3; grid-row: 1; }
  .generator-controls { grid-template-columns: 130px minmax(0, 1fr); }
  .generator-controls > button { grid-column: 1 / -1; justify-self: start; }
}
@media (max-width: 650px) {
  .folder-hero { flex-wrap: wrap; gap: 14px; }
  .folder-hero > .status { margin-left: 56px; }
  .vault-row { display: grid; grid-template-columns: 38px minmax(0, 1fr); gap: 8px 14px; }
  .vault-row > .vault-avatar { grid-column: 1; grid-row: 1 / span 3; align-self: start; }
  .vault-row > .vault-row-main, .vault-row > .badge, .vault-row > .vault-row-actions { grid-column: 2; }
  .vault-row > .badge { justify-self: start; }
  .vault-row-actions { opacity: 1; }
  .member-row { grid-template-columns: minmax(0, 1fr) 36px; gap: 14px; }
  .member-row > .member-role { grid-column: 1; }
  .member-row > .status { grid-column: 1; grid-row: auto; }
  .member-row > .actions-menu { grid-column: 2; grid-row: 1; }
  .role-defaults, .generator-controls { grid-template-columns: minmax(0, 1fr); }
  .generator-options { grid-template-columns: minmax(0, 1fr); }
  .files-overview-tools > .button { width: 100%; }
  .folder-overview-card { padding: 18px !important; }
  .generator-actions > .button { width: 100%; }
}

/* Every popup option shares one icon-and-label row. */
.actions-menu > div > a, .actions-menu > div > button, .actions-menu > div > form > button {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 42px;
  padding: 10px 12px; border: 0; border-radius: 10px; background: transparent;
  color: var(--text-soft); font-size: 14px; line-height: 1.4; font-weight: 550; text-align: left;
  text-decoration: none; cursor: pointer;
}
.actions-menu > div > a:hover, .actions-menu > div > button:hover, .actions-menu > div > form > button:hover { background: var(--surface-soft); color: var(--text); }
.actions-menu > div .icon { display: block; flex: 0 0 18px; width: 18px; height: 18px; }
.actions-menu > div > form { padding: 0; }
.actions-menu .danger { color: var(--danger-strong) !important; }
.actions-menu .danger:hover { background: var(--danger-soft) !important; }

/* Keep the account control visible while long navigation lists scroll. */
.sidebar { overflow: visible; }
.sidebar > .nav { min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.sidebar-foot { flex-shrink: 0; }
@media (min-width: 1001px) and (max-height: 800px) {
  .sidebar-card { display: none; }
  .sidebar .brand { padding-bottom: 18px; }
}
.sidebar > .brand, .sidebar > .company-current, .sidebar > .company-switch, .sidebar > .account-back { flex-shrink: 0; }
.sidebar > .nav { flex: 1 1 auto; min-height: 0; overflow-y: auto; scrollbar-width: thin; padding-bottom: 8px; }
.sidebar > .nav .nav-link { flex-shrink: 0; }
.sidebar-foot { flex: 0 0 auto; padding-top: 14px; }
.mobile-bulk-download { display: none; }
@media (max-width: 1000px) {
  .mobile-bulk-download:not([hidden]) { display: inline-flex; color: var(--primary-strong); background: var(--primary-soft); }
}

/* Scroll within popup content, leaving its controls in view. */
* { scrollbar-width: thin; scrollbar-color: var(--line-hover) transparent; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line-hover); border: 2px solid transparent; border-radius: 20px; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background-color: var(--faint); }
::-webkit-scrollbar-button { display: none; width: 0; height: 0; }
.file-info-dialog[open] { display: flex; flex-direction: column; overflow: hidden; padding: 24px; }
.file-info-dialog > .dialog-head, .file-info-dialog > .dialog-actions { flex: 0 0 auto; }
.file-info-dialog > [data-info-content] { min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable; padding-right: 12px; }
.file-info-dialog .dialog-actions { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
@media (max-width: 650px) { .file-info-dialog[open] { padding: 18px; } }
.file-info-dialog > [data-info-content] { display: flex; flex-direction: column; overflow: hidden; padding-right: 0; }
.file-info-dialog [data-info-content] > .folder-hero, .file-info-dialog [data-info-content] > h2, .file-info-dialog [data-info-content] > .eyebrow { flex: 0 0 auto; }
.file-info-dialog [data-info-content] > .folder-hero { padding-bottom: 18px; margin-bottom: 0; }
.file-info-dialog .file-info-scroll { min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable; padding-right: 10px; }
.file-info-dialog .file-info-list { margin-top: 0; }
.file-info-dialog .folder-hero h2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* Compact checkbox rows and flat buttons across the application. */
input[type="checkbox"], input[type="radio"] { width: 18px; height: 18px; min-height: 18px; padding: 0; accent-color: var(--primary); box-shadow: none; flex: 0 0 18px; }
.checkbox-label { display: flex; flex-direction: row; align-items: center; gap: 10px; font-size: 14px; font-weight: 500; line-height: 1.5; }
.checkbox-label > span { min-width: 0; }
.checkbox-label input { margin: 0; }
.button, .button:hover, .button:active { box-shadow: none !important; }
.button-ghost, .button-light { border-color: var(--line); }
.generator-controls { align-items: center; }
.generator-controls > label { max-width: 150px; font-size: 14px; }
.generator-options .checkbox-label { min-height: 44px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-soft); }
.generator-options .checkbox-label:has(:checked) { border-color: var(--primary-line); background: var(--primary-tint); }
.generator-options { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 650px) {
  .generator-controls { gap: 16px; }
  .generator-options { gap: 10px; }
  .generator-options .checkbox-label { padding: 10px; font-size: 13px; gap: 8px; }
  .generator-controls > button { width: 100%; }
}
.profile-setting-button { width: 100%; text-align: left; border: 0; background: transparent; cursor: pointer; font: inherit; }
.profile-setting-button > div { min-width: 0; }
.password-settings-panel { width: 100%; }
.settings-options { display: grid; gap: 4px; }
.settings-options .profile-setting strong { font-size: 15px; }
.settings-options .profile-setting > div { min-width: 0; }
.settings-options .profile-setting { min-height: 86px; }
.settings-categories { display: grid; gap: 26px; }
.settings-category > h2 { margin: 0 0 10px 4px; font-size: 14px; color: var(--muted); font-weight: 600; letter-spacing: 0; }
.settings-category .panel { padding: 8px; }
.settings-category .profile-setting { min-height: 68px; }
.settings-category .profile-setting .stat-icon { width: 36px; height: 36px; border-radius: 11px; }
.settings-category .profile-setting:first-child { border-top: 0; }
.settings-category .profile-setting strong { font-size: 15px; }
body:has(dialog[open]) { overflow: hidden; }

/* Lists use the space available inside their page, including narrow desktop panes. */
.dashboard-grid { display: grid; gap: 20px; grid-template-columns: minmax(0, 1fr); }
.dashboard-activity { container-type: inline-size; }
.dashboard-activity-row { display: grid; grid-template-columns: 38px minmax(0, 1fr); align-items: start; gap: 5px 14px; padding: 18px 0; }
.dashboard-activity-row > .avatar { grid-column: 1; grid-row: 1 / span 3; }
.dashboard-activity-summary, .dashboard-activity-target, .dashboard-activity-time { grid-column: 2; min-width: 0; }
.dashboard-activity-summary strong { display: block; overflow-wrap: anywhere; }
.dashboard-activity-action { display: block; margin-top: 3px; color: var(--text-soft); font-size: 14px; line-height: 1.5; }
.dashboard-activity-target:empty { display: none; }
.dashboard-activity-target .activity-file { margin: 0; padding: 0; border: 0; border-radius: 4px; background: transparent; font-size: 14px; }
.dashboard-activity-target .activity-file:hover { text-decoration: underline; }
.dashboard-activity-target p.activity-detail { margin: 0; }
.dashboard-activity-time { display: flex; gap: 8px; color: var(--muted); font-size: 12px; white-space: nowrap; }
@container (min-width: 620px) {
  .dashboard-activity-row { grid-template-columns: 38px minmax(180px, .8fr) minmax(0, 1fr) 100px; align-items: center; gap: 18px; }
  .dashboard-activity-row > .avatar { grid-row: 1; }
  .dashboard-activity-summary { grid-column: 2; }
  .dashboard-activity-target { grid-column: 3; }
  .dashboard-activity-time { grid-column: 4; display: grid; gap: 3px; text-align: right; }
}

.public-file-list .file-list-head, .public-file-list .file-row { grid-template-columns: minmax(0, 1fr) 85px 140px 92px; }
.public-file-list .file-row { cursor: default; }
.public-file-action { justify-self: end; }
.public-file-actions { display: flex; align-items: center; justify-content: flex-end; gap: 4px; }
.public-file-actions .icon-button { display: inline-grid; place-items: center; flex: 0 0 44px; width: 44px; height: 44px; }
.public-file-list .file-list-head > span:last-child { display: block; }
.responsive-table td { vertical-align: top; overflow-wrap: anywhere; }
@media (max-width: 1000px) {
  .public-file-list .file-row { grid-template-columns: minmax(0, 1fr) 92px; gap: 12px; min-height: 80px; }
  .public-file-list .file-name { grid-column: 1; grid-row: 1; }
  .public-file-size, .public-file-modified { display: none; }
  .public-file-list .public-file-action, .public-file-list .public-file-actions { grid-column: 2; grid-row: 1; align-self: center; }
}
@media (max-width: 1200px) {
  .table-wrap:has(.responsive-table) { padding: 0; margin: 0; overflow: visible; }
  .responsive-table { display: block; min-width: 0 !important; }
  .responsive-table thead { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .responsive-table tbody { display: grid; gap: 14px; }
  .responsive-table tbody tr { display: block; min-width: 0; padding: 14px; border: 1px solid var(--line); border-radius: 14px; }
  .responsive-table td { display: grid; grid-template-columns: minmax(90px, .42fr) minmax(0, 1fr); gap: 12px; align-items: start; padding: 7px 0; border: 0; text-align: left; font-size: 13px; }
  .responsive-table td[data-label]::before { content: attr(data-label); color: var(--muted); font-size: 12px; }
  .responsive-table .table-item { display: block; padding: 0 0 14px; margin-bottom: 5px; border-bottom: 1px solid var(--line); }
  .responsive-table .user-cell { min-width: 0; align-items: flex-start; }
  .responsive-table .user-cell strong, .responsive-table .user-cell small { overflow-wrap: anywhere; }
  .responsive-table .actions-menu { justify-self: end; }
}

.auth-legal-links{display:flex;justify-content:center;gap:12px;font-size:13px;color:var(--muted);margin-top:16px}.auth-legal-links a:hover{text-decoration:underline}

/* File uploads use the existing dialog, button and surface styles. */
.upload-workspace { display: contents; }
.folder-upload-warning-overlay { position: fixed; inset: 0; z-index: 150; display: grid; place-items: center; padding: 20px; background: rgba(3, 9, 18, .64); backdrop-filter: blur(5px); pointer-events: none; }
.folder-upload-warning-card, .folder-upload-warning-dialog { width: min(500px, calc(100vw - 32px)); padding: clamp(24px, 4vw, 36px); border: 2px solid var(--amber); border-radius: var(--r-lg); background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg); }
.folder-upload-warning-card { display: flex; align-items: center; flex-direction: column; gap: 18px; text-align: center; }
.folder-upload-warning-icon { display: grid; place-items: center; width: 64px; height: 64px; flex-shrink: 0; border-radius: 18px; color: var(--amber-strong); background: var(--amber-soft); }
.folder-upload-warning-icon .icon { width: 32px; height: 32px; }
.folder-upload-warning-title { display: block; margin: 0; font-size: clamp(24px, 3vw, 30px); font-weight: 700; line-height: 1.2; }
.folder-upload-warning-card p, .folder-upload-warning-dialog > p { margin: 0; font-size: 16px; line-height: 1.65; color: var(--text-soft); }
.folder-upload-warning-dialog { max-height: calc(100dvh - 32px); overflow-y: auto; }
.folder-upload-warning-dialog .dialog-head { align-items: flex-start; margin-bottom: 24px; }
.folder-upload-warning-dialog > p { margin-top: 16px; }
.folder-upload-warning-dialog .dialog-actions { margin-top: 26px; }
.upload-dialog { width: min(580px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); overflow-y: auto; }
.upload-dialog .dialog-head { align-items: flex-start; gap: 12px; }
.upload-dialog .dialog-head > div { min-width: 0; }
.upload-dialog .dialog-head .help-text { margin: 6px 0 0; }
.upload-dialog .dialog-head .icon-button { flex-shrink: 0; }
.upload-destination { margin: 0; color: var(--text-soft); font-size: 14px; overflow-wrap: anywhere; }
.upload-dialog .upload-folder-picker { position: relative; flex-direction: row; gap: 8px; cursor: pointer; }
.upload-folder-picker:focus-within { outline: 2px solid var(--primary); outline-offset: 3px; }
.upload-folder-picker.is-disabled { opacity: .6; cursor: wait; }
.upload-selection > strong { font-size: 14px; line-height: 1.5; }
.upload-queue { max-height: min(220px, 28dvh); overflow-y: auto; overscroll-behavior: contain; list-style: none; padding: 0; margin: 10px 0 0; border: 1px solid var(--line); border-radius: var(--r-sm); }
.upload-queue li { display: grid; grid-template-columns: minmax(0, 1fr) minmax(60px, .45fr); gap: 12px; padding: 10px 12px; font-size: 13px; }
.upload-queue li + li { border-top: 1px solid var(--line); }
.upload-queue li > span { overflow-wrap: anywhere; }
.upload-queue small { text-align: right; color: var(--muted); overflow-wrap: anywhere; }
.upload-queue [data-status="done"] small { color: var(--success-strong); }
.upload-queue [data-status="error"] small { color: var(--danger); }
.upload-queue [data-status="invalid"] small { color: var(--danger-strong); }
.upload-error { display: block; border: 1px solid var(--danger-line); padding: 16px; }
.upload-error[hidden] { display: none; }
.upload-error strong { display: block; font-size: 16px; }
.upload-error p { margin: 8px 0 0; line-height: 1.6; overflow-wrap: anywhere; }
.upload-status { margin: 0; overflow-wrap: anywhere; }
.upload-progress progress { display: block; width: 100%; height: 8px; accent-color: var(--primary); }
.file-drop-overlay { position: fixed; inset: 12px; z-index: 150; display: grid; place-items: center; padding: 20px; border: 3px dashed var(--primary); border-radius: var(--r-lg); background: var(--surface); opacity: .96; pointer-events: none; }
.file-drop-overlay[hidden] { display: none; }
.file-drop-prompt { display: flex; align-items: center; flex-direction: column; gap: 16px; max-width: 480px; text-align: center; color: var(--text-soft); }
.file-drop-prompt .drop-icon { width: 64px; height: 64px; background: var(--primary-soft); }
.file-drop-prompt .drop-icon .icon { width: 30px; height: 30px; }
.file-drop-prompt strong { color: var(--primary-strong); font-size: clamp(20px, 2.2vw, 28px); }
.folder-tools .breadcrumbs { min-width: 0; }
.folder-tools .breadcrumbs a { min-width: 0; max-width: 100%; overflow-wrap: anywhere; }
@media (min-width: 1001px) {
  .folder-tools .file-tools-controls { flex: 1 1 300px; }
  .folder-tools .file-summary { flex: 0 1 auto; }
}
@media (max-width: 620px) {
  .upload-dialog { padding: 20px; }
  .upload-dialog .dialog-actions .button { flex: 1 1 auto; }
  .folder-tools .toolbar-actions { flex-wrap: wrap; }
  .folder-tools .toolbar-actions .folder-info-button { flex: 0 0 44px; }
}

/* Bounded previews share the file browser's light and dark theme. */
.file-preview-dialog { inset: 0; width: 100vw; max-width: none; height: 100dvh; max-height: none; margin: 0; padding: 0; border: 0; border-radius: 0; box-shadow: none; }
.file-preview-dialog[open] { display: flex; flex-direction: column; gap: 0; overflow: hidden; }
.file-preview-dialog > .dialog-head { margin: 0; padding: max(12px, env(safe-area-inset-top)) 24px 12px; gap: 16px; flex: 0 0 auto; border-bottom: 1px solid var(--line); }
.file-preview-dialog > .dialog-head .icon-button { display: inline-grid; place-items: center; width: 44px; height: 44px; }
.preview-title-copy { min-width: 0; }
.preview-title-copy h2 { overflow-wrap: anywhere; margin: 4px 0 0; }
.preview-title-copy .eyebrow { margin: 0; }
.file-preview-dialog > [data-preview-status] { display: grid; place-items: center; flex: 1 1 auto; margin: 0; padding: 24px; text-align: center; }
.file-preview-stage { min-height: 160px; min-width: 0; overflow: auto; overscroll-behavior: contain; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); }
.file-preview-dialog > .file-preview-stage { display: flex; align-items: center; justify-content: center; flex: 1 1 0; min-height: 0; border: 0; border-radius: 0; }
.file-preview-stage[hidden], .file-preview-dialog [hidden] { display: none; }
.file-preview-image { display: block; max-width: 100%; max-height: 65dvh; width: auto; height: auto; object-fit: contain; margin: 0 auto; }
.file-preview-text { margin: 0; padding: 20px; min-height: 160px; max-height: 65dvh; overflow: auto; color: var(--text); font: 13px/1.7 ui-monospace, SFMono-Regular, Consolas, monospace; white-space: pre-wrap; overflow-wrap: anywhere; tab-size: 4; }
.file-preview-dialog .file-preview-image { width: 100%; height: 100%; max-height: 100%; object-fit: contain; }
.file-preview-dialog .file-preview-text { width: 100%; height: 100%; min-height: 0; max-height: none; box-sizing: border-box; }
.preview-footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex: 0 0 auto; }
.preview-footer .help-text { margin: 0; }
.file-preview-dialog > .preview-footer { padding: 12px 24px max(12px, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }
.preview-page { width: min(1120px, calc(100% - 32px)); margin: 32px auto; }
.preview-page-head { margin-bottom: 24px; }
.preview-card { padding: 24px; }
.preview-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.preview-heading > div { min-width: 0; }
.preview-heading h1 { font-size: 22px; overflow-wrap: anywhere; margin: 4px 0 0; }
.preview-heading .eyebrow { margin: 0; }
.preview-card > .preview-footer { margin-top: 20px; }
@media (max-width: 650px) {
  .preview-card { padding: 16px; }
  .file-preview-dialog > .dialog-head { padding-right: 16px; padding-left: 16px; }
  .file-preview-dialog > .preview-footer { padding-right: 16px; padding-left: 16px; }
  .preview-heading { align-items: flex-start; }
  .preview-heading .button { flex-shrink: 0; }
  .preview-footer { gap: 10px; }
  .preview-footer .help-text { font-size: 11px; }
  .file-preview-text { padding: 14px; }
}
