/*
  404human — Notion-native editorial workspace design system.
  Warm paper light mode (#ffffff / #f7f6f3) & Notion charcoal dark mode (#191919 / #202020),
  full-bleed page cover + overlapping icon, database properties blocks, multi-color
  Notion sticker tags, Sans/Serif/Mono document switcher, callout blocks, and
  Gallery + Table database views.

  All contrast pairs verified by tools/check-contrast.mjs in both schemes.
*/
@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url("fonts/manrope-var.woff2") format("woff2");
}

:root {
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --sans: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", ui-sans-serif, system-ui, sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", Georgia, Cambria, "Times New Roman", serif;
  color-scheme: light dark;

  /* ---- Core Notion Canvas & Ink ---- */
  --background:           light-dark(#ffffff, #191919);
  --foreground:           light-dark(#37352f, #ebebea);
  --card:                 light-dark(#f7f6f3, #202020);
  --card-foreground:      light-dark(#37352f, #ebebea);
  --secondary:            light-dark(#f1f1ef, #2a2a2a);
  --secondary-foreground: light-dark(#37352f, #ebebea);
  --muted:                light-dark(#efefec, #2a2a2a);
  --muted-foreground:     light-dark(#615d55, #9b9a97);
  --border:               light-dark(#e3e2de, #2f2f2f);
  --border-strong:        light-dark(#d3d1cb, #3d3d3d);

  --accent:               light-dark(#1a6bc4, #1e6bc4);
  --accent-foreground:    #ffffff;
  --primary:              light-dark(#2f2d28, #ebebea);
  --primary-foreground:   light-dark(#ffffff, #191919);
  --link:                 light-dark(#1a6bc4, #6bb0ff);
  --ring:                 light-dark(#1a6bc4, #6bb0ff);
  --code-fg:              light-dark(#b42318, #ff857a);

  --ok-bg:                light-dark(#e7f3ec, #1b3124);
  --ok-fg:                light-dark(#1f5c39, #7ad9a0);
  --accent-soft-bg:       light-dark(#e8f1fb, #1c2c40);
  --accent-soft-fg:       light-dark(#165299, #84beff);
  --mark-bg:              light-dark(#fbf3db, #3d351e);
  --mark-fg:              light-dark(#5c4409, #f5d887);
  --destructive:          #b91c1c;
  --destructive-foreground: #ffffff;

  /* ---- Notion Sticker Tag Palette (7 muted semantic tints) ---- */
  --tag-orange-bg:        light-dark(#faebdd, #3b2818);
  --tag-orange-fg:        light-dark(#7c3a0d, #f5b982);
  --tag-blue-bg:          light-dark(#e5f0fb, #1a2c42);
  --tag-blue-fg:          light-dark(#155296, #87c0ff);
  --tag-purple-bg:        light-dark(#f1eaf9, #2c213d);
  --tag-purple-fg:        light-dark(#5b2d90, #cfa8ff);
  --tag-red-bg:           light-dark(#fbe9e9, #3c1f22);
  --tag-red-fg:           light-dark(#8f1d24, #ff9ea5);
  --tag-green-bg:         light-dark(#e6f3ec, #1b3124);
  --tag-green-fg:         light-dark(#1d5c38, #7ad9a0);
  --tag-brown-bg:         light-dark(#f3ece6, #312721);
  --tag-brown-fg:         light-dark(#5f3d28, #ddb89e);
  --tag-teal-bg:          light-dark(#e4f3f2, #183032);
  --tag-teal-fg:          light-dark(#14595c, #79d4d8);

  /* ---- Cover Banner Surface ---- */
  --cover-a:              light-dark(#f3efe8, #242320);
  --cover-b:              light-dark(#e7eef6, #1b2430);
  --cover-c:              light-dark(#f5ece7, #29211f);
  --cover-dot:            light-dark(rgba(55, 53, 47, 0.08), rgba(235, 235, 234, 0.07));

  --radius-sm:            4px;
  --radius-md:            6px;
  --radius-lg:            8px;
  --spacing:              0.25rem;
  --sidebar-width:        252px;

  /* Declared WCAG contrast checks (verified by tools/check-contrast.mjs) */
  /* check: --foreground on --background 4.5 */
  /* check: --card-foreground on --card 4.5 */
  /* check: --foreground on --muted 4.5 */
  /* check: --link on --background 4.5 */
  /* check: --link on --card 4.5 */
  /* check: --muted-foreground on --background 4.5 */
  /* check: --muted-foreground on --card 4.5 */
  /* check: --muted-foreground on --muted 4.5 */
  /* check: --secondary-foreground on --secondary 4.5 */
  /* check: --accent-foreground on --accent 4.5 */
  /* check: --primary-foreground on --primary 4.5 */
  /* check: --code-fg on --muted 4.5 */
  /* check: --destructive-foreground on --destructive 4.5 */
  /* check: --ok-fg on --ok-bg 4.5 */
  /* check: --accent-soft-fg on --accent-soft-bg 4.5 */
  /* check: --mark-fg on --mark-bg 4.5 */
  /* check: --tag-orange-fg on --tag-orange-bg 4.5 */
  /* check: --tag-blue-fg on --tag-blue-bg 4.5 */
  /* check: --tag-purple-fg on --tag-purple-bg 4.5 */
  /* check: --tag-red-fg on --tag-red-bg 4.5 */
  /* check: --tag-green-fg on --tag-green-bg 4.5 */
  /* check: --tag-brown-fg on --tag-brown-bg 4.5 */
  /* check: --tag-teal-fg on --tag-teal-bg 4.5 */
  /* check: --ring on --background 3 boundary */
}

html[data-theme="light"] { color-scheme: light; }
html[data-theme="dark"]  { color-scheme: dark; }

/* Notion document typography toggle (applies to canvas only, sidebar stays Sans) */
html[data-font="serif"] main {
  font-family: var(--serif);
  font-size: 16.5px;
  line-height: 1.7;
}

html[data-font="serif"] main h1,
html[data-font="serif"] main h2,
html[data-font="serif"] main h3 {
  letter-spacing: -0.012em;
}

html[data-font="mono"] main {
  font-family: var(--mono);
  font-size: 14.2px;
  line-height: 1.68;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  background: var(--background);
  min-height: 100%;
  -webkit-font-smoothing: antialiased;
}

body {
  margin: 0;
  padding: 0;
  font-family: var(--sans);
  font-size: 15.5px;
  line-height: 1.65;
  font-optical-sizing: auto;
  background: var(--background);
  color: var(--foreground);
}

/* ---- Notion 2-Column App Shell ---- */
.notion-app {
  display: flex;
  min-height: 100vh;
  width: 100%;
}

/* ---- Left Workspace Sidebar ---- */
.notion-sidebar {
  width: var(--sidebar-width);
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  background: var(--card);
  border-right: 1px solid var(--border);
  padding: 12px 10px 18px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  scrollbar-width: thin;
}

.notion-workspace {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 8px;
  border-radius: var(--radius-md);
  color: var(--foreground);
  text-decoration: none;
  transition: background 120ms ease;
}

.notion-workspace:hover {
  background: var(--muted);
  text-decoration: none;
}

/* Quick Search (⌘K) button inside sidebar */
.sidebar-search {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  padding: 6px 9px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--background);
  color: var(--muted-foreground);
  font-family: var(--sans);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 100ms ease, border-color 100ms ease, color 100ms ease;
}

.sidebar-search:hover {
  background: var(--muted);
  border-color: var(--border-strong);
  color: var(--foreground);
}

.sidebar-search-left {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.sidebar-search kbd {
  padding: 0 5px;
  font-size: 0.69rem;
  box-shadow: none;
  background: var(--card);
  border-color: var(--border);
  color: var(--muted-foreground);
}

/* Compact 1-row "Now" flagship pin */
.sidebar-now {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 8px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--background);
  color: var(--foreground);
  font-size: 0.81rem;
  font-weight: 600;
  text-decoration: none;
  transition: background 100ms ease, border-color 100ms ease;
}

.sidebar-now:hover {
  background: var(--muted);
  border-color: var(--border-strong);
  text-decoration: none;
}

.sidebar-now-left {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.sidebar-now-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--ok-fg);
  flex-shrink: 0;
}

.sidebar-now-tag {
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--ok-fg);
  white-space: nowrap;
}

.notion-avatar {
  width: 24px;
  height: 24px;
  border-radius: var(--radius-md);
  object-fit: cover;
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.notion-ws-text {
  min-width: 0;
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.notion-ws-name {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--foreground);
}

.notion-ws-sub {
  font-size: 0.72rem;
  color: var(--muted-foreground);
}

.sidebar-section {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar-label {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted-foreground);
  padding: 4px 8px;
  margin: 0;
}

.sidebar-nav {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 5px 8px;
  border-radius: var(--radius-md);
  color: var(--foreground);
  text-decoration: none;
  font-size: 0.87rem;
  font-weight: 500;
  line-height: 1.35;
  transition: background 100ms ease;
}

.sidebar-nav a:hover {
  background: var(--muted);
  text-decoration: none;
}

.sidebar-nav a[aria-current="page"] {
  background: var(--muted);
  color: var(--foreground);
  font-weight: 600;
}

.sidebar-nav a[aria-current="page"] .sidebar-glyph {
  color: var(--foreground);
}

.sidebar-nav-left {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.svg-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
  pointer-events: none;
}

.ui-icon {
  display: inline-block;
  flex-shrink: 0;
  vertical-align: middle;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sidebar-glyph {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  color: var(--muted-foreground);
  flex-shrink: 0;
}

.sidebar-nav a:hover .sidebar-glyph {
  color: var(--foreground);
}

.sidebar-count {
  font-family: var(--mono);
  font-size: 0.71rem;
  color: var(--muted-foreground);
  background: var(--muted);
  padding: 1px 6px;
  border-radius: 999px;
}

.sidebar-writing {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

.sidebar-writing .sidebar-sublist {
  overflow: hidden;
}

.sidebar-sublist {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.sidebar-sublist a {
  display: block;
  padding: 5px 8px;
  border-radius: var(--radius-md);
  text-decoration: none;
  transition: background 100ms ease;
}

.sidebar-sublist a:hover {
  background: var(--muted);
  text-decoration: none;
}

.sidebar-sublist a[aria-current="page"] {
  background: var(--muted);
}

.sidebar-sublist a[aria-current="page"] .sidebar-item-title {
  font-weight: 600;
}

.sidebar-item-title {
  display: block;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--foreground);
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-item-meta {
  display: block;
  font-family: var(--mono);
  font-size: 0.71rem;
  color: var(--muted-foreground);
  margin-top: 1px;
}

.sidebar-more {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  margin-top: 6px;
  padding: 6px 9px;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--foreground);
  background: var(--background);
  border: 1px solid var(--border);
  text-decoration: none;
  border-radius: var(--radius-md);
  flex-shrink: 0;
  transition: background 100ms ease, border-color 100ms ease;
}

.sidebar-more:hover {
  color: var(--foreground);
  background: var(--muted);
  text-decoration: none;
}

.sidebar-footer {
  margin-top: auto;
  padding: 10px 8px 0;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  font-size: 0.76rem;
  color: var(--muted-foreground);
}

.sidebar-footer a {
  color: var(--muted-foreground);
  text-decoration: none;
}

.sidebar-footer a:hover {
  color: var(--foreground);
  text-decoration: underline;
}

/* ---- Main Workspace Area ---- */
.notion-main-wrap {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--background);
}

/* ---- Minimal Sticky Notion Topbar ---- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--background) 92%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.notion-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 45px;
  padding: 5px 20px;
}

.notion-crumbs {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  font-size: 0.85rem;
  color: var(--muted-foreground);
}

.notion-crumb-root {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--foreground);
  font-weight: 600;
  text-decoration: none;
  padding: 3px 6px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
}

.notion-crumb-root:hover {
  background: var(--muted);
  text-decoration: none;
}

.notion-crumb-sep {
  color: var(--border-strong);
  user-select: none;
}

.notion-crumb-current {
  color: var(--muted-foreground);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.notion-topbar-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.topbar-link,
#theme-toggle {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: var(--radius-md);
  font-family: var(--sans);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--muted-foreground);
  background: transparent;
  border: 1px solid transparent;
  text-decoration: none;
  cursor: pointer;
  transition: background 100ms ease, color 100ms ease;
}

.topbar-link:hover,
#theme-toggle:hover {
  background: var(--muted);
  color: var(--foreground);
  text-decoration: none;
}

#theme-toggle {
  border-color: var(--border);
  color: var(--foreground);
}

/* ---- Settings Popover (Design System · Theme · Font) ---- */
.settings-wrap {
  position: relative;
}

.settings-trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-md);
  font-family: var(--sans);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--foreground);
  background: var(--card);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: background 100ms ease, border-color 100ms ease;
}

.settings-trigger:hover,
.settings-trigger[aria-expanded="true"] {
  background: var(--muted);
  border-color: var(--border-strong);
}

.settings-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 316px;
  max-width: calc(100vw - 24px);
  max-height: calc(100vh - 70px);
  overflow-y: auto;
  padding: 13px;
  background: var(--background);
  color: var(--foreground);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.14), 0 2px 6px rgba(0, 0, 0, 0.06);
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 11px;
  font-family: var(--sans);
}

/* Hidden by default (HTML/Notion stay pure); activated per OS/IDE design system */
.win-controls,
.os-bar,
.term-shell,
.mac-menubar,
.mac-lights,
.mac-restore-pill,
.vscode-activity {
  display: none;
}

/* Global Cmd+K Command Palette / Spotlight (available in ALL 14 themes) */
.mac-spot-backdrop {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  position: fixed;
  inset: 0;
  padding: 15vh 16px 24px;
  z-index: 250;
  background: rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(4px);
}

.mac-spot-backdrop[hidden] {
  display: none;
}

.mac-spot-box {
  width: 100%;
  max-width: 580px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--background);
  color: var(--foreground);
  border: 1px solid var(--border-strong);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.28), 0 2px 8px rgba(0, 0, 0, 0.1);
  font-family: var(--sans);
}

.mac-spot-input-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
}

.mac-spot-icon { color: var(--muted-foreground); }

.mac-spot-input {
  flex: 1 1 auto;
  min-width: 0;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--foreground);
  font-family: var(--sans);
  font-size: 1rem;
}

.mac-spot-kbd { font-size: 0.7rem; box-shadow: none; }

.mac-spot-list {
  list-style: none;
  margin: 0;
  padding: 6px;
  max-height: 330px;
  overflow-y: auto;
}

.mac-spot-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  cursor: pointer;
}

.mac-spot-item.is-active,
.mac-spot-item:hover {
  background: var(--accent);
  color: #ffffff;
}

.mac-spot-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.mac-spot-title {
  font-size: 0.88rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mac-spot-sub {
  font-size: 0.75rem;
  color: var(--muted-foreground);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mac-spot-item.is-active .mac-spot-sub,
.mac-spot-item:hover .mac-spot-sub,
.mac-spot-item.is-active .mac-spot-group,
.mac-spot-item:hover .mac-spot-group {
  color: rgba(255, 255, 255, 0.85);
}

.mac-spot-group {
  font-size: 0.71rem;
  font-weight: 600;
  color: var(--muted-foreground);
  flex-shrink: 0;
}

.mac-spot-empty {
  padding: 20px;
  text-align: center;
  color: var(--muted-foreground);
  font-size: 0.88rem;
}

.mac-spot-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  border-top: 1px solid var(--border);
  font-size: 0.72rem;
  color: var(--muted-foreground);
}

.settings-panel[hidden] {
  display: none;
}

.settings-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.settings-heading {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted-foreground);
}

.style-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.style-opt {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 5px 8px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--foreground);
  font-family: var(--sans);
  font-size: 0.77rem;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: background 100ms ease, border-color 100ms ease;
}

.style-opt:hover {
  background: var(--muted);
  border-color: var(--border-strong);
}

.style-opt[aria-pressed="true"] {
  border-color: var(--link);
  background: var(--accent-soft-bg);
  color: var(--accent-soft-fg);
  font-weight: 600;
}

.style-swatch {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  flex-shrink: 0;
  border: 1px solid rgba(128, 128, 128, 0.35);
}

.sw-html     { background: #ffffff; border-color: #111111; box-shadow: inset 0 0 0 2px #0000ee; border-radius: 0; }
.sw-notion   { background: linear-gradient(135deg, #f7f6f3 50%, #37352f 50%); }
.sw-linear   { background: linear-gradient(135deg, #101116 50%, #5e6ad2 50%); }
.sw-obsidian { background: linear-gradient(135deg, #1e1e1e 48%, #a882ff 48%); }
.sw-notes    { background: linear-gradient(135deg, #fcfaf5 55%, #d97706 55%); }
.sw-vscode   { background: linear-gradient(90deg, #333333 28%, #1e1e1e 28% 72%, #007acc 72%); border-radius: 2px; }
.sw-figma    { background: conic-gradient(#f24e1e 0 90deg, #a259ff 90deg 180deg, #0acf83 180deg 270deg, #1abcfe 270deg 360deg); border-radius: 3px; }
.sw-docs     { background: linear-gradient(135deg, #ffffff 50%, #000000 50%); border-radius: 0; }
.sw-arc      { background: linear-gradient(135deg, #b8c0ff 0%, #ffd6e0 55%, #c8f4de 100%); border-radius: 5px; }
.sw-win7     { background: linear-gradient(180deg, #dff1ff 0%, #68b4f0 48%, #3486cc 50%, #9ad1fa 100%); }
.sw-win97    { background: linear-gradient(135deg, #007878 45%, #c0c0c0 45%, #000080 100%); border-radius: 0; }
.sw-macos    { background: radial-gradient(circle at 30% 35%, #ff5f56 0 28%, transparent 30%), radial-gradient(circle at 70% 65%, #007aff 0 32%, #ececee 34%); border-radius: 999px; }
.sw-terminal { background: #0c120e; border-color: #39e58c; box-shadow: inset 0 0 0 2px #39e58c; border-radius: 0; }
.sw-swiss    { background: linear-gradient(135deg, #faf8f3 58%, #c92a2a 58%); border-radius: 0; }

.settings-row {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 10px;
}

.seg-control {
  display: flex;
  padding: 2px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--card);
  gap: 2px;
}

.seg-btn {
  flex: 1 1 0;
  border: 0;
  background: transparent;
  color: var(--muted-foreground);
  padding: 4px 6px;
  border-radius: var(--radius-sm);
  font-family: var(--sans);
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 100ms ease, color 100ms ease;
}

.seg-btn[data-set-font="serif"] { font-family: var(--serif); }
.seg-btn[data-set-font="mono"]  { font-family: var(--mono); }

.seg-btn:hover { color: var(--foreground); }

.seg-btn[aria-pressed="true"] {
  background: var(--background);
  color: var(--foreground);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.settings-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  font-size: 0.74rem;
  color: var(--muted-foreground);
}

.settings-reset {
  border: 0;
  background: transparent;
  padding: 0;
  font: inherit;
  font-weight: 600;
  color: var(--link);
  cursor: pointer;
}

.settings-reset:hover { text-decoration: underline; }

/* Mobile horizontal nav (visible when sidebar collapses < 1040px) */
.mobile-nav-bar {
  display: none;
  padding: 4px 16px 8px;
  border-top: 1px solid var(--border);
  overflow-x: auto;
  scrollbar-width: none;
}

.mobile-nav-bar::-webkit-scrollbar {
  display: none;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  font-size: 0.83rem;
}

.site-nav a {
  color: var(--muted-foreground);
  text-decoration: none;
  padding: 4px 9px;
  border-radius: var(--radius-md);
  font-weight: 500;
}

.site-nav a:hover {
  background: var(--muted);
  color: var(--foreground);
  text-decoration: none;
}

.site-nav a[aria-current="page"] {
  background: var(--muted);
  color: var(--foreground);
  font-weight: 600;
}

/* ---- Full-Bleed Notion Page Cover (Home) ---- */
.notion-cover {
  width: 100%;
  background: linear-gradient(to bottom, #fdfbf8 0%, #fdfbf8 83%, #eedcc8 83.5%, #e5ceb4 100%);
  border-bottom: 1px solid var(--border);
  position: relative;
  overflow: hidden;
  display: flex;
  justify-content: center;
}

.notion-cover picture {
  display: block;
  width: 100%;
  max-width: 960px;
}

.notion-cover-img {
  display: block;
  width: 100%;
  height: auto;
  border: 0;
  border-radius: 0;
}

html[data-theme="dark"] .notion-cover {
  filter: brightness(0.86) contrast(1.04);
}

.notion-cover-caption {
  max-width: 960px;
  margin: 0 auto;
  height: 100%;
  padding: 14px 48px;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
}

.notion-cover-pill {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--muted-foreground);
  background: color-mix(in srgb, var(--background) 78%, transparent);
  backdrop-filter: blur(6px);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 3px 8px;
}

.has-cover main {
  padding-top: 0;
}

.notion-page-icon-overlap {
  margin-top: 22px;
  margin-bottom: 14px;
  position: relative;
  z-index: 2;
  display: inline-flex;
}

.notion-page-avatar {
  width: 78px;
  height: 78px;
  border-radius: 16px;
  object-fit: cover;
  border: 4px solid var(--background);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
  background: var(--card);
}

/* Minimalist Notion page icon above interior page H1s */
.page-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-lg);
  background: var(--card);
  border: 1px solid var(--border);
  font-family: var(--mono);
  font-size: 1.05rem;
  color: var(--muted-foreground);
  margin-bottom: 14px;
  user-select: none;
}

/* ---- Main Document Canvas ---- */
main {
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  padding: 38px 48px 68px;
  flex: 1 0 auto;
}

/* ---- Notion Database Properties Block ---- */
.notion-props {
  display: grid;
  grid-template-columns: 124px minmax(0, 1fr);
  gap: 8px 16px;
  align-items: baseline;
  margin: 18px 0 0;
  padding: 14px 0 4px;
  border-top: 1px solid var(--border);
  font-family: var(--sans);
  font-size: 0.84rem;
}

.notion-prop-key {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted-foreground);
  font-size: 0.81rem;
  font-weight: 500;
  white-space: nowrap;
}

.notion-prop-glyph {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 15px;
  height: 15px;
  opacity: 0.78;
  flex-shrink: 0;
}

.notion-prop-val {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  color: var(--foreground);
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
}

/* ---- True Notion Callout Blocks ---- */
.notion-callout {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 18px;
  border-radius: var(--radius-lg);
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--card-foreground);
  margin: 18px 0;
}

.notion-callout-blue {
  background: var(--accent-soft-bg);
  border-color: color-mix(in srgb, var(--accent-soft-fg) 22%, transparent);
}

.notion-callout-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-md);
  background: var(--background);
  border: 1px solid var(--border);
  font-family: var(--mono);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--foreground);
  flex-shrink: 0;
  margin-top: 1px;
}

.notion-callout-body {
  min-width: 0;
  flex: 1 1 auto;
}

.notion-callout-body > :first-child { margin-top: 0; }
.notion-callout-body > :last-child  { margin-bottom: 0; }

.notion-callout-title {
  font-weight: 700;
  font-size: 0.96rem;
  color: var(--foreground);
  margin: 0 0 6px;
}

.notion-callout-meta {
  font-family: var(--mono);
  font-size: 0.74rem;
  color: var(--muted-foreground);
  margin-bottom: 6px;
}

/* ---- Notion Section Headings ---- */
.notion-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin: 0 0 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.notion-section-head h2 {
  margin: 0;
  font-size: 1.24rem;
}

.notion-section-meta {
  font-family: var(--mono);
  font-size: 0.76rem;
  color: var(--muted-foreground);
}

/* ---- Typography ---- */
h1, h2, h3, h4 {
  color: var(--foreground);
  line-height: 1.24;
  letter-spacing: -0.022em;
  font-weight: 700;
  margin-top: 0;
}

h1 {
  font-size: clamp(2rem, 3.6vw, 2.65rem);
  margin-bottom: 12px;
}

h2 {
  font-size: clamp(1.25rem, 2vw, 1.5rem);
  margin-top: 32px;
  margin-bottom: 12px;
}

h3 {
  font-size: 1.08rem;
  margin-top: 24px;
  margin-bottom: 8px;
}

p {
  margin-top: 0;
  margin-bottom: 14px;
}

pre, code, kbd, .mono {
  font-family: var(--mono);
}

a {
  color: var(--link);
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--link) 35%, transparent);
  text-underline-offset: 3px;
}

a:hover {
  text-decoration-color: var(--link);
}

::selection {
  background: var(--accent-soft-bg);
  color: var(--foreground);
}

:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
  border-radius: 3px;
}

small {
  color: var(--muted-foreground);
  font-size: 0.85rem;
}

hr {
  border: 0;
  height: 1px;
  background: var(--border);
  margin: 28px 0;
}

img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

progress {
  accent-color: var(--accent);
  width: 100px;
  height: 8px;
  vertical-align: middle;
}

/* ---- Homepage Project Progress Table & Cross-Theme Progress Bars ---- */
.prog-meter {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.prog-bar {
  appearance: none;
  -webkit-appearance: none;
  width: 88px;
  height: 7px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--muted);
  overflow: hidden;
}

.prog-bar::-webkit-progress-bar {
  background: var(--muted);
}

.prog-bar::-webkit-progress-value {
  background: var(--accent);
  border-radius: var(--radius-sm);
}

.prog-bar::-moz-progress-bar {
  background: var(--accent);
  border-radius: var(--radius-sm);
}

.prog-frac {
  font-size: 0.76rem;
  color: var(--muted-foreground);
  min-width: 34px;
}

.prog-next {
  color: var(--muted-foreground);
  font-size: 0.86rem;
}

/* ---- Dedicated /projects/ Page Entries ---- */
.projects-stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.project-entry {
  margin: 0;
  padding: 18px 20px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  min-width: 0;
  overflow-wrap: break-word;
}

.project-entry-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-bottom: 8px;
}

.project-entry-title-row {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}

.project-entry h3 {
  margin: 0;
  font-size: 1.08rem;
}

.project-entry h3 a {
  color: var(--foreground);
  text-decoration: none;
}

.project-entry h3 a:hover {
  color: var(--link);
  text-decoration: underline;
}

.project-entry-what {
  margin: 0 0 12px;
  color: var(--foreground);
  font-size: 0.94rem;
  line-height: 1.58;
}

.project-entry-meta {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 6px 12px;
  margin: 0 0 14px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  font-size: 0.86rem;
}

.project-entry-meta dt {
  margin: 0;
  padding-top: 2px;
}

.project-entry-meta dd {
  margin: 0;
  color: var(--muted-foreground);
  min-width: 0;
  overflow-wrap: break-word;
}

.project-entry-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  font-family: var(--mono);
  font-size: 0.78rem;
}

/* Pure HTML Only styling for /projects/ entries */
html[data-style="html"] .project-entry {
  padding: 0 0 20px;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
}

html[data-style="html"] .project-entry h3 a {
  color: var(--link);
  text-decoration: underline;
}

html[data-style="html"] .project-entry-meta {
  border-top: 0;
  padding-top: 0;
}

/* Prevent horizontal overflow globally on narrow screens & long tokens */
main,
article,
section,
.post-header,
.post-body {
  min-width: 0;
  overflow-wrap: break-word;
}

pre {
  max-width: 100%;
}

.table-wrap {
  max-width: 100%;
}

/* ---- Inline Code, Kbd, Mark & Notion Sticker Pills ---- */
code, kbd {
  background: var(--muted);
  font-size: 0.85em;
  border-radius: var(--radius-sm);
}

code {
  padding: 0.14em 0.38em;
  color: var(--code-fg);
}

kbd {
  display: inline-block;
  padding: 1px 6px;
  background: var(--card);
  color: var(--foreground);
  border: 1px solid var(--border-strong);
  box-shadow: 0 1px 0 var(--border-strong);
  font-size: 0.8em;
}

pre code, mark code, a code, td > code {
  color: inherit;
}

pre code, mark code, a code {
  background: none;
  border: 0;
  padding: 0;
  font-size: inherit;
}

mark {
  background: var(--mark-bg);
  color: var(--mark-fg);
  padding: 1px 5px;
  border-radius: var(--radius-sm);
  font-weight: 600;
}

.badge {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem;
  max-width: 100%;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-family: var(--sans);
  font-size: 0.76rem;
  font-weight: 600;
  line-height: 1.4;
  white-space: normal;
  overflow-wrap: anywhere;
  background: var(--secondary);
  color: var(--secondary-foreground);
  text-decoration: none;
}

a.badge:hover {
  filter: brightness(0.95);
  text-decoration: none;
}

.badge-ok     { background: var(--ok-bg);          color: var(--ok-fg); }
.badge-accent { background: var(--accent-soft-bg); color: var(--accent-soft-fg); }
.badge-muted  { background: var(--muted);          color: var(--muted-foreground); }

/* Multi-color Notion sticker tags by topic */
.tag-rust         { background: var(--tag-orange-bg); color: var(--tag-orange-fg); }
.tag-postgres     { background: var(--tag-blue-bg);   color: var(--tag-blue-fg); }
.tag-ai           { background: var(--tag-purple-bg); color: var(--tag-purple-fg); }
.tag-security     { background: var(--tag-red-bg);    color: var(--tag-red-fg); }
.tag-reliability  { background: var(--tag-green-bg);  color: var(--tag-green-fg); }
.tag-architecture { background: var(--tag-brown-bg);  color: var(--tag-brown-fg); }
.tag-databases    { background: var(--tag-teal-bg);   color: var(--tag-teal-fg); }

/* Kind badges */
.kind-failure     { background: var(--tag-red-bg);    color: var(--tag-red-fg); }
.kind-experiment  { background: var(--tag-purple-bg); color: var(--tag-purple-fg); }
.kind-release     { background: var(--tag-green-bg);  color: var(--tag-green-fg); }

.dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

/* ---- Notion-Style Buttons ---- */
button.link {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  color: var(--link);
  text-decoration: underline;
  cursor: pointer;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 7px 14px;
  border-radius: var(--radius-md);
  font-family: var(--sans);
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  background: var(--background);
  color: var(--foreground);
  border: 1px solid var(--border-strong);
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease;
}

.btn:hover {
  background: var(--muted);
  text-decoration: none;
}

.btn-primary {
  background: var(--primary);
  color: var(--primary-foreground);
  border-color: var(--primary);
}

.btn-primary:hover {
  background: var(--primary);
  opacity: 0.9;
}

.btn-secondary {
  background: var(--card);
  color: var(--foreground);
  border-color: var(--border);
}

.btn-secondary:hover {
  background: var(--muted);
  border-color: var(--border-strong);
}

/* ---- Home Hero & Flagship Callout ---- */
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(290px, 0.82fr);
  gap: 28px;
  align-items: start;
  margin: 0 0 32px;
}

.hero {
  margin: 0;
  padding: 0;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-family: var(--sans);
  font-size: 0.82rem;
  color: var(--muted-foreground);
  margin-bottom: 12px;
}

.hero h1 em {
  font-style: normal;
  color: var(--link);
}

.hero p {
  font-size: 1.04rem;
  line-height: 1.65;
  color: var(--muted-foreground);
  max-width: 58ch;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 20px;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 20px;
  font-family: var(--sans);
  font-size: 0.8rem;
  color: var(--muted-foreground);
  font-variant-numeric: tabular-nums;
}

.hero-meta span {
  padding: 3px 9px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.hero-meta strong {
  color: var(--foreground);
}

/* ---- Sections ---- */
section, article {
  margin: 38px 0;
}

article:first-child,
section:first-child {
  margin-top: 0;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.section-head h2 { margin: 0; }
.section-head a  { font-size: 0.84rem; }

.section-sub {
  color: var(--muted-foreground);
  margin-bottom: 18px;
}

/* ---- Reusable Card / Dialog Containers ---- */
.win-dialog {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.win-dialog-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  font-family: var(--sans);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--foreground);
}

.win-bar-tag {
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--muted-foreground);
  white-space: nowrap;
}

.win-bar-btn {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--background);
  color: var(--foreground);
  font-family: var(--sans);
  font-size: 0.75rem;
  font-weight: 500;
  text-decoration: none;
}

.win-bar-btn:hover {
  background: var(--muted);
  text-decoration: none;
}

.win-dialog-body {
  padding: 18px 18px 20px;
  color: var(--card-foreground);
}

.win-dialog-body h2 {
  font-size: 1.18rem;
  margin-top: 0;
  margin-bottom: 8px;
}

.win-dialog-body p {
  color: var(--muted-foreground);
  font-size: 0.92rem;
  margin-bottom: 14px;
}

.win-dialog-well {
  padding: 10px 12px;
  background: var(--background);
  color: var(--muted-foreground);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-family: var(--mono);
  font-size: 0.78rem;
  line-height: 1.5;
  margin-bottom: 14px;
}

/* ---- Notion Database Tables ---- */
.table-wrap {
  overflow-x: auto;
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.91rem;
}

th, td {
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
}

th {
  font-family: var(--sans);
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--muted-foreground);
  background: var(--card);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background 80ms ease;
}

tbody tr:last-child { border-bottom: 0; }
tbody tr:hover      { background: var(--card); }

table[border="1"],
table[border="1"] th,
table[border="1"] td { border: 0; }
table[border="1"] th { border-bottom: 1px solid var(--border); }
table[border="1"] td { border-bottom: 1px solid var(--border); }

.post-body table {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin: 20px 0;
}

td time, td > code {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.num {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}

.mobile-label { display: none; }

/* ---- Notion Section Panels ---- */
.win-panel {
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.win-panel-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  padding: 11px 16px;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  font-family: var(--sans);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--foreground);
}

.win-panel-bar a {
  color: var(--muted-foreground);
  font-size: 0.78rem;
  text-decoration: none;
}

.win-panel-bar a:hover { color: var(--foreground); }

.win-panel-body {
  padding: 16px;
  color: var(--foreground);
}

.win-panel-note {
  font-size: 0.88rem;
  color: var(--muted-foreground);
  margin-bottom: 14px;
}

/* ---- Notion Database View Tabs (Gallery / Table / In Dev / Build Logs) ---- */
.win-tabset { position: relative; }

.win-tab-radio {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.win-tabs {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
  font-family: var(--sans);
}

.win-tabs-left {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.win-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 11px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--muted-foreground);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  cursor: pointer;
  user-select: none;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  transition: color 100ms ease, background 100ms ease;
}

.win-tab:hover {
  color: var(--foreground);
  background: var(--card);
}

.win-tab-glyph {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: 0.78;
}

.win-tabs-link {
  font-size: 0.82rem;
  padding-bottom: 6px;
  text-decoration: none;
}

.win-tabs-link:hover { text-decoration: underline; }

.win-tab-pane  { background: transparent; padding: 0; }
.win-tab-panel { display: none; }

#tm-gallery:checked ~ .win-tabs label[for="tm-gallery"],
#tm-core:checked    ~ .win-tabs label[for="tm-core"],
#tm-dev:checked     ~ .win-tabs label[for="tm-dev"],
#tm-logs:checked    ~ .win-tabs label[for="tm-logs"] {
  color: var(--foreground);
  font-weight: 600;
  border-bottom-color: var(--foreground);
}

#tm-gallery:focus-visible ~ .win-tabs label[for="tm-gallery"],
#tm-core:focus-visible    ~ .win-tabs label[for="tm-core"],
#tm-dev:focus-visible     ~ .win-tabs label[for="tm-dev"],
#tm-logs:focus-visible    ~ .win-tabs label[for="tm-logs"] {
  outline: 2px solid var(--ring);
  outline-offset: -2px;
}

#tm-gallery:checked ~ .win-tab-pane .panel-gallery,
#tm-core:checked    ~ .win-tab-pane .panel-core,
#tm-dev:checked     ~ .win-tab-pane .panel-dev,
#tm-logs:checked    ~ .win-tab-pane .panel-logs {
  display: block;
}

/* ---- Notion Project Gallery Cards ---- */
.notion-gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.gallery-card {
  display: flex;
  flex-direction: column;
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: border-color 120ms ease, background 120ms ease;
}

.gallery-card:hover {
  border-color: var(--border-strong);
  background: var(--card);
}

.gallery-card-cover {
  height: 54px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--card);
  border-bottom: 1px solid var(--border);
}

.gallery-card-id {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--muted-foreground);
}

.gallery-card-body {
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1 1 auto;
}

.gallery-card-title {
  margin: 0;
  font-size: 1.02rem;
  font-weight: 700;
}

.gallery-card-title a {
  color: var(--foreground);
  text-decoration: none;
}

.gallery-card-title a:hover {
  color: var(--link);
  text-decoration: underline;
}

.gallery-card-desc {
  margin: 0;
  font-size: 0.87rem;
  line-height: 1.52;
  color: var(--muted-foreground);
  flex: 1 1 auto;
}

.gallery-card-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 10px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  font-family: var(--mono);
  font-size: 0.74rem;
  color: var(--muted-foreground);
}

/* ---- Notion Metric Gallery Cards ---- */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.metric {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.metric-readout {
  font-family: var(--mono);
  font-size: 1.32rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--foreground);
  line-height: 1.15;
}

.metric-label {
  font-family: var(--sans);
  font-weight: 600;
  font-size: 0.86rem;
  color: var(--foreground);
}

.metric-note {
  font-size: 0.82rem;
  line-height: 1.48;
  color: var(--muted-foreground);
  margin: 0;
}

/* ---- Check badge for Principles ---- */
.win-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  margin-right: 8px;
  border-radius: var(--radius-sm);
  background: var(--ok-bg);
  color: var(--ok-fg);
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 800;
  vertical-align: -1px;
  flex-shrink: 0;
}

.win-well {
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 2px 14px;
}

.win-shortcuts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

/* ---- Clean Fieldset Fallback (series milestones / progress cards) ---- */
fieldset {
  min-inline-size: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px 20px;
  margin: 0 0 20px;
  background: var(--card);
  color: var(--card-foreground);
}

fieldset > legend {
  padding: 2px 10px;
  background: var(--background);
  color: var(--foreground);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--sans);
  font-size: 0.82rem;
  font-weight: 600;
}

fieldset p:last-child,
fieldset dl:last-child { margin-bottom: 0; }

/* ---- Principles (2-col Notion callout cards) ---- */
.principles-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.principle {
  padding: 14px 16px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.principle h3 {
  margin: 0 0 5px;
  font-size: 0.96rem;
  display: flex;
  align-items: center;
}

.principle p {
  margin: 0;
  font-size: 0.88rem;
  color: var(--muted-foreground);
}

/* ---- Notion List View Rows ---- */
.row-list {
  list-style: none;
  padding: 0;
  margin: 0 0 20px;
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.win-panel-body > .row-list {
  border: 0;
  border-radius: 0;
}

.row-item {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  transition: background 80ms ease;
}

.row-item:last-child { border-bottom: 0; }
.row-item:hover      { background: var(--card); }

.row-main { min-width: 0; }

.row-title {
  font-weight: 600;
  color: var(--foreground);
  text-decoration: none;
}

.row-title:hover {
  color: var(--link);
  text-decoration: underline;
}

.row-desc {
  display: block;
  font-size: 0.87rem;
  color: var(--muted-foreground);
  margin-top: 2px;
}

.row-meta {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
  font-family: var(--mono);
  font-size: 0.76rem;
  color: var(--muted-foreground);
  font-variant-numeric: tabular-nums;
}

.log-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 0.82rem;
}

.log-links a {
  padding: 3px 10px;
  background: var(--card);
  color: var(--foreground);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  text-decoration: none;
}

.log-links a:hover { background: var(--muted); }

/* ---- Notion Toggle Blocks (<details>) ---- */
.notion-toggles {
  border-top: 1px solid var(--border);
}

details {
  padding: 11px 0;
  border-bottom: 1px solid var(--border);
}

details:last-child { border-bottom: 0; }

.notion-toggles details:last-child {
  border-bottom: 1px solid var(--border);
}

details summary {
  cursor: pointer;
  font-weight: 600;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--foreground);
}

details summary::-webkit-details-marker { display: none; }

details summary::before {
  content: "▸";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  font-size: 0.84rem;
  color: var(--muted-foreground);
  border-radius: var(--radius-sm);
  transition: transform 140ms ease, background 100ms ease;
  flex-shrink: 0;
}

details summary:hover::before {
  background: var(--muted);
  color: var(--foreground);
}

details[open] > summary::before { transform: rotate(90deg); }

details > *:not(summary) {
  margin-top: 8px;
  margin-left: 28px;
  color: var(--muted-foreground);
}

details > .table-wrap,
details > pre {
  margin-left: 0;
  color: var(--foreground);
}

details p:last-child { margin-bottom: 0; }

td details { border-bottom: 0; padding: 0; }

/* ---- Build-log index grid ---- */
.log-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  align-items: stretch;
}

.log-grid fieldset {
  margin: 0;
  display: flex;
  flex-direction: column;
}

.log-card-body {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  height: 100%;
}

.log-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.log-card-actions {
  margin-top: auto;
  margin-bottom: 0;
  padding-top: 8px;
}

/* ---- Books shelf grid ---- */
.books-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  align-items: stretch;
}

.books-grid .book-card {
  display: flex;
  align-items: stretch;
  gap: 14px;
  margin: 0;
  padding: 14px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: border-color 120ms ease, background 120ms ease;
}

.books-grid .book-card:hover {
  border-color: var(--border-strong);
}

.book-cover-wrap {
  flex: 0 0 84px;
  width: 84px;
}

.book-cover {
  display: block;
  width: 84px;
  height: auto;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--muted);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.14);
}

.book-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1 1 auto;
  min-width: 0;
}

.book-title {
  margin: 0;
  font-size: 0.98rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--foreground);
}

.book-author {
  margin: 2px 0 0;
  font-size: 0.8rem;
  color: var(--muted-foreground);
}

.book-note {
  margin: 4px 0 0;
  font-size: 0.86rem;
  line-height: 1.5;
  color: var(--muted-foreground);
  flex: 1 1 auto;
}

.book-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 10px;
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.book-link {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--link);
  text-decoration: none;
}

.book-link:hover {
  text-decoration: underline;
}

/* ---- Definition lists ---- */
dl { margin: 0; }

dt {
  font-family: var(--sans);
  font-size: 0.74rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted-foreground);
  margin-bottom: 2px;
}

dd { margin-left: 0; margin-bottom: 12px; }
dd:last-child { margin-bottom: 0; }

/* ---- Long-form Notion Document (.post-body) — full section width ---- */
.post-header { max-width: none; }

.post-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-family: var(--sans);
  font-size: 0.82rem;
  color: var(--muted-foreground);
  margin-bottom: 10px;
}

.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 14px;
}

.post-lead {
  font-size: 1.08rem;
  line-height: 1.6;
  color: var(--muted-foreground);
  margin-bottom: 0;
}

.post-body > p,
.post-body > ul,
.post-body > ol,
.post-body > dl,
.post-body > blockquote,
.post-body > h2,
.post-body > h3,
.post-body > h4,
.post-body details > *:not(summary) {
  max-width: none;
}

.post-body ul,
.post-body ol {
  padding-left: 1.4rem;
  margin-top: 0;
  margin-bottom: 16px;
}

.post-body li { margin-bottom: 6px; }

.post-body blockquote {
  margin: 20px 0;
  padding: 10px 16px;
  background: var(--card);
  border-left: 3px solid var(--foreground);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  color: var(--card-foreground);
}

.post-body blockquote p:last-child { margin-bottom: 0; }

pre {
  overflow-x: auto;
  font-size: 0.85rem;
  line-height: 1.55;
}

.post-body pre {
  padding: 16px 18px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin: 20px 0;
}

/* Prev/Next navigation on series pages */
.pager {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 32px 0;
}

.pager-card {
  display: block;
  padding: 12px 16px;
  background: var(--card);
  color: var(--foreground);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  text-decoration: none;
  transition: background 100ms ease, border-color 100ms ease;
}

.pager-card:hover {
  background: var(--muted);
  border-color: var(--border-strong);
  text-decoration: none;
}

.pager-card.next { text-align: right; }

.pager-dir {
  display: block;
  font-family: var(--sans);
  font-size: 0.76rem;
  color: var(--muted-foreground);
  margin-bottom: 3px;
}

.pager-title {
  font-weight: 600;
  color: var(--foreground);
}

/* ---- Minimal Document Footer ---- */
.site-footer {
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  padding: 20px 48px 36px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  font-size: 0.8rem;
  color: var(--muted-foreground);
}

.site-footer p { margin: 0; }

.site-footer a {
  color: var(--muted-foreground);
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--foreground);
  text-decoration: underline;
}

/* ============================================================================
   0. HTML ONLY (DEFAULT) — Clean Semantic HTML with Minimal Spacing & Font
   Zero sidebar, zero cards, zero cover banners, zero chrome bloat.
   ============================================================================ */
html[data-style="html"] {
  --background:           light-dark(#ffffff, #111111);
  --foreground:           light-dark(#141414, #e8e8e8);
  --card:                 light-dark(#ffffff, #111111);
  --card-foreground:      light-dark(#141414, #e8e8e8);
  --secondary:            light-dark(#f5f5f5, #1d1d1d);
  --secondary-foreground: light-dark(#141414, #e8e8e8);
  --muted:                light-dark(#f2f2f2, #1f1f1f);
  --muted-foreground:     light-dark(#555555, #a3a3a3);
  --border:               light-dark(#dddddd, #2e2e2e);
  --border-strong:        light-dark(#bbbbbb, #444444);
  --link:                 light-dark(#0000cc, #7db4ff);
  --ring:                 light-dark(#0000cc, #7db4ff);
  --accent-soft-bg:       light-dark(#eef4ff, #18273d);
  --accent-soft-fg:       light-dark(#0000aa, #96c4ff);
  --radius-sm:            2px;
  --radius-md:            3px;
  --radius-lg:            4px;
}

/* Strip all app-shell chrome: no sidebar, no cover, no avatar widget */
html[data-style="html"] .notion-sidebar,
html[data-style="html"] .notion-cover,
html[data-style="html"] .notion-page-icon-overlap,
html[data-style="html"] .notion-avatar,
html[data-style="html"] .notion-prop-glyph,
html[data-style="html"] .win-tab-glyph,
html[data-style="html"] .page-icon {
  display: none;
}

html[data-style="html"] .notion-app {
  display: block;
}

html[data-style="html"] .site-header {
  position: static;
  width: 100%;
  background: var(--background);
  backdrop-filter: none;
  border-bottom: 1px solid var(--border);
  max-width: 740px;
  margin: 0 auto;
  padding: 18px 20px 10px;
}

html[data-style="html"] .notion-topbar {
  padding: 0;
  min-height: 0;
}

html[data-style="html"] .notion-crumb-root {
  padding: 0;
  font-size: 1rem;
  font-weight: 700;
}

html[data-style="html"] .notion-crumb-root:hover {
  background: transparent;
  text-decoration: underline;
}

html[data-style="html"] .mobile-nav-bar {
  display: block;
  border-top: 0;
  padding: 8px 0 0;
  overflow-x: visible;
}

html[data-style="html"] .site-nav {
  flex-wrap: wrap;
  white-space: normal;
  gap: 6px 14px;
  font-size: 0.9rem;
}

html[data-style="html"] .site-nav a {
  padding: 0;
  border-radius: 0;
  color: var(--link);
  text-decoration: underline;
  font-weight: 400;
}

html[data-style="html"] .site-nav a:hover {
  background: transparent;
  color: var(--link);
}

html[data-style="html"] .site-nav a[aria-current="page"] {
  background: transparent;
  color: var(--foreground);
  font-weight: 700;
}

html[data-style="html"] .settings-trigger {
  background: transparent;
  border: 1px solid var(--border-strong);
  padding: 3px 8px;
  font-size: 0.78rem;
}

html[data-style="html"] main,
html[data-style="html"] .has-cover main {
  max-width: 740px;
  margin: 0 auto;
  padding: 28px 20px 56px;
}

html[data-style="html"] .site-footer {
  max-width: 740px;
  padding: 18px 20px 36px;
}

/* Plain classic links & clean typography */
html[data-style="html"] a {
  text-decoration: underline;
  text-decoration-color: currentColor;
}

html[data-style="html"] .hero h1 {
  font-size: clamp(1.9rem, 3.4vw, 2.35rem);
  letter-spacing: -0.015em;
}

html[data-style="html"] .hero h1 em {
  color: var(--foreground);
  font-style: italic;
  padding-right: 0.08em;
}

/* Plain HTML Properties list (no icons or heavy pills) */
html[data-style="html"] .notion-props {
  grid-template-columns: 70px minmax(0, 1fr);
  gap: 5px 10px;
  border-top: 1px solid var(--border);
  padding-top: 12px;
  font-size: 0.92rem;
}

html[data-style="html"] .notion-prop-key {
  gap: 0;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--foreground);
}

html[data-style="html"] .notion-prop-key::after {
  content: ":";
}

/* Strip colored sticker badges down to clean minimal HTML inline text */
html[data-style="html"] .badge {
  background: transparent;
  color: var(--muted-foreground);
  padding: 0;
  font-size: 0.85rem;
  font-weight: 400;
  font-family: var(--mono);
}

html[data-style="html"] a.badge {
  color: var(--link);
  text-decoration: underline;
}

html[data-style="html"] .badge .dot {
  display: none;
}

html[data-style="html"] .gallery-card .badge::before { content: "("; }
html[data-style="html"] .gallery-card .badge::after  { content: ")"; }

/* Strip project cards into a clean plain HTML list */
html[data-style="html"] .notion-gallery {
  grid-template-columns: 1fr;
  gap: 18px;
}

html[data-style="html"] .gallery-card {
  border: 0;
  border-radius: 0;
  background: transparent;
}

html[data-style="html"] .gallery-card:hover {
  background: transparent;
}

html[data-style="html"] .gallery-card-body {
  padding: 0;
  gap: 4px;
}

html[data-style="html"] .gallery-card-title a {
  color: var(--link);
  text-decoration: underline;
}

html[data-style="html"] .gallery-card-desc {
  font-size: 0.95rem;
  color: var(--foreground);
}

html[data-style="html"] .gallery-card-foot {
  border-top: 0;
  padding-top: 0;
  justify-content: flex-start;
  gap: 12px;
  font-size: 0.82rem;
}

/* Strip row-list card container into plain HTML list */
html[data-style="html"] .row-list {
  border: 0;
  border-radius: 0;
  background: transparent;
}

html[data-style="html"] .row-item {
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}

html[data-style="html"] .row-item:hover {
  background: transparent;
}

html[data-style="html"] .row-title {
  color: var(--link);
  text-decoration: underline;
  font-weight: 500;
}

html[data-style="html"] .win-tabs {
  border-bottom: 1px solid var(--border);
  margin-bottom: 18px;
}

html[data-style="html"] .win-tab {
  padding: 4px 10px 6px 0;
  font-size: 0.9rem;
}

html[data-style="html"] .win-tab:hover {
  background: transparent;
}

html[data-style="html"] .table-wrap {
  border-radius: 0;
  border: 0;
  border-top: 1px solid var(--border);
}

html[data-style="html"] .progress-table th {
  background: transparent;
  padding-left: 0;
}

html[data-style="html"] .progress-table td {
  padding-left: 0;
}

html[data-style="html"] .prog-bar {
  appearance: auto;
  -webkit-appearance: auto;
  height: 10px;
  border: 0;
  background: transparent;
}

html[data-style="html"] .notion-callout,
html[data-style="html"] .metric,
html[data-style="html"] .principle,
html[data-style="html"] .pager-card,
html[data-style="html"] .post-body pre {
  border-radius: 0;
  background: var(--secondary);
}

/* ============================================================================
   DESIGN SYSTEM LAYOUTS (5 Complete Architectural Transformations + Notion)
   Each design system adapts both its visual grammar AND spatial layout:
     - notion   (default): 2-col sidebar + full-bleed cover + document
     - win7     : Aurora wallpaper + floating Aero Glass Explorer + Aero Taskbar
     - win97    : Teal desktop + 3D bevelled Window + top Menu Bar + Start Taskbar
     - macos    : Sonoma wallpaper + floating Finder + 3-col Bento + Glass Dock
     - terminal : Full-viewport Tmux TUI + top tabs + 1-col list + Tmux Statusbar
     - swiss    : Full-width Editorial Broadsheet + asymmetric split + 3-col print
   ============================================================================ */

/* ---- 1. Windows 7 Aero Glass — Floating Explorer Window + Taskbar ---- */
html[data-style="win7"] {
  --sans: "Segoe UI", "Manrope", -apple-system, BlinkMacSystemFont, ui-sans-serif, system-ui, sans-serif;
  --background:           light-dark(#f8fbff, #101821);
  --foreground:           light-dark(#142233, #e8f1fa);
  --card:                 light-dark(#eaf2fb, #172330);
  --card-foreground:      light-dark(#142233, #e8f1fa);
  --secondary:            light-dark(#dfeaf6, #1f2e3f);
  --secondary-foreground: light-dark(#142233, #e8f1fa);
  --muted:                light-dark(#d9e7f6, #1e2d3e);
  --muted-foreground:     light-dark(#445b73, #96aec7);
  --border:               light-dark(#b5cce0, #2c435a);
  --border-strong:        light-dark(#7fa6c9, #45688a);
  --accent:               light-dark(#1967b2, #3b8ee0);
  --primary:              light-dark(#165fa6, #57a5f5);
  --primary-foreground:   light-dark(#ffffff, #0a1420);
  --link:                 light-dark(#0f569e, #72bcff);
  --ring:                 light-dark(#3c7fb1, #72bcff);
  --accent-soft-bg:       light-dark(#dceefa, #173049);
  --accent-soft-fg:       light-dark(#0e4c8a, #8ac8ff);
  --radius-sm:            3px;
  --radius-md:            4px;
  --radius-lg:            6px;
}

html[data-style="win7"] body {
  background:
    radial-gradient(ellipse at 18% 16%, light-dark(rgba(164, 224, 255, 0.72), rgba(45, 130, 215, 0.34)), transparent 52%),
    radial-gradient(ellipse at 82% 76%, light-dark(rgba(41, 118, 206, 0.65), rgba(18, 68, 128, 0.45)), transparent 56%),
    linear-gradient(135deg, light-dark(#2e74b8, #07111e) 0%, light-dark(#6bb6eb, #102742) 48%, light-dark(#1c4e8a, #061221) 100%);
  background-attachment: fixed;
  padding: 18px 24px 66px;
}

html[data-style="win7"] .notion-app {
  max-width: 1180px;
  min-height: calc(100vh - 88px);
  margin: 0 auto;
  padding: 6px;
  border-radius: 10px;
  background:
    linear-gradient(122deg, rgba(255, 255, 255, 0.34) 0%, transparent 38%),
    light-dark(rgba(182, 220, 250, 0.56), rgba(20, 42, 68, 0.68));
  backdrop-filter: blur(18px);
  border: 1px solid light-dark(rgba(255, 255, 255, 0.8), rgba(125, 188, 250, 0.32));
  box-shadow:
    0 24px 64px rgba(0, 16, 44, 0.46),
    inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

html[data-style="win7"] .notion-sidebar {
  position: relative;
  height: auto;
  width: 226px;
  border-radius: 6px 0 0 6px;
  background:
    linear-gradient(128deg, light-dark(rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0.08)) 0%, transparent 46%),
    linear-gradient(180deg, light-dark(#e5f1fc, #162434) 0%, light-dark(#d2e5f8, #111c29) 100%);
  border-right: 1px solid var(--border-strong);
  box-shadow: inset -1px 0 0 light-dark(rgba(255, 255, 255, 0.72), rgba(140, 195, 250, 0.14));
}

html[data-style="win7"] .notion-main-wrap {
  border-radius: 0 6px 6px 0;
  border: 1px solid light-dark(rgba(90, 134, 176, 0.55), rgba(85, 132, 180, 0.35));
  border-left: 0;
}

html[data-style="win7"] .site-header {
  position: relative;
  border-radius: 0 6px 0 0;
  background:
    linear-gradient(112deg, transparent 14%, light-dark(rgba(255, 255, 255, 0.58), rgba(255, 255, 255, 0.1)) 26%, transparent 39%),
    linear-gradient(180deg, light-dark(#eaf5ff, #1c3148) 0%, light-dark(#cde4fa, #132234) 50%, light-dark(#bedaf6, #0f1c2b) 51%, light-dark(#dbecfd, #172b40) 100%);
  border-bottom: 1px solid var(--border-strong);
  box-shadow: inset 0 1px 0 light-dark(rgba(255, 255, 255, 0.9), rgba(160, 210, 255, 0.22));
}

/* Iconic Windows 7 Aero Window Caption Controls */
html[data-style="win7"] .win-controls {
  display: inline-flex;
  align-items: stretch;
  margin-left: 6px;
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid light-dark(#6d8ea8, #45688a);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

html[data-style="win7"] .wc-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 22px;
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--foreground);
  background: linear-gradient(180deg, light-dark(#ffffff, #2c435a) 0%, light-dark(#dceaf7, #1c2e42) 50%, light-dark(#c6dcf2, #152434) 51%, light-dark(#ddecfa, #21364c) 100%);
  border-right: 1px solid light-dark(#89a6bf, #3a5977);
  user-select: none;
}

html[data-style="win7"] .wc-close {
  width: 34px;
  border-right: 0;
  color: #ffffff;
  background: linear-gradient(180deg, #f39d92 0%, #dc5140 49%, #b82919 50%, #da5444 100%);
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.45);
}

/* Explorer interior: hide Notion cover, present compact Aero User Tile header */
html[data-style="win7"] .notion-cover { display: none; }
html[data-style="win7"] .has-cover main,
html[data-style="win7"] main { padding: 24px 34px 44px; max-width: none; }
html[data-style="win7"] .site-footer { max-width: none; padding: 16px 34px 24px; }

html[data-style="win7"] .notion-page-icon-overlap {
  margin-top: 0;
  margin-bottom: 12px;
}

html[data-style="win7"] .notion-page-avatar {
  width: 60px;
  height: 60px;
  border-radius: 7px;
  border: 3px solid light-dark(#ffffff, #38587a);
  box-shadow: 0 3px 10px light-dark(rgba(17, 58, 102, 0.25), rgba(0, 0, 0, 0.55)), 0 0 0 1px var(--border-strong);
}

html[data-style="win7"] .notion-props {
  background: linear-gradient(180deg, light-dark(#f2f7fd, #162230) 0%, light-dark(#e5effa, #111c28) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 16px;
}

html[data-style="win7"] .btn,
html[data-style="win7"] .settings-trigger,
html[data-style="win7"] .win-bar-btn {
  background: linear-gradient(180deg,
    light-dark(#ffffff, #2a3e54) 0%,
    light-dark(#eaf2fa, #203245) 49%,
    light-dark(#d5e5f5, #172636) 50%,
    light-dark(#e6f0fa, #1f3348) 100%);
  border: 1px solid light-dark(#708ea8, #45688a);
  box-shadow: inset 0 1px 0 light-dark(rgba(255, 255, 255, 0.9), rgba(170, 215, 255, 0.2));
  color: var(--foreground);
}

html[data-style="win7"] .btn:hover,
html[data-style="win7"] .settings-trigger:hover,
html[data-style="win7"] .settings-trigger[aria-expanded="true"],
html[data-style="win7"] .win-bar-btn:hover {
  background: linear-gradient(180deg,
    light-dark(#f2f9ff, #334e6b) 0%,
    light-dark(#d9ecfc, #26405c) 49%,
    light-dark(#b9dbf8, #1c344d) 50%,
    light-dark(#d8edfd, #294869) 100%);
  border-color: light-dark(#3c7fb1, #69b3f5);
  box-shadow: 0 0 0 2px light-dark(rgba(60, 127, 177, 0.22), rgba(105, 179, 245, 0.24)), inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

html[data-style="win7"] .gallery-card,
html[data-style="win7"] .table-wrap,
html[data-style="win7"] .notion-callout,
html[data-style="win7"] .row-list,
html[data-style="win7"] .metric,
html[data-style="win7"] .principle,
html[data-style="win7"] .win-dialog,
html[data-style="win7"] .win-panel,
html[data-style="win7"] .settings-panel {
  border-color: var(--border-strong);
  box-shadow:
    inset 0 1px 0 light-dark(rgba(255, 255, 255, 0.85), rgba(150, 200, 250, 0.14)),
    0 2px 6px light-dark(rgba(25, 65, 110, 0.08), rgba(0, 0, 0, 0.3));
}

html[data-style="win7"] .sidebar-nav a:hover,
html[data-style="win7"] .sidebar-sublist a:hover {
  background: linear-gradient(180deg, light-dark(#edf6ff, #22384f) 0%, light-dark(#d4e8fb, #1a2d40) 100%);
  box-shadow: inset 0 0 0 1px light-dark(#89b5db, #3f678c);
}

html[data-style="win7"] .prog-bar {
  height: 11px;
  border-radius: 3px;
  border-color: light-dark(#9bb5cc, #3d5d7d);
  background: linear-gradient(180deg, light-dark(#e3ebf3, #13202e) 0%, light-dark(#f2f7fc, #1c2c3d) 100%);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.12);
}

html[data-style="win7"] .prog-bar::-webkit-progress-value {
  background: linear-gradient(180deg, #83f18c 0%, #2fd444 48%, #0fb826 50%, #3ee252 100%);
  border-radius: 2px;
}

html[data-style="win7"] .prog-bar::-moz-progress-bar {
  background: linear-gradient(180deg, #83f18c 0%, #2fd444 48%, #0fb826 50%, #3ee252 100%);
  border-radius: 2px;
}

/* Fixed Bottom Windows 7 Aero Glass Taskbar */
html[data-style="win7"] .os-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 44px;
  padding: 0 12px;
  z-index: 90;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.26) 0%, rgba(20, 48, 82, 0.65) 48%, rgba(10, 28, 52, 0.82) 50%, rgba(22, 54, 92, 0.78) 100%);
  backdrop-filter: blur(18px);
  border-top: 1px solid rgba(255, 255, 255, 0.45);
  box-shadow: 0 -4px 18px rgba(0, 12, 32, 0.35);
}

html[data-style="win7"] .os-start {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: #ffffff;
  font-size: 0.78rem;
  font-weight: 600;
}

html[data-style="win7"] .os-start-label { display: none; }

html[data-style="win7"] .os-orb {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background:
    radial-gradient(circle at 50% 22%, rgba(255, 255, 255, 0.85) 0%, transparent 45%),
    radial-gradient(circle at 50% 80%, #57d2ff 0%, #1778d4 52%, #0a3469 100%);
  border: 1px solid rgba(255, 255, 255, 0.75);
  box-shadow: 0 0 10px rgba(96, 198, 255, 0.65), inset 0 1px 2px #ffffff;
}

html[data-style="win7"] .os-dock-items {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-right: auto;
  overflow-x: auto;
  scrollbar-width: none;
}

html[data-style="win7"] .os-dock-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 4px;
  color: #ffffff;
  font-size: 0.78rem;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.24) 0%, rgba(255, 255, 255, 0.08) 50%, rgba(0, 0, 0, 0.14) 51%, rgba(255, 255, 255, 0.16) 100%);
  border: 1px solid rgba(255, 255, 255, 0.32);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

html[data-style="win7"] .os-dock-item:hover {
  background: linear-gradient(180deg, rgba(160, 222, 255, 0.45) 0%, rgba(92, 180, 245, 0.28) 50%, rgba(45, 130, 215, 0.35) 51%, rgba(135, 210, 255, 0.38) 100%);
  text-decoration: none;
}

html[data-style="win7"] .os-tray {
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.74rem;
  font-family: var(--mono);
  padding: 4px 10px;
  border-left: 1px solid rgba(255, 255, 255, 0.22);
  white-space: nowrap;
}

/* ---- 2. Windows 97 Classic — Teal Desktop + Floating Window + Menu Bar + Taskbar ---- */
html[data-style="win97"] {
  --background:           light-dark(#ffffff, #171a20);
  --foreground:           light-dark(#000000, #e6e8ec);
  --card:                 light-dark(#d4d0c8, #272c35);
  --card-foreground:      light-dark(#000000, #e6e8ec);
  --secondary:            light-dark(#c0c0c0, #323843);
  --secondary-foreground: light-dark(#000000, #e6e8ec);
  --muted:                light-dark(#c0c0c0, #323843);
  --muted-foreground:     light-dark(#3b3b3b, #a8b0bc);
  --border:               light-dark(#808080, #4d5563);
  --border-strong:        light-dark(#404040, #6d7787);
  --accent:               light-dark(#000080, #2359a8);
  --primary:              light-dark(#000080, #2359a8);
  --primary-foreground:   #ffffff;
  --link:                 light-dark(#0000aa, #7bb8ff);
  --ring:                 light-dark(#000080, #7bb8ff);
  --accent-soft-bg:       light-dark(#dce4f7, #1b2c47);
  --accent-soft-fg:       light-dark(#000080, #9bc9ff);
  --radius-sm:            0px;
  --radius-md:            0px;
  --radius-lg:            0px;
  --bevel-out: inset 1.5px 1.5px 0 light-dark(#ffffff, #535c6b), inset -1.5px -1.5px 0 light-dark(#404040, #0d0f13), inset 3px 3px 0 light-dark(#dfdfdf, #3a414d), inset -3px -3px 0 light-dark(#808080, #1c2027);
  --bevel-in:  inset 1.5px 1.5px 0 light-dark(#404040, #0d0f13), inset -1.5px -1.5px 0 light-dark(#ffffff, #535c6b);
}

/* Iconic Classic Windows Teal Desktop Wallpaper */
html[data-style="win97"] body {
  background:
    radial-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 0) 0 0 / 20px 20px,
    light-dark(#008080, #0c2c2e);
  background-attachment: fixed;
  padding: 16px 20px 56px;
}

html[data-style="win97"] .notion-avatar,
html[data-style="win97"] .notion-page-avatar,
html[data-style="win97"] .sidebar-count,
html[data-style="win97"] .dot,
html[data-style="win97"] .style-swatch {
  border-radius: 0;
}

/* Floating Classic 3D Window (NO Notion sidebar!) */
html[data-style="win97"] .notion-sidebar { display: none; }
html[data-style="win97"] .notion-cover   { display: none; }

html[data-style="win97"] .notion-app {
  display: block;
  max-width: 1060px;
  min-height: calc(100vh - 76px);
  margin: 0 auto;
  padding: 4px;
  background: var(--card);
  box-shadow: var(--bevel-out), 6px 6px 0 rgba(0, 0, 0, 0.36);
}

html[data-style="win97"] .notion-main-wrap {
  background: var(--card);
}

html[data-style="win97"] .site-header {
  position: relative;
  background: var(--card);
  backdrop-filter: none;
  border-bottom: 0;
}

/* Navy-to-Sky Classic Window Title Bar */
html[data-style="win97"] .notion-topbar {
  background: linear-gradient(90deg, light-dark(#000080, #112954) 0%, light-dark(#1084d0, #265fb3) 100%);
  min-height: 36px;
  padding: 4px 8px;
}

html[data-style="win97"] .notion-crumb-root,
html[data-style="win97"] .notion-crumb-sep,
html[data-style="win97"] .notion-crumb-current,
html[data-style="win97"] .topbar-link {
  color: #ffffff;
  font-family: var(--mono);
  font-size: 0.8rem;
}

html[data-style="win97"] .notion-crumb-root:hover,
html[data-style="win97"] .topbar-link:hover {
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
}

/* Classic Square 3D Caption Buttons */
html[data-style="win97"] .win-controls {
  display: inline-flex;
  gap: 2px;
  margin-left: 4px;
}

html[data-style="win97"] .wc-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 19px;
  background: var(--card);
  color: var(--foreground);
  box-shadow: var(--bevel-out);
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 800;
  user-select: none;
}

/* Classic Horizontal Windows 97 Menu Bar directly below Title Bar */
html[data-style="win97"] .mobile-nav-bar {
  display: block;
  background: var(--card);
  border-top: 1px solid light-dark(#ffffff, #4d5563);
  border-bottom: 1px solid var(--border);
  padding: 3px 8px;
}

html[data-style="win97"] .site-nav {
  font-family: var(--mono);
  font-size: 0.78rem;
  gap: 2px;
}

html[data-style="win97"] .site-nav a {
  color: var(--foreground);
  padding: 3px 9px;
}

html[data-style="win97"] .site-nav a:hover {
  background: light-dark(#000080, #2359a8);
  color: #ffffff;
}

/* Sunken 3D White Client Document Area */
html[data-style="win97"] main,
html[data-style="win97"] .has-cover main {
  background: var(--background);
  box-shadow: var(--bevel-in);
  margin: 6px;
  padding: 24px 30px 44px;
  max-width: none;
  width: auto;
}

html[data-style="win97"] .site-footer {
  max-width: none;
  margin: 0 6px 4px;
  padding: 8px 12px;
  background: var(--card);
  box-shadow: var(--bevel-in);
  border-top: 0;
  font-family: var(--mono);
  font-size: 0.74rem;
}

html[data-style="win97"] .notion-page-icon-overlap {
  margin-top: 0;
  margin-bottom: 12px;
}

html[data-style="win97"] .notion-page-avatar {
  width: 60px;
  height: 60px;
  border: 3px solid var(--card);
  box-shadow: var(--bevel-out);
}

/* Classic Raised 3D Folder Tabs */
html[data-style="win97"] .win-tabs {
  border-bottom: 2px solid var(--border-strong);
  margin-bottom: 0;
  padding-left: 4px;
}

html[data-style="win97"] .win-tab {
  background: var(--card);
  color: var(--foreground);
  border-bottom: 0;
  margin-bottom: 0;
  margin-right: 3px;
  padding: 6px 14px;
  box-shadow: var(--bevel-out);
  font-family: var(--mono);
  font-size: 0.78rem;
}

html[data-style="win97"] #tm-gallery:checked ~ .win-tabs label[for="tm-gallery"],
html[data-style="win97"] #tm-core:checked    ~ .win-tabs label[for="tm-core"] {
  background: var(--background);
  padding-top: 8px;
  margin-top: -2px;
  margin-bottom: -2px;
  position: relative;
  z-index: 2;
}

html[data-style="win97"] .win-tab-pane {
  background: var(--card);
  box-shadow: var(--bevel-out);
  padding: 14px;
}

html[data-style="win97"] .btn,
html[data-style="win97"] .settings-trigger,
html[data-style="win97"] .win-bar-btn,
html[data-style="win97"] .style-opt {
  background: var(--card);
  color: var(--foreground);
  border: 0;
  box-shadow: var(--bevel-out);
  font-family: var(--mono);
}

html[data-style="win97"] .btn:active,
html[data-style="win97"] .settings-trigger[aria-expanded="true"],
html[data-style="win97"] .style-opt[aria-pressed="true"] {
  box-shadow: var(--bevel-in);
  background: light-dark(#000080, #2359a8);
  color: #ffffff;
}

html[data-style="win97"] .settings-panel {
  background: var(--card);
  border: 0;
  box-shadow: var(--bevel-out), 5px 5px 0 rgba(0, 0, 0, 0.35);
}

html[data-style="win97"] .seg-control {
  background: var(--background);
  border: 0;
  box-shadow: var(--bevel-in);
}

html[data-style="win97"] .seg-btn[aria-pressed="true"] {
  background: light-dark(#000080, #2359a8);
  color: #ffffff;
  box-shadow: none;
}

html[data-style="win97"] .gallery-card,
html[data-style="win97"] .notion-callout,
html[data-style="win97"] .metric,
html[data-style="win97"] .principle,
html[data-style="win97"] .win-dialog,
html[data-style="win97"] .win-panel,
html[data-style="win97"] .pager-card {
  background: var(--background);
  border: 0;
  box-shadow: var(--bevel-out);
}

html[data-style="win97"] .table-wrap,
html[data-style="win97"] .row-list,
html[data-style="win97"] .win-well,
html[data-style="win97"] .win-dialog-well {
  border: 0;
  box-shadow: var(--bevel-in);
  padding: 2px;
}

html[data-style="win97"] .settings-heading,
html[data-style="win97"] .notion-prop-key {
  font-family: var(--mono);
}

html[data-style="win97"] .prog-bar {
  height: 12px;
  border: 0;
  border-radius: 0;
  background: var(--background);
  box-shadow: var(--bevel-in);
  padding: 2px;
}

html[data-style="win97"] .prog-bar::-webkit-progress-bar {
  background: var(--background);
}

html[data-style="win97"] .prog-bar::-webkit-progress-value {
  background: repeating-linear-gradient(90deg, light-dark(#000080, #3b82f6) 0 8px, transparent 8px 10px);
  border-radius: 0;
}

html[data-style="win97"] .prog-bar::-moz-progress-bar {
  background: repeating-linear-gradient(90deg, light-dark(#000080, #3b82f6) 0 8px, transparent 8px 10px);
  border-radius: 0;
}

/* Fixed Bottom Classic Windows 97 Start Taskbar */
html[data-style="win97"] .os-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 36px;
  padding: 3px 6px;
  z-index: 90;
  background: var(--card);
  box-shadow: inset 0 2px 0 light-dark(#ffffff, #535c6b);
  font-family: var(--mono);
}

html[data-style="win97"] .os-start {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: var(--card);
  color: var(--foreground);
  box-shadow: var(--bevel-out);
  font-size: 0.78rem;
  font-weight: 800;
  text-decoration: none;
  flex-shrink: 0;
}

html[data-style="win97"] .os-orb {
  width: 12px;
  height: 12px;
  background: conic-gradient(#e03131 0 90deg, #2f9e44 90deg 180deg, #1971c2 180deg 270deg, #f08c00 270deg 360deg);
  border: 1px solid #000000;
}

html[data-style="win97"] .os-dock-items {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-right: auto;
  overflow-x: auto;
  scrollbar-width: none;
}

html[data-style="win97"] .os-dock-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  background: var(--card);
  color: var(--foreground);
  box-shadow: var(--bevel-out);
  font-size: 0.75rem;
  text-decoration: none;
  white-space: nowrap;
}

html[data-style="win97"] .os-dock-item:first-child {
  box-shadow: var(--bevel-in);
  font-weight: 700;
}

html[data-style="win97"] .os-tray {
  padding: 3px 10px;
  box-shadow: var(--bevel-in);
  color: var(--foreground);
  font-size: 0.73rem;
  white-space: nowrap;
}

/* ---- 3. macOS Aqua / Vibrancy — Floating Finder Window + Bento + Frosted Dock ---- */
html[data-style="macos"] {
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Manrope", system-ui, sans-serif;
  --background:           light-dark(#ffffff, #1c1c1e);
  --foreground:           light-dark(#1d1d1f, #f5f5f7);
  --card:                 light-dark(#f5f5f7, #262629);
  --card-foreground:      light-dark(#1d1d1f, #f5f5f7);
  --secondary:            light-dark(#ececef, #2e2e32);
  --secondary-foreground: light-dark(#1d1d1f, #f5f5f7);
  --muted:                light-dark(#e8e8ed, #323236);
  --muted-foreground:     light-dark(#5e5e66, #a1a1a6);
  --border:               light-dark(rgba(0, 0, 0, 0.09), rgba(255, 255, 255, 0.11));
  --border-strong:        light-dark(rgba(0, 0, 0, 0.16), rgba(255, 255, 255, 0.2));
  --accent:               light-dark(#0066cc, #0a84ff);
  --primary:              light-dark(#0066cc, #0a84ff);
  --primary-foreground:   #ffffff;
  --link:                 light-dark(#0066cc, #5eb0ff);
  --ring:                 light-dark(#0066cc, #5eb0ff);
  --accent-soft-bg:       light-dark(#e5f1ff, #152c47);
  --accent-soft-fg:       light-dark(#0055b3, #7dc0ff);
  --radius-sm:            6px;
  --radius-md:            8px;
  --radius-lg:            12px;
}

/* Soft macOS Sonoma / Sequoia Wallpaper Backdrop */
html[data-style="macos"] body {
  background:
    radial-gradient(ellipse at 14% 16%, light-dark(rgba(255, 175, 145, 0.55), rgba(140, 62, 130, 0.44)), transparent 52%),
    radial-gradient(ellipse at 86% 20%, light-dark(rgba(128, 196, 255, 0.58), rgba(24, 88, 176, 0.45)), transparent 54%),
    radial-gradient(ellipse at 52% 92%, light-dark(rgba(176, 156, 255, 0.42), rgba(28, 110, 128, 0.36)), transparent 56%),
    linear-gradient(145deg, light-dark(#f2eae5, #12101c) 0%, light-dark(#e4effb, #0e1624) 52%, light-dark(#ede8f8, #121822) 100%);
  background-attachment: fixed;
  padding: 46px 26px 96px;
  transition: padding 200ms ease;
}

/* Fixed Translucent macOS Top Menu Bar (28px) */
html[data-style="macos"] .mac-menubar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 28px;
  padding: 0 14px;
  z-index: 120;
  background: light-dark(rgba(252, 252, 254, 0.74), rgba(26, 26, 30, 0.74));
  backdrop-filter: blur(22px) saturate(1.8);
  border-bottom: 1px solid light-dark(rgba(0, 0, 0, 0.08), rgba(255, 255, 255, 0.1));
  font-size: 0.78rem;
  color: var(--foreground);
}

html[data-style="macos"] .mac-menu-left,
html[data-style="macos"] .mac-menu-right {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
}

html[data-style="macos"] .mac-apple,
html[data-style="macos"] .mac-app-name,
html[data-style="macos"] .mac-menu-link {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 5px;
  color: var(--foreground);
  text-decoration: none;
  white-space: nowrap;
}

html[data-style="macos"] .mac-app-name {
  font-weight: 700;
}

html[data-style="macos"] .mac-apple:hover,
html[data-style="macos"] .mac-app-name:hover,
html[data-style="macos"] .mac-menu-link:hover {
  background: light-dark(rgba(0, 0, 0, 0.08), rgba(255, 255, 255, 0.12));
  text-decoration: none;
}

html[data-style="macos"] .mac-menu-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border: 0;
  border-radius: 5px;
  background: light-dark(rgba(0, 0, 0, 0.06), rgba(255, 255, 255, 0.1));
  color: var(--foreground);
  font-family: var(--sans);
  font-size: 0.74rem;
  font-weight: 500;
  cursor: pointer;
}

html[data-style="macos"] .mac-menu-btn:hover {
  background: light-dark(rgba(0, 102, 204, 0.15), rgba(10, 132, 255, 0.25));
  color: var(--link);
}

html[data-style="macos"] .mac-menu-btn kbd {
  padding: 0 4px;
  font-size: 0.68rem;
  box-shadow: none;
  border-color: var(--border);
  background: transparent;
}

html[data-style="macos"] .mac-status,
html[data-style="macos"] .mac-clock {
  padding: 0 6px;
  font-size: 0.74rem;
  color: var(--muted-foreground);
  white-space: nowrap;
}

html[data-style="macos"] .mac-clock {
  color: var(--foreground);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

/* Minimized-to-Dock Restore Pill */
html[data-style="macos"][data-mac-state="minimized"] .mac-restore-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 80;
  padding: 12px 20px;
  border-radius: 999px;
  background: light-dark(rgba(255, 255, 255, 0.84), rgba(34, 34, 38, 0.84));
  backdrop-filter: blur(22px) saturate(1.6);
  border: 1px solid light-dark(rgba(255, 255, 255, 0.8), rgba(255, 255, 255, 0.18));
  color: var(--foreground);
  font-family: var(--sans);
  font-size: 0.88rem;
  font-weight: 600;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.22);
  cursor: pointer;
}

/* Floating Rounded macOS Finder Window */
html[data-style="macos"] .notion-app {
  max-width: 1200px;
  min-height: calc(100vh - 144px);
  margin: 0 auto;
  border-radius: 16px;
  border: 1px solid light-dark(rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0.14));
  box-shadow:
    0 28px 80px light-dark(rgba(25, 36, 62, 0.18), rgba(0, 0, 0, 0.62)),
    0 2px 8px rgba(0, 0, 0, 0.08);
  transition: max-width 220ms ease, transform 220ms ease, opacity 200ms ease, border-radius 200ms ease;
}

/* Interactive macOS Window States (Red = Minimize, Yellow = Compact, Green = Full Screen) */
html[data-style="macos"][data-mac-state="minimized"] .notion-app {
  opacity: 0;
  transform: scale(0.92) translateY(36px);
  pointer-events: none;
}

html[data-style="macos"][data-mac-state="compact"] .notion-app {
  max-width: 920px;
}

html[data-style="macos"][data-mac-state="full"] body {
  padding: 28px 0 0;
}

html[data-style="macos"][data-mac-state="full"] .notion-app {
  max-width: 100%;
  min-height: calc(100vh - 28px);
  border-radius: 0;
  border-width: 0;
  box-shadow: none;
}

html[data-style="macos"][data-mac-state="full"] .notion-sidebar,
html[data-style="macos"][data-mac-state="full"] .notion-main-wrap,
html[data-style="macos"][data-mac-state="full"] .site-header {
  border-radius: 0;
}

html[data-style="macos"][data-mac-state="full"] .os-bar {
  display: none;
}

html[data-style="macos"] .notion-sidebar {
  position: relative;
  height: auto;
  width: 234px;
  border-radius: 15px 0 0 15px;
  background: light-dark(rgba(238, 238, 243, 0.86), rgba(34, 34, 38, 0.86));
  backdrop-filter: blur(26px) saturate(1.5);
  border-right: 1px solid var(--border);
  padding-top: 14px;
}

/* Interactive Traffic-Light Window Controls */
html[data-style="macos"] .mac-lights {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 2px 0 4px 10px;
}

html[data-style="macos"] .mac-dot {
  width: 12px;
  height: 12px;
  padding: 0;
  border-radius: 999px;
  border: 0.5px solid rgba(0, 0, 0, 0.2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 800;
  line-height: 1;
  color: transparent;
  cursor: pointer;
  transition: color 100ms ease, filter 100ms ease;
}

html[data-style="macos"] .mac-red    { background: #ff5f56; }
html[data-style="macos"] .mac-yellow { background: #ffbd2e; }
html[data-style="macos"] .mac-green  { background: #27c93f; }

html[data-style="macos"] .mac-lights:hover .mac-dot {
  color: rgba(0, 0, 0, 0.65);
}

html[data-style="macos"] .mac-dot:active {
  filter: brightness(0.85);
}

html[data-style="macos"] .notion-main-wrap {
  border-radius: 0 15px 15px 0;
  background: var(--background);
}

html[data-style="macos"] .site-header {
  position: relative;
  border-radius: 0 15px 0 0;
  background: light-dark(rgba(250, 250, 252, 0.86), rgba(32, 32, 35, 0.88));
  backdrop-filter: blur(20px) saturate(1.5);
  border-bottom: 1px solid var(--border);
}

/* Finder interior: no Notion cover, squircle profile + 3-col Apple Bento Grid */
html[data-style="macos"] .notion-cover { display: none; }
html[data-style="macos"] main,
html[data-style="macos"] .has-cover main { padding: 28px 36px 48px; max-width: none; }
html[data-style="macos"] .site-footer { max-width: none; padding: 18px 36px 28px; }

html[data-style="macos"] .notion-page-icon-overlap {
  margin-top: 0;
  margin-bottom: 14px;
}

html[data-style="macos"] .notion-page-avatar {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  border: 1px solid var(--border);
  box-shadow: 0 8px 22px light-dark(rgba(0, 0, 0, 0.12), rgba(0, 0, 0, 0.45));
}

/* 3-Column Apple Bento Grid with Wide Flagship Card */
html[data-style="macos"] .notion-gallery {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

html[data-style="macos"] .notion-gallery .gallery-card:first-child {
  grid-column: span 2;
  background: linear-gradient(135deg, var(--accent-soft-bg) 0%, var(--card) 100%);
  border-color: color-mix(in srgb, var(--link) 28%, var(--border));
}

html[data-style="macos"] .settings-trigger {
  border-radius: 999px;
  padding: 4px 12px;
  background: light-dark(rgba(255, 255, 255, 0.85), rgba(46, 46, 50, 0.85));
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

html[data-style="macos"] .settings-panel {
  border-radius: 14px;
  background: light-dark(rgba(252, 252, 254, 0.96), rgba(36, 36, 40, 0.96));
  backdrop-filter: blur(24px) saturate(1.5);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.2), 0 1px 3px rgba(0, 0, 0, 0.08);
}

html[data-style="macos"] .gallery-card,
html[data-style="macos"] .metric,
html[data-style="macos"] .principle,
html[data-style="macos"] .table-wrap,
html[data-style="macos"] .row-list {
  box-shadow: 0 1px 3px light-dark(rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.25));
}

html[data-style="macos"] .gallery-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 22px light-dark(rgba(0, 0, 0, 0.09), rgba(0, 0, 0, 0.42));
}

html[data-style="macos"] .sidebar-nav a:hover,
html[data-style="macos"] .sidebar-nav a[aria-current="page"] {
  background: light-dark(rgba(0, 102, 204, 0.12), rgba(10, 132, 255, 0.22));
  color: var(--link);
}

html[data-style="macos"] .sidebar-nav a:hover .sidebar-glyph,
html[data-style="macos"] .sidebar-nav a[aria-current="page"] .sidebar-glyph { color: var(--link); }

html[data-style="macos"] #tm-gallery:checked ~ .win-tabs label[for="tm-gallery"],
html[data-style="macos"] #tm-core:checked    ~ .win-tabs label[for="tm-core"] {
  color: var(--link);
  border-bottom-color: var(--link);
}

html[data-style="macos"] .prog-bar {
  height: 6px;
  border: 0;
  border-radius: 999px;
}

html[data-style="macos"] .prog-bar::-webkit-progress-value,
html[data-style="macos"] .prog-bar::-moz-progress-bar {
  border-radius: 999px;
}

/* Floating Frosted-Glass macOS Bottom Dock with Native Apple Squircle App Icons */
html[data-style="macos"] .os-bar {
  display: flex;
  align-items: center;
  position: fixed;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 110;
  padding: 7px 12px 10px;
  border-radius: 20px;
  background: light-dark(rgba(255, 255, 255, 0.62), rgba(34, 34, 38, 0.68));
  backdrop-filter: blur(26px) saturate(1.9);
  border: 1px solid light-dark(rgba(255, 255, 255, 0.82), rgba(255, 255, 255, 0.16));
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.5);
  max-width: calc(100vw - 24px);
}

html[data-style="macos"] .os-start,
html[data-style="macos"] .os-tray { display: none; }

html[data-style="macos"] .os-dock-items {
  display: flex;
  align-items: flex-end;
  gap: 10px;
}

html[data-style="macos"] .os-dock-item {
  position: relative;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 12px;
  color: #ffffff;
  text-decoration: none;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.35);
  transition: transform 150ms cubic-bezier(0.22, 1, 0.36, 1), box-shadow 150ms ease;
}

html[data-style="macos"] .os-dock-item svg {
  width: 20px;
  height: 20px;
  stroke-width: 1.9;
}

/* Native macOS app icon color palettes */
html[data-style="macos"] .os-dock-item:nth-child(1) { background: linear-gradient(180deg, #49b6ff 0%, #007aff 100%); }
html[data-style="macos"] .os-dock-item:nth-child(2) { background: linear-gradient(180deg, #7484ff 0%, #4c51d6 100%); }
html[data-style="macos"] .os-dock-item:nth-child(3) { background: linear-gradient(180deg, #ffb43b 0%, #f06518 100%); }
html[data-style="macos"] .os-dock-item:nth-child(4) { background: linear-gradient(180deg, #4f525c 0%, #1d1e24 100%); }
html[data-style="macos"] .os-dock-item:nth-child(5) { background: linear-gradient(180deg, #c084fc 0%, #7c3aed 100%); }
html[data-style="macos"] .os-dock-item:nth-child(6) { background: linear-gradient(180deg, #45df83 0%, #16a34a 100%); }

/* Active running app indicator dot under Home */
html[data-style="macos"] .os-dock-item:nth-child(1)::after {
  content: "";
  position: absolute;
  bottom: -7px;
  width: 4px;
  height: 4px;
  border-radius: 999px;
  background: light-dark(rgba(0, 0, 0, 0.6), rgba(255, 255, 255, 0.85));
}

/* Floating macOS Dock Tooltip Pill on Hover */
html[data-style="macos"] .os-dock-item span {
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  padding: 3px 9px;
  border-radius: 6px;
  background: light-dark(rgba(250, 250, 252, 0.96), rgba(38, 38, 42, 0.96));
  color: var(--foreground);
  border: 1px solid var(--border);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.16);
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 120ms ease, transform 120ms ease;
}

html[data-style="macos"] .os-dock-item:hover {
  transform: translateY(-7px) scale(1.12);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.45);
  text-decoration: none;
}

html[data-style="macos"] .os-dock-item:hover span {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Frosted macOS Spotlight Search Modal (Cmd+K) */
html[data-style="macos"] .mac-spot-backdrop {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  position: fixed;
  inset: 0;
  padding: 15vh 16px 24px;
  z-index: 250;
  background: rgba(0, 0, 0, 0.24);
  backdrop-filter: blur(4px);
}

html[data-style="macos"] .mac-spot-backdrop[hidden] {
  display: none;
}

html[data-style="macos"] .mac-spot-box {
  width: 100%;
  max-width: 580px;
  border-radius: 16px;
  overflow: hidden;
  background: light-dark(rgba(252, 252, 254, 0.92), rgba(34, 34, 38, 0.92));
  backdrop-filter: blur(28px) saturate(1.8);
  border: 1px solid light-dark(rgba(255, 255, 255, 0.8), rgba(255, 255, 255, 0.16));
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.34), 0 2px 8px rgba(0, 0, 0, 0.12);
}

html[data-style="macos"] .mac-spot-input-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}

html[data-style="macos"] .mac-spot-icon {
  color: var(--muted-foreground);
}

html[data-style="macos"] .mac-spot-input {
  flex: 1 1 auto;
  min-width: 0;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--foreground);
  font-family: var(--sans);
  font-size: 1.05rem;
}

html[data-style="macos"] .mac-spot-kbd {
  font-size: 0.7rem;
  box-shadow: none;
}

html[data-style="macos"] .mac-spot-list {
  list-style: none;
  margin: 0;
  padding: 6px;
  max-height: 330px;
  overflow-y: auto;
}

html[data-style="macos"] .mac-spot-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 12px;
  border-radius: 9px;
  cursor: pointer;
}

html[data-style="macos"] .mac-spot-item.is-active,
html[data-style="macos"] .mac-spot-item:hover {
  background: var(--primary);
  color: #ffffff;
}

html[data-style="macos"] .mac-spot-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

html[data-style="macos"] .mac-spot-title {
  font-size: 0.9rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

html[data-style="macos"] .mac-spot-sub {
  font-size: 0.76rem;
  color: var(--muted-foreground);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

html[data-style="macos"] .mac-spot-item.is-active .mac-spot-sub,
html[data-style="macos"] .mac-spot-item:hover .mac-spot-sub,
html[data-style="macos"] .mac-spot-item.is-active .mac-spot-group,
html[data-style="macos"] .mac-spot-item:hover .mac-spot-group {
  color: rgba(255, 255, 255, 0.85);
}

html[data-style="macos"] .mac-spot-group {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted-foreground);
  flex-shrink: 0;
}

html[data-style="macos"] .mac-spot-empty {
  padding: 20px;
  text-align: center;
  color: var(--muted-foreground);
  font-size: 0.88rem;
}

html[data-style="macos"] .mac-spot-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  border-top: 1px solid var(--border);
  font-size: 0.72rem;
  color: var(--muted-foreground);
}

/* ---- 4. Terminal — Full-Screen Tmux / TUI Workstation (NO Sidebar, NO Cover) ---- */
html[data-style="terminal"] {
  --sans: var(--mono);
  --background:           light-dark(#f4f6f0, #0a0f0c);
  --foreground:           light-dark(#122116, #d8f6e2);
  --card:                 light-dark(#eaece4, #0f1712);
  --card-foreground:      light-dark(#122116, #d8f6e2);
  --secondary:            light-dark(#dfe4d8, #142119);
  --secondary-foreground: light-dark(#122116, #d8f6e2);
  --muted:                light-dark(#dfe4d8, #142119);
  --muted-foreground:     light-dark(#3b5441, #7da88d);
  --border:               light-dark(#b7c4b3, #1f3828);
  --border-strong:        light-dark(#7d947a, #2f573e);
  --accent:               light-dark(#0e6b3a, #25a361);
  --primary:              light-dark(#0e6b3a, #39e58c);
  --primary-foreground:   light-dark(#ffffff, #06120b);
  --link:                 light-dark(#0d6637, #39e58c);
  --ring:                 light-dark(#0d6637, #39e58c);
  --code-fg:              light-dark(#0d6637, #5bf2a4);
  --accent-soft-bg:       light-dark(#dceee1, #12291c);
  --accent-soft-fg:       light-dark(#0b572f, #5bf2a4);
  --radius-sm:            0px;
  --radius-md:            0px;
  --radius-lg:            0px;
}

html[data-style="terminal"] body {
  font-size: 14px;
  line-height: 1.65;
  padding-bottom: 30px;
}

/* Pure Text-Mode TUI: hide Notion sidebar, cover, and avatar widget */
html[data-style="terminal"] .notion-sidebar,
html[data-style="terminal"] .notion-cover,
html[data-style="terminal"] .notion-page-icon-overlap,
html[data-style="terminal"] .notion-avatar {
  display: none;
}

html[data-style="terminal"] .notion-app { display: block; }

html[data-style="terminal"] .site-header {
  background: var(--card);
  backdrop-filter: none;
  border-bottom: 1px solid var(--border-strong);
}

html[data-style="terminal"] .notion-topbar {
  max-width: 1120px;
  margin: 0 auto;
}

/* Top Tmux Window Tabs */
html[data-style="terminal"] .mobile-nav-bar {
  display: block;
  border-top: 1px solid var(--border);
  background: var(--background);
  padding: 5px 20px;
}

html[data-style="terminal"] .site-nav {
  max-width: 1080px;
  margin: 0 auto;
  gap: 8px;
  font-size: 0.78rem;
}

html[data-style="terminal"] .site-nav a {
  padding: 2px 8px;
  border: 1px solid var(--border);
  color: var(--muted-foreground);
}

html[data-style="terminal"] .site-nav a::before {
  content: "./";
  color: var(--link);
}

html[data-style="terminal"] .site-nav a:hover {
  border-color: var(--link);
  color: var(--link);
  background: var(--accent-soft-bg);
}

html[data-style="terminal"] main,
html[data-style="terminal"] .has-cover main {
  max-width: 1120px;
  padding: 26px 32px 54px;
}

html[data-style="terminal"] .site-footer {
  max-width: 1120px;
  padding: 16px 32px 26px;
}

/* Interactive Terminal Shell Box (Option A Hybrid) */
html[data-style="terminal"] .term-shell {
  display: block;
  margin: 0 0 28px;
  border: 1px solid var(--border-strong);
  background: var(--card);
  box-shadow: 4px 4px 0 light-dark(rgba(18, 33, 22, 0.1), rgba(57, 229, 140, 0.1));
  font-family: var(--mono);
  font-size: 0.84rem;
  line-height: 1.55;
}

html[data-style="terminal"] .term-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding: 6px 12px;
  border-bottom: 1px solid var(--border-strong);
  background: var(--muted);
  font-size: 0.75rem;
}

html[data-style="terminal"] .term-bar-title {
  font-weight: 700;
  color: var(--link);
}

html[data-style="terminal"] .term-bar-hint {
  color: var(--muted-foreground);
}

html[data-style="terminal"] .term-out {
  padding: 12px 14px 6px;
  max-height: 320px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

html[data-style="terminal"] .term-line {
  white-space: pre-wrap;
  word-break: break-word;
}

html[data-style="terminal"] .term-echo {
  margin-top: 6px;
}

html[data-style="terminal"] .term-accent { color: var(--link); font-weight: 700; }
html[data-style="terminal"] .term-cmd    { color: var(--foreground); font-weight: 700; }
html[data-style="terminal"] .term-dim    { color: var(--muted-foreground); }
html[data-style="terminal"] .term-tag    { color: var(--link); }
html[data-style="terminal"] .term-err    { color: light-dark(#b42318, #ff7b72); }

html[data-style="terminal"] .term-key {
  display: inline-block;
  min-width: 132px;
  color: var(--link);
  font-weight: 700;
}

html[data-style="terminal"] .term-neofetch {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 14px 24px;
  margin: 4px 0 6px;
  padding: 10px 12px;
  border: 1px dashed var(--border-strong);
  background: var(--background);
}

html[data-style="terminal"] .term-ascii {
  margin: 0;
  color: var(--link);
  font-size: 0.78rem;
  line-height: 1.25;
  font-weight: 700;
}

html[data-style="terminal"] .term-nf-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 0.8rem;
}

html[data-style="terminal"] .term-prompt-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px 10px;
  border-top: 1px dashed var(--border);
  background: var(--background);
}

html[data-style="terminal"] .term-prompt {
  color: var(--link);
  font-weight: 700;
  white-space: nowrap;
  user-select: none;
}

html[data-style="terminal"] .term-input {
  flex: 1 1 auto;
  min-width: 0;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--foreground);
  font-family: var(--mono);
  font-size: 0.86rem;
  caret-color: var(--link);
}

html[data-style="terminal"] .term-input::placeholder {
  color: var(--muted-foreground);
  opacity: 0.72;
}

html[data-style="terminal"] .term-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 14px;
  border-top: 1px solid var(--border);
  background: var(--card);
}

html[data-style="terminal"] .term-chip {
  padding: 2px 8px;
  border: 1px solid var(--border-strong);
  background: var(--background);
  color: var(--foreground);
  font-family: var(--mono);
  font-size: 0.74rem;
  cursor: pointer;
}

html[data-style="terminal"] .term-chip::before {
  content: "$ ";
  color: var(--link);
}

html[data-style="terminal"] .term-chip:hover {
  border-color: var(--link);
  color: var(--link);
  background: var(--accent-soft-bg);
}

/* Frame page sections below the shell as authentic CLI command outputs */
html[data-style="terminal"] .hero::before,
html[data-style="terminal"] #projects::before,
html[data-style="terminal"] #progress::before,
html[data-style="terminal"] section[aria-label="Latest writing"]::before,
html[data-style="terminal"] section[aria-label="Notes and principles"]::before {
  display: block;
  margin-bottom: 10px;
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--link);
}

html[data-style="terminal"] .hero::before { content: "$ cat ~/README.md"; }
html[data-style="terminal"] #projects::before { content: "$ ls -la ~/projects/"; }
html[data-style="terminal"] #progress::before { content: "$ ./progress --all"; }
html[data-style="terminal"] section[aria-label="Latest writing"]::before { content: "$ ls -lt ~/writing/ | head -n 6"; }
html[data-style="terminal"] section[aria-label="Notes and principles"]::before { content: "$ cat ~/NOTES.md"; }

html[data-style="terminal"] .prog-bar {
  border-radius: 0;
  border-color: var(--border-strong);
  height: 9px;
}

html[data-style="terminal"] .prog-bar::-webkit-progress-value,
html[data-style="terminal"] .prog-bar::-moz-progress-bar {
  background: var(--link);
  border-radius: 0;
}

/* Single-Column Stacked TUI Directory List instead of 2-Col Cards */
html[data-style="terminal"] .notion-gallery {
  grid-template-columns: 1fr;
  gap: 0;
  border: 1px solid var(--border-strong);
}

html[data-style="terminal"] .gallery-card {
  border: 0;
  border-bottom: 1px dashed var(--border-strong);
  background: var(--background);
}

html[data-style="terminal"] .gallery-card:last-child { border-bottom: 0; }
html[data-style="terminal"] .gallery-card:hover { background: var(--card); }

html[data-style="terminal"] .notion-props {
  border: 1px solid var(--border-strong);
  padding: 12px 16px;
  background: var(--card);
}

html[data-style="terminal"] .notion-crumb-root::before {
  content: "~$";
  color: var(--link);
  font-weight: 700;
}

html[data-style="terminal"] main h1::before {
  content: "> ";
  color: var(--link);
}

html[data-style="terminal"] .notion-section-head h2::before,
html[data-style="terminal"] .section-head h2::before {
  content: "## ";
  color: var(--link);
}

html[data-style="terminal"] .settings-panel {
  box-shadow: 6px 6px 0 light-dark(rgba(18, 33, 22, 0.16), rgba(57, 229, 140, 0.16));
}

html[data-style="terminal"] #tm-gallery:checked ~ .win-tabs label[for="tm-gallery"],
html[data-style="terminal"] #tm-core:checked    ~ .win-tabs label[for="tm-core"] {
  color: var(--link);
  border-bottom-color: var(--link);
}

/* Fixed Bottom Tmux Statusline */
html[data-style="terminal"] .os-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 28px;
  padding: 0 12px;
  z-index: 90;
  background: var(--primary);
  color: var(--primary-foreground);
  font-family: var(--mono);
  font-size: 0.74rem;
  font-weight: 700;
}

html[data-style="terminal"] .os-orb { display: none; }

html[data-style="terminal"] .os-start {
  color: var(--primary-foreground);
  text-decoration: none;
  white-space: nowrap;
}

html[data-style="terminal"] .os-start-label {
  font-size: 0;
}

html[data-style="terminal"] .os-start-label::before {
  content: "[tmux:404]";
  font-size: 0.74rem;
}

html[data-style="terminal"] .os-dock-items {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-right: auto;
  overflow-x: auto;
  scrollbar-width: none;
}

html[data-style="terminal"] .os-dock-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--primary-foreground);
  text-decoration: none;
  opacity: 0.85;
  white-space: nowrap;
}

html[data-style="terminal"] .os-dock-item svg { display: none; }
html[data-style="terminal"] .os-dock-item:hover { opacity: 1; text-decoration: underline; }
html[data-style="terminal"] .os-tray { white-space: nowrap; }

/* ---- 5. Swiss Editorial — Broadsheet Masthead + Asymmetric Split + 3-Col Print Grid ---- */
html[data-style="swiss"] {
  --background:           light-dark(#faf8f3, #141312);
  --foreground:           light-dark(#141312, #f2efe9);
  --card:                 light-dark(#f2efe8, #1c1b19);
  --card-foreground:      light-dark(#141312, #f2efe9);
  --secondary:            light-dark(#e9e5dc, #252421);
  --secondary-foreground: light-dark(#141312, #f2efe9);
  --muted:                light-dark(#e9e5dc, #252421);
  --muted-foreground:     light-dark(#524e47, #a39e94);
  --border:               light-dark(#d4cfc4, #33302c);
  --border-strong:        light-dark(#141312, #ebe7df);
  --accent:               light-dark(#c92a2a, #e04848);
  --primary:              light-dark(#141312, #f2efe9);
  --primary-foreground:   light-dark(#faf8f3, #141312);
  --link:                 light-dark(#b82323, #ff7070);
  --ring:                 light-dark(#c92a2a, #ff7070);
  --accent-soft-bg:       light-dark(#fae5e5, #3a1a1a);
  --accent-soft-fg:       light-dark(#9c1c1c, #ff9999);
  --radius-sm:            0px;
  --radius-md:            0px;
  --radius-lg:            0px;
}

/* Pure Editorial Broadsheet: NO sidebar, NO cover banner, NO OS dock */
html[data-style="swiss"] .notion-sidebar,
html[data-style="swiss"] .notion-cover {
  display: none;
}

html[data-style="swiss"] .notion-app { display: block; }

html[data-style="swiss"] .notion-avatar,
html[data-style="swiss"] .notion-page-avatar,
html[data-style="swiss"] .sidebar-count,
html[data-style="swiss"] .style-swatch {
  border-radius: 0;
}

html[data-style="swiss"] h1,
html[data-style="swiss"] h2,
html[data-style="swiss"] h3 {
  font-family: var(--serif);
  letter-spacing: -0.028em;
}

/* Grand Swiss Newspaper Masthead */
html[data-style="swiss"] .site-header {
  background: var(--background);
  backdrop-filter: none;
  border-bottom: 3px solid var(--foreground);
}

html[data-style="swiss"] .notion-topbar {
  max-width: 1240px;
  margin: 0 auto;
  padding: 12px 40px;
}

html[data-style="swiss"] .notion-crumb-root {
  font-family: var(--serif);
  font-size: 1.25rem;
  letter-spacing: -0.02em;
  padding: 0;
}

html[data-style="swiss"] .mobile-nav-bar {
  display: block;
  border-top: 1px solid var(--foreground);
  padding: 6px 40px;
}

html[data-style="swiss"] .site-nav {
  max-width: 1160px;
  margin: 0 auto;
  gap: 20px;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

html[data-style="swiss"] .site-nav a {
  padding: 4px 0;
  color: var(--foreground);
  font-weight: 600;
}

html[data-style="swiss"] .site-nav a:hover {
  background: transparent;
  color: var(--link);
}

html[data-style="swiss"] main,
html[data-style="swiss"] .has-cover main {
  max-width: 1240px;
  padding: 36px 40px 72px;
}

html[data-style="swiss"] .site-footer {
  max-width: 1240px;
  padding: 20px 40px 44px;
  border-top: 2px solid var(--foreground);
}

html[data-style="swiss"] .notion-page-icon-overlap {
  margin-top: 0;
  margin-bottom: 18px;
}

html[data-style="swiss"] .notion-page-avatar {
  width: 56px;
  height: 56px;
  border: 2px solid var(--foreground);
  box-shadow: none;
}

/* Asymmetric 2-Column Swiss Split Hero + Framed Colophon Fact Box */
html[data-style="swiss"] .hero {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
  gap: 36px;
  align-items: start;
  padding-bottom: 32px;
  border-bottom: 2px solid var(--foreground);
}

html[data-style="swiss"] .hero h1 {
  font-size: clamp(2.8rem, 5.2vw, 4.3rem);
  line-height: 1.04;
  margin-bottom: 16px;
}

html[data-style="swiss"] .hero p {
  font-size: 1.12rem;
  line-height: 1.58;
  max-width: 52ch;
}

html[data-style="swiss"] .notion-props {
  margin: 0;
  padding: 18px 20px;
  border: 1px solid var(--foreground);
  border-top: 4px solid var(--link);
  background: var(--card);
  grid-template-columns: 82px minmax(0, 1fr);
}

/* 3-Column Front-Page Newspaper Grid with Wide Lead Story */
html[data-style="swiss"] .notion-gallery {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  border-top: 2px solid var(--foreground);
  border-left: 1px solid var(--border);
}

html[data-style="swiss"] .notion-gallery .gallery-card {
  border: 0;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  box-shadow: none;
}

html[data-style="swiss"] .notion-gallery .gallery-card:first-child {
  grid-column: span 2;
  background: var(--card);
}

html[data-style="swiss"] .notion-gallery .gallery-card:first-child .gallery-card-title {
  font-size: 1.38rem;
}

/* 2-Column Editorial Newspaper Index for Writing */
html[data-style="swiss"] .row-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border: 0;
  border-top: 2px solid var(--foreground);
}

html[data-style="swiss"] .row-item {
  border-bottom: 1px solid var(--border);
  padding: 14px 16px;
}

html[data-style="swiss"] .row-item:nth-child(odd) {
  border-right: 1px solid var(--border);
}

html[data-style="swiss"] .notion-section-head,
html[data-style="swiss"] .section-head {
  border-bottom: 2px solid var(--foreground);
  padding-bottom: 10px;
}

html[data-style="swiss"] .settings-panel {
  border: 2px solid var(--foreground);
  box-shadow: 6px 6px 0 var(--foreground);
}

html[data-style="swiss"] .settings-trigger {
  border: 1px solid var(--foreground);
  background: var(--background);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.72rem;
}

html[data-style="swiss"] .settings-heading,
html[data-style="swiss"] th {
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

html[data-style="swiss"] .prog-bar {
  border-radius: 0;
  border-color: var(--foreground);
  height: 8px;
}

html[data-style="swiss"] .prog-bar::-webkit-progress-value,
html[data-style="swiss"] .prog-bar::-moz-progress-bar {
  background: var(--link);
  border-radius: 0;
}

html[data-style="swiss"] #tm-gallery:checked ~ .win-tabs label[for="tm-gallery"],
html[data-style="swiss"] #tm-core:checked    ~ .win-tabs label[for="tm-core"] {
  color: var(--link);
  border-bottom: 2px solid var(--link);
}

/* ---- 6. Linear — High-Craft Issue Tracker & Cycle List Presentation ---- */
html[data-style="linear"] {
  --background:           light-dark(#fbfbfc, #0b0c0e);
  --foreground:           light-dark(#18191f, #f2f3f5);
  --card:                 light-dark(#f4f5f8, #121418);
  --card-foreground:      light-dark(#18191f, #f2f3f5);
  --secondary:            light-dark(#eceef3, #1a1c22);
  --secondary-foreground: light-dark(#18191f, #f2f3f5);
  --muted:                light-dark(#eaecf2, #1b1d24);
  --muted-foreground:     light-dark(#5b5f6e, #8a8f9e);
  --border:               light-dark(#e3e5ec, #22252e);
  --border-strong:        light-dark(#cdd1de, #313644);
  --accent:               light-dark(#5e6ad2, #7a86f0);
  --primary:              light-dark(#5e6ad2, #7a86f0);
  --primary-foreground:   #ffffff;
  --link:                 light-dark(#4d58c4, #9aa4ff);
  --ring:                 light-dark(#5e6ad2, #7a86f0);
  --accent-soft-bg:       light-dark(#eef0fc, #1a1d33);
  --accent-soft-fg:       light-dark(#444fb8, #a7b0ff);
  --radius-sm:            4px;
  --radius-md:            6px;
  --radius-lg:            8px;
}

html[data-style="linear"] .notion-cover { display: none; }
html[data-style="linear"] .notion-sidebar {
  width: 230px;
  background: light-dark(#f6f7fa, #0e1014);
  border-right: 1px solid var(--border);
}

html[data-style="linear"] .notion-main-wrap {
  background:
    radial-gradient(ellipse 680px 260px at 50% 0%, light-dark(rgba(94, 106, 210, 0.08), rgba(94, 106, 210, 0.14)), transparent 70%),
    var(--background);
}

html[data-style="linear"] .site-header {
  background: light-dark(rgba(251, 251, 252, 0.85), rgba(11, 12, 14, 0.85));
  backdrop-filter: blur(12px);
}

/* Linear keyboard-shortcut hints on primary sidebar nav items */
html[data-style="linear"] .sidebar-nav li:nth-child(1) a::after { content: "G H"; }
html[data-style="linear"] .sidebar-nav li:nth-child(2) a::after { content: "G P"; }
html[data-style="linear"] .sidebar-nav li:nth-child(5) a::after { content: "G L"; }
html[data-style="linear"] .sidebar-nav li:nth-child(7) a::after { content: "G S"; }
html[data-style="linear"] .sidebar-nav li a::after {
  font-family: var(--mono);
  font-size: 0.66rem;
  color: var(--muted-foreground);
  opacity: 0.55;
  letter-spacing: 0.04em;
}

html[data-style="linear"] .sidebar-nav a[aria-current="page"] {
  background: var(--accent-soft-bg);
  color: var(--accent-soft-fg);
}

html[data-style="linear"] .sidebar-nav a[aria-current="page"] .sidebar-glyph {
  color: var(--accent-soft-fg);
}

html[data-style="linear"] main,
html[data-style="linear"] .has-cover main {
  max-width: 1040px;
  padding: 28px 40px 60px;
}

html[data-style="linear"] .notion-page-icon-overlap {
  margin-top: 0;
  margin-bottom: 12px;
}

html[data-style="linear"] .notion-page-avatar {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  box-shadow: none;
}

/* Projects presented as a Dense Linear Issue Stack with auto-numbered ENG-01 IDs */
html[data-style="linear"] .notion-gallery {
  grid-template-columns: 1fr;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  counter-reset: lin-issue;
}

html[data-style="linear"] .gallery-card {
  counter-increment: lin-issue;
  border: 0;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  background: var(--background);
}

html[data-style="linear"] .gallery-card:last-child { border-bottom: 0; }

html[data-style="linear"] .gallery-card:hover {
  background: var(--card);
  box-shadow: inset 2px 0 0 var(--accent);
}

html[data-style="linear"] .gallery-card-body {
  padding: 12px 16px;
  gap: 6px;
}

html[data-style="linear"] .gallery-card-title::before {
  content: "ENG-0" counter(lin-issue);
  display: inline-block;
  margin-right: 10px;
  font-family: var(--mono);
  font-size: 0.74rem;
  font-weight: 500;
  color: var(--muted-foreground);
  letter-spacing: 0.02em;
}

html[data-style="linear"] .gallery-card-foot {
  border-top: 0;
  padding-top: 2px;
}

html[data-style="linear"] #tm-gallery:checked ~ .win-tabs label[for="tm-gallery"],
html[data-style="linear"] #tm-core:checked    ~ .win-tabs label[for="tm-core"] {
  color: var(--link);
  border-bottom-color: var(--accent);
}

/* ---- 7. VS Code / Zed — Authentic IDE Workbench (Activity Rail + Explorer + Tabs + Gutter + Status Bar) ---- */
html[data-style="vscode"] {
  --background:           light-dark(#ffffff, #1e1e1e);
  --foreground:           light-dark(#24292e, #d4d4d4);
  --card:                 light-dark(#f3f3f3, #252526);
  --card-foreground:      light-dark(#24292e, #d4d4d4);
  --secondary:            light-dark(#e8e8e8, #2d2d30);
  --secondary-foreground: light-dark(#24292e, #d4d4d4);
  --muted:                light-dark(#e6e6e6, #2a2d2e);
  --muted-foreground:     light-dark(#616161, #858585);
  --border:               light-dark(#e0e0e0, #333337);
  --border-strong:        light-dark(#c8c8c8, #45454b);
  --accent:               #007acc;
  --primary:              #007acc;
  --primary-foreground:   #ffffff;
  --link:                 light-dark(#005fb8, #4fc1ff);
  --ring:                 #007acc;
  --code-fg:              light-dark(#a31515, #ce9178);
  --accent-soft-bg:       light-dark(#e4f1fb, #183047);
  --accent-soft-fg:       light-dark(#00549e, #7bc2ff);
  --radius-sm:            2px;
  --radius-md:            3px;
  --radius-lg:            3px;
}

html[data-style="vscode"] body { padding-bottom: 24px; }
html[data-style="vscode"] .notion-cover,
html[data-style="vscode"] .notion-page-icon-overlap { display: none; }

/* Real 48px VS Code Activity Bar with Icons & Active Left Edge Indicator */
html[data-style="vscode"] .vscode-activity {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 48px;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: calc(100vh - 24px);
  background: light-dark(#2c2c2c, #333333);
  border-right: 1px solid light-dark(#1e1e1e, #252526);
  padding: 4px 0 8px;
  z-index: 30;
}

html[data-style="vscode"] .vsc-act-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 44px;
  color: rgba(255, 255, 255, 0.55);
  text-decoration: none;
  transition: color 100ms ease;
}

html[data-style="vscode"] .vsc-act-btn:hover,
html[data-style="vscode"] .vsc-act-btn.is-active {
  color: #ffffff;
}

html[data-style="vscode"] .vsc-act-btn.is-active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: #ffffff;
}

html[data-style="vscode"] .vsc-act-bottom {
  margin-top: auto;
}

/* VS Code Explorer Sidebar */
html[data-style="vscode"] .notion-sidebar {
  width: 236px;
  height: calc(100vh - 24px);
  background: var(--card);
  border-right: 1px solid var(--border);
  padding: 10px 8px 16px;
  font-family: var(--mono);
  font-size: 0.78rem;
}

html[data-style="vscode"] .notion-workspace {
  padding: 4px 6px 8px;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
}

html[data-style="vscode"] .notion-ws-name {
  font-size: 0.74rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

html[data-style="vscode"] .notion-ws-name::before {
  content: "▾ ";
  color: var(--muted-foreground);
}

html[data-style="vscode"] .notion-ws-sub { display: none; }

html[data-style="vscode"] .sidebar-label {
  font-size: 0.66rem;
  letter-spacing: 0.08em;
  padding: 2px 6px;
}

html[data-style="vscode"] .sidebar-nav a {
  padding: 4px 6px;
  border-radius: 0;
  font-size: 0.78rem;
}

html[data-style="vscode"] .sidebar-nav a:hover {
  background: light-dark(#e4e6f1, #2a2d2e);
}

/* Tight filename + extension styling (zero gap before .rs / .toml / .md) */
html[data-style="vscode"] .sidebar-nav-left {
  gap: 0;
}

html[data-style="vscode"] .sidebar-glyph {
  margin-right: 7px;
  color: light-dark(#005fb8, #519aba);
}

html[data-style="vscode"] .sidebar-nav li:nth-child(1) .sidebar-nav-left::after { content: ".rs"; color: light-dark(#c55a11, #dea584); }
html[data-style="vscode"] .sidebar-nav li:nth-child(2) .sidebar-nav-left::after { content: ".toml"; color: light-dark(#795e26, #dcdcaa); }
html[data-style="vscode"] .sidebar-nav li:nth-child(3) .sidebar-nav-left::after { content: "/"; color: var(--muted-foreground); }
html[data-style="vscode"] .sidebar-nav li:nth-child(4) .sidebar-nav-left::after { content: "/"; color: var(--muted-foreground); }
html[data-style="vscode"] .sidebar-nav li:nth-child(5) .sidebar-nav-left::after { content: ".md"; color: light-dark(#005fb8, #519aba); }
html[data-style="vscode"] .sidebar-nav li:nth-child(6) .sidebar-nav-left::after { content: ".md"; color: light-dark(#005fb8, #519aba); }
html[data-style="vscode"] .sidebar-nav li:nth-child(7) .sidebar-nav-left::after { content: ".log"; color: light-dark(#008000, #6a9955); }

html[data-style="vscode"] .sidebar-nav a[aria-current="page"] {
  background: light-dark(#d6ebff, #094771);
  color: light-dark(#000000, #ffffff);
}

/* Authentic VS Code Editor Tab Strip + Breadcrumb Bar */
html[data-style="vscode"] .site-header {
  background: light-dark(#ececec, #252526);
  backdrop-filter: none;
  border-bottom: 1px solid var(--border);
}

html[data-style="vscode"] .notion-topbar {
  padding: 0 12px 0 0;
  min-height: 36px;
}

html[data-style="vscode"] .notion-crumbs {
  align-self: stretch;
  gap: 0;
}

html[data-style="vscode"] .notion-crumb-root {
  height: 100%;
  padding: 0 14px;
  border-radius: 0;
  background: var(--background);
  border-top: 2px solid #007acc;
  border-right: 1px solid var(--border);
  font-family: var(--mono);
  font-size: 0.78rem;
  gap: 0;
}

html[data-style="vscode"] .notion-crumb-root img {
  margin-right: 7px;
  border-radius: 2px;
}

html[data-style="vscode"] .notion-crumb-root::after {
  content: ".rs  ×";
  color: var(--muted-foreground);
  font-weight: 400;
}

html[data-style="vscode"] .notion-crumb-sep {
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--muted-foreground);
}

html[data-style="vscode"] .notion-crumb-current {
  font-family: var(--mono);
  font-size: 0.74rem;
  color: var(--muted-foreground);
}

html[data-style="vscode"] .notion-crumb-current::before {
  content: "src › ";
  opacity: 0.65;
}

/* Editor Document Canvas with Real Vertical Line-Number Gutter */
html[data-style="vscode"] main,
html[data-style="vscode"] .has-cover main {
  position: relative;
  max-width: 1080px;
  margin: 0;
  padding: 24px 40px 56px 64px;
  overflow: hidden;
}

html[data-style="vscode"] main::before {
  content: "01\A 02\A 03\A 04\A 05\A 06\A 07\A 08\A 09\A 10\A 11\A 12\A 13\A 14\A 15\A 16\A 17\A 18\A 19\A 20\A 21\A 22\A 23\A 24\A 25\A 26\A 27\A 28\A 29\A 30\A 31\A 32\A 33\A 34\A 35\A 36\A 37\A 38\A 39\A 40\A 41\A 42\A 43\A 44\A 45\A 46\A 47\A 48\A 49\A 50\A 51\A 52\A 53\A 54\A 55\A 56\A 57\A 58\A 59\A 60";
  position: absolute;
  top: 24px;
  left: 0;
  bottom: 0;
  width: 44px;
  padding-right: 12px;
  border-right: 1px solid var(--border);
  text-align: right;
  white-space: pre;
  font-family: var(--mono);
  font-size: 0.74rem;
  line-height: 2.1;
  color: light-dark(#999999, #5a5a5a);
  user-select: none;
  pointer-events: none;
}

html[data-style="vscode"] .site-footer {
  max-width: 1080px;
  margin: 0;
  padding: 16px 40px 28px 64px;
  font-family: var(--mono);
  font-size: 0.75rem;
}

html[data-style="vscode"] h1,
html[data-style="vscode"] h2,
html[data-style="vscode"] .gallery-card-title {
  font-family: var(--mono);
}

html[data-style="vscode"] .hero h1 {
  font-size: clamp(1.75rem, 3vw, 2.3rem);
}

html[data-style="vscode"] .hero h1::before {
  content: "/// ";
  color: light-dark(#008000, #6a9955);
}

html[data-style="vscode"] .hero h1 em {
  color: light-dark(#0000ff, #569cd6);
}

/* Cargo.toml Metadata Block for Properties */
html[data-style="vscode"] .notion-props {
  position: relative;
  padding: 26px 16px 12px;
  background: var(--card);
  border: 1px solid var(--border);
  border-left: 2px solid #007acc;
  font-family: var(--mono);
  font-size: 0.8rem;
}

html[data-style="vscode"] .notion-props::before {
  content: "[package.metadata]";
  position: absolute;
  top: 6px;
  left: 16px;
  font-size: 0.72rem;
  color: light-dark(#795e26, #dcdcaa);
}

html[data-style="vscode"] .notion-prop-key {
  font-family: var(--mono);
  color: light-dark(#0451a5, #9cdcfe);
}

/* Syntax-Colored Code-Block Project Cards */
html[data-style="vscode"] .gallery-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 2px;
}

html[data-style="vscode"] .gallery-card:hover {
  border-color: #007acc;
  background: light-dark(#f8f8f8, #28282b);
}

html[data-style="vscode"] .gallery-card-title a {
  color: light-dark(#267f99, #4ec9b0);
}

html[data-style="vscode"] .notion-section-head h2::before {
  content: "mod ";
  color: light-dark(#af00db, #c586c0);
  font-weight: 500;
}

html[data-style="vscode"] .notion-section-head h2::after {
  content: " {";
  color: light-dark(#795e26, #ffd700);
  font-weight: 400;
}

/* Iconic Blue VS Code Bottom Status Bar */
html[data-style="vscode"] .os-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 24px;
  padding: 0 12px;
  z-index: 95;
  background: #007acc;
  color: #ffffff;
  font-family: var(--mono);
  font-size: 0.72rem;
}

html[data-style="vscode"] .os-orb { display: none; }
html[data-style="vscode"] .os-start { color: #ffffff; text-decoration: none; font-weight: 700; white-space: nowrap; }
html[data-style="vscode"] .os-start-label { font-size: 0; }
html[data-style="vscode"] .os-start-label::before { content: "⎇ main*   ⊘ 0  ⚠ 0"; font-size: 0.72rem; }
html[data-style="vscode"] .os-dock-items { display: flex; align-items: center; gap: 12px; margin-right: auto; overflow-x: auto; scrollbar-width: none; }
html[data-style="vscode"] .os-dock-item { color: rgba(255, 255, 255, 0.9); text-decoration: none; white-space: nowrap; }
html[data-style="vscode"] .os-dock-item svg { display: none; }
html[data-style="vscode"] .os-dock-item:hover { color: #ffffff; text-decoration: underline; }
html[data-style="vscode"] .os-tray { font-size: 0; white-space: nowrap; }
html[data-style="vscode"] .os-tray::after { content: "Ln 1, Col 1   Spaces: 2   UTF-8   Rust"; font-size: 0.72rem; color: rgba(255, 255, 255, 0.92); }

/* ---- 8. Figma — Spatial Dot-Grid Canvas + Layers Sidebar + Blue-Labeled Artboards ---- */
html[data-style="figma"] {
  --background:           light-dark(#e5e5e5, #1e1e1e);
  --foreground:           light-dark(#1e1e1e, #f5f5f5);
  --card:                 light-dark(#ffffff, #2c2c2c);
  --card-foreground:      light-dark(#1e1e1e, #f5f5f5);
  --secondary:            light-dark(#f0f0f0, #383838);
  --secondary-foreground: light-dark(#1e1e1e, #f5f5f5);
  --muted:                light-dark(#ececec, #383838);
  --muted-foreground:     light-dark(#595959, #a6a6a6);
  --border:               light-dark(#d4d4d4, #3d3d3d);
  --border-strong:        light-dark(#b8b8b8, #525252);
  --accent:               #0d99ff;
  --primary:              #0d99ff;
  --primary-foreground:   #ffffff;
  --link:                 light-dark(#0a74cc, #58b8ff);
  --ring:                 #0d99ff;
  --accent-soft-bg:       light-dark(#e5f4ff, #153147);
  --accent-soft-fg:       light-dark(#0663b0, #7cc7ff);
  --radius-sm:            4px;
  --radius-md:            6px;
  --radius-lg:            8px;
}

html[data-style="figma"] body { padding-bottom: 64px; }
html[data-style="figma"] .notion-cover { display: none; }

/* Dark Figma Top Toolbar */
html[data-style="figma"] .site-header {
  background: #2c2c2c;
  backdrop-filter: none;
  border-bottom: 1px solid #3e3e3e;
  color: #ffffff;
}

html[data-style="figma"] .notion-crumb-root,
html[data-style="figma"] .notion-crumb-current,
html[data-style="figma"] .topbar-link {
  color: #f0f0f0;
}

html[data-style="figma"] .settings-trigger {
  background: #3c3c3c;
  border-color: #525252;
  color: #ffffff;
}

html[data-style="figma"] .settings-trigger:hover {
  background: #0d99ff;
  border-color: #0d99ff;
}

/* Figma Left Layers Panel */
html[data-style="figma"] .notion-sidebar {
  width: 234px;
  background: var(--card);
  border-right: 1px solid var(--border);
}

/* Infinite Dot-Grid Canvas Background */
html[data-style="figma"] .notion-main-wrap {
  background:
    radial-gradient(light-dark(rgba(0, 0, 0, 0.14), rgba(255, 255, 255, 0.12)) 1px, transparent 0) 0 0 / 20px 20px,
    var(--background);
}

html[data-style="figma"] main,
html[data-style="figma"] .has-cover main {
  max-width: 1020px;
  padding: 36px 40px 64px;
}

html[data-style="figma"] .notion-page-icon-overlap {
  margin-top: 0;
  margin-bottom: 12px;
}

html[data-style="figma"] .notion-page-avatar {
  width: 56px;
  height: 56px;
  border-radius: 999px;
  border: 2px solid #0d99ff;
}

/* Artboard Frames floating on the Figma Canvas with blue Frame Labels above each */
html[data-style="figma"] .hero,
html[data-style="figma"] #projects,
html[data-style="figma"] #progress,
html[data-style="figma"] section[aria-label="Latest writing"],
html[data-style="figma"] section[aria-label="Notes and principles"] {
  position: relative;
  background: var(--card);
  border: 1px solid var(--border-strong);
  padding: 24px 26px;
  margin-top: 38px;
  box-shadow: 0 4px 16px light-dark(rgba(0, 0, 0, 0.06), rgba(0, 0, 0, 0.35));
}

html[data-style="figma"] .hero:hover,
html[data-style="figma"] #projects:hover,
html[data-style="figma"] #progress:hover,
html[data-style="figma"] section[aria-label="Latest writing"]:hover,
html[data-style="figma"] section[aria-label="Notes and principles"]:hover,
html[data-style="figma"] .gallery-card:hover {
  outline: 1.5px solid #0d99ff;
  outline-offset: -1px;
}

html[data-style="figma"] .hero::before,
html[data-style="figma"] #projects::before,
html[data-style="figma"] #progress::before,
html[data-style="figma"] section[aria-label="Latest writing"]::before,
html[data-style="figma"] section[aria-label="Notes and principles"]::before {
  position: absolute;
  top: -22px;
  left: 0;
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 600;
  color: light-dark(#0a74cc, #58b8ff);
}

html[data-style="figma"] .hero::before { content: "❖ Frame 01 · Intro / 940 × auto"; }
html[data-style="figma"] #projects::before { content: "❖ Frame 02 · Projects Component Set"; }
html[data-style="figma"] #progress::before { content: "❖ Frame 03 · Progress Ledger"; }
html[data-style="figma"] section[aria-label="Latest writing"]::before { content: "❖ Frame 04 · Writing Index"; }
html[data-style="figma"] section[aria-label="Notes and principles"]::before { content: "❖ Frame 05 · Engineering Notes"; }

html[data-style="figma"] .gallery-card {
  background: light-dark(#fafafa, #242424);
  border: 1px solid var(--border);
}

/* Floating Figma Bottom Tool Pill */
html[data-style="figma"] .os-bar {
  display: flex;
  align-items: center;
  position: fixed;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 95;
  padding: 5px 8px;
  border-radius: 12px;
  background: #2c2c2c;
  border: 1px solid #444444;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
}

html[data-style="figma"] .os-start,
html[data-style="figma"] .os-tray { display: none; }
html[data-style="figma"] .os-dock-items { display: flex; align-items: center; gap: 4px; }
html[data-style="figma"] .os-dock-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 10px;
  border-radius: 7px;
  color: #e5e5e5;
  font-size: 0.75rem;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
}

html[data-style="figma"] .os-dock-item:first-child,
html[data-style="figma"] .os-dock-item:hover {
  background: #0d99ff;
  color: #ffffff;
  text-decoration: none;
}

/* ---- 9. Obsidian — Amethyst PKM Knowledge Vault & [[Wikilinks]] ---- */
html[data-style="obsidian"] {
  --background:           light-dark(#ffffff, #1e1e1e);
  --foreground:           light-dark(#222029, #dcddde);
  --card:                 light-dark(#f6f4fa, #18181b);
  --card-foreground:      light-dark(#222029, #dcddde);
  --secondary:            light-dark(#eeeaf6, #26252b);
  --secondary-foreground: light-dark(#222029, #dcddde);
  --muted:                light-dark(#ece8f5, #27262d);
  --muted-foreground:     light-dark(#5f5a6e, #9894a6);
  --border:               light-dark(#e2dced, #2e2d36);
  --border-strong:        light-dark(#c8bedb, #434052);
  --accent:               light-dark(#7c3aed, #a882ff);
  --primary:              light-dark(#7c3aed, #a882ff);
  --primary-foreground:   light-dark(#ffffff, #14101f);
  --link:                 light-dark(#6d28d9, #b494ff);
  --ring:                 light-dark(#7c3aed, #a882ff);
  --accent-soft-bg:       light-dark(#f0e8ff, #28203d);
  --accent-soft-fg:       light-dark(#5b21b6, #cbb3ff);
  --radius-sm:            4px;
  --radius-md:            6px;
  --radius-lg:            10px;
}

html[data-style="obsidian"] .notion-cover { display: none; }
html[data-style="obsidian"] .notion-sidebar {
  background: light-dark(#f4f2f8, #161619);
  border-right: 1px solid var(--border);
}

/* Obsidian Tabbed Note Pane Header */
html[data-style="obsidian"] .site-header {
  background: light-dark(#f4f2f8, #161619);
  backdrop-filter: none;
  border-bottom: 1px solid var(--border);
}

html[data-style="obsidian"] .notion-crumb-root {
  background: var(--background);
  border: 1px solid var(--border);
  border-bottom-color: var(--background);
  border-radius: 8px 8px 0 0;
  padding: 5px 12px;
  margin-bottom: -6px;
}

html[data-style="obsidian"] main,
html[data-style="obsidian"] .has-cover main {
  max-width: 920px;
  padding: 32px 44px 64px;
}

html[data-style="obsidian"] .notion-page-icon-overlap { margin-top: 0; margin-bottom: 12px; }
html[data-style="obsidian"] .notion-page-avatar { width: 56px; height: 56px; border-radius: 12px; border: 2px solid var(--accent); }

/* YAML Frontmatter Properties Panel */
html[data-style="obsidian"] .notion-props {
  position: relative;
  margin-top: 22px;
  padding: 26px 18px 14px;
  border: 1px solid var(--border-strong);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-md);
  background: var(--card);
}

html[data-style="obsidian"] .notion-props::before {
  content: "PROPERTIES · YAML";
  position: absolute;
  top: 7px;
  left: 18px;
  font-family: var(--mono);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--link);
}

/* [[Wikilink]] Presentation on Links & Project Titles */
html[data-style="obsidian"] .gallery-card-title a::before,
html[data-style="obsidian"] .row-title::before { content: "[["; color: var(--link); opacity: 0.55; margin-right: 1px; font-weight: 400; }
html[data-style="obsidian"] .gallery-card-title a::after,
html[data-style="obsidian"] .row-title::after { content: "]]"; color: var(--link); opacity: 0.55; margin-left: 1px; font-weight: 400; }

html[data-style="obsidian"] .gallery-card {
  border-left: 3px solid color-mix(in srgb, var(--accent) 45%, var(--border));
}

html[data-style="obsidian"] .gallery-card:hover {
  border-left-color: var(--accent);
}

html[data-style="obsidian"] #tm-gallery:checked ~ .win-tabs label[for="tm-gallery"],
html[data-style="obsidian"] #tm-core:checked    ~ .win-tabs label[for="tm-core"] {
  color: var(--link);
  border-bottom-color: var(--accent);
}

/* ---- 10. Arc Browser — Tinted Space Frame + Pinned Favorites Grid + Floating Canvas ---- */
html[data-style="arc"] {
  --background:           light-dark(#ffffff, #191822);
  --foreground:           light-dark(#1e1c2b, #f2f1f8);
  --card:                 light-dark(#f7f6fc, #22212e);
  --card-foreground:      light-dark(#1e1c2b, #f2f1f8);
  --secondary:            light-dark(#efedf8, #2a2938);
  --secondary-foreground: light-dark(#1e1c2b, #f2f1f8);
  --muted:                light-dark(#eeecf7, #2b2a3a);
  --muted-foreground:     light-dark(#5a5770, #a29eb8);
  --border:               light-dark(#e3e0f0, #333145);
  --border-strong:        light-dark(#cdc7e4, #47445e);
  --accent:               light-dark(#4f46e5, #818cf8);
  --primary:              light-dark(#4f46e5, #818cf8);
  --primary-foreground:   #ffffff;
  --link:                 light-dark(#4338ca, #a5b4fc);
  --ring:                 light-dark(#4f46e5, #818cf8);
  --accent-soft-bg:       light-dark(#eef2ff, #232445);
  --accent-soft-fg:       light-dark(#3730a3, #c7d2fe);
  --radius-sm:            6px;
  --radius-md:            10px;
  --radius-lg:            14px;
}

/* Luminous Arc Space Gradient Frame wrapping the entire viewport */
html[data-style="arc"] body {
  background:
    radial-gradient(ellipse at 10% 10%, light-dark(rgba(182, 196, 255, 0.9), rgba(79, 70, 229, 0.42)), transparent 55%),
    radial-gradient(ellipse at 90% 85%, light-dark(rgba(255, 206, 220, 0.85), rgba(147, 51, 234, 0.36)), transparent 55%),
    linear-gradient(155deg, light-dark(#d8deff, #17152a) 0%, light-dark(#e9defa, #1d1833) 50%, light-dark(#f8e1e9, #151728) 100%);
  background-attachment: fixed;
  padding: 10px 10px 10px 0;
}

html[data-style="arc"] .notion-app {
  min-height: calc(100vh - 20px);
}

html[data-style="arc"] .notion-sidebar {
  width: 244px;
  height: calc(100vh - 20px);
  top: 10px;
  background: transparent;
  border-right: 0;
  padding: 10px 12px 14px;
}

/* Iconic Arc 2x3 Pinned Favorites Glass Tile Grid! */
html[data-style="arc"] .sidebar-nav {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-rows: 58px;
  gap: 8px;
}

html[data-style="arc"] .sidebar-nav li:last-child:nth-child(odd) {
  grid-column: span 2;
}

html[data-style="arc"] .sidebar-nav a[aria-current="page"] {
  background: light-dark(rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.18));
  border-color: light-dark(rgba(79, 70, 229, 0.45), rgba(165, 180, 252, 0.5));
}

html[data-style="arc"] .sidebar-search,
html[data-style="arc"] .sidebar-now {
  background: light-dark(rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0.08));
  border-color: light-dark(rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0.14));
}

html[data-style="arc"] .sidebar-nav a {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 8px 6px;
  border-radius: 13px;
  background: light-dark(rgba(255, 255, 255, 0.58), rgba(255, 255, 255, 0.08));
  border: 1px solid light-dark(rgba(255, 255, 255, 0.78), rgba(255, 255, 255, 0.13));
  box-shadow:
    inset 0 1px 0 light-dark(rgba(255, 255, 255, 0.85), rgba(255, 255, 255, 0.14)),
    0 2px 6px light-dark(rgba(30, 28, 60, 0.05), rgba(0, 0, 0, 0.22));
  transition: transform 130ms ease, background 120ms ease, border-color 120ms ease;
}

html[data-style="arc"] .sidebar-nav-left {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 100%;
  font-size: 0.71rem;
  font-weight: 600;
  line-height: 1.15;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

html[data-style="arc"] .sidebar-glyph {
  width: 20px;
  height: 20px;
  color: var(--link);
}

html[data-style="arc"] .sidebar-glyph .ui-icon {
  width: 17px;
  height: 17px;
}

html[data-style="arc"] .sidebar-nav a:hover {
  background: light-dark(rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.16));
  border-color: light-dark(rgba(79, 70, 229, 0.35), rgba(165, 180, 252, 0.4));
  transform: translateY(-1px);
}

html[data-style="arc"] .sidebar-nav a:hover .sidebar-glyph {
  color: var(--accent);
}

html[data-style="arc"] .sidebar-count { display: none; }

/* Rounded Floating Arc Webpage Canvas */
html[data-style="arc"] .notion-main-wrap {
  border-radius: 14px;
  border: 1px solid light-dark(rgba(255, 255, 255, 0.85), rgba(255, 255, 255, 0.12));
  box-shadow: 0 12px 36px light-dark(rgba(30, 28, 60, 0.12), rgba(0, 0, 0, 0.5));
}

html[data-style="arc"] .site-header {
  border-radius: 14px 14px 0 0;
}

html[data-style="arc"] .notion-cover { display: none; }
html[data-style="arc"] main,
html[data-style="arc"] .has-cover main { padding: 30px 42px 56px; }
html[data-style="arc"] .notion-page-icon-overlap { margin-top: 0; margin-bottom: 14px; }
html[data-style="arc"] .notion-page-avatar { width: 60px; height: 60px; border-radius: 16px; }

/* ---- 11. Notes / Bear — Warm Cream Paper Writer's Notebook ---- */
html[data-style="notes"] {
  --background:           light-dark(#fcfaf5, #1b1917);
  --foreground:           light-dark(#2c2620, #ede6dc);
  --card:                 light-dark(#f4efe6, #24211d);
  --card-foreground:      light-dark(#2c2620, #ede6dc);
  --secondary:            light-dark(#ede6da, #2d2924);
  --secondary-foreground: light-dark(#2c2620, #ede6dc);
  --muted:                light-dark(#ece5d8, #2e2a25);
  --muted-foreground:     light-dark(#6e6254, #a89d8e);
  --border:               light-dark(#e5dccd, #36312b);
  --border-strong:        light-dark(#d2c5b0, #4a433b);
  --accent:               light-dark(#b45309, #f59e0b);
  --primary:              light-dark(#b45309, #f59e0b);
  --primary-foreground:   light-dark(#ffffff, #1b150c);
  --link:                 light-dark(#9a3412, #fbbf24);
  --ring:                 light-dark(#b45309, #fbbf24);
  --accent-soft-bg:       light-dark(#fef3c7, #332713);
  --accent-soft-fg:       light-dark(#92400e, #fcd34d);
  --radius-sm:            5px;
  --radius-md:            8px;
  --radius-lg:            10px;
}

html[data-style="notes"] .notion-cover { display: none; }

html[data-style="notes"] .notion-sidebar {
  background: var(--card);
  border-right: 1px solid var(--border);
}

html[data-style="notes"] h1,
html[data-style="notes"] h2,
html[data-style="notes"] h3 {
  font-family: var(--serif);
}

html[data-style="notes"] main,
html[data-style="notes"] .has-cover main {
  max-width: 780px;
  padding: 36px 42px 68px;
}

html[data-style="notes"] .notion-page-icon-overlap { margin-top: 0; margin-bottom: 14px; }
html[data-style="notes"] .notion-page-avatar { width: 58px; height: 58px; border-radius: 999px; border: 2px solid var(--accent); }

/* Calm Single-Column Pinned Notes Feed instead of 2-col Grid */
html[data-style="notes"] .notion-gallery {
  grid-template-columns: 1fr;
  gap: 10px;
}

html[data-style="notes"] .gallery-card {
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  background: var(--card);
}

html[data-style="notes"] .notion-section-head,
html[data-style="notes"] .section-head {
  border-bottom: 1px dashed var(--border-strong);
}

html[data-style="notes"] #tm-gallery:checked ~ .win-tabs label[for="tm-gallery"],
html[data-style="notes"] #tm-core:checked    ~ .win-tabs label[for="tm-core"] {
  color: var(--link);
  border-bottom-color: var(--accent);
}

/* ---- 12. Vercel / Stripe Docs — High-Contrast Monochrome Hairline Blueprint ---- */
html[data-style="docs"] {
  --background:           light-dark(#ffffff, #000000);
  --foreground:           light-dark(#0a0a0a, #ededed);
  --card:                 light-dark(#fafafa, #0a0a0a);
  --card-foreground:      light-dark(#0a0a0a, #ededed);
  --secondary:            light-dark(#f2f2f2, #141414);
  --secondary-foreground: light-dark(#0a0a0a, #ededed);
  --muted:                light-dark(#f2f2f2, #161616);
  --muted-foreground:     light-dark(#555555, #9a9a9a);
  --border:               light-dark(#eaeaea, #242424);
  --border-strong:        light-dark(#d4d4d4, #383838);
  --accent:               light-dark(#0070f3, #3291ff);
  --primary:              light-dark(#0a0a0a, #ffffff);
  --primary-foreground:   light-dark(#ffffff, #000000);
  --link:                 light-dark(#0066db, #52a8ff);
  --ring:                 light-dark(#0070f3, #3291ff);
  --accent-soft-bg:       light-dark(#ebf5ff, #0c223d);
  --accent-soft-fg:       light-dark(#0058bd, #7cc0ff);
  --radius-sm:            4px;
  --radius-md:            6px;
  --radius-lg:            0px;
}

html[data-style="docs"] .notion-cover { display: none; }
html[data-style="docs"] .notion-sidebar {
  width: 248px;
  background: var(--background);
  border-right: 1px solid var(--border);
}

/* Docs vertical rail accent on sidebar links */
html[data-style="docs"] .sidebar-nav a {
  border-radius: 0;
  border-left: 2px solid transparent;
  padding-left: 10px;
}

html[data-style="docs"] .sidebar-nav a:hover,
html[data-style="docs"] .sidebar-nav a[aria-current="page"] {
  background: transparent;
  border-left-color: var(--accent);
  color: var(--link);
}

html[data-style="docs"] main,
html[data-style="docs"] .has-cover main {
  max-width: 980px;
  padding: 36px 48px 72px;
}

html[data-style="docs"] .notion-page-icon-overlap { margin-top: 0; margin-bottom: 12px; }
html[data-style="docs"] .notion-page-avatar { width: 42px; height: 42px; border-radius: 999px; border: 1px solid var(--border-strong); box-shadow: none; }

/* Signature Vercel 0-Gap Hairline Blueprint Grid */
html[data-style="docs"] .notion-gallery {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  border-top: 1px solid var(--border);
  border-left: 1px solid var(--border);
}

html[data-style="docs"] .gallery-card {
  border: 0;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  background: var(--background);
}

html[data-style="docs"] .gallery-card:hover {
  background: var(--card);
}

html[data-style="docs"] .notion-props {
  border: 1px solid var(--border);
  padding: 14px 18px;
  background: var(--card);
}

html[data-style="docs"] .row-list,
html[data-style="docs"] .table-wrap {
  border-radius: 0;
}

html[data-style="docs"] #tm-gallery:checked ~ .win-tabs label[for="tm-gallery"],
html[data-style="docs"] #tm-core:checked    ~ .win-tabs label[for="tm-core"] {
  color: var(--foreground);
  border-bottom-color: var(--accent);
}

/* ---- Responsive Breakpoints ---- */
@media (max-width: 1040px) {
  .notion-sidebar,
  html[data-style="vscode"] .vscode-activity { display: none; }
  .mobile-nav-bar { display: block; }
  .notion-cover-caption { padding: 12px 28px; }
  main { padding: 28px 28px 56px; }
  .has-cover main { padding-top: 0; }
  .site-footer { padding: 18px 28px 32px; }

  html[data-style="win7"] .notion-main-wrap,
  html[data-style="win7"] .site-header,
  html[data-style="macos"] .notion-main-wrap,
  html[data-style="macos"] .site-header {
    border-radius: 8px;
    border-left: 1px solid var(--border);
  }
  html[data-style="macos"] .notion-gallery,
  html[data-style="swiss"] .notion-gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  html[data-style="macos"] .notion-gallery .gallery-card:first-child,
  html[data-style="swiss"] .notion-gallery .gallery-card:first-child {
    grid-column: span 2;
  }
}

@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; gap: 20px; }
  .metrics-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .notion-gallery,
  .principles-list,
  .log-grid,
  .books-grid,
  .pager,
  html[data-style="macos"] .notion-gallery,
  html[data-style="swiss"] .notion-gallery,
  html[data-style="swiss"] .hero,
  html[data-style="swiss"] .row-list {
    grid-template-columns: 1fr;
  }
  html[data-style="macos"] .notion-gallery .gallery-card:first-child,
  html[data-style="swiss"] .notion-gallery .gallery-card:first-child {
    grid-column: span 1;
  }
  html[data-style="swiss"] .row-item:nth-child(odd) { border-right: 0; }
  .pager-card.next { text-align: left; }
}

@media (max-width: 640px) {
  .notion-topbar { padding: 5px 12px; gap: 6px; }
  .topbar-link,
  .notion-crumb-sep,
  .notion-crumb-current,
  .notion-cover-caption { display: none; }
  .mobile-nav-bar { padding: 4px 10px 8px; }
  .notion-page-icon-overlap { margin-top: 16px; }
  .notion-page-avatar { width: 64px; height: 64px; border-radius: 14px; }
  main { padding: 22px 16px 44px; }
  .has-cover main { padding-top: 0; }
  .site-footer { padding: 16px 16px 28px; }
  .notion-props { grid-template-columns: 98px minmax(0, 1fr); gap: 7px 10px; }
  .project-entry-meta { grid-template-columns: 1fr; gap: 3px; }
  .project-entry-meta dd { margin-bottom: 6px; }
  .metrics-grid { grid-template-columns: 1fr; }
  .row-item { flex-direction: column; gap: 4px; }
  .mobile-records,
  .mobile-records tbody,
  .mobile-records tr,
  .mobile-records td { display: block; width: auto; }
  .mobile-records thead {
    position: absolute; width: 1px; height: 1px; padding: 0;
    overflow: hidden; clip-path: inset(50%);
  }
  .mobile-records tr { padding: 12px; border-bottom: 1px solid var(--border); }
  .mobile-records td { border: 0 !important; padding: 3px 0; text-align: left; overflow-wrap: anywhere; }
  .mobile-records .mobile-label {
    display: inline; font-size: 0.74rem; font-weight: 600;
    color: var(--muted-foreground); margin-right: 0.35rem;
  }
  td > code { white-space: normal; }

  /* Mobile polish for all alternate OS/Workspace/Broadsheet layouts */
  html[data-style="win7"] body,
  html[data-style="win97"] body { padding: 8px 8px 54px; }
  html[data-style="arc"] body { padding: 8px; }
  html[data-style="vscode"] body { padding-bottom: 28px; }
  html[data-style="figma"] body { padding-bottom: 64px; }
  html[data-style="macos"] body { padding: 38px 10px 84px; }
  html[data-style="macos"] .mac-menu-link,
  html[data-style="macos"] .mac-status,
  html[data-style="macos"] .mac-menu-btn span,
  html[data-style="macos"] .mac-menu-btn kbd { display: none; }
  html[data-style="macos"] .os-dock-item { width: 38px; height: 38px; border-radius: 10px; }
  html[data-style="macos"] .os-dock-items { gap: 8px; }
  html[data-style="figma"] .os-dock-item span { display: none; }
  html[data-style="vscode"] main,
  html[data-style="vscode"] .has-cover main { padding: 18px 16px 36px; box-shadow: none; border-left: 0; }
  html[data-style="vscode"] main::before { display: none; }
  html[data-style="vscode"] .site-footer { padding: 14px 16px 28px; }
  html[data-style="html"] main,
  html[data-style="html"] .has-cover main { padding: 20px 16px 40px; }
  html[data-style="html"] .site-header { padding: 14px 16px 8px; }
  html[data-style="win7"] .has-cover main,
  html[data-style="win7"] main,
  html[data-style="win97"] .has-cover main,
  html[data-style="win97"] main,
  html[data-style="macos"] .has-cover main,
  html[data-style="macos"] main,
  html[data-style="terminal"] .has-cover main,
  html[data-style="terminal"] main,
  html[data-style="swiss"] .has-cover main,
  html[data-style="swiss"] main,
  html[data-style="linear"] .has-cover main,
  html[data-style="linear"] main,
  html[data-style="figma"] .has-cover main,
  html[data-style="figma"] main,
  html[data-style="obsidian"] .has-cover main,
  html[data-style="obsidian"] main,
  html[data-style="arc"] .has-cover main,
  html[data-style="arc"] main,
  html[data-style="notes"] .has-cover main,
  html[data-style="notes"] main,
  html[data-style="docs"] .has-cover main,
  html[data-style="docs"] main {
    padding: 18px 16px 36px;
  }
  html[data-style="win7"] .notion-page-icon-overlap,
  html[data-style="win97"] .notion-page-icon-overlap,
  html[data-style="macos"] .notion-page-icon-overlap,
  html[data-style="swiss"] .notion-page-icon-overlap,
  html[data-style="linear"] .notion-page-icon-overlap,
  html[data-style="figma"] .notion-page-icon-overlap,
  html[data-style="obsidian"] .notion-page-icon-overlap,
  html[data-style="arc"] .notion-page-icon-overlap,
  html[data-style="notes"] .notion-page-icon-overlap,
  html[data-style="docs"] .notion-page-icon-overlap {
    margin-top: 0;
  }
  html[data-style="swiss"] .notion-topbar,
  html[data-style="swiss"] .mobile-nav-bar,
  html[data-style="swiss"] .site-footer { padding-left: 16px; padding-right: 16px; }
  html[data-style="win7"] .win-controls,
  html[data-style="win97"] .win-controls,
  html[data-style="win7"] .os-tray,
  html[data-style="win97"] .os-tray,
  html[data-style="terminal"] .os-tray,
  html[data-style="vscode"] .os-tray { display: none; }
}
