/* Hallmark v2.0.0 · shape: app screen · scope: app · theme: custom · idea: "the same homework line changes hands" · vibe: "soft pixel stationery for two" · posture: light/system/chromatic-rose */
/* critique: let the task title and its three real states carry the screen. */
@font-face {
  font-family: Tiny5;
  src: url("/static/tiny5.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}

:root {
  color-scheme: light;
  --font-task: system-ui, sans-serif;
  --font-pixel: Tiny5, monospace;
  --paper: #f0f8f3;
  --sheet: #fffdfd;
  --panel: #edf7f0;
  --rose-paper: #faedf4;
  --ink: #263a30;
  --muted: #50645a;
  --line: #bfcec5;
  --mint: #285d45;
  --mint-soft: #d9eee0;
  --rose: #81345c;
  --rose-soft: #f7dfec;
  --focus: #993566;
  --shadow: #31534217;
  --dot: #83a89345;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --paper: #142019;
    --sheet: #1a2920;
    --panel: #223429;
    --rose-paper: #30222c;
    --ink: #e5f0e8;
    --muted: #b1c2b8;
    --line: #42594a;
    --mint: #a8e5bc;
    --mint-soft: #294939;
    --rose: #f2b0d2;
    --rose-soft: #482b3e;
    --focus: #f4a7cf;
    --shadow: #080d0a66;
    --dot: #82a99237;
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #142019;
  --sheet: #1a2920;
  --panel: #223429;
  --rose-paper: #30222c;
  --ink: #e5f0e8;
  --muted: #b1c2b8;
  --line: #42594a;
  --mint: #a8e5bc;
  --mint-soft: #294939;
  --rose: #f2b0d2;
  --rose-soft: #482b3e;
  --focus: #f4a7cf;
  --shadow: #080d0a66;
  --dot: #82a99237;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; overflow-x: clip; }
body {
  margin: 0;
  padding: clamp(1rem, 5vw, 4rem) 1rem;
  background-color: var(--paper);
  background-image: radial-gradient(circle, var(--dot) 1px, transparent 1px);
  background-size: 12px 12px;
  color: var(--ink);
  font: 1.125rem/1.4 var(--font-pixel);
}
h1, h2, h3, p, ul { margin: 0; }
h1, h2, h3 { min-width: 0; overflow-wrap: break-word; }
h1 { text-wrap: balance; font-size: 2.5rem; line-height: 1.12; font-weight: 400; }
h2 { font-size: 1.25rem; font-weight: 400; }
h3 { font-size: 1rem; font-weight: 650; }
[hidden] { display: none !important; }
:where(button, input, textarea, a, summary):focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.ledger, .login-window {
  margin-inline: auto;
  background: var(--sheet);
  border: 1px solid var(--line);
  border-radius: 6px;
  box-shadow: 5px 6px 0 var(--shadow);
}
.ledger { max-width: 52rem; }
.login-page { min-height: 100svh; display: grid; place-items: center; }
.login-window { width: min(100%, 28rem); }
.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .65rem;
  padding: .45rem clamp(.75rem, 3vw, 1.4rem);
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  border-radius: 5px 5px 0 0;
}
.wordmark { color: var(--mint); font: 1.35rem/1 var(--font-pixel); }
.toolbar, .row-buttons { display: flex; align-items: center; flex-wrap: wrap; gap: .3rem .65rem; }
.account { font-size: 1rem; color: var(--mint); }
.account.sonya { color: var(--rose); }
.ledger-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: .65rem;
  padding: 1.55rem clamp(.9rem, 4vw, 1.8rem) 1.2rem;
}
.progress, .intro { color: var(--muted); margin-top: .45rem; }
.progress { font-size: 1rem; font-variant-numeric: tabular-nums; }
.login-content { padding: clamp(1.15rem, 6vw, 2rem); }
.login-form { display: grid; gap: .55rem; margin-top: 1.25rem; }
.login-form .primary { margin-top: .55rem; }
fieldset { margin: 0 0 .45rem; padding: 0; border: 0; min-inline-size: 0; }
legend { padding: 0; margin-bottom: .4rem; font-weight: 600; }
.profiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; }
.profiles label {
  display: flex;
  align-items: center;
  gap: .45rem;
  cursor: pointer;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--panel);
  padding: .55rem .65rem;
  min-height: 44px;
}
.profiles label:last-child { background: var(--rose-paper); }
.profiles label:has(:checked) { border-color: var(--mint); color: var(--mint); }
.profiles label:last-child:has(:checked) { border-color: var(--rose); color: var(--rose); }
input[type="radio"] { margin: 0; accent-color: var(--mint); }
input:not([type="radio"]), textarea {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: .5rem .64rem;
  color: var(--ink);
  background: var(--sheet);
  border: 1px solid var(--line);
  border-radius: 4px;
  font: inherit;
}
input::placeholder { color: var(--muted); }
input[name="title"], textarea, .task-info h3, .task-description { font-family: var(--font-task); }
textarea { resize: vertical; }
.code { letter-spacing: .24em; font-variant-numeric: tabular-nums; }

button, a { color: var(--mint); }
button, summary { font: inherit; cursor: pointer; }
.primary, .control, .quiet, .check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: 4px;
  padding: .4rem .7rem;
  font-size: 1rem;
  text-decoration: none;
  line-height: 1.25;
}
.primary { background: var(--mint-soft); color: var(--mint); border-color: var(--mint); font-weight: 650; }
.control { background: var(--panel); color: var(--mint); border-color: var(--line); }
.quiet, .check { background: transparent; color: var(--mint); padding-inline: .28rem; }
.quiet:hover, .check:not(.read):hover, a:hover { text-decoration: underline; }
.primary:hover, .control:hover { background: var(--mint-soft); border-color: var(--mint); }
.primary:active, .control:active { box-shadow: inset 0 1px 2px var(--shadow); }
summary { list-style: none; }
summary::-webkit-details-marker { display: none; }
details[open] > summary { color: var(--rose); }
.box {
  width: 1.15rem;
  height: 1.15rem;
  display: inline-grid;
  place-items: center;
  flex: none;
  border: 1px solid var(--mint);
  border-radius: 3px;
  font-size: 1rem;
  background: var(--mint-soft);
}
.check[aria-checked="false"] .box { background: var(--sheet); }
.read { padding: 0; justify-content: start; }

.create { margin: 0 clamp(.9rem, 4vw, 1.8rem) 1.2rem; }
.task-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, .55fr);
  gap: .65rem;
  align-items: end;
  padding-top: .75rem;
}
.task-form label, .row-form label {
  display: grid;
  gap: .26rem;
  min-width: 0;
  font-size: 1rem;
}
.description-field { grid-column: 1 / -1; }
.task-form > button { justify-self: start; }
.row-form { display: grid; gap: .5rem; padding: .5rem 0 .25rem; }
.error {
  color: var(--rose);
  background: var(--rose-paper);
  border-left: 2px solid var(--rose);
  padding: .55rem .7rem;
  margin-top: .75rem;
  font-size: 1rem;
}
.ledger-error { margin: 0 clamp(.9rem, 4vw, 1.8rem) .75rem; }

.list h2 {
  padding: .5rem clamp(.9rem, 4vw, 1.8rem);
  background: var(--panel);
  color: var(--mint);
  border-block: 1px solid var(--line);
}
.submitted-list h2 { background: var(--rose-paper); color: var(--rose); }
.list ul { list-style: none; padding: 0; }
.empty { color: var(--muted); padding: 1.1rem clamp(.9rem, 4vw, 1.8rem); }
.task {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 15.3rem);
  align-items: start;
  gap: .7rem 1.2rem;
  padding: .75rem clamp(.9rem, 4vw, 1.8rem);
}
.task + .task { border-top: 1px solid var(--line); }
.task-info { min-width: 0; padding-top: .46rem; }
.task-description {
  margin-top: .6rem;
  font-size: 1rem;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.task-meta { display: flex; align-items: baseline; flex-wrap: wrap; gap: .3rem .7rem; margin-top: .25rem; }
.task-meta:empty { display: none; }
.task-meta, .due { font-size: 1rem; color: var(--muted); }
.due-label { font-size: 1.125rem; }
.urgent, .nudge { color: var(--rose); }
.urgent .due-label, .nudge { background: var(--rose-soft); padding: .06rem .28rem; border-radius: 3px; }
.task-actions { display: flex; flex-wrap: wrap; align-items: flex-start; gap: .16rem .5rem; }
.task-actions details[open] { flex-basis: 100%; }
.task:has(.edit-task[open]) { grid-template-columns: minmax(0, 1fr); }
.underlined { text-decoration: underline; text-decoration-color: var(--mint); text-underline-offset: .19em; }
.submitted { text-decoration: line-through; color: var(--muted); }

@media (max-width: 38rem) {
  .task { grid-template-columns: minmax(0, 1fr); gap: .45rem; }
  .task-info { padding-top: 0; }
}
@media (max-width: 28rem) {
  .task-form { grid-template-columns: minmax(0, 1fr); }
  .wordmark { font-size: 1.2rem; }
  .masthead { align-items: center; flex-wrap: wrap; }
  .toolbar { column-gap: .35rem; }
}
