/* ════════════════════════════════════════════════════════════
   Themes are token sets. Every component reads tokens only, so
   every theme gets every feature. Structural quirks per theme
   (bevels, title bars) live in the "theme quirks" section.
   ════════════════════════════════════════════════════════════ */

:root, :root[data-theme="pastel"] {
  --wall-a: #f3dfcf; --wall-b: #e9e1f1; --wall-ink: rgba(59, 48, 42, .08);
  --paper: #fffaf2; --panel: #f8efe3; --sheet: #ffffff;
  --ink: #3b302a; --dim: #85776c; --line: #3b302a; --soft-line: #e6d8c7; --shadow: #3b302a;
  --peach: #f2c4ad; --sage: #c9dcc0; --lav: #d9cfee; --butter: #f6e3a6; --rose: #efc3c9; --sky: #c8dbe6;
  --accent: #b5654a; --on-accent: #fff;
  --title-ink: var(--ink);
  --chrome: "Pixelify Sans", ui-monospace, "SF Mono", Menlo, monospace;
  --radius: 8px; --shadow-d: 5px;
  --wallpaper: dots;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]), :root[data-theme="pastel"] {
    --wall-a: #2b2320; --wall-b: #262330; --wall-ink: rgba(255, 240, 225, .06);
    --paper: #362e29; --panel: #2f2823; --sheet: #3b332d;
    --ink: #f1e6da; --dim: #b3a497; --line: #120e0c; --soft-line: #4a3f38; --shadow: #120e0c;
    --peach: #8c5d4b; --sage: #5e7357; --lav: #6c6284; --butter: #8a7741; --rose: #865a60; --sky: #557080;
    --accent: #f0a88a; --on-accent: #2b2320;
  }
}
:root[data-theme="mono"] {
  --wall-a: #ffffff; --wall-b: #ffffff; --wall-ink: #000;
  --paper: #fff; --panel: #fff; --sheet: #fff;
  --ink: #000; --dim: #555; --line: #000; --soft-line: #bbb; --shadow: #000;
  --peach: #fff; --sage: #fff; --lav: #eee; --butter: #fff; --rose: #fff; --sky: #fff;
  --accent: #000; --on-accent: #fff;
  --chrome: "Silkscreen", "Pixelify Sans", ui-monospace, monospace;
  --radius: 0px; --shadow-d: 3px;
}
:root[data-theme="teal"] {
  --wall-a: #4f8f8b; --wall-b: #4f8f8b; --wall-ink: rgba(0, 0, 0, .06);
  --paper: #e3ded6; --panel: #d6d0c6; --sheet: #ffffff;
  --ink: #1d1d1d; --dim: #5d5850; --line: #1d1d1d; --soft-line: #b5ada1; --shadow: rgba(0, 0, 0, .45);
  --peach: #6f6aa8; --sage: #6f6aa8; --lav: #6f6aa8; --butter: #6f6aa8; --rose: #6f6aa8; --sky: #6f6aa8;
  --accent: #3d3a86; --on-accent: #fff;
  --title-ink: #fff;
  --chrome: "VT323", ui-monospace, monospace;
  --radius: 0px; --shadow-d: 3px;
}
:root[data-theme="midnight"] {
  --wall-a: #1d1a2e; --wall-b: #241d33; --wall-ink: rgba(220, 200, 255, .06);
  --paper: #2a2540; --panel: #231f37; --sheet: #2f2a47;
  --ink: #ece6ff; --dim: #a69dc4; --line: #0e0b18; --soft-line: #3d365a; --shadow: #0e0b18;
  --peach: #6b4a6b; --sage: #3f5f5a; --lav: #4b4580; --butter: #6e6040; --rose: #6a3f58; --sky: #36506e;
  --accent: #f3a6d0; --on-accent: #1d1a2e;
  --chrome: "Space Mono", ui-monospace, monospace;
  --radius: 10px; --shadow-d: 5px;
}
:root[data-theme="paper"] {
  --wall-a: #faf8f4; --wall-b: #faf8f4; --wall-ink: transparent;
  --paper: #ffffff; --panel: #f6f3ee; --sheet: #ffffff;
  --ink: #26221f; --dim: #77706a; --line: #e2ddd5; --soft-line: #ece7df; --shadow: rgba(38, 34, 31, .08);
  --peach: #ffffff; --sage: #ffffff; --lav: #f3efe8; --butter: #fff6d6; --rose: #ffffff; --sky: #ffffff;
  --accent: #a4532f; --on-accent: #fff;
  --chrome: ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --radius: 10px; --shadow-d: 0px;
}
@media (prefers-color-scheme: dark) {
  :root[data-theme="paper"] {
    --wall-a: #1c1a18; --wall-b: #1c1a18; --paper: #24211f; --panel: #2a2724; --sheet: #24211f;
    --ink: #ece7e1; --dim: #a39b93; --line: #3a3531; --soft-line: #34302c; --lav: #2f2b28; --butter: #3a3324;
    --peach: #24211f; --sage: #24211f; --rose: #24211f; --sky: #24211f; --accent: #e69d78; --on-accent: #1c1a18;
  }
}

/* admin-chosen overrides (data attributes on <html>) */
:root[data-font="pixelify"] { --chrome: "Pixelify Sans", ui-monospace, monospace; }
:root[data-font="silkscreen"] { --chrome: "Silkscreen", ui-monospace, monospace; }
:root[data-font="vt323"] { --chrome: "VT323", ui-monospace, monospace; }
:root[data-font="spacemono"] { --chrome: "Space Mono", ui-monospace, monospace; }
:root[data-font="system"] { --chrome: ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif; }
:root[data-corners="round"] { --radius: 8px; }
:root[data-corners="square"] { --radius: 0px; }
:root[data-shadow="none"] { --shadow-d: 0px; }
:root[data-shadow="small"] { --shadow-d: 3px; }
:root[data-shadow="large"] { --shadow-d: 8px; }

:root {
  --body: ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --serif: "Source Serif 4", "Iowan Old Style", Georgia, "Times New Roman", serif;
  --dock-h: 76px;
  --r-sm: calc(var(--radius) * .7);
  --hard: var(--shadow-d) var(--shadow-d) 0 var(--shadow);
}

/* ── base & wallpaper ───────────────────── */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; min-height: 100vh; color: var(--ink); font: 15.5px/1.6 var(--body);
  background-color: var(--wall-a);
  background-image: radial-gradient(var(--wall-ink) 1px, transparent 1.3px), linear-gradient(160deg, var(--wall-a), var(--wall-b));
  background-size: 6px 6px, 100% 100%;
  background-attachment: scroll, fixed;
  -webkit-font-smoothing: antialiased;
}
:root[data-design="desktop"][data-theme="mono"] body { background-image: radial-gradient(#000 .8px, transparent 1px); background-size: 4px 4px; }
:root[data-wall="grid"] body { background-image: linear-gradient(var(--wall-ink) 1px, transparent 1px), linear-gradient(90deg, var(--wall-ink) 1px, transparent 1px), linear-gradient(160deg, var(--wall-a), var(--wall-b)); background-size: 22px 22px, 22px 22px, 100% 100%; }
:root[data-wall="stripes"] body { background-image: repeating-linear-gradient(135deg, var(--wall-ink) 0 6px, transparent 6px 16px), linear-gradient(160deg, var(--wall-a), var(--wall-b)); background-size: auto, 100% 100%; }
:root[data-wall="checker"] body { background-image: conic-gradient(var(--wall-ink) 25%, transparent 0 50%, var(--wall-ink) 0 75%, transparent 0), linear-gradient(160deg, var(--wall-a), var(--wall-b)); background-size: 24px 24px, 100% 100%; }
:root[data-wall="plain"] body { background-image: linear-gradient(160deg, var(--wall-a), var(--wall-b)); }
:root[data-wall="dots"] body { background-image: radial-gradient(var(--wall-ink) 1px, transparent 1.3px), linear-gradient(160deg, var(--wall-a), var(--wall-b)); background-size: 6px 6px, 100% 100%; }

a { color: inherit; text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--accent); }
.dim { color: var(--dim); }
:focus-visible { outline: 2px dashed var(--accent); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip:focus { position: fixed; z-index: 100; top: 6px; left: 6px; width: auto; height: auto; clip: auto; background: var(--paper); padding: 4px 10px; border: 2px solid var(--line); }
h1, h2, h3 { font-family: var(--chrome); line-height: 1.15; }

/* ── menu bar ───────────────────────────── */
.menubar {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 2px;
  padding: 3px 10px; min-height: 30px; background: var(--paper); border-bottom: 2px solid var(--line);
  font-family: var(--chrome); font-size: 14px;
}
.menubar .logo { font-weight: 700; padding: 2px 8px; text-decoration: none; }
.menubar .logo span { color: var(--accent); }
.menubar .app { font-weight: 700; padding: 2px 8px; }
.menubar .items { display: flex; gap: 2px; flex-wrap: wrap; }
.menubar .items a, .menubar button {
  font: inherit; color: var(--ink); background: none; border: 0; cursor: pointer;
  padding: 2px 8px; border-radius: 3px; text-decoration: none;
}
.menubar .items a:hover, .menubar button:hover, .menubar .logo:hover { background: var(--ink); color: var(--paper); }
.menubar .spacer { flex: 1; }
.menubar .clock { padding: 2px 6px; color: var(--dim); white-space: nowrap; }
.menubar .status { display: inline-flex; align-items: center; gap: 6px; padding: 1px 9px; margin-right: 4px; border: 2px solid var(--line); border-radius: 999px; background: var(--sage); font-size: 12.5px; white-space: nowrap; }
.menubar .status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #3f9a52; box-shadow: 0 0 0 2px var(--paper); }
.menu { position: relative; }
.menu-pop {
  position: absolute; right: 0; top: calc(100% + 6px); min-width: 190px; z-index: 40;
  background: var(--paper); border: 2px solid var(--line); border-radius: var(--r-sm); box-shadow: var(--hard); padding: 4px;
}
.menu-pop[hidden] { display: none; }
.menu-pop button { display: flex; width: 100%; justify-content: space-between; text-align: left; padding: 4px 10px; }
.menu-pop button[aria-checked="true"]::after { content: "✓"; }
@media (max-width: 720px) { .menubar .items, .menubar .status, .menubar .clock { display: none; } }

/* ── stage & windows ────────────────────── */
.stage { max-width: 1040px; margin: 0 auto; padding: 28px 16px calc(var(--dock-h) + 40px); }
.stage.narrow-stage { max-width: 840px; }
.stack { display: grid; gap: 26px; }
.win {
  background: var(--paper); border: 2px solid var(--line);
  border-radius: var(--radius) var(--radius) var(--r-sm) var(--r-sm); box-shadow: var(--hard);
  min-width: 0; scroll-margin-top: 56px; animation: open .18s ease-out;
}
@keyframes open { from { transform: scale(.985) translateY(4px); } }
.titlebar {
  --tint: var(--peach);
  display: flex; align-items: center; gap: 8px; height: 30px; padding: 0 8px;
  border-bottom: 2px solid var(--line); border-radius: calc(var(--radius) - 2px) calc(var(--radius) - 2px) 0 0;
  background: repeating-linear-gradient(to bottom, var(--line) 0 1px, transparent 1px 4px) center / calc(100% - 16px) 13px no-repeat, var(--tint);
  font-family: var(--chrome); font-size: 14px; color: var(--title-ink); user-select: none;
}
.titlebar .box, .titlebar a.close {
  flex: none; width: 15px; height: 15px; display: block;
  background: var(--paper); border: 2px solid var(--line); border-radius: 3px; position: relative; z-index: 1;
}
.titlebar a.close:hover::after { content: ""; position: absolute; inset: 2px; background: var(--line); border-radius: 1px; }
.titlebar .title { margin: 0 auto; padding: 0 10px; background: var(--tint); font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.titlebar .title a { text-decoration: none; }
.titlebar .title a:hover { text-decoration: underline; }
.titlebar .ghost { visibility: hidden; }
.t-peach { --tint: var(--peach); } .t-sage { --tint: var(--sage); } .t-lav { --tint: var(--lav); }
.t-butter { --tint: var(--butter); } .t-rose { --tint: var(--rose); } .t-sky { --tint: var(--sky); }
.body { padding: 20px 22px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; padding: 8px 12px; border-bottom: 2px solid var(--line); background: var(--panel); }
.statusbar { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 3px 10px; border-top: 2px solid var(--line); font-family: var(--chrome); font-size: 12px; color: var(--dim); background: var(--panel); border-radius: 0 0 var(--r-sm) var(--r-sm); }

/* ── controls ───────────────────────────── */
.btn, button.btn {
  display: inline-flex; align-items: center; gap: 6px; font: 13.5px var(--chrome); color: var(--ink);
  text-decoration: none; cursor: pointer; padding: 5px 13px; background: var(--paper);
  border: 2px solid var(--line); border-radius: var(--r-sm); box-shadow: 0 3px 0 var(--line);
  transition: transform .06s, box-shadow .06s;
}
.btn:hover { background: var(--butter); color: var(--ink); }
.btn:active { transform: translateY(3px); box-shadow: 0 0 0 var(--line); }
.btn.primary { background: var(--accent); color: var(--on-accent); }
.btn.primary:hover { filter: brightness(1.06); color: var(--on-accent); }
.btn.danger { background: var(--rose); }
.btn.small { padding: 2px 9px; font-size: 12.5px; }
.btns { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.seg { display: inline-flex; border: 2px solid var(--line); border-radius: var(--r-sm); overflow: hidden; background: var(--paper); }
.seg a { font: 13px var(--chrome); padding: 3px 12px; text-decoration: none; }
.seg a + a { border-left: 2px solid var(--line); }
.seg a[aria-current] { background: var(--ink); color: var(--paper); }
.seg a:not([aria-current]):hover { background: var(--butter); color: var(--ink); }
.chips { display: flex; flex-wrap: wrap; gap: 5px; }
.chip { font: 11.5px var(--mono); padding: 1px 8px; background: var(--paper); border: 1px solid var(--soft-line); border-radius: 999px; white-space: nowrap; }
.keys { display: flex; flex-wrap: wrap; gap: 8px; }
.key { font: 13px var(--chrome); padding: 3px 10px; background: var(--paper); border: 2px solid var(--line); border-radius: 5px; box-shadow: 0 3px 0 var(--line); }
.badge-n { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: #d4553f; color: #fff; font: 700 11px var(--body); border: 2px solid var(--paper); }

/* ── home ───────────────────────────────── */
.home { display: grid; grid-template-columns: 112px minmax(0, 1fr) 250px; gap: 28px; align-items: start; }
.icons { display: grid; gap: 10px; }
.icon { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 8px 4px; text-decoration: none; text-align: center; font: 13px var(--chrome); border-radius: 6px; }
.icon svg { width: 52px; height: 52px; filter: drop-shadow(3px 3px 0 var(--shadow)); }
.icon span { padding: 0 5px; border-radius: 3px; }
:root[data-design="desktop"][data-theme="teal"] .icon span { color: #fff; }
.icon:hover span, .icon:focus-visible span { background: var(--ink); color: var(--paper); }
.welcome .hello { display: flex; gap: 18px; align-items: center; }
.avatar { flex: none; width: 76px; height: 76px; border: 2px solid var(--line); border-radius: calc(var(--radius) + 2px); object-fit: cover; background: var(--butter); display: grid; place-items: center; font: 700 30px var(--chrome); }
.role { margin: 4px 0 0; font-size: 16.5px; }
.lede { font-size: 17px; margin: 18px 0 20px; max-width: 58ch; }
.note { background: var(--butter); border: 2px solid var(--line); border-radius: 3px; box-shadow: var(--hard); padding: 14px 16px 16px; transform: rotate(1.2deg); color: var(--ink); }
.note h2 { font-size: 15px; margin: 0 0 8px; }
.note ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; font-size: 14.5px; }
.note li { padding-left: 18px; position: relative; }
.note li::before { content: "✓"; position: absolute; left: 0; font-weight: 700; }
.note + .note { margin-top: 22px; transform: rotate(-1deg); background: var(--sage); }
:root[data-design="desktop"][data-theme="teal"] .note { background: #fff7c7; } :root[data-design="desktop"][data-theme="teal"] .note + .note { background: #e2f1df; }
.recent { display: grid; gap: 4px; }
.recent a { display: flex; gap: 10px; align-items: center; padding: 6px 8px; border-radius: 6px; text-decoration: none; }
.recent a:hover { background: var(--panel); color: var(--ink); }
.recent img, .recent .ph { width: 44px; height: 30px; border: 2px solid var(--line); border-radius: 4px; object-fit: cover; background: var(--lav); flex: none; }
.recent strong { font: 600 14px var(--chrome); display: block; }
.recent small { color: var(--dim); font-size: 12.5px; display: block; line-height: 1.35; }
.counter { margin-top: 22px; text-align: center; font: 12px var(--chrome); color: var(--dim); }
.counter b { display: inline-block; margin-top: 4px; font: 20px var(--mono); letter-spacing: 3px; color: #b8f5a0; background: #1b1a17; padding: 2px 8px; border: 2px solid var(--line); border-radius: 4px; }
@media (max-width: 900px) {
  .home { grid-template-columns: 1fr; }
  .icons { grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); order: 2; }
  .home .side { order: 3; }
}

/* draggable windows (desktop only, enabled by app.js) */
.draggable .titlebar, .draggable.note h2 { cursor: grab; }
.dragging { cursor: grabbing !important; transition: none !important; }
.dragging .titlebar { cursor: grabbing; }

/* greeting chat */
.chat { display: grid; gap: 6px; margin: 18px 0 20px; max-width: 520px; }
.bubble {
  justify-self: start; max-width: 100%; padding: 7px 14px; font-size: 16px; line-height: 1.45;
  background: var(--panel); border: 2px solid var(--line); border-radius: 16px 16px 16px 4px;
}
.bubble:first-child { font-size: 18px; }
.chat .typing { display: inline-flex; gap: 4px; padding: 11px 14px; }
.chat .typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--dim); animation: dot 1s infinite ease-in-out; }
.chat .typing i:nth-child(2) { animation-delay: .15s; } .chat .typing i:nth-child(3) { animation-delay: .3s; }
@keyframes dot { 0%, 60%, 100% { transform: translateY(0); opacity: .5; } 30% { transform: translateY(-4px); opacity: 1; } }
.chat .pop { animation: pop .22s ease-out; }
@keyframes pop { from { transform: scale(.8) translateY(6px); opacity: .2; } }
.chat .replies[hidden], .counter[hidden] { display: none; }
.chat .replies { display: flex; flex-wrap: wrap; gap: 8px; justify-self: end; margin-top: 6px; }
.chat .replies a { padding: 6px 14px; border-radius: 16px 16px 4px 16px; background: var(--accent); color: var(--on-accent); text-decoration: none; border: 2px solid var(--line); font-size: 14.5px; }
.chat .replies a:hover { filter: brightness(1.07); }

/* ── projects ───────────────────────────── */
.grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); padding: 20px; }
.card { display: flex; flex-direction: column; text-decoration: none; min-width: 0; background: var(--panel); border: 2px solid var(--line); border-radius: var(--radius); overflow: hidden; transition: transform .12s, box-shadow .12s; }
.card:hover { transform: translate(-2px, -2px); box-shadow: 4px 4px 0 var(--shadow); color: var(--ink); }
.card .shot { aspect-ratio: 16 / 10; border-bottom: 2px solid var(--line); background: var(--lav); overflow: hidden; }
.card .shot img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card .txt { padding: 10px 12px 12px; display: grid; gap: 6px; }
.card h3 { margin: 0; font-size: 16px; display: flex; gap: 6px; align-items: center; }
.card p { margin: 0; font-size: 13.5px; color: var(--dim); line-height: 1.45; }
.star { color: var(--accent); }
.listview { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.listview th { text-align: left; font: 600 12.5px var(--chrome); color: var(--dim); padding: 6px 12px; border-bottom: 2px solid var(--line); background: var(--panel); }
.listview td { padding: 8px 12px; border-bottom: 1px solid var(--soft-line); vertical-align: middle; }
.listview tr:nth-child(even) td { background: color-mix(in srgb, var(--panel) 55%, transparent); }
.listview .nowrap { white-space: nowrap; }
.listview a.rowlink { text-decoration: none; font-weight: 600; }
.listview a.rowlink:hover { text-decoration: underline; }
.scroll { overflow-x: auto; }
.thumb { width: 64px; height: 40px; object-fit: cover; border: 1px solid var(--line); border-radius: 4px; background: var(--lav); vertical-align: middle; display: block; }
.detail { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.frame { border: 2px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--lav); box-shadow: 4px 4px 0 var(--shadow); }
.frame img { width: 100%; display: block; }
.detail .meta { display: grid; gap: 14px; }
.prose { max-width: 68ch; }
.prose ul { padding-left: 20px; margin: 0; }
.prose li { margin: 4px 0; }
.prose li::marker { color: var(--accent); }
.pager { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
@media (max-width: 760px) { .detail { grid-template-columns: 1fr; } }

/* ── about ──────────────────────────────── */
.banner { margin: -20px -22px 18px; border-bottom: 2px solid var(--line); background: var(--panel); aspect-ratio: 4 / 1; overflow: hidden; }
.banner img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 26px; align-items: start; }
@media (max-width: 760px) { .cols { grid-template-columns: 1fr; } }
.section-h { font-size: 15px; margin: 0 0 10px; }
.group + .group { margin-top: 14px; }
.group h3 { font: 600 12.5px var(--chrome); color: var(--dim); margin: 0 0 8px; text-transform: uppercase; letter-spacing: .06em; }
.timeline { list-style: none; padding: 0 0 0 18px; margin: 0; border-left: 2px dashed var(--soft-line); display: grid; gap: 14px; }
.timeline li { position: relative; }
.timeline li::before { content: ""; position: absolute; left: -25px; top: 6px; width: 10px; height: 10px; border: 2px solid var(--line); border-radius: 50%; background: var(--rose); }
.timeline .when { font: 12.5px var(--chrome); color: var(--dim); }
.badges { display: flex; flex-wrap: wrap; gap: 14px; }
.badge { display: flex; flex-direction: column; align-items: center; gap: 6px; width: 140px; text-align: center; font: 12.5px var(--chrome); text-decoration: none; padding: 8px; border-radius: 6px; border: 2px solid transparent; }
a.badge:hover { border-color: var(--line); background: var(--panel); color: var(--ink); }
.badge img { width: 84px; height: 84px; object-fit: contain; }

/* ── contact & conversations ────────────── */
.compose .row { display: grid; grid-template-columns: 76px 1fr; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--soft-line); }
.compose .row label { font: 13px var(--chrome); color: var(--dim); }
.compose .row input { border: 0; box-shadow: none; background: transparent; padding: 4px 0; }
.compose .row input:focus { outline: none; }
.compose .row:focus-within { border-bottom-color: var(--accent); }
.compose textarea { margin-top: 12px; min-height: 180px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.contact-rows { display: grid; gap: 10px; }
.contact-rows a { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 13px; border: 2px solid var(--line); border-radius: var(--r-sm); background: var(--panel); text-decoration: none; font-family: var(--chrome); }
.contact-rows a:hover { background: var(--butter); color: var(--ink); }
.contact-rows small { color: var(--dim); font-family: var(--mono); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mine:empty { display: none; }
.thread { display: grid; gap: 14px; }
.mail { border: 2px solid var(--line); border-radius: var(--r-sm); background: var(--paper); overflow: hidden; }
.mail.me { background: color-mix(in srgb, var(--sky) 35%, var(--paper)); }
.mail-h { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 7px 12px; border-bottom: 1px solid var(--soft-line); background: var(--panel); font-size: 13px; }
.mail-h strong { font-family: var(--chrome); font-size: 14px; }
.mail-b { padding: 10px 14px 12px; white-space: pre-wrap; overflow-wrap: anywhere; }
.copyline { display: flex; gap: 8px; margin-top: 8px; }
.copyline input { font: 12.5px var(--mono); }
.callout { padding: 12px 14px; border: 2px solid var(--line); border-radius: var(--r-sm); background: var(--butter); color: var(--ink); }

/* admin inbox: two-pane mail app */
.mailapp { display: grid; grid-template-columns: 320px minmax(0, 1fr); min-height: 520px; }
.maillist { border-right: 2px solid var(--line); overflow-y: auto; max-height: 72vh; }
.maillist a { display: grid; gap: 2px; padding: 10px 14px; border-bottom: 1px solid var(--soft-line); text-decoration: none; }
.maillist a:hover { background: var(--panel); color: var(--ink); }
.maillist a[aria-current] { background: var(--lav); }
.maillist .top { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; }
.maillist .who { font-family: var(--chrome); }
.maillist .subj { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.maillist .snip { font-size: 12.5px; color: var(--dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.maillist .unread .who, .maillist .unread .subj { font-weight: 700; }
.maillist .unread .who::before { content: "● "; color: #d4553f; }
.mailview { padding: 18px 20px; display: grid; gap: 14px; align-content: start; }
.mailview h2 { margin: 0; font-size: 20px; }
.empty { display: grid; place-items: center; color: var(--dim); font-family: var(--chrome); padding: 40px; }
@media (max-width: 820px) { .mailapp { grid-template-columns: 1fr; } .maillist { border-right: 0; border-bottom: 2px solid var(--line); max-height: 300px; } }

/* ── résumé (traditional) ───────────────── */
.viewer { background: color-mix(in srgb, var(--panel) 70%, var(--soft-line)); padding: 28px 16px; overflow-x: auto; }
.cv {
  width: 210mm; max-width: 100%; min-height: 297mm; margin: 0 auto; background: #fff; color: #1d1d1d;
  padding: 16mm 17mm; font: 10.5pt/1.42 var(--serif);
  box-shadow: 0 1px 0 #d8d2c8, 0 12px 32px rgba(40, 30, 20, .16);
}
.cv a { color: inherit; text-decoration: none; }
.cv header { text-align: center; margin-bottom: 4mm; }
.cv h1 { font: 600 22pt/1.1 var(--serif); letter-spacing: .02em; margin: 0; font-variant: small-caps; }
.cv .cv-title { margin: 1mm 0 1.5mm; font-size: 11pt; font-style: italic; }
.cv .cv-contact { font-size: 9.5pt; color: #333; }
.cv .cv-contact span + span::before { content: " · "; color: #888; }
.cv h2 {
  font: 600 10.5pt var(--serif); text-transform: uppercase; letter-spacing: .12em;
  margin: 5mm 0 2mm; padding-bottom: 1mm; border-bottom: .8pt solid #1d1d1d; break-after: avoid;
}
.cv p { margin: 0; }
.cv .entry { break-inside: avoid; }
.cv .entry + .entry { margin-top: 2.6mm; }
.cv .entry-h { display: flex; justify-content: space-between; gap: 4mm; align-items: baseline; }
.cv .entry-h strong { font-weight: 600; }
.cv .entry-h .when { font-size: 9.5pt; white-space: nowrap; }
.cv .entry-sub { display: flex; justify-content: space-between; gap: 4mm; font-style: italic; font-size: 9.8pt; color: #333; }
.cv ul { margin: 1mm 0 0; padding-left: 5mm; }
.cv li { margin: .4mm 0; }
.cv .skills-tbl { width: 100%; border-collapse: collapse; }
.cv .skills-tbl th { text-align: left; font-weight: 600; width: 34mm; vertical-align: top; padding: .4mm 0; }
.cv .skills-tbl td { padding: .4mm 0; }
.cv .small { font-size: 9.5pt; color: #333; }
@media (max-width: 760px) { .cv { width: auto; min-height: 0; padding: 22px 18px; } .cv .entry-h, .cv .entry-sub { flex-direction: column; gap: 0; } }

/* ── dock ───────────────────────────────── */
.dock {
  position: fixed; left: 50%; bottom: 12px; transform: translateX(-50%); z-index: 30;
  display: flex; gap: 6px; padding: 7px 10px 9px;
  background: color-mix(in srgb, var(--paper) 88%, transparent); backdrop-filter: blur(6px);
  border: 2px solid var(--line); border-radius: calc(var(--radius) + 6px); box-shadow: var(--hard);
}
.dock a { position: relative; display: grid; place-items: center; width: 46px; height: 46px; border-radius: 10px; text-decoration: none; transition: transform .12s; }
.dock a svg { width: 36px; height: 36px; }
.dock a:hover { transform: translateY(-5px); }
.dock a .lbl { position: absolute; bottom: 58px; left: 50%; transform: translateX(-50%); white-space: nowrap; font: 12px var(--chrome); background: var(--ink); color: var(--paper); padding: 1px 7px; border-radius: 4px; opacity: 0; pointer-events: none; transition: opacity .1s; }
.dock a:hover .lbl, .dock a:focus-visible .lbl { opacity: 1; }
.dock a[aria-current]::after { content: ""; position: absolute; bottom: -5px; width: 5px; height: 5px; border-radius: 50%; background: var(--ink); }
.dock a .badge-n { position: absolute; top: -4px; right: -4px; }
.dock .sep { width: 2px; background: var(--soft-line); margin: 4px 2px; border-radius: 2px; }
footer.fine { text-align: center; font: 12px var(--chrome); color: var(--dim); margin-top: 28px; }

/* ── spotlight ──────────────────────────── */
.spot-back { position: fixed; inset: 0; z-index: 60; background: rgba(30, 24, 20, .28); display: grid; justify-items: center; align-items: start; padding-top: 14vh; }
.spot-back[hidden] { display: none; }
.spot { width: min(560px, calc(100vw - 32px)); background: var(--paper); border: 2px solid var(--line); border-radius: var(--radius); box-shadow: var(--hard); overflow: hidden; }
.spot input { width: 100%; border: 0; border-bottom: 2px solid var(--line); background: transparent; color: var(--ink); font: 18px var(--body); padding: 14px 16px; outline: none; }
.spot ul { list-style: none; margin: 0; padding: 6px; max-height: 50vh; overflow-y: auto; }
.spot li a { display: flex; justify-content: space-between; gap: 12px; padding: 8px 10px; border-radius: 6px; text-decoration: none; }
.spot li a small { color: var(--dim); }
.spot li[aria-selected="true"] a { background: var(--accent); color: var(--on-accent); }
.spot li[aria-selected="true"] a small { color: inherit; opacity: .85; }
.spot .hint { padding: 6px 12px; border-top: 2px solid var(--line); font: 12px var(--chrome); color: var(--dim); background: var(--panel); }

/* ── boot screen & screensaver ──────────── */
.boot { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; background: var(--paper); transition: opacity .35s; cursor: pointer; }
.boot.done { opacity: 0; pointer-events: none; }
.boot .inner { display: grid; gap: 14px; justify-items: center; font-family: var(--chrome); }
.boot .logo { font-size: 46px; color: var(--accent); }
.boot .bar { width: 200px; height: 14px; border: 2px solid var(--line); border-radius: 4px; overflow: hidden; background: var(--panel); }
.boot .bar i { display: block; height: 100%; width: 0; background: repeating-linear-gradient(90deg, var(--accent) 0 10px, transparent 10px 13px); animation: load 1.3s steps(14) forwards; }
@keyframes load { to { width: 100%; } }
.saver { position: fixed; inset: 0; z-index: 70; overflow: hidden; background: var(--wall-a); cursor: none; }
.saver[hidden] { display: none; }
.saver span { position: absolute; font: 700 clamp(22px, 4vw, 40px) var(--chrome); color: var(--ink); white-space: nowrap; animation: bounceX 9s linear infinite alternate, bounceY 6.3s linear infinite alternate; }
.saver i { position: absolute; border: 2px solid var(--line); border-radius: 50%; animation: drift 14s linear infinite; opacity: .9; }
@keyframes bounceX { from { left: 0; } to { left: calc(100% - 12ch); } }
@keyframes bounceY { from { top: 0; } to { top: calc(100% - 1.4em); } }
@keyframes drift { from { transform: translateY(110vh) rotate(0); } to { transform: translateY(-20vh) rotate(360deg); } }

/* ── admin ──────────────────────────────── */
.narrow { max-width: 460px; margin: 0 auto; }
.form { display: grid; gap: 14px; }
.field label { display: block; font: 600 13px var(--chrome); margin-bottom: 4px; }
.field .help { font-size: 12.5px; color: var(--dim); margin-top: 3px; }
input[type=text], input[type=url], input[type=email], input[type=password], input[type=number], textarea, select {
  width: 100%; font: 14.5px var(--body); color: var(--ink); background: var(--paper);
  border: 2px solid var(--line); border-radius: 5px; padding: 7px 9px; box-shadow: inset 2px 2px 0 rgba(0, 0, 0, .06);
}
textarea { min-height: 110px; resize: vertical; line-height: 1.5; }
input[type=color] { width: 54px; height: 34px; padding: 2px; border: 2px solid var(--line); border-radius: 5px; background: var(--paper); }
.check { display: flex; gap: 8px; align-items: center; font: 13px var(--chrome); }
.check input { width: 16px; height: 16px; accent-color: var(--accent); }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.alert { padding: 8px 12px; border: 2px solid var(--line); border-radius: 5px; font: 13.5px var(--chrome); color: var(--ink); }
.alert.ok { background: var(--sage); }
.alert.bad { background: var(--rose); }
.folders { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
.folder { position: relative; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px 8px; text-decoration: none; border: 2px solid transparent; border-radius: 6px; font: 13.5px var(--chrome); text-align: center; }
.folder:hover { border-color: var(--line); background: var(--panel); color: var(--ink); }
.folder .ficon { width: 52px; height: 40px; border: 2px solid var(--line); border-radius: 3px 10px 3px 3px; background: var(--tint, var(--peach)); box-shadow: 3px 3px 0 var(--shadow); }
.folder .badge-n { position: absolute; top: 6px; right: calc(50% - 38px); }
.inline { display: inline; margin: 0; }
.preview { margin-top: 6px; max-width: 220px; max-height: 120px; border: 2px solid var(--line); border-radius: 4px; background: var(--panel); display: block; }
.media-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
.media-item { border: 2px solid var(--line); border-radius: 6px; background: var(--panel); overflow: hidden; display: flex; flex-direction: column; }
.media-item img { width: 100%; aspect-ratio: 4 / 3; object-fit: contain; background: var(--paper); border-bottom: 2px solid var(--line); }
.media-item .meta { padding: 8px; display: grid; gap: 6px; font-size: 12.5px; }
.media-item input { font: 12px var(--mono); padding: 4px 6px; }
input[type=file] { font: 13px var(--chrome); }
.appearance { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 24px; align-items: start; }
.appearance fieldset { border: 2px solid var(--line); border-radius: var(--r-sm); padding: 10px 14px 14px; margin: 0; display: grid; gap: 12px; }
.appearance legend { font: 600 13px var(--chrome); padding: 0 6px; }
.color-row { display: flex; gap: 12px; align-items: center; }
.previewpane { position: sticky; top: 46px; }
.previewpane iframe { width: 100%; height: 72vh; border: 2px solid var(--line); border-radius: var(--r-sm); background: var(--paper); }
@media (max-width: 960px) { .appearance { grid-template-columns: 1fr; } .previewpane { position: static; } }

/* ════════════════════════════════════════════════════════════
   Design languages. Desktop is the default styling above; the
   others are scoped by html[data-design] and reuse the tokens,
   so every palette works with every design.
   ════════════════════════════════════════════════════════════ */
.ph-h { font-size: 16px; margin: 24px 0 8px; }
.ui-btn { font: 13.5px var(--chrome); color: var(--ink); background: var(--paper); border: 2px solid var(--line); border-radius: var(--r-sm); padding: 3px 10px; cursor: pointer; white-space: nowrap; }
.ui-btn:hover { background: var(--butter); }
.ui-btn[hidden] { display: none; }
.menubar .ui-btn { border: 0; background: none; padding: 2px 8px; border-radius: 3px; }
.menubar .ui-btn:hover { background: var(--ink); color: var(--paper); }
.menu-h { font: 600 11px var(--chrome); text-transform: uppercase; letter-spacing: .08em; color: var(--dim); padding: 6px 10px 2px; }
.menu-pop button { font: 13.5px var(--chrome); color: var(--ink); background: none; border: 0; cursor: pointer; border-radius: 3px; }
.menu-pop button:hover { background: var(--ink); color: var(--paper); }
.inbox-link { display: inline-flex; align-items: center; gap: 6px; font: 13.5px var(--chrome); text-decoration: none; padding: 3px 10px; border: 2px solid var(--line); border-radius: var(--r-sm); background: var(--paper); white-space: nowrap; }
.inbox-link:hover { background: var(--butter); color: var(--ink); }
[data-inbox-slot]:empty { display: none; }
.design-pick { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); margin-top: 4px; }
.design-pick label { display: grid; gap: 4px; padding: 10px; border: 2px solid var(--soft-line); border-radius: var(--r-sm); cursor: pointer; font: 13px var(--chrome); background: var(--paper); }
.design-pick label:has(input:checked) { border-color: var(--line); background: var(--butter); box-shadow: 0 3px 0 var(--line); }
.design-pick input { position: absolute; opacity: 0; }
.design-pick label:focus-within { outline: 2px dashed var(--accent); outline-offset: 2px; }
.design-pick small { font: 12px/1.35 var(--body); color: var(--dim); }
.design-thumb { display: grid; height: 54px; border: 2px solid var(--line); border-radius: 4px; background: var(--panel); padding: 4px; gap: 3px; }
.design-thumb i { display: block; background: var(--paper); border: 1px solid var(--line); border-radius: 2px; }
.dt-desktop { grid-template: 1fr 1fr / 1fr 2fr; } .dt-desktop i:nth-child(2) { grid-row: span 2; background: var(--peach); } .dt-desktop i:nth-child(3) { background: var(--sage); }
.dt-messenger { grid-template: 1fr 1fr 1fr / 1fr 2fr; } .dt-messenger i:first-child { grid-row: span 3; } .dt-messenger i:nth-child(2) { width: 70%; border-radius: 6px; background: var(--sky); } .dt-messenger i:nth-child(3) { width: 55%; justify-self: end; border-radius: 6px; background: var(--peach); }
.dt-editorial { grid-template: 10px 1fr / 1fr 1fr; } .dt-editorial i:first-child { grid-column: span 2; background: var(--ink); } .dt-editorial i:nth-child(2) { background: var(--butter); }
.dt-notebook { grid-template: 1fr / 1fr 3fr 1fr; } .dt-notebook i:nth-child(2) { background: repeating-linear-gradient(var(--paper) 0 5px, var(--soft-line) 5px 6px); }

/* ── Messenger ──────────────────────────── */
html[data-design="messenger"] body { height: 100vh; overflow: hidden; }
.ms-app { display: grid; grid-template-columns: 320px minmax(0, 1fr); height: 100vh; max-width: 1280px; margin: 0 auto; background: var(--paper); border-inline: 2px solid var(--line); }
.ms-side { display: flex; flex-direction: column; min-height: 0; border-right: 2px solid var(--line); background: var(--panel); }
.ms-me { display: flex; gap: 12px; align-items: center; padding: 16px 16px 10px; }
.ms-me .avatar { width: 48px; height: 48px; font-size: 20px; border-radius: 50%; }
.ms-me-txt { display: grid; min-width: 0; }
.ms-me-txt strong { font: 700 16px var(--chrome); }
.ms-me-txt small { color: var(--dim); font-size: 12.5px; display: flex; align-items: center; gap: 6px; }
.ms-dot { width: 8px; height: 8px; border-radius: 50%; background: #3f9a52; flex: none; }
.ms-tools { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 16px 12px; border-bottom: 2px solid var(--line); }
.ms-tools .menu-pop { left: 0; right: auto; }
.ms-chats { overflow-y: auto; flex: 1; padding: 6px; }
.ms-chat { display: flex; gap: 12px; align-items: center; padding: 9px 10px; border-radius: var(--r-sm); text-decoration: none; }
.ms-chat:hover { background: var(--paper); color: var(--ink); }
.ms-chat[aria-current] { background: var(--accent); color: var(--on-accent); }
.ms-chat[aria-current] small { color: inherit; opacity: .85; }
.ms-ava { flex: none; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-size: 19px; border: 2px solid var(--line); background: var(--tint, var(--butter)); object-fit: cover; }
.ms-sub .ms-ava { width: 34px; height: 34px; border-radius: 9px; font: 700 15px var(--chrome); }
.ms-meta { display: grid; min-width: 0; }
.ms-meta strong { font: 600 14.5px var(--chrome); }
.ms-meta small { font-size: 12.5px; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ms-group { font: 600 11px var(--chrome); text-transform: uppercase; letter-spacing: .08em; color: var(--dim); padding: 14px 10px 4px; }
.ms-side-foot { padding: 8px 12px 12px; border-top: 2px solid var(--soft-line); }
.ms-side-foot .counter { margin: 0; }
.ms-pane { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.ms-head { display: flex; gap: 12px; align-items: center; padding: 10px 18px; border-bottom: 2px solid var(--line); background: var(--paper); }
.ms-head .ms-ava { width: 38px; height: 38px; font-size: 17px; }
.ms-head-txt { flex: 1; min-width: 0; display: grid; }
.ms-head h1 { font-size: 17px; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ms-head small { color: var(--dim); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ms-actions { display: flex; gap: 6px; }
.ms-back { display: none; font: 28px/1 var(--chrome); text-decoration: none; padding: 0 6px 4px; }
.ms-log { flex: 1; overflow-y: auto; padding: 18px clamp(14px, 3vw, 32px) 26px; display: flex; flex-direction: column; gap: 8px;
  background-image: radial-gradient(var(--wall-ink) 1px, transparent 1.3px); background-size: 14px 14px; }
.ms-day { text-align: center; margin: 2px 0 8px; } .ms-day span { font: 12px var(--chrome); color: var(--dim); background: var(--panel); border: 1px solid var(--soft-line); border-radius: 999px; padding: 2px 10px; }
.ms-row { display: flex; }
.ms-row.ms-mine { justify-content: flex-end; }
.ms-b { max-width: min(560px, 86%); padding: 9px 14px; background: var(--panel); border: 2px solid var(--line); border-radius: 18px 18px 18px 5px; line-height: 1.5; overflow-wrap: anywhere; animation: rise .2s ease-out; }
@keyframes rise { from { transform: translateY(6px) scale(.97); } }
.ms-mine .ms-b { background: var(--accent); color: var(--on-accent); border-radius: 18px 18px 5px 18px; }
.ms-b.ms-wide { max-width: min(680px, 100%); width: 100%; }
.ms-b.ms-photo { padding: 4px; overflow: hidden; } .ms-b.ms-photo img { display: block; max-width: 100%; max-height: 340px; border-radius: 14px 14px 14px 3px; }
.ms-b.ms-links { display: flex; gap: 8px; flex-wrap: wrap; background: none; border: 0; padding: 4px 0; }
.ms-b.ms-greet { background: none; border: 0; padding: 0; max-width: 100%; }
.ms-greet .chat { margin: 0; gap: 8px; } .ms-greet .bubble { border-radius: 18px 18px 18px 5px; }
.ms-greet .chat .replies { display: none; }
.ms-label { font: 600 11.5px var(--chrome); text-transform: uppercase; letter-spacing: .07em; color: var(--dim); margin-bottom: 6px; }
.ms-list { margin: 0; padding-left: 18px; } .ms-list li + li { margin-top: 4px; }
.ms-cards { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); width: min(680px, 100%); }
.ms-card { display: grid; text-decoration: none; background: var(--paper); border: 2px solid var(--line); border-radius: 14px; overflow: hidden; transition: transform .12s; }
.ms-card:hover { transform: translateY(-2px); color: var(--ink); }
.ms-card img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-bottom: 2px solid var(--line); background: var(--lav); }
.ms-card-t { display: grid; padding: 8px 12px 10px; } .ms-card-t strong { font: 600 14.5px var(--chrome); } .ms-card-t small { color: var(--dim); font-size: 12.5px; line-height: 1.4; }
.ms-files { list-style: none; margin: 0; padding: 0; display: grid; }
.ms-files a { display: flex; gap: 12px; align-items: center; padding: 8px 4px; text-decoration: none; border-bottom: 1px solid var(--soft-line); }
.ms-files li:last-child a { border-bottom: 0; }
.ms-files a > span:last-child { display: grid; min-width: 0; } .ms-files small { color: var(--dim); font-size: 12.5px; }
.ms-file { flex: none; width: 34px; height: 34px; display: grid; place-items: center; border: 2px solid var(--line); border-radius: 8px; background: var(--butter); font-size: 16px; }
.ms-file-msg { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; } .ms-file-msg > span:nth-child(2) { display: grid; flex: 1; min-width: 160px; } .ms-file-msg small { color: var(--dim); font-size: 12.5px; }
.ms-sheet { margin: 6px calc(-1 * clamp(14px, 3vw, 32px)) 0; } .ms-sheet .viewer { background: transparent; }
.ms-pins { display: flex; gap: 14px; flex-wrap: wrap; align-items: start; margin-bottom: 8px; }
.ms-pins .note { flex: 1 1 220px; max-width: 320px; } .ms-pins .note + .note { margin-top: 0; }
.ms-foot { border-top: 2px solid var(--line); background: var(--panel); padding: 10px 14px; }
.ms-quick { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.ms-quick a { padding: 6px 14px; border-radius: 18px 18px 5px 18px; background: var(--paper); border: 2px solid var(--line); text-decoration: none; font-size: 14px; }
.ms-quick a:hover { background: var(--accent); color: var(--on-accent); }
.chat-compose { display: grid; gap: 8px; }
.ms-foot .compose.chat-compose { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ms-foot .compose.chat-compose > .alert, .ms-foot .compose.chat-compose > textarea, .ms-foot .compose.chat-compose > .actions { grid-column: 1 / -1; }
.ms-foot .compose .row { grid-template-columns: 1fr; padding: 0; border: 0; gap: 0; }
.ms-foot .compose .row label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.ms-foot .compose .row input { border: 2px solid var(--line); background: var(--paper); border-radius: 999px; padding: 6px 14px; }
.ms-foot textarea { margin: 0; min-height: 52px; max-height: 30vh; border-radius: 16px; }
.ms-foot .actions { margin: 0 !important; }
.ms-foot .reply { grid-template-columns: minmax(0, 1fr) auto; align-items: end; }
.ms-foot .reply .field { margin: 0; } .ms-foot .reply > .alert { grid-column: 1 / -1; }
.bubbles { gap: 10px; }
.bubbles .mail { max-width: min(560px, 86%); justify-self: end; border-radius: 18px 18px 5px 18px; background: var(--accent); color: var(--on-accent); }
.bubbles .mail.me { justify-self: start; border-radius: 18px 18px 18px 5px; background: var(--panel); color: var(--ink); }
.bubbles .mail-h { background: none; border: 0; padding: 7px 14px 0; font-size: 12px; } .bubbles .mail-h .dim { color: inherit; opacity: .75; }
.bubbles .mail-b { padding: 2px 14px 10px; }
.ms-log .callout { max-width: 680px; }
@media (max-width: 760px) {
  html[data-design="messenger"] body { height: auto; overflow: visible; }
  .ms-app { display: block; height: auto; border: 0; }
  .ms-side { border-right: 0; border-bottom: 2px solid var(--line); }
  .ms-me { padding: 10px 14px 6px; } .ms-tools { padding: 0 14px 8px; border-bottom: 0; }
  .ms-chats { display: flex; gap: 4px; overflow-x: auto; padding: 0 8px 8px; }
  .ms-chat { flex: none; flex-direction: column; gap: 4px; padding: 6px 8px; font-size: 12px; }
  .ms-chat .ms-meta small, .ms-group, .ms-sub, .ms-side-foot { display: none; }
  .ms-chat .ms-meta strong { font-size: 12px; }
  .ms-back { display: block; }
  .ms-head { position: sticky; top: 0; z-index: 5; }
  .ms-log { overflow: visible; }
  .ms-foot { position: sticky; bottom: 0; }
  .ms-foot .compose.chat-compose { grid-template-columns: 1fr; }
}

/* ── Editorial ──────────────────────────── */
html[data-design="editorial"] body { background: var(--sheet); font: 17px/1.65 var(--serif); }
html[data-design="editorial"] h1, html[data-design="editorial"] h2, html[data-design="editorial"] h3 { font-family: var(--serif); }
.ed-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; max-width: 1180px; margin: 0 auto; padding: 8px 24px; font: 12.5px var(--chrome); color: var(--dim); border-bottom: 1px solid var(--soft-line); }
.ed-tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.ed-tools .status { font: 12px var(--chrome); padding: 1px 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--sage); color: var(--ink); }
.ed-tools .ui-btn, .ed-tools .inbox-link { border-width: 1px; }
.ed-mast { text-align: center; max-width: 1180px; margin: 0 auto; padding: 34px 24px 0; }
.ed-name { display: inline-block; font: 700 clamp(44px, 9vw, 104px)/.95 var(--serif); letter-spacing: -.035em; text-decoration: none; }
.ed-name:hover { color: var(--ink); }
.ed-dek { margin: 10px 0 0; font: italic 18px var(--serif); color: var(--dim); }
.ed-nav { display: flex; justify-content: center; gap: clamp(14px, 4vw, 40px); flex-wrap: wrap; margin-top: 22px; padding: 12px 0; border-top: 3px double var(--ink); border-bottom: 1px solid var(--ink); font: 600 13px var(--chrome); text-transform: uppercase; letter-spacing: .14em; }
.ed-nav a { text-decoration: none; padding: 2px 0; border-bottom: 2px solid transparent; }
.ed-nav a[aria-current], .ed-nav a:hover { border-bottom-color: var(--accent); color: var(--ink); }
.ed-main { max-width: 1180px; margin: 0 auto; padding: 36px 24px 60px; }
.ed-kicker { font: 600 12.5px var(--chrome); text-transform: uppercase; letter-spacing: .16em; color: var(--accent); margin: 0 0 10px; }
.ed-kicker a { text-decoration: none; }
.ed-hero { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: clamp(24px, 4vw, 56px); align-items: center; padding-bottom: 40px; border-bottom: 1px solid var(--ink); }
.ed-headline { font: 700 clamp(34px, 5.4vw, 64px)/1.04 var(--serif); letter-spacing: -.02em; margin: 0 0 18px; }
.ed-standfirst { font-size: clamp(18px, 2vw, 21px); line-height: 1.5; color: var(--dim); margin: 0 0 22px; max-width: 62ch; }
.ed-hero-fig, .ed-wide { margin: 0; }
.ed-hero-fig img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; border: 1px solid var(--ink); }
.ed-hero-fig figcaption { font: italic 13.5px var(--serif); color: var(--dim); margin-top: 6px; }
.ed-split { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: clamp(24px, 4vw, 56px); padding: 40px 0; border-bottom: 1px solid var(--ink); }
.ed-letter-head { display: flex; gap: 14px; align-items: center; font-family: var(--chrome); }
.ed-letter-head .avatar { width: 56px; height: 56px; border-radius: 50%; font-size: 22px; }
.ed-letter .bubble { font-family: var(--serif); font-size: 18px; background: none; border: 0; border-left: 3px solid var(--accent); border-radius: 0; padding: 2px 0 2px 14px; }
.ed-letter .chat .replies a { border-radius: 999px; }
.ed-margin .note { transform: none; box-shadow: none; border-width: 1px; font-family: var(--body); }
.ed-margin .note + .note { transform: none; margin-top: 14px; }
.ed-section { font: 700 clamp(26px, 3vw, 34px) var(--serif); margin: 0 0 22px; padding-bottom: 8px; border-bottom: 3px double var(--ink); }
.ed-features { padding-top: 40px; }
.ed-row { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: clamp(20px, 4vw, 48px); align-items: center; padding: 26px 0; border-bottom: 1px solid var(--soft-line); }
.ed-row:nth-child(odd of .ed-row) .ed-fig { order: 2; }
.ed-fig { display: block; overflow: hidden; border: 1px solid var(--ink); aspect-ratio: 16 / 10; background: var(--panel); }
.ed-fig img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .4s; }
.ed-row:hover .ed-fig img { transform: scale(1.03); }
.ed-ph { display: block; height: 100%; background: repeating-linear-gradient(45deg, var(--panel) 0 10px, var(--soft-line) 10px 11px); }
.ed-num { font: 600 13px var(--chrome); color: var(--accent); letter-spacing: .1em; }
.ed-row h3 { font: 700 clamp(26px, 3.2vw, 38px)/1.1 var(--serif); margin: 6px 0 10px; }
.ed-row h3 a { text-decoration: none; } .ed-row h3 a:hover { text-decoration: underline; text-decoration-color: var(--accent); }
.ed-stand { font-size: 18px; color: var(--dim); margin: 0 0 12px; }
.ed-more { display: inline-block; margin-top: 14px; font: 600 13px var(--chrome); text-transform: uppercase; letter-spacing: .1em; }
.ed-art-head { max-width: 860px; margin: 0 auto 28px; text-align: center; }
.ed-title { font: 700 clamp(38px, 6vw, 72px)/1.02 var(--serif); letter-spacing: -.025em; margin: 0 0 16px; }
.ed-art-head .ed-standfirst { margin-inline: auto; }
.ed-wide { margin: 0 auto 34px; max-width: 1040px; } .ed-wide img { width: 100%; max-height: 520px; object-fit: cover; display: block; border: 1px solid var(--ink); }
.ed-body { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: clamp(24px, 5vw, 64px); max-width: 1040px; margin: 0 auto; align-items: start; }
.ed-copy { max-width: 66ch; } .ed-copy h2 { font-size: 26px; margin: 32px 0 10px; }
.ed-copy ul { padding-left: 22px; } .ed-copy li { margin: 6px 0; } .ed-copy li::marker { color: var(--accent); }
.ed-copy > p:first-child::first-letter, .ed-drop::first-letter { float: left; font: 700 4.1em/.8 var(--serif); padding: 6px 10px 0 0; color: var(--accent); }
.ed-pull { margin: 28px 0; padding: 14px 0; border-top: 1px solid var(--ink); border-bottom: 1px solid var(--ink); font: italic 600 24px/1.35 var(--serif); text-align: center; }
.ed-facts { position: sticky; top: 20px; border-top: 3px solid var(--ink); padding-top: 12px; font-size: 15.5px; }
.ed-facts h3 { font: 600 12px var(--chrome); text-transform: uppercase; letter-spacing: .14em; color: var(--dim); margin: 18px 0 6px; }
.ed-facts h3:first-child { margin-top: 4px; } .ed-facts p { margin: 0 0 10px; }
.ed-fact-photo .avatar { width: 100%; height: auto; aspect-ratio: 1; border-radius: 0; border-width: 1px; font-size: 64px; }
.ed-badges { max-width: 1040px; margin: 40px auto 0; }
.ed-filters { display: flex; justify-content: center; gap: 18px; flex-wrap: wrap; font: 600 13px var(--chrome); text-transform: uppercase; letter-spacing: .12em; }
.ed-filters a { text-decoration: none; border-bottom: 2px solid transparent; } .ed-filters a[aria-current] { border-bottom-color: var(--accent); }
.ed-gallery { display: grid; gap: 32px 26px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.ed-tile { display: grid; gap: 6px; text-decoration: none; }
.ed-tile-img { display: block; aspect-ratio: 4 / 3; overflow: hidden; border: 1px solid var(--ink); background: var(--panel); }
.ed-tile-img img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .4s; }
.ed-tile:hover img { transform: scale(1.04); } .ed-tile:hover { color: var(--ink); }
.ed-tile strong { font: 700 22px/1.2 var(--serif); margin-top: 6px; } .ed-tile span:last-child { color: var(--dim); font-size: 15.5px; }
.ed-index { list-style: none; margin: 0 auto; padding: 0; max-width: 1040px; border-top: 3px double var(--ink); }
.ed-index a { display: grid; grid-template-columns: 50px minmax(0, 1.1fr) minmax(0, 1.6fr) minmax(0, .8fr); gap: 16px; align-items: baseline; padding: 16px 4px; border-bottom: 1px solid var(--soft-line); text-decoration: none; }
.ed-index a:hover { background: var(--panel); color: var(--ink); }
.ed-index-t { font: 700 22px var(--serif); } .ed-index-s { color: var(--dim); } .ed-index-k { font: 12.5px var(--chrome); color: var(--dim); text-align: right; }
.ed-pager { display: flex; justify-content: space-between; gap: 16px; max-width: 1040px; margin: 48px auto 0; padding-top: 18px; border-top: 3px double var(--ink); }
.ed-pager a { display: grid; text-decoration: none; max-width: 48%; } .ed-pager a.next { text-align: right; margin-left: auto; }
.ed-pager small { font: 600 12px var(--chrome); text-transform: uppercase; letter-spacing: .12em; color: var(--accent); } .ed-pager strong { font: 700 22px var(--serif); }
.ed-cv-bar { display: flex; justify-content: center; gap: 14px; flex-wrap: wrap; align-items: center; }
html[data-design="editorial"] .viewer { background: var(--panel); }
.ed-letterpaper { background: var(--paper); border: 1px solid var(--line); padding: 24px 26px; background-image: repeating-linear-gradient(transparent 0 31px, var(--soft-line) 31px 32px); }
.ed-letterpaper textarea { background: transparent; border: 0; box-shadow: none; font: 18px/32px var(--serif); min-height: 256px; padding: 0; }
.ed-narrow { max-width: 760px; margin: 0 auto; display: grid; gap: 18px; }
html[data-design="editorial"] .mail { border-width: 1px; border-radius: 0; font-family: var(--serif); }
html[data-design="editorial"] :is(.btn, .ui-btn, .inbox-link, .contact-rows a, .ed-margin .note) { border-width: 1px; box-shadow: none; border-radius: 0; }
html[data-design="editorial"] .btn { text-transform: uppercase; letter-spacing: .08em; font-size: 12.5px; padding: 7px 16px; }
.ed-foot { border-top: 3px double var(--ink); margin-top: 20px; font-size: 15px; }
.ed-foot-cols { max-width: 1180px; margin: 0 auto; padding: 22px 24px 30px; display: grid; grid-template-columns: 1.4fr 1fr auto; gap: 24px; align-items: start; }
.ed-foot nav { display: flex; flex-wrap: wrap; gap: 8px 18px; font: 13px var(--chrome); }
.ed-foot p { margin: 4px 0 0; font-size: 14px; } .ed-foot .counter { margin: 0; }
@media (max-width: 860px) {
  .ed-hero, .ed-split, .ed-row, .ed-body, .ed-foot-cols { grid-template-columns: 1fr; }
  .ed-row .ed-fig { order: 0 !important; }
  .ed-facts { position: static; }
  .ed-index a { grid-template-columns: 36px 1fr; } .ed-index-s, .ed-index-k { grid-column: 2; text-align: left; }
}

/* ── Notebook ───────────────────────────── */
html[data-design="notebook"] body { background: var(--sheet); }
.nb-top { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 12px; padding: 10px 20px; border-bottom: 1px solid var(--soft-line); background: color-mix(in srgb, var(--sheet) 92%, transparent); backdrop-filter: blur(8px); }
.nb-logo { display: inline-flex; align-items: center; gap: 8px; font: 700 16px var(--chrome); text-decoration: none; }
.nb-mark { display: grid; place-items: center; width: 28px; height: 28px; border-radius: var(--r-sm); background: var(--accent); color: var(--on-accent); font-size: 16px; }
.nb-logo .dim { font-weight: 400; }
.nb-search { display: inline-flex; justify-content: space-between; align-items: center; gap: 30px; min-width: min(280px, 40vw); padding: 5px 8px 5px 12px; font: 14px var(--body); color: var(--dim); background: var(--panel); border: 1px solid var(--soft-line); border-radius: var(--r-sm); cursor: pointer; }
.nb-search:hover { border-color: var(--accent); }
.nb-search[hidden] { display: none; }
.nb-search kbd { font: 11.5px var(--mono); border: 1px solid var(--soft-line); border-radius: 4px; padding: 0 5px; background: var(--paper); }
.nb-gap { flex: 1; }
.nb-top .status { font: 12px var(--chrome); padding: 1px 10px; border: 1px solid var(--soft-line); border-radius: 999px; background: var(--sage); }
.nb-top .ui-btn, .nb-top .inbox-link { border-width: 1px; border-color: var(--soft-line); }
.nb-wrap { display: grid; grid-template-columns: 250px minmax(0, 1fr) 200px; max-width: 1320px; margin: 0 auto; align-items: start; }
.nb-side { position: sticky; top: 53px; max-height: calc(100vh - 53px); overflow-y: auto; padding: 22px 14px 30px 20px; border-right: 1px solid var(--soft-line); font-size: 14.5px; }
.nb-side details + details { margin-top: 14px; }
.nb-side summary { font: 600 12px var(--chrome); text-transform: uppercase; letter-spacing: .08em; color: var(--dim); cursor: pointer; padding: 2px 0 6px; list-style-position: outside; }
.nb-side a { display: block; padding: 4px 10px; margin: 1px 0; border-radius: var(--r-sm); text-decoration: none; border-left: 2px solid transparent; }
.nb-side a:hover { background: var(--panel); color: var(--ink); }
.nb-side a[aria-current] { background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); font-weight: 600; border-left-color: var(--accent); border-radius: 0 var(--r-sm) var(--r-sm) 0; }
.nb-side a.nb-sub { padding-left: 22px; font-size: 13.5px; color: var(--dim); }
.nb-side a.nb-sub[aria-current] { color: var(--accent); }
.nb-side-foot { margin-top: 22px; } .nb-side-foot .counter { text-align: left; }
.nb-main { min-width: 0; padding: 26px clamp(18px, 4vw, 56px) 60px; }
.nb-crumbs { display: flex; gap: 8px; flex-wrap: wrap; font-size: 13.5px; color: var(--dim); margin-bottom: 14px; }
.nb-crumbs a { text-decoration: none; } .nb-crumbs a:hover { color: var(--accent); }
.nb-doc { max-width: 760px; }
.nb-doc h1 { font: 700 clamp(30px, 4vw, 40px)/1.15 var(--body); letter-spacing: -.02em; margin: 0 0 12px; }
.nb-doc h2 { font: 700 23px/1.25 var(--body); letter-spacing: -.01em; margin: 40px 0 12px; padding-top: 14px; border-top: 1px solid var(--soft-line); scroll-margin-top: 70px; position: relative; }
.nb-anchor { position: absolute; left: -22px; color: var(--dim); text-decoration: none; opacity: 0; }
.nb-doc h2:hover .nb-anchor { opacity: 1; }
.nb-doc ul { padding-left: 22px; } .nb-doc li { margin: 4px 0; }
.nb-lede { font-size: 18px; color: var(--dim); margin: 0 0 18px; }
.nb-hello { display: flex; gap: 14px; align-items: center; margin: 18px 0; }
.nb-hello .avatar { width: 54px; height: 54px; border-radius: 50%; font-size: 22px; border-width: 1px; }
.nb-callout { border: 1px solid var(--soft-line); border-left: 4px solid var(--accent); border-radius: var(--r-sm); background: var(--panel); padding: 12px 16px; margin: 18px 0; }
.nb-callout-h { font: 600 13px var(--chrome); color: var(--accent); margin-bottom: 4px; }
.nb-chat .chat { margin: 6px 0 4px; } .nb-chat .bubble { background: var(--paper); border-width: 1px; }
.nb-chat .chat .replies a { border-width: 1px; }
.nb-cv-bar { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: center; }
.nb-cards { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.nb-cards a { display: grid; gap: 4px; align-content: start; padding: 14px 16px; border: 1px solid var(--soft-line); border-radius: var(--radius); text-decoration: none; background: var(--paper); transition: border-color .12s, transform .12s; }
.nb-cards a:hover { border-color: var(--accent); color: var(--ink); transform: translateY(-1px); }
.nb-cards strong { font: 600 15px var(--body); } .nb-cards span { font-size: 14px; color: var(--dim); }
.nb-pcards img { width: calc(100% + 32px); margin: -14px -16px 8px; aspect-ratio: 16 / 9; object-fit: cover; border-bottom: 1px solid var(--soft-line); border-radius: var(--radius) var(--radius) 0 0; }
.nb-table { width: 100%; border-collapse: collapse; font-size: 14.5px; margin: 10px 0 6px; }
.nb-table th, .nb-table td { text-align: left; padding: 8px 12px; border-bottom: 1px solid var(--soft-line); vertical-align: top; }
.nb-table thead th { font: 600 12.5px var(--chrome); color: var(--dim); background: var(--panel); }
.nb-table td.nowrap, .nb-table .nowrap { white-space: nowrap; }
.nb-kv th { width: 120px; color: var(--dim); font-weight: 500; }
.nb-doc code, .nb-kv code { font: 12.5px var(--mono); background: var(--panel); border: 1px solid var(--soft-line); border-radius: 4px; padding: 1px 6px; }
.nb-fig { margin: 18px 0; } .nb-fig img { width: 100%; max-height: 420px; object-fit: cover; display: block; border: 1px solid var(--soft-line); border-radius: var(--radius); }
.nb-tabs { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; border-bottom: 1px solid var(--soft-line); margin: 6px 0 18px; }
.nb-tabs nav { display: flex; gap: 4px; }
.nb-tabs a { padding: 6px 12px; text-decoration: none; font-size: 14px; border-bottom: 2px solid transparent; margin-bottom: -1px; color: var(--dim); }
.nb-tabs a[aria-current] { border-bottom-color: var(--accent); color: var(--ink); font-weight: 600; }
.nb-notes { display: flex; gap: 18px; flex-wrap: wrap; align-items: start; } .nb-notes .note { flex: 1 1 240px; } .nb-notes .note + .note { margin-top: 0; }
.nb-form { border: 1px solid var(--soft-line); border-radius: var(--radius); padding: 6px 18px 16px; background: var(--paper); }
.nb-pager { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; max-width: 760px; margin-top: 48px; }
.nb-pager a { display: grid; gap: 2px; padding: 12px 16px; border: 1px solid var(--soft-line); border-radius: var(--radius); text-decoration: none; }
.nb-pager a:hover { border-color: var(--accent); color: var(--ink); }
.nb-pager a.next { text-align: right; grid-column: 2; }
.nb-pager small { font-size: 12.5px; color: var(--dim); } .nb-pager strong { color: var(--accent); font-weight: 600; }
.nb-toc { position: sticky; top: 53px; padding: 30px 16px; font-size: 13.5px; display: grid; gap: 6px; }
.nb-toc strong { font: 600 12px var(--chrome); text-transform: uppercase; letter-spacing: .08em; color: var(--dim); }
.nb-toc a { text-decoration: none; color: var(--dim); } .nb-toc a:hover { color: var(--accent); }
html[data-design="notebook"] :is(.btn, .mail, .contact-rows a, .callout) { border-width: 1px; box-shadow: none; }
html[data-design="notebook"] .viewer { background: var(--panel); border-radius: var(--radius); }
@media (max-width: 1100px) { .nb-wrap { grid-template-columns: 230px minmax(0, 1fr); } .nb-toc { display: none; } }
@media (max-width: 760px) {
  .nb-wrap { display: block; }
  .nb-side { position: static; max-height: none; border-right: 0; border-bottom: 1px solid var(--soft-line); padding: 12px 16px; display: flex; gap: 6px 16px; flex-wrap: wrap; }
  .nb-side details { margin: 0 !important; } .nb-side details:not([open]) a { display: none; }
  .nb-side a.nb-sub, .nb-side-foot { display: none; }
  .nb-top { flex-wrap: wrap; } .nb-search { min-width: 0; gap: 10px; }
  .nb-pager { grid-template-columns: 1fr; } .nb-pager a.next { grid-column: 1; }
}


/* polish */
.ed-mast-small { padding-top: 18px; }
.ed-mast-small .ed-name { font-size: clamp(30px, 4.5vw, 46px); }
.ed-mast-small .ed-dek { display: none; }
.ed-mast-small .ed-nav { margin-top: 12px; padding: 9px 0; }
.ed-letterpaper { background-image: none; }
.ed-letterpaper textarea { background-image: repeating-linear-gradient(transparent 0 31px, var(--soft-line) 31px 32px); background-attachment: local; }
html[data-design="editorial"] .contact-rows { gap: 0; border-top: 1px solid var(--ink); }
html[data-design="editorial"] .contact-rows a { background: none; border: 0; border-bottom: 1px solid var(--soft-line); padding: 9px 2px; font-family: var(--serif); }
html[data-design="editorial"] .contact-rows a:hover { background: none; color: var(--accent); }
.ed-circ .counter, .nb-side-foot .counter { font: 12px var(--chrome); color: var(--dim); }
.ed-circ .counter b, .nb-side-foot .counter b { display: block; font: 600 22px var(--serif); letter-spacing: .08em; color: var(--ink); background: none; border: 0; padding: 0; margin-top: 2px; }
.nb-side-foot .counter b { font: 600 15px var(--mono); }
html[data-design="notebook"] :is(input[type=text], input[type=email], textarea) { border-width: 1px; border-color: var(--soft-line); box-shadow: none; border-radius: var(--r-sm); }
html[data-design="notebook"] :is(input, textarea):focus { border-color: var(--accent); outline: none; }
html[data-design="notebook"] .compose .row input { border: 0; }
.nb-quick { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 520px) { .nb-quick { grid-template-columns: 1fr; } }
.ms-pins .note { font-size: 13.5px; padding: 10px 14px 12px; transform: rotate(-.6deg); max-width: 280px; }
.ms-pins .note + .note { transform: rotate(.8deg); }
.ms-pins .note ul { gap: 3px; font-size: 13.5px; }
html[data-design="messenger"] :is(input[type=text], input[type=email], textarea) { box-shadow: none; }

/* ── theme quirks ───────────────────────── */
:root[data-design="desktop"][data-theme="teal"] .win, :root[data-design="desktop"][data-theme="teal"] .btn, :root[data-design="desktop"][data-theme="teal"] .dock, :root[data-design="desktop"][data-theme="teal"] .card {
  border-color: #1d1d1d; box-shadow: inset -2px -2px 0 #8d867c, inset 2px 2px 0 #fff, var(--hard);
}
:root[data-design="desktop"][data-theme="teal"] .btn { box-shadow: inset -2px -2px 0 #8d867c, inset 2px 2px 0 #fff; }
:root[data-design="desktop"][data-theme="teal"] .btn:active { box-shadow: inset 2px 2px 0 #8d867c, inset -2px -2px 0 #fff; transform: none; }
:root[data-design="desktop"][data-theme="teal"] .titlebar { background: linear-gradient(90deg, #3d3a86, #8a86c8); }
:root[data-design="desktop"][data-theme="teal"] .titlebar .title { background: transparent; font-size: 18px; }
:root[data-design="desktop"][data-theme="teal"] .menubar { background: var(--paper); }
:root[data-design="desktop"][data-theme="mono"] .titlebar .title { background: #fff; }
:root[data-theme="mono"] .btn.primary { background: #000; color: #fff; }
:root[data-theme="mono"] img { filter: grayscale(1) contrast(1.1); }
:root[data-design="desktop"][data-theme="mono"] .counter b { color: #fff; background: #000; }
:root[data-design="desktop"][data-theme="paper"] .win, :root[data-design="desktop"][data-theme="paper"] .card, :root[data-design="desktop"][data-theme="paper"] .btn, :root[data-design="desktop"][data-theme="paper"] .dock, :root[data-design="desktop"][data-theme="paper"] .note, :root[data-design="desktop"][data-theme="paper"] .mail { border-width: 1px; box-shadow: 0 1px 2px rgba(0,0,0,.04), 0 6px 20px rgba(38, 34, 31, .06); }
:root[data-design="desktop"][data-theme="paper"] .titlebar { background: transparent; border-bottom-width: 1px; height: 36px; }
:root[data-design="desktop"][data-theme="paper"] .titlebar .title { background: transparent; font-weight: 600; }
:root[data-design="desktop"][data-theme="paper"] .titlebar .box, :root[data-design="desktop"][data-theme="paper"] .titlebar a.close { border-width: 1px; border-radius: 50%; width: 12px; height: 12px; background: #e9a59a; }
:root[data-design="desktop"][data-theme="paper"] .note { transform: none; }
:root[data-design="desktop"][data-theme="paper"] .menubar { border-bottom-width: 1px; }
:root[data-design="desktop"][data-theme="midnight"] .titlebar { background: repeating-linear-gradient(to bottom, rgba(255,255,255,.18) 0 1px, transparent 1px 4px) center / calc(100% - 16px) 13px no-repeat, var(--tint); }

/* ── print: only the résumé sheet (or page content) ─ */
@page { size: A4; margin: 14mm; }
@page cv { size: A4; margin: 0; }
@media print {
  .cv { page: cv; }
  html, body { background: #fff !important; }
  .menubar, .dock, .toolbar, .statusbar, .titlebar, footer.fine, .no-print, .boot, .saver, .spot-back,
  .ms-side, .ms-head, .ms-foot, .ms-day, .ed-top, .ed-mast, .ed-foot, .nb-top, .nb-side, .nb-toc, .nb-crumbs, .nb-pager,
  .bb-tools, .bb-foot, .pf-bar, .pf-foot { display: none !important; }
  .bb-main, .pf-main { padding: 0 !important; margin: 0 !important; max-width: none !important; }
  html[data-design="messenger"] body, .ms-app, .ms-pane, .ms-log { display: block !important; height: auto !important; overflow: visible !important; border: 0 !important; background: #fff !important; padding: 0 !important; margin: 0 !important; max-width: none !important; }
  .ms-sheet { margin: 0 !important; }
  .ed-main, .nb-main, .nb-wrap, .nb-doc { display: block !important; padding: 0 !important; margin: 0 !important; max-width: none !important; }
  .stage { padding: 0 !important; max-width: none !important; }
  .win { border: 0 !important; box-shadow: none !important; animation: none !important; background: #fff !important; }
  .viewer { background: #fff !important; padding: 0 !important; overflow: visible !important; }
  .cv { width: auto; min-height: 0; box-shadow: none; padding: 14mm 16mm; color: #000; }
  .cv .cv-contact, .cv .entry-sub, .cv .small { color: #222; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .win, .ms-b, .chat .pop, .saver span, .saver i, .boot .bar i { animation: none; }
  .note, .note + .note { transform: none; }
  .card, .dock a, .btn { transition: none; }
}

/* VT323 is drawn small: scale chrome text up wherever it's the interface font */
:root[data-design="desktop"][data-theme="teal"]:not([data-font]), :root[data-design="desktop"][data-font="vt323"] { --chrome-boost: 1; }
:root[data-design="desktop"][data-theme="teal"]:not([data-font]) :is(.menubar, .seg a, .btn, .statusbar, .icon, .card h3, .group h3, .recent strong, .key, .field label, .contact-rows a, .dock .lbl, .maillist .who, .compose .row label),
:root[data-design="desktop"][data-font="vt323"] :is(.menubar, .seg a, .btn, .statusbar, .icon, .card h3, .group h3, .recent strong, .key, .field label, .contact-rows a, .dock .lbl, .maillist .who, .compose .row label) { font-size: 1.3em; }


/* ════════════════════════════════════════════════════════════
   Clean designs. Pixel fonts, wallpapers, sticky-note tilt, the LCD
   counter, bevels and chunky 2px outlines belong to Desktop only.
   ════════════════════════════════════════════════════════════ */
:root:not([data-design="desktop"]) {
  --chrome: var(--body);
  --hard: 0 1px 2px rgba(0, 0, 0, .05), 0 8px 24px -12px rgba(0, 0, 0, .18);
  --title-ink: var(--ink);
}
:root[data-design="editorial"] { --chrome: var(--body); }
/* teal and mono are retro palettes; outside Desktop they become calm light schemes */
:root[data-theme="teal"]:not([data-design="desktop"]) {
  --wall-a: #f4f3f0; --wall-b: #f4f3f0; --paper: #ffffff; --panel: #f3f1ed; --sheet: #ffffff;
  --line: #d9d4cc; --soft-line: #e8e4dd; --shadow: rgba(0, 0, 0, .12);
  --peach: #eeeaf7; --sage: #e3f0e1; --lav: #eceaf6; --butter: #fff6cf; --rose: #f6e6ea; --sky: #e5eef4;
  --radius: 10px;
}
:root[data-theme="mono"]:not([data-design="desktop"]) { --line: #d4d4d4; --soft-line: #e6e6e6; --radius: 6px; }
:root[data-theme="midnight"]:not([data-design="desktop"]) { --line: #3d365a; }
:root[data-theme="pastel"]:not([data-design="desktop"]), :root:not([data-theme]):not([data-design="desktop"]) { --line: #e2d3c1; }
@media (prefers-color-scheme: dark) {
  :root[data-theme="pastel"]:not([data-design="desktop"]), :root:not([data-theme]):not([data-design="desktop"]) { --line: #4a3f38; }
}
:root:not([data-design="desktop"]) body { background: var(--sheet); background-image: none; }
:root:not([data-design="desktop"]) .ms-log { background-image: none; background: var(--sheet); }

:root:not([data-design="desktop"]) :is(.btn, .ui-btn, .inbox-link, .key, .seg, .bubble, .chat .replies a, .card, .mail, .callout, .contact-rows a,
  .avatar, .note, .frame, .recent img, .recent .ph, .spot, .menu-pop, .ms-ava, .ms-b, .ms-card, .ms-file, .ms-quick a, .ms-foot .compose .row input,
  input[type=text], input[type=email], input[type=search], textarea, select, .alert, .media-item, .preview, .badge) { border-width: 1px; }
:root:not([data-design="desktop"]) :is(.ms-app, .ms-side, .ms-tools, .ms-head, .ms-foot, .ms-card img) { border-width: 1px; border-color: var(--soft-line); }
:root:not([data-design="desktop"]) .seg a + a { border-left-width: 1px; }
:root:not([data-design="desktop"]) :is(.btn, button.btn) { box-shadow: 0 1px 2px rgba(0, 0, 0, .06); font-weight: 500; border-radius: 8px; transition: background .15s, border-color .15s, transform .06s; }
:root:not([data-design="desktop"]) .btn:hover { background: var(--panel); }
:root:not([data-design="desktop"]) .btn.primary { border-color: var(--accent); }
:root:not([data-design="desktop"]) .btn.primary:hover { background: var(--accent); }
:root:not([data-design="desktop"]) .btn:active { transform: translateY(1px); box-shadow: none; }
:root:not([data-design="desktop"]) .key { box-shadow: 0 1px 0 var(--line); }
:root:not([data-design="desktop"]) :is(.ui-btn, .inbox-link) { border-color: var(--soft-line); border-radius: 999px; padding: 4px 12px; font-size: 13px; background: var(--paper); transition: background .15s, border-color .15s; }
:root:not([data-design="desktop"]) :is(.ui-btn, .inbox-link):hover { background: var(--panel); border-color: var(--line); color: var(--ink); }
:root:not([data-design="desktop"]) .menu-pop { border-color: var(--soft-line); border-radius: 12px; box-shadow: var(--hard); padding: 6px; }
:root:not([data-design="desktop"]) .menu-pop button { border-radius: 6px; padding: 5px 10px; font-size: 13.5px; }
:root:not([data-design="desktop"]) .menu-pop button:hover { background: var(--panel); color: var(--ink); }
:root:not([data-design="desktop"]) .menu-h { letter-spacing: .06em; font-size: 10.5px; }
:root:not([data-design="desktop"]) .status { background: var(--panel) !important; border-color: var(--soft-line) !important; }
:root:not([data-design="desktop"]) .avatar { background: var(--panel); }

/* notes are tidy cards, not tilted stickies */
:root:not([data-design="desktop"]) .note, :root:not([data-design="desktop"]) .note + .note { transform: none; box-shadow: none; background: var(--panel); border-color: var(--soft-line); border-radius: var(--radius); }
:root:not([data-design="desktop"]) .note h2 { font: 600 12px var(--body); text-transform: uppercase; letter-spacing: .07em; color: var(--dim); }
:root:not([data-design="desktop"]) .note li::before { content: ""; top: .62em; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); left: 4px; }
:root:not([data-design="desktop"]) .draggable.note h2 { cursor: default; }

/* the visitor counter is a quiet line of text */
:root:not([data-design="desktop"]) .counter { font: 12.5px var(--body); }
:root:not([data-design="desktop"]) .counter b { display: inline; font-weight: 600; font-family: var(--body); font-size: inherit; font-variant-numeric: tabular-nums; letter-spacing: 0; color: var(--ink); background: none; border: 0; padding: 0; margin: 0 0 0 4px; }

/* greeting bubbles: soft, borderless */
:root:not([data-design="desktop"]) .bubble { border-color: transparent; background: var(--panel); }
:root:not([data-design="desktop"]) .chat .replies a { border-color: var(--accent); }
:root:not([data-design="desktop"]) .ms-b { border-color: transparent; }
:root:not([data-design="desktop"]) .ms-mine .ms-b { border-color: var(--accent); }
:root:not([data-design="desktop"]) .ms-pins .note, :root:not([data-design="desktop"]) .ms-pins .note + .note { transform: none; }
:root:not([data-design="desktop"]) :is(.ms-card, .ms-quick a, .ms-file) { border-color: var(--soft-line); }
:root:not([data-design="desktop"]) :is(input[type=text], input[type=email], input[type=search], textarea, select) { border-color: var(--soft-line); box-shadow: none; border-radius: 8px; }
:root:not([data-design="desktop"]) :is(input, textarea, select):focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
:root:not([data-design="desktop"]) :is(.mail, .callout, .contact-rows a, .card) { border-color: var(--soft-line); box-shadow: none; }
:root:not([data-design="desktop"]) .timeline li::before { border-width: 1px; }
:root:not([data-design="desktop"]) .boot .bar { border-width: 1px; }
:root:not([data-design="desktop"]) .saver { background: var(--sheet); }

:root:not([data-design="desktop"]) .compose .row input:focus { box-shadow: none; }

/* ════════════════════════════════════════════════════════════
   Bubbles: a plain page and a column of big chat bubbles.
   Dark by default; the ◐ button switches to light.
   ════════════════════════════════════════════════════════════ */
/* light */
:root[data-design="bubbles"][data-design] {
  --bb-bg: #fff; --bb-b: rgba(206, 206, 206, .5); --bb-ink: #000; --bb-dim: rgba(0, 0, 0, .5); --bb-link: #0076ff;
  --ink: #000; --dim: #6e6e73; --paper: #fff; --panel: #f0f0f0; --sheet: #fff;
  --line: #d2d2d7; --soft-line: #e5e5ea; --accent: #0076ff; --on-accent: #fff; --radius: 14px;
  --butter: #f5f5f7; --sage: #f5f5f7; --lav: #f5f5f7; --peach: #f5f5f7; --rose: #fbeef0; --sky: #f5f5f7;
  color-scheme: light;
}
/* dark: system setting, or the ◐ button */
@media (prefers-color-scheme: dark) {
  :root[data-design="bubbles"][data-design]:not([data-scheme="light"]) {
    --bb-bg: #000; --bb-b: rgba(206, 206, 206, .125); --bb-ink: #fff; --bb-dim: rgba(206, 206, 206, .5);
    --ink: #fff; --dim: #8e8e93; --paper: #1c1c1e; --panel: #1f1f1f; --sheet: #000; --line: #3a3a3c; --soft-line: #2c2c2e;
    --butter: #2c2c2e; --sage: #2c2c2e; --lav: #2c2c2e; --peach: #2c2c2e; --rose: #3a2a2c; --sky: #2c2c2e; color-scheme: dark;
  }
}
:root[data-design="bubbles"][data-design][data-scheme="dark"] {
  --bb-bg: #000; --bb-b: rgba(206, 206, 206, .125); --bb-ink: #fff; --bb-dim: rgba(206, 206, 206, .5);
  --ink: #fff; --dim: #8e8e93; --paper: #1c1c1e; --panel: #1f1f1f; --sheet: #000; --line: #3a3a3c; --soft-line: #2c2c2e;
  --butter: #2c2c2e; --sage: #2c2c2e; --lav: #2c2c2e; --peach: #2c2c2e; --rose: #3a2a2c; --sky: #2c2c2e; color-scheme: dark;
}
html[data-design="bubbles"] body { background: var(--bb-bg); color: var(--bb-ink); }
.bb-tools { position: fixed; top: 14px; right: 16px; z-index: 20; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.bb-main { max-width: 1040px; padding: clamp(28px, 7vw, 84px) clamp(16px, 5vw, 64px) 40px; }
.bb-log { display: flex; flex-direction: column; align-items: flex-start; gap: .2em; font: 400 18px/1.25 var(--body); }
@media (min-width: 600px) { .bb-log { font-size: 24px; } }
@media (min-width: 900px) { .bb-log { font-size: 28px; } }
@media (min-width: 1200px) { .bb-log { font-size: 32px; } }
.bb { position: relative; max-width: min(26em, 100%); padding: .5em .85em; background: var(--bb-b); color: var(--bb-ink); border-radius: 1.25em; overflow-wrap: anywhere;
  transform-origin: 0 100%; transition: border-radius .25s ease-out .075s; }
.bb-last { border-bottom-left-radius: 0; }                       /* no-JS: last bubble keeps the tail */
.bb-play .bb-last:not(.bb-corner) { border-bottom-left-radius: 1.25em; }
.bb-log .bb.bb-corner { border-bottom-left-radius: 0; }
/* while the conversation plays: hidden until each bubble is sent */
.bb-play .bb { visibility: hidden; }
.bb-typing { overflow: hidden; }
.bb-msg { display: block; }
.bb-typing .bb-msg { opacity: 0; }
.bb-dots { position: absolute; top: 0; bottom: 0; left: .85em; display: flex; align-items: center; gap: .2em; pointer-events: none; transform-origin: 0 50%; will-change: transform, opacity; }
.bb-dots b { width: .34em; height: .34em; border-radius: 50%; background: var(--bb-dim); will-change: transform, opacity; }
.bb-typing { will-change: width, transform; }
/* failsafe: if the script never runs, show everything after a moment */
html.js[data-design="bubbles"]:not(.bb-ready) :is(.bb-log .bb, .bb-form, .bb-mine-wrap) { animation: bb-hold 3s; }
@keyframes bb-hold { from, to { visibility: hidden; } }
.bb a { color: var(--bb-link); text-decoration: underline; text-decoration-thickness: .06em; text-underline-offset: .14em; }
.bb a:hover { color: var(--bb-ink); }
.bb strong, .bb-strong { font-weight: 600; }
.bb-small { display: block; font-size: .5em; letter-spacing: .06em; text-transform: uppercase; color: var(--bb-dim); margin-bottom: .5em; }
.bb:has(> .bb-img) { padding: 0; overflow: hidden; background: none; }
.bb-img { display: block; max-width: min(560px, 100%); max-height: 420px; object-fit: cover; }
.bb:has(> .bb-ava) { border-radius: 50%; }
.bb-img.bb-ava { width: 3.2em; height: 3.2em; border-radius: 50%; }
.bb .badges { display: flex; flex-wrap: wrap; gap: 10px; font-size: 13px; letter-spacing: 0; }
.bb .badge { width: 104px; color: var(--bb-ink); text-decoration: none; }
.bb .badge img { width: 64px; height: 64px; object-fit: contain; }
.bb-form, .bb-main > .callout, .bb-main > .thread, .bb-mine-wrap { max-width: 640px; margin-top: 16px; font-size: 16px; }
.bb-form { background: var(--bb-b); border-radius: 22px; padding: 14px 20px 18px; }
.bb-form .compose .row { border-bottom-color: var(--line); }
.bb-form textarea { background: var(--bb-bg); border-color: var(--line); border-radius: 14px; }
.bb-form .btn.primary { border-radius: 999px; padding: 7px 18px; }
.bb-main .thread .mail { border: 0; }
.bb-cv-bar { margin: 16px 0; }
html[data-design="bubbles"] .viewer { background: transparent; padding-inline: 0; }
.bb-foot { padding: 0 clamp(16px, 5vw, 64px) 36px; } .bb-foot .counter { text-align: left; color: var(--bb-dim); margin: 0; }
@media (max-width: 640px) {
  .bb-tools { position: static; padding: 12px 16px 0; }
  .bb-main { padding-top: 22px; }
}

/* ════════════════════════════════════════════════════════════
   Portfolio: docs-landing style single-page CV. Follows the
   system light/dark setting; the bar button overrides it.
   ════════════════════════════════════════════════════════════ */
:root[data-design="portfolio"][data-design] {
  --pf-bg: #ffffff; --pf-bg2: #f6f8fa; --pf-ink: #2c3e50; --pf-head: #2c3e50; --pf-dim: #6a737d; --pf-line: #eaecef; --pf-brand: #3eaf7c;
  --ink: var(--pf-ink); --dim: var(--pf-dim); --paper: #fff; --panel: var(--pf-bg2); --sheet: #fff; --line: #dfe2e5; --soft-line: var(--pf-line);
  --accent: var(--pf-brand); --on-accent: #fff; --radius: 8px;
  --butter: var(--pf-bg2); --sage: var(--pf-bg2); --lav: var(--pf-bg2); --peach: var(--pf-bg2); --rose: #fdecec; --sky: var(--pf-bg2);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root[data-design="portfolio"][data-design]:not([data-scheme="light"]) {
    --pf-bg: #22272e; --pf-bg2: #2b313a; --pf-ink: #adbac7; --pf-head: #cdd9e5; --pf-dim: #8b98a5; --pf-line: #3e4c5a; --pf-brand: #3aa675;
    --paper: #22272e; --sheet: #22272e; --line: #444c56; --rose: #4a2c30; color-scheme: dark;
  }
}
:root[data-design="portfolio"][data-design][data-scheme="dark"] {
  --pf-bg: #22272e; --pf-bg2: #2b313a; --pf-ink: #adbac7; --pf-head: #cdd9e5; --pf-dim: #8b98a5; --pf-line: #3e4c5a; --pf-brand: #3aa675;
  --paper: #22272e; --sheet: #22272e; --line: #444c56; --rose: #4a2c30; color-scheme: dark;
}
html[data-design="portfolio"] body { background: var(--pf-bg); color: var(--pf-ink); font: 16px/1.7 var(--body); transition: background .2s, color .2s; }
.pf-bar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 1.5rem; min-height: 3.6rem; padding: .5rem 1.5rem; background: var(--pf-bg); border-bottom: 1px solid var(--pf-line); }
.pf-brand { font-size: 1.3rem; font-weight: 600; color: var(--pf-head); text-decoration: none; white-space: nowrap; }
.pf-brand:hover { color: var(--pf-head); }
.pf-links { margin-left: auto; display: flex; align-items: center; gap: 1.5rem; }
.pf-links a { color: var(--pf-ink); font-weight: 500; text-decoration: none; line-height: 1.4; border-bottom: 2px solid transparent; white-space: nowrap; }
.pf-links a:hover { color: var(--pf-brand); }
.pf-links a[aria-current] { color: var(--pf-brand); border-bottom-color: var(--pf-brand); }
.pf-ext span { font-size: .85em; color: var(--pf-dim); }
.pf-tools { display: flex; align-items: center; gap: .4rem; }
.pf-scheme { display: grid; place-items: center; width: 2.1rem; height: 2.1rem; padding: 0; border: 0; border-radius: 8px; background: none; color: var(--pf-ink); cursor: pointer; transition: background .15s, color .15s; }
.pf-scheme:hover { background: var(--pf-bg2); color: var(--pf-brand); }
.pf-scheme svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.pf-sun { display: none; }
:root[data-design="portfolio"][data-design][data-scheme="dark"] .pf-sun { display: block; } :root[data-design="portfolio"][data-design][data-scheme="dark"] .pf-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root[data-design="portfolio"][data-design]:not([data-scheme="light"]) .pf-sun { display: block; }
  :root[data-design="portfolio"][data-design]:not([data-scheme="light"]) .pf-moon { display: none; }
}
.pf-main { max-width: 740px; margin: 0 auto; padding: 2rem 1.5rem 3rem; }
.pf-hero { text-align: center; padding: 2.2rem 0 .6rem; }
.pf-ava { display: block; width: 176px; height: 176px; margin: 0 auto 1.6rem; border-radius: 50%; object-fit: cover; }
.pf-ava-ph { display: grid; place-items: center; font-size: 72px; font-weight: 700; background: var(--pf-bg2); color: var(--pf-brand); }
.pf-hero h1 { margin: 0 0 .5rem; font-size: 2.6rem; line-height: 1.2; font-weight: 700; color: var(--pf-head); font-family: var(--body); }
.pf-desc { margin: 0 0 1rem; font-size: 1.45rem; line-height: 1.35; color: var(--pf-dim); }
.pf-hero .status { display: inline-block; font-size: 13px; padding: 2px 12px; border-radius: 999px; border: 1px solid var(--pf-line); }
.pf-doc h1, .pf-doc h2, .pf-doc h3 { font-family: var(--body); color: var(--pf-head); line-height: 1.25; }
.pf-doc h1 { font-size: 2.2rem; margin: .6rem 0 1rem; }
.pf-doc h2 { position: relative; font-size: 1.65rem; font-weight: 600; margin: 2.8rem 0 1rem; padding-bottom: .3rem; border-bottom: 1px solid var(--pf-line); scroll-margin-top: 5rem; }
.pf-hash { position: absolute; left: -.9em; padding-right: .2em; color: var(--pf-brand) !important; font-weight: 500; opacity: 0; transition: opacity .15s; }
.pf-doc h2:hover .pf-hash { opacity: 1; }
.pf-doc h3 { font-size: 1.25rem; font-weight: 600; margin: 1.6rem 0 .25rem; }
.pf-doc p, .pf-doc ul { margin: 0 0 1rem; } .pf-doc ul { padding-left: 1.2em; } .pf-doc li + li { margin-top: .25rem; }
.pf-doc a, .pf-foot a { color: var(--pf-brand); font-weight: 500; text-decoration: none; }
.pf-doc a:hover, .pf-foot a:hover { text-decoration: underline; color: var(--pf-brand); }
.pf-doc h3 a { color: inherit; } .pf-doc h3 a:hover { color: var(--pf-brand); }
.pf-doc .btn { font-weight: 500; text-decoration: none !important; }
.pf-doc .btn:not(.primary) { color: var(--pf-ink); }
.pf-doc .btn.primary, .pf-doc .btn.primary:hover { color: #fff; }
.pf-lead { font-size: 1.12rem; }
.pf-toc { list-style: none; padding: 0 !important; margin: 1.4rem 0 1.6rem !important; display: grid; gap: .3rem; }
.pf-toc li { display: flex; align-items: center; gap: .65rem; margin: 0 !important; }
.pf-ico { width: 1.6rem; text-align: center; font-size: 1.05rem; }
.pf-meta { color: var(--pf-dim); font-size: .9rem; }
.pf-tag { display: inline-block; padding: 0 7px; border-radius: 3px; background: var(--pf-brand); color: #fff; font-size: .68rem; font-weight: 600; line-height: 1.6; vertical-align: .25em; letter-spacing: .02em; }
.pf-proj p { margin: .1rem 0; }
.pf-wide { display: block; width: 100%; max-height: 420px; object-fit: cover; border-radius: 8px; margin: 1rem 0 1.4rem; }
.pf-filters { display: flex; flex-wrap: wrap; gap: .4rem 1.1rem; }
.pf-filters a[aria-current] { text-decoration: underline; text-underline-offset: 4px; }
.pf-crumb { margin: 0 0 .2rem !important; font-size: .92rem; color: var(--pf-dim); }
.pf-pager { display: flex; justify-content: space-between; gap: 1rem; margin-top: 3rem; padding-top: 1rem; border-top: 1px solid var(--pf-line); }
.pf-cv-bar { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: center; margin-bottom: 1rem; }
.pf-form { border: 1px solid var(--pf-line); border-radius: 8px; padding: .8rem 1.2rem 1.1rem; margin-bottom: 1rem; }
.pf-doc .badges { display: flex; flex-wrap: wrap; gap: 12px; }
.pf-doc .badge { color: var(--pf-ink); }
html[data-design="portfolio"] .viewer { background: var(--pf-bg2); border-radius: 8px; }
html[data-design="portfolio"] .ui-btn { border-color: transparent; background: none; color: var(--pf-ink); }
html[data-design="portfolio"] .ui-btn:hover { background: var(--pf-bg2); color: var(--pf-brand); }
.pf-foot { border-top: 1px solid var(--pf-line); padding: 2rem 1.5rem 2.4rem; text-align: center; color: var(--pf-dim); font-size: .95rem; }
.pf-foot p { margin: 0; } .pf-foot .counter { margin: 6px 0 0; }
@media (max-width: 719px) {
  .pf-bar { flex-wrap: wrap; gap: .3rem 1rem; padding: .55rem 1rem; }
  .pf-tools { margin-left: auto; }
  .pf-links { order: 3; width: 100%; margin: 0; gap: 1.1rem; overflow-x: auto; padding-bottom: 2px; }
  .pf-main { padding: 1.2rem 1.1rem 2.5rem; }
  .pf-hero { padding-top: 1.2rem; } .pf-ava { width: 128px; height: 128px; margin-bottom: 1.2rem; }
  .pf-hero h1 { font-size: 2rem; } .pf-desc { font-size: 1.15rem; }
  .pf-hash { display: none; }
}
@media (prefers-reduced-motion: reduce) { .bb, .bb-form, .bb-mine-wrap { animation: none !important; } }
.bb-tools :is(.ui-btn, .inbox-link) { background: var(--bb-b); color: var(--bb-ink); border-color: transparent; }
.bb-tools :is(.ui-btn, .inbox-link):hover { background: var(--bb-b); color: var(--bb-link); border-color: transparent; }

/* status ("Open to …") as a pill with a live dot in every clean design */
:root:not([data-design="desktop"]) .status { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; border-radius: 999px; font: 500 12.5px/1.2 var(--body); padding: 5px 11px 5px 9px; border: 1px solid var(--soft-line); color: var(--ink); }
:root:not([data-design="desktop"]) .status::before { content: ""; flex: none; width: 7px; height: 7px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 0 rgba(34, 197, 94, .5); animation: status-ping 2.4s ease-out infinite; }
@keyframes status-ping { 0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, .45); } 70%, 100% { box-shadow: 0 0 0 6px rgba(34, 197, 94, 0); } }
.bb-tools .status { background: var(--bb-b) !important; border-color: transparent !important; color: var(--bb-ink); font-size: 13px; padding: 6px 12px 6px 10px; }
@media (prefers-reduced-motion: reduce) { :root:not([data-design="desktop"]) .status::before { animation: none; } }

/* visitor count: one quiet line outside Desktop (no LCD, no zero padding) */
:root:not([data-design="desktop"]) .counter br { display: none; }
:root:not([data-design="desktop"]) .counter b { margin-left: .3em; }
.bb-foot .counter:not([hidden]) { display: inline-flex; align-items: center; padding: 6px 12px; border-radius: 999px; background: var(--bb-b); color: var(--bb-dim); font-size: 13px; line-height: 1.2; }
.bb-foot .counter b { color: var(--bb-ink); }

/* ── image lightbox (every design) ───────────────────────── */
img.zoomable { cursor: zoom-in; }
img.zoomable:focus-visible { outline: 3px solid #7aa7ff; outline-offset: 3px; }
html.lb-open, html.lb-open body { overflow: hidden; }
.lb { position: fixed; inset: 0; z-index: 2147483000; display: grid; place-items: center; padding: max(16px, env(safe-area-inset-top)) 16px 16px;
  background: rgba(8, 8, 10, .55); -webkit-backdrop-filter: blur(28px) saturate(1.5); backdrop-filter: blur(28px) saturate(1.5);
  cursor: zoom-out; overscroll-behavior: contain; touch-action: none; }
.lb[hidden] { display: none; }
.lb-bg { position: absolute; inset: -10%; background: center / cover no-repeat; filter: blur(60px) saturate(1.6); opacity: .45; transform: scale(1.1); pointer-events: none; }
.lb-fig { position: relative; margin: 0; display: grid; justify-items: center; gap: 14px; max-width: 100%; }
.lb-img { display: block; max-width: 92vw; max-height: 88vh; object-fit: contain; border-radius: 14px; background: rgba(255, 255, 255, .04);
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .7), 0 0 0 1px rgba(255, 255, 255, .06); transform-origin: center; will-change: transform; }
.lb-cap { max-width: min(640px, 90vw); padding: 7px 14px; border-radius: 999px; background: rgba(255, 255, 255, .1); color: rgba(255, 255, 255, .92);
  font: 500 14px/1.4 ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif; text-align: center; cursor: text;
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); box-shadow: 0 0 0 1px rgba(255, 255, 255, .08); }
.lb-cap[hidden] { display: none; }
.lb-close { position: absolute; top: max(14px, env(safe-area-inset-top)); right: 14px; width: 40px; height: 40px; display: grid; place-items: center; padding: 0;
  border: 0; border-radius: 999px; background: rgba(255, 255, 255, .12); color: #fff; cursor: pointer;
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); box-shadow: 0 0 0 1px rgba(255, 255, 255, .1); transition: background .15s ease, transform .15s ease; }
.lb-close:hover { background: rgba(255, 255, 255, .22); transform: scale(1.06); }
.lb-close:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
@media print { .lb { display: none !important; } }
