:root {
  color-scheme: light;
  color: #14264b;
  background: #edf3fc;
  font: 100%/1.5 Aptos, "Segoe UI", system-ui, sans-serif;
  --ink: #14264b;
  --muted: #435674;
  --blue: #244e91;
  --line: #bfcee4;
  --yellow: #ffe076;
  --orange: #ffac58;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }
button, select, textarea, input { font: inherit; }
button, select { min-height: 2.75rem; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .48; }
:focus-visible { outline: 3px solid #387aca; outline-offset: 3px; }
.wrap { width: min(100% - 3rem, 74rem); margin-inline: auto; }
.skip { position: fixed; z-index: 3; inset: .75rem auto auto .75rem; transform: translateY(-200%); background: white; padding: .65rem; }
.skip:focus { transform: none; }

.hero {
  color: white;
  padding-block: 1.35rem clamp(2rem, 4vw, 3rem);
  background: linear-gradient(110deg, #14264b 20%, #214a81);
  border-bottom: .22rem solid var(--yellow);
}
.home { display: inline-flex; align-items: center; gap: .55rem; min-height: 2.75rem; color: #e6efff; font-weight: 700; text-decoration: none; }
.home:hover { text-decoration: underline; }
.home:focus-visible { outline-color: var(--yellow); }
.hero h1 { margin: .75rem 0 .3rem; color: var(--yellow); font-size: clamp(2rem, 4.8vw, 3.45rem); letter-spacing: -.05em; line-height: 1.08; }
.hero p { color: #e6efff; margin: .75rem 0 0; }

.workspace { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 1.25rem; align-items: start; padding-block: 1.6rem 3.5rem; }
.panel { min-width: 0; background: white; border: 1px solid #d6e2f2; border-radius: .95rem; padding: clamp(1rem, 2.6vw, 1.6rem); box-shadow: 0 4px 15px #152b4e0c; }
h2 { font-size: 1.4rem; letter-spacing: -.032em; margin: 0; line-height: 1.25; }
.panel-heading p { color: var(--muted); margin: .45rem 0 1.15rem; }
.lists { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .7rem; }
.lists label { display: grid; grid-template-rows: minmax(3.05rem, 1fr) auto; }
label, legend { font-weight: 700; font-size: .9rem; }
.lists small { display: block; margin-bottom: .22rem; font-size: .8rem; font-weight: 500; color: var(--muted); }
textarea, select { width: 100%; min-width: 0; color: var(--ink); background: white; border: 1px solid var(--line); border-radius: .5rem; }
textarea { display: block; resize: vertical; padding: .65rem; font: .9rem/1.55 ui-monospace, "Cascadia Code", Consolas, monospace; }
textarea::placeholder { color: #566783; opacity: 1; }
.lists textarea { background: #f8fbff; min-height: 7rem; }
select {
  appearance: none;
  padding: .45rem 2.1rem .45rem .65rem;
  background:
    linear-gradient(45deg, transparent 50%, var(--ink) 51%) right .95rem center / .32rem .32rem no-repeat,
    linear-gradient(135deg, var(--ink) 50%, transparent 51%) right .63rem center / .32rem .32rem no-repeat,
    white;
}
select:disabled { color: var(--muted); background-color: #f5f8fd; }
.matches { padding: 0; border: 0; margin: 1.25rem 0 0; min-width: 0; }
legend { padding: 0; margin-bottom: .4rem; }
.match-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .65rem; }
.match-options label { display: flex; align-items: flex-start; gap: .55rem; padding: .64rem; cursor: pointer; border: 1px solid var(--line); border-radius: .5rem; }
.match-options label:has(input:checked) { border-color: #658ccb; background: #edf4ff; }
.match-options span { min-width: 0; }
.match-options code { display: block; margin-top: .1rem; color: var(--muted); font-weight: 500; overflow-wrap: anywhere; }
input[type="checkbox"] { flex: none; width: 1.08rem; height: 1.08rem; margin: .14rem 0 0; accent-color: var(--blue); }
.options { display: flex; align-items: end; flex-wrap: wrap; gap: .7rem 1.15rem; margin-top: 1.15rem; }
.separator { display: grid; gap: .28rem; width: 8.3rem; }
.cleanup { display: grid; gap: .38rem; }
.cleanup label { display: flex; gap: .5rem; align-items: center; font-weight: 500; cursor: pointer; }
.cleanup input { margin-top: 0; }
.form-actions, .result-actions { display: flex; flex-wrap: wrap; gap: .55rem; margin-top: 1rem; }
button { border: 1px solid transparent; padding: .52rem .95rem; border-radius: .5rem; font-weight: 700; font-size: .9rem; }
.primary { background: var(--orange); color: var(--ink); }
.primary:hover { background: #ff963f; }
.secondary { background: var(--blue); color: white; }
.secondary:hover:enabled { background: #183b73; }
.quiet { background: white; color: var(--ink); border-color: var(--line); }
.quiet:hover:enabled { background: #eef4fd; }
.results-header { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: .35rem .7rem; }
output { font-size: .9rem; color: var(--muted); }
.result-tools { display: flex; align-items: center; gap: .65rem; margin: .95rem 0 .55rem; }
.result-tools select { width: auto; max-width: 100%; font-size: .9rem; }
.results textarea { min-height: 14rem; background: #f5f8fd; }
.status { color: var(--muted); min-height: 1.35rem; font-size: .875rem; margin: .5rem 0 0; }
.status[data-error] { color: #9a322d; }
.status:empty { min-height: 0; margin: 0; }

@media (max-width: 59rem) {
  .workspace { grid-template-columns: minmax(0, 1fr); }
  .results textarea { height: 14rem; }
}
@media (max-width: 35rem) {
  .lists { grid-template-columns: minmax(0, 1fr); }
  .lists label { display: block; }
  .lists small { display: inline; margin-left: .25rem; }
  .lists textarea { margin-top: .28rem; height: 5.5rem; min-height: 5.5rem; }
  .wrap { width: calc(100% - 1.5rem); }
}
@media (max-width: 24rem) {
  .match-options label { padding-inline: .4rem; gap: .35rem; }
}
@media (forced-colors: active) {
  select { appearance: auto; }
  button { border: 1px solid ButtonText; }
}
