:root {
  --bg: #fff;
  --text: #171717;
  --link: #0b63ce;
  --surface: #f4f4f4;
  --border: #b8b8b8;
  --muted-text: #4b5563;
  --accent: #2d5be3;
  --accent-strong: #1f47c2;
  --on-accent: #ffffff;
  --track: #d5dce8;
  --control-shadow: none;
  --section-bg: #fff;
  --field-bg: #fff;
  --table-head-bg: #f4f4f4;
  --radius-panel: 0;
  --radius-control: 0;
  --panel-shadow: none;
  --body-surface: var(--bg);
}
html[data-theme="dark"] {
  --bg: #090b10;
  --text: #e9eef9;
  --link: #8cb8ff;
  --surface: #121824;
  --border: #3a4a66;
  --muted-text: #a4b0c7;
  --accent: #90a8ff;
  --accent-strong: #7692fa;
  --on-accent: #0d162d;
  --track: #2a3650;
  --control-shadow: none;
  --section-bg: #090b10;
  --field-bg: #090b10;
  --table-head-bg: #121824;
  --body-surface: #090b10;
}
html[data-theme="light"][data-ui="modern"] {
  --text: #122338;
  --link: #1d4ed8;
  --muted-text: #4a6382;
  --surface: #eaf0ff;
  --section-bg: #f9fbff;
  --field-bg: #ffffff;
  --table-head-bg: #eef3ff;
  --border: #c7d5f1;
  --accent: #2c63f6;
  --accent-strong: #194dd8;
  --on-accent: #ffffff;
  --track: #d4def7;
  --radius-panel: 24px;
  --radius-control: 14px;
  --control-shadow: 0 1px 2px rgba(27, 44, 86, 0.12);
  --panel-shadow: 0 14px 36px rgba(31, 56, 106, 0.14);
  --body-surface: #eff3fb;
}
html[data-theme="dark"][data-ui="modern"] {
  --text: #e7eeff;
  --link: #98b4ff;
  --muted-text: #9fb0d9;
  --surface: #18253f;
  --section-bg: #101a2f;
  --field-bg: #0b1529;
  --table-head-bg: #172646;
  --border: #3d5582;
  --accent: #8ea8ff;
  --accent-strong: #6f90ff;
  --on-accent: #0b1530;
  --track: #263659;
  --radius-panel: 24px;
  --radius-control: 14px;
  --control-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
  --panel-shadow: 0 16px 34px rgba(0, 0, 0, 0.45);
  --body-surface: #0a1326;
}
* { box-sizing: border-box; }
body {
  margin: 0 auto;
  max-width: 1900px;
  width: min(98vw, 1900px);
  padding: 0.7rem;
  background: var(--body-surface);
  color: var(--text);
  font: 13px/1.42 "JetBrains Mono", "Fira Code", "SFMono-Regular", Menlo, Consolas, monospace;
  overflow-x: hidden;
}
a { color: var(--link); }
input[type="range"], input[type="checkbox"] { accent-color: var(--accent); }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--link);
  outline-offset: 2px;
}
h1, h2, h3, p { margin: 0 0 0.48rem; }
h1 { font-size: 1.3rem; line-height: 1.2; letter-spacing: 0.01em; font-weight: 600; }
h2 { font-size: 1.02rem; line-height: 1.24; font-weight: 600; }
h3 { font-size: 0.92rem; line-height: 1.22; font-weight: 600; }
header, footer { padding: 0.2rem 0 0.45rem; }
section {
  border: 1px solid var(--border);
  border-radius: var(--radius-panel);
  box-shadow: var(--panel-shadow);
  padding: 0.65rem;
  background: var(--section-bg);
}
input[type="text"], input[type="date"], input[type="time"], input[type="range"], textarea, button, select { font: inherit; }
input[type="text"], input[type="date"], input[type="time"], textarea, input[type="range"], select {
  width: 100%;
  padding: 0.32rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
  background: var(--field-bg);
  color: var(--text);
}
html:not([data-ui="modern"]) input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  height: 1.02rem;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
  accent-color: auto;
}
html:not([data-ui="modern"]) input[type="range"]::-webkit-slider-runnable-track {
  height: 0.34rem;
  border: 1px solid var(--border);
  border-radius: 0;
  background: var(--surface);
}
html:not([data-ui="modern"]) input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 0.72rem;
  height: 0.98rem;
  margin-top: -0.37rem;
  border: 1px solid var(--text);
  border-radius: 0;
  background: var(--field-bg);
  box-shadow: none;
}
html:not([data-ui="modern"]) input[type="range"]::-moz-range-track {
  height: 0.34rem;
  border: 1px solid var(--border);
  border-radius: 0;
  background: var(--surface);
}
html:not([data-ui="modern"]) input[type="range"]::-moz-range-progress {
  height: 0.34rem;
  border: 1px solid var(--border);
  border-radius: 0;
  background: var(--accent);
}
html:not([data-ui="modern"]) input[type="range"]::-moz-range-thumb {
  width: 0.72rem;
  height: 0.98rem;
  border: 1px solid var(--text);
  border-radius: 0;
  background: var(--field-bg);
  box-shadow: none;
}
textarea {
  max-width: 100%;
  resize: vertical;
  overflow: auto;
}
button {
  padding: 0.28rem 0.6rem;
  margin-right: 0.35rem;
  border-radius: var(--radius-control);
  border: 1px solid var(--border);
  background: var(--field-bg);
  color: var(--text);
  box-shadow: var(--control-shadow);
}
.tiny { font-size: 0.78rem; }
.small { font-size: 0.85rem; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.app-shell { display: block; }
.brand-orb-row { margin: 0 0 0.48rem; }
.accent-orb {
  width: 2.4rem;
  height: 2.4rem;
  margin: 0;
  padding: 0;
  border-radius: 999px;
  border: 1px solid var(--border);
  background:
    radial-gradient(circle at 32% 30%, rgba(255, 255, 255, 0.85), rgba(255, 255, 255, 0) 36%),
    radial-gradient(circle at 66% 65%, rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0) 55%),
    linear-gradient(145deg, var(--accent), var(--accent-strong));
  box-shadow: inset 0 0 14px rgba(255, 255, 255, 0.22), 0 2px 6px rgba(0, 0, 0, 0.18);
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}
.accent-orb:hover {
  transform: translateY(-1px) scale(1.03);
  box-shadow: inset 0 0 16px rgba(255, 255, 255, 0.26), 0 4px 10px rgba(0, 0, 0, 0.23);
  filter: saturate(1.08);
  animation: orb-float 1.7s ease-in-out infinite;
}
@keyframes orb-float {
  0%, 100% { transform: translateY(-1px) scale(1.03); }
  50% { transform: translateY(-2px) scale(1.035); }
}
@keyframes orb-gradient-drift {
  0% { background-position: 28% 24%, 72% 70%, 20% 80%; }
  50% { background-position: 42% 34%, 58% 56%, 74% 28%; }
  100% { background-position: 62% 48%, 38% 38%, 24% 18%; }
}
.menu { display: flex; flex-wrap: wrap; gap: 0.52rem; margin-bottom: 0.75rem; }
.menu a { display: inline-block; }
.sidebar-actions { border-top: 1px solid var(--border); padding-top: 0.55rem; }
.sidebar-actions p { margin-bottom: 0.42rem; }
.sidebar-date-controls {
  display: grid;
  grid-template-columns: 2.5rem minmax(0, 1fr) 2.5rem;
  gap: 0.35rem;
  align-items: center;
}
.sidebar-date-controls input[type="date"] {
  min-width: 0;
  width: 100%;
  padding-right: 1.8rem;
  font-variant-numeric: tabular-nums;
}
.sidebar-date-controls button {
  margin-right: 0;
  min-width: 2.5rem;
  width: 2.5rem;
  padding-left: 0;
  padding-right: 0;
}
main { display: grid; grid-template-columns: 1fr; gap: 0.75rem; }
.task-list { list-style: none; padding: 0; margin: 0.35rem 0 0.75rem; }
.task-list li { margin-bottom: 0.2rem; }
.task-item-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 8.6rem 6.1rem 7.7rem;
  align-items: center;
  column-gap: 0.55rem;
  row-gap: 0.35rem;
}
.task-item-row > .task-link:first-child {
  justify-self: start;
  min-width: 0;
}
.task-link { border: 0; background: none; padding: 0; color: var(--link); text-decoration: underline; cursor: pointer; }
.task-link.done { font-weight: 700; }
.task-repeat-meta { display: inline-flex; align-items: center; gap: 0.25rem; }
.task-item-row > .task-link.tiny { justify-self: start; margin-right: 0; }
.week-table, #calendar-table, #goal-notes-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.week-table th, .week-table td, #calendar-table th, #calendar-table td, #goal-notes-table th, #goal-notes-table td {
  border: 1px solid var(--border);
  padding: 0.28rem;
  vertical-align: top;
}
#calendar-table td {
  overflow-wrap: anywhere;
  word-break: break-word;
}
#calendar-table th, #goal-notes-table th { background: var(--table-head-bg); text-align: center; }
.controls { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
[hidden] { display: none !important; }
.top-controls { align-items: center; }
.top-controls button { margin-right: 0; }
.timer-mode-controls label,
.timer-countdown-controls label { white-space: nowrap; }
.timer-mode-controls button { min-width: 15rem; margin-right: 0; }
.timer-countdown-controls input[type="range"] {
  flex: 0 1 clamp(11rem, 28vw, 22rem);
  width: clamp(11rem, 28vw, 22rem);
  min-width: 0;
}
#timer-countdown-value { min-width: 6ch; text-align: right; font-variant-numeric: tabular-nums; }
.soundscape-grid { display: grid; grid-template-columns: 1fr; gap: 0.35rem; }
.soundscape-row { margin: 0; }
.soundscape-row label { min-width: 6rem; }
.soundscape-row input[type="range"] { flex: 1 1 auto; min-width: 0; }
.soundscape-row span { min-width: 3ch; text-align: right; font-variant-numeric: tabular-nums; }
#timer-display.timer-blink-stopped,
#timer-display.timer-blink-finished {
  animation: timer-blink 1s steps(1, end) infinite;
}
@keyframes timer-blink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0.2; }
}
.day-number { font-weight: 700; }
.day-select {
  border: 0;
  background: none;
  color: inherit;
  padding: 0;
  margin: 0;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.day-items { margin: 0.2rem 0 0; padding-left: 0.95rem; max-width: 100%; }
.day-items li {
  font-size: 0.78rem;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.today-cell { outline: 1px solid var(--link); }
.selected-day-cell { outline: 2px dashed var(--link); outline-offset: -2px; }
.jardin-grid { display: grid; grid-template-columns: 1fr; gap: 0.65rem; }
.mood-buttons { display: grid; grid-template-columns: 1fr; gap: 0.28rem; max-width: 18rem; }
.mood-button { text-align: left; width: 100%; margin: 0; }
.mood-button.active,
.chip.active,
.beck-step-link.active {
  font-weight: 400;
  background: var(--surface);
  border-color: var(--link);
  box-shadow: inset 0 0 0 1px var(--link);
  color: var(--text);
}
#day-note, #import-text, .beck-step-content textarea { min-height: 6rem; }
.message { min-height: 1.2rem; margin-top: 0.3rem; }
.beck-layout { display: grid; grid-template-columns: 1fr; gap: 0.65rem; }
.beck-entry-controls label { white-space: nowrap; }
.beck-entry-controls select { max-width: 16rem; }
.beck-steps { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.beck-step-link { margin: 0; }
.beck-step-content {
  display: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
  padding: 0.6rem;
  background: var(--table-head-bg);
}
.beck-step-content.active { display: block; }
.beck-nav-controls { margin-top: 0.5rem; }
.beck-nav-controls button { min-width: 8rem; }
.chip-group { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.chip { margin: 0; }

html[data-ui="modern"] body {
  font: 14px/1.48 "Roboto", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  letter-spacing: 0.01em;
  background-image:
    radial-gradient(1100px 520px at 8% -8%, rgba(76, 122, 255, 0.16), transparent 55%),
    radial-gradient(850px 500px at 100% 0%, rgba(49, 197, 255, 0.12), transparent 45%);
}
html[data-ui="modern"] .accent-orb {
  background-size: 145% 145%, 165% 165%, 210% 210%;
  animation: orb-gradient-drift 24s ease-in-out infinite alternate;
}
html[data-ui="modern"] .accent-orb:hover {
  animation: orb-gradient-drift 14s ease-in-out infinite alternate, orb-float 1.7s ease-in-out infinite;
}
html[data-theme="dark"][data-ui="modern"] body {
  background-image:
    radial-gradient(1100px 520px at 8% -8%, rgba(89, 121, 255, 0.16), transparent 55%),
    radial-gradient(850px 500px at 100% 0%, rgba(75, 160, 255, 0.14), transparent 45%);
}
html[data-ui="modern"] a:focus-visible,
html[data-ui="modern"] button:focus-visible,
html[data-ui="modern"] input:focus-visible,
html[data-ui="modern"] textarea:focus-visible {
  outline-color: var(--accent);
}
html[data-ui="modern"] .sidebar {
  background: var(--section-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-panel);
  box-shadow: var(--panel-shadow);
  padding: 0.8rem;
}
html[data-ui="modern"] .sidebar-date-controls input[type="date"] {
  padding-right: 2.1rem;
}
html[data-ui="modern"] .menu a {
  text-decoration: none;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--field-bg);
  padding: 0.38rem 0.7rem;
  color: var(--text);
  box-shadow: var(--control-shadow);
}
html[data-ui="modern"] .menu a:hover {
  border-color: var(--accent);
}
html[data-ui="modern"] .sidebar-actions a {
  text-decoration: none;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--field-bg);
  padding: 0.34rem 0.66rem;
  color: var(--text);
  display: inline-block;
  box-shadow: var(--control-shadow);
}
html[data-ui="modern"] .sidebar-actions {
  border-top-color: var(--border);
}
html[data-ui="modern"] section {
  border-color: rgba(137, 160, 206, 0.45);
}
html[data-theme="dark"][data-ui="modern"] section {
  border-color: rgba(76, 106, 170, 0.65);
}
html[data-ui="modern"] h1 { font-size: 1.42rem; }
html[data-ui="modern"] h2 { font-size: 1.06rem; }
html[data-ui="modern"] h3 { font-size: 0.98rem; color: var(--muted-text); }
html[data-ui="modern"] #timer-display {
  font: 600 2.1rem/1.1 "JetBrains Mono", "Fira Code", "SFMono-Regular", Menlo, Consolas, monospace;
  color: var(--accent-strong);
  margin: 0.35rem 0 0.6rem;
}
html[data-ui="modern"] button {
  padding: 0.45rem 0.86rem;
  border-radius: 999px;
  -webkit-tap-highlight-color: transparent;
}
html[data-ui="modern"] #timer-start,
html[data-ui="modern"] #soundscape-toggle,
html[data-ui="modern"] #import-button,
html[data-ui="modern"] #beck-next,
html[data-ui="modern"] #task-form button {
  background: var(--accent);
  border-color: var(--accent-strong);
  color: var(--on-accent);
  font-weight: 600;
}
html[data-ui="modern"] #soundscape-toggle[aria-pressed="true"] {
  background: var(--accent-strong);
}
html[data-ui="modern"] #beck-prev,
html[data-ui="modern"] #timer-stop,
html[data-ui="modern"] #timer-reset,
html[data-ui="modern"] .beck-step-link,
html[data-ui="modern"] .mood-button,
html[data-ui="modern"] .chip {
  background: var(--field-bg);
  border-color: var(--border);
}
html[data-ui="modern"] input[type="text"],
html[data-ui="modern"] input[type="date"],
html[data-ui="modern"] input[type="time"],
html[data-ui="modern"] textarea,
html[data-ui="modern"] select {
  padding: 0.56rem 0.68rem;
  box-shadow: inset 0 1px 0 rgba(127, 157, 220, 0.14);
}
html[data-ui="modern"] input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  height: 10px;
  background: var(--track);
  border: 0;
  border-radius: 999px;
  padding: 0;
}
html[data-ui="modern"] input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  border: 2px solid var(--on-accent);
  background: var(--accent);
}
html[data-ui="modern"] input[type="range"]::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  border: 2px solid var(--on-accent);
  background: var(--accent);
}
html[data-ui="modern"] input[type="range"]::-moz-range-track {
  height: 10px;
  background: var(--track);
  border-radius: 999px;
}
html[data-ui="modern"] .task-link {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.35rem 0.72rem;
  text-decoration: none;
  background: var(--field-bg);
  box-shadow: var(--control-shadow);
}
html[data-ui="modern"] .task-link.done {
  background: var(--accent);
  border-color: var(--accent-strong);
  color: var(--on-accent);
}
html[data-ui="modern"] .mood-button.active,
html[data-ui="modern"] .chip.active,
html[data-ui="modern"] .beck-step-link.active {
  background: var(--accent);
  border-color: var(--accent-strong);
  color: var(--on-accent);
}
html[data-ui="modern"] button:active,
html[data-ui="modern"] .task-link:active,
html[data-ui="modern"] .menu a:active,
html[data-ui="modern"] .sidebar-actions a:active,
html[data-ui="modern"] .day-select:active,
html[data-ui="modern"] .mood-button:active,
html[data-ui="modern"] .chip:active,
html[data-ui="modern"] .beck-step-link:active {
  transform: translateY(1px) scale(0.99);
  filter: brightness(0.95);
}
html[data-ui="modern"] .day-number {
  color: var(--accent-strong);
}
html[data-ui="modern"] .today-cell {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}
html[data-ui="modern"] .selected-day-cell {
  outline: 2px dashed var(--accent-strong);
  outline-offset: -2px;
}
html[data-ui="modern"] .week-table th,
html[data-ui="modern"] .week-table td,
html[data-ui="modern"] #calendar-table th,
html[data-ui="modern"] #calendar-table td,
html[data-ui="modern"] #goal-notes-table th,
html[data-ui="modern"] #goal-notes-table td {
  border-color: var(--border);
}
html[data-ui="modern"] .beck-step-content {
  background: var(--section-bg);
}
html[data-ui="modern"] .message {
  color: var(--muted-text);
}

@media (min-width: 1120px) {
  .app-shell { display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 0.9rem; align-items: start; }
  .sidebar { position: sticky; top: 0.35rem; }
  .menu { flex-direction: column; align-items: flex-start; }
  main {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    grid-template-areas:
      "timer timer timer timer timer timer"
      "tasks tasks tasks tasks soundscape soundscape"
      "calendar calendar calendar jardin jardin jardin"
      "beck beck beck beck beck beck"
      "data data data data data data";
    gap: 0.85rem;
  }
  #timer { grid-area: timer; }
  #tasks { grid-area: tasks; }
  #soundscape { grid-area: soundscape; }
  #calendar { grid-area: calendar; }
  #jardin { grid-area: jardin; }
  #beck { grid-area: beck; }
  #data { grid-area: data; }
  .jardin-grid { grid-template-columns: 1fr 1fr; }
  .beck-layout { grid-template-columns: 180px minmax(0, 1fr); }
  .beck-steps { flex-direction: column; align-items: stretch; }
}
@media (max-width: 760px) {
  body { padding: 0.45rem; width: 100%; }
  section { padding: 0.52rem; }
  h1 { font-size: 1.1rem; }
  h2 { font-size: 0.96rem; }
  h3 { font-size: 0.88rem; }
  .menu { flex-direction: column; align-items: flex-start; gap: 0.35rem; }
  .controls { flex-direction: column; align-items: stretch; }
  .top-controls { flex-direction: row; align-items: center; }
  .sidebar-date-controls { grid-template-columns: 2.35rem minmax(0, 1fr) 2.35rem; }
  .timer-countdown-controls input[type="range"] {
    width: 100%;
    flex: 1 1 auto;
  }
  .week-table, #calendar-table, #goal-notes-table { display: block; overflow-x: auto; }
  .task-item-row {
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
  }
  .task-repeat-meta,
  .task-item-row > .task-link.tiny {
    justify-self: start;
  }
  html[data-ui="modern"] body { font-size: 14px; }
  html[data-ui="modern"] .sidebar { padding: 0.58rem; }
  html[data-ui="modern"] section { border-radius: 18px; }
}
