/* ============================================================
   VERPA SUPPORT DESK — style.css
   ============================================================ */

* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --bg:#f6f7f9; --surface:#fff; --surface-2:#f8fafc; --ink:#111826; --muted:#5b6677; --faint:#98a2b3;
  --line:#e7ebf0; --line-2:#eef1f5;
  --primary:#0d8b80; --primary-dark:#0a6f66; --primary-soft:#e3f4f1; --nav-active:#111826;
  --sales:#0d8b80; --sales-bg:#e3f4f1; --tech:#4f46e5; --tech-bg:#ecebfb; --sub:#7c3aed; --sub-bg:#f1ebfd;
  --st-open:#2563eb; --st-open-bg:#e8effe; --st-prog:#c2750a; --st-prog-bg:#fcf2e0;
  --st-done:#15924f; --st-done-bg:#e4f5ea; --st-closed:#6b7686; --st-closed-bg:#eef1f5;
  --p-high:#d23b3b; --p-high-bg:#fbe8e8; --p-mid:#c2750a; --p-mid-bg:#fcf2e0; --p-low:#5b6677; --p-low-bg:#eef1f5;
  --danger:#dc2626; --arch:#7a6a52; --arch-bg:#f2ede4;
  --shadow:0 1px 2px rgba(17,24,38,.04),0 1px 3px rgba(17,24,38,.06); --shadow-lg:0 10px 30px rgba(17,24,38,.10);
  --font:"Inter",-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;
}
body { background:var(--bg); color:var(--ink); font-family:var(--font); font-size:14px; line-height:1.5; -webkit-font-smoothing:antialiased; }

/* ---- AUTH ---- */
.auth-wrap { min-height:100vh; display:grid; place-items:center; padding:24px; background:radial-gradient(1200px 600px at 50% -10%,#e9f3f1,var(--bg)); }
.auth-card { width:420px; max-width:100%; background:var(--surface); border:1px solid var(--line); border-radius:18px; box-shadow:var(--shadow-lg); padding:32px 30px 28px; text-align:center; }
.auth-logo { width:68px; height:68px; margin:0 auto 16px; border-radius:14px; overflow:hidden; background:transparent; display:grid; place-items:center; }
.auth-logo img { width:100%; height:100%; object-fit:cover; border-radius:14px; }
.auth-logo-fallback { width:68px; height:68px; margin:0 auto 16px; border-radius:14px; background:linear-gradient(135deg,var(--primary),var(--primary-dark)); display:grid; place-items:center; color:#fff; font-weight:800; font-size:26px; box-shadow:0 4px 14px rgba(13,139,128,.32); }
.auth-card h1 { font-size:19px; font-weight:750; letter-spacing:-.3px; }
.auth-card p { font-size:13px; color:var(--muted); margin:5px 0 22px; }
.ms-btn { width:100%; display:flex; align-items:center; justify-content:center; gap:10px; padding:12px; border:1px solid var(--line); border-radius:10px; background:var(--surface); font-family:var(--font); font-size:14px; font-weight:600; cursor:pointer; transition:.14s; }
.ms-btn:hover { background:var(--surface-2); box-shadow:var(--shadow); }
.cfg-err { text-align:left; background:#fbe8e8; color:#b42318; border:1px solid #f4cdcd; border-radius:10px; padding:12px 14px; font-size:12.5px; line-height:1.5; margin-bottom:16px; }
.cfg-err code { background:#fff; padding:1px 5px; border-radius:4px; }
.spinner { width:26px; height:26px; border:3px solid var(--line); border-top-color:var(--primary); border-radius:50%; animation:sp 1s linear infinite; margin:8px auto; }
@keyframes sp { to { transform:rotate(360deg); } }

/* ---- SHELL / SIDEBAR ---- */
.shell { display:flex; min-height:100vh; }
.sidebar { width:250px; flex:none; background:var(--surface); border-right:1px solid var(--line); display:flex; flex-direction:column; position:sticky; top:0; height:100vh; overflow-y:auto; }
.sb-brand { padding:22px 22px 14px; }
.sb-brand .row { display:flex; align-items:center; gap:11px; }
.sb-logo { width:38px; height:38px; border-radius:10px; overflow:hidden; display:grid; place-items:center; flex:none; }
.sb-logo img { width:100%; height:100%; object-fit:cover; border-radius:10px; }
.sb-logo-fallback { width:38px; height:38px; border-radius:10px; background:linear-gradient(135deg,var(--primary),var(--primary-dark)); display:grid; place-items:center; color:#fff; font-weight:800; font-size:17px; box-shadow:0 4px 12px rgba(13,139,128,.3); }
.sb-brand h1 { font-size:16px; font-weight:750; letter-spacing:-.3px; }
.sb-brand p { font-size:12px; color:var(--faint); margin-top:1px; }
.sb-nav { padding:6px 12px; display:flex; flex-direction:column; gap:2px; }
.nav-item { display:flex; align-items:center; gap:11px; padding:9px 12px; border-radius:9px; font-size:13.5px; font-weight:550; color:var(--muted); cursor:pointer; transition:.13s; }
.nav-item:hover { background:var(--surface-2); color:var(--ink); }
.nav-item.active { background:var(--nav-active); color:#fff; font-weight:600; }
.nav-item.active svg { color:#fff; }
.nav-item svg { color:var(--faint); flex:none; }
.sb-section { padding:14px 22px 7px; font-size:11px; font-weight:700; letter-spacing:.6px; color:var(--faint); text-transform:uppercase; }
.sb-list { padding:0 12px; display:flex; flex-direction:column; gap:1px; }
.sb-link { display:flex; align-items:center; gap:10px; padding:7px 12px; border-radius:8px; font-size:13px; color:var(--muted); cursor:pointer; transition:.13s; }
.sb-link:hover { background:var(--surface-2); color:var(--ink); }
.sb-link .lbl { flex:1; }
.sb-link .cnt { font-size:12.5px; font-weight:650; color:var(--faint); font-variant-numeric:tabular-nums; }
.dot { width:9px; height:9px; border-radius:50%; flex:none; }
.sb-foot { margin-top:auto; padding:14px; border-top:1px solid var(--line); }
.userchip { display:flex; align-items:center; gap:10px; padding:8px 10px; border-radius:10px; }
.userchip .av { width:32px; height:32px; border-radius:50%; background:var(--primary-soft); color:var(--primary-dark); display:grid; place-items:center; font-size:12px; font-weight:700; flex:none; }
.userchip .nm { font-size:13px; font-weight:650; line-height:1.2; }
.userchip .rl { font-size:11px; color:var(--faint); }
.rolepill { font-size:10px; font-weight:700; padding:1px 7px; border-radius:5px; background:var(--tech-bg); color:var(--tech); }
.logout { width:100%; margin-top:6px; display:flex; align-items:center; justify-content:center; gap:8px; padding:8px; border:1px solid var(--line); border-radius:9px; background:var(--surface); color:var(--muted); font-family:var(--font); font-size:12.5px; font-weight:600; cursor:pointer; }
.logout:hover { background:var(--surface-2); color:var(--ink); }

/* ---- MAIN ---- */
.main { flex:1; min-width:0; }
.main-inner { max-width:1180px; margin:0 auto; padding:30px 34px 70px; }
.page-head { display:flex; align-items:flex-start; justify-content:space-between; gap:18px; margin-bottom:24px; flex-wrap:wrap; }
.page-head h2 { font-size:24px; font-weight:750; letter-spacing:-.6px; }
.page-head .sub { font-size:13.5px; color:var(--muted); margin-top:3px; }

/* ---- BUTTONS ---- */
.btn { font-family:var(--font); cursor:pointer; border:none; border-radius:9px; font-weight:600; font-size:13.5px; padding:10px 16px; transition:.14s; display:inline-flex; align-items:center; gap:7px; }
.btn-dark { background:var(--nav-active); color:#fff; box-shadow:var(--shadow); }
.btn-dark:hover { background:#000; transform:translateY(-1px); }
.btn-primary { background:var(--primary); color:#fff; box-shadow:0 2px 8px rgba(13,139,128,.28); }
.btn-primary:hover { background:var(--primary-dark); transform:translateY(-1px); }
.btn-primary:disabled { opacity:.6; cursor:default; transform:none; }
.btn-ghost { background:var(--surface); color:var(--ink); border:1px solid var(--line); }
.btn-ghost:hover { background:var(--surface-2); }
.btn-danger { background:var(--danger); color:#fff; }
.btn-danger:hover { background:#b91c1c; }
.btn-block { width:100%; justify-content:center; }
.btn-sm { padding:9px 13px; font-size:12.5px; }
.icon-btn { background:var(--surface-2); border:1px solid var(--line); width:32px; height:32px; border-radius:8px; cursor:pointer; display:grid; place-items:center; color:var(--muted); }
.icon-btn:hover { background:var(--bg); color:var(--ink); }

/* ---- STAT GRID ---- */
.stat-grid { display:grid; grid-template-columns:repeat(4,1fr); gap:14px; margin-bottom:30px; }
.stat { background:var(--surface); border:1px solid var(--line); border-radius:13px; padding:17px 18px; box-shadow:var(--shadow); display:flex; align-items:center; gap:14px; }
.stat .ic { width:40px; height:40px; border-radius:10px; display:grid; place-items:center; flex:none; }
.stat .n { font-size:27px; font-weight:760; letter-spacing:-1.2px; line-height:1; }
.stat .l { font-size:12.5px; color:var(--muted); margin-top:5px; }

/* ---- SECTION / CARD ---- */
.section-head { display:flex; align-items:center; justify-content:space-between; margin-bottom:14px; }
.section-head h3 { font-size:17px; font-weight:700; letter-spacing:-.3px; }
.link { color:var(--primary-dark); font-size:13px; font-weight:600; cursor:pointer; }
.link:hover { text-decoration:underline; }
.card-grid { display:grid; grid-template-columns:1fr 1fr; gap:14px; }
.tcard { background:var(--surface); border:1px solid var(--line); border-radius:13px; padding:17px 19px; box-shadow:var(--shadow); cursor:pointer; transition:.14s; }
.tcard:hover { border-color:#d4dbe3; transform:translateY(-1px); box-shadow:var(--shadow-lg); }
.tcard.arch { opacity:.82; }
.tcard .ch { display:flex; align-items:flex-start; justify-content:space-between; gap:10px; }
.tcard h4 { font-size:14.5px; font-weight:650; letter-spacing:-.2px; line-height:1.35; }
.tcard .desc { font-size:13px; color:var(--muted); margin:7px 0 12px; overflow:hidden; display:-webkit-box; -webkit-line-clamp:1; -webkit-box-orient:vertical; }
.tcard .desc.none { color:var(--faint); font-style:italic; }
.tags { display:flex; gap:7px; flex-wrap:wrap; }
.tag { font-size:11.5px; font-weight:600; padding:3px 10px; border-radius:7px; white-space:nowrap; }
.badge { font-size:11px; font-weight:650; padding:3px 10px; border-radius:20px; white-space:nowrap; }
.who { margin-top:12px; padding-top:11px; border-top:1px solid var(--line-2); display:flex; align-items:center; gap:14px; font-size:12px; color:var(--muted); flex-wrap:wrap; }
.who .it { display:inline-flex; align-items:center; gap:5px; }
.who .it b { font-weight:650; color:var(--ink); }
.who svg { color:var(--faint); flex:none; }
.who .ti { margin-left:auto; color:var(--faint); }

/* ---- TOOLBAR / FILTERS ---- */
.toolbar { display:flex; gap:10px; align-items:center; flex-wrap:wrap; margin-bottom:18px; }
.search { flex:1; min-width:190px; position:relative; }
.search input { width:100%; padding:10px 13px 10px 36px; border:1px solid var(--line); border-radius:9px; font-family:var(--font); font-size:13.5px; background:var(--surface); }
.search input:focus { outline:none; border-color:var(--primary); box-shadow:0 0 0 3px var(--primary-soft); }
.search svg { position:absolute; left:12px; top:50%; transform:translateY(-50%); color:var(--faint); }
select.filter { padding:9px 12px; border:1px solid var(--line); border-radius:9px; font-family:var(--font); font-size:13px; background:var(--surface); cursor:pointer; }
select.filter:focus { outline:none; border-color:var(--primary); }
.activefilter { display:inline-flex; align-items:center; gap:6px; font-size:12.5px; font-weight:600; color:var(--primary-dark); background:var(--primary-soft); border-radius:20px; padding:5px 11px; }
.activefilter svg { cursor:pointer; }
.empty { text-align:center; padding:60px 20px; color:var(--muted); background:var(--surface); border:1px solid var(--line); border-radius:13px; }
.empty svg { color:var(--faint); margin-bottom:13px; }
.empty h3 { font-size:16px; color:var(--ink); margin-bottom:5px; }
.back { display:inline-flex; align-items:center; gap:7px; font-size:13.5px; color:var(--muted); cursor:pointer; margin-bottom:18px; font-weight:550; }
.back:hover { color:var(--ink); }

/* ---- DETAIL ---- */
.detail-layout { display:grid; grid-template-columns:1fr 340px; gap:22px; align-items:start; }
.panel-card { background:var(--surface); border:1px solid var(--line); border-radius:14px; box-shadow:var(--shadow); }
.pc-pad { padding:20px 22px; }
.pc-head { padding:16px 22px; border-bottom:1px solid var(--line-2); font-size:15px; font-weight:700; }
.d-title { font-size:20px; font-weight:750; letter-spacing:-.5px; line-height:1.3; }
.d-titlerow { display:flex; align-items:flex-start; justify-content:space-between; gap:14px; }
.arch-banner { display:flex; align-items:center; gap:8px; background:var(--arch-bg); color:var(--arch); border:1px solid #e6ddcd; border-radius:10px; padding:9px 13px; font-size:12.5px; font-weight:600; margin-bottom:16px; }

/* ---- MESSAGES ---- */
.msg { display:flex; gap:12px; padding:16px 0; border-bottom:1px solid var(--line-2); }
.msg:last-of-type { border-bottom:none; }
.av { width:32px; height:32px; border-radius:50%; background:var(--primary-soft); color:var(--primary-dark); display:grid; place-items:center; font-size:12px; font-weight:700; flex:none; }
.msg.internal .av { background:#fdf1d8; color:#a96a08; }
.mb { flex:1; min-width:0; }
.mb .mh { display:flex; align-items:center; gap:9px; margin-bottom:4px; }
.mb .mh .nm { font-size:13px; font-weight:650; }
.mb .mh .tm { font-size:12px; color:var(--faint); margin-left:auto; }
.int-badge { font-size:10.5px; font-weight:700; color:#a96a08; background:#fdf1d8; padding:2px 7px; border-radius:5px; }

/* Rich text message content */
.mb .mc { font-size:13.5px; line-height:1.55; word-break:break-word; }
.mb .mc p { margin-bottom:0.5em; }
.mb .mc p:last-child { margin-bottom:0; }
.mb .mc ul, .mb .mc ol { padding-left:1.4em; margin-bottom:0.5em; }
.mb .mc li { margin-bottom:0.2em; }
.mb .mc table { border-collapse:collapse; font-size:13px; margin:6px 0; max-width:100%; }
.mb .mc th, .mb .mc td { border:1px solid var(--line); padding:5px 9px; text-align:left; }
.mb .mc th { background:var(--surface-2); font-weight:650; }
.mb .mc img { max-width:100%; border-radius:8px; margin:6px 0; cursor:pointer; }
.mb .mc strong { font-weight:700; }
.mb .mc em { font-style:italic; }

.msg-att { margin-top:9px; display:flex; flex-direction:column; gap:6px; }
.filechip { display:flex; align-items:center; gap:9px; background:var(--surface-2); border:1px solid var(--line); border-radius:8px; padding:7px 10px; font-size:12.5px; max-width:340px; }
.filechip .fn { flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-weight:550; }
.filechip .fs { color:var(--faint); font-size:11.5px; flex:none; }
.filechip .rm,.filechip .dl { cursor:pointer; color:var(--faint); display:grid; place-items:center; flex:none; }
.filechip .rm:hover { color:var(--danger); }
.filechip .dl:hover { color:var(--primary); }
.filechip .pv { cursor:pointer; color:var(--faint); display:grid; place-items:center; flex:none; }
.filechip .pv:hover { color:var(--tech); }

/* ---- RICH TEXT EDITOR (reply) ---- */
.reply { border-top:1px solid var(--line-2); padding:18px 22px; }
.editor-toolbar { display:flex; align-items:center; gap:3px; padding:6px 8px; background:var(--surface-2); border:1px solid var(--line); border-bottom:none; border-radius:9px 9px 0 0; flex-wrap:wrap; }
.editor-toolbar button { background:transparent; border:none; border-radius:5px; width:28px; height:28px; display:grid; place-items:center; cursor:pointer; color:var(--muted); font-family:var(--font); font-size:13px; font-weight:600; transition:.12s; }
.editor-toolbar button:hover { background:var(--line); color:var(--ink); }
.editor-toolbar button.active { background:var(--primary-soft); color:var(--primary-dark); }
.editor-toolbar .sep { width:1px; height:18px; background:var(--line); margin:0 3px; flex:none; }
.editor-toolbar .img-upload-btn { font-size:11px; width:auto; padding:0 8px; }
.reply-editor { min-height:90px; padding:11px 13px; border:1px solid var(--line); border-radius:0 0 9px 9px; font-family:var(--font); font-size:13.5px; line-height:1.55; background:var(--surface); outline:none; }
.reply-editor:focus { border-color:var(--primary); box-shadow:0 0 0 3px var(--primary-soft); }
.reply-editor:empty::before { content:attr(data-placeholder); color:var(--faint); pointer-events:none; }
.reply-editor ul, .reply-editor ol { padding-left:1.4em; }
.reply-editor table { border-collapse:collapse; min-width:240px; }
.reply-editor th, .reply-editor td { border:1px solid var(--line); padding:5px 9px; min-width:60px; }
.reply-editor th { background:var(--surface-2); font-weight:650; }
.reply-editor img { max-width:100%; border-radius:6px; }
.reply-bar { display:flex; align-items:center; gap:14px; margin-top:12px; flex-wrap:wrap; }
.reply-bar .spacer { flex:1; }
.toggle { display:inline-flex; align-items:center; gap:9px; font-size:13px; color:var(--muted); cursor:pointer; user-select:none; }
.switch { width:38px; height:22px; border-radius:20px; background:#d4dbe3; position:relative; transition:.16s; flex:none; }
.switch::after { content:""; position:absolute; top:2px; left:2px; width:18px; height:18px; border-radius:50%; background:#fff; box-shadow:0 1px 3px rgba(0,0,0,.2); transition:.16s; }
.toggle.on .switch { background:var(--p-mid); }
.toggle.on .switch::after { transform:translateX(16px); }
.attach-btn { display:inline-flex; align-items:center; gap:7px; font-size:13px; font-weight:600; color:var(--ink); background:var(--surface); border:1px solid var(--line); border-radius:9px; padding:8px 13px; cursor:pointer; }
.attach-btn:hover { background:var(--surface-2); }
#replyFiles { margin-top:10px; display:flex; flex-direction:column; gap:6px; }

/* ---- DETAIL SIDE ---- */
.dl-list { display:flex; flex-direction:column; gap:11px; }
.dl-row { display:flex; gap:9px; font-size:13px; }
.dl-row svg { color:var(--faint); flex:none; margin-top:2px; }
.dl-row .k { color:var(--muted); }
.dl-row .v { color:var(--ink); font-weight:600; word-break:break-word; }
.upd-field { margin-bottom:14px; }
.upd-field label { display:block; font-size:12px; font-weight:600; color:var(--muted); margin-bottom:5px; }
.upd-field select { width:100%; padding:9px 11px; border:1px solid var(--line); border-radius:9px; font-family:var(--font); font-size:13px; background:var(--surface); cursor:pointer; }
.upd-field select:focus { outline:none; border-color:var(--primary); box-shadow:0 0 0 3px var(--primary-soft); }
.lockrow { display:flex; align-items:center; gap:7px; font-size:12.5px; color:var(--faint); margin-top:-8px; margin-bottom:12px; }

/* ---- OVERLAY / MODAL ---- */
.overlay { position:fixed; inset:0; background:rgba(17,24,38,.45); backdrop-filter:blur(2px); opacity:0; pointer-events:none; transition:.2s; z-index:60; display:grid; place-items:center; padding:20px; }
.overlay.show { opacity:1; pointer-events:auto; }
.modal { background:var(--surface); border-radius:16px; width:600px; max-width:100%; max-height:92vh; display:flex; flex-direction:column; box-shadow:var(--shadow-lg); transform:scale(.97); transition:.2s; }
.overlay.show .modal { transform:scale(1); }
.modal-head { padding:18px 24px; border-bottom:1px solid var(--line-2); display:flex; align-items:center; justify-content:space-between; }
.modal-head h2 { font-size:17px; font-weight:700; }
.modal-body { padding:22px 24px; overflow-y:auto; }
.modal-foot { padding:15px 24px; border-top:1px solid var(--line-2); display:flex; gap:10px; justify-content:flex-end; background:var(--surface-2); border-radius:0 0 16px 16px; }

/* ---- FORM FIELDS ---- */
.field { margin-bottom:15px; }
.field label { display:block; font-size:12.5px; font-weight:600; margin-bottom:6px; }
.field label .req { color:var(--danger); }
.field .hint { font-weight:400; color:var(--faint); }
.field input,.field textarea,.field select { width:100%; padding:10px 12px; border:1px solid var(--line); border-radius:9px; font-family:var(--font); font-size:13.5px; background:var(--surface); }
.field input:focus,.field textarea:focus,.field select:focus { outline:none; border-color:var(--primary); box-shadow:0 0 0 3px var(--primary-soft); }
.field textarea { resize:vertical; min-height:78px; }
.row2 { display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.seg { display:flex; gap:8px; }
.seg button { flex:1; padding:12px; border:1.5px solid var(--line); border-radius:9px; background:var(--surface); cursor:pointer; font-family:var(--font); font-size:13px; font-weight:600; color:var(--muted); transition:.14s; display:flex; align-items:center; justify-content:center; gap:7px; }
.seg button[data-v="Verkoop"].active { border-color:var(--sales); background:var(--sales-bg); color:var(--sales); }
.seg button[data-v="Technisch"].active { border-color:var(--tech); background:var(--tech-bg); color:var(--tech); }
.hidden { display:none !important; }
.step-hint { font-size:12.5px; color:var(--faint); text-align:center; padding:14px 0 4px; }
.infobox { background:#f4f0fd; border:1px solid #e6ddf8; border-radius:11px; padding:13px 15px; margin-bottom:16px; }
.infobox .ih { display:flex; align-items:center; gap:8px; font-size:13px; font-weight:700; color:#6d28d9; margin-bottom:6px; }
.infobox p { font-size:12.5px; line-height:1.55; color:#5b4b8a; }
.infobox b { color:#5b21b6; }
.drop { border:1.5px dashed #d0d8e0; border-radius:10px; padding:16px; text-align:center; cursor:pointer; transition:.14s; color:var(--muted); background:var(--surface-2); font-size:12.5px; }
.drop:hover,.drop.over { border-color:var(--primary); background:var(--primary-soft); color:var(--primary-dark); }
.drop strong { color:var(--primary-dark); }
#newFiles { margin-top:10px; display:flex; flex-direction:column; gap:6px; }

/* ---- TOAST ---- */
.toast { position:fixed; bottom:24px; left:50%; transform:translateX(-50%) translateY(20px); background:var(--ink); color:#fff; padding:11px 18px; border-radius:10px; font-size:13px; font-weight:550; box-shadow:var(--shadow-lg); opacity:0; pointer-events:none; transition:.22s; z-index:90; max-width:90vw; }
.toast.show { opacity:1; transform:translateX(-50%) translateY(0); }

/* ---- VIEWER ---- */
.viewer-overlay { position:fixed; inset:0; background:rgba(17,24,38,.62); backdrop-filter:blur(3px); opacity:0; pointer-events:none; transition:.2s; z-index:80; display:grid; place-items:center; padding:24px; }
.viewer-overlay.show { opacity:1; pointer-events:auto; }
.viewer { background:var(--surface); border-radius:14px; width:1000px; max-width:100%; height:88vh; display:flex; flex-direction:column; box-shadow:var(--shadow-lg); overflow:hidden; transform:scale(.97); transition:.2s; }
.viewer-overlay.show .viewer { transform:scale(1); }
.viewer-head { padding:12px 16px; border-bottom:1px solid var(--line-2); display:flex; align-items:center; justify-content:space-between; gap:12px; }
.viewer-head .vt { font-size:14px; font-weight:650; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.viewer-actions { display:flex; align-items:center; gap:8px; flex:none; }
.viewer-btn { display:inline-flex; align-items:center; gap:6px; font-size:12.5px; font-weight:600; color:var(--ink); background:var(--surface); border:1px solid var(--line); border-radius:8px; padding:7px 11px; cursor:pointer; text-decoration:none; }
.viewer-btn:hover { background:var(--surface-2); }
.viewer-body { flex:1; background:var(--surface-2); position:relative; }
.viewer-body iframe { width:100%; height:100%; border:none; }
.viewer-body img { max-width:100%; max-height:100%; display:block; margin:auto; }
.viewer-loading { position:absolute; inset:0; display:grid; place-items:center; color:var(--muted); font-size:13px; }
.viewer-fallback { position:absolute; inset:0; display:grid; place-items:center; text-align:center; color:var(--muted); font-size:13.5px; padding:24px; }

/* ---- SHARE / FOLLOW ---- */
.fchips { display:flex; flex-wrap:wrap; gap:7px; margin-bottom:12px; }
.fchip { display:inline-flex; align-items:center; gap:6px; font-size:12px; font-weight:600; color:var(--primary-dark,#0a6f66); background:var(--primary-soft,#e6f4f2); border-radius:20px; padding:4px 10px; }
.fchip svg { cursor:pointer; opacity:.7; }
.fchip svg:hover { opacity:1; }
.share-row { display:flex; gap:8px; }
.share-row input { flex:1; padding:9px 11px; border:1px solid var(--line); border-radius:9px; font-family:inherit; font-size:13px; }
.share-res { display:flex; align-items:center; gap:10px; padding:8px 6px; border-radius:8px; cursor:pointer; }
.share-res:hover { background:var(--surface-2); }

/* ---- MOBILE BAR ---- */
.mobilebar { display:none; align-items:center; justify-content:space-between; gap:10px; padding:10px 14px; background:var(--surface); border-bottom:1px solid var(--line); position:sticky; top:0; z-index:45; }
.mobilebar .mb-brand { display:flex; align-items:center; gap:9px; font-weight:700; font-size:15px; }
.mobilebar .mb-logo { width:28px; height:28px; border-radius:7px; overflow:hidden; }
.mobilebar .mb-logo img { width:100%; height:100%; object-fit:cover; }
.hamb { background:var(--surface-2); border:1px solid var(--line); border-radius:9px; width:38px; height:38px; display:grid; place-items:center; color:var(--ink); cursor:pointer; }
.sb-scrim { display:none; position:fixed; inset:0; background:rgba(17,24,38,.45); z-index:48; opacity:0; transition:.2s; }
.sb-scrim.show { display:block; opacity:1; }

/* ---- RESPONSIVE ---- */
@media (max-width:900px){
  .detail-layout,.card-grid{ grid-template-columns:1fr; }
  .stat-grid{ grid-template-columns:1fr 1fr; }
  .main-inner{ padding:24px 22px 70px; }
}
@media (max-width:680px){
  .mobilebar{ display:flex; }
  .sidebar{ position:fixed; top:0; left:0; height:100vh; z-index:49; transform:translateX(-100%); transition:transform .24s ease; box-shadow:var(--shadow-lg); }
  .sidebar.open{ transform:translateX(0); }
  .main-inner{ padding:16px 14px 80px; }
  .row2{ grid-template-columns:1fr; }
  .stat-grid{ grid-template-columns:1fr 1fr; gap:10px; }
  .page-head{ flex-direction:column; align-items:flex-start; gap:10px; }
  .page-head h2{ font-size:20px; }
  .page-head .btn{ width:100%; justify-content:center; }
  .toolbar{ flex-wrap:wrap; gap:8px; }
  .toolbar input,.toolbar select.filter{ flex:1 1 100%; min-width:0; }
  .detail-layout{ gap:16px; }
  .panel-card .pc-head{ font-size:14px; }
  .d-title{ font-size:17px; }
  .d-titlerow{ flex-direction:column; align-items:flex-start; gap:8px; }
  .reply-bar{ flex-wrap:wrap; gap:8px; }
  .reply-bar .spacer{ display:none; }
  .reply-bar .btn{ flex:1; justify-content:center; }
  .attach-btn{ flex:1; justify-content:center; }
  .modal{ border-radius:14px 14px 0 0; max-height:96vh; position:fixed; bottom:0; left:0; right:0; width:100%; transform:translateY(20px); }
  .overlay.show .modal{ transform:translateY(0); }
  .modal-body{ padding:18px 18px; }
  .modal-foot{ padding:12px 18px; flex-direction:column-reverse; }
  .modal-foot .btn{ width:100%; justify-content:center; }
  .seg button{ padding:10px 8px; font-size:12.5px; }
  .viewer{ height:95vh; border-radius:14px 14px 0 0; position:fixed; bottom:0; left:0; right:0; width:100%; }
  .viewer-overlay{ padding:0; align-items:flex-end; }
  .share-row{ flex-direction:column; }
  .share-row input,.share-row .btn{ width:100%; }
  .filechip{ flex-wrap:wrap; }
  .msg-att{ flex-direction:column; }
  .back{ font-size:13px; margin-bottom:12px; }
  .arch-banner{ font-size:12.5px; }
  .who{ flex-direction:column; gap:8px; }
  .editor-toolbar { gap:1px; }
}
@media (max-width:380px){
  .stat-grid{ grid-template-columns:1fr; }
  .main-inner{ padding:12px 12px 80px; }
  .sb-brand h1{ font-size:14px; }
  .tags{ flex-wrap:wrap; }
}
