/* Proxymaker: warm black and gold, Epilogue with JetBrains Mono for figures. */

@font-face { font-family: "Epilogue"; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url("fonts/epilogue-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Epilogue"; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url("fonts/epilogue-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 400 500; font-display: swap;
  src: url("fonts/jetbrains-mono-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 400 500; font-display: swap;
  src: url("fonts/jetbrains-mono-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  --bg: #0c0a08;
  --bg-side: #100d0a;
  --surface: #181512;
  --surface-2: #211d19;
  --surface-3: #2c2721;
  --line: rgba(255, 236, 210, .08);
  --line-strong: rgba(255, 236, 210, .16);
  --ink: #f7f3ec;
  --muted: #a8a198;
  --faint: #8f8a84;
  --accent: #c9a45a;
  --accent-strong: #dcbb76;
  --accent-soft: rgba(201, 164, 90, .14);
  --accent-ink: #0c0a08;
  --danger: #ff9a85;
  --font: "Epilogue", "Segoe UI", system-ui, sans-serif;
  --mono: "JetBrains Mono", Consolas, ui-monospace, monospace;
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 20px;
  --card-r: 4.6% / 3.3%;
  --tile-w: 200px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --ease-enter: cubic-bezier(.22, 1, .36, 1);
  --m-in: 150ms;
  --m-out: 120ms;
  --m-press: 90ms;
  --m-panel: 200ms;
  --m-slide: 240ms;
  color-scheme: dark;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { display: grid; grid-template-rows: auto 1fr auto; overflow: hidden; background: var(--bg); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
svg { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
h1, h2 { margin: 0; font-weight: 400; letter-spacing: -0.035em; line-height: 1.1; }
h1 { font-size: 34px; }
h2 { font-size: 17px; font-weight: 500; letter-spacing: -0.015em; }
strong { font-weight: 600; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
::selection { background: rgba(201, 164, 90, .35); }
.label, .field > label { font-size: 13px; font-weight: 500; color: var(--muted); }
.hint { margin: 0; font-size: 13px; color: var(--faint); line-height: 1.45; }
.summary { font-family: var(--mono); font-size: 13px; color: var(--muted); }

/* Top bar ------------------------------------------------------------------------------------ */
.topbar {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 20px;
  height: 64px; padding: 0 20px 0 22px; border-bottom: 1px solid var(--line); background: var(--bg);
}
.brand { display: flex; align-items: center; gap: 11px; min-width: 0; }
.logo { width: 30px; height: 30px; stroke: var(--accent); stroke-width: 1.6; }
.logo rect:first-child { fill: var(--bg); opacity: .65; }
.logo rect:last-child { fill: var(--accent-soft); }
.brand-name { font-size: 19px; font-weight: 500; letter-spacing: -0.03em; }
.views { position: relative; display: flex; padding: 4px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); }
.view-indicator { position: absolute; left: 0; top: 4px; bottom: 4px; width: 0; border-radius: 999px; background: var(--ink); transition: transform var(--m-slide) var(--ease), width var(--m-slide) var(--ease); }
.view-tab { position: relative; z-index: 1; display: flex; align-items: center; gap: 8px; border: 0; background: none; padding: 7px 18px; border-radius: 999px; color: var(--muted); font-weight: 500; transition: color var(--m-slide) var(--ease); }
.view-tab:hover { color: var(--ink); }
.view-tab.active { color: var(--bg); }
.count { font-family: var(--mono); font-size: 13px; opacity: .75; }
.top-actions { display: flex; justify-content: flex-end; align-items: center; gap: 10px; }
.language-switch { display: flex; gap: 2px; height: 40px; padding: 3px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); }
.language-switch button {
  min-width: 36px; padding: 0 9px; border: 0; border-radius: 999px; background: none; color: var(--muted);
  font-family: var(--mono); font-size: 12px; letter-spacing: .04em; transition: background var(--m-out) var(--ease), color var(--m-out) var(--ease);
}
.language-switch button:hover { color: var(--ink); transition-duration: var(--m-in); }
.language-switch button[aria-checked="true"] { background: var(--surface-3); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-strong); }
.icon-button.large { width: 40px; height: 40px; }
.icon-button.large svg { width: 19px; height: 19px; }
.update-pill {
  height: 28px; margin-left: 4px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--accent);
  background: var(--accent-soft); color: var(--accent-strong); font-size: 13px; font-weight: 500; white-space: nowrap;
  animation: fade var(--m-panel) var(--ease); transition: background var(--m-out) var(--ease);
}
.update-pill:hover { background: rgba(201, 164, 90, .26); transition-duration: var(--m-in); }

/* Buttons and fields ------------------------------------------------------------------------ */
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px; height: 40px; padding: 0 16px;
  border-radius: 999px; border: 1px solid var(--line-strong); background: transparent; font-weight: 500; white-space: nowrap;
  transition: background var(--m-out) var(--ease), border-color var(--m-out) var(--ease), color var(--m-out) var(--ease), transform var(--m-out) var(--ease), opacity var(--m-out);
}
.button:disabled { opacity: .4; cursor: default; }
.button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; padding: 0 8px 0 20px; }
.button.primary:not(:has(.export-count:not([hidden]))) { padding: 0 20px; }
.button.small { height: 34px; padding: 0 14px; font-size: 14px; }
.button.wide { width: 100%; }
.button.danger { border-color: rgba(255, 154, 133, .5); color: var(--danger); }
.button kbd { font-family: var(--mono); font-size: 13px; color: var(--faint); }
@media (hover: hover) and (pointer: fine) {
  .button:hover:not(:disabled) { background: var(--surface-2); border-color: rgba(255, 236, 210, .28); transform: translateY(-1px); transition-duration: var(--m-in); }
  .button.primary:hover:not(:disabled) { background: var(--accent-strong); border-color: var(--accent-strong); }
  .button.danger:hover:not(:disabled) { background: rgba(255, 154, 133, .1); }
}
.button:active:not(:disabled) { transform: translateY(1px) scale(.985); transition-duration: var(--m-press); }
.export-count { height: 28px; display: inline-flex; align-items: center; padding: 0 10px; border-radius: 999px; background: rgba(12, 10, 8, .14); font-family: var(--mono); font-size: 13px; font-weight: 500; }

.icon-button {
  display: inline-grid; place-items: center; width: 32px; height: 32px; padding: 0; border-radius: 999px;
  border: 1px solid var(--line-strong); background: transparent; font-size: 17px; line-height: 1;
  transition: background var(--m-out) var(--ease), border-color var(--m-out) var(--ease), transform var(--m-out) var(--ease), color var(--m-out);
}
.icon-button svg { width: 16px; height: 16px; }
@media (hover: hover) and (pointer: fine) {
  .icon-button:hover:not(:disabled) { background: var(--surface-2); border-color: rgba(255, 236, 210, .28); transform: translateY(-1px); transition-duration: var(--m-in); }
}
.icon-button:active:not(:disabled) { transform: translateY(1px) scale(.97); transition-duration: var(--m-press); }
.icon-button:disabled { opacity: .35; cursor: default; }

.link-button {
  border: 0; padding: 2px 0; background: linear-gradient(currentColor, currentColor) 100% 100% / 0 1px no-repeat;
  color: var(--accent); font-size: 14px; transition: background-size var(--m-out) var(--ease);
}
.link-button:hover { background-size: 100% 1px; background-position: 0 100%; transition-duration: var(--m-in); }

input[type="number"], input[type="search"], select, textarea {
  width: 100%; height: 42px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: var(--r-sm);
  background: var(--bg); transition: border-color 140ms var(--ease), box-shadow 140ms var(--ease);
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(201, 164, 90, .18); }
select { appearance: none; padding-right: 34px; background: var(--bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a8a198' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3C/svg%3E") right 10px center / 16px no-repeat; }
textarea { height: 140px; min-height: 110px; padding: 12px 14px; resize: vertical; font-family: var(--mono); font-size: 13.5px; line-height: 1.65; }
textarea::placeholder, input::placeholder { color: #6f6a64; }
input[type="range"] { width: 100%; height: 20px; margin: 0; appearance: none; background: transparent; }
input[type="range"]::-webkit-slider-runnable-track { height: 4px; border-radius: 4px; background: var(--surface-3); }
input[type="range"]::-webkit-slider-thumb { appearance: none; width: 16px; height: 16px; margin-top: -6px; border-radius: 50%; background: var(--ink); border: 3px solid var(--bg); box-shadow: 0 0 0 1px var(--line-strong); transition: transform var(--m-out) var(--ease); }
input[type="range"]:hover::-webkit-slider-thumb { transform: scale(1.12); }
input[type="range"]:focus-visible { outline: none; }
input[type="range"]:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 3px rgba(201, 164, 90, .45); }

/* Layout -------------------------------------------------------------------------------------- */
.layout { display: grid; grid-template-columns: 340px 1fr; min-height: 0; }
.sidebar { display: flex; flex-direction: column; overflow-y: auto; border-right: 1px solid var(--line); background: var(--bg-side); }
.group { display: flex; flex-direction: column; gap: 14px; padding: 22px 22px 24px; border-bottom: 1px solid var(--line); }
.group-head { display: flex; align-items: baseline; justify-content: space-between; }
.group-links { display: flex; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 8px; }
.field > label { display: flex; justify-content: space-between; }
.field output { font-family: var(--mono); color: var(--ink); }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field.disabled { opacity: .35; pointer-events: none; }
.number { position: relative; }
.number input { font-family: var(--mono); font-size: 14px; padding-right: 40px; }
.number span { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--faint); font-family: var(--mono); font-size: 13px; pointer-events: none; }
.color { display: flex; align-items: center; gap: 10px; }
.color input { width: 42px; height: 30px; padding: 0; border: 1px solid var(--line-strong); border-radius: 999px; background: none; cursor: pointer; }
.color input::-webkit-color-swatch-wrapper { padding: 3px; }
.color input::-webkit-color-swatch { border: 0; border-radius: 999px; }
.color span { font-family: var(--mono); font-size: 13px; color: var(--muted); }

.segmented { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; padding: 4px; border-radius: var(--r-md); background: var(--bg); border: 1px solid var(--line); }
.segmented button {
  display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 9px 2px 7px; border: 0; border-radius: var(--r-sm);
  background: none; color: var(--muted); font-size: 13px; transition: background var(--m-out) var(--ease), color var(--m-out) var(--ease);
}
.segmented button svg { width: 20px; height: 20px; }
.segmented button:hover { color: var(--ink); background: var(--surface); transition-duration: var(--m-in); }
.segmented button[aria-checked="true"] { background: var(--surface-3); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-strong); }
.segmented button[aria-checked="true"] svg { stroke: var(--accent); }

.inline-field { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 12px; margin: 4px 0 14px; }
.inline-field select { width: auto; min-width: 150px; }
.sheet-fit { margin: 8px 0 0; font-family: var(--mono); font-size: 13px; color: var(--muted); }
.segmented.three { grid-template-columns: repeat(3, 1fr); }
.back-choice { display: flex; align-items: center; gap: 12px; margin-top: 10px; }
.back-choice img { width: 46px; aspect-ratio: 63 / 88; object-fit: cover; border-radius: 3px; border: 1px solid var(--line-strong); background: var(--surface-2); }
.back-text { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; min-width: 0; }
#back-name { max-width: 100%; font-size: 13px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#back-hint { margin-top: 8px; }
.switch { display: grid; grid-template-columns: 38px 1fr; gap: 12px; align-items: start; cursor: pointer; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.track { position: relative; width: 38px; height: 22px; margin-top: 1px; border-radius: 999px; background: var(--surface-3); border: 1px solid var(--line-strong); transition: background var(--m-in) var(--ease), border-color var(--m-in) var(--ease); }
.track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--muted); transition: transform 180ms var(--ease), background 180ms var(--ease); }
.switch input:checked + .track { background: var(--accent); border-color: var(--accent); }
.switch input:checked + .track::after { transform: translateX(16px); background: var(--accent-ink); }
.switch input:focus-visible + .track { outline: 2px solid var(--accent); outline-offset: 2px; }
.switch-text { font-size: 14px; font-weight: 500; }
.switch-text small { display: block; margin-top: 3px; color: var(--faint); font-size: 13px; font-weight: 400; line-height: 1.45; }
.print-note { margin: 0; padding: 18px 22px 22px; color: var(--faint); font-size: 13px; line-height: 1.5; }
.print-note strong { color: var(--muted); font-weight: 500; }
.print-note .link-button { display: block; margin-top: 8px; }

.workspace { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: radial-gradient(1200px 500px at 50% -260px, rgba(201, 164, 90, .07), transparent 70%), var(--bg); }
.view { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.toolbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; padding: 30px 34px 22px; }
.toolbar-title { display: flex; align-items: baseline; gap: 16px; min-width: 0; }
.toolbar-title .summary { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.toolbar-tools { display: flex; align-items: center; gap: 16px; }
.size-control { display: flex; align-items: center; gap: 10px; color: var(--faint); }
.size-control input { width: 110px; }

/* Card grid ------------------------------------------------------------------------------------ */
.grid-scroll { position: relative; flex: 1; overflow-y: auto; padding: 4px 34px 40px; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(var(--tile-w), 1fr)); gap: 34px 26px; }
.tile { display: flex; flex-direction: column; gap: 12px; min-width: 0; animation: rise 260ms var(--ease-enter) both; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
.tile-art {
  position: relative; display: block; width: 100%; aspect-ratio: 63 / 88; padding: 0; border: 0; border-radius: var(--card-r);
  background: var(--surface); overflow: hidden; box-shadow: 0 1px 0 rgba(255, 255, 255, .06) inset, 0 14px 30px -12px rgba(0, 0, 0, .8);
  transition: transform 120ms var(--ease), box-shadow 120ms var(--ease);
}
.tile-art img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 400ms var(--ease); }
.tile-art .placeholder { position: absolute; inset: 0; display: grid; place-items: center; padding: 16px; text-align: center; color: var(--muted); }
.hover-hint {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -40%); white-space: nowrap; padding: 6px 12px; border-radius: 999px;
  background: rgba(12, 10, 8, .86); color: var(--ink); font-size: 13px; font-weight: 500; opacity: 0;
  transition: opacity var(--m-out) var(--ease), transform var(--m-out) var(--ease);
}
@media (hover: hover) and (pointer: fine) {
  .tile-art:hover { transform: translateY(-2px); box-shadow: 0 1px 0 rgba(255, 255, 255, .08) inset, 0 22px 36px -14px rgba(0, 0, 0, .9); transition-duration: 180ms; }
  .tile-art:hover img { transform: scale(1.025); transition-duration: 600ms; }
}
.tile-art:hover .hover-hint, .tile-art:focus-visible .hover-hint { opacity: 1; transform: translate(-50%, -50%); transition-duration: var(--m-in); }
.badge {
  position: absolute; bottom: 9px; left: 9px; height: 28px; padding: 0 10px; border-radius: 999px; display: inline-flex; align-items: center;
  background: var(--accent); color: var(--accent-ink); font-family: var(--mono); font-size: 14px; font-weight: 500; box-shadow: 0 4px 12px rgba(0, 0, 0, .5);
}
.badge::after { content: "×"; margin-left: 1px; }
.flag { position: absolute; bottom: 11px; right: 9px; height: 24px; padding: 0 8px; display: inline-flex; align-items: center; border-radius: 999px; background: rgba(12, 10, 8, .86); font-family: var(--mono); font-size: 13px; color: var(--ink); }
.tile-info { display: flex; flex-direction: column; gap: 6px; min-width: 0; padding: 0 2px; }
.tile-name { font-size: 15px; font-weight: 500; letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile-line { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; }
.tile-set { font-family: var(--mono); font-size: 13px; color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile-controls { display: flex; align-items: center; gap: 2px; padding: 2px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); }
.tile-controls .icon-button { width: 26px; height: 26px; border-color: transparent; font-size: 16px; }
.tile-controls .qty { min-width: 22px; text-align: center; font-family: var(--mono); font-size: 13px; }
.tile-controls .remove { color: var(--faint); }
.tile-controls .remove:hover { color: var(--danger); }
.tile-controls .remove svg { width: 15px; height: 15px; }

.empty { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 22px; padding: 30px; text-align: center; }
.empty h2 { font-size: 30px; font-weight: 400; letter-spacing: -0.035em; max-width: 520px; }
.fan { position: relative; width: 210px; height: 150px; margin-bottom: 6px; }
.fan span { position: absolute; left: 70px; top: 4px; width: 92px; height: 128px; border-radius: 8px; border: 1px solid var(--line-strong); background: var(--surface); transform-origin: 50% 120%; animation: deal 700ms var(--ease-enter) both; }
.fan span:nth-child(1) { transform: rotate(-14deg) translateX(-24px); animation-delay: 60ms; }
.fan span:nth-child(3) { transform: rotate(14deg) translateX(24px); animation-delay: 160ms; }
.fan span:nth-child(2) { z-index: 1; border-color: var(--accent); background: linear-gradient(160deg, #2a2219, #15110d); box-shadow: 0 18px 40px -16px rgba(0, 0, 0, .9); animation-delay: 110ms; }
.fan span:nth-child(2)::after { content: ""; position: absolute; inset: 9px; border-radius: 4px; border: 1px solid rgba(201, 164, 90, .45); }
@keyframes deal { from { opacity: 0; transform: translateY(16px) rotate(0); } }
.steps { list-style: none; margin: 0; padding: 0; display: flex; gap: 12px; text-align: left; }
.steps li { display: flex; flex-direction: column; gap: 10px; width: 200px; padding: 16px 18px 18px; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--surface); color: var(--muted); font-size: 14px; line-height: 1.45; }
.steps strong { color: var(--ink); font-weight: 500; }
.num { font-family: var(--mono); font-size: 13px; color: var(--accent); }

/* Sheets -------------------------------------------------------------------------------------- */
.pager { display: flex; align-items: center; gap: 12px; font-family: var(--mono); font-size: 13px; color: var(--muted); white-space: nowrap; }
.sheet-stage { flex: 1; min-height: 0; display: grid; place-items: center; padding: 0 34px 34px; container-type: size; }
.sheet { --sheet-w: 210; --sheet-h: 297; position: relative; width: min(100cqw, 100cqh * var(--sheet-w) / var(--sheet-h)); aspect-ratio: var(--sheet-w) / var(--sheet-h); background: #fff; border-radius: 3px; box-shadow: 0 30px 70px -20px rgba(0, 0, 0, .9), 0 0 0 1px rgba(255, 255, 255, .06); }
.sheet img { display: block; width: 100%; height: 100%; border-radius: 3px; }
.sheet img:not([src]) { visibility: hidden; }
.sheet-empty { position: absolute; inset: 0; display: grid; place-items: center; padding: 24px; color: #6b6259; text-align: center; }
.sheet-loading { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(255, 255, 255, .5); }

/* Status bar ------------------------------------------------------------------------------------ */
.statusbar { position: relative; display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 6px 20px 6px 22px; border-top: 1px solid var(--line); background: var(--bg); color: var(--muted); font-size: 13px; }
#status-text { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.progress { position: absolute; left: 0; right: 0; top: -1px; height: 2px; overflow: hidden; }
.progress::after { content: ""; position: absolute; top: 0; bottom: 0; width: 28%; background: linear-gradient(90deg, transparent, var(--accent), transparent); animation: sweep 1.2s linear infinite; }
@keyframes sweep { from { transform: translateX(-100%); } to { transform: translateX(360%); } }
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 2px solid rgba(201, 164, 90, .25); border-top-color: var(--accent); animation: spin .8s linear infinite; }
.spinner.small { width: 15px; height: 15px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Dialogs -------------------------------------------------------------------------------------- */
.modal { position: fixed; inset: 0; z-index: 20; display: grid; grid-template-rows: minmax(0, 1fr); place-items: center; padding: 32px; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(6, 5, 4, .78); backdrop-filter: blur(3px); animation: fade var(--m-panel) var(--ease); }
.modal-window { position: relative; display: flex; flex-direction: column; max-height: 100%; border-radius: var(--r-lg); border: 1px solid var(--line-strong); background: var(--surface); box-shadow: 0 40px 100px -20px rgba(0, 0, 0, .9); animation: drop var(--m-panel) var(--ease); }
@keyframes fade { from { opacity: 0; } }
@keyframes drop { from { opacity: 0; transform: translateY(-6px); } }
.modal-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding: 24px 26px 18px; }
.modal-head h2 { font-size: 26px; font-weight: 400; letter-spacing: -0.03em; }
.modal-head .summary { margin: 6px 0 0; }
.modal-foot { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 26px; border-top: 1px solid var(--line); }
.prints { width: min(1200px, 100%); height: 100%; min-height: 0; }
.prints-filters { display: flex; align-items: center; gap: 12px; padding: 0 26px 18px; border-bottom: 1px solid var(--line); }
.search { position: relative; flex: 1; }
.search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--faint); }
.search input { padding-left: 38px; }
.prints-filters select { width: 230px; }
.stepper { display: flex; align-items: center; gap: 8px; padding-left: 6px; white-space: nowrap; }
.stepper .qty { min-width: 24px; text-align: center; font-family: var(--mono); font-size: 14px; }
.prints-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 22px 26px; }
.prints-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 22px 18px; }
.print { display: flex; flex-direction: column; gap: 8px; padding: 0; border: 0; background: none; text-align: left; }
.print .art { position: relative; width: 100%; aspect-ratio: 63 / 88; border-radius: var(--card-r); overflow: hidden; background: var(--surface-2); box-shadow: 0 12px 26px -14px rgba(0, 0, 0, .9); transition: transform 120ms var(--ease), box-shadow 120ms var(--ease); }
.print img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform 400ms var(--ease); }
@media (hover: hover) and (pointer: fine) {
  .print:hover .art { transform: translateY(-2px); transition-duration: 180ms; }
  .print:hover img { transform: scale(1.025); transition-duration: 600ms; }
}
.print.current .art { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--accent), 0 12px 26px -14px rgba(0, 0, 0, .9); }
.print .in-use, .print .lowres { position: absolute; top: 8px; height: 24px; padding: 0 9px; display: inline-flex; align-items: center; border-radius: 999px; font-size: 13px; font-weight: 600; }
.print .in-use { left: 8px; background: var(--accent); color: var(--accent-ink); }
.print .lowres { right: 8px; background: rgba(12, 10, 8, .86); color: var(--ink); font-weight: 500; }
.print .set-name { font-size: 14px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.print .set-code { margin-top: -4px; font-family: var(--mono); font-size: 13px; color: var(--faint); }
.prints-empty { padding: 50px; text-align: center; color: var(--muted); }
.message { width: min(500px, 100%); gap: 14px; padding: 26px; }
.message h2 { font-size: 24px; font-weight: 400; letter-spacing: -0.03em; }
#message-body { color: var(--muted); white-space: pre-line; overflow-wrap: anywhere; }
#message-body ul { max-height: 190px; overflow-y: auto; margin: 10px 0 0; padding: 12px 14px 12px 30px; border-radius: var(--r-sm); background: var(--bg); color: var(--ink); font-family: var(--mono); font-size: 13px; }
#message-body .lead { margin: 0 0 12px; }
#message-body .missing-list { max-height: min(52vh, 420px); margin: 0; padding: 0; list-style: none; background: none; font-family: var(--font); font-size: 14px; display: flex; flex-direction: column; gap: 8px; }
.missing { display: flex; flex-direction: column; gap: 9px; padding: 12px 14px; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--bg); white-space: normal; }
.missing.done { border-color: rgba(201, 164, 90, .35); }
.missing-name { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.missing-line { font-family: var(--mono); font-size: 13px; color: var(--ink); text-decoration: line-through; text-decoration-color: rgba(255, 154, 133, .6); }
.missing.done .missing-line { text-decoration: none; color: var(--muted); }
.missing.done .missing-name .hint { display: none; }
.missing-name .hint { margin: 0; font-size: 13px; color: var(--faint); }
.suggestions { display: flex; flex-wrap: wrap; gap: 6px; }
.suggestions:empty { display: none; }
.chip { height: 30px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface-2); color: var(--ink); font-size: 13px; transition: background var(--m-out) var(--ease), border-color var(--m-out) var(--ease), transform var(--m-press) var(--ease); }
.chip:hover { background: var(--accent-soft); border-color: var(--accent); transition-duration: var(--m-in); }
.chip:active { transform: scale(.985); }
.chip:disabled { opacity: .5; cursor: default; }
.added { font-size: 13px; color: var(--accent); }
.modal-window.message.wide { width: min(600px, 100%); }

.about { width: min(560px, 100%); }
.about-body { display: flex; flex-direction: column; gap: 16px; padding: 0 26px 26px; color: var(--muted); overflow-y: auto; }
.about-body p { margin: 0; }
.about-owner { color: var(--ink); }
.about-update { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 14px; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--bg); color: var(--ink); font-size: 14px; }
.about-update.newer { border-color: rgba(201, 164, 90, .45); }
.about-links { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.about-credits { font-size: 13px; color: var(--faint); }

.card-search { flex: none; z-index: 6; }
.search-results { position: absolute; z-index: 5; top: calc(100% + 6px); left: 0; right: 0; display: flex; flex-direction: column; padding: 5px; border-radius: var(--r-md); border: 1px solid var(--line-strong); background: var(--surface-2); box-shadow: 0 18px 40px -10px rgba(0, 0, 0, .8); animation: drop var(--m-in) var(--ease); }
.search-results .result { padding: 8px 10px; border: 0; border-radius: var(--r-sm); background: none; color: var(--ink); font-size: 14px; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-results .result.active, .search-results .result:hover { background: var(--surface-3); }
.search-results .result.active { box-shadow: inset 2px 0 0 var(--accent); }
.search-results .empty-result { color: var(--faint); cursor: default; }
.search-results .empty-result:hover { background: none; }
.tile-controls .flip { color: var(--muted); }
.tile-controls .flip[aria-pressed="true"] { color: var(--accent); }
.tile-controls .flip svg { width: 15px; height: 15px; }

.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 6px; }

.lightbox { position: fixed; inset: 0; z-index: 30; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 28px; background: rgba(6, 5, 4, .93); cursor: zoom-out; animation: fade var(--m-panel) var(--ease); }
.lightbox img { max-width: 100%; max-height: calc(100% - 50px); border-radius: 3.5% / 2.5%; box-shadow: 0 30px 80px rgba(0, 0, 0, .8); }
.lightbox p { margin: 0; font-family: var(--mono); font-size: 13px; color: var(--muted); }

@media (max-width: 1180px) {
  .layout { grid-template-columns: 300px 1fr; }
  .steps { flex-direction: column; }
  .steps li { width: 320px; }
  #images-button { padding: 0 12px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-delay: 0ms !important; transition-duration: 1ms !important; }
  .tile-art:hover, .tile-art:hover img, .print:hover .art, .print:hover img, .button:hover, .icon-button:hover { transform: none !important; }
}

#back-shift:not([hidden]) { display: grid; gap: 8px; margin-top: 14px; }
#back-shift .field-grid { margin: 0; }

.button.icon-only { width: 34px; padding: 0; justify-content: center; }
.button.icon-only svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.drop-zone {
  position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; pointer-events: none;
  background: rgba(12, 10, 8, .72); backdrop-filter: blur(3px);
}
.drop-zone[hidden] { display: none; }
.drop-card {
  display: grid; justify-items: center; gap: 8px; padding: 36px 48px; border-radius: 18px; text-align: center;
  border: 1.5px dashed var(--accent); background: var(--surface, #15120e); max-width: 420px;
}
.drop-card svg { width: 34px; height: 34px; fill: none; stroke: var(--accent); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.drop-card strong { font-size: 20px; }
.drop-card span { color: var(--muted, #a59c8f); font-size: 14px; }

.prints-source { grid-template-columns: repeat(2, 1fr); margin: 0 26px 14px; }
.prints-source button { flex-direction: row; justify-content: center; gap: 8px; font-size: 14px; padding: 9px 8px; }
.prints-source small { font-family: var(--mono); font-size: 11px; color: var(--faint); }
