:root {
  color-scheme: light;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #29251f;
  background: #E5E2D3;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }

body { margin: 0; min-width: 320px; }

.shell { width: min(100% - 2rem, 1100px); margin-inline: auto; }

.site-header { padding: 2rem 0 1.5rem; color: #fff; background: #564229; }
.site-header h1 { margin: 0; font-size: clamp(1.8rem, 5vw, 2.7rem); }
.site-header p { margin: .4rem 0 0; }
.eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: .75rem; }

main { padding-block: 1.25rem 2rem; }
.panel { margin-block: 1rem; padding: clamp(1rem, 3vw, 1.5rem); background: #fffdf7; border: 1px solid #d5cfbf; border-radius: .75rem; box-shadow: 0 2px 8px #2c211211; }
.panel h2 { margin: 0 0 1rem; color: #453521; font-size: 1.35rem; }

label, .redirect-row > span { display: block; margin-bottom: .4rem; font-weight: 650; }
input, button { font: inherit; }
input:not([type="file"]) { min-height: 2.65rem; width: 100%; padding: .5rem .7rem; border: 1px solid #817866; border-radius: .35rem; }
input:focus-visible, button:focus-visible, a:focus-visible { outline: 3px solid #407E01; outline-offset: 2px; }
button, .file-picker { min-height: 2.65rem; padding: .55rem .85rem; border: 0; border-radius: .35rem; color: #fff; background: #453521; font-weight: 650; cursor: pointer; }
button:hover:not(:disabled), .file-picker:hover { background: #564229; }
button:disabled { opacity: .48; cursor: not-allowed; }
.button-secondary { color: #453521; background: #eee9dc; border: 1px solid #a69b84; }
.button-secondary:hover:not(:disabled) { background: #e2dbc8; }

.input-row, .button-row, .redirect-row { display: flex; align-items: center; gap: .65rem; flex-wrap: wrap; }
.input-row input { flex: 1 1 15rem; }
.redirect-row { margin-top: 1.1rem; align-items: baseline; }
.redirect-row code { flex: 1 1 20rem; overflow-wrap: anywhere; }
.muted { color: #665f52; }
.details-grid { display: grid; grid-template-columns: minmax(7rem, 10rem) 1fr; gap: .55rem 1rem; margin-block: 1.1rem; }
.details-grid dt { font-weight: 650; }
.details-grid dd { margin: 0; overflow-wrap: anywhere; }
.notice { margin-block: 1rem; padding: .85rem 1rem; border-left: 4px solid #407E01; background: #edf4e6; border-radius: .25rem; }
.notice--warning { border-left-color: #9a5c00; background: #fff3da; }
.file-controls { display: grid; gap: .65rem; margin-block: 1rem; }
.toggle-row { display: flex; align-items: flex-start; gap: .55rem; margin-block: .8rem; }
.toggle-row input { width: auto; min-height: 1rem; margin-top: .25rem; }
.diagnostic-controls { display: flex; flex-wrap: wrap; gap: .6rem; margin-block: .8rem; }
.id-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: .8rem; }
.diagnostic-output { max-height: 20rem; overflow: auto; padding: .8rem; background: #f3efe5; border: 1px solid #d5cfbf; border-radius: .35rem; white-space: pre-wrap; overflow-wrap: anywhere; }
textarea { display: block; width: 100%; padding: .65rem; border: 1px solid #817866; border-radius: .35rem; font: .85rem ui-monospace, SFMono-Regular, Consolas, monospace; }
.file-picker { display: inline-flex; align-items: center; justify-content: center; width: fit-content; }
.file-picker + input[type="file"] { position: absolute; width: 1px; height: 1px; opacity: 0; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th, td { padding: .7rem .55rem; border-bottom: 1px solid #ded8ca; vertical-align: middle; }
th { background: #f3efe5; }
.empty-state { color: #665f52; text-align: center; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.section-heading h2 { margin-bottom: 0; }
.log-list { max-height: 17rem; overflow: auto; padding-left: 1.5rem; }
.log-list li { padding: .35rem 0; overflow-wrap: anywhere; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .85rem; }
.site-footer { padding-block: 0 2rem; color: #665f52; font-size: .9rem; }
.callback-panel { margin-top: 15vh; padding: 2rem; background: #fffdf7; border-radius: .75rem; }

@media (max-width: 600px) {
  .shell { width: min(100% - 1rem, 1100px); }
  .details-grid { grid-template-columns: 1fr; gap: .2rem; }
  .details-grid dd { margin-bottom: .55rem; }
  .button-row > button { flex: 1 1 100%; }
  .diagnostic-controls > button { flex: 1 1 100%; }
  th, td { white-space: nowrap; }
}
