:root {
  --bg: #080d19;
  --sidebar: #111827;
  --surface: #111a2d;
  --surface-raised: #172238;
  --surface-soft: #0d1628;
  --text: #f7f9fc;
  --muted: #91a3c1;
  --line: #273550;
  --line-strong: #3b4b69;
  --accent: #ff725e;
  --accent-hover: #ff8877;
  --blue: #66a6ff;
  --success: #71e0ae;
  --danger: #ff6b70;
  --warning: #f7be67;
  --shadow: 0 22px 60px rgba(0, 0, 0, 0.28);
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body {
  min-height: 100vh;
  margin: 0;
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  background: radial-gradient(circle at 82% 10%, rgba(70, 126, 215, 0.09), transparent 30%), var(--bg);
  color: var(--text);
}

button, input, textarea { font-family: inherit; }
.app-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 30px 24px 24px;
  border-right: 1px solid var(--line);
  background: var(--sidebar);
}
.brand { display: flex; align-items: center; gap: 12px; color: var(--text); text-decoration: none; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  border-radius: 8px;
  background: var(--accent);
  color: #111827;
  font-size: 18px;
  font-weight: 900;
  box-shadow: 0 10px 24px rgba(255, 114, 94, 0.2);
}
.brand > span:last-child { display: grid; gap: 2px; }
.brand strong { font-size: 14px; line-height: 1; }
.brand small { color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: 0.08em; }
.sidebar-nav { display: grid; gap: 8px; margin-top: 72px; }
.sidebar-nav p { margin: 0 0 8px; color: var(--accent); font-size: 11px; font-weight: 900; text-transform: uppercase; }
.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--muted);
  text-decoration: none;
}
.sidebar-nav a span { color: #60708d; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 11px; }
.sidebar-nav a strong { font-size: 13px; }
.sidebar-nav a:hover { color: var(--text); background: rgba(255, 255, 255, 0.03); }
.sidebar-nav a.active { border-color: var(--line); background: var(--surface-raised); color: var(--text); }
.sidebar-nav a.active span { color: var(--accent); }
.sidebar-status {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: auto;
  border: 1px solid rgba(113, 224, 174, 0.15);
  border-radius: 8px;
  padding: 14px;
  background: rgba(6, 13, 25, 0.42);
}
.status-dot, .system-pill i {
  width: 8px;
  height: 8px;
  flex: 0 0 8px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 4px rgba(113, 224, 174, 0.08);
}
.sidebar-status div { display: grid; gap: 4px; }
.sidebar-status strong { font-size: 12px; }
.sidebar-status small { color: var(--muted); font-size: 10px; }
.page { min-width: 0; min-height: 100vh; padding: 32px clamp(24px, 5vw, 76px) 56px; }
.page-shell { width: min(100%, 1040px); margin: 0 auto; }
.workspace-header { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin: 0 0 28px; }
.workspace-header > div { display: grid; gap: 7px; }
.workspace-header > div span { color: var(--accent); font-size: 11px; font-weight: 900; text-transform: uppercase; }
.workspace-header > div strong { color: var(--muted); font-size: 13px; font-weight: 600; }
.system-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 9px 16px;
  background: var(--surface);
  color: #dce5f4;
  font-size: 12px;
  font-weight: 700;
}
.card {
  width: min(100%, 900px);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: clamp(24px, 4vw, 38px);
  background: rgba(17, 26, 45, 0.96);
  box-shadow: var(--shadow);
}
.card-narrow { width: min(100%, 680px); }
.top-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 0 0 20px; }
.badge {
  display: inline-flex;
  margin: 0;
  border: 1px solid rgba(255, 114, 94, 0.36);
  border-radius: 999px;
  padding: 6px 11px;
  background: rgba(255, 114, 94, 0.08);
  color: var(--accent);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}
.language-switch { display: inline-flex; gap: 3px; padding: 3px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-soft); }
.language-switch button { min-height: 30px; border: 0; border-radius: 6px; padding: 5px 11px; background: transparent; color: var(--muted); font-size: 11px; font-weight: 900; }
.language-switch button.active { background: var(--accent); color: #101725; }
h1 { margin: 0 0 10px; font-size: clamp(30px, 4vw, 42px); line-height: 1.08; letter-spacing: 0; }
h2 { margin: 0 0 14px; font-size: 19px; }
.hint { max-width: 680px; margin: 0 0 28px; color: var(--muted); font-size: 14px; line-height: 1.6; }
.progress { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 0 0 22px; }
.progress-step {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 54px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 13px;
  background: var(--surface-soft);
  color: var(--muted);
}
.progress-step span { display: grid; place-items: center; width: 28px; height: 28px; flex: 0 0 28px; border-radius: 6px; background: #222f46; color: var(--muted); font-size: 12px; font-weight: 900; }
.progress-step strong { font-size: 12px; }
.progress-step.active, .progress-step.done { border-color: rgba(255, 114, 94, 0.58); color: var(--text); }
.progress-step.active span, .progress-step.done span { background: var(--accent); color: #111827; }
.verified-box, .summary-box, .instructions { border: 1px solid var(--line); border-radius: 8px; background: var(--surface-soft); }
.verified-box { display: grid; gap: 7px; margin: 0 0 20px; padding: 16px 18px; border-left: 3px solid var(--success); }
.verified-box strong { color: var(--success); font-size: 13px; }
.verified-box span { color: var(--muted); font-size: 13px; word-break: break-word; }
.instructions { margin: 0 0 20px; padding: 18px; font-size: 13px; line-height: 1.5; }
.instruction-step { display: flex; align-items: center; gap: 12px; margin: 0 0 13px; }
.instruction-step:last-child { margin-bottom: 0; }
.step-label { min-width: 58px; color: var(--muted); font-size: 11px; font-weight: 900; text-transform: uppercase; }
.action-link { display: inline-flex; align-items: center; justify-content: center; min-height: 36px; border: 1px solid var(--line-strong); border-radius: 7px; padding: 8px 14px; background: var(--surface-raised); color: var(--text); font-weight: 800; text-decoration: none; }
.action-link:hover { border-color: var(--blue); color: var(--blue); }
.support-line { margin: 0; color: var(--muted); font-size: 12px; font-weight: 600; }
.instruction-text-step { align-items: flex-start; }
.form { display: grid; gap: 12px; }
label { color: #dfe7f5; font-size: 12px; font-weight: 800; }
input, textarea { width: 100%; border: 1px solid var(--line-strong); border-radius: 8px; padding: 14px 15px; background: #0a1323; color: var(--text); font: inherit; font-size: 14px; line-height: 1.5; }
textarea { min-height: 180px; resize: vertical; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 12px; }
#status-card-input { min-height: 130px; }
input::placeholder, textarea::placeholder { color: #61718e; }
input:focus, textarea:focus { outline: 0; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(102, 166, 255, 0.12); }
button { min-height: 48px; border: 1px solid var(--accent); border-radius: 8px; padding: 12px 18px; background: var(--accent); color: #111827; font: inherit; font-size: 14px; font-weight: 900; cursor: pointer; }
button:hover { border-color: var(--accent-hover); background: var(--accent-hover); }
button:disabled { opacity: 0.55; cursor: default; }
.secondary-button { border-color: var(--line-strong); background: var(--surface-soft); color: var(--text); }
.secondary-button:hover { border-color: var(--blue); background: var(--surface-raised); color: var(--text); }
.success-button { border-color: var(--success); background: var(--success); color: #0a1a14; }
.success-button:hover { border-color: #91e9c4; background: #91e9c4; }
.link-actions { display: grid; gap: 10px; margin-top: 12px; }
.secondary-link-button { display: inline-flex; align-items: center; justify-content: center; min-height: 46px; border: 1px solid var(--line-strong); border-radius: 8px; padding: 11px 16px; background: transparent; color: var(--text); font-size: 13px; font-weight: 800; text-decoration: none; }
.secondary-link-button:hover { border-color: var(--blue); color: var(--blue); }
.confirm-section { display: grid; gap: 16px; margin-top: 2px; }
.confirm-section[hidden] { display: none; }
.status-notice { border: 1px solid var(--line); border-radius: 8px; padding: 15px; background: var(--surface-soft); color: var(--warning); font-size: 15px; font-weight: 900; text-align: center; }
.status-notice.success { border-color: rgba(113, 224, 174, 0.4); background: rgba(113, 224, 174, 0.08); color: var(--success); }
.status-notice.failed, .status-notice.review { border-color: rgba(255, 107, 112, 0.4); background: rgba(255, 107, 112, 0.08); color: var(--danger); }
.summary-box { padding: 18px; }
.summary-box h2 { padding-bottom: 13px; border-bottom: 1px solid var(--line); }
.summary-box dl { display: grid; margin: 0; }
.summary-box dl div { display: grid; grid-template-columns: minmax(130px, 0.55fr) minmax(0, 1fr); gap: 16px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.summary-box dl div:last-child { border-bottom: 0; }
.summary-box dt { color: var(--muted); font-size: 13px; }
.summary-box dd { margin: 0; color: var(--text); font-size: 13px; font-weight: 800; text-align: right; word-break: break-word; }
.button-row { display: grid; grid-template-columns: 1fr 2fr; gap: 12px; }
.message { min-height: 22px; margin: 14px 0 0; font-size: 13px; font-weight: 800; }
.message.error { color: var(--danger); }
.message.success { color: var(--success); }
.message.info { color: var(--warning); }
.back-link { display: inline-block; margin-top: 18px; color: var(--muted); text-decoration: none; font-size: 12px; font-weight: 800; }
.back-link:hover { color: var(--text); }
.batch-list { display: grid; gap: 10px; }
.batch-item { display: grid; gap: 8px; padding: 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-raised); }
.batch-item div { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 12px; }
.batch-item strong { color: var(--muted); font-size: 12px; }
.batch-item span { color: var(--text); font-size: 12px; font-weight: 800; word-break: break-word; }
.batch-item.status-success { border-left: 3px solid var(--success); }
.batch-item.status-failed { border-left: 3px solid var(--danger); }

@media (max-width: 860px) {
  body { display: block; }
  .app-sidebar { position: static; width: 100%; height: auto; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 18px; padding: 14px 18px; border-right: 0; border-bottom: 1px solid var(--line); }
  .sidebar-nav { display: flex; justify-content: center; margin: 0; }
  .sidebar-nav p, .sidebar-nav a span { display: none; }
  .sidebar-nav a { min-height: 40px; padding: 8px 12px; }
  .sidebar-status { margin: 0; padding: 10px 12px; }
  .sidebar-status small { display: none; }
  .page { min-height: auto; padding: 26px 18px 46px; }
}

@media (max-width: 640px) {
  .app-sidebar { grid-template-columns: 1fr auto; }
  .sidebar-nav { grid-column: 1 / -1; grid-row: 2; justify-content: stretch; }
  .sidebar-nav a { flex: 1; justify-content: center; }
  .sidebar-status { justify-self: end; }
  .sidebar-status div { display: none; }
  .workspace-header { margin-bottom: 18px; }
  .workspace-header > div strong { display: none; }
  .system-pill { padding: 8px 11px; }
  .card { padding: 22px 18px; }
  h1 { font-size: 29px; }
  .top-row { align-items: flex-start; }
  .progress { grid-template-columns: 1fr; }
  .progress-step { min-height: 46px; }
  .summary-box dl div, .button-row { grid-template-columns: 1fr; }
  .summary-box dd { text-align: left; }
  .instruction-step { align-items: stretch; flex-direction: column; gap: 7px; }
  .step-label { min-width: 0; }
  .action-link { width: 100%; }
  .batch-item div { grid-template-columns: 1fr; gap: 4px; }
}
