/* Nation app look, copied from ryze-ecomm app/globals.css tokens. */
@import url("https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;450;500;600;650;700&family=Geist+Mono:wght@400;500&display=block");

:root {
  --frame: #1a1a1a;
  --sheet: #fbfbfa;
  --surface: #ffffff;
  --depth: #f5f6f5;
  --tray: #f1f1ef;
  --thead: #f4f5f3;
  --row-hover: #fafaf9;
  --row-open: #f6f4f1;
  --fg1: #1c1c1c;
  --fg2: #4a4844;
  --fg3: #8a8680;
  --fg4: #b8b4ad;
  --accent: #c9663a;
  --accent-ink: #a8522b;
  --accent-soft: rgba(201, 102, 58, 0.1);
  --pos: #1a7a50;
  --pos-soft: #e3f1ea;
  --pos-strong: #15603f;
  --warn: oklch(0.72 0.16 70);
  --warn-soft: #fcf0c5;
  --warn-strong: #7a5a00;
  --neutral-soft: #eceeec;
  --danger: oklch(0.577 0.245 27.325);
  --border: rgba(28, 28, 28, 0.09);
  --border-t: rgba(28, 28, 28, 0.06);
  --frame-fg1: #e3e3e3;
  --frame-fg2: #b0b0ab;
  --frame-fg3: #808080;
  --paper-75: #f7f0e6;
  --paper-200: #e9dccb;
  --shadow-card: 0 0 0 .5px var(--border), 0 1px 2px -1px rgba(0,0,0,.05), 0 10px 28px -14px rgba(0,0,0,.14);
  --shadow-xl: 0 0 0 .5px var(--border), 0 2px 4px -2px rgba(0,0,0,.05), 0 12px 32px -12px rgba(0,0,0,.12);
  --shadow-dock: 0 0 0 .5px var(--border-t), 0 8px 28px -16px rgba(28,28,28,.16);
  --shadow-raised: inset 0 1px 0 rgba(255,255,255,.9), 0 0 0 .5px var(--border), 0 1px 2px rgba(28,28,28,.06), 0 2px 5px -3px rgba(28,28,28,.1);
  --shadow-solid: inset 0 1px 0 rgba(255,255,255,.28), 0 1px 2px rgba(28,28,28,.16), 0 2px 6px -3px rgba(28,28,28,.24);
  --shadow-frame-active: inset 0 1px 0 rgba(255,255,255,.1), inset 0 0 0 .5px rgba(255,255,255,.07), 0 1px 2px rgba(0,0,0,.45), 0 2px 6px -2px rgba(0,0,0,.35);
  --shadow-popup: 0 0 0 .5px var(--border), 0 1px 1px rgba(28,28,28,.04), 0 8px 24px -8px rgba(28,28,28,.18);
  --ease-paper: cubic-bezier(0.16, 1, 0.3, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { width: 1280px; height: 720px; overflow: hidden; }
body {
  font-family: "Plus Jakarta Sans", system-ui, sans-serif;
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
  color: var(--fg1);
  background: var(--sheet);
  font-size: 13px;
  line-height: 1.5;
}
.mono { font-family: "Geist Mono", ui-monospace, monospace; }
i.ph { font-size: 16px; line-height: 1; display: inline-block; }
.muted { color: var(--fg3); }

/* ---------- motion ---------- */
@keyframes tool-shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.tool-shimmer {
  background: linear-gradient(90deg, var(--fg3) 0%, var(--fg1) 50%, var(--fg3) 100%);
  background-size: 200% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: tool-shimmer 1.6s linear infinite;
}
@property --dot-ripple { syntax: "<length>"; inherits: false; initial-value: 0px; }
.dot-ripple {
  position: absolute; inset: 0; color: var(--fg3);
  background: radial-gradient(circle, currentColor 1.4px, transparent 1.9px) 0 0 / 14px 14px;
  mask-image: repeating-radial-gradient(circle, transparent var(--dot-ripple), #000 calc(var(--dot-ripple) + 40px), transparent calc(var(--dot-ripple) + 80px));
  -webkit-mask-image: repeating-radial-gradient(circle, transparent var(--dot-ripple), #000 calc(var(--dot-ripple) + 40px), transparent calc(var(--dot-ripple) + 80px));
  animation: dot-ripple 1.6s linear infinite;
}
@keyframes dot-ripple { to { --dot-ripple: 80px; } }
.photo-develop { animation: photo-develop 1.4s cubic-bezier(0.4, 0, 0.2, 1) both; }
@keyframes photo-develop {
  0% { opacity: 0; filter: blur(18px) grayscale(1) brightness(1.3); }
  40% { opacity: 1; }
  100% { opacity: 1; filter: none; }
}
.card-flip-in { backface-visibility: hidden; animation: card-flip-in 700ms cubic-bezier(0.2, 0.8, 0.2, 1) both; }
@keyframes card-flip-in {
  from { opacity: .3; transform: perspective(1400px) rotateY(-90deg); }
  to { opacity: 1; transform: perspective(1400px) rotateY(0deg); }
}
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
.rise { animation: rise 450ms var(--ease-paper) both; }
.step-reveal > * { animation: rise 450ms var(--ease-paper) both; }
.step-reveal > :nth-child(2) { animation-delay: 60ms; }
.step-reveal > :nth-child(3) { animation-delay: 120ms; }
.step-reveal > :nth-child(4) { animation-delay: 180ms; }
.step-reveal > :nth-child(n+5) { animation-delay: 240ms; }
@keyframes word-in { from { opacity: 0; transform: translateY(8px); filter: blur(6px); } }
.word-in { display: inline-block; white-space: pre; animation: word-in 700ms var(--ease-paper) backwards; animation-delay: calc(var(--wi, 0) * 55ms); }
@keyframes fade-in { from { opacity: 0; } }
.fade-in { animation: fade-in 400ms ease both; }
@keyframes thinking-dot { 0%, 60%, 100% { opacity: .25; } 30% { opacity: 1; } }
.thinking-dots span { animation: thinking-dot 1.2s ease-in-out infinite; }
.thinking-dots span:nth-child(2) { animation-delay: .15s; }
.thinking-dots span:nth-child(3) { animation-delay: .3s; }
@keyframes pulse-dot { 0%, 100% { opacity: .35; transform: scale(.85); } 50% { opacity: 1; transform: scale(1); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pop-in { from { opacity: 0; transform: scale(.94) translateY(6px); } }
.pop-in { animation: pop-in 380ms var(--ease-paper) both; }
@keyframes slide-in-right { from { opacity: 0; transform: translateX(24px); } }
@keyframes row-in { from { opacity: 0; transform: translateY(-6px); background: #fff7ef; } }
.row-in { animation: row-in 600ms var(--ease-paper) both; }
@keyframes flash-bg { from { background: #fff1e6; } }

/* ---------- sidekick ---------- */
.sk-tile {
  position: relative; width: 72px; height: 72px; border-radius: 14px; overflow: hidden;
  background: linear-gradient(to bottom, var(--paper-75), var(--paper-200));
  box-shadow: 0 0 0 .5px var(--border);
}
.sk-tile img.sk-body { position: absolute; width: 79px; height: 63px; left: -12%; bottom: -6%; left: auto; right: -1px; }
.sk-tile img.sk-body { left: -4px; }
.sk-free { position: relative; display: inline-block; }
.sk-free img { display: block; width: 100%; height: auto; }
.sk-orbit { position: absolute; left: 50%; top: 40%; width: 0; height: 0; pointer-events: none; }
.sk-orbit img { position: absolute; transform: translate(-50%, -50%); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 32px; padding: 0 12px; border-radius: 10px; border: 0;
  font: 500 13px/1 "Plus Jakarta Sans", sans-serif; white-space: nowrap; cursor: default;
  transition: transform 120ms ease, opacity 200ms ease, filter 200ms ease;
}
.btn.sm { height: 28px; padding: 0 10px; border-radius: 9px; font-size: 12.5px; }
.btn.lg { height: 40px; padding: 0 18px; border-radius: 10px; font-size: 14px; }
.btn.primary { color: #fff; background: linear-gradient(180deg, #2b2c2b, #161716); box-shadow: var(--shadow-solid); }
.btn.secondary { color: var(--fg1); background: linear-gradient(180deg, #fff, #f7f8f7); box-shadow: var(--shadow-raised); }
.btn.agent { color: #fff; background: linear-gradient(180deg, #d3744b, #c45f34); box-shadow: var(--shadow-solid); }
.btn.ghost { color: var(--fg2); background: transparent; }
.btn.disabled { opacity: .45; }
.btn.pressed { transform: scale(.97); }
.send-btn {
  width: 32px; height: 32px; border-radius: 999px; display: grid; place-items: center; color: #fff;
  background: linear-gradient(180deg, #d3744b, #c45f34); box-shadow: var(--shadow-solid); transition: opacity 200ms ease;
}
.send-btn.off { opacity: .45; }
.send-btn.stop { background: #fff; color: var(--fg1); box-shadow: var(--shadow-raised); }
.send-btn.stop::after { content: ""; width: 10px; height: 10px; border-radius: 2px; background: var(--fg1); }
.send-btn i { font-size: 15px; }
.plus-btn { width: 28px; height: 28px; border-radius: 999px; display: grid; place-items: center; color: var(--fg2); box-shadow: var(--shadow-raised); background: #fff; }

/* ---------- pills ---------- */
.pill { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 7px; font-size: 12px; font-weight: 500; white-space: nowrap; }
.pill.pos { background: var(--pos-soft); color: var(--pos-strong); }
.pill.warn { background: var(--warn-soft); color: var(--warn-strong); }
.pill.neutral { background: var(--neutral-soft); color: var(--fg2); }
.pill.accent { background: var(--accent-soft); color: var(--accent-ink); }
.pill .dot { width: 6px; height: 6px; border-radius: 99px; background: currentColor; opacity: .8; }

/* ---------- cards / tray ---------- */
.tray { background: var(--tray); border-radius: 16px; padding: 4px; }
.tray > .card { box-shadow: var(--shadow-card); }
.card { background: var(--surface); border-radius: 14px; box-shadow: var(--shadow-card); overflow: hidden; }
.tray-bar { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 6px 6px 6px 14px; font-size: 12px; color: var(--fg3); }
.tray-bar .fact { flex: 1; min-width: 0; }

/* ---------- radio / checkbox rows ---------- */
.choice { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 0 16px; border-top: 1px solid var(--border-t); font-size: 13px; font-weight: 500; position: relative; transition: background 200ms ease; }
.choice:first-child { border-top: 0; }
.choice.tall { min-height: 60px; }
.choice.sel { background: var(--row-open); }
.choice.sel::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 2px; background: var(--fg1); }
.choice .sub { display: block; font-size: 12px; font-weight: 450; color: var(--fg3); margin-top: 1px; }
.radio { width: 16px; height: 16px; border-radius: 99px; box-shadow: inset 0 0 0 1.5px var(--fg4); flex: none; display: grid; place-items: center; background: #fff; transition: box-shadow 150ms ease; }
.sel .radio, .radio.on { box-shadow: inset 0 0 0 1.5px var(--fg1); }
.sel .radio::after, .radio.on::after { content: ""; width: 8px; height: 8px; border-radius: 99px; background: var(--fg1); }
.check { width: 16px; height: 16px; border-radius: 4px; box-shadow: inset 0 0 0 1.5px var(--fg4); flex: none; display: grid; place-items: center; background: #fff; color: #fff; font-size: 11px; transition: background 150ms ease; }
.check.on { background: var(--fg1); box-shadow: none; }
.check.on::after { content: "✓"; font-weight: 700; font-size: 11px; line-height: 1; }

/* ---------- composer ---------- */
.composer {
  background: #fff; border-radius: 24px; box-shadow: var(--shadow-xl); padding: 16px 20px 12px;
}
.composer .field { min-height: 46px; font-size: 15px; line-height: 1.6; color: var(--fg1); white-space: pre-wrap; }
.composer .field .phd { color: var(--fg4); }
.composer .row { display: flex; align-items: center; justify-content: space-between; margin-top: 6px; }
.caret { display: inline-block; width: 1.5px; height: 1.1em; background: var(--fg1); vertical-align: -3px; margin-left: 1px; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.dock {
  display: flex; align-items: center; gap: 10px; height: 44px; padding: 0 8px 0 10px; border-radius: 999px; background: #fff;
  box-shadow: var(--shadow-dock); font-size: 13px; color: var(--fg1);
}
.dock .txt { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; }
.dock .txt .phd { color: var(--fg3); }
.dock .sep { width: 1px; height: 18px; background: var(--border); }
.dock img.sk24 { width: 24px; height: auto; }

/* ---------- chat ---------- */
.msg-user { align-self: flex-end; max-width: 80%; background: #fff; border-radius: 14px 14px 4px 14px; padding: 8px 14px; font-size: 14.5px; line-height: 1.55; box-shadow: 0 0 0 .5px var(--border), 0 1px 2px rgba(0,0,0,.04); }
.msg-ai { font-size: 14.5px; line-height: 1.6; color: var(--fg1); }
.msg-ai p + p, .msg-ai p + ul, .msg-ai ul + p { margin-top: 8px; }
.msg-ai ul { padding-left: 18px; }
.msg-ai li + li { margin-top: 3px; }
.msg-ai b { font-weight: 650; }
.msg-ai code { font-family: "Geist Mono", monospace; font-size: 12.5px; background: var(--depth); padding: 1px 5px; border-radius: 5px; }
.tool-group { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--fg3); min-height: 26px; }
.tool-group .chev { font-size: 12px; color: var(--fg4); }
.tool-chips { display: flex; }
.tool-chips span { width: 20px; height: 20px; border-radius: 99px; background: #fff; box-shadow: 0 0 0 .5px var(--border), 0 1px 2px rgba(0,0,0,.06); display: grid; place-items: center; margin-left: -5px; color: var(--fg2); }
.tool-chips span:first-child { margin-left: 0; }
.tool-chips i { font-size: 11px; }
.tool-rows { margin: 4px 0 2px 6px; padding-left: 12px; border-left: 1px solid var(--border); display: flex; flex-direction: column; gap: 4px; }
.tool-row { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--fg2); min-height: 22px; }
.tool-row .mark { width: 14px; display: grid; place-items: center; color: var(--fg4); flex: none; }
.tool-row .mark .run { width: 7px; height: 7px; border-radius: 99px; background: var(--accent); animation: pulse-dot 1s ease-in-out infinite; }
.tool-row code, .tool-group code { font-family: "Geist Mono", monospace; font-size: 12px; color: var(--fg2); }
.thinking { display: flex; align-items: center; gap: 8px; color: var(--fg3); font-size: 14px; }
.thinking img { width: 30px; }

/* ---------- build steps ---------- */
.build { list-style: none; }
.build > li { position: relative; display: grid; grid-template-columns: 20px minmax(0, 1fr); column-gap: 12px; padding-bottom: 20px; }
.build > li:last-child { padding-bottom: 0; }
.build > li .line { position: absolute; top: 20px; bottom: 0; left: 9px; width: 2px; border-radius: 99px; background: var(--border); overflow: hidden; }
.build > li .line::after { content: ""; display: block; width: 100%; height: 100%; background: var(--pos); transform-origin: top; transform: scaleY(0); transition: transform 500ms var(--ease-paper); }
.build > li.done .line::after { transform: scaleY(1); }
.build > li:last-child .line { display: none; }
.node { position: relative; z-index: 1; width: 20px; height: 20px; border-radius: 99px; display: grid; place-items: center; background: #fff; box-shadow: inset 0 0 0 1.5px var(--fg4); color: #fff; transition: background 300ms ease 300ms, box-shadow 300ms ease 300ms; }
.node.sm { width: 14px; height: 14px; }
.done > .node, .node.done { background: var(--pos); box-shadow: none; }
.done > .node::after, .node.done::after { content: ""; width: 9px; height: 5px; border-left: 2px solid #fff; border-bottom: 2px solid #fff; transform: translateY(-1px) rotate(-45deg); }
.node.sm.done::after { width: 6px; height: 3px; border-width: 1.5px; }
.active > .node, .node.active { background: var(--warn-soft); box-shadow: inset 0 0 0 1.5px var(--warn-strong); }
.build .lbl { min-height: 20px; font-size: 13px; font-weight: 600; line-height: 20px; }
.build .waiting .lbl { font-weight: 500; color: var(--fg3); }
.build .sub { grid-column: 2; margin-top: 10px; }

/* ---------- app shell ---------- */
.frame { position: fixed; inset: 0; background: var(--frame); display: flex; }
.sidebar { width: 228px; flex: none; padding: 10px 8px 8px 10px; display: flex; flex-direction: column; color: var(--frame-fg1); }
.store-sw { display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 6px; font-size: 13px; font-weight: 500; }
.store-sw .av { width: 20px; height: 20px; border-radius: 6px; background: var(--accent); color: #fff; display: grid; place-items: center; font-size: 11px; font-weight: 650; }
.store-sw .grow { flex: 1; }
.store-sw i { color: var(--frame-fg2); font-size: 14px; }
.nav { margin-top: 8px; display: flex; flex-direction: column; gap: 1px; }
.nav .grp { font-size: 12px; color: var(--frame-fg3); padding: 14px 8px 4px; }
.nav a { display: flex; align-items: center; gap: 10px; height: 28px; padding: 0 8px; border-radius: 8px; font-size: 13px; color: var(--frame-fg1); text-decoration: none; }
.nav a i { font-size: 18px; color: var(--frame-fg2); width: 20px; text-align: center; }
.nav a.cur { background: linear-gradient(180deg, #3a3b3a, #2d2e2d); box-shadow: var(--shadow-frame-active); color: #fff; }
.nav a.cur i { color: #fff; }
.nav a.subl { padding-left: 38px; color: var(--frame-fg2); font-size: 12.5px; height: 26px; }
.sidebar .foot { margin-top: auto; display: flex; flex-direction: column; gap: 6px; }
.sidebar .acct { display: flex; align-items: center; gap: 10px; height: 34px; padding: 0 6px; font-size: 13px; }
.sidebar .acct .av { width: 22px; height: 22px; border-radius: 99px; background: #f1f1ef; color: var(--fg1); display: grid; place-items: center; font-size: 11px; font-weight: 600; }
.sheet { position: relative; flex: 1; min-width: 0; margin: 8px 8px 8px 0; border-radius: 14px; background: var(--sheet); overflow: hidden; display: flex; }
.sheet-main { position: relative; flex: 1; min-width: 0; display: flex; flex-direction: column; }
.page-head { height: 56px; flex: none; display: flex; align-items: center; gap: 8px; padding: 0 28px; font-size: 15px; font-weight: 600; }
.page-head i { font-size: 16px; color: var(--fg2); }
.page-head .count { color: var(--fg3); font-weight: 500; font-size: 13px; }
.page-head .right { margin-left: auto; display: flex; gap: 8px; }
.page-body { flex: 1; min-height: 0; padding: 0 28px 90px; overflow: hidden; position: relative; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); background: #fff; border-radius: 14px; box-shadow: var(--shadow-card); }
.stats > div { padding: 12px 14px; border-left: 1px solid var(--border-t); }
.stats > div:first-child { border-left: 0; }
.stats .k { font-size: 12px; color: var(--fg3); }
.stats .v { font-size: 17px; font-weight: 600; line-height: 22px; margin-top: 2px; font-variant-numeric: tabular-nums; }
.stats .v small { font-size: 12px; color: var(--fg3); font-weight: 500; }
.filters { margin-top: 12px; display: flex; align-items: center; gap: 2px; height: 40px; padding: 0 6px; background: #fff; border-radius: 12px; box-shadow: var(--shadow-card); font-size: 13px; color: var(--fg2); }
.filters span { padding: 4px 9px; border-radius: 7px; }
.filters span.on { background: var(--depth); color: var(--fg1); font-weight: 500; }
.filters .search { display: flex; align-items: center; gap: 8px; margin-left: 6px; padding-left: 12px; border-left: 1px solid var(--border); color: var(--fg3); }
.table { margin-top: 12px; width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
.table th { text-align: left; font-weight: 500; color: var(--fg3); font-size: 12px; background: var(--thead); height: 32px; padding: 0 12px; }
.table th:first-child { border-radius: 9px 0 0 9px; }
.table th:last-child { border-radius: 0 9px 9px 0; }
.table td { height: 52px; padding: 0 12px; border-bottom: 1px solid var(--border-t); white-space: nowrap; }
.table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table .prod { display: flex; align-items: center; gap: 10px; font-weight: 500; }
.table .prod img { width: 32px; height: 32px; border-radius: 7px; object-fit: cover; box-shadow: 0 0 0 .5px var(--border); background: #fff; }
.empty { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 4px; }
.empty b { font-size: 15px; font-weight: 600; margin-top: 10px; }
.empty span { font-size: 13px; color: var(--fg3); max-width: 300px; }
.dock-wrap { position: absolute; left: 0; right: 0; bottom: 16px; display: flex; justify-content: center; pointer-events: none; z-index: 20; }
.dock-wrap .dock { width: 560px; }

/* side chat panel (builder + pages) */
.side-chat { width: 400px; flex: none; margin: 8px 8px 8px 0; border-radius: 14px; background: #fff; display: flex; flex-direction: column; overflow: hidden; }
.side-chat .hd { height: 52px; display: flex; align-items: center; gap: 8px; padding: 0 16px; font-weight: 600; font-size: 14px; }
.side-chat .hd img { width: 26px; }
.side-chat .hd .x { margin-left: auto; color: var(--fg3); }
.side-chat .body { flex: 1; min-height: 0; overflow: hidden; padding: 4px 18px 12px; display: flex; flex-direction: column; gap: 12px; }
.side-chat .body > .inner { display: flex; flex-direction: column; gap: 12px; transition: transform 500ms var(--ease-paper); }
.side-chat .foot { padding: 0 12px 12px; }
.side-chat .composer { border-radius: 18px; padding: 12px 14px 10px; box-shadow: 0 0 0 .5px var(--border), 0 6px 20px -12px rgba(0,0,0,.18); }
.side-chat .composer .field { min-height: 26px; font-size: 14px; }

/* ---------- fake cursor ---------- */
#cursor { position: fixed; left: 0; top: 0; width: 22px; height: 22px; z-index: 9999; pointer-events: none; transform-origin: 3px 3px; will-change: transform; }
#cursor svg { display: block; filter: drop-shadow(0 1px 1.5px rgba(0,0,0,.35)); }
#cursor .ring { position: absolute; left: -12px; top: -12px; width: 28px; height: 28px; border-radius: 99px; background: rgba(28,28,28,.18); opacity: 0; transform: scale(.4); }
.tool-group .glbl { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
