/* Reconciliation page. Flat design, no shadows, no outside fonts or images. */

:root {
  --bg: #f4f6f9;
  --surface: #ffffff;
  --surface-2: #eef1f5;
  --text: #1a2230;
  --muted: #53606f;
  --border: #d3d9e1;
  --accent: #1a4fc9;
  --accent-text: #ffffff;
  --done-fg: #14532d;
  --done-bg: #e1f4e7;
  --done-num: #15703a;
  --review-fg: #7f1d1d;
  --review-bg: #fde7e4;
  --review-num: #b01c1c;
  --pending-fg: #1a2230;
  --pending-bg: #ffffff;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1318;
    --surface: #171c23;
    --surface-2: #202731;
    --text: #e8ebef;
    --muted: #a2adba;
    --border: #35404d;
    --accent: #8db0ff;
    --accent-text: #0c1018;
    --done-fg: #b9f0cb;
    --done-bg: #14301f;
    --done-num: #5fe08d;
    --review-fg: #ffcdc8;
    --review-bg: #3a1717;
    --review-num: #ff8f87;
    --pending-fg: #e8ebef;
    --pending-bg: #171c23;
  }
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

.copy-helper { position: fixed; left: -9999px; top: 0; opacity: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.wrap {
  max-width: 1280px;
  margin: 0 auto;
  padding: 20px 16px 48px;
}

h1, h2 { margin: 0; line-height: 1.25; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1rem; }

.top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.top-side { margin: 0; display: flex; align-items: baseline; gap: 12px; }
.tz { color: var(--muted); font-size: 0.9rem; }

.link {
  background: none;
  border: 0;
  padding: 4px;
  color: var(--accent);
  font: inherit;
  font-size: 0.9rem;
  text-decoration: underline;
  cursor: pointer;
}

.notice {
  margin: 0 0 14px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}

.howto {
  margin-bottom: 16px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}
.howto h2 { margin-bottom: 6px; }
.howto ul { margin: 0; padding-left: 20px; }
.howto li { margin: 3px 0; }
.howto-note { margin: 8px 0 0; color: var(--muted); font-size: 0.9rem; }

.panel {
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}
.gate p { margin: 8px 0; }

.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field > span { font-size: 0.8rem; color: var(--muted); }
.grow { flex: 1 1 260px; }

input[type="search"],
input[type="password"],
input[type="datetime-local"] {
  width: 100%;
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
}

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

.btn {
  min-height: 40px;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.btn:hover { background: var(--surface-2); }
.btn:disabled { opacity: 0.6; cursor: default; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.btn.primary:hover { filter: brightness(1.08); }

.key-form, .filters {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
}
.filters { margin-bottom: 12px; }
.filters .field:not(.grow) { flex: 0 1 200px; }
.filters-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.auto { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 0.9rem; }

.scope {
  margin: 0 0 12px;
  padding: 8px 12px;
  border: 1px dashed var(--border);
  border-radius: 8px;
  color: var(--muted);
  font-size: 0.9rem;
}

.error {
  margin: 10px 0 0;
  padding: 8px 12px;
  border: 1px solid var(--review-num);
  border-radius: 8px;
  background: var(--review-bg);
  color: var(--review-fg);
}

.cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}
.card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.card:hover { background: var(--surface-2); }
.card[aria-pressed="true"] { border: 2px solid var(--accent); padding: 11px 13px; }
.card-label { color: var(--muted); font-size: 0.85rem; }
.card-num { font-size: 1.75rem; font-weight: 700; line-height: 1.2; font-variant-numeric: tabular-nums; }
.card-done .card-num { color: var(--done-num); }
.card-review .card-num { color: var(--review-num); }

.bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.pills { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.bar-label { color: var(--muted); font-size: 0.9rem; }
.pill {
  min-height: 36px;
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  cursor: pointer;
}
.pill:hover { background: var(--surface-2); }
.pill[aria-pressed="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-text);
  font-weight: 700;
}
.downloads { display: flex; gap: 8px; }

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
th, td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
}
thead th { background: var(--surface-2); color: var(--muted); font-size: 0.8rem; font-weight: 600; }
tbody tr:last-child td { border-bottom: 0; }

.mono, td.copy { font-family: ui-monospace, "SFMono-Regular", Consolas, "Liberation Mono", monospace; font-size: 0.85rem; }
td.copy { cursor: copy; }
td.copy:hover { text-decoration: underline; }
td.note { white-space: normal; min-width: 180px; max-width: 360px; overflow-wrap: anywhere; }
td.empty { padding: 24px 12px; text-align: center; color: var(--muted); white-space: normal; }

tr.row-pending td { background: var(--pending-bg); color: var(--pending-fg); }
tr.row-done td { background: var(--done-bg); color: var(--done-fg); }
tr.row-review td { background: var(--review-bg); color: var(--review-fg); }

.badge { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; }
.badge-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.35em;
  height: 1.35em;
  border: 1.5px solid currentColor;
  border-radius: 50%;
  font-size: 0.8rem;
  line-height: 1;
}

.fb {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 4px 10px;
  border: 1px solid currentColor;
  border-radius: 8px;
  color: inherit;
  font-weight: 600;
  text-decoration: none;
}
a.fb:hover { text-decoration: underline; }
span.fb { opacity: 0.55; }

.foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
}
.shown { color: var(--muted); }

.toast {
  position: fixed;
  left: 50%;
  bottom: 20px;
  max-width: calc(100vw - 32px);
  transform: translateX(-50%);
  padding: 8px 14px;
  border-radius: 8px;
  background: var(--text);
  color: var(--bg);
  font-size: 0.9rem;
  overflow-wrap: anywhere;
}

@media (max-width: 760px) {
  .cards { grid-template-columns: repeat(2, 1fr); }
  .filters .field:not(.grow) { flex: 1 1 100%; }
  .btn, .pill { min-height: 44px; }
  .downloads { width: 100%; }
  .downloads .btn { flex: 1; }
  h1 { font-size: 1.3rem; }
}
