:root {
  --mist: #e6eceb;
  --surface: #f8faf9;
  --ink: #12222b;
  --muted: #55666e;
  --line: #c5d0cf;
  --teal: #0b5d57;
  --teal-dark: #08423e;
  --amber: #a84b08;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--mist);
  color: var(--ink);
  font: 16px/1.55 var(--sans);
  font-variant-numeric: tabular-nums;
}

.wrap { width: min(1040px, 100% - 2rem); margin-inline: auto; }

/* Header */
.top { background: var(--ink); color: var(--surface); }
.top-inner {
  display: flex; flex-wrap: wrap; gap: .75rem 2rem;
  align-items: baseline; justify-content: space-between;
  padding-block: 1.75rem;
}
.top h1 {
  margin: 0; font: 600 clamp(2rem, 5vw, 3rem)/1.1 var(--serif); letter-spacing: -.01em;
}
.live { margin: 0; display: flex; align-items: center; gap: .55rem; color: #c9d6d4; }
.dot { width: .65rem; height: .65rem; border-radius: 50%; background: #7d8c8a; }
.live.ok .dot { background: #4fd1a5; animation: pulse 2.4s ease-out infinite; }
.live.down .dot { background: #f0a35e; }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(79, 209, 165, .6); }
  70%, 100% { box-shadow: 0 0 0 .6rem rgba(79, 209, 165, 0); }
}

/* Layout */
.layout {
  display: grid; gap: 2.5rem; padding-block: 2.5rem;
  grid-template-columns: minmax(0, 1fr);
}
@media (min-width: 860px) {
  .layout { grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); }
}

h2 { margin: 0 0 .5rem; font: 600 1.6rem/1.2 var(--serif); }
h3 { margin: 2rem 0 .25rem; font: 600 1.15rem/1.3 var(--serif); }
.lead, .hint { margin: 0 0 1.25rem; color: var(--muted); max-width: 60ch; }
.hint { margin-bottom: .75rem; font-size: .92rem; }

/* Form */
.note-form { display: grid; gap: .5rem; margin-bottom: 2rem; }
label { font-weight: 600; }
textarea {
  width: 100%; resize: vertical; min-height: 5.5rem;
  padding: .75rem .85rem; font: inherit; color: var(--ink);
  background: var(--surface); border: 1.5px solid var(--line); border-radius: 6px;
}
textarea:focus-visible, button:focus-visible, a:focus-visible {
  outline: 3px solid var(--teal); outline-offset: 2px;
}
.form-row { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.counter { color: var(--muted); font-size: .9rem; }
button {
  font: inherit; font-weight: 600; cursor: pointer;
  padding: .6rem 1.1rem; border-radius: 6px; border: 0;
  background: var(--teal); color: #fff;
}
button:hover { background: var(--teal-dark); }
button:disabled { opacity: .6; cursor: wait; }
.error { margin: 0; color: var(--amber); font-weight: 600; }

/* Entries */
.entries { list-style: none; margin: 0; padding: 0; border-top: 1.5px solid var(--ink); }
.entry {
  display: grid; gap: .25rem 1.25rem; padding: 1rem 0;
  border-bottom: 1px solid var(--line);
  grid-template-columns: 8.5rem minmax(0, 1fr) auto;
}
.entry time { color: var(--muted); font-size: .9rem; padding-top: .1rem; }
.entry p { margin: 0; overflow-wrap: anywhere; white-space: pre-wrap; }
.entry button {
  background: transparent; color: var(--muted); padding: .2rem .5rem;
  border: 1px solid var(--line); font-weight: 500; font-size: .88rem;
}
.entry button:hover { background: var(--amber); border-color: var(--amber); color: #fff; }
@media (max-width: 560px) {
  .entry { grid-template-columns: minmax(0, 1fr) auto; }
  .entry time { grid-column: 1 / -1; }
}
.empty { color: var(--muted); padding: 1rem 0; }

/* Status */
.status dl { margin: 0; }
.status dl > div {
  display: flex; justify-content: space-between; gap: 1rem;
  padding: .55rem 0; border-bottom: 1px solid var(--line);
}
.status dt { color: var(--muted); }
.status dd { margin: 0; font-weight: 600; text-align: right; overflow-wrap: anywhere; }

.foot { padding-block: 1.5rem 2.5rem; color: var(--muted); font-size: .9rem; }
.foot p { margin: 0; }

.notfound { padding-block: 5rem; }
.notfound h1 { font: 600 2.2rem/1.2 var(--serif); }
a { color: var(--teal); }

@media (prefers-reduced-motion: reduce) {
  .live.ok .dot { animation: none; }
}
