
:root {
  color-scheme: light;
  --bg: #f7f3ec;
  --ink: #1f2933;
  --muted: #667085;
  --card: #fffaf2;
  --line: #eadfce;
  --accent: #b35c2e;
  --accent-2: #264653;
  --soft: #f1e2ce;
  --ok: #2a9d8f;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); }
button, input, textarea, a { font: inherit; }
.top-bar { position: sticky; top: 0; z-index: 100; display: flex; align-items: center; justify-content: space-between; padding: 12px clamp(18px, 4vw, 56px); background: rgba(247, 243, 236, 0.88); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.brand { font-weight: 800; letter-spacing: -.02em; }
.top-nav { display: flex; gap: 8px; align-items: center; }
.top-nav-link { padding: 6px 12px; border-radius: 999px; font-size: 13px; font-weight: 700; color: var(--muted); text-decoration: none; border: 1px solid var(--line); background: var(--card); transition: all .15s ease; }
.top-nav-link:hover { color: var(--ink); border-color: var(--accent-2); }
.top-nav-link.active { background: var(--accent-2); color: #fff; border-color: var(--accent-2); }
.auth-area { display: flex; align-items: center; gap: 8px; }
.auth-area .small { padding: 6px 12px; font-size: 12px; }
.auth-user { font-size: 12px; color: var(--muted); max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hero { padding: 28px clamp(18px, 4vw, 56px) 48px; background: linear-gradient(135deg, #fff8ed 0%, #f2dfc5 55%, #e9c8a4 100%); border-bottom: 1px solid var(--line); }
.nav { display: flex; justify-content: space-between; align-items: center; margin-bottom: 56px; }
a { color: var(--accent-2); text-decoration: none; font-weight: 700; }
.btn-ghost { display: inline-flex; align-items: center; padding: 11px 18px; border-radius: 999px; border: 1px solid rgba(38,70,83,.12); background: rgba(255,255,255,.72); color: var(--accent-2); font-weight: 800; text-decoration: none; transition: .18s ease; }
.btn-ghost:hover { transform: translateY(-1px); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 36px; align-items: end; max-width: 1180px; margin: 0 auto; }
.eyebrow { margin: 0 0 10px; color: var(--accent); font-weight: 800; text-transform: uppercase; letter-spacing: .08em; font-size: 12px; }
h1 { margin: 0; max-width: 780px; font-size: clamp(40px, 7vw, 84px); line-height: .95; letter-spacing: -.06em; }
h2 { margin: 0 0 18px; font-size: 25px; letter-spacing: -.03em; }
.lead { max-width: 680px; color: #475467; font-size: 18px; line-height: 1.8; }
.hero-actions, .chips { display: flex; flex-wrap: wrap; gap: 10px; }
button { border: 0; border-radius: 999px; padding: 11px 18px; cursor: pointer; font-weight: 800; transition: .18s ease; }
button:hover { transform: translateY(-1px); }
button.small { padding: 7px 11px; font-size: 12px; }
button.danger { color: #9f3428; border-color: rgba(159,52,40,.2); }
.color-red { color: #b35c2e; }
.color-blue { color: #264653; }
.primary { background: var(--accent-2); color: white; }
.secondary, .chip { background: rgba(255,255,255,.72); color: var(--accent-2); border: 1px solid rgba(38,70,83,.12); }
.chip.active { background: var(--accent-2); color: white; }
.timer-card { background: rgba(255,250,242,.72); border: 1px solid rgba(255,255,255,.8); border-radius: 28px; padding: 28px; box-shadow: 0 20px 70px rgba(89, 55, 27, .14); }
.timer-card span, .timer-card small { display: block; color: var(--muted); }
.timer-card strong { display: block; margin: 8px 0; font-size: 58px; letter-spacing: -.05em; }
main { max-width: 1180px; margin: -22px auto 64px; padding: 0 clamp(16px, 3vw, 24px); }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat, .panel, .topic-card { background: rgba(255,250,242,.9); border: 1px solid var(--line); border-radius: 24px; box-shadow: 0 14px 50px rgba(74, 47, 24, .08); }
.stat { padding: 18px; }
.stat strong { display: block; font-size: 30px; }
.stat span { color: var(--muted); font-size: 13px; }
.panel { padding: 22px; }
.controls { display: grid; grid-template-columns: 1fr minmax(260px, 390px); gap: 18px; align-items: start; margin-bottom: 18px; }
.controls .chips { grid-column: 1 / -1; }
input { width: 100%; border: 1px solid var(--line); background: white; border-radius: 999px; padding: 13px 16px; outline: none; }
input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(179,92,46,.12); }
textarea { width: 100%; border: 1px solid var(--line); background: #fffdf8; border-radius: 14px; padding: 10px 12px; outline: none; resize: vertical; line-height: 1.45; }
textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(179,92,46,.12); }
.route-panel { margin-bottom: 18px; user-select: text; }
.route-panel[hidden] { display: none; }
.route-actions { display: flex; gap: 8px; flex-wrap: wrap; margin: 18px 0; }
.route-status { display: inline-flex; align-items: center; color: var(--muted); font-size: 14px; font-weight: 750; }
.route-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.editor-toolbar { display: flex; gap: 8px; flex-wrap: wrap; padding: 10px; border: 1px solid var(--line); background: #fffdf8; border-radius: 16px; margin: 10px 0 12px; }
.layout { display: grid; grid-template-columns: 380px 1fr; gap: 18px; align-items: start; }
.template-panel { position: sticky; top: 18px; max-height: calc(100vh - 36px); overflow: auto; }
.template-block { margin: 18px 0; }
.template-block h3 { margin: 0 0 8px; font-size: 16px; color: var(--accent-2); }
ul { margin: 0; padding-left: 20px; }
li { margin: 8px 0; line-height: 1.55; }
.topic-list { display: grid; gap: 12px; }
.topic-card { padding: 18px; }
.topic-meta { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.badge { display: inline-flex; align-items: center; border-radius: 999px; padding: 5px 9px; background: var(--soft); color: #7a3d1f; font-size: 12px; font-weight: 800; }
.badge-edited { background: #e8f4ea; color: #2f6b3f; }
.topic-card-edited { border-color: #9bc4a6; }
.topic-card h3 { margin: 0 0 10px; font-size: 18px; line-height: 1.45; }
.translation { color: var(--muted); line-height: 1.7; margin: 0 0 14px; }
.card-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.script { background: white; border: 1px solid var(--line); border-radius: 18px; padding: 16px; }
.script ol { margin: 0; padding-left: 22px; }
.rich-editor { min-height: 180px; padding: 12px; border: 1px solid var(--line); border-radius: 16px; background: #fffaf2; outline: none; line-height: 1.7; }
.rich-editor:focus { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(179,92,46,.12); }
.rich-editor div { margin: 0 0 8px; }
.tip { color: var(--muted); font-size: 14px; line-height: 1.7; }
mark { background: #ffe3b0; border-radius: 5px; padding: 0 3px; }
@media (max-width: 900px) {
  .hero-grid, .layout, .controls, .route-grid { grid-template-columns: 1fr; }
  .template-panel { position: static; max-height: none; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .stats { grid-template-columns: 1fr; }
  .nav { margin-bottom: 34px; }
  h1 { font-size: 42px; }
}
