:root {
  color-scheme: light;
  font-family: "Hiragino Sans", "Yu Gothic", system-ui, sans-serif;
  color: #232c39;
  background: #f4f6f9;
  --border: #dce2eb;
  --muted: #536176;
  --accent: #244e8f;
  --tint: #eaf1fc;
}

* { box-sizing: border-box; }
body { margin: 0; }
.shell { width: min(100% - 2rem, 1080px); margin-inline: auto; }
.topbar { border-bottom: 1px solid var(--border); background: #fff; }
.topbar-inner, .account, .page-title, .pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .8rem;
}
.topbar-inner { min-height: 62px; }
.project { color: var(--accent); font-weight: 750; }
.account { font-size: .875rem; flex-wrap: wrap; justify-content: end; }
main.shell { padding-block: 2rem 3rem; }
.page-title { flex-wrap: wrap; }
h1 { font-size: clamp(1.7rem, 4vw, 2.4rem); margin: 0; letter-spacing: -.04em; }

.metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .8rem;
  margin: 1.2rem 0;
}
.metrics div, .panel, .login-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
}
.metrics div { padding: .9rem 1rem; }
.metrics dt, label { color: var(--muted); font-size: .85rem; font-weight: 650; }
.metrics dd {
  margin: .3rem 0 0;
  font-size: 1.65rem;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
}

.filters { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: .8rem; padding: 1rem 1rem 0; }
label { display: grid; gap: .35rem; }
input, select, button {
  font: inherit;
  font-size: .875rem;
  color: inherit;
  background: #fff;
  border: 1px solid #bcc8d7;
  border-radius: 7px;
  padding: .45rem .65rem;
  min-height: 2.25rem;
}
input, select { width: 100%; }
button { font-weight: 650; cursor: pointer; white-space: nowrap; }
button:disabled { cursor: default; opacity: .45; }
button:not(:disabled):hover { background: var(--tint); }
button.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
button.primary:not(:disabled):hover { background: #193b71; }
button.pick { color: var(--accent); }
button.release { color: #8a393e; }
:focus-visible { outline: 2px solid #265dad; outline-offset: 2px; }

.notice { margin: 0; min-height: 2rem; padding: .45rem 1rem; font-size: .83rem; color: var(--muted); }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: .875rem; }
th, td { padding: .42rem 1rem; white-space: nowrap; height: 53px; border-top: 1px solid var(--border); }
th { height: 42px; background: #f6f8fc; font-size: .78rem; color: var(--muted); }
tbody tr:hover { background: #fbfcfe; }
.problem-id { font-family: ui-monospace, monospace; font-weight: 650; }
.family-value, .date { color: var(--muted); }
.badge {
  display: inline-block;
  padding: .18rem .55rem;
  border-radius: 6px;
  background: #eef1f5;
  color: var(--muted);
  font-size: .8rem;
  font-weight: 650;
}
.badge.claimed { background: #f7eee1; color: #714f20; }
.badge.mine { background: var(--tint); color: var(--accent); }
.empty { text-align: center; color: var(--muted); height: 7rem; }
.pagination { padding: .75rem 1rem; border-top: 1px solid var(--border); color: var(--muted); font-size: .85rem; }
.pagination div { display: flex; gap: .4rem; }

.login { display: grid; min-height: 100svh; place-items: center; padding: 1rem; }
.login-card { width: min(100%, 400px); padding: 1.75rem; }
.login-card .project { margin: 0 0 .35rem; }
.login-card form { display: grid; gap: .65rem; margin-top: 1.5rem; }
.login-card .notice { padding-inline: 0; }

@media (max-width: 600px) {
  .metrics { gap: .4rem; }
  .metrics div { padding: .65rem .55rem; }
  .metrics dd { font-size: 1.35rem; }
  .filters { grid-template-columns: 1fr 1fr; }
  .filters label:first-child { grid-column: 1 / -1; }
}

.row-actions button + button { margin-inline-start: .4rem; }
.history-panel { margin-block-start: 1.2rem; }
.history-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .8rem;
  padding: .8rem 1rem 0;
}
.history-heading h2 { margin: 0; font-size: 1.15rem; }
