/* ==========================================================================
   Hydrolysis Unified Notebook Shell
   2カラム骨格 × 標準28pxノート横罫 × スレートネイビー × 白ベース5項目下線ヘッダー
   ========================================================================== */

:root {
  --hl-bg: #12151E;
  --hl-rule: rgba(148, 163, 184, 0.10);
  --hl-surface: #1A1E2B;
  --hl-subtle: #212636;
  --hl-border: #2E3548;
  --hl-border-soft: #262C3D;
  --hl-text: #F1F5F9;
  --hl-text-dim: #94A3B8;
  --hl-text-muted: #64748B;
  --hl-code-bg: #131722;
  --hl-accent: #60A5FA;
  --hl-accent-hover: #93C5FD;
  --hl-accent-fg: #0F172A;
  --hl-accent-soft: rgba(96, 165, 250, 0.14);
  --hl-shadow: none;
  --hl-radius: 6px;
  --hl-radius-lg: 8px;
  --hl-rule-step: 28px;
}

[data-theme="light"] {
  --hl-bg: #F8FAFC;
  --hl-rule: rgba(148, 163, 184, 0.28);
  --hl-surface: #FFFFFF;
  --hl-subtle: #F3F6FA;
  --hl-border: #CBD5E1;
  --hl-border-soft: #E2E8F0;
  --hl-text: #0F172A;
  --hl-text-dim: #475569;
  --hl-text-muted: #64748B;
  --hl-code-bg: #F8FAFC;
  --hl-accent: #1E40AF;
  --hl-accent-hover: #1E3A8A;
  --hl-accent-fg: #FFFFFF;
  --hl-accent-soft: rgba(30, 64, 175, 0.08);
  --hl-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
}

/* ==========================================================================
   全面ノート横罫 & 既存CSSトークンのクリーン上書き
   ========================================================================== */
body.hl-notebook {
  --bg-deep: var(--hl-bg);
  --bg-subtle: var(--hl-subtle);
  --bg-card: var(--hl-surface);
  --bg-glass: var(--hl-surface);
  --bg-glass-card: var(--hl-surface);
  --bg-glass-hover: var(--hl-subtle);
  --bg-input: var(--hl-code-bg);
  --glass-border: var(--hl-border);
  --glass-border-light: var(--hl-border);
  --glass-border-glow: var(--hl-accent);
  --border-glass: var(--hl-border);
  --line: var(--hl-border-soft);
  --text-main: var(--hl-text);
  --text-dim: var(--hl-text-dim);
  --text-muted: var(--hl-text-muted);
  --cyan: var(--hl-accent);
  --cyan-glow: var(--hl-accent-soft);
  --purple: var(--hl-accent);
  --purple-glow: var(--hl-accent-soft);
  --shadow-glass: var(--hl-shadow);
  --shadow-card: var(--hl-shadow);
  --shadow-glow-cyan: none;
  --font-display: 'Plus Jakarta Sans', 'Noto Sans JP', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-sans: 'Plus Jakarta Sans', 'Noto Sans JP', -apple-system, BlinkMacSystemFont, sans-serif;

  background-color: var(--hl-bg) !important;
  background-image: repeating-linear-gradient(
    to bottom,
    transparent 0,
    transparent calc(var(--hl-rule-step) - 1px),
    var(--hl-rule) calc(var(--hl-rule-step) - 1px),
    var(--hl-rule) var(--hl-rule-step)
  ) !important;
  color: var(--hl-text);
  font-family: var(--font-sans);
  margin: 0;
  padding: 0;
  min-height: 100vh;
}

body.hl-notebook::before,
body.hl-notebook::after {
  display: none !important;
  content: none !important;
}

/* ==========================================================================
   1段目 統一グローバルヘッダー（白/サーフェスベース × 5項目下線タブ）
   ========================================================================== */
.hl-chrome {
  position: sticky;
  top: 0;
  z-index: 900;
  flex: 0 0 auto;
}

.hl-header {
  background: var(--hl-surface);
  border-bottom: 2px solid var(--hl-border);
}

.hl-header-inner {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 20px;
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.hl-brand {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--hl-text);
  display: inline-flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  flex-shrink: 0;
}

.hl-brand:hover {
  color: var(--hl-accent);
  text-decoration: none;
}

.hl-brand-mark {
  width: 10px;
  height: 10px;
  border-radius: 99px;
  background: var(--hl-accent);
  display: inline-block;
  flex-shrink: 0;
}

.hl-nav {
  display: flex;
  align-items: stretch;
  height: 100%;
  gap: 4px;
}

.hl-nav a {
  display: inline-flex;
  align-items: center;
  padding: 0 13px;
  color: var(--hl-text-dim);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  position: relative;
  white-space: nowrap;
  transition: color 0.15s ease;
}

.hl-nav a:hover {
  color: var(--hl-text);
  text-decoration: none;
}

.hl-nav a.active {
  color: var(--hl-accent);
}

.hl-nav a.active::after {
  content: "";
  position: absolute;
  left: 6px;
  right: 6px;
  bottom: 0;
  height: 3px;
  background: var(--hl-accent);
}

.hl-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.hl-header .theme-toggle-btn,
.hl-context-bar .lang-toggle-btn {
  border: 1px solid var(--hl-border);
  background: var(--hl-surface);
  color: var(--hl-text-dim);
  border-radius: var(--hl-radius);
  padding: 6px 11px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  line-height: 1.2;
  box-shadow: none;
}

.hl-header .theme-toggle-btn:hover,
.hl-context-bar .lang-toggle-btn:hover {
  color: var(--hl-text);
  background: var(--hl-subtle);
  border-color: var(--hl-text-muted);
  box-shadow: none;
}

@media (max-width: 720px) {
  .hl-header-inner {
    height: auto;
    flex-wrap: wrap;
    padding: 8px 14px 0;
    gap: 6px 12px;
  }
  .hl-brand {
    order: 1;
    padding-bottom: 6px;
  }
  .hl-header-actions {
    order: 2;
    padding-bottom: 6px;
  }
  .hl-nav {
    order: 3;
    width: 100%;
    height: 40px;
    border-top: 1px solid var(--hl-border-soft);
    justify-content: space-between;
    gap: 0;
  }
  .hl-nav a {
    flex: 1 1 0;
    justify-content: center;
    padding: 0 4px;
    font-size: 12.5px;
  }
}

/* ==========================================================================
   2段目 汎用ゲームコンテキストバー（/games/2048-3d/* 専用）
   ========================================================================== */
.hl-context-bar {
  background: var(--hl-subtle);
  border-bottom: 1px solid var(--hl-border);
}

.hl-context-inner {
  max-width: 1140px;
  margin: 0 auto;
  padding: 7px 20px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 14px;
  font-size: 13px;
}

.hl-context-crumb {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--hl-text-muted);
  white-space: nowrap;
}

.hl-context-crumb a {
  color: var(--hl-text-dim);
  text-decoration: none;
  font-weight: 500;
}

.hl-context-crumb a:hover {
  color: var(--hl-accent);
  text-decoration: underline;
}

.hl-context-title {
  color: var(--hl-text);
  font-weight: 700;
}

.hl-context-right {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.hl-context-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
}

.hl-context-links a {
  padding: 4px 10px;
  border-radius: var(--hl-radius);
  color: var(--hl-text-dim);
  font-size: 12.5px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
}

.hl-context-links a:hover {
  background: var(--hl-surface);
  color: var(--hl-text);
  text-decoration: none;
}

.hl-context-links a.active {
  background: var(--hl-surface);
  color: var(--hl-accent);
  border: 1px solid var(--hl-border);
  font-weight: 600;
}

.hl-context-langs {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  padding-left: 8px;
  border-left: 1px solid var(--hl-border);
}

.hl-context-langs a {
  padding: 3px 7px;
  border-radius: 4px;
  font-size: 11.5px;
  color: var(--hl-text-dim);
  text-decoration: none;
}

.hl-context-langs a[aria-current="page"] {
  background: var(--hl-accent-soft);
  color: var(--hl-accent);
  font-weight: 700;
}

/* ゲームプレイ本編 (game.html) 用スリムバー */
body.hl-game-play .hl-chrome {
  position: relative;
}

body.hl-game-play .hl-header-inner {
  height: 44px;
  padding: 0 14px;
}

body.hl-game-play .hl-context-inner {
  padding: 5px 14px;
}

@media (max-width: 720px) {
  body.hl-game-play .hl-header-inner {
    height: auto;
    padding: 6px 12px 0;
  }
  body.hl-game-play .hl-nav {
    height: 34px;
  }
  .hl-context-inner {
    padding: 6px 12px;
  }
  .hl-context-langs {
    border-left: 0;
    padding-left: 0;
  }
}

/* ==========================================================================
   2カラム骨格（左メイン ＋ 右常設サイドバー）
   ========================================================================== */
.hl-shell {
  max-width: 1140px;
  margin: 0 auto;
  padding: 26px 20px 56px;
}

.hl-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 290px;
  gap: 24px;
  align-items: start;
}

@media (max-width: 920px) {
  .hl-layout {
    grid-template-columns: 1fr;
  }
}

.hl-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.hl-panel {
  background: var(--hl-surface);
  border: 1px solid var(--hl-border);
  border-radius: var(--hl-radius-lg);
  padding: 26px 28px;
  box-shadow: var(--hl-shadow);
}

@media (max-width: 640px) {
  .hl-shell {
    padding: 16px 12px 44px;
  }
  .hl-panel {
    padding: 20px 16px;
  }
}

/* 右サイドバー */
.hl-sidebar {
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: sticky;
  top: 76px;
}

@media (max-width: 920px) {
  .hl-sidebar {
    position: static;
  }
}

.hl-side-box {
  background: var(--hl-surface);
  border: 1px solid var(--hl-border);
  border-radius: var(--hl-radius-lg);
  overflow: hidden;
  box-shadow: var(--hl-shadow);
}

.hl-side-head {
  background: var(--hl-subtle);
  border-bottom: 1px solid var(--hl-border-soft);
  padding: 10px 14px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--hl-text);
}

.hl-side-list {
  list-style: none;
  margin: 0;
  padding: 6px 0;
}

.hl-side-list li a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 14px;
  font-size: 13px;
  color: var(--hl-text-dim);
  text-decoration: none;
}

.hl-side-list li a:hover {
  background: var(--hl-subtle);
  color: var(--hl-accent);
  text-decoration: none;
}

.hl-side-badge {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--hl-text-muted);
  background: var(--hl-subtle);
  border: 1px solid var(--hl-border-soft);
  padding: 1px 6px;
  border-radius: 4px;
  flex-shrink: 0;
}

/* ==========================================================================
   総合トップ（一覧ハブ）コンポーネント
   ========================================================================== */
.hl-eyebrow {
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--hl-accent);
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}

.hl-top-intro {
  padding-bottom: 18px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--hl-border-soft);
}

.hl-top-intro h1 {
  font-size: 24px;
  font-weight: 800;
  margin: 0 0 8px;
  color: var(--hl-text);
  line-height: 1.35;
}

.hl-top-intro h1 span {
  background: none;
  -webkit-text-fill-color: currentColor;
  color: var(--hl-accent);
}

.hl-top-intro p {
  margin: 0;
  font-size: 14px;
  color: var(--hl-text-dim);
  line-height: 1.75;
}

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

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

.hl-hub-card {
  background: var(--hl-subtle);
  border: 1px solid var(--hl-border-soft);
  border-radius: var(--hl-radius);
  padding: 15px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
}

.hl-hub-kicker {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--hl-accent);
  margin-bottom: 4px;
}

.hl-hub-card h2 {
  font-size: 15.5px;
  font-weight: 700;
  margin: 0 0 10px;
  color: var(--hl-text);
}

.hl-hub-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-size: 13px;
}

.hl-hub-list li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  padding-bottom: 6px;
  border-bottom: 1px dashed var(--hl-border);
}

.hl-hub-list li:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.hl-hub-list a {
  color: var(--hl-text);
  font-weight: 500;
  text-decoration: none;
}

.hl-hub-list a:hover {
  color: var(--hl-accent);
  text-decoration: underline;
}

.hl-hub-tag {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--hl-text-muted);
  white-space: nowrap;
}

.hl-hub-more {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--hl-accent);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.hl-hub-more:hover {
  text-decoration: underline;
}

/* ==========================================================================
   既存ページ要素（doc-container / blog-container / portal-container）の調和
   ========================================================================== */
body.hl-notebook .doc-container,
body.hl-notebook .blog-container,
body.hl-notebook .portal-container,
body.hl-notebook .tut-page-container {
  max-width: none;
  width: 100%;
  margin: 0;
  padding: 0;
}

body.hl-notebook.hl-game-play {
  min-height: 0;
}

body.hl-notebook .doc-container h1,
body.hl-notebook .portal-container h1,
body.hl-notebook .blog-container h1 {
  color: var(--hl-text);
}

body.hl-notebook h1 span {
  background: none;
  -webkit-text-fill-color: currentColor;
  color: var(--hl-accent);
}

/* 記事内の見出し左縦バー（案3組版のクリーン継承） */
body.hl-notebook .post-content h2 {
  border-left: 4px solid var(--hl-accent);
  padding: 2px 0 2px 12px;
  border-bottom: 0;
  color: var(--hl-text);
}

body.hl-notebook .section-header h2 {
  color: var(--hl-text);
}

body.hl-notebook .hl-main .modes-grid,
body.hl-notebook .doc-section .modes-grid {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

body.hl-notebook .toc-box,
body.hl-notebook .mode-card,
body.hl-notebook .story-block,
body.hl-notebook .profile-card,
body.hl-notebook .doc-section,
body.hl-notebook .featured-card,
body.hl-notebook .ranking-section {
  background: var(--hl-surface);
  border-color: var(--hl-border);
  box-shadow: none;
}

body.hl-notebook .mode-card:hover {
  transform: none;
  border-color: var(--hl-accent);
  box-shadow: none;
}

body.hl-notebook .mode-card.featured {
  background: var(--hl-surface);
  border-color: var(--hl-accent);
  box-shadow: none;
}

body.hl-notebook .btn-hero-play,
body.hl-notebook .btn-card-play {
  background: var(--hl-accent);
  color: var(--hl-accent-fg);
  border: 1px solid var(--hl-accent);
  box-shadow: none;
}

body.hl-notebook .btn-hero-play:hover,
body.hl-notebook .btn-card-play:hover {
  background: var(--hl-accent-hover);
  border-color: var(--hl-accent-hover);
  color: var(--hl-accent-fg);
  box-shadow: none;
}

body.hl-notebook .btn-hero-guide,
body.hl-notebook .btn-card-play.secondary-btn {
  background: var(--hl-subtle);
  color: var(--hl-accent);
  border: 1px solid var(--hl-border);
  box-shadow: none;
}

body.hl-notebook .ranking-tab-btn {
  background: var(--hl-subtle);
  border: 1px solid var(--hl-border);
  color: var(--hl-text-dim);
  box-shadow: none;
}

body.hl-notebook .ranking-tab-btn:hover {
  color: var(--hl-text);
  border-color: var(--hl-text-muted);
}

body.hl-notebook .ranking-tab-btn.active {
  background: var(--hl-accent);
  border-color: var(--hl-accent);
  color: var(--hl-accent-fg);
  box-shadow: none;
}

body.hl-notebook .ranking-table-container {
  background: var(--hl-surface);
  border-color: var(--hl-border);
}

body.hl-notebook .doc-section a:not([class*="btn-"]),
body.hl-notebook .post-content a:not([class*="btn-"]) {
  color: var(--hl-accent);
}

body.hl-notebook [data-privacy-settings] {
  background: var(--hl-subtle);
  color: var(--hl-text);
  border: 1px solid var(--hl-border);
  border-radius: var(--hl-radius);
  padding: 4px 10px;
  font: inherit;
  font-size: 0.9em;
  cursor: pointer;
  margin: 0 2px;
}

body.hl-notebook [data-privacy-settings]:hover {
  border-color: var(--hl-accent);
  color: var(--hl-accent);
}

body.hl-notebook .hero-section {
  background: var(--hl-subtle);
  border: 1px solid var(--hl-border-soft);
  border-radius: var(--hl-radius-lg);
  padding: 28px 24px;
  margin-bottom: 24px;
}

body.hl-notebook .hero-badge,
body.hl-notebook .mode-badge {
  background: var(--hl-accent-soft);
  color: var(--hl-accent);
  border-color: transparent;
}

body.hl-notebook .featured-badge {
  background: var(--hl-accent);
  color: var(--hl-accent-fg);
}

/* プライバシー設定ランチャーの黒帯をクリーンに調和 */
body.hl-notebook .privacy-settings-launcher {
  background: var(--hl-surface) !important;
  border-top: 1px solid var(--hl-border-soft);
  padding: 12px 16px !important;
}

body.hl-notebook .privacy-settings-button {
  background: var(--hl-subtle) !important;
  color: var(--hl-text-dim) !important;
  border-color: var(--hl-border) !important;
}

/* ==========================================================================
   統一フッター（運営者情報・ポリシー・利用規約・お問い合わせをここに静かに集約）
   ========================================================================== */
.hl-footer {
  border-top: 1px solid var(--hl-border);
  background: var(--hl-surface);
  padding: 22px 20px;
  font-size: 13px;
  color: var(--hl-text-muted);
}

.hl-footer-inner {
  max-width: 1140px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
}

.hl-footer-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.hl-footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 18px;
}

.hl-footer-links a {
  color: var(--hl-text-dim);
  text-decoration: none;
}

.hl-footer-links a:hover {
  color: var(--hl-accent);
  text-decoration: underline;
}

.hl-footer-credit {
  font-size: 11.5px;
  color: var(--hl-text-muted);
}

/* ==========================================================================
   母艦ブログ補足調整（share-box 等）
   ========================================================================== */
body.hl-notebook .share-box {
  background: var(--hl-subtle) !important;
  border-color: var(--hl-border) !important;
}

/* ==========================================================================
   2048×3D ダークモード専用シェル（body.hl-2048-dark）
   ========================================================================== */
body.hl-2048-dark {
  --hl-bg: #070a12;
  --hl-surface: #0f172a;
  --hl-subtle: #131c31;
  --hl-border: #26334d;
  --hl-border-soft: #1e293b;
  --hl-text: #f8fafc;
  --hl-text-dim: #94a3b8;
  --hl-text-muted: #64748b;
  --hl-accent: #38bdf8;
  --hl-accent-hover: #7dd3fc;
  --hl-accent-fg: #041424;
  --hl-accent-soft: rgba(56, 189, 248, 0.14);
  --hl-shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
}

body.hl-2048-dark .hl-panel {
  background: rgba(15, 23, 42, 0.72);
  border-color: rgba(148, 163, 184, 0.16);
}

body.hl-2048-dark .hl-panel .portal-container,
body.hl-2048-dark .hl-panel .doc-container,
body.hl-2048-dark .hl-panel .tut-page-container {
  max-width: none;
  width: 100%;
  margin: 0;
  padding: 0;
}

body.hl-2048-dark.hl-game-play .hl-chrome {
  position: relative;
}

body.hl-2048-dark.hl-game-play .hl-header-inner {
  height: 44px;
  padding: 0 14px;
}

body.hl-2048-dark.hl-game-play .hl-context-inner {
  padding: 5px 14px;
}

@media (max-width: 720px) {
  body.hl-2048-dark.hl-game-play .hl-header-inner {
    height: auto;
    padding: 6px 12px 0;
  }
  body.hl-2048-dark.hl-game-play .hl-nav {
    height: 34px;
  }
}

/* ==========================================================================
   実用Webツール共通 UI（文字数カウント / PNG→SVG / タイマー）
   ========================================================================== */
.tl-head {
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--hl-border-soft);
}

.tl-head h1 {
  font-size: 24px;
  font-weight: 800;
  margin: 0 0 6px;
  color: var(--hl-text);
}

.tl-head p {
  margin: 0;
  font-size: 14px;
  color: var(--hl-text-dim);
  line-height: 1.7;
}

.tl-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.tl-btn-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.tl-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--hl-radius);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  border: 1px solid var(--hl-border);
  background: var(--hl-surface);
  color: var(--hl-text);
  text-decoration: none;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.tl-btn:hover {
  background: var(--hl-subtle);
  border-color: var(--hl-text-muted);
}

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

.tl-btn-primary {
  background: var(--hl-accent);
  color: var(--hl-accent-fg);
  border-color: var(--hl-accent);
}

.tl-btn-primary:hover {
  background: var(--hl-accent-hover);
  border-color: var(--hl-accent-hover);
}

.tl-textarea {
  width: 100%;
  min-height: 220px;
  padding: 14px;
  border-radius: var(--hl-radius);
  border: 1px solid var(--hl-border);
  background: var(--hl-code-bg);
  color: var(--hl-text);
  font-family: var(--font-sans);
  font-size: 14.5px;
  line-height: 1.75;
  resize: vertical;
  box-sizing: border-box;
}

.tl-textarea:focus,
.tl-input:focus,
.tl-select:focus {
  outline: 2px solid var(--hl-accent);
  outline-offset: -1px;
}

.tl-input,
.tl-select {
  padding: 7px 10px;
  border-radius: var(--hl-radius);
  border: 1px solid var(--hl-border);
  background: var(--hl-code-bg);
  color: var(--hl-text);
  font-family: inherit;
  font-size: 13.5px;
}

.tl-input:disabled,
.tl-select:disabled,
.tl-field input[type="range"]:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.tl-field-title {
  font-size: 12.5px;
  color: var(--hl-text-dim);
}

.tl-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(135px, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.tl-stat-box {
  background: var(--hl-subtle);
  border: 1px solid var(--hl-border-soft);
  border-radius: var(--hl-radius);
  padding: 11px 13px;
}

.tl-stat-label {
  font-size: 11.5px;
  color: var(--hl-text-muted);
  margin-bottom: 3px;
}

.tl-stat-value {
  font-family: 'JetBrains Mono', monospace;
  font-size: 20px;
  font-weight: 700;
  color: var(--hl-text);
}

.tl-status {
  margin-top: 12px;
  padding: 9px 12px;
  border-radius: var(--hl-radius);
  background: var(--hl-subtle);
  border: 1px solid var(--hl-border-soft);
  font-size: 13px;
  color: var(--hl-text-dim);
}

.tl-dropzone {
  border: 2px dashed var(--hl-border);
  border-radius: var(--hl-radius-lg);
  background: var(--hl-subtle);
  padding: 22px 16px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.tl-dropzone.dragover {
  border-color: var(--hl-accent);
  background: var(--hl-accent-soft);
}

.tl-options-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin: 14px 0;
  padding: 14px;
  background: var(--hl-subtle);
  border: 1px solid var(--hl-border-soft);
  border-radius: var(--hl-radius);
}

.tl-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 12.5px;
  color: var(--hl-text-dim);
}

.tl-preview-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 14px;
}

@media (max-width: 640px) {
  .tl-preview-grid {
    grid-template-columns: 1fr;
  }
}

.tl-preview-pane {
  border: 1px solid var(--hl-border);
  border-radius: var(--hl-radius);
  overflow: hidden;
  background: var(--hl-surface);
}

.tl-preview-head {
  padding: 8px 12px;
  background: var(--hl-subtle);
  border-bottom: 1px solid var(--hl-border-soft);
  font-size: 12px;
  font-weight: 700;
  color: var(--hl-text-dim);
  display: flex;
  justify-content: space-between;
}

.tl-checker-stage {
  min-height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background-color: #f1f5f9;
  background-image:
    linear-gradient(45deg, #e2e8f0 25%, transparent 25%),
    linear-gradient(-45deg, #e2e8f0 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #e2e8f0 75%),
    linear-gradient(-45deg, transparent 75%, #e2e8f0 75%);
  background-size: 16px 16px;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0;
}

.tl-checker-stage img,
.tl-checker-stage svg {
  max-width: 100%;
  max-height: 240px;
  width: auto;
  height: auto;
  display: block;
}

.tl-tabs {
  display: inline-flex;
  background: var(--hl-subtle);
  border: 1px solid var(--hl-border);
  border-radius: var(--hl-radius);
  padding: 3px;
  gap: 3px;
  margin-bottom: 18px;
}

.tl-tab {
  border: 0;
  background: transparent;
  color: var(--hl-text-dim);
  padding: 7px 14px;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}

.tl-tab.active {
  background: var(--hl-accent);
  color: var(--hl-accent-fg);
}

.tl-timer-display {
  font-family: 'JetBrains Mono', monospace;
  font-size: clamp(42px, 8vw, 68px);
  font-weight: 700;
  letter-spacing: 0.03em;
  text-align: center;
  color: var(--hl-text);
  padding: 18px 10px 10px;
  font-variant-numeric: tabular-nums;
}

.tl-progress-track {
  width: 100%;
  height: 8px;
  background: var(--hl-subtle);
  border: 1px solid var(--hl-border-soft);
  border-radius: 999px;
  overflow: hidden;
  margin: 0 0 18px;
}

.tl-progress-bar {
  height: 100%;
  width: 100%;
  background: var(--hl-accent);
  transition: width 0.2s linear;
}

.tl-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  margin-top: 14px;
}

.tl-table th,
.tl-table td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid var(--hl-border-soft);
}

.tl-table th {
  background: var(--hl-subtle);
  color: var(--hl-text-dim);
  font-size: 12px;
}

.tl-table td.mono {
  font-family: 'JetBrains Mono', monospace;
}

.tl-doc {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--hl-border-soft);
}

.tl-doc h2 {
  font-size: 17px;
  margin: 0 0 10px;
  border-left: 4px solid var(--hl-accent);
  padding: 2px 0 2px 10px;
  color: var(--hl-text);
}

.tl-doc p,
.tl-doc li {
  font-size: 14px;
  color: var(--hl-text-dim);
  line-height: 1.78;
}
