@font-face { font-family: "Commissioner"; src: url("/assets/Commissioner-Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Commissioner"; src: url("/assets/Commissioner-Medium.ttf") format("truetype"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Noto Serif Display"; src: url("/assets/NotoSerifDisplay-LightItalic.ttf") format("truetype"); font-weight: 300; font-style: italic; font-display: swap; }

:root {
  --offwhite: #F2EDE7;
  --sand: #D8D2C8;
  --sage: #909990;
  --black: #111111;
  --ink-2: #4a4a47;
  --ok: #5f6f5f;
  --bad: #8a3b2e;
  --radius: 14px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--offwhite);
  color: var(--black);
  font: 400 16px/1.5 "Commissioner", system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input { font: inherit; color: inherit; }

.page {
  min-height: 100dvh;
  max-width: 560px;
  margin: 0 auto;
  padding: max(20px, env(safe-area-inset-top)) 20px max(24px, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
}

.top { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 8px 0 28px; }
.logo { width: min(230px, 58vw); height: auto; display: block; }

.lang { display: inline-flex; border: 1px solid var(--sand); border-radius: 999px; padding: 3px; }
.lang button {
  border: 0; background: transparent; padding: 6px 12px; min-height: 36px; border-radius: 999px;
  font-size: 13px; font-weight: 500; letter-spacing: .04em; cursor: pointer; color: var(--ink-2);
}
.lang button[aria-pressed="true"] { background: var(--black); color: var(--offwhite); }

main { flex: 1; }
h1 {
  font: italic 300 clamp(34px, 9vw, 46px)/1.08 "Noto Serif Display", Georgia, serif;
  margin: 8px 0 10px; letter-spacing: -.01em;
}
.lead { margin: 0 0 28px; color: var(--ink-2); }

.field { margin-bottom: 16px; }
label { display: block; font-size: 14px; font-weight: 500; margin-bottom: 6px; }
input[type="text"] {
  width: 100%; min-height: 50px; padding: 12px 14px;
  font-size: 16px; /* 16px keeps iOS from zooming in */
  background: #fbf9f6; border: 1px solid var(--sand); border-radius: var(--radius);
  outline: none; transition: border-color .15s, box-shadow .15s;
}
input[type="text"]:focus { border-color: var(--sage); box-shadow: 0 0 0 3px rgba(144,153,144,.25); }
input[aria-invalid="true"] { border-color: var(--bad); }

.drop {
  margin-top: 8px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  min-height: 150px; padding: 24px; text-align: center;
  border: 1.5px dashed var(--sage); border-radius: var(--radius); background: rgba(216,210,200,.25);
  cursor: pointer; transition: background .15s, border-color .15s; color: var(--ink-2);
  -webkit-tap-highlight-color: transparent;
}
.drop svg { width: 30px; height: 30px; color: var(--black); }
.drop:hover, .drop.over { background: rgba(216,210,200,.55); border-color: var(--black); }
.drop:focus-visible { outline: 2px solid var(--black); outline-offset: 3px; }
.drop[aria-disabled="true"] { opacity: .5; pointer-events: none; }
.drop-touch { display: none; }
@media (hover: none) and (pointer: coarse) {
  .drop-desk { display: none; }
  .drop-touch { display: inline; }
}

.hint { font-size: 13px; color: var(--ink-2); margin: 10px 0 0; }
.muted { color: var(--ink-2); }

.list { list-style: none; margin: 18px 0 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.item { min-width: 0; border: 1px solid var(--sand); border-radius: var(--radius); padding: 12px 14px; background: #fbf9f6; }
.item .row { display: flex; align-items: center; gap: 10px; }
.item .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; }
.item .sz { font-size: 13px; color: var(--ink-2); white-space: nowrap; }
.item .x {
  border: 0; background: transparent; width: 36px; height: 36px; margin: -8px -8px -8px 0; border-radius: 50%;
  cursor: pointer; color: var(--ink-2); font-size: 20px; line-height: 1;
}
.item .x:hover { background: var(--sand); color: var(--black); }
.item .meta { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; color: var(--ink-2); margin-top: 6px; }
.item .msg { font-size: 13px; margin-top: 6px; color: var(--bad); }
.item.ok .meta .st { color: var(--ok); }
.item.bad { border-color: rgba(138,59,46,.45); }
.item .retry {
  margin-top: 8px; border: 1px solid var(--black); background: transparent; border-radius: 999px;
  padding: 6px 14px; min-height: 36px; font-size: 14px; cursor: pointer;
}

.bar { height: 6px; background: var(--sand); border-radius: 999px; overflow: hidden; margin-top: 8px; }
.bar i { display: block; height: 100%; width: 0; background: var(--black); border-radius: inherit; transition: width .25s linear; }
.item.ok .bar i { background: var(--sage); }

.overall { margin-top: 20px; padding: 14px; border-radius: var(--radius); background: rgba(216,210,200,.4); }
.overall .row { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; font-weight: 500; }
.overall .hint { margin-top: 8px; }

.error { margin: 16px 0 0; padding: 12px 14px; border-radius: var(--radius); background: rgba(138,59,46,.08); color: var(--bad); font-size: 14px; }

.ts { margin-top: 20px; min-height: 0; }
.ts:empty { margin-top: 0; }

.btn {
  margin-top: 20px; width: 100%; min-height: 54px; border: 0; border-radius: 999px;
  background: var(--black); color: var(--offwhite); font-size: 16px; font-weight: 500; letter-spacing: .02em;
  cursor: pointer; transition: opacity .15s, transform .1s;
}
.btn:active { transform: scale(.99); }
.btn:disabled { opacity: .45; cursor: default; }
.btn-ghost { background: transparent; color: var(--black); border: 1px solid var(--black); }

.done { margin-top: 8px; padding: 24px 20px; border-radius: var(--radius); background: rgba(144,153,144,.18); }
.done h2 { font: italic 300 32px/1.1 "Noto Serif Display", Georgia, serif; margin: 0 0 8px; }
.done p { margin: 0; color: var(--ink-2); }

.foot {
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  margin-top: 40px; padding-top: 16px; border-top: 1px solid var(--sand);
  font-size: 13px; color: var(--ink-2);
}
.foot a { color: inherit; text-underline-offset: 3px; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
