:root {
  color-scheme: light;
  --ink: #14231d;
  --muted: #66736d;
  --paper: #f6f7f2;
  --card: #ffffff;
  --green: #176b4d;
  --green-dark: #0e5038;
  --green-soft: #dff0e8;
  --line: #dce3de;
  --shadow: 0 18px 50px rgba(20, 35, 29, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 50% 0%, rgba(23, 107, 77, 0.1), transparent 34rem),
    var(--paper);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.shell {
  width: min(680px, calc(100% - 32px));
  min-height: 100vh;
  margin: 0 auto;
  padding: clamp(56px, 10vh, 110px) 0 48px;
  text-align: center;
}

.eyebrow {
  display: inline-block;
  margin-bottom: 12px;
  color: var(--green);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(3.4rem, 12vw, 6.5rem);
  letter-spacing: -0.075em;
  line-height: 0.92;
}

.subtitle {
  margin: 24px auto 0;
  color: var(--muted);
  font-size: clamp(1rem, 3vw, 1.2rem);
}

.idle-view {
  margin-top: clamp(52px, 10vh, 92px);
}

.memory-panel {
  margin-top: 34px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: var(--shadow);
  text-align: left;
}

.memory-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.memory-header h2 {
  margin: 0;
  font-size: 1.2rem;
}

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

.memory-toggle {
  display: inline-flex;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f2f5f1;
}

.memory-tab {
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-weight: 750;
  padding: 10px 14px;
}

.memory-tab.is-active {
  background: white;
  color: var(--ink);
  box-shadow: 0 1px 4px rgba(20, 35, 29, 0.08);
}

.memory-status {
  min-height: 20px;
  margin: 18px 0 10px;
  color: var(--muted);
  font-size: 0.95rem;
}

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

.tag-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.tag-filter-chip,
.person-tag {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 800;
}

.tag-filter-chip {
  border: 1px solid var(--line);
  background: white;
  color: var(--muted);
  padding: 9px 12px;
}

.tag-filter-chip.is-active {
  border-color: var(--green);
  background: var(--green);
  color: white;
}

.memory-item {
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: white;
}

.memory-item-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.memory-item h3 {
  margin: 0;
  font-size: 1rem;
}

.memory-badge {
  flex-shrink: 0;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--green-dark);
  font-size: 0.78rem;
  font-weight: 800;
}

.memory-meta {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.person-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.person-tag {
  padding: 6px 10px;
  background: #eef5f0;
  color: var(--green-dark);
}

.memory-copy {
  margin: 10px 0 0;
  line-height: 1.5;
}

.memory-empty {
  margin: 0;
  padding: 14px 0;
  color: var(--muted);
}

.primary-button {
  width: min(100%, 520px);
  min-height: 128px;
  padding: 28px 34px;
  border: 0;
  border-radius: 28px;
  background: var(--green);
  box-shadow: 0 14px 0 var(--green-dark), var(--shadow);
  color: white;
  font-size: clamp(1.35rem, 5vw, 2rem);
  font-weight: 800;
  line-height: 1.15;
  transition: transform 120ms ease, box-shadow 120ms ease, background 120ms ease;
}

.primary-button:hover {
  background: #197a57;
  transform: translateY(-2px);
  box-shadow: 0 16px 0 var(--green-dark), var(--shadow);
}

.primary-button:active {
  transform: translateY(8px);
  box-shadow: 0 6px 0 var(--green-dark), var(--shadow);
}

.text-button {
  display: block;
  margin: 30px auto 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 4px;
}

.key-panel,
.task-card {
  margin-top: 48px;
  padding: clamp(24px, 6vw, 42px);
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--card);
  box-shadow: var(--shadow);
  text-align: left;
}

.key-panel {
  width: min(100%, 520px);
  margin-right: auto;
  margin-left: auto;
}

.key-panel h2 {
  margin: 0;
  font-size: 1.4rem;
}

.key-panel p {
  margin: 8px 0 24px;
  color: var(--muted);
}

.key-panel label {
  display: block;
  margin-bottom: 8px;
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
}

.key-row {
  display: flex;
  gap: 10px;
}

.key-row input {
  min-width: 0;
  flex: 1;
  padding: 13px 14px;
  border: 1px solid #b9c5bd;
  border-radius: 10px;
  color: var(--ink);
}

.small-button,
.complete-button,
.secondary-button {
  border-radius: 10px;
  font-weight: 750;
}

.small-button,
.complete-button {
  border: 1px solid var(--green);
  background: var(--green);
  color: white;
}

.small-button {
  padding: 12px 18px;
}

.task-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.project-pill {
  display: inline-flex;
  padding: 7px 11px;
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--green-dark);
  font-size: 0.8rem;
  font-weight: 800;
}

.timer {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  font-weight: 800;
}

.task-card h2 {
  margin: 30px 0 28px;
  font-size: clamp(1.8rem, 7vw, 3rem);
  letter-spacing: -0.045em;
  line-height: 1.05;
}

.detail {
  padding: 18px 0;
  border-top: 1px solid var(--line);
}

.detail-label {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.detail p {
  margin: 7px 0 0;
  line-height: 1.55;
}

blockquote {
  margin: 24px 0;
  color: var(--green);
  font-size: 1.15rem;
  font-weight: 750;
}

.actions {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
}

.complete-button,
.secondary-button {
  min-height: 50px;
  padding: 12px 18px;
}

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

.message {
  min-height: 24px;
  margin: 28px auto 0;
  color: var(--muted);
}

.message[data-tone="success"] {
  color: var(--green);
  font-weight: 700;
}

.message[data-tone="error"] {
  color: #a12d2d;
  font-weight: 700;
}

[hidden] {
  display: none !important;
}

@media (max-width: 520px) {
  .shell {
    width: min(100% - 24px, 680px);
    padding-top: 48px;
  }

  .key-row,
  .actions {
    grid-template-columns: 1fr;
    flex-direction: column;
  }

  .memory-header,
  .memory-item-top {
    flex-direction: column;
    align-items: flex-start;
  }

  .actions {
    display: grid;
  }

  .secondary-button {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
