:root {
  color-scheme: light;
  font-family: "Avenir Next", ui-sans-serif, system-ui, sans-serif;
  background: #f5f2e9;
  color: #183126;
  --muted: #536659;
  --line: #c8d0c0;
  --paper: #fcfbf5;
  --deep: #1c4938;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; }
a { color: inherit; }
p { margin: 0; }
button, select { font: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid #185d8a; outline-offset: 4px; }
.shell { width: min(1160px, calc(100% - 40px)); margin: 0 auto; }
header { background: var(--paper); border-bottom: 1px solid var(--line); }
.topbar { min-height: 67px; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.topbar a { text-decoration: none; font-weight: 650; font-size: .92rem; }
.brand { display: inline-flex; align-items: center; gap: 10px; }
.intro { padding: 43px 0 28px; }
h1 { margin: 0; font-size: clamp(2.2rem, 6vw, 4.35rem); letter-spacing: -.068em; line-height: 1.04; }
.intro p { margin-top: 12px; color: var(--muted); font-size: 1.03rem; }
.workspace { display: grid; grid-template-columns: minmax(270px, 320px) minmax(0, 1fr); gap: 15px; align-items: start; }
.controls, .results { border: 1px solid var(--line); background: var(--paper); border-radius: 14px; min-width: 0; padding: 20px; }
h2 { margin: 0; font-size: 1.18rem; letter-spacing: -.024em; }
.muted { color: var(--muted); font-size: .84rem; line-height: 1.5; overflow-wrap: anywhere; }
.picker { position: relative; display: flex; flex-wrap: wrap; gap: 7px; margin: 12px 0 7px; }
#files { position: absolute; width: 1px; height: 1px; clip-path: inset(50%); }
.picker:has(#files:focus-visible) label { outline: 2px solid #185d8a; outline-offset: 3px; }
.controls > label { display: block; font-weight: 660; margin: 16px 0 5px; font-size: .86rem; }
select { display: block; width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 7px 9px; min-height: 42px; color: inherit; background: #fffef9; }
button, .button { cursor: pointer; display: inline-flex; align-items: center; justify-content: center; min-height: 40px; border: 1px solid var(--line); border-radius: 8px; background: #f0efe3; padding: 7px 11px; font-size: .84rem; font-weight: 650; color: inherit; }
button:hover, .button:hover { background: #e4e9d9; }
button:disabled, .picker:has(#files:disabled) label { cursor: default; opacity: .52; }
.dark { color: #fffef6; background: var(--deep); border-color: var(--deep); }
.dark:hover { background: #245943; }
.notice { margin-top: 15px; padding: 9px 10px; background: #e8eee0; border-radius: 8px; color: #344b3d; line-height: 1.45; font-size: .84rem; }
.notice[data-error="true"] { background: #f8eddd; color: #763a21; }
.result-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 5px 14px; }
#groups { display: grid; gap: 11px; margin: 13px 0; }
.group { border: 1px solid var(--line); background: #f0f2e7; border-radius: 9px; padding: 12px; }
.group-top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 7px 15px; margin-bottom: 10px; }
.group h3 { margin: 0; font-size: .96rem; letter-spacing: -.01em; }
.group button { min-height: 32px; padding: 6px 8px; font-size: .77rem; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 128px), 1fr)); gap: 8px; }
.card { display: flex; flex-direction: column; min-width: 0; padding: 6px; border: 1px solid var(--line); background: var(--paper); border-radius: 7px; gap: 5px; }
.card img { width: 100%; height: 86px; display: block; object-fit: contain; background: #e8eadf; border-radius: 4px; }
.card button.thumb { min-height: 0; padding: 0; border: 0; background: transparent; margin: 0; }
.card.excluded img { opacity: .48; }
.card h4, .card p { margin: 0; overflow-wrap: anywhere; }
.card h4 { font-size: .75rem; font-weight: 650; line-height: 1.4; }
.card .muted, .card .recommendation { font-size: .72rem; }
.recommendation { color: #246447; font-weight: 700; }
.card button { width: 100%; margin-top: auto; }
.card button[aria-pressed="true"], .group-top button[aria-pressed="true"] { background: #dcead6; border-color: #768f74; }
details { font-size: .82rem; color: var(--muted); margin-bottom: 11px; }
details ul { padding-left: 24px; overflow-wrap: anywhere; }
details summary { cursor: pointer; }
.exports { border-top: 1px solid var(--line); padding-top: 12px; display: flex; justify-content: space-between; align-items: center; gap: 9px; flex-wrap: wrap; }
.buttons { display: flex; flex-wrap: wrap; gap: 7px; }
#preview { width: min(900px, calc(100% - 24px)); max-height: calc(100% - 24px); padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); color: inherit; }
#preview::backdrop { background: #15291cbb; }
.preview-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; }
.preview-head h2 { overflow-wrap: anywhere; }
#preview-photo { display: block; max-width: 100%; max-height: 75vh; margin: 0 auto; object-fit: contain; }
footer { display: flex; gap: 16px; padding: 22px 0; color: var(--muted); font-size: .85rem; }
.policy { max-width: 720px; line-height: 1.65; padding-top: 30px; }
.policy h1 { font-size: 2.3rem; }
.policy h2 { margin: 20px 0 5px; }
.policy p { margin-bottom: 8px; }
@media (max-width: 760px) {
  .workspace { grid-template-columns: minmax(0, 1fr); }
  .intro { padding: 29px 0 20px; }
}
@media (max-width: 410px) { .shell { width: calc(100% - 24px); } .controls, .results { padding: 14px; } }
