:root {
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-subtle: #f7f8fb;
  --surface-strong: #eff1f6;
  --ink: #17181c;
  --muted: #6d7079;
  --faint: #9da1ac;
  --line: #e7e8ed;
  --line-strong: #d8dae2;
  --accent: #4b5cff;
  --accent-soft: #eef0ff;
  --accent-ink: #2635c8;
  --success: #16a46c;
  --warning: #e78a18;
  --danger: #e75252;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --shadow-sm: 0 1px 2px rgba(20, 23, 31, .06), 0 5px 16px rgba(20, 23, 31, .05);
  --shadow-device: 0 32px 70px rgba(16, 19, 31, .18), 0 6px 18px rgba(16, 19, 31, .16);
  --header-height: 66px;
  --mobile-tab-height: 0px;
  font-family: Pretendard, "Apple SD Gothic Neo", "Noto Sans KR", Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }

html, body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--bg);
  color: var(--ink);
}

button, input, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
a { color: inherit; text-decoration: none; }

svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.app-shell { height: 100%; }

.topbar {
  height: var(--header-height);
  display: grid;
  grid-template-columns: auto auto minmax(240px, 520px) auto;
  align-items: center;
  gap: 28px;
  padding: 0 22px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, .96);
  backdrop-filter: blur(16px);
  position: relative;
  z-index: 50;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: max-content;
}

.brand-mark {
  width: 31px;
  height: 31px;
  border: 2px solid var(--ink);
  border-radius: 10px;
  display: grid;
  place-items: center;
  position: relative;
  transform: rotate(-7deg);
}

.brand-mark::before,
.brand-mark::after {
  content: "";
  position: absolute;
  background: var(--ink);
  border-radius: 99px;
}

.brand-mark::before { width: 15px; height: 2px; transform: rotate(45deg); }
.brand-mark::after { width: 15px; height: 2px; transform: rotate(-45deg); }
.brand-mark__dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); position: relative; z-index: 1; }

.brand-word { font-size: 15px; font-weight: 850; letter-spacing: .075em; }

.topnav { display: flex; gap: 20px; align-items: center; }
.topnav a { font-size: 14px; color: #444750; font-weight: 650; transition: color .18s ease; }
.topnav a:hover { color: var(--ink); }

.searchbox {
  min-width: 0;
  height: 40px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0 11px;
  background: var(--surface-subtle);
  color: var(--faint);
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

.searchbox:focus-within {
  border-color: #aeb5ff;
  box-shadow: 0 0 0 4px rgba(75, 92, 255, .1);
  background: white;
}

.searchbox svg { width: 18px; height: 18px; flex: none; }
.searchbox input { min-width: 0; flex: 1; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 13px; }
.searchbox input::placeholder { color: var(--faint); }
.searchbox kbd { border: 1px solid var(--line-strong); background: white; color: var(--faint); border-radius: 6px; padding: 2px 6px; font-size: 10px; box-shadow: 0 1px 0 var(--line); }

.top-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; min-width: max-content; }
.ghost-button, .primary-button, .mobile-menu-button { border: 0; cursor: pointer; }
.ghost-button { background: transparent; padding: 9px 12px; font-size: 13px; font-weight: 700; }
.primary-button { background: var(--ink); color: white; border-radius: 10px; padding: 10px 15px; font-size: 13px; font-weight: 750; box-shadow: 0 1px 2px rgba(0,0,0,.13); }
.mobile-menu-button { display: none; background: transparent; width: 38px; height: 38px; place-items: center; }

.mobile-tabs { display: none; }

.workspace {
  height: calc(100dvh - var(--header-height) - var(--mobile-tab-height));
  display: grid;
  grid-template-columns: 104px minmax(510px, 1fr) minmax(410px, 38vw);
  overflow: hidden;
  background: var(--bg);
}

.panel { min-width: 0; min-height: 0; background: var(--surface); }
.panel + .panel { border-left: 1px solid var(--line); }

.panel-scroll {
  overflow-y: auto;
  overscroll-behavior-y: contain;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.panel-scroll::-webkit-scrollbar { display: none; width: 0; height: 0; }

/* App rail */
.app-rail {
  padding: 16px 12px 28px;
  display: block;
  background: #fbfbfd;
}

.creator-card { position: relative; display: grid; place-items: center; padding: 2px 0 14px; }
.creator-avatar {
  width: 52px;
  height: 52px;
  border-radius: 18px;
  border: 0;
  color: white;
  background: #17181c;
  font-size: 14px;
  font-weight: 850;
  letter-spacing: .03em;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(23, 24, 28, .15);
}
.creator-online { position: absolute; right: 11px; bottom: 12px; width: 12px; height: 12px; border-radius: 50%; background: #22bb7a; border: 2px solid #fbfbfd; }
.creator-tooltip, .app-tooltip {
  pointer-events: none;
  opacity: 0;
  transform: translateX(-6px);
  position: absolute;
  left: calc(100% + 10px);
  top: 50%;
  translate: 0 -50%;
  z-index: 80;
  background: #17181c;
  color: white;
  border-radius: 10px;
  padding: 9px 11px;
  box-shadow: 0 12px 30px rgba(0,0,0,.2);
  white-space: nowrap;
  transition: opacity .14s ease, transform .14s ease;
}
.creator-tooltip strong { display: block; font-size: 12px; }
.creator-tooltip span { display: block; margin-top: 3px; color: #b9bbc3; font-size: 10px; }
.creator-card:hover .creator-tooltip, .rail-app:hover .app-tooltip, .rail-app:focus-visible .app-tooltip { opacity: 1; transform: translateX(0); }

.rail-rule { width: 34px; height: 1px; background: var(--line-strong); margin: 0 auto 14px; }
.app-list { display: flex; flex-direction: column; align-items: center; gap: 9px; }

.rail-app {
  width: 64px;
  min-height: 70px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 18px;
  background: transparent;
  cursor: pointer;
  position: relative;
  transition: background .16s ease, transform .16s ease;
}
.rail-app:hover { background: #f0f1f5; }
.rail-app:active { transform: scale(.97); }
.rail-app::before {
  content: "";
  width: 3px;
  height: 0;
  border-radius: 0 3px 3px 0;
  position: absolute;
  left: -12px;
  background: var(--accent);
  transition: height .18s ease;
}
.rail-app.is-active { background: var(--accent-soft); }
.rail-app.is-active::before { height: 34px; }

.rail-app-icon {
  width: 48px;
  height: 48px;
  border-radius: 15px;
  display: grid;
  place-items: center;
  color: white;
  font-size: 14px;
  font-weight: 850;
  letter-spacing: -.02em;
  box-shadow: 0 5px 14px color-mix(in srgb, var(--app-color) 25%, transparent);
  background: linear-gradient(145deg, color-mix(in srgb, var(--app-color) 82%, white), var(--app-color));
}
.rail-app-status { position: absolute; right: 5px; bottom: 8px; width: 11px; height: 11px; border-radius: 50%; border: 2px solid #fbfbfd; background: var(--success); }
.rail-app-status.prototype { background: var(--warning); }
.rail-app-status.archived { background: var(--faint); }
.app-tooltip { top: 35px; translate: 0 -50%; text-align: left; }
.app-tooltip strong { display: block; font-size: 12px; }
.app-tooltip span { display: block; color: #b9bbc3; margin-top: 2px; font-size: 10px; }

.rail-loading { height: 54px; display: flex; align-items: center; justify-content: center; gap: 4px; opacity: 0; }
.rail-loading.is-visible { opacity: 1; }
.rail-loading span { width: 4px; height: 4px; border-radius: 50%; background: var(--faint); animation: dotPulse .9s infinite ease-in-out; }
.rail-loading span:nth-child(2) { animation-delay: .12s; }
.rail-loading span:nth-child(3) { animation-delay: .24s; }
@keyframes dotPulse { 0%, 100% { transform: translateY(0); opacity: .35; } 50% { transform: translateY(-3px); opacity: 1; } }

/* Demo */
.demo-panel { background: #fff; }
.demo-inner { width: min(100%, 900px); margin: 0 auto; padding: 34px clamp(24px, 4vw, 58px) 90px; }
.demo-heading-row { display: flex; align-items: flex-start; gap: 20px; justify-content: space-between; }
.app-title-block { min-width: 0; display: flex; gap: 14px; align-items: flex-start; }
.app-title-icon { width: 48px; height: 48px; border-radius: 15px; flex: none; display: grid; place-items: center; color: white; font-size: 14px; font-weight: 850; background: var(--accent); box-shadow: 0 8px 18px rgba(75, 92, 255, .2); }
.eyeline { margin: 0 0 8px; color: var(--muted); font-size: 10px; line-height: 1; letter-spacing: .13em; font-weight: 800; }
.app-title-block h1 { margin: 0; font-size: clamp(26px, 2.4vw, 36px); line-height: 1.08; letter-spacing: -.045em; }
.app-title-block p:last-child { margin: 7px 0 0; color: var(--muted); font-size: 14px; line-height: 1.55; }
.share-button { border: 1px solid var(--line); background: white; height: 39px; padding: 0 12px; border-radius: 10px; display: inline-flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 700; cursor: pointer; transition: background .18s, border-color .18s; }
.share-button:hover { border-color: var(--line-strong); background: var(--surface-subtle); }
.share-button svg { width: 16px; height: 16px; }

.demo-toolbar { margin: 26px 0 15px; display: flex; align-items: center; gap: 7px; }
.segmented-control { display: inline-flex; align-items: center; gap: 3px; padding: 4px; background: var(--surface-subtle); border: 1px solid var(--line); border-radius: 12px; }
.orientation-button, .tool-button { height: 34px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 0; background: transparent; border-radius: 8px; color: var(--muted); font-size: 11px; font-weight: 750; cursor: pointer; transition: background .16s, color .16s, box-shadow .16s; }
.orientation-button { padding: 0 10px; }
.orientation-button svg { width: 16px; height: 16px; }
.orientation-button.is-active { background: white; color: var(--ink); box-shadow: var(--shadow-sm); }
.toolbar-spacer { flex: 1; }
.tool-button { padding: 0 9px; border: 1px solid transparent; }
.tool-button:hover { background: var(--surface-subtle); color: var(--ink); }
.tool-button svg { width: 16px; height: 16px; }

.device-stage {
  min-height: 610px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: #f6f7fa;
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: 45px 25px 58px;
  transition: min-height .28s ease;
}
.device-stage.is-landscape { min-height: 485px; }
.stage-grid {
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(36, 39, 51, .035) 1px, transparent 1px), linear-gradient(90deg, rgba(36, 39, 51, .035) 1px, transparent 1px);
  background-size: 24px 24px;
  mask-image: radial-gradient(circle at center, black, transparent 75%);
}
.stage-glow { position: absolute; width: 430px; height: 430px; border-radius: 50%; background: color-mix(in srgb, var(--app-color, #4b5cff) 11%, transparent); filter: blur(30px); transition: background .28s ease; }

.device-shell {
  --device-w: 300px;
  --device-h: 545px;
  width: var(--device-w);
  height: var(--device-h);
  border: 7px solid #17181c;
  border-radius: 42px;
  background: #17181c;
  box-shadow: var(--shadow-device);
  position: relative;
  z-index: 3;
  transition: width .32s cubic-bezier(.2,.75,.2,1), height .32s cubic-bezier(.2,.75,.2,1), border-radius .32s ease;
}
.device-shell.landscape { --device-w: min(620px, calc(100% - 30px)); --device-h: 340px; border-radius: 34px; }
.device-hardware { pointer-events: none; position: absolute; top: 0; left: 0; right: 0; height: 28px; z-index: 8; }
.device-camera { position: absolute; width: 8px; height: 8px; background: #343640; border-radius: 50%; left: calc(50% - 35px); top: 9px; }
.device-speaker { position: absolute; width: 38px; height: 5px; background: #343640; border-radius: 99px; left: 50%; translate: -50% 0; top: 10px; }
.device-shell.landscape .device-hardware { width: 28px; height: auto; top: 0; bottom: 0; right: auto; }
.device-shell.landscape .device-camera { left: 9px; top: calc(50% - 35px); }
.device-shell.landscape .device-speaker { width: 5px; height: 38px; left: 10px; top: 50%; translate: 0 -50%; }
.device-screen { position: absolute; inset: 7px; border-radius: 31px; background: white; overflow-x: hidden; color: #17181c; scrollbar-width: none; }
.device-screen::-webkit-scrollbar { display: none; }
.device-shell.landscape .device-screen { border-radius: 24px; }
.device-home-indicator { position: absolute; z-index: 8; width: 96px; height: 4px; background: rgba(255,255,255,.8); border-radius: 99px; left: 50%; bottom: 8px; translate: -50% 0; mix-blend-mode: difference; pointer-events: none; }
.device-shell.landscape .device-home-indicator { width: 4px; height: 96px; left: auto; right: 8px; top: 50%; bottom: auto; translate: 0 -50%; }

.interaction-hint { position: absolute; bottom: 21px; z-index: 4; display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 11px; font-weight: 650; transition: opacity .25s; }
.interaction-hint.is-hidden { opacity: 0; pointer-events: none; }
.pulse-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--app-color, var(--accent)); box-shadow: 0 0 0 0 color-mix(in srgb, var(--app-color, var(--accent)) 35%, transparent); animation: pulse 1.7s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--app-color, var(--accent)) 35%, transparent); } 65% { box-shadow: 0 0 0 8px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }

.guide-section, .detail-section { padding-top: 42px; }
.section-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; }
.section-heading h2, .detail-section h2 { margin: 0; font-size: 23px; letter-spacing: -.035em; }
.guide-progress { color: var(--muted); font-size: 11px; font-weight: 700; }
.guide-list { margin-top: 18px; border-top: 1px solid var(--line); }
.guide-item { display: grid; grid-template-columns: 34px 1fr auto; gap: 12px; align-items: center; min-height: 72px; border-bottom: 1px solid var(--line); }
.guide-check { width: 24px; height: 24px; border: 1px solid var(--line-strong); background: white; border-radius: 8px; cursor: pointer; display: grid; place-items: center; transition: background .16s, border-color .16s; }
.guide-check svg { width: 14px; height: 14px; stroke-width: 2.3; opacity: 0; }
.guide-item.is-complete .guide-check { background: var(--ink); border-color: var(--ink); color: white; }
.guide-item.is-complete .guide-check svg { opacity: 1; }
.guide-copy strong { display: block; font-size: 13px; margin-bottom: 5px; }
.guide-copy span { display: block; color: var(--muted); font-size: 12px; line-height: 1.45; }
.guide-action { border: 0; background: transparent; color: var(--accent-ink); font-size: 11px; font-weight: 750; cursor: pointer; padding: 9px; }
.guide-action:hover { text-decoration: underline; }

.app-facts { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 0 24px; margin: 18px 0 0; border-top: 1px solid var(--line); }
.fact { min-height: 68px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 14px; }
.fact dt { color: var(--muted); font-size: 11px; }
.fact dd { margin: 0; font-size: 12px; font-weight: 720; text-align: right; }

/* Mock mobile apps */
.mock-app { min-height: 100%; background: #f8f9fc; font-family: inherit; }
.mock-statusbar { height: 31px; display: flex; justify-content: space-between; align-items: flex-end; padding: 0 17px 5px; color: #25262b; font-size: 9px; font-weight: 750; background: white; position: sticky; top: 0; z-index: 6; }
.mock-status-icons { display: flex; align-items: center; gap: 4px; }
.mock-signal { width: 12px; height: 7px; display: flex; gap: 1px; align-items: flex-end; }
.mock-signal i { width: 2px; background: currentColor; border-radius: 1px; }
.mock-signal i:nth-child(1) { height: 3px; }.mock-signal i:nth-child(2) { height: 5px; }.mock-signal i:nth-child(3) { height: 7px; }
.mock-battery { width: 16px; height: 8px; border: 1px solid currentColor; border-radius: 2px; position: relative; }
.mock-battery::before { content: ""; position: absolute; inset: 1px; width: 10px; border-radius: 1px; background: currentColor; }
.mock-battery::after { content: ""; width: 1px; height: 4px; border-radius: 0 1px 1px 0; background: currentColor; position: absolute; right: -3px; top: 1px; }
.mock-header { background: white; padding: 14px 17px 16px; display: flex; align-items: center; justify-content: space-between; }
.mock-header-title small { display: block; color: #858894; font-size: 9px; margin-bottom: 3px; }
.mock-header-title strong { font-size: 17px; letter-spacing: -.04em; }
.mock-avatar { width: 30px; height: 30px; border-radius: 11px; background: var(--mock-accent); color: white; display: grid; place-items: center; font-size: 9px; font-weight: 800; }
.mock-content { padding: 14px; }
.mock-banner { border-radius: 17px; padding: 16px; color: white; background: linear-gradient(135deg, color-mix(in srgb, var(--mock-accent) 75%, white), var(--mock-accent)); box-shadow: 0 12px 25px color-mix(in srgb, var(--mock-accent) 18%, transparent); }
.mock-banner small { display: block; font-size: 9px; opacity: .78; margin-bottom: 6px; }
.mock-banner strong { display: block; font-size: 17px; line-height: 1.25; letter-spacing: -.04em; }
.mock-banner-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-top: 18px; }
.mock-progress { flex: 1; height: 5px; background: rgba(255,255,255,.27); border-radius: 99px; overflow: hidden; }
.mock-progress span { display: block; width: 64%; height: 100%; background: white; border-radius: 99px; }
.mock-banner em { font-size: 10px; font-style: normal; font-weight: 750; }
.mock-section-title { margin: 20px 2px 10px; display: flex; justify-content: space-between; align-items: center; }
.mock-section-title strong { font-size: 12px; }
.mock-section-title button { border: 0; background: transparent; color: var(--mock-accent); font-size: 9px; font-weight: 750; cursor: pointer; }
.mock-task-list { display: flex; flex-direction: column; gap: 8px; }
.mock-task { width: 100%; margin: 0; appearance: none; -webkit-appearance: none; background: white; border: 1px solid #eceef3; border-radius: 13px; padding: 12px; display: grid; grid-template-columns: 21px 1fr auto; gap: 9px; align-items: center; color: inherit; font: inherit; line-height: normal; text-align: left; cursor: pointer; transition: transform .15s, border-color .15s; }
.mock-task:active { transform: scale(.985); }
.mock-task:focus-visible { outline: 2px solid var(--mock-accent); outline-offset: 2px; }
.mock-task-check { width: 19px; height: 19px; border: 1.5px solid #c7cbd4; border-radius: 7px; display: grid; place-items: center; color: white; }
.mock-task-check svg { width: 11px; height: 11px; opacity: 0; }
.mock-task.is-done .mock-task-check { background: var(--mock-accent); border-color: var(--mock-accent); }
.mock-task.is-done .mock-task-check svg { opacity: 1; }
.mock-task.is-done .mock-task-copy strong { text-decoration: line-through; color: #9c9faa; }
.mock-task-copy strong { display: block; font-size: 10px; margin-bottom: 3px; }
.mock-task-copy span { display: block; color: #9296a1; font-size: 8px; }
.mock-task-tag { color: var(--mock-accent); background: color-mix(in srgb, var(--mock-accent) 10%, white); border-radius: 6px; padding: 4px 6px; font-size: 7px; font-weight: 750; }
.mock-bottom-nav { position: sticky; bottom: 0; margin-top: 18px; height: 58px; border-top: 1px solid #eceef3; background: rgba(255,255,255,.95); display: grid; grid-template-columns: repeat(4,1fr); align-items: center; backdrop-filter: blur(10px); }
.mock-nav-item { border: 0; background: transparent; display: grid; justify-items: center; gap: 3px; color: #a0a3ad; font-size: 7px; cursor: pointer; }
.mock-nav-item svg { width: 17px; height: 17px; }
.mock-nav-item.is-active { color: var(--mock-accent); font-weight: 750; }
.mock-add-button { width: 44px; height: 44px; border-radius: 16px; border: 0; background: var(--mock-accent); color: white; display: grid; place-items: center; box-shadow: 0 10px 18px color-mix(in srgb, var(--mock-accent) 25%, transparent); cursor: pointer; }
.mock-add-button svg { width: 19px; height: 19px; }
.mock-add-row { display: flex; justify-content: center; margin: 15px 0 -10px; }
.mock-toast { position: sticky; bottom: 70px; margin: 0 auto; width: max-content; max-width: calc(100% - 28px); background: #17181c; color: white; border-radius: 10px; padding: 8px 10px; font-size: 8px; font-weight: 650; box-shadow: 0 8px 18px rgba(0,0,0,.18); animation: mockToast .22s ease; z-index: 9; }
@keyframes mockToast { from { transform: translateY(5px); opacity: 0; } }

.mock-app.landscape-layout .mock-statusbar { display: none; }
.mock-app.landscape-layout { display: grid; grid-template-columns: 142px 1fr; min-height: 100%; }
.mock-app.landscape-layout .mock-sidebar { display: flex; flex-direction: column; padding: 24px 12px 16px 22px; background: #15161a; color: white; }
.mock-app.landscape-layout .mock-sidebar strong { font-size: 16px; letter-spacing: -.04em; }
.mock-app.landscape-layout .mock-sidebar small { color: #8e929e; font-size: 8px; margin-top: 4px; }
.mock-app.landscape-layout .mock-sidebar-nav { margin-top: 28px; display: flex; flex-direction: column; gap: 7px; }
.mock-app.landscape-layout .mock-sidebar-nav button { border: 0; background: transparent; color: #aeb1bb; text-align: left; padding: 8px 9px; border-radius: 8px; font-size: 8px; cursor: pointer; }
.mock-app.landscape-layout .mock-sidebar-nav button.is-active { background: rgba(255,255,255,.1); color: white; }
.mock-app.landscape-layout .mock-main { min-width: 0; overflow-y: auto; background: #f8f9fc; }
.mock-app.landscape-layout .mock-header { padding: 18px 20px 12px; background: #f8f9fc; }
.mock-app.landscape-layout .mock-content { display: grid; grid-template-columns: 1.1fr .9fr; gap: 12px; padding: 10px 18px 20px; }
.mock-app.landscape-layout .mock-banner { grid-column: 1; }
.mock-app.landscape-layout .mock-secondary-card { grid-column: 2; grid-row: 1; }
.mock-secondary-card { border-radius: 17px; background: white; border: 1px solid #eceef3; padding: 14px; }
.mock-secondary-card small { color: #9296a1; font-size: 8px; }
.mock-secondary-card strong { display: block; font-size: 18px; margin-top: 8px; }
.mock-secondary-chart { height: 58px; display: flex; align-items: flex-end; gap: 5px; margin-top: 12px; }
.mock-secondary-chart i { flex: 1; background: color-mix(in srgb, var(--mock-accent) 16%, white); border-radius: 4px 4px 2px 2px; }
.mock-secondary-chart i:nth-child(1){height:28%}.mock-secondary-chart i:nth-child(2){height:48%}.mock-secondary-chart i:nth-child(3){height:37%}.mock-secondary-chart i:nth-child(4){height:72%;background:var(--mock-accent)}.mock-secondary-chart i:nth-child(5){height:54%}.mock-secondary-chart i:nth-child(6){height:83%}.mock-secondary-chart i:nth-child(7){height:67%}
.mock-app.landscape-layout .mock-tasks-wrap { grid-column: 1 / -1; }
.mock-sidebar { display: none; }

/* Story */
.story-panel {
  background: #fff;
  scroll-behavior: smooth;
}

.story-feed-shell {
  width: min(100%, 760px);
  margin: 0 auto;
  padding: 38px clamp(28px, 3vw, 52px) 120px;
}

.journal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}

.journal-header h2 {
  margin: 6px 0 0;
  font-size: clamp(28px, 2.5vw, 38px);
  line-height: 1.2;
  letter-spacing: -.05em;
}

.journal-header p:not(.eyeline) {
  max-width: 480px;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.72;
  word-break: keep-all;
}

.journal-header-actions {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 34px;
}

.journal-count {
  color: var(--faint);
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}

.journal-list-button {
  height: 34px;
  border: 1px solid var(--line);
  background: white;
  border-radius: 9px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 730;
  cursor: pointer;
  transition: color .16s, border-color .16s, background .16s;
}

.journal-list-button[hidden] { display: none; }
.journal-list-button:hover { color: var(--ink); border-color: var(--line-strong); background: var(--surface-subtle); }
.journal-list-button svg { width: 15px; height: 15px; }

.journal-author-bar {
  margin-top: 25px;
  display: grid;
  grid-template-columns: 39px 1fr auto;
  gap: 11px;
  align-items: center;
  padding: 16px 0 22px;
  border-bottom: 1px solid var(--line);
}

.author-avatar {
  width: 39px;
  height: 39px;
  border-radius: 14px;
  background: #22232a;
  color: white;
  display: grid;
  place-items: center;
  font-size: 10px;
  font-weight: 800;
}

.journal-author-bar strong { display: block; font-size: 12px; }
.journal-author-bar span { display: block; margin-top: 3px; color: var(--faint); font-size: 10px; }

.follow-button {
  border: 1px solid var(--line);
  background: white;
  border-radius: 9px;
  padding: 8px 11px;
  font-size: 10px;
  font-weight: 750;
  cursor: pointer;
}

.follow-button.is-following { background: var(--ink); border-color: var(--ink); color: white; }

.post-feed { position: relative; }

.post-card {
  position: relative;
  border-bottom: 1px solid var(--line);
}

.post-card::before {
  content: "";
  position: absolute;
  left: -18px;
  top: 24px;
  width: 3px;
  height: 0;
  border-radius: 999px;
  background: var(--app-color, var(--accent));
  opacity: 0;
  transition: height .28s ease, opacity .2s ease;
}

.post-card.is-current::before {
  height: 36px;
  opacity: 1;
}

.post-summary-button {
  width: 100%;
  border: 0;
  background: transparent;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 32px;
  gap: 12px;
  align-items: start;
  padding: 25px 0;
  text-align: left;
  cursor: pointer;
}

.post-summary-button:hover .post-summary-title { color: var(--accent-ink); }
.post-card.is-current .post-summary-title { color: var(--accent-ink); }
.post-summary-button:hover .post-open-icon { border-color: var(--line-strong); background: var(--surface-subtle); }

.post-index {
  padding-top: 3px;
  color: var(--faint);
  font-size: 10px;
  font-weight: 780;
  font-variant-numeric: tabular-nums;
  transition: color .2s;
}

.post-summary-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.post-kicker {
  color: var(--faint);
  font-size: 9px;
  font-weight: 760;
  letter-spacing: .02em;
}

.post-summary-title {
  display: block;
  margin-top: 8px;
  color: var(--ink);
  font-size: 20px;
  line-height: 1.42;
  letter-spacing: -.04em;
  word-break: keep-all;
  transition: color .16s, font-size .38s cubic-bezier(.2,.7,.2,1), line-height .38s;
}

.post-summary-excerpt {
  display: block;
  margin-top: 9px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.65;
  word-break: keep-all;
  transition: font-size .3s, margin .3s;
}

.post-summary-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 13px;
  margin-top: 11px;
  color: var(--faint);
  font-size: 9px;
}

.post-summary-meta span + span::before {
  content: "";
  display: inline-block;
  width: 2px;
  height: 2px;
  margin: 0 8px 3px 0;
  border-radius: 50%;
  background: var(--line-strong);
}

.post-open-icon {
  width: 30px;
  height: 30px;
  margin-top: 2px;
  border: 1px solid var(--line);
  border-radius: 9px;
  display: grid;
  place-items: center;
  color: var(--muted);
  transition: transform .42s cubic-bezier(.2,.7,.2,1), border-color .16s, background .16s, color .16s;
}

.post-open-icon svg { width: 14px; height: 14px; }

.post-card.is-open .post-summary-button { padding-top: 34px; padding-bottom: 22px; }
.post-card.is-open .post-index { color: var(--app-color, var(--accent)); }
.post-card.is-open .post-summary-title { font-size: clamp(27px, 2.25vw, 36px); line-height: 1.27; }
.post-card.is-open .post-summary-excerpt { margin-top: 13px; font-size: 14px; line-height: 1.72; }
.post-card.is-open .post-open-icon { transform: rotate(45deg); color: var(--accent-ink); border-color: #c7cbff; background: var(--accent-soft); }

.post-expander {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  transition: grid-template-rows .52s cubic-bezier(.22,.72,.2,1), opacity .3s ease;
}

.post-expander-inner {
  min-height: 0;
  overflow: hidden;
}

.post-card.is-open .post-expander {
  grid-template-rows: 1fr;
  opacity: 1;
}

.post-expanded-content {
  padding: 0 0 40px 50px;
}

.post-reading-meta {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 10px 0 16px;
  border-top: 1px solid var(--line);
}

.post-reading-meta > div { display: flex; align-items: center; gap: 14px; color: var(--faint); font-size: 9px; }
.post-reading-meta > div span + span::before { content: ""; display: inline-block; width: 2px; height: 2px; margin: 0 8px 3px 0; border-radius: 50%; background: var(--line-strong); }

.bookmark-button {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  background: white;
  border-radius: 10px;
  cursor: pointer;
  transition: background .16s, color .16s, border-color .16s;
}

.bookmark-button svg { width: 15px; height: 15px; }
.bookmark-button[aria-pressed="true"] { color: var(--accent); border-color: #bbc0ff; background: var(--accent-soft); }

.post-lead {
  margin: 7px 0 0;
  color: #454852;
  font-size: 16px;
  line-height: 1.82;
  font-weight: 520;
  letter-spacing: -.015em;
  word-break: keep-all;
}

.table-of-contents {
  margin: 32px 0 42px;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 17px 18px;
  background: var(--surface-subtle);
}

.toc-heading { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.toc-heading span { font-size: 12px; font-weight: 800; }
.toc-heading small { color: var(--faint); font-size: 9px; }
.table-of-contents ol { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 3px; }
.table-of-contents button { width: 100%; border: 0; background: transparent; border-radius: 8px; padding: 7px 9px; display: grid; grid-template-columns: 24px 1fr; gap: 4px; text-align: left; color: var(--muted); font-size: 11px; cursor: pointer; transition: background .15s, color .15s; }
.table-of-contents button:hover { background: white; color: var(--ink); }
.table-of-contents button.is-active { background: white; color: var(--accent-ink); box-shadow: 0 1px 4px rgba(20,23,31,.05); font-weight: 750; }
.table-of-contents .toc-num { color: var(--faint); font-variant-numeric: tabular-nums; }

.article-body { font-size: 15px; line-height: 1.95; color: #363840; word-break: keep-all; }
.article-section { scroll-margin-top: 24px; margin: 0 0 52px; }
.article-section h3 { margin: 0 0 17px; color: var(--ink); font-size: 24px; line-height: 1.35; letter-spacing: -.04em; }
.article-section p { margin: 0 0 18px; }
.article-section strong { color: var(--ink); }
.article-figure { margin: 27px 0; border-radius: 18px; min-height: 240px; background: #f4f5f8; border: 1px solid var(--line); overflow: hidden; position: relative; display: grid; place-items: center; }
.article-figure::before { content: ""; position: absolute; inset: 0; background: linear-gradient(135deg, color-mix(in srgb, var(--app-color) 8%, white), transparent); }
.figure-window { position: relative; z-index: 1; width: 75%; border: 1px solid #e0e2e8; background: white; border-radius: 13px; box-shadow: 0 18px 38px rgba(24,27,39,.1); overflow: hidden; transform: rotate(-1.5deg); }
.figure-window-bar { height: 26px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 5px; padding: 0 9px; }
.figure-window-bar i { width: 5px; height: 5px; border-radius: 50%; background: #d5d7de; }
.figure-window-body { padding: 18px; display: grid; grid-template-columns: 52px 1fr; gap: 13px; }
.figure-window-nav { border-radius: 8px; background: #f0f1f5; }
.figure-window-lines { display: grid; gap: 8px; }
.figure-window-lines i { height: 8px; border-radius: 4px; background: #eef0f4; }
.figure-window-lines i:nth-child(1) { width: 48%; background: color-mix(in srgb, var(--app-color) 55%, white); }
.figure-window-lines i:nth-child(2) { width: 88%; }
.figure-window-lines i:nth-child(3) { width: 73%; }
.figure-window-lines i:nth-child(4) { width: 91%; }
.figure-window-lines i:nth-child(5) { width: 61%; }
.article-caption { margin-top: 9px; color: var(--faint); font-size: 10px; text-align: center; }
.article-quote { margin: 27px 0; padding: 2px 0 2px 19px; border-left: 3px solid var(--app-color, var(--accent)); color: var(--ink); font-size: 18px; line-height: 1.65; font-weight: 690; letter-spacing: -.025em; }
.article-callout { margin: 24px 0; padding: 17px 18px; border-radius: 14px; background: var(--surface-subtle); border: 1px solid var(--line); }
.article-callout strong { display: block; font-size: 12px; margin-bottom: 7px; }
.article-callout p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.7; }
.article-tags { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 29px; }
.article-tag { border: 1px solid var(--line); border-radius: 999px; padding: 7px 10px; color: var(--muted); font-size: 10px; }

.orientation-note {
  margin: 25px 0;
  display: grid;
  grid-template-columns: 1fr 34px 1fr;
  gap: 10px;
  align-items: center;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-subtle);
}

.orientation-note > div { display: grid; justify-items: center; gap: 7px; text-align: center; }
.orientation-note > svg { width: 18px; height: 18px; justify-self: center; color: var(--faint); }
.orientation-note strong { font-size: 11px; }
.orientation-note small { color: var(--faint); font-size: 9px; }
.orientation-phone { display: block; border: 2px solid #383a43; background: white; box-shadow: 0 7px 16px rgba(20,23,31,.09); }
.orientation-phone.portrait-mini { width: 34px; height: 56px; border-radius: 9px; }
.orientation-phone.landscape-mini { width: 58px; height: 34px; border-radius: 9px; }

.comments { border-top: 1px solid var(--line); padding-top: 37px; margin-top: 64px; }
.comments-heading { display: flex; justify-content: space-between; align-items: center; }
.comments-heading h3 { margin: 0; font-size: 19px; letter-spacing: -.03em; }
.comments-heading h3 span { color: var(--accent); }
.comments-preview-label { color: var(--faint); font-size: 9px; }
.comment-form { display: grid; grid-template-columns: 36px 1fr; gap: 11px; margin-top: 18px; }
.comment-avatar { width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; background: #eceef3; color: #62656f; font-size: 10px; font-weight: 780; }
.comment-input-wrap { border: 1px solid var(--line); border-radius: 13px; overflow: hidden; transition: border-color .16s, box-shadow .16s; }
.comment-input-wrap:focus-within { border-color: #aeb5ff; box-shadow: 0 0 0 4px rgba(75, 92, 255, .08); }
.comment-input-wrap textarea { width: 100%; min-height: 82px; resize: vertical; border: 0; outline: 0; padding: 13px 14px 7px; color: var(--ink); font-size: 12px; line-height: 1.6; }
.comment-input-wrap textarea::placeholder { color: var(--faint); }
.comment-form-bottom { min-height: 43px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 5px 7px 7px 14px; }
.comment-form-bottom span { color: var(--faint); font-size: 9px; }
.comment-form-bottom button { border: 0; background: var(--ink); color: white; padding: 8px 11px; border-radius: 8px; font-size: 10px; font-weight: 730; cursor: pointer; }
.comment-list { margin-top: 25px; }
.comment { display: grid; grid-template-columns: 36px 1fr; gap: 11px; padding: 20px 0; border-bottom: 1px solid var(--line); }
.comment-body { min-width: 0; }
.comment-meta { display: flex; align-items: center; gap: 7px; }
.comment-meta strong { font-size: 11px; }
.creator-badge { color: var(--accent-ink); background: var(--accent-soft); border-radius: 5px; padding: 3px 5px; font-size: 8px; font-weight: 750; }
.comment-time { color: var(--faint); font-size: 9px; }
.comment p { margin: 8px 0 9px; color: #4a4c55; font-size: 12px; line-height: 1.65; }
.comment-actions { display: flex; gap: 12px; }
.comment-actions button { border: 0; background: transparent; padding: 0; color: var(--faint); font-size: 9px; cursor: pointer; }

.post-continuation {
  margin: 44px 0 4px;
  padding: 22px 18px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 5px 14px;
}

.post-continuation span { grid-column: 1; color: var(--faint); font-size: 9px; }
.post-continuation strong { grid-column: 1; color: var(--ink); font-size: 12px; line-height: 1.5; word-break: keep-all; }
.post-continuation svg { grid-column: 2; grid-row: 1 / 3; width: 18px; height: 18px; color: var(--faint); animation: continuation-bob 1.8s ease-in-out infinite; }
.post-continuation.is-last svg { animation-direction: reverse; }

@keyframes continuation-bob {
  0%, 100% { transform: translateY(-2px); }
  50% { transform: translateY(3px); }
}

.toast { position: fixed; z-index: 100; left: 50%; bottom: 24px; transform: translate(-50%, 12px); background: #17181c; color: white; border-radius: 11px; padding: 10px 14px; font-size: 11px; font-weight: 650; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; box-shadow: 0 12px 34px rgba(0,0,0,.24); }
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

/* Search filtering */
.rail-app.is-filtered-out { display: none; }

/* Focus */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Responsive */
@media (max-width: 1260px) {
  .topbar { grid-template-columns: auto minmax(210px, 1fr) auto; gap: 18px; }
  .topnav { display: none; }
  .workspace { grid-template-columns: 92px minmax(470px, 1fr) minmax(360px, 38vw); }
  .app-rail { padding-inline: 8px; }
  .demo-inner { padding-inline: 28px; }
  .story-inner { padding-inline: 32px; }
  .device-shell.landscape { --device-w: min(560px, calc(100% - 20px)); --device-h: 315px; }
}

@media (max-width: 980px) {
  :root { --mobile-tab-height: 48px; }
  .topbar { grid-template-columns: auto 1fr auto; padding: 0 16px; }
  .brand-word { display: none; }
  .searchbox { justify-self: stretch; }
  .ghost-button, .primary-button { display: none; }
  .mobile-menu-button { display: grid; }
  .mobile-tabs { height: var(--mobile-tab-height); display: grid; grid-template-columns: repeat(3, 1fr); border-bottom: 1px solid var(--line); background: white; }
  .mobile-tabs button { border: 0; background: white; color: var(--muted); border-bottom: 2px solid transparent; font-size: 12px; font-weight: 700; cursor: pointer; }
  .mobile-tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent); }
  .workspace { display: block; position: relative; }
  .panel { display: none; position: absolute; inset: 0; border-left: 0 !important; }
  .panel.is-mobile-active { display: block; }
  .app-rail { padding: 20px; }
  .creator-card { justify-content: start; grid-template-columns: 56px 1fr; place-items: center start; }
  .creator-avatar { grid-row: 1 / 3; }
  .creator-card::after { content: "Studio Twelve\A24개의 앱"; white-space: pre; margin-left: 15px; font-size: 14px; font-weight: 780; line-height: 1.55; }
  .creator-online { left: 43px; right: auto; bottom: 13px; }
  .creator-tooltip { display: none; }
  .rail-rule { width: 100%; margin: 5px 0 16px; }
  .app-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(86px, 1fr)); gap: 13px; align-items: start; }
  .rail-app { width: 100%; min-height: 93px; background: var(--surface-subtle); }
  .rail-app::before { left: 0; top: 50%; translate: 0 -50%; }
  .rail-app-icon { width: 54px; height: 54px; }
  .app-tooltip { opacity: 1; transform: none; translate: -50% 0; left: 50%; top: auto; bottom: 4px; background: transparent; color: var(--ink); box-shadow: none; padding: 0; max-width: calc(100% - 8px); }
  .app-tooltip strong { overflow: hidden; text-overflow: ellipsis; }
  .app-tooltip span { display: none; }
  .rail-app-status { right: calc(50% - 29px); bottom: 31px; }
  .demo-inner, .story-inner { width: 100%; }
  .device-stage { min-height: 590px; }
}

@media (max-width: 640px) {
  .topbar { gap: 12px; }
  .searchbox { height: 38px; }
  .searchbox kbd { display: none; }
  .demo-inner { padding: 24px 16px 70px; }
  .story-inner { padding: 28px 19px 80px; }
  .app-title-icon { width: 42px; height: 42px; border-radius: 13px; }
  .share-button span, .tool-button span { display: none; }
  .share-button { width: 39px; padding: 0; justify-content: center; }
  .tool-button { width: 34px; padding: 0; }
  .device-stage { border-radius: 20px; min-height: 560px; padding-inline: 8px; }
  .device-shell { --device-w: min(292px, calc(100% - 12px)); --device-h: 530px; }
  .device-shell.landscape { --device-w: calc(100% - 6px); --device-h: 260px; border-radius: 25px; }
  .device-stage.is-landscape { min-height: 370px; }
  .mock-app.landscape-layout { grid-template-columns: 96px 1fr; }
  .mock-app.landscape-layout .mock-sidebar { padding-left: 15px; }
  .app-facts { grid-template-columns: 1fr; }
  .story-header h2 { font-size: 30px; }
  .article-body { font-size: 14px; }
  .comment-form-bottom span { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; transition-duration: .01ms !important; }
}

/* Responsive refinements for the inline journal feed */
@media (max-width: 1260px) {
  .story-feed-shell { padding-inline: 30px; }
  .post-card::before { left: -14px; }
}

@media (max-width: 980px) {
  .story-feed-shell { width: 100%; }
}

@media (max-width: 640px) {
  .story-feed-shell { padding: 26px 18px 82px; }
  .journal-header { gap: 14px; }
  .journal-header h2 { font-size: 30px; }
  .journal-header p:not(.eyeline) { font-size: 12px; }
  .journal-header-actions { flex-direction: column; align-items: flex-end; gap: 7px; }
  .journal-author-bar { margin-top: 20px; }
  .post-card::before { left: -10px; }
  .post-summary-button { grid-template-columns: 27px minmax(0, 1fr) 30px; gap: 9px; padding: 22px 0; }
  .post-summary-title { font-size: 18px; }
  .post-summary-excerpt { font-size: 11px; }
  .post-card.is-open .post-summary-title { font-size: 27px; }
  .post-card.is-open .post-summary-excerpt { font-size: 13px; }
  .post-expanded-content { padding: 0 0 38px 36px; }
  .post-lead { font-size: 14px; }
  .table-of-contents { margin-block: 26px 34px; padding: 15px 14px; }
  .article-section { margin-bottom: 42px; }
  .article-section h3 { font-size: 21px; }
  .article-figure { min-height: 190px; }
  .orientation-note { padding: 16px 12px; grid-template-columns: 1fr 24px 1fr; }
  .comments { margin-top: 48px; }
}

/* --------------------------------------------------------------------------
   V3 — mobile app strip, left utility menu, and single-open journal
   -------------------------------------------------------------------------- */
.mobile-appbar,
.mobile-menu-backdrop,
.mobile-utility-drawer,
.mobile-demo-switch {
  display: none;
}
.mobile-connect-button { display: none; }

/* When one article is open, every other row becomes a compact article index. */
.post-feed.has-open-post .post-card:not(.is-open) .post-summary-button {
  grid-template-columns: 38px minmax(0, 1fr) 28px;
  align-items: center;
  padding: 15px 0;
}
.post-feed.has-open-post .post-card:not(.is-open) .post-index { padding-top: 0; }
.post-feed.has-open-post .post-card:not(.is-open) .post-kicker,
.post-feed.has-open-post .post-card:not(.is-open) .post-summary-excerpt,
.post-feed.has-open-post .post-card:not(.is-open) .post-summary-meta {
  display: none;
}
.post-feed.has-open-post .post-card:not(.is-open) .post-summary-title {
  margin-top: 0;
  font-size: 14px;
  line-height: 1.45;
  font-weight: 690;
  letter-spacing: -.025em;
}
.post-feed.has-open-post .post-card:not(.is-open) .post-open-icon {
  width: 26px;
  height: 26px;
  margin-top: 0;
  border-color: transparent;
}
.post-feed.has-open-post .post-card:not(.is-open):hover .post-open-icon {
  border-color: var(--line);
}

@media (max-width: 980px) {
  :root {
    --mobile-appbar-height: 82px;
    --header-height: 0px;
    --mobile-tab-height: 0px;
  }

  html,
  body {
    height: auto;
    min-height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior-y: auto;
  }

  body.mobile-menu-is-open { overflow: hidden; }
  .app-shell { height: auto; min-height: 100dvh; }
  .topbar,
  .mobile-tabs { display: none !important; }

  .mobile-appbar {
    min-height: calc(var(--mobile-appbar-height) + env(safe-area-inset-top));
    padding-top: env(safe-area-inset-top);
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr);
    position: sticky;
    top: 0;
    z-index: 180;
    background: rgba(255, 255, 255, .97);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 5px 18px rgba(20, 23, 31, .04);
    backdrop-filter: blur(18px);
  }

  .mobile-overflow-button {
    width: 48px;
    min-height: var(--mobile-appbar-height);
    padding: 0;
    border: 0;
    border-right: 1px solid var(--line);
    background: transparent;
    display: grid;
    place-items: center;
    cursor: pointer;
    color: var(--ink);
  }
  .mobile-overflow-button svg { width: 22px; height: 22px; fill: currentColor; stroke: none; }
  .mobile-overflow-button:active { background: var(--surface-subtle); }

  .mobile-app-strip {
    min-width: 0;
    min-height: var(--mobile-appbar-height);
    display: flex;
    align-items: stretch;
    gap: 3px;
    padding: 5px 8px 4px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x proximity;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }
  .mobile-app-strip::-webkit-scrollbar,
  .mobile-app-list::-webkit-scrollbar { display: none; width: 0; height: 0; }

  .mobile-app-list {
    display: flex;
    align-items: stretch;
    gap: 3px;
  }

  .mobile-creator-chip,
  .mobile-app-chip {
    flex: 0 0 62px;
    min-width: 62px;
    height: 72px;
    padding: 5px 4px 3px;
    border: 0;
    border-radius: 13px;
    background: transparent;
    display: grid;
    grid-template-rows: 44px 16px;
    justify-items: center;
    align-items: center;
    gap: 1px;
    scroll-snap-align: center;
    cursor: pointer;
    position: relative;
    color: var(--muted);
    transition: background .16s, color .16s, transform .16s;
  }
  .mobile-creator-chip:active,
  .mobile-app-chip:active { transform: scale(.96); }
  .mobile-creator-chip > span:last-child,
  .mobile-app-chip > span:last-child {
    display: block;
    width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: center;
    font-size: 9px;
    line-height: 1;
    font-weight: 720;
  }

  .mobile-chip-icon {
    width: 40px;
    height: 40px;
    border-radius: 13px;
    display: grid;
    place-items: center;
    color: white;
    font-size: 11px;
    font-weight: 850;
    letter-spacing: -.02em;
    background: var(--chip-color, var(--ink));
    box-shadow: 0 5px 12px color-mix(in srgb, var(--chip-color, var(--ink)) 22%, transparent);
  }
  .mobile-creator-icon { background: #17181c; }
  .mobile-creator-chip::after,
  .mobile-app-chip::after {
    content: "";
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: 0;
    height: 3px;
    border-radius: 4px 4px 0 0;
    background: transparent;
  }
  .mobile-app-chip.is-active {
    background: var(--accent-soft);
    color: var(--accent-ink);
  }
  .mobile-app-chip.is-active::after { background: var(--chip-color, var(--accent)); }
  .mobile-app-chip.is-filtered-out { display: none; }

  .mobile-menu-backdrop {
    position: fixed;
    inset: 0;
    z-index: 240;
    display: block;
    background: rgba(18, 20, 27, .38);
    opacity: 0;
    pointer-events: none;
    transition: opacity .22s ease;
    backdrop-filter: blur(2px);
  }
  .mobile-menu-backdrop.is-open {
    opacity: 1;
    pointer-events: auto;
  }

  .mobile-utility-drawer {
    width: min(342px, 88vw);
    height: 100dvh;
    padding: calc(18px + env(safe-area-inset-top)) 17px calc(18px + env(safe-area-inset-bottom));
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 250;
    display: flex;
    flex-direction: column;
    background: white;
    box-shadow: 22px 0 52px rgba(18, 20, 27, .18);
    transform: translateX(-104%);
    visibility: hidden;
    transition: transform .28s cubic-bezier(.22, .72, .2, 1), visibility 0s linear .28s;
  }
  .mobile-utility-drawer.is-open {
    transform: translateX(0);
    visibility: visible;
    transition-delay: 0s;
  }

  .mobile-drawer-head {
    min-height: 45px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
  }
  .mobile-drawer-brand { display: flex; align-items: center; gap: 10px; }
  .mobile-drawer-brand .brand-mark { width: 29px; height: 29px; border-radius: 9px; }
  .mobile-drawer-brand strong { font-size: 15px; letter-spacing: -.025em; }
  .mobile-drawer-close {
    width: 39px;
    height: 39px;
    border: 0;
    border-radius: 11px;
    display: grid;
    place-items: center;
    background: var(--surface-subtle);
    cursor: pointer;
  }
  .mobile-drawer-close svg { width: 18px; height: 18px; }

  .mobile-account-card {
    margin-top: 19px;
    min-height: 82px;
    padding: 15px;
    border: 1px solid var(--line);
    border-radius: 17px;
    background: var(--surface-subtle);
  }
  .mobile-account-card__row { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 11px; align-items: center; }
  .mobile-account-avatar {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    color: white;
    background: var(--ink);
    font-size: 12px;
    font-weight: 830;
  }
  .mobile-account-copy { min-width: 0; }
  .mobile-account-copy strong { display: block; font-size: 13px; }
  .mobile-account-copy span { display: block; margin-top: 4px; color: var(--muted); font-size: 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .mobile-account-card__guest strong { display: block; font-size: 15px; letter-spacing: -.03em; }
  .mobile-account-card__guest p { margin: 6px 0 0; color: var(--muted); font-size: 11px; line-height: 1.55; word-break: keep-all; }

  .mobile-menu-search {
    height: 44px;
    margin-top: 13px;
    padding: 0 13px;
    border: 1px solid var(--line);
    border-radius: 13px;
    display: flex;
    align-items: center;
    gap: 9px;
    background: white;
  }
  .mobile-menu-search:focus-within { border-color: #aeb5ff; box-shadow: 0 0 0 4px rgba(75, 92, 255, .08); }
  .mobile-menu-search svg { width: 17px; height: 17px; color: var(--muted); }
  .mobile-menu-search input { min-width: 0; flex: 1; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 12px; }
  .mobile-menu-search input::placeholder { color: var(--faint); }

  .mobile-menu-nav {
    min-height: 0;
    margin-top: 15px;
    padding-right: 2px;
    flex: 1;
    overflow-y: auto;
    scrollbar-width: none;
  }
  .mobile-menu-nav::-webkit-scrollbar { display: none; }
  .mobile-menu-group { padding: 5px 0 11px; }
  .mobile-menu-group + .mobile-menu-group { border-top: 1px solid var(--line); padding-top: 11px; }
  .mobile-menu-group-label { display: block; padding: 4px 9px 7px; color: var(--faint); font-size: 9px; font-weight: 760; letter-spacing: .04em; }
  .mobile-menu-item {
    width: 100%;
    min-height: 46px;
    padding: 0 9px;
    border: 0;
    border-radius: 11px;
    display: grid;
    grid-template-columns: 25px 1fr 18px;
    align-items: center;
    gap: 9px;
    background: transparent;
    color: var(--ink);
    text-align: left;
    cursor: pointer;
  }
  .mobile-menu-item:hover,
  .mobile-menu-item:active { background: var(--surface-subtle); }
  .mobile-menu-item > svg:first-child { width: 18px; height: 18px; color: var(--muted); }
  .mobile-menu-item > span { font-size: 12px; font-weight: 670; }
  .mobile-menu-item > svg:last-child { width: 15px; height: 15px; color: var(--faint); }
  .mobile-menu-item.is-primary { color: white; background: var(--ink); }
  .mobile-menu-item.is-primary > svg { color: white; }
  .mobile-menu-item.is-danger { color: var(--danger); }
  .mobile-menu-item.is-danger > svg:first-child { color: var(--danger); }
  .mobile-menu-foot {
    padding-top: 13px;
    border-top: 1px solid var(--line);
    display: flex;
    justify-content: space-between;
    color: var(--faint);
    font-size: 9px;
  }

  .workspace {
    height: auto;
    min-height: 0;
    display: block;
    overflow: visible;
    position: static;
  }
  .app-rail { display: none !important; }
  .demo-panel,
  .story-panel {
    display: block !important;
    position: static !important;
    inset: auto !important;
    min-height: 0;
    overflow: visible !important;
    border-left: 0 !important;
  }
  .demo-panel { border-bottom: 10px solid var(--surface-subtle); }
  .panel.is-mobile-active { display: block; }

  .demo-inner {
    width: 100%;
    padding: 23px 16px 46px;
  }
  .demo-heading-row { align-items: flex-start; }
  .app-title-block { align-items: center; }
  .app-title-block h1 { font-size: clamp(27px, 8vw, 34px); }
  .app-title-block > div:last-child > p:last-child { font-size: 12px; }

  .mobile-demo-switch {
    height: 45px;
    margin: 22px 0 15px;
    padding: 3px;
    border: 1px solid var(--line);
    border-radius: 13px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    background: var(--surface-subtle);
  }
  .mobile-demo-switch button {
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--muted);
    font-size: 12px;
    font-weight: 750;
    cursor: pointer;
  }
  .mobile-demo-switch button[aria-selected="true"] {
    background: white;
    color: var(--ink);
    box-shadow: 0 1px 5px rgba(20, 23, 31, .09);
  }
  .demo-panel[data-mobile-view="guide"] .mobile-app-view { display: none !important; }
  .demo-panel[data-mobile-view="app"] .mobile-guide-view { display: none !important; }
  .demo-panel[data-mobile-view="guide"] .mobile-guide-view { display: block; }
  .demo-panel[data-mobile-view="app"] .mobile-app-view.demo-toolbar { display: flex; }
  .demo-panel[data-mobile-view="app"] .mobile-app-view.device-stage { display: grid; }

  .demo-toolbar { margin-top: 0; }
  .device-stage { min-height: 555px; margin-top: 12px; }
  .guide-section { margin-top: 2px; }
  .detail-section { display: none; }

  .story-feed-shell {
    width: 100%;
    padding: 35px 18px calc(86px + env(safe-area-inset-bottom));
  }
  .journal-header h2 { font-size: 30px; }
  .journal-author-bar { margin-top: 20px; }
  .post-feed.has-open-post .post-card:not(.is-open) .post-summary-button {
    grid-template-columns: 29px minmax(0, 1fr) 24px;
    gap: 8px;
    padding: 14px 0;
  }
  .post-feed.has-open-post .post-card:not(.is-open) .post-summary-title {
    font-size: 14px;
  }
  .post-feed.has-open-post .post-card:not(.is-open) .post-open-icon {
    width: 23px;
    height: 23px;
  }
  .post-card.is-open .post-summary-button { padding-top: 27px; }
  .post-card.is-open .post-summary-title { font-size: 27px; }
  .post-expanded-content { padding-left: 36px; }
}

@media (max-width: 430px) {
  .mobile-appbar { grid-template-columns: 45px minmax(0, 1fr); }
  .mobile-overflow-button { width: 45px; }
  .mobile-creator-chip,
  .mobile-app-chip { flex-basis: 59px; min-width: 59px; }
  .mobile-chip-icon { width: 38px; height: 38px; border-radius: 12px; }
  .device-shell { --device-w: min(286px, calc(100% - 8px)); --device-h: 518px; }
  .device-shell.landscape { --device-w: calc(100% - 2px); --device-h: 244px; }
  .device-stage { min-height: 545px; }
  .device-stage.is-landscape { min-height: 350px; }
}

/* APPSTAGE integrated v5: API connection states and discovery controls */
.api-mode-banner {
  position: fixed;
  top: var(--header-height);
  left: 50%;
  translate: -50% 0;
  z-index: 120;
  max-width: min(760px, calc(100vw - 28px));
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 13px;
  border: 1px solid #f0c979;
  border-radius: 0 0 12px 12px;
  background: #fff7df;
  color: #6d4b05;
  box-shadow: var(--shadow-sm);
  font-size: 12px;
  font-weight: 680;
}
.api-mode-banner[data-mode="error"] { border-color: #efb0b0; background: #fff0f0; color: #9f3030; }
.api-mode-banner[data-mode="loading"] { border-color: var(--line); background: white; color: var(--muted); }
.api-mode-banner[hidden] { display: none; }
.api-mode-banner button { border: 0; border-radius: 8px; background: #1b1c22; color: white; padding: 6px 9px; cursor: pointer; font-size: 11px; font-weight: 800; white-space: nowrap; }

.discovery-controls { min-width: 0; display: grid; grid-template-columns: minmax(170px, 1fr) 118px 106px; gap: 8px; }
.category-filter { min-width: 0; display: flex; }
.category-filter select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface-subtle);
  color: #454850;
  outline: none;
  padding: 0 30px 0 10px;
  font-size: 12px;
  font-weight: 700;
}
.category-filter select:focus { border-color: #aeb5ff; box-shadow: 0 0 0 4px rgba(75, 92, 255, .1); background: white; }

.rail-pagination {
  width: 72px;
  margin: 13px auto 0;
  display: grid;
  grid-template-columns: 22px 1fr 22px;
  align-items: center;
  gap: 2px;
  color: var(--muted);
}
.rail-pagination button,
.mobile-pagination button {
  border: 1px solid var(--line);
  background: white;
  border-radius: 8px;
  cursor: pointer;
  height: 25px;
  font-size: 17px;
  line-height: 1;
}
.rail-pagination button:disabled,
.mobile-pagination button:disabled { opacity: .35; cursor: default; }
.rail-pagination span { text-align: center; font-size: 9px; font-weight: 800; }
.app-list-state { width: 76px; margin: 12px auto 0; text-align: center; color: var(--muted); font-size: 9px; line-height: 1.45; }
.app-list-state strong, .app-list-state span { display: block; }
.app-list-state strong { color: var(--ink); font-size: 10px; margin-bottom: 3px; }
.app-list-state button { margin-top: 6px; border: 1px solid var(--line); background: white; border-radius: 7px; padding: 5px 7px; font-size: 9px; cursor: pointer; }
.state-spinner { width: 17px; height: 17px; margin: 0 auto 6px; border: 2px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: apiSpin .8s linear infinite; }
@keyframes apiSpin { to { transform: rotate(360deg); } }

.detail-state {
  position: absolute;
  inset: 0;
  z-index: 25;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(255,255,255,.93);
  backdrop-filter: blur(5px);
}
.detail-state[hidden] { display: none; }
.demo-inner { position: relative; }
.detail-state-card { max-width: 390px; text-align: center; padding: 28px; border: 1px solid var(--line); border-radius: 20px; background: white; box-shadow: var(--shadow-sm); }
.detail-state-card strong { display: block; font-size: 18px; }
.detail-state-card p { margin: 9px 0 17px; color: var(--muted); font-size: 13px; line-height: 1.65; }
.detail-state-card button { border: 0; border-radius: 10px; background: var(--ink); color: white; padding: 10px 14px; font-size: 12px; font-weight: 800; cursor: pointer; }

.author-api-link { margin-left: auto; color: var(--accent-ink); font-size: 11px; font-weight: 800; white-space: nowrap; }
.story-empty-state { padding: 42px 22px; text-align: center; border-top: 1px solid var(--line); color: var(--muted); }
.story-empty-state strong { display: block; color: var(--ink); margin-bottom: 6px; }
.story-empty-state p { margin: 0; font-size: 13px; }

.mobile-api-filters,
.mobile-pagination { display: none; }

@media (max-width: 1260px) {
  .topbar { gap: 16px; grid-template-columns: auto auto minmax(220px, 1fr) auto; }
  .discovery-controls { grid-template-columns: minmax(150px, 1fr) 104px 96px; }
  .topnav a:nth-child(2) { display: none; }
}

@media (max-width: 980px) {
  .api-mode-banner { top: calc(var(--mobile-appbar-height) + env(safe-area-inset-top)); border-radius: 0 0 12px 12px; }
  .mobile-api-filters { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 10px 20px 0; }
  .mobile-api-filters label { display: grid; gap: 6px; color: var(--muted); font-size: 11px; font-weight: 750; }
  .mobile-api-filters select { width: 100%; height: 38px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface-subtle); color: #454850; padding: 0 10px; font-size: 12px; font-weight: 700; }
  .mobile-pagination { display: grid; grid-template-columns: 34px 1fr 34px; align-items: center; gap: 8px; margin: 10px 20px 0; }
  .mobile-pagination span { text-align: center; font-size: 11px; font-weight: 800; color: var(--muted); }
  .rail-pagination { display: none; }
  .author-api-link { margin-left: auto; }
}

@media (max-width: 640px) {
  .api-mode-banner { width: calc(100vw - 18px); max-width: none; padding: 8px 10px; font-size: 10px; }
  .api-mode-banner span { flex: 1; }
  .author-api-link { font-size: 10px; }
}


/* Final integrated v5 alignment fixes */
.topbar { grid-template-columns: auto auto minmax(410px, 1fr) auto; gap: 20px; }
.primary-button { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.mobile-pagination button { color: var(--ink); }
.api-mode-banner[data-mode="offline"] { border-color: #f0c979; background: #fff7df; color: #6d4b05; }
@media (max-width: 1260px) {
  .topbar { grid-template-columns: auto minmax(390px, 1fr) auto; gap: 14px; }
  .topnav { display: none; }
  .discovery-controls { grid-template-columns: minmax(170px, 1fr) 112px 100px; }
}
@media (max-width: 980px) {
  .topbar { display: none !important; }
  .api-mode-banner { left: 9px; right: 9px; translate: 0 0; width: auto; max-width: none; }
  .mobile-api-filters { display: grid; }
}
@media (max-width: 640px) {
  .mobile-api-filters { grid-template-columns: 1fr 1fr; margin-inline: 16px; }
  .journal-author-bar { flex-wrap: wrap; }
  .author-api-link { order: 3; margin-left: 54px; }
}

/* Integrated v5 final layout alignment */
.discovery-controls { grid-template-columns: minmax(190px, 1fr) 118px 106px; }
.journal-author-bar { grid-template-columns: 39px minmax(0, 1fr) auto auto; }
.author-api-link { margin-left: 0; }
.detail-state[data-state="empty"] .detail-state-card,
.detail-state[data-state="not-found"] .detail-state-card,
.detail-state[data-state="error"] .detail-state-card { border-color: var(--line-strong); }
@media (max-width: 1260px) {
  .discovery-controls { grid-template-columns: minmax(150px, 1fr) 105px 94px; }
}
@media (max-width: 980px) {
  .journal-author-bar { grid-template-columns: 39px minmax(0, 1fr) auto auto; }
  .mobile-category-filter + .mobile-category-filter { margin-top: 8px; }
}
@media (max-width: 430px) {
  .journal-author-bar { grid-template-columns: 39px minmax(0, 1fr) auto; }
  .author-api-link { grid-column: 2; grid-row: 2; justify-self: start; margin: 0; }
  .follow-button { grid-column: 3; grid-row: 1 / span 2; }
}

/* APPSTAGE v5.2 account and developer self-service */
.auth-backdrop {
  position: fixed; inset: 0; z-index: 1200; background: rgb(15 23 42 / .48);
  backdrop-filter: blur(4px); opacity: 0; transition: opacity .2s ease;
}
.auth-backdrop.is-open { opacity: 1; }
.auth-dialog {
  position: fixed; z-index: 1210; top: 50%; left: 50%; width: min(680px, calc(100vw - 32px));
  max-height: min(820px, calc(100dvh - 32px)); transform: translate(-50%, -46%) scale(.98);
  opacity: 0; pointer-events: none; overflow: hidden; display: flex; flex-direction: column;
  background: #fff; border: 1px solid #e5e7eb; border-radius: 24px; box-shadow: 0 24px 80px rgb(15 23 42 / .24);
  transition: transform .22s ease, opacity .22s ease;
}
.auth-dialog.is-open { transform: translate(-50%, -50%) scale(1); opacity: 1; pointer-events: auto; }
.auth-dialog__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; padding: 24px 28px 18px; border-bottom: 1px solid #eceff3; }
.auth-dialog__head h2 { margin: 4px 0 0; font-size: 25px; letter-spacing: -.04em; }
.auth-dialog__brand { color: #5965d8; font-size: 11px; font-weight: 800; letter-spacing: .14em; }
.auth-dialog__head > button { width: 38px; height: 38px; border: 0; border-radius: 12px; background: #f5f6f8; font-size: 25px; line-height: 1; cursor: pointer; }
.auth-dialog__notice { margin: 18px 28px 0; padding: 12px 14px; border-radius: 12px; background: #f2f4ff; color: #334155; font-size: 13px; line-height: 1.55; }
.auth-dialog__notice[data-state="error"] { background: #fff1f2; color: #9f1239; }
.auth-dialog__notice[data-state="success"] { background: #ecfdf5; color: #065f46; }
.auth-dialog__body { overflow-y: auto; padding: 24px 28px 30px; scrollbar-width: none; }
.auth-dialog__body::-webkit-scrollbar { display: none; }
[data-auth-view][hidden] { display: none !important; }
.auth-form, .developer-registration-form { display: grid; gap: 16px; }
.auth-form label, .developer-registration-form label { display: grid; gap: 7px; color: #334155; font-size: 13px; font-weight: 700; }
.auth-form input, .auth-form select, .auth-form textarea, .developer-registration-form input, .developer-registration-form select, .developer-registration-form textarea {
  width: 100%; min-height: 45px; box-sizing: border-box; border: 1px solid #d8dde6; border-radius: 11px; background: #fff;
  padding: 11px 12px; color: #111827; font: inherit; font-size: 14px; outline: none;
}
.auth-form textarea, .developer-registration-form textarea { resize: vertical; line-height: 1.55; }
.auth-form input:focus, .auth-form select:focus, .auth-form textarea:focus, .developer-registration-form input:focus, .developer-registration-form select:focus, .developer-registration-form textarea:focus { border-color: #6875ea; box-shadow: 0 0 0 3px rgb(104 117 234 / .12); }
.auth-primary, .auth-link-button { min-height: 46px; display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 12px; padding: 0 18px; background: #4b5cff; color: #fff; font-size: 14px; font-weight: 800; text-decoration: none; cursor: pointer; }
.auth-primary:disabled { opacity: .55; cursor: wait; }
.auth-links { display: flex; justify-content: space-between; gap: 12px; }
.auth-links button, .auth-state > button, .account-actions > button, .developer-registration-form > button:not(.auth-primary), .one-time-key > button { border: 0; background: transparent; color: #5360cf; font-size: 13px; font-weight: 700; cursor: pointer; padding: 7px 0; }
.auth-help { margin: -8px 0 0; color: #64748b; font-size: 12px; }
.auth-check { display: flex !important; grid-template-columns: auto 1fr; align-items: flex-start; gap: 9px !important; font-weight: 500 !important; line-height: 1.45; }
.auth-check input { width: 17px !important; min-height: 17px !important; margin: 2px 0 0; padding: 0; }
.auth-state { display: grid; gap: 14px; text-align: center; padding: 12px 2px; }
.auth-state h3 { margin: 0; font-size: 21px; }
.auth-state p { margin: 0; color: #64748b; line-height: 1.65; }
.onboarding-view { display: grid; gap: 16px; }
.onboarding-value h3 { margin: 0; font-size: 20px; letter-spacing: -.035em; }
.onboarding-value p { margin: 7px 0 0; color: #64748b; font-size: 13px; line-height: 1.55; }
.onboarding-steps { margin: 0; padding: 0; list-style: none; }
.onboarding-steps li {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  gap: 10px;
  padding: 13px 0;
  border-top: 1px solid #ececef;
}
.onboarding-steps li > span {
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border-radius: 50%;
  background: #17181d;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
}
.onboarding-steps strong,
.onboarding-steps small { display: block; }
.onboarding-steps strong { font-size: 14px; }
.onboarding-steps small { margin-top: 3px; color: #64748b; font-size: 12px; line-height: 1.45; }
.onboarding-note { margin: -5px 0 0; color: #475569; font-size: 12px; line-height: 1.5; }
.onboarding-login { border: 0; background: transparent; color: #5360cf; font-size: 13px; font-weight: 700; cursor: pointer; }
.account-summary { display: grid; gap: 12px; }
.account-summary__card { padding: 18px; border: 1px solid #e6e9ef; border-radius: 16px; background: #fafbfc; }
.account-summary__card strong { display: block; margin-bottom: 5px; font-size: 16px; }
.account-summary__card span { color: #64748b; font-size: 13px; }
.account-status { display: inline-flex; align-items: center; margin-top: 12px; padding: 5px 9px; border-radius: 999px; background: #eef2ff; color: #4653bf; font-size: 11px; font-weight: 800; }
.account-actions { display: grid; gap: 10px; margin-top: 18px; }
.auth-secondary-link { display: flex; align-items: center; justify-content: center; min-height: 44px; border: 1px solid #d8dde6; border-radius: 12px; color: #334155; text-decoration: none; font-size: 13px; font-weight: 800; }
.registration-policy { padding: 15px 16px; border-radius: 14px; background: #f6f7ff; color: #334155; }
.registration-policy strong { font-size: 14px; }
.registration-policy p { margin: 5px 0 0; color: #64748b; font-size: 12px; line-height: 1.55; }
.auth-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.auth-form-grid .wide { grid-column: 1 / -1; }
.auth-form-grid fieldset { border: 1px solid #d8dde6; border-radius: 11px; padding: 10px 12px; }
.auth-form-grid legend { padding: 0 4px; color: #334155; font-size: 13px; font-weight: 700; }
.auth-form-grid fieldset .auth-check { display: inline-flex !important; margin-right: 10px; }
.one-time-key { display: grid; gap: 14px; }
.one-time-key > strong { font-size: 21px; }
.one-time-key > p { margin: 0; color: #64748b; line-height: 1.6; }
.one-time-key__value { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: stretch; }
.one-time-key__value code { min-width: 0; overflow-wrap: anywhere; padding: 14px; border-radius: 12px; background: #111827; color: #dbeafe; font-size: 12px; line-height: 1.55; }
.one-time-key__value button { border: 0; border-radius: 12px; padding: 0 15px; background: #e8ebff; color: #3441ad; font-weight: 800; cursor: pointer; }
.one-time-key dl { display: grid; grid-template-columns: max-content 1fr; gap: 7px 12px; margin: 0; padding: 14px; border: 1px solid #e6e9ef; border-radius: 12px; font-size: 12px; }
.one-time-key dt { color: #64748b; }
.one-time-key dd { margin: 0; font-weight: 700; }
.ai-connect { display: grid; gap: 14px; }
.ai-connect__intro { padding: 18px; border-radius: 16px; background: linear-gradient(135deg, #eef2ff, #f8fafc); }
.ai-connect__intro > span { display: block; margin-bottom: 7px; color: #4b5cff; font-size: 11px; font-weight: 850; }
.ai-connect__intro > strong { display: block; font-size: 18px; line-height: 1.45; }
.ai-connect__intro > p { margin: 7px 0 0; color: #64748b; font-size: 13px; line-height: 1.6; }
.ai-step { display: grid; gap: 14px; padding: 18px; border: 1px solid #e5e8ee; border-radius: 16px; background: #fff; }
.ai-step > header { display: grid; grid-template-columns: 30px minmax(0, 1fr); align-items: start; gap: 10px; }
.ai-step > header > span { display: grid; width: 30px; height: 30px; place-items: center; border-radius: 50%; background: #111827; color: #fff; font-size: 12px; font-weight: 850; }
.ai-step > header strong, .ai-step > header small { display: block; }
.ai-step > header strong { font-size: 15px; }
.ai-step > header small { margin-top: 4px; color: #64748b; font-size: 12px; line-height: 1.45; }
.quick-connect-form { display: grid; gap: 14px; }
.quick-connect-form[hidden], .ai-key-actions[hidden], .ai-key-value[hidden] { display: none !important; }
.quick-connect-form label { display: grid; gap: 7px; color: #334155; font-size: 13px; font-weight: 700; }
.quick-connect-form input {
  width: 100%; min-height: 45px; box-sizing: border-box; border: 1px solid #d8dde6; border-radius: 11px;
  padding: 11px 12px; color: #111827; font: inherit; font-size: 14px; outline: none;
}
.ai-key-actions { display: grid; grid-template-columns: max-content 1fr; align-items: center; gap: 11px; }
.ai-key-actions small { color: #64748b; line-height: 1.5; }
.ai-key-value { margin-top: 2px; }
.ai-prompt { width: 100%; box-sizing: border-box; resize: vertical; border: 1px solid #d8dde6; border-radius: 12px; padding: 14px; background: #f8fafc; color: #334155; font: 12px/1.65 ui-monospace, SFMono-Regular, Menlo, monospace; }
.ai-workspace-counts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.ai-workspace-counts > div { padding: 12px; border-radius: 12px; background: #f8fafc; text-align: center; }
.ai-workspace-counts strong, .ai-workspace-counts span { display: block; }
.ai-workspace-counts strong { font-size: 18px; }
.ai-workspace-counts span { margin-top: 3px; color: #64748b; font-size: 11px; }
.ai-result-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.ai-advanced { padding: 0 4px; color: #64748b; font-size: 12px; }
.ai-advanced summary { color: #475569; font-weight: 800; cursor: pointer; }
.ai-advanced p { line-height: 1.55; }
.ai-advanced button, .ai-advanced a { margin-right: 14px; border: 0; padding: 0; background: transparent; color: #5360cf; font: inherit; font-weight: 800; text-decoration: none; cursor: pointer; }
.html-guide-frame { width: 100%; min-height: 360px; border: 1px solid #e5e8ee; border-radius: 16px; background: #fff; }
.bridge-demo-pulse { animation: bridge-demo-pulse .75s ease; }
.bridge-demo-dark .device-screen { background: #111827; filter: saturate(.9) brightness(.88); }
@keyframes bridge-demo-pulse { 50% { transform: scale(1.018); box-shadow: 0 0 0 8px rgb(75 92 255 / .12), 0 32px 80px rgb(26 31 70 / .26); } }
body.auth-dialog-open { overflow: hidden; }

@media (max-width: 640px) {
  .auth-dialog { top: auto; bottom: 0; left: 0; width: 100%; max-height: calc(100dvh - 18px); border-radius: 22px 22px 0 0; transform: translateY(100%); }
  .auth-dialog.is-open { transform: translateY(0); }
  .auth-dialog__head { padding: 19px 20px 15px; }
  .auth-dialog__body { padding: 20px 20px 28px; }
  .auth-dialog__notice { margin: 14px 20px 0; }
  .auth-form-grid { grid-template-columns: 1fr; }
  .auth-form-grid .wide { grid-column: auto; }
  .one-time-key__value { grid-template-columns: 1fr; }
  .one-time-key__value button { min-height: 42px; }
  .ai-key-actions, .ai-result-actions { grid-template-columns: 1fr; }
}

/* APPSTAGE minimal UI — one surface, one divider, only essential copy */
:root {
  --header-height: 58px;
  --shadow-sm: none;
  --shadow-device: 0 14px 34px rgba(16, 19, 31, .12);
}

.topbar {
  grid-template-columns: auto minmax(260px, 620px) auto;
  gap: 24px;
  height: var(--header-height);
  padding: 0 20px;
  border-bottom-color: #eeeeef;
  backdrop-filter: none;
}
.topnav,
.category-filter,
.searchbox kbd { display: none; }
.discovery-controls { display: block; }
.searchbox {
  height: 38px;
  border: 0;
  border-radius: 9px;
  background: #f5f5f6;
}
.searchbox:focus-within {
  border: 0;
  background: #f1f1f3;
  box-shadow: 0 0 0 2px rgba(75, 92, 255, .14);
}
.primary-button,
.creator-avatar,
.rail-app-icon { box-shadow: none; }

.workspace {
  grid-template-columns: 84px minmax(480px, 1fr) minmax(360px, 34vw);
}
.panel + .panel { border-left: 0; }
.app-rail {
  padding: 14px 8px 22px;
  background: #fafafa;
}
.creator-card { padding-bottom: 11px; }
.creator-avatar {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  font-size: 12px;
}
.creator-online,
.rail-rule { display: none; }
.app-list { gap: 6px; }
.rail-app {
  width: 56px;
  min-height: 58px;
  border-radius: 12px;
}
.rail-app-icon {
  width: 42px;
  height: 42px;
  border-radius: 11px;
  font-size: 12px;
}
.rail-app-status {
  right: 5px;
  bottom: 6px;
  width: 8px;
  height: 8px;
  border: 0;
}
.rail-pagination { margin-top: 9px; }
.rail-pagination button { border: 0; background: transparent; }

.demo-inner {
  max-width: 820px;
  padding: 24px clamp(22px, 3vw, 42px) 44px;
}
.guest-start {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 0 0 20px;
  padding: 11px 13px;
  border-radius: 9px;
  background: #f5f5f6;
}
.guest-start[hidden] { display: none; }
.guest-start p { margin: 0; color: #5b5d65; font-size: 12px; line-height: 1.45; }
.guest-start p strong { color: #17181d; }
.guest-start button {
  flex: 0 0 auto;
  border: 0;
  background: transparent;
  color: #3f4cce;
  padding: 5px 2px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}
.demo-heading-row { gap: 12px; }
.app-title-block { gap: 11px; }
.app-title-icon {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  box-shadow: none;
}
.eyeline { display: none; }
.app-title-block h1 { font-size: clamp(25px, 2vw, 31px); }
.app-title-block p:last-child {
  margin-top: 4px;
  font-size: 12px;
  line-height: 1.4;
}
.share-button {
  height: 35px;
  border: 0;
  border-radius: 9px;
  background: #f4f4f5;
}
.demo-toolbar { margin: 18px 0 8px; }
.segmented-control {
  gap: 2px;
  padding: 3px;
  border: 0;
  border-radius: 9px;
  background: #f4f4f5;
}
.orientation-button,
.tool-button { height: 32px; border-radius: 7px; }
.orientation-button.is-active {
  background: white;
  box-shadow: none;
}
.device-stage {
  min-height: 585px;
  padding: 20px 0 30px;
  border: 0;
  border-radius: 0;
  background: transparent;
}
.device-stage.is-landscape { min-height: 430px; }
.stage-grid,
.stage-glow,
.interaction-hint { display: none; }
.device-shell {
  border-width: 4px;
  border-radius: 36px;
}
.device-shell.landscape { border-radius: 28px; }
.device-screen { inset: 4px; border-radius: 29px; }
.device-shell.landscape .device-screen { border-radius: 22px; }
.guide-section,
.detail-section,
.mobile-demo-switch { display: none !important; }

.story-panel { background: #fafafa; }
.story-feed-shell {
  max-width: 680px;
  padding: 24px clamp(24px, 3vw, 40px) 54px;
}
.journal-header { align-items: center; }
.journal-header h2 {
  margin: 0;
  font-size: 24px;
  line-height: 1.2;
}
.journal-header p:not(.eyeline),
.journal-count { display: none; }
.journal-header-actions { min-height: 0; }
.journal-author-bar {
  grid-template-columns: 32px minmax(0, 1fr) auto;
  gap: 9px;
  margin-top: 12px;
  padding: 10px 0 12px;
  border-bottom-color: #e9e9eb;
}
.author-avatar {
  width: 32px;
  height: 32px;
  border-radius: 9px;
}
.journal-author-bar span,
.follow-button { display: none; }
.author-api-link { font-size: 10px; }
.post-card { border-bottom-color: #e9e9eb; }
.post-card::before { display: none; }
.post-summary-button,
.post-feed.has-open-post .post-card:not(.is-open) .post-summary-button {
  grid-template-columns: minmax(0, 1fr) 24px;
  gap: 8px;
  padding: 15px 0;
}
.post-index,
.post-summary-excerpt,
.post-summary-meta { display: none; }
.post-summary-title,
.post-feed.has-open-post .post-card:not(.is-open) .post-summary-title {
  margin: 0;
  color: var(--ink);
  font-size: 16px;
  line-height: 1.4;
  letter-spacing: -.025em;
}
.post-kicker {
  order: 2;
  margin-top: 4px;
  font-size: 9px;
  letter-spacing: 0;
}
.post-open-icon,
.post-feed.has-open-post .post-card:not(.is-open) .post-open-icon {
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 6px;
}
.post-card.is-open .post-summary-button {
  padding: 18px 0 12px;
}
.post-card.is-open .post-summary-title {
  font-size: 22px;
  line-height: 1.35;
}
.post-card.is-open .post-open-icon {
  border: 0;
  background: transparent;
}
.post-expanded-content {
  padding: 0 0 24px;
}
.article-body {
  font-size: 14px;
  line-height: 1.7;
}
.article-section { margin-bottom: 28px; }
.article-section h3 {
  margin-bottom: 10px;
  font-size: 20px;
}
.article-section p { margin-bottom: 12px; }
.article-figure {
  min-height: 190px;
  margin: 18px 0;
  border: 0;
  border-radius: 10px;
}
.article-callout,
.orientation-note {
  margin: 16px 0;
  padding: 13px;
  border: 0;
  border-radius: 8px;
}
.article-quote {
  margin: 18px 0;
  padding-left: 14px;
  font-size: 16px;
}
.article-tags,
.table-of-contents,
.post-reading-meta,
.post-lead,
.comments,
.post-continuation { display: none; }
.html-guide-frame {
  min-height: 205px;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.auth-dialog {
  border: 0;
  border-radius: 16px;
  box-shadow: 0 18px 60px rgb(15 23 42 / .2);
}
.auth-dialog__head {
  padding: 20px 24px 12px;
  border-bottom: 0;
}
.auth-dialog__brand { display: none; }
.auth-dialog__head h2 { margin: 0; font-size: 22px; }
.auth-dialog__head > button {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: #f4f4f5;
}
.auth-dialog__body { padding: 12px 24px 24px; }
.auth-dialog__notice { margin: 8px 24px 0; border-radius: 8px; }
.auth-form,
.developer-registration-form { gap: 13px; }
.auth-form input,
.auth-form select,
.auth-form textarea,
.developer-registration-form input,
.developer-registration-form select,
.developer-registration-form textarea,
.quick-connect-form input {
  border-radius: 8px;
}
.auth-primary,
.auth-link-button,
.auth-secondary-link { border-radius: 8px; }
.ai-connect { gap: 0; }
.ai-connect__intro {
  padding: 0 0 14px;
  border-radius: 0;
  background: transparent;
}
.ai-connect__intro > strong { font-size: 18px; }
.ai-connect__intro > p {
  margin-top: 4px;
  font-size: 12px;
  line-height: 1.4;
}
.ai-step {
  gap: 12px;
  padding: 16px 0;
  border: 0;
  border-top: 1px solid #ececef;
  border-radius: 0;
}
.ai-step > header {
  grid-template-columns: 25px minmax(0, 1fr);
  gap: 9px;
}
.ai-step > header > span {
  width: 25px;
  height: 25px;
  font-size: 11px;
}
.ai-step > header small { margin-top: 2px; }
.ai-workspace-counts > div {
  padding: 10px;
  border-radius: 8px;
  background: #f5f5f6;
}
.ai-advanced {
  padding: 14px 0 0;
  border-top: 1px solid #ececef;
}

@media (max-width: 1260px) {
  .topbar { grid-template-columns: auto minmax(240px, 1fr) auto; }
  .workspace { grid-template-columns: 76px minmax(430px, 1fr) minmax(340px, 36vw); }
}

@media (max-width: 980px) {
  :root { --mobile-appbar-height: 70px; }
  .mobile-appbar {
    grid-template-columns: 45px minmax(0, 1fr) 58px;
    border-bottom-color: #eeeeef;
    box-shadow: none;
    backdrop-filter: none;
  }
  .mobile-connect-button {
    display: block;
    align-self: center;
    min-height: 34px;
    margin-right: 8px;
    border: 0;
    border-radius: 8px;
    background: #17181d;
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    cursor: pointer;
  }
  .mobile-overflow-button { border-right: 0; }
  .demo-panel { border-bottom: 1px solid #eeeeef; }
  .demo-inner { padding: 18px 14px 28px; }
  .guest-start {
    align-items: flex-start;
    gap: 7px;
    margin-bottom: 14px;
    padding: 10px 11px;
  }
  .guest-start p { font-size: 11px; }
  .guest-start button { padding-top: 1px; font-size: 11px; }
  .device-stage {
    min-height: 555px;
    margin-top: 4px;
    padding-inline: 0;
  }
  .device-stage.is-landscape { min-height: 340px; }
  .story-feed-shell {
    padding: 22px 16px calc(54px + env(safe-area-inset-bottom));
  }
  .journal-header h2 { font-size: 24px; }
  .journal-author-bar { margin-top: 10px; }
  .post-feed.has-open-post .post-card:not(.is-open) .post-summary-button {
    grid-template-columns: minmax(0, 1fr) 24px;
    gap: 8px;
    padding: 14px 0;
  }
  .post-card.is-open .post-summary-button { padding-top: 17px; }
  .post-card.is-open .post-summary-title { font-size: 22px; }
  .post-expanded-content { padding-left: 0; }
}

@media (max-width: 430px) {
  .app-title-block > div:last-child > p:last-child { display: none; }
  .device-stage { min-height: 535px; }
  .device-stage.is-landscape { min-height: 300px; }
  .html-guide-frame { min-height: 250px; }
}
