:root {
  --bg: #0c0d0b;
  --surface: #161814;
  --surface-2: #22261f;
  --fg: #ebe6dc;
  --muted: #9a9488;
  --line: #2e332b;
  --accent: #e26a1a;
  --accent-fg: #1a0d06;
  --font-sans: "Liberation Sans", "Segoe UI", sans-serif;
  --font-display: "Liberation Serif", "Bitstream Charter", Georgia, serif;
  --font-mono: "Liberation Mono", ui-monospace, monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html { -webkit-font-smoothing: antialiased; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
}

button,
input,
label { font: inherit; }

button:not(:disabled),
[role="button"]:not(:disabled),
label.capture { cursor: pointer; }

button:disabled,
input:disabled { cursor: not-allowed; opacity: 0.55; }

.app {
  width: min(40rem, calc(100% - 2rem));
  margin: 0 auto;
  padding: 1.5rem 0 3rem;
}

.eyebrow {
  margin: 0;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1 {
  margin: 0.25rem 0 0;
  font-family: var(--font-display);
  font-size: 2.25rem;
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.1;
  text-wrap: balance;
}

.layer-id {
  margin: 0.4rem 0 0;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.8rem;
}

.note {
  margin: 1.25rem 0 0;
  padding: 0.85rem 0 0.85rem 0.9rem;
  border-left: 3px solid var(--accent);
  color: var(--fg);
  font-size: 1rem;
  line-height: 1.45;
}

.lede {
  margin: 0.85rem 0 0;
  color: var(--muted);
  font-size: 0.95rem;
  text-wrap: pretty;
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

h2 {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

button {
  min-height: 2.75rem;
  border: 1px solid var(--line);
  border-radius: 0.7rem;
  background: transparent;
  color: var(--fg);
  padding: 0.55rem 0.9rem;
}

button:hover:not(:disabled) { border-color: var(--accent); }

button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-fg);
  font-weight: 650;
}

button:focus-visible,
input:focus-visible,
.record:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.records {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.65rem;
}

.record {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 0.85rem;
  padding: 0.8rem 0.9rem;
}

.record.is-selected {
  border-color: var(--accent);
  background: var(--surface-2);
}

.record strong { font-weight: 650; }

.record span,
.meta,
.fine,
.empty {
  color: var(--muted);
  font-size: 0.85rem;
}

.panel {
  margin-top: 1rem;
  padding: 1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 0.9rem;
}

.capture {
  display: block;
  margin-top: 0.75rem;
}

.capture input[type="file"] {
  width: 100%;
  min-height: 2.75rem;
  color: var(--fg);
}

.capture input[type="file"]::file-selector-button {
  margin-right: 0.8rem;
  min-height: 2.75rem;
  border: 0;
  border-radius: 0.7rem;
  background: var(--accent);
  color: var(--accent-fg);
  padding: 0.6rem 1rem;
  font: inherit;
  font-weight: 650;
  cursor: pointer;
}

.thumbs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(7.5rem, 1fr));
  gap: 0.75rem;
  margin: 0.9rem 0 0;
  padding: 0;
  list-style: none;
}

.thumb {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.thumb img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 0.7rem;
  border: 1px solid var(--line);
  background: var(--bg);
}

.thumb time {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-variant-numeric: tabular-nums;
}

.thumb button { width: 100%; }

.composer {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.7rem;
}

.composer input[type="text"] {
  flex: 1;
  min-height: 2.75rem;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 0.7rem;
  background: var(--bg);
  color: var(--fg);
  padding: 0.55rem 0.75rem;
}

.status {
  min-height: 1.4em;
  margin: 0.85rem 0 0;
  color: var(--fg);
  font-size: 0.92rem;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.25rem;
}

.fine { margin: 0.7rem 0 0; }

@media (max-width: 420px) {
  h1 { font-size: 1.9rem; }
  .composer { flex-direction: column; }
  .composer button { width: 100%; }
}

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