:root {
  color-scheme: light;
  --bg: #f4f0e8;
  --ink: #16201c;
  --muted: #657069;
  --panel: #fffdf8;
  --line: #ded7ca;
  --accent: #1c6b61;
  --accent-strong: #0d4f47;
  --sun: #d69a2d;
  --rose: #be4d63;
  --shadow: 0 18px 50px rgba(22, 32, 28, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(214, 154, 45, 0.18), transparent 28rem),
    linear-gradient(135deg, #f7f2e8 0%, #eaf3ef 48%, #f4ecef 100%);
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: end;
  min-height: 220px;
}

.eyebrow,
.kicker {
  margin: 0;
  color: var(--accent-strong);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  max-width: 720px;
  font-size: clamp(2.7rem, 7vw, 5.8rem);
  line-height: 0.92;
}

h2 {
  font-size: 1.2rem;
}

.subtle {
  max-width: 620px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.6;
}

.clock {
  display: grid;
  gap: 4px;
  justify-items: end;
  padding-bottom: 8px;
}

#clock-time {
  font-size: clamp(2rem, 5vw, 4rem);
  font-weight: 850;
}

#clock-zone {
  color: var(--muted);
}

.grid {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 18px;
  margin-top: 28px;
}

.panel {
  min-width: 0;
  padding: 22px;
  border: 1px solid rgba(22, 32, 28, 0.11);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.88);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

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

.focus-panel {
  background: linear-gradient(145deg, rgba(255, 253, 248, 0.94), rgba(224, 242, 236, 0.9));
}

.icon-button {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  background: #ffffffaa;
  font-size: 1.25rem;
}

.timer {
  margin: 8px 0 18px;
  font-size: clamp(4rem, 12vw, 7.5rem);
  font-weight: 900;
  line-height: 0.9;
  font-variant-numeric: tabular-nums;
}

.timer-controls {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.timer-controls button,
.inline-form button,
.link-form button,
.primary-action {
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  color: white;
  background: var(--accent);
  font-weight: 800;
}

.timer-controls button {
  color: var(--ink);
  background: #e8e2d5;
}

.timer-controls button.active {
  color: white;
  background: var(--ink);
}

.primary-action {
  width: 100%;
  margin-top: 12px;
  background: var(--accent-strong);
}

.score,
.saved {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.habit-list {
  display: grid;
  gap: 10px;
}

.habit {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) 32px;
  gap: 10px;
  align-items: center;
  min-height: 46px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffaf1;
}

.habit input {
  width: 20px;
  height: 20px;
  accent-color: var(--accent);
}

.habit span {
  overflow-wrap: anywhere;
}

.habit.done span {
  color: var(--muted);
  text-decoration: line-through;
}

.remove {
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 999px;
  color: var(--rose);
  background: transparent;
  font-size: 1.1rem;
}

.inline-form,
.link-form {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.inline-form {
  grid-template-columns: minmax(0, 1fr) 72px;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: #fffdf8;
  outline: none;
}

input {
  min-height: 44px;
  padding: 0 12px;
}

textarea {
  min-height: 255px;
  resize: vertical;
  padding: 14px;
  line-height: 1.55;
}

input:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(28, 107, 97, 0.16);
}

.links {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.link-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 58px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: #fffaf1;
  text-decoration: none;
}

.link-card strong {
  overflow-wrap: anywhere;
}

.link-card span {
  color: var(--accent-strong);
  font-weight: 900;
}

@media (max-width: 820px) {
  .hero,
  .grid {
    grid-template-columns: 1fr;
  }

  .clock {
    justify-items: start;
  }

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

@media (max-width: 520px) {
  .shell {
    width: min(100% - 22px, 1180px);
    padding: 22px 0;
  }

  .panel {
    padding: 18px;
  }

  .timer-controls {
    grid-template-columns: 1fr;
  }
}
