:root {
  font-family: "Avenir Next", Avenir, "Segoe UI", sans-serif;
  color: #242119;
  background: #f7f7f1;
  font-weight: 500;
  --accent: #ef653d;
  --border: #d7d5c8;
  --muted: #5a574a;
  --card: #fffef7;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .55; }
a { color: inherit; }
.top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 66px;
  padding: 0 max(24px, calc((100% - 1080px) / 2));
  border-bottom: 1px solid var(--border);
  font-size: .89rem;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 700; }
.mark { display: grid; grid-template-columns: repeat(2, 5px); gap: 2px; padding: 6px; background: var(--accent); border-radius: 4px; }
.mark i { display: block; height: 5px; border: 1px solid #242119; }
main { max-width: 1128px; padding: 0 24px; margin: auto; }
.intro { display: grid; grid-template-columns: 1fr 1fr; align-items: end; gap: 34px; padding: 48px 0 32px; }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(3.3rem, 8vw, 5.5rem); line-height: .93; letter-spacing: -.085em; font-weight: 750; }
.intro p { font-size: clamp(1.08rem, 2.3vw, 1.35rem); line-height: 1.42; color: var(--muted); max-width: 16em; padding-bottom: 2px; }
.workspace { display: grid; grid-template-columns: 1.33fr 1fr; border: 1px solid var(--border); border-radius: 17px; background: var(--card); overflow: hidden; }
.upload, .settings { min-width: 0; padding: 22px; }
.settings { border-left: 1px solid var(--border); }
h2 { font-size: 1.2rem; font-weight: 750; letter-spacing: -.035em; }
.drop { min-height: 255px; border: 1px dashed #aaa68e; border-radius: 12px; margin-top: 15px; display: grid; place-items: center; align-content: center; gap: 10px; padding: 19px 10px; background: #f7f4e8; }
.drop.active { outline: 3px solid var(--accent); outline-offset: -3px; }
.drop p, .queue-head p { font-size: .89rem; }
.tiles { display: flex; align-items: center; justify-content: center; min-height: 94px; padding: 0 6px; }
.tiles img { object-fit: cover; border: 4px solid white; border-radius: 8px; box-shadow: 0 4px 10px #33291529; background: #dce3cd; }
.tiles img:first-child { transform: rotate(-10deg); margin-right: -15px; }
.tiles img:nth-child(2) { transform: rotate(2deg); z-index: 1; background: #f7cc72; }
.tiles img:last-child { transform: rotate(10deg); margin-left: -12px; }
.settings h2 { margin-bottom: 14px; }
.dimension-row, .segments { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.dimension-row label, legend { font-weight: 700; font-size: .84rem; }
.dimension-row label span { color: var(--muted); font-weight: 500; }
input[type="number"] { display: block; width: 100%; border: 1px solid var(--border); background: #fff; color: inherit; min-height: 41px; padding: 6px 10px; border-radius: 6px; margin-top: 4px; }
fieldset { border: 0; margin: 14px 0 0; padding: 0; min-width: 0; }
legend { margin-bottom: 4px; padding: 0; }
.segments label { position: relative; }
.segments input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.segments span { display: grid; place-items: center; min-height: 39px; border-radius: 6px; border: 1px solid var(--border); color: var(--muted); padding: 5px 6px; text-align: center; font-size: .84rem; cursor: pointer; }
.segments input:checked + span { border-color: #34291c; background: #fbe8d8; color: #282315; font-weight: 700; }
.segments input:focus-visible + span { outline: 2px solid #7841a1; outline-offset: 2px; }
.segments input:disabled + span { opacity: .65; cursor: default; }
.hint, .privacy-note, footer { color: var(--muted); font-size: .77rem; line-height: 1.45; }
.hint { margin-top: 7px; min-height: 2.2em; }
.actions { display: flex; align-items: center; gap: 14px; }
.actions .primary { flex: 1; }
.privacy-note { margin-top: 8px; }
.primary, .secondary { border: 1px solid #27231b; border-radius: 7px; padding: 8px 16px; min-height: 39px; color: #211c16; font-weight: 750; font-size: .88rem; }
.primary { background: var(--accent); }
.secondary { background: white; }
.primary:hover:not(:disabled), .secondary:hover:not(:disabled) { box-shadow: 0 2px 0 #27231b; }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 2px solid #7841a1; outline-offset: 2px; }
.link { border: 0; background: transparent; padding: 2px; color: inherit; font-size: .82rem; text-decoration: underline; text-underline-offset: 2px; }
.queue { margin-top: 12px; }
.queue-head, .results-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
ul { list-style: none; padding: 0; margin: 8px 0 0; }
#file-list { max-height: 136px; overflow: auto; }
#file-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto; border-top: 1px solid var(--border); padding: 5px 0; gap: 10px; align-items: center; font-size: .78rem; }
#file-list span, .card strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.status { min-height: 20px; margin: 12px 0; font-size: .86rem; }
.status.error, .card .failure { color: #842719; }
.results { padding: 18px 0 26px; border-top: 1px solid var(--border); }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(218px, 100%), 1fr)); gap: 12px; margin-top: 14px; }
.card { min-width: 0; display: grid; gap: 8px; border: 1px solid var(--border); background: var(--card); border-radius: 10px; padding: 12px; font-size: .84rem; }
.preview { min-height: 140px; display: grid; place-items: center; border: 1px solid #e9e7de; border-radius: 5px; background: #f1eee4; }
.card img { max-width: 100%; max-height: 128px; width: auto; height: auto; display: block; object-fit: contain; background: repeating-conic-gradient(#e9e7de 0% 25%, #faf8ef 0% 50%) 0 0 / 14px 14px; border-radius: 5px; }
.card p { color: var(--muted); font-size: .76rem; }
.card a { justify-self: start; }
footer { max-width: 1128px; padding: 12px 24px 26px; margin: auto; }
@media (max-width: 715px) {
  .intro, .workspace { grid-template-columns: 1fr; }
  .intro { gap: 16px; padding-top: 32px; }
  .settings { border-left: 0; border-top: 1px solid var(--border); }
}
@media (max-width: 390px) {
  main { padding: 0 14px; }
  .top, footer { padding-inline: 14px; }
  .upload, .settings { padding: 14px; }
  .tiles img { width: 78px; height: 76px; }
}
.info { padding-block: 45px 60px; }
.info h1 { font-size: clamp(2.8rem, 7.4vw, 5rem); margin-bottom: 32px; }
.info section { max-width: 680px; border-top: 1px solid var(--border); padding: 19px 0 24px; }
.info section p { margin-top: 10px; line-height: 1.55; }
