/* HolisferAccount - tasarım tokenları (saf CSS, build/npm gerektirmez) */

:root {
  --ink: #1b1f19;
  --ink-900: #1b1f19;
  --ink-800: #a6741e;
  --ink-700: #895c14;
  --ink-600: #c0924a;
  --surface: #ffffff;
  --surface-muted: #eef0e8;
  --surface-border: #dadfd2;
  --accent: #a6741e;
  --accent-soft: #f1e6cc;
  --text-secondary: #5d6459;
  --success: #2f7a52;
  --danger: #a8412c;
  --warning: #8a6a1f;
  --radius-card: 8px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "IBM Plex Sans", sans-serif;
  background: var(--surface-muted);
  color: var(--ink);
}

h1, h2, h3, .font-display {
  font-family: "IBM Plex Sans", sans-serif;
  font-weight: 600;
  letter-spacing: -0.01em;
}

a {
  color: inherit;
}

/* --- Layout --- */

.topbar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--ink);
  border-bottom: none;
  padding: 0.75rem 1.5rem;
  --text-secondary: #aab3a0;
  --surface-border: #343a2c;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.brand {
  font-weight: 500;
  font-size: 1.125rem;
  color: #f3f1e6;
  font-family: "IBM Plex Sans", sans-serif;
}

.brand-accent {
  font-weight: 700;
  color: var(--ink-600);
}

.nav {
  display: flex;
  gap: 0.25rem;
}

.nav-link {
  padding: 0.5rem 0.75rem;
  border-radius: 4px;
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  color: var(--text-secondary);
}

.nav-link.active {
  background: var(--ink-800);
  color: white;
}

.nav-link:not(.active):hover {
  background: var(--surface-muted);
}

.topbar .nav-link:not(.active) {
  color: var(--text-secondary);
}

.topbar .nav-link:not(.active):hover {
  background: rgba(255, 255, 255, 0.08);
}

.logout-link {
  font-size: 0.875rem;
  color: var(--text-secondary);
  text-decoration: none;
}

.topbar .logout-link {
  color: #cfd6c0;
}

.topbar .logout-link:hover {
  color: #ffffff;
}

.page {
  max-width: 960px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

/* Fonksiyon sayfalari (bkz. {% block page_wide %} - emailsignature modulu
   sablonlari) icerigin sikismamasi icin .page'in 960px sinirini kaldirir;
   Ana Sayfa ve Yonetim/config sayfalari .page-wide eklemedigi icin
   960px max-width'te kalmaya devam eder. */
.page-wide {
  max-width: none;
}

.page-with-sidebar {
  display: flex;
  gap: 2rem;
}

.sidebar {
  width: 12rem;
  flex-shrink: 0;
}

.sidebar-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  padding: 0 0.5rem;
  margin-bottom: 0.75rem;
}

.sidebar-link {
  display: block;
  padding: 0.5rem 0.75rem;
  border-radius: 4px;
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  color: var(--text-secondary);
  margin-bottom: 0.25rem;
}

.sidebar-link.active {
  background: white;
  color: var(--ink);
  border: 1px solid var(--surface-border);
}

.content {
  flex: 1;
}

.sidebar-toggle {
  display: none;
}

/* Fonksiyon sayfalarinda .sidebar sabit 12rem genislikte oldugu icin dar
   ekranda .content'e ~200px'lik bir seritten fazla yer kalmiyordu. Mobilde
   sidebar'i, topbar'da zaten kullanilan ayni acilir-kapanir menu deseniyle
   (bkz. .nav-toggle/.topbar-menu, ayni ozgunluk numarasi hilesi burada da
   gecerli: .sidebar-menu.sidebar-menu-open iki class'li oldugu icin kaynak
   sirasindan bagimsiz her zaman kazanir) bir .sidebar-toggle dugmesinin
   arkasina topluyoruz. */
@media (max-width: 767px) {
  .page-with-sidebar {
    flex-direction: column;
    gap: 0.75rem;
  }

  .sidebar {
    width: 100%;
  }

  .sidebar-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    background: var(--surface);
    border: 1px solid var(--surface-border);
    border-radius: 4px;
    padding: 0.625rem 0.875rem;
    font-size: 0.9rem;
    font-weight: 500;
    font-family: inherit;
    color: var(--ink);
    cursor: pointer;
  }

  .sidebar-menu {
    display: none;
    flex-direction: column;
    margin-top: 0.5rem;
  }

  .sidebar-menu.sidebar-menu-open {
    display: flex;
  }

  .sidebar-link {
    margin-bottom: 0.25rem;
  }
}

/* --- Card / form kontrolleri --- */

.card {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-card);
  padding: 1.5rem;
}

.field {
  display: block;
  margin-bottom: 1rem;
}

.field-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 0.375rem;
}

.text-input, select.text-input {
  width: 100%;
  border: 1px solid var(--surface-border);
  border-radius: 4px;
  padding: 0.625rem 0.875rem;
  font-size: 0.95rem;
  font-family: inherit;
  color: var(--ink);
  background: white;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.text-input:focus {
  border-color: var(--ink-600);
  box-shadow: 0 0 0 3px rgba(166, 116, 30, 0.18);
}

.field-error {
  display: block;
  margin-top: 0.375rem;
  font-size: 0.875rem;
  color: var(--danger);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 4px;
  padding: 0.625rem 1.125rem;
  font-size: 0.95rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
}

.btn-primary {
  background: var(--ink-800);
  color: white;
  width: 100%;
}

.btn-primary:hover {
  background: var(--ink-700);
}

.btn-secondary {
  background: white;
  color: var(--ink);
  border: 1px solid var(--surface-border);
}

.btn-secondary:hover {
  background: var(--surface-muted);
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}

.form-actions .btn-primary,
.form-actions .btn-secondary,
.form-actions .btn-danger {
  width: auto;
}

.radio-group {
  display: flex;
  gap: 0.75rem;
}

.radio-option {
  flex: 1;
  border: 1px solid var(--surface-border);
  border-radius: 4px;
  padding: 0.625rem 0.875rem;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.radio-option.selected {
  border-color: var(--ink-800);
  background: rgba(166, 116, 30, 0.08);
}

.hint {
  background: var(--surface-muted);
  border-radius: 4px;
  padding: 0.625rem 0.875rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.alert {
  border-radius: 4px;
  padding: 0.625rem 0.875rem;
  font-size: 0.875rem;
  margin-bottom: 1rem;
}

.alert-danger {
  background: rgba(168, 65, 44, 0.1);
  color: var(--danger);
}

.alert-success {
  background: rgba(47, 122, 82, 0.1);
  color: var(--success);
}

.alert-warning {
  background: rgba(138, 106, 31, 0.1);
  color: var(--warning);
}

.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 3px;
  border-inline-start: 3px solid currentColor;
  padding: 0.25rem 0.6rem;
  font-size: 0.75rem;
  font-weight: 500;
}

.badge-accent {
  background: var(--accent-soft);
  color: #6b4a14;
}

.badge-neutral {
  background: var(--surface-muted);
  color: var(--text-secondary);
}

.badge-success {
  background: rgba(47, 122, 82, 0.1);
  color: var(--success);
}

.table-scroll {
  overflow-x: auto;
  max-width: 100%;
}

table.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  text-align: start;
}

.data-table th {
  border-bottom: 1px solid var(--surface-border);
  color: var(--text-secondary);
  font-weight: 500;
  padding: 0.75rem 1.25rem;
}

.data-table td {
  border-bottom: 1px solid var(--surface-border);
  padding: 0.75rem 1.25rem;
}

.data-table tr:last-child td {
  border-bottom: none;
}

/* --- Login sayfasi --- */

.login-shell {
  display: flex;
  min-height: 100vh;
}

.login-brand-panel {
  display: none;
  width: 40%;
  flex-direction: column;
  justify-content: space-between;
  background: radial-gradient(circle at center, color-mix(in srgb, var(--ink-600) 45%, white) 0%, var(--ink) 72%);
  color: white;
  padding: 2.5rem;
}

@media (min-width: 768px) {
  .login-brand-panel {
    display: flex;
  }
}

.login-brand-panel .slogan {
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.7);
  margin-top: 0.25rem;
}

.login-brand-panel .footnote {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.5);
}

.login-motif {
  flex: 1;
  padding: 2.5rem 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-logo-img {
  display: block;
  max-width: 18rem;
  width: 100%;
  height: auto;
}

.login-form-panel {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.login-form-inner {
  width: 100%;
  max-width: 24rem;
}

.login-title {
  font-size: 1.5rem;
  font-weight: 600;
  margin: 0 0 0.25rem;
}

.login-subtitle {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin: 0 0 1.5rem;
}

.link-button {
  background: none;
  border: none;
  padding: 0;
  font-size: 0.875rem;
  color: var(--text-secondary);
  text-decoration: underline;
  cursor: pointer;
}

/* --- HTMX yukleme gostergesi --- */
.htmx-indicator {
  display: none;
}
.htmx-request .htmx-indicator {
  display: block;
}
.htmx-request.htmx-indicator {
  display: block;
}

/* --- Ek badge/buton tonlari --- */
.badge-danger {
  background: rgba(168, 65, 44, 0.1);
  color: var(--danger);
}

.badge-warning {
  background: rgba(138, 106, 31, 0.1);
  color: var(--warning);
}

.btn-danger {
  background: white;
  color: var(--danger);
  border: 1px solid rgba(168, 65, 44, 0.35);
}

.btn-danger:hover {
  background: rgba(168, 65, 44, 0.08);
}

/* --- Konfigurasyon ana sayfasi - fonksiyon kutucuklari --- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1rem;
}

@media (max-width: 767px) {
  .stat-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.stat-tile {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-card);
  padding: 1.25rem;
}

.stat-tile-logo {
  padding: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.stat-tile-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.stat-tile-label {
  margin: 0 0 0.5rem;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.stat-tile-value {
  margin: 0;
  font-size: 1.75rem;
  font-weight: 700;
  font-family: "IBM Plex Mono", monospace;
  color: var(--ink);
}

.tile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
  gap: 1rem;
}

.tile-card {
  display: block;
  text-decoration: none;
  color: inherit;
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-card);
  padding: 1.25rem;
  transition: border-color 0.15s;
}

.tile-card:hover {
  border-color: var(--ink-600);
}

.tile-card-title {
  font-weight: 600;
  margin: 0 0 0.375rem;
}

.tile-card-desc {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.tile-grid-3col {
  grid-template-columns: 1fr;
}

@media (min-width: 960px) {
  .tile-grid-3col {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* --- Topbar sag taraf (dil secici + cikis) --- */
.topbar-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.nav-toggle {
  display: none;
  border: 1px solid var(--surface-border);
  background: transparent;
  color: #eae8db;
  border-radius: 4px;
  width: 2.25rem;
  height: 2.25rem;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
}

.topbar-menu {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.lang-select {
  border: 1px solid var(--surface-border);
  border-radius: 4px;
  padding: 0.375rem 0.5rem;
  font-size: 0.85rem;
  font-family: inherit;
  color: var(--ink);
  background: white;
}

.topbar .lang-select {
  background: transparent;
  border-color: #3c4432;
  color: #eae8db;
}

.topbar .lang-select option {
  color: var(--ink);
  background: white;
}

.is-hidden {
  display: none !important;
}

.auth-lang-switcher {
  position: absolute;
  top: 1.25rem;
  inset-inline-end: 1.25rem;
  z-index: 10;
}

/* --- HTML imza sablon editoru --- */
.editor-btn {
  border: 1px solid transparent;
  background: transparent;
  border-radius: 4px;
  padding: 0.35rem 0.55rem;
  font-size: 0.85rem;
  font-family: inherit;
  color: var(--ink);
  cursor: pointer;
  line-height: 1;
}

.editor-btn:hover {
  background: white;
  border-color: var(--surface-border);
}

.placeholder-chip {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--surface-border);
  background: var(--surface-muted);
  border-radius: 999px;
  padding: 0.3rem 0.7rem;
  font-size: 0.8rem;
  color: var(--ink);
  cursor: pointer;
  margin-inline-end: 0.375rem;
  margin-block-end: 0.375rem;
}

.placeholder-chip:hover {
  border-color: var(--ink-600);
  background: white;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(27, 31, 25, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 2rem;
}

.modal-box {
  background: white;
  border-radius: var(--radius-card);
  width: 100%;
  max-width: 40rem;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--surface-border);
}

.modal-body {
  padding: 1.25rem;
  overflow: auto;
}

.modal-body iframe {
  width: 100%;
  height: 20rem;
  border: 1px solid var(--surface-border);
  border-radius: 4px;
}

/* --- HolisferAssistant widget (Faz 3) - shared/assistant/templates/assistant/*.html ---
   Varsayilan panel ~420px (balonda satir basina ~55-60 karakter), baslikdaki
   "Genislet" ile 720px'e cikar (.ai-widget-panel--expanded, tercih localStorage'da).
   Mobilde (<640px) ekran genisliginde alt panel olur. */
.ai-widget {
  position: fixed;
  inset-inline-end: 1.5rem;
  bottom: 1.5rem;
  z-index: 1000;
}

.ai-widget-fab {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3.25rem;
  height: 3.25rem;
  border-radius: 999px;
  border: none;
  background: var(--ink-800);
  color: white;
  box-shadow: 0 4px 12px rgba(27, 31, 25, 0.24);
  cursor: pointer;
}

.ai-widget-fab:hover {
  background: var(--ink-700);
}

.ai-widget-panel {
  position: absolute;
  inset-inline-end: 0;
  bottom: 4rem;
  width: min(420px, calc(100vw - 3rem));
}

.ai-widget-panel--expanded {
  width: min(720px, calc(100vw - 3rem));
}

.ai-widget-card {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1rem;
  height: min(560px, 72vh);
  box-shadow: 0 12px 32px rgba(27, 31, 25, 0.18);
}

.ai-widget-panel--expanded .ai-widget-card {
  height: min(860px, 85vh);
}

.ai-widget-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding-bottom: 0.625rem;
  border-bottom: 1px solid var(--surface-border);
  font-size: 0.95rem;
}

.ai-widget-header-actions {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.ai-widget-new-form {
  margin: 0;
  margin-inline-end: 0.25rem;
}

.ai-widget-new-btn {
  width: auto;
  font-size: 0.75rem;
  padding: 0.3rem 0.65rem;
}

.ai-widget-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
}

.ai-widget-icon-btn:hover {
  background: var(--surface-muted);
  color: var(--ink);
}

.ai-widget-expand .ai-icon-collapse,
.ai-widget-expand[aria-pressed="true"] .ai-icon-expand {
  display: none;
}

.ai-widget-expand[aria-pressed="true"] .ai-icon-collapse {
  display: block;
}

.ai-widget-messages {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  padding-inline-end: 0.25rem;
}

.ai-widget-message {
  max-width: 88%;
  border-radius: 0.875rem;
  padding: 0.55rem 0.8rem;
  font-size: 0.9rem;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.ai-widget-message p {
  margin: 0;
}

.ai-widget-message .badge {
  margin-top: 0.375rem;
}

.ai-widget-message-user {
  align-self: flex-end;
  background: var(--ink-800);
  color: white;
  border-end-end-radius: 0.25rem;
}

.ai-widget-message-assistant {
  align-self: flex-start;
  background: var(--surface-muted);
  color: var(--ink);
  border-end-start-radius: 0.25rem;
}

.ai-widget-action {
  width: auto;
  margin-top: 0.5rem;
  padding: 0.4rem 0.85rem;
  font-size: 0.85rem;
}

.ai-widget-empty {
  margin: auto;
  max-width: 30ch;
  text-align: center;
}

.ai-widget-empty-title {
  margin: 0 0 0.25rem;
  font-weight: 600;
  color: var(--ink);
}

.ai-widget-empty-hint {
  margin: 0;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.ai-widget-form {
  display: flex;
  align-items: flex-end;
  gap: 0.5rem;
}

.ai-widget-input {
  flex: 1;
  min-height: 2.625rem;
  max-height: 8rem;
  resize: none;
  line-height: 1.4;
  overflow-y: auto;
}

.ai-widget-form .btn-primary {
  width: auto;
  min-height: 2.625rem;
}

.ai-widget-form.htmx-request .btn-primary,
.ai-widget-new-form.htmx-request .btn {
  opacity: 0.6;
  cursor: progress;
}

@media (max-width: 639px) {
  .ai-widget {
    inset-inline-end: 1rem;
    bottom: 1rem;
  }

  .ai-widget-panel,
  .ai-widget-panel--expanded {
    position: fixed;
    inset-inline: 0.5rem;
    bottom: 5rem;
    width: auto;
  }

  .ai-widget-card,
  .ai-widget-panel--expanded .ai-widget-card {
    height: min(640px, calc(100vh - 6rem));
    height: min(640px, calc(100dvh - 6rem));
  }

  .ai-widget-expand {
    display: none;
  }

  /* iOS Safari 16px alti yazi boyutunda odaklaninca sayfayi zoom'lar */
  .ai-widget-input {
    font-size: 1rem;
  }
}
/* --- Topbar mobil menu (hamburger): topbar-right'taki kullanici adi/dil
   secici/cikis linkleri mobilde tek satira sigmayip ic ice giriyordu, bunlari
   .topbar-menu-open acilana kadar gizli bir acilir menuye topladik (bkz.
   holisfer/static/css/app.css - ayni desen). .topbar-menu-open iki class'li
   oldugu icin (ozgunluk 0,0,2,0) asagidaki media query'deki .topbar-menu
   { display:none } (ozgunluk 0,0,1,0) kurali kaynak sirasindan bagimsiz her
   zaman kazanir. */
@media (max-width: 767px) {
  .topbar {
    padding-inline: 1rem;
  }

  .nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .topbar-menu {
    display: none;
    position: absolute;
    inset-inline: 0;
    top: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 0.25rem;
    margin: 0;
    padding: 0.75rem 1rem 1rem;
    background: var(--ink);
    border-bottom: 1px solid var(--surface-border);
    z-index: 20;
  }

  .topbar-menu.topbar-menu-open {
    display: flex;
  }

  .topbar-menu form {
    padding: 0.375rem 0;
  }

  .topbar-menu .lang-select {
    width: 100%;
  }
}

/* --- BreakRoom: Patika oyunu (yalniz bu projede kullanilir - diger projelere tasinmaz) ---
   Gorsel dil "gece bahcesi": koyu tahta, yuvarlatilmis tas karolar, altin isik izi,
   elmas "run tasi" numaralar, yesil cit duvarlar. Renkler mevcut tokenlardan turetilir. */
.trail-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: 34rem;
  margin: 0 auto 0.75rem;
}

.trail-timer {
  font-family: "IBM Plex Mono", monospace;
  font-size: 1.5rem;
  font-weight: 600;
}

.trail-progress {
  flex: 1;
  max-width: 9rem;
  position: relative;
  padding: 0.2rem 0.6rem;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.75rem;
  text-align: center;
  color: var(--text-secondary);
  border-radius: 999px;
  background: linear-gradient(to right, var(--accent-soft) var(--trail-progress, 0%), var(--surface) var(--trail-progress, 0%));
  border: 1px solid var(--surface-border);
  transition: background 0.2s;
}

.trail-toolbar-actions {
  display: inline-flex;
  gap: 0.5rem;
}

.trail-board-wrap {
  max-width: 34rem;
  margin: 0 auto;
  padding: 0.5rem;
  border-radius: calc(var(--radius-card) * 2);
  background: var(--ink);
  box-shadow: 0 10px 30px rgba(27, 31, 25, 0.25);
}

.trail-board {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  outline-offset: 4px;
}

.trail-stone {
  fill: color-mix(in srgb, var(--ink) 82%, white);
  transition: fill 0.25s ease;
}

.trail-stone-lit {
  fill: color-mix(in srgb, var(--accent) 48%, var(--ink));
}

.trail-glow {
  stroke: var(--accent);
  stroke-width: 30;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.22;
  pointer-events: none;
}

.trail-thread {
  stroke: var(--accent-soft);
  stroke-width: 9;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}

.trail-hedge {
  fill: var(--success);
  stroke: color-mix(in srgb, var(--success) 55%, black);
  stroke-width: 2;
  pointer-events: none;
}

.trail-node-shape {
  fill: var(--ink);
  stroke: var(--accent);
  stroke-width: 7;
  stroke-linejoin: round;
  pointer-events: none;
  transition: fill 0.2s ease;
}

.trail-node-text {
  fill: var(--accent-soft);
  font-family: "IBM Plex Mono", monospace;
  font-size: 30px;
  font-weight: 600;
  text-anchor: middle;
  dominant-baseline: central;
  pointer-events: none;
}

.trail-node-done .trail-node-shape {
  fill: var(--accent);
}

.trail-node-done .trail-node-text {
  fill: var(--ink);
}

.trail-node-next .trail-node-shape {
  stroke: var(--accent-soft);
  animation: trail-beacon 1.4s ease-in-out infinite;
  transform-box: fill-box;
  transform-origin: center;
}

.trail-head {
  fill: var(--accent-soft);
  stroke: var(--accent);
  stroke-width: 4;
  pointer-events: none;
  transform-box: fill-box;
  transform-origin: center;
  animation: trail-firefly 1.2s ease-in-out infinite;
}

.trail-blocked {
  animation: trail-shake 0.26s ease;
}

.trail-won .trail-stone {
  animation: trail-ripple 0.9s ease both;
}

.trail-rules {
  margin: 0 0 1.25rem;
  padding-inline-start: 1.25rem;
  line-height: 1.6;
}

.trail-result {
  text-align: center;
}

.trail-result-title {
  margin: 0 0 1rem;
  font-size: 1.25rem;
  font-weight: 600;
}

.trail-result-stats {
  grid-template-columns: repeat(3, 1fr);
  margin-bottom: 1rem;
}

@keyframes trail-beacon {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.12); }
}

@keyframes trail-firefly {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.35); opacity: 0.75; }
}

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

@keyframes trail-ripple {
  0% { fill: color-mix(in srgb, var(--accent) 48%, var(--ink)); }
  45% { fill: var(--accent-soft); }
  100% { fill: color-mix(in srgb, var(--accent) 70%, var(--ink)); }
}

@media (prefers-reduced-motion: reduce) {
  .trail-node-next .trail-node-shape,
  .trail-head,
  .trail-blocked,
  .trail-won .trail-stone {
    animation: none;
  }
}
