:root {
  color-scheme: light;
  --paper: #f7f2e8;
  --surface: #fffaf1;
  --ink: #29231e;
  --muted: #6e5a46;
  --brown: #36251c;
  --dark-brown: #513626;
  --sand: #eee3d1;
  --line: #d9c9ac;
  --gold: #edc686;
  font:
    16px/1.5 system-ui,
    sans-serif;
}
* {
  box-sizing: border-box;
}
body {
  background: var(--paper);
  color: var(--ink);
  margin: 0;
  min-height: 100dvh;
}
button,
input,
select,
textarea {
  font: inherit;
}
button {
  cursor: pointer;
  border: 1px solid var(--dark-brown);
  border-radius: 0.45rem;
  background: var(--dark-brown);
  color: white;
  font-weight: 650;
  min-height: 2.75rem;
  padding: 0.58rem 0.85rem;
}
button:hover {
  filter: brightness(1.09);
}
button:disabled {
  cursor: default;
  opacity: 0.48;
}
:where(button, input, select, textarea, a, summary, [tabindex]):focus-visible {
  outline: 3px solid #8a622f;
  outline-offset: 3px;
}
.secondary {
  color: var(--dark-brown);
  background: var(--surface);
  border-color: #bba17e;
}
.text-button {
  color: var(--dark-brown);
  background: transparent;
  border-color: transparent;
}
.accent {
  background: var(--gold);
  border-color: #d6aa65;
  color: #29231e;
}
.masthead {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem max(1.25rem, calc((100% - 88rem) / 2));
  background: var(--brown);
  color: white;
  border-bottom: 3px solid #b18b50;
}
.brand {
  display: inline-flex;
  gap: 0.7rem;
  align-items: center;
  color: white;
  font-weight: 750;
  text-decoration: none;
  font-size: clamp(1.05rem, 3vw, 1.28rem);
  letter-spacing: -0.025em;
}
.brand img {
  border-radius: 0.38rem;
}
.brand-suffix {
  color: #f0ca88;
}
.storage-label {
  color: #f7f2e8;
  font-size: 0.88rem;
  white-space: nowrap;
}
main {
  max-width: 90.5rem;
  margin: auto;
  padding: clamp(1rem, 3vw, 2rem) 1.25rem 3rem;
  display: grid;
  grid-template-columns: minmax(13rem, 17rem) minmax(0, 1fr);
  gap: clamp(1.2rem, 3.2vw, 3rem);
  align-items: start;
}
aside,
.work-area {
  min-width: 0;
}
.sidebar-heading,
.section-heading,
.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
}
.sidebar-heading,
.section-heading {
  justify-content: space-between;
  margin-bottom: 1rem;
}
.sidebar-heading {
  min-height: 2.75rem;
}
h1,
h2,
p {
  margin: 0;
}
h1 {
  font:
    clamp(2.15rem, 5vw, 4.65rem)/1.01 Georgia,
    serif;
  letter-spacing: -0.045em;
  overflow-wrap: anywhere;
}
h2 {
  font-size: 1.22rem;
  letter-spacing: -0.02em;
}
.match-option {
  text-align: left;
  display: grid;
  gap: 0.18rem;
  width: 100%;
  padding: 0.72rem 0.8rem;
  color: var(--ink);
  background: transparent;
  border-color: transparent;
  overflow-wrap: anywhere;
}
.match-option + .match-option {
  margin-top: 0.32rem;
}
.match-option span,
.subtle,
.footer {
  color: var(--muted);
  font-size: 0.92rem;
}
.match-option[aria-current] {
  border-color: #bba17e;
  background: var(--sand);
  box-shadow: inset 3px 0 #8a622f;
}
.file-actions {
  border-top: 1px solid var(--line);
  display: grid;
  gap: 0.25rem;
  padding-top: 1rem;
  margin-top: 1.15rem;
}
.match-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: end;
  gap: 1rem;
  border-radius: 0.75rem;
  background: linear-gradient(115deg, #36251c, #513626);
  color: white;
  padding: clamp(1.2rem, 4vw, 2.8rem);
  margin-bottom: 1.2rem;
}
.match-header > div {
  min-width: 0;
}
.match-meta {
  color: #f0dfc8;
  font-size: 0.9rem;
}
.match-header h1 {
  margin: 0.55rem 0 0.72rem;
}
.export {
  color: #29231e;
  background: var(--gold);
  border-color: #e0b573;
}
.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  border-bottom: 1px solid var(--line);
  margin-bottom: 1rem;
}
.tabs button {
  background: transparent;
  border: 0;
  border-bottom: 3px solid transparent;
  border-radius: 0.35rem 0.35rem 0 0;
  color: var(--muted);
}
.tabs button:hover,
.tabs button[aria-current] {
  background: var(--sand);
  color: var(--ink);
}
.tabs button[aria-current] {
  border-bottom-color: #8a622f;
}
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  padding: clamp(0.85rem, 2.5vw, 1.7rem);
  margin-bottom: 1rem;
}
.section-heading .subtle,
.share p {
  margin-top: 0.25rem;
}
.badge {
  background: #faedce;
  color: #684715;
  font-weight: 700;
  font-size: 0.84rem;
  padding: 0.3rem 0.62rem;
  border-radius: 2rem;
}
.badge.complete {
  background: #e1eee1;
  color: #205334;
}
.filters,
.form-grid,
.stage-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}
.filters {
  margin-bottom: 1rem;
}
.form-grid .actions {
  grid-column: 1 / -1;
}
label {
  display: grid;
  gap: 0.3rem;
  font-size: 0.9rem;
  font-weight: 650;
}
input:not([type="checkbox"], [type="file"]),
select,
textarea {
  width: 100%;
  min-width: 0;
  min-height: 2.75rem;
  border: 1px solid #bba17e;
  border-radius: 0.35rem;
  padding: 0.48rem 0.6rem;
  color: var(--ink);
  background: #fffaf1;
  font-size: 1rem;
}
select {
  appearance: none;
  padding-right: 1.8rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='m1 1 5 5 5-5' fill='none' stroke='%2336251c' stroke-width='2'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.7rem center;
}
.checkbox {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  align-self: end;
  min-height: 2.75rem;
}
.checkbox input {
  width: 1.2rem;
  height: 1.2rem;
  accent-color: var(--dark-brown);
}
.stage-row {
  grid-template-columns: 2fr 1fr auto;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  padding: 0.75rem;
}
.stage-row legend {
  padding: 0 0.3rem;
  font-weight: 700;
}
.stack,
.share {
  display: grid;
  gap: 1rem;
}
.share details {
  border-top: 1px solid var(--line);
  padding-top: 0.75rem;
}
summary {
  cursor: pointer;
  font-weight: 650;
}
.inline-form {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 0.6rem;
  margin: 0.8rem 0;
}
.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 0.45rem;
}
table {
  border-collapse: collapse;
  width: 100%;
  min-width: 24rem;
}
th,
td {
  padding: 0.62rem 0.8rem;
  text-align: left;
  border-bottom: 1px solid #e5d7c0;
}
thead {
  background: #eee3d1;
  color: #513626;
}
th {
  font-weight: 650;
}
tbody tr:last-child > * {
  border-bottom: 0;
}
.position {
  color: #6e5a46;
  font-weight: 700;
}
.numeric {
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.roster {
  margin: 0;
  padding: 0;
  list-style: none;
}
.roster li {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
  padding: 0.65rem 0;
  border-top: 1px solid var(--line);
}
.roster li > div:first-child {
  display: grid;
  overflow-wrap: anywhere;
}
.notice {
  background: var(--sand);
  color: #513626;
  border: 1px solid #d9c9ac;
  border-radius: 0.5rem;
  margin-bottom: 0.75rem;
  padding: 0.55rem 0.8rem;
}
.notice.error {
  background: #faebe4;
  color: #783126;
  border-color: #dbb2a1;
}
.footer {
  max-width: 88rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.7rem;
  padding: 1rem 1.25rem 2rem;
  margin: auto;
  border-top: 1px solid var(--line);
}
@media (max-width: 750px) {
  main {
    grid-template-columns: 1fr;
  }
  .file-actions {
    display: flex;
    flex-wrap: wrap;
  }
}
@media (max-width: 470px) {
  .storage-label {
    display: none;
  }
  .form-grid,
  .filters,
  .inline-form,
  .stage-row {
    grid-template-columns: minmax(0, 1fr);
  }
}
