:root {
  --bg: #f5f3ee;
  --panel: #ffffff;
  --ink: #15171c;
  --muted: #6d717a;
  --soft: #9a9ea7;
  --line: #e7e3da;
  --accent: #4f46e5;
  --accent-2: #7c3aed;
  --accent-soft: #eef0ff;
  --ok: #0f9d6a;
  --danger: #d92d20;
  --sidebar: #121419;
  --radius: 18px;
  --shadow: 0 18px 50px -24px rgba(21, 23, 28, .28);
  --font: "Segoe UI", "Plus Jakarta Sans", "Inter", system-ui, -apple-system, sans-serif;
  --sidebar-w: 264px;
  --chat-w: 920px;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
[hidden] { display: none !important; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent); }
code { font-family: "Cascadia Code", Consolas, monospace; font-size: .92em; background: #f2efe9; padding: .1em .38em; border-radius: .35em; }

/* ---------- brand ---------- */
.brand-row { display: flex; align-items: center; gap: 11px; }
.brand-mark {
  width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center;
  background: linear-gradient(140deg, #6366f1, #8b5cf6 55%, #d946ef);
  color: #fff; box-shadow: 0 8px 22px -8px rgba(124, 58, 237, .7);
}
.brand-mark svg { width: 21px; height: 21px; }
.brand-name { font-weight: 700; font-size: 16.5px; letter-spacing: -.02em; }
.brand-row.small .brand-mark { width: 30px; height: 30px; border-radius: 9px; }
.brand-row.small .brand-mark svg { width: 18px; height: 18px; }
.brand-row.small .brand-name { font-size: 15px; }
.pill {
  font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .09em;
  padding: 3px 8px; border-radius: 999px; color: #cfc8ff;
  background: rgba(124, 58, 237, .22); border: 1px solid rgba(167, 139, 250, .35);
}

/* ---------- auth ---------- */
.auth-shell {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(0, .88fr);
  background: var(--bg);
}
.auth-hero {
  position: relative; overflow: hidden; isolation: isolate;
  display: flex; flex-direction: column;
  padding: clamp(26px, 4vw, 52px) clamp(26px, 5.2vw, 84px) 30px;
  background: #0d0f13; color: #f4f2ec;
}
.auth-hero::before {
  content: ""; position: absolute; inset: -30% -20% auto auto; width: 760px; height: 760px; z-index: -1;
  background: radial-gradient(circle at center, rgba(99, 102, 241, .42), transparent 62%);
}
.auth-hero::after {
  content: ""; position: absolute; left: -22%; bottom: -46%; width: 720px; height: 720px; z-index: -1;
  background: radial-gradient(circle at center, rgba(217, 70, 239, .22), transparent 60%);
}
.hero-copy { margin-top: clamp(34px, 8vh, 92px); max-width: 560px; }
.eyebrow {
  margin: 0 0 14px; color: #a8a3f5; font-size: 11.5px; font-weight: 700;
  letter-spacing: .16em; text-transform: uppercase;
}
.hero-copy h1 {
  margin: 0; font-size: clamp(44px, 5.6vw, 76px); line-height: .98;
  letter-spacing: -.045em; font-weight: 700;
}
.hero-sub { margin: 22px 0 0; max-width: 470px; color: #b6b5bd; font-size: clamp(14.5px, 1.2vw, 17px); line-height: 1.65; }
.hero-points { list-style: none; margin: 26px 0 0; padding: 0; display: grid; gap: 11px; color: #d9d7de; font-size: 13.5px; }
.hero-points li { display: flex; align-items: center; gap: 10px; }
.tick {
  width: 19px; height: 19px; border-radius: 999px; flex: 0 0 auto; position: relative;
  background: rgba(52, 211, 153, .16); border: 1px solid rgba(52, 211, 153, .4);
}
.tick::after {
  content: ""; position: absolute; left: 6px; top: 4px; width: 5px; height: 8px;
  border: solid #34d399; border-width: 0 1.6px 1.6px 0; transform: rotate(42deg);
}
.hero-window {
  margin-top: auto; width: min(470px, 100%); padding: 16px;
  border-radius: 20px; background: rgba(255, 255, 255, .055);
  border: 1px solid rgba(255, 255, 255, .1); backdrop-filter: blur(14px);
  box-shadow: 0 30px 80px -30px rgba(0, 0, 0, .8); transform: rotate(-1deg);
}
.window-dots { display: flex; gap: 5px; margin-bottom: 13px; }
.window-dots i { width: 7px; height: 7px; border-radius: 999px; background: rgba(255, 255, 255, .22); }
.mini-bubble {
  margin-left: auto; width: fit-content; max-width: 86%;
  background: linear-gradient(135deg, #5b54e8, #7c3aed); color: #fff;
  padding: 10px 13px; border-radius: 13px 13px 4px 13px; font-size: 12.5px; line-height: 1.5;
}
.mini-steps { margin: 13px 0; display: grid; gap: 7px; }
.mini-step { display: flex; align-items: center; gap: 8px; color: #b9b7c1; font-size: 12px; }
.mini-ok {
  width: 17px; height: 17px; border-radius: 999px; display: grid; place-items: center;
  font-size: 10px; color: #34d399; background: rgba(52, 211, 153, .14);
}
.mini-site {
  display: flex; align-items: center; gap: 7px; padding: 9px 11px; border-radius: 10px;
  background: rgba(0, 0, 0, .3); color: #a7f3d0; font-size: 11.5px;
  font-family: "Cascadia Code", Consolas, monospace;
}
.live-dot { width: 6px; height: 6px; border-radius: 999px; background: #34d399; box-shadow: 0 0 0 4px rgba(52, 211, 153, .14); }
.auth-foot { margin: 22px 0 0; color: #6f6d78; font-size: 11.5px; }

.auth-panel {
  display: grid; place-items: center; padding: 40px clamp(22px, 4vw, 60px);
  background:
    radial-gradient(900px 500px at 100% 0%, #ece7ff 0%, transparent 60%),
    var(--bg);
}
.auth-card {
  width: min(404px, 100%); background: var(--panel); border: 1px solid var(--line);
  border-radius: 26px; padding: 30px; box-shadow: var(--shadow);
}
.auth-tabs {
  display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px;
  background: #f3f0ea; border-radius: 12px; margin-bottom: 24px;
}
.tab {
  border: 0; background: transparent; padding: 9px; border-radius: 9px;
  font-size: 13px; font-weight: 600; color: var(--muted); transition: .18s;
}
.tab.active { background: #fff; color: var(--ink); box-shadow: 0 2px 8px rgba(21, 23, 28, .08); }
.auth-card h2 { margin: 0; font-size: 23px; letter-spacing: -.03em; }
.auth-sub { margin: 7px 0 22px; color: var(--muted); font-size: 13.5px; }
.field { display: grid; gap: 7px; margin-bottom: 14px; }
.field > span { font-size: 12px; font-weight: 600; color: #4b4f57; }
.field input {
  width: 100%; height: 46px; padding: 0 13px; border-radius: 12px;
  border: 1px solid #ddd8ce; background: #fbfaf7; outline: none; transition: .16s;
  font-size: 14px;
}
.field input::placeholder { color: #a8a49b; }
.field input:focus {
  border-color: #a5a0f5; background: #fff;
  box-shadow: 0 0 0 4px rgba(99, 102, 241, .12);
}
.form-error { min-height: 18px; margin: 11px 0 0; color: var(--danger); font-size: 12.5px; line-height: 1.45; }
.auth-note { margin: 18px 0 0; padding-top: 16px; border-top: 1px solid var(--line); color: var(--soft); font-size: 11.5px; text-align: center; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid transparent; border-radius: 12px; padding: 10px 15px;
  font-size: 13.5px; font-weight: 600; transition: transform .15s, box-shadow .15s, background .15s;
  background: #f1eee8; color: var(--ink);
}
.btn:hover:not(:disabled) { transform: translateY(-1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn svg { width: 17px; height: 17px; }
.btn-primary {
  background: linear-gradient(135deg, #5b54e8, #7c3aed); color: #fff;
  box-shadow: 0 10px 24px -12px rgba(91, 84, 232, .85);
}
.btn-primary:hover:not(:disabled) { box-shadow: 0 14px 30px -12px rgba(91, 84, 232, .95); }
.btn-block { width: 100%; }
.btn-ghost { background: #fff; border-color: var(--line); color: #3c4048; }
.btn-ghost:hover:not(:disabled) { background: #faf8f4; }
.btn-new {
  width: 100%; background: rgba(255, 255, 255, .08); color: #f1efff;
  border: 1px solid rgba(255, 255, 255, .12); justify-content: flex-start;
}
.btn-new:hover { background: rgba(255, 255, 255, .13); }
.btn-new svg { color: #a5b4fc; }
.btn-publish-mobile { display: none; padding: 8px 14px; border-radius: 10px; background: #17181d; color: #fff; border: 0; font-size: 12.5px; }

/* ---------- app shell ---------- */
.app-shell { height: 100dvh; display: flex; flex-direction: column; overflow: hidden; }
.topbar {
  height: 64px; flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between;
  padding: 0 clamp(14px, 2.4vw, 26px); background: rgba(255, 255, 255, .78);
  border-bottom: 1px solid var(--line); backdrop-filter: blur(14px); z-index: 10;
}
.topbar-right { display: flex; align-items: center; gap: 12px; }
.mode-banner {
  flex: 0 0 auto; display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 10px;
  padding: 9px clamp(14px, 2.4vw, 26px); font-size: 12.5px; line-height: 1.45;
  background: #fff7e6; border-bottom: 1px solid #f0d9a8; color: #7a4b00;
}
.mode-banner strong { font-size: 11px; letter-spacing: .07em; text-transform: uppercase; }
.mode-banner code { background: rgba(122, 75, 0, .09); color: inherit; }
#unpublish-btn { color: var(--danger); }
.balance-chip {
  display: flex; align-items: baseline; gap: 8px; padding: 7px 12px;
  border: 1px solid var(--line); border-radius: 999px; background: #fff;
  font-family: inherit; color: inherit; cursor: pointer;
}
.balance-chip:hover { background: #faf7f1; }
.balance-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--soft); font-weight: 700; }
.balance-chip strong { font-size: 13px; letter-spacing: -.01em; }
.storage-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 11px;
  border: 1px solid var(--line); border-radius: 999px; background: #fff;
  color: #4b4f57; font-size: 12px; font-weight: 600;
}
.storage-chip svg { width: 15px; height: 15px; color: var(--accent); }
.storage-chip strong { font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.storage-chip:hover { background: #faf7f1; }
.storage-chip.warn { border-color: #fecaca; background: #fff6f5; color: #b42318; }
.storage-chip.warn svg { color: #d92d20; }
.user-chip {
  display: flex; align-items: center; gap: 8px; padding: 4px 7px 4px 4px;
  border: 1px solid transparent; border-radius: 999px; background: transparent;
  font-size: 13px; font-weight: 600; color: inherit;
}
.user-chip:hover { background: #f0ede7; border-color: var(--line); }
.user-chevron { width: 15px; height: 15px; color: var(--soft); }
.avatar {
  width: 30px; height: 30px; border-radius: 999px; display: grid; place-items: center;
  background: linear-gradient(140deg, #ddd6fe, #c7d2fe); color: #4338ca;
  font-size: 12.5px; font-weight: 700;
}
.icon-btn {
  width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px;
  border: 1px solid transparent; background: transparent; color: var(--muted);
}
.icon-btn:hover:not(:disabled) { background: #f0ede7; color: var(--ink); }
.icon-btn:disabled { opacity: .35; cursor: not-allowed; }
.icon-btn svg { width: 18px; height: 18px; }

.app-body {
  flex: 1; min-height: 0; display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr) 312px;
}
.app-shell.admin-mode .app-body { grid-template-columns: var(--sidebar-w) minmax(0, 1fr); }
.app-shell.admin-mode .rail { display: none; }
.sidebar {
  position: relative;
  display: flex; flex-direction: column; min-height: 0; padding: 18px 14px;
  background: linear-gradient(180deg, #15171d, #0f1115); color: #ececf1;
}
.sidebar-resizer {
  position: absolute; top: 0; right: -4px; bottom: 0; width: 8px; z-index: 12;
  cursor: col-resize; touch-action: none;
}
.sidebar-resizer::after {
  content: ""; position: absolute; top: 50%; left: 3px; width: 2px; height: 46px;
  margin-top: -23px; border-radius: 999px; background: rgba(255, 255, 255, .16);
  transition: background .15s, height .15s, margin .15s;
}
.sidebar-resizer:hover::after { background: #a5b4fc; height: 76px; margin-top: -38px; }
body.resizing { cursor: col-resize; user-select: none; }
body.resizing * { cursor: col-resize !important; }
.sidebar-top { display: grid; gap: 11px; padding: 0 2px; }
.sidebar-label {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: .13em;
  color: #6f7480; font-weight: 700; padding-left: 4px;
}
.project-list { flex: 1; min-height: 0; overflow-y: auto; margin-top: 16px; display: flex; flex-direction: column; gap: 4px; }
.project-item {
  width: 100%; text-align: left; border: 1px solid transparent; border-radius: 11px;
  padding: 10px 11px; background: transparent; color: #c9cad1; display: grid; gap: 3px;
  transition: .15s;
}
.project-item:hover { background: rgba(255, 255, 255, .055); }
.project-item.active { background: rgba(255, 255, 255, .09); border-color: rgba(255, 255, 255, .09); color: #fff; }
.project-name { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.project-date { font-size: 10.5px; color: #797e8a; }
.project-empty { color: #797e8a; font-size: 12px; padding: 10px 6px; line-height: 1.55; }
.sidebar-foot { padding: 16px 6px 2px; border-top: 1px solid rgba(255, 255, 255, .07); }
.sidebar-foot p { margin: 0; color: #6f7480; font-size: 11px; line-height: 1.55; }
.sidebar-foot .card-label { color: #787e8c; }
.sidebar-foot .mini-list { margin-top: 10px; gap: 9px; }
.sidebar-foot .mini-list li::before { background: rgba(129, 140, 248, .16); color: #a5b4fc; }
.sidebar-foot .mini-list b { color: #dddde4; font-size: 12px; }
.sidebar-foot .mini-list span { color: #828794; font-size: 10.5px; }
.sidebar-admin { margin-top: 2px; }
.admin-menu-btn {
  position: relative; width: 100%; display: flex; align-items: center; gap: 8px;
  padding: 9px 10px; border-radius: 11px; border: 1px solid rgba(167, 139, 250, .3);
  background: linear-gradient(135deg, rgba(99, 102, 241, .22), rgba(124, 58, 237, .16));
  color: #e9e6ff; font-size: 12.5px; font-weight: 600; text-align: left;
}
.admin-menu-btn:hover { background: linear-gradient(135deg, rgba(99, 102, 241, .34), rgba(124, 58, 237, .26)); }
.admin-menu-btn.active { border-color: rgba(199, 210, 254, .55); background: linear-gradient(135deg, rgba(99, 102, 241, .45), rgba(124, 58, 237, .34)); color: #fff; }
.admin-menu-btn svg { width: 17px; height: 17px; flex: 0 0 auto; color: #c7d2fe; }
.admin-menu-btn span { flex: 1; }
.admin-menu-btn .admin-badge { border-color: #15171d; }

.main { min-width: 0; min-height: 0; display: flex; padding: 0 clamp(14px, 2.6vw, 34px); }
.empty-state { width: 100%; overflow-y: auto; display: flex; align-items: center; justify-content: center; padding: 30px 0; }
.empty-inner { width: min(760px, 100%); padding: 18px 4px 40px; }
.empty-inner h2 { margin: 0; font-size: clamp(30px, 3.6vw, 46px); letter-spacing: -.04em; line-height: 1.06; }
.empty-sub { margin: 13px 0 26px; color: var(--muted); font-size: 14.5px; max-width: 480px; line-height: 1.6; }
.ideas { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.idea {
  text-align: left; display: grid; gap: 5px; padding: 17px; border-radius: 16px;
  border: 1px solid var(--line); background: #fff; transition: .17s;
  box-shadow: 0 1px 0 rgba(21, 23, 28, .02);
}
.idea:hover { border-color: #c7c2f7; transform: translateY(-2px); box-shadow: 0 16px 32px -22px rgba(79, 70, 229, .55); }
.idea-icon {
  width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent); margin-bottom: 5px;
}
.idea-icon svg { width: 19px; height: 19px; }
.idea-title { font-size: 14px; font-weight: 700; letter-spacing: -.01em; }
.idea-desc { font-size: 12px; color: var(--muted); line-height: 1.5; }

.chat-view { width: 100%; max-width: var(--chat-w); margin: 0 auto; display: flex; flex-direction: column; min-height: 0; position: relative; }
.chat-resizer {
  position: absolute; top: 72px; bottom: 118px; right: -9px; width: 10px;
  cursor: col-resize; touch-action: none; z-index: 4;
}
.chat-resizer::after {
  content: ""; position: absolute; top: 50%; left: 4px; width: 2px; height: 52px;
  margin-top: -26px; border-radius: 999px; background: #ddd8ce;
  transition: background .15s, height .15s, margin .15s;
}
.chat-resizer:hover::after { background: var(--accent); height: 84px; margin-top: -42px; }
.chat-head { flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 20px 4px 12px; }
.chat-title-wrap h2 { margin: 0; font-size: 18px; letter-spacing: -.025em; }
.chat-title-wrap p { margin: 3px 0 0; color: var(--muted); font-size: 12px; }
.chat-actions { display: flex; align-items: center; gap: 7px; flex: 0 0 auto; }
.chat-settings { background: #fff; border-color: var(--line); }
.messages { flex: 1; min-height: 0; overflow-y: auto; padding: 8px 4px 14px; display: flex; flex-direction: column; gap: 13px; }
.site-bar {
  flex: 0 0 auto; display: flex; align-items: center; gap: 9px;
  margin: 0 4px 10px; padding: 8px 10px 8px 12px;
  background: #f0fdf7; border: 1px solid #bbf7d0; border-radius: 11px; min-width: 0;
}
.site-bar-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: #15803d; flex: 0 0 auto; }
.site-bar a { font-size: 11.5px; color: #166534; text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1 1 auto; }
.site-bar .btn { padding: 6px 10px; font-size: 11px; flex: 0 0 auto; }
@media (min-width: 1181px) { .site-bar { display: none !important; } }
.msg {
  max-width: min(710px, 88%); padding: 12px 15px; border-radius: 16px;
  font-size: 14px; line-height: 1.65; overflow-wrap: anywhere; white-space: pre-wrap;
  animation: rise .22s ease both;
}
.msg.user { align-self: flex-end; background: #191a20; color: #f6f5f2; border-bottom-right-radius: 5px; }
.msg.assistant { align-self: flex-start; background: #fff; border: 1px solid var(--line); border-bottom-left-radius: 5px; box-shadow: 0 1px 2px rgba(21, 23, 28, .04); }
.msg.error { align-self: flex-start; background: #fff6f5; border: 1px solid #fecaca; color: #8f1d15; border-bottom-left-radius: 5px; }
.msg.assistant a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.msg-meta { margin-top: 7px; color: var(--soft); font-size: 10.5px; display: flex; gap: 8px; flex-wrap: wrap; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.activity {
  flex: 0 0 auto; margin: 0 4px 10px; padding: 12px 14px;
  background: #fff; border: 1px solid var(--line); border-radius: 15px;
  box-shadow: 0 12px 30px -24px rgba(21, 23, 28, .4); animation: rise .2s ease both;
}
.activity-head { display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 600; }
.spinner {
  width: 13px; height: 13px; border-radius: 999px; flex: 0 0 auto;
  border: 2px solid #dcd7ff; border-top-color: var(--accent);
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.step-label { margin-left: auto; color: var(--soft); font-size: 10.5px; }
.activity-list { margin-top: 9px; display: grid; gap: 5px; max-height: 132px; overflow-y: auto; }
.activity-row { display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: #5c6069; min-width: 0; }
.activity-dot { width: 6px; height: 6px; border-radius: 999px; background: var(--accent); flex: 0 0 auto; }
.activity-row.done .activity-dot { background: var(--ok); }
.activity-row.fail .activity-dot { background: var(--danger); }
.activity-row span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.activity.done .spinner { border-color: #bbf7d0; border-top-color: var(--ok); animation: none; }

.composer {
  flex: 0 0 auto; margin: 0 4px 16px; padding: 11px 13px 9px;
  background: #fff; border: 1px solid var(--line); border-radius: 18px;
  box-shadow: 0 16px 40px -30px rgba(21, 23, 28, .5);
  transition: border-color .16s, box-shadow .16s;
}
.composer:focus-within { border-color: #b9b2f8; box-shadow: 0 0 0 4px rgba(99, 102, 241, .1), 0 16px 40px -30px rgba(21, 23, 28, .5); }
.composer textarea {
  width: 100%; border: 0; outline: 0; resize: none; background: transparent;
  font-size: 14px; line-height: 1.55; max-height: 158px; padding: 2px 2px 6px;
}
.composer textarea::placeholder { color: #aaa69d; }
.composer-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.composer-hint { color: var(--soft); font-size: 10.5px; padding-left: 3px; }
.send-btn {
  width: 37px; height: 37px; border-radius: 12px; border: 0; display: grid; place-items: center;
  background: linear-gradient(135deg, #5b54e8, #7c3aed); color: #fff;
  box-shadow: 0 8px 18px -10px rgba(91, 84, 232, .9); transition: .15s;
}
.send-btn:hover:not(:disabled) { transform: translateY(-1px); }
.send-btn:disabled { opacity: .45; cursor: not-allowed; }
.send-btn svg { width: 19px; height: 19px; }

.rail { overflow-y: auto; padding: 20px 18px 20px 0; display: flex; flex-direction: column; gap: 13px; }
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.card-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: .11em; color: var(--soft); font-weight: 700; }
.card-hint { margin: 10px 0 0; color: var(--soft); font-size: 11px; line-height: 1.5; }
.balance-big { margin-top: 7px; font-size: 25px; font-weight: 700; letter-spacing: -.035em; }
.balance-card .btn { margin-top: 12px; }
.balance-card { background: linear-gradient(160deg, #ffffff, #fbf9ff); }
.publish-state { margin: 8px 0 12px; font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.publish-result { margin-top: 11px; display: grid; gap: 7px; }
.publish-result a {
  display: block; font-size: 12px; color: var(--accent); word-break: break-all;
  text-decoration: none; background: var(--accent-soft); padding: 9px 10px; border-radius: 9px;
}
.path-fallback { margin: 0; color: var(--soft); font-size: 10.5px; word-break: break-all; line-height: 1.45; }
.site-address { margin: -4px 0 10px; font-family: "Cascadia Code", Consolas, monospace; font-size: 10.5px; color: var(--muted); word-break: break-all; line-height: 1.45; }
.publish-card #edit-address-btn { margin-top: 8px; }
.btn-preview {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  margin-bottom: 8px; background: #f4f2ff; border: 1px solid #d9d4fb; color: #4f46e5;
}
.btn-preview:hover:not(:disabled) { background: #ece9ff; border-color: #c4bcf8; }
.btn-preview svg { width: 16px; height: 16px; }
.preview-mobile { display: none; }
.domain-link { border: 1px dashed #c9c2f7; }
.field-optional { font-style: normal; color: var(--soft); font-weight: 500; }
.storage-block { margin-top: 13px; padding-top: 12px; border-top: 1px solid var(--line); }
.storage-line { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; font-size: 11.5px; color: var(--muted); }
.storage-line b { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.storage-bar { margin-top: 7px; height: 6px; border-radius: 999px; background: #eeeae2; overflow: hidden; }
.storage-bar i { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, #6366f1, #8b5cf6); transition: width .3s; }
.storage-bar i.warn { background: linear-gradient(90deg, #f59e0b, #ef4444); }
.storage-note { margin: 8px 0 0; color: var(--soft); font-size: 10.5px; line-height: 1.5; }
.storage-inline { margin: -8px 0 16px; font-size: 11.5px; color: var(--muted); }
.storage-card { width: min(456px, 100%); }
.storage-summary { display: flex; align-items: baseline; gap: 8px; margin-top: 16px; }
.storage-summary strong { font-size: 31px; font-weight: 700; letter-spacing: -.04em; line-height: 1; }
.storage-summary span { color: var(--muted); font-size: 13px; }
.storage-meter { margin-top: 11px; height: 10px; border-radius: 999px; background: #eeeae2; overflow: hidden; }
.storage-meter i { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #6366f1, #8b5cf6); transition: width .3s; }
.storage-meter i.warn { background: linear-gradient(90deg, #f59e0b, #ef4444); }
.storage-note { margin: 8px 0 0; color: var(--muted); font-size: 12px; }
.storage-breakdown { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }
.storage-breakdown div { padding: 11px 12px; border: 1px solid var(--line); border-radius: 12px; background: #faf8f3; }
.storage-breakdown span { display: block; font-size: 11px; color: var(--muted); }
.storage-breakdown b { display: block; margin-top: 3px; font-size: 15px; }
.storage-plan { margin: 14px 0 0; font-size: 12px; color: var(--muted); }
.mini-list { margin: 11px 0 0; padding: 0; list-style: none; display: grid; gap: 12px; counter-reset: step; }
.mini-list li { position: relative; padding-left: 28px; }
.mini-list li::before {
  counter-increment: step; content: counter(step);
  position: absolute; left: 0; top: 1px; width: 19px; height: 19px; border-radius: 999px;
  display: grid; place-items: center; font-size: 10px; font-weight: 700;
  color: var(--accent); background: var(--accent-soft);
}
.mini-list b { display: block; font-size: 12.5px; }
.mini-list span { display: block; color: var(--muted); font-size: 11.5px; line-height: 1.5; margin-top: 1px; }

/* ---------- modal & toast ---------- */
.modal { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 20px; background: rgba(11, 13, 18, .52); backdrop-filter: blur(5px); }
.modal-card {
  width: min(432px, 100%); background: #fff; border-radius: 24px; padding: 25px;
  position: relative; box-shadow: 0 40px 100px -30px rgba(0, 0, 0, .5); animation: rise .2s ease both;
}
.modal-card h3 { margin: 0; font-size: 20px; letter-spacing: -.03em; }
.modal-sub { margin: 8px 0 20px; color: var(--muted); font-size: 13px; line-height: 1.6; }
.modal-close { position: absolute; right: 14px; top: 14px; width: 32px; height: 32px; border-radius: 9px; border: 0; background: #f3f0ea; display: grid; place-items: center; color: var(--muted); }
.modal-close:hover { background: #ebe7df; color: var(--ink); }
.modal-close svg { width: 16px; height: 16px; }
.topup-email {
  margin: 0 0 14px; padding: 12px; border-radius: 12px; background: #f7f5ff;
  border: 1px dashed #c9c2f7; text-align: center; font-weight: 700; font-size: 14px; color: #4338ca;
  word-break: break-all;
}
.site-field { display: flex; align-items: stretch; min-width: 0; }
.site-field input { flex: 1 1 auto; min-width: 0; border-radius: 12px 0 0 12px; }
.site-suffix {
  display: inline-flex; align-items: center; padding: 0 10px; flex: 0 0 auto;
  border: 1px solid #ddd8ce; border-left: 0; border-radius: 0 12px 12px 0;
  background: #f3f0ea; color: var(--muted); font-size: 11px; white-space: nowrap;
}
.site-status { min-height: 18px; margin: -2px 0 10px; font-size: 11.5px; color: var(--muted); line-height: 1.45; }
.site-status.ok { color: var(--ok); }
.site-status.bad { color: var(--danger); }
.site-status.pending { color: var(--soft); }
.settings-warning {
  margin: 0 0 13px; padding: 10px 12px; border-radius: 10px;
  background: #fffbeb; border: 1px solid #fde68a; color: #92400e; font-size: 11.5px; line-height: 1.5;
}
.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%);
  background: #17181d; color: #f4f2ec; padding: 10px 16px; border-radius: 999px;
  font-size: 12.5px; z-index: 80; box-shadow: 0 18px 40px -16px rgba(0, 0, 0, .55);
  max-width: min(92vw, 560px); text-align: center; animation: rise .2s ease both;
}

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .app-body { grid-template-columns: min(var(--sidebar-w), 260px) minmax(0, 1fr); }
  .app-shell.admin-mode .app-body { grid-template-columns: min(var(--sidebar-w), 260px) minmax(0, 1fr); }
  .rail { display: none; }
  .btn-publish-mobile { display: inline-flex; }
  .preview-mobile { display: inline-flex; }
}
@media (max-width: 820px) {
  .auth-shell { grid-template-columns: 1fr; }
  .auth-hero { padding: 22px 20px 34px; }
  .hero-window, .auth-foot { display: none; }
  .hero-copy { margin-top: 26px; }
  .hero-copy h1 { font-size: clamp(38px, 11vw, 52px); }
  .hero-sub { margin-top: 16px; font-size: 14px; }
  .hero-points { margin-top: 18px; }
  .auth-panel { padding: 0 16px 42px; }
  .auth-card { margin-top: -18px; padding: 24px; border-radius: 22px; position: relative; z-index: 2; }
  .topbar { height: 58px; }
  .topbar-right { gap: 7px; }
  .balance-label, #user-name { display: none; }
  .user-chevron { display: none; }
  .storage-chip { padding: 6px 9px; gap: 5px; }
  .storage-chip svg { width: 15px; height: 15px; }
  .storage-chip strong { font-size: 11px; }
  .user-chip { padding: 3px; gap: 0; border-color: transparent; }
  .chat-resizer, .sidebar-resizer { display: none; }
  .app-body { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); }
  .app-shell.admin-mode .app-body { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); }
  .sidebar { flex-direction: row; align-items: center; gap: 9px; padding: 9px 12px; overflow-x: auto; }
  .sidebar-top { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
  .sidebar-label, .sidebar-foot { display: none; }
  .sidebar-top .btn-new { width: auto; white-space: nowrap; padding: 8px 11px; font-size: 12px; }
  .sidebar-admin { margin-top: 0; flex: 0 0 auto; }
  .admin-menu-btn { width: auto; white-space: nowrap; padding: 8px 11px; font-size: 12px; }
  .admin-menu-btn svg { display: none; }
  .admin-menu-btn .admin-badge { top: -5px; right: -5px; border-color: #0f1115; }
  .project-list { flex-direction: row; margin: 0; padding: 0; gap: 6px; overflow-x: auto; overflow-y: hidden; flex: 0 1 auto; }
  .project-item { min-width: max-content; padding: 7px 10px; display: block; }
  .project-date { display: none; }
  .main { padding: 0 11px; }
  .chat-head { padding: 13px 3px 9px; }
  .chat-title-wrap h2 { font-size: 16px; }
  .chat-title-wrap p { display: none; }
  .messages { padding: 6px 2px 10px; gap: 9px; }
  .msg { max-width: 93%; font-size: 13.5px; }
  .activity { margin: 0 2px 8px; }
  .composer { margin: 0 2px 9px; }
  .composer-hint { display: none; }
  .empty-state { align-items: flex-start; }
  .empty-inner { padding-top: 26px; }
  .ideas { grid-template-columns: 1fr; }
  .idea { padding: 14px; }
  .toast { bottom: 14px; }
}
@media (max-width: 560px) {
  .brand-row.small .brand-name { display: none; }
  .topbar { padding: 0 12px; }
  .balance-chip { padding: 6px 10px; }
}

/* ---------- riwayat saldo ---------- */
.ledger { margin: 14px 0 4px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.ledger-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 10px 12px; background: #faf8f3; border-bottom: 1px solid var(--line); }
.ledger-head h4 { margin: 0; font-size: 12.5px; letter-spacing: .01em; }
.ledger-head span { font-size: 10.5px; color: var(--soft); }
.ledger-list { list-style: none; margin: 0; padding: 0; max-height: 260px; overflow-y: auto; }
.ledger-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 12px; border-bottom: 1px solid #f1ede4; }
.ledger-item:last-child { border-bottom: 0; }
.ledger-what { min-width: 0; }
.ledger-what b { display: block; font-size: 12px; font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ledger-what small { display: block; margin-top: 2px; font-size: 10.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ledger-amount { flex: 0 0 auto; font-size: 12.5px; font-weight: 700; font-variant-numeric: tabular-nums; }
.ledger-amount.minus { color: var(--danger); }
.ledger-amount.plus { color: var(--ok); }
.ledger-empty { padding: 14px 12px; font-size: 12px; color: var(--muted); text-align: center; }
