:root {
  --ink: #171513;
  --paper: #faf7ef;
  --sheet: #fffdfa;
  --panel: #f3efe5;
  --line: #d8cbb0;
  --gold: #b7841e;
  --gold-dark: #8c6313;
  --teal: #1f5c5f;
  --teal-soft: #dceceb;
  --clay: #9d4f3e;
  --danger: #9a2e2b;
  --muted: #6f665b;
  --shadow: 0 18px 48px rgba(23, 21, 19, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: linear-gradient(180deg, #f8f4ec 0%, #eee7d8 100%);
  font-family: Georgia, "Times New Roman", serif;
}

button,
select,
textarea,
input,
a {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.app-shell {
  display: grid;
  grid-template-columns: 286px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 24px;
  color: #f7efe1;
  background:
    linear-gradient(180deg, rgba(13, 13, 13, 0.86), rgba(13, 13, 13, 0.96)),
    radial-gradient(circle at 30% 0%, rgba(183, 132, 30, 0.24), transparent 32%),
    #111;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border: 1px solid rgba(247, 239, 225, 0.46);
  color: var(--gold);
  font-family: Arial, sans-serif;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 1px;
}

.brand-lockup h1,
.topbar h2,
.tool-panel h3,
.context-panel h3,
.book-feature h3 {
  margin: 0;
  line-height: 1.05;
  letter-spacing: 0;
}

.brand-lockup h1 {
  font-size: 28px;
}

.eyebrow,
.panel-label,
.resource-type,
.step-kicker {
  margin: 0 0 6px;
  color: var(--gold);
  font-family: Arial, sans-serif;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.nav-list {
  display: grid;
  gap: 8px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid rgba(247, 239, 225, 0.16);
  border-radius: 8px;
  color: #f7efe1;
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
  text-align: left;
}

.nav-item:hover,
.nav-item:focus-visible,
.nav-item.active {
  border-color: rgba(183, 132, 30, 0.8);
  background: rgba(183, 132, 30, 0.18);
  outline: none;
}

.nav-icon {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  color: #15120d;
  background: var(--gold);
  font-family: Arial, sans-serif;
  font-size: 11px;
  font-weight: 800;
}

.side-panel {
  margin-top: auto;
  padding: 16px;
  border: 1px solid rgba(247, 239, 225, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
}

.side-panel p {
  margin: 0 0 12px;
  color: rgba(247, 239, 225, 0.82);
  font-size: 14px;
  line-height: 1.35;
}

.support-link {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 38px;
  min-width: 92px;
  margin-right: 6px;
  padding: 8px 12px;
  border-radius: 7px;
  color: #14110c;
  background: var(--gold);
  font-family: Arial, sans-serif;
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}

.support-link.muted {
  color: #f7efe1;
  background: rgba(255, 255, 255, 0.12);
}

.main-content {
  min-width: 0;
  padding: 28px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  margin-bottom: 22px;
}

.topbar h2 {
  max-width: 820px;
  font-size: 34px;
}

.book-link,
.cta-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 16px;
  border: 1px solid var(--gold);
  border-radius: 8px;
  color: #15120d;
  background: var(--gold);
  font-family: Arial, sans-serif;
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.reset-grid,
.split-layout,
.resources-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(300px, 0.85fr);
  gap: 22px;
  align-items: start;
}

.tool-panel,
.context-panel,
.book-feature {
  border: 1px solid rgba(155, 126, 74, 0.26);
  border-radius: 8px;
  background: rgba(255, 253, 250, 0.84);
  box-shadow: var(--shadow);
}

.tool-panel {
  padding: 24px;
}

.context-panel {
  display: grid;
  gap: 16px;
  padding: 18px;
}

.section-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.tool-panel h3,
.context-panel h3,
.book-feature h3 {
  font-size: 30px;
}

.timer-card {
  display: grid;
  place-items: center;
  min-width: 98px;
  min-height: 110px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.timer-card span {
  font-family: Arial, sans-serif;
  font-size: 24px;
  font-weight: 800;
}

.timer-card small {
  color: var(--muted);
  font-family: Arial, sans-serif;
  font-size: 11px;
  text-transform: uppercase;
}

.timer-controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 5px;
  padding: 0 8px 8px;
}

.timer-controls button {
  min-height: 28px;
  padding: 4px 7px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--ink);
  background: #fffdfa;
  font-family: Arial, sans-serif;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}

.timer-controls button:hover,
.timer-controls button:focus-visible {
  border-color: var(--teal);
  background: var(--teal-soft);
  outline: none;
}

.post-reset-timer .timer-card {
  width: 100%;
  min-height: 136px;
  margin-top: 12px;
}

.post-reset-timer .timer-card span {
  font-size: 38px;
}

.timer-card.complete {
  border-color: var(--gold);
  background: #fff3cf;
}

.timer-complete-message {
  display: none;
  margin: 10px 0 0;
  color: var(--ink);
  font-family: Arial, sans-serif;
  font-size: 13px;
  font-weight: 800;
}

.timer-complete-message.active {
  display: block;
}

.mood-picker {
  margin: 0 0 18px;
  padding: 0;
  border: 0;
}

.mood-picker legend,
.step-card label,
.research-panel label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-family: Arial, sans-serif;
  font-size: 13px;
  font-weight: 800;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.mood-chip {
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  background: #fffdfa;
  cursor: pointer;
}

.mood-chip:hover,
.mood-chip:focus-visible,
.mood-chip.active {
  border-color: var(--teal);
  background: var(--teal-soft);
  outline: none;
}

.progress-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  margin-bottom: 16px;
}

.progress-bar {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: #e4dac6;
}

.progress-bar span {
  display: block;
  width: 20%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--gold), var(--teal));
  transition: width 180ms ease;
}

#stepCounter,
.status-text {
  margin: 0;
  color: var(--muted);
  font-family: Arial, sans-serif;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.step-card {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdfa;
}

.step-card h4 {
  margin: 0 0 8px;
  font-size: 28px;
}

.step-card p {
  margin: 0 0 18px;
  color: #302b26;
  font-size: 18px;
  line-height: 1.42;
}

.step-extra {
  display: grid;
  gap: 14px;
  margin-top: 16px;
}

.step-extra-group {
  display: grid;
  gap: 12px;
}

.step-extra-label,
.toolbox-summary {
  margin: 0;
  color: var(--muted);
  font-family: Arial, sans-serif;
  font-size: 13px;
  font-weight: 800;
}

.timer-options,
.toolbox-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.custom-timer {
  display: grid;
  gap: 8px;
}

.custom-timer-controls {
  display: grid;
  grid-template-columns: minmax(92px, 0.45fr) auto;
  gap: 8px;
  align-items: center;
}

.duration-chip,
.tool-chip {
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  background: #fffdfa;
  cursor: pointer;
}

.duration-chip:hover,
.duration-chip:focus-visible,
.duration-chip.active,
.tool-chip:hover,
.tool-chip:focus-visible,
.tool-chip.active {
  border-color: var(--teal);
  background: var(--teal-soft);
  outline: none;
}

.toolbox-summary {
  font-weight: 700;
  line-height: 1.35;
}

textarea,
select,
input[type="number"] {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: #fff;
}

textarea {
  min-height: 126px;
  padding: 14px;
  resize: vertical;
  line-height: 1.35;
}

select {
  min-height: 42px;
  padding: 8px 10px;
}

input[type="number"] {
  min-height: 44px;
  padding: 8px 10px;
  font-family: Arial, sans-serif;
  font-weight: 800;
}

textarea:focus,
select:focus,
input[type="number"]:focus {
  border-color: var(--teal);
  outline: 3px solid rgba(31, 92, 95, 0.18);
}

.tool-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 16px;
}

.primary,
.secondary {
  min-height: 44px;
  padding: 10px 16px;
  border-radius: 8px;
  font-family: Arial, sans-serif;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
}

.primary {
  border: 1px solid var(--ink);
  color: #fffdfa;
  background: var(--ink);
}

.primary:hover,
.primary:focus-visible {
  background: var(--teal);
  outline: none;
}

.primary.full {
  width: 100%;
  margin-top: 10px;
}

.secondary {
  border: 1px solid var(--line);
  color: var(--ink);
  background: #fffdfa;
}

.secondary:hover,
.secondary:focus-visible {
  border-color: var(--teal);
  outline: none;
}

.secondary.full {
  width: 100%;
}

.secondary.danger {
  width: 100%;
  color: var(--danger);
}

.signal-card,
.book-card,
.resource-card,
.journal-entry {
  border: 1px solid rgba(155, 126, 74, 0.25);
  border-radius: 8px;
  background: #fffdfa;
}

.signal-card {
  padding: 18px;
}

.calm-card h3,
.video-card h3 {
  font-size: 22px;
  margin-bottom: 8px;
}

.method-list {
  display: grid;
  gap: 12px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
  counter-reset: method;
}

.method-list li {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  counter-increment: method;
}

.method-list li::before {
  content: counter(method);
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  color: #fffdfa;
  background: var(--teal);
  font-family: Arial, sans-serif;
  font-size: 12px;
  font-weight: 800;
}

.method-list strong,
.method-list span {
  display: block;
}

.method-list span,
.signal-card p,
.book-card p,
.resource-card p,
.journal-entry p,
.book-feature p {
  color: #3f3830;
  line-height: 1.42;
}

.book-card.compact {
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr);
  gap: 14px;
  padding: 14px;
}

.journal-book-offer {
  display: grid;
  gap: 16px;
  padding: 18px;
  border: 1px solid rgba(183, 132, 30, 0.42);
  border-radius: 8px;
  background: #15120d;
  color: #fffdfa;
  box-shadow: var(--shadow);
}

.journal-book-offer img {
  width: min(100%, 260px);
  justify-self: center;
  border-radius: 7px;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.28);
}

.journal-book-offer h3 {
  font-size: 30px;
  margin-bottom: 8px;
}

.journal-book-offer p:not(.eyebrow) {
  color: rgba(255, 253, 250, 0.86);
}

.journal-book-offer .cta-link {
  width: 100%;
  margin-top: 4px;
}

.book-card img {
  width: 100%;
  border-radius: 6px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.18);
}

.book-card h3 {
  font-size: 20px;
  margin-bottom: 6px;
}

.book-card a,
.video-card a,
.resource-card a,
.research-item a {
  color: var(--gold-dark);
  font-family: Arial, sans-serif;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.plain-list {
  margin: 12px 0 0;
  padding-left: 20px;
}

.plain-list li {
  margin-bottom: 7px;
}

.empty-state {
  padding: 28px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: #fffdfa;
  text-align: center;
}

.empty-state h4 {
  margin: 0 0 8px;
  font-size: 22px;
}

.empty-state p {
  margin: 0;
  color: var(--muted);
}

.journal-list {
  display: grid;
  gap: 12px;
}

.journal-entry {
  padding: 16px;
}

.journal-entry header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.journal-entry h4 {
  margin: 0;
  font-size: 20px;
}

.journal-entry time {
  color: var(--muted);
  font-family: Arial, sans-serif;
  font-size: 12px;
  font-weight: 800;
}

.journal-entry dl {
  display: grid;
  gap: 8px;
  margin: 0;
}

.journal-entry dt {
  color: var(--gold-dark);
  font-family: Arial, sans-serif;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.journal-entry dd {
  margin: 0;
}

.journal-email-capture {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid rgba(183, 132, 30, 0.3);
  border-radius: 8px;
  background: #fff8e9;
}

.journal-email-capture h5 {
  margin: 0 0 8px;
  font-size: 18px;
  line-height: 1.25;
}

.journal-email-capture p:not(.eyebrow) {
  margin: 0 0 12px;
  color: #3f3830;
  font-size: 14px;
}

.journal-email-capture label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-family: Arial, sans-serif;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.email-capture-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.email-capture-row input[type="email"] {
  width: 100%;
  min-height: 44px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.email-capture-row input[type="email"]:focus {
  border-color: var(--teal);
  outline: 3px solid rgba(31, 92, 95, 0.18);
}

.email-capture-status {
  min-height: 18px;
  margin: 8px 0 0;
  color: var(--teal);
  font-family: Arial, sans-serif;
  font-size: 12px;
  font-weight: 800;
}

.journal-video-match {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid rgba(31, 92, 95, 0.24);
  border-radius: 8px;
  background: var(--teal-soft);
}

.journal-video-match h5 {
  margin: 0 0 8px;
  font-size: 18px;
  line-height: 1.25;
}

.journal-video-match p:not(.eyebrow) {
  margin: 0 0 10px;
  color: #2d3b39;
  font-size: 14px;
}

.journal-video-match a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 8px 12px;
  border-radius: 7px;
  color: #fffdfa;
  background: var(--ink);
  font-family: Arial, sans-serif;
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}

.journal-video-match a:hover,
.journal-video-match a:focus-visible {
  background: var(--teal);
  outline: none;
}

.resources-layout {
  grid-template-columns: minmax(0, 1fr) 390px;
}

.resource-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.resource-card {
  padding: 16px;
}

.resource-card.urgent {
  border-color: rgba(154, 46, 43, 0.45);
  background: #fff9f7;
}

.resource-card h4 {
  margin: 0 0 8px;
  font-size: 21px;
}

.research-panel {
  gap: 12px;
}

.research-results {
  display: grid;
  gap: 10px;
  max-height: 520px;
  overflow: auto;
  padding-right: 2px;
}

.research-item {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdfa;
}

.research-item h4 {
  margin: 0 0 6px;
  font-size: 16px;
  line-height: 1.25;
}

.research-item p {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 13px;
}

.book-feature {
  display: grid;
  grid-template-columns: minmax(220px, 360px) minmax(0, 1fr);
  gap: 28px;
  align-items: center;
  padding: 28px;
}

.book-feature img {
  width: 100%;
  max-height: 620px;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.book-feature h3 {
  max-width: 760px;
  font-size: 42px;
}

.book-feature p {
  max-width: 760px;
  font-size: 19px;
}

.book-statement {
  padding: 16px;
  border-left: 4px solid var(--gold);
  background: var(--panel);
  font-weight: 700;
}

@media (max-width: 1040px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
  }

  .nav-list {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .side-panel {
    margin-top: 0;
  }

  .reset-grid,
  .split-layout,
  .resources-layout,
  .book-feature {
    grid-template-columns: 1fr;
  }

  .book-feature img {
    max-width: 320px;
    margin: 0 auto;
  }
}

@media (max-width: 720px) {
  .main-content,
  .sidebar {
    padding: 16px;
  }

  .topbar,
  .section-head {
    flex-direction: column;
  }

  .topbar h2,
  .book-feature h3 {
    font-size: 29px;
  }

  .tool-panel h3,
  .context-panel h3 {
    font-size: 25px;
  }

  .nav-list {
    grid-template-columns: 1fr 1fr;
  }

  .nav-item {
    min-height: 42px;
  }

  .resource-grid {
    grid-template-columns: 1fr;
  }

  .book-card.compact {
    grid-template-columns: 82px minmax(0, 1fr);
  }

  .tool-actions {
    justify-content: stretch;
  }

  .tool-actions button {
    flex: 1;
  }

  .email-capture-row {
    grid-template-columns: 1fr;
  }
}
