:root {
  --bg: #ffffff;
  --text: #111111;
  --accent: #111111;
  --muted: rgba(17, 17, 17, 0.62);
  --line: rgba(17, 17, 17, 0.22);
  --soft: rgba(17, 17, 17, 0.14);
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  min-height: 100vh;
}

.container {
  max-width: 640px;
  margin: 0;
  padding: 56px 24px 80px;
}

h1 {
  font-size: 30px;
  font-weight: 600;
  margin: 0 0 8px;
  letter-spacing: -0.01em;
}

h2 {
  font-size: 20px;
  font-weight: 600;
  margin: 0 0 16px;
}

h3 {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin: 32px 0 12px;
}

.muted { color: var(--muted); }

.about p {
  margin: 0 0 16px;
  max-width: 560px;
}

.about p:last-child {
  margin-bottom: 0;
}

.nav {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
  margin-bottom: 32px;
}

.nav-item {
  background: none;
  border: none;
  padding: 0;
  color: var(--muted);
  font: inherit;
  cursor: pointer;
}

.nav-item:hover { color: var(--text); }

.nav-item.active {
  color: var(--text);
  font-weight: 600;
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px;
  margin: 32px 0 28px;
}

.stat {
  border: 1px solid var(--line);
  padding: 14px;
}

.stat .value {
  font-size: 30px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

.stat .label {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}

.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 8px;
}

button {
  font: inherit;
  cursor: pointer;
  border-radius: 0;
}

button.primary {
  background: var(--accent);
  color: var(--bg);
  border: 1px solid var(--accent);
  padding: 10px 20px;
}

button.primary:hover { opacity: 0.85; }

button.secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line);
  padding: 10px 16px;
}

button.secondary:hover { border-color: var(--muted); }

button.link {
  background: none;
  border: none;
  padding: 0;
  color: var(--muted);
}

button.link:hover { color: var(--text); }

#home-result { margin-top: 24px; }

/* graph */
.graph-wrap {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin-top: 20px;
}

#graph {
  display: grid;
  grid-template-rows: repeat(7, 16px);
  grid-auto-flow: column;
  grid-auto-columns: 16px;
  gap: 4px;
}

.graph-days {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 10px;
  color: var(--muted);
}

.graph-days span {
  height: 16px;
  line-height: 16px;
}

.cell {
  width: 16px;
  height: 16px;
  border-radius: 3px;
  border: 1px solid var(--line);
  background: transparent;
}

.cell.future { opacity: 0.25; }

.cell.aborted {
  border-style: dashed;
  border-color: var(--muted);
  background: var(--soft);
}

.cell.sample {
  display: inline-block;
  vertical-align: middle;
}

#graph-months {
  display: flex;
  gap: 4px;
  margin-top: 4px;
}

.month-item {
  width: 16px;
  font-size: 10px;
  color: var(--muted);
  white-space: nowrap;
  overflow: visible;
}

.legend {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  font-size: 12px;
  color: var(--muted);
}

.legend-note { margin-left: 12px; }

/* settings */
#theme-options {
  display: grid;
  gap: 8px;
}

.theme-option {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  background: transparent;
  border: 1px solid var(--line);
  padding: 12px;
  color: var(--text);
}

.theme-option.selected { border-color: var(--accent); }
.theme-option:hover { border-color: var(--muted); }

.swatches {
  display: flex;
  gap: 4px;
}

.swatches i {
  display: inline-block;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1px solid var(--line);
}

.theme-name { flex: 1; }

.theme-combo {
  font-size: 12px;
  color: var(--muted);
}

select {
  font: inherit;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--line);
  padding: 8px 10px;
}

/* sound */
.check {
  display: flex;
  align-items: center;
  gap: 8px;
}

.check input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 12px;
}

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

.field select {
  max-width: 220px;
}

input[type="range"] {
  width: 100%;
  max-width: 260px;
  accent-color: var(--accent);
}

/* focus overlay */
#prompt {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 40;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  padding: 56px 24px;
}

#prompt[hidden] { display: none; }

.prompt-inner {
  width: 100%;
  max-width: 460px;
}

.pfade {
  opacity: 0;
  transition: opacity 1.8s ease;
}

.pfade.in { opacity: 1; }

.prompt-inner input:focus {
  outline: none;
  border-color: var(--text);
}

.prompt-inner h2 {
  font-size: 18px;
  margin: 0 0 8px;
}

.prompt-inner input {
  width: 100%;
  font: inherit;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--line);
  padding: 10px 12px;
  margin-bottom: 20px;
}

.prompt-actions {
  display: flex;
  gap: 10px;
}

#focus {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
}

#focus[hidden] { display: none; }

.focus-message {
  text-align: center;
  opacity: 0;
  transition: opacity 3s ease;
  padding: 0 40px;
  max-width: 640px;
}

.focus-message.visible { opacity: 1; }

.focus-intent {
  font-size: 26px;
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 12px;
}

.focus-step {
  font-size: 17px;
  color: var(--muted);
}
