:root {
  color-scheme: light;
  --paper: #d5e0e2;
  --ink: #1c2c31;
  --panel: #f3f7f7;
  --line: #b7c8cb;
  --muted: #5a6f74;
  --accent: #0c5c62;
  --live: #d7efeb;
  --arrive: #b7e0d8;
  --font: "Zen Kaku Gothic New", "Yu Gothic UI", "Hiragino Sans", sans-serif;
  --mono: "Fragment Mono", "Yu Gothic UI", ui-monospace, monospace;
}

* { box-sizing: border-box; }

html,
body {
  height: 100%;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
}

button,
input,
textarea {
  font: inherit;
  color: inherit;
}

.app {
  height: 100%;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.toolbar {
  flex: none;
  padding: 1.15rem 1.35rem 0.85rem;
}

.title-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}

h1 {
  margin: 0;
  font-size: 1.7rem;
  font-weight: 700;
  line-height: 1.2;
}

.title-row a {
  color: var(--accent);
  font-weight: 500;
}

.lede,
.help,
#status {
  max-width: 42rem;
}

.lede {
  margin: 0.35rem 0 0.85rem;
}

.search {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.7rem;
  align-items: center;
  max-width: 46rem;
}

.search input,
.search textarea {
  width: 100%;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 0;
  resize: vertical;
  min-height: 2.65rem;
  max-height: 11rem;
  line-height: 1.45;
}

#picker {
  margin-top: 0.85rem;
  max-width: 52rem;
}

summary {
  cursor: pointer;
  font-weight: 500;
  width: fit-content;
}

.picker-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.7rem 0 0.35rem;
}

.picker-actions button,
#more {
  background: transparent;
  border: 1px solid var(--line);
  padding: 0.28rem 0.6rem;
  cursor: pointer;
}

.checks {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(12.5rem, 1fr));
  gap: 0.15rem 0.8rem;
  margin-top: 0.35rem;
}

.checks label {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
  padding: 0.15rem 0;
}

.checks small {
  color: var(--muted);
  font-size: 0.75rem;
}

.help {
  margin: 0.7rem 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

#status {
  min-height: 1.5em;
  margin: 0.75rem 0 0;
}

.list-wrap {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 0.35rem 1.35rem 1.25rem;
}

.record {
  background: var(--panel);
  margin-bottom: 0.75rem;
}

.record-string {
  margin: 0;
  padding: 0.7rem 0.85rem 0.55rem;
  font-weight: 500;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.record.live { background: var(--live); }

.record.live .record-string::before {
  content: "";
  display: inline-block;
  width: 0.55rem;
  height: 0.55rem;
  margin-right: 0.45rem;
  background: var(--accent);
  vertical-align: 0.08rem;
}

.hash-line {
  display: grid;
  grid-template-columns: 9.25rem minmax(0, 1fr) auto;
  gap: 0.65rem;
  align-items: start;
  padding: 0.4rem 0.85rem;
  border-top: 1px solid var(--line);
}

.hash-name { font-weight: 500; }

.digest {
  font-family: var(--mono);
  font-size: 0.8125rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.copy {
  border: 1px solid var(--line);
  background: transparent;
  padding: 0.12rem 0.5rem;
  cursor: pointer;
}

.pending,
.no-hash,
.empty-string {
  color: var(--muted);
  font-style: normal;
}

.no-hash {
  margin: 0;
  padding: 0.35rem 0.85rem 0.7rem;
  border-top: 1px solid var(--line);
}

.hash-line.arrived { background: var(--arrive); }

#more {
  margin-top: 0.15rem;
  background: var(--panel);
}

.toast {
  position: fixed;
  left: 1rem;
  bottom: 1rem;
  padding: 0.45rem 0.7rem;
  background: var(--ink);
  color: var(--panel);
  opacity: 0;
  pointer-events: none;
}

.toast.show { opacity: 1; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

@media (max-width: 640px) {
  .toolbar,
  .list-wrap { padding-left: 0.85rem; padding-right: 0.85rem; }
  .search { grid-template-columns: 1fr; gap: 0.3rem; }
  h1 { font-size: 1.45rem; }
  .hash-line {
    grid-template-columns: minmax(0, 1fr) auto;
  }
  .digest { grid-column: 1 / -1; }
}

@media (prefers-reduced-motion: reduce) {
  .hash-line.arrived { background: transparent; }
}
