:root {
  --ink: #111722;
  --muted: #657084;
  --muted-2: #929bad;
  --line: #e7eaf0;
  --line-strong: #dce1e9;
  --paper: #ffffff;
  --canvas: #f6f7f9;
  --sidebar: #080b12;
  --sidebar-2: #0d1320;
  --blue: #1677ff;
  --blue-2: #085fd6;
  --blue-soft: #edf5ff;
  --green: #16875b;
  --green-soft: #eaf8f1;
  --amber: #a66a08;
  --amber-soft: #fff7e8;
  --red: #c44343;
  --red-soft: #fff0f0;
  --violet: #7655d8;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.05);
  --shadow-md: 0 10px 32px rgba(16, 24, 40, 0.09);
  --radius-sm: 7px;
  --radius: 10px;
  --radius-lg: 14px;
  --font: "DM Sans", Inter, system-ui, sans-serif;
  --mono: "JetBrains Mono", monospace;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --ink: #edf2f8;
  --muted: #a0adbf;
  --muted-2: #77869b;
  --line: #252e3d;
  --line-strong: #323d50;
  --paper: #111722;
  --canvas: #0b1019;
  --blue-soft: #102846;
  --green-soft: #102c24;
  --amber-soft: #342811;
  --red-soft: #351a1f;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .28);
  --shadow-md: 0 12px 38px rgba(0, 0, 0, .32);
}

* { box-sizing: border-box; }
html, body, #app { min-height: 100%; }
html { color-scheme: light; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--canvas);
  font-family: var(--font);
  font-size: 13px;
  -webkit-font-smoothing: antialiased;
}
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
svg { display: block; }

.icon { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: 0 0 auto; }
.icon--sm { width: 14px; height: 14px; }
.icon--lg { width: 19px; height: 19px; }

.app-loading { min-height: 100vh; display: grid; place-items: center; background: var(--canvas); padding: 24px; text-align: center; }
.app-loading > div { display: grid; justify-items: center; gap: 8px; }
.app-loading-mark { width: 42px; height: 42px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 12px; color: var(--blue); background: var(--paper); box-shadow: var(--shadow-sm); animation: pulse 1.2s infinite; }
.app-loading strong { margin-top: 4px; font-size: 13px; }
.app-loading p { margin: 0; color: var(--muted); font-size: 10px; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 224px minmax(0, 1fr); }
.sidebar {
  position: sticky; top: 0; height: 100vh; z-index: 30;
  display: flex; flex-direction: column; overflow: auto;
  color: #aab4c5; background: linear-gradient(180deg, #070a10 0%, #0a101b 100%);
  border-right: 1px solid rgba(255,255,255,.06); padding: 16px 12px 12px;
}
.brand { height: 52px; display: flex; align-items: center; gap: 10px; color: #fff; padding: 0 4px; margin-bottom: 14px; }
.brand img {
  width: 60px;
  height: 40px;
  object-fit: contain;
  object-position: center;
}
.brand span { font-size: 15px; font-weight: 600; letter-spacing: .18em; }
.workspace-switcher {
  width: 100%; border: 1px solid rgba(255,255,255,.09); color: #ecf1f8; background: rgba(255,255,255,.035);
  border-radius: 9px; padding: 8px; display: flex; align-items: center; gap: 9px; cursor: pointer; text-align: left;
}
.workspace-switcher:hover { background: rgba(255,255,255,.065); }
.workspace-avatar { width: 25px; height: 25px; border-radius: 6px; display: grid; place-items: center; color: white; font-weight: 700; background: linear-gradient(145deg, #2791ff, #115bd5); box-shadow: 0 4px 12px rgba(22,119,255,.28); }
.workspace-meta { min-width: 0; flex: 1; }
.workspace-meta strong, .workspace-meta span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.workspace-meta strong { font-size: 12px; color: #edf2f8; font-weight: 600; }
.workspace-meta span { margin-top: 1px; font-size: 10px; color: #77849a; }
.nav { margin-top: 15px; display: grid; gap: 2px; }
.nav-label { padding: 15px 9px 6px; color: #59677d; font-size: 9px; font-weight: 700; letter-spacing: .13em; text-transform: uppercase; }
.nav-item {
  height: 34px; display: flex; align-items: center; gap: 10px; padding: 0 9px;
  border-radius: 7px; color: #9aa6b8; font-size: 12px; font-weight: 500; transition: .16s ease;
}
.nav-item:hover { color: #eaf1fb; background: rgba(255,255,255,.045); }
.nav-item.active { color: #fff; background: linear-gradient(90deg, rgba(22,119,255,.27), rgba(22,119,255,.12)); box-shadow: inset 2px 0 var(--blue); }
.nav-item .count { margin-left: auto; min-width: 18px; padding: 1px 5px; border-radius: 999px; color: #8290a4; background: rgba(255,255,255,.06); font-size: 9px; text-align: center; }
.plan-card { margin-top: auto; border: 1px solid rgba(255,255,255,.08); border-radius: 9px; background: rgba(255,255,255,.025); padding: 10px; }
.plan-row { display: flex; justify-content: space-between; align-items: center; color: #e8eef7; font-size: 11px; }
.plan-row button { border: 0; color: #8abaff; background: transparent; padding: 0; font-size: 10px; cursor: pointer; }
.mini-progress { height: 3px; margin: 9px 0 7px; border-radius: 9px; background: rgba(255,255,255,.09); overflow: hidden; }
.mini-progress > span { display: block; width: 37%; height: 100%; background: var(--blue); border-radius: inherit; }
.plan-caption { color: #68768b; font-size: 9px; line-height: 1.5; }

.main { min-width: 0; }
.topbar {
  position: sticky; top: 0; z-index: 20; height: 56px; display: flex; align-items: center; gap: 14px;
  border-bottom: 1px solid var(--line); background: rgba(255,255,255,.93); backdrop-filter: blur(16px); padding: 0 20px;
}
.menu-toggle { display: none; }
.search {
  width: min(430px, 42vw); height: 32px; display: flex; align-items: center; gap: 8px; border: 1px solid var(--line);
  border-radius: 7px; color: var(--muted-2); background: #f8f9fb; padding: 0 10px;
}
.search:focus-within { border-color: #b8d6ff; box-shadow: 0 0 0 3px rgba(22,119,255,.08); background: white; }
.search input { width: 100%; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 11px; }
.search kbd { border: 1px solid #e0e4eb; border-radius: 4px; background: white; padding: 1px 4px; color: var(--muted-2); font-size: 9px; }
.topbar-spacer { flex: 1; }
.icon-btn {
  width: 32px; height: 32px; display: grid; place-items: center; border: 1px solid transparent; border-radius: 7px;
  background: transparent; color: #657084; cursor: pointer; position: relative;
}
.icon-btn:hover { border-color: var(--line); color: var(--ink); background: #f8f9fb; }
.notification-dot { position: absolute; right: 5px; top: 5px; width: 5px; height: 5px; border: 1px solid white; border-radius: 50%; background: var(--blue); }
.account-button { border: 0; background: transparent; display: flex; align-items: center; gap: 8px; padding: 3px 4px 3px 6px; border-radius: 8px; cursor: pointer; }
.account-button:hover { background: #f4f6f8; }
.avatar { width: 27px; height: 27px; display: grid; place-items: center; border-radius: 50%; color: white; background: linear-gradient(145deg, #182b48, #1677ff); font-size: 10px; font-weight: 700; }
.account-copy { text-align: right; }
.account-copy strong, .account-copy span { display: block; }
.account-copy strong { font-size: 10px; font-weight: 600; }
.account-copy span { color: var(--muted-2); font-size: 9px; }

.btn {
  height: 32px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid var(--line-strong);
  border-radius: 7px; color: #344054; background: white; padding: 0 11px; box-shadow: var(--shadow-sm); cursor: pointer;
  font-size: 11px; font-weight: 600; transition: .14s ease; white-space: nowrap;
}
.btn:hover { border-color: #c7cdd7; background: #fafbfc; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn--primary { border-color: var(--blue); color: white; background: linear-gradient(180deg, #2687ff, #0c68ea); box-shadow: 0 1px 2px rgba(0,75,177,.24), inset 0 1px rgba(255,255,255,.2); }
.btn--primary:hover { border-color: #075fcf; background: linear-gradient(180deg, #1b7ff9, #075fcf); }
.btn--quiet { border-color: transparent; background: transparent; box-shadow: none; }
.btn--danger { color: var(--red); border-color: #f2cece; background: var(--red-soft); }
.btn--lg { height: 39px; padding: 0 15px; font-size: 12px; }
.btn--full { width: 100%; }

.page { padding: 20px; max-width: 1540px; margin: 0 auto; }
.page-head { min-height: 50px; display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 17px; }
.page-head h1 { margin: 0; font-size: 20px; line-height: 1.25; letter-spacing: -.02em; }
.page-head p { margin: 5px 0 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.head-actions { display: flex; align-items: center; gap: 8px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.section-heading h2 { margin: 0; font-size: 12px; font-weight: 700; }
.section-heading a, .section-heading button { border: 0; background: transparent; color: var(--blue); font-size: 10px; cursor: pointer; }

.workflow {
  display: grid; grid-template-columns: repeat(5, 1fr); align-items: center; gap: 0; margin-bottom: 18px; padding: 12px 15px;
  border: 1px solid var(--line); border-radius: var(--radius); background: white;
}
.workflow-step { position: relative; display: flex; align-items: center; gap: 8px; color: var(--muted-2); min-width: 0; }
.workflow-step:not(:last-child)::after { content: ""; position: absolute; left: calc(100% - 18px); right: 16px; top: 12px; height: 1px; background: #dfe4ec; }
.workflow-step.done:not(:last-child)::after, .workflow-step.active:not(:last-child)::after { background: #94bfff; }
.workflow-dot { position: relative; z-index: 1; width: 25px; height: 25px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; background: #f6f7f9; color: #7d8797; }
.workflow-step.done .workflow-dot { border-color: #b9decf; color: var(--green); background: var(--green-soft); }
.workflow-step.active .workflow-dot { border-color: var(--blue); color: white; background: var(--blue); box-shadow: 0 0 0 4px rgba(22,119,255,.1); }
.workflow-copy { min-width: 0; }
.workflow-copy strong, .workflow-copy span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.workflow-copy strong { color: #5f6a7c; font-size: 10px; }
.workflow-copy span { margin-top: 1px; font-size: 9px; }
.workflow-step.active .workflow-copy strong { color: var(--ink); }

.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(280px, .72fr) minmax(250px, .62fr); gap: 14px; align-items: start; }
.stack { display: grid; gap: 14px; }
.panel { border: 1px solid var(--line); border-radius: var(--radius); background: white; box-shadow: var(--shadow-sm); overflow: hidden; }
.panel-head { min-height: 42px; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 0 13px; border-bottom: 1px solid var(--line); }
.panel-head h2 { margin: 0; font-size: 11px; font-weight: 700; }
.panel-body { padding: 13px; }
.panel--flush .panel-body { padding: 0; }

.data-table { width: 100%; border-collapse: collapse; }
.data-table th { height: 30px; padding: 0 12px; color: var(--muted-2); background: #fbfcfd; font-size: 9px; font-weight: 600; text-align: left; border-bottom: 1px solid var(--line); }
.data-table td { height: 52px; padding: 7px 12px; border-bottom: 1px solid var(--line); font-size: 10px; vertical-align: middle; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table tbody tr { cursor: pointer; }
.data-table tbody tr:hover { background: #fafcff; }
.project-cell { display: flex; align-items: center; gap: 9px; min-width: 180px; }
.thumb { width: 43px; height: 34px; flex: 0 0 auto; position: relative; overflow: hidden; border: 1px solid #dae3f0; border-radius: 5px; background: linear-gradient(135deg, #fff 48%, #e7f2ff 48%); }
.thumb::before { content: ""; position: absolute; right: -7px; bottom: -12px; width: 35px; height: 35px; border-radius: 50%; background: #1677ff; opacity: .8; }
.thumb::after { content: "L"; position: absolute; left: 5px; top: 5px; color: #0b3d91; font-size: 8px; font-weight: 800; }
.thumb.purple { background: linear-gradient(135deg, #15182a 48%, #eeeaff 48%); }
.thumb.purple::before { background: #7859d9; }
.thumb.green { background: linear-gradient(135deg, #fff 50%, #e4faf1 50%); }
.thumb.green::before { background: #17a36b; }
.cell-title { display: block; color: #273142; font-weight: 600; font-size: 10px; }
.cell-sub { display: block; margin-top: 2px; color: var(--muted-2); font-size: 9px; }
.status { display: inline-flex; align-items: center; gap: 5px; height: 20px; border-radius: 999px; padding: 0 7px; color: #576274; background: #f4f5f7; font-size: 9px; font-weight: 600; }
.status::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.status--green { color: var(--green); background: var(--green-soft); }
.status--blue { color: var(--blue-2); background: var(--blue-soft); }
.status--amber { color: var(--amber); background: var(--amber-soft); }
.status--red { color: var(--red); background: var(--red-soft); }
.status--gray { color: #6d7684; background: #f2f3f5; }
.avatars { display: flex; }
.avatars span { width: 20px; height: 20px; display: grid; place-items: center; margin-left: -5px; border: 2px solid white; border-radius: 50%; color: white; background: #304b73; font-size: 7px; font-weight: 700; }
.avatars span:first-child { margin-left: 0; }
.avatars span:nth-child(2) { background: #9d5d67; }
.avatars span:nth-child(3) { background: #5d8b71; }

.preview-card { padding: 12px; }
.design-preview {
  position: relative; overflow: hidden; min-height: 196px; border: 1px solid #dbe4f0; border-radius: 8px;
  background: linear-gradient(135deg, white 0 54%, #e7f2ff 54% 100%); padding: 18px;
}
.design-preview::before, .design-preview::after { content: ""; position: absolute; border-radius: 50%; background: rgba(22,119,255,.12); }
.design-preview::before { width: 185px; height: 185px; right: -50px; bottom: -80px; border: 34px solid #1677ff; background: transparent; }
.design-preview::after { width: 95px; height: 95px; right: 22px; bottom: 14px; background: linear-gradient(145deg, #0d2f64, #1677ff); border: 7px solid white; }
.design-preview h3 { position: relative; z-index: 1; width: 64%; margin: 0; color: #0a3587; font-size: 24px; line-height: .9; letter-spacing: -.05em; text-transform: uppercase; }
.design-preview p { position: relative; z-index: 1; width: 52%; margin: 15px 0 0; color: #375274; font-size: 8px; line-height: 1.45; }
.asset-preview { width: 100%; height: 100%; min-height: 260px; display: block; border: 0; object-fit: contain; background: #eef1f5; }
.asset-preview.compact { min-height: 0; object-fit: cover; }
.asset-preview-empty { min-height: 260px; display: grid; place-items: center; color: var(--muted-2); background: #eef1f5; font-size: 10px; }
.asset-preview-empty.compact { min-height: 100%; }
.preview-meta { display: flex; align-items: center; justify-content: space-between; margin-top: 11px; }
.preview-meta strong { font-size: 11px; }
.preview-stats { display: grid; grid-template-columns: repeat(4,1fr); margin: 12px 0; padding: 9px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.preview-stat { text-align: center; border-right: 1px solid var(--line); }
.preview-stat:last-child { border: 0; }
.preview-stat strong, .preview-stat span { display: block; }
.preview-stat strong { font-size: 11px; }
.preview-stat span { margin-top: 1px; color: var(--muted-2); font-size: 8px; }

.job-card { display: grid; grid-template-columns: 66px 1fr auto; gap: 12px; align-items: center; padding: 12px; }
.job-preview { height: 66px; border: 1px solid #d9e5f4; border-radius: 6px; background: linear-gradient(135deg, #fff 45%, #dcecff 45%); position: relative; overflow: hidden; }
.job-preview::after { content: ""; position: absolute; right: -14px; bottom: -20px; width: 55px; height: 55px; border-radius: 50%; border: 12px solid #1677ff; }
.job-copy strong { display: block; font-size: 10px; }
.job-copy span { display: block; margin-top: 3px; color: var(--muted-2); font-size: 9px; }
.progress-track { height: 4px; margin-top: 12px; overflow: hidden; border-radius: 999px; background: #edf0f4; }
.progress-track span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--blue), #51a2ff); transition: width .35s ease; }
.job-eta { padding-left: 12px; border-left: 1px solid var(--line); text-align: right; }
.job-eta span { display: block; color: var(--muted-2); font-size: 8px; }
.job-eta strong { display: block; margin-top: 4px; font-size: 15px; }

.metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
.metric { border: 1px solid var(--line); border-radius: 7px; padding: 8px; }
.metric strong, .metric span, .metric small { display: block; }
.metric strong { font-size: 14px; }
.metric span { margin-top: 2px; color: var(--muted); font-size: 8px; }
.metric small { margin-top: 4px; color: var(--green); font-size: 7px; }
.chart { height: 104px; position: relative; margin-top: 12px; background: repeating-linear-gradient(to bottom, transparent 0 25px, #eef1f5 25px 26px); }
.chart svg { width: 100%; height: 100%; overflow: visible; }
.activity-list, .export-list, .layer-list { display: grid; }
.activity-item, .export-item { min-height: 45px; display: flex; align-items: center; gap: 9px; padding: 8px 12px; border-bottom: 1px solid var(--line); }
.activity-item:last-child, .export-item:last-child { border: 0; }
.activity-icon { width: 20px; height: 20px; display: grid; place-items: center; border-radius: 50%; color: var(--green); background: var(--green-soft); }
.activity-icon.blue { color: var(--blue); background: var(--blue-soft); }
.activity-icon.amber { color: var(--amber); background: var(--amber-soft); }
.activity-copy { min-width: 0; flex: 1; }
.activity-copy strong, .activity-copy span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.activity-copy strong { font-size: 9px; font-weight: 500; }
.activity-copy span { margin-top: 2px; color: var(--muted-2); font-size: 8px; }
.activity-time { color: var(--muted-2); font-size: 8px; white-space: nowrap; }
.file-icon { width: 25px; height: 28px; display: grid; place-items: center; border: 1px solid var(--line-strong); border-radius: 5px; color: var(--blue); background: #fafcff; font-family: var(--mono); font-size: 7px; }

.toolbar { display: flex; align-items: center; gap: 8px; margin-bottom: 13px; }
.field { display: grid; gap: 5px; }
.field label { color: #596477; font-size: 10px; font-weight: 600; }
.input, .select, .textarea {
  width: 100%; border: 1px solid var(--line-strong); border-radius: 7px; outline: 0; color: var(--ink); background: white; padding: 8px 9px; font-size: 11px;
}
.input:focus, .select:focus, .textarea:focus { border-color: #9ac6ff; box-shadow: 0 0 0 3px rgba(22,119,255,.08); }
.textarea { min-height: 82px; resize: vertical; line-height: 1.5; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 15px; }
.empty { min-height: 170px; display: grid; place-items: center; color: var(--muted); text-align: center; padding: 24px; }
.empty strong { display: block; color: var(--ink); font-size: 13px; }
.empty span { display: block; margin-top: 5px; font-size: 10px; line-height: 1.5; }

.projects-layout { display: grid; grid-template-columns: minmax(0, 1fr) 270px; gap: 14px; }
.filter-bar { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.filter-bar .input { max-width: 280px; }
.filter-chip { height: 29px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); background: white; padding: 0 10px; cursor: pointer; font-size: 10px; }
.filter-chip.active { border-color: #bbd8ff; color: var(--blue-2); background: var(--blue-soft); }
.project-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 11px; }
.project-card { border: 1px solid var(--line); border-radius: var(--radius); background: white; overflow: hidden; cursor: pointer; transition: .15s ease; }
.project-card:hover { transform: translateY(-1px); border-color: #cfd8e5; box-shadow: var(--shadow-md); }
.project-visual { height: 125px; display: grid; place-items: center; background: #f6f8fb; padding: 13px; }
.project-visual .design-preview { width: 100%; min-height: 100%; padding: 10px; }
.project-visual .design-preview h3 { font-size: 16px; }
.project-visual .design-preview p { margin-top: 7px; font-size: 6px; }
.project-card-body { padding: 11px; }
.project-card-title { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.project-card-title strong { font-size: 11px; }
.project-card-meta { margin-top: 7px; display: flex; align-items: center; justify-content: space-between; color: var(--muted-2); font-size: 9px; }

.upload-layout { display: grid; grid-template-columns: minmax(0, 1fr) 315px; gap: 14px; }
.dropzone {
  min-height: 310px; display: grid; place-items: center; border: 1px dashed #a9c8ed; border-radius: var(--radius);
  background: radial-gradient(circle at 50% 40%, #f3f8ff 0, #fafcff 58%, white 100%); text-align: center; padding: 25px; transition: .15s ease;
}
.dropzone.dragover { border-color: var(--blue); background: var(--blue-soft); }
.upload-glyph { width: 46px; height: 46px; margin: 0 auto 15px; display: grid; place-items: center; border: 1px solid #cfe2fa; border-radius: 12px; color: var(--blue); background: white; box-shadow: 0 8px 20px rgba(22,119,255,.1); }
.dropzone h2 { margin: 0; font-size: 15px; }
.dropzone p { max-width: 360px; margin: 7px auto 15px; color: var(--muted); font-size: 10px; line-height: 1.6; }
.formats { display: flex; justify-content: center; gap: 5px; margin-top: 14px; }
.format { border: 1px solid var(--line); border-radius: 5px; color: var(--muted); background: white; padding: 4px 6px; font-family: var(--mono); font-size: 7px; }
.check-list { display: grid; gap: 10px; }
.check-item { display: flex; align-items: flex-start; gap: 9px; }
.check-icon { width: 19px; height: 19px; display: grid; place-items: center; border-radius: 50%; color: var(--green); background: var(--green-soft); }
.check-item strong, .check-item span { display: block; }
.check-item strong { font-size: 10px; }
.check-item span { margin-top: 2px; color: var(--muted-2); font-size: 9px; line-height: 1.45; }

.process-layout { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 14px; }
.process-hero { display: grid; grid-template-columns: 170px minmax(0,1fr); gap: 20px; padding: 18px; }
.source-preview { min-height: 210px; }
.source-preview .design-preview { min-height: 210px; }
.process-summary h2 { margin: 2px 0 5px; font-size: 16px; }
.process-summary > p { margin: 0; color: var(--muted); font-size: 10px; }
.big-progress { height: 6px; margin: 19px 0 8px; border-radius: 999px; background: #edf0f4; overflow: hidden; }
.big-progress span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--blue), #4da5ff); transition: width .35s ease; }
.process-percent { display: flex; justify-content: space-between; color: var(--muted); font-size: 9px; }
.process-tasks { margin-top: 17px; display: grid; gap: 1px; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--line); }
.process-task { display: flex; align-items: center; gap: 9px; min-height: 39px; background: white; padding: 0 10px; }
.task-state { width: 17px; height: 17px; display: grid; place-items: center; border-radius: 50%; color: var(--muted-2); background: #f3f4f6; }
.process-task.done .task-state { color: var(--green); background: var(--green-soft); }
.process-task.active .task-state { color: var(--blue); background: var(--blue-soft); animation: pulse 1.2s infinite; }
.process-task strong { flex: 1; font-size: 10px; font-weight: 500; }
.process-task span { color: var(--muted-2); font-size: 8px; }
@keyframes pulse { 50% { box-shadow: 0 0 0 4px rgba(22,119,255,.12); } }

.confidence-score { display: flex; align-items: center; gap: 12px; }
.confidence-ring { width: 74px; height: 74px; display: grid; place-items: center; border-radius: 50%; background: conic-gradient(var(--green) 0 94%, #edf0f4 94%); position: relative; }
.confidence-ring::before { content: ""; position: absolute; inset: 7px; border-radius: 50%; background: white; }
.confidence-ring strong { position: relative; font-size: 16px; }
.confidence-copy strong, .confidence-copy span { display: block; }
.confidence-copy strong { color: var(--green); font-size: 11px; }
.confidence-copy span { margin-top: 4px; color: var(--muted); font-size: 9px; line-height: 1.5; }

.review-layout { display: grid; grid-template-columns: 245px minmax(0,1fr) 285px; gap: 12px; }
.review-canvas { min-height: 610px; display: grid; place-items: center; padding: 26px; background-color: #eef1f5; background-image: radial-gradient(#cdd3dd 1px, transparent 1px); background-size: 14px 14px; }
.review-canvas .design-preview { width: min(440px, 85%); min-height: 440px; padding: 36px; box-shadow: 0 18px 50px rgba(25,45,75,.14); }
.review-canvas .design-preview h3 { font-size: 42px; }
.review-canvas .design-preview p { font-size: 12px; }
.layer-row { min-height: 42px; display: grid; grid-template-columns: 22px minmax(0,1fr) auto; align-items: center; gap: 7px; padding: 0 10px; border-bottom: 1px solid var(--line); cursor: pointer; }
.layer-row:last-child { border: 0; }
.layer-row:hover, .layer-row.selected { background: #f5f9ff; }
.editor-layer-row { min-height: 42px; display: grid; grid-template-columns: minmax(0,1fr) 28px 28px; align-items: center; border-bottom: 1px solid var(--line); }
.editor-layer-row.selected { background: #f5f9ff; }
.editor-layer-main { min-width: 0; height: 42px; display: grid; grid-template-columns: 22px minmax(0,1fr); align-items: center; gap: 7px; border: 0; color: inherit; background: transparent; padding: 0 6px 0 10px; text-align: left; cursor: pointer; }
.layer-control { width: 26px; height: 26px; display: grid; place-items: center; border: 0; border-radius: 5px; color: var(--muted-2); background: transparent; cursor: pointer; }
.layer-control:hover { color: var(--blue); background: var(--blue-soft); }
.layer-kind { width: 20px; height: 20px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 5px; color: var(--blue); background: white; }
.layer-copy strong, .layer-copy span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.layer-copy strong { font-size: 9px; }
.layer-copy span { margin-top: 1px; color: var(--muted-2); font-size: 8px; }
.confidence { font-family: var(--mono); font-size: 8px; color: var(--green); }
.confidence.low { color: var(--amber); }
.inspector { display: grid; gap: 11px; }
.segmented { display: grid; grid-template-columns: repeat(2,1fr); padding: 2px; border: 1px solid var(--line); border-radius: 7px; background: #f5f6f8; }
.segmented button { height: 26px; border: 0; border-radius: 5px; background: transparent; color: var(--muted); font-size: 9px; cursor: pointer; }
.segmented button.active { color: var(--ink); background: white; box-shadow: var(--shadow-sm); }

.editor-layout { display: grid; grid-template-columns: 220px minmax(0,1fr) 270px; height: calc(100vh - 92px); min-height: 650px; border: 1px solid var(--line); border-radius: var(--radius); background: white; overflow: hidden; }
.editor-rail { min-width: 0; border-right: 1px solid var(--line); background: white; overflow: auto; }
.editor-rail.right { border-left: 1px solid var(--line); border-right: 0; }
.editor-rail-head { height: 41px; display: flex; align-items: center; justify-content: space-between; padding: 0 10px; border-bottom: 1px solid var(--line); font-size: 10px; font-weight: 700; }
.editor-center { min-width: 0; display: grid; grid-template-rows: 41px minmax(0,1fr) 29px; background: #eceff3; }
.editor-toolbar { display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); background: white; padding: 0 9px; }
.tool-group { display: flex; align-items: center; gap: 4px; }
.tool-button { width: 27px; height: 27px; display: grid; place-items: center; border: 1px solid transparent; border-radius: 5px; color: var(--muted); background: transparent; cursor: pointer; }
.tool-button:hover, .tool-button.active { border-color: var(--line); color: var(--blue); background: var(--blue-soft); }
.canvas-area { min-height: 0; position: relative; overflow: auto; display: grid; place-items: center; padding: 35px 35px 145px; background-image: radial-gradient(#cdd3dd 1px, transparent 1px); background-size: 16px 16px; }
.konva-shell { overflow: hidden; background: white; box-shadow: 0 18px 52px rgba(22,35,58,.18); }
.konva-shell canvas { display: block; }
.canvas-empty { width: 420px; max-width: 80vw; display: grid; place-items: center; min-height: 220px; color: var(--muted); background: white; padding: 32px; text-align: center; box-shadow: 0 18px 52px rgba(22,35,58,.12); }
.artboard {
  width: 560px; height: 560px; position: relative; overflow: hidden; color: #10244a; background: linear-gradient(135deg, #fff 0 55%, #e5f1ff 55%);
  box-shadow: 0 18px 52px rgba(22,35,58,.18); transform-origin: center;
}
.art-layer { position: absolute; }
.art-layer.selected { outline: 2px solid var(--blue); outline-offset: 4px; }
.art-layer.selected::after { content: ""; position: absolute; right: -7px; bottom: -7px; width: 7px; height: 7px; border: 1px solid white; background: var(--blue); }
.art-headline { left: 42px; top: 54px; width: 290px; color: #0b3d91; font-size: 48px; font-weight: 700; line-height: .92; letter-spacing: -.06em; text-transform: uppercase; }
.art-subtitle { left: 45px; top: 210px; width: 230px; color: #365377; font-size: 14px; line-height: 1.45; }
.art-date { left: 45px; top: 300px; color: #14243e; font-size: 12px; font-weight: 700; line-height: 1.5; }
.art-orbit { right: -115px; bottom: -150px; width: 410px; height: 410px; border: 74px solid var(--blue); border-radius: 50%; opacity: .92; }
.art-portrait { right: 52px; bottom: 55px; width: 180px; height: 180px; border: 12px solid white; border-radius: 50%; background: radial-gradient(circle at 50% 32%, #d6a178 0 15%, #182b48 16% 36%, #0e5abd 37% 100%); box-shadow: 0 12px 24px rgba(8,41,91,.24); }
.art-label { right: 35px; bottom: 42px; width: 220px; border-radius: 5px; color: white; background: #0b3d91; padding: 11px 13px; font-size: 12px; font-weight: 700; text-align: center; box-shadow: 0 8px 20px rgba(6,40,92,.25); }
.canvas-status { display: flex; align-items: center; justify-content: space-between; border-top: 1px solid var(--line); color: var(--muted-2); background: white; padding: 0 9px; font-size: 8px; }
.properties { padding: 11px; display: grid; gap: 10px; }
.properties form { display: grid; gap: 10px; }
.property-row { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.color-field { height: 29px; display: flex; align-items: center; gap: 7px; border: 1px solid var(--line-strong); border-radius: 6px; padding: 0 7px; font-family: var(--mono); font-size: 8px; }
.color-swatch { width: 14px; height: 14px; border-radius: 3px; background: var(--blue); }
.ai-dock { position: absolute; left: 50%; bottom: 46px; width: min(560px, calc(100% - 40px)); transform: translateX(-50%); border: 1px solid #d9e0ea; border-radius: 12px; background: rgba(255,255,255,.96); box-shadow: 0 16px 38px rgba(18,32,54,.16); padding: 8px; backdrop-filter: blur(12px); }
.ai-input-row { display: flex; align-items: center; gap: 8px; }
.ai-input-row input { flex: 1; border: 0; outline: 0; font-size: 10px; }
.ai-history { max-height: 125px; overflow: auto; display: grid; gap: 5px; margin-bottom: 6px; }
.ai-message { border-radius: 6px; color: var(--muted); background: #f6f7f9; padding: 7px 8px; font-size: 9px; line-height: 1.45; }
.ai-message.user { color: #0a4da9; background: var(--blue-soft); }

.settings-layout { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 15px; }
.settings-nav { display: grid; align-content: start; gap: 3px; }
.settings-nav button { height: 34px; display: flex; align-items: center; gap: 8px; border: 0; border-radius: 7px; color: var(--muted); background: transparent; padding: 0 9px; cursor: pointer; font-size: 10px; text-align: left; }
.settings-nav button.active { color: var(--blue-2); background: var(--blue-soft); }
.settings-nav button:disabled { opacity: .38; cursor: not-allowed; }
.settings-content { max-width: 980px; }
.settings-section { border-bottom: 1px solid var(--line); padding: 0 0 18px; margin-bottom: 18px; }
.settings-section:last-child { border: 0; }
.settings-section h2 { margin: 0 0 4px; font-size: 12px; }
.settings-section > p { margin: 0 0 13px; color: var(--muted); font-size: 10px; line-height: 1.5; }
.profile-summary { display: flex; align-items: center; gap: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--canvas); padding: 13px; margin-bottom: 20px; }
.profile-avatar { width: 43px; height: 43px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 12px; color: white; background: linear-gradient(145deg, #182b48, #1677ff); font-size: 13px; font-weight: 700; }
.profile-summary > div { min-width: 0; flex: 1; }
.profile-summary strong, .profile-summary span { display: block; }
.profile-summary strong { font-size: 12px; }
.profile-summary > div span { margin-top: 3px; color: var(--muted); font-size: 9px; }
.field--full { grid-column: 1 / -1; }
.field small { color: var(--muted-2); font-size: 8px; }
.appearance-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; }
.appearance-card { position: relative; display: grid; gap: 6px; border: 1px solid var(--line); border-radius: 9px; background: var(--paper); padding: 10px; cursor: pointer; }
.appearance-card:has(input:checked) { border-color: #8bbfff; box-shadow: 0 0 0 3px rgba(22,119,255,.08); }
.appearance-card input { position: absolute; right: 10px; top: 10px; accent-color: var(--blue); }
.appearance-card strong { font-size: 10px; }
.appearance-card small { color: var(--muted); font-size: 8px; line-height: 1.45; }
.theme-preview { height: 64px; display: grid; grid-template-columns: 20px 1fr; grid-template-rows: 14px 1fr; overflow: hidden; border: 1px solid var(--line); border-radius: 6px; background: #f5f7fa; }
.theme-preview i { display: block; }
.theme-preview i:first-child { grid-row: 1 / -1; background: #111827; }
.theme-preview i:nth-child(2) { background: #fff; border-bottom: 1px solid #e5e7eb; }
.theme-preview i:nth-child(3) { margin: 7px; border-radius: 3px; background: #fff; box-shadow: 0 0 0 1px #e5e7eb; }
.theme-preview--dark { background: #0b1019; border-color: #30394a; }
.theme-preview--dark i:first-child { background: #070b12; }
.theme-preview--dark i:nth-child(2) { background: #151c28; border-color: #30394a; }
.theme-preview--dark i:nth-child(3) { background: #151c28; box-shadow: 0 0 0 1px #30394a; }
.theme-preview--system { background: linear-gradient(90deg, #f5f7fa 50%, #0b1019 50%); }
.theme-preview--system i:first-child { background: linear-gradient(90deg, #111827 50%, #070b12 50%); }
.theme-preview--system i:nth-child(2) { background: linear-gradient(90deg, #fff 50%, #151c28 50%); }
.theme-preview--system i:nth-child(3) { background: linear-gradient(90deg, #fff 50%, #151c28 50%); }
.preference-list { display: grid; margin-top: 13px; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
.preference-row { min-height: 58px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 12px; border-bottom: 1px solid var(--line); cursor: pointer; }
.preference-row:last-child { border: 0; }
.preference-row span { min-width: 0; }
.preference-row strong, .preference-row small { display: block; }
.preference-row strong { font-size: 10px; }
.preference-row small { margin-top: 3px; color: var(--muted); font-size: 8px; line-height: 1.45; }
.preference-row input { width: 17px; height: 17px; flex: 0 0 auto; accent-color: var(--blue); }
.account-details { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
.account-details > div { min-width: 0; padding: 12px; border-right: 1px solid var(--line); }
.account-details > div:last-child { border: 0; }
.account-details span, .account-details strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-details span { color: var(--muted); font-size: 8px; }
.account-details strong { margin-top: 4px; font-size: 10px; }
.settings-section--danger { margin-bottom: 0; }
.billing-plan { display: flex; align-items: center; justify-content: space-between; gap: 12px; border: 1px solid #bcd8ff; border-radius: 9px; background: linear-gradient(135deg, #f4f9ff, white); padding: 13px; }
.billing-plan strong, .billing-plan span { display: block; }
.billing-plan strong { font-size: 12px; }
.billing-plan span { margin-top: 3px; color: var(--muted); font-size: 9px; }
.billing-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.billing-options article { display: flex; justify-content: space-between; align-items: center; gap: 14px; min-height: 88px; padding: 14px; border: 1px solid var(--line); border-radius: 9px; background: white; }
.billing-options article > div { display: grid; gap: 5px; }
.billing-options article span { color: var(--muted); font-size: 9px; line-height: 1.5; }
.billing-options button { flex: 0 0 auto; }
.api-key { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 7px; background: #fafbfc; padding: 8px 10px; font-family: var(--mono); font-size: 9px; }
.api-key span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.api-key-list { display: grid; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
.api-key-row { min-height: 62px; display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 12px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.api-key-row:last-child { border-bottom: 0; }
.api-key-row > div { min-width: 0; }
.api-key-row strong, .api-key-row span { display: block; }
.api-key-row strong { font-size: 10px; }
.api-key-row > div span { margin-top: 4px; color: var(--muted); font-size: 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.api-key-row code, .api-endpoint code, .api-secret code, .code-sample { font-family: var(--mono); }
.api-endpoint, .api-secret { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--canvas); padding: 9px 10px; }
.api-endpoint code, .api-secret code { min-width: 0; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 9px; }
.code-sample { overflow: auto; margin: 10px 0 0; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); background: var(--canvas); padding: 12px; font-size: 9px; line-height: 1.7; }
.api-secret { display: grid; grid-template-columns: minmax(0, 1fr) auto; }

.auth-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(0, .95fr) minmax(420px, 1.05fr); background: #080b12; }
.auth-brand { position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; color: white; padding: 32px 38px; background: radial-gradient(circle at 65% 35%, rgba(22,119,255,.22), transparent 36%), #080b12; }
.auth-brand::before { content: ""; position: absolute; width: 520px; height: 520px; left: 48%; top: 20%; transform: rotate(45deg); border: 1px solid rgba(45,144,255,.16); box-shadow: 0 0 90px rgba(22,119,255,.12); }
.auth-brand::after { content: ""; position: absolute; width: 330px; height: 330px; left: 58%; top: 31%; transform: rotate(45deg); border: 1px solid rgba(45,144,255,.24); box-shadow: 0 0 70px rgba(22,119,255,.18); }
.auth-logo { position: relative; z-index: 1; display: flex; align-items: center; gap: 11px; font-size: 15px; font-weight: 700; letter-spacing: .2em; }
.auth-logo img {
  width: 112px;
  height: 75px;
  object-fit: contain;
  object-position: center;
}
.auth-statement { position: relative; z-index: 1; max-width: 520px; margin: auto 0; }
.auth-statement h1 { margin: 0; max-width: 470px; font-size: clamp(34px, 4vw, 56px); line-height: 1.02; letter-spacing: -.055em; }
.auth-statement p { max-width: 450px; margin: 16px 0 0; color: #8996aa; font-size: 12px; line-height: 1.7; }
.auth-flow { display: flex; gap: 17px; margin-top: 25px; color: #718097; font-size: 9px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; }
.auth-flow span { color: #53a1ff; }
.auth-foot { position: relative; z-index: 1; color: #5d6b81; font-size: 9px; }
.auth-main { display: grid; place-items: center; background: white; padding: 28px; }
.auth-card { width: min(390px, 100%); }
.auth-card h2 { margin: 0; font-size: 22px; letter-spacing: -.03em; }
.auth-card > p { margin: 7px 0 20px; color: var(--muted); font-size: 11px; line-height: 1.6; }
.auth-form { display: grid; gap: 12px; }
.auth-form .btn { margin-top: 2px; }
.auth-separator { display: flex; align-items: center; gap: 10px; color: var(--muted-2); font-size: 9px; margin: 6px 0; }
.auth-separator::before, .auth-separator::after { content: ""; height: 1px; flex: 1; background: var(--line); }
.google-signin { min-height: 40px; width: 100%; display: flex; justify-content: center; overflow: hidden; }
.google-signin > div { width: 100% !important; }
.google-signin iframe { width: 100% !important; }
.auth-note { margin-top: 16px; color: var(--muted); font-size: 10px; text-align: center; }
.auth-note a { color: var(--blue); font-weight: 600; }
.password-row { display: flex; align-items: center; justify-content: space-between; }
.password-row a { color: var(--blue); font-size: 9px; }
.auth-error { color: var(--red); background: var(--red-soft); border: 1px solid #f3cccc; border-radius: 7px; padding: 8px 9px; font-size: 9px; }
.mfa-qr { display: grid; place-items: center; padding: 14px; border: 1px solid var(--line); border-radius: 9px; background: white; }
.mfa-qr svg { width: min(220px, 100%); height: auto; }

.onboarding-shell { min-height: 100vh; display: grid; place-items: center; background: radial-gradient(circle at 50% 0, #edf5ff, transparent 34%), var(--canvas); padding: 30px; }
.onboarding-card { width: min(700px, 100%); border: 1px solid var(--line); border-radius: 14px; background: white; box-shadow: var(--shadow-md); overflow: hidden; }
.onboarding-head { display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); padding: 14px 18px; }
.onboarding-head .brand { color: var(--ink); margin: 0; padding: 0; }
.onboarding-head .brand img { width: 72px; height: 48px; }
.onboarding-progress { color: var(--muted); font-size: 10px; }
.onboarding-body { padding: 28px; }
.onboarding-body h1 { margin: 0; font-size: 22px; letter-spacing: -.03em; }
.onboarding-body > p { margin: 7px 0 21px; color: var(--muted); font-size: 11px; line-height: 1.6; }
.choice-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }
.choice-card { border: 1px solid var(--line); border-radius: 9px; background: white; padding: 12px; cursor: pointer; text-align: left; }
.choice-card:hover, .choice-card.selected { border-color: #9bc6ff; background: var(--blue-soft); }
.choice-card strong, .choice-card span { display: block; }
.choice-card strong { font-size: 10px; }
.choice-card span { margin-top: 4px; color: var(--muted); font-size: 9px; line-height: 1.45; }
.workspace-list { display: grid; gap: 8px; }
.workspace-choice { width: 100%; }
.workspace-choice:disabled { opacity: 1; cursor: default; }
.payment-provider-list { display: grid; gap: 10px; }
.payment-provider { width: 100%; min-height: 82px; }

.modal-backdrop { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; background: rgba(5,9,16,.42); backdrop-filter: blur(3px); padding: 20px; }
.modal { width: min(440px, 100%); border: 1px solid var(--line); border-radius: 12px; background: white; box-shadow: 0 22px 70px rgba(7,14,27,.25); overflow: hidden; }
.modal-head { display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); padding: 13px 15px; }
.modal-head h2 { margin: 0; font-size: 12px; }
.modal-body { padding: 15px; }
.toast-region { position: fixed; z-index: 100; right: 18px; bottom: 18px; display: grid; gap: 8px; }
.toast { min-width: 250px; max-width: 360px; display: flex; align-items: center; gap: 9px; border: 1px solid var(--line-strong); border-radius: 9px; color: #384255; background: white; box-shadow: var(--shadow-md); padding: 10px 11px; font-size: 10px; animation: toast-in .2s ease; }
.toast .activity-icon { flex: 0 0 auto; }
@keyframes toast-in { from { transform: translateY(6px); opacity: 0; } }

:root[data-theme="dark"] .main,
:root[data-theme="dark"] .panel,
:root[data-theme="dark"] .workflow,
:root[data-theme="dark"] .project-card,
:root[data-theme="dark"] .process-task,
:root[data-theme="dark"] .editor-layout,
:root[data-theme="dark"] .editor-rail,
:root[data-theme="dark"] .editor-toolbar,
:root[data-theme="dark"] .canvas-status,
:root[data-theme="dark"] .auth-main,
:root[data-theme="dark"] .onboarding-card,
:root[data-theme="dark"] .choice-card,
:root[data-theme="dark"] .modal,
:root[data-theme="dark"] .mfa-qr,
:root[data-theme="dark"] .billing-options article,
:root[data-theme="dark"] .appearance-card,
:root[data-theme="dark"] .toast {
  background: var(--paper);
}
:root[data-theme="dark"] .topbar { background: rgba(17,23,34,.94); }
:root[data-theme="dark"] .search,
:root[data-theme="dark"] .search:focus-within,
:root[data-theme="dark"] .api-key,
:root[data-theme="dark"] .data-table th,
:root[data-theme="dark"] .project-visual,
:root[data-theme="dark"] .segmented,
:root[data-theme="dark"] .ai-message,
:root[data-theme="dark"] .filter-chip,
:root[data-theme="dark"] .format,
:root[data-theme="dark"] .workflow-dot,
:root[data-theme="dark"] .task-state {
  background: #151c28;
}
:root[data-theme="dark"] .input,
:root[data-theme="dark"] .select,
:root[data-theme="dark"] .textarea,
:root[data-theme="dark"] .btn,
:root[data-theme="dark"] .search kbd,
:root[data-theme="dark"] .layer-kind,
:root[data-theme="dark"] .upload-glyph {
  color: var(--ink);
  background: #151c28;
}
:root[data-theme="dark"] .btn:hover,
:root[data-theme="dark"] .icon-btn:hover,
:root[data-theme="dark"] .account-button:hover,
:root[data-theme="dark"] .data-table tbody tr:hover,
:root[data-theme="dark"] .layer-row:hover,
:root[data-theme="dark"] .layer-row.selected {
  background: #1a2331;
}
:root[data-theme="dark"] .btn--primary,
:root[data-theme="dark"] .btn--primary:hover { color: white; background: linear-gradient(180deg, #2687ff, #0c68ea); }
:root[data-theme="dark"] .btn--danger { color: #ff8f98; background: var(--red-soft); border-color: #5b2b33; }
:root[data-theme="dark"] .cell-title,
:root[data-theme="dark"] .workflow-copy strong,
:root[data-theme="dark"] .field label,
:root[data-theme="dark"] .toast { color: var(--ink); }
:root[data-theme="dark"] .billing-plan { border-color: #264f82; background: linear-gradient(135deg, #102440, #111722); }
:root[data-theme="dark"] .onboarding-shell { background: radial-gradient(circle at 50% 0, #102846, transparent 34%), var(--canvas); }
:root[data-theme="dark"] .dropzone { background: radial-gradient(circle at 50% 40%, #102440 0, #111722 58%, #0f151f 100%); }
:root[data-theme="dark"] .ai-dock { border-color: var(--line); background: rgba(17,23,34,.96); }
:root[data-theme="dark"] .ai-input-row input { color: var(--ink); background: transparent; }
:root[data-theme="dark"] .notification-dot { border-color: var(--paper); }
:root[data-theme="dark"] .avatars span { border-color: var(--paper); }
:root[data-theme="dark"] .confidence-ring::before { background: var(--paper); }
:root[data-theme="dark"] .status--gray { color: #a8b2c1; background: #202938; }

@media (max-width: 1220px) {
  .dashboard-grid { grid-template-columns: minmax(0, 1.4fr) minmax(270px, .7fr); }
  .dashboard-grid > .stack:last-child { grid-column: 1 / -1; grid-template-columns: repeat(2,1fr); }
  .project-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .review-layout { grid-template-columns: 210px minmax(0,1fr); }
  .review-layout > .panel:last-child { grid-column: 1 / -1; }
  .editor-layout { grid-template-columns: 190px minmax(0,1fr) 240px; }
}
@media (max-width: 940px) {
  .app-shell { display: block; }
  .sidebar { position: fixed; left: -230px; transition: left .2s ease; }
  .sidebar.open { left: 0; box-shadow: 18px 0 50px rgba(0,0,0,.22); }
  .menu-toggle { display: grid; }
  .account-copy { display: none; }
  .page { padding: 14px; }
  .dashboard-grid, .projects-layout, .upload-layout, .process-layout, .review-layout, .settings-layout { grid-template-columns: 1fr; }
  .dashboard-grid > .stack:last-child { grid-column: auto; grid-template-columns: 1fr; }
  .workflow-copy span { display: none; }
  .workflow-step:not(:last-child)::after { display: none; }
  .project-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .editor-layout { grid-template-columns: 170px minmax(560px, 1fr) 220px; overflow: auto; }
  .auth-shell { grid-template-columns: 1fr; }
  .auth-brand { min-height: 270px; padding: 24px; }
  .auth-statement h1 { font-size: 34px; }
  .auth-foot { display: none; }
}
@media (max-width: 620px) {
  .topbar { padding: 0 10px; }
  .search { width: auto; flex: 1; }
  .search kbd, .topbar .btn span, .account-button { display: none; }
  .page-head { align-items: flex-start; }
  .workflow { grid-template-columns: repeat(5, auto); padding: 10px; }
  .workflow-copy { display: none; }
  .workflow-step { justify-content: center; }
  .project-grid, .form-grid, .choice-grid { grid-template-columns: 1fr; }
  .appearance-options, .account-details { grid-template-columns: 1fr; }
  .account-details > div { border-right: 0; border-bottom: 1px solid var(--line); }
  .account-details > div:last-child { border-bottom: 0; }
  .profile-summary { align-items: flex-start; flex-wrap: wrap; }
  .profile-summary .status { margin-left: 55px; }
  .process-hero { grid-template-columns: 1fr; }
  .review-canvas { min-height: 430px; padding: 15px; }
  .review-canvas .design-preview { width: 100%; min-height: 360px; }
  .metrics { grid-template-columns: 1fr; }
  .billing-options { grid-template-columns: 1fr; }
  .api-key-row { grid-template-columns: minmax(0, 1fr) auto; }
  .api-key-row > .btn { grid-column: 1 / -1; }
  .api-secret { grid-template-columns: 1fr; }
  .auth-main { padding: 24px 18px; }
  .auth-brand { min-height: 240px; }
  .auth-flow { gap: 9px; font-size: 7px; }
}
