:root {
  --navy: #0f122f;
  --blue: #008fff;
  --vivid: #0e46e7;
  --violet: #7017a2;
  --lime: #00e500;
  --pink: #ff0098;
  --bg: #f3f5fa;
  --line: #e1e5ef;
  --muted: #5d6380;
  --stage: #e7eaf2;
  --head: 'Josefin Sans', 'Lato', system-ui, sans-serif;
  --body: 'Lato', system-ui, -apple-system, 'Segoe UI', sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--navy); font: 14px/1.5 var(--body); -webkit-font-smoothing: antialiased; }
h1, h2, h3 { font-family: var(--head); font-weight: 700; margin: 0; }
a { color: var(--vivid); }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.spacer { flex: 1; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--line); background: #fff; color: var(--navy); padding: 8px 14px; border-radius: 8px; font-weight: 700; font-size: 14px; line-height: 1.2; white-space: nowrap; transition: background .15s, border-color .15s; }
.btn:hover { border-color: #c5ccdc; background: #f8f9fc; }
.btn.primary { background: var(--vivid); border-color: var(--vivid); color: #fff; }
.btn.primary:hover { background: #0a39c2; border-color: #0a39c2; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { background: rgba(15,18,47,.05); }
.btn.danger { color: #c4006f; }
.btn.small { padding: 6px 10px; font-size: 14px; }
.btn:disabled { opacity: .5; cursor: default; }
.btn.on-dark { background: rgba(255,255,255,.1); border-color: transparent; color: #fff; }
.btn.on-dark:hover { background: rgba(255,255,255,.18); }

/* ---------- Top bar ---------- */
.topbar { height: 56px; flex: none; background: var(--navy); color: #fff; display: flex; align-items: center; gap: 14px; padding: 0 18px; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-family: var(--head); font-weight: 700; font-size: 19px; padding-top: 3px; }
.brand .mark { width: 22px; height: 22px; border-radius: 11px 11px 11px 3px; background: var(--pink); margin-top: -3px; flex: none; }
.brand .sub { color: #9aa3d6; font-weight: 600; }
.topnote { color: #9aa3d6; font-size: 14px; }

.seg { display: inline-flex; background: rgba(255,255,255,.08); border-radius: 9px; padding: 3px; gap: 2px; }
.seg button { background: none; border: 0; color: #c3c8ea; padding: 6px 12px; border-radius: 6px; font-weight: 700; font-size: 14px; }
.seg button:hover { color: #fff; }
.seg button.on { background: #fff; color: var(--navy); }
.seg.light { background: #e9ecf4; }
.seg.light button { color: var(--muted); }
.seg.light button.on { color: var(--navy); box-shadow: 0 1px 2px rgba(15,18,47,.12); }

/* ---------- Dashboard ---------- */
.container { max-width: 1040px; margin: 0 auto; padding: 40px 24px 80px; }
.intro h1 { font-size: 34px; letter-spacing: -.3px; }
.intro p { color: var(--muted); max-width: 60ch; margin: 8px 0 0; font-size: 15px; }

.new-review { margin: 28px 0 40px; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 20px; }
.new-review .row { display: flex; gap: 12px; align-items: flex-end; margin-top: 16px; flex-wrap: wrap; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 200px; }
.field.grow { flex: 1 1 240px; }
.field.full { flex: 1 1 100%; }
.new-review .row + .row { margin-top: 14px; }
.field label { font-size: 14px; font-weight: 700; color: var(--muted); }
.field input[type=text], .field select { height: 40px; border: 1px solid var(--line); border-radius: 8px; padding: 0 12px; background: #fff; width: 100%; }
.field select { padding-right: 32px; appearance: none; cursor: pointer; text-overflow: ellipsis;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='none' stroke='%235d6380' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m3 4.5 3 3 3-3'/%3E%3C/svg%3E") no-repeat right 12px center; }
.field input[type=text]:focus, .field select:focus { border-color: var(--blue); outline: none; box-shadow: 0 0 0 3px rgba(0,143,255,.15); }
.new-review .btn.primary { height: 40px; padding: 0 20px; }
.drop { height: 40px; display: flex; align-items: center; gap: 8px; border: 1px dashed #b9c1d6; border-radius: 8px; padding: 0 12px; color: var(--muted); cursor: pointer; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.drop.over { border-color: var(--blue); background: #f0f7ff; }
.drop input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.drop.has-file { color: var(--navy); border-style: solid; }
.form-error { color: #c4006f; margin-top: 12px; font-weight: 700; }

.list-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 12px; }
.list-head h2 { font-size: 20px; }
.list-head span { color: var(--muted); }
.review-list { background: #fff; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.review-row { display: grid; grid-template-columns: 22px 44px minmax(0,1fr) 110px 100px 200px; align-items: center; gap: 16px; padding: 14px 18px; border-top: 1px solid var(--line); }
.review-row:first-child { border-top: 0; }
.review-row:hover { background: #fafbfd; }
.type-icon { width: 44px; height: 44px; border-radius: 10px; display: grid; place-items: center; font-family: var(--head); font-weight: 700; font-size: 14px; color: #fff; overflow: hidden; padding-top: 2px; }
.type-icon.website { background: var(--vivid); }
.type-icon.pdf { background: var(--violet); }
.type-icon.image { background: #fff; padding: 0; border: 1px solid var(--line); }
.type-icon img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.review-main { min-width: 0; }
.review-main a { color: var(--navy); text-decoration: none; font-weight: 700; font-size: 15px; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.review-main a:hover { color: var(--vivid); }
.review-main .sub { color: var(--muted); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.open-count { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; }
.open-count .dot { width: 9px; height: 9px; border-radius: 5px 5px 5px 1px; background: #c8cede; }
.open-count.has .dot { background: var(--pink); }
.when { color: var(--muted); font-size: 14px; }
.row-actions { display: flex; gap: 4px; justify-content: flex-end; }
.empty { color: var(--muted); text-align: center; padding: 48px 24px; }

/* ---------- Review screen ---------- */
body.review { display: flex; flex-direction: column; height: 100vh; overflow: hidden; }
.asset-title { font-weight: 700; max-width: 340px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #e5e8fb; }
.divider { width: 1px; height: 24px; background: rgba(255,255,255,.15); }
.urlbar { flex: 1 1 auto; max-width: 560px; min-width: 160px; display: flex; align-items: center; gap: 2px; background: rgba(255,255,255,.08); border-radius: 8px; padding: 0 4px; height: 34px; }
.urlbar button { background: none; border: 0; color: #c3c8ea; width: 28px; height: 28px; border-radius: 6px; display: grid; place-items: center; }
.urlbar button:hover { background: rgba(255,255,255,.1); color: #fff; }
.urlbar input { flex: 1; min-width: 0; background: transparent; border: 0; color: #fff; padding: 0 6px; font-size: 14px; outline: none; }

.workspace { flex: 1; display: flex; min-height: 0; }
.stage { flex: 1; min-width: 0; overflow: auto; background: var(--stage); position: relative; }
.sidebar { width: 390px; flex: none; border-left: 1px solid var(--line); background: #fff; display: flex; flex-direction: column; min-height: 0; }

/* Website stage */
.stage.web { overflow: auto; }
.frame-wrap { position: relative; width: 100%; height: 100%; background: #fff; margin: 0 auto; }
.frame-wrap iframe { border: 0; width: 100%; height: 100%; display: block; background: #fff; }
.stage.web[data-device=tablet] .frame-wrap { width: 820px; max-width: calc(100% - 32px); height: calc(100% - 32px); margin: 16px auto; border-radius: 12px; overflow: hidden; box-shadow: 0 8px 30px rgba(15,18,47,.18); }
.stage.web[data-device=mobile] .frame-wrap { width: 390px; max-width: calc(100% - 32px); height: calc(100% - 32px); max-height: 844px; margin: 16px auto; border-radius: 24px; overflow: hidden; box-shadow: 0 0 0 8px var(--navy), 0 12px 40px rgba(15,18,47,.25); }
.frame-loading { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); background: var(--navy); color: #fff; font-size: 14px; font-weight: 700; padding: 6px 12px; border-radius: 20px; pointer-events: none; }
.frame-note { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); background: #fff; border: 1px solid var(--line); box-shadow: 0 6px 20px rgba(15,18,47,.15); padding: 10px 12px 10px 16px; border-radius: 10px; display: flex; align-items: center; gap: 12px; font-weight: 700; white-space: nowrap; }

/* Image and document stage */
.doc-col { padding: 28px 32px 48px; display: flex; flex-direction: column; align-items: center; gap: 32px; min-height: 100%; }
.page-block { width: min(1000px, 100%); display: flex; flex-direction: column; gap: 8px; }
.page-block.img { width: auto; max-width: min(1400px, 100%); min-width: min(520px, 100%); }
.page-bar { display: flex; align-items: center; gap: 10px; min-height: 32px; }
.page-name { font-family: var(--head); font-weight: 700; font-size: 15px; padding-top: 2px; }
.version-sel { border: 1px solid var(--line); border-radius: 6px; padding: 4px 6px; background: #fff; font-size: 14px; max-width: 220px; }
.version-one { font-size: 14px; color: var(--muted); }
.old-flag { font-size: 14px; font-weight: 700; color: #7a4b00; background: #fff1cc; padding: 2px 8px; border-radius: 10px; }
.sheet { position: relative; background: #fff; box-shadow: 0 2px 4px rgba(15,18,47,.06), 0 10px 30px rgba(15,18,47,.1); width: 100%; }
.page-block.img .sheet { width: auto; }
.sheet img { display: block; width: 100%; height: 100%; object-fit: contain; user-select: none; -webkit-user-drag: none; }
.page-block.img .sheet img { width: auto; max-width: 100%; height: auto; }
.sheet.old { outline: 3px solid #ffd666; outline-offset: 0; }
.stage.commenting .sheet { cursor: crosshair; }
.pin-layer { position: absolute; inset: 0; pointer-events: none; }
.convert-note { min-height: 100%; display: grid; place-items: center; padding: 32px; }
.convert-box { background: #fff; border-radius: 14px; padding: 28px 32px; max-width: 440px; text-align: center; box-shadow: 0 10px 30px rgba(15,18,47,.1); }
.convert-box h2 { font-size: 20px; margin-bottom: 6px; }
.convert-box p { color: var(--muted); margin: 0; }

/* Pins (same look as the injected layer) */
.pin { position: absolute; min-width: 32px; height: 32px; padding: 0 6px; margin-top: -32px; border-radius: 16px 16px 16px 3px; background: var(--pink); color: #fff; border: 2px solid #fff; font: 700 14px/28px var(--body); text-align: center; pointer-events: auto; cursor: pointer; box-shadow: 0 2px 8px rgba(15,18,47,.35); transform-origin: 0 100%; transition: transform .15s; }
.pin:hover { transform: scale(1.1); }
.pin.resolved { background: var(--lime); color: var(--navy); }
.pin.active { transform: scale(1.2); z-index: 2; box-shadow: 0 0 0 2px #fff, 0 0 0 5px var(--navy), 0 4px 12px rgba(15,18,47,.35); } /* selected: ring, status color kept */
.pin.draft { background: var(--navy); cursor: default; animation: pulse 1.4s ease-out infinite; } /* unsaved comment: navy, never a status color */
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(15,18,47,.5); } 100% { box-shadow: 0 0 0 16px rgba(15,18,47,0); } }

/* Sidebar */
.side-head { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.tabs { display: flex; gap: 2px; }
.tabs { flex: none; }
.tabs button { white-space: nowrap; background: none; border: 0; padding: 6px 10px; border-radius: 6px; font-weight: 700; color: var(--muted); }
.tabs button span { font-weight: 400; margin-left: 2px; }
.tabs button.on { background: #eef1f8; color: var(--navy); }
.scope { min-width: 0; max-width: 170px; text-overflow: ellipsis; margin-left: auto; border: 1px solid var(--line); border-radius: 6px; padding: 4px 6px; background: #fff; font-size: 14px; }
.threads { flex: 1; overflow: auto; padding: 10px; }

.composer { padding: 14px; border-bottom: 1px solid var(--line); background: #fff5fb; }
.composer-title { display: flex; align-items: center; gap: 8px; font-weight: 700; margin-bottom: 8px; }
textarea { width: 100%; min-height: 64px; resize: vertical; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; background: #fff; line-height: 1.45; }
textarea:focus { border-color: var(--blue); outline: none; box-shadow: 0 0 0 3px rgba(0,143,255,.15); }
.row-end { display: flex; align-items: center; gap: 6px; margin-top: 8px; }
.hint { font-size: 14px; color: var(--muted); margin-right: auto; }

.thread { border: 1px solid var(--line); border-radius: 10px; padding: 12px; margin-bottom: 8px; cursor: pointer; background: #fff; }
.thread:hover { border-color: #c9d0e0; }
.thread.elsewhere:not(.active) { background: #fafbfd; }
.thread.active { border-color: var(--navy); box-shadow: 0 0 0 3px rgba(15,18,47,.1); cursor: default; }
.meta { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); }
.meta b { color: var(--navy); font-size: 14px; }
.num { display: inline-grid; place-items: center; min-width: 26px; height: 26px; padding: 0 4px; border-radius: 13px 13px 13px 3px; background: var(--pink); color: #fff; font-size: 14px; font-weight: 700; flex: none; }
.num.resolved { background: var(--lime); color: var(--navy); }
.num.draft { background: var(--navy); color: #fff; }
.tag { margin-left: auto; font-size: 14px; background: #eef1f8; color: var(--muted); padding: 1px 7px; border-radius: 10px; }
.page-note { font-size: 14px; color: var(--violet); margin-top: 6px; font-weight: 700; }
.thread .body { margin-top: 6px; overflow-wrap: anywhere; }
.thread .body.clamp { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.replies-count { font-size: 14px; color: var(--muted); margin-top: 6px; }
.comment { border-top: 1px solid #eef0f6; margin-top: 10px; padding-top: 10px; }
.thread textarea { margin-top: 12px; min-height: 48px; }

/* ---------- Folders, search, selection ---------- */
.toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; min-height: 40px; }
.crumbs { flex: 1; min-width: 0; display: flex; align-items: center; gap: 2px; flex-wrap: wrap; font-family: var(--head); font-size: 20px; font-weight: 700; }
.crumbs .crumb, .crumbs .crumb-current { padding: 5px 8px 2px; border-radius: 8px; border: 2px solid transparent; }
.crumbs .crumb { background: none; color: var(--muted); font: inherit; }
.crumbs .crumb:hover { color: var(--vivid); background: #fff; }
.crumbs .crumb-current { color: var(--navy); }
.crumbs .crumb-sep { color: #b6bdd0; padding: 0 2px; }
.crumbs .btn { font-family: var(--body); margin-left: 4px; }
.search { position: relative; display: flex; align-items: center; width: 320px; max-width: 100%; }
.search svg { position: absolute; left: 12px; color: var(--muted); pointer-events: none; }
.search input { width: 100%; height: 38px; border: 1px solid var(--line); border-radius: 8px; padding: 0 34px 0 36px; background: #fff; }
.search input:focus { border-color: var(--blue); outline: none; box-shadow: 0 0 0 3px rgba(0,143,255,.15); }
.search input::-webkit-search-cancel-button { display: none; }
.search kbd { position: absolute; right: 10px; font: 700 14px var(--body); color: var(--muted); border: 1px solid var(--line); border-radius: 4px; padding: 0 5px; background: #f6f7fb; }
.search input:focus + kbd, .search input:not(:placeholder-shown) + kbd { display: none; }
.toolbar > .btn { height: 38px; }
.select-bar { display: flex; align-items: center; gap: 8px; background: var(--navy); color: #fff; border-radius: 10px; padding: 8px 10px 8px 16px; margin-bottom: 10px; font-weight: 700; }
.select-bar .btn.ghost { color: #c3c8ea; }
.select-bar .btn.ghost:hover { background: rgba(255,255,255,.1); color: #fff; }
.select-bar .btn.danger { color: #ff7ac6; }
.list-caption { padding: 10px 18px; font-size: 14px; color: var(--muted); border-bottom: 1px solid var(--line); background: #fafbfd; }

.check-cell { display: flex; align-items: center; justify-content: center; }
.check-cell input { width: 16px; height: 16px; accent-color: var(--vivid); cursor: pointer; opacity: .35; }
.review-row:hover .check-cell input, .check-cell input:checked, .check-cell input:focus-visible { opacity: 1; }
.review-row.selected { background: #f0f5ff; }
.review-row[draggable="true"] { cursor: default; }
.review-row.dragging { opacity: .45; }
.folder-row { cursor: pointer; }
.type-icon.folder { background: #f1ecf8; color: var(--violet); padding: 0; }
.review-main .sub.where { font-size: 14px; }
.review-main .sub.where a, .review-main .where-link { display: inline; color: var(--violet); font-size: 14px; font-weight: 700; }
.review-main .sub.where a:hover, .review-main .where-link:hover { text-decoration: underline; }
mark { background: #ffe0f2; color: inherit; border-radius: 2px; padding: 0 1px; }
.drop-target { outline: 2px dashed var(--pink); outline-offset: -2px; background: #fff5fb !important; }
.crumbs .drop-target { outline-offset: 0; }

.menu { position: absolute; z-index: 50; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 30px rgba(15,18,47,.15); padding: 4px; min-width: 170px; display: flex; flex-direction: column; }
.menu button { background: none; border: 0; text-align: left; padding: 8px 12px; border-radius: 6px; font-weight: 700; font-size: 14px; }
.menu button:hover, .menu button:focus-visible { background: #f2f4f9; outline: none; }
.menu button.danger { color: #c4006f; }

.modal.wide { width: min(460px, 100%); }
.modal-label { display: block; font-size: 14px; font-weight: 700; color: var(--muted); margin: 10px 0 6px; }
.tree { border: 1px solid var(--line); border-radius: 10px; max-height: 300px; overflow: auto; padding: 4px; }
.tree-row { display: flex; align-items: center; gap: 8px; width: 100%; background: none; border: 0; border-radius: 6px; padding: 7px 10px 7px calc(10px + var(--depth) * 18px); text-align: left; font-weight: 700; color: var(--navy); }
.tree-row svg { width: 16px; height: 16px; color: var(--violet); flex: none; }
.tree-row:hover { background: #f2f4f9; }
.tree-row.on { background: var(--vivid); color: #fff; }
.tree-row.on svg { color: #fff; }
.tree-row:disabled { opacity: .4; cursor: not-allowed; background: none; }
.tree-new { display: flex; gap: 8px; margin-top: 10px; }
.tree-new input { flex: 1; height: 34px; border: 1px solid var(--line); border-radius: 8px; padding: 0 10px; }
.tree-new input:focus { border-color: var(--blue); outline: none; box-shadow: 0 0 0 3px rgba(0,143,255,.15); }

.asset-title { display: flex; align-items: center; min-width: 60px; flex: 0 1 auto; max-width: 420px; }
.asset-title a { color: #9aa3d6; text-decoration: none; flex: none; max-width: 140px; overflow: hidden; text-overflow: ellipsis; }
.title-sep { color: #5f6796; margin: 0 6px; }
.title-btn { display: inline-flex; align-items: center; gap: 6px; min-width: 0; background: none; border: 0; color: #e5e8fb; font-weight: 700; padding: 4px 6px; margin-left: -6px; border-radius: 6px; }
.title-btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.title-btn svg { flex: none; opacity: 0; color: #9aa3d6; transition: opacity .15s; }
.title-btn:hover { background: rgba(255,255,255,.08); }
.title-btn:hover svg, .title-btn:focus-visible svg { opacity: 1; }
.title-form { flex: 1 1 auto; min-width: 120px; }
.title-form input { width: 100%; max-width: 300px; height: 30px; background: rgba(255,255,255,.12); border: 1px solid var(--blue); border-radius: 6px; color: #fff; font-weight: 700; padding: 0 8px; outline: none; }
.dupe-list { display: flex; flex-direction: column; gap: 8px; margin: 4px 0 12px; max-height: 260px; overflow: auto; }
.dupe { display: block; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; text-decoration: none; color: var(--navy); }
.dupe:hover { border-color: var(--vivid); background: #f6f9ff; }
.dupe b { display: block; }
.dupe span { font-size: 14px; color: var(--muted); }
.modal p.dupe-hint { margin: 0; font-size: 14px; }
.modal p { overflow-wrap: anywhere; }
.asset-title a:hover { color: #fff; }

/* ---------- Folder cards ---------- */
.folder-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 26px 18px; margin: 4px 0 30px; }
@media (max-width: 1180px) { .folder-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 1040px) and (min-width: 901px) { .folder-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) { .folder-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.folder-grid:empty { display: none; }
.folder-card { --face: #eceef4; position: relative; margin-top: 12px; background: #fff; border-radius: 0 14px 14px 14px; box-shadow: 0 0 0 1px var(--line); cursor: pointer; transition: box-shadow .15s; }
/* The folder tab: rounded on the left, slanted on the right */
.folder-card::before { content: ""; position: absolute; left: 0; top: -12px; width: calc(42% + 14px); height: 13px; background: var(--face); border-radius: 12px 0 0 0; clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 100%, 0 100%); transition: background .15s; }
.folder-card:hover { --face: #e3e6ef; box-shadow: 0 0 0 1px #cdd3e1, 0 6px 18px rgba(15,18,47,.07); }
.folder-card.dragging { opacity: .45; }
.folder-card.drop-target { --face: #ffe1f2; outline: 2px dashed var(--pink); outline-offset: 3px; }
.folder-face { position: relative; height: 118px; background: var(--face); border-radius: 0 14px 0 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; transition: background .15s; }
.folder-count { display: flex; align-items: baseline; gap: 6px; color: var(--muted); }
.folder-count b { font-family: var(--head); font-size: 34px; line-height: 1; color: var(--navy); padding-top: 4px; }
.folder-count span { font-size: 14px; }
.folder-sub { font-size: 14px; color: var(--muted); }
.folder-more { position: absolute; top: 8px; right: 8px; width: 30px; height: 30px; border-radius: 8px; border: 0; background: transparent; color: var(--muted); display: grid; place-items: center; opacity: 0; transition: opacity .15s, background .15s; }
.folder-card:hover .folder-more, .folder-more:focus-visible { opacity: 1; }
.folder-more:hover { background: #fff; color: var(--navy); }
.folder-body { padding: 14px 16px 16px; min-height: 84px; }
.folder-name { display: block; font-family: var(--head); font-weight: 700; font-size: 17px; color: var(--navy); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding-top: 2px; }
.folder-name:hover { color: var(--vivid); }
.folder-meta { font-size: 14px; color: var(--muted); margin-top: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.folder-meta .where-link { color: var(--violet); font-weight: 700; text-decoration: none; }
.folder-meta .where-link:hover { text-decoration: underline; }
.folder-open { display: flex; align-items: center; gap: 7px; margin-top: 8px; font-size: 14px; font-weight: 700; color: var(--navy); }
.folder-open .dot { width: 8px; height: 8px; border-radius: 4px 4px 4px 1px; background: var(--pink); }
.list-heading { font-size: 16px; margin: 0 0 10px; color: var(--navy); }
@media (hover: none) { .folder-more { opacity: 1; } }
@media (max-width: 560px) {
  .folder-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 12px; }
  .folder-face { height: 88px; }
  .folder-count b { font-size: 28px; }
  .folder-body { padding: 12px; min-height: 0; }
  .folder-name { font-size: 15px; }
  .folder-meta { font-size: 14px; }
}

.drop-icon, .drop-sub { display: none; }

/* ---------- Comment stages ---------- */
.pin.review, .num.review { background: var(--violet); color: #fff; }
.tabs { flex-wrap: nowrap; width: 100%; gap: 2px; }
.tabs button { flex: 1 1 auto; padding: 6px 4px; font-size: 14px; white-space: nowrap; }
.tabs button span { margin-left: 3px; }
.tabs button span { color: var(--muted); }
.side-head { flex-wrap: wrap; row-gap: 8px; }
.side-head .scope { margin-left: 0; max-width: none; }
.status-row { display: flex; align-items: center; gap: 8px; margin-top: 12px; }
.status-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.status-seg { display: flex; flex: 1; background: #eef1f8; border-radius: 8px; padding: 2px; gap: 2px; }
.status-seg button { flex: 1; border: 0; background: none; border-radius: 6px; padding: 5px 4px; font-size: 14px; font-weight: 700; color: var(--muted); white-space: nowrap; }
.status-seg button:hover { color: var(--navy); background: rgba(255,255,255,.6); }
.status-seg button.on { background: #fff; box-shadow: 0 1px 2px rgba(15,18,47,.15); }
.status-seg button.open.on { color: var(--pink); }
.status-seg button.review.on { color: var(--violet); }
.status-seg button.resolved.on { color: #0a7a0a; }
.status-note { font-size: 14px; color: var(--muted); margin-top: 6px; }
.counts { display: flex; flex-direction: column; gap: 2px; }
.ready-count { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 700; color: var(--violet); }
.ready-count .dot { width: 8px; height: 8px; border-radius: 4px 4px 4px 1px; background: var(--violet); }
.folder-open.ready { color: var(--violet); margin-top: 4px; }
.folder-open.ready .dot { background: var(--violet); }

/* ---------- App shell: left nav + main ---------- */
body.app { display: block; min-height: 100vh; height: auto; padding-left: 350px; }
.app-nav { position: fixed; top: 0; left: 0; bottom: 0; width: 350px; z-index: 40; overflow-y: auto; overscroll-behavior: contain; background: var(--navy); color: #fff; display: flex; flex-direction: column; gap: 18px; padding: 18px 16px 16px; }
.nav-brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-family: var(--head); font-weight: 700; font-size: 20px; padding: 6px 8px 0; }
.nav-brand .mark { width: 22px; height: 22px; border-radius: 11px 11px 11px 3px; background: var(--pink); margin-top: -3px; flex: none; }
.nav-brand .sub, .brand .sub { color: var(--pink); font-weight: 700; }
.brand-name { white-space: nowrap; }
.brand-icon { width: 28px; height: 28px; object-fit: contain; flex: none; margin-top: -4px; }
.nav-links, .nav-bottom { display: flex; flex-direction: column; gap: 2px; }
.nav-link { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 8px; color: #c3c8ea; text-decoration: none; font-weight: 700; transition: background .15s, color .15s; }
.nav-link:hover { background: rgba(255,255,255,.07); color: #fff; }
.nav-link.on { background: rgba(255,255,255,.12); color: #fff; box-shadow: inset 3px 0 0 var(--pink); }
.nav-link svg { flex: none; }
.nav-bottom { margin-top: auto; padding-top: 12px; border-top: 1px solid rgba(255,255,255,.1); }

.nav-create { background: #fff; color: var(--navy); border-radius: 14px; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.nav-create h2 { font-size: 16px; padding-top: 2px; }
.nav-create .field { min-width: 0; }
.seg.full { display: flex; }
.seg.full button { flex: 1; white-space: nowrap; padding: 6px 6px; }
.btn.full { width: 100%; height: 40px; }
.nav-create .form-error { margin-top: 0; font-size: 14px; }
.drop.tall { height: auto; min-height: 132px; flex-direction: column; justify-content: center; gap: 5px; text-align: center; white-space: normal; padding: 14px; border-width: 2px; border-radius: 12px; background: #fafbfe; font-size: 14px; font-weight: 400; transition: border-color .15s, background .15s; }
.drop.tall:hover { border-color: var(--blue); background: #f4f9ff; }
.drop.tall.over { border-color: var(--pink); background: #fff5fb; }
.drop.tall .drop-icon { display: block; color: var(--vivid); }
.drop.tall .drop-main { font-weight: 700; color: var(--navy); overflow-wrap: anywhere; }
.drop.tall .drop-main u { color: var(--vivid); text-underline-offset: 2px; }
.drop.tall .drop-sub { display: block; font-size: 14px; color: var(--muted); }
.drop.tall.has-file { border-style: solid; border-color: var(--vivid); background: #f4f8ff; }

.app-main { padding: 34px 40px 80px; min-width: 0; max-width: 1240px; width: 100%; }
.page-head { margin-bottom: 26px; }
.page-head h1 { font-size: 32px; letter-spacing: -.3px; }
.page-head p { color: var(--muted); margin: 6px 0 0; font-size: 15px; }
.page-head.with-action { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.folders-heading { margin-top: 32px; }
.title-crumbs { display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: 2px 4px; }
.page-head h1 .crumb { background: none; border: 0; padding: 2px 4px; margin: 0 -4px; border-radius: 6px; font: inherit; color: var(--muted); cursor: pointer; }
.page-head h1 .crumb:hover { color: var(--vivid); background: #fff; }
.page-head h1 .crumb.drop-target { outline-offset: 2px; }
.page-head h1 .crumb-sep { color: #b6bdd0; font-weight: 400; margin: 0 4px; }
.page-head h1 .crumb-current { color: var(--navy); }
.page-head h1 .crumb-kind { color: var(--muted); font-weight: 600; }
.empty.compact { padding: 18px 20px; text-align: left; }
.app-main .review-list:empty { display: none; }

.panel { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 24px; }
.placeholder { text-align: center; padding: 56px 24px; }
.placeholder-icon { width: 56px; height: 56px; border-radius: 16px; background: #f1ecf8; color: var(--violet); display: grid; place-items: center; margin: 0 auto 14px; }
.placeholder h2 { font-size: 20px; }
.placeholder p { color: var(--muted); max-width: 52ch; margin: 8px auto 0; }
.form-panel { max-width: 520px; display: flex; flex-direction: column; gap: 16px; }
.field-hint { font-size: 14px; color: var(--muted); }
.req { font-weight: 400; }
.field input[type=text].invalid, .field input[type=text].invalid:focus { border-color: #c4006f; box-shadow: 0 0 0 3px rgba(196,0,111,.12); }
#newFolderField { margin-top: -4px; padding: 12px; border-radius: 10px; background: #f6f7fb; border: 1px solid var(--line); }
.field input:disabled { background: #f4f5f9; color: var(--muted); cursor: not-allowed; }

/* ---------- Analytics ---------- */
.range-picker { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.range-picker .seg button { padding: 6px 10px; }
.custom-range { display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 700; color: var(--muted); }
.custom-range input { height: 32px; border: 1px solid var(--line); border-radius: 6px; padding: 0 8px; margin-left: 4px; background: #fff; }
.stat-grid { display: grid; gap: 16px; margin-bottom: 32px; }
.stat-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stat { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 20px; display: flex; flex-direction: column; gap: 6px; }
.stat-label { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 700; color: var(--muted); }
.stat-value { font-family: var(--head); font-size: 36px; font-weight: 700; line-height: 1.05; padding-top: 4px; }
.stat-sub { font-size: 14px; color: var(--muted); }
.stat-foot { margin-top: auto; padding-top: 10px; border-top: 1px solid #eef0f6; font-size: 14px; color: var(--muted); }
.stat.stage .dot { width: 10px; height: 10px; border-radius: 5px 5px 5px 1px; }
.stat.stage.open .dot, .stat.stage.open .meter i { background: var(--pink); }
.stat.stage.review .dot, .stat.stage.review .meter i { background: var(--violet); }
.stat.stage.resolved .dot, .stat.stage.resolved .meter i { background: var(--lime); }
.meter { height: 6px; border-radius: 3px; background: #eef1f8; overflow: hidden; margin-top: 4px; }
.meter i { display: block; height: 100%; border-radius: 3px; }
.section-title { font-size: 18px; }
.section-note { color: var(--muted); margin: 4px 0 14px; font-size: 14px; }
.chart-panel { padding: 22px 24px 18px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.panel-head h2 { font-size: 18px; }
.panel-head h2 span { font-family: var(--body); font-size: 14px; font-weight: 400; color: var(--muted); margin-left: 6px; }
.legend { display: flex; gap: 16px; font-size: 14px; color: var(--muted); font-weight: 700; }
.legend span { display: flex; align-items: center; gap: 6px; }
.sw { width: 10px; height: 10px; border-radius: 3px; }
.sw.reviews, .bar.reviews { background: var(--violet); }
.sw.comments, .bar.comments { background: var(--blue); }
.chart-scroll { overflow-x: auto; }
.chart { display: grid; grid-template-columns: repeat(var(--cols), minmax(14px, 1fr)); gap: 4px; height: 244px; min-width: calc(var(--cols) * 18px); }
.chart .col { display: flex; flex-direction: column; min-width: 0; }
.chart .bars { flex: 1; display: flex; align-items: flex-end; justify-content: center; gap: 2px; padding: 0 1px; border-radius: 4px 4px 0 0; border-bottom: 1px solid var(--line); }
.chart .col:hover .bars { background: #f4f6fb; }
.bar { width: 50%; max-width: 14px; min-height: 0; border-radius: 3px 3px 0 0; }
.chart .tick { height: 24px; line-height: 24px; overflow: visible; white-space: nowrap; font-size: 14px; color: var(--muted); }
.chart-max { margin-top: 8px; font-size: 14px; color: var(--muted); }

/* Scheduled cleanup */
.panel.cleanup { margin-top: 0; }
.cleanup-head { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.cleanup-head .stat-value { font-size: 44px; padding-top: 6px; }
.cleanup-what { font-weight: 700; font-size: 16px; }
.cleanup-when { color: var(--muted); }
.cleanup-flag { margin-left: auto; font-size: 14px; font-weight: 700; color: #7a4b00; background: #fff1cc; padding: 6px 12px; border-radius: 20px; }
.cleanup-table { width: 100%; border-collapse: collapse; margin-top: 18px; }
.cleanup-table th { text-align: left; font-size: 14px; color: var(--muted); font-weight: 700; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.cleanup-table td { padding: 10px; border-bottom: 1px solid #eef0f6; }
.cleanup-table a { font-weight: 700; color: var(--navy); text-decoration: none; }
.cleanup-table a:hover { color: var(--vivid); }
.cleanup-table .muted { color: var(--muted); }
.cleanup-note { color: var(--muted); margin: 14px 0 0; }
.panel.cleanup .btn { margin-top: 10px; }
.section-title { margin-top: 8px; }

@media (max-width: 1000px) {
  .stat-grid.three { grid-template-columns: 1fr; }
  .range-picker { align-items: flex-start; }
}
@media (max-width: 900px) {
  body.app { padding-left: 0; }
  .app-nav { position: static; width: auto; height: auto; overflow: visible; }
  .nav-links { flex-direction: row; flex-wrap: wrap; }
  .nav-bottom { margin-top: 0; padding-top: 0; border-top: 0; }
  .app-main { padding: 24px 16px 60px; }
  .page-head h1 { font-size: 26px; }
}

/* ---------- Review screen: floating comment tray ---------- */
.workspace { position: relative; }
.workspace .sidebar { position: absolute; top: 12px; right: 12px; bottom: 12px; width: 380px; z-index: 30; border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 16px 48px rgba(15,18,47,.2), 0 2px 6px rgba(15,18,47,.08); overflow: hidden; }
.workspace.tray-closed .sidebar { display: none; }
.tray-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 10px 4px 16px; }
.tray-head h2 { font-size: 17px; padding-top: 3px; }
.tray-collapse { width: 34px; height: 34px; border: 0; background: none; border-radius: 8px; color: var(--muted); display: grid; place-items: center; }
.tray-collapse:hover { background: #f0f2f8; color: var(--navy); }
.tray-count { min-width: 24px; height: 24px; padding: 0 7px; border-radius: 12px 12px 12px 3px; background: var(--pink); display: inline-grid; place-items: center; font-size: 14px; }
.tray-count[hidden] { display: none; }

/* ---------- Review screen: one page at a time ---------- */
.stage.docs { overflow: hidden; }
.workspace:not(.tray-closed) .stage.docs { padding-right: 404px; }
.doc-view { height: 100%; display: grid; grid-template-columns: minmax(0, 1fr); }
.doc-view.with-rail { grid-template-columns: 156px minmax(0, 1fr); }
.page-rail { overflow-y: auto; padding: 16px 10px 16px 16px; display: flex; flex-direction: column; gap: 14px; border-right: 1px solid var(--line); background: #eef0f6; }
.rail-item { display: flex; flex-direction: column; align-items: center; gap: 6px; border: 0; background: none; padding: 0; color: var(--muted); font-weight: 700; }
.rail-thumb { position: relative; display: block; width: 100%; border-radius: 6px; overflow: hidden; background: #fff; box-shadow: 0 0 0 1px var(--line), 0 2px 6px rgba(15,18,47,.06); transition: box-shadow .15s; }
.rail-thumb img { display: block; width: 100%; height: auto; max-height: 150px; object-fit: cover; object-position: top; }
.rail-item:hover .rail-thumb { box-shadow: 0 0 0 2px #b9c3dc; }
.rail-item.on .rail-thumb { box-shadow: 0 0 0 3px var(--vivid); }
.rail-item.on { color: var(--vivid); }
.rail-badge { position: absolute; top: 4px; right: 4px; min-width: 24px; height: 24px; padding: 0 6px; border-radius: 12px 12px 12px 3px; background: var(--pink); color: #fff; font-size: 14px; display: grid; place-items: center; }
.doc-main { position: relative; display: flex; flex-direction: column; min-width: 0; min-height: 0; height: 100%; }
.doc-main .page-bar { padding: 12px 20px; border-bottom: 1px solid var(--line); background: #f7f8fc; flex-wrap: wrap; row-gap: 8px; }
.page-name .of { color: var(--muted); font-weight: 600; }
.fit-seg button { padding: 5px 10px; }
.sheet-wrap { flex: 1; min-height: 0; overflow: auto; display: flex; justify-content: center; align-items: flex-start; padding: 24px 24px 96px; }
.sheet-wrap .sheet { flex: none; width: auto; }
.sheet-wrap .sheet img { width: 100%; height: 100%; object-fit: fill; }
.pager { position: absolute; left: 50%; bottom: 20px; transform: translateX(-50%); display: flex; align-items: center; gap: 4px; padding: 6px; border-radius: 28px; background: var(--navy); color: #fff; box-shadow: 0 10px 30px rgba(15,18,47,.3); z-index: 5; }
.pager button { width: 40px; height: 40px; border-radius: 20px; border: 0; background: none; color: #fff; display: grid; place-items: center; }
.pager button:hover:not(:disabled) { background: rgba(255,255,255,.14); }
.pager button:disabled { opacity: .35; cursor: default; }
.pager-num { display: flex; align-items: center; gap: 8px; padding: 0 6px; font-weight: 700; white-space: nowrap; }
.pager-num input { width: 48px; height: 32px; text-align: center; border-radius: 8px; border: 0; background: rgba(255,255,255,.14); color: #fff; font-weight: 700; }
.pager-num input:focus { outline: 2px solid var(--blue); }

@media (max-width: 900px) {
  .workspace .sidebar { position: relative; inset: auto; width: auto; height: 46%; border-radius: 0; box-shadow: none; border: 0; border-top: 1px solid var(--line); }
  .workspace:not(.tray-closed) .stage.docs { padding-right: 0; }
  .doc-view.with-rail { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
  .page-rail { flex-direction: row; overflow-x: auto; overflow-y: hidden; border-right: 0; border-bottom: 1px solid var(--line); padding: 10px 12px; }
  .rail-item { flex: 0 0 116px; }
  .rail-thumb img { max-height: 90px; }
}

/* ---------- Review header: page tools (files) and comments toggle ---------- */
.page-tools { display: flex; align-items: center; gap: 10px; flex: none; margin-left: 8px; }
.page-tools .pt-name { font-weight: 700; color: #fff; white-space: nowrap; }
.page-tools .pt-name .of { color: #9aa3d6; font-weight: 600; }
.page-tools .version-sel { background: rgba(255,255,255,.1); color: #fff; border: 1px solid rgba(255,255,255,.18); max-width: 180px; height: 34px; border-radius: 8px; padding: 0 8px; }
#deviceSeg button, #shareBtn { display: inline-flex; align-items: center; gap: 6px; }
@media (max-width: 1520px) {
  #deviceSeg .lbl, #shareBtn .lbl { display: none; }
  #deviceSeg button { padding: 6px 9px; }
  .page-tools .version-one { display: none; }
}
@media (max-width: 1366px) {
  #trayToggle .lbl { display: none; }
}
.page-tools .version-sel option { color: var(--navy); }
.page-tools .version-one { color: #9aa3d6; white-space: nowrap; }
.page-tools .old-flag { white-space: nowrap; }
.page-tools .fit-seg button { padding: 6px 8px; display: grid; place-items: center; }
.btn.replace-btn { background: var(--blue); border-color: var(--blue); color: #fff; height: 34px; }
.btn.replace-btn:hover { background: #0078d6; border-color: #0078d6; }
.icon-btn { width: 34px; height: 34px; border: 0; border-radius: 8px; background: rgba(255,255,255,.08); color: #c3c8ea; display: grid; place-items: center; flex: none; }
.icon-btn.danger:hover { background: #c4006f; color: #fff; }
.tray-toggle { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 12px; border: 0; border-radius: 8px; background: rgba(255,255,255,.1); color: #fff; font-weight: 700; white-space: nowrap; }
.tray-toggle:hover { background: rgba(255,255,255,.18); }
.tray-toggle.on { background: #fff; color: var(--navy); }
.tray-toggle .tray-count { color: #fff; }
.sheet-wrap { padding-top: 28px; }

/* ---------- Comment dialog ---------- */
.popover { position: fixed; z-index: 60; width: 340px; max-width: calc(100vw - 24px); max-height: calc(100vh - 80px); display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 18px 50px rgba(15,18,47,.28), 0 2px 6px rgba(15,18,47,.08); }
.popover[hidden] { display: none; }
.pop-head { display: flex; align-items: center; gap: 8px; padding: 12px 8px 8px 14px; }
.pop-head b { color: var(--navy); }
.pop-where, .pop-time { color: var(--muted); }
.pop-x { margin-left: auto; width: 32px; height: 32px; border: 0; border-radius: 8px; background: none; color: var(--muted); display: grid; place-items: center; }
.pop-x:hover { background: #f0f2f8; color: var(--navy); }
.pop-body { padding: 0 14px 4px; overflow-y: auto; min-height: 0; }
.pop-body .body { overflow-wrap: anywhere; }
.pop-body .page-note { margin: 0 0 6px; }
.pop-body .comment { border-top: 1px solid #eef0f6; margin-top: 10px; padding-top: 10px; }
.pop-pad { padding: 10px 14px 14px; }
.pop-pad .status-seg { margin-bottom: 4px; }
.pop-pad textarea { margin-top: 10px; }
@media (max-width: 600px) {
  .popover { left: 12px !important; right: 12px; top: auto !important; bottom: 12px; width: auto; }
}

/* Thumbnail strip with per-page actions */
.rail-go { display: flex; flex-direction: column; align-items: center; gap: 6px; width: 100%; border: 0; background: none; padding: 0; color: inherit; font: inherit; cursor: pointer; }
.rail-num:empty { display: none; }
.rail-actions { display: flex; gap: 4px; width: 100%; margin-top: 6px; }
.rail-btn { height: 30px; border: 1px solid var(--line); border-radius: 7px; background: #fff; display: inline-flex; align-items: center; justify-content: center; gap: 5px; font-weight: 700; color: var(--navy); padding: 0 6px; }
.rail-btn.replace { flex: 1; background: var(--blue); border-color: var(--blue); color: #fff; }
.rail-btn.replace:hover { background: #0078d6; border-color: #0078d6; }
.rail-btn.replace:disabled { opacity: .7; }
.rail-btn.delete { width: 32px; flex: none; color: #c4006f; padding: 0; }
.rail-btn.delete:hover { background: #c4006f; border-color: #c4006f; color: #fff; }

/* Header: page arrows, labeled fit buttons, two comment counts */
.pt-nav { display: flex; align-items: center; gap: 6px; }
.icon-btn:disabled { opacity: .35; cursor: default; }
.icon-btn:not(.danger):hover:not(:disabled) { background: rgba(255,255,255,.18); color: #fff; }
.page-tools .fit-seg button { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; }
.tray-count.ready { background: var(--violet); margin-left: -4px; }

/* Modal + toast */
.modal-backdrop { position: fixed; inset: 0; background: rgba(15,18,47,.5); display: flex; align-items: center; justify-content: center; z-index: 100; padding: 16px; }
.modal { background: #fff; border-radius: 14px; padding: 24px; width: min(380px, 100%); box-shadow: 0 20px 60px rgba(15,18,47,.3); }
.modal h2 { font-size: 20px; }
.modal p { color: var(--muted); margin: 6px 0 14px; }
.modal input { width: 100%; height: 40px; border: 1px solid var(--line); border-radius: 8px; padding: 0 12px; }
.modal input:focus { border-color: var(--blue); outline: none; box-shadow: 0 0 0 3px rgba(0,143,255,.15); }
.modal .row-end { margin-top: 16px; justify-content: flex-end; }
.toast { position: fixed; bottom: 24px; left: 50%; transform: translate(-50%, 20px); background: var(--navy); color: #fff; padding: 10px 16px; border-radius: 10px; font-weight: 700; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 200; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
body.review .toast { bottom: 92px; }

@media (max-width: 900px) {
  .urlbar, .divider, .asset-title, .topnote { display: none; }
  .workspace { flex-direction: column; }
  .sidebar { width: auto; height: 42%; border-left: 0; border-top: 1px solid var(--line); }
  .review-row { grid-template-columns: 22px 44px minmax(0,1fr) auto; }
  .toolbar { flex-wrap: wrap; }
  .search { order: 3; flex-basis: 100%; }
  .review-row .when, .review-row .counts { display: none; }
  .doc-col { padding: 16px; }
  .page-bar { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* ---------- Layout refinements ---------- */
/* Dashboard: headline with search and New folder on the same row */
.dash-head { align-items: center; margin-bottom: 22px; }
.dash-head h1 { flex: 1 1 auto; min-width: 0; }
.head-tools { display: flex; align-items: center; gap: 12px; flex: none; }
.head-tools > .btn { height: 38px; }
/* 3. Section labels use the body font, bold, at their existing sizes */
.toolbar .crumbs { font-family: var(--body); }
.toolbar .crumbs .crumb-current { padding: 0; border: 0; }
.toolbar { min-height: 0; margin-bottom: 12px; }
.list-heading { font-family: var(--body); font-weight: 700; }
/* 4. Full width pages (Profile keeps its narrower form column) */
.app-main { max-width: none; }
body[data-page="profile"] .app-main { max-width: 1240px; }
/* 5. Breathing room above Scheduled cleanup */
.chart-panel { margin-bottom: 40px; }
@media (max-width: 760px) {
  .dash-head { align-items: flex-start; }
  .head-tools { width: 100%; }
  .head-tools .search { flex: 1; width: auto; order: 0; flex-basis: auto; }
}

/* ---------- Sign in ---------- */
body.login-page { min-height: 100vh; height: auto; display: grid; place-items: center; padding: 24px; background: var(--navy); }
.login-card { width: min(420px, 100%); background: #fff; border-radius: 18px; padding: 32px; box-shadow: 0 24px 60px rgba(0,0,0,.35); }
.login-brand { display: flex; align-items: center; gap: 10px; font-family: var(--head); font-weight: 700; font-size: 24px; color: var(--navy); }
.login-brand .brand-icon { width: 36px; height: 36px; }
.login-brand .sub { color: var(--pink); }
.login-card h1 { font-size: 26px; margin: 22px 0 6px; }
.login-lead { color: var(--muted); margin: 0 0 20px; }
.login-error { background: #fff0f7; border: 1px solid #ffc2e1; color: #9b0058; border-radius: 10px; padding: 12px 14px; margin-bottom: 16px; font-weight: 700; }
.google-btn { display: flex; align-items: center; justify-content: center; gap: 12px; height: 46px; border: 1px solid #dadce0; border-radius: 10px; background: #fff; color: #1f1f1f; font-weight: 700; text-decoration: none; transition: background .15s, box-shadow .15s; }
.google-btn:hover { background: #f8f9fb; box-shadow: 0 1px 3px rgba(15,18,47,.15); }
.google-btn.disabled { opacity: .5; pointer-events: none; }
.dev-login { margin-top: 18px; padding: 14px; border: 1px dashed #e0b400; border-radius: 10px; background: #fffbea; display: flex; flex-direction: column; gap: 8px; }
.dev-flag { font-weight: 700; color: #7a4b00; }
.dev-login label { font-weight: 700; color: var(--muted); }
.dev-login input { height: 40px; border: 1px solid var(--line); border-radius: 8px; padding: 0 12px; }
.login-foot { color: var(--muted); margin: 20px 0 0; }

/* ---------- Avatars, users, profile ---------- */
.avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; flex: none; background: #eef1f8; }
.avatar.initials { display: inline-grid; place-items: center; background: var(--violet); color: #fff; font-weight: 700; }
.avatar.large { width: 56px; height: 56px; font-size: 22px; }
.nav-avatar { width: 20px; height: 20px; border-radius: 50%; object-fit: cover; flex: none; margin: -1px; }
.invite-panel { margin-bottom: 20px; }
.invite-form { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.invite-form .field select { height: 40px; }
.invite-form .btn { height: 40px; }
.invite-panel .field-hint { display: block; margin: 10px 0 0; }
.users-panel { padding: 0; overflow-x: auto; }
.users-table { width: 100%; border-collapse: collapse; }
.users-table th { text-align: left; color: var(--muted); font-weight: 700; padding: 14px 18px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.users-table td { padding: 14px 18px; border-bottom: 1px solid #eef0f6; vertical-align: middle; }
.users-table tr:last-child td { border-bottom: 0; }
.users-table .sub { color: var(--muted); }
.users-table .you { color: var(--muted); font-weight: 400; }
.users-table .actions { text-align: right; white-space: nowrap; }
.user-cell { display: flex; align-items: center; gap: 12px; }
.role-sel { height: 34px; border: 1px solid var(--line); border-radius: 8px; padding: 0 8px; background: #fff; }
.role-tag, .status-tag { display: inline-block; font-weight: 700; padding: 3px 10px; border-radius: 12px; }
.role-tag.admin { background: #f1ecf8; color: var(--violet); }
.role-tag.member { background: #eef1f8; color: var(--muted); }
.status-tag.active { background: #e6fbe6; color: #0a7a0a; }
.status-tag.invited { background: #fff1cc; color: #7a4b00; }
.copy-row { display: flex; gap: 8px; margin: 6px 0 4px; }
.copy-row input { flex: 1; min-width: 0; height: 40px; border: 1px solid var(--line); border-radius: 8px; padding: 0 10px; background: #f6f7fb; }
.profile-who { display: flex; align-items: center; gap: 14px; }
.profile-who .sub { color: var(--muted); }
.title-plain { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #e5e8fb; font-weight: 700; }
body.guest .brand { cursor: default; }

/* ---------- Automatic cleanup ---------- */
.cleanup-title { margin-top: 8px; }
.cleanup-stats { margin-bottom: 20px; }
.panel.cleanup { margin-bottom: 20px; }
.panel.cleanup h3 { font-family: var(--body); font-size: 16px; margin: 0; }
.cleanup-table .actions { text-align: right; white-space: nowrap; }
.cleanup-flag.off { display: inline-block; margin: 0 0 16px; font-weight: 700; color: #7a4b00; background: #fff1cc; padding: 6px 12px; border-radius: 20px; }
.kept-tag { display: inline-flex; align-items: center; gap: 5px; font-size: 14px; font-weight: 700; color: #0a7a0a; margin-left: 8px; }
.archived-banner { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); z-index: 40; max-width: min(640px, calc(100% - 24px)); display: flex; align-items: center; gap: 12px; padding: 10px 12px 10px 16px; background: #fff1cc; color: #5c3900; border: 1px solid #f0d27a; border-radius: 10px; font-weight: 700; box-shadow: 0 6px 20px rgba(15,18,47,.15); }
.archived-banner .btn { flex: none; }

/* ---------- Delete folder and contents dialog ---------- */
.danger-modal { width: min(560px, 100%); }
.danger-modal h2 { color: #9b0058; }
.del-list { max-height: 280px; overflow-y: auto; border: 1px solid var(--line); border-radius: 10px; margin: 4px 0 16px; }
.del-item { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; padding: 10px 12px; border-top: 1px solid #eef0f6; }
.del-item:first-child { border-top: 0; }
.del-type { flex: none; min-width: 64px; font-weight: 700; color: var(--muted); }
.del-name { font-weight: 700; color: var(--navy); }
.del-where, .del-count { color: var(--muted); }
.del-count { margin-left: auto; }
.btn.danger-solid { background: #c4006f; border-color: #c4006f; color: #fff; }
.btn.danger-solid:hover { background: #a3005c; border-color: #a3005c; }

/* Folder menu: two delete options in two blues */
.menu button.del-light { color: var(--blue); }
.menu button.del-light:hover, .menu button.del-light:focus-visible { background: #e8f4ff; }
.menu button.del-dark { color: var(--vivid); }
.menu button.del-dark:hover, .menu button.del-dark:focus-visible { background: #e7ecfd; }
/* Proof rows: thumbnail and sub line open the proof too */
.thumb-link { display: block; border-radius: 10px; transition: transform .15s, box-shadow .15s; }
.thumb-link:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(15,18,47,.15); }
.review-main a.sub-link { display: block; font-size: 14px; font-weight: 400; color: var(--muted); }
.review-main a.sub-link:hover { color: var(--vivid); text-decoration: underline; }
.search input { padding-right: 12px; }

/* ---------- Proof-It wordmark: white letters, the o's are pins (pink, then purple) ---------- */
.wordmark { display: inline-flex; align-items: baseline; white-space: nowrap; color: #fff; font-family: var(--head); font-weight: 700; letter-spacing: .2px; }
.wordmark.on-light { color: var(--navy); }
.o-pin {
  display: inline-block; width: .5em; height: .5em; margin: 0 .03em;  /* Josefin Sans x-height is .46em; round letters sit a touch taller */
  border-radius: 50% 50% 50% 14%;       /* same shape as comment pins: point at bottom left */
  transform: translateY(.02em);
  /* transparent center so it still reads as an "o" on any background */
  -webkit-mask: radial-gradient(circle at 52% 48%, transparent .1em, #000 .105em);
          mask: radial-gradient(circle at 52% 48%, transparent .1em, #000 .105em);
}
.o-pin.pink { background: var(--pink); }
.o-pin.purple { background: var(--violet); }
.nav-brand { font-size: 24px; gap: 12px; }
.nav-brand .brand-icon { width: 34px; height: 34px; }
.topbar .brand { font-size: 21px; gap: 10px; }
.topbar .brand .brand-icon { width: 30px; height: 30px; }
.login-brand { font-size: 26px; }

/* Analytics: team member filter */
.range-picker { flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 10px 14px; }
.user-filter { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--muted); }
.user-filter select { height: 36px; border: 1px solid var(--line); border-radius: 8px; padding: 0 10px; background: #fff; color: var(--navy); font-weight: 700; min-width: 160px; }
.custom-range { flex-basis: 100%; justify-content: flex-end; }
.attrib-note { display: flex; align-items: center; gap: 8px; margin: 0 0 18px; padding: 10px 14px; border-radius: 10px; background: #eef4ff; color: #22306b; }

/* Comment author photos */
.c-avatar { width: 22px; height: 22px; border-radius: 50%; object-fit: cover; flex: none; }
.c-avatar.initial { display: inline-grid; place-items: center; background: #e3e7f2; color: var(--navy); font-size: 14px; font-weight: 700; line-height: 1; }

/* ---------- Settings ---------- */
.settings-panel { margin-bottom: 20px; max-width: 900px; }
.settings-panel p { margin: 0 0 14px; line-height: 1.55; }
.settings-panel .panel-head { margin-bottom: 12px; }
.chip { display: inline-block; padding: 4px 12px; border-radius: 20px; font-weight: 700; background: #eef1f8; color: var(--muted); }
.chip.ok { background: #e6fbe6; color: #0a7a0a; }
.chip.warn { background: #fff1cc; color: #7a4b00; }
.chip.bad { background: #ffe3ef; color: #9b0058; }
.settings-msg { max-width: 900px; margin: 0 0 16px; padding: 12px 16px; border-radius: 10px; font-weight: 700; }
.settings-msg.ok { background: #e6fbe6; color: #0a5a0a; }
.settings-msg.bad { background: #ffe3ef; color: #9b0058; }
.steps { margin: 0 0 18px; padding-left: 22px; line-height: 1.6; }
.drive-pick { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.drive-pick select { height: 40px; min-width: 260px; border: 1px solid var(--line); border-radius: 8px; padding: 0 10px; background: #fff; }
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 10px 16px; margin: 0 0 16px; }
.kv dt { font-weight: 700; color: var(--muted); }
.kv dd { margin: 0; }
.kv .ext { margin-left: 8px; font-weight: 700; }
.err { color: #9b0058; }
.muted { color: var(--muted); }
.meter.big { height: 10px; margin: 6px 0 10px; }
.meter.big i { background: var(--blue); }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 14px; background: #eef1f8; padding: 1px 6px; border-radius: 5px; }
a.btn { text-decoration: none; }

.role-tag.super-admin { background: var(--navy); color: #fff; }
.settings-cleanup { max-width: 900px; margin-bottom: 28px; }
.settings-cleanup .section-title { margin-top: 0; }
