/* W&T Studio · planner. Dark graphite + gold; light paper + terracotta. */
:root {
  --bg: #0E0E0D;
  --panel: #161614;
  --raised: #1D1D1A;
  --sunken: #121211;
  --line: #262522;
  --line-strong: #34322D;
  --text: #EFEFEB;
  --muted: #9A9791;
  --faint: #85827B;
  --accent: #C4A97D;
  --accent-hi: #D6BE96;
  --accent-ink: #14120E;
  --accent-soft: rgb(196 169 125 / .12);
  --accent-line: rgb(196 169 125 / .42);
  --scrim: rgb(6 6 5 / .62);
  --shadow-sm: 0 1px 2px rgb(0 0 0 / .35);
  --shadow: 0 2px 6px rgb(0 0 0 / .28), 0 18px 48px rgb(0 0 0 / .38);
  --st-draft: #8C8983;
  --st-ready: #7E98B8;
  --st-scheduled: #C4A97D;
  --st-publishing: #C9935A;
  --st-published: #86A580;
  --st-error: #C8695C;
  --r: 14px;
  --r-sm: 12px;
  --ease: cubic-bezier(.22, .8, .24, 1);
  --t: 200ms;
  --serif: "Cormorant Garamond", "Cormorant", Georgia, serif;
  --sans: "Onest", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --rail-w: 236px;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #F2EFE8;
  --panel: #F8F6F1;
  --raised: #FFFFFF;
  --sunken: #EAE6DD;
  --line: #E0DBD0;
  --line-strong: #CFC8BA;
  --text: #1F1D1A;
  --muted: #6B665E;
  --faint: #736D63;
  --accent: #A4472B;
  --accent-hi: #B85636;
  --accent-ink: #FFFFFF;
  --accent-soft: rgb(164 71 43 / .09);
  --accent-line: rgb(164 71 43 / .38);
  --scrim: rgb(40 34 26 / .32);
  --shadow-sm: 0 1px 2px rgb(60 45 25 / .08);
  --shadow: 0 2px 6px rgb(60 45 25 / .06), 0 18px 44px rgb(60 45 25 / .13);
  --st-draft: #8D877D;
  --st-ready: #4F74A3;
  --st-scheduled: #A07E45;
  --st-publishing: #B9762F;
  --st-published: #4F8A4A;
  --st-error: #B4472F;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg); color: var(--text);
  font: 400 14px/1.45 var(--sans);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  transition: background var(--t) var(--ease), color var(--t) var(--ease);
}
::selection { background: var(--accent); color: var(--accent-ink); }
[hidden] { display: none !important; }
button, input, textarea, select { font: inherit; color: inherit; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
* { scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 10px; border: 3px solid var(--bg); }
.muted { color: var(--muted); }
.ico { width: 18px; height: 18px; flex: none; display: block; }
kbd { font: 500 11px/1 var(--sans); padding: 3px 5px; border-radius: 5px; border: 1px solid currentColor; opacity: .55; }
.tnum { font-variant-numeric: tabular-nums; }

/* ---------- logo ---------- */
.logo-mask {
  display: block; width: 76px; aspect-ratio: 158 / 70; background: var(--accent);
  -webkit-mask: url(/img/wt-logo-mask.png) center / contain no-repeat;
  mask: url(/img/wt-logo-mask.png) center / contain no-repeat;
}

/* ---------- buttons & fields ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 36px; padding: 0 14px; border-radius: var(--r-sm);
  border: 1px solid var(--line); background: var(--panel); color: var(--text);
  cursor: pointer; white-space: nowrap; font-weight: 500;
  transition: background var(--t) var(--ease), border-color var(--t) var(--ease), color var(--t) var(--ease), transform var(--t) var(--ease), opacity var(--t);
}
.btn:hover { border-color: var(--line-strong); background: var(--raised); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: default; transform: none; }
.btn.gold { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.gold:hover { background: var(--accent-hi); border-color: var(--accent-hi); }
.btn.gold kbd { border-color: currentColor; }
.btn.quiet { background: transparent; border-color: transparent; color: var(--muted); }
.btn.quiet:hover { background: var(--panel); color: var(--text); }
.btn.danger { color: var(--st-error); }
.btn.danger:hover { border-color: color-mix(in srgb, var(--st-error) 45%, transparent); }
.btn.block { width: 100%; height: 42px; }
.btn.sm { height: 30px; padding: 0 10px; font-size: 13px; }
.icon-btn { width: 36px; padding: 0; }
.icon-btn.sm { width: 30px; height: 30px; }

.field { display: grid; gap: 6px; }
.field > span { font-size: 12px; color: var(--muted); letter-spacing: .01em; }
input:not([type=checkbox]):not([type=radio]):not([type=file]), textarea, select {
  width: 100%; height: 40px; padding: 0 12px; border-radius: var(--r-sm);
  border: 1px solid var(--line); background: var(--sunken); color: var(--text);
  transition: border-color var(--t) var(--ease), background var(--t) var(--ease);
}
textarea { height: auto; padding: 10px 12px; resize: vertical; line-height: 1.5; }
select { appearance: none; padding-right: 32px; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 17px) 17px, calc(100% - 12px) 17px; background-size: 5px 5px; background-repeat: no-repeat; }
input:hover, textarea:hover, select:hover { border-color: var(--line-strong); }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--accent-line); background: var(--panel); box-shadow: 0 0 0 3px var(--accent-soft); }
input::placeholder, textarea::placeholder { color: var(--faint); }
input:disabled, textarea:disabled { opacity: .6; }
.form-error { color: var(--st-error); min-height: 1.2em; margin: 0; font-size: 13px; }

.seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 11px; background: var(--sunken); border: 1px solid var(--line); }
.seg button { height: 28px; padding: 0 12px; border-radius: 8px; border: 0; background: transparent; color: var(--muted); cursor: pointer; font-weight: 500; display: inline-flex; align-items: center; gap: 6px; transition: background var(--t) var(--ease), color var(--t) var(--ease); }
.seg button:hover { color: var(--text); }
.seg button.on { background: var(--raised); color: var(--text); box-shadow: var(--shadow-sm); }
.seg.wide { display: flex; }
.seg.wide button { flex: 1; justify-content: center; height: 34px; }

.pill { --st: var(--st-draft); display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 9px; border-radius: 20px; font-size: 12px; font-weight: 500; white-space: nowrap; color: var(--st); background: color-mix(in srgb, var(--st) 13%, transparent); }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--st); }
.st-draft { --st: var(--st-draft); } .st-ready { --st: var(--st-ready); } .st-scheduled { --st: var(--st-scheduled); }
.st-publishing { --st: var(--st-publishing); } .st-published { --st: var(--st-published); } .st-error { --st: var(--st-error); }

.ava { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; flex: none; display: block; background: var(--raised); }
.ava-letter { display: grid; place-items: center; font: 600 13px var(--sans); color: var(--accent); border: 1px solid var(--accent-line); }

/* ---------- sign-in ---------- */
.auth { min-height: 100%; display: grid; place-items: center; padding: 24px 16px; background: radial-gradient(120% 70% at 50% 0%, var(--panel), var(--bg) 70%); }
.auth-card { width: min(380px, 100%); display: grid; gap: 16px; padding: 36px 32px 30px; background: var(--panel); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); }
.auth-logo { width: 92px; margin: 0 auto 4px; }
.auth-card h1 { font: 500 30px/1.1 var(--serif); text-align: center; margin: 0; letter-spacing: -.01em; }
.auth-card h1 em, .bar-title h1 em, .empty h2 em, .soon h2 em, .set-sec h2 em { color: var(--accent); font-style: italic; }
.auth-card p.muted { text-align: center; margin: -6px 0 6px; font-size: 13px; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: var(--rail-w) minmax(0, 1fr); min-height: 100%; }
.rail { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 22px; padding: 26px 16px 18px; background: var(--panel); border-right: 1px solid var(--line); }
.rail-logo { display: block; padding: 0 10px; width: max-content; }
.acct { position: relative; }
.acct-btn { width: 100%; display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--sunken); cursor: pointer; text-align: left; transition: border-color var(--t) var(--ease); }
.acct-btn:hover { border-color: var(--line-strong); }
.acct-name { display: grid; min-width: 0; line-height: 1.25; flex: 1; }
.acct-name b { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-name small { color: var(--muted); font-size: 11px; }
.acct-chev { color: var(--muted); }
.acct-menu { position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 20; padding: 6px; background: var(--raised); border: 1px solid var(--line); border-radius: var(--r-sm); box-shadow: var(--shadow); }
.menu-item { width: 100%; display: flex; align-items: center; gap: 10px; padding: 9px 10px; border: 0; border-radius: 8px; background: transparent; cursor: pointer; text-align: left; color: var(--text); }
.menu-item:hover { background: var(--sunken); }
.menu-item.dim { color: var(--muted); cursor: default; }
.menu-item.dim:hover { background: transparent; }
.menu-item .ico { color: var(--muted); }
.menu-item .check { margin-left: auto; color: var(--accent); }
.menu-sep { height: 1px; background: var(--line); margin: 5px 4px; }

.nav { display: grid; gap: 2px; }
.nav-item { position: relative; display: flex; align-items: center; gap: 12px; height: 40px; padding: 0 12px; border-radius: var(--r-sm); border: 0; background: transparent; color: var(--muted); text-decoration: none; cursor: pointer; font-weight: 500; width: 100%; text-align: left; transition: background var(--t) var(--ease), color var(--t) var(--ease); }
.nav-item:hover { color: var(--text); background: var(--sunken); }
.nav-item.on { color: var(--text); background: var(--raised); box-shadow: var(--shadow-sm); }
.nav-item.on .ico { color: var(--accent); }
.nav-item .soon-tag { margin-left: auto; font-size: 10px; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); }
.nav-item .count { margin-left: auto; font-size: 11px; min-width: 20px; height: 18px; padding: 0 6px; border-radius: 10px; display: grid; place-items: center; background: color-mix(in srgb, var(--st-error) 20%, transparent); color: var(--st-error); }
.rail-foot { margin-top: auto; display: grid; gap: 2px; border-top: 1px solid var(--line); padding-top: 12px; }

.main { min-width: 0; display: flex; flex-direction: column; }
.bar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; min-height: 76px; padding: 14px 32px; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.bar-title { min-width: 0; }
.bar-title h1 { margin: 0; font: 500 30px/1.05 var(--serif); letter-spacing: -.01em; white-space: nowrap; }
.bar-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.bar-end { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.next-up { display: inline-flex; align-items: center; gap: 10px; height: 36px; padding: 0 12px 0 4px; border-radius: 20px; border: 1px solid var(--accent-line); background: var(--accent-soft); color: var(--text); text-decoration: none; font-size: 12.5px; cursor: pointer; transition: border-color var(--t) var(--ease), background var(--t); }
.next-up:hover { border-color: var(--accent); }
.next-up img, .next-up .nu-blank { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; background: var(--sunken); }
.next-up b { font-weight: 500; color: var(--accent); }
.next-up .nu-text { display: grid; line-height: 1.15; }
.next-up small { color: var(--muted); font-size: 11px; }
.view { flex: 1; padding: 28px 32px 48px; outline: none; }
.mobile-only { display: none !important; }

/* ---------- calendar ---------- */
.cal-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 232px; gap: 24px; align-items: start; }
.cal { border: 1px solid var(--line); border-radius: var(--r); background: var(--panel); overflow: hidden; }
.cal-head, .cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-head > div { padding: 12px 14px; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); border-bottom: 1px solid var(--line); }
.cal-head > div.is-today { color: var(--accent); }
.day { position: relative; min-height: 132px; padding: 10px; display: flex; flex-direction: column; gap: 6px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); transition: background var(--t) var(--ease); }
.cal-grid > .day:nth-child(7n) { border-right: 0; }
.cal-grid > .day:nth-last-child(-n+7) { border-bottom: 0; }
.day.out { background: var(--sunken); }
.day.out .dnum { opacity: .45; }
.day.past:not(.out) { background: color-mix(in srgb, var(--sunken) 55%, var(--panel)); }
.dnum { font-size: 13px; font-weight: 500; color: var(--muted); height: 24px; min-width: 24px; display: inline-grid; place-items: center; align-self: flex-start; border-radius: 12px; }
.day.today { box-shadow: inset 0 2px 0 var(--accent); }
.day.today .dnum { color: var(--accent-ink); background: var(--accent); padding: 0 6px; }
.day-add { position: absolute; top: 8px; right: 8px; width: 26px; height: 26px; border-radius: 8px; border: 1px solid var(--accent-line); background: var(--panel); color: var(--accent); display: grid; place-items: center; cursor: pointer; opacity: 0; transform: scale(.9); transition: opacity var(--t) var(--ease), transform var(--t) var(--ease), background var(--t); }
.day-add .ico { width: 15px; height: 15px; }
.day:hover .day-add, .day-add:focus-visible { opacity: 1; transform: none; }
.day-add:hover { background: var(--accent); color: var(--accent-ink); }
.day.drop-over, .undated.drop-over { background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent-line); }

.pc { position: relative; display: flex; align-items: center; gap: 8px; padding: 5px 8px 5px 5px; border-radius: 9px; background: var(--raised); border: 1px solid var(--line); cursor: grab; min-width: 0; overflow: hidden; transition: border-color var(--t) var(--ease), transform var(--t) var(--ease), box-shadow var(--t) var(--ease), opacity var(--t); }
.pc::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--st); }
.pc:hover { border-color: var(--line-strong); box-shadow: var(--shadow-sm); }
.pc.locked { cursor: pointer; }
.pc.dragging { opacity: .35; }
.pc .th { width: 34px; height: 42px; border-radius: 5px; object-fit: cover; flex: none; background: var(--sunken); display: grid; place-items: center; color: var(--faint); }
.pc .th .ico { width: 15px; height: 15px; }
.pc-body { min-width: 0; display: grid; gap: 1px; }
.pc-meta { display: flex; align-items: center; gap: 6px; }
.pc-time { font-weight: 600; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.pc-meta .ico { width: 14px; height: 14px; color: var(--muted); }
.pc-cap { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal.week .day { min-height: calc(100vh - 230px); padding: 12px 10px; }
.cal.week .pc { flex-direction: column; align-items: stretch; padding: 6px 6px 10px; }
.cal.week .pc .th { width: 100%; height: auto; aspect-ratio: 4 / 5; border-radius: 6px; }
.cal.week .pc-body { padding: 2px 2px 0; }
.cal.week .pc-cap { white-space: normal; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
.cal.week .day-add { opacity: .7; transform: none; }
.week-label { display: none; }
.cal.week.is-empty .day { min-height: 180px; }
.week-empty { grid-column: 1 / -1; display: grid; justify-items: center; gap: 6px; padding: 36px 24px 40px; text-align: center; border-top: 1px solid var(--line); }
.week-empty b { font: 500 24px/1.2 var(--serif); }
.week-empty b em { color: var(--accent); }
.week-empty span { color: var(--muted); font-size: 13px; }

.side-col h3 { font: 500 20px/1.2 var(--serif); margin: 4px 0 4px; }
.side-col h3 em { color: var(--accent); }
.side-col p { margin: 0 0 14px; font-size: 12.5px; color: var(--muted); }
.undated { display: grid; gap: 8px; min-height: 120px; padding: 8px; border-radius: var(--r); border: 1px dashed var(--line-strong); transition: background var(--t), box-shadow var(--t); }
.undated-empty { margin: auto; text-align: center; color: var(--faint); font-size: 12.5px; padding: 14px 8px; line-height: 1.5; }

.agenda { display: none; }
.day-dots { display: none; }

/* ---------- empty / skeleton / soon ---------- */
.empty { display: grid; justify-items: center; text-align: center; gap: 10px; padding: 56px 24px; border: 1px solid var(--line); border-radius: var(--r); background: var(--panel); }
.empty h2 { margin: 6px 0 0; font: 500 26px/1.15 var(--serif); }
.empty p { margin: 0; max-width: 46ch; color: var(--muted); }
.empty .btn { margin-top: 8px; }
.empty-art { width: 120px; height: 84px; position: relative; }
.empty-art i { position: absolute; border-radius: 6px; border: 1px solid var(--line-strong); background: var(--raised); }
.empty-art i:nth-child(1) { inset: 10px 52px 6px 8px; transform: rotate(-6deg); }
.empty-art i:nth-child(2) { inset: 4px 30px 12px 30px; z-index: 1; border-color: var(--accent-line); background: linear-gradient(var(--accent-soft), var(--raised)); }
.empty-art i:nth-child(3) { inset: 10px 8px 6px 52px; transform: rotate(6deg); }
.skel { background: linear-gradient(100deg, var(--sunken) 30%, var(--raised) 50%, var(--sunken) 70%); background-size: 300% 100%; animation: shimmer 1.4s linear infinite; border-radius: 8px; }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -50% 0; } }
.soon { display: grid; justify-items: center; text-align: center; gap: 12px; padding: 12vh 24px; }
.soon h2 { margin: 0; font: 500 40px/1.1 var(--serif); }
.soon p { margin: 0; max-width: 48ch; color: var(--muted); }
.soon .ring { width: 72px; height: 72px; border-radius: 50%; border: 1px solid var(--accent-line); display: grid; place-items: center; color: var(--accent); background: var(--accent-soft); }
.soon .ring .ico { width: 28px; height: 28px; }

/* ---------- feed ---------- */
.feed { max-width: 640px; margin: 0 auto; }
.profile { display: grid; grid-template-columns: auto 1fr; gap: 28px; align-items: center; padding: 8px 4px 26px; }
.profile .ava { width: 88px; height: 88px; padding: 3px; border: 1px solid var(--accent-line); background: var(--panel); }
.profile .ava-letter { font-size: 30px; }
.profile h2 { margin: 0 0 8px; font: 500 24px/1.1 var(--sans); letter-spacing: -.01em; }
.profile-stats { display: flex; gap: 22px; color: var(--muted); }
.profile-stats b { color: var(--text); font-weight: 600; }
.feed-note { display: flex; align-items: center; gap: 10px; justify-content: space-between; padding: 12px 0; border-top: 1px solid var(--line); color: var(--muted); font-size: 12.5px; }
.feed-note .legend { display: flex; gap: 14px; align-items: center; white-space: nowrap; flex: none; }
.feed-note .legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.pgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; }
.tile { position: relative; aspect-ratio: 3 / 4; background: var(--sunken); overflow: hidden; cursor: pointer; display: block; }
.tile img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 400ms var(--ease), filter var(--t); }
.tile:hover img { transform: scale(1.03); }
.tile .badge { position: absolute; top: 8px; right: 8px; color: #fff; filter: drop-shadow(0 1px 2px rgb(0 0 0 / .6)); }
.tile .badge .ico { width: 18px; height: 18px; }
.tile.planned { cursor: grab; }
.tile.planned::after { content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none; box-shadow: inset 0 0 0 2px var(--bg), inset 0 0 0 4px var(--st); }
.tile .when, .tile .badge { z-index: 2; }
.tile.planned.st-scheduled .when { background: linear-gradient(transparent, color-mix(in srgb, var(--st-scheduled) 55%, rgb(0 0 0 / .7))); }
.tile.planned.st-draft::after, .tile.planned.st-ready::after, .tile.planned.st-error::after { box-shadow: none; }
.tile.planned.st-draft, .tile.planned.st-ready, .tile.planned.st-error { outline: 1.5px dashed color-mix(in srgb, var(--st) 85%, transparent); outline-offset: -5px; }
.tile .when { position: absolute; left: 0; right: 0; bottom: 0; padding: 22px 8px 7px; color: #fff; font-size: 11.5px; font-weight: 500; background: linear-gradient(transparent, rgb(0 0 0 / .72)); display: flex; justify-content: space-between; align-items: center; gap: 4px; }
.tile .when .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--st); box-shadow: 0 0 0 2px rgb(0 0 0 / .3); }
.tile .noimg { position: absolute; inset: 0; display: grid; place-items: center; color: var(--faint); }
.tile.drop-over { outline: 2px solid var(--accent); outline-offset: -2px; }
.tile.drop-over img { filter: brightness(.6); }
.tile.dragging { opacity: .35; }
.grid-sep { grid-column: 1 / -1; display: flex; align-items: center; gap: 12px; padding: 18px 0 10px; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); }
.grid-sep::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* ---------- publications ---------- */
.counters { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; background: var(--line); margin-bottom: 20px; }
.counter { display: grid; gap: 4px; padding: 16px 20px; background: var(--panel); border: 0; text-align: left; cursor: pointer; transition: background var(--t); }
.counter:hover { background: var(--raised); }
.counter.on { background: var(--raised); box-shadow: inset 0 -2px 0 var(--st); }
.counter span { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--muted); }
.counter span::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--st); }
.counter b { font: 500 34px/1 var(--serif); font-variant-numeric: lining-nums tabular-nums; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.filters .search { position: relative; flex: 1 1 240px; }
.filters .search .ico { position: absolute; left: 12px; top: 11px; color: var(--faint); }
.filters .search input:not([type=checkbox]) { padding-left: 38px; }
.filters select { width: auto; min-width: 150px; }
.table { border: 1px solid var(--line); border-radius: var(--r); background: var(--panel); overflow: hidden; }
.trow { display: grid; grid-template-columns: 52px minmax(0, 1fr) 120px 170px 140px 36px; align-items: center; gap: 16px; padding: 10px 16px; border-bottom: 1px solid var(--line); cursor: pointer; transition: background var(--t); }
.trow:last-child { border-bottom: 0; }
.trow:hover { background: var(--raised); }
.trow.head { cursor: default; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); padding-top: 12px; padding-bottom: 12px; background: var(--sunken); }
.trow.head:hover { background: var(--sunken); }
.trow .th { width: 52px; height: 64px; border-radius: 7px; object-fit: cover; background: var(--sunken); display: grid; place-items: center; color: var(--faint); }
.trow .cap { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.trow .cap.none { color: var(--faint); font-style: italic; }
.trow .err { color: var(--st-error); font-size: 12px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.trow .fmt { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.trow .go { color: var(--faint); }
.trow .mobile-meta { display: none; }
.no-results { padding: 40px 16px; text-align: center; color: var(--muted); }

/* ---------- media library ---------- */
.lib-tools { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.lib-tools .sel-bar { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.lib-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 14px; }
.mtile { position: relative; border-radius: var(--r-sm); overflow: hidden; background: var(--panel); border: 1px solid var(--line); cursor: pointer; transition: border-color var(--t), transform var(--t) var(--ease), box-shadow var(--t); }
.mtile:hover { border-color: var(--line-strong); box-shadow: var(--shadow-sm); }
.mtile .img { aspect-ratio: 4 / 5; background: var(--sunken); position: relative; }
.mtile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mtile .meta { display: flex; justify-content: space-between; align-items: center; gap: 6px; padding: 8px 10px; font-size: 12px; color: var(--muted); }
.mtile .meta .name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mtile .tag { position: absolute; left: 8px; bottom: 8px; display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; border-radius: 12px; font-size: 11px; font-weight: 500; color: #fff; background: rgb(0 0 0 / .55); backdrop-filter: blur(6px); }
.mtile .tag .ico { width: 12px; height: 12px; }
.mtile .used { position: absolute; right: 8px; top: 8px; }
.mtile .used .pill { background: rgb(14 14 13 / .72); backdrop-filter: blur(6px); }
.mtile .tick { position: absolute; left: 8px; top: 8px; width: 24px; height: 24px; border-radius: 50%; border: 1.5px solid rgb(255 255 255 / .85); background: rgb(0 0 0 / .25); display: grid; place-items: center; color: transparent; transition: background var(--t), border-color var(--t), color var(--t); }
.mtile .tick .ico { width: 14px; height: 14px; }
.mtile.sel { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.mtile.sel .tick { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.mtile.taken { cursor: default; }
.mtile.taken .tick { display: none; }
.dropveil { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; background: var(--scrim); backdrop-filter: blur(4px); pointer-events: none; opacity: 0; transition: opacity var(--t); }
.dropveil.on { opacity: 1; }
.dropveil div { display: grid; justify-items: center; gap: 10px; padding: 40px 56px; border-radius: 20px; border: 1.5px dashed var(--accent); background: var(--panel); color: var(--text); font: 500 26px var(--serif); }
.dropveil .ico { width: 32px; height: 32px; color: var(--accent); }
.upbar { height: 2px; background: var(--line); border-radius: 2px; overflow: hidden; margin-bottom: 14px; }
.upbar span { display: block; height: 100%; width: 0; background: var(--accent); }

/* ---------- settings ---------- */
.settings { max-width: 760px; display: grid; gap: 22px; }
.set-sec { padding: 22px 24px; border: 1px solid var(--line); border-radius: var(--r); background: var(--panel); }
.set-sec h2 { margin: 0 0 4px; font: 500 22px/1.2 var(--serif); }
.set-sec > p { margin: 0 0 18px; color: var(--muted); font-size: 13px; }
.set-row { display: flex; align-items: center; gap: 16px; padding: 12px 0; border-top: 1px solid var(--line); }
.set-row:first-of-type { border-top: 0; }
.set-row .label { flex: 1; display: grid; gap: 2px; }
.set-row .label small { color: var(--muted); }
.acct-card { display: flex; align-items: center; gap: 16px; }
.acct-card .ava { width: 56px; height: 56px; }
.acct-card .info { flex: 1; display: grid; gap: 2px; }
.acct-card .info b { font-weight: 600; font-size: 15px; }
.ok-dot { display: inline-flex; align-items: center; gap: 6px; color: var(--st-published); font-size: 12.5px; }
.ok-dot::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.ok-dot.bad { color: var(--st-error); }
.pw-form { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; align-items: end; }

/* ---------- editor panel ---------- */
.scrim { position: fixed; inset: 0; z-index: 40; background: var(--scrim); opacity: 0; transition: opacity 240ms var(--ease); }
.scrim.on { opacity: 1; }
.editor { position: fixed; top: 0; right: 0; bottom: 0; z-index: 50; width: min(980px, calc(100vw - 72px)); display: grid; grid-template-columns: minmax(0, 1fr) 380px; background: var(--bg); border-left: 1px solid var(--line); box-shadow: var(--shadow); transform: translateX(102%); transition: transform 280ms var(--ease); }
.editor.open { transform: none; }
.ed-main { display: flex; flex-direction: column; min-height: 0; }
.ed-head { display: flex; align-items: center; gap: 12px; padding: 18px 24px; border-bottom: 1px solid var(--line); }
.ed-head h2 { margin: 0; font: 500 26px/1 var(--serif); }
.ed-head h2 em { color: var(--accent); }
.ed-head .saved { font-size: 12px; color: var(--faint); display: inline-flex; align-items: center; gap: 6px; }
.ed-head .saved .ico { width: 14px; height: 14px; }
.ed-head .spacer { flex: 1; }
.ed-body { flex: 1; overflow: auto; padding: 22px 24px 28px; display: grid; gap: 22px; align-content: start; }
.ed-sec { display: grid; gap: 10px; }
.ed-sec > .lbl { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--muted); letter-spacing: .01em; }
.counter-txt { font-size: 12px; color: var(--faint); font-variant-numeric: tabular-nums; }
.counter-txt.over { color: var(--st-error); }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 10px; }
.thumbs:empty { display: none; }
.mthumb { position: relative; aspect-ratio: 4 / 5; border-radius: 9px; overflow: hidden; background: var(--sunken); border: 1px solid var(--line); }
.mthumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mthumb .n { position: absolute; top: 6px; left: 6px; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; display: grid; place-items: center; font-size: 11px; font-weight: 600; color: #fff; background: rgb(0 0 0 / .55); }
.mthumb .tools { position: absolute; inset: auto 0 0; display: flex; justify-content: space-between; padding: 5px; background: linear-gradient(transparent, rgb(0 0 0 / .65)); opacity: 0; transition: opacity var(--t); }
.mthumb:hover .tools, .mthumb:focus-within .tools { opacity: 1; }
.mthumb .tools button { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 6px; border: 0; background: rgb(255 255 255 / .16); color: #fff; cursor: pointer; padding: 0; }
.mthumb .tools button:hover { background: rgb(255 255 255 / .3); }
.mthumb .tools button:disabled { opacity: .3; cursor: default; }
.mthumb .tools .ico { width: 14px; height: 14px; }
.drop { position: relative; display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap; min-height: 84px; padding: 16px; border-radius: var(--r-sm); border: 1px dashed var(--line-strong); color: var(--muted); text-align: center; cursor: pointer; overflow: hidden; transition: border-color var(--t), background var(--t), color var(--t); }
.drop:hover, .drop.over { border-color: var(--accent); background: var(--accent-soft); color: var(--text); }
.drop .ico { color: var(--accent); }
.drop .bar-p { position: absolute; left: 0; bottom: 0; height: 2px; width: 0; background: var(--accent); }
.drop-row { display: flex; gap: 10px; }
.drop-row .drop { flex: 1; }
.ed-row { display: grid; grid-template-columns: 1fr 1fr auto; gap: 12px; align-items: end; }
.problems { display: grid; gap: 6px; padding: 12px 14px; border-radius: var(--r-sm); background: var(--sunken); border: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.problems b { color: var(--text); font-weight: 500; }
.problems ul { margin: 0; padding-left: 18px; display: grid; gap: 2px; }
.err-box { display: flex; gap: 10px; padding: 12px 14px; border-radius: var(--r-sm); color: var(--st-error); background: color-mix(in srgb, var(--st-error) 10%, transparent); border: 1px solid color-mix(in srgb, var(--st-error) 28%, transparent); font-size: 13px; white-space: pre-wrap; }
.ed-foot { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 14px 24px; border-top: 1px solid var(--line); background: var(--panel); }
.ed-foot .spacer { flex: 1; }
.picker { display: grid; gap: 10px; padding: 12px; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--panel); }
.picker-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 8px; max-height: 260px; overflow: auto; }
.picker-grid button { position: relative; aspect-ratio: 4 / 5; border: 1px solid var(--line); border-radius: 7px; overflow: hidden; padding: 0; cursor: pointer; background: var(--sunken); }
.picker-grid button img { width: 100%; height: 100%; object-fit: cover; display: block; }
.picker-grid button.sel { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.picker-grid button.sel::after { content: ""; position: absolute; inset: 0; background: var(--accent-soft); }

.ed-preview { overflow: auto; padding: 26px 24px; background: var(--panel); border-left: 1px solid var(--line); display: grid; justify-items: center; align-content: start; gap: 14px; }
.ed-preview .cap-lbl { font-size: 12.5px; color: var(--muted); }
.phone { width: 316px; border-radius: 44px; padding: 10px; background: #0A0A09; border: 1px solid #2E2D29; box-shadow: var(--shadow), inset 0 0 0 1px #1d1c19; }
.phone-screen { position: relative; border-radius: 35px; overflow: hidden; background: #fff; color: #0c0c0c; height: 610px; display: flex; flex-direction: column; font: 13px/1.38 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
.phone-status { display: flex; justify-content: space-between; align-items: center; padding: 12px 22px 4px; font-size: 12px; font-weight: 600; }
.phone-island { position: absolute; top: 9px; left: 50%; transform: translateX(-50%); width: 92px; height: 26px; border-radius: 14px; background: #0A0A09; }
.phone-app { display: flex; align-items: center; justify-content: space-between; padding: 8px 14px 6px; border-bottom: 1px solid #efefef; }
.phone-app b { font-size: 16px; font-weight: 700; letter-spacing: -.02em; }
.phone-scroll { flex: 1; overflow: auto; scrollbar-width: none; }
.phone-scroll::-webkit-scrollbar { display: none; }
.ig-head { display: flex; align-items: center; gap: 9px; padding: 9px 11px; }
.ig-ring { width: 32px; height: 32px; border-radius: 50%; padding: 2px; background: conic-gradient(from 200deg, #feda75, #fa7e1e, #d62976, #962fbf, #4f5bd5, #feda75); }
.ig-ring > * { width: 100%; height: 100%; border-radius: 50%; border: 2px solid #fff; object-fit: cover; display: grid; place-items: center; background: #eee; font-size: 11px; font-weight: 700; color: #555; }
.ig-head b { font-size: 13px; }
.ig-head small { display: block; font-size: 11px; color: #737373; font-weight: 400; }
.ig-head .ico { margin-left: auto; width: 18px; height: 18px; }
.ig-media { position: relative; background: #f2f2f2; }
.ig-track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; height: 100%; scrollbar-width: none; overscroll-behavior-x: contain; }
.ig-track::-webkit-scrollbar { display: none; }
.ig-track > * { flex: 0 0 100%; width: 100%; height: 100%; object-fit: cover; scroll-snap-align: center; display: block; background: #000; }
.ig-empty { height: 100%; display: grid; place-items: center; align-content: center; gap: 8px; color: #9b9b9b; font-size: 12px; text-align: center; }
.ig-empty .ico { width: 30px; height: 30px; margin: 0 auto; }
.ig-arrow { position: absolute; top: 50%; transform: translateY(-50%); width: 24px; height: 24px; border-radius: 50%; border: 0; background: rgb(255 255 255 / .9); color: #222; display: grid; place-items: center; cursor: pointer; box-shadow: 0 1px 3px rgb(0 0 0 / .25); padding: 0; }
.ig-arrow .ico { width: 14px; height: 14px; }
.ig-arrow.l { left: 8px; } .ig-arrow.r { right: 8px; }
.ig-count { position: absolute; top: 9px; right: 9px; padding: 2px 8px; border-radius: 12px; background: rgb(0 0 0 / .62); color: #fff; font-size: 11px; font-weight: 500; }
.ig-reel { position: absolute; top: 10px; right: 10px; color: #fff; filter: drop-shadow(0 1px 2px rgb(0 0 0 / .5)); }
.ig-actions { position: relative; display: flex; align-items: center; gap: 14px; padding: 9px 11px 5px; }
.ig-actions .ico { width: 23px; height: 23px; stroke-width: 1.7; }
.ig-actions .save { margin-left: auto; }
.ig-dots { position: absolute; left: 50%; top: 17px; transform: translateX(-50%); display: flex; gap: 4px; }
.ig-dots i { width: 6px; height: 6px; border-radius: 50%; background: #c8c8c8; transition: background var(--t); }
.ig-dots i.on { background: #0095f6; }
.ig-text { padding: 3px 11px; white-space: pre-wrap; overflow-wrap: anywhere; }
.ig-text .more { color: #737373; cursor: pointer; }
.ig-text .tag { color: #00376b; }
.ig-text .ph { color: #a8a8a8; }
.ig-comments { padding: 2px 11px; color: #737373; }
.ig-comment { padding: 2px 11px; white-space: pre-wrap; overflow-wrap: anywhere; }
.ig-date { padding: 6px 11px 14px; color: #737373; font-size: 10.5px; text-transform: uppercase; letter-spacing: .02em; }
.phone-tabs { display: flex; justify-content: space-around; padding: 9px 0 16px; border-top: 1px solid #efefef; color: #0c0c0c; }
.phone-tabs .ico { width: 21px; height: 21px; }

/* ---------- toasts & sheet ---------- */
.toasts { position: fixed; right: 24px; bottom: 24px; z-index: 90; display: grid; gap: 10px; justify-items: end; pointer-events: none; }
.toast { display: flex; align-items: center; gap: 10px; max-width: min(420px, calc(100vw - 32px)); padding: 12px 16px; border-radius: 12px; background: var(--raised); border: 1px solid var(--line); box-shadow: var(--shadow); color: var(--text); opacity: 0; transform: translateY(8px); transition: opacity var(--t) var(--ease), transform var(--t) var(--ease); }
.toast.in { opacity: 1; transform: none; }
.toast .ico { color: var(--st-published); }
.toast.err .ico { color: var(--st-error); }
.toast.err { border-color: color-mix(in srgb, var(--st-error) 40%, var(--line)); }
.sheet { position: fixed; inset: auto 0 0; z-index: 70; padding: 10px 12px calc(16px + env(safe-area-inset-bottom)); background: var(--raised); border-top: 1px solid var(--line); border-radius: 20px 20px 0 0; box-shadow: var(--shadow); transform: translateY(100%); transition: transform 260ms var(--ease); }
.sheet.open { transform: none; }
.sheet .grab { width: 40px; height: 4px; border-radius: 3px; background: var(--line-strong); margin: 2px auto 10px; }
.tabbar { display: none; }

/* ---------- responsive ---------- */
@media (max-width: 1280px) {
  .cal-wrap { grid-template-columns: minmax(0, 1fr); }
  .side-col { order: 2; }
  .undated { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); min-height: 72px; }
  .trow { grid-template-columns: 52px minmax(0, 1fr) 110px 150px 130px 28px; gap: 12px; }
}
@media (max-width: 1100px) {
  .next-up .nu-text small { display: none; }
  .editor { grid-template-columns: minmax(0, 1fr) 340px; }
  .phone { width: 300px; }
}
@media (max-width: 900px) {
  :root { --rail-w: 76px; }
  .rail { padding: 22px 10px; align-items: center; }
  .rail-logo .logo-mask { width: 48px; }
  .rail .acct-name, .rail .acct-chev, .nav-item span:not(.count), .nav-item .soon-tag { display: none; }
  .acct-btn { justify-content: center; padding: 6px; border: 0; background: transparent; }
  .acct-menu { width: 240px; }
  .nav-item { justify-content: center; padding: 0; width: 48px; }
  .nav-item .count { position: absolute; top: 4px; right: 2px; min-width: 16px; height: 16px; font-size: 10px; padding: 0 4px; }
  .editor { width: 100vw; display: block; overflow-y: auto; overscroll-behavior: contain; border-left: 0; }
  .ed-main { display: block; }
  .ed-body { overflow: visible; }
  .ed-head { position: sticky; top: 0; z-index: 2; background: var(--bg); }
  .ed-foot { position: sticky; bottom: 0; z-index: 2; }
  .ed-preview { overflow: visible; border-left: 0; border-top: 1px solid var(--line); }
  .trow { grid-template-columns: 52px minmax(0, 1fr) auto; }
  .trow .fmt, .trow .when-col, .trow.head { display: none; }
  .trow .st { grid-column: 3; }
  .trow .mobile-meta { display: flex; align-items: center; gap: 6px; margin-top: 3px; }
  .trow .mobile-meta .ico { width: 13px; height: 13px; }
  .trow .go { display: none; }
  .pw-form { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  body { font-size: 15px; }
  .shell { grid-template-columns: 1fr; padding-bottom: calc(68px + env(safe-area-inset-bottom)); }
  .rail { display: none; }
  .mobile-only { display: inline-flex !important; }
  .bar { min-height: 0; padding: calc(10px + env(safe-area-inset-top)) 16px 10px; gap: 10px; }
  .bar-title h1 { font-size: 26px; }
  .bar-end { gap: 8px; }
  #new-post { display: none; }
  .next-up { height: 34px; gap: 8px; padding: 0 10px 0 3px; font-size: 12px; }
  .next-up .nu-text small { display: none; }
  .bar-actions { order: 3; width: 100%; }
  .view { padding: 16px 16px 32px; }
  .tabbar { position: fixed; z-index: 30; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: repeat(5, 1fr); align-items: center; padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); background: color-mix(in srgb, var(--panel) 94%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-top: 1px solid var(--line); }
  .tab { display: grid; justify-items: center; gap: 3px; padding: 6px 0; border: 0; background: transparent; color: var(--muted); font-size: 10.5px; text-decoration: none; cursor: pointer; position: relative; }
  .tab .ico { width: 22px; height: 22px; }
  .tab.on { color: var(--text); }
  .tab.on .ico { color: var(--accent); }
  .tab .count { position: absolute; top: 2px; left: calc(50% + 6px); min-width: 15px; height: 15px; padding: 0 4px; border-radius: 8px; font-size: 9.5px; display: grid; place-items: center; background: var(--st-error); color: #fff; }
  .tab-new { justify-self: center; width: 50px; height: 50px; margin-top: -18px; border-radius: 50%; border: 0; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); box-shadow: var(--shadow); cursor: pointer; }
  .tab-new .ico { width: 24px; height: 24px; stroke-width: 2; }
  .toasts { left: 16px; right: 16px; bottom: calc(80px + env(safe-area-inset-bottom)); justify-items: stretch; }
  .toast { max-width: none; }

  .cal-head > div { padding: 8px 0; text-align: center; font-size: 10px; letter-spacing: .04em; }
  .day { min-height: 58px; padding: 5px 3px; gap: 3px; align-items: center; cursor: pointer; }
  .day .dnum { align-self: center; font-size: 12.5px; }
  .day-add { display: none; }
  .cal.month .pc { display: none; }
  .day-dots { display: flex; gap: 3px; flex-wrap: wrap; justify-content: center; max-width: 34px; }
  .day-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--st); }
  .day.picked { background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent-line); }
  .agenda { display: grid; gap: 10px; margin-top: 18px; }
  .agenda h3 { margin: 0; display: flex; justify-content: space-between; align-items: center; font: 500 22px var(--serif); }
  .agenda h3 .btn { font: 500 13px var(--sans); }
  .agenda .pc { padding: 8px; }
  .agenda .pc .th { width: 46px; height: 56px; }
  .agenda .pc-cap { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  .agenda-empty { padding: 18px; border-radius: var(--r-sm); border: 1px dashed var(--line-strong); color: var(--muted); text-align: center; font-size: 13.5px; }
  .cal.week { border: 0; background: transparent; overflow: visible; }
  .cal.week .cal-head { display: none; }
  .cal.week .cal-grid { grid-template-columns: 1fr; gap: 10px; }
  .cal.week .day { min-height: 0; border: 1px solid var(--line) !important; border-radius: var(--r-sm); background: var(--panel); align-items: stretch; padding: 10px; }
  .cal.week .day.today { box-shadow: none; border-color: var(--accent-line) !important; }
  .cal.week .day.today .week-label { color: var(--accent); }
  .cal.week .week-label { display: flex; align-items: center; gap: 8px; font-weight: 500; }
  .cal.week .week-label small { color: var(--muted); font-weight: 400; }
  .cal.week .dnum { display: none; }
  .cal.week .pc { flex-direction: row; align-items: center; padding: 6px; }
  .cal.week .pc .th { width: 40px; height: 50px; aspect-ratio: auto; }
  .cal.week .day-add { display: grid; opacity: 1; top: 8px; }
  .cal.week.is-empty .day { min-height: 0; }
  .cal.week .week-empty { order: -1; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--panel); padding: 22px 16px; }
  .side-col h3 { font-size: 20px; }
  .undated { grid-template-columns: 1fr; }

  .profile { grid-template-columns: auto 1fr; gap: 18px; padding-top: 0; }
  .profile .ava { width: 72px; height: 72px; }
  .profile h2 { font-size: 19px; }
  .profile-stats { gap: 14px; font-size: 13px; }
  .feed-note { flex-direction: column; align-items: flex-start; }
  .pgrid { gap: 2px; margin: 0 -16px; }
  .pgrid .grid-sep { padding-inline: 16px; }
  .tile .when { font-size: 10px; padding: 16px 5px 5px; }

  .counters { grid-template-columns: repeat(2, 1fr); }
  .counter { padding: 12px 14px; }
  .counter b { font-size: 28px; }
  .filters select { flex: 1 1 40%; min-width: 0; }
  .lib-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .lib-tools .sel-bar { margin-left: 0; width: 100%; }
  .set-sec { padding: 18px 16px; }
  .set-row { flex-wrap: wrap; }

  .ed-head { padding: calc(12px + env(safe-area-inset-top)) 16px 12px; }
  .ed-head h2 { font-size: 22px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
  .ed-body { padding: 16px; }
  .ed-foot { padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); }
  .ed-foot .btn { flex: 1; }
  .ed-foot .spacer { display: none; }
  .ed-row { grid-template-columns: 1fr 1fr; }
  .ed-row .btn { grid-column: 1 / -1; }
  .mthumb .tools { opacity: 1; }
  .ed-preview { padding: 22px 0 28px; }
  .soon h2 { font-size: 32px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 1ms !important; animation-duration: 1ms !important; }
}
