/* ==========================================================================
   RUHAH CHANNELS — design system
   The same hand as the RUHAH brand dashboard (ruhah2/dashboard/static/dashboard/
   dashboard.css): a desk with white sheets on it, black ink, hairline borders,
   Inter + Instrument Serif + Roboto Mono, Material Symbols icons. The only
   change of colour: the desk is a soft pink instead of beige.
   ========================================================================== */

@font-face {
    font-family: 'Material Symbols Outlined';
    font-style: normal;
    font-weight: 100 700;
    font-display: block;
    src: url('fonts/Material-Symbols-Outlined.woff2') format('woff2');
}

:root {
    --d-bg: #FAEEF1;            /* the desk */
    --d-bg-deep: #F3DFE5;       /* pressed / hover on the desk */
    --d-bg-rgb: 250, 238, 241;
    --d-sheet: #FFFFFF;         /* panels */
    --d-sheet-soft: #FDF8F9;    /* row hover, panel footers */
    --d-pink: #E79DB3;          /* the one accent: selection rings, today */
    --d-pink-soft: #F8DCE4;
    --d-ink: #0B0B0B;
    --d-ink-2: #5A4D52;         /* secondary text */
    --d-ink-3: #9A8B91;         /* captions, labels */
    --d-line: rgba(11, 11, 11, 0.10);
    --d-line-strong: rgba(11, 11, 11, 0.85);
    --d-up: #1F7A4D;
    --d-down: #B3261E;
    --d-warn: #9A6B00;
    --d-radius: 12px;
    --d-radius-s: 8px;
    --d-side: 224px;
    --d-font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --d-serif: 'Instrument Serif', 'Times New Roman', serif;
    --d-mono: 'Roboto Mono', ui-monospace, monospace;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body { font-family: var(--d-font); font-size: 13.5px; line-height: 1.45; color: var(--d-ink); background: var(--d-bg); -webkit-font-smoothing: antialiased; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
img, video { display: block; max-width: 100%; }
[hidden] { display: none !important; }

/* Icons: Material Symbols Outlined (the set the RUHAH dashboard uses). */
.ms { font-family: 'Material Symbols Outlined'; font-weight: 300; font-style: normal; font-size: 20px; line-height: 1; letter-spacing: normal; text-transform: none; display: inline-block; white-space: nowrap; direction: ltr; -webkit-font-smoothing: antialiased; font-variation-settings: 'FILL' 0, 'wght' 300, 'GRAD' 0, 'opsz' 20; user-select: none; flex: none; }
.ms.fill, .active > .ms { font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 20; }
.ms.s14 { font-size: 14px; } .ms.s16 { font-size: 16px; } .ms.s18 { font-size: 18px; } .ms.s24 { font-size: 24px; } .ms.s34 { font-size: 34px; }
.pf-icon { display: inline-block; flex: none; }

/* ---- Shell: side column + main ------------------------------------------ */
.dash-side { position: fixed; inset: 0 auto 0 0; width: var(--d-side); display: flex; flex-direction: column; padding: 12px 12px 22px; border-right: 1px solid var(--d-line); z-index: 60; overflow-y: auto; }
.dash-brandmark { position: relative; display: block; height: 13px; margin: 10px 10px; text-decoration: none; }
.dash-rule { height: 1px; margin: 12px -12px; background: var(--d-line); flex: none; }
.dash-nav > .dash-rule { margin: 10px -12px; }
.dash-mark { position: absolute; inset: 0; display: flex; align-items: center; transition: opacity 0.9s ease-in-out, filter 0.9s ease-in-out; }
.dash-mark.logo img { height: 13px; width: auto; }
.dash-mark.title { font-family: var(--d-serif); font-size: 19px; line-height: 1; letter-spacing: 0.04em; color: var(--d-ink); opacity: 0; filter: blur(5px); }
.dash-side:hover .dash-mark.logo { opacity: 0; filter: blur(5px); }
.dash-side:hover .dash-mark.title { opacity: 1; filter: blur(0); }
@media (prefers-reduced-motion: reduce) { .dash-mark { transition: none; } }
.dash-nav { display: flex; flex-direction: column; gap: 2px; }
.dash-nav-label { font-family: var(--d-mono); font-size: 9.5px; letter-spacing: 0.14em; color: var(--d-ink-3); padding: 14px 10px 6px; text-transform: uppercase; }
.dash-nav a, .dash-nav button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; border-radius: var(--d-radius-s); background: none; text-decoration: none; text-align: left; font-size: 13px; font-weight: 400; color: var(--d-ink-2); cursor: pointer; transition: background 0.15s, color 0.15s; }
.dash-nav a:hover, .dash-nav button:hover { background: var(--d-bg-deep); color: var(--d-ink); }
.dash-nav a.active { background: var(--d-sheet); color: var(--d-ink); font-weight: 500; box-shadow: 0 0 0 1px var(--d-line); }
.dash-nav .count { margin-left: auto; font-size: 11px; color: var(--d-ink-3); font-variant-numeric: tabular-nums; }
.dash-side-foot { margin-top: auto; padding-top: 12px; }
.dash-user { display: flex; align-items: center; gap: 10px; margin: 12px -12px 0; padding: 22px 22px 0; border-top: 1px solid var(--d-line); }
.dash-user-badge { width: 30px; height: 30px; border-radius: 50%; background: var(--d-ink); color: #fff; display: grid; place-items: center; font-size: 12px; font-weight: 600; text-transform: uppercase; flex: none; overflow: hidden; text-decoration: none; }
.dash-user-name { flex: 1; min-width: 0; font-size: 12.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--d-ink); text-decoration: none; }
.dash-user-name small { display: block; font-size: 11px; font-weight: 400; color: var(--d-ink-3); }
.dash-user-out { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 6px; color: var(--d-ink-2); text-decoration: none; }
.dash-user-out:hover { background: var(--d-bg-deep); color: var(--d-ink); }

.dash-main { margin-left: var(--d-side); min-height: 100vh; padding: 26px 32px 80px; }
.dash-wrap { width: 100%; max-width: 1320px; margin: 0 auto; }
.dash-wrap.narrow { max-width: 860px; }
.dash-topbar { display: none; }
.dash-dock { display: none; }

/* Workspace switcher: the first thing in the side column. */
.ws { position: relative; }
.ws-current { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 1px solid var(--d-line); border-radius: var(--d-radius-s); background: var(--d-sheet); font-size: 13px; font-weight: 500; cursor: pointer; text-align: left; }
.ws-current:hover { border-color: var(--d-line-strong); }
.ws-current span.name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ws-menu { position: absolute; left: 0; right: 0; top: calc(100% + 6px); padding: 5px; background: var(--d-sheet); border: 1px solid var(--d-line); border-radius: var(--d-radius); box-shadow: 0 12px 30px rgba(11, 11, 11, 0.08); z-index: 5; }
.ws-menu button, .ws-menu a { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 9px; border: 0; border-radius: 6px; background: none; font-size: 12.5px; color: var(--d-ink-2); text-decoration: none; cursor: pointer; text-align: left; }
.ws-menu button:hover, .ws-menu a:hover { background: var(--d-bg); color: var(--d-ink); }
.ws-menu .on { color: var(--d-ink); font-weight: 500; }
.ws-menu hr { border: 0; height: 1px; margin: 5px -5px; background: var(--d-line); }

/* ---- Page head ---------------------------------------------------------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding-bottom: 16px; margin-bottom: 18px; border-bottom: 1px solid var(--d-line); }
.page-title { font-family: var(--d-serif); font-weight: 400; font-size: 34px; line-height: 1.05; letter-spacing: -0.01em; }
.page-sub { margin-top: 4px; font-size: 12.5px; color: var(--d-ink-2); }
.page-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* ---- Sheets (panels) ---------------------------------------------------- */
.panel { background: var(--d-sheet); border: 1px solid var(--d-line); border-radius: var(--d-radius); min-width: 0; }
.panel + .panel { margin-top: 14px; }
.grid > .panel + .panel { margin-top: 0; }
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 16px 18px 0; }
.panel-title { font-family: var(--d-serif); font-size: 21px; font-weight: 400; line-height: 1.15; }
.panel-note { margin-top: 2px; font-size: 12px; color: var(--d-ink-3); }
.panel-body { padding: 14px 18px 18px; }
.panel-foot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 12px 18px; border-top: 1px solid var(--d-line); background: var(--d-sheet-soft); border-radius: 0 0 var(--d-radius) var(--d-radius); font-size: 12px; color: var(--d-ink-2); }
.eyebrow { font-family: var(--d-mono); font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--d-ink-3); }
.grid { display: grid; gap: 14px; }
.grid.c2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.c3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.c4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.muted { color: var(--d-ink-3); }
.num { font-variant-numeric: tabular-nums; }
.kpi-value { font-family: var(--d-serif); font-size: 44px; line-height: 1; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.row { display: flex; align-items: center; gap: 8px; }
.row.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }

/* ---- Controls ----------------------------------------------------------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 34px; padding: 0 14px; border-radius: var(--d-radius-s); border: 1px solid var(--d-ink); background: var(--d-ink); color: #fff; font-size: 12.5px; font-weight: 500; text-decoration: none; cursor: pointer; white-space: nowrap; transition: opacity 0.15s, background 0.15s; }
.btn:hover { opacity: 0.86; }
.btn:disabled { opacity: 0.35; cursor: default; }
.btn.ghost { background: var(--d-sheet); color: var(--d-ink); border-color: var(--d-line); }
.btn.ghost:hover { opacity: 1; border-color: var(--d-line-strong); }
.btn.danger { background: var(--d-sheet); color: var(--d-down); border-color: rgba(179, 38, 30, 0.35); }
.btn.sm { height: 28px; padding: 0 10px; font-size: 12px; }
.btn.lg { height: 42px; font-size: 13px; }
.btn.block { width: 100%; }
.seg { display: inline-flex; padding: 3px; gap: 2px; background: var(--d-bg-deep); border-radius: var(--d-radius-s); }
.panel .seg { background: var(--d-bg); }
.seg button, .seg a { display: inline-flex; align-items: center; height: 26px; padding: 0 11px; border: 0; border-radius: 6px; background: none; font-size: 12px; color: var(--d-ink-2); cursor: pointer; white-space: nowrap; text-decoration: none; }
.seg button:hover, .seg a:hover { color: var(--d-ink); }
.seg .active { background: var(--d-sheet); color: var(--d-ink); font-weight: 500; box-shadow: 0 0 0 1px var(--d-line); }
.seg.full { display: flex; } .seg.full > * { flex: 1; justify-content: center; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 11px; border-radius: 999px; border: 1px solid var(--d-line); background: var(--d-sheet); font-size: 12px; color: var(--d-ink-2); cursor: pointer; white-space: nowrap; }
.chip:hover { border-color: var(--d-line-strong); color: var(--d-ink); }
.chip.active { background: var(--d-ink); border-color: var(--d-ink); color: #fff; }
.chip.active .pf-icon { filter: invert(1); }
.input, .select { height: 34px; padding: 0 11px; border: 1px solid var(--d-line); border-radius: var(--d-radius-s); background: var(--d-sheet); font-size: 12.5px; outline: none; min-width: 0; }
.input:focus, .select:focus { border-color: var(--d-line-strong); }
.input.block, .select.block { display: block; width: 100%; }
textarea.input { height: auto; padding: 9px 11px; resize: vertical; line-height: 1.5; }
.label { display: block; margin-bottom: 6px; font-size: 12px; color: var(--d-ink-2); }
.help { margin-top: 5px; font-size: 11.5px; color: var(--d-ink-3); }
.form-row + .form-row { margin-top: 14px; }

/* A real checkbox drawn as the dashboard's switch. */
.switch { position: relative; display: inline-block; width: 30px; height: 18px; flex: none; }
.switch input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; margin: 0; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: rgba(11, 11, 11, 0.16); transition: background 0.18s; }
.switch span::after { content: ''; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 0.5px rgba(0, 0, 0, 0.08); transition: transform 0.18s; }
.switch input:checked + span { background: var(--d-ink); }
.switch input:checked + span::after { transform: translateX(12px); }

/* Settings rows: a label on the left, its control on the right, a hairline between. */
.field-list { padding: 6px 18px 8px; }
.field { display: grid; grid-template-columns: minmax(0, 220px) minmax(0, 1fr); align-items: center; gap: 14px; min-height: 52px; padding: 8px 0; }
.field + .field { border-top: 1px solid var(--d-line); }
.field > label, .field > .field-name { display: flex; align-items: center; gap: 10px; font-size: 12.5px; color: var(--d-ink-2); min-width: 0; }
.field > label .ms, .field > .field-name .ms { color: var(--d-ink-3); font-size: 18px; }
.field .input, .field .select { width: 100%; height: 36px; }
.field .readonly-value { font-size: 13px; font-weight: 500; overflow-wrap: anywhere; }
.field .end { justify-self: end; }

/* ---- Status ------------------------------------------------------------- */
.tag { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 9px; border-radius: 999px; background: var(--d-bg); font-size: 11px; font-weight: 500; color: var(--d-ink-2); white-space: nowrap; }
.tag::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--d-ink-3); }
.tag.ok { background: #DCF0E2; color: #17603B; } .tag.ok::before { background: var(--d-up); }
.tag.warn { background: #FBEECB; color: #7A5600; } .tag.warn::before { background: var(--d-warn); }
.tag.bad { background: #F9DDDA; color: #8F1F18; } .tag.bad::before { background: var(--d-down); }
.tag.info { background: #DBE8F8; color: #1D4E89; } .tag.info::before { background: #2F6DB5; }
.tag.ink { background: var(--d-bg-deep); color: var(--d-ink); } .tag.ink::before { background: var(--d-ink); }
.tag.plain::before { display: none; }

/* ---- Tables and rows ---------------------------------------------------- */
.table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.table th { padding: 8px 10px; text-align: left; font-family: var(--d-mono); font-size: 10px; font-weight: 400; letter-spacing: 0.1em; text-transform: uppercase; color: var(--d-ink-3); border-bottom: 1px solid var(--d-line); white-space: nowrap; }
.table td { padding: 9px 10px; border-bottom: 1px solid var(--d-line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table .r { text-align: right; }
.table th:first-child, .table td:first-child { padding-left: 18px; }
.table th:last-child, .table td:last-child { padding-right: 18px; }
.mono { font-family: var(--d-mono); font-size: 12px; }

/* Post rows: picture first, then the words, then where and when (as the dashboard's orders). */
.list-panel { overflow: hidden; }
.list-head, .prow { display: grid; grid-template-columns: 120px minmax(0, 1.6fr) minmax(0, 0.9fr) 150px minmax(110px, auto) 20px; align-items: center; gap: 18px; padding: 0 18px; }
.list-head { height: 36px; font-family: var(--d-mono); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--d-ink-3); }
.prow { padding-top: 12px; padding-bottom: 12px; cursor: pointer; transition: background 0.12s; outline: none; box-shadow: 0 -1px 0 var(--d-line); }
.prow:hover, .prow:focus-visible { background: var(--d-sheet-soft); }
.o-pics { display: flex; gap: 6px; min-width: 0; }
.o-pic { position: relative; flex: none; width: 52px; height: 52px; border-radius: 7px; background: var(--d-bg); overflow: hidden; display: grid; place-items: center; color: var(--d-ink-3); }
.o-pic img, .o-pic video { width: 100%; height: 100%; object-fit: cover; }
.o-pic.more { font-size: 12px; font-weight: 500; color: var(--d-ink-2); }
.p-caption { font-size: 13px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.p-caption.empty-caption { color: var(--d-ink-3); }
.p-when { font-size: 12.5px; color: var(--d-ink-2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.p-when small { display: block; font-size: 11.5px; color: var(--d-ink-3); }
.o-go { color: var(--d-ink-3); }
.prow:hover .o-go { color: var(--d-ink); }

/* Account faces: a round picture with the platform's mark on its corner. */
.faces { display: flex; flex-wrap: wrap; gap: 6px; }
.face { position: relative; width: 30px; height: 30px; flex: none; }
.face-pic { width: 100%; height: 100%; border-radius: 50%; background: var(--d-bg-deep); overflow: hidden; display: grid; place-items: center; font-size: 11px; font-weight: 600; text-transform: uppercase; color: var(--d-ink-2); }
.face-pic img { width: 100%; height: 100%; object-fit: cover; }
.face-mark { position: absolute; right: -4px; bottom: -3px; width: 16px; height: 16px; border-radius: 50%; background: var(--d-sheet); display: grid; place-items: center; box-shadow: 0 0 0 1px var(--d-line); }
.face.lg { width: 44px; height: 44px; }
.face.lg .face-mark { width: 20px; height: 20px; }

.empty { padding: 34px 18px; text-align: center; font-size: 12.5px; color: var(--d-ink-3); }
.no-data { padding: 56px 18px; text-align: center; font-size: 13px; line-height: 1.6; color: var(--d-ink-3); }
.no-data .ms { display: block; margin: 0 auto 8px; font-size: 28px; }
.no-data .btn { margin-top: 14px; }
.desk-empty { background: var(--d-sheet); border: 1px dashed rgba(11, 11, 11, 0.16); border-radius: var(--d-radius); }

/* ---- Toast (Django messages) -------------------------------------------- */
#toast { position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%) translateY(16px); display: flex; align-items: center; gap: 8px; background: var(--d-ink); color: #fff; padding: 11px 16px; border-radius: 10px; font-size: 12.5px; font-weight: 500; z-index: 3000; opacity: 0; pointer-events: none; transition: opacity 0.25s ease, transform 0.25s ease; max-width: calc(100vw - 32px); }
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
#toast.bad { background: var(--d-down); }

/* ---- The right-hand sheet (the dashboard's overlay: slides in, desk blurs) -- */
#sheet-root { position: fixed; top: 0; right: -100%; width: 100%; height: 100%; z-index: 2000; display: none; transition: right 0.4s ease-in-out; }
#sheet-root.open { right: 0; }
#sheet-backdrop { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(var(--d-bg-rgb), 0.35); backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px); opacity: 0; transition: opacity 0.4s ease-in-out; pointer-events: none; z-index: 2001; }
#sheet-root.open #sheet-backdrop { opacity: 1; pointer-events: auto; }
#sheet { position: absolute; top: 0; right: 0; width: max(25%, 440px); max-width: 100%; height: 100%; background: var(--d-sheet); border-left: 1px solid var(--d-line); z-index: 2002; display: flex; flex-direction: column; }
.sheet-head { display: flex; align-items: center; gap: 10px; padding: 18px 22px 16px; border-bottom: 1px solid var(--d-line); flex-shrink: 0; }
.sheet-head .ms { color: var(--d-ink-2); }
.sheet-title { flex: 1; font-family: var(--d-serif); font-size: 24px; line-height: 1.1; }
.sheet-close { display: grid; place-items: center; width: 28px; height: 28px; border: 0; border-radius: 6px; background: none; color: var(--d-ink-2); cursor: pointer; }
.sheet-close:hover { background: var(--d-bg); color: var(--d-ink); }
#sheet-body { padding: 18px 22px 28px; overflow-y: auto; flex: 1; font-size: 13px; }
.sheet-card { margin-top: 12px; padding: 7px 12px; border: 1px solid var(--d-line); border-radius: var(--d-radius); }
.sheet-card:first-child { margin-top: 0; }
.sheet-card-title { padding: 6px 0 4px; font-family: var(--d-mono); font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--d-ink-3); }
.sheet-line { display: flex; justify-content: space-between; gap: 16px; padding: 6px 0; font-size: 13px; color: var(--d-ink-2); }
.sheet-line > span:last-child { text-align: right; color: var(--d-ink); overflow-wrap: anywhere; }
.sheet-text { padding: 4px 0 8px; font-size: 13px; line-height: 1.55; white-space: pre-line; overflow-wrap: anywhere; }
.sheet-actions { display: flex; gap: 8px; margin-top: 18px; }
.sheet-actions > * { flex: 1 1 0; min-width: 0; }
.sheet-actions .btn { width: 100%; height: 42px; font-size: 13px; }
.sheet-media { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; padding: 5px 0; }
.sheet-media > * { aspect-ratio: 1 / 1; border-radius: var(--d-radius-s); background: var(--d-bg); overflow: hidden; }
.sheet-media.single { grid-template-columns: minmax(0, 1fr); }
.sheet-media.single > * { aspect-ratio: auto; max-height: 360px; }
.sheet-media img, .sheet-media video { width: 100%; height: 100%; object-fit: cover; }
.sheet-media.single img, .sheet-media.single video { object-fit: contain; max-height: 360px; }
.target { display: flex; gap: 12px; align-items: flex-start; padding: 11px 0; }
.target + .target { border-top: 1px solid var(--d-line); }
.target-body { flex: 1; min-width: 0; }
.target-name { font-size: 13px; font-weight: 500; }
.target-meta { margin-top: 2px; font-size: 12px; color: var(--d-ink-3); overflow-wrap: anywhere; }
.target-meta.bad { color: var(--d-down); }
.target-meta a { text-decoration: underline; text-underline-offset: 2px; }
.notes { display: grid; gap: 8px; margin: 0 0 16px; padding: 0; list-style: none; font-size: 12.5px; color: var(--d-ink-2); }
.notes li { display: flex; gap: 8px; }
.notes .ms { font-size: 16px; color: var(--d-ink-3); margin-top: 1px; }
.codeline { display: block; padding: 9px 11px; border: 1px solid var(--d-line); border-radius: var(--d-radius-s); background: var(--d-bg); font-family: var(--d-mono); font-size: 11.5px; overflow-wrap: anywhere; user-select: all; }
pre.codeline { white-space: pre-wrap; }

/* ---- New post: the kinds ------------------------------------------------ */
.kind-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.kind { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 46px 18px 26px; background: var(--d-sheet); border: 1px dashed rgba(11, 11, 11, 0.18); border-radius: var(--d-radius); text-decoration: none; text-align: center; transition: border-color 0.15s, background 0.15s; }
.kind:hover { border-style: solid; border-color: var(--d-line-strong); }
.kind .ms { font-size: 44px; color: var(--d-ink-3); }
.kind:hover .ms { color: var(--d-ink); }
.kind-name { font-family: var(--d-serif); font-size: 26px; line-height: 1.1; }
.kind-where { display: flex; gap: 9px; margin-top: 14px; opacity: 0.45; }
.kind:hover .kind-where { opacity: 1; }

/* ---- Composer ----------------------------------------------------------- */
.composer { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 14px; align-items: start; }
.composer-side { position: sticky; top: 26px; display: grid; gap: 14px; }
.composer-side .panel + .panel { margin-top: 0; }
.pick { display: flex; flex-wrap: wrap; gap: 10px; }
.pick-item { position: relative; display: flex; align-items: center; gap: 9px; padding: 6px 12px 6px 6px; border: 1px solid var(--d-line); border-radius: 999px; background: var(--d-sheet); font-size: 12.5px; color: var(--d-ink-2); cursor: pointer; }
.pick-item:hover { border-color: var(--d-line-strong); color: var(--d-ink); }
.pick-item.on { border-color: var(--d-ink); color: var(--d-ink); font-weight: 500; box-shadow: 0 0 0 1px var(--d-ink); }
.pick-item.dead { opacity: 0.5; }
.pick-item .check { display: none; color: var(--d-ink); }
.pick-item.on .check { display: inline-block; }
.drop { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 150px; padding: 22px; border: 1px dashed rgba(11, 11, 11, 0.2); border-radius: var(--d-radius); background: var(--d-sheet-soft); text-align: center; cursor: pointer; transition: border-color 0.15s, background 0.15s; }
.drop:hover, .drop.over { border-color: var(--d-line-strong); background: var(--d-pink-soft); }
.drop .ms { font-size: 34px; color: var(--d-ink-3); }
.drop strong { font-size: 13.5px; font-weight: 500; }
.drop small { font-size: 12px; color: var(--d-ink-3); }
.thumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.thumb { position: relative; width: 76px; height: 76px; border-radius: var(--d-radius-s); background: var(--d-bg); overflow: hidden; cursor: pointer; }
.thumb.on { outline: 2px solid var(--d-ink); outline-offset: 2px; }
.thumb img, .thumb video { width: 100%; height: 100%; object-fit: cover; }
.thumb button { position: absolute; top: 4px; right: 4px; width: 20px; height: 20px; border: 0; border-radius: 50%; background: var(--d-ink); color: #fff; display: grid; place-items: center; cursor: pointer; opacity: 0; transition: opacity 0.15s; }
.thumb:hover button { opacity: 1; }
.thumb.busy { display: grid; place-items: center; color: var(--d-ink-3); font-size: 11px; }
.caption-box { position: relative; }
.caption-box textarea { width: 100%; min-height: 130px; padding-bottom: 28px; font-size: 13.5px; }
.counter { position: absolute; right: 11px; bottom: 9px; font-size: 11.5px; color: var(--d-ink-3); font-variant-numeric: tabular-nums; pointer-events: none; }
.counter.over { color: var(--d-down); font-weight: 500; }
.config { margin-top: 12px; border: 1px solid var(--d-line); border-radius: var(--d-radius); background: var(--d-sheet); }
.config-head { display: flex; align-items: center; gap: 9px; padding: 11px 14px; font-size: 12.5px; font-weight: 500; }
.config-body { padding: 4px 14px 14px; border-top: 1px solid var(--d-line); }
.config-body .form-row:first-child { margin-top: 12px; }
.opt-toggle { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 0; font-size: 12.5px; color: var(--d-ink-2); }
.opt-toggle + .opt-toggle { border-top: 1px solid var(--d-line); }
.preview { aspect-ratio: 4 / 5; border-radius: var(--d-radius-s); background: var(--d-bg); overflow: hidden; display: grid; place-items: center; color: var(--d-ink-3); font-size: 12px; }
.preview img, .preview video { width: 100%; height: 100%; object-fit: contain; }
.problems { margin-top: 12px; padding: 10px 12px; border-radius: var(--d-radius-s); background: #F9DDDA; color: #8F1F18; font-size: 12.5px; line-height: 1.5; }
.problems div + div { margin-top: 4px; }
.quick { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }

/* ---- Calendar ----------------------------------------------------------- */
.cal { overflow: hidden; }
.cal-head, .cal-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-head div { padding: 9px 10px; font-family: var(--d-mono); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--d-ink-3); border-bottom: 1px solid var(--d-line); }
.cal-day { min-height: 118px; padding: 7px 7px 8px; border-bottom: 1px solid var(--d-line); border-right: 1px solid var(--d-line); min-width: 0; }
.cal-day:nth-child(7n) { border-right: 0; }
.cal-week:last-child .cal-day { border-bottom: 0; }
.cal-day.out { background: var(--d-sheet-soft); }
.cal-day.out .cal-num { color: var(--d-ink-3); opacity: 0.6; }
.cal-num { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 5px; border-radius: 999px; font-size: 11.5px; color: var(--d-ink-2); font-variant-numeric: tabular-nums; }
.cal-day.today .cal-num { background: var(--d-ink); color: #fff; font-weight: 500; }
.cal-post { display: flex; align-items: center; gap: 6px; width: 100%; margin-top: 4px; padding: 4px 6px; border: 0; border-radius: 6px; background: var(--d-bg); font-size: 11.5px; color: var(--d-ink); cursor: pointer; text-align: left; }
.cal-post:hover { background: var(--d-bg-deep); }
.cal-post span.t { color: var(--d-ink-3); font-variant-numeric: tabular-nums; flex: none; }
.cal-post span.c { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.cal-post.bad { background: #F9DDDA; } .cal-post.ok { background: #E7F4EB; }

/* ---- Connections -------------------------------------------------------- */
.conn { display: flex; align-items: center; gap: 14px; padding: 14px 18px; }
.conn + .conn { border-top: 1px solid var(--d-line); }
.conn-mark { width: 38px; height: 38px; border-radius: 10px; background: var(--d-bg); display: grid; place-items: center; flex: none; }
.conn-name { width: 110px; font-size: 13.5px; font-weight: 500; flex: none; }
.conn-accounts { flex: 1; display: flex; flex-wrap: wrap; gap: 8px; min-width: 0; }
.acct { display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 6px 0 4px; border: 1px solid var(--d-line); border-radius: 999px; background: var(--d-sheet); font-size: 12.5px; }
.acct.dead { border-color: rgba(179, 38, 30, 0.35); color: var(--d-down); }
.acct .face { width: 24px; height: 24px; }
.acct button { display: grid; place-items: center; width: 20px; height: 20px; border: 0; border-radius: 50%; background: none; color: var(--d-ink-3); cursor: pointer; }
.acct button:hover { background: var(--d-bg); color: var(--d-down); }

/* ---- Plans -------------------------------------------------------------- */
.plan { display: flex; flex-direction: column; padding: 20px; }
.plan.current { border-color: var(--d-ink); box-shadow: 0 0 0 1px var(--d-ink); }
.plan-price { margin: 10px 0 2px; font-family: var(--d-serif); font-size: 48px; line-height: 1; letter-spacing: -0.02em; }
.plan-price small { font-family: var(--d-font); font-size: 13px; letter-spacing: 0; color: var(--d-ink-3); margin-left: 4px; }
.plan ul { list-style: none; display: grid; gap: 8px; margin: 16px 0 20px; font-size: 12.5px; color: var(--d-ink-2); }
.plan li { display: flex; gap: 8px; align-items: center; }
.plan li .ms { font-size: 16px; color: var(--d-up); }
.plan .btn { margin-top: auto; }
.meter { height: 8px; border-radius: 999px; background: var(--d-bg); overflow: hidden; }
.meter span { display: block; height: 100%; border-radius: 999px; background: var(--d-ink); }

/* ---- Auth pages and the public site ------------------------------------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.auth-card { width: 100%; max-width: 380px; padding: 30px 28px 26px; }
.auth-logo { height: 13px; width: auto; margin-bottom: 26px; }
.auth-heading { font-family: var(--d-serif); font-weight: 400; font-size: 36px; line-height: 1.05; letter-spacing: -0.01em; }
.auth-sub { margin: 6px 0 22px; font-size: 12.5px; color: var(--d-ink-2); }
.auth-card .input { width: 100%; height: 40px; }
.auth-foot { margin-top: 18px; font-size: 12.5px; color: var(--d-ink-2); text-align: center; }
.form-error { margin-bottom: 14px; padding: 9px 11px; border-radius: var(--d-radius-s); background: #F9DDDA; color: #8F1F18; font-size: 12.5px; }
.pub-top { display: flex; align-items: center; justify-content: space-between; max-width: 1080px; margin: 0 auto; padding: 22px 24px; }
.pub-top img { height: 14px; }
.pub-top nav { display: flex; align-items: center; gap: 8px; }
.pub-hero { max-width: 860px; margin: 0 auto; padding: 70px 24px 56px; text-align: center; }
.pub-hero h1 { font-family: var(--d-serif); font-weight: 400; font-size: clamp(44px, 7vw, 78px); line-height: 1; letter-spacing: -0.02em; }
.pub-hero p { max-width: 560px; margin: 20px auto 28px; font-size: 15px; line-height: 1.6; color: var(--d-ink-2); }
.pub-marks { display: flex; justify-content: center; gap: 18px; margin-top: 34px; opacity: 0.7; }
.pub-section { max-width: 1080px; margin: 0 auto; padding: 0 24px 64px; }
.pub-section h2 { font-family: var(--d-serif); font-weight: 400; font-size: 34px; margin-bottom: 18px; text-align: center; }
.pub-feature { padding: 22px; }
.pub-feature .ms { font-size: 26px; color: var(--d-ink-2); }
.pub-feature h3 { margin: 12px 0 6px; font-family: var(--d-serif); font-weight: 400; font-size: 22px; }
.pub-feature p { font-size: 13px; line-height: 1.6; color: var(--d-ink-2); }
.pub-foot { display: flex; justify-content: center; gap: 18px; padding: 26px 24px 40px; border-top: 1px solid var(--d-line); font-size: 12px; color: var(--d-ink-3); }
.legal { max-width: 720px; margin: 0 auto; padding: 30px 24px 80px; }
.legal h1 { font-family: var(--d-serif); font-weight: 400; font-size: 44px; margin-bottom: 6px; }
.legal h2 { font-family: var(--d-serif); font-weight: 400; font-size: 24px; margin: 28px 0 8px; }
.legal p, .legal li { font-size: 14px; line-height: 1.7; color: var(--d-ink-2); }
.legal ul { padding-left: 20px; }

/* ---- Phone / narrow ------------------------------------------------------ */
@media (max-width: 1100px) {
    .composer { grid-template-columns: minmax(0, 1fr); }
    .composer-side { position: static; }
    .list-head, .prow { grid-template-columns: 64px minmax(0, 1.4fr) minmax(0, 0.8fr) 130px minmax(100px, auto) 18px; gap: 14px; }
    .o-pic.extra { display: none; }
}
@media (max-width: 900px) {
    .dash-side { display: none; }
    .dash-main { margin-left: 0; padding: 66px 14px 96px; }
    .dash-topbar { position: fixed; inset: 0 0 auto 0; height: 52px; display: flex; align-items: center; justify-content: space-between; padding: 0 16px; background: rgba(var(--d-bg-rgb), 0.86); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); border-bottom: 1px solid var(--d-line); z-index: 60; }
    .dash-topbar img { height: 12px; }
    .dash-topbar span { font-size: 12px; font-weight: 500; max-width: 55vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .dash-dock { position: fixed; left: 10px; right: 10px; bottom: calc(10px + env(safe-area-inset-bottom)); display: flex; justify-content: space-between; padding: 6px; background: rgba(255, 255, 255, 0.9); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); border: 1px solid var(--d-line); border-radius: 16px; z-index: 60; }
    .dash-dock a { flex: 1; display: grid; place-items: center; height: 40px; border-radius: 11px; color: var(--d-ink-3); text-decoration: none; }
    .dash-dock a.active { background: var(--d-ink); color: #fff; }
    .page-title { font-size: 28px; }
    .page-head { align-items: flex-start; }
    .grid.c2, .grid.c3, .grid.c4, .kind-grid { grid-template-columns: minmax(0, 1fr); }
    .kind { padding: 26px 18px 20px; }
    .list-head { display: none; }
    .prow { grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "pics caption status" "pics faces when"; align-items: start; row-gap: 6px; column-gap: 12px; padding: 12px 14px; }
    .prow .o-pics { grid-area: pics; } .prow .o-pic:nth-child(n+2) { display: none; }
    .prow .p-caption { grid-area: caption; } .prow .faces { grid-area: faces; }
    .prow .p-status { grid-area: status; justify-self: end; } .prow .p-when { grid-area: when; justify-self: end; text-align: right; }
    .o-go { display: none; }
    .field { grid-template-columns: minmax(0, 1fr); gap: 6px; padding: 12px 0; }
    .field .end { justify-self: start; }
    .cal-day { min-height: 74px; padding: 4px; }
    .cal-post span.c { display: none; }
    .conn { flex-wrap: wrap; }
    #toast { bottom: calc(80px + env(safe-area-inset-bottom)); }
}
@media (max-width: 768px) {
    /* Phone: the sheet rises from the bottom, as on the dashboard. */
    #sheet-root { right: 0; transition: none; }
    #sheet-backdrop { transition: opacity 0.2s ease; background: rgba(var(--d-bg-rgb), 0.45); }
    #sheet { top: auto; bottom: 0; left: 0; right: 0; width: 100%; height: 85vh; border-left: none; border-top: 1px solid var(--d-line); border-radius: 22px 22px 0 0; transform: translateY(100%); transition: transform 0.2s ease; overflow: hidden; }
    #sheet-root.open #sheet { transform: translateY(0); }
}
