/* ==========================================================================
   Рабочие листы: Мотивация и запуск дел при СДВГ (Extra Focus by Stasia)
   Lightweight, Mobile-First App with Left Drawer & Sheet Switcher
   ========================================================================== */

:root {
  --primary-dark: #373854;
  --primary-brand: #4E4F73;
  --primary-light: #6d6f96;
  --accent-brown: #4E4F73;
  --accent-brown-dark: #373854;
  --accent-brown-soft: rgba(78, 79, 115, 0.1);
  --accent-gold: #4E4F73;
  --accent-gold-light: #6d6f96;
  --accent-gold-soft: rgba(78, 79, 115, 0.1);
  --accent-pink: #d97d97;
  --accent-pink-soft: rgba(245, 182, 193, 0.22);
  --accent-sky: #4b7bb5;
  --accent-sky-soft: rgba(184, 209, 245, 0.25);
  --accent-teal: #2f6f64;
  --accent-teal-soft: rgba(47, 111, 100, 0.12);
  --accent-rust: #5a3d24;
  --accent-rust-soft: rgba(90, 61, 36, 0.12);
  --accent-purple: #6d4b9b;
  --accent-purple-soft: rgba(109, 75, 155, 0.12);
  
  --bg-page: #ffffff;
  --bg-subtle: #eeedf7;
  --paper: #ffffff;
  --paper-subtle: #fbfaff;
  --paper-border: rgba(78, 79, 115, 0.15);
  --line: rgba(78, 79, 115, 0.13);
  
  --text-dark: #2c2d42;
  --text-muted: #565879;
  --text-dim: #888aa8;
  
  --font-serif: 'Lithium', Georgia, serif;
  --font-cormorant: 'Lithium', Georgia, serif;
  --font-sans: 'OpenSans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --shadow-sheet: 0 14px 38px rgba(78, 79, 115, 0.08), 0 2px 8px rgba(78, 79, 115, 0.03);
  --shadow-drawer: 0 0 40px rgba(44, 45, 66, 0.22);
}

html[data-theme="dark"] {
  --primary-dark: #f1f2fc;
  --primary-brand: #a5a8e0;
  --primary-light: #c2c4f0;
  --bg-page: #10111d;
  --bg-subtle: #17182a;
  --paper: #161727;
  --paper-subtle: #131422;
  --paper-border: rgba(165, 168, 224, 0.16);
  --line: rgba(165, 168, 224, 0.12);
  
  --text-dark: #f2f3fc;
  --text-muted: #b0b3d8;
  --text-dim: #797c9f;
  --shadow-sheet: 0 16px 44px rgba(0, 0, 0, 0.55);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-page);
  color: var(--text-dark);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* ==========================================================================
   Light & Airy App Header
   ========================================================================== */

.app-topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--theme-border, rgba(78, 79, 115, 0.14));
  padding: 10px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

html[data-theme="dark"] .app-topbar {
  background: rgba(23, 24, 38, 0.96);
}

.topbar-theme-toggle {
  width: 36px;
  height: 36px;
  display: inline-grid;
  place-items: center;
  padding: 3px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
}

.topbar-theme-toggle .theme-toggle-image {
  width: 28px;
  height: 28px;
  object-fit: contain;
  transform: translateY(3px);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.menu-trigger-btn {
  appearance: none;
  background: var(--paper);
  border: 1px solid var(--paper-border);
  border-radius: var(--radius-sm);
  padding: 7px 12px;
  font-family: var(--font-sans);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--primary-dark);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 6px rgba(0,0,0,0.03);
}

.menu-trigger-btn:hover {
  background: var(--accent-gold-soft);
  border-color: var(--accent-gold);
}

.topbar-title {
  display: flex;
  flex-direction: column;
}

.topbar-title-main {
  font-family: var(--font-sans);
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--primary-dark);
  line-height: 1.15;
}

.topbar-title-sub {
  font-size: 0.75rem;
  color: var(--text-dim);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.topbar-btn {
  appearance: none;
  background: var(--paper);
  border: 1px solid var(--paper-border);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  transition: all 0.2s;
}

.topbar-btn:hover {
  color: var(--primary-dark);
  border-color: var(--primary-brand);
}

.topbar-btn.primary {
  background: var(--primary-brand);
  color: #fff;
  border-color: var(--primary-brand);
}

.topbar-btn.primary:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
  box-shadow: 0 2px 8px rgba(78, 79, 115, 0.25);
}

/* Save Toast Badge */
.save-toast {
  font-size: 0.78rem;
  color: var(--accent-teal);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.save-toast.show {
  opacity: 1;
}

/* ==========================================================================
   Side Drawer (Left Panel for sheets, history & actions)
   ========================================================================== */

.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(18, 19, 32, 0.45);
  backdrop-filter: blur(4px);
  z-index: 200;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.drawer-backdrop.open {
  opacity: 1;
  visibility: visible;
}

.drawer-panel {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 340px;
  max-width: 88vw;
  background: var(--paper);
  border-right: 1px solid var(--paper-border);
  box-shadow: var(--shadow-drawer);
  z-index: 210;
  transform: translateX(-100%);
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.drawer-panel.open {
  transform: translateX(0);
}

.drawer-header {
  padding: 18px 20px;
  border-bottom: 1px solid var(--paper-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--paper-subtle);
}

.drawer-title {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--primary-dark);
}

.drawer-close-btn {
  appearance: none;
  background: transparent;
  border: none;
  font-size: 1.3rem;
  line-height: 1;
  color: var(--text-dim);
  cursor: pointer;
  padding: 4px;
}

.drawer-close-btn:hover {
  color: var(--primary-dark);
}

.drawer-body {
  padding: 20px;
  overflow-y: auto;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.drawer-section-title {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1.8px;
  color: var(--accent-gold);
  margin-bottom: 10px;
}

/* Nav list of sheets */
.sheet-nav-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sheet-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--paper-subtle);
  border: 1px solid var(--paper-border);
  color: var(--text-dark);
  text-decoration: none;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  transition: all 0.2s;
}

.sheet-nav-item:hover {
  border-color: var(--accent-gold);
  background: #fff;
}

html[data-theme="dark"] .sheet-nav-item:hover {
  background: #1c1e33;
}

.sheet-nav-item.active {
  background: var(--primary-brand);
  color: #fff;
  border-color: var(--primary-brand);
  box-shadow: 0 4px 12px rgba(78, 79, 115, 0.2);
}

html[data-theme="dark"] .sheet-nav-item.active {
  background: var(--primary-brand);
  color: #fff;
  border-color: var(--primary-brand);
}

.sheet-nav-num {
  font-size: 0.75rem;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent-brown-soft);
  color: var(--accent-brown);
  display: grid;
  place-content: center;
  font-weight: 700;
  flex-shrink: 0;
}

.sheet-nav-item.active .sheet-nav-num {
  background: rgba(255, 255, 255, 0.25);
  color: #fff;
}

html[data-theme="dark"] .sheet-nav-item.active .sheet-nav-num {
  color: #11121d;
  background: rgba(0, 0, 0, 0.15);
}

/* Indented Companion Guide between Sheet 1 and Sheet 2 */
.sheet-nav-item.nav-item-guide {
  margin-left: 20px;
  width: calc(100% - 20px);
  padding: 8px 12px;
  font-size: 0.85rem;
  background: var(--paper-subtle);
  border-left: 3px solid var(--accent-brown);
  color: var(--text-dark);
}

.sheet-nav-branch {
  color: var(--accent-brown);
  font-weight: 800;
  font-size: 1rem;
  margin-right: -4px;
}

.sheet-nav-item.nav-item-guide:hover {
  border-color: var(--accent-brown);
  background: var(--accent-brown-soft);
}

.sheet-nav-item.nav-item-guide.active {
  background: var(--accent-brown);
  border-color: var(--accent-brown);
  color: #fff;
  box-shadow: 0 4px 12px rgba(115, 78, 47, 0.25);
}

.sheet-nav-item.nav-item-guide.active .sheet-nav-branch {
  color: #fff;
}

.drawer-guide-link {
  width: 100%;
  margin-top: 8px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  background: var(--accent-brown-soft);
  border: 1px dashed var(--accent-brown);
  color: var(--accent-brown);
  font-family: var(--font-sans);
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  text-align: left;
  transition: all 0.2s;
}

.drawer-guide-link:hover {
  background: var(--accent-brown);
  color: #fff;
  border-style: solid;
}

/* History items in drawer */
.history-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 200px;
  overflow-y: auto;
}

.history-item {
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: var(--paper-subtle);
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.82rem;
  cursor: pointer;
  transition: all 0.2s;
}

.history-item:hover {
  border-color: var(--accent-gold);
  background: #fff;
}

.history-item.active {
  border-color: var(--accent-gold);
  font-weight: 700;
  background: var(--accent-gold-soft);
}

.history-del-btn {
  background: transparent;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 2px 4px;
}

.history-del-btn:hover {
  color: var(--accent-rust);
}

/* Drawer Action Blocks / Grid */
.drawer-actions-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.drawer-card-subgrid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.drawer-card-btn {
  appearance: none;
  background: var(--paper-subtle);
  border: 1px solid var(--paper-border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  text-align: left;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  color: var(--text-dark);
  font-family: var(--font-sans);
}

.drawer-card-btn:hover {
  background: #fff;
  border-color: var(--accent-gold);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(36, 37, 61, 0.06);
}

html[data-theme="dark"] .drawer-card-btn:hover {
  background: #1d1e33;
}

.drawer-card-btn.featured {
  background: var(--primary-brand);
  color: #fff;
  border-color: var(--primary-brand);
  padding: 12px 14px;
  box-shadow: 0 4px 14px rgba(78, 79, 115, 0.2);
}

.drawer-card-btn.featured .drawer-card-desc {
  color: rgba(255, 255, 255, 0.85);
}

.drawer-card-btn.featured:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(78, 79, 115, 0.3);
}

.drawer-card-btn.danger {
  color: var(--accent-rust);
}

.drawer-card-btn.danger:hover {
  border-color: var(--accent-rust);
  background: rgba(155, 75, 52, 0.06);
}

.drawer-card-icon {
  font-size: 1.25rem;
  line-height: 1;
  flex-shrink: 0;
}

.drawer-card-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.drawer-card-title {
  font-size: 0.84rem;
  font-weight: 700;
  line-height: 1.2;
}

.drawer-card-desc {
  font-size: 0.72rem;
  color: var(--text-dim);
  line-height: 1.2;
}

.drawer-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--paper-border);
  font-size: 0.74rem;
  color: var(--text-dim);
  line-height: 1.4;
  background: var(--paper-subtle);
}

/* ==========================================================================
   Main Content & Sheet Canvas
   ========================================================================== */

.main-content {
  max-width: 960px;
  width: 100%;
  margin: 20px auto 60px;
  padding: 0 16px;
  flex-grow: 1;
}

/* Top Fast Switcher (Horizontal Pills on screen) */
.quick-pills {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 12px;
  margin-bottom: 16px;
  scrollbar-width: thin;
}

.quick-pill {
  appearance: none;
  background: var(--paper);
  border: 1px solid var(--paper-border);
  padding: 8px 16px;
  border-radius: 999px;
  font-family: var(--font-sans);
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}

.quick-pill:hover {
  border-color: var(--primary-brand);
  color: var(--primary-dark);
}

.quick-pill.active {
  background: var(--primary-brand);
  color: #fff;
  border-color: var(--primary-brand);
  box-shadow: 0 4px 12px rgba(78, 79, 115, 0.2);
}

html[data-theme="dark"] .quick-pill.active {
  background: var(--primary-brand);
  color: #fff;
  border-color: var(--primary-brand);
}

/* Sheet Card */
.sheet-canvas {
  background: var(--paper);
  border: 1px solid var(--paper-border);
  border-radius: var(--radius-lg);
  padding: 36px 38px;
  box-shadow: var(--shadow-sheet);
  position: relative;
  overflow: hidden;
}

@media (max-width: 640px) {
  .sheet-canvas {
    padding: 24px 18px;
    border-radius: var(--radius-md);
  }
}

.sheet-diagonal-stripe {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--primary-brand);
}

.sheet-header {
  border-bottom: 2px solid rgba(78, 79, 115, 0.16);
  padding-bottom: 16px;
  margin-bottom: 20px;
}

.sheet-h1 {
  font-family: var(--font-serif);
  font-size: clamp(1.6rem, 3.5vw, 2.2rem);
  font-weight: 800;
  color: var(--primary-dark);
  line-height: 1.15;
  margin-bottom: 4px;
}

.sheet-tagline {
  font-family: var(--font-cormorant);
  font-style: italic;
  font-size: 1.1rem;
  color: var(--text-muted);
  margin-top: 8px;
  line-height: 1.35;
}

.sheet-lead {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.55;
  margin-bottom: 20px;
}

/* Info Callout */
.info-box {
  background: var(--accent-gold-soft);
  border: 1px solid rgba(115, 78, 47, 0.25);
  border-left: 4px solid var(--accent-gold);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  margin-bottom: 20px;
}

.info-box.teal {
  background: var(--accent-teal-soft);
  border-color: rgba(47, 111, 100, 0.25);
  border-left-color: var(--accent-teal);
}

.info-box.rust {
  background: var(--accent-rust-soft);
  border-color: rgba(155, 75, 52, 0.25);
  border-left-color: var(--accent-rust);
}

.info-box-title {
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  color: var(--accent-gold);
  margin-bottom: 6px;
}

.info-box.teal .info-box-title { color: var(--accent-teal); }
.info-box.rust .info-box-title { color: var(--accent-rust); }

.info-box-content {
  font-size: 0.9rem;
  line-height: 1.45;
  color: var(--text-dark);
}

/* ==========================================================================
   Compact Fuel Legend Bar (ICNU)
   ========================================================================== */

.fuel-legend-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--paper-subtle);
  border: 1px solid var(--paper-border);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.fuel-legend-label {
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--accent-gold);
  white-space: nowrap;
}

.fuel-legend-pills {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  flex-grow: 1;
}

.fuel-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--paper);
  border: 1px solid var(--paper-border);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.8rem;
  color: var(--text-dark);
  transition: all 0.15s ease;
}

.fuel-pill strong {
  font-weight: 800;
  font-size: 0.78rem;
  letter-spacing: 0.5px;
}

.fuel-pill em {
  font-style: normal;
  color: var(--text-dim);
  font-size: 0.76rem;
}

.fuel-pill:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(36, 37, 61, 0.06);
}

.fuel-pill.int { border-left: 3px solid var(--accent-brown); }
.fuel-pill.nov { border-left: 3px solid #2f6f64; }
.fuel-pill.cha { border-left: 3px solid #6d4b9b; }
.fuel-pill.urg { border-left: 3px solid #b84332; }

.fuel-pill.int strong { color: var(--accent-brown); }
.fuel-pill.nov strong { color: #2f6f64; }
.fuel-pill.cha strong { color: #6d4b9b; }
.fuel-pill.urg strong { color: #b84332; }

.fuel-guide-btn {
  appearance: none;
  background: var(--accent-gold-soft);
  border: 1px dashed var(--accent-gold);
  border-radius: 999px;
  padding: 4px 12px;
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--accent-gold);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.fuel-pill-img {
  width: 18px;
  height: 18px;
  object-fit: contain;
  vertical-align: middle;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.15));
  flex-shrink: 0;
}

.fuel-guide-btn-img {
  width: 20px;
  height: 20px;
  object-fit: contain;
  vertical-align: middle;
  filter: drop-shadow(0 1px 3px rgba(115, 78, 47, 0.3));
  flex-shrink: 0;
}

.guide-fuel-crystal-img {
  width: 44px;
  height: 44px;
  object-fit: contain;
  flex-shrink: 0;
  filter: drop-shadow(0 3px 8px rgba(0, 0, 0, 0.15));
  transition: transform 0.25s ease;
}

.guide-fuel-item:hover .guide-fuel-crystal-img {
  transform: scale(1.08) rotate(3deg);
}

.fuel-guide-btn:hover {
  background: var(--accent-brown);
  color: #fff;
  border-style: solid;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(115, 78, 47, 0.2);
}

/* Section Kickers */
.section-kicker {
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  color: var(--accent-gold);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.section-kicker::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  background: var(--accent-gold);
  border-radius: 2px;
}

.section-sublead {
  font-size: 0.88rem;
  font-style: italic;
  color: var(--text-dim);
  margin-bottom: 10px;
}

/* Form Inputs */
.input-field, .textarea-field {
  width: 100%;
  border: 1px solid var(--paper-border);
  background: var(--paper-subtle);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-family: var(--font-sans);
  font-size: 0.92rem;
  color: var(--text-dark);
  line-height: 1.5;
  transition: all 0.2s;
  margin-bottom: 14px;
}

html[data-theme="dark"] .input-field,
html[data-theme="dark"] .textarea-field {
  background: #131422;
  border-color: rgba(255, 255, 255, 0.1);
}

.input-field:focus, .textarea-field:focus {
  outline: none;
  border-color: var(--accent-gold);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(201, 122, 43, 0.15);
}

html[data-theme="dark"] .input-field:focus,
html[data-theme="dark"] .textarea-field:focus {
  background: #191a2e;
}

.textarea-field {
  resize: vertical;
  min-height: 70px;
}

/* Interactive Checkboxes & Chips */
.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.checkbox-card {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--paper-border);
  background: var(--paper-subtle);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
  user-select: none;
}

.checkbox-card:hover {
  background: #fff;
  border-color: var(--accent-gold);
}

.checkbox-card input[type="checkbox"] {
  appearance: none;
  width: 18px;
  height: 18px;
  border: 1.5px solid var(--text-dim);
  border-radius: 4px;
  background: #fff;
  cursor: pointer;
  flex-shrink: 0;
  margin-top: 2px;
  display: grid;
  place-content: center;
}

html[data-theme="dark"] .checkbox-card input[type="checkbox"] {
  background: #11121d;
}

.checkbox-card input[type="checkbox"]:checked {
  background: var(--accent-gold);
  border-color: var(--accent-gold);
}

.checkbox-card input[type="checkbox"]:checked::after {
  content: "";
  width: 5px;
  height: 9px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
  margin-bottom: 2px;
}

.checkbox-label {
  font-size: 0.88rem;
  line-height: 1.4;
  color: var(--text-dark);
}

/* ==========================================================================
   Authentic Weekly Matrix Table for Sheet 1
   ========================================================================== */

.tracker-table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--paper-border);
  border-radius: var(--radius-md);
  background: var(--paper);
  box-shadow: var(--shadow-sheet);
  margin: 14px 0 22px;
  -webkit-overflow-scrolling: touch;
}

.moves-matrix-table {
  width: 100%;
  min-width: 580px;
  border-collapse: collapse;
  table-layout: fixed;
}

.moves-matrix-table thead th {
  background: var(--paper-subtle);
  color: var(--accent-gold);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  padding: 11px 8px;
  border-bottom: 2px solid var(--paper-border);
  border-right: 1px solid var(--line);
  user-select: none;
}

.moves-matrix-table thead th:last-child {
  border-right: none;
}

.col-day { width: 85px; text-align: center; }
.col-task { width: auto; text-align: left; }
.col-check { width: 56px; text-align: center; }

.moves-matrix-table tbody td {
  border-bottom: 1px dashed var(--line);
  padding: 3px 6px;
  vertical-align: middle;
}

.moves-matrix-table tbody tr.day-row-end td {
  border-bottom: 2px solid var(--paper-border);
}

.day-col-cell {
  text-align: center;
  vertical-align: middle;
  border-right: 1.5px solid var(--paper-border);
  background: var(--paper-subtle);
  padding: 6px 4px !important;
}

.day-code {
  font-size: 0.96rem;
  font-weight: 800;
  color: var(--primary-dark);
  display: block;
  line-height: 1.2;
}

.day-subname {
  font-size: 0.66rem;
  color: var(--text-dim);
  display: block;
  line-height: 1.2;
}

.task-col-cell {
  border-right: 1px solid var(--line);
  padding: 2px 8px !important;
}

.matrix-task-input {
  width: 100%;
  border: none;
  background: transparent;
  border-bottom: 1px solid transparent;
  padding: 6px 4px;
  font-family: var(--font-sans);
  font-size: 0.88rem;
  color: var(--text-dark);
  transition: all 0.15s;
}

.matrix-task-input:focus {
  outline: none;
  border-bottom-color: var(--accent-gold);
  background: rgba(115, 78, 47, 0.05);
}

html[data-theme="dark"] .matrix-task-input:focus {
  background: rgba(115, 78, 47, 0.12);
}

.check-col-cell {
  text-align: center;
  border-right: 1px dashed var(--line);
  padding: 2px !important;
  width: 56px;
}

.moves-matrix-table tbody tr td:last-child {
  border-right: none;
}

/* Tactile Checkbox Box */
.motive-check-box {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 32px;
  cursor: pointer;
  user-select: none;
  position: relative;
}

.motive-check-box input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  pointer-events: none;
}

.box-visual {
  width: 22px;
  height: 22px;
  border-radius: 5px;
  border: 1.8px solid var(--text-dim);
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s cubic-bezier(0.16, 1, 0.3, 1);
}

html[data-theme="dark"] .box-visual {
  background: #18192a;
  border-color: rgba(255, 255, 255, 0.25);
}

.motive-check-box:hover .box-visual {
  border-color: var(--accent-gold);
  transform: scale(1.15);
  box-shadow: 0 2px 8px rgba(115, 78, 47, 0.25);
}

/* Checked Motives */
.motive-check-box.chip-int.checked .box-visual {
  background: var(--accent-brown);
  border-color: var(--accent-brown);
  box-shadow: 0 2px 8px rgba(115, 78, 47, 0.35);
}

.motive-check-box.chip-nov.checked .box-visual {
  background: #2f6f64;
  border-color: #2f6f64;
  box-shadow: 0 2px 8px rgba(47, 111, 100, 0.35);
}

.motive-check-box.chip-cha.checked .box-visual {
  background: #6d4b9b;
  border-color: #6d4b9b;
  box-shadow: 0 2px 8px rgba(109, 75, 155, 0.35);
}

.motive-check-box.chip-urg.checked .box-visual {
  background: #b84332;
  border-color: #b84332;
  box-shadow: 0 2px 8px rgba(184, 67, 50, 0.35);
}

.motive-check-box.checked .box-visual::after {
  content: "✓";
  font-size: 14px;
  font-weight: 900;
  color: #fff;
  line-height: 1;
}

/* Quick Take Banner */
.quick-take {
  border-left: 4px solid var(--accent-gold);
  padding: 10px 14px;
  background: rgba(115, 78, 47, 0.08);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-family: var(--font-cormorant);
  font-style: italic;
  font-size: 1.1rem;
  color: var(--accent-gold);
  margin-top: 24px;
}

.sheet-footer-mark {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 18px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-size: 0.74rem;
  color: var(--text-dim);
  flex-wrap: wrap;
  gap: 8px;
}

/* Blank lines for print */
.blank-lines {
  display: none;
  min-height: 60px;
  border-bottom: 1px solid var(--line);
  background-image: repeating-linear-gradient(
    transparent,
    transparent 24px,
    var(--line) 25px
  );
  line-height: 25px;
  margin-bottom: 14px;
}

/* ==========================================================================
   Stasia Signature Panda Footer Card
   ========================================================================== */

.stasia-panda-footer {
  margin-top: 36px;
  margin-bottom: 24px;
}

.panda-footer-card {
  background: var(--paper);
  border: 1px solid var(--paper-border);
  border-radius: var(--radius-lg);
  padding: 24px 28px;
  box-shadow: var(--shadow-sheet);
  display: flex;
  align-items: center;
  gap: 24px;
  position: relative;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.panda-footer-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 4px;
  background: var(--accent-brown);
}

.panda-avatar-wrapper {
  flex-shrink: 0;
  width: 84px;
  height: 84px;
  border-radius: 50%;
  background: var(--accent-brown-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid rgba(115, 78, 47, 0.25);
  box-shadow: 0 4px 14px rgba(115, 78, 47, 0.1);
}

.panda-avatar-img {
  width: 72px;
  height: 72px;
  object-fit: contain;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.1));
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.panda-footer-card:hover .panda-avatar-img {
  transform: scale(1.08) rotate(-3deg);
}

.panda-info {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.panda-badge {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1.6px;
  color: var(--accent-gold);
}

.panda-name {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--primary-dark);
  margin: 0;
  line-height: 1.2;
}

.panda-desc {
  font-size: 0.88rem;
  line-height: 1.45;
  color: var(--text-muted);
  margin: 0;
  max-width: 680px;
}

.panda-links {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 6px;
}

.panda-btn {
  font-size: 0.82rem;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--paper-border);
  background: var(--paper-subtle);
  color: var(--text-dark);
  text-decoration: none;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.panda-btn:hover {
  border-color: var(--accent-gold);
  background: #fff;
  transform: translateY(-1px);
}

.panda-btn.primary {
  background: var(--primary-dark);
  color: #fff;
  border-color: var(--primary-dark);
}

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

.panda-btn.tg {
  border-color: rgba(47, 111, 100, 0.3);
  color: var(--accent-teal);
  background: var(--accent-teal-soft);
}

.panda-btn.tg:hover {
  background: var(--accent-teal);
  color: #fff;
}

@media (max-width: 600px) {
  .panda-footer-card {
    flex-direction: column;
    text-align: center;
    padding: 20px 16px;
    gap: 14px;
  }

  .panda-avatar-wrapper {
    margin: 0 auto;
  }

  .panda-links {
    justify-content: center;
  }
}

/* ==========================================================================
   Bottom Sheet Navigation
   ========================================================================== */

.sheet-nav-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 28px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  flex-wrap: wrap;
  gap: 10px;
}

@media (max-width: 600px) {
  .sheet-nav-bottom {
    flex-direction: column;
    align-items: stretch;
  }
  .sheet-nav-bottom .topbar-btn {
    justify-content: center;
    width: 100%;
  }
}

/* ==========================================================================
   Guide Sheet: Reader & Article
   ========================================================================== */

.guide-article-intro {
  font-size: 1rem;
  line-height: 1.55;
  color: var(--text-dark);
  margin-bottom: 24px;
  border-left: 3px solid var(--accent-gold);
  padding-left: 14px;
  background: rgba(115, 78, 47, 0.04);
  padding-top: 6px;
  padding-bottom: 6px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.guide-section {
  margin-bottom: 28px;
}

.guide-section-h3 {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--primary-dark);
  margin: 0 0 10px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 6px;
}

.guide-compare-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 14px 0;
}

.compare-card {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--paper-border);
  background: var(--paper-subtle);
  font-size: 0.88rem;
  line-height: 1.45;
}

.compare-card-title {
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--primary-dark);
  margin-bottom: 2px;
}

.compare-card-sub {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-dim);
  margin-bottom: 8px;
}

.compare-card.adhd-card {
  border-color: var(--accent-gold);
  background: var(--accent-gold-soft);
}

.compare-card.adhd-card .compare-card-title {
  color: var(--accent-gold);
}

.guide-fuel-cards {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 14px;
}

.guide-fuel-item {
  border: 1px solid var(--paper-border);
  border-radius: var(--radius-sm);
  background: var(--paper-subtle);
  padding: 14px 16px;
}

.guide-fuel-item.int { border-left: 4px solid var(--accent-brown); }
.guide-fuel-item.nov { border-left: 4px solid #2f6f64; }
.guide-fuel-item.cha { border-left: 4px solid #6d4b9b; }
.guide-fuel-item.urg { border-left: 4px solid #b84332; }

.guide-fuel-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.guide-fuel-icon {
  font-size: 1.5rem;
  line-height: 1;
}

.guide-fuel-name {
  font-weight: 800;
  font-size: 0.96rem;
  color: var(--primary-dark);
}

.guide-fuel-subtitle {
  font-size: 0.78rem;
  color: var(--text-dim);
}

.guide-tips-box {
  background: #fff;
  border: 1px solid var(--paper-border);
  border-radius: 6px;
  padding: 10px 12px;
  margin-top: 10px;
  font-size: 0.86rem;
}

html[data-theme="dark"] .guide-tips-box {
  background: #11121d;
}

.guide-tips-box ul {
  margin: 6px 0 0 18px;
  padding: 0;
  color: var(--text-muted);
}

.guide-tips-box li {
  margin-bottom: 4px;
}

.guide-steps-list {
  padding-left: 20px;
  margin: 10px 0;
}

.guide-steps-list li {
  margin-bottom: 8px;
}

.guide-author-word {
  background: var(--accent-teal-soft);
  border: 1px solid rgba(47, 111, 100, 0.3);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  margin-top: 20px;
  position: relative;
}

.guide-author-badge {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1.4px;
  color: var(--accent-teal);
  margin-bottom: 4px;
}

.guide-author-word p {
  font-family: var(--font-cormorant);
  font-style: italic;
  font-size: 1.15rem;
  line-height: 1.4;
  color: var(--primary-dark);
  margin: 0;
}

.guide-modal-footer {
  padding: 14px 24px;
  border-top: 1px solid var(--paper-border);
  background: var(--paper-subtle);
  display: flex;
  justify-content: flex-end;
}

@media (max-width: 600px) {
  .guide-compare-grid {
    grid-template-columns: 1fr;
  }

  .guide-modal-body {
    padding: 16px;
  }
}

/* ==========================================================================
   PRINT MEDIA RULES (Format A4)
   ========================================================================== */

@media print {
  @page {
    size: A4 portrait;
    margin: 8mm 12mm 8mm 12mm;
  }

  html, body {
    background: #fff !important;
    color: #000 !important;
    font-size: 10pt !important;
  }

  .app-topbar,
  .quick-pills,
  .drawer-backdrop,
  .drawer-panel,
  .no-print {
    display: none !important;
  }

  .main-content {
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .sheet-canvas {
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    background: #fff !important;
  }

  .sheet-diagonal-stripe {
    display: none !important;
  }

  .sheet-h1 {
    font-size: 18pt !important;
    color: #1a1b2e !important;
  }

  .sheet-tagline {
    font-size: 10.5pt !important;
  }

  .sheet-lead {
    font-size: 9pt !important;
    margin-bottom: 12px !important;
  }

  .info-box {
    background: #faf8f4 !important;
    border: 1px solid #d8cdb8 !important;
    border-left: 3px solid #734E2F !important;
    padding: 8px 10px !important;
    margin-bottom: 12px !important;
  }

  .fuel-legend-bar {
    background: #f8f6f0 !important;
    border: 1px solid #ccc !important;
    padding: 3px 6px !important;
    margin-bottom: 6px !important;
  }

  .fuel-legend-label {
    font-size: 7pt !important;
    color: #000 !important;
  }

  .fuel-pill {
    font-size: 6.8pt !important;
    padding: 1px 5px !important;
    border: 1px solid #ddd !important;
    background: #fff !important;
  }

  .input-field, .textarea-field, .day-task-input {
    border: 1px solid #ccc !important;
    background: #fff !important;
    color: #000 !important;
    font-size: 9pt !important;
    padding: 5px 8px !important;
    margin-bottom: 8px !important;
  }

  .day-card {
    border: 1px solid #ddd !important;
    background: #fff !important;
    padding: 8px 10px !important;
    margin-bottom: 6px !important;
  }

  .motive-chip {
    border: 1px solid #aaa !important;
    font-size: 7.5pt !important;
    padding: 2px 6px !important;
  }

  .motive-chip.checked {
    background: #24253d !important;
    color: #fff !important;
  }

  .tracker-table-wrap {
    border: 1px solid #666 !important;
    box-shadow: none !important;
    margin: 8px 0 14px !important;
    overflow: visible !important;
  }

  .moves-matrix-table {
    min-width: 100% !important;
  }

  .moves-matrix-table thead th {
    background: #f2ede4 !important;
    color: #111 !important;
    border: 1px solid #777 !important;
    font-size: 7.5pt !important;
    padding: 3px 2px !important;
  }

  .moves-matrix-table tbody td {
    border: 1px solid #888 !important;
    padding: 2px 4px !important;
  }

  .moves-matrix-table tbody tr,
  .day-row-start,
  .info-box,
  .checkbox-card,
  .guide-fuel-item {
    break-inside: avoid !important;
    page-break-inside: avoid !important;
  }

  .day-col-cell {
    background: #faf7f0 !important;
    border-right: 1.5px solid #444 !important;
  }

  .day-code {
    font-size: 8pt !important;
    color: #000 !important;
  }

  .day-subname {
    font-size: 5.5pt !important;
    color: #444 !important;
  }

  .matrix-task-input {
    display: block !important;
    border: none !important;
    font-size: 8pt !important;
    padding: 1px 2px !important;
  }

  .box-visual {
    width: 13px !important;
    height: 13px !important;
    border: 1.2px solid #222 !important;
    background: #fff !important;
    border-radius: 2px !important;
  }

  .motive-check-box.checked .box-visual {
    background: #24253d !important;
    border-color: #24253d !important;
  }

  .motive-check-box.checked .box-visual::after {
    color: #fff !important;
    font-size: 8pt !important;
  }

  .motive-check-box {
    height: 20px !important;
  }

  /* Blank Print Mode */
  body.print-blank .input-field,
  body.print-blank .textarea-field,
  body.print-blank .day-task-input,
  body.print-blank .matrix-task-input {
    display: none !important;
  }

  body.print-blank .blank-lines {
    display: block !important;
    min-height: 18px !important;
    margin: 0 !important;
  }

  body.print-blank .motive-check-box.checked .box-visual {
    background: #fff !important;
    border-color: #222 !important;
  }

  body.print-blank .motive-check-box.checked .box-visual::after {
    display: none !important;
  }

  body.print-blank .checkbox-card input[type="checkbox"]:checked {
    background: #fff !important;
  }
}
