:root {
  color-scheme: light;
  --bg: #f3f0e8;
  --card: #fffcf7;
  --ink: #1d1a16;
  --muted: #5e584e;
  --line: #ddd4c6;
  --accent: #1d4f3e;
  --accent-soft: #e7f2ec;
  --ok: #146c43;
  --ok-bg: #e5f6ec;
  --bad: #9f2430;
  --bad-bg: #fdecee;
  --warn: #8a5a12;
  --warn-bg: #fff6e8;
  --shadow: 0 10px 30px rgba(40, 32, 20, 0.06);
  --header: 0;
}

html.dark {
  color-scheme: dark;
  --bg: #12171b;
  --card: #1b2228;
  --ink: #f4efe6;
  --muted: #c9c0b3;
  --line: #334049;
  --accent: #8fd0ae;
  --accent-soft: #1d332b;
  --ok: #8ed7ae;
  --ok-bg: #173528;
  --bad: #ffb4b4;
  --bad-bg: #3a2226;
  --warn: #f0c27a;
  --warn-bg: #332816;
  --shadow: none;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.65;
}
body[data-dir="rtl"] .c1-copy,
.c1-copy[dir="rtl"] {
  font-family: "Segoe UI", Tahoma, "Noto Naskh Arabic", sans-serif;
}
a { color: var(--accent); }
button, a, summary { -webkit-tap-highlight-color: transparent; }
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.c1-shell { width: min(1120px, calc(100% - 2rem)); margin: 0 auto; padding: 1.25rem 0 3rem; }
.c1-top {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  margin-bottom: 1rem;
}
.c1-kicker { color: var(--muted); font-size: 0.92rem; margin: 0; }
.c1-title { font-size: clamp(1.45rem, 2vw, 2rem); line-height: 1.3; margin: 0.2rem 0 0.8rem; }
.c1-instr {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.9rem 1rem;
  margin-bottom: 1rem;
}
.c1-instr h2 { margin: 0 0 0.35rem; font-size: 1.05rem; }
.c1-instr p { margin: 0; }
.c1-layout {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.c1-article, .c1-bank, .c1-actions, .c1-panel, .c1-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
}
.c1-article, .c1-panel { padding: 1rem 1.05rem 1.2rem; }
.c1-article p, .c1-panel p { margin: 0 0 0.9rem; overflow-wrap: anywhere; }
.c1-gap {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: flex-start;
  width: 100%;
  margin: 0 0 0.9rem;
  padding: 0.7rem 0.75rem;
  border: 1px dashed var(--line);
  border-radius: 12px;
  background: transparent;
  color: inherit;
  text-align: start;
  font: inherit;
  line-height: 1.55;
  min-height: 48px;
}
.c1-gap.is-active { border-style: solid; border-color: var(--accent); background: var(--accent-soft); }
.c1-gap.is-filled { border-style: solid; }
.c1-gap.is-example { border-style: solid; background: var(--accent-soft); cursor: default; }
.c1-gap.is-correct { border-color: var(--ok); background: var(--ok-bg); }
.c1-gap.is-wrong { border-color: var(--bad); background: var(--bad-bg); }
.c1-gap.is-empty-warn { border-color: var(--warn); background: var(--warn-bg); }
.c1-badge, .c1-letter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.7rem;
  height: 1.7rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-weight: 700;
  font-size: 0.85rem;
}
.c1-letter { flex: 0 0 auto; }
.c1-sentence { flex: 1 1 12rem; }
.c1-hint {
  margin: -0.4rem 0 0.9rem;
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg);
}
.c1-mini {
  border: 1px solid var(--line);
  background: var(--card);
  color: inherit;
  border-radius: 999px;
  min-height: 36px;
  padding: 0.2rem 0.75rem;
  font: inherit;
}
.c1-bank { padding: 0.85rem; }
.c1-bank summary { cursor: pointer; font-weight: 650; }
.c1-option {
  display: flex;
  gap: 0.55rem;
  width: 100%;
  margin-top: 0.55rem;
  padding: 0.7rem;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: transparent;
  color: inherit;
  text-align: start;
  font: inherit;
  line-height: 1.5;
  overflow-wrap: anywhere;
}
.c1-option.is-selected {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: inset 3px 0 0 var(--accent);
}
.c1-option.is-used { opacity: 0.72; }
.c1-option .tr {
  display: block;
  color: var(--muted);
  margin-top: 0.25rem;
}
.c1-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  padding: 0.85rem;
}
.c1-actions button, .c1-back {
  min-height: 44px;
  border-radius: 12px;
  border: 1px solid var(--accent);
  background: transparent;
  color: var(--ink);
  padding: 0.45rem 0.8rem;
  font: inherit;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}
.c1-actions .is-primary { background: var(--accent); color: #fff; }
html.dark .c1-actions .is-primary { color: #10231b; }
.c1-score, .c1-notice {
  margin: 0.8rem 0 0;
  font-weight: 650;
}
.c1-langs { display: flex; gap: 0.4rem; }
.c1-langs button[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); }
.c1-grid { display: grid; gap: 0.9rem; }
.c1-card {
  display: block;
  padding: 1rem 1.05rem;
  text-decoration: none;
  color: inherit;
}
.c1-card h2 { margin: 0.35rem 0; font-size: 1.2rem; line-height: 1.35; }
.c1-card p { margin: 0; color: var(--muted); }
.c1-pill {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.1rem 0.55rem;
  font-size: 0.82rem;
}
.c1-main { display: flex; flex-direction: column; gap: 1rem; min-width: 0; }
@media (min-width: 960px) {
  .c1-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.7fr) minmax(280px, 0.9fr);
    align-items: start;
  }
  .c1-main { grid-column: 1; grid-row: 1; }
  .c1-actions { grid-column: 1; grid-row: 2; }
  .c1-bank {
    grid-column: 2;
    grid-row: 1 / span 2;
    position: sticky;
    top: 1rem;
    max-height: calc(100vh - 2rem);
    overflow: auto;
  }
}
@media (max-width: 959px) {
  .c1-shell { width: min(1120px, calc(100% - 1.25rem)); }
  .c1-bank { position: static; max-height: none; }
}
.c1-gap-inline { display: inline-flex; width: auto; max-width: 100%; margin: 0.35rem 0; vertical-align: top; }
.c1-variants { display: flex; flex-wrap: wrap; gap: 0.45rem; margin-bottom: 0.8rem; }
.c1-variants button, .c1-dialog button { min-height: 44px; border-radius: 12px; border: 1px solid var(--line); background: transparent; color: inherit; padding: 0.35rem 0.75rem; font: inherit; }
.c1-variants button[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); }
.c1-dialog { position: fixed; z-index: 30; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(420px, calc(100% - 2rem)); background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 1rem; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.c1-dialog p { flex: 1 0 100%; margin: 0; }
.c1-solution-note { display: block; margin: 0.25rem 0 0.6rem; color: var(--muted); }
body[data-c1-page="exercise"] .c1-exercise-bar {
  width: min(1120px, calc(100% - 2rem));
  margin: 0.75rem auto 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  position: relative;
  z-index: 2;
}
body[data-c1-page="exercise"] a.telc-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 9px 16px;
  border-radius: 14px;
  border: 2px solid #cbd5e1;
  background: #f8fafc;
  color: #334155;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
}
body[data-c1-page="exercise"] a.telc-back-btn:hover { background: #eef2f7; border-color: #94a3b8; color: #0f172a; }
html.dark body[data-c1-page="exercise"] a.telc-back-btn { color: #e2e8f0; background: rgba(30, 41, 59, 0.9); border-color: #475569; }
body[data-c1-page="exercise"] .t1-hide-title-btn {
  width: 32px; height: 32px; min-width: 32px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid #d7dee8; border-radius: 999px; background: #fff; color: #5b6778; cursor: pointer;
}
body[data-c1-page="exercise"] .t1-hide-title-btn.is-on { background: #eef2f7; border-color: #94a3b8; color: #1e293b; }
html.dark body[data-c1-page="exercise"] .t1-hide-title-btn { background: #1e293b; color: #e2e8f0; border-color: #475569; }
html.c1-hide-title body[data-c1-page="exercise"] .c1-title { filter: blur(8px); user-select: none; }
@media (max-width: 640px) {
  body[data-c1-page="exercise"] .c1-exercise-bar { width: min(1120px, calc(100% - 1.25rem)); }
}
@media (max-width: 959px) {
  .c1-variant .c1-bank { display: none; }
  .c1-variant.is-sheet-open .c1-bank { display: block; position: fixed; z-index: 25; left: 0; right: 0; bottom: 0; max-height: 70vh; overflow: auto; border-radius: 16px 16px 0 0; }
  .c1-sheet-close { display: inline-flex; }
}
@media (min-width: 960px) {
  .c1-sheet-close { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; }
}
