:root {
  --ink: #10233f;
  --muted: #64748b;
  --line: #dbe5ee;
  --paper: #f7fafc;
  --card: #ffffff;
  --teal: #148f87;
  --teal-dark: #0e6d69;
  --gold: #f0b755;
  --danger: #c64f4f;
  --shadow: 0 18px 50px rgba(16, 35, 63, .09);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: radial-gradient(circle at 80% -10%, #dff5f0 0, transparent 36%), var(--paper); }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
a { color: inherit; }
.shell { min-height: 100vh; display: grid; grid-template-columns: 248px 1fr; }
.rail { padding: 28px 18px; background: #10233f; color: #ecf7f5; display: flex; flex-direction: column; gap: 30px; }
.brand { display: flex; align-items: center; gap: 12px; font-weight: 760; letter-spacing: -.02em; font-size: 20px; }
.brand-mark { width: 36px; height: 36px; border-radius: 12px 12px 12px 4px; display: grid; place-items: center; color: #10233f; background: linear-gradient(145deg, #f6ca77, #72d2bf); font-weight: 900; }
.rail nav { display: grid; gap: 6px; }
.rail nav button { border: 0; color: #bed0df; background: transparent; text-align: left; border-radius: 11px; padding: 12px; font-size: 14px; }
.rail nav button:hover, .rail nav button.active { color: #fff; background: rgba(255,255,255,.12); }
.rail-foot { margin-top: auto; color: #9db3c4; font-size: 12px; line-height: 1.55; }
.main { padding: 28px clamp(20px, 4vw, 56px) 56px; max-width: 1440px; width: 100%; }
.topbar { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 26px; }
.eyebrow { color: var(--teal); font-size: 12px; font-weight: 760; letter-spacing: .12em; text-transform: uppercase; }
h1, h2, h3, p { margin-top: 0; }
h1 { font-size: clamp(26px, 3vw, 38px); line-height: 1.1; letter-spacing: -.04em; margin-bottom: 8px; }
h2 { font-size: 20px; letter-spacing: -.025em; margin-bottom: 5px; }
h3 { font-size: 15px; margin-bottom: 7px; }
.subtle { color: var(--muted); font-size: 14px; line-height: 1.55; }
.grid { display: grid; gap: 18px; }
.stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.two { grid-template-columns: 1.35fr .9fr; }
.card { background: var(--card); border: 1px solid rgba(219, 229, 238, .85); border-radius: 18px; box-shadow: var(--shadow); padding: 22px; }
.stat { min-height: 126px; display: flex; flex-direction: column; justify-content: space-between; }
.stat .label { color: var(--muted); font-size: 13px; }
.stat .value { font-size: 30px; font-weight: 780; letter-spacing: -.04em; }
.stat .hint { color: var(--teal-dark); font-size: 12px; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.btn { border: 1px solid var(--line); background: #fff; color: var(--ink); border-radius: 10px; padding: 10px 14px; font-weight: 650; font-size: 13px; }
.btn:hover { border-color: #9fb5c6; transform: translateY(-1px); }
.btn.primary { background: var(--teal); border-color: var(--teal); color: white; }
.btn.primary:hover { background: var(--teal-dark); }
.btn.ghost { border-color: transparent; background: #edf7f5; color: var(--teal-dark); }
.btn.danger { color: var(--danger); border-color: #f1cccc; background: #fff8f8; }
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 13px; }
th, td { padding: 13px 10px; border-bottom: 1px solid #edf1f5; text-align: left; white-space: nowrap; }
th { color: var(--muted); font-weight: 650; font-size: 12px; }
td strong { font-weight: 720; }
.pill { display: inline-flex; align-items: center; gap: 6px; border-radius: 99px; padding: 5px 9px; font-size: 11px; font-weight: 720; }
.pill.good { color: #137664; background: #e1f5ef; }
.pill.off { color: #a44949; background: #fbe8e8; }
.pill.wait { color: #8c691e; background: #fff4d7; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.empty { padding: 38px 20px; text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: 14px; }
.form-grid { display: grid; gap: 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.field { display: grid; gap: 7px; }
.field.full { grid-column: 1 / -1; }
label { color: var(--muted); font-size: 13px; font-weight: 650; }
input, textarea, select { width: 100%; border: 1px solid var(--line); border-radius: 10px; background: white; padding: 11px 12px; color: var(--ink); outline: none; }
input:focus, textarea:focus, select:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(20,143,135,.12); }
textarea { min-height: 130px; resize: vertical; }
.notice { border-radius: 12px; padding: 12px 14px; font-size: 13px; line-height: 1.5; }
.notice.info { color: #1e5c66; background: #e8f6f5; }
.notice.error { color: #963f43; background: #fff0f0; }
.notice.success { color: #196b56; background: #e7f7ef; }
.login { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: radial-gradient(circle at 20% 10%, #dff5f0, transparent 38%), #10233f; }
.login-card { width: min(440px, 100%); background: white; border-radius: 24px; padding: 34px; box-shadow: 0 30px 90px rgba(0,0,0,.25); }
.login-card .brand { color: var(--ink); margin-bottom: 28px; }
.login-card form { display: grid; gap: 15px; }
.login-card .btn { margin-top: 7px; padding: 13px 15px; }
.hero-panel { background: linear-gradient(135deg, #10233f 0%, #164c5a 58%, #148f87 100%); color: white; border: 0; overflow: hidden; position: relative; }
.hero-panel:after { content: ""; position: absolute; width: 260px; height: 260px; border-radius: 50%; border: 32px solid rgba(255,255,255,.08); right: -70px; top: -75px; }
.hero-panel .subtle { color: #c8e2e2; }
.hero-panel .eyebrow { color: #f6ca77; }
.balance { font-size: clamp(38px, 6vw, 62px); font-weight: 800; letter-spacing: -.06em; margin: 12px 0 6px; }
.studio-shell { min-height: 100vh; background: #f5f8f8; }
.studio-header { display: flex; align-items: center; justify-content: space-between; padding: 18px clamp(18px, 5vw, 70px); background: #10233f; color: white; }
.studio-header .brand { color: white; }
.studio-main { max-width: 1200px; margin: 0 auto; padding: 36px 20px 60px; }
.studio-layout { display: grid; grid-template-columns: 1.1fr .9fr; gap: 20px; align-items: start; }
.prompt-area { min-height: 250px; font-size: 17px; line-height: 1.55; }
.dropzone { border: 1.5px dashed #abc5c8; border-radius: 14px; background: #f4fbfa; padding: 20px; text-align: center; color: var(--muted); }
.preview-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.preview { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 12px; background: #10233f; border: 1px solid var(--line); }
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid #edf1f5; }
.setting-row:last-child { border-bottom: 0; }
.brand-lockup { display: flex; align-items: center; gap: 10px; }
.small { font-size: 12px; color: var(--muted); }
.mobile-only { display: none; }
@media (max-width: 960px) {
  .shell { grid-template-columns: 1fr; }
  .rail { padding: 16px 18px; flex-direction: row; align-items: center; gap: 16px; position: sticky; top: 0; z-index: 5; }
  .rail nav { display: flex; overflow-x: auto; flex: 1; }
  .rail nav button { white-space: nowrap; }
  .rail-foot { display: none; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .two, .studio-layout { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .main { padding: 22px 14px 40px; }
  .stats { grid-template-columns: 1fr; }
  .card { padding: 17px; border-radius: 15px; }
  .topbar { display: block; }
  .topbar .actions { margin-top: 15px; }
  .form-grid { grid-template-columns: 1fr; }
  .field.full { grid-column: auto; }
  .login-card { padding: 24px; }
  .studio-header { padding: 15px 16px; }
  .studio-main { padding: 24px 14px 40px; }
}
