:root{
  --white:#fefefe; --red:#ff1616; --black:#000000;
  --ink:#141414; --muted:#7a7a7a; --line:#ececec; --bg:#f6f6f7; --card:#ffffff;
  --radius:12px; --shadow:0 1px 3px rgba(0,0,0,.06),0 8px 24px rgba(0,0,0,.04);
}
*{box-sizing:border-box}
body{margin:0;font-family:'Poppins',system-ui,sans-serif;color:var(--ink);background:var(--bg);font-size:15px;line-height:1.5}
a{color:var(--red);text-decoration:none}
h1,h2,h3{font-weight:600;margin:0}
.muted{color:var(--muted)}
.small{font-size:12.5px}
.num{text-align:right;font-variant-numeric:tabular-nums;font-weight:600}

/* Layout */
.app{display:flex;min-height:100vh}
.sidebar{width:230px;background:var(--black);color:var(--white);display:flex;flex-direction:column;padding:22px 16px;position:sticky;top:0;height:100vh}
.brand{font-weight:700;font-size:22px;letter-spacing:-.5px;color:var(--white);text-transform:uppercase}
.brand-mark{color:var(--red)}
.brand-lg{font-size:30px;margin-bottom:18px}
.sidebar nav{margin-top:28px;display:flex;flex-direction:column;gap:4px;flex:1}
.sidebar nav a{color:#cfcfcf;padding:10px 12px;border-radius:8px;font-weight:500}
.sidebar nav a:hover{background:#1c1c1c;color:#fff}
.sidebar nav a.on{background:var(--red);color:#fff}
.sidebar-foot{border-top:1px solid #2a2a2a;padding-top:14px;display:flex;flex-direction:column;gap:8px;align-items:flex-start;font-size:13px;color:#bbb}
.sidebar-foot-row{display:flex;justify-content:space-between;align-items:center;width:100%}
.sidebar-foot a{color:#bbb}
.sidebar-build{margin-top:8px;font-size:11px;color:#666;letter-spacing:.2px}
.main{flex:1;padding:30px 36px;max-width:1100px}

/* Header */
.page-head{display:flex;justify-content:space-between;align-items:center;margin-bottom:22px}
.page-head h1{font-size:24px}

/* Buttons */
.btn{display:inline-block;background:#fff;border:1px solid var(--line);color:var(--ink);padding:9px 16px;border-radius:9px;font-weight:500;cursor:pointer;font-family:inherit;font-size:14px}
.btn:hover{border-color:#d5d5d5}
.btn-primary{background:var(--red);border-color:var(--red);color:#fff}
.btn-primary:hover{background:#e40f0f;border-color:#e40f0f}
.btn-block{width:100%;text-align:center;margin-top:8px}

/* Cards + stats */
.card{background:var(--card);border:1px solid var(--line);border-radius:var(--radius);box-shadow:var(--shadow);padding:20px 22px;margin-bottom:20px}
.card h2{font-size:16px;margin-bottom:12px}
.stat-row{display:grid;grid-template-columns:repeat(3,1fr);gap:16px;margin-bottom:22px}
.stat{background:var(--card);border:1px solid var(--line);border-radius:var(--radius);box-shadow:var(--shadow);padding:20px}
.stat-num{font-size:30px;font-weight:700;letter-spacing:-1px}
.stat-label{color:var(--muted);font-size:13px;margin-top:2px}
.grid-2{display:grid;grid-template-columns:1fr 1fr;gap:20px}

/* Tables */
.table{width:100%;border-collapse:collapse}
.table th{text-align:left;font-size:12px;text-transform:uppercase;letter-spacing:.4px;color:var(--muted);padding:8px 10px;border-bottom:1px solid var(--line)}
.table td{padding:11px 10px;border-bottom:1px solid var(--line);vertical-align:top}
.table tr:last-child td{border-bottom:none}
.truncate{max-width:280px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.row-actions{display:flex;gap:12px;align-items:center;white-space:nowrap}
.row-actions form{margin:0}
.link{background:none;border:none;color:var(--red);cursor:pointer;font-family:inherit;font-size:14px;padding:0}
.link.danger{color:#b00}
.tag{display:inline-block;background:#f1f1f3;color:#555;border-radius:20px;padding:2px 10px;font-size:11.5px;font-weight:500}
.tag-off{background:#ffe9e9;color:#c00;margin-left:6px}

/* Forms */
.filters{display:flex;gap:10px;margin-bottom:18px}
.filters input[type=text]{flex:1}
/* `hidden` must actually hide.
   The browser's own [hidden] rule is display:none at the lowest possible
   specificity, so ANY class that sets display beats it - .btn{display:block}
   did, and the AI drafter's Reset button sat visible before there was
   anything to reset. This is a whole class of bug rather than one button:
   every future `el.hidden = true` in this app depends on it. */
[hidden]{display:none !important}

input,select{font-family:inherit;font-size:14px;padding:10px 12px;border:1px solid var(--line);border-radius:9px;background:#fff;width:100%}
input:focus,select:focus{outline:none;border-color:var(--red)}
.form-card{max-width:620px}
.form-card label{display:block;margin-bottom:16px;font-weight:500;font-size:14px}
.form-card label input,.form-card label select{margin-top:6px;font-weight:400}
.form-row{display:grid;grid-template-columns:1fr 1fr;gap:16px}
.checkbox{display:flex;align-items:center;gap:8px}
.checkbox input{width:auto;margin:0}
.slug-input{display:flex;align-items:stretch;margin-top:6px}
.slug-prefix{display:flex;align-items:center;padding:0 10px;background:#f4f4f5;border:1px solid var(--line);border-right:none;border-radius:9px 0 0 9px;color:var(--muted);font-size:13px;white-space:nowrap}
.slug-input input{border-radius:0 9px 9px 0}
.form-actions{display:flex;gap:10px;margin-top:8px}
.with-btn{display:flex;gap:8px;margin-top:6px}
.with-btn input{flex:1}
.with-btn .btn{white-space:nowrap}
.btn-sm{padding:6px 12px;font-size:13px}

/* Social preview block */
.preview-block{border:1px solid var(--line);border-radius:11px;padding:14px 16px;margin-bottom:16px;background:#fbfbfc}
.preview-head{font-weight:600;font-size:13px;text-transform:uppercase;letter-spacing:.4px;color:var(--muted);margin-bottom:10px}
.preview-card{display:flex;gap:0;border:1px solid var(--line);border-radius:10px;overflow:hidden;background:#fff;max-width:460px}
.pc-img{width:150px;min-height:110px;background:#eee center/cover no-repeat;flex-shrink:0}
.pc-body{padding:12px 14px;min-width:0}
.pc-title{font-weight:600;font-size:14px;line-height:1.3;margin-bottom:4px}
.pc-desc{margin-bottom:6px;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.pc-host{text-transform:uppercase;font-size:11px;letter-spacing:.4px}
.preview-hint{margin:10px 0 6px}
.preview-custom summary{cursor:pointer;font-size:13px;font-weight:500;color:var(--red)}
.preview-custom[open] summary{margin-bottom:10px}
.preview-custom label{display:block;margin-bottom:10px;font-size:13px;font-weight:500}
.preview-custom label input{margin-top:5px;font-weight:400}
.pager{display:flex;gap:6px;margin-top:16px}
.pager a{padding:6px 11px;border:1px solid var(--line);border-radius:8px;color:var(--ink)}
.pager a.on{background:var(--red);color:#fff;border-color:var(--red)}

/* Flash */
.flash{padding:12px 16px;border-radius:9px;margin-bottom:16px;font-size:14px}
.flash-success{background:#eafaf0;color:#137a3f;border:1px solid #c4ecd3}
.flash-error{background:#ffecec;color:#c22;border:1px solid #f5c9c9}
.flash-warn{background:#fff6e6;color:#8a5a00;border:1px solid #f3dca6}
.flash-fold summary{cursor:pointer;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.flash-fold ul{margin:8px 0 0;padding-left:20px}

/* Login / error */
.login-body{display:flex;align-items:center;justify-content:center;min-height:100vh;background:var(--black)}
.login-card{background:#fff;border-radius:16px;width:360px;max-width:92vw;overflow:hidden;box-shadow:0 20px 60px rgba(0,0,0,.35)}
.card-logobar{background:#000;padding:22px;text-align:center}
.card-logobar .brand{margin:0}
.card-inner{padding:30px}
.login-card.center .card-inner{text-align:center}
.login-card label{display:block;margin-bottom:14px;font-weight:500;font-size:14px}
.login-card label input{margin-top:6px}
.err-code{font-size:56px;color:var(--red);margin:6px 0 0}

/* ===== Bio page (themeable) =====
   Every theme sets these variables; the components below read them. */
.bio-body{
  --bio-bg:#0d0d0d; --bio-bg2:#1a1a1a; --bio-fg:#ffffff; --bio-muted:#b8b8b8;
  --bio-btn-bg:#ffffff; --bio-btn-fg:#000000; --bio-btn-hover:#ff1616; --bio-btn-hover-fg:#ffffff;
  --bio-accent:#ff1616; --bio-radius:12px; --bio-font:'Poppins',system-ui,sans-serif; --bio-title-font:var(--bio-font);
  background:var(--bio-bg);min-height:100vh;padding:40px 18px;font-family:var(--bio-font)}
.theme-wow{background:linear-gradient(160deg,#000,#1a1a1a)}
.theme-light{--bio-bg:#f6f6f7;--bio-fg:#141414;--bio-muted:#666;--bio-btn-bg:#111827;--bio-btn-fg:#fff;--bio-btn-hover:#ff1616;--bio-accent:#ff1616;background:#f6f6f7}
.theme-rak{--bio-btn-bg:#ff1616;--bio-btn-fg:#fff;--bio-btn-hover:#000;--bio-accent:#ff1616;background:linear-gradient(160deg,#2a0000,#000)}
.theme-emirates{--bio-accent:#d4af37;--bio-btn-bg:#d4af37;--bio-btn-fg:#111;--bio-btn-hover:#fff;background:linear-gradient(160deg,#111,#1c1c22)}
.theme-abudhabi{--bio-accent:#0e9aa7;--bio-btn-bg:#0e9aa7;--bio-btn-fg:#fff;--bio-btn-hover:#fff;--bio-btn-hover-fg:#0e9aa7;background:linear-gradient(160deg,#04252a,#0b1418)}
.theme-ajman{--bio-accent:#f5a623;--bio-btn-bg:#f5a623;--bio-btn-fg:#1a1200;--bio-btn-hover:#fff;background:linear-gradient(160deg,#2a1c00,#141414)}
.theme-divine{--bio-bg:#2a0410;--bio-fg:#fdf3e7;--bio-muted:#e8cfa8;--bio-btn-bg:#eacb90;--bio-btn-fg:#4a0410;--bio-btn-hover:#fff;--bio-accent:#eacb90;--bio-title-font:'Playfair Display',serif;background:linear-gradient(160deg,#3a0518,#5a0a24)}
.theme-gradient{--bio-btn-bg:#fff;--bio-btn-fg:#111;--bio-btn-hover:#111;--bio-btn-hover-fg:#fff;--bio-accent:#ff1616;background:linear-gradient(160deg,#ff1616,#7a0000 55%,#000)}
.theme-minimal{--bio-bg:#ffffff;--bio-fg:#111;--bio-muted:#777;--bio-btn-bg:#fff;--bio-btn-fg:#111;--bio-btn-hover:#111;--bio-btn-hover-fg:#fff;--bio-radius:8px;background:#fff}
.theme-minimal .bio-block{border:1.5px solid #111}

.bio{max-width:480px;margin:0 auto;text-align:center;color:var(--bio-fg)}
.bio-avatar{width:92px;height:92px;border-radius:50%;object-fit:cover;border:3px solid var(--bio-accent)}
.bio-title{font-size:23px;margin-top:14px;font-family:var(--bio-title-font);color:var(--bio-fg)}
.bio-headline{color:var(--bio-fg);opacity:.85;margin:4px 0 0}
.bio-text{color:var(--bio-muted);font-size:14px;margin-top:6px}

/* Social icon row */
.bio-socials{display:flex;justify-content:center;flex-wrap:wrap;gap:14px;margin:18px 0 4px}
.bio-social{color:var(--bio-fg);opacity:.85;transition:opacity .12s,transform .12s}
.bio-social:hover{opacity:1;transform:translateY(-2px);color:var(--bio-accent)}

/* Blocks - flex-wrap gives multi-column via width classes */
.bio-blocks{display:flex;flex-wrap:wrap;gap:12px;margin:22px 0}
.bio-block{box-sizing:border-box}
.w-full{width:100%}
.w-half{width:calc(50% - 6px)}
.w-third{width:calc(33.333% - 8px)}

/* Link button */
.bio-link{display:flex;align-items:center;gap:12px;background:var(--bio-btn-bg);color:var(--bio-btn-fg);padding:14px 16px;border-radius:var(--bio-radius);font-weight:600;transition:transform .08s,background .12s,color .12s;text-align:left}
.bio-link:hover{transform:scale(1.02);background:var(--bio-btn-hover);color:var(--bio-btn-hover-fg)}
.bio-link-thumb{width:40px;height:40px;border-radius:8px;background:#ddd center/cover no-repeat;flex-shrink:0}
.bio-link-text{display:flex;flex-direction:column;min-width:0;flex:1}
.bio-link-label{font-weight:600;line-height:1.2}
.bio-link-sub{font-size:12px;font-weight:400;opacity:.7}
.bio-link .bio-link-label,.bio-link .bio-link-sub{text-align:center}
.bio-link:has(.bio-link-thumb) .bio-link-text{text-align:left}

/* Image button */
.bio-image{position:relative;display:block;border-radius:var(--bio-radius);overflow:hidden;line-height:0}
.bio-image img{width:100%;display:block;object-fit:cover}
.bio-image-cap{position:absolute;left:0;right:0;bottom:0;padding:10px 12px;background:linear-gradient(transparent,rgba(0,0,0,.65));color:#fff;font-weight:600;font-size:13px;line-height:1.2;text-align:left}

/* Text block */
.bio-textblock{color:var(--bio-fg);text-align:center;font-size:14.5px;line-height:1.5;padding:2px}
.bio-text-head{display:block;font-size:16px;margin-bottom:4px}

/* Coupon */
.bio-coupon{background:var(--bio-btn-bg);color:var(--bio-btn-fg);border-radius:var(--bio-radius);padding:12px 14px;text-align:center}
.coupon-label{display:block;font-size:12.5px;opacity:.8;margin-bottom:6px}
.coupon-row{display:flex;align-items:stretch;gap:0;border:1.5px dashed var(--bio-btn-fg);border-radius:8px;overflow:hidden}
.coupon-code{flex:1;padding:9px 10px;font-weight:700;letter-spacing:1px;font-variant-numeric:tabular-nums}
.coupon-copy{border:none;background:var(--bio-btn-fg);color:var(--bio-btn-bg);padding:0 16px;cursor:pointer;font-family:inherit;font-weight:700;font-size:13px}
.coupon-copy.copied{opacity:.7}

/* Raw HTML block */
.bio-html{width:100%;color:var(--bio-fg)}
.bio-html img{max-width:100%;height:auto}

.bio-feed-title{width:100%;font-size:14px;text-transform:uppercase;letter-spacing:1px;color:var(--bio-muted);margin:10px 0 14px}
.bio-feed{display:grid;grid-template-columns:repeat(3,1fr);gap:6px}
.feed-tile{aspect-ratio:1;background:rgba(128,128,128,.25);border-radius:8px;overflow:hidden}
.feed-tile img{width:100%;height:100%;object-fit:cover;display:block}
.bio-foot{margin-top:30px;color:var(--bio-muted);opacity:.7;font-size:12px}

/* Floating WhatsApp bar */
.bio-wa-bar{position:fixed;left:16px;right:16px;bottom:16px;max-width:460px;margin:0 auto;display:flex;align-items:center;justify-content:center;gap:8px;background:#25D366;color:#fff;padding:13px;border-radius:30px;font-weight:600;box-shadow:0 8px 24px rgba(0,0,0,.28);z-index:50}
.bio-wa-bar:hover{background:#1ebe57;color:#fff}

/* Scroll to top */
.bio-scroll-top{position:fixed;right:18px;bottom:78px;width:44px;height:44px;border-radius:50%;border:none;background:var(--bio-accent,#ff1616);color:#fff;font-size:20px;cursor:pointer;box-shadow:0 6px 18px rgba(0,0,0,.3);opacity:0;pointer-events:none;transition:opacity .2s;z-index:49}
.bio-scroll-top.show{opacity:1;pointer-events:auto}

/* Quick find */
.quick-find{width:100%;margin-bottom:12px;padding:11px 14px;border:1px solid var(--line);border-radius:10px;font-family:inherit;font-size:14px}
.quick-find:focus{outline:none;border-color:var(--red)}

/* Redesigned link rows */
.links-table td{vertical-align:middle}
.link-main{width:100%}
.short-row{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.short-url{font-weight:600;font-size:14.5px;color:var(--ink)}
.short-url:hover{color:var(--red)}
.pin-flag{background:var(--red);color:#fff;font-size:9.5px;font-weight:700;letter-spacing:.5px;padding:2px 6px;border-radius:5px}
.dest-row{display:flex;align-items:center;gap:8px;margin-top:3px}
.dest-url{color:var(--muted);font-size:12.5px;max-width:420px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.link-title{margin-top:2px}
.icon-btn{background:none;border:none;cursor:pointer;font-size:16px;line-height:1;color:#c9c9c9;padding:2px 3px;font-family:inherit}
.icon-btn:hover{color:#999}
.fav-btn.on{color:var(--red)}
.pin-btn{filter:grayscale(1) opacity(.45)}
.pin-btn.on{filter:none;opacity:1}
.is-pinned{background:#fff8f8}
.clicks-btn{background:none;border:none;font-family:inherit;font-weight:600;font-size:15px;color:var(--ink);cursor:pointer;font-variant-numeric:tabular-nums}
.clicks-btn:hover{color:var(--red);text-decoration:underline}
.copy-mini{padding:1px 6px;font-size:10.5px}

/* Duplicate warning actions */
.dup-actions{display:flex;align-items:center;gap:10px;margin-top:10px;flex-wrap:wrap}
.dup-link{font-weight:600}

.range-tabs{display:flex;gap:6px;flex-wrap:wrap;margin-bottom:12px}
.range-tabs button{background:#f4f4f5;border:1px solid var(--line);border-radius:8px;padding:6px 12px;font-size:13px;font-family:inherit;cursor:pointer}
.range-tabs button.on{background:var(--red);border-color:var(--red);color:#fff}
.stats-total{font-size:13px;color:var(--muted);margin-bottom:12px}
.stats-total span{color:var(--ink);font-weight:600}
.chart-wrap{position:relative;height:280px}
.chart-sm{height:220px}
.breakdowns{display:grid;grid-template-columns:repeat(3,1fr);gap:16px;margin-top:18px}
.bd-col h4{margin:0 0 6px;font-size:12px;text-transform:uppercase;letter-spacing:.4px;color:var(--muted)}
.bd-list{list-style:none;margin:0;padding:0}
.bd-list li{display:flex;justify-content:space-between;gap:8px;padding:5px 0;border-bottom:1px solid var(--line);font-size:13px}
.bd-list li:last-child{border-bottom:none}
.bd-list li span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.bd-list li b{font-variant-numeric:tabular-nums}
.head-actions{display:flex;gap:8px;flex-wrap:wrap}
textarea{width:100%;font-family:inherit;font-size:14px;padding:10px 12px;border:1px solid var(--line);border-radius:9px;resize:vertical;box-sizing:border-box}
textarea:focus{outline:none;border-color:var(--red)}
@media(max-width:600px){.breakdowns{grid-template-columns:1fr}}

/* Link list extras */
.thumb-cell{width:52px}
.thumb{display:block;width:44px;height:44px;border-radius:8px;background:#eee center/cover no-repeat;border:1px solid var(--line)}
.thumb-empty{background:repeating-linear-gradient(45deg,#f4f4f5,#f4f4f5 6px,#eee 6px,#eee 12px)}
.copy-line{display:flex;align-items:center;gap:8px}
.copy-line .truncate-txt{max-width:240px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;display:inline-block}
.copy-btn{border:1px solid var(--line);background:#fff;color:var(--muted);border-radius:6px;padding:2px 8px;font-size:11.5px;cursor:pointer;font-family:inherit}
.copy-btn:hover{border-color:var(--red);color:var(--red)}
.copy-btn.copied{background:#eafaf0;color:#137a3f;border-color:#c4ecd3}
.slug-tools{display:flex;align-items:center;gap:10px;margin-top:8px}
.slug-chips{display:flex;flex-wrap:wrap;gap:8px;margin-top:10px}
.slug-chip{background:#fff;border:1px solid var(--line);border-radius:20px;padding:5px 14px;font-family:inherit;font-size:13px;font-weight:600;cursor:pointer}
.slug-chip:hover{border-color:var(--red);color:var(--red)}
.slug-chip.on{background:var(--red);border-color:var(--red);color:#fff}
.filters select{max-width:150px}

/* Bio list table */
.bios-table td{vertical-align:middle}
.bios-table th.ta-right{text-align:right}
.ta-right{text-align:right}
.bio-url{font-weight:600}
.views-cell{font-weight:600;font-variant-numeric:tabular-nums}
.bios-table td.row-actions{justify-content:flex-end;gap:4px}

/* ===== Bio editor: two-column with live preview ===== */
.main:has(.bio-editor-layout){max-width:1400px}
.bio-editor-layout{display:grid;grid-template-columns:minmax(0,1fr) 360px;gap:24px;align-items:start}
.bio-editor-main{min-width:0}

/* Sticky save bars top + bottom */
.editor-savebar{position:sticky;top:0;z-index:5;display:flex;align-items:center;justify-content:space-between;gap:12px;background:#fff;border:1px solid var(--line);border-radius:11px;padding:12px 16px;margin-bottom:14px;box-shadow:var(--shadow)}
.editor-savebar.bottom{position:static;margin-top:16px}

/* Collapsible sections */
/* overflow:clip rather than hidden - both clip to the rounded corner, but
   'hidden' makes this a scroll container and traps position:sticky inside
   it, which killed the mobile save bar. 'hidden' stays as the fallback. */
.acc{background:var(--card);border:1px solid var(--line);border-radius:11px;margin-bottom:12px;overflow:hidden;overflow:clip}
.acc>summary{cursor:pointer;list-style:none;padding:14px 18px;font-weight:600;font-size:15px;display:flex;align-items:center;gap:8px;user-select:none}
.acc>summary::-webkit-details-marker{display:none}
.acc>summary::before{content:'▸';color:var(--muted);font-size:12px;transition:transform .15s}
.acc[open]>summary::before{transform:rotate(90deg)}
.acc>summary:hover{background:#fafafb}
.acc-body{padding:4px 18px 18px}
.acc-body label{display:block;margin-bottom:14px;font-weight:500;font-size:14px}
.acc-body label input,.acc-body label select,.acc-body label textarea{margin-top:6px;font-weight:400}

/* Design controls */
.color-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:10px;margin-bottom:14px}
.color-field{display:flex;align-items:center;gap:8px;background:#f6f6f7;border-radius:9px;padding:7px 10px}
.color-field .cf-label{flex:1;font-size:13px;font-weight:500}
.color-pick{width:34px;height:28px;padding:0;border:1px solid var(--line);border-radius:6px;background:none;cursor:pointer;flex-shrink:0}
.cf-text{width:96px;margin:0;font-size:12.5px;padding:6px 8px}

/* Live preview */
.bio-editor-preview{position:sticky;top:20px}
.preview-bar{display:flex;align-items:center;justify-content:space-between;margin-bottom:8px;font-weight:600;font-size:13px;color:var(--muted);text-transform:uppercase;letter-spacing:.4px}
.preview-phone{background:#111;border-radius:26px;padding:10px;box-shadow:var(--shadow)}
.preview-phone iframe{width:100%;height:600px;border:none;border-radius:18px;background:#fff;display:block}

@media(max-width:1000px){
  .bio-editor-layout{grid-template-columns:1fr}
  .bio-editor-preview{position:static;order:-1}
  .preview-phone iframe{height:420px}
  .color-grid{grid-template-columns:1fr}
}

/* Outline button style (bio public, toggled by custom style) */
.btn-outline .bio-link{background:transparent;border:2px solid var(--bio-btn-bg);color:var(--bio-fg)}
.btn-outline .bio-link:hover{background:var(--bio-btn-bg);color:var(--bio-btn-fg)}
.btn-outline .bio-coupon{background:transparent;border:2px solid var(--bio-btn-bg)}

/* Bio block editor (admin) */
.block-editor{border:1px solid var(--line);border-radius:11px;padding:14px 16px;margin-bottom:14px;background:#fbfbfc}
.block-editor.add-block{background:#fff;border-style:dashed}
.blk-add-title{font-size:14px;margin-bottom:10px}
.blk-head{display:flex;align-items:center;gap:12px;margin-bottom:10px}
.blk-tag{background:var(--ink);color:#fff;border-radius:6px;padding:2px 9px;font-size:11px;font-weight:600;text-transform:uppercase;letter-spacing:.4px}
.blk-move{display:flex;gap:6px;margin-left:auto}
.blk-move form{margin:0}
.block-editor label{display:block;margin-bottom:10px;font-weight:500;font-size:13px}
.block-editor label input,.block-editor label select,.block-editor label textarea{margin-top:5px;font-weight:400}
.blk-actions{display:flex;align-items:center;gap:14px;margin-top:4px}
.blk-del{margin-top:8px}

/* Bio builder */
.inline-row{display:flex;gap:8px;align-items:center;margin-bottom:8px;flex-wrap:wrap}
.inline-row input[type=text],.inline-row input[type=url]{flex:1;min-width:160px}
.inline-del{margin:-4px 0 14px}
.add-row{margin-top:14px;padding-top:14px;border-top:1px dashed var(--line)}
.nowrap{white-space:nowrap}
.checkbox.nowrap{gap:5px}
.ig-row{padding-bottom:6px;border-bottom:1px solid var(--line);margin-bottom:10px}
.feed-sync-actions{display:flex;flex-wrap:wrap;gap:8px;margin-bottom:12px}
.feed-run-table td{vertical-align:top}
.feed-run-table .fr-url{word-break:break-all}
.feed-grid-admin{display:grid;grid-template-columns:repeat(auto-fill,minmax(200px,1fr));gap:14px;margin:8px 0 16px}
.feed-admin-tile{border:1px solid var(--line);border-radius:10px;padding:10px;background:#fff}
.feed-admin-tile.linked{border-left:3px solid var(--red)}
.fa-thumb{aspect-ratio:1;background:#eee center/cover no-repeat;border-radius:7px;margin-bottom:8px}
.fa-cap{height:32px;overflow:hidden;margin-bottom:6px}
.feed-admin-tile input{margin-bottom:6px}

/* ===== Dashboard: brand breakdown + lists ===== */
.brand-breakdown{display:flex;gap:22px;align-items:center}
.brand-chart{width:200px;height:200px;flex-shrink:0;position:relative}
.brand-legend{display:flex;flex-direction:column;gap:8px;flex:1;min-width:0}
.brand-legend-item{display:flex;align-items:center;gap:10px;background:#f6f6f7;border-radius:22px;padding:7px 14px}
.brand-dot{width:12px;height:12px;border-radius:50%;flex-shrink:0}
.bl-label{flex:1;font-size:13px;font-weight:500;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.bl-count{font-weight:700;font-variant-numeric:tabular-nums;font-size:14px}

/* Small inline brand pill (used in lists) */
.brand-pill{display:inline-flex;align-items:center;gap:6px;background:#f1f1f3;border-radius:20px;padding:2px 10px 2px 8px;font-size:11.5px;font-weight:600;color:#444;white-space:nowrap}
.brand-pill .brand-dot{width:8px;height:8px}

/* Dashboard top/recent lists */
.dash-list{display:flex;flex-direction:column}
.dash-item{display:flex;align-items:center;gap:12px;padding:11px 0;border-bottom:1px solid var(--line)}
.dash-item:last-child{border-bottom:none}
.dash-main{flex:1;min-width:0}
.dash-short{font-weight:600;font-size:14px;color:var(--ink)}
.dash-short:hover{color:var(--red)}
.dash-sub{display:flex;align-items:center;gap:8px;margin-top:4px;min-width:0}
.dash-dest{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0}
.dash-num{font-weight:700;font-size:16px;font-variant-numeric:tabular-nums;flex-shrink:0}
.dash-edit{flex-shrink:0}

/* ===== Links page: list + analytics rail ===== */
.main:has(.links-layout){max-width:1520px}
.links-layout{display:grid;grid-template-columns:minmax(0,1fr) 380px;gap:22px;align-items:start}
.links-col{min-width:0}

/* Inline quick-create bar */
.quick-create{display:flex;gap:10px;margin-bottom:18px}
.quick-create input{flex:1}
.quick-adv{white-space:nowrap;display:inline-flex;align-items:center}

/* Row list (div-based, was a table) */
.link-rows{display:flex;flex-direction:column}
.link-row{display:flex;align-items:flex-start;gap:12px;padding:12px 10px;border-bottom:1px solid var(--line);cursor:pointer;border-radius:8px}
.link-row:last-child{border-bottom:none}
.link-row:hover{background:#fafafb}
.link-row.selected{background:#fff2f2;box-shadow:inset 3px 0 0 var(--red)}
.link-row .link-main{flex:1;min-width:0}
.link-row .dest-row{min-width:0}
.link-row .dest-url{flex:1;min-width:0;max-width:100%}
.meta-row{display:flex;align-items:center;gap:10px;margin-top:5px;flex-wrap:wrap}
.meta-clicks{font-size:12.5px;color:var(--muted)}
.meta-clicks b{color:var(--ink);font-variant-numeric:tabular-nums}

/* Compact icon actions */
.row-actions{display:flex;gap:2px;align-items:center;flex-shrink:0}
.row-actions form{margin:0}
.act-btn{display:inline-flex;align-items:center;justify-content:center;width:30px;height:30px;border:1px solid transparent;background:none;border-radius:7px;color:#9a9a9a;cursor:pointer;font-family:inherit;padding:0;text-decoration:none}
.act-btn:hover{background:#f4f4f5;color:var(--red);border-color:var(--line)}
.act-btn.danger:hover{color:#c00}
.act-btn svg{display:block}

/* Analytics rail */
.analytics-rail{position:sticky;top:20px}
.rail-inner{background:var(--card);border:1px solid var(--line);border-radius:var(--radius);box-shadow:var(--shadow);padding:18px;position:relative}
.rail-close{display:none;position:absolute;top:10px;right:12px;background:none;border:none;font-size:26px;line-height:1;color:#999;cursor:pointer}
.rail-reset{background:none;border:none;color:var(--red);font-family:inherit;font-size:12.5px;font-weight:600;cursor:pointer;padding:0;margin-bottom:6px}
.rail-title{font-weight:700;font-size:16px;letter-spacing:-.3px;word-break:break-word}
.rail-scope{margin-bottom:14px}
.rail-big{font-size:34px;font-weight:700;letter-spacing:-1px;margin:8px 0 2px}
.rail-big-unit{font-size:14px;font-weight:500;color:var(--muted);letter-spacing:0}
.rail-meta{margin-bottom:8px}
.rail-breakdowns{grid-template-columns:1fr;gap:14px;margin-top:16px}
.analytics-rail .range-tabs button{padding:5px 10px;font-size:12.5px}
.analytics-rail .chart-sm{height:200px}

/* Floating open-analytics button (mobile only) */
.rail-fab{display:none}

/* Responsive */
@media(max-width:1024px){
  .links-layout{grid-template-columns:1fr}
  .analytics-rail{position:fixed;top:0;right:0;bottom:0;width:370px;max-width:92vw;z-index:120;transform:translateX(105%);transition:transform .22s ease}
  .analytics-rail.open{transform:none;box-shadow:-12px 0 44px rgba(0,0,0,.2)}
  .rail-inner{height:100%;overflow:auto;border-radius:0;border:none}
  .rail-close{display:flex}
  .rail-fab{display:inline-flex;align-items:center;gap:6px;position:fixed;right:18px;bottom:18px;z-index:110;background:var(--red);color:#fff;border:none;border-radius:26px;padding:12px 18px;font-family:inherit;font-weight:600;font-size:14px;cursor:pointer;box-shadow:0 8px 24px rgba(255,22,22,.35)}
}

@media(max-width:800px){
  /* The sidebar used to become a horizontal row here, which only moved the
     problem: ten nav items wrapped into a block taller than the content.
     It is now a collapsing top bar - see the mobile section at the end. */
  /* minmax(0,1fr), not 1fr: a 1fr track still has min-width:auto, so the
     click chart's intrinsic canvas width propped every card open and
     scrolled the whole page sideways on a phone. */
  .grid-2,.stat-row,.form-row{grid-template-columns:minmax(0,1fr)}
  .quick-create{flex-wrap:wrap}
  .quick-adv{display:none}
}

/* ---- v21: roles, brand repository, permission matrix ---- */
.role-chip{display:inline-block;border-radius:20px;padding:2px 10px;font-size:11px;font-weight:600;letter-spacing:.2px}
.role-super_admin{background:#ffe1e1;color:#b60000}
.role-admin{background:#e5e9ff;color:#2438b3}
.role-editor{background:#e7f6ec;color:#137a3f}
.role-viewer{background:#eee;color:#555}
.sidebar-foot .role-chip{margin:6px 0}
.mono{font-family:ui-monospace,SFMono-Regular,Menlo,monospace}
.flash-info{background:#eef4ff;color:#2438b3;border:1px solid #cfdcff}
.tag-hidden{background:#efe3ff;color:#6b2fb3;margin-left:6px}
.link-row.is-hidden{opacity:.72}
.link-row.is-hidden .short-url{text-decoration:line-through dotted}
.act-btn.hide-btn.on{color:#6b2fb3}

/* small buttons */
.btn-sm{padding:6px 12px;font-size:13px}
.btn-mini{display:inline-block;background:#fff;border:1px solid var(--line);color:var(--ink);border-radius:7px;padding:3px 9px;font-size:12px;font-weight:500;cursor:pointer;font-family:inherit}
.btn-mini.danger{color:#c22;border-color:#f0cccc}
.btn-mini:hover{border-color:var(--red)}

/* brand form */
.brand-form .form-card{max-width:820px}
.color-row{display:flex;align-items:center;gap:8px;margin-top:6px}
.color-row input[type=color]{width:46px;height:34px;padding:2px;border-radius:8px}
.repeat-rows{display:flex;flex-direction:column;gap:8px;margin-bottom:10px}
.repeat-row{display:flex;gap:8px;align-items:center}
.repeat-row.three{display:grid;grid-template-columns:1fr 1.4fr 1fr auto;gap:8px}
.palette-row{grid-template-columns:46px auto 1fr auto}
.palette-row input[type=color]{width:46px;height:34px;padding:2px}
.repeat-row input{margin:0}
.swatch{display:inline-block;width:16px;height:16px;border-radius:4px;border:1px solid rgba(0,0,0,.1);vertical-align:middle;margin-right:3px}

/* credentials */
.cred-table td{vertical-align:middle}
.cred-secret{display:inline-block;min-width:70px}
.inline-details{display:inline-block}
.inline-details summary{list-style:none}
.cred-newver{display:flex;gap:6px;margin-top:8px;flex-wrap:wrap}
.cred-newver input{width:auto;flex:1;min-width:120px}
.cred-history{padding:6px 2px}
.cred-ver{padding:2px 0;border-bottom:1px dashed var(--line)}
.add-cred{margin-top:14px}
.add-cred summary{display:inline-block;list-style:none}

/* permission matrix */
.matrix-scroll{overflow-x:auto}
.matrix-table th,.matrix-table td{padding:7px 8px;white-space:nowrap}
.matrix-table select.lvl{padding:5px 6px;font-size:13px;min-width:74px}
select.lvl-view{border-color:#8fb7ff;background:#f3f8ff}
select.lvl-edit{border-color:#7fd0a0;background:#f1fbf5}

/* ---- v22: AI fetch, brand logo, Instagram blocks, invites ---- */
.fetch-row{display:flex;align-items:center;gap:10px;margin:4px 0}
.logo-preview{margin:0 0 14px}
.logo-preview img{max-height:60px;max-width:200px;border:1px solid var(--line);border-radius:8px;padding:6px;background:#fff;object-fit:contain}

/* Instagram collapsible brand blocks */
.ig-brand-block{padding:0;overflow:hidden}
.ig-brand-block > summary{list-style:none;cursor:pointer;display:flex;align-items:center;justify-content:space-between;padding:16px 20px}
.ig-brand-block > summary::-webkit-details-marker{display:none}
.ig-brand-block > summary:hover{background:#fafafa}
.ig-brand-id{display:flex;align-items:center;gap:12px}
.ig-brand-logo{width:34px;height:34px;border-radius:8px;object-fit:contain;background:#fff;border:1px solid var(--line);padding:3px}
.brand-dot.lg{width:20px;height:20px;border-radius:6px}
.ig-brand-name{font-weight:600;font-size:16px}
.ig-brand-count{color:var(--muted);font-size:13px}
.ig-brand-block[open] > summary{border-bottom:1px solid var(--line)}
.ig-account{padding:16px 20px;border-bottom:1px solid var(--line)}
.ig-account:last-child{border-bottom:none}
.ig-stats{display:flex;align-items:center;gap:14px}
.ig-avatar{width:52px;height:52px;border-radius:50%;object-fit:cover;border:1px solid var(--line)}
.ig-stats-main{flex:1}
.ig-handle{font-weight:600}
.ig-metrics{display:flex;gap:18px;margin:3px 0;font-size:14px;color:#444}
.ig-metrics b{color:var(--ink)}
.ig-edit{margin-top:12px}
.ig-edit > summary{list-style:none;display:inline-block}
.ig-edit > summary::-webkit-details-marker{display:none}
.ig-row{margin-top:12px}

/* ===== Tasks (WOW Threads) ===== */
.sidebar nav a.nav-sub{font-size:13px;padding:6px 12px 6px 24px;color:#9a9a9a}
.sidebar nav a.nav-sub:hover{color:#fff}

.task-filters{display:flex;flex-wrap:wrap;gap:8px;margin-bottom:18px}
.chip{display:inline-flex;align-items:center;gap:7px;background:#fff;border:1px solid var(--line);border-radius:999px;padding:6px 13px;font-size:13px;font-weight:500;color:var(--ink)}
.chip:hover{border-color:#d5d5d5}
.chip.on{background:var(--black);border-color:var(--black);color:#fff}
.chip-n{background:rgba(0,0,0,.08);border-radius:999px;padding:1px 7px;font-size:11.5px}
.chip.on .chip-n{background:rgba(255,255,255,.2)}

.kanban{display:grid;grid-template-columns:repeat(4,minmax(210px,1fr));gap:14px;align-items:start}
.kb-col{background:#f0f0f1;border-radius:var(--radius);padding:10px;min-height:120px}
.kb-head{display:flex;justify-content:space-between;align-items:center;padding:2px 6px 10px}
.kb-title{font-weight:600;font-size:13px;text-transform:uppercase;letter-spacing:.4px;color:var(--muted)}
.kb-count{background:rgba(0,0,0,.08);border-radius:999px;padding:1px 8px;font-size:11.5px;font-weight:600;color:var(--muted)}
.kb-list{display:flex;flex-direction:column;gap:9px;min-height:60px}
.kb-list.drop-target{outline:2px dashed #c9c9cb;outline-offset:3px;border-radius:9px}
.kb-card{background:var(--card);border:1px solid var(--line);border-left:3px solid var(--line);border-radius:10px;padding:11px 12px;box-shadow:0 1px 2px rgba(0,0,0,.04);cursor:grab}
.kb-card:hover{border-color:#dcdcdc}
.kb-card.is-dragging{opacity:.45;cursor:grabbing}
.kb-card.is-saving{opacity:.6}
.kb-card.save-failed{border-color:var(--red);box-shadow:0 0 0 2px rgba(255,22,22,.15)}
.kb-card.prio-high{border-left-color:#f5a623}
.kb-card.prio-urgent{border-left-color:var(--red)}
.kb-card.prio-low{border-left-color:#c7c7c7}
.kb-card-title{display:block;font-weight:500;color:var(--ink);margin-bottom:7px;line-height:1.35}
.kb-card-title:hover{color:var(--red)}
.kb-card-meta{display:flex;flex-wrap:wrap;gap:6px;margin-bottom:8px}
.kb-card-foot{display:flex;justify-content:space-between;align-items:center;gap:8px}
.kb-people{display:flex;gap:-4px}
.kb-stats{display:flex;gap:8px;align-items:center}

.avatar{display:inline-flex;align-items:center;justify-content:center;width:22px;height:22px;border-radius:50%;background:var(--black);color:#fff;font-size:11px;font-weight:600;margin-right:-4px;border:2px solid #fff}
.prio-tag{font-size:11px;font-weight:600;border-radius:5px;padding:2px 7px;background:#f0f0f1;color:var(--muted)}
.prio-tag.prio-high{background:#fff3e0;color:#b26a00}
.prio-tag.prio-urgent{background:#ffe9e9;color:#c11}
.due{font-size:11.5px;color:var(--muted)}
.due.overdue{color:var(--red);font-weight:600}
.status-tag{font-size:11.5px;font-weight:600;border-radius:5px;padding:2px 8px;background:#f0f0f1;color:var(--muted)}
.status-tag.st-in_progress{background:#e8f1ff;color:#1259c3}
.status-tag.st-blocked{background:#ffe9e9;color:#c11}
.status-tag.st-done{background:#e8f7ec;color:#1a7f3c}
.status-dot{display:inline-block;width:8px;height:8px;border-radius:50%;background:#c7c7c7;margin-right:6px}
.status-dot.st-in_progress{background:#1259c3}
.status-dot.st-blocked{background:var(--red)}
.status-dot.st-done{background:#1a7f3c}

/* Thread view */
.crumb{margin-bottom:6px}
.thread-meta{display:flex;flex-wrap:wrap;gap:8px;align-items:center;margin-top:8px}
.thread-layout{display:grid;grid-template-columns:minmax(0,1fr) 300px;gap:20px;align-items:start}
.thread-side .card{padding:16px 18px}
.chat{display:flex;flex-direction:column;gap:14px;margin-bottom:16px;max-height:560px;overflow-y:auto}
.msg{display:flex;gap:10px}
.msg-body{flex:1;min-width:0}
.msg-head{display:flex;gap:8px;align-items:baseline;margin-bottom:2px}
.msg-text{white-space:pre-wrap;word-wrap:break-word}
.msg-ai .msg-text{background:#f7f5ff;border-left:2px solid #b3a4ff;padding:8px 10px;border-radius:6px}
.msg-system{padding:2px 0 2px 32px;font-style:italic}
.src-tag{font-size:10.5px;background:#f0f0f1;color:var(--muted);border-radius:4px;padding:1px 6px}

.composer{position:relative}
.composer textarea{width:100%;font-family:inherit;font-size:14px;padding:10px 12px;border:1px solid var(--line);border-radius:9px;resize:vertical}
.composer textarea:focus{outline:none;border-color:#c9c9cb}
.composer .btn{margin-top:8px}
.mention-wrap{position:relative}
.mention-menu{position:absolute;left:10px;bottom:100%;margin-bottom:4px;background:#fff;border:1px solid var(--line);border-radius:9px;box-shadow:var(--shadow);z-index:20;overflow:hidden;min-width:170px}
.mention-item{display:block;width:100%;text-align:left;background:none;border:0;padding:7px 12px;font-family:inherit;font-size:13.5px;cursor:pointer}
.mention-item:hover,.mention-item.on{background:#f4f4f5}

.subtask-list,.people-list,.todo-list{list-style:none;padding:0;margin:0 0 12px;display:flex;flex-direction:column;gap:8px}
.subtask-list li,.todo-list li{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.people-list li{display:flex;align-items:center;gap:8px}
.rel-tag{font-size:10.5px;text-transform:uppercase;letter-spacing:.3px;background:#f0f0f1;color:var(--muted);border-radius:4px;padding:1px 6px;margin-left:auto}
.rel-tag.rel-assignee{background:#e8f1ff;color:#1259c3}
.rel-tag.rel-owner{background:#f2ecff;color:#5b3ecc}

.inline-add{display:flex;gap:8px;flex-wrap:wrap;margin-top:6px}
.inline-add input[type=text],.inline-add select{flex:1;min-width:110px;padding:7px 10px;border:1px solid var(--line);border-radius:8px;font-family:inherit;font-size:13.5px}
/* A label with its control as a SIBLING, not wrapped inside it.
   .stack-form nests the input within the label, which cannot express a field
   that carries a hint line between the two - and the WOW Creators forms lean
   on those hints to explain permit states, claim windows and visibility. So
   they use `<label class="lbl" for=...>` with the control alongside.
   Typography is copied from .stack-form label on purpose: two markup idioms
   are tolerable, two different LOOKS are not.
   These shipped for two versions with no rule at all behind them, which is
   why the roster and every creator form rendered as raw HTML. */
.lbl{display:block;font-size:13px;font-weight:500;margin:14px 0 4px}
.lbl:first-child{margin-top:0}

.stack-form{display:flex;flex-direction:column;gap:10px}
.stack-form label{display:flex;flex-direction:column;gap:4px;font-size:13px;font-weight:500}
.stack-form input,.stack-form select,.stack-form textarea{padding:8px 10px;border:1px solid var(--line);border-radius:8px;font-family:inherit;font-size:14px;font-weight:400}
.two-up{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.btn-danger{color:#c22;border-color:#f0cccc}
.btn-danger:hover{background:#c22;border-color:#c22;color:#fff}

.ai-summary p{margin:0 0 8px}
.ai-sub{font-size:11.5px;text-transform:uppercase;letter-spacing:.4px;color:var(--muted);margin:10px 0 4px;font-weight:600}
.ai-summary ul{margin:0 0 8px;padding-left:18px;font-size:13.5px}
.ai-summary li{margin-bottom:3px}
.ai-subtasks{margin-top:10px}
.suggest-row{display:flex;align-items:center;gap:10px}
.suggest-out{margin-top:8px;display:flex;flex-direction:column;gap:6px}
.suggest-item{display:flex;justify-content:space-between;align-items:center;gap:10px;background:#fafafa;border:1px solid var(--line);border-radius:8px;padding:7px 10px;font-size:13.5px;color:var(--ink)}
.suggest-item:hover{border-color:#d5d5d5}

@media (max-width:1000px){
  .kanban{grid-template-columns:repeat(2,minmax(0,1fr))}
  .thread-layout{grid-template-columns:1fr}
}
@media (max-width:640px){
  .kanban{grid-template-columns:1fr}
}

/* Quick-pick date chips */
.date-presets{display:flex;flex-wrap:wrap;gap:5px;margin-top:6px}
.date-chip{background:#f4f4f5;border:1px solid var(--line);color:var(--muted);border-radius:999px;padding:3px 10px;font-size:11.5px;font-weight:600;font-family:inherit;cursor:pointer;line-height:1.5}
.date-chip:hover{border-color:#c9c9cb;color:var(--ink)}
.date-chip.on{background:var(--black);border-color:var(--black);color:#fff}
.date-chip-clear{color:#a0a0a0;border-style:dashed}
.date-chip-clear:hover{color:var(--red);border-color:#f0cccc}

/* ===== v26: details strip, collapsibles, info icons, load overview ===== */
.head-actions{display:flex;gap:8px;align-items:center}

/* Details strip - the basics, horizontal, above the fold */
.detail-strip{background:var(--card);border:1px solid var(--line);border-left:3px solid var(--brand-accent,#ccc);border-radius:var(--radius);box-shadow:var(--shadow);padding:14px 18px;margin-bottom:18px}
.ds-row{display:flex;flex-wrap:wrap;align-items:flex-start;gap:26px}
.ds-item{display:flex;flex-direction:column;gap:5px;min-width:0}
.ds-label{font-size:11px;text-transform:uppercase;letter-spacing:.4px;color:var(--muted);font-weight:600;display:flex;align-items:center;gap:5px}
.ds-value{display:flex;align-items:center;gap:6px;font-size:14px;font-weight:500}
.ds-people{gap:0}
.ds-edit{margin-left:auto;align-self:center}
.ds-edit-form{border-top:1px solid var(--line);margin-top:14px;padding-top:14px}
.ds-form{display:flex;flex-wrap:wrap;gap:14px;align-items:flex-start}
.ds-form label{display:flex;flex-direction:column;gap:4px;font-size:12px;font-weight:600;color:var(--muted)}
.ds-form input,.ds-form select{padding:7px 10px;border:1px solid var(--line);border-radius:8px;font-family:inherit;font-size:14px;font-weight:400;color:var(--ink)}
.ds-form button{align-self:flex-end}

/* Segmented status control */
.seg{display:inline-flex;border:1px solid var(--line);border-radius:9px;overflow:hidden;background:#fff}
.seg-btn{background:#fff;border:0;border-right:1px solid var(--line);padding:6px 12px;font-family:inherit;font-size:12.5px;font-weight:600;color:var(--muted);cursor:pointer;white-space:nowrap}
.seg-btn:last-child{border-right:0}
.seg-btn:hover{background:#fafafa;color:var(--ink)}
.seg-btn.on{color:#fff}
.seg-btn.on.st-open{background:#6b7280}
.seg-btn.on.st-in_progress{background:#1259c3}
.seg-btn.on.st-blocked{background:var(--red)}
.seg-btn.on.st-done{background:#1a7f3c}
.seg-status{margin-left:8px}

/* Collapsible sections */
.collapse-head{display:flex;align-items:center;gap:7px;margin-bottom:12px}
.collapsible.is-collapsed .collapse-head{margin-bottom:0}
.collapse-toggle{background:none;border:0;padding:0;font:inherit;font-size:16px;font-weight:600;color:var(--ink);cursor:pointer;display:flex;align-items:center;gap:7px}
.collapse-toggle:hover{color:var(--red)}
.chev{font-size:11px;color:var(--muted);width:10px;display:inline-block}
.stale-dot{width:7px;height:7px;border-radius:50%;background:#f5a623;display:inline-block}

/* Info icons + shared popover */
.info-i{width:15px;height:15px;border-radius:50%;border:1px solid #d5d5d5;background:#fff;color:var(--muted);font-size:10px;font-weight:700;font-family:Georgia,serif;line-height:1;cursor:pointer;padding:0;display:inline-flex;align-items:center;justify-content:center;vertical-align:middle}
.info-i:hover{border-color:var(--red);color:var(--red)}
.info-bubble{position:absolute;z-index:60;max-width:340px;background:var(--black);color:#f2f2f2;font-size:13px;line-height:1.5;padding:11px 14px;border-radius:10px;box-shadow:0 8px 28px rgba(0,0,0,.22)}

/* Kanban card: brand accent + name instead of a pill */
.kb-card{border-top:3px solid var(--brand-accent,#ddd);border-left:1px solid var(--line)}
.kb-card.prio-high,.kb-card.prio-urgent,.kb-card.prio-low{border-left:1px solid var(--line)}
.kb-brand{font-size:10.5px;font-weight:700;text-transform:uppercase;letter-spacing:.5px;color:var(--brand-accent,#888);margin-bottom:5px}
.kb-card.prio-urgent .kb-card-title{font-weight:600}

/* Attachments */
.attach-list{list-style:none;padding:0;margin:0 0 12px;display:flex;flex-direction:column;gap:7px}
.attach-list li{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.attach-ico{font-size:15px}
.attach-del{margin-left:auto}

/* Small linked lists in the rail */
.mini-list{list-style:none;padding:0;margin:0;display:flex;flex-direction:column;gap:7px}
.mini-list li{display:flex;align-items:center;gap:7px;font-size:13.5px}
.mini-list a{color:var(--ink);flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.mini-list a:hover{color:var(--red)}

/* Avatars as photos */
.avatar-img{object-fit:cover;padding:0}

/* Load overview */
.stat-row{display:grid;grid-template-columns:repeat(4,1fr);gap:14px;margin-bottom:20px}
.stat-card{background:var(--card);border:1px solid var(--line);border-radius:var(--radius);box-shadow:var(--shadow);padding:16px 18px}
.stat-n{font-size:26px;font-weight:700;line-height:1.1}
.stat-l{font-size:12px;color:var(--muted);margin-top:2px}
.stat-card.stat-bad .stat-n{color:var(--red)}
.stat-card.stat-warn .stat-n{color:#b26a00}
.load-table td{vertical-align:middle}
.load-person{display:flex;align-items:center;gap:8px;font-weight:500}
.load-bar-cell{width:28%}
.load-bar{background:#f0f0f1;border-radius:999px;height:8px;overflow:hidden;min-width:60px}
.load-bar span{display:block;height:100%;background:var(--black);border-radius:999px}
.n-bad{color:var(--red);font-weight:700}
.n-warn{color:#b26a00;font-weight:700}
.two-col{display:grid;grid-template-columns:1fr 1fr;gap:20px}

@media (max-width:1000px){
  .stat-row{grid-template-columns:repeat(2,1fr)}
  .two-col{grid-template-columns:1fr}
  .ds-row{gap:16px}
}
.avatar-field{display:flex;gap:14px;align-items:flex-start;margin-top:4px}
.avatar-field-inputs{display:flex;flex-direction:column;gap:6px;flex:1}
.avatar.avatar-lg{width:56px;height:56px;font-size:22px;margin:0;flex:none}

/* Search + archive */
.task-search{display:flex;gap:8px;align-items:center;margin-bottom:14px;flex-wrap:wrap}
.task-search input[type=search]{flex:1;min-width:220px;max-width:460px;padding:9px 13px;border:1px solid var(--line);border-radius:9px;font-family:inherit;font-size:14px;background:#fff}
.task-search input[type=search]:focus{outline:none;border-color:#c9c9cb}
.archived-banner{display:flex;align-items:center;gap:14px;flex-wrap:wrap;background:#fff8e6;border:1px solid #f0dca8;border-radius:var(--radius);padding:12px 16px;margin-bottom:16px;font-size:14px}
.archived-banner form{margin-left:auto}
.sidebar nav a.nav-brand{display:flex;align-items:center;gap:7px;font-size:12.5px;padding:5px 12px 5px 24px}
.sidebar nav a.nav-brand .brand-dot{width:7px;height:7px;flex:none}
.scope-note{margin:-4px 0 12px}

/* Rich text in updates */
.msg-text.rich{white-space:normal}
.msg-text.rich ul,.msg-text.rich ol{margin:6px 0;padding-left:22px}
.msg-text.rich li{margin-bottom:3px}
.msg-text.rich blockquote{margin:6px 0;padding:4px 12px;border-left:3px solid var(--line);color:#555}
.msg-text.rich code{background:#f4f4f5;border-radius:4px;padding:1px 5px;font-size:12.5px;font-family:ui-monospace,SFMono-Regular,Menlo,monospace}
.msg-text.rich a{word-break:break-word}
.msg-text.rich .mention{color:var(--red);font-weight:600}
.composer-foot{display:flex;align-items:center;gap:12px;flex-wrap:wrap;margin-top:8px}
.format-hint{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:11.5px}
.recur-tag{font-size:12px;font-weight:600;background:#eef4ff;color:#1259c3;border-radius:5px;padding:2px 8px}

/* Instagram performance */
.ig-actions{display:flex;gap:8px;align-items:center}
.ig-cal{display:grid;grid-template-columns:repeat(7,1fr);gap:6px;margin-bottom:10px}
.ig-cal-head{font-size:11px;text-transform:uppercase;letter-spacing:.4px;color:var(--muted);font-weight:600;text-align:center;padding-bottom:2px}
.ig-cell{min-height:74px;border:1px solid var(--line);border-radius:9px;padding:5px;background:#fafafa;display:flex;flex-direction:column;gap:4px}
.ig-cell.has-post{background:#fff}
.ig-cell.is-today{border-color:var(--red);box-shadow:0 0 0 2px rgba(255,22,22,.12)}
.ig-date{font-size:10.5px;color:var(--muted);font-weight:600}
.ig-post{position:relative;display:block;border-radius:6px;overflow:hidden;background:#eee;aspect-ratio:1/1}
.ig-post img{width:100%;height:100%;object-fit:cover;display:block}
.ig-score{position:absolute;right:2px;bottom:2px;background:rgba(0,0,0,.72);color:#fff;font-size:9.5px;font-weight:700;border-radius:4px;padding:1px 4px}
.spark{display:flex;align-items:flex-end;gap:2px;height:90px;padding:6px 0}
.spark-bar{flex:1;background:var(--black);border-radius:2px 2px 0 0;min-width:2px}
.spark-bar:hover{background:var(--red)}
.ig-rank{list-style:none;padding:0;margin:0;display:flex;flex-direction:column;gap:10px}
.ig-rank li{display:flex;align-items:center;gap:10px}
.ig-rank img{width:42px;height:42px;object-fit:cover;border-radius:7px;flex:none}
.ig-rank-body{flex:1;min-width:0;display:flex;flex-direction:column}
.ig-rank-body a{color:var(--ink);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.ig-rank-score{font-weight:700;font-variant-numeric:tabular-nums}
.ig-notes{width:100%;font-family:inherit;font-size:14px;padding:11px 13px;border:1px solid var(--line);border-radius:9px;resize:vertical;margin-bottom:10px}
@media (max-width:700px){ .ig-cell{min-height:56px} }

/* ===== v29: board at scale ===== */
/* The fix for 26 screens of scroll: each column scrolls itself, inside one
   screen, with its heading pinned. The page stops being a single tall strip. */
.kanban{align-items:stretch}
.kb-col{display:flex;flex-direction:column;max-height:calc(100vh - 250px);min-height:220px}
.kb-head{position:sticky;top:0;z-index:2;background:#f0f0f1;margin:-10px -10px 0;padding:12px 16px 10px;border-radius:var(--radius) var(--radius) 0 0}
.kb-list{overflow-y:auto;overscroll-behavior:contain;padding:10px 2px 4px;margin:0 -2px;flex:1}
.kb-list::-webkit-scrollbar{width:8px}
.kb-list::-webkit-scrollbar-thumb{background:#d3d3d5;border-radius:4px}
.kb-col-done{opacity:.82}
.kb-col-done:hover{opacity:1}
.kb-more{display:block;text-align:center;font-size:12.5px;font-weight:600;color:var(--muted);background:#fff;border:1px dashed var(--line);border-radius:9px;padding:8px}
.kb-more:hover{border-color:var(--red);color:var(--red)}
.kb-empty,.kb-nomatch{text-align:center;padding:14px 4px}

.board-bar{display:flex;justify-content:space-between;align-items:center;gap:12px;flex-wrap:wrap;margin:2px 0 12px}
.sort-picker{display:flex;align-items:center;gap:6px;color:var(--muted)}
.sort-opt{color:var(--muted);border:1px solid transparent;border-radius:7px;padding:2px 9px;font-weight:600;font-size:12.5px}
.sort-opt:hover{border-color:var(--line);color:var(--ink)}
.sort-opt.on{background:var(--black);border-color:var(--black);color:#fff}

/* Buckets */
.kb-brand{display:flex;align-items:center;gap:6px;justify-content:space-between}
.type-tag{font-size:9.5px;font-weight:700;letter-spacing:.3px;text-transform:uppercase;border-radius:4px;padding:1px 5px;background:#f0f0f1;color:var(--muted)}
.type-tag.type-content{background:#eef4ff;color:#1259c3}
.type-tag.type-admin{background:#f4efff;color:#5b3ecc}
.chip.chip-type-content.on{background:#1259c3;border-color:#1259c3}
.chip.chip-type-admin.on{background:#5b3ecc;border-color:#5b3ecc}
.kb-card.is-filtered{display:none}

/* ===== v30: denser board — the point is to see the big picture ===== */
.kb-col{padding:8px}
.kb-head{margin:-8px -8px 0;padding:9px 12px 8px}
.kb-title{font-size:11.5px}
.kb-list{gap:6px;padding:8px 2px 4px}
.kb-card{padding:7px 9px;border-radius:8px}
.kb-brand{font-size:9px;margin-bottom:3px;gap:4px}
.type-tag{font-size:8.5px;padding:0 4px}
/* One line only; the full title is in the tooltip and on the task page. */
.kb-card-title{font-size:12.5px;line-height:1.3;margin-bottom:4px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.kb-card-meta{margin-bottom:4px;gap:4px}
.prio-tag{font-size:9.5px;padding:1px 5px}
.kb-card-foot{gap:6px}
.avatar{width:17px;height:17px;font-size:9px;border-width:1.5px}
.kb-stats{gap:5px;font-size:10.5px}
.due{font-size:10.5px}
.kb-more{padding:6px;font-size:11.5px}

/* Scrollbar stays out of the way until the column actually overflows and you
   point at it - a permanent gutter on four columns is visual noise. */
.kb-list{scrollbar-width:none}
.kb-list::-webkit-scrollbar{width:0}
.kb-col:hover .kb-list{scrollbar-width:thin}
.kb-col:hover .kb-list::-webkit-scrollbar{width:7px}

/* Inner column alignment: a variable-width number makes the text beside it
   stop at a different place in each card, which is what reads as misaligned. */
.ig-rank-score{min-width:58px;text-align:right}
.dash-num{min-width:66px;text-align:right}
.load-table td.num,.load-table th.num{min-width:64px}

/* Sidebar: clickable logo, collapsible Tasks group */
.brand-home{display:block;color:var(--white)}
.brand-home:hover .brand-mark{opacity:.8}
.nav-group{display:flex;flex-direction:column}
.nav-row{display:flex;align-items:center;gap:2px}
.nav-row .nav-main{flex:1}
.nav-toggle{background:none;border:0;color:#8a8a8a;cursor:pointer;padding:6px 8px;border-radius:8px;line-height:1;font-size:11px}
.nav-toggle:hover{background:#1c1c1c;color:#fff}
.nav-group.open .nav-toggle .chev{display:inline-block;transform:rotate(90deg)}
.nav-children{display:none;flex-direction:column;gap:2px}
.nav-group.open .nav-children{display:flex}

/* Instagram: month navigation on the posting calendar */
.ig-cal-bar{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap}
.ig-cal-bar h2{margin:0}
.ig-cal-nav{display:flex;align-items:center;gap:8px}
.ig-cal-month{min-width:120px;text-align:center;font-size:13px}
.btn.is-off{opacity:.35;pointer-events:none}
.ig-cell.is-outside{background:transparent;border-color:transparent}

/* Global search */
.search-global{margin:0 0 14px}
.search-global input[type=search]{flex:1;min-width:220px}
.search-cat{margin-top:14px}
.search-cat h2{margin:0 0 10px;font-size:14px}
.search-list{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:10px}
.search-list li{display:flex;flex-direction:column;gap:2px}
.search-list li > a{font-weight:600;font-size:13px}

/* Full task title on hover (board cards) */
.kb-tip{position:absolute;z-index:60;max-width:320px;padding:7px 10px;border-radius:8px;
  background:#111;color:#fff;font-size:12px;line-height:1.4;
  box-shadow:0 6px 20px rgba(0,0,0,.28);pointer-events:none;word-wrap:break-word}

/* ---- Content calendar (v32) ---- */
.cal-layout{display:grid;grid-template-columns:minmax(0,1fr) 220px;gap:12px;align-items:start}
/* Below this the tray costs the grid more than it gives, so it moves under it. */
@media (max-width:1280px){.cal-layout{grid-template-columns:1fr}}
.cal-card{min-width:0}
.cal-empty-note{margin:6px 0 12px}

.cal-grid{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:3px;margin-top:10px}
.cal-head{font-size:10.5px;text-transform:uppercase;letter-spacing:.06em;color:#8a8a8a;text-align:center;padding:4px 0}
.cal-cell{min-height:118px;border:1px solid #ececec;border-radius:8px;padding:3px;display:flex;flex-direction:column;gap:3px;background:#fff}
.cal-cell.is-outside{background:transparent;border-color:transparent}
.cal-cell.is-past{background:#fafafa}
.cal-cell.is-today{border-color:#ff1616;box-shadow:0 0 0 1px #ff1616 inset}
.cal-cell.is-over{background:#fff4f4;border-color:#ff1616}
.cal-day{display:flex;align-items:center;justify-content:space-between;min-height:16px}
.cal-date{font-size:11px;color:#8a8a8a}
.cal-cell.is-today .cal-date{color:#ff1616;font-weight:700}
.cal-add{opacity:0;font-size:13px;line-height:1;color:#8a8a8a;text-decoration:none;padding:0 3px;border-radius:4px}
.cal-cell:hover .cal-add{opacity:1}
.cal-add:hover{background:#f0f0f0;color:#111}

.cal-item{display:flex;align-items:flex-start;gap:3px;padding:3px 4px;border-radius:5px;background:#f7f7f7;
  border-left:3px solid var(--brand-accent,#ccc);font-size:11px;line-height:1.3;color:#111;text-decoration:none;cursor:grab}
.cal-item:hover{background:#efefef}
/* A day cell is ~98px even on a wide screen, so a single ellipsised line
   turns every entry into "Cornich…". Two clamped lines fit most real titles;
   anything still cut keeps the hover tooltip. The tray is a list in a 260px
   column, so one line is right there. */
.cal-item-title{min-width:0;display:-webkit-box;-webkit-line-clamp:2;line-clamp:2;
  -webkit-box-orient:vertical;overflow:hidden;word-break:break-word}
.cal-tray-list .cal-item-title{display:block;white-space:nowrap;text-overflow:ellipsis}
.cal-item.prio-urgent{background:#ffecec}
.cal-item.prio-high{background:#fff5e8}
.cal-item.is-done{opacity:.5;text-decoration:line-through}
.cal-item.is-dragging{opacity:.4}
.cal-item.is-saving{opacity:.6}
.cal-item.is-failed{background:#ffdcdc;border-left-color:#c00}

/* Channel colour lives on the DOT, never on the element carrying the class -
   a bare .chan-instagram also matches the filter chip and painted the whole
   pill in Instagram pink with unreadable dark text on top. */
.chan-dot{width:6px;height:6px;border-radius:50%;flex:0 0 auto;margin-top:4px}
.chan-dot.chan-instagram{background:#e1306c}
.chan-dot.chan-facebook{background:#1877f2}
.chan-dot.chan-youtube{background:#ff0000}
.chan-dot.chan-blog{background:#0a8f5b}
.chan-dot.chan-newsletter{background:#8a4bff}
.chan-dot.chan-other{background:#8a8a8a}
.chip.chan::before{content:"";display:inline-block;width:7px;height:7px;border-radius:50%;margin-right:5px;vertical-align:middle}
.chip.chan-instagram::before{background:#e1306c}.chip.chan-facebook::before{background:#1877f2}
.chip.chan-youtube::before{background:#ff0000}.chip.chan-blog::before{background:#0a8f5b}
.chip.chan-newsletter::before{background:#8a4bff}.chip.chan-other::before{background:#8a8a8a}

.cal-tray h2{margin:0 0 8px;font-size:13px}
.cal-tray-list{display:flex;flex-direction:column;gap:4px;max-height:520px;overflow-y:auto}

/* ---- WOW Docs / knowledge base (v33) ---- */
.doc-list{list-style:none;margin:14px 0 0;padding:0;display:flex;flex-direction:column;gap:2px}
.doc-row{display:flex;align-items:flex-start;justify-content:space-between;gap:14px;
  padding:10px 12px;border:1px solid #ececec;border-radius:10px;background:#fff}
.doc-row:hover{border-color:#d8d8d8}
.doc-row.is-stale{border-left:3px solid #e8a33d}
.doc-row-main{display:flex;flex-direction:column;gap:3px;min-width:0}
.doc-title{font-weight:600;font-size:13.5px}
.doc-summary{display:block;max-width:70ch}
.doc-meta{display:flex;align-items:center;gap:6px;flex-wrap:wrap}
.doc-tag{color:#8a8a8a;text-decoration:none;font-size:11px}
.doc-tag:hover{color:#111;text-decoration:underline}
.chip-tag{font-weight:400}
.doc-row-side{display:flex;flex-direction:column;align-items:flex-end;gap:2px;white-space:nowrap;flex:0 0 auto}
.doc-ver{font-variant-numeric:tabular-nums}
.doc-stale{color:#b06f14}

.doc-review{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;
  margin:0 0 14px;padding:9px 12px;border-radius:10px;background:#f5f5f5;font-size:12.5px}
.doc-review.is-stale{background:#fff6e8;color:#7a4c06}
.doc-lede{font-size:14px;color:#444;margin:0 0 12px;max-width:75ch}
/* Reuses the flash palette: a retirement is the same class of "read this before
   you act" message, just permanent rather than one-shot. */
.retired-note{max-width:75ch}
.retired-note a{color:inherit;text-decoration:underline}
.retired-note .muted{color:#8a5a00;opacity:.75;display:block;margin-top:4px}
.doc-body-card{max-width:none}
.doc-rendered{font-size:14px;line-height:1.65;max-width:78ch}
.doc-rendered .rt-h{margin:22px 0 8px;line-height:1.3}
.doc-rendered h2.rt-h{font-size:18px}
.doc-rendered h3.rt-h{font-size:15.5px}
.doc-rendered h4.rt-h{font-size:14px;color:#444}
.doc-rendered > .rt-h:first-child{margin-top:0}
.doc-rendered hr{border:0;border-top:1px solid #e6e6e6;margin:20px 0}
.doc-rendered ul,.doc-rendered ol{padding-left:20px;margin:8px 0}
.doc-rendered blockquote{border-left:3px solid #e0e0e0;margin:10px 0;padding:2px 0 2px 12px;color:#555}
.doc-form textarea.doc-body{font-size:13px;line-height:1.6;min-height:420px}
.doc-links{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:6px;font-size:12.5px}
.form-actions{display:flex;gap:8px;align-items:center;margin-top:6px}
.inline-form{display:inline}
/* The base .input is width:100%, which would stack this form five rows deep. */
.bg-addform .input-sm{width:auto;min-width:0}
.bg-addform select.input-sm{max-width:210px}
.bg-addform input[name="label"]{width:170px}
.bg-unbudgeted td.bg-over{color:#c0281a}      /* beats .bg-unbudgeted td colour */
.bg-plan{border:1px solid var(--line);background:#fff;color:#555;border-radius:6px;
  padding:2px 8px;font-size:11.5px;font-weight:600;cursor:pointer;white-space:nowrap}
.bg-plan:hover{border-color:var(--ink);color:var(--ink)}
.bg-empty{margin:18px 0;padding:18px 20px;border:1px solid var(--line);border-radius:var(--radius);
  background:#fff}
.bg-empty p{margin:6px 0 12px;max-width:60ch}
.pager{display:flex;gap:6px;margin-top:14px}
.pager a{padding:3px 8px;border-radius:6px;border:1px solid #e6e6e6;text-decoration:none;color:#444}
.pager a.on{background:#111;color:#fff;border-color:#111}

/* Knowledge base: keep the tag row to a glance, not an index */
.tag-row{align-items:flex-start}
.tag-more{position:relative;display:inline-block}
.tag-more summary{cursor:pointer;list-style:none;user-select:none}
.tag-more summary::-webkit-details-marker{display:none}
.tag-more[open] summary{background:#111;color:#fff;border-color:#111}
.tag-more-panel{display:flex;flex-wrap:wrap;gap:6px;margin-top:8px;padding:10px;
  border:1px solid #ececec;border-radius:10px;background:#fafafa;max-height:230px;overflow-y:auto}

/* Repeated flash messages collapse to one row with a count */
.flash-n{opacity:.65;font-weight:600;font-size:11.5px;margin-left:4px}
.flash-muted{background:#f2f2f2;color:#666}

/* Ledger */
.outcome-form{margin-top:12px;padding-top:12px;border-top:1px solid #ececec}
.outcome-form .grid-2{gap:10px}

/* Ledger: overview strip, wider filters, sane pagination */
.ledger-overview{display:flex;flex-direction:column;gap:2px;margin:0 0 12px;padding:10px 12px;
  border-radius:10px;background:#f6f7f8}
.ledger-overview strong{font-size:15px}
.ov-sep{margin-left:8px;color:#666;font-size:12.5px}
.chip-gap{display:inline-block;width:14px}
.pager-bar{display:flex;align-items:center;justify-content:space-between;gap:14px;flex-wrap:wrap;margin-top:14px}
.pager-gap{padding:3px 4px;color:#999}
.dup-group h2{margin:0 0 4px;font-size:14px}
.dup-group{margin-top:12px}

/* ---- money register (v48) ---- */
/* The filter row mixes a search box with selects; without this the selects
   inherit the full-width form styling and stack into a column. */
.money-filters{display:flex;flex-wrap:wrap;gap:8px;align-items:center;margin-bottom:16px}
.money-filters input[type=search]{flex:1 1 260px;min-width:0;margin:0}
.money-filters select{flex:0 0 auto;width:auto;min-width:150px;margin:0}
.money-filters .btn{flex:0 0 auto}

.pos-strip{display:grid;grid-template-columns:repeat(auto-fit,minmax(190px,1fr));gap:12px;margin-bottom:18px}
.pos-card{background:var(--card);border:1px solid var(--line);border-radius:11px;padding:14px 16px}
.pos-label{font-size:11.5px;font-weight:600;letter-spacing:.4px;text-transform:uppercase;color:var(--muted)}
.pos-value{font-size:22px;font-weight:700;margin-top:4px;letter-spacing:-.5px}
.pos-value.big{font-size:28px}
.pos-value .cur{font-size:12px;font-weight:600;color:var(--muted);margin-left:5px}
.pos-value.neg{color:#c22}
.pos-sub{font-size:12px;color:var(--muted);margin-top:3px}
.table-card{padding:0;overflow-x:auto;overflow-y:hidden}
.money-table{width:100%;border-collapse:collapse;font-size:13.5px}
.money-table th{text-align:left;padding:10px 14px;background:#fafafb;border-bottom:1px solid var(--line);
  font-size:11.5px;text-transform:uppercase;letter-spacing:.3px;color:var(--muted)}
.money-table td{padding:10px 14px;border-bottom:1px solid #f0f0f2;vertical-align:top}
.money-table tr:last-child td{border-bottom:none}
.money-table .num{text-align:right;font-variant-numeric:tabular-nums}
.money-table .nowrap{white-space:nowrap}
.money-table .neg{color:#c22}
.money-table .pos{color:#137a3f}
.money-table .row-muted td{opacity:.55}

/* ---- money: month bars + collapsible groups ---- */
.month-bars{display:flex;align-items:flex-end;gap:10px;padding:4px 2px 0;overflow-x:auto}
.mb-col{flex:1 1 0;min-width:42px;text-align:center}
.mb-stack{height:96px;display:flex;align-items:flex-end;justify-content:center;gap:3px}
.mb-in,.mb-out{width:12px;border-radius:3px 3px 0 0;min-height:2px}
.mb-in{background:#3ea06a}
.mb-out{background:#e4674f}
.mb-label{font-size:11px;color:var(--muted);margin-top:6px;font-weight:600}
.mb-net{font-size:10.5px;font-variant-numeric:tabular-nums}
.mb-net.neg{color:#c22}
.mb-net.pos{color:#137a3f}

tr.month-row td{background:#f6f6f7;padding:0;border-bottom:1px solid var(--line)}
.month-toggle{display:flex;align-items:center;gap:9px;width:100%;padding:9px 14px;background:none;
  border:0;cursor:pointer;font-family:inherit;font-size:13.5px;text-align:left;color:var(--ink)}
.month-toggle:hover{background:#eeeef0}
.month-toggle .chev{color:var(--muted);font-size:11px;transition:transform .15s}
tr.month-row.open .month-toggle .chev{transform:rotate(90deg)}
.month-sum{margin-left:auto;display:flex;gap:14px;align-items:baseline;font-variant-numeric:tabular-nums}
.month-sum .pos{color:#137a3f}
.month-sum .neg{color:#c22}
.month-net{font-weight:700}

/* ---- money: inline edit + note icon ---- */
select.inline-edit{width:100%;min-width:110px;max-width:170px;padding:3px 6px;font-size:12px;
  border:1px solid transparent;border-radius:6px;background:transparent;color:var(--ink);
  cursor:pointer;font-family:inherit}
select.inline-edit:hover{border-color:var(--line);background:#fff}
select.inline-edit:focus{border-color:var(--red);background:#fff;outline:none}
select.inline-edit.saved{border-color:#3ea06a;background:#eafaf0}
select.inline-edit.failed{border-color:#c22;background:#ffecec}
select.inline-edit:disabled{opacity:.6}
.orig-cat{font-size:10.5px;margin-top:2px;opacity:.6}

.note-btn{background:none;border:0;cursor:pointer;padding:0 2px;font-size:12px;line-height:1;
  opacity:.85;filter:grayscale(.15)}
.note-btn.empty{opacity:.18;filter:grayscale(1)}
.note-btn:hover{opacity:1;filter:none}
.note-body{margin-top:5px;padding:7px 9px;background:#fffbe8;border:1px solid #f0e4b8;
  border-radius:7px;font-size:12.5px;color:#5a4a10;max-width:60ch}

/* ---- money: category chart + upcoming ---- */
.cat-panels{display:grid;grid-template-columns:1fr 1fr;gap:14px;align-items:start}
.panel-total{float:right;font-size:15px;font-weight:700;font-variant-numeric:tabular-nums}
.panel-total.neg{color:#c22}
.panel-total.pos{color:#137a3f}
.cat-chart{display:flex;flex-direction:column;gap:7px;margin-top:4px}
.cat-row{display:grid;grid-template-columns:118px 1fr 92px;align-items:center;gap:10px}
.cat-name{font-size:12.5px;color:var(--ink);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.cat-track{background:#f1f1f3;border-radius:5px;height:15px;overflow:hidden}
.cat-bar{height:100%;border-radius:5px;min-width:2px}
.cat-bar.out{background:#e4674f}
.cat-bar.in{background:#3ea06a}
/* Committed money is hatched, so a plan is never mistaken for a fact. */
.cat-bar.planned{background:repeating-linear-gradient(45deg,#e9a23b,#e9a23b 5px,#f0bd6d 5px,#f0bd6d 10px)}
.cat-val{font-size:12px;text-align:right;font-variant-numeric:tabular-nums}
.cat-val.neg{color:#c22}
.cat-val.pos{color:#137a3f}

/* ---------------------------------------------------------------- mobile ---
   The admin is desk-first by design: the board's drag, the calendar's drag and
   a 1,100-row ledger are not phone work and are deliberately left alone. What
   IS phone work is reading, and editing a bio page on location - so the
   sidebar stops eating the screen, and the bio editor gets a real pass. */

.sidebar-top{display:flex;align-items:center;justify-content:space-between;gap:10px}
.nav-burger{display:none;background:none;border:0;cursor:pointer;padding:8px;border-radius:8px}
.nav-burger span{display:block;width:20px;height:2px;background:#fff;border-radius:2px;margin:4px 0}
.nav-burger:hover{background:#1c1c1c}

@media (max-width: 860px){
  /* One fixed 230px column left 145px of usable width on a phone - the single
     thing that made every admin page unusable, rather than any one screen. */
  .app{flex-direction:column}
  .sidebar{position:sticky;top:0;width:auto;height:auto;padding:10px 14px;z-index:60;
           flex-direction:column;gap:8px}
  .sidebar nav,.sidebar .sidebar-foot,.sidebar .sidebar-build{display:none}
  .sidebar.open nav{display:flex;flex-direction:column;gap:2px;margin-top:6px}
  .sidebar.open .sidebar-foot{display:flex;margin-top:8px;border-top:1px solid #2a2a2a;padding-top:14px}
  .sidebar.open .sidebar-build{display:block}
  .nav-burger{display:block}
  .main{padding:16px 14px;max-width:none}
  .page-head{flex-direction:column;align-items:flex-start;gap:10px}
  .head-actions{flex-wrap:wrap}

  /* iOS zooms the whole page when a focused input is under 16px. On a form you
     fill standing in a shop, that reflow is worse than the smaller type. */
  input,select,textarea{font-size:16px}

  table{display:block;overflow-x:auto}
  .table-card{overflow-x:auto}
  .cat-panels{grid-template-columns:1fr}
  .cat-row{grid-template-columns:96px 1fr 80px;gap:7px}
  .month-sum{margin-left:0;flex-wrap:wrap;gap:8px;font-size:12px}
  .month-toggle{flex-wrap:wrap}
  .pos-value{font-size:19px}
  .pos-value.big{font-size:23px}
  canvas{max-width:100%}

  /* The ledger's own mobile pass is deliberately out of scope, but its seven
     sort options in one non-wrapping row scrolled the page sideways. */
  .sort-picker{flex-wrap:wrap}
  .sort-opt{padding:4px 10px}
}

@media (max-width: 860px){
  /* Bio editor: the live preview is a phone frame shown ON a phone. Above the
     editor it is something to scroll past on every visit, so it moves below. */
  .bio-editor-layout{grid-template-columns:1fr;gap:16px}
  .bio-editor-preview{position:static;order:2}
  .bio-editor-main{order:1}
  .editor-savebar{top:52px}
}

@media (max-width: 700px){
  /* Instagram mapping is the on-location job: match a post to an article URL,
     over and over. A square thumbnail per post makes 24 posts ~9,600px of
     scrolling; a 64px thumb beside the field makes it about a quarter of that
     and keeps the caption and input on the same screen as the image. */
  .feed-grid-admin{grid-template-columns:1fr;gap:10px}
  .feed-admin-tile{display:grid;grid-template-columns:64px minmax(0,1fr);
    column-gap:10px;row-gap:4px;align-items:start;padding:10px 12px;
    grid-template-areas:"thumb cap" "thumb input" "thumb link"}
  .fa-thumb{grid-area:thumb;width:64px;aspect-ratio:1;margin:0}
  .fa-cap{grid-area:cap;height:auto;max-height:34px}
  .feed-admin-tile input{grid-area:input;margin-bottom:0;min-height:40px}
  .feed-admin-tile a{grid-area:link;justify-self:start}

  /* Save stays reachable from any tile rather than 24 tiles below the one
     being edited. */
  .feed-save{position:sticky;bottom:0;background:var(--bg);padding:10px 0;margin:0;
    border-top:1px solid var(--line);z-index:4}
  .feed-save .btn{width:100%}

  .color-grid{grid-template-columns:1fr}
  .blk-actions{flex-wrap:wrap}
  /* Comfortable targets for the block move/delete controls. */
  .blk-move,.blk-del,.btn-mini{min-width:36px;min-height:36px}
}

/* Budget and payee pages -------------------------------------------------- */
.pill{display:inline-block;background:#f1f1f3;border-radius:20px;padding:1px 9px;font-size:11px;
      font-weight:600;color:#555;white-space:nowrap;vertical-align:middle}
.pill-warn{background:#fde9e9;color:#a11}
.pill-book{background:#eef4ff;color:#2438b3}
/* A submit button that has to sit inside a table row next to real links. It is
   a button because it posts (and carries CSRF), not an <a>. */
.linkish{background:none;border:0;padding:0;margin:0 0 0 8px;font:inherit;font-size:inherit;
         color:var(--link,#0a58ca);cursor:pointer;text-decoration:underline}
.linkish:hover{color:#c22}
.file-list{list-style:none;padding:0;margin:0 0 12px}
.file-list li{display:flex;align-items:center;gap:10px;padding:5px 0;border-bottom:1px solid #f0f0f2}
.file-list li:last-child{border-bottom:0}

/* Money sub-nav and counts ------------------------------------------------ */
.money-nav{display:flex;flex-wrap:wrap;gap:4px;margin:0 0 16px;border-bottom:1px solid #ececef;padding-bottom:8px}
.money-nav a{padding:5px 12px;border-radius:7px;font-size:13.5px;font-weight:600;color:#555;text-decoration:none}
.money-nav a:hover{background:#f4f4f6;color:var(--ink)}
.money-nav a.on{background:var(--accent,#e8442e);color:#fff}
.nav-count{display:inline-block;min-width:17px;padding:0 5px;border-radius:9px;background:#e8442e;color:#fff;
           font-size:10.5px;font-weight:700;line-height:16px;text-align:center;vertical-align:middle}
.money-nav a.on .nav-count{background:rgba(255,255,255,.28)}
.nav-sub .nav-count{background:#e8442e}
.chip{display:inline-block;padding:4px 11px;border-radius:20px;border:1px solid #e2e2e6;background:#fff;
      font-size:12.5px;font-weight:600;color:#555;text-decoration:none}
.chip:hover{border-color:#cfcfd4}
.chip.on{background:var(--ink,#222);color:#fff;border-color:var(--ink,#222)}
.chip.on .nav-count{background:rgba(255,255,255,.28)}

/* Money: the three forecast panels --------------------------------------- */
.chart-row{display:grid;grid-template-columns:repeat(auto-fit,minmax(260px,1fr));gap:14px;margin-bottom:14px}
.chart-card{padding:16px 18px}
.chart-card h3{margin:0 0 12px;font-size:14.5px}
.stack{display:flex;height:20px;border-radius:6px;overflow:hidden;background:#f1f1f3}
.stack-seg{height:100%}
.stack-seg.spent{background:#d9503c}
.stack-seg.todo{background:repeating-linear-gradient(45deg,#e8a33d,#e8a33d 6px,#f0b962 6px,#f0b962 12px)}
.stack-key{display:flex;flex-wrap:wrap;gap:14px;margin-top:9px;font-size:12.5px;color:#555}
.stack-key i.k{display:inline-block;width:10px;height:10px;border-radius:3px;margin-right:5px;vertical-align:-1px}
.stack-key i.k.spent{background:#d9503c}
.stack-key i.k.todo{background:#e8a33d}
/* How far through the month you are - context for "spent so far". */
.month-progress{height:3px;background:#ececef;border-radius:2px;margin-top:10px}
.month-progress div{height:100%;background:#bcbcc4;border-radius:2px}
.ytd-strip{display:flex;flex-wrap:wrap;align-items:baseline;gap:16px;padding:10px 16px;margin-bottom:14px;
           background:#fafafb;border:1px solid #ececef;border-radius:9px;font-size:13px}

/* Money: master-detail split --------------------------------------------- */
/* minmax(0,1fr) so a wide table shrinks the column instead of overflowing it. */
.money-split{display:grid;grid-template-columns:minmax(0,1fr) 340px;gap:16px;align-items:start}
.money-main{min-width:0}
.money-side{position:sticky;top:16px}
.money-side-card{padding:16px 18px}
.money-side-card h2{margin-top:0;font-size:15px}
.money-side-card .grid-2{grid-template-columns:1fr 1fr;gap:10px}
.money-side-card label{font-size:12.5px}
tr.picked td{background:#fff6f4;box-shadow:inset 3px 0 0 var(--accent,#e8442e)}
@media (max-width:1080px){
  .money-split{grid-template-columns:minmax(0,1fr)}
  .money-side{position:static}
}

/* Modals ------------------------------------------------------------------ */
dialog.dlg{border:0;padding:0;background:transparent;max-width:min(560px,94vw);width:100%}
dialog.dlg::backdrop{background:rgba(20,20,24,.45)}
.dlg-card{background:#fff;border-radius:12px;padding:20px 22px;box-shadow:0 18px 50px rgba(0,0,0,.22);
            max-height:88vh;overflow-y:auto}
.dlg-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px}
.dlg-head h2{margin:0 0 4px;font-size:16px}
.dlg-x{font-size:26px;line-height:1;color:#999;text-decoration:none;padding:0 4px}
.dlg-x:hover{color:#c22}
/* showModal() centres the dialog itself, so do not fight it with a margin.
   The 18px form is only for the no-JS fallback, where the server renders
   `open` and the dialog sits inline instead of floating. */
dialog.dlg[open]{display:block;margin:auto}
dialog.dlg[open]:not(:modal){margin:18px auto}
.cat-child{padding-left:6px}
.inline-lbl{display:inline-flex;align-items:center;gap:6px;font-size:12.5px;color:#555}
.inline-lbl input,.inline-lbl select{margin:0}

/* A pinned last column ---------------------------------------------------- */
/* The budget table is wider than its card, so the actions column scrolled out
   of reach - edit and remove were unreachable at any window size. Sticky keeps
   it against the right edge while the rest of the row scrolls under it. */
.money-table .col-pin{position:sticky;right:0;background:#fff;z-index:2}
.money-table thead .col-pin{background:#fafafb}
/* A soft edge so the pinned cell reads as floating above the scrolled content
   only while there IS something scrolled under it. */
.money-table .col-pin::before{content:"";position:absolute;left:-10px;top:0;bottom:0;width:10px;
  background:linear-gradient(to right,rgba(0,0,0,0),rgba(0,0,0,.06));pointer-events:none}
.money-table tr:hover .col-pin{background:#fbfbfc}

/* Liquid-vs-committed bar ------------------------------------------------- */
.cover-bar{margin:0 0 14px;padding:12px 16px;background:#fafafb;border:1px solid #ececef;border-radius:9px}
.cover-row{display:grid;grid-template-columns:80px minmax(0,1fr) 110px;align-items:center;gap:12px;margin:5px 0}
.cover-key{font-size:12px;color:var(--muted)}
.cover-track{background:#eeeef1;border-radius:5px;height:14px;overflow:hidden}
.cover-fill{height:100%;border-radius:5px}
.cover-fill.in{background:#2f9e5f}
.cover-fill.out{background:#d9503c}
.cover-val{text-align:right;font-size:12.5px;font-weight:600;font-variant-numeric:tabular-nums}
@media (max-width:640px){ .cover-row{grid-template-columns:64px minmax(0,1fr) 88px;gap:8px} }
.payee-jump{display:inline-block;margin-top:5px;font-size:12px;font-weight:600}
/* A small jump beside an inline select: edit in place, or go and look. */
.row-jump{display:inline-block;margin-left:5px;font-size:13px;color:var(--muted);text-decoration:none}
.row-jump:hover{color:var(--accent,#e8442e)}
/* Card utilisation, shown where the limit is stated. */
.use-track{height:5px;background:#eeeef1;border-radius:3px;margin-top:8px;overflow:hidden}
.use-fill{height:100%;background:#e8a33d;border-radius:3px}
.use-fill.hot{background:#d9503c}

/* Row title doubles as the edit control, so no separate "edit" link is needed. */
.row-title{font-weight:600;color:var(--ink);text-decoration:none;border-bottom:1px dashed transparent}
.row-title:hover{color:var(--accent,#e8442e);border-bottom-color:currentColor}
.icon-btn{background:none;border:0;padding:2px 4px;font-size:15px;line-height:1;cursor:pointer;
  color:var(--muted);border-radius:5px}
.icon-btn:hover{background:#f4f4f6}
.icon-btn.danger:hover{background:#fdeceb;color:#c22}
/* A projected occurrence is a forecast, not a debt - shown lighter. */
.row-projected td{opacity:.62}
.row-projected .row-title{font-weight:500}
.pill-soft{background:#eef2f7;color:#5a6b80}
.panel-note{float:right;margin-right:12px;font-weight:400}
/* Avatar: the initial sits underneath, the image on top. If the image 404s its
   onerror removes it and the letter shows through, rather than a broken icon. */
.avatar-stack{position:relative;overflow:hidden}
.avatar-stack img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;border-radius:inherit}
.cover-fill.biz{background:#2f6fd0}
.cover-fill.unk{background:#bdb7b5}
.tag-file{background:#e7f0fb;color:#2f6fd0;font-weight:700}
/* Dashboard: the morning brief sits above everything else. */
.brief-card{padding:18px 20px;margin-bottom:18px}
.brief-card h2{margin:0 0 14px;font-size:16px}
.brief-body{margin-top:14px;padding-top:14px;border-top:1px solid var(--line);font-size:14.5px;line-height:1.6}
.brief-body h1,.brief-body h2,.brief-body h3{font-size:14.5px;margin:14px 0 4px}
.brief-body ul{margin:4px 0 4px 18px;padding:0}
.or-file{margin:14px 0;padding:14px 16px;border:1px dashed var(--rule-strong,#cfc4c1);border-radius:8px;position:relative}
.or-rule{position:absolute;top:-9px;left:14px;background:#fff;padding:0 8px;font-size:11px;
  font-weight:700;letter-spacing:.12em;text-transform:uppercase;color:var(--muted)}
/* Today: who is late */
.who-block{padding:12px 15px;border-bottom:1px solid var(--line)}
.who-block:last-child{border-bottom:0}
.who-head{display:flex;align-items:center;gap:9px;flex-wrap:wrap}
.who-list{list-style:none;margin:8px 0 0 30px;padding:0}
.who-list li{padding:3px 0;display:flex;gap:8px;align-items:baseline;flex-wrap:wrap}
/* Collapsed tiles on Today / Dashboard */
.collapse-head{display:flex;align-items:center;gap:9px;flex-wrap:wrap;margin:0}
.collapse-toggle{background:none;border:0;padding:0;cursor:pointer;font:inherit;color:inherit}
.collapse-toggle .chev{display:inline-block;transition:transform .12s ease;color:var(--muted)}
.collapsible:not(.is-collapsed) .collapse-toggle .chev{transform:rotate(90deg)}
.collapsible.is-collapsed .collapse-body{display:none}
/* The hand-off to a Claude routine: WOWLNK cannot start one, so it hands over
   the exact instruction instead of implying a button that works. */
.routine-box{margin-top:16px;padding:14px 16px;background:var(--surface-2,#f3eeec);border-radius:8px}
.routine-box h3{margin:0 0 6px;font-size:14px}
.routine-cmd{display:flex;gap:10px;align-items:center;flex-wrap:wrap;margin-top:8px}
.routine-cmd code{background:#fff;border:1px solid var(--line);border-radius:6px;padding:6px 10px;
  font-size:12.5px;flex:1 1 260px;word-break:break-word}
.row-income td{background:#f4faf6}
.row-income .row-title{color:#137a3f}

/* Reference numbers. The journal list showed no id at all, so an entry could be
   read but not cited - "journal 82" meant nothing on screen. Fixed width so the
   titles still line up as the numbers grow. */
.jrnl-ref{display:inline-block;min-width:3.2em;opacity:.55}
.flow-code{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:.72rem;
           letter-spacing:-.01em;opacity:.6;white-space:nowrap}
.flow-code .gap{opacity:.4}

/* Money flow (Sankey). Hand-rolled SVG - no chart library, so nothing to load
   and nothing to break when a CDN changes. */
.flow-wrap{overflow-x:auto}
.flow-svg{width:100%;min-width:760px;height:auto;display:block}
.flow-rib{fill:currentColor;opacity:.22;transition:opacity .12s}
.flow-rib:hover{opacity:.5}
.flow-rib.in{color:#1a9c6b}
.flow-rib.out{color:#d3453b}
.flow-node{fill:#444}
.flow-node.c0{fill:#1a9c6b}
.flow-node.c1{fill:#2a2a2a}
.flow-node.c2{fill:#d3453b}
.flow-lbl{font-size:11px;fill:#333;font-family:inherit}
.flow-lbl.mid{font-size:11px;font-weight:600}
.flow-val{fill:#8a8a8a;font-size:10px}
@media (prefers-color-scheme:dark){
  .flow-node.c1{fill:#ddd}
  .flow-lbl{fill:#ddd}
}
.flow-pills{display:flex;flex-wrap:wrap;gap:6px;align-items:center;margin:0 0 14px}
.pill{display:inline-flex;align-items:center;gap:5px;padding:4px 11px;border-radius:999px;
      border:1px solid var(--line,#e3e3e3);font-size:.8rem;text-decoration:none;color:inherit;background:transparent}
.pill:hover{border-color:#999}
.pill.on{background:#1a1a1a;color:#fff;border-color:#1a1a1a}
.pill.on .nav-count{background:rgba(255,255,255,.22);color:#fff}
.pill-empty{opacity:.45}
.flow-hit{fill:transparent;pointer-events:all;cursor:default}
@media (prefers-color-scheme:dark){ .pill.on{background:#eee;color:#111;border-color:#eee} }
/* Struck off: proposed for deletion, still counted. The line through it is the
   whole signal - it must read as "someone thinks this is wrong", not as gone. */
.struck{text-decoration:line-through;text-decoration-thickness:1.5px;opacity:.7}
tr.row-struck td{background:rgba(211,69,59,.05)}
.btn.danger{color:#d3453b;border-color:rgba(211,69,59,.4)}
.btn.danger:hover{background:rgba(211,69,59,.08)}
/* Tutorial screenshots. Bordered so a screenshot of a white UI is not
   indistinguishable from the page it is sitting on. */
.rt-img{display:block;max-width:100%;height:auto;margin:14px 0;border:1px solid var(--line,#e3e3e3);
        border-radius:6px;box-shadow:0 1px 3px rgba(0,0,0,.06)}
.doc-drift{border-left:3px solid #e0a800;background:rgba(224,168,0,.06);padding:10px 14px;
           border-radius:0 6px 6px 0;margin:0 0 16px}
/* Brief sections. Collapsed by default; the peek is what makes that bearable -
   a header with no preview is just a hidden section. */
.rt-section{border-top:1px solid var(--line,#ececec);padding:2px 0}
.rt-section:first-child{border-top:0}
.rt-section .collapse-head{margin:0}
.rt-section .collapse-toggle{display:flex;align-items:baseline;gap:7px;width:100%;text-align:left;
  background:none;border:0;padding:9px 2px;cursor:pointer;font:inherit;font-weight:600;font-size:.82rem;
  letter-spacing:.02em;color:inherit}
.rt-section .collapse-toggle:hover{opacity:.75}
.rt-section .rt-peek{margin-left:auto;font-weight:400;font-size:.76rem;opacity:.55;
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:55%}
.rt-section.is-collapsed .rt-peek{opacity:.7}
.rt-section:not(.is-collapsed) .rt-peek{display:none}
.rt-section .collapse-body{padding:0 2px 10px}
.rt-section .collapse-body .rt-h{display:none}
.brief-src{margin:12px 0 0;padding-top:10px;border-top:1px solid var(--line,#ececec)}
/* How much to trust a row. Colour carries the meaning at a glance: a bank line
   is evidence, a sweep entry is somebody's account of events. */

.tag.tier-bank{background:rgba(26,156,107,.13);color:#127750}
.tag.tier-platform{background:rgba(26,110,156,.13);color:#12607f}
.tag.tier-document{background:rgba(224,168,0,.15);color:#8a6a00}
.tag.tier-estimate{background:rgba(211,69,59,.12);color:#a8362e}
/* Next-month plan. The basis tag is the point: a stated obligation and a
   six-month average are both useful and are not the same kind of fact. */
.plan-table .plan-group th{background:var(--soft,#f6f6f6);border-top:1px solid var(--line,#e3e3e3);
  font-size:.78rem;letter-spacing:.04em;text-transform:uppercase;padding-top:10px}
.plan-table .plan-line{padding-left:4px}
.tag.basis-committed{background:rgba(26,156,107,.13);color:#127750}
.tag.basis-observed{background:rgba(224,168,0,.15);color:#8a6a00}
.tag.basis-none{background:rgba(211,69,59,.12);color:#a8362e}

/* ---------------------------------------------------------- budget grid
   Month -> group -> payee. Groups are <details> so the page opens as a short
   list of headings; empty groups stay shut and dimmed rather than vanishing,
   because a missing heading reads as "nothing here" when the truth is
   "nothing yet". */
.bg-monthbar{display:flex;gap:6px;margin:14px 0 4px;flex-wrap:wrap}
.bg-monthbar a{display:inline-block;padding:4px 11px;border-radius:20px;border:1px solid #e2e2e6;
  background:#fff;font-size:12.5px;font-weight:600;color:#555;text-decoration:none}
.bg-monthbar a:hover{border-color:#cfcfd4}
.bg-monthbar a.on{background:var(--ink,#222);color:#fff;border-color:var(--ink,#222)}
.bg-over{color:#c0281a}
.bg-under{color:var(--muted)}
.bg-section{margin:22px 0}
.bg-section-head{display:flex;align-items:baseline;justify-content:space-between;gap:16px;
  padding-bottom:8px;border-bottom:2px solid var(--ink,#222)}
.bg-section-head h2{margin:0;font-size:16px}
.bg-nums{display:flex;gap:6px;align-items:baseline;font-variant-numeric:tabular-nums;font-size:13px}
.bg-nums strong{min-width:84px;text-align:right;display:inline-block;font-size:14px}
.bg-colhead{display:flex;justify-content:flex-end;gap:10px;padding:6px 4px 0;font-size:11px;
  color:var(--muted);text-transform:uppercase;letter-spacing:.04em}
.bg-colhead span{min-width:84px;text-align:right}
.bg-group{border-bottom:1px solid var(--line)}
.bg-group[data-empty="1"] summary{opacity:.4}
.bg-group>summary{display:flex;align-items:center;gap:12px;padding:10px 4px;cursor:pointer;list-style:none}
.bg-group>summary::-webkit-details-marker{display:none}
.bg-group>summary::before{content:'\25B8';color:var(--muted);font-size:11px;width:10px;flex:0 0 10px}
.bg-group[open]>summary::before{content:'\25BE'}
.bg-gname{font-weight:600;margin-right:auto}   /* pushes the numbers right */
.bg-gnums{display:flex;gap:10px;font-variant-numeric:tabular-nums;font-size:13px}
.bg-gnums span{min-width:84px;text-align:right}
.bg-table{width:100%;border-collapse:collapse;margin:0 0 14px 22px;font-size:13px}
.bg-table th{font-weight:500;color:var(--muted);text-align:left;padding:6px 8px;
  border-bottom:1px solid var(--line);font-size:11px;text-transform:uppercase;letter-spacing:.04em}
.bg-table td{padding:7px 8px;border-bottom:1px solid #f4f4f6}
.bg-table .r,.bg-table th.r{text-align:right;font-variant-numeric:tabular-nums}
.bg-unbudgeted td{background:#fbfbfc;color:#555}
.bg-dot{display:inline-block;width:6px;height:6px;border-radius:50%;background:#c0281a;
  margin-right:7px;vertical-align:middle}
.bg-add td{background:transparent;border-bottom:none;padding-top:10px}
.bg-addform{display:flex;gap:6px;flex-wrap:wrap;align-items:center}
.bg-addform .input-sm{padding:4px 8px;font-size:13px;border:1px solid #e2e2e6;border-radius:7px}
.bg-addform .input-sm.r{width:96px;text-align:right}
.inline-form{display:inline}
/* The base .input is width:100%, which would stack this form five rows deep. */
.bg-addform .input-sm{width:auto;min-width:0}
.bg-addform select.input-sm{max-width:210px}
.bg-addform input[name="label"]{width:170px}
.bg-unbudgeted td.bg-over{color:#c0281a}      /* beats .bg-unbudgeted td colour */
.bg-plan{border:1px solid var(--line);background:#fff;color:#555;border-radius:6px;
  padding:2px 8px;font-size:11.5px;font-weight:600;cursor:pointer;white-space:nowrap}
.bg-plan:hover{border-color:var(--ink);color:var(--ink)}
.bg-empty{margin:18px 0;padding:18px 20px;border:1px solid var(--line);border-radius:var(--radius);
  background:#fff}
.bg-empty p{margin:6px 0 12px;max-width:60ch}

/* A rolled-up payee row opens to show the charges behind it. One figure you
   cannot break down is a figure you cannot check. */
.bg-charges{display:inline-block;vertical-align:middle}
.bg-charges>summary{display:inline-block;padding:1px 8px;border-radius:6px;border:1px solid var(--line);
  background:#fff;font-size:11px;color:#666;cursor:pointer;list-style:none}
.bg-charges>summary::-webkit-details-marker{display:none}
.bg-charges>summary::after{content:' \25BE'}
.bg-charges[open]>summary::after{content:' \25B4'}
.bg-charges a{display:flex;gap:12px;padding:3px 8px;font-size:12px;text-decoration:none;color:inherit;
  border-bottom:1px solid #f4f4f6}
.bg-charges a:hover{background:#fafafb}
.bg-charges a span:nth-child(1){min-width:44px}
.bg-charges a span:nth-child(2){min-width:74px;text-align:right;font-variant-numeric:tabular-nums}

/* An account's own notes, shown above its numbers - they are usually a warning
   about how the account behaves, and that must be read first. */
.acct-notes{margin:14px 0}
.acct-notes h2{margin:0 0 6px;font-size:12px;text-transform:uppercase;letter-spacing:.04em}
.acct-notes p{margin:0 0 8px;font-size:13.5px;line-height:1.65}

/* Four-band flow: the column headings, and the middle band drawn differently
   from money entering or leaving - reshuffling is not spend and must not read
   like it. */
.flow-bandlbl text{font-size:11px;fill:#8a8a90;text-transform:uppercase;letter-spacing:.05em}
.flow-rib.move{fill:#7f77dd;opacity:.30}
.flow-rib.stay{fill:#b4b2a9;opacity:.22}
.flow-rib.move:hover,.flow-rib.stay:hover{opacity:.55}

/* v109: a task's number, "#307", wherever the task is listed. Muted and
   tabular so it reads as an identifier, not part of the title. */
.task-ref { font-variant-numeric: tabular-nums; font-weight: 500; color: var(--muted, #8a8a8a);
            font-size: .82em; letter-spacing: .01em; margin-right: .25em; white-space: nowrap; }
h1 .task-ref { font-size: .6em; vertical-align: middle; }

/* v110: filters on the task list. Labelled selects in one wrapping row; each
   label sits above its control so eight filters stay scannable on a phone. */
.tasks-filters{display:flex;flex-wrap:wrap;gap:10px 12px;align-items:flex-end;margin-bottom:8px}
.tasks-filters .tf{display:flex;flex-direction:column;gap:4px;margin:0;flex:0 1 auto}
.tasks-filters .tf > span{font-size:11.5px;font-weight:600;letter-spacing:.3px;text-transform:uppercase;color:var(--muted)}
.tasks-filters select,.tasks-filters input[type=date]{margin:0;width:auto;min-width:130px}
.tasks-filters .tf-actions{flex-direction:row;gap:6px}
.tasks-count{margin:0 0 14px}
.todo-who{margin-left:auto;white-space:nowrap}
@media (max-width:640px){.tasks-filters .tf{flex:1 1 45%}.tasks-filters select,.tasks-filters input[type=date]{width:100%;min-width:0}}
.tasks-filters .tf-range{display:flex;align-items:center;gap:6px}
@media (max-width:640px){.tasks-filters .tf-range input{flex:1 1 0}}

/* ===== v112: the three pages that were unusable on a phone ================
   Measured at 375px: the board overflowed the viewport by 70px, the task
   filters' date range by 50px, and on Links the row's six 30px action buttons
   and 52px thumbnail are both flex-shrink:0 - leaving ~130px for the content,
   which is why the URL, the date and the title each wrapped a word per line. */
@media (max-width:640px){
  /* --- Links ------------------------------------------------------------ */
  /* The filter bar did not wrap, so the text field collapsed to a sliver and
     every select clipped its own label ("An…", "Ne…"). */
  .filters{flex-wrap:wrap}
  .filters input[type=text]{flex:1 1 100%}
  .filters select{flex:1 1 calc(50% - 5px);max-width:none;min-width:0}
  .filters .btn,.filters button{flex:0 0 auto}

  /* Actions move to their own row, so the content gets the full width back
     instead of competing with six buttons that refuse to shrink. */
  .link-row{display:grid;grid-template-columns:44px minmax(0,1fr);
            grid-template-areas:"thumb main" "actions actions";
            column-gap:10px;row-gap:8px;align-items:start;padding:12px 8px}
  .thumb-cell{grid-area:thumb;width:44px}
  .link-row .link-main{grid-area:main;min-width:0}
  .row-actions{grid-area:actions;justify-content:flex-end;gap:4px;flex-wrap:wrap}
  .dest-row{flex-wrap:wrap}
  /* A timestamp broken across four lines is not a timestamp. */
  .meta-row .muted.small{white-space:nowrap}
  .meta-row .link-title{flex:1 1 100%;min-width:0;white-space:nowrap;
                        overflow:hidden;text-overflow:ellipsis}

  /* --- The board -------------------------------------------------------- */
  /* `1fr` is minmax(auto,1fr), and `auto` will not shrink below the content's
     min-content width - so one long card title pushed the whole column past
     the screen. minmax(0,1fr) lets it shrink; the card then has to be allowed
     to wrap, or it just overflows its own column instead. */
  .kanban{grid-template-columns:minmax(0,1fr)}
  .kb-col,.kb-list,.kb-card{min-width:0}
  .kb-card-title{overflow-wrap:anywhere}
  /* Each column scrolling inside itself is right on a desktop and wrong on a
     phone: it makes four tiny windows inside one long page. Let them grow and
     let the page do the scrolling. */
  .kb-col{max-height:none}
  .kb-list{overflow-y:visible;max-height:none}
  .kb-head{position:static}

  /* --- The task list ---------------------------------------------------- */
  /* Two date inputs and the word "and" need the full width; sharing a row
     with another filter forced them 50px past the screen edge. */
  .tasks-filters .tf{min-width:0}
  .tasks-filters .tf-wide{flex:1 1 100%}
  .tasks-filters .tf-range input{flex:1 1 0;min-width:0;width:auto}
}

/* ===== v114: the newsletter (Sendy) ======================================
   The sub-nav borrows .money-nav's look; .nl-out pushes "Open Sendy" right.
   The preview frame is a sandboxed iframe, so its height is fixed here - it
   cannot report its own content height back without scripts, which the
   sandbox exists to stop. */
.nl-nav .nl-out{margin-left:auto;color:var(--muted);font-weight:500}
.nl-h2{font-size:16px;margin:26px 0 10px}
.nl-sub{margin-top:4px;display:flex;flex-wrap:wrap;gap:6px;align-items:center}
.nl-table td{vertical-align:middle}
.nl-state,.nl-sub-state{display:inline-block;font-size:11.5px;font-weight:600;border-radius:5px;padding:2px 8px;background:#f0f0f1;color:var(--muted)}
.nl-state.nl-sent,.nl-sub-state.nl-active{background:#e8f7ec;color:#1a7f3c}
.nl-state.nl-sending,.nl-state.nl-scheduled{background:#e8f1ff;color:#1259c3}
.nl-state.nl-bad,.nl-sub-state.nl-bounced,.nl-sub-state.nl-complained{background:#ffe9e9;color:#c11}
.nl-sub-state.nl-unsubscribed,.nl-sub-state.nl-unconfirmed{background:#fff6e6;color:#8a5a00}
.nl-minus{font-size:16px;color:var(--muted);font-weight:600}
.nl-meta{display:flex;flex-direction:column;gap:6px;font-size:14px}
.nl-meta .muted{display:inline-block;min-width:92px}
.nl-grid{margin-bottom:20px}
.nl-grid .card{margin-bottom:0}
.nl-bad td{color:#c11;font-weight:600}
.nl-card-h{padding:18px 22px 0}
.nl-pad{padding:0 22px 18px}
.nl-link{max-width:520px;overflow-wrap:anywhere}
.nl-preview{width:100%;height:640px;border:1px solid var(--line);border-radius:9px;background:#fff}
.nl-form{max-width:none}
.nl-compose{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:16px;align-items:start}
.nl-compose .nl-preview{height:520px}
.nl-html{font-size:12.5px;line-height:1.5;min-height:520px}
.nl-preview-label{margin-bottom:6px;font-weight:500}
.nl-details{margin:0 0 16px}
.nl-details summary{cursor:pointer;margin-bottom:8px}
.nl-fieldset{border:1px solid var(--line);border-radius:9px;padding:12px 16px 4px;margin:0 0 16px}
.nl-fieldset legend{font-weight:600;font-size:14px;padding:0 6px}
.nl-fieldset .checkbox{margin-bottom:10px;font-weight:400}
.nl-lists{display:grid;grid-template-columns:repeat(auto-fill,minmax(240px,1fr));gap:0 16px}
.nl-when{margin:0 0 10px 26px}
.nl-confirm{margin-left:26px}
.nl-preflight ul{margin:8px 0;padding-left:20px}
.nl-code{background:#f6f6f7;border:1px solid var(--line);border-radius:9px;padding:12px 14px;font-size:12.5px;overflow-x:auto}
@media (max-width:860px){
  .nl-compose{grid-template-columns:minmax(0,1fr)}
  .nl-preview,.nl-compose .nl-preview{height:440px}
  .nl-html{min-height:280px}
  .nl-when,.nl-confirm{margin-left:0}
  .nl-nav .nl-out{margin-left:0}
}

/* ---- Wholesale (v115) ---- */
.ws-nav{margin-top:-6px}
.ws-h2{font-size:16px;margin:22px 0 10px}
.ws-filters{display:flex;flex-wrap:wrap;gap:8px;align-items:center;margin:0 0 16px}
.ws-filters select,.ws-filters input[type=search],.ws-filters input[type=date]{width:auto;min-width:150px}
.ws-filters label{display:flex;gap:6px;align-items:center}
.ws-inline{display:flex;flex-wrap:wrap;gap:10px;align-items:center;margin:4px 0}
.ws-inline input[type=file]{width:auto;padding:6px}
.ws-fields{display:flex;flex-wrap:wrap;gap:14px;margin-bottom:12px}
.ws-fields label{font-size:13px;font-weight:500}
.ws-fields input,.ws-fields select{margin-top:4px;width:auto}
.ws-grid td,.ws-grid th{white-space:nowrap}
.ws-grid td:first-child{white-space:normal;min-width:220px}
.ws-flag-low{color:var(--red);font-weight:700}
.ws-flag-none{display:inline-block;margin-left:4px;font-size:10.5px;background:#fff6e6;color:#8a5a00;border-radius:4px;padding:0 5px}
.ws-cost{background:#fbf6f6}
.stat-card.ws-cost{background:#fbf6f6}
.ws-st{font-size:11.5px;font-weight:600;border-radius:5px;padding:2px 8px;background:#f0f0f1;color:var(--muted)}
.ws-st-issued{background:#e8f7ec;color:#1a7f3c}
.ws-st-cancelled{background:#ffe9e9;color:#c11;text-decoration:line-through}
.ws-st-superseded{background:#f1f1f1;color:#666}
.ws-st-draft{background:#fff6e6;color:#8a5a00}
.ws-lines td{vertical-align:middle}
.ws-qty{width:80px;text-align:right}
.ws-price{width:100px;text-align:right}
.ws-reason{width:140px;padding:6px 8px}
.ws-rowfilter{max-width:260px;margin:4px 0 10px}
.ws-actions{display:flex;flex-wrap:wrap;gap:10px;align-items:center}
.ws-actions form{margin:0}
.ws-actions input[name=reason]{flex:1;min-width:220px;width:auto}
.ws-todo form + form{border-top:1px solid var(--line);padding-top:8px}
.ws-codes{white-space:pre-wrap;max-height:180px;overflow:auto;background:#f6f6f7;border-radius:8px;padding:8px;margin-top:6px}
.ws-down{color:var(--red)}
.ws-pad{padding:0 12px 10px}
/* v116: photos */
.ws-thumb-cell{width:52px;padding-right:0}
.ws-thumb{display:block;width:44px;height:44px;object-fit:cover;border-radius:6px;border:1px solid var(--line);background:#f6f6f7}
.ws-thumb-sm{width:30px;height:30px;object-fit:cover;border-radius:5px;border:1px solid var(--line);flex:0 0 auto}
.ws-with-thumb{display:flex;align-items:center;gap:8px}
.ws-photo{display:block;width:120px;height:120px;object-fit:cover;border-radius:9px;border:1px solid var(--line);margin-bottom:8px}
.ws-photo-lg{display:block;max-width:100%;width:320px;max-height:320px;object-fit:contain;border-radius:12px;border:1px solid var(--line);background:#fff}
.ws-hero{margin:0 0 18px}
.ws-photo-field{margin-bottom:16px}
@media (max-width:860px){
  .ws-filters select,.ws-filters input[type=search]{flex:1 1 45%;min-width:0}
  .ws-grid td:first-child{min-width:160px}
  .ws-actions input[name=reason]{min-width:0;width:100%}
}

/* ---- Wholesale camera page (v117) - built for a phone held in one hand ---- */
.ws-cam-count{display:inline-block;min-width:28px;text-align:center;font-size:14px;background:var(--red);color:#fff;border-radius:999px;padding:2px 9px;vertical-align:middle}
.ws-cam-help{max-width:640px}
.ws-cam-filter{max-width:420px;width:100%}
.ws-cam{width:100%;border-collapse:separate;border-spacing:0 8px}
.ws-cam-row td{background:var(--card);border-top:1px solid var(--line);border-bottom:1px solid var(--line);padding:10px;vertical-align:middle}
.ws-cam-row td:first-child{border-left:1px solid var(--line);border-radius:var(--radius) 0 0 var(--radius)}
.ws-cam-row td:last-child{border-right:1px solid var(--line);border-radius:0 var(--radius) var(--radius) 0}
.ws-cam-img{width:64px}
.ws-cam-img .ws-thumb{width:56px;height:56px}
.ws-cam-ph{display:flex;align-items:center;justify-content:center;width:56px;height:56px;border-radius:8px;background:#f2f2f4;color:var(--muted);font-size:10px;text-align:center}
.ws-cam-act{width:1%;white-space:nowrap;text-align:right}
.ws-cam-btn{position:relative;overflow:hidden;padding:12px 16px;font-size:15px}
.ws-cam-btn.is-busy{opacity:.55;pointer-events:none}
.ws-cam-input{position:absolute;inset:0;opacity:0;width:100%;height:100%;cursor:pointer}
.ws-cam-msg{min-height:1em;margin-top:2px}
.ws-cam-label{pointer-events:none}
.ws-cam-ok{color:#1a7f3c;font-weight:600}
.ws-cam-err{color:var(--red);font-weight:600}
.ws-cam-row.is-done td{background:#f3fbf5}
@media (max-width:860px){
  .ws-cam-row td{padding:8px}
  .ws-cam-btn{padding:14px 14px;font-size:16px}
  .ws-cam-txt{font-size:14px}
}
/* v118: paste a web address on the camera page (admins) */
.ws-cam-web{display:flex;gap:6px;margin-top:6px}
.ws-cam-web input{flex:1;min-width:0;padding:7px 9px;font-size:13px}
@media (max-width:860px){.ws-cam-web input{font-size:16px}}
/* v120: print options on a document */
.ws-print-opts{display:flex;align-items:center;gap:12px;margin:0}
.ws-print-opts .checkbox{font-size:13px;font-weight:500;margin:0}

/* ===================================================== v125: navigation ===
   Grouped sidebar with icons, a collapsible icon rail, a jump-to palette
   (Ctrl/Cmd K or "/"), and in-page tabs that scroll instead of wrapping.
   The data is nav_tree() in helpers.php; this is only how it looks. */
.sidebar{width:244px;padding:18px 12px 12px;background:#0b0b0c;gap:0;transition:width .18s ease}
.sidebar-top{padding:0 6px}
.nav-icon-btn{display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;padding:0;border:0;
  border-radius:8px;background:none;color:#8d8d8d;cursor:pointer;flex:none}
.nav-icon-btn:hover{background:#1b1b1e;color:#fff}
.nav-search-ico{display:none}
.nav-jump{display:flex;align-items:center;gap:10px;width:100%;margin:16px 0 6px;padding:8px 10px;border:1px solid #232327;
  border-radius:9px;background:#141416;color:#8d8d8d;font:inherit;font-size:13.5px;cursor:pointer;text-align:left}
.nav-jump:hover{border-color:#34343a;color:#ddd}
.nav-jump .nav-label{flex:1}
.nav-kbd{font:600 10.5px/1 ui-monospace,SFMono-Regular,Menlo,monospace;color:#77777d;border:1px solid #2c2c31;border-radius:5px;padding:3px 5px}
.sidebar nav{margin-top:4px;gap:0;overflow-y:auto;overflow-x:hidden;min-height:0;scrollbar-width:thin;scrollbar-color:#2a2a2e transparent;
  margin-right:-6px;padding-right:6px}
.nav-sec{display:flex;flex-direction:column;gap:1px;padding:6px 0}
.nav-sec-h{font-size:10.5px;font-weight:600;letter-spacing:.09em;text-transform:uppercase;color:#5d5d63;padding:8px 10px 4px}
.sidebar nav a.nav-a{position:relative;display:flex;align-items:center;gap:11px;padding:7px 10px;border-radius:9px;
  color:#c4c4c8;font-weight:500;font-size:14px;line-height:20px}
.nav-label{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-width:0}
.sidebar nav a.nav-a .ni{color:#7c7c83;flex:none;transition:color .12s}
.sidebar nav a.nav-a:hover{background:#18181b;color:#fff}
.sidebar nav a.nav-a:hover .ni{color:#d6d6da}
.sidebar nav a.nav-a.on{background:#1e1e22;color:#fff}
.sidebar nav a.nav-a.on .ni{color:var(--red)}
.sidebar nav a.nav-a.on::before{content:"";position:absolute;left:-12px;top:7px;bottom:7px;width:3px;border-radius:0 3px 3px 0;background:var(--red)}
.nav-dot{width:6px;height:6px;border-radius:50%;background:#ff3b3b;margin-left:auto;flex:none}
.nav-group.open .nav-dot{display:none}
.nav-row{gap:0}
.nav-toggle{width:28px;height:28px;display:inline-flex;align-items:center;justify-content:center;padding:0;color:#6d6d73}
.nav-toggle .ni{width:14px;height:14px;transition:transform .15s ease}
.nav-group.open .nav-toggle .ni{transform:rotate(90deg)}
.nav-children{position:relative;margin:2px 0 6px 20px;padding-left:10px;border-left:1px solid #26262a;gap:1px}
.sidebar nav a.nav-sub{display:flex;align-items:center;gap:8px;padding:5px 8px;border-radius:7px;font-size:13px;line-height:18px;color:#93939a}
.sidebar nav a.nav-sub:hover{background:#17171a;color:#fff}
.sidebar nav a.nav-sub.on{color:#fff;font-weight:600;background:#1b1b1f}
.sidebar nav a.nav-sub.on::before{content:"";position:absolute;left:-1px;width:2px;height:18px;background:var(--red);border-radius:2px}
.sidebar nav a.nav-sub .nav-count{margin-left:auto}
.sidebar nav a.nav-brand{padding:5px 8px;font-size:12.5px}
.nav-sub-h{font-size:9.5px;font-weight:700;letter-spacing:.09em;text-transform:uppercase;color:#55555b;padding:8px 8px 2px}
.nav-sub-h:first-child{padding-top:2px}
.sidebar-foot{margin-top:6px;padding:10px 4px 0;border-top:1px solid #1f1f23;gap:6px;align-items:stretch}
.nav-me{display:flex;align-items:center;gap:10px}
.nav-avatar{width:30px;height:30px;border-radius:50%;background:var(--red);color:#fff;font-weight:700;font-size:13px;
  display:inline-flex;align-items:center;justify-content:center;flex:none}
.nav-me-text{display:flex;flex-direction:column;align-items:flex-start;min-width:0;flex:1;gap:2px}
.nav-me-name{color:#e6e6e8;font-size:13px;font-weight:600;max-width:120px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.sidebar-foot .role-chip{margin:0;font-size:10px;padding:1px 8px}
.sidebar-foot a.nav-out{color:#8d8d8d}
.sidebar-build{margin-top:2px;padding:0 0 2px;font-size:10.5px;color:#4f4f55}
:focus-visible{outline:2px solid #4c7dff;outline-offset:2px}

/* Icon rail: desktop only, remembered (html.nav-rail is set before paint). */
@media (min-width:861px){
  html.nav-rail .sidebar{width:68px;padding:16px 10px 10px}
  html.nav-rail .nav-label,html.nav-rail .nav-sec-h,html.nav-rail .nav-toggle,html.nav-rail .nav-children,
  html.nav-rail .nav-kbd,html.nav-rail .brand-home{display:none!important}
  html.nav-rail .sidebar-top{justify-content:center;padding:0}
  html.nav-rail .nav-rail-btn .ni{transform:scaleX(-1)}
  html.nav-rail .nav-jump{justify-content:center;padding:8px 0}
  html.nav-rail .sidebar nav{margin-right:0;padding-right:0}
  html.nav-rail .nav-sec+.nav-sec{border-top:1px solid #1f1f23}
  html.nav-rail .sidebar nav a.nav-a{justify-content:center;padding:9px 0}
  html.nav-rail .sidebar nav a.nav-a.on::before{left:-10px}
  html.nav-rail .nav-dot{position:absolute;top:6px;right:9px;display:block!important}
  html.nav-rail .nav-me{flex-direction:column;gap:6px}
}

/* In-page tabs (money, wholesale, newsletter): one row that scrolls sideways
   on a phone instead of wrapping into a block. */
.subnav{display:flex;flex-wrap:nowrap;align-items:flex-end;gap:2px;margin:0 0 18px;padding:0;border-bottom:1px solid #e6e6ea;
  overflow-x:auto;scrollbar-width:none;-webkit-overflow-scrolling:touch}
.subnav::-webkit-scrollbar{display:none}
.subnav a{flex:none;padding:9px 10px 10px;margin-bottom:-1px;border-radius:0;border-bottom:2px solid transparent;
  font-size:13.5px;font-weight:600;color:#6a6a70;white-space:nowrap}
.subnav a:hover{background:none;color:var(--ink);border-bottom-color:#d6d6db}
.subnav a.on{background:none;color:var(--ink);border-bottom-color:var(--red)}
.subnav a.on .nav-count{background:#e8442e}
.subnav-g{display:flex;align-items:flex-end;gap:2px;flex:none}
.subnav-g+.subnav-g{margin-left:6px;padding-left:8px;position:relative}
.subnav-g+.subnav-g::before{content:"";position:absolute;left:0;top:10px;bottom:12px;width:1px;background:#e2e2e6}
.subnav-gl{font-size:10px;font-weight:700;letter-spacing:.08em;text-transform:uppercase;color:#a3a3a9;padding:0 4px 13px 2px}
.subnav .nl-out{border-bottom:0}

/* Jump-to palette */
.jump-ov{position:fixed;inset:0;z-index:300;background:rgba(12,12,14,.42);backdrop-filter:blur(2px);
  display:flex;align-items:flex-start;justify-content:center;padding:11vh 16px 16px}
.jump{width:min(620px,100%);background:#fff;border-radius:14px;box-shadow:0 24px 70px rgba(0,0,0,.28);overflow:hidden;
  display:flex;flex-direction:column;max-height:76vh}
.jump-in{display:flex;align-items:center;gap:10px;padding:0 16px;border-bottom:1px solid #eee;color:#999}
.jump-in input{flex:1;border:0;outline:0;font:inherit;font-size:16px;padding:16px 0;color:var(--ink);background:none}
.jump-list{overflow-y:auto;padding:6px;margin:0;list-style:none}
.jump-list li{display:flex;align-items:center;gap:10px;padding:9px 12px;border-radius:9px;cursor:pointer;font-size:14px}
.jump-list li .jc{margin-left:auto;font-size:12px;color:#9a9aa0;white-space:nowrap}
.jump-list li .ji{color:#b0b0b6;display:inline-flex}
.jump-list li.sel{background:#f3f3f5}
.jump-list li.sel .ji{color:var(--red)}
.jump-list mark{background:none;color:var(--red);font-weight:600}
.jump-empty{padding:16px;color:#999;font-size:13.5px}
.jump-foot{display:flex;gap:14px;padding:8px 16px;border-top:1px solid #f0f0f2;font-size:11.5px;color:#a0a0a6}
.jump-foot kbd{font:600 10.5px ui-monospace,Menlo,monospace;border:1px solid #e3e3e7;border-radius:4px;padding:1px 4px;color:#777}

@media (max-width:860px){
  .sidebar{width:auto;padding:10px 14px;max-height:100vh;overflow-y:auto}
  .sidebar.open{height:100vh}
  .sidebar.open nav{gap:0;margin-right:0;padding-right:0}
  .nav-jump,.nav-rail-btn{display:none}
  .nav-search-ico{display:inline-flex;margin-left:auto}
  .sidebar-top{padding:0}
  .sidebar nav a.nav-a.on::before{left:-14px}
  .jump-ov{padding-top:8vh}
}

/* ---- v126: single-link badge, Needs you, team desk, phone bottom bar ---- */
.sidebar nav a.nav-a .nav-count{margin-left:auto}
.nav-dot.nav-rail-only{display:none}

.needs-list{display:flex;flex-direction:column;gap:10px;max-width:760px}
.needs-item{display:flex;align-items:center;gap:16px;padding:14px 18px;text-decoration:none;color:var(--ink);margin:0;
  transition:box-shadow .15s,transform .15s}
.needs-item:hover{box-shadow:0 4px 18px rgba(0,0,0,.08);transform:translateY(-1px)}
.needs-n{flex:none;min-width:44px;height:44px;padding:0 10px;border-radius:12px;background:#fdeceb;color:#c8321f;
  font-weight:700;font-size:18px;display:flex;align-items:center;justify-content:center}
.needs-t{display:flex;flex-direction:column;gap:2px;min-width:0}
.needs-go{margin-left:auto;color:#b5b5bb;font-size:18px}
.needs-clear{max-width:760px}

.desk-amount{display:flex;gap:8px}
.desk-amount input{flex:1;min-width:0}
.desk-amount select{width:auto}
.desk-newpayee{margin-top:6px}
.desk-dl{display:grid;grid-template-columns:max-content 1fr;gap:8px 18px;margin:0}
.desk-dl dt{color:#8a8a90;font-size:13px}
.desk-dl dd{margin:0}
.row-held td{background:#fffaf0}
.desk-sub{display:none}
.flash-target{animation:wlPulse 1.6s ease 2}
@keyframes wlPulse{0%,100%{box-shadow:0 0 0 0 rgba(232,68,46,0)}50%{box-shadow:0 0 0 4px rgba(232,68,46,.28)}}

.bottombar{display:none}
@media (max-width:860px){
  .bottombar{display:flex;position:fixed;left:0;right:0;bottom:0;z-index:200;background:rgba(255,255,255,.97);
    backdrop-filter:blur(8px);border-top:1px solid #ececef;padding:4px 4px calc(4px + env(safe-area-inset-bottom))}
  .bb-a{flex:1;display:flex;flex-direction:column;align-items:center;gap:2px;padding:6px 2px;border:0;background:none;
    color:#6b6b72;font:inherit;font-size:10.5px;text-decoration:none;border-radius:10px;cursor:pointer;min-width:0}
  .bb-a.on{color:var(--red)}
  .bb-a:active{background:#f3f3f5}
  .bb-i{position:relative;display:inline-flex}
  .bb-i .ni{width:22px;height:22px}
  .bb-n{position:absolute;top:-5px;left:14px;min-width:16px;height:16px;padding:0 4px;border-radius:8px;background:#e8442e;
    color:#fff;font-size:10px;font-weight:700;line-height:16px;text-align:center}
  .bb-l{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%}
  .main{padding-bottom:calc(76px + env(safe-area-inset-bottom))}
  body:has(.sidebar.open) .bottombar{display:none}
  .desk-table th:nth-child(3),.desk-table td:nth-child(3),.desk-table th:nth-child(4),.desk-table td:nth-child(4){display:none}
  .desk-table .desk-sub{display:block;margin-top:3px}
  .desk-table td{padding-left:8px;padding-right:8px}
}
@media print{.bottombar{display:none!important}}
.money-filters input[type=month]{flex:0 0 auto;width:auto;margin:0}

/* ---- v127: pins, undo toast, keyboard shortcuts, sticky table headings ---- */
.nav-pins .nav-pin .nav-label{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.nav-pins[hidden]{display:none}
.wl-toast{position:fixed;left:50%;bottom:22px;transform:translateX(-50%);z-index:320;display:flex;align-items:center;gap:12px;
  max-width:min(560px,calc(100vw - 32px));background:#141414;color:#fff;border-radius:11px;padding:10px 10px 10px 16px;
  box-shadow:0 12px 36px rgba(0,0,0,.28);font-size:13.5px}
.wl-toast[hidden]{display:none}
.wl-toast-t{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.wl-toast-u{border:0;background:#fff;color:#141414;font:inherit;font-weight:600;border-radius:8px;padding:6px 10px;cursor:pointer;white-space:nowrap}
.wl-toast-u kbd{font:600 10px ui-monospace,Menlo,monospace;color:#888;margin-left:4px}
.wl-toast-x{border:0;background:none;color:inherit;opacity:.6;font-size:20px;line-height:1;cursor:pointer;padding:2px 6px}
.wl-toast-x:hover{opacity:1}
.key-cursor{outline:2px solid var(--accent,#e8442e);outline-offset:-2px}
tr.key-cursor td{background:#fff6f4}
.wl-keys-ov{position:fixed;inset:0;z-index:310;background:rgba(12,12,14,.42);display:flex;align-items:flex-start;justify-content:center;padding:12vh 16px 16px}
.wl-keys{width:min(640px,100%);background:#fff;border-radius:14px;box-shadow:0 24px 70px rgba(0,0,0,.28);padding:16px 20px 18px}
.wl-keys-h{display:flex;align-items:center;justify-content:space-between;margin-bottom:10px}
.wl-keys .wl-toast-x{color:#141414}
.wl-keys-cols{display:grid;grid-template-columns:1fr 1fr;gap:4px 28px}
.wl-keys td{padding:5px 0;font-size:13px;vertical-align:top}
.wl-keys td:first-child{white-space:nowrap;padding-right:14px;color:#555}
.wl-keys kbd{font:600 11px ui-monospace,Menlo,monospace;border:1px solid #e3e3e7;border-bottom-width:2px;border-radius:5px;padding:1px 5px;background:#fafafb}
@media (min-width:861px){
  .main thead th{position:sticky;top:0;z-index:3;background:var(--card)}
  .main .money-table thead th{background:#fafafb}
  .sticky-ok{overflow:visible!important}
  /* The table-card's rounded top was clipped by its overflow; keep it now. */
  .table-card.sticky-ok thead th:first-child{border-top-left-radius:var(--radius)}
  .table-card.sticky-ok thead th:last-child{border-top-right-radius:var(--radius)}
}
@media (max-width:860px){
  .wl-toast{bottom:calc(74px + env(safe-area-inset-bottom))}
  .wl-keys-cols{grid-template-columns:1fr}
}
@media print{.wl-toast,.wl-keys-ov{display:none!important}}

/* v128 - Purchasing */
.pill.pill-bad{background:#fde8e8;color:#b42318}
.table td.bad{color:#b42318}
.pur-bank{white-space:pre-wrap;font-family:inherit;background:var(--card,#fff);border:1px solid #e7e7ea;border-radius:8px;padding:10px 12px;margin:0 0 8px}
@media (min-width:861px){.ws-lines input[list]{min-width:12em}}
/* v129: on a phone the receipt/order/bill line tables fit: narrow number boxes, item box takes the rest */
@media (max-width:860px){.ws-lines input.ws-qty,.ws-lines input.ws-price{width:4.6em;min-width:0}.ws-lines input[list]{width:100%;min-width:6.5em}.ws-lines td,.ws-lines th{padding-left:4px;padding-right:4px}}
/* ===================================================== v130: clients ===
   WOW Media clients and their monthly deliverables. */
.cl-bar{height:7px;background:#f0eeec;border-radius:4px;overflow:hidden;min-width:90px}
.cl-bar i{display:block;height:100%;background:var(--accent,#ee3b1e);border-radius:4px}
.cl-st{display:inline-block;font-size:11.5px;font-weight:600;border-radius:999px;padding:2px 9px;white-space:nowrap}
.cl-st-done{background:#e6f4ec;color:#1e8e5a}.cl-st-part{background:#fff2dc;color:#b26a00}.cl-st-pend{background:#f0f0f2;color:#8a8a93}
.cl-st-bonus{background:#eaedff;color:#3d5afe}.cl-st-cov{background:#e3f4f5;color:#0e7c86}.cl-st-removed{background:#f5f5f5;color:#999;text-decoration:line-through}
.cl-chan{margin:22px 0 8px;font-size:15px}
.cl-removed td{opacity:.55}
.cl-entries{margin:4px 0 0;padding:0;list-style:none;font-size:12.5px}
.cl-entries li{display:flex;gap:6px;align-items:center;flex-wrap:wrap}
.cl-entries a{word-break:break-all}
.cl-entries li.cl-planned{opacity:.85}
.cl-entries .cl-task{font-weight:600;color:inherit}
.cl-qty{width:4.2em}
.cl-done-form{display:flex;gap:6px;flex-wrap:wrap;margin-top:6px}
.cl-done-form input[type=url],.cl-done-form input[type=text]{flex:1 1 220px;min-width:0}
.cl-panel{margin-top:22px}
.cl-diff-missing td:first-child{border-left:3px solid #3d5afe}
.cl-diff-qty td:first-child{border-left:3px solid #b26a00}
.cl-diff-extra td:first-child{border-left:3px solid #c11}
.cl-log{font-size:12.5px;line-height:1.7}
.cl-head-meta{display:flex;gap:10px;flex-wrap:wrap;align-items:center}
/* v191: Sections on the client page, before a report over several months opens */
.clp-sec{margin-top:10px}
.clp-sec summary{cursor:pointer;display:list-item;width:max-content;max-width:100%}
.clp-sec summary b{font-weight:600}
.clp-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:4px 14px}
.clp-grid label{display:flex;align-items:center;gap:7px;margin:0;font-weight:400;cursor:pointer}
.clp-grid input[type=checkbox]{width:auto;margin:0;flex:none}
@media (max-width:700px){.clp-grid{grid-template-columns:1fr 1fr}}
@media (max-width:420px){.clp-grid{grid-template-columns:1fr}}
.stat-card .cl-stat-text{font-size:17px;line-height:1.3}
.cl-nowrap{white-space:nowrap}
@media (max-width:860px){.cl-done-form input{flex-basis:100%}.cl-hide-sm{display:none}}

/* ---- Content planner (v132) ---- */
.pl-warn{background:#fff7e6;border:1px solid #f3d9a4;border-radius:10px;padding:10px 14px;margin-bottom:14px;font-size:13.5px;line-height:1.6}
.pl-cov{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:10px}
.pl-cov-card{display:flex;flex-direction:column;gap:2px;background:#fff;border:1px solid var(--line);border-radius:12px;padding:12px 14px;color:var(--ink);text-decoration:none}
.pl-cov-card:hover{border-color:#cfcfcf}
.pl-cov-card.on{box-shadow:0 0 0 2px var(--ink) inset}
.pl-cov-card.is-quiet{background:#fff1f1;border-color:#f4b4b4}
.pl-cov-card.is-quiet .pl-cov-big{color:#c11}
.pl-cov-site{display:flex;align-items:center;gap:6px;font-weight:600;font-size:13.5px}
.pl-cov-big{font-size:22px;font-weight:700;line-height:1.2}
.pl-cov-note{margin:6px 0 14px}
.pl-legend{display:flex;flex-wrap:wrap;gap:4px 8px;align-items:center;color:var(--muted)}
.pl-n{display:inline-block;min-width:16px;text-align:center;font-size:10.5px;font-weight:700;line-height:15px;border-radius:999px;padding:0 4px}
.pl-published{background:#e6f4ec;color:#1e8e5a}
.pl-updated{background:#e8efff;color:#2f55d4}
.pl-draft{background:#f0f0f2;color:#6f6f78}
.pl-planned{background:#fff2dc;color:#a35f00}
.pl-overdue{background:#ffe3e3;color:#c11}
.pl-cell{text-decoration:none;color:var(--ink);min-height:96px}
.pl-cell:hover{border-color:#cfcfcf}
.pl-wd{display:none}
.pl-row{display:flex;align-items:center;gap:3px;flex-wrap:wrap;font-size:10.5px;line-height:1.4}
.pl-site{color:#555;margin-right:1px}
.pl-day{display:grid;grid-template-columns:repeat(auto-fit,minmax(250px,1fr));gap:12px;align-items:start}
.pl-col{margin-bottom:0;padding:14px 16px;min-width:0}
.pl-col.is-empty{background:#fff8f8;border-color:#f4c9c9}
.pl-col-head{display:flex;align-items:center;gap:7px;font-size:16px;margin:0 0 8px}
.pl-col-note{color:#a35f00;margin:0 0 6px}
.pl-nothing{color:#c11;font-weight:500;margin:4px 0}
.pl-sec{font-size:12px;text-transform:uppercase;letter-spacing:.05em;margin:12px 0 4px;color:#555}
.pl-sec-published{color:#1e8e5a}.pl-sec-updated{color:#2f55d4}.pl-sec-unpublished{color:#c11}.pl-sec-planned{color:#a35f00}
.pl-list{list-style:none;margin:0;padding:0;font-size:13.5px;line-height:1.45}
.pl-list li{padding:5px 0;border-bottom:1px solid #f2f2f2;word-break:break-word}
.pl-list li:last-child{border-bottom:none}
.pl-type{display:inline-block;font-size:10.5px;font-weight:600;color:#666;background:#f2f2f4;border-radius:4px;padding:0 5px;margin-right:2px}
.pl-state{display:inline-block;font-size:10.5px;font-weight:700;border-radius:999px;padding:0 7px;margin-right:3px}
.pl-state-done{background:#e6f4ec;color:#1e8e5a}.pl-state-pending{background:#fff2dc;color:#a35f00}
.pl-state-overdue{background:#ffe3e3;color:#c11}.pl-state-scheduled{background:#e8efff;color:#2f55d4}
/* A phone cannot fit seven columns of site rows: the month becomes a list of days. */
@media (max-width:700px){
  .pl-grid{grid-template-columns:1fr;gap:6px}
  .pl-grid .cal-head,.pl-grid .is-outside{display:none}
  .pl-cell{min-height:0}
  .pl-wd{display:inline}
}
/* v133: Instagram on the planner */
.pl-igc{background:#fde7f0;color:#c1306b}
.pl-ig{display:inline-flex;align-items:center;gap:1px;color:#e1306c;text-decoration:none;vertical-align:-2px;margin-left:3px}
.pl-ig:hover{color:#a3164b}
.pl-ig-n{font-size:11px;font-weight:700}
.pl-sec-ig{color:#c1306b}
.pl-igpost .pl-ig{margin:0 3px 0 0}
.pl-promo{font-size:12.5px;margin:3px 0 0 18px}
.pl-promo-sugg{color:#a35f00}
.pl-decide{display:inline}
.pl-decide .btn{padding:2px 8px;font-size:12px;margin-left:4px}
/* v135: Sendy emails on the planner */
.pl-emc{background:#efe7ff;color:#6a3fd1}
.pl-mail{display:inline-flex;align-items:center;gap:1px;color:#6a3fd1;vertical-align:-2px;margin-left:3px}
.pl-email .pl-mail{margin:0 3px 0 0}
.pl-sec-mail{color:#6a3fd1}
.pl-banner{display:flex;align-items:center;gap:8px}
.pl-banner img{width:84px;max-height:48px;object-fit:cover;border-radius:4px;border:1px solid var(--line);flex:0 0 auto}
/* v136: WhatsApp on the planner */
.pl-wac{background:#e3f6ea;color:#128c4a}
.pl-wa{display:inline-flex;align-items:center;gap:1px;color:#128c4a;vertical-align:-2px;margin-left:3px}
.pl-waitem .pl-wa{margin:0 3px 0 0}
.pl-sec-wa{color:#128c4a}
.pl-wa-body{display:inline;font-size:13.5px}
.pl-wa-body summary{display:inline;cursor:pointer}
.pl-wa-text{margin:6px 0 2px 18px;padding:8px 10px;background:#f4fbf6;border-radius:8px;font-size:13px}
.pl-wa-flag{color:#a35f00}
.pl-waform{padding:12px 16px;margin-bottom:14px}
.pl-waform summary{cursor:pointer;font-weight:600}
.pl-waform-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:10px;margin-top:12px;align-items:end}
.pl-waform-grid label{display:flex;flex-direction:column;gap:4px;font-size:13px}
.pl-waform-body{grid-column:1/-1}
.pl-waform-grid textarea{font-family:inherit;font-size:14px;padding:10px 12px;border:1px solid var(--line);border-radius:9px;width:100%;box-sizing:border-box}


/* ---- People (v137) ---- */
.health-pill{display:inline-block;padding:2px 10px;border-radius:999px;font-size:12.5px;font-weight:600;white-space:nowrap;background:#f0f0f0;color:#555}
.health-pill.health-strong{background:#e3f5e8;color:#17703a}
.health-pill.health-steady{background:#eaf2fb;color:#1f5a96}
.health-pill.health-cooling{background:#fff3dc;color:#8a5a00}
.health-pill.health-at_risk{background:#fde8e8;color:#b3261e}
.health-dot{display:inline-block;width:8px;height:8px;border-radius:50%;margin-right:6px;background:#bbb;vertical-align:middle}
.health-dot.health-strong{background:#2e9e57}.health-dot.health-steady{background:#3b7fc4}
.health-dot.health-cooling{background:#e0a020}.health-dot.health-at_risk{background:#d64541}
.person-health{border-left:4px solid #ccc}
.person-health.health-border-strong{border-left-color:#2e9e57}.person-health.health-border-steady{border-left-color:#3b7fc4}
.person-health.health-border-cooling{border-left-color:#e0a020}.person-health.health-border-at_risk{border-left-color:#d64541}
.person-health-head{display:flex;flex-wrap:wrap;gap:12px;align-items:center}
.person-health-parts{margin-top:6px}
.person-health-note{margin:10px 0 2px;font-size:15px}
.person-contacts,.person-roles,.people-due{list-style:none;margin:6px 0 12px;padding:0}
.person-contacts li,.person-roles li,.people-due li{padding:6px 0;border-bottom:1px solid var(--line);overflow-wrap:anywhere}
.person-contacts li.retired{text-decoration:line-through;color:var(--muted)}
.person-roles li.current{font-weight:500}
.person-timeline{list-style:none;margin:0;padding:0}
.person-timeline li{padding:10px 0 10px 14px;border-left:2px solid var(--line);margin-left:4px;position:relative}
.person-timeline li::before{content:"";position:absolute;left:-5px;top:16px;width:8px;height:8px;border-radius:50%;background:var(--muted)}
.people-filter{display:flex;flex-wrap:wrap;gap:8px;align-items:center}
.people-filter input[type=search]{flex:1 1 220px;width:auto}
.people-filter select{width:auto;flex:0 1 auto}
.btn-link{background:none;border:0;padding:0 4px;color:var(--muted);cursor:pointer;font:inherit}
.btn-link:hover{color:var(--red)}
label.check{display:flex;gap:8px;align-items:center;font-size:13px}
label.check input{width:auto}
.person-health details>summary,.person-contacts~details>summary,.person-roles~details>summary{cursor:pointer;margin:6px 0}

/* ---- People dashboard (v139) ---- */
.pd-of{font-size:15px;font-weight:500;color:var(--muted)}
.pd-up{color:#1a7f3c;margin-left:4px}
.stat-l .neg{margin-left:4px}
.pd-h3{font-size:14px;margin:16px 0 4px}
.pd-pipeline{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:12px}
.pd-stage{border:1px solid var(--line);border-radius:8px;padding:10px 12px;border-top:3px solid #bbb;min-width:0}
.pd-stage-talking{border-top-color:#3b7fc4}.pd-stage-proposal{border-top-color:#e0a020}
.pd-stage-won{border-top-color:#2e9e57}.pd-stage-lost{border-top-color:#d64541}
.pd-stage-head{display:flex;justify-content:space-between;font-size:13px;color:var(--muted);margin-bottom:6px}
.pd-stage-head strong{color:var(--ink);font-size:18px}
.pd-stage ul{list-style:none;margin:0;padding:0;font-size:13px}
.pd-stage li{padding:3px 0;overflow-wrap:anywhere}
.pd-bars{position:relative;display:flex;align-items:flex-end;gap:6px;height:170px;padding-top:8px}
.pd-col{flex:1;display:flex;flex-direction:column;justify-content:flex-end;height:100%;min-width:0}
.pd-bar{position:relative;background:#cfd6de;border-radius:3px 3px 0 0;min-height:2px;display:flex;flex-direction:column;justify-content:flex-end;overflow:hidden}
.pd-bar-sales{background:var(--red);width:100%}
.pd-bar.pd-met{background:#2e9e57}.pd-bar.pd-short{background:#e0a020}
.pd-bar span{color:#fff;font-size:11px;font-weight:600;text-align:center;padding-top:2px;position:absolute;top:0;left:0;right:0}
.pd-x{font-size:10.5px;color:var(--muted);text-align:center;height:18px;line-height:18px;white-space:nowrap;overflow:hidden}
.pd-target{position:absolute;left:0;right:0;border-top:1px dashed var(--muted);pointer-events:none}
.pd-target span{position:absolute;right:0;top:-16px;font-size:10.5px;color:var(--muted);background:var(--card);padding:0 4px}
.pd-key{display:inline-block;width:10px;height:10px;border-radius:2px;margin:0 5px 0 10px;vertical-align:middle}
.pd-key-all{background:#cfd6de;margin-left:0}.pd-key-sales{background:var(--red)}
.pd-health-row{margin-bottom:14px}
.pd-stack{display:flex;height:14px;border-radius:7px;overflow:hidden;background:var(--line);margin:6px 0 4px}
.pd-seg{display:block;min-width:4px}
.health-seg-strong{background:#2e9e57}.health-seg-steady{background:#3b7fc4}.health-seg-cooling{background:#e0a020}
.health-seg-at_risk{background:#d64541}.health-seg-none{background:#c9c9c9}
.pd-dir-out{background:#3b7fc4}.pd-dir-both{background:#7a5cc4}.pd-dir-in{background:#2e9e57}
.pd-legend{display:flex;flex-wrap:wrap;gap:4px 14px}
.pd-legend .pd-key{margin-left:0}
.pd-channels{margin-top:12px}
.pd-channels td{padding:4px 6px}
.pd-chan-bar{width:60%}
.pd-chan-bar span{display:block;height:8px;border-radius:4px;background:var(--black)}
.pd-chip{display:inline-block;border:1px solid var(--line);border-radius:999px;padding:1px 9px;margin:0 4px 4px 0}
@media (max-width:1000px){.pd-pipeline{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media (max-width:640px){.pd-pipeline{grid-template-columns:minmax(0,1fr)}.pd-x{font-size:9px}.pd-bars{gap:3px}}
/* v140 briefings card */
.pd-days{display:flex;flex-wrap:wrap;gap:6px 14px;margin:8px 0 12px}
.pd-tg{align-self:end;padding-bottom:10px}
.pd-brief-actions{display:flex;flex-wrap:wrap;gap:8px;align-items:center;margin-top:12px}
.pd-brief-actions .inline-form{display:inline}

/* v141: planner checks */
.pl-check{padding:14px 18px;margin-bottom:12px}
.pl-check-fix{border-left:4px solid #c11}
.pl-check-look{border-left:4px solid #e0a000}
.pl-check-head{font-size:16px;margin:0;display:flex;align-items:center;gap:8px}
.pl-check-n{font-size:12px;font-weight:700;background:#f0f0f2;border-radius:999px;padding:1px 8px}
.pl-check-why{margin:2px 0 8px}
.pl-check-detail{margin-left:14px;word-break:break-word}
.cl-chk{display:inline-block;font-size:11px;font-weight:600;border-radius:999px;padding:0 7px}
.cl-chk-ok{background:#e6f4ec;color:#1e8e5a}
.cl-chk-bad{background:#ffe3e3;color:#c11}

/* v141 People: freshness line, sweep button */
.page-head .page-actions{display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.pd-fresh{margin-top:4px}

/* v148: proof on each piece of a client's month */
.cl-entries li{flex-wrap:wrap}
.cl-proof{flex-basis:100%;margin:4px 0 8px;padding:8px 10px;border:1px solid var(--border,#e6e6e6);border-radius:8px;background:var(--bg-soft,#fafafa)}
.cl-shots{display:flex;flex-wrap:wrap;gap:6px;align-items:stretch}
.cl-shot{position:relative;display:inline-block}
.cl-shot img{height:64px;width:auto;max-width:120px;object-fit:cover;border-radius:4px;border:1px solid #ddd;display:block}
.cl-shot-x{position:absolute;top:-6px;right:-6px;width:18px;height:18px;border-radius:50%;border:0;background:#333;color:#fff;font-size:10px;line-height:18px;padding:0;cursor:pointer}
.cl-drop{display:inline-flex;flex-direction:column;justify-content:center;align-items:center;min-width:110px;height:64px;border:1.5px dashed #bbb;border-radius:6px;font-size:12px;font-weight:600;cursor:pointer;color:#555;padding:0 8px}
.cl-drop small{font-weight:400;color:#888}
.cl-drop.armed,.cl-drop.over,.cl-drop:focus{border-color:#e23b1e;color:#e23b1e;outline:none}
.cl-nums{display:flex;flex-wrap:wrap;gap:8px 12px;margin-top:8px;align-items:flex-end}
.cl-nums label{display:flex;flex-direction:column;font-size:11px;color:#777;margin:0}
.cl-nums input{width:92px;padding:3px 6px;font-size:13px}
.cl-saved.cl-bad{color:#c0392b}
.cl-slot{display:flex;flex-wrap:wrap;gap:6px;align-items:center;margin:4px 0}
.cl-slot-n{font-size:12px;font-weight:600;color:#a06a00;min-width:86px}
.cl-plink{flex-basis:100%;margin:4px 0}
.cl-plink input{width:100%;max-width:420px}
.cl-done-form.cl-slot{display:flex;flex-direction:row;flex-wrap:wrap;align-items:center}
.cl-slot input[type=url]{flex:1 1 200px;min-width:160px;width:auto}
.cl-slot input[type=date]{width:auto}

/* v149: a piece not done yet can take its screenshot first */
.cl-proof-new{flex-basis:auto;display:inline-flex;align-items:center;gap:6px;margin:0;padding:0;border:0;background:none}
.cl-proof-new .cl-drop{height:34px;min-width:120px;flex-direction:row;gap:6px}
.cl-proof-new .cl-drop small{font-size:11px}

/* v150 - the client month, polished: each line a block, each piece a card that says plainly whether it is done. */
.cl-top{position:sticky;top:0;z-index:20;background:var(--bg);margin:-30px -36px 0;padding:22px 36px 12px;border-bottom:1px solid transparent}
.cl-top .page-head{margin-bottom:10px}
.cl-top-prog{display:inline-flex;align-items:center;gap:8px;font-size:13px;font-weight:600;margin-left:auto}
.cl-top-prog .cl-mini{width:90px}
.cl-ring-card{display:flex;align-items:center;gap:14px}
.cl-ring{width:52px;height:52px;flex:0 0 52px;transform:rotate(-90deg)}
.cl-ring circle{fill:none;stroke-width:3.6}
.cl-ring-bg{stroke:#f0eeec}
.cl-ring-fg{stroke:var(--red);stroke-linecap:round}
.cl-ring-fg.cl-ring-full{stroke:#1e8e5a}
.cl-mini{display:inline-block;width:64px;height:6px;background:#f0eeec;border-radius:3px;overflow:hidden;vertical-align:middle}
.cl-mini i{display:block;height:100%;background:var(--red);border-radius:3px}
.cl-line-done .cl-mini i{background:#1e8e5a}

.cl-lines{padding:0;overflow:visible}
.cl-line{padding:14px 18px;border-top:1px solid var(--line)}
.cl-line:first-child{border-top:0}
.cl-line.cl-removed{opacity:.55}
.cl-line-head{display:flex;justify-content:space-between;align-items:flex-start;gap:12px}
.cl-line-name{font-size:15px;min-width:0}
.cl-line-meta{display:flex;align-items:center;gap:10px;flex-wrap:wrap;justify-content:flex-end;flex:0 0 auto}
.cl-pk{display:inline-flex;align-items:center;gap:5px;font-size:12px;color:var(--muted)}
.cl-pk b{color:var(--ink);font-size:13px}
.cl-qty{width:3.4em;padding:2px 4px;font-size:13px;text-align:center;border:1px solid transparent;background:transparent;border-radius:6px}
.cl-qty:hover,.cl-qty:focus{border-color:var(--line);background:#fff}

.cl-pieces{display:grid;gap:8px;margin-top:10px}
.cl-piece{border:1px solid var(--line);border-left:3px solid #ccc;border-radius:9px;padding:9px 12px;background:#fff}
.cl-piece-done{border-left-color:#1e8e5a}
.cl-piece-plan{border-left-color:#e0a030;background:#fffcf5}
.cl-piece-todo{border:1.5px dashed #d5d5d8;border-left:3px dashed #c4c4c8;background:#fbfbfc;margin:0}
.cl-piece-head{display:flex;align-items:center;gap:8px;flex-wrap:wrap;font-size:13px;min-height:24px}
.cl-piece-mark{width:20px;height:20px;border-radius:50%;display:inline-flex;align-items:center;justify-content:center;font-size:11px;font-weight:700;flex:0 0 20px}
.cl-piece-done .cl-piece-mark{background:#e6f4ec;color:#1e8e5a}
.cl-piece-plan .cl-piece-mark{background:#fff2dc;color:#b26a00}
.cl-piece-todo .cl-piece-mark{background:#f0f0f2;color:#9a9aa2}
.cl-piece-n,.cl-piece-todo .cl-slot-n{font-weight:600;font-size:12px;color:var(--ink);min-width:0}
.cl-piece-date{font-weight:600}
.cl-piece-link{word-break:break-all;max-width:100%}
.cl-piece-task{margin:4px 0 0 28px}
.cl-piece .cl-proof,.cl-piece .cl-plink{margin-left:28px}
.cl-piece .cl-plink input{max-width:460px}

.cl-proof{flex-basis:auto;margin-top:8px;padding:0;border:0;background:none}
.cl-shots{display:flex;flex-wrap:wrap;gap:8px;align-items:stretch}
.cl-shot img{height:96px;max-width:170px;border-radius:6px}
.cl-proof .cl-drop{height:96px;min-width:130px;background:#fafafa}
.cl-nums{display:grid;grid-template-columns:repeat(auto-fill,minmax(104px,1fr));gap:8px 10px;margin-top:10px;max-width:640px}
.cl-nums label{display:flex;flex-direction:column;gap:2px;font-size:11px;color:var(--muted);margin:0}
.cl-nums input{width:100%;box-sizing:border-box;padding:4px 7px;font-size:13px}
.cl-proof > .cl-saved{display:block;margin-top:4px;min-height:1em}

.cl-slot{display:block}
.cl-slot-row{display:flex;flex-wrap:wrap;gap:8px;align-items:center;margin:6px 0 0 28px}
.cl-slot-row input[type=url]{flex:1 1 240px;min-width:0}
.cl-slot-row input[type=date]{width:auto}
.cl-slot-row .cl-proof-new{margin:0}
.cl-slot-row .cl-proof-new .cl-drop{height:34px;min-width:0;background:#fff}

.cl-line-foot{display:flex;gap:18px;flex-wrap:wrap;margin-top:6px}
.cl-line-foot:empty{display:none}
.cl-more summary{cursor:pointer;color:var(--muted)}
.cl-more[open]{flex-basis:100%}
.cl-more[open] summary{color:var(--ink);font-weight:600}
.cl-more .cl-piece{margin-top:6px}

.cl-menu{position:relative;display:inline-block}
.cl-menu > summary{list-style:none;cursor:pointer;width:26px;height:24px;border-radius:6px;display:inline-flex;align-items:center;justify-content:center;color:var(--muted);font-size:16px;line-height:1}
.cl-menu > summary::-webkit-details-marker{display:none}
.cl-menu > summary:hover,.cl-menu[open] > summary{background:#f0f0f2;color:var(--ink)}
.cl-menu-pop{position:absolute;right:0;top:28px;z-index:30;min-width:220px;background:#fff;border:1px solid var(--line);border-radius:10px;box-shadow:0 8px 28px rgba(0,0,0,.12);padding:6px;display:flex;flex-direction:column}
.cl-menu-pop form{margin:0}
.cl-menu-item{display:block;width:100%;text-align:left;background:none;border:0;padding:7px 10px;border-radius:7px;font:inherit;font-size:13px;color:var(--ink);cursor:pointer;text-decoration:none}
.cl-menu-item:hover{background:#f5f5f6}
.cl-menu-form{display:flex;flex-direction:column;gap:6px;padding:6px}
.cl-menu-form label{display:flex;flex-direction:column;gap:4px;margin:0}

.cl-setup > summary{cursor:pointer;padding:12px 16px;background:var(--card);border:1px solid var(--line);border-radius:var(--radius)}
.cl-setup[open] > summary{margin-bottom:12px}
.cl-setup .cl-panel{margin-top:12px}

.cl-all-done{display:none;padding:14px 18px}
.cl-onlyleft .cl-all-done:not(:empty){display:block}
.cl-onlyleft .cl-line-done,.cl-onlyleft .cl-piece-done,.cl-onlyleft .cl-chan-done{display:none}

@media (max-width:860px){
  .cl-top{position:static;margin:0;padding:0}
  .cl-top-prog{margin-left:0}
  .cl-line{padding:12px}
  .cl-line-head{flex-direction:column;gap:6px}
  .cl-line-meta{justify-content:flex-start}
  .cl-piece .cl-proof,.cl-piece .cl-plink,.cl-slot-row,.cl-piece-task{margin-left:0}
  .cl-slot-row input[type=url]{flex-basis:100%}
  .cl-shot img,.cl-proof .cl-drop{height:80px}
  .cl-nums{grid-template-columns:repeat(2,minmax(0,1fr))}
  .cl-menu-pop{min-width:200px}
}
.cl-piece-head .cl-menu{margin-left:auto}
.cl-done-form.cl-slot.cl-piece-todo{display:block}
@media (max-width:860px){.cl-ring{width:40px;height:40px;flex-basis:40px}.cl-ring-card{gap:10px}}
.cl-chanblock{display:block}
.cl-or{padding:0 2px}

/* v151 - the all-clients calendar: days down, clients across, a chip per piece. */
.ccal-bar{margin-bottom:8px}
.ccal-legend{display:inline-flex;gap:6px;flex-wrap:wrap;margin-left:auto}
.ccal-key{cursor:default}
.ccal-help{margin:6px 0 10px}
.ccal-wrap{padding:0;overflow:auto;max-height:calc(100vh - 210px)}
.ccal{border-collapse:separate;border-spacing:0;font-size:12.5px}
.ccal th,.ccal td{border-bottom:1px solid var(--line);border-right:1px solid var(--line);vertical-align:top;padding:0}
.ccal thead th{position:sticky;top:0;z-index:3;background:#fff;padding:9px 10px;text-align:left;font-weight:600}
.ccal-corner{left:0;z-index:4 !important;min-width:74px}
.ccal-client{min-width:168px;max-width:220px}
.ccal-client a{color:var(--ink)}
.ccal-client a:hover{color:var(--red)}
.ccal-sub{font-size:11px;font-weight:400;color:var(--muted);margin-top:2px}
.ccal-latecount{color:#c62828}
.ccal-day{position:sticky;left:0;z-index:2;background:#fff;padding:6px 8px;text-align:left;font-weight:500;white-space:nowrap;color:var(--muted)}
.ccal-dn{font-weight:700;color:var(--ink);display:inline-block;min-width:16px}
.ccal-dw{font-size:11px}
.ccal-unplanned .ccal-day{font-size:11px;white-space:normal;color:var(--ink);font-weight:600}
.ccal-unplanned td{background:#fafafa;border-bottom:2px solid #e2e2e5}
.ccal-weekend td,.ccal-weekend .ccal-day{background:#fafafb}
.ccal-today td,.ccal-today .ccal-day{background:#fff6f4}
.ccal-today .ccal-dn{color:var(--red)}
.ccal-zone{min-height:30px;padding:3px;display:flex;flex-direction:column;gap:3px;height:100%;box-sizing:border-box}
.ccal-over{background:#ffe9e4;outline:2px dashed var(--red);outline-offset:-2px;border-radius:4px}
.ccal-picking .ccal-drop{cursor:pointer}
.ccal-chip{display:flex;align-items:center;gap:5px;border-radius:6px;padding:3px 7px;font-size:11.5px;line-height:1.3;border:1px solid transparent;background:#f0f0f2;color:#55555c;user-select:none}
.ccal-legend .ccal-chip{display:inline-flex}
.ccal-drag{cursor:grab}
.ccal-drag:active{cursor:grabbing}
.ccal-name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0;flex:1}
.ccal-dot{width:7px;height:7px;border-radius:50%;flex:0 0 7px}
.ccal-done{background:#e6f4ec;color:#1b6e47;border-color:#c9e8d6}
.ccal-plan{background:#fff6e5;color:#8a5600;border-color:#f3dfb5}
.ccal-late{background:#fdeaea;color:#b3261e;border-color:#f5c4c1}
.ccal-open{background:#f0f0f2;color:#55555c;border-color:#e2e2e6}
.ccal-tick{font-weight:700}
.ccal-task{font-size:11px;opacity:.8}
.ccal-chip.dragging{opacity:.45}
.ccal-chip.picked{outline:2px solid var(--red);outline-offset:1px}
.ccal-chip.busy{opacity:.5}
.ccal-toast{position:fixed;left:50%;bottom:24px;transform:translateX(-50%) translateY(20px);background:#141414;color:#fff;padding:9px 16px;border-radius:9px;font-size:13px;opacity:0;pointer-events:none;transition:all .2s;z-index:80;max-width:90vw}
.ccal-toast.on{opacity:1;transform:translateX(-50%)}
.ccal-toast.bad{background:#b3261e}
@media (max-width:860px){
  .ccal-wrap{max-height:none}
  .ccal-client{min-width:140px}
  .ccal-legend{margin-left:0}
  .ccal-toast{bottom:84px}
}

/* v151: a piece planned on a day, on the client's month */
.cl-done-form.cl-slot.cl-piece-plan{display:block}
.cl-piece-late{border-left-color:#c62828;background:#fff7f6}
.cl-st-late{background:#fdeaea;color:#b3261e}

/* v154 - the client plan (deliverables down, clients across) and the standard deliverables */
.ccal-views{display:inline-flex;gap:0}
.ccal-views .btn{border-radius:0}
.ccal-views .btn:first-child{border-radius:6px 0 0 6px}
.ccal-views .btn:last-child{border-radius:0 6px 6px 0}
.cplan .cplan-group th{background:var(--bg-soft,#f4f4f5);text-align:left;font-size:12px;letter-spacing:.06em;text-transform:uppercase;color:var(--muted,#666);padding:6px 10px;position:static}
.cplan .cplan-type{text-align:left;font-weight:600;font-size:13px;min-width:210px;white-space:normal}
.cplan-site{display:block;font-weight:400;font-size:11px;color:var(--muted,#666)}
.cplan-own{display:inline-block;font-weight:400;font-size:10px;padding:0 5px;border-radius:8px;background:#fff4e5;color:#9a5b00}
.cplan-cell{min-width:110px;vertical-align:middle}
.cplan-cell .ccal-chip{display:inline-block;margin:2px 3px 2px 0;min-width:28px;text-align:center}
.cplan-none{background:repeating-linear-gradient(135deg,transparent 0 6px,rgba(0,0,0,.025) 6px 12px)}
button.cplan-day{cursor:pointer;font:inherit;font-size:12px}
.cplan-pick{display:inline-block;margin-left:4px}
.cplan-pick input{font-size:12px;padding:2px 4px}
.cl-type{color:var(--muted,#666);margin-top:2px}
.cl-type-none{color:#9a5b00}
.cl-types-intro{max-width:760px}
.cl-types .cl-types-label{width:100%;min-width:260px}
.cl-types .cl-types-key{width:150px}
.cl-types-new td{background:var(--bg-soft,#f9f9fa)}
@media (max-width:700px){.cplan .cplan-type{min-width:150px}.cplan-cell{min-width:80px}}
.cl-types{overflow-x:auto}
.cl-types select{min-width:130px}
.cl-types .cl-qty{width:64px}

/* v155 - Suggest a plan */
.ccal-prop{background:#fff;border:1.5px dashed #c47f00;color:#8a5a00}
.cplan-suggest{padding:14px 18px;margin-bottom:12px}
.cplan-suggest form{display:flex;gap:8px;flex-wrap:wrap;margin-top:8px}
.cplan-warn{margin:8px 0;padding-left:18px}
.cplan-warn li{margin:3px 0}
.cplan-w-red{color:#b42318}
.cplan-w-amber{color:#9a5b00}

/* v155 - campaigns in a month */
.cl-camps{padding:12px 16px;margin:12px 0}
.cl-camps-head{display:flex;gap:10px;align-items:baseline;flex-wrap:wrap}
.cl-camp-list{list-style:none;margin:8px 0;padding:0}
.cl-camp-list li{display:flex;gap:10px;align-items:baseline;flex-wrap:wrap;padding:4px 0;border-top:1px solid var(--border,#eee)}
.cl-camp-add{display:flex;gap:6px;flex-wrap:wrap;margin-top:8px}
.cl-camp-add input[name=title]{min-width:240px;flex:1}
.cl-camp-tag{display:inline-block;font-size:11px;padding:0 7px;border-radius:9px;background:#eef4ff;color:#2c4a8a;margin-left:4px}
.ccal-for{opacity:.75;font-style:italic}

/* v157 - pieces found for clients */
.cf-help{max-width:820px}
.cf-list{padding:0}
.cf-row{display:flex;gap:12px;align-items:center;flex-wrap:wrap;padding:10px 14px;border-top:1px solid var(--border,#eee)}
.cf-row:first-child{border-top:0}
.cf-img{width:64px;height:64px;object-fit:cover;border-radius:8px;flex:none;background:#f4f4f5}
.cf-noimg{display:flex;align-items:center;justify-content:center;font-size:24px;color:#888}
.cf-what{flex:1;min-width:220px}
.cf-title{font-weight:600;margin:2px 0}
.cf-src{display:inline-block;font-size:11px;padding:0 7px;border-radius:9px;background:#eef4ff;color:#2c4a8a;margin-right:4px}
.cf-src-newsletter{background:#fff2dc;color:#8a5a00}
.cf-src-instagram{background:#fde8f1;color:#9b1c5a}
.cf-act{display:flex;gap:6px;align-items:center}
.cf-act select{max-width:280px}

/* v159 - the day page's sections fold; the client calendar is narrower and its first column no longer cut */
.pl-acc{margin:6px 0 2px}
.pl-acc>summary{cursor:pointer;list-style:none;display:flex;align-items:center;gap:6px;margin:8px 0 4px;user-select:none}
.pl-acc>summary::-webkit-details-marker{display:none}
.pl-acc>summary::before{content:'▸';font-size:10px;color:var(--muted);transition:transform .15s}
.pl-acc[open]>summary::before{transform:rotate(90deg)}
.pl-acc>summary:hover{opacity:.8}
.ccal-corner,.ccal-day{min-width:92px;width:92px;box-sizing:border-box}
.ccal-unplanned .ccal-day{white-space:nowrap;font-size:10.5px}
.ccal-client{min-width:128px;max-width:150px;font-size:12px;padding:8px 8px !important}
.ccal-client .ccal-sub{font-size:10.5px}
.ccal-zone{min-width:120px}
.ccal-chip{font-size:11px;padding:2px 6px}
.cplan .cplan-type{position:sticky;left:0;z-index:2;background:#fff;padding:7px 10px;min-width:190px;max-width:220px;font-size:12.5px}
.cplan thead .ccal-corner{min-width:190px;padding-left:10px}
.cplan-cell{min-width:96px;padding:4px 6px}
/* v159 - a client's line folds to one row: the deliverable, how many, the date, the status */
.cl-line{padding:0}
.cl-line>summary{list-style:none;cursor:pointer;display:flex;align-items:center;gap:10px;padding:11px 18px;user-select:none}
.cl-line>summary::-webkit-details-marker{display:none}
.cl-line>summary::before{content:'▸';font-size:11px;color:var(--muted);transition:transform .15s;flex:0 0 auto}
.cl-line[open]>summary::before{transform:rotate(90deg)}
.cl-line>summary:hover{background:#fafafb}
.cl-sum-name{flex:1;min-width:0;font-weight:600;font-size:14px;overflow:hidden;text-overflow:ellipsis}
.cl-sum-n{font-weight:700;font-size:13px;min-width:34px;text-align:right}
.cl-sum-when{font-size:12px;min-width:96px;color:var(--muted);white-space:nowrap}
.cl-when-plan{color:#8a5600}
.cl-when-late{color:#b3261e;font-weight:600}
.cl-when-done{color:#1b6e47}
.cl-line-body{padding:2px 18px 14px 36px}
.cl-line-body .cl-line-name:empty{display:none}
@media (max-width:700px){.cl-line>summary{flex-wrap:wrap;gap:6px 10px}.cl-sum-name{flex-basis:100%}.cl-line-body{padding-left:18px}}
/* v159 - list pages: the less-used filters fold into one "Filters" control; the journal reads by day */
.more-filters{margin:-8px 0 16px}
.more-filters>summary{list-style:none;cursor:pointer;gap:6px}
.more-filters>summary::-webkit-details-marker{display:none}
.more-filters>summary::before{content:'▸';font-size:10px;color:var(--muted);transition:transform .15s}
.more-filters[open]>summary::before{transform:rotate(90deg)}
.more-filters[open]>summary{margin-bottom:10px}
.more-filters .task-filters{margin-bottom:10px}
.jrnl-list .jrnl-day{font-size:11.5px;font-weight:700;text-transform:uppercase;letter-spacing:.05em;color:var(--muted);padding:14px 0 4px;border:0;background:none}
.jrnl-list .jrnl-day:first-child{padding-top:2px}
.more-filters>summary.chip{display:inline-flex;align-items:center;gap:6px}
.cl-line-sum{min-height:22px}
.cl-when-none{color:var(--muted)}
/* v159 - the Edit bio page: the feed first, the page's settings folded into one group */
.acc-feed{border-color:#e9c6d6}
.acc-feed>summary{color:#c1306b}
.acc-todo{color:#b3261e}
.acc-group>summary{flex-wrap:wrap;white-space:nowrap}
.acc-group>summary .muted{white-space:normal;font-weight:400;flex:1 1 200px}
.acc-group>.acc-body>details.acc,.acc-group details.acc{margin:0 0 10px}

/* v162 - ledger results: at a glance, a figure on each row */
.lr-glance{margin:0 0 14px;padding:12px 14px;border:1px solid var(--line);border-radius:var(--radius);background:var(--card)}
.lr-head{display:flex;justify-content:space-between;align-items:baseline;gap:12px;flex-wrap:wrap}
.lr-head h2{font-size:15px;margin:0}
.lr-nav{display:flex;gap:12px}
.lr-tiles{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:10px;margin:10px 0}
.lr-tile{padding:8px 10px;border:1px solid var(--line);border-radius:var(--radius);background:var(--bg)}
.lr-label{margin-bottom:2px}
.lr-num{font-size:20px;font-weight:600;color:var(--ink);font-variant-numeric:tabular-nums}
.lr-up{color:#1a7f37;font-weight:600}
.lr-down{color:#c62828;font-weight:600}
.lr-flat{color:var(--muted)}
.lr-cover{margin:4px 0 8px}
.lr-cover a{margin-left:6px}
.lr-trend{display:flex;align-items:flex-end;gap:12px;margin-top:6px}
.lr-trend-l{flex:0 0 130px}
.lr-bars{display:flex;align-items:flex-end;gap:4px;height:46px;flex:1;max-width:420px}
.lr-bar{flex:1;display:flex;flex-direction:column;justify-content:flex-end;align-items:center;height:100%;text-decoration:none}
.lr-bar span{display:block;width:100%;background:var(--muted);opacity:.45;border-radius:2px 2px 0 0}
.lr-bar.on span{background:var(--red);opacity:1}
.lr-bar.none span{height:0}
.lr-bar em{font-style:normal;font-size:10px;color:var(--muted);line-height:12px}
.lr-row{font-variant-numeric:tabular-nums;color:var(--ink)}
.lr-row.lr-none{color:var(--muted);font-style:italic}
@media (max-width:640px){.lr-trend{flex-direction:column;align-items:stretch;gap:2px}.lr-trend-l{flex:none}.lr-bars{flex:none;height:46px;max-width:none}}

/* ---- v177: wide screens use their width ----------------------------------
   Up to 1440px nothing changes. Above it the main column grows to 1800px;
   forms, documents and text blocks keep their own max-widths, so only lists,
   boards, calendars and tables actually spread out. */
@media (min-width:1440px){
  .main{max-width:1800px}
  .main:has(.links-layout),.main:has(.bio-editor-layout){max-width:1800px}
}

/* ---- v177: My tasks -------------------------------------------------------- */
.tm-summary{display:grid;grid-template-columns:repeat(auto-fit,minmax(118px,1fr));gap:10px;margin:0 0 16px}
.tm-tile{display:flex;flex-direction:column;gap:2px;background:#fff;border:1px solid var(--line);border-radius:10px;padding:11px 14px;color:var(--ink);text-decoration:none;transition:border-color .12s,box-shadow .12s}
.tm-tile strong{font-size:22px;line-height:1.1}
.tm-tile span{font-size:12px;color:var(--muted);font-weight:500}
.tm-tile:hover{border-color:#cfcfcf;box-shadow:0 2px 8px rgba(0,0,0,.05)}
.tm-tile.is-on{border-color:var(--ink);box-shadow:inset 0 0 0 1px var(--ink)}
.tm-tile.is-alert strong{color:var(--red)}
.tm-tile-done_week strong{color:#1a7f3c}

.tm-bulk{position:sticky;top:8px;z-index:30;display:flex;flex-wrap:wrap;align-items:center;gap:8px 10px;background:var(--ink);color:#fff;border-radius:10px;padding:9px 12px;margin:0 0 12px;box-shadow:0 6px 18px rgba(0,0,0,.18)}
.tm-bulk[hidden],.tm-bulk [hidden]{display:none!important}
.tm-bulk select,.tm-bulk input[type=date]{margin:0;width:auto;padding:5px 8px;font-size:13px;border-radius:7px}
.tm-bulk .tm-bulk-count{font-size:13px;margin-right:4px}
.tm-bulk .small.muted{color:#bbb}
.tm-bulk .btn{padding:6px 12px}
.tm-inline{display:inline-flex;align-items:center;gap:6px;margin:0;font-weight:500}
.tm-inline input{margin:0;width:auto}

.tm-layout{display:grid;grid-template-columns:minmax(0,1fr) minmax(360px,42%);gap:18px;align-items:start}
.tm-listhead{display:flex;align-items:center;gap:14px;flex-wrap:wrap;margin:0 0 10px}
.tm-listhead .tasks-count{margin:0}
.tm-keys{margin-left:auto}
.tm-group{padding:12px 10px 8px}
.tm-group h2{padding:0 8px;margin-bottom:6px}
.tm-list{list-style:none;margin:0;padding:0;display:flex;flex-direction:column}
.tm-row{display:flex;align-items:center;gap:10px;padding:8px 8px;border-radius:8px;cursor:pointer;border:1px solid transparent}
.tm-row + .tm-row{border-top-color:#f3f3f3}
.tm-row:hover{background:#fafafa}
.tm-row.is-active{background:#fff5f5;border-color:#ffd0d0}
.tm-row.is-done .tm-open{color:var(--muted);text-decoration:line-through}
.tm-check{margin:0;width:16px;height:16px;flex:0 0 auto;cursor:pointer}
.tm-main{flex:1;min-width:0}
.tm-title{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-weight:500}
.tm-open{color:var(--ink)}
.tm-meta{display:flex;align-items:center;gap:6px;flex-wrap:wrap;margin-top:3px;font-size:12px}
.tm-meta .brand-pill{font-size:11px}
.tm-side{display:flex;flex-direction:column;align-items:flex-end;gap:2px;flex:0 0 auto;text-align:right;min-width:84px}
.tm-side .due-today{color:#b26a00;font-weight:600}
.tm-who{max-width:160px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}

.tm-pane{position:sticky;top:12px;max-height:calc(100vh - 24px);overflow-y:auto;overflow-x:hidden;background:#fff;border:1px solid var(--line);border-radius:var(--radius);box-shadow:var(--shadow);padding:18px 20px}
.tm-pane.is-loading{opacity:.55}
.tm-pane-empty{padding:30px 6px;text-align:center}
.tp-head{display:flex;justify-content:space-between;align-items:center;gap:8px}
.tp-ref{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.tp-close{background:none;border:0;font-size:24px;line-height:1;cursor:pointer;color:var(--muted);padding:0 4px}
.tp-close:hover{color:var(--ink)}
.tp-title{font-size:19px;margin:10px 0 2px;line-height:1.3}
.tp-title a{color:var(--ink)}
.tp-fields{display:grid;grid-template-columns:repeat(auto-fit,minmax(130px,1fr));gap:10px;margin:14px 0 12px}
.tp-fields label{display:flex;flex-direction:column;gap:4px;margin:0}
.tp-fields label > span,.tp-label{font-size:11px;font-weight:600;letter-spacing:.3px;text-transform:uppercase;color:var(--muted)}
.tp-fields select,.tp-fields input{margin:0;width:100%;padding:6px 8px;font-size:13px}
.tp-due{display:flex;align-items:center;gap:6px;min-width:0}
.tp-due input{flex:1;min-width:0}
.tp-people{display:flex;align-items:center;flex-wrap:wrap;gap:6px;margin:0 0 14px}
.tp-people .tp-label{margin-right:4px}
.tp-chip{display:inline-flex;align-items:center;gap:4px;background:#f0f0f1;border-radius:999px;padding:3px 6px 3px 10px;font-size:12.5px;font-weight:500}
.tp-chip button{background:none;border:0;cursor:pointer;color:var(--muted);font-size:15px;line-height:1;padding:0 2px}
.tp-chip button:hover{color:var(--red)}
.tp-people select{margin:0;width:auto;padding:4px 8px;font-size:12.5px}
.tp-reply textarea{width:100%;margin:0;font-size:13.5px}
.tp-reply-row{display:flex;justify-content:space-between;align-items:center;margin:6px 0 14px}
.tp-chat{display:flex;flex-direction:column;gap:10px;border-top:1px solid var(--line);padding-top:12px}
.tp-danger{display:flex;gap:8px;justify-content:flex-end;border-top:1px solid var(--line);margin-top:14px;padding-top:12px}

/* Below 1100px the pane slides over the list instead of sitting beside it. */
@media (max-width:1100px){
  .tm-layout{grid-template-columns:minmax(0,1fr)}
  .tm-pane{position:fixed;top:0;right:0;bottom:0;width:min(520px,94vw);max-height:none;border-radius:0;z-index:120;transform:translateX(105%);transition:transform .2s ease}
  body.tm-pane-open .tm-pane{transform:none}
  .tm-keys{display:none}
}
@media (max-width:640px){
  .tm-side{min-width:64px}
}

/* ---- v178: the shared pipeline ------------------------------------------- */
.pl-sides{display:flex;gap:6px;margin:-8px 0 14px}
.pl-summary{display:grid;grid-template-columns:repeat(auto-fit,minmax(128px,1fr));gap:10px;margin:0 0 14px}
.pl-bar{display:flex;justify-content:space-between;align-items:center;flex-wrap:wrap;gap:8px;margin:0 0 14px}
.pl-bar .chips{display:flex;flex-wrap:wrap;gap:6px;align-items:center}
.pl-bar .brand-dot{display:inline-block;width:8px;height:8px;border-radius:50%}
.pl-sep{width:1px;height:22px;background:var(--line);margin:0 4px}
.pl-board{display:grid;grid-template-columns:repeat(var(--pl-cols,4),minmax(220px,1fr));gap:12px;align-items:start;overflow-x:auto}
.pl-col{background:#f0f0f1;border-radius:var(--radius);padding:10px;min-height:120px;display:flex;flex-direction:column;gap:8px}
.pl-col-head{display:flex;align-items:center;gap:8px;font-weight:600;font-size:13px;text-transform:uppercase;letter-spacing:.3px;color:#555;padding:2px 4px}
.pl-col-head .small{margin-left:auto;text-transform:none;letter-spacing:0;font-weight:500}
.pl-col-won{background:#eef7f0}
.pl-col-lost{background:#f6f2f2}
.pl-card{display:flex;flex-direction:column;gap:4px;background:#fff;border:1px solid var(--line);border-left:3px solid var(--brand-accent,#ccc);border-radius:9px;padding:10px 12px;color:var(--ink);text-decoration:none;box-shadow:0 1px 2px rgba(0,0,0,.03)}
.pl-card:hover{border-color:#d4d4d4;box-shadow:0 3px 10px rgba(0,0,0,.06)}
.pl-card-name{font-weight:600;line-height:1.3}
.pl-card-meta{font-size:12px;color:var(--muted)}
.pl-card-next{font-size:12.5px;line-height:1.35}
.pl-card-foot{display:flex;justify-content:space-between;align-items:center;gap:6px;margin-top:2px}
.pl-due{font-size:11.5px;font-weight:600;color:var(--muted)}
.pl-due.pl-due-overdue{color:var(--red)}
.pl-due.pl-due-today{color:#b26a00}
.pl-card.pl-due-overdue{background:#fffafa}
.pl-stage{display:inline-block;font-size:11.5px;font-weight:600;border-radius:5px;padding:2px 8px;background:#f0f0f1;color:#555}
.pl-stage-talking{background:#e8f1ff;color:#1259c3}
.pl-stage-proposal{background:#fff3e0;color:#b26a00}
.pl-stage-won{background:#e8f7ec;color:#1a7f3c}
.pl-stage-lost{background:#f3eded;color:#8a4b4b}
.pl-list table td{vertical-align:top}
.pl-list tr.pl-due-overdue td:first-child{box-shadow:inset 3px 0 0 var(--red)}
.pl-head-meta{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-top:4px}
.pl-deal{display:grid;grid-template-columns:minmax(0,1fr) minmax(280px,360px);gap:18px;align-items:start}
.pl-deal-form{display:grid;grid-template-columns:repeat(auto-fit,minmax(170px,1fr));gap:10px 12px;align-items:end}
.pl-deal-form label{margin:0}
.pl-deal-form select,.pl-deal-form input{margin:0;width:100%}
.pl-deal-actions{display:flex;gap:8px}
.pl-facts{display:grid;grid-template-columns:auto 1fr;gap:6px 14px;margin:0}
.pl-facts dt{color:var(--muted);font-size:13px}
.pl-facts dd{margin:0;font-weight:500}
.pl-next{margin:14px 0 0;padding-top:12px;border-top:1px solid var(--line)}
.pl-next .pl-due{margin-left:6px}
.pl-touches,.pl-events{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:12px}
.pl-touches li{display:flex;flex-direction:column;gap:2px;padding-bottom:10px;border-bottom:1px solid #f3f3f3}
.pl-touches li:last-child{border-bottom:0}
.pl-person{padding:8px 0;border-bottom:1px solid #f3f3f3}
.pl-person:last-of-type{border-bottom:0}
@media (max-width:1000px){ .pl-deal{grid-template-columns:minmax(0,1fr)} .pl-board{grid-template-columns:repeat(var(--pl-cols,4),minmax(240px,1fr))} }

/* ---- v178: the compact access matrix (Users) ------------------------------ */
.user-form-card{max-width:1100px}
.user-form-card > form > label,.user-form-card > form > .grid-2,.user-form-card #roleNote{max-width:620px}
.mx-tools{display:flex;flex-wrap:wrap;align-items:center;gap:6px;margin:4px 0 8px}
.mx-more-toggle{margin-left:auto!important}
.mx-summary{background:#fff;border:1px solid var(--line);border-radius:8px;padding:8px 10px;margin:0 0 10px;line-height:1.55}
.mx-wrap{overflow-x:auto}
table.mx{border-collapse:separate;border-spacing:3px;width:100%}
.mx th,.mx td{padding:0;text-align:center}
.mx th.mx-cat{text-align:left;font-weight:500;font-size:13px;padding:0 10px 0 2px;white-space:nowrap;width:1%}
.mx-opt{font-size:10px;font-weight:600;color:#b26a00;background:#fff3e0;border-radius:4px;padding:1px 5px;margin-left:4px;vertical-align:1px}
.mx tr.mx-group th{text-align:left;font-size:11px;font-weight:700;letter-spacing:.4px;text-transform:uppercase;color:var(--muted);padding:10px 2px 2px}
.mx-colbtn{display:inline-flex;align-items:center;gap:5px;border:0;background:none;font:inherit;font-size:12px;font-weight:600;cursor:pointer;padding:4px 2px;white-space:nowrap;color:var(--ink)}
.mx-colbtn:hover{text-decoration:underline}
.mx-colbtn .brand-dot{width:8px;height:8px;border-radius:50%;display:inline-block}
.mx-cell{width:100%;min-width:56px;height:30px;border:1px solid var(--line);border-radius:6px;background:#fff;font:inherit;font-size:12px;font-weight:600;cursor:pointer;color:var(--ink)}
.mx-cell:hover{border-color:#bbb}
.mx-cell.mx-view{background:#f3f8ff;border-color:#8fb7ff;color:#1259c3}
.mx-cell.mx-edit{background:#e7f7ed;border-color:#7fd0a0;color:#1a7f3c}
.mx td.mx-na{background:repeating-linear-gradient(135deg,transparent 0 5px,#f3f3f4 5px 6px);border-radius:6px}
.mx-rowbtn{border:0;background:none;font:inherit;font-size:11.5px;color:var(--muted);cursor:pointer;padding:0 6px}
.mx-rowbtn:hover{color:var(--ink);text-decoration:underline}
.mx .mx-more{display:none}
.mx.mx-show-more .mx-more{display:table-cell}
.mx-legend{margin:6px 0 0}

/* v181: screenshots in documents open full size (zoomable on a phone), and the
   WOW Creators tutorial page inside the module. */
.rt-img-link{display:block;cursor:zoom-in}
.help-doc .doc-rendered{max-width:78ch}
@media (max-width:640px){
  .doc-rendered{font-size:15px;line-height:1.6}
  .doc-rendered .rt-img{margin:10px -4px;max-width:calc(100% + 8px)}
}

/* ---- v188: the WOW Creators staff guide (/admin/creator/help) ----
   The tutorial in a readable column with "On this page" and quick links beside
   it on a wide screen, so the card no longer runs a 78ch column inside a
   full-width box. Under 1100px the side panel moves above the guide. */
.help-wrap{display:grid;grid-template-columns:minmax(0,1fr);gap:16px;align-items:start}
.help-main{min-width:0;display:flex;flex-direction:column;gap:16px}
.help-main .help-doc{padding:28px 32px}
.help-doc .doc-rendered{max-width:760px;margin:0 auto;font-size:15px;line-height:1.7}
.help-doc .doc-rendered h3.rt-h{font-size:19px;margin:34px 0 10px;padding-top:22px;border-top:1px solid #eee;scroll-margin-top:16px}
.help-doc .doc-rendered .rt-img{border:1px solid #e6e6e6;border-radius:12px;box-shadow:0 6px 18px rgba(0,0,0,.06)}
.help-faq{padding:28px 32px}
.help-faq-in{max-width:760px;margin:0 auto}
.help-faq-h{font-size:20px;margin:0 0 4px}
.help-faq-group{font-size:12px;font-weight:700;letter-spacing:.08em;text-transform:uppercase;color:#e11;margin:24px 0 4px}
.help-q{border-bottom:1px solid #eee}
.help-q summary{cursor:pointer;list-style:none;position:relative;padding:13px 34px 13px 0;font-weight:600;font-size:14.5px}
.help-q summary::-webkit-details-marker{display:none}
.help-q summary::after{content:"+";position:absolute;right:0;top:10px;width:24px;height:24px;border-radius:50%;
  display:grid;place-items:center;background:#f2f2f2;font-weight:600}
.help-q[open] summary::after{content:"\2013";background:#111;color:#fff}
.help-q p{margin:0 0 14px;line-height:1.65;color:#444;font-size:14.5px}
.help-side{display:grid;grid-template-columns:1fr;gap:12px}
.help-side-card{padding:16px 18px}
.help-side-h{font-size:11px;font-weight:700;letter-spacing:.08em;text-transform:uppercase;color:#888;margin-bottom:8px}
.help-toc,.help-links{display:flex;flex-wrap:wrap;gap:6px}
.help-toc a,.help-links a{font-size:13px;color:#222;text-decoration:none;padding:6px 10px;border-radius:8px;background:#f5f5f5}
.help-toc a:hover,.help-links a:hover{background:#ececec}
.help-toc a.on{background:#111;color:#fff}
.help-toc a.help-toc-faq{font-weight:600}
@media (min-width:1100px){
  .help-wrap{grid-template-columns:minmax(0,1fr) 270px}
  .help-side{position:sticky;top:16px;max-height:calc(100vh - 32px);overflow:auto}
  .help-toc,.help-links{flex-direction:column;flex-wrap:nowrap;gap:2px}
  .help-toc a,.help-links a{background:none;padding:6px 10px;border-left:2px solid transparent;border-radius:0 8px 8px 0}
  .help-toc a:hover,.help-links a:hover{background:#f5f5f5}
  .help-toc a.on{background:#f5f5f5;color:#111;border-left-color:#e11;font-weight:600}
  .help-wrap{grid-template-areas:"main side"}
  .help-main{grid-area:main} .help-side{grid-area:side}
}
@media (max-width:1099px){
  .help-side{order:-1}
  .help-toc a.help-toc-faq{background:#111;color:#fff}
  /* One swipeable row, so the guide starts on the first screen. */
  .help-toc{flex-wrap:nowrap;overflow-x:auto;-webkit-overflow-scrolling:touch;scrollbar-width:none;margin:0 -4px;padding:0 4px 2px}
  .help-toc::-webkit-scrollbar{display:none}
  .help-toc a{white-space:nowrap;flex:none}
}
@media (max-width:640px){
  .help-main .help-doc,.help-faq{padding:18px 16px}
  .help-side-links{display:none}
}
