/* ===================================================================
   Lightbox — application stylesheet
   Design system per client mockups: violet accent, light icon
   sidebar, white cards on cool gray, pill statuses.
   =================================================================== */

:root {
  --accent:       #6D5DF6;
  --accent-deep:  #5847E0;
  --accent-weak:  #EFEDFE;
  --teal:         #00D1A3;
  --bg:           #F8F9FB;
  --card:         #FFFFFF;
  --line:         #E8EBF0;
  --ink:          #16181D;
  --muted:        #6B7280;
  --danger:       #E5484D;
  --warn:         #C2570B;
  --ok:           #0B8A60;
  --radius:       14px;
  --shadow:       0 1px 3px rgba(16,24,40,.04), 0 1px 2px rgba(16,24,40,.03), 0 0 0 1px var(--line);
  --font:         'Inter', -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Inter', -apple-system, 'Segoe UI', Roboto, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  font-size: 14px;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-family: var(--font-display); letter-spacing: -0.015em; font-weight: 700; }
a { color: var(--accent); }
a:hover { color: var(--accent-deep); }

/* ---------- app shell ---------- */
.shell { display: flex; min-height: 100vh; }

.sidebar {
  width: 260px; flex: none;
  background: var(--card);
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; z-index: 20;
  transition: width .2s ease, transform .2s ease;
}
/* Desktop collapse: shrink to a skinny icon-only rail; labels appear on hover. */
@media (min-width: 821px) {
  body.sidebar-collapsed .sidebar { width: 64px; }
  /* The nav normally scrolls (overflow-y:auto), which would clip the hover
     tooltip. Collapsed, the icon rail is short, so let overflow show. */
  body.sidebar-collapsed .sidebar-nav { overflow: visible; }
  body.sidebar-collapsed .sidebar { overflow: visible; }
  body.sidebar-collapsed .sidebar-nav a { justify-content: center; padding: 10px 0; position: relative; }
  body.sidebar-collapsed .sidebar-nav a .nav-text { display: none; }
  body.sidebar-collapsed .sidebar-nav .nav-label { display: none; }
  body.sidebar-collapsed .sidebar-brand { justify-content: center; padding-left: 0; padding-right: 0; }
  body.sidebar-collapsed .sidebar-brand .brand-text,
  body.sidebar-collapsed .sidebar-brand { font-size: 0; gap: 0; }   /* hide agency name, keep mark */
  body.sidebar-collapsed .sidebar-brand .brand-mark { font-size: initial; }
  body.sidebar-collapsed .sidebar-foot {
    flex-direction: column; align-items: center; gap: 10px;
    padding-left: 0; padding-right: 0;
  }
  body.sidebar-collapsed .sidebar-foot .who { display: none; }
  body.sidebar-collapsed .signout-link .signout-text { display: none; }
  body.sidebar-collapsed .signout-link .signout-icon { display: inline-block; }
  body.sidebar-collapsed .signout-link {
    margin: 0; position: relative; display: inline-flex; align-items: center; justify-content: center;
    width: 34px; height: 34px; border-radius: 8px;
  }
  body.sidebar-collapsed .signout-link:hover { background: var(--bg); }
  body.sidebar-collapsed .signout-link::after {
    content: attr(data-label);
    position: absolute; left: calc(100% + 10px); top: 50%; transform: translateY(-50%);
    background: var(--ink, #16181D); color: #fff; font-size: 12.5px; font-weight: 600;
    padding: 5px 9px; border-radius: 7px; white-space: nowrap;
    opacity: 0; pointer-events: none; transition: opacity .12s; z-index: 70;
    box-shadow: 0 4px 14px rgba(0,0,0,.25);
  }
  body.sidebar-collapsed .signout-link:hover::after { opacity: 1; }

  /* Hover tooltip showing the item's label */
  body.sidebar-collapsed .sidebar-nav a::after {
    content: attr(data-label);
    position: absolute; left: calc(100% + 10px); top: 50%; transform: translateY(-50%);
    background: var(--ink, #16181D); color: #fff; font-size: 12.5px; font-weight: 600;
    padding: 5px 9px; border-radius: 7px; white-space: nowrap;
    opacity: 0; pointer-events: none; transition: opacity .12s; z-index: 70;
    box-shadow: 0 4px 14px rgba(0,0,0,.25);
  }
  body.sidebar-collapsed .sidebar-nav a:hover::after { opacity: 1; }
}
.sidebar-brand {
  display: flex; align-items: center; gap: 10px;
  padding: 20px 18px 16px;
  font-weight: 700; font-size: 15px; letter-spacing: -0.01em;
  color: var(--ink);
}
.brand-mark {
  display: inline-flex; width: 26px; height: 26px; flex: none;
  background: linear-gradient(135deg, var(--accent) 0%, #9B7BFF 100%);
  border-radius: 8px;
  align-items: center; justify-content: center;
}
.brand-mark::after {
  content: ''; width: 10px; height: 10px;
  background: #fff; border-radius: 2px; transform: rotate(45deg); opacity: .92;
}
.sidebar-nav { padding: 4px 10px; flex: 1; overflow-y: auto; }
.sidebar-nav a {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 12px; margin: 1px 0;
  border-radius: 9px;
  color: #5A6072; text-decoration: none;
  font-weight: 500; font-size: 13.5px;
}
.sidebar-nav a svg { width: 18px; height: 18px; flex: none; opacity: .75; }
.sidebar-nav a:hover { background: #F3F4F8; color: var(--ink); }
.sidebar-nav a.active { background: var(--accent-weak); color: var(--accent); }
.sidebar-nav a.active svg { opacity: 1; }
.sidebar-nav a.soon { opacity: .5; cursor: default; pointer-events: none; }
.sidebar-nav a.soon .soon-tag {
  margin-left: auto; font-size: 9px; font-weight: 700; letter-spacing: .04em;
  text-transform: uppercase; color: var(--muted);
  background: var(--bg); border: 1px solid var(--line); border-radius: 5px; padding: 1px 5px;
}
.sidebar-nav .nav-label {
  padding: 16px 11px 6px;
  font-size: 10.5px; font-weight: 600; letter-spacing: .08em;
  text-transform: uppercase; color: var(--muted);
}
.sidebar-foot {
  border-top: 1px solid var(--line);
  padding: 14px 16px;
  display: flex; align-items: center; gap: 10px;
  font-size: 13px;
}
.signout-icon { display: none; }
.signout-link .signout-text { display: inline; }
.sidebar-foot .who { font-weight: 600; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-foot .who small { display: block; font-weight: 400; color: var(--muted); font-size: 11.5px; }
.sidebar-foot a { color: var(--muted); text-decoration: none; font-size: 12.5px; }
.sidebar-foot a:hover { color: var(--accent); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 20px 34px;
  background: var(--card); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 5;
}
.topbar h1 { margin: 0; font-size: 26px; font-weight: 700; letter-spacing: -0.02em; }
.topbar .actions { display: flex; gap: 10px; }
.topbar-burger {
  display: none; align-items: center; justify-content: center;
  width: 40px; height: 40px; flex: none; padding: 0;
  background: none; border: none; color: var(--ink); cursor: pointer;
  border-radius: 9px;
}
.topbar-burger:hover { background: var(--bg); }
.topbar-collapse {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; flex: none; padding: 0;
  background: none; border: none; color: var(--muted); cursor: pointer;
  border-radius: 9px;
}
.topbar-collapse:hover { background: var(--bg); color: var(--ink); }
@media (max-width: 820px) { .topbar-collapse { display: none; } }
.sidebar-scrim { display: none; }
@media (max-width: 820px) { .sidebar-scrim { display: block; } }
.content { padding: 30px 34px 56px 28px; max-width: 1600px; width: 100%; }
/* Pages that should use the full available width (e.g. the asset viewer, so the
   center column grows when the sidebar is collapsed while the rail stays fixed). */
.content-wide { max-width: none; }

/* ---------- cards & stats ---------- */
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
  margin-bottom: 0;
}
.card h2 { margin: 0 0 14px; font-size: 18px; }
.card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.card-head h3 { margin: 0; font-size: 16px; }
.card-form { max-width: 640px; }

.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: 1fr 1fr; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-2-1 { display: grid; grid-template-columns: 2fr 1fr; gap: 18px; align-items: start; }
.stack { display: grid; gap: 18px; }

.stat { padding: 18px 20px; }
.stat .stat-num { font-size: 27px; font-weight: 700; letter-spacing: -0.02em; }
.stat .stat-label { color: var(--muted); font-size: 12.5px; margin-top: 3px; font-weight: 500; }
.stat-delta { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; color: var(--ok); margin-top: 7px; }
.stat-delta.flat { color: var(--muted); }
.stat-delta svg { width: 13px; height: 13px; }

/* ---------- progress / storage ---------- */
.progress { height: 8px; background: #EDEFF4; border-radius: 99px; overflow: hidden; }
.progress > span { display: block; height: 100%; border-radius: 99px; background: var(--accent); }
.progress.warn > span { background: var(--warn); }
.storage-rows { margin-top: 14px; display: grid; gap: 9px; font-size: 13px; }
.storage-rows > div { display: flex; justify-content: space-between; align-items: center; }
.storage-rows .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 8px; background: var(--accent); }

/* ---------- tables ---------- */
table.data { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.data th, table.data td { text-align: left; padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.data th {
  font-size: 10.5px; font-weight: 600; letter-spacing: .07em;
  text-transform: uppercase; color: var(--muted);
  border-bottom: 1px solid var(--line);
}
table.data tr:last-child td { border-bottom: 0; }
table.data tbody tr:hover td, table.data tr:hover td { background: #FAFAFC; }
table.data td:first-child, table.data th:first-child { padding-left: 4px; }
table.data td:last-child, table.data th:last-child { padding-right: 4px; }
.right { text-align: right; }
.row-link { font-weight: 600; color: var(--ink); text-decoration: none; }
.row-link:hover { color: var(--accent); }
.row-actions { text-align: right; white-space: nowrap; }
.row-actions form { display: inline; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.mt0 { margin-top: 0; }

/* project / asset thumbnails */
.thumb {
  display: inline-flex; width: 38px; height: 38px; flex: none;
  border-radius: 9px; margin-right: 12px;
  align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: 13px;
  background: linear-gradient(135deg, var(--accent), #9B7BFF);
}
.thumb.t2 { background: linear-gradient(135deg, #0EA5E9, #6366F1); }
.thumb.t3 { background: linear-gradient(135deg, #F59E0B, #EF4444); }
.thumb.t4 { background: linear-gradient(135deg, #10B981, #0EA5E9); }
.thumb-cell { display: flex; align-items: center; min-width: 0; }
.avatar {
  display: inline-flex; width: 32px; height: 32px; flex: none;
  border-radius: 50%; align-items: center; justify-content: center;
  background: var(--accent-weak); color: var(--accent);
  font-size: 12px; font-weight: 700; margin-right: 10px;
}
.user-cell { display: flex; align-items: center; }

/* ---------- chips ---------- */
.chip {
  display: inline-block; padding: 3px 10px; border-radius: 99px;
  font-size: 11.5px; font-weight: 600;
  background: #EEF0F4; color: #5A6072; white-space: nowrap;
}
.chip-active, .chip-approved, .chip-completed { background: #E3F9F0; color: var(--ok); }
.chip-in_review, .chip-awaiting, .chip-past_due { background: #FFF1E0; color: var(--warn); }
.chip-planning { background: #E8F1FF; color: #2563EB; }
.chip-trialing { background: var(--accent-weak); color: var(--accent); }
.chip-draft, .chip-archived, .chip-cancelled, .chip-muted { background: #EEF0F4; color: #5A6072; }
.chip-changes, .chip-rejected, .chip-unpaid { background: #FDEAEA; color: var(--danger); }
.chip-warn { background: #FFF1E0; color: var(--warn); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 8px 15px; border-radius: 9px;
  font-family: var(--font); font-size: 13px; font-weight: 600;
  border: 1px solid transparent; cursor: pointer; text-decoration: none;
  transition: background .12s, border-color .12s, color .12s;
  line-height: 1.35;
}
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { background: var(--accent-deep); color: #fff; }
.btn-outline { background: var(--card); color: var(--ink); border-color: #D8DBE4; }
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #C53A3F; color: #fff; }
.btn-sm { padding: 5px 11px; font-size: 12px; border-radius: 7px; }

/* ---------- forms ---------- */
form label { display: block; font-weight: 600; font-size: 12.5px; margin: 0 0 14px; color: var(--ink); }
form label input, form label select, form label textarea { margin-top: 6px; font-weight: 400; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-row label { margin-bottom: 14px; }
input[type=text], input[type=email], input[type=password], input[type=date],
input[type=url], input[type=number], input[type=search], select, textarea {
  width: 100%; padding: 9px 12px;
  border: 1px solid #D8DBE4; border-radius: 9px;
  font-family: var(--font); font-size: 13.5px; color: var(--ink);
  background: var(--card);
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--accent-weak);
  border-color: var(--accent);
}
input::placeholder { color: #A7ACBA; }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; }
.inline-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.inline-form input, .inline-form select { width: auto; min-width: 150px; }

/* ---------- toolbar / filters / tabs ---------- */
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.toolbar-search input { width: 260px; }
.filters { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.filters input, .filters select { width: auto; min-width: 160px; }
.toolbar-tabs { display: flex; gap: 3px; background: #EBEDF3; border-radius: 9px; padding: 3px; }
.toolbar-tabs a { padding: 6px 14px; border-radius: 7px; font-size: 12.5px; font-weight: 600; color: var(--muted); text-decoration: none; }
.toolbar-tabs a.active { background: var(--card); color: var(--ink); box-shadow: 0 1px 2px rgba(23,25,35,.1); }

.breadcrumb { font-size: 12.5px; color: var(--muted); margin-bottom: 16px; display: flex; gap: 7px; align-items: center; flex-wrap: wrap; font-weight: 500; }
.breadcrumb a { color: var(--muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb { margin-bottom: 8px; }
.folder-headline { margin: 0 0 18px; }
.folder-title { margin: 0; font-size: 26px; font-weight: 700; letter-spacing: -0.02em; color: var(--ink); display: inline-block; max-width: 100%; }
.folder-title.editable { cursor: text; padding: 2px 6px; margin-left: -6px; border-radius: 8px; transition: background .12s; }
.folder-title.editable:hover { background: var(--bg); }
.folder-title-input { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; color: var(--ink);
  border: 2px solid var(--accent); border-radius: 8px; padding: 0 6px; margin-left: -8px;
  font-family: inherit; line-height: 1.3; min-width: 280px; max-width: 100%; outline: none; }

/* ---------- feeds / lists ---------- */
.activity-feed { list-style: none; margin: 0; padding: 0; }
.activity-feed li { padding: 10px 0; border-bottom: 1px solid var(--line); display: grid; gap: 3px; }
.activity-feed li:last-child { border-bottom: 0; padding-bottom: 0; }
.activity-feed li:first-child { padding-top: 0; }
.feed-text { font-size: 13px; }
.feed-meta { font-size: 11.5px; color: var(--muted); }

dl.dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; font-size: 13.5px; }
dl.dl dt { color: var(--muted); font-weight: 500; }
dl.dl dd { margin: 0; }

/* ---------- flash + empty ---------- */
.flash { padding: 12px 16px; border-radius: 10px; margin-bottom: 18px; font-size: 13.5px; font-weight: 500; }
.flash-success { background: #E3F9F0; color: var(--ok); }
.flash-error { background: #FDEAEA; color: var(--danger); }
.flash-info { background: var(--accent-weak); color: var(--accent-deep); }

.empty { text-align: center; padding: 44px 20px; color: var(--muted); font-size: 13.5px; }
.empty .big, .empty h3 { font-size: 16px; font-weight: 700; color: var(--ink); margin: 0 0 6px; }
.empty p { margin: 0 0 16px; }

/* ---------- auth screens ---------- */
.auth-wrap { display: flex; min-height: 100vh; background: var(--card); }

/* form half */
.auth-main {
  flex: 1; position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 40px 32px;
}
.auth-brand {
  position: absolute; top: 30px; left: 36px;
  display: flex; align-items: center; gap: 11px;
  text-decoration: none; color: var(--ink);
}
.auth-logo {
  width: 30px; height: 30px; border-radius: 9px;
  background: linear-gradient(140deg, #8B7DF8 0%, #6D5DF6 50%, #4A39CC 100%);
  box-shadow: 0 2px 8px rgba(109,93,246,.35);
}
.auth-wordmark { font-weight: 700; font-size: 17px; letter-spacing: -0.01em; }
.auth-card { width: 100%; max-width: 360px; }
.auth-card h1 { font-size: 26px; margin: 0 0 7px; letter-spacing: -0.02em; }
.auth-card .sub { color: var(--muted); font-size: 14px; margin: 0 0 30px; }
.auth-card form label { margin-bottom: 20px; }
.auth-card input[type=text], .auth-card input[type=email],
.auth-card input[type=password] { padding: 11px 13px; font-size: 14.5px; }
.auth-card .btn { width: 100%; padding: 11px; font-size: 14.5px; margin-top: 4px; }
.auth-card .alt { margin-top: 26px; font-size: 13px; color: var(--muted); text-align: center; }

/* image half */
.auth-side {
  flex: 1; max-width: 50%; order: 2;
  background-size: cover; background-position: center; background-repeat: no-repeat;
  position: relative; overflow: hidden;
}
/* Soft concave curve on the image's left edge. A wide, full-height ellipse in
   the page (card) color overlaps the image's left side; only its curved right
   flank shows, scooping the edge inward. Scales with the panel height. */
.auth-side::before {
  content: ""; position: absolute;
  top: -50%; bottom: -50%; left: -70px;
  width: 130px; background: var(--card);
  border-radius: 0 100% 100% 0 / 0 50% 50% 0;
  pointer-events: none; z-index: 1;
}
.auth-side:not(.has-hero) {
  background-image:
    radial-gradient(120% 90% at 85% 10%, rgba(255,255,255,.18) 0%, transparent 50%),
    radial-gradient(100% 100% at 10% 95%, #8B7DF8 0%, transparent 55%),
    linear-gradient(160deg, #6D5DF6 0%, #4A39CC 55%, #2A1E7A 100%);
}

/* ---------- setup wizard steps ---------- */
.steps { display: flex; gap: 6px; margin-bottom: 24px; }
.steps span { height: 4px; flex: 1; background: #EBEDF3; border-radius: 99px; }
.steps span.done { background: var(--accent); }

/* ---------- responsive ---------- */
@media (max-width: 1080px) {
  .grid-4 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 980px) {
  .grid-2, .grid-3, .grid-2-1 { grid-template-columns: 1fr; }
  .auth-side { display: none; }
}
@media (max-width: 820px) {
  /* Sidebar becomes an off-canvas drawer */
  .sidebar {
    position: fixed; top: 0; left: 0; height: 100vh; height: 100dvh; width: 248px; z-index: 60;
    transform: translateX(-100%); transition: transform .22s ease;
    box-shadow: 0 0 40px rgba(0,0,0,.18);
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-scrim {
    position: fixed; inset: 0; background: rgba(20,20,35,.42); z-index: 55;
    opacity: 0; pointer-events: none; transition: opacity .22s ease;
  }
  .sidebar-scrim.show { opacity: 1; pointer-events: auto; }
  body.sidebar-open { overflow: hidden; }
  /* Drawer shows full labels again (it is no longer a cramped rail) */
  .sidebar-brand { justify-content: flex-start; padding: 20px 18px 16px; font-size: 15px; gap: 10px; }
  .sidebar-nav a { justify-content: flex-start; padding: 10px 12px; font-size: 13.5px; gap: 11px; }
  .sidebar-nav .nav-label, .sidebar-foot .who { display: block; }
  .sidebar-foot { justify-content: flex-start; flex-wrap: wrap; gap: 8px 10px; }
  .sidebar-foot a { margin-left: auto; }

  /* Topbar: show burger, condense actions */
  .topbar-burger { display: inline-flex; }
  .topbar { padding-left: 14px; padding-right: 14px; gap: 10px; }
  .topbar h1 { font-size: 21px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .topbar .actions { gap: 6px; flex: none; }
  /* Collapse the search pill to an icon-only button */
  .topbar-search-hint { padding: 8px; gap: 0; }
  .topbar-search-hint span.search-text, .topbar-search-hint kbd { display: none; }
  /* Page-specific action buttons (Download / Share / New version, etc.):
     compact on mobile so the topbar row never overflows. */
  .topbar .actions .btn { padding: 7px 10px; font-size: 12.5px; }
  .topbar .actions .btn-icon span { display: none; }   /* icon-only (e.g. Share) */
  .topbar .actions .dl-caret { display: none; }

  .content, .topbar { padding-left: 14px; padding-right: 14px; }
  .grid-4 { grid-template-columns: 1fr; }
}

/* ---------- mobile: tables become cards, tabs scroll, card gutters ---------- */
@media (max-width: 720px) {
  /* Any data table opted-in with data-label cells reflows to stacked cards */
  table.data.cards-on-mobile,
  table.data.cards-on-mobile thead,
  table.data.cards-on-mobile tbody,
  table.data.cards-on-mobile tr,
  table.data.cards-on-mobile td { display: block; width: 100%; }
  table.data.cards-on-mobile thead { position: absolute; left: -9999px; }
  table.data.cards-on-mobile tr {
    background: var(--card); border: 1px solid var(--line); border-radius: 12px;
    padding: 6px 14px; margin-bottom: 12px; box-shadow: var(--shadow);
  }
  table.data.cards-on-mobile tr:hover td { background: transparent; }
  table.data.cards-on-mobile td {
    border-bottom: 1px solid var(--line);
    padding: 10px 0; text-align: left;
    display: flex; align-items: center; justify-content: space-between; gap: 14px;
  }
  table.data.cards-on-mobile td:last-child { border-bottom: 0; }
  table.data.cards-on-mobile td:first-child,
  table.data.cards-on-mobile td:last-child { padding-left: 0; padding-right: 0; }
  /* Label each value with the column name */
  table.data.cards-on-mobile td[data-label]::before {
    content: attr(data-label);
    font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
    color: var(--muted); flex: none; margin-right: 12px;
  }
  /* The primary cell (name/link) reads as a card header: full width, no label */
  table.data.cards-on-mobile td.cell-primary {
    display: block; padding-top: 14px;
    font-size: 15px;
  }
  table.data.cards-on-mobile td.cell-primary::before { display: none; }
  /* Action cell (buttons, role select) gets full width to avoid overflow */
  table.data.cards-on-mobile td.row-actions,
  table.data.cards-on-mobile td.cell-control { display: block; }
  table.data.cards-on-mobile td.row-actions::before,
  table.data.cards-on-mobile td.cell-control::before { display: block; margin-bottom: 6px; }
  table.data.cards-on-mobile td.cell-control select,
  table.data.cards-on-mobile td.cell-control .select,
  table.data.cards-on-mobile td.row-actions form,
  table.data.cards-on-mobile td.row-actions .btn { width: 100%; max-width: 100%; }

  /* Settings / section tabs: horizontal scroll instead of overflow */
  .tabs {
    flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .tabs::-webkit-scrollbar { display: none; }
  .tabs a { white-space: nowrap; flex: none; }

  /* Asset cards: single column; .content padding provides the edge gutter */
  .asset-grid { grid-template-columns: 1fr; }

  /* Filter chip rows / inline filter bars: allow wrap or scroll, not clip */
  .filter-row, .chip-row { flex-wrap: wrap; }

  /* Toolbars: search goes full width so it can't overflow */
  .toolbar-search { flex: 1 1 100%; }
  .toolbar-search input { width: 100%; }
  /* Share-link copy field: never wider than its card */
  .link-url { max-width: 100%; flex-wrap: wrap; }
}

/* Horizontal-scroll wrapper for tables that stay tabular on mobile
   (e.g. file browser with a selection column). Use instead of cards
   when a stacked layout would lose meaning. */
.table-scroll { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
@media (max-width: 720px) {
  .table-scroll > table.data { min-width: 560px; }
}

/* ---------- asset browser ---------- */
.browser { display: grid; grid-template-columns: 230px 1fr; gap: 18px; align-items: start; }
.folder-pane { padding: 10px 10px 10px 4px; min-width: 0; overflow: hidden; }
.folder-tree { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1px; }
.folder-node { display: block; }
.folder-children { display: none; }
.folder-children.is-open { display: block; }

.folder-row {
  display: flex; align-items: center; gap: 0; min-width: 0;
  padding: 0 6px 0 var(--fi-pad, 0px);
  border-radius: 8px; position: relative;
  color: #5A6072;
}
.folder-row:hover { background: #F3F4F8; }
.folder-row.active { background: var(--accent-weak); }
.folder-row.active .fi-link, .folder-row.active .fi-folder { color: var(--accent); }

/* caret toggle */
.fi-caret {
  flex: none; width: 16px; height: 28px; padding: 0; margin: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: none; border: 0; cursor: pointer; color: var(--muted);
  border-radius: 6px;
}
.fi-caret:hover { background: rgba(0,0,0,.06); color: var(--ink); }
.fi-caret svg { width: 14px; height: 14px; transition: transform .15s ease; }
.fi-caret.is-open svg { transform: rotate(90deg); }
.fi-caret--blank { cursor: default; pointer-events: none; }

/* folder name link (navigates) */
.fi-link {
  flex: 1 1 auto; min-width: 0;
  display: flex; align-items: center; gap: 9px;
  padding: 7px 8px 7px 2px; color: inherit; text-decoration: none;
  font-size: 13px; font-weight: 500;
}
.fi-link:hover { color: var(--ink); }
.fi-folder { width: 16px; height: 16px; flex: none; opacity: .7; }
.fi-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.folder-row .count { margin-left: auto; font-size: 11px; color: var(--muted); flex: none; }

/* hover actions: + and ⋯ — overlaid on the row's right edge (Air-style), so they
   don't reserve space and the name can use the full width. A gradient lead-in
   fades the name out underneath them rather than letting text show through. */
.fi-actions {
  position: absolute; top: 0; right: 4px; bottom: 0; z-index: 2;
  display: flex; align-items: center; gap: 1px; padding-left: 24px;
  opacity: 0; pointer-events: none; transition: opacity .12s ease;
  /* fade matches the row hover background */
  background: linear-gradient(to right, rgba(243,244,248,0) 0%, #F3F4F8 24px, #F3F4F8 100%);
}
.folder-row:hover .fi-actions { opacity: 1; pointer-events: auto; }
.folder-row.active .fi-actions {
  background: linear-gradient(to right, var(--accent-weak-0, rgba(109,93,246,0)) 0%, var(--accent-weak) 24px, var(--accent-weak) 100%);
}
.fi-act {
  width: 26px; height: 26px; padding: 0; border: 0; background: none;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 6px; cursor: pointer; color: var(--muted);
}
.fi-act:hover { background: rgba(0,0,0,.08); color: var(--ink); }
.fi-act svg { width: 15px; height: 15px; }
/* hide the count on hover so it doesn't sit under the overlaid actions */
.folder-row:hover .count { visibility: hidden; }

/* ⋯ popover menu */
.folder-menu {
  position: absolute; z-index: 1200; min-width: 168px;
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 12px 32px rgba(16,18,29,.16); padding: 6px;
  display: grid; gap: 1px;
}
.folder-menu .fm-item {
  display: block; width: 100%; text-align: left;
  padding: 9px 12px; border: 0; background: none; border-radius: 8px;
  font-size: 13px; font-weight: 500; color: var(--ink); cursor: pointer;
}
.folder-menu .fm-item:hover { background: #F3F4F8; }
.folder-menu .fm-danger { color: #D6453D; }
.folder-menu .fm-danger:hover { background: #FDECEA; }

.new-folder { border-top: 1px solid var(--line); margin-top: 10px; padding-top: 12px; }
.new-folder .nf-label { font-size: 11.5px; color: var(--muted); margin-bottom: 7px; }
.new-folder .nf-label strong { color: var(--ink); font-weight: 600; }
.new-folder .nf-form { display: flex; gap: 7px; }
.new-folder .nf-form input { min-width: 0; flex: 1; font-size: 13px; }

.asset-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; position: relative; }
.marquee-box {
  position: absolute; z-index: 5; pointer-events: none;
  border: 1px solid var(--accent); background: rgba(109, 93, 246, .10); border-radius: 2px;
}
.asset-card.marquee-hit { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: 10px; }
.asset-card { position: relative; display: flex; flex-direction: column; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.asset-thumb {
  display: flex; align-items: center; justify-content: center;
  aspect-ratio: 4 / 3; background: #F1F2F6; position: relative; overflow: hidden;
}
.asset-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.type-glyph { width: 40px; height: 40px; color: #A7ACBA; }
.type-glyph svg { width: 100%; height: 100%; }
.type-image { color: #6B46FF; } .type-video { color: #0EA5E9; }
.type-design { color: #F59E0B; } .type-document { color: #10B981; }
.thumb-status { position: absolute; left: 8px; bottom: 8px; }
.asset-meta { display: block; padding: 9px 11px 11px; }
.asset-folder-tag { color: var(--accent); }
.asset-name {
  display: block; font-size: 12.5px; font-weight: 600; color: var(--ink);
  text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.asset-name:hover { color: var(--accent); }
.asset-card .pick {
  position: absolute; top: 8px; left: 8px; z-index: 2; margin: 0;
  opacity: 0; transition: opacity .12s;
}
.asset-card:hover .pick, .asset-card .pick:has(input:checked) { opacity: 1; }
.asset-card .pick input { width: 17px; height: 17px; accent-color: var(--accent); }

.folder-card {
  display: flex; flex-direction: column;
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  text-decoration: none; position: relative; overflow: hidden;
}
.fc-cover {
  display: grid; gap: 2px; aspect-ratio: 4 / 3; background: #F1F2F6;
  align-items: center; justify-items: center; overflow: hidden;
}
.fc-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.fc-cover > svg { width: 34px; height: 34px; color: #C9CCD6; }
.fc-cover.covers-1 { grid-template: 1fr / 1fr; }
.fc-cover.covers-2 { grid-template: 1fr / 1fr 1fr; }
.fc-cover.covers-3 { grid-template: 1fr 1fr / 1fr 1fr; }
.fc-cover.covers-3 img:first-child { grid-row: 1 / 3; }
.fc-cover.covers-4 { grid-template: 1fr 1fr / 1fr 1fr; }
.fc-body { display: flex; align-items: center; gap: 11px; padding: 9px 11px 11px; }
.fc-icon { flex: none; line-height: 0; }
.fc-icon svg { width: 34px; height: 34px; display: block; }
.fc-icon.fc-internal svg { color: var(--muted); }
.fc-icon.fc-shared svg { color: var(--ok); }
.folder-card .fc-name {
  display: block; font-weight: 600; font-size: 12.5px; color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 120px;
}
.folder-card .fc-meta { display: block; font-size: 11px; color: var(--muted); }
.folder-card:hover { outline: 2px solid var(--accent-weak); }
.fc-actions { position: absolute; top: 8px; right: 8px; display: none; gap: 4px; }
.folder-card:hover .fc-actions { display: flex; }
.icon-btn {
  width: 24px; height: 24px; border-radius: 6px; border: 1px solid var(--line);
  background: var(--card); color: var(--muted); cursor: pointer; font-size: 12px; line-height: 1;
}
.icon-btn:hover { color: var(--accent); border-color: var(--accent); }

.dropzone {
  display: none; padding: 14px 18px; margin-bottom: 14px;
  border: 2px dashed var(--accent); border-radius: var(--radius);
  background: var(--accent-weak); color: var(--accent-deep);
  font-size: 13px; text-align: center;
}
.dropzone.show { display: block; }

.bulk-bar {
  display: none; gap: 10px; align-items: center;
  position: sticky; bottom: 14px; margin-top: 14px;
  background: var(--ink); color: #fff;
  padding: 10px 14px; border-radius: 12px;
  box-shadow: 0 8px 24px rgba(23,25,35,.25);
}
.bulk-bar.show { display: flex; }
.bulk-bar select { width: auto; background: #2A2D3A; color: #fff; border-color: #3A3E4E; }

/* ---------- asset detail ---------- */
.preview-card { padding: 0; overflow: hidden; background: #1C1E28; display: flex; align-items: center; justify-content: center; min-height: 320px; position: relative; }

/* Controls overlaid inside the preview window */
.preview-overlay-zoom {
  position: absolute; top: 12px; left: 12px; z-index: 6;
  background: rgba(20,22,30,.72); backdrop-filter: blur(6px);
  border-radius: 999px; padding: 5px 10px; box-shadow: 0 4px 14px rgba(0,0,0,.3);
}
.preview-overlay-zoom .zoom-btn { background: rgba(255,255,255,.1); border-color: transparent; color: #fff; }
.preview-overlay-zoom .zoom-btn:hover { background: rgba(255,255,255,.2); border-color: transparent; color: #fff; }
.preview-overlay-zoom input[type=range] { width: 110px; accent-color: #fff; }
.preview-overlay-zoom .zoom-pct { color: #cfd2dc; }
.preview-overlay-fs {
  position: absolute; top: 12px; right: 12px; z-index: 6;
  width: 34px; height: 34px; display: flex; align-items: center; justify-content: center;
  background: rgba(20,22,30,.72); backdrop-filter: blur(6px); color: #fff;
  border: none; border-radius: 9px; cursor: pointer; box-shadow: 0 4px 14px rgba(0,0,0,.3);
  transition: background .15s;
}
.preview-overlay-fs:hover { background: rgba(109,93,246,.9); }
/* In fullscreen the card is moved into .fs-stage, which has its own Exit + zoom
   bar (and its own mode pill) — so hide the inline overlays to avoid dupes. */
.fs-stage .preview-overlay-controls,
.fs-stage .preview-overlay-zoom,
.fs-stage .preview-overlay-fs { display: none; }
.preview-img { max-width: 100%; max-height: 640px; display: block; }
video.preview-img { width: 100%; }
.preview-frame { width: 100%; height: 640px; border: 0; background: #fff; }
.preview-fallback { text-align: center; color: #A7ACBA; padding: 60px 20px; }
.preview-fallback .big-ext { font-size: 34px; font-weight: 800; letter-spacing: .04em; color: #fff; opacity: .85; }

.filmstrip { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 4px; }
.film {
  flex: none; width: 92px; border-radius: 10px; overflow: hidden;
  border: 2px solid transparent; background: #F1F2F6; text-decoration: none;
  display: flex; flex-direction: column; align-items: center;
}
.film img { width: 100%; height: 60px; object-fit: cover; }
.film-ext { height: 60px; display: flex; align-items: center; justify-content: center; width: 100%; font-weight: 700; font-size: 12px; color: var(--muted); }
.film-label { font-size: 11px; font-weight: 700; padding: 4px 0; color: var(--muted); }
.film.active { border-color: var(--accent); }
.film.active .film-label { color: var(--accent); }

@media (max-width: 980px) {
  .browser { grid-template-columns: 1fr; }
}

/* ---------- command palette ---------- */
.cmdk-overlay {
  position: fixed; inset: 0; z-index: 100; display: none;
  background: rgba(16,24,40,.34); backdrop-filter: blur(2px);
  align-items: flex-start; justify-content: center; padding-top: 14vh;
}
.cmdk-overlay.open { display: flex; }
.cmdk {
  width: 100%; max-width: 560px; background: var(--card);
  border-radius: 16px; box-shadow: 0 24px 60px rgba(16,24,40,.28); overflow: hidden;
}
.cmdk-input {
  width: 100%; border: 0; border-bottom: 1px solid var(--line);
  padding: 17px 20px; font-size: 16px; font-family: var(--font); outline: none;
}
.cmdk-list { max-height: 340px; overflow-y: auto; padding: 8px; }
.cmdk-item {
  display: flex; align-items: center; gap: 12px; padding: 11px 13px;
  border-radius: 10px; cursor: pointer; color: var(--ink); text-decoration: none; font-size: 14px;
}
.cmdk-item .ci-icon { width: 18px; height: 18px; color: var(--muted); flex: none; }
.cmdk-item .ci-icon svg { width: 100%; height: 100%; }
.cmdk-item .ci-sub { margin-left: auto; font-size: 11.5px; color: var(--muted); }
.cmdk-item.active, .cmdk-item:hover { background: var(--accent-weak); color: var(--accent-deep); }
.cmdk-item.active .ci-icon, .cmdk-item:hover .ci-icon { color: var(--accent); }
.cmdk-empty { padding: 26px; text-align: center; color: var(--muted); font-size: 13.5px; }
.cmdk-foot {
  border-top: 1px solid var(--line); padding: 9px 16px;
  font-size: 11.5px; color: var(--muted); display: flex; gap: 14px;
}
.cmdk-foot kbd {
  background: var(--bg); border: 1px solid var(--line); border-radius: 5px;
  padding: 1px 6px; font-family: var(--font); font-size: 11px;
}
.topbar-search-hint {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 12px; border: 1px solid var(--line); border-radius: 9px;
  background: var(--bg); color: var(--muted); font-size: 13px; cursor: pointer;
}
.topbar-search-hint kbd {
  background: var(--card); border: 1px solid var(--line); border-radius: 4px;
  padding: 0 5px; font-size: 11px; font-family: var(--font);
}

/* ---------- dashboard: welcome + sections ---------- */
.welcome { margin: -4px 0 22px; }
.welcome h2 { font-size: 24px; margin: 0 0 4px; letter-spacing: -0.02em; }
.welcome p { font-size: 14.5px; margin: 0; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; margin: 0 0 14px; }
.section-head h3 { font-size: 18px; margin: 0; }

/* ---------- project cards (UX rec #1, #2, #9) ---------- */
.project-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(264px, 1fr)); gap: 18px; }
.project-card {
  display: flex; flex-direction: column; text-decoration: none;
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  overflow: hidden; transition: transform .12s, box-shadow .12s; position: relative;
}
.project-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: var(--pc-accent); z-index: 2;
}
.project-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(16,24,40,.10), 0 0 0 1px var(--line); }
.pc-cover {
  position: relative; aspect-ratio: 16 / 9; background: #EEF0F4;
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.pc-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.project-card img { max-width: 100%; }
.pc-cover-blank {
  font-size: 44px; font-weight: 800; color: #fff; letter-spacing: -0.02em;
  width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
  background: var(--pc-accent);
  background-image: linear-gradient(135deg, rgba(255,255,255,0) 0%, rgba(255,255,255,.35) 100%);
}
.pc-status { position: absolute; top: 10px; right: 10px; }
.pc-body { padding: 13px 15px 15px; display: flex; flex-direction: column; gap: 3px; }
.pc-client { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--muted); font-weight: 500; }
.pc-logo { width: 16px; height: 16px; border-radius: 4px; object-fit: cover; }
.pc-logo-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--pc-accent); display: inline-block; }
.pc-name { font-size: 15px; font-weight: 700; color: var(--ink); letter-spacing: -0.01em; }
.pc-meta { display: flex; gap: 12px; font-size: 12px; color: var(--muted); margin-top: 3px; }
.pc-review-dot { color: var(--warn); font-weight: 600; }

/* ---------- pending review list ---------- */
.review-list { display: grid; }
.review-row {
  display: flex; align-items: center; gap: 12px; padding: 10px 0;
  border-bottom: 1px solid var(--line); text-decoration: none; color: var(--ink);
}
.review-row:last-child { border-bottom: 0; }
.review-row:hover .review-name { color: var(--accent); }
.review-thumb {
  width: 44px; height: 44px; border-radius: 9px; flex: none; overflow: hidden;
  background: #EEF0F4; display: flex; align-items: center; justify-content: center;
}
.review-thumb img { width: 100%; height: 100%; object-fit: cover; }
.review-thumb svg { width: 20px; height: 20px; color: #A7ACBA; }
.review-info { flex: 1; min-width: 0; display: grid; gap: 2px; }
.review-name { font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.storage-card { background: linear-gradient(180deg, var(--card), #FCFCFE); }

/* ---------- empty-state micro-illustrations (UX rec #8) ---------- */
.empty-art { color: var(--accent); opacity: .55; margin: 0 auto 14px; width: 64px; height: 64px; }
.empty-art svg { width: 100%; height: 100%; }
.empty-art.sm { width: 44px; height: 44px; margin-bottom: 10px; }

/* ---------- accent color picker ---------- */
.accent-picker { display: flex; align-items: center; gap: 10px; margin-top: 6px; }
.accent-picker input[type=color] {
  width: 40px; height: 34px; padding: 2px; border: 1px solid #D8DBE4; border-radius: 8px;
  background: var(--card); cursor: pointer;
}

/* ---------- drag-to-move ---------- */
.asset-card.draggable { cursor: grab; }
.asset-card.draggable:active { cursor: grabbing; }
.asset-card.dragging { opacity: .4; outline: 2px dashed var(--accent); }
.drop-target.drop-hover {
  outline: 2px solid var(--accent) !important;
  background: var(--accent-weak);
}
.folder-card.drop-target.drop-hover { box-shadow: 0 0 0 3px var(--accent-weak), 0 8px 24px rgba(109,93,246,.18); }
.folder-row.drop-target.drop-hover { background: var(--accent-weak); color: var(--accent); }
.drag-ghost {
  position: absolute; top: -1000px; left: -1000px;
  background: var(--ink); color: #fff; font-size: 12px; font-weight: 700;
  padding: 6px 12px; border-radius: 8px; pointer-events: none;
}

/* ---------- hotspot review ---------- */
.hotspot-stage { position: relative; cursor: crosshair; }
/* Markup modes: view = grab-to-pan, comment = crosshair pinning. */
.hotspot-stage[data-markup-mode="view"] { cursor: grab; }
.hotspot-stage[data-markup-mode="view"].panning,
.hotspot-stage[data-markup-mode="view"].panning .zoom-viewport { cursor: grabbing; }
.hotspot-stage[data-markup-mode="view"] .hotspot-pin[data-thread] { cursor: pointer; }
.hotspot-stage[data-markup-mode="comment"] { cursor: crosshair; }

/* Inline overlay controls row: mode pill + zoom control sit together top-left. */
.preview-overlay-controls {
  position: absolute; top: 12px; left: 12px; z-index: 6;
  display: flex; align-items: center; gap: 8px;
}
.preview-overlay-controls .preview-overlay-zoom { position: static; }

/* Mode toggle pill. */
.markup-mode {
  display: inline-flex; gap: 2px; padding: 3px;
  background: rgba(20,22,29,.72); border-radius: 9px;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.markup-mode-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 11px; border: 0; border-radius: 7px; cursor: pointer;
  background: transparent; color: #cfd2dc; font: inherit; font-size: 13px; font-weight: 600;
}
.markup-mode-btn svg { width: 15px; height: 15px; }
.markup-mode-btn:hover { color: #fff; }
.markup-mode-btn.active { background: #fff; color: #16181D; }
/* Fullscreen pill lives in the fs-bar, to the left of the zoom slider. */
.markup-mode-fs { background: #232838; }
.hotspot-layer { position: absolute; inset: 0; pointer-events: none; }
.hotspot-pin {
  position: absolute; transform: translate(-50%, -50%);
  width: 26px; height: 26px; border-radius: 50% 50% 50% 2px;
  background: var(--accent); color: #fff; border: 2px solid #fff;
  font-size: 12px; font-weight: 700; cursor: pointer; pointer-events: auto;
  box-shadow: 0 2px 6px rgba(16,24,40,.35);
  display: flex; align-items: center; justify-content: center;
}
.hotspot-pin.resolved { background: var(--ok); }
.hotspot-pin.pending { background: var(--warn); animation: pin-pulse 1.2s infinite; }
.hotspot-pin[hidden] { display: none; }
@keyframes pin-pulse { 0%,100% { transform: translate(-50%,-50%) scale(1); } 50% { transform: translate(-50%,-50%) scale(1.15); } }

/* ---------- comment composer + threads ---------- */
.comment-composer textarea { width: 100%; resize: vertical; }
.composer-pin-note { font-size: 12px; color: var(--warn); margin-bottom: 6px; }
.composer-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 8px; }
.vis-toggle { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 500; margin: 0; }
.vis-toggle.sm { font-size: 11.5px; }
.vis-toggle input { width: auto; }

.thread-list { display: grid; gap: 14px; margin-top: 16px; }
.thread { border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
.thread.resolved { opacity: .72; }
.thread.flash-highlight { outline: 2px solid var(--accent); transition: outline .2s; }
.thread-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.thread-pin {
  width: 20px; height: 20px; border-radius: 50% 50% 50% 2px; background: var(--accent);
  color: #fff; font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center;
}
.thread-title { font-weight: 600; font-size: 13px; }
.thread-resolve { margin-left: auto; }
.link-btn { background: none; border: 0; color: var(--accent); font-size: 12.5px; cursor: pointer; padding: 0; font-weight: 600; }
.link-btn.danger { color: var(--danger); }
.comment-delete { margin-top: 4px; }

.comment { display: flex; gap: 10px; padding: 7px 0; }
.comment.internal { background: #FFFBEB; margin: 0 -12px; padding: 7px 12px; border-radius: 8px; }
.avatar.sm { width: 26px; height: 26px; font-size: 10px; }
.comment-body { flex: 1; min-width: 0; }
.comment-meta { display: flex; align-items: center; gap: 7px; font-size: 13px; }
.comment-text { font-size: 13.5px; margin-top: 2px; white-space: pre-wrap; word-wrap: break-word; }
.reply-form { display: flex; gap: 7px; align-items: center; margin-top: 8px; }
.reply-form .mention-wrap { flex: 1; }
.reply-form input[type=text] { width: 100%; }
.mention-wrap { position: relative; }
.mention-menu {
  position: absolute; z-index: 1300; max-height: 220px; overflow-y: auto;
  background: #fff; border: 1px solid var(--line); border-radius: 10px;
  box-shadow: 0 12px 32px rgba(16,18,29,.16); padding: 4px;
}
.mention-item { padding: 7px 10px; border-radius: 7px; font-size: 13px; cursor: pointer; color: var(--ink); }
.mention-item.active, .mention-item:hover { background: var(--accent-weak); color: var(--accent); }
.mention-tag { color: var(--accent); font-weight: 600; }

/* ---------- approval decision panel ---------- */
.review-decision textarea { width: 100%; resize: vertical; margin-bottom: 10px; }
.decision-buttons { display: grid; gap: 8px; }
.btn-approve { background: var(--ok); color: #fff; }
.btn-approve:hover { background: #0A7A54; color: #fff; }
.btn-changes { background: var(--warn); color: #fff; }
.btn-changes:hover { background: #A8490A; color: #fff; }
.withdraw-form { margin-top: 10px; text-align: center; }
.withdraw-link { font-size: 13px; color: var(--muted); }
.withdraw-link:hover { color: var(--ink); text-decoration: underline; }
.decision-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.decision-list li { display: flex; gap: 10px; }
.decision-badge {
  width: 26px; height: 26px; border-radius: 50%; flex: none;
  display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 700; font-size: 13px;
}
.decision-badge.approved { background: var(--ok); }
.decision-badge.changes_requested { background: var(--warn); }
.decision-badge.rejected { background: var(--danger); }

/* ---------- asset review layout: image gets the room ---------- */
.grid-asset-review { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 18px; align-items: start; }
@media (max-width: 980px) { .grid-asset-review { grid-template-columns: 1fr; } }

/* ---------- preview toolbar (zoom + fullscreen) ---------- */
.zoom-control { display: flex; align-items: center; gap: 8px; }
.zoom-btn {
  width: 28px; height: 28px; border: 1px solid var(--line); background: var(--card);
  border-radius: 8px; font-size: 17px; line-height: 1; cursor: pointer; color: var(--ink);
}
.zoom-btn:hover { border-color: var(--accent); color: var(--accent); }
.zoom-control input[type=range] { width: 130px; accent-color: var(--accent); }
.zoom-pct { font-size: 12px; color: var(--muted); min-width: 38px; font-variant-numeric: tabular-nums; }

/* ---------- zoomable viewport ---------- */
/* The viewport fills the stage and centers the content with flexbox. We use
   align-items/justify-content:center (NOT stretch) so .zoom-content keeps its
   intrinsic size and shrink-wraps the image on both axes — the hotspot layer
   (inset:0 of the wrapper) is then exactly the image's box, so a click at X% of
   the image maps to a pin at X% of the layer. */
.preview-card.hotspot-stage { display: block; padding: 0; }
/* overflow hidden: panning is done via a translate() folded into the zoom
   transform (see makeZoom), not native scrollbars — transform:scale() paints
   larger but does not create scrollable overflow, so scrollbars can't track it.
   The content is flex-centered; JS clamps the pan so every edge is reachable. */
.zoom-viewport { width: 100%; height: 76vh; overflow: hidden; border-radius: 10px; background: #14161D;
  display: flex; align-items: center; justify-content: center; }
.zoom-content { position: relative;
  will-change: transform; transition: transform .08s ease-out; transform-origin: center center; }
.zoom-content.panning { transition: none; } /* no lag while dragging */
.zoom-content .preview-img { display: block; max-width: 100%; max-height: 76vh; width: auto; height: auto; }
.zoom-content .hotspot-layer { position: absolute; inset: 0; }

/* ---------- fullscreen review overlay ---------- */
.fs-overlay { position: fixed; inset: 0; z-index: 200; background: #0D0F14; flex-direction: column; }
.fs-overlay[hidden] { display: none; }
.fs-overlay:not([hidden]) { display: flex; }
.fs-bar {
  display: flex; align-items: center; gap: 18px; padding: 12px 18px;
  background: #161922; border-bottom: 1px solid #232838; color: #fff; flex: none;
}
.fs-title { font-weight: 600; font-size: 14px; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fs-bar .zoom-pct { color: #9aa0b4; }
.fs-bar .zoom-btn { background: #232838; border-color: #2f3548; color: #fff; }
.fs-body { flex: 1; display: flex; min-height: 0; }
.fs-stage { flex: 1; overflow: hidden; padding: 18px; min-height: 0; }
.fs-stage .preview-card { background: transparent; box-shadow: none; width: 100%; height: 100%; max-width: 100%; }
.fs-stage .zoom-viewport { width: 100%; height: 100%; max-height: none; background: transparent; }
.fs-stage .zoom-content .preview-img { max-height: 88vh; }
.fs-rail {
  width: 360px; flex: none; background: var(--card); overflow-y: auto; padding: 18px;
  border-left: 1px solid var(--line);
}
.fs-rail .card { box-shadow: none; padding: 0; }
@media (max-width: 760px) { .fs-rail { display: none; } }

/* ---------- icon button (icon + short label) ---------- */
.btn-icon { display: inline-flex; align-items: center; gap: 7px; }
.btn-icon svg { width: 16px; height: 16px; }

/* ---------- app modals ---------- */
.modal-overlay {
  position: fixed; inset: 0; z-index: 300;
  background: rgba(16,24,40,.42); backdrop-filter: blur(2px);
  display: flex; align-items: center; justify-content: center; padding: 24px;
}
.modal-overlay[hidden] { display: none; }
.modal {
  width: 100%; max-width: 460px; background: var(--card);
  border-radius: 16px; box-shadow: 0 24px 60px rgba(16,24,40,.28);
  max-height: 88vh; display: flex; flex-direction: column; overflow: hidden;
}
.modal-head { padding: 18px 22px 0; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.modal-head h3 { margin: 0; font-size: 17px; }
.modal-close {
  flex: none; width: 30px; height: 30px; margin: -4px -6px 0 0;
  display: flex; align-items: center; justify-content: center;
  border: 0; background: transparent; color: var(--muted); cursor: pointer;
  border-radius: 8px; font-size: 16px; line-height: 1;
}
.modal-close:hover { background: var(--bg); color: var(--ink); }
.modal-body { padding: 14px 22px; overflow-y: auto; }
.modal-body p { margin: 0 0 4px; font-size: 14px; color: var(--ink); line-height: 1.55; }
.modal-body input[type=text] { margin-top: 10px; }
.modal-foot { padding: 14px 22px 18px; display: flex; gap: 10px; justify-content: flex-end; border-top: 1px solid var(--line); }
.modal-foot:empty { display: none; } /* uiModal callers (Share, Edit) have no footer buttons */
.modal-wide { max-width: 540px; }

/* ---------- share modal (management) ---------- */
.share-modal .share-section { margin-bottom: 4px; }
.share-modal .share-heading { margin: 0 0 4px; font-size: 13px; font-weight: 700; letter-spacing: .02em; color: var(--ink); }
.share-modal .share-section .muted.small { margin: 0 0 4px; }
.share-modal .share-toggles { display: flex; gap: 16px; margin: 4px 0 14px; }
.share-sep { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }
.share-link-list { display: grid; gap: 8px; }
.share-link-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 9px; }
.share-link-row.revoked { opacity: .55; }
.share-link-out { display: flex; gap: 8px; margin-top: 12px; }
.share-link-out input { flex: 1; font-size: 12.5px; }

/* ---------- public share viewer ---------- */
.share-body { background: var(--bg); margin: 0; }
.share-topbar {
  display: flex; align-items: center; gap: 18px; padding: 14px 22px;
  background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10;
}
.share-brand { display: flex; align-items: center; gap: 9px; font-weight: 700; font-size: 15px; }
.share-title { font-size: 14px; color: var(--muted); flex: 1; }
.share-main { max-width: 1500px; margin: 0 auto; padding: 24px 22px 60px; }
.share-msg { max-width: 420px; margin: 12vh auto; text-align: center; }
.share-msg h1 { font-size: 22px; margin: 0 0 8px; }
.share-pw { display: flex; gap: 8px; margin-top: 16px; }
.share-pw input { flex: 1; }
.share-back { display: inline-block; margin-bottom: 14px; color: var(--accent); font-size: 13px; text-decoration: none; }
.share-review { display: grid; grid-template-columns: minmax(0,1fr) 360px; gap: 20px; align-items: start; }
@media (max-width: 900px) { .share-review { grid-template-columns: 1fr; } }
.share-stage { background: var(--card); border-radius: 14px; padding: 16px; box-shadow: var(--shadow); }
.share-stage .hotspot-stage { background: transparent; border-radius: 10px; overflow: hidden; }
.share-stage .zoom-viewport { height: 72vh; }
.share-zoom-bar { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.share-zoom-bar input[type=range] { width: 140px; accent-color: var(--accent); }
.share-rail { background: var(--card); border-radius: 14px; padding: 18px; box-shadow: var(--shadow); }
.share-rail h3 { margin: 0 0 14px; font-size: 16px; }
.share-name-form { display: grid; gap: 10px; margin-bottom: 8px; }
.share-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
.share-tile { display: flex; flex-direction: column; background: var(--card); border-radius: 12px; overflow: hidden; box-shadow: var(--shadow); text-decoration: none; }
.share-thumb { aspect-ratio: 4/3; background: #EEF0F4; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.share-thumb img { width: 100%; height: 100%; object-fit: cover; }
.share-tile-name { padding: 10px 12px; font-size: 13px; font-weight: 600; color: var(--ink); }

/* ---------- notification bell + list ---------- */
.topbar-bell { position: relative; display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 10px; color: var(--ink); text-decoration: none; }
.topbar-bell:hover { background: var(--bg); color: var(--accent); }
.bell-badge { position: absolute; top: 3px; right: 3px; min-width: 16px; height: 16px; padding: 0 4px;
  background: var(--danger); color: #fff; border-radius: 99px; font-size: 10px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; border: 2px solid var(--card); }

.notif-list { list-style: none; margin: 0; padding: 0; }
.notif-item { display: flex; align-items: flex-start; gap: 12px; padding: 14px 6px; border-bottom: 1px solid var(--line); position: relative; }
.notif-item:last-child { border-bottom: 0; }
.notif-item.unread { background: var(--accent-weak); margin: 0 -12px; padding: 14px 18px; border-radius: 10px; border-bottom: 0; }
.notif-icon { width: 30px; height: 30px; border-radius: 50%; background: var(--bg); display: flex; align-items: center; justify-content: center; font-size: 14px; flex: none; }
.notif-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; text-decoration: none; color: var(--ink); }
.notif-title { font-size: 14px; font-weight: 600; }
.notif-body { font-size: 13px; color: var(--muted); }
.notif-time { font-size: 12px; color: var(--muted); margin-top: 2px; }
.notif-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); flex: none; margin-top: 6px; }

/* ---------- review sessions ---------- */
.chip-info { background: #E6EEFF; color: #2B5CD9; }
.chip-danger { background: #FCE8E8; color: var(--danger); }

.tabs { display: flex; gap: 4px; margin-bottom: 18px; border-bottom: 1px solid var(--line); }
.tabs a { padding: 9px 14px; font-size: 13.5px; font-weight: 600; color: var(--muted); text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a.active { color: var(--accent); border-bottom-color: var(--accent); }

.progress-bar { height: 6px; background: var(--line); border-radius: 99px; overflow: hidden; }
.progress-bar span { display: block; height: 100%; background: var(--ok); border-radius: 99px; transition: width .3s; }

.review-list { display: grid; gap: 12px; }
.review-row { display: flex; align-items: center; gap: 20px; text-decoration: none; color: var(--ink); padding: 16px 18px; }
.review-row:hover { border-color: var(--accent); }
.review-row-main { flex: 1; min-width: 0; }
.review-row-title { font-weight: 600; font-size: 15px; display: flex; align-items: center; gap: 8px; }
.review-row-progress { width: 200px; flex: none; }
.review-row-progress .progress-bar { margin-bottom: 6px; }
@media (max-width: 720px) { .review-row-progress { display: none; } }

.review-asset-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; }
.review-asset-card { position: relative; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.review-asset-thumb { display: block; aspect-ratio: 4/3; background: #EEF0F4; }
.review-asset-thumb img { width: 100%; height: 100%; object-fit: cover; }
.review-asset-meta { padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; }
.review-asset-name { font-size: 13px; font-weight: 600; }
.review-asset-remove { position: absolute; top: 6px; right: 6px; }
.review-asset-remove .link-btn { background: rgba(0,0,0,.55); color: #fff; width: 22px; height: 22px; border-radius: 50%; font-size: 15px; line-height: 1; }

/* ---------- global assets view ---------- */
.asset-filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 6px; }
.asset-filters input[type=search] { flex: 1; min-width: 200px; }
.asset-filters select { min-width: 120px; }
.asset-meta .small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.btn-ghost { background: transparent; color: var(--muted); }
.btn-ghost:hover { color: var(--accent); background: var(--bg); }
.pager { display: flex; align-items: center; justify-content: center; gap: 16px; margin-top: 22px; }

/* ---------- share links table helpers ---------- */
.cell-strong { font-weight: 600; }
table.data tr.row-dim td { opacity: .6; }

/* ---------- settings ---------- */
.toggle-row { display: flex; align-items: flex-start; gap: 11px; padding: 11px 0; font-weight: 500; font-size: 14px; }
.toggle-row input[type=checkbox] { width: 17px; height: 17px; margin-top: 1px; accent-color: var(--accent); flex: none; }
.toggle-row span { display: flex; flex-direction: column; gap: 1px; }
.toggle-sub { padding-left: 28px; border-left: 2px solid var(--line); margin-left: 8px; transition: opacity .15s; }
.logo-preview { display: block; margin: 8px 0; }
.logo-preview img { max-height: 56px; max-width: 220px; border: 1px solid var(--line); border-radius: 8px; padding: 8px; background: var(--card); }

/* ---------- folder client-visibility bar ---------- */
.visibility-bar { display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 10px 14px; border-radius: 10px; background: var(--bg); border: 1px solid var(--line); margin-bottom: 14px; font-size: 13px; }
.visibility-bar.is-visible { background: #ECFDF5; border-color: #A7F3D0; }
.visibility-bar .vis-state strong { font-weight: 600; }

/* ---------- share links: inline link URL ---------- */
.link-url { display: flex; gap: 6px; margin-top: 8px; max-width: 420px; }
.link-url input { flex: 1; font-size: 12px; padding: 5px 8px; color: var(--muted); background: var(--bg); }

/* ---------- Google sign-in ---------- */
.oauth-divider { display: flex; align-items: center; gap: 12px; margin: 20px 0; color: var(--muted); font-size: 12px; }
.oauth-divider::before, .oauth-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.btn-google { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%;
  background: #fff; color: #3c4043; border: 1px solid #dadce0; font-weight: 600; padding: 11px;
  border-radius: 8px; text-decoration: none; }
.btn-google:hover { background: #f8f9fa; border-color: #d2d3d6; }

/* ---------- landing page (split layout, mirrors auth) ---------- */
.home-wrap { display: flex; min-height: 100vh; background: var(--card); }
.home-main {
  flex: 1; position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 40px 32px;
}
.home-content { width: 100%; max-width: 440px; }
.home-content h1 { font-size: 40px; line-height: 1.08; letter-spacing: -0.02em; font-weight: 800; margin: 0 0 18px; }
.home-content p { font-size: 17px; color: var(--muted); line-height: 1.5; margin: 0 0 30px; }
.home-cta { display: flex; gap: 12px; margin-bottom: 34px; }
.home-cta .btn { padding: 12px 22px; font-size: 15px; }
.home-note { font-size: 17px; color: var(--muted); line-height: 1.5; margin: 0; }
.home-side {
  flex: 1; max-width: 50%; order: 2;
  background-size: cover; background-position: center; background-repeat: no-repeat;
  position: relative; overflow: hidden;
}
.home-side::before {
  content: ""; position: absolute;
  top: -50%; bottom: -50%; left: -70px;
  width: 130px; background: var(--card);
  border-radius: 0 100% 100% 0 / 0 50% 50% 0;
  pointer-events: none; z-index: 1;
}
.home-side:not(.has-hero) {
  background-image:
    radial-gradient(120% 90% at 85% 10%, rgba(255,255,255,.18) 0%, transparent 50%),
    radial-gradient(100% 100% at 10% 95%, #8B7DF8 0%, transparent 55%),
    linear-gradient(160deg, #6D5DF6 0%, #4A39CC 55%, #2A1E7A 100%);
}
@media (max-width: 980px) {
  .home-side { display: none; }
  .home-content h1 { font-size: 34px; }
}

/* ---------- landing footer legal links ---------- */
.home-legal { margin: 28px 0 0; font-size: 13px; color: var(--muted); }
.home-legal a { color: var(--muted); text-decoration: none; }
.home-legal a:hover { color: var(--ink); text-decoration: underline; }

/* ---------- static legal pages ---------- */
.legal-body { background: var(--card); color: var(--ink); }
.legal-top { display: flex; align-items: center; justify-content: space-between; max-width: 760px; margin: 0 auto; padding: 26px 24px; }
.legal-top nav a { font-size: 14px; color: var(--muted); text-decoration: none; }
.legal-top nav a:hover { color: var(--ink); }
.legal-doc { max-width: 760px; margin: 0 auto; padding: 12px 24px 64px; }
.legal-doc h1 { font-size: 32px; letter-spacing: -0.02em; margin: 0 0 6px; }
.legal-updated { color: var(--muted); font-size: 13px; margin: 0 0 32px; }
.legal-doc h2 { font-size: 18px; margin: 32px 0 10px; }
.legal-doc p { font-size: 15px; line-height: 1.65; color: #33363F; margin: 0 0 14px; }
.legal-doc a { color: var(--accent); }
.legal-foot { max-width: 760px; margin: 0 auto; padding: 24px; border-top: 1px solid var(--line);
  display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); }
.legal-foot a { color: var(--muted); text-decoration: none; }
.legal-foot a:hover { color: var(--ink); }

/* ---------- billing tab ---------- */
.plan-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.plan-name { font-weight: 700; font-size: 17px; }
.usage { margin-top: 16px; }
.usage-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; font-size: 14px; }
.usage-bar { height: 8px; background: #EBEDF3; border-radius: 99px; overflow: hidden; }
.usage-bar span { display: block; height: 100%; background: var(--accent); border-radius: 99px; }

/* ---------- download dropdown ---------- */
.dl-menu { position: relative; display: inline-block; }
.dl-caret { font-size: 10px; opacity: .7; margin-left: 2px; }
.dl-pop { position: absolute; top: calc(100% + 6px); right: 0; z-index: 40; min-width: 220px;
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 16px 40px -12px rgba(16,18,29,.28); padding: 6px; }
.dl-pop[hidden] { display: none; }
.dl-item { display: flex; flex-direction: column; align-items: flex-start; gap: 1px;
  width: 100%; text-align: left; padding: 9px 12px; border: 0; background: none; border-radius: 8px; cursor: pointer; }
.dl-item:hover { background: var(--bg); }
.dl-item + .dl-item { border-top: 1px solid var(--line); }
.dl-item-title { font-weight: 600; font-size: 14px; color: var(--ink); }
.dl-item-sub { font-size: 12px; color: var(--muted); }

/* ---------- export modal ---------- */
.export-modal { max-width: 460px; }
.modal-x { background: none; border: 0; font-size: 22px; line-height: 1; color: var(--muted); cursor: pointer; float: right; }
.modal-x:hover { color: var(--ink); }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 12px; font-weight: 600;
  color: var(--muted); text-transform: uppercase; letter-spacing: .03em; margin-bottom: 14px; }
.field select, .field input { font-size: 14px; font-weight: 400; text-transform: none; letter-spacing: 0;
  box-sizing: border-box; height: 40px; line-height: 1.2; padding: 9px 11px;
  border: 1px solid var(--line); border-radius: 9px; color: var(--ink); background: #fff; }
.field select { appearance: none; -webkit-appearance: none; padding-right: 30px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%236B7280' d='M0 0l5 6 5-6z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 11px center; }
.export-dims { display: flex; align-items: flex-end; gap: 12px; }
.export-dims .field { flex: 1; }
.dim-input { display: flex; align-items: center; }
.dim-input input { flex: 1; border-radius: 9px 0 0 9px; border-right: 0; }
.dim-unit { box-sizing: border-box; height: 40px; display: flex; align-items: center;
  padding: 0 11px; border: 1px solid var(--line); border-left: 0; border-radius: 0 9px 9px 0;
  background: var(--bg); color: var(--muted); font-size: 13px; }
.dim-lock { margin-bottom: 0; width: 40px; height: 40px; flex: none; border: 1px solid var(--line);
  border-radius: 9px; background: #fff; color: var(--muted); cursor: pointer; display: flex; align-items: center; justify-content: center; }
.dim-lock.locked { color: var(--accent); border-color: var(--accent); background: #f0eefe; }
.export-row { display: flex; gap: 12px; align-items: flex-end; }
.export-row .field { flex: 1; }
.export-preview { margin-top: 4px; word-break: break-all; }

/* ---------- PDF deck viewer ---------- */
.deck-nav { display: flex; align-items: center; justify-content: center; gap: 14px; margin-bottom: 12px; }
.deck-counter { font-size: 13px; color: var(--muted); font-weight: 600; }
.deck-rail { display: flex; gap: 8px; overflow-x: auto; padding: 12px 2px 2px; margin-top: 12px; }
.deck-thumb { flex: none; width: 64px; border: 1px solid var(--line); border-radius: 7px; background: #fff;
  padding: 0; cursor: pointer; overflow: hidden; position: relative; transition: border-color .12s; }
.deck-thumb img { width: 100%; height: 80px; object-fit: cover; display: block; }
.deck-thumb span { display: block; font-size: 11px; color: var(--muted); padding: 2px 0; text-align: center; }
.deck-thumb:hover { border-color: #c9cee0; }
.deck-thumb.active { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.deck-thumb.active span { color: var(--accent); font-weight: 700; }

/* ---------- project team: add member ---------- */
.add-member-row { display: flex; gap: 10px; align-items: center; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.add-member-row select { flex: 1; min-width: 160px; box-sizing: border-box; height: 38px; padding: 8px 11px;
  border: 1px solid var(--line); border-radius: 9px; background: #fff; font-size: 14px; color: var(--ink); }
.add-member-row select[name="role"] { flex: 0 0 150px; }

/* ---------- AI tags card ---------- */
.ai-badge { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
  color: var(--accent); background: #f0eefe; padding: 2px 7px; border-radius: 99px; margin-left: 6px; vertical-align: middle; }
.ai-caption { font-size: 14px; line-height: 1.5; color: var(--ink); margin: 0 0 14px; }
.tag-cloud { display: flex; flex-wrap: wrap; gap: 7px; }
.tag-chip { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; color: var(--ink);
  background: var(--bg); border: 1px solid var(--line); border-radius: 99px; padding: 4px 10px; }
.tag-chip.tag-ai { background: #f6f5fe; border-color: #e4e0fb; }
.tag-x { border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 15px; line-height: 1; padding: 0; }
.tag-x:hover { color: #E5484D; }
.linklike { border: 0; background: none; color: var(--accent); cursor: pointer; font: inherit; padding: 0; text-decoration: underline; }

/* ---------- asset filename editing ---------- */
.filename-edit { display: flex; align-items: stretch; }
.filename-edit input { flex: 1; border-top-right-radius: 0; border-bottom-right-radius: 0; }
.filename-ext { display: inline-flex; align-items: center; padding: 0 12px; background: var(--bg);
  border: 1px solid var(--line); border-left: 0; border-top-right-radius: 9px; border-bottom-right-radius: 9px;
  color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; }

/* ---------- upload placeholder tiles (Air-style) ---------- */
.asset-card.uploading { position: relative; }
.asset-card.uploading .asset-thumb { display: flex; align-items: center; justify-content: center;
  background: repeating-linear-gradient(45deg, #f4f5f8, #f4f5f8 10px, #eef0f5 10px, #eef0f5 20px); }
.upload-spinner { width: 30px; height: 30px; border: 3px solid #d6dae4; border-top-color: var(--accent);
  border-radius: 50%; animation: upspin .8s linear infinite; }
@keyframes upspin { to { transform: rotate(360deg); } }
.asset-card.uploading .upload-state { color: var(--muted); }
.asset-card.done .upload-spinner { border: 3px solid var(--accent); border-top-color: var(--accent); animation: none; position: relative; }
.asset-card.done .upload-spinner::after { content: "✓"; position: absolute; inset: 0; display: flex;
  align-items: center; justify-content: center; color: var(--accent); font-size: 15px; font-weight: 700; }
.asset-card.done .upload-state { color: var(--accent); }
.asset-card.failed .asset-thumb { background: #fdecec; }
.asset-card.failed .upload-spinner { border-color: #E5484D; border-top-color: #E5484D; animation: none; position: relative; }
.asset-card.failed .upload-spinner::after { content: "!"; position: absolute; inset: 0; display: flex;
  align-items: center; justify-content: center; color: #E5484D; font-size: 16px; font-weight: 700; }
.asset-card.failed .upload-state { color: #E5484D; }

/* Feedback card tabs (Comments / Approvals) */
.feedback-tabs { padding-bottom: 0; }
.feedback-tabs .tab-row { display: flex; gap: 4px; }
.tab-btn { background: none; border: none; padding: 6px 10px 10px; font: inherit; font-weight: 600;
  font-size: 13px; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tab-btn:hover { color: var(--ink); }
.tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); }
.tab-pane[hidden] { display: none; }

/* Approver list */
.approver-list { display: flex; flex-direction: column; gap: 6px; margin: 6px 0 14px; }
.approver-row { display: flex; align-items: center; gap: 9px; padding: 6px 0; }
.approver-meta { display: flex; flex-direction: column; line-height: 1.25; flex: 1; min-width: 0; }
.approver-meta strong { font-size: 13.5px; }
.approver-row .chip { flex-shrink: 0; }
.approver-remove { margin: 0; }
.approver-remove .link-btn { color: var(--muted); font-size: 16px; line-height: 1; padding: 0 2px; }
.approver-remove .link-btn:hover { color: var(--danger); }
.approver-add { margin-top: 6px; }
.approver-group-label { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
  color: var(--muted); margin: 10px 0 2px; }

/* Inline toast for Ajax actions in the feedback box */
#feedbackCard { position: relative; }
.box-toast { position: absolute; top: 8px; right: 8px; z-index: 5; background: var(--ok); color: #fff;
  padding: 6px 12px; border-radius: 8px; font-size: 13px; font-weight: 600; box-shadow: 0 4px 14px rgba(0,0,0,.14);
  opacity: 0; transform: translateY(-6px); transition: opacity .18s, transform .18s; pointer-events: none; }
.box-toast.show { opacity: 1; transform: translateY(0); }
.box-toast.is-error { background: var(--danger); }

/* Reusable confirmation: modal + inline (replaces native confirm()) */
.confirm-modal { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; }
.confirm-modal[hidden] { display: none; }
.confirm-backdrop { position: absolute; inset: 0; background: rgba(20,22,30,.45); }
.confirm-dialog { position: relative; background: #fff; border-radius: 14px; padding: 22px; max-width: 380px;
  width: calc(100% - 40px); box-shadow: 0 18px 50px rgba(0,0,0,.25); }
.confirm-msg { margin: 0 0 18px; font-size: 15px; line-height: 1.45; }
.confirm-actions { display: flex; justify-content: flex-end; gap: 8px; }
.inline-confirm { display: inline-flex; align-items: center; gap: 8px; }
.inline-confirm-msg { font-size: 13px; color: var(--ink); }
.inline-confirm-yes { color: var(--danger); font-weight: 600; }
.inline-confirm-no { color: var(--muted); }

/* Help Center */
.help-layout { display: grid; grid-template-columns: 220px 1fr; gap: 28px; align-items: start; }
.help-nav { display: flex; flex-direction: column; gap: 2px; position: sticky; top: 16px; }
.help-nav a { padding: 7px 11px; border-radius: 8px; color: var(--muted); font-size: 14px; font-weight: 500; text-decoration: none; }
.help-nav a:hover { background: var(--surface-2, #f3f4f8); color: var(--ink); }
.help-nav a.active { background: var(--accent-soft, #ede9fe); color: var(--accent); font-weight: 600; }
.help-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.help-card { display: flex; flex-direction: column; gap: 5px; padding: 16px; border: 1px solid var(--border, #e6e8ef);
  border-radius: 12px; text-decoration: none; color: var(--ink); background: #fff; transition: border-color .15s, box-shadow .15s; }
.help-card:hover { border-color: var(--accent); box-shadow: 0 4px 16px rgba(0,0,0,.06); }
.help-card strong { font-size: 15px; }
.help-prose { max-width: 680px; line-height: 1.6; }
.help-prose h2 { font-size: 17px; margin: 26px 0 8px; }
.help-prose h2:first-child { margin-top: 4px; }
.help-prose p, .help-prose li { font-size: 14.5px; color: #2b2f3a; }
.help-prose ul, .help-prose ol { padding-left: 22px; margin: 8px 0; }
.help-prose li { margin: 5px 0; }
.help-prose a { color: var(--accent); }
.help-prose kbd { background: #f3f4f8; border: 1px solid var(--border, #e6e8ef); border-radius: 5px; padding: 1px 6px; font-size: 12px; font-family: ui-monospace, monospace; }
.help-foot { margin-top: 28px; padding-top: 16px; border-top: 1px solid var(--border, #e6e8ef); }
.help-foot a { color: var(--muted); text-decoration: none; font-size: 14px; }
.help-foot a:hover { color: var(--accent); }
@media (max-width: 760px) {
  .help-layout { grid-template-columns: 1fr; gap: 16px; }
  .help-nav { position: static; flex-direction: row; flex-wrap: wrap; }
}

/* Public MCP docs page (pre-login) */
/* This page is documentation, not a login form: let the card go wide and start
   below the brand logo instead of vertically centering a narrow column. */
.auth-card:has(.mcp-doc) { max-width: 920px; }
.auth-main:has(.mcp-doc) { justify-content: flex-start; padding-top: 92px; padding-bottom: 56px; }
.alt-sub { margin-top: 6px; font-size: 12.5px; }
.alt-sub a { color: var(--muted); }
.alt-sub a:hover { color: var(--accent); }
.mcp-doc { max-width: 860px; }
.mcp-doc h1 { font-size: 26px; line-height: 1.2; margin: 0 0 10px; }
.mcp-doc h2 { font-size: 16px; margin: 26px 0 8px; }
.mcp-doc .lede { font-size: 15px; line-height: 1.55; color: #3a3f4b; margin: 0 0 18px; max-width: 640px; }
.mcp-doc p { font-size: 14.5px; line-height: 1.55; color: #3a3f4b; max-width: 680px; }
.mcp-doc .muted { color: var(--muted); font-size: 13px; }
.mcp-url { display: flex; flex-direction: column; gap: 4px; background: var(--accent-weak); border-radius: 10px; padding: 12px 16px; margin: 4px 0 8px; max-width: 480px; }
.mcp-url-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--accent); }
.mcp-url code { font-size: 14px; font-weight: 600; color: var(--ink); word-break: break-all; }
.mcp-examples, .mcp-steps { padding-left: 20px; margin: 8px 0; }
.mcp-examples li, .mcp-steps li { font-size: 14.5px; line-height: 1.5; color: #3a3f4b; margin: 5px 0; }
.mcp-examples li { color: var(--ink); }
.mcp-tools { width: 100%; max-width: 720px; border-collapse: collapse; margin: 6px 0; }
.mcp-tools td { font-size: 13.5px; line-height: 1.45; color: #3a3f4b; padding: 8px 12px 8px 0; border-bottom: 1px solid var(--border, #e6e8ef); vertical-align: top; }
.mcp-tools td:first-child { white-space: nowrap; padding-right: 18px; color: var(--ink); }
.mcp-back { margin-top: 24px; }
.mcp-back a { color: var(--muted); text-decoration: none; font-size: 14px; }
.mcp-back a:hover { color: var(--accent); }

/* ============================================================
   Public blog. ALL post design lives here + in lib/Blog.php.
   Tweak these rules to restyle every post at once.
   ============================================================ */
.blog-body { background: #fff; color: var(--ink); margin: 0; font-family: var(--font, 'Inter', sans-serif); }
.blog-top {
  display: flex; align-items: center; justify-content: space-between;
  max-width: 1080px; margin: 0 auto; padding: 20px 24px;
  border-bottom: 1px solid #ececf2;
}
.blog-top nav { display: flex; gap: 18px; }
.blog-top nav a { color: var(--muted); text-decoration: none; font-size: 14px; font-weight: 600; }
.blog-top nav a:hover { color: var(--accent); }
.blog-foot {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px;
  max-width: 1080px; margin: 64px auto 0; padding: 28px 24px; border-top: 1px solid #ececf2;
  color: var(--muted); font-size: 13px;
}
.blog-foot a { color: var(--muted); text-decoration: none; }
.blog-foot a:hover { color: var(--accent); }

/* Listing */
.blog-list { max-width: 1080px; margin: 0 auto; padding: 48px 24px; }
.blog-list > h1 { font-size: 34px; letter-spacing: -0.02em; margin: 0 0 44px; }
.blog-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 40px 24px; }
.blog-card {
  display: flex; flex-direction: column; text-decoration: none; color: inherit;
  border: 1px solid #ececf2; border-radius: 14px; overflow: hidden; background: #fff;
  transition: box-shadow .18s, transform .18s;
}
.blog-card:hover { box-shadow: 0 12px 32px rgba(40,36,90,.12); transform: translateY(-2px); }
.blog-card-img { display: block; height: 168px; background-size: cover; background-position: center; background-color: #f1f1f8; }
.blog-card-body { display: flex; flex-direction: column; gap: 7px; padding: 16px 18px; }
.blog-card-body strong { font-size: 17px; line-height: 1.3; letter-spacing: -0.01em; }
.blog-card-excerpt { font-size: 13.5px; line-height: 1.5; color: var(--muted); }
.blog-card-date { font-size: 12px; color: #9aa0ae; margin-top: 2px; }
.blog-empty { color: var(--muted); }

/* Article */
.blog-article { max-width: 720px; margin: 0 auto; padding: 40px 24px; }
.blog-back { display: inline-block; margin-bottom: 22px; color: var(--muted); text-decoration: none; font-size: 14px; font-weight: 600; }
.blog-back:hover { color: var(--accent); }
.blog-article-head h1 { font-size: 38px; line-height: 1.15; letter-spacing: -0.025em; margin: 0 0 12px; }
.blog-meta { color: var(--muted); font-size: 14px; margin: 0 0 8px; }
.blog-hero { width: 100%; height: auto; border-radius: 16px; margin: 22px 0 8px; display: block; }

/* The authored body. This is the typography applied to every post's HTML. */
.blog-content { font-size: 17px; line-height: 1.75; color: #2d2f3a; padding-top: 14px; }
.blog-content > *:first-child { margin-top: 0; }
.blog-content h2 { font-size: 26px; letter-spacing: -0.02em; margin: 2.2rem 0 0.8rem; line-height: 1.25; color: var(--ink); }
.blog-content h3 { font-size: 20px; margin: 1.8rem 0 0.6rem; color: var(--ink); }
.blog-content p { margin: 0 0 1.2rem; }
.blog-content ul, .blog-content ol { margin: 0 0 1.2rem; padding-left: 1.6rem; }
.blog-content li { margin-bottom: 0.45rem; }
.blog-content a { color: var(--accent); font-weight: 600; }
.blog-content strong { color: var(--ink); }
.blog-content img { max-width: 100%; height: auto; border-radius: 12px; margin: 1.6rem 0; display: block; }
.blog-content blockquote {
  border-left: 3px solid var(--accent); margin: 1.8rem 0; padding: 0.2rem 0 0.2rem 1.4rem;
  color: var(--muted); font-style: italic;
}
.blog-content pre { background: #16181d; color: #e8e8ef; padding: 16px 18px; border-radius: 10px; overflow-x: auto; font-size: 14px; margin: 1.4rem 0; }
.blog-content code { font-family: ui-monospace, monospace; font-size: 0.92em; }
.blog-content hr { border: none; border-top: 1px solid #ececf2; margin: 2rem 0; }

/* Related */
.blog-related { max-width: 720px; margin: 48px auto 0; padding: 0 24px; }
.blog-related h2 { font-size: 18px; margin: 0 0 16px; }

@media (max-width: 640px) {
  .blog-article-head h1 { font-size: 30px; }
  .blog-list > h1 { font-size: 28px; }
}

/* Admin blog list (internal) */
.data-table { border-collapse: collapse; }
.data-table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 8px 12px; border-bottom: 1px solid #ececf2; }
.data-table td { padding: 11px 12px; border-bottom: 1px solid #f1f1f6; font-size: 14px; }
.data-table a { color: var(--ink); text-decoration: none; font-weight: 600; }
.data-table a:hover { color: var(--accent); }
.status-chip { display: inline-block; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; padding: 2px 9px; border-radius: 999px; background: #f1f1f8; color: var(--muted); }
.status-chip.ok { background: #e8f8f0; color: var(--ok, #0B8A60); }

/* List / Cards view toggle (segmented control) */
.toolbar .view-toggle { display: inline-flex; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; margin-left: auto; }
.view-opt { border: none; background: var(--card); color: var(--muted); font-size: 13px; font-weight: 600; padding: 7px 16px; cursor: pointer; }
.view-opt + .view-opt { border-left: 1px solid var(--line); }
.view-opt.active { background: var(--accent); color: #fff; }
.view-opt:not(.active):hover { background: var(--bg); color: var(--ink); }

/* Client cards — deliberately distinct from project cards: horizontal directory
   cards with a big rounded logo badge, no image cover. */
.client-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.client-card {
  display: flex; align-items: center; gap: 16px; text-decoration: none;
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 18px 20px; transition: transform .12s, box-shadow .12s;
  border-left: 4px solid var(--cc-accent, var(--accent));
}
.client-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(16,24,40,.10), 0 0 0 1px var(--line); }
.cc-badge {
  width: 54px; height: 54px; border-radius: 14px; flex: none;
  display: flex; align-items: center; justify-content: center; overflow: hidden;
  background: var(--cc-accent, var(--accent)); color: #fff; font-size: 22px; font-weight: 800; letter-spacing: -0.02em;
}
.cc-badge img { width: 100%; height: 100%; object-fit: cover; }
.cc-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cc-name { font-size: 16px; font-weight: 700; color: var(--ink); letter-spacing: -0.01em; }
.cc-meta { font-size: 12.5px; color: var(--muted); }
.cc-meta span + span::before { content: '·'; margin: 0 7px; color: var(--line); }

/* Topbar user-avatar menu */
.user-menu { position: relative; }
.user-menu-trigger { background: none; border: none; padding: 0; cursor: pointer; border-radius: 50%; line-height: 0; }
.user-menu-trigger .avatar {
  width: 34px; height: 34px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--accent) 0%, #9B7BFF 100%); color: #fff;
  font-size: 12.5px; font-weight: 700; letter-spacing: .02em;
}
.user-menu-trigger:hover .avatar { box-shadow: 0 0 0 3px var(--accent-weak); }
.user-menu-dropdown {
  position: absolute; top: calc(100% + 8px); right: 0; min-width: 210px; z-index: 60;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 12px 32px rgba(16,24,40,.16); padding: 6px; overflow: hidden;
}
.user-menu-dropdown[hidden] { display: none; }
.user-menu-head { padding: 9px 11px 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; display: flex; flex-direction: column; gap: 1px; }
.user-menu-head .who-name { font-size: 13.5px; font-weight: 700; color: var(--ink); }
.user-menu-head .who-email { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-menu-dropdown a {
  display: flex; align-items: center; gap: 10px; padding: 9px 11px; border-radius: 8px;
  color: var(--ink); text-decoration: none; font-size: 13.5px; font-weight: 500;
}
.user-menu-dropdown a svg { width: 16px; height: 16px; flex: none; opacity: .7; }
.user-menu-dropdown a:hover { background: var(--bg); }
.user-menu-dropdown a.user-menu-signout { color: var(--danger, #E5484D); }
.user-menu-dropdown a.user-menu-signout svg { opacity: 1; }

/* Find Similar (asset view rail) */
.similar-group { margin-top: 14px; }
.similar-group:first-of-type { margin-top: 6px; }
.similar-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: 8px; }
.similar-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 9px; }
.similar-item { display: flex; flex-direction: column; gap: 5px; text-decoration: none; color: var(--ink); }
.similar-thumb {
  display: block; aspect-ratio: 1 / 1; border-radius: 9px; overflow: hidden; background: #EEF0F4;
}
.similar-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .15s; }
.similar-item:hover .similar-thumb img { transform: scale(1.04); }
.similar-thumb-blank { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-size: 22px; font-weight: 800; color: #fff; background: linear-gradient(135deg, var(--accent) 0%, #9B7BFF 100%); }
.similar-title { font-size: 11.5px; line-height: 1.3; color: var(--muted); overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.similar-item:hover .similar-title { color: var(--accent); }

/* Similarity sensitivity slider (Agency settings) */
.slider-row { display: flex; align-items: center; gap: 14px; max-width: 460px; }
.similarity-slider { flex: 1; accent-color: var(--accent); cursor: pointer; }

/* Possible Duplicates card (reuses .similar-* grid) */
.dup-card .similar-thumb { position: relative; }
.dup-badge {
  position: absolute; top: 4px; left: 4px; background: #E5484D; color: #fff;
  font-size: 9.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
  padding: 2px 6px; border-radius: 5px;
}

/* Team-member facepile (billing usage) */
.facepile { display: flex; align-items: center; margin-top: 10px; }
.facepile > * { margin-left: -8px; }
.facepile > *:first-child { margin-left: 0; }
.facepile-avatar {
  width: 34px; height: 34px; border-radius: 50%; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: #fff; letter-spacing: .02em;
  background: linear-gradient(135deg, var(--accent) 0%, #9B7BFF 100%);
  box-shadow: 0 0 0 2.5px var(--card); position: relative;
}
.facepile-more { background: #C9CCD6; color: #4A4F60; }
.facepile-slot {
  width: 34px; height: 34px; border-radius: 50%; flex: none;
  border: 1.5px dashed var(--line); background: var(--bg);
  box-shadow: 0 0 0 2.5px var(--card);
}

.facepile-label { margin-top: 9px; }

/* ---- Billing redesign: two-card split ---- */
.billing-split { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 18px; }
@media (max-width: 860px) { .billing-split { grid-template-columns: 1fr; } }
.billing-panel { margin-bottom: 0; }
.bp-head { display: flex; align-items: center; gap: 11px; margin-bottom: 20px; }
.bp-head h3 { font-size: 16px; margin: 0; }
.bp-head .bp-count { margin-left: auto; }
.bp-icon {
  width: 38px; height: 38px; border-radius: 10px; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent-weak, #EEEBFF); color: var(--accent);
}
.bp-icon svg { width: 19px; height: 19px; }
.bp-icon-sm { width: 32px; height: 32px; border-radius: 9px; }
.bp-icon-sm svg { width: 16px; height: 16px; }

/* Storage donut */
.storage-body { display: flex; align-items: center; gap: 26px; flex-wrap: wrap; }
.donut {
  width: 168px; height: 168px; border-radius: 50%; flex: none;
  background: conic-gradient(var(--ring) var(--deg), #ECEAF6 0deg);
  display: flex; align-items: center; justify-content: center;
}
.donut-hole {
  width: 130px; height: 130px; border-radius: 50%; background: var(--card);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; text-align: center;
}
.donut-num { font-size: 24px; font-weight: 800; color: var(--ink); letter-spacing: -0.02em; }
.donut-sub { font-size: 12.5px; color: var(--muted); }
.donut-chip { margin-top: 5px; font-size: 11px; font-weight: 700; color: var(--accent); background: var(--accent-weak, #EEEBFF); padding: 3px 9px; border-radius: 20px; }
.storage-legend { list-style: none; margin: 0; padding: 0; flex: 1; min-width: 160px; display: flex; flex-direction: column; gap: 12px; }
.storage-legend li { display: flex; align-items: center; gap: 9px; font-size: 13.5px; color: var(--ink); }
.storage-legend li em { margin-left: auto; font-style: normal; font-weight: 600; color: var(--muted); }
.storage-legend .dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.storage-legend .dot-used { background: var(--accent); }
.storage-legend .dot-free { background: #D9D5EC; }
.storage-legend .storage-total { border-top: 1px solid var(--line); padding-top: 12px; color: var(--muted); }
.storage-legend .storage-total svg { flex: none; opacity: .7; }

/* Larger facepile + add button (team card) */
.facepile-lg .facepile-avatar, .facepile-lg .facepile-slot, .facepile-lg .facepile-add { width: 52px; height: 52px; font-size: 16px; }
.facepile-lg > * { margin-left: -12px; }
.facepile-lg > *:first-child { margin-left: 0; }
.facepile-add {
  width: 52px; height: 52px; border-radius: 50%; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1.5px dashed var(--line); color: var(--muted); background: var(--card);
  box-shadow: 0 0 0 2.5px var(--card); font-size: 22px; font-weight: 400; text-decoration: none;
  transition: border-color .12s, color .12s;
}
.facepile-add:hover { border-color: var(--accent); color: var(--accent); }

/* Invite row */
.invite-row { display: flex; align-items: center; gap: 13px; }
.invite-copy { display: flex; flex-direction: column; gap: 2px; }
.invite-copy strong { font-size: 14px; color: var(--ink); }
.invite-row .btn { margin-left: auto; }

/* Plan header: status chip + action button */
.plan-status { display: flex; align-items: center; gap: 12px; }

/* Starter folders on New Project + folder-template editor in Settings */
.starter-folders { border: 1px solid var(--line); border-radius: 12px; padding: 16px 16px 6px; margin-bottom: 18px; }
.starter-folders legend { font-size: 13px; font-weight: 700; color: var(--ink); padding: 0 6px; }
.folder-choices { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 4px; }
.folder-choice {
  display: inline-flex; align-items: center; gap: 7px; cursor: pointer;
  border: 1px solid var(--line); border-radius: 8px; padding: 7px 12px; font-size: 13.5px;
  background: var(--bg); transition: border-color .12s, background .12s;
}
.folder-choice:hover { border-color: var(--accent); }
.folder-choice input { margin: 0; }
.folder-choice:has(input:checked) { border-color: var(--accent); background: var(--accent-weak); color: var(--accent); }
.custom-folders-label { display: block; margin-top: 12px; }
.folder-template-input { width: 100%; font-family: inherit; resize: vertical; }

/* Version count pill on asset cards (bottom-right, opposite the status chip) */
.thumb-versions {
  position: absolute; right: 8px; bottom: 8px;
  background: rgba(22, 24, 29, 0.72); color: #fff;
  font-size: 11px; font-weight: 600; letter-spacing: .01em;
  padding: 3px 8px; border-radius: 20px; backdrop-filter: blur(2px);
}

/* Inline pin-comment popup (appears next to a freshly dropped hotspot pin) */
.pin-popup {
  position: absolute; z-index: 30; pointer-events: auto;
  width: 264px; max-width: 72vw;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 12px 32px rgba(22,24,29,0.18); padding: 12px;
  transform: translate(14px, -50%);   /* default: to the right of the pin, vertically centered */
}
.pin-popup[hidden] { display: none; }
.pin-popup.flip-x { transform: translate(calc(-100% - 14px), -50%); }   /* left of pin near right edge */
.pin-popup.flip-y { transform: translate(14px, calc(-100% + 0px)); }    /* above pin near bottom */
.pin-popup.flip-x.flip-y { transform: translate(calc(-100% - 14px), calc(-100% + 0px)); }
.pin-popup textarea {
  width: 100%; resize: vertical; min-height: 52px; font-family: inherit; font-size: 13.5px;
  border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; box-sizing: border-box;
}
.pin-popup .vis-toggle.small { display: flex; align-items: center; gap: 6px; font-size: 12px; margin-top: 8px; }
.pin-popup-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 10px; }

/* Pins region wrapper is transparent to layout (pins position against the layer) */
.pins-region { display: contents; }

/* Read popup: shows an existing pin's comment(s) next to the pin */
.pin-read {
  position: absolute; z-index: 31; pointer-events: auto;
  width: 280px; max-width: 74vw;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 12px 32px rgba(22,24,29,0.18); padding: 12px 12px 10px;
  transform: translate(14px, -50%);
}
.pin-read[hidden] { display: none; }
.pin-read.flip-x { transform: translate(calc(-100% - 14px), -50%); }
.pin-read.flip-y { transform: translate(14px, calc(-100% + 0px)); }
.pin-read.flip-x.flip-y { transform: translate(calc(-100% - 14px), calc(-100% + 0px)); }
.pin-read-close {
  position: absolute; top: 6px; right: 8px; border: 0; background: none;
  font-size: 20px; line-height: 1; color: var(--muted); cursor: pointer; padding: 2px 4px;
}
.pin-read-close:hover { color: var(--ink); }
.pin-read-title { font-size: 12px; font-weight: 700; color: var(--muted); margin-bottom: 8px; padding-right: 18px; }
.pin-read-body .comment { margin-bottom: 8px; }
.pin-read-body .comment:last-child { margin-bottom: 0; }

/* Rectangular hotspot region marker + live rubber-band while dragging */
.hotspot-region {
  position: absolute; box-sizing: border-box; padding: 0; margin: 0;
  border: 2px solid var(--accent); background: rgba(99,102,241,0.12);
  border-radius: 4px; cursor: pointer; pointer-events: auto;
}
.hotspot-region:hover { background: rgba(99,102,241,0.20); }
.hotspot-region.resolved { border-color: var(--ok); background: rgba(34,197,94,0.12); }
.hotspot-region .region-tag {
  position: absolute; top: -10px; left: -10px;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--accent); color: #fff; font-size: 11px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.hotspot-region.resolved .region-tag { background: var(--ok); }
.drag-rect {
  position: absolute; box-sizing: border-box;
  border: 2px dashed var(--accent); background: rgba(99,102,241,0.10);
  border-radius: 4px; pointer-events: none;
}
.drag-rect[hidden] { display: none; }

/* Prominent download affordances on share links */
.share-download-btn {
  display: inline-flex; align-items: center; gap: 8px;
  width: 100%; justify-content: center; margin: 4px 0 18px;
  font-size: 15px; font-weight: 600;
}
.share-download-btn svg { flex: none; }
.stage-download {
  position: absolute; top: 12px; right: 12px; z-index: 12;
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 10px;
  background: rgba(22,24,29,0.62); color: #fff; backdrop-filter: blur(3px);
  box-shadow: 0 2px 10px rgba(0,0,0,0.18); transition: background .12s, transform .12s;
}
.stage-download:hover { background: var(--accent); transform: translateY(-1px); }

/* List-view folder icon with client-visibility state */
.row-folder-icon { display: inline-flex; vertical-align: middle; margin-right: 7px; line-height: 0; }
.row-folder-icon svg { width: 20px; height: 20px; }
.row-folder-icon.fc-internal svg { color: var(--muted); }
.row-folder-icon.fc-shared svg { color: var(--ok); }
