/* Ilo Resize — same family as Ilo Animation and Ilo Raw: dark by default (it sits beside Illustrator), pink accent. */
:root {
    --bg: #262626; --bg-2: #2d2d2d; --bg-3: #353535; --stage: #1c1c1c; --field: #1f1f1f;
    --line: rgba(255, 255, 255, 0.07); --line-2: rgba(255, 255, 255, 0.13); --hover: rgba(255, 255, 255, 0.06);
    --text: #ededed; --text-2: #b9b9b9; --text-3: #858585;
    --accent: #e562ef; --accent-2: #b23fc4; --accent-soft: rgba(229, 98, 239, 0.16); --warn: #e8a93a; --ok: #4ec27e;
    --shadow: 0 12px 32px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(0, 0, 0, 0.4); --ease: cubic-bezier(0.2, 0, 0, 1);
}
@media (prefers-color-scheme: light) {
    :root:not([data-theme="dark"]) {
        --bg: #f0f0f0; --bg-2: #e6e6e6; --bg-3: #dadada; --stage: #d4d4d4; --field: #ffffff;
        --line: rgba(0, 0, 0, 0.08); --line-2: rgba(0, 0, 0, 0.16); --hover: rgba(0, 0, 0, 0.05);
        --text: #1d1d1d; --text-2: #474747; --text-3: #7a7a7a; --accent: #b23fc4; --accent-soft: rgba(178, 63, 196, 0.14);
    }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font: 12px/1.45 -apple-system, BlinkMacSystemFont, 'Segoe UI', Inter, Helvetica, Arial, sans-serif; -webkit-font-smoothing: antialiased; }
body { display: flex; flex-direction: column; overflow: hidden; }
button { font: inherit; }
.muted { color: var(--text-3); }

.top { display: flex; align-items: center; gap: 12px; height: 44px; padding: 0 12px; border-bottom: 1px solid var(--line); background: var(--bg); flex: none; }
.brand { display: flex; align-items: center; gap: 7px; color: inherit; text-decoration: none; }
.brand svg { width: 30px; height: 19px; fill: var(--text); }
.brand b { font-size: 13px; letter-spacing: .01em; }
.top-mid { flex: 1; text-align: center; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-actions { display: flex; gap: 6px; }

.btn { height: 28px; padding: 0 12px; border: 0; border-radius: 7px; background: var(--bg-3); color: var(--text); cursor: pointer; font-weight: 600; font-size: 11.5px; transition: background .15s var(--ease); white-space: nowrap; }
.btn:hover { background: var(--hover); }
.btn.ghost { background: transparent; color: var(--text-2); box-shadow: inset 0 0 0 1px var(--line-2); }
.btn.ghost:hover { color: var(--text); background: var(--hover); }
.btn.primary { background: var(--accent-2); color: #fff; }
.btn.primary:hover { background: #c04ed2; }
.btn.small { height: 26px; padding: 0 10px; }
.btn.big { height: 38px; padding: 0 20px; font-size: 13px; border-radius: 9px; }
.btn:disabled { opacity: .4; cursor: default; }

.app { flex: 1; min-height: 0; display: grid; grid-template-columns: 290px minmax(0, 1fr); }
.empty { grid-column: 1 / -1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 26px; padding: 24px; overflow: auto; }
.drop { max-width: 560px; text-align: center; padding: 34px 32px; border-radius: 16px; border: 1.5px dashed var(--line-2); background: var(--bg-2); }
.drop.over, body.over .drop { border-color: var(--accent); background: var(--accent-soft); }
.drop h1 { margin: 0 0 10px; font-size: 26px; letter-spacing: -.01em; }
.drop p { margin: 0 0 18px; color: var(--text-2); font-size: 13px; line-height: 1.55; }
.drop .hint { margin: 12px 0 0; color: var(--text-3); font-size: 11.5px; }
.examples { display: flex; flex-direction: column; align-items: center; gap: 10px; color: var(--text-3); }
.ex-row { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.ex { border: 0; padding: 0; background: none; cursor: pointer; border-radius: 9px; overflow: hidden; box-shadow: 0 0 0 1px var(--line-2); transition: transform .2s var(--ease); }
.ex:hover { transform: translateY(-2px); box-shadow: 0 0 0 2px var(--accent); }
.ex img { display: block; height: 96px; }

.side { border-right: 1px solid var(--line); overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 12px; }
.src { display: flex; gap: 10px; align-items: center; }
.src-pic { width: 84px; height: 84px; flex: none; display: grid; place-items: center; background: var(--stage); border-radius: 8px; }
.src-pic img { max-width: 78px; max-height: 78px; display: block; box-shadow: 0 1px 3px rgba(0, 0, 0, .4); }
.src-meta { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.src-meta b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.src-meta span { color: var(--text-3); }
.layers { display: flex; flex-direction: column; gap: 10px; }
.side-head { display: flex; flex-direction: column; gap: 1px; border-top: 1px solid var(--line); padding-top: 12px; cursor: pointer; list-style: none; position: relative; padding-right: 22px; }
.side-head::-webkit-details-marker { display: none; }
.side-head::after { content: ''; position: absolute; right: 6px; top: 17px; width: 7px; height: 7px; border-right: 1.5px solid var(--text-3); border-bottom: 1.5px solid var(--text-3); transform: rotate(45deg); transition: transform .2s var(--ease); }
.layers:not([open]) .side-head::after { transform: rotate(-45deg); }
.side-head b em { font-style: normal; font-weight: 500; color: var(--text-3); margin-left: 4px; }
.layers[open] .parts { margin-top: 2px; }
.versions:not([open]) .side-head::after { transform: rotate(-45deg); }
.ver { display: flex; flex-direction: column; gap: 8px; }
.ver textarea { width: 100%; box-sizing: border-box; resize: vertical; min-height: 64px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--field); color: var(--text); font: inherit; font-size: 11.5px; padding: 7px 9px; }
.ver textarea:focus { outline: none; border-color: var(--accent); }
.ver-acts { display: flex; gap: 6px; flex-wrap: wrap; }
.ver-note { margin: 0; font-size: 11.5px; }
.ver-note:empty { display: none; }
.ver-map { display: flex; flex-direction: column; gap: 4px; }
.ver-map:empty { display: none; }
.ver-map .vm { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); align-items: center; gap: 8px; }
.ver-map .vm span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text-2); font-size: 11.5px; }
.ver-map select, .ver-show select { height: 24px; border-radius: 6px; border: 1px solid var(--line-2); background: var(--field); color: var(--text); font: inherit; font-size: 11px; padding: 0 4px; min-width: 0; }
.ver-pics { display: flex; align-items: center; gap: 8px; }
.ver-show { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.ver-show select { flex: 1; height: 28px; font-size: 12px; }
.parts { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.parts li { display: grid; grid-template-columns: 34px minmax(0, 1fr) 96px 24px; align-items: center; gap: 8px; padding: 4px 6px; border-radius: 7px; }
.parts li:hover { background: var(--hover); }
.parts li.off { opacity: .45; }
.parts .thumb { width: 34px; height: 26px; border-radius: 4px; background: var(--stage); display: grid; place-items: center; overflow: hidden; }
.parts .thumb img { max-width: 32px; max-height: 24px; }
.parts .nm { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text-2); }
.parts select { height: 24px; border-radius: 6px; border: 1px solid var(--line-2); background: var(--field); color: var(--text); font: inherit; font-size: 11px; padding: 0 4px; }
.parts .eye { width: 24px; height: 24px; border: 0; border-radius: 6px; background: transparent; color: var(--text-3); cursor: pointer; display: grid; place-items: center; }
.parts .eye:hover { background: var(--hover); color: var(--text); }
.parts .eye svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.4; }

.work { display: flex; flex-direction: column; min-height: 0; }
.picker { padding: 12px 16px 10px; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 9px; }
.tabs { display: flex; gap: 2px; padding: 2px; border-radius: 8px; background: var(--field); box-shadow: inset 0 0 0 1px var(--line); align-self: flex-start; }
.tabs button { border: 0; background: transparent; padding: 4px 12px; border-radius: 6px; font-size: 11.5px; font-weight: 600; color: var(--text-2); cursor: pointer; }
.tabs button.on { background: var(--bg-3); color: var(--text); box-shadow: 0 1px 2px rgba(0, 0, 0, .35); }
.tabs button em { font-style: normal; color: var(--accent); margin-left: 4px; }
.chips { display: flex; flex-wrap: wrap; gap: 5px; max-height: 210px; overflow-y: auto; align-content: flex-start; }
.chips .set { display: contents; }
.chips .set b { flex-basis: 100%; font-size: 10.5px; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: .06em; margin: 4px 0 -1px; }
.chips .set:first-child b { margin-top: 0; }
.chips .none { margin: 2px 0; font-size: 11.5px; }
.pick-top { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.size-search { flex: 1 1 180px; max-width: 280px; height: 28px; border-radius: 7px; border: 1px solid var(--line-2); background: var(--field); color: var(--text); font: inherit; font-size: 12px; padding: 0 10px; }
.chip { border: 0; border-radius: 99px; padding: 4px 11px; background: var(--field); color: var(--text-2); cursor: pointer; box-shadow: inset 0 0 0 1px var(--line-2); font-size: 11.5px; display: inline-flex; gap: 6px; align-items: center; }
.chip small { color: var(--text-3); font-size: 10.5px; }
.chip:hover { color: var(--text); }
.chip.on { background: var(--accent-soft); color: var(--text); box-shadow: inset 0 0 0 1px var(--accent); }
.custom-row { display: flex; align-items: center; gap: 14px; }
.custom { display: flex; gap: 6px; flex: 1; max-width: 460px; }
.picked-n { margin-left: auto; color: var(--text-3); font-size: 11.5px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.custom input { flex: 1; height: 26px; border-radius: 7px; border: 1px solid var(--line-2); background: var(--field); color: var(--text); padding: 0 9px; font: inherit; font-size: 11.5px; }
.custom input:focus { outline: none; border-color: var(--accent); }

.grid { flex: 1; overflow-y: auto; padding: 16px; display: grid; grid-template-columns: repeat(auto-fill, minmax(256px, 1fr)); grid-auto-rows: max-content; gap: 16px; align-content: start; background: var(--stage); }
.card { background: var(--bg-2); border-radius: 12px; overflow: hidden; display: flex; flex-direction: column; box-shadow: 0 0 0 1px var(--line); }
.card .view { height: 230px; display: flex; align-items: center; justify-content: center; padding: 14px; overflow: hidden; background: repeating-conic-gradient(var(--stage) 0% 25%, var(--bg) 0% 50%) 50% / 16px 16px; cursor: zoom-in; }
.card .view img { max-width: 100%; max-height: 202px; width: auto; height: auto; display: block; box-shadow: 0 2px 10px rgba(0, 0, 0, .45); }
.card .meta { padding: 9px 11px 4px; display: flex; justify-content: space-between; gap: 6px; align-items: baseline; }
.card .meta b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card .meta span { color: var(--text-3); white-space: nowrap; font-size: 11px; }
.card .note { padding: 0 11px; color: var(--warn); font-size: 11px; min-height: 16px; }
.card .acts { display: flex; gap: 4px; padding: 6px 8px 9px; }
.card .acts .btn { height: 25px; padding: 0 9px; font-size: 11px; }
.card .acts .grow { flex: 1; }
/* "Another layout 2/4" gives way first (it never pushes the formats out of the card); the formats are one group */
.card .acts .alt { min-width: 0; overflow: hidden; text-overflow: ellipsis; flex: 0 1 auto; }
.card .acts .alt small { margin-left: 3px; color: var(--text-3); font-size: 10px; font-weight: 500; font-variant-numeric: tabular-nums; }
.card .dl, .top-dl { position: relative; flex: none; }
.top-dl .menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; min-width: 250px; padding: 4px; border-radius: 10px; background: var(--bg-3); box-shadow: 0 0 0 1px var(--line-2), 0 10px 28px rgba(0, 0, 0, .35); display: flex; flex-direction: column; }
.top-dl .menu[hidden] { display: none; }
.top-dl .menu button { display: flex; flex-direction: column; gap: 2px; border: 0; background: transparent; color: var(--text); font: inherit; font-size: 12px; font-weight: 600; padding: 8px 10px; border-radius: 7px; cursor: pointer; text-align: left; }
.top-dl .menu button small { color: var(--text-3); font-weight: 500; font-size: 10.5px; }
.top-dl .menu button:hover, .top-dl .menu button:focus-visible { background: var(--hover); outline: none; }
.card .menu { position: absolute; right: 0; bottom: calc(100% + 6px); z-index: 5; min-width: 176px; padding: 4px; border-radius: 10px; background: var(--bg-3); box-shadow: 0 0 0 1px var(--line-2), 0 10px 28px rgba(0, 0, 0, .35); display: flex; flex-direction: column; }
.card .menu[hidden] { display: none; }
.card .menu button { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; border: 0; background: transparent; color: var(--text); font: inherit; font-size: 12px; font-weight: 600; padding: 7px 9px; border-radius: 7px; cursor: pointer; text-align: left; }
.card .menu button small { color: var(--text-3); font-weight: 500; font-size: 10.5px; }
.card .menu button:hover, .card .menu button:focus-visible { background: var(--hover); outline: none; }
.card { overflow: visible; }
.card .view { border-radius: 12px 12px 0 0; }

.zoom { position: fixed; inset: 0; z-index: 30; background: rgba(0, 0, 0, .78); display: grid; place-items: center; padding: 40px; cursor: zoom-out; }
.zoom img { max-width: 100%; max-height: 100%; box-shadow: var(--shadow); background: #fff; }
.zoom[hidden] { display: none; }

.toast { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); background: var(--bg-3); color: var(--text); padding: 9px 14px; border-radius: 9px; box-shadow: var(--shadow); z-index: 40; max-width: 80vw; }
.toast.bad { color: #ffb3b9; }
.toast[hidden] { display: none; }

/* phones: one scrolling column — the design, the sizes, then every result full width; bigger touch targets,
   16 px fields (no zoom-in on focus) */
@media (max-width: 760px) {
    html, body { height: auto; min-height: 100%; }
    body { display: block; overflow-x: hidden; overflow-y: auto; }
    .top { position: sticky; top: 0; z-index: 20; height: 52px; padding: 0 12px; }
    .top-mid { display: none; }
    .top-actions .btn { height: 34px; font-size: 13px; }
    .app { display: block; }
    .empty { min-height: calc(100vh - 52px); padding: 20px 16px; justify-content: flex-start; }
    .drop { padding: 26px 18px; }
    .drop h1 { font-size: 24px; }
    .side { border-right: 0; border-bottom: 1px solid var(--line); overflow: visible; padding: 14px 16px; }
    .parts li { grid-template-columns: 34px minmax(0, 1fr) 116px 34px; padding: 6px 4px; }
    .parts select { height: 34px; font-size: 16px; }
    .parts .eye { width: 34px; height: 34px; }
    .work { display: block; }
    .picker { padding: 12px 16px; }
    .tabs { align-self: stretch; overflow-x: auto; }
    .tabs button { padding: 7px 12px; font-size: 13px; white-space: nowrap; }
    .chip { padding: 8px 13px; font-size: 13px; }
    .custom { max-width: none; }
    .custom input { height: 38px; font-size: 16px; }
    .custom .btn { height: 38px; }
    .grid { overflow: visible; grid-template-columns: 1fr; padding: 14px 12px 28px; gap: 14px; }
    .card .view { height: auto; min-height: 200px; padding: 12px; }
    .card .view img { max-height: 62vh; }
    .card .acts { flex-wrap: wrap; }
    .card .acts .btn { height: 36px; padding: 0 12px; font-size: 13px; }
    .zoom { padding: 12px; }
}
