/* IPV6learn — moderní, jednoduché, barevnější */

:root,
[data-theme="light"] {
  --ink: #0f172a;
  --ink-soft: #334155;
  --muted: #64748b;
  --line: #dbe4f0;
  --line-strong: #c5d4e8;
  --bg: #f3f8fc;
  --bg-soft: #eaf3fa;
  --surface: #ffffff;
  --surface-2: #eef5fb;
  --accent: #0ea5e9;
  --accent-2: #14b8a6;
  --accent-3: #f59e0b;
  --accent-hover: #0284c7;
  --accent-soft: #e0f2fe;
  --ok: #059669;
  --ok-bg: #d1fae5;
  --bad: #e11d48;
  --bad-bg: #ffe4e6;
  --info: #0284c7;
  --info-bg: #e0f2fe;
  --shadow: 0 2px 8px rgba(14, 165, 233, 0.08), 0 12px 32px rgba(15, 23, 42, 0.06);
  --header-border: #dbe4f0;
  --btn-secondary: #0f766e;
  --btn-secondary-hover: #0d9488;
  --mode-active-bg: #0ea5e9;
  --mode-active-fg: #ffffff;
  --radius: 14px;
  --radius-sm: 10px;
  --sans: "IBM Plex Sans", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --step-a: #eff6ff;
  --step-a-border: #93c5fd;
  --step-a-num: #2563eb;
  --step-b: #ecfdf5;
  --step-b-border: #6ee7b7;
  --step-b-num: #059669;
  --step-c: #fff7ed;
  --step-c-border: #fdba74;
  --step-c-num: #ea580c;
  color-scheme: light;
}

[data-theme="dark"] {
  --ink: #f1f5f9;
  --ink-soft: #cbd5e1;
  --muted: #94a3b8;
  --line: #1e293b;
  --line-strong: #334155;
  --bg: #0b1220;
  --bg-soft: #111827;
  --surface: #111827;
  --surface-2: #1e293b;
  --accent: #38bdf8;
  --accent-2: #2dd4bf;
  --accent-3: #fbbf24;
  --accent-hover: #7dd3fc;
  --accent-soft: rgba(56, 189, 248, 0.14);
  --ok: #34d399;
  --ok-bg: rgba(52, 211, 153, 0.14);
  --bad: #fb7185;
  --bad-bg: rgba(251, 113, 133, 0.14);
  --info: #38bdf8;
  --info-bg: rgba(56, 189, 248, 0.14);
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
  --header-border: #1e293b;
  --btn-secondary: #0f766e;
  --btn-secondary-hover: #14b8a6;
  --mode-active-bg: #38bdf8;
  --mode-active-fg: #0b1220;
  --step-a: rgba(37, 99, 235, 0.18);
  --step-a-border: rgba(147, 197, 253, 0.35);
  --step-a-num: #93c5fd;
  --step-b: rgba(5, 150, 105, 0.18);
  --step-b-border: rgba(110, 231, 183, 0.35);
  --step-b-num: #6ee7b7;
  --step-c: rgba(234, 88, 12, 0.18);
  --step-c-border: rgba(253, 186, 116, 0.4);
  --step-c-num: #fdba74;
  color-scheme: dark;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--sans);
  color: var(--ink);
  background:
    radial-gradient(900px 420px at 0% -10%, color-mix(in srgb, var(--accent) 18%, transparent), transparent 60%),
    radial-gradient(700px 380px at 100% 0%, color-mix(in srgb, var(--accent-2) 14%, transparent), transparent 55%),
    radial-gradient(600px 400px at 80% 100%, color-mix(in srgb, var(--accent-3) 10%, transparent), transparent 50%),
    var(--bg);
  background-attachment: fixed;
  line-height: 1.55;
  transition: background-color 0.35s ease, color 0.35s ease;
}

/* —— Header —— */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  max-width: 960px;
  margin: 0 auto;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--header-border);
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(12px);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.header-crumb {
  margin: 0;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
  padding: 0.35rem 0.75rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
}

/* —— Hub landing —— */
.hub {
  padding: 0.5rem 0 1rem;
}

.hub-intro {
  margin-bottom: 1.75rem;
  max-width: 36rem;
}

.hub-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.hub-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.45rem;
  text-align: left;
  padding: 1.25rem 1.2rem 1.15rem;
  border-radius: var(--radius);
  border: 1.5px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow);
  cursor: pointer;
  font: inherit;
  color: inherit;
  min-height: 11.5rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.hub-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px color-mix(in srgb, var(--accent) 18%, transparent);
}

.hub-card-short {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
  background: linear-gradient(165deg, var(--accent-soft), var(--surface) 55%);
}

.hub-card-test {
  border-color: color-mix(in srgb, var(--accent-2) 45%, var(--line));
  background: linear-gradient(165deg, color-mix(in srgb, var(--accent-2) 14%, var(--surface)), var(--surface) 55%);
}

.hub-card-subnet {
  border-color: color-mix(in srgb, var(--accent-3) 50%, var(--line));
  background: linear-gradient(165deg, color-mix(in srgb, var(--accent-3) 14%, var(--surface)), var(--surface) 55%);
}

.hub-card-special {
  border-color: color-mix(in srgb, #0891b2 45%, var(--line));
  background: linear-gradient(165deg, color-mix(in srgb, #0891b2 12%, var(--surface)), var(--surface) 55%);
}

.hub-card-learn {
  border-color: color-mix(in srgb, var(--ok) 40%, var(--line));
  background: linear-gradient(165deg, var(--ok-bg), var(--surface) 55%);
}

.hub-card-exam {
  border-color: color-mix(in srgb, #d97706 50%, var(--line));
  background: linear-gradient(165deg, color-mix(in srgb, #d97706 14%, var(--surface)), var(--surface) 55%);
}

.hub-card-exam .hub-icon {
  color: #b45309;
}

.hub-card-soon {
  opacity: 0.72;
  cursor: default;
  background: var(--surface-2);
}

.hub-card-soon:hover {
  transform: none;
  box-shadow: var(--shadow);
}

.hub-badge {
  position: absolute;
  top: 0.85rem;
  right: 0.85rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  border: 1px solid var(--line);
}

.hub-badge.is-live {
  background: var(--ok-bg);
  color: var(--ok);
  border-color: color-mix(in srgb, var(--ok) 35%, var(--line));
}

.hub-icon {
  font-family: var(--mono);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--accent);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.35rem 0.55rem;
  margin-top: 0.15rem;
}

.hub-card h2 {
  margin: 0.25rem 0 0;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}

.hub-card p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--ink-soft);
  line-height: 1.45;
  flex: 1;
}

.hub-card code {
  font-family: var(--mono);
  font-size: 0.88em;
  background: var(--accent-soft);
  padding: 0.05em 0.3em;
  border-radius: 4px;
}

.hub-cta {
  margin-top: 0.35rem;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--accent-hover);
}

.hub-card-soon .hub-cta {
  color: var(--muted);
}

.hub-foot {
  margin-top: 1.5rem;
  padding: 0.9rem 1.1rem;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 0.92rem;
}

.hub-foot p {
  margin: 0;
}

/* —— Module chrome —— */
.module-bar {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--line);
}

.module-bar-title {
  flex: 1;
  font-size: 0.88rem;
  font-weight: 650;
  color: var(--muted);
}

.btn-sm {
  padding: 0.4rem 0.8rem;
  font-size: 0.82rem;
}

.steps-compact {
  margin-bottom: 1rem;
}

.steps-compact .step {
  padding: 0.65rem 0.75rem;
  min-height: auto;
}

.steps-compact .step code {
  display: none;
}

.steps-compact .step h3 {
  font-size: 0.75rem;
}

@media (max-width: 900px) {
  .hub-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .hub-grid {
    grid-template-columns: 1fr;
  }
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  background: none;
  border: none;
  padding: 0.2rem 0;
  cursor: pointer;
  color: inherit;
  font: inherit;
  transition: transform 0.2s ease;
}

.brand:hover {
  transform: translateY(-1px);
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 10px;
  font-family: var(--mono);
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: -0.08em;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 6px 16px color-mix(in srgb, var(--accent) 35%, transparent);
}

.brand-name {
  font-weight: 700;
  font-size: 1.12rem;
  letter-spacing: -0.03em;
}

.mode-nav {
  display: flex;
  gap: 0.25rem;
  padding: 0.28rem;
  background: var(--surface);
  border-radius: 999px;
  border: 1px solid var(--line);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}

.mode-btn {
  font-family: var(--sans);
  font-size: 0.84rem;
  font-weight: 600;
  border: none;
  background: transparent;
  color: var(--ink-soft);
  padding: 0.48rem 0.95rem;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, transform 0.15s ease;
}

.mode-btn:hover {
  color: var(--ink);
  background: var(--bg-soft);
}

.mode-btn.is-active {
  background: var(--mode-active-bg);
  color: var(--mode-active-fg);
  box-shadow: 0 4px 12px color-mix(in srgb, var(--accent) 30%, transparent);
}

.theme-toggle {
  width: 2.45rem;
  height: 2.45rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  display: grid;
  place-items: center;
  position: relative;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.theme-toggle:hover {
  border-color: var(--accent);
  transform: rotate(-10deg);
}

.theme-icon {
  position: absolute;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.theme-icon-sun {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid currentColor;
  box-shadow:
    0 -7px 0 -5px currentColor,
    0 7px 0 -5px currentColor,
    7px 0 0 -5px currentColor,
    -7px 0 0 -5px currentColor,
    5px 5px 0 -5px currentColor,
    -5px 5px 0 -5px currentColor,
    5px -5px 0 -5px currentColor,
    -5px -5px 0 -5px currentColor;
}

.theme-icon-moon {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: transparent;
  box-shadow: 4px -2px 0 0 currentColor;
  transform: rotate(-30deg);
}

[data-theme="light"] .theme-icon-sun,
[data-theme="dark"] .theme-icon-moon {
  opacity: 0;
  transform: scale(0.5) rotate(45deg);
}

[data-theme="light"] .theme-icon-moon {
  opacity: 1;
}

[data-theme="dark"] .theme-icon-sun {
  opacity: 1;
  transform: scale(1) rotate(0);
}

main {
  max-width: 960px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3rem;
}

.view {
  display: none;
}

.view.is-visible {
  display: block;
  animation: viewIn 0.4s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes viewIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* —— Hero —— */
.hero {
  padding: 1.5rem 0 0.25rem;
}

.hero-kicker {
  margin: 0 0 0.55rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  animation: rise 0.5s ease both;
}

.hero-brand {
  margin: 0 0 0.65rem;
  font-size: clamp(2.6rem, 8vw, 4rem);
  font-weight: 700;
  letter-spacing: -0.045em;
  line-height: 1;
  color: var(--ink);
  animation: rise 0.55s 0.04s ease both;
}

.hero-lead {
  margin: 0 0 1.4rem;
  font-size: 1.1rem;
  color: var(--ink-soft);
  max-width: 34rem;
  animation: rise 0.55s 0.08s ease both;
}

.hero-lead code {
  font-family: var(--mono);
  font-size: 0.92em;
  font-weight: 600;
  background: var(--accent-soft);
  color: var(--accent-hover);
  padding: 0.12em 0.4em;
  border-radius: 7px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-bottom: 2rem;
  animation: rise 0.55s 0.12s ease both;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* —— Colorful steps —— */
.steps {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr;
  gap: 0.65rem;
  align-items: stretch;
  animation: rise 0.55s 0.16s ease both;
}

.step {
  margin: 0;
  padding: 1rem 1.05rem;
  border-radius: var(--radius);
  border: 1.5px solid;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  min-width: 0;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.step:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.step-a {
  background: var(--step-a);
  border-color: var(--step-a-border);
}

.step-b {
  background: var(--step-b);
  border-color: var(--step-b-border);
}

.step-c {
  background: var(--step-c);
  border-color: var(--step-c-border);
}

.step-num {
  width: 1.55rem;
  height: 1.55rem;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-size: 0.78rem;
  font-weight: 700;
  color: #fff;
}

.step-a .step-num {
  background: var(--step-a-num);
}

.step-b .step-num {
  background: var(--step-b-num);
}

.step-c .step-num {
  background: var(--step-c-num);
}

.step h3 {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--ink-soft);
}

.step code {
  font-family: var(--mono);
  font-size: clamp(0.68rem, 1.5vw, 0.82rem);
  font-weight: 500;
  word-break: break-all;
  color: var(--ink);
  line-height: 1.4;
}

.step-c code {
  color: var(--step-c-num);
  font-weight: 600;
}

.step-join {
  width: 10px;
  align-self: center;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.45;
  animation: joinPulse 1.6s ease-in-out infinite;
}

.step-join:nth-of-type(2) {
  animation-delay: 0.2s;
  background: var(--accent-2);
}

@keyframes joinPulse {
  0%,
  100% {
    opacity: 0.3;
    transform: scale(0.85);
  }
  50% {
    opacity: 1;
    transform: scale(1.15);
  }
}

/* —— Rules —— */
.rules {
  margin-top: 2.25rem;
  padding: 1.35rem 1.4rem;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  animation: rise 0.55s 0.22s ease both;
}

.rules h2 {
  margin: 0 0 0.85rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
}

.rules ol {
  margin: 0;
  padding-left: 1.2rem;
  color: var(--ink-soft);
}

.rules li {
  margin-bottom: 0.5rem;
  padding-left: 0.2rem;
}

.rules li::marker {
  color: var(--accent);
  font-weight: 700;
}

.rules code {
  font-family: var(--mono);
  font-size: 0.88em;
  background: var(--accent-soft);
  color: var(--accent-hover);
  padding: 0.1em 0.4em;
  border-radius: 6px;
}

/* —— Panels —— */
.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.2rem;
}

.panel-head h2 {
  margin: 0;
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.panel-sub {
  margin: 0.35rem 0 0;
  color: var(--ink-soft);
  font-size: 0.95rem;
  max-width: 36rem;
}

.stat {
  margin: 0;
  font-weight: 600;
  font-size: 0.86rem;
  padding: 0.5rem 0.95rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}

.stat span {
  font-family: var(--mono);
  color: var(--accent);
}

.instructions {
  background: linear-gradient(120deg, var(--accent-soft), color-mix(in srgb, var(--accent-2) 12%, var(--surface)));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.95rem 1.1rem;
  margin-bottom: 1rem;
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.instructions strong {
  color: var(--accent-hover);
}

/* —— Address board —— */
.addr-board {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  margin-bottom: 0.85rem;
}

.addr-row {
  display: grid;
  grid-template-columns: 9.5rem 1fr;
  border-bottom: 1px solid var(--line);
  align-items: stretch;
}

.addr-row:last-child {
  border-bottom: none;
}

.hextets-wrap {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  min-width: 0;
}

.row-label {
  display: flex;
  align-items: center;
  padding: 0.85rem 0.95rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ink-soft);
  background: var(--surface-2);
  border-right: 1px solid var(--line);
  line-height: 1.25;
}

.addr-row:nth-child(1) .row-label {
  background: color-mix(in srgb, var(--step-a) 70%, var(--surface-2));
  color: var(--step-a-num);
}

.addr-row:nth-child(2) .row-label {
  background: color-mix(in srgb, var(--step-b) 70%, var(--surface-2));
  color: var(--step-b-num);
}

.addr-row:nth-child(3) .row-label {
  background: color-mix(in srgb, var(--step-c) 70%, var(--surface-2));
  color: var(--step-c-num);
}

.hextet,
.hextet-input,
.compress-input {
  font-family: var(--mono);
  font-size: clamp(0.72rem, 2vw, 0.9rem);
  font-weight: 500;
  text-align: center;
}

.hextet {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.95rem 0.2rem;
  border-right: 1px solid var(--line);
  color: var(--ink);
  background: var(--bg-soft);
}

.hextets-wrap .hextet:last-child,
.hextets-wrap .hextet-input:last-child {
  border-right: none;
}

.hextet-input,
.compress-input {
  width: 100%;
  border: none;
  border-right: 1px solid var(--line);
  padding: 0.95rem 0.3rem;
  background: var(--surface);
  color: var(--ink);
  outline: none;
  transition: background 0.15s ease, box-shadow 0.15s ease;
}

.hextet-input:focus,
.compress-input:focus {
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 2px var(--accent);
  position: relative;
  z-index: 1;
}

.hextet-input.is-ok,
.compress-input.is-ok {
  background: var(--ok-bg);
  box-shadow: inset 0 0 0 2px var(--ok);
}

.hextet-input.is-bad,
.compress-input.is-bad {
  background: var(--bad-bg);
  box-shadow: inset 0 0 0 2px var(--bad);
  animation: shake 0.35s ease;
}

@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-3px);
  }
  75% {
    transform: translateX(3px);
  }
}

.compress-input {
  border-right: none;
  text-align: left;
  padding-left: 1rem;
  padding-right: 1rem;
}

/* —— Buttons —— */
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1.1rem;
}

.btn {
  font-family: var(--sans);
  font-size: 0.92rem;
  font-weight: 650;
  padding: 0.7rem 1.25rem;
  border-radius: var(--radius-sm);
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease,
    transform 0.15s ease, box-shadow 0.2s ease;
}

.btn:hover:not(:disabled) {
  transform: translateY(-2px);
}

.btn:active:not(:disabled) {
  transform: translateY(0);
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-primary {
  background: linear-gradient(145deg, var(--accent), color-mix(in srgb, var(--accent) 70%, var(--accent-2)));
  border-color: transparent;
  color: #fff;
  box-shadow: 0 8px 20px color-mix(in srgb, var(--accent) 35%, transparent);
}

.btn-primary:hover:not(:disabled) {
  background: linear-gradient(145deg, var(--accent-hover), var(--accent));
}

[data-theme="dark"] .btn-primary {
  color: #0b1220;
}

.btn-secondary {
  background: var(--btn-secondary);
  border-color: var(--btn-secondary);
  color: #fff;
  box-shadow: 0 6px 16px color-mix(in srgb, var(--btn-secondary) 30%, transparent);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--btn-secondary-hover);
  border-color: var(--btn-secondary-hover);
}

.btn-ghost {
  background: var(--surface);
  border-color: var(--line-strong);
  color: var(--ink);
}

.btn-ghost:hover:not(:disabled) {
  background: var(--surface-2);
  border-color: var(--accent);
  color: var(--accent-hover);
}

.btn.is-pulse {
  animation: softPulse 1.2s ease-in-out infinite;
}

@keyframes softPulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 45%, transparent);
  }
  50% {
    box-shadow: 0 0 0 8px color-mix(in srgb, var(--accent) 0%, transparent);
  }
}

/* —— Feedback —— */
.feedback {
  margin-top: 0.9rem;
  padding: 0.95rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 0.92rem;
  line-height: 1.45;
  background: var(--surface);
  animation: viewIn 0.3s ease both;
}

.feedback .fb-title {
  margin: 0 0 0.45rem;
  font-weight: 700;
}

.feedback .fb-list {
  margin: 0;
  padding-left: 1.15rem;
}

.feedback .fb-list li {
  margin-bottom: 0.35rem;
}

.feedback .fb-where {
  font-weight: 700;
}

.feedback code {
  font-family: var(--mono);
  font-size: 0.88em;
  font-weight: 500;
  background: var(--surface-2);
  padding: 0.05em 0.3em;
  border-radius: 5px;
}

.feedback .fb-hint {
  margin: 0.55rem 0 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.feedback .fb-lesson {
  margin-top: 0.75rem;
  padding: 0.75rem 0.85rem;
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--accent-3) 12%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--accent-3) 35%, var(--line));
}

.feedback .fb-lesson strong {
  display: block;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.3rem;
  color: var(--step-c-num);
}

.feedback .fb-lesson p {
  margin: 0;
  color: var(--ink-soft);
}

.feedback.is-ok {
  background: var(--ok-bg);
  border-color: color-mix(in srgb, var(--ok) 40%, var(--line));
  color: var(--ok);
  font-weight: 600;
}

.feedback.is-bad {
  background: var(--bad-bg);
  border-color: color-mix(in srgb, var(--bad) 35%, var(--line));
}

.feedback.is-bad .fb-title,
.feedback.is-bad .fb-where {
  color: var(--bad);
}

.feedback.is-info {
  background: var(--info-bg);
  border-color: color-mix(in srgb, var(--info) 40%, var(--line));
  color: var(--info);
  font-weight: 600;
}

/* —— Test —— */
.progress-track {
  height: 6px;
  background: var(--surface-2);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 0.95rem;
}

.progress-fill {
  height: 100%;
  width: 10%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2) 55%, var(--accent-3));
  border-radius: 999px;
  transition: width 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.test-dots {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1rem;
}

.test-dot {
  width: 2.05rem;
  height: 2.05rem;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--line-strong);
  background: var(--surface);
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--ink-soft);
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease,
    transform 0.15s ease;
}

.test-dot:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px);
}

.test-dot.is-filled {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent-hover);
}

.test-dot.is-current {
  background: var(--mode-active-bg);
  border-color: var(--mode-active-bg);
  color: var(--mode-active-fg);
}

/* —— Results —— */
.results-card {
  text-align: center;
  padding: 1.75rem 0 0.5rem;
  max-width: 40rem;
  margin: 0 auto;
}

.results-label {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent);
}

.results-score {
  margin: 0.45rem 0 0;
  font-size: clamp(2.8rem, 8vw, 4.2rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1;
  animation: rise 0.5s ease both;
}

.results-pct {
  margin: 0.35rem 0 0;
  font-family: var(--mono);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--accent-2);
}

.results-breakdown {
  margin: 0.5rem 0 0;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--ink-soft);
}

.results-msg {
  margin: 0.8rem 0 1.4rem;
  color: var(--ink-soft);
}

.results-list {
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.results-actions {
  justify-content: center;
  margin-bottom: 0;
}

.result-item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.7rem;
  align-items: start;
  padding: 0.85rem 1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.03);
  animation: rise 0.4s ease both;
}

.result-item .badge {
  font-weight: 700;
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  padding: 0.25rem 0.5rem;
  border-radius: 7px;
}

.result-item.is-ok .badge {
  color: var(--ok);
  background: var(--ok-bg);
}

.result-item.is-bad .badge {
  color: var(--bad);
  background: var(--bad-bg);
}

.result-item code {
  font-family: var(--mono);
  font-size: 0.78rem;
  word-break: break-all;
}

.result-meta {
  color: var(--muted);
  margin-top: 0.22rem;
  font-size: 0.8rem;
}

.site-footer {
  text-align: center;
  padding: 1.35rem 1.25rem 2.35rem;
  color: var(--muted);
  font-size: 0.8rem;
  border-top: 1px solid var(--line);
  max-width: 960px;
  margin: 0 auto;
}

.site-footer p {
  margin: 0;
}

.footer-credit {
  margin-top: 0.4rem !important;
  font-size: 0.78rem;
}

.footer-credit a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s ease;
}

.footer-credit a:hover {
  color: var(--accent-hover);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* —— Learn / teorie —— */
.learn {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.learn-toc {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  padding: 0.75rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  position: sticky;
  top: 4.25rem;
  z-index: 5;
}

.learn-toc a {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink-soft);
  text-decoration: none;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.learn-toc a:hover {
  color: var(--accent-hover);
  border-color: var(--accent);
  background: var(--accent-soft);
}

.learn-block {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem 1.35rem;
  box-shadow: var(--shadow);
  scroll-margin-top: 8rem;
}

.learn-block h3 {
  margin: 0 0 0.85rem;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.learn-block h4 {
  margin: 0.85rem 0 0.45rem;
  font-size: 0.95rem;
  color: var(--accent-hover);
}

.learn-block p,
.learn-block li {
  color: var(--ink-soft);
}

.learn-block ol,
.learn-list {
  margin: 0 0 0.75rem;
  padding-left: 1.2rem;
}

.learn-block li {
  margin-bottom: 0.4rem;
}

.learn-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin: 0.85rem 0;
}

.learn-card {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 1rem;
}

.learn-card h4 {
  margin: 0 0 0.5rem;
  color: var(--ink);
}

.learn-card ul {
  margin: 0;
  padding-left: 1.1rem;
}

.learn-card p {
  margin: 0 0 0.45rem;
  font-size: 0.92rem;
}

.learn-card p:last-child {
  margin-bottom: 0;
}

.learn-compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.learn-compare > div {
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  padding: 1rem;
}

.learn-compare h4 {
  margin-top: 0;
}

.learn-callout {
  margin: 0.85rem 0;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--line));
  color: var(--ink-soft);
  font-size: 0.92rem;
}

.learn-callout.is-warn {
  background: color-mix(in srgb, var(--accent-3) 14%, var(--surface));
  border-color: color-mix(in srgb, var(--accent-3) 40%, var(--line));
}

.learn-callout strong {
  color: var(--ink);
}

.learn-note {
  margin: 0.75rem 0 0;
  font-size: 0.9rem;
  color: var(--muted);
}

.learn-table-wrap {
  overflow-x: auto;
  margin: 0.75rem 0;
}

.learn-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.learn-table th,
.learn-table td {
  text-align: left;
  padding: 0.7rem 0.85rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.learn-table th {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  background: var(--surface-2);
}

.learn-table code {
  font-family: var(--mono);
  font-size: 0.85em;
  background: var(--accent-soft);
  color: var(--accent-hover);
  padding: 0.1em 0.35em;
  border-radius: 5px;
  white-space: nowrap;
}

.learn-block code {
  font-family: var(--mono);
  font-size: 0.9em;
  background: var(--surface-2);
  padding: 0.08em 0.35em;
  border-radius: 5px;
}

.learn-link {
  color: var(--accent);
  font-weight: 650;
  text-decoration: none;
}

.learn-link:hover {
  text-decoration: underline;
}

.learn-sources {
  margin: 0.5rem 0 0;
  font-size: 0.82rem;
  color: var(--muted);
}

.learn-sources a {
  color: var(--accent);
}

@media (max-width: 720px) {
  .learn-cards,
  .learn-compare {
    grid-template-columns: 1fr;
  }

  .learn-toc {
    top: auto;
    position: relative;
  }

  .mode-btn {
    font-size: 0.75rem;
    padding: 0.45rem 0.55rem;
  }
}

@media (max-width: 860px) {
  .steps {
    grid-template-columns: 1fr;
    gap: 0.55rem;
  }

  .step-join {
    width: 8px;
    height: 8px;
    justify-self: center;
  }
}

@media (max-width: 720px) {
  .addr-row {
    grid-template-columns: 1fr;
  }

  .row-label {
    border-right: none;
    border-bottom: 1px solid var(--line);
    padding: 0.5rem 0.85rem;
  }

  .hextets-wrap {
    grid-template-columns: repeat(4, 1fr);
  }

  .hextets-wrap .hextet:nth-child(4n),
  .hextets-wrap .hextet-input:nth-child(4n) {
    border-right: none;
  }

  .hextets-wrap .hextet:nth-child(n + 5),
  .hextets-wrap .hextet-input:nth-child(n + 5) {
    border-top: 1px solid var(--line);
  }

  .header-right {
    width: 100%;
    justify-content: space-between;
  }

  .mode-nav {
    flex: 1;
  }

  .mode-btn {
    flex: 1;
    text-align: center;
  }

  .actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .actions .btn {
    width: 100%;
  }
}

/* —— Otázky zkoušení —— */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.exam-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  align-items: center;
  justify-content: space-between;
  margin: 0 0 1.25rem;
}

.exam-modes {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: var(--surface);
}

.exam-mode-btn {
  font: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  padding: 0.45rem 0.9rem;
  border: none;
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
}

.exam-mode-btn + .exam-mode-btn {
  border-left: 1px solid var(--line);
}

.exam-mode-btn.is-active {
  background: color-mix(in srgb, #d97706 18%, var(--surface));
  color: var(--ink);
}

.exam-filter select {
  font: inherit;
  font-size: 0.9rem;
  padding: 0.45rem 0.75rem;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  max-width: 100%;
}

.exam-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1.35rem 1.5rem 1.25rem;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-height: 16rem;
}

.exam-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
  align-items: center;
}

.exam-id {
  font-family: var(--mono);
  font-size: 0.85rem;
  font-weight: 600;
  color: #b45309;
  background: color-mix(in srgb, #d97706 12%, var(--surface));
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
}

.exam-topic-tag {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--muted);
  text-transform: uppercase;
}

.exam-question {
  margin: 0;
  font-size: clamp(1.2rem, 2.5vw, 1.55rem);
  letter-spacing: -0.02em;
  line-height: 1.35;
}

.exam-answer-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  justify-content: center;
  min-height: 5.5rem;
}

.exam-answer {
  margin: 0;
  padding: 1rem 1.1rem;
  border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--ok) 35%, var(--line));
  background: var(--ok-bg);
  color: var(--ink);
  line-height: 1.55;
  font-size: 0.98rem;
  white-space: pre-wrap;
}

.exam-actions {
  margin-top: 0.25rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--line);
}

.exam-empty {
  margin: 1.5rem 0;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 640px) {
  .exam-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .exam-modes {
    width: 100%;
  }

  .exam-mode-btn {
    flex: 1;
  }

  .exam-filter select {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
