:root {
  --bg: #f3f5f9;
  --panel: #ffffff;
  --panel-soft: #f8fafc;
  --line: #d9e0ea;
  --line-strong: #c5cfdb;
  --text: #16202a;
  --muted: #647184;
  --accent: #245dff;
  --accent-dark: #1f4ed8;
  --danger: #c73d3d;
  --shadow: 0 12px 30px rgba(19, 30, 54, 0.08);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: Arial, Helvetica, sans-serif;
  background: linear-gradient(180deg, #eef2f8 0%, #f7f9fc 180px, #f3f5f9 100%);
  color: var(--text);
}

a { color: var(--accent-dark); }
button, input, select {
  font: inherit;
}
button, .button-link {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: 11px 15px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.12s ease, background 0.12s ease;
}
button:hover, .button-link:hover { background: var(--accent-dark); }
button:active, .button-link:active { transform: translateY(1px); }
button:disabled { opacity: 0.6; cursor: not-allowed; }

input, select {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--text);
}
input:focus, select:focus {
  outline: none;
  border-color: #8fb0ff;
  box-shadow: 0 0 0 3px rgba(36, 93, 255, 0.12);
}
label {
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-size: 14px;
}

.hero {
  padding: 28px 24px 10px;
}
.hero-inner {
  max-width: 1600px;
  margin: 0 auto;
  background: linear-gradient(135deg, #111c2e 0%, #1c2d4a 100%);
  color: #fff;
  border-radius: 22px;
  padding: 26px 28px;
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: center;
  box-shadow: var(--shadow);
}
.hero h1 { margin: 0 0 8px; font-size: 32px; }
.hero-text { margin: 0; max-width: 700px; color: rgba(255,255,255,0.8); }
.eyebrow, .section-kicker {
  margin: 0 0 8px;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.hero .eyebrow { color: rgba(255,255,255,0.65); }
.hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}
.badge {
  padding: 9px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.15);
  font-size: 13px;
}

.page-shell {
  max-width: 1600px;
  margin: 0 auto;
  padding: 18px 24px 30px;
}
.workspace {
  display: grid;
  grid-template-columns: 430px minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}
.stack, .stack-lg {
  display: flex;
  flex-direction: column;
}
.stack { gap: 12px; }
.stack-lg { gap: 22px; }
.row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow);
}
.section-card {
  padding: 18px;
}
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: start;
  margin-bottom: 14px;
}
.section-head h2, .preview-topbar h2 {
  margin: 0;
  font-size: 22px;
}

.list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 14px;
}
.list-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  border: 1px solid var(--line);
  background: var(--panel-soft);
  border-radius: 16px;
  padding: 12px;
}
.compact-item { padding: 10px 12px; }
.item-meta { min-width: 0; }
.item-meta strong {
  display: block;
  margin-bottom: 5px;
}
.item-meta small {
  display: block;
  color: var(--muted);
  line-height: 1.45;
}
.compact-list { margin-top: 10px; }

.checkbox-row {
  flex-direction: row;
  align-items: center;
  gap: 10px;
}
.checkbox-row input {
  width: 18px;
  height: 18px;
  margin: 0;
}

.subpanel {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel-soft);
  padding: 0 14px 14px;
}
.subpanel summary {
  cursor: pointer;
  list-style: none;
  padding: 14px 2px;
  font-weight: 700;
}
.subpanel summary::-webkit-details-marker { display: none; }
.nested-form { padding-top: 4px; }

.info-strip {
  border: 1px solid #d7e3ff;
  background: #eff4ff;
  color: #294b97;
  border-radius: 14px;
  padding: 11px 12px;
  font-size: 13px;
}
.summary {
  margin-top: 14px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: #f8fafc;
  padding: 14px;
  min-height: 104px;
  white-space: pre-line;
  line-height: 1.55;
}
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.preview-panel {
  padding: 18px;
}
.preview-topbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 16px;
}
.preview-wrap {
  min-height: 720px;
  border: 1px solid var(--line-strong);
  border-radius: 20px;
  overflow: hidden;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}
.preview-object {
  width: 100%;
  height: 76vh;
  min-height: 720px;
}

.tab-color-panel {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 14px;
  padding: 12px;
}
.tab-color-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.help-text {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}
.color-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.color-option {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
  background: var(--panel-soft);
}
.color-option input {
  width: 18px;
  height: 18px;
  margin: 0;
  flex: 0 0 auto;
}
.color-swatch {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: 1px solid rgba(0, 0, 0, 0.18);
  flex: 0 0 auto;
}
.color-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.empty-state {
  border: 1px dashed var(--line-strong);
  background: var(--panel-soft);
  color: var(--muted);
  border-radius: 14px;
  padding: 14px;
  text-align: center;
}
.ghost-button, .danger-button {
  padding: 9px 12px;
}
.ghost-button {
  background: #edf3ff;
  color: #244ca8;
}
.ghost-button:hover { background: #dfe9ff; }
.danger-button {
  background: #fff0f0;
  color: var(--danger);
}
.danger-button:hover { background: #ffe2e2; }
.hidden { display: none !important; }

@media (max-width: 1200px) {
  .workspace { grid-template-columns: 1fr; }
  .preview-object { height: 560px; min-height: 560px; }
}

@media (max-width: 780px) {
  .hero { padding: 16px 14px 8px; }
  .page-shell { padding: 12px 14px 20px; }
  .hero-inner, .preview-topbar { flex-direction: column; align-items: stretch; }
  .hero h1 { font-size: 26px; }
  .row, .color-grid { grid-template-columns: 1fr; }
  .list-item { flex-direction: column; align-items: stretch; }
  .preview-object { height: 460px; min-height: 460px; }
}

.auth-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.auth-shell {
  width: 100%;
  max-width: 520px;
}

.auth-card {
  padding: 28px;
}

.auth-form {
  margin-top: 20px;
}

.auth-error {
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(176, 0, 32, 0.12);
  border: 1px solid rgba(176, 0, 32, 0.25);
}

.auth-help {
  margin-top: 18px;
  font-size: 0.95rem;
  opacity: 0.85;
}
