:root {
  color-scheme: light;
  --bg: #f7f8f6;
  --surface: #ffffff;
  --surface-warm: #fbfdfb;
  --surface-soft: #f3f8f1;
  --text: #061120;
  --muted: #657184;
  --border: #cfd5dd;
  --border-soft: rgba(6, 17, 32, 0.18);
  --green: #129a49;
  --green-2: #42c96b;
  --green-soft: #e9f7ed;
  --logo-green-dark: #087f3c;
  --logo-green-mid: #129a49;
  --logo-green-bright: #2fae4f;
  --orange: #ff9f0a;
  --red: #ff3b30;
  --shadow: 0 20px 60px rgba(20, 30, 50, 0.08);
  --shadow-soft: 0 14px 38px rgba(20, 30, 50, 0.055);
  --radius-shell: 32px;
  --radius-card: 28px;
  --radius-md: 18px;
  --radius-sm: 13px;
  --timer-size: clamp(250px, 24vw, 288px);
  font-family:
    "Inter", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #03070d;
  --surface: #080d14;
  --surface-warm: #0b1119;
  --surface-soft: #0d1712;
  --text: #f8fafc;
  --muted: #a0a8b5;
  --border: #202833;
  --border-soft: rgba(240, 246, 252, 0.1);
  --green: #63d94f;
  --green-2: #8be46a;
  --green-soft: rgba(96, 207, 77, 0.16);
  --logo-green-dark: #0a4f28;
  --logo-green-mid: #2f9f43;
  --logo-green-bright: #3abf55;
  --orange: #f5b21b;
  --red: #ff453a;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.34);
  --shadow-soft: 0 16px 42px rgba(0, 0, 0, 0.28);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 8% 0%, rgba(18, 154, 73, 0.08), transparent 34rem),
    radial-gradient(circle at 96% 12%, rgba(66, 201, 107, 0.05), transparent 28rem),
    var(--bg);
  color: var(--text);
  letter-spacing: 0;
  font-weight: 400;
}

body.has-feedback-modal {
  overflow: hidden;
}

body.has-feedback-modal::before {
  position: fixed;
  z-index: 70;
  inset: 0;
  background: rgba(6, 17, 32, 0.18);
  backdrop-filter: blur(10px);
  content: "";
}

button,
input,
textarea {
  font: inherit;
}

button {
  color: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

.app-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  width: min(1500px, calc(100% - 32px));
  min-height: calc(100vh - 32px);
  margin: 16px auto;
  overflow: hidden;
  border: 1.2px solid rgba(6, 17, 32, 0.16);
  border-radius: var(--radius-shell);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.sidebar {
  position: sticky;
  top: 16px;
  align-self: stretch;
  display: flex;
  min-height: calc(100vh - 32px);
  flex-direction: column;
  gap: 28px;
  justify-content: flex-start;
  overflow: visible;
  padding: 38px 28px 28px;
  border-right: 1.2px solid rgba(6, 17, 32, 0.16);
  background: linear-gradient(180deg, var(--surface) 0%, var(--surface-warm) 100%);
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  font-weight: 400;
  line-height: 0.96;
}

.brand.compact {
  justify-self: center;
  gap: 10px;
}

.brand-mark {
  position: relative;
  display: grid;
  width: 62px;
  height: 62px;
  flex: 0 0 62px;
  place-items: center;
  padding: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--green);
  filter: drop-shadow(0 12px 18px rgba(18, 154, 73, 0.12));
}

.brand.compact .brand-mark {
  width: 46px;
  height: 46px;
  flex-basis: 46px;
}

.brand-mark img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

[data-theme="dark"] .brand-mark {
  filter: drop-shadow(0 10px 18px rgba(99, 217, 79, 0.16));
}

.brand-text {
  max-width: 152px;
  font-size: 26px;
  font-weight: 400;
  letter-spacing: 0;
}

.brand.compact .brand-text {
  max-width: 122px;
  font-size: 18px;
  font-weight: 400;
}

.brand-text strong {
  display: block;
  color: var(--green);
  font-weight: 400;
}

.side-nav {
  display: grid;
  gap: 18px;
  margin-top: 10px;
}

.nav-item,
.bottom-item {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--text);
  font-weight: 400;
}

.nav-item {
  min-height: 56px;
  padding: 0 20px;
  border-radius: 14px;
}

.nav-item.is-active {
  background: linear-gradient(90deg, var(--green-soft), rgba(233, 247, 237, 0.42));
  color: var(--green);
}

.icon {
  display: inline-flex;
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  align-items: center;
  justify-content: center;
}

.icon svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.85;
}

.sidebar-cards {
  display: grid;
  gap: 18px;
  margin-top: auto;
  margin-bottom: 0;
}

.quote-card,
.mini-card,
.timer-card,
.sessions-card,
.feedback-card,
.panel,
.stat-card {
  border: 1.2px solid var(--border-soft);
  border-radius: var(--radius-card);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.quote-card {
  margin: 0;
  padding: 24px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--surface-soft), var(--surface));
}

.quote-card > span {
  display: block;
  height: 27px;
  color: #9aa3ad;
  font-size: 46px;
  font-weight: 400;
  line-height: 0.8;
}

.quote-card p {
  margin: 14px 0 18px;
  font-size: 17px;
  font-weight: 400;
  line-height: 1.42;
}

.quote-card cite {
  color: var(--muted);
  font-style: normal;
}

.mini-card {
  position: relative;
  min-height: 178px;
  padding: 24px;
  overflow: hidden;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #f7fbf5, var(--surface));
}

[data-theme="dark"] .mini-card {
  background: linear-gradient(135deg, rgba(96, 207, 77, 0.08), var(--surface));
}

.mini-card p {
  max-width: 178px;
  margin: 0 0 20px;
  font-weight: 400;
  line-height: 1.45;
}

.mini-card span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  line-height: 1.25;
  white-space: nowrap;
}

.mini-card strong {
  display: inline-block;
  font-size: 44px;
  line-height: 1;
}

.sparkline {
  position: absolute;
  right: 22px;
  bottom: 26px;
  width: 124px;
  height: 44px;
}

.sparkline path {
  fill: none;
  stroke: var(--green);
  stroke-linecap: round;
  stroke-width: 4;
}

.main-content {
  min-width: 0;
  padding: 36px 38px 26px;
  background: var(--surface);
}

.mobile-header,
.bottom-nav,
.view {
  display: none;
}

.view.is-visible {
  display: block;
}

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

.heading-block {
  min-width: 0;
}

h1,
h2,
p {
  margin-top: 0;
}

strong,
b {
  font-weight: 400;
}

h1 {
  margin-bottom: 8px;
  font-size: clamp(28px, 3.1vw, 36px);
  font-weight: 700;
  line-height: 1.04;
  letter-spacing: 0;
}

h2,
.summary-card h2,
.sessions-card h2,
.feedback-card h2,
.chart-panel h2,
.page-head h1 {
  font-weight: 700;
}

.page-head {
  align-items: flex-end;
}

.topbar p,
.page-head p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 18px;
}

.top-actions,
.mobile-actions {
  display: flex;
  align-items: center;
  gap: 18px;
}

.segmented {
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  width: 116px;
  height: 54px;
  align-items: center;
  padding: 5px;
  border: 1.2px solid rgba(6, 17, 32, 0.18);
  border-radius: 17px;
  background: rgba(245, 247, 249, 0.88);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.8),
    0 10px 24px rgba(20, 30, 50, 0.06);
  cursor: pointer;
  backdrop-filter: blur(14px);
}

[data-theme="dark"] .segmented {
  border-color: rgba(255, 255, 255, 0.09);
  background: rgba(18, 25, 34, 0.88);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 12px 28px rgba(0, 0, 0, 0.28);
}

.segmented.mini {
  width: 72px;
  height: 38px;
  padding: 3px;
  border-radius: 13px;
  box-shadow: none;
}

.sun,
.moon {
  position: relative;
  display: grid;
  height: 100%;
  place-items: center;
  border-radius: 12px;
  color: var(--muted);
  transition:
    background 0.2s ease,
    color 0.2s ease,
    box-shadow 0.2s ease;
}

.sun::before {
  width: 15px;
  height: 15px;
  border: 1.8px solid currentColor;
  border-radius: 999px;
  content: "";
}

.sun::after {
  position: absolute;
  width: 23px;
  height: 23px;
  border-radius: 999px;
  background:
    linear-gradient(currentColor, currentColor) center top / 1.6px 4px no-repeat,
    linear-gradient(currentColor, currentColor) center bottom / 1.6px 4px no-repeat,
    linear-gradient(90deg, currentColor, currentColor) left center / 4px 1.6px no-repeat,
    linear-gradient(90deg, currentColor, currentColor) right center / 4px 1.6px no-repeat;
  content: "";
}

[data-theme="light"] .moon {
  color: #061120;
}

.moon svg {
  width: 22px;
  height: 22px;
  display: block;
}

[data-theme="light"] .sun,
[data-theme="dark"] .moon {
  background: var(--surface);
  color: var(--text);
  box-shadow:
    0 8px 18px rgba(20, 30, 50, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.streak {
  display: grid;
  min-width: 112px;
  height: 58px;
  grid-template-columns: 24px 24px;
  align-content: center;
  align-items: center;
  justify-content: center;
  column-gap: 8px;
  border: 1.2px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.streak .flame {
  grid-row: span 2;
}

.streak strong {
  font-size: 20px;
  font-weight: 700;
  line-height: 1;
  justify-self: center;
  text-align: center;
  transform: none;
}

.streak span:last-child {
  margin-top: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1;
  justify-self: center;
  text-align: center;
}

.mini-streak {
  display: flex;
  min-width: 56px;
  height: 38px;
  gap: 7px;
  box-shadow: none;
}

.mini-streak strong {
  font-size: 14px;
}

.flame {
  position: relative;
  width: 18px;
  height: 24px;
  border-radius: 65% 35% 58% 42%;
  background: linear-gradient(160deg, #ffcf54 0%, var(--orange) 42%, #ff5a3d 100%);
  box-shadow:
    inset -3px -5px 8px rgba(142, 43, 0, 0.22),
    0 8px 18px rgba(255, 159, 10, 0.2);
  transform: rotate(8deg);
}

.flame::after {
  position: absolute;
  left: 6px;
  bottom: 4px;
  width: 7px;
  height: 11px;
  border-radius: 70% 30% 55% 45%;
  background: linear-gradient(180deg, #fff3a6, #ffb21d);
  content: "";
}

.flame::before {
  position: absolute;
  top: -3px;
  right: 3px;
  width: 8px;
  height: 12px;
  border-radius: 65% 35% 55% 45%;
  background: linear-gradient(160deg, #ffdf78, var(--orange));
  content: "";
  transform: rotate(20deg);
}

.focus-grid {
  display: grid;
  grid-template-columns: minmax(560px, 1fr) 280px;
  gap: 24px;
}

.timer-card {
  position: relative;
  display: grid;
  grid-template-areas:
    "task task"
    "timer preset"
    "tip tip";
  grid-template-columns: minmax(320px, 1fr) minmax(260px, 300px);
  column-gap: 34px;
  row-gap: 8px;
  align-items: start;
  align-content: start;
  min-height: 462px;
  padding: 26px;
  overflow: visible;
}

.task-group,
.preset-row {
  display: grid;
  gap: 12px;
}

.task-group {
  grid-area: task;
  margin-bottom: 8px;
}

.preset-row {
  grid-area: preset;
  position: relative;
  z-index: 4;
  width: 100%;
  align-self: start;
  justify-self: end;
  padding-top: 0;
  margin-top: 14px;
}

label,
legend {
  color: var(--text);
  font-size: 15px;
  font-weight: 400;
}

input,
textarea,
.preset-button {
  width: 100%;
  border: 1.2px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  outline: none;
}

input,
textarea {
  padding: 0 18px;
}

input {
  min-height: 58px;
}

input::placeholder,
textarea::placeholder {
  color: #7b8494;
}

input:focus,
textarea:focus,
.preset-button:focus-visible {
  border-color: color-mix(in srgb, var(--green) 70%, var(--border));
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--green) 15%, transparent);
}

textarea {
  min-height: 98px;
  padding: 16px;
  resize: vertical;
}

.select-wrap {
  position: relative;
}

.preset-button {
  display: flex;
  min-height: 54px;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  font-size: 17px;
  cursor: pointer;
}

.preset-menu {
  position: absolute;
  z-index: 20;
  top: calc(100% + 8px);
  left: 0;
  display: none;
  width: min(292px, calc(100vw - 48px));
  max-height: 238px;
  overflow-x: hidden;
  overflow-y: auto;
  border: 1.2px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: 0 18px 40px rgba(20, 30, 50, 0.12);
}

.preset-menu.is-open {
  display: block;
}

.preset-menu::-webkit-scrollbar {
  width: 8px;
}

.preset-menu::-webkit-scrollbar-track {
  background: transparent;
}

.preset-menu::-webkit-scrollbar-thumb {
  border: 2px solid var(--surface);
  border-radius: 999px;
  background: color-mix(in srgb, var(--logo-green-mid) 42%, var(--border));
}

.preset-menu {
  scrollbar-color: color-mix(in srgb, var(--logo-green-mid) 42%, var(--border)) transparent;
  scrollbar-width: thin;
}

.preset-option {
  display: grid;
  gap: 5px;
  width: 100%;
  padding: 15px 16px;
  border: 0;
  border-bottom: 1px solid var(--border);
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.preset-option:last-child {
  border-bottom: 0;
}

.preset-option strong {
  color: var(--text);
  font-size: 14px;
  font-weight: 400;
}

.preset-option span {
  color: var(--muted);
  font-size: 12px;
}

.preset-option.is-selected strong {
  color: var(--green);
}

.timer-layout {
  grid-area: timer;
  position: static;
  display: grid;
  width: 100%;
  justify-items: center;
  align-self: start;
  margin-top: -12px;
  pointer-events: auto;
}

.timer-ring {
  position: relative;
  width: var(--timer-size);
  max-width: 100%;
  aspect-ratio: 1;
  pointer-events: auto;
}

.timer-ring svg,
.summary-ring svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.timer-ring circle,
.summary-ring circle {
  fill: none;
  stroke-linecap: round;
}

.track {
  stroke: color-mix(in srgb, var(--border) 84%, transparent);
}

.timer-ring .track,
.timer-ring .progress {
  stroke-width: 15;
}

.progress {
  stroke: var(--green);
  transition: stroke-dashoffset 0.4s ease;
}

.timer-ring .progress {
  stroke: url("#timerProgressGradient");
}

.timer-face {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  text-align: center;
}

.timer-face strong {
  display: block;
  font-size: clamp(46px, 5vw, 62px);
  font-weight: 400;
  line-height: 1;
  letter-spacing: 0;
}

.timer-face span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 12px;
  color: var(--green);
  font-size: 18px;
  font-weight: 400;
  cursor: pointer;
  touch-action: manipulation;
  user-select: none;
}

.play-mini {
  width: 0;
  height: 0;
  border-top: 7px solid transparent;
  border-bottom: 7px solid transparent;
  border-left: 11px solid currentColor;
}

.pause-mini {
  position: relative;
  display: inline-block;
  width: 12px;
  height: 14px;
}

.pause-mini::before,
.pause-mini::after {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 4px;
  border-radius: 999px;
  background: currentColor;
  content: "";
}

.pause-mini::before {
  left: 0;
}

.pause-mini::after {
  right: 0;
}

.timer-controls {
  display: grid;
  grid-template-columns: repeat(3, 66px);
  width: min(360px, 100%);
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 4px;
  pointer-events: auto;
}

.round-action,
.icon-button {
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--border-soft);
  background: var(--surface);
  cursor: pointer;
}

.round-action {
  width: 66px;
  gap: 5px;
  border: 0;
  background: transparent;
  color: var(--muted);
}

.round-action .icon,
.icon-button {
  width: 38px;
  height: 38px;
  border-radius: 999px;
}

.round-action .icon {
  border: 1.2px solid var(--border);
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 8px 20px rgba(20, 30, 50, 0.05);
}

.round-action span:last-child {
  font-size: 11px;
  font-weight: 400;
}

.primary-play {
  display: grid;
  width: 48px;
  height: 48px;
  justify-self: center;
  place-items: center;
  border: 0;
  border-radius: 999px;
  background:
    radial-gradient(circle at 32% 22%, rgba(96, 207, 77, 0.42), transparent 30%),
    linear-gradient(145deg, var(--logo-green-bright) 0%, var(--logo-green-mid) 46%, var(--logo-green-dark) 100%);
  color: #ffffff;
  box-shadow: 0 16px 28px rgba(18, 154, 73, 0.24);
  cursor: pointer;
  touch-action: manipulation;
  user-select: none;
}

.primary-play .icon,
.primary-play > svg {
  width: 23px;
  height: 23px;
}

.primary-play > svg {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.4;
}

.tip {
  grid-area: tip;
  position: static;
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 0 0;
  padding: 11px 14px;
  border-radius: 14px;
  background: linear-gradient(90deg, #ecf8ef, #f8fcf8);
  color: #047037;
  font-size: 13px;
  font-weight: 400;
}

[data-theme="dark"] .tip {
  background: linear-gradient(90deg, rgba(96, 207, 77, 0.14), rgba(96, 207, 77, 0.05));
  color: var(--green-2);
}

.right-stack {
  display: grid;
  gap: 18px;
}

.summary-card {
  min-height: 292px;
  padding: 24px;
  border: 1.2px solid var(--border-soft);
  border-radius: var(--radius-card);
  background:
    radial-gradient(circle at 88% 14%, rgba(47, 174, 79, 0.12), transparent 34%),
    linear-gradient(90deg, var(--green-soft), rgba(233, 247, 237, 0.42));
  color: var(--text);
}

[data-theme="light"] .summary-card {
  color: var(--green);
}

[data-theme="dark"] .summary-card {
  background:
    radial-gradient(circle at 88% 14%, rgba(58, 191, 85, 0.13), transparent 34%),
    linear-gradient(90deg, var(--green-soft), rgba(96, 207, 77, 0.05));
}

.card-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.summary-action {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: currentColor;
  cursor: pointer;
  touch-action: manipulation;
}

.summary-action:hover {
  background: rgba(18, 154, 73, 0.1);
}

.summary-action .icon {
  width: 20px;
  height: 20px;
}

.summary-card h2,
.sessions-card h2,
.feedback-card h2,
.chart-panel h2 {
  font-size: 20px;
  letter-spacing: 0;
}

.summary-card h2 {
  margin-bottom: 0;
  line-height: 32px;
}

.sessions-card h2,
.feedback-card h2,
.chart-panel h2 {
  margin-bottom: 16px;
}

.summary-ring {
  position: relative;
  width: 138px;
  height: 138px;
  margin: 26px auto 18px;
}

.summary-ring .track {
  stroke: color-mix(in srgb, var(--border) 78%, transparent);
}

.summary-ring .progress {
  stroke: url("#summaryProgressGradient");
}

[data-theme="dark"] .summary-ring .progress {
  stroke: url("#summaryProgressGradient");
}

.summary-ring circle {
  stroke-width: 10;
}

.summary-ring strong,
.summary-ring span {
  position: absolute;
  right: 0;
  left: 0;
  text-align: center;
}

.summary-ring strong {
  top: 42px;
  font-size: 34px;
  font-weight: 400;
}

.summary-ring span {
  top: 80px;
  font-weight: 400;
}

.summary-card p {
  display: grid;
  gap: 6px;
  margin-bottom: 0;
  text-align: center;
}

.summary-card p span,
.summary-ring span {
  color: var(--muted);
}

.summary-card p strong {
  font-size: 16px;
  font-weight: 400;
}

.sessions-card {
  min-height: 326px;
  padding: 22px;
}

.sessions-list {
  display: grid;
  min-height: 130px;
}

.sessions-card.is-empty .sessions-list {
  min-height: 104px;
}

.sessions-card.has-sessions .sessions-list {
  min-height: 172px;
}

.session-row {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 11px 0;
  border-bottom: 1px solid var(--border-soft);
}

.session-row:last-child {
  border-bottom: 0;
}

.dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--green);
}

.dot.medium {
  background: var(--orange);
}

.dot.low {
  background: var(--red);
}

.session-main {
  min-width: 0;
}

.session-main strong,
.session-main span {
  display: block;
}

.session-main strong {
  overflow: hidden;
  font-size: 14px;
  font-weight: 400;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.session-main span,
.session-meta {
  color: var(--muted);
  font-size: 13px;
}

.session-meta {
  display: grid;
  gap: 6px;
  justify-items: end;
}

.pill {
  display: inline-flex;
  min-width: 46px;
  justify-content: center;
  padding: 5px 10px;
  border-radius: 999px;
  background: #e4f6e8;
  color: #137d3c;
  font-size: 12px;
  font-weight: 400;
}

.pill.medium {
  background: #fff3d8;
  color: #d98200;
}

.pill.low {
  background: color-mix(in srgb, var(--red) 13%, var(--surface));
  color: var(--red);
}

.link-button {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  margin-top: 2px;
  padding: 0 0 6px;
  border: 0;
  background: transparent;
  color: var(--green);
  font-weight: 400;
  cursor: pointer;
}

.sessions-card.has-sessions .link-button {
  margin-top: 14px;
}

.empty-state {
  display: grid;
  min-height: 118px;
  place-items: center;
  color: var(--muted);
  text-align: center;
}

.feedback-card {
  margin-top: 18px;
  padding: 24px;
}

.feedback-card.is-active {
  position: fixed;
  z-index: 80;
  top: 50%;
  left: 50%;
  width: min(1000px, calc(100vw - 40px));
  max-height: calc(100vh - 40px);
  margin: 0;
  overflow-y: auto;
  padding: 28px;
  transform: translate(-50%, -50%);
  box-shadow: 0 30px 90px rgba(20, 30, 50, 0.18);
}

.feedback-card:not(.is-active) {
  display: none;
}

.feedback-close {
  position: absolute;
  top: 18px;
  right: 18px;
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  color: var(--muted);
  cursor: pointer;
}

.feedback-close:hover {
  color: var(--text);
  background: var(--surface-soft);
}

.feedback-close .icon {
  width: 18px;
  height: 18px;
}

.feedback-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-right: 44px;
  margin-bottom: 22px;
}

.feedback-head p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.feedback-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr 1.2fr;
  gap: 32px;
  align-items: start;
}

fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

legend,
.note-label {
  display: block;
  margin-bottom: 14px;
  text-align: center;
}

.choice-row {
  display: flex;
  justify-content: center;
  gap: 12px;
}

.choice,
.mood {
  min-width: 76px;
  min-height: 78px;
  border: 1.2px solid transparent;
  border-radius: 13px;
  background: var(--surface);
  cursor: pointer;
  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    transform 0.18s ease;
}

.choice {
  display: grid;
  place-items: center;
  gap: 7px;
  padding: 11px 10px 10px;
  font-weight: 400;
}

.choice .icon {
  width: 30px;
  height: 30px;
}

.choice .icon svg {
  stroke-width: 2.25;
}

.choice span:last-child {
  font-size: 13px;
  line-height: 1;
}

.choice.success {
  color: var(--green);
  background: linear-gradient(180deg, #f4fbf6, #eef8f1);
}

.choice.warn {
  color: var(--orange);
  background: linear-gradient(180deg, #fffaf0, #fff4df);
}

.choice.danger {
  color: var(--red);
  background: linear-gradient(180deg, #fff6f4, #fff0ee);
}

[data-theme="dark"] .choice.success,
[data-theme="dark"] .choice.warn,
[data-theme="dark"] .choice.danger {
  background: var(--surface-soft);
}

.choice.is-selected,
.mood.is-selected {
  border-color: currentColor;
  box-shadow: 0 0 0 4px color-mix(in srgb, currentColor 14%, transparent);
}

.choice:hover,
.mood:hover {
  transform: translateY(-1px);
}

.mood {
  position: relative;
  display: grid;
  width: 58px;
  min-width: 58px;
  height: 58px;
  min-height: 58px;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
}

.mood.success {
  color: var(--green);
}

.mood.warn {
  color: var(--orange);
}

.mood.danger {
  color: var(--red);
}

.mood-face {
  position: relative;
  display: block;
  width: 42px;
  height: 42px;
  border: 3.2px solid currentColor;
  border-radius: 999px;
  background:
    radial-gradient(circle at 33% 38%, currentColor 0 2.3px, transparent 2.6px),
    radial-gradient(circle at 67% 38%, currentColor 0 2.3px, transparent 2.6px);
}

.mood-face::after {
  position: absolute;
  right: 10px;
  bottom: 9px;
  left: 10px;
  height: 8px;
  border-bottom: 3.2px solid currentColor;
  border-radius: 0 0 999px 999px;
  content: "";
}

.mood.warn .mood-face::after {
  right: 11px;
  bottom: 13px;
  left: 11px;
  height: 0;
  border-bottom-width: 3px;
  border-radius: 999px;
}

.mood.danger .mood-face::after {
  top: 28px;
  bottom: auto;
  border-top: 3.2px solid currentColor;
  border-bottom: 0;
  border-radius: 999px 999px 0 0;
}

.mood-labels {
  display: grid;
  width: 208px;
  grid-template-columns: repeat(3, 1fr);
  justify-content: space-between;
  margin: 8px auto 0;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  text-align: center;
}

.note-label {
  text-align: left;
  grid-column: 3;
  grid-row: 1;
}

.feedback-grid textarea {
  grid-column: 3;
  grid-row: 1;
  align-self: start;
  margin-top: 32px;
}

.save-feedback {
  display: none;
  margin-top: 18px;
  padding: 14px 18px;
  border: 0;
  border-radius: 14px;
  background: var(--green);
  color: #ffffff;
  font-weight: 400;
  cursor: pointer;
}

.feedback-card.is-active .save-feedback {
  display: inline-flex;
}

.panel {
  padding: 24px;
}

.history-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}

.filter-button {
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
}

.filter-button.is-active {
  border-color: transparent;
  background: var(--green-soft);
  color: var(--green);
  font-weight: 400;
}

.filter-button.tone-high {
  border-color: color-mix(in srgb, var(--green) 24%, transparent);
  color: var(--green);
}

.filter-button.tone-high.is-active {
  background: #eef8f1;
  color: var(--green);
}

.filter-button.tone-medium {
  border-color: color-mix(in srgb, var(--orange) 28%, transparent);
  color: var(--orange);
}

.filter-button.tone-medium.is-active {
  background: #fff8e9;
  color: var(--orange);
}

.filter-button.tone-low {
  border-color: color-mix(in srgb, var(--red) 24%, transparent);
  color: var(--red);
}

.filter-button.tone-low.is-active {
  background: #fff1ef;
  color: var(--red);
}

[data-theme="dark"] .filter-button.tone-high.is-active,
[data-theme="dark"] .filter-button.tone-medium.is-active,
[data-theme="dark"] .filter-button.tone-low.is-active {
  background: var(--surface-soft);
}

.history-list {
  display: grid;
}

.history-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border-soft);
}

.history-item:last-child {
  border-bottom: 0;
}

.history-item p {
  margin: 6px 0 0;
  color: var(--muted);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.stat-card {
  padding: 22px;
}

.stat-card span {
  display: block;
  color: var(--muted);
  font-weight: 400;
}

.stat-card strong {
  display: block;
  margin-top: 14px;
  font-size: 42px;
  font-weight: 400;
}

.bar-chart {
  display: grid;
  height: 260px;
  grid-template-columns: repeat(auto-fit, minmax(58px, 1fr));
  align-items: stretch;
  gap: 14px;
}

.bar {
  display: grid;
  height: 100%;
  grid-template-rows: 1fr auto auto;
  align-items: end;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.bar-fill {
  display: block;
  width: min(42px, 72%);
  height: var(--bar-height, 8%);
  min-height: 12px;
  justify-self: center;
  border-radius: 999px 999px 4px 4px;
  background:
    radial-gradient(circle at 45% 12%, rgba(96, 207, 77, 0.36), transparent 28%),
    linear-gradient(180deg, var(--logo-green-bright), var(--logo-green-mid) 46%, var(--logo-green-dark));
  box-shadow: 0 14px 24px rgba(18, 154, 73, 0.18);
}

.daily-bar strong {
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
}

.daily-bar span:last-child {
  color: var(--muted);
}

.settings-panel {
  display: grid;
  max-width: 560px;
  gap: 18px;
}

.settings-disclaimer {
  max-width: 560px;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.privacy-card {
  max-width: 640px;
  margin-top: 20px;
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: 22px;
  background: color-mix(in srgb, var(--surface) 94%, var(--green-soft));
  box-shadow: var(--shadow-card);
}

.privacy-card h2 {
  margin: 0 0 14px;
  color: var(--text);
  font-size: 18px;
  font-weight: 700;
}

.privacy-card p {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.privacy-card small {
  display: block;
  margin-top: 14px;
  color: var(--muted);
  font-size: 12px;
}

.settings-panel label,
.modal label {
  display: grid;
  gap: 10px;
}

.toggle-row {
  grid-template-columns: 1fr auto;
  align-items: center;
}

.toggle-row input[type="checkbox"] {
  position: relative;
  display: inline-block;
  width: 46px;
  min-width: 46px;
  height: 28px;
  min-height: 28px;
  margin: 0;
  padding: 0;
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  background: color-mix(in srgb, var(--muted) 18%, var(--surface));
  cursor: pointer;
  inline-size: 46px;
  block-size: 28px;
  transition:
    background 0.18s ease,
    border-color 0.18s ease;
}

.toggle-row input[type="checkbox"]::before {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: var(--surface);
  box-shadow: 0 4px 12px rgba(20, 30, 50, 0.18);
  content: "";
  transition: transform 0.18s ease;
}

.toggle-row input[type="checkbox"]:checked {
  border-color: transparent;
  background: var(--green);
}

.toggle-row input[type="checkbox"]:checked::before {
  transform: translateX(18px);
}

.modal-backdrop {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(2, 6, 12, 0.55);
}

.modal {
  display: grid;
  width: min(430px, 100%);
  gap: 18px;
  padding: 22px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-head h2 {
  margin: 0;
}

body.is-focus-mode {
  background: var(--surface);
}

body.is-focus-mode .app-shell {
  display: block;
  width: 100%;
  min-height: 100vh;
  margin: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

body.is-focus-mode .sidebar,
body.is-focus-mode .right-stack,
body.is-focus-mode .mobile-header,
body.is-focus-mode .bottom-nav,
body.is-focus-mode .task-group,
body.is-focus-mode .preset-row,
body.is-focus-mode .tip,
body.is-focus-mode .top-actions {
  display: none;
}

body.is-focus-mode .bottom-nav,
body.is-focus-mode .bottom-nav * {
  pointer-events: none;
}

body.is-focus-mode .main-content {
  position: relative;
  display: grid;
  min-height: 100vh;
  padding: 36px;
  place-items: center;
  background:
    radial-gradient(circle at 50% 42%, rgba(18, 154, 73, 0.08), transparent 30rem),
    var(--surface);
}

body.is-focus-mode .main-content::before {
  position: fixed;
  top: 30px;
  left: 36px;
  width: 46px;
  height: 46px;
  background: url("assets/logo-concentrado-symbol.png") center / contain no-repeat;
  opacity: 0.24;
  content: "";
}

body.is-focus-mode .main-content::after {
  position: fixed;
  top: 38px;
  left: 92px;
  color: var(--text);
  content: "Concentrado App";
  font-size: 18px;
  font-weight: 500;
  line-height: 1;
  opacity: 0.22;
}

body.is-focus-mode .topbar {
  display: none;
}

body.is-focus-mode .focus-grid {
  width: min(760px, 100%);
  grid-template-columns: 1fr;
}

body.is-focus-mode .timer-card {
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

body.is-focus-mode .timer-layout {
  position: relative;
  z-index: 5;
  margin-top: 0;
}

body.is-focus-mode .timer-ring {
  width: min(58vh, 520px);
}

body.is-focus-mode .timer-ring .track {
  stroke: color-mix(in srgb, var(--border) 62%, transparent);
}

body.is-focus-mode .timer-face strong {
  font-size: clamp(68px, 9vw, 96px);
}

body.is-focus-mode .timer-face span {
  font-size: 20px;
}

body.is-focus-mode .timer-controls {
  margin-top: 24px;
}

[hidden] {
  display: none !important;
}

@media (max-width: 1180px) {
  .app-shell {
    grid-template-columns: 250px minmax(0, 1fr);
  }

  .sidebar {
    padding: 30px 22px;
  }

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

  .timer-card {
    min-height: 452px;
  }

  .timer-layout {
    width: 100%;
  }

  .right-stack {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  .summary-card,
  .sessions-card {
    min-height: 250px;
  }

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

  .note-label,
  .feedback-grid textarea {
    grid-column: 1 / -1;
  }
}

@media (max-width: 820px) {
  :root {
    --timer-size: min(70vw, 270px);
  }

  body {
    background: var(--bg);
  }

  .app-shell {
    display: block;
    width: 100%;
    min-height: 100vh;
    margin: 0;
    overflow: visible;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .sidebar {
    position: fixed;
    z-index: 60;
    inset: 0 auto 0 0;
    width: min(310px, 82vw);
    height: 100vh;
    min-height: 100vh;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
  }

  .sidebar.is-open {
    transform: translateX(0);
  }

  .main-content {
    padding: 104px 16px 92px;
    background: var(--bg);
  }

  .mobile-header {
    position: fixed;
    z-index: 50;
    top: 0;
    right: 0;
    left: 0;
    display: grid;
    min-height: 82px;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    column-gap: 4px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-soft);
    background: color-mix(in srgb, var(--surface) 94%, transparent);
    backdrop-filter: blur(20px);
  }

  .icon-button.ghost {
    display: none;
  }

  .mobile-actions {
    gap: 8px;
  }

  .brand.compact {
    justify-self: start;
    gap: 6px;
    margin-left: 0;
  }

  .topbar {
    display: none;
  }

  .focus-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .timer-card,
  .sessions-card,
  .feedback-card,
  .panel,
  .stat-card {
    box-shadow: none;
  }

  .timer-card {
    display: grid;
    grid-template-areas:
      "task"
      "preset"
      "timer";
    grid-template-columns: 1fr;
    row-gap: 18px;
    min-height: auto;
    padding: 0;
    border: 0;
    background: transparent;
  }

  .task-group,
  .preset-row {
    width: 100%;
    text-align: center;
  }

  .task-group {
    margin-bottom: 0;
  }

  .preset-row {
    padding-top: 0;
    margin-top: 0;
    justify-self: stretch;
  }

  input {
    min-height: 50px;
    text-align: left;
  }

  .preset-button {
    justify-content: center;
    gap: 18px;
  }

  .preset-menu {
    width: 100%;
  }

  .timer-layout {
    position: static;
    width: 100%;
    margin-top: -24px;
    pointer-events: auto;
  }

  .timer-controls {
    grid-template-columns: repeat(3, 64px);
    width: min(260px, 100%);
    align-items: start;
    gap: 8px;
    margin-top: -4px;
  }

  .round-action {
    display: grid;
    width: 64px;
    justify-items: center;
  }

  .round-action .icon {
    width: 42px;
    height: 42px;
  }

  .primary-play {
    align-self: start;
  }

  .tip {
    display: none;
  }

  .right-stack {
    grid-template-columns: 1fr;
  }

  .summary-card {
    display: grid;
    min-height: 0;
    grid-template-columns: 76px 1fr 24px;
    align-items: center;
    gap: 16px;
    padding: 14px;
    border-radius: 18px;
  }

  .summary-card .card-title {
    display: contents;
  }

  .summary-card h2 {
    display: none;
  }

  .summary-action {
    grid-column: 3;
    grid-row: 1;
  }

  .summary-ring {
    grid-column: 1;
    grid-row: 1;
    width: 72px;
    height: 72px;
    margin: 0;
  }

  .summary-ring circle {
    stroke-width: 9;
  }

  .summary-ring strong {
    top: 20px;
    font-size: 18px;
  }

  .summary-ring span {
    top: 42px;
    font-size: 10px;
  }

  .summary-card p {
    grid-column: 2;
    grid-row: 1;
    text-align: left;
  }

  .summary-card p strong {
    font-size: 14px;
  }

  .sessions-card {
    min-height: auto;
    padding: 18px 18px 22px;
    border-radius: 18px;
  }

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

  .feedback-head {
    display: block;
  }

  .choice {
    min-width: 0;
    flex: 1;
  }

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

  .stat-card strong {
    margin-top: 10px;
    font-size: 32px;
  }

  .bottom-nav {
    position: fixed;
    z-index: 50;
    right: 0;
    bottom: 0;
    left: 0;
    display: grid;
    min-height: 76px;
    grid-template-columns: repeat(4, 1fr);
    border-top: 1px solid var(--border-soft);
    background: color-mix(in srgb, var(--surface) 94%, transparent);
    backdrop-filter: blur(20px);
  }

  .bottom-item {
    display: grid;
    min-height: 76px;
    place-items: center;
    gap: 2px;
    padding: 8px 2px;
    color: var(--muted);
    font-size: 12px;
  }

  .bottom-item .icon {
    width: 28px;
    height: 28px;
  }

  .bottom-item.is-active {
    color: var(--green);
  }

  body.is-focus-mode .main-content {
    min-height: 100dvh;
    padding: 24px 18px;
    place-items: center;
  }

  body.is-focus-mode .focus-grid {
    display: grid;
    width: 100%;
    place-items: center;
  }

  body.is-focus-mode .timer-card {
    position: relative;
    z-index: 10;
    width: 100%;
  }

  body.is-focus-mode .timer-layout {
    position: relative;
    z-index: 10;
    width: 100%;
    justify-items: center;
  }

  body.is-focus-mode .timer-ring {
    width: min(78vw, 340px);
  }

  body.is-focus-mode .timer-face strong {
    font-size: clamp(56px, 15vw, 72px);
  }

  body.is-focus-mode .timer-controls {
    width: min(260px, 100%);
    margin-top: 16px;
  }
}

@media (max-width: 520px) {
  .main-content {
    padding-right: 16px;
    padding-left: 16px;
  }

  .brand.compact .brand-text {
    font-size: 17px;
  }

  .mobile-actions {
    gap: 6px;
  }

  .segmented.mini {
    width: 64px;
  }

  .mini-streak {
    min-width: 50px;
  }

  .timer-face strong {
    font-size: 46px;
  }

  .session-row {
    grid-template-columns: 12px minmax(0, 1fr) auto;
  }

  .session-meta > span:first-child {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
