/* THMG DAM — interface styles (THMG brand: Purple Deep, Beige Sand, Black 90%, Green Olive) */
:root {
  --purple: #3D275C; --purple-mid: #6E5690; --purple-light: #AC9BC4;
  --beige: #D4C2AC; --beige-mid: #FAE8D2; --beige-light: #FFF4E6;
  --ink: #1A1A1A; --ink-mid: #4D4D4D; --ink-light: #8C8C8C;
  --line: #DEDEDE; --grey: #F4F4F4; --white: #FFFFFF;
  --olive: #394537; --olive-mid: #5C6F57; --olive-light: #93A68D;
  --red: #B4372F; --yellow: #FBDC70;
  --serif: 'Source Serif 4', 'Source Serif Pro', Georgia, serif;
  --sans: 'Source Sans 3', 'Source Sans Pro', Arial, sans-serif;
  --shadow: 0 2px 12px rgba(26,26,26,.08); --shadow-hi: 0 4px 20px rgba(26,26,26,.12);
  --r: 6px; --side: 248px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--sans); font-size: 15px; line-height: 1.55; color: var(--ink); background: var(--white); }
h1, h2, h3 { font-family: var(--serif); font-weight: 500; line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: 30px; } h2 { font-size: 22px; } h3 { font-size: 18px; font-weight: 400; }
a { color: var(--purple); text-decoration: none; } a:hover { color: var(--purple-mid); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--purple); outline-offset: 2px; }
.muted { color: var(--ink-mid); } .small { font-size: 13px; } .tiny { font-size: 12px; color: var(--ink-light); }
.caps { text-transform: uppercase; letter-spacing: .14em; font-size: 12px; }
.hidden { display: none !important; }
.row { display: flex; gap: 8px; align-items: center; } .wrap { flex-wrap: wrap; } .grow { flex: 1; }
.spread { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.stack > * + * { margin-top: 16px; }

/* ---------- shell ---------- */
.app { display: grid; grid-template-columns: var(--side) 1fr; min-height: 100vh; }
.side { background: var(--purple); color: var(--beige-light); padding: 24px 0; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { padding: 0 24px 24px; border-bottom: 1px solid rgba(255,255,255,.12); }
.brand .word { font-family: var(--serif); font-size: 20px; letter-spacing: .3em; color: #fff; }
.brand .sub { font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: var(--beige); margin-top: 4px; }
.side nav { padding: 16px 12px; }
.side .label { padding: 16px 12px 6px; font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: var(--beige); opacity: .8; }
.navlink { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: var(--r); color: var(--beige-light); cursor: pointer; font-size: 14px; }
.navlink:hover { background: rgba(255,255,255,.08); color: #fff; }
.navlink.active { background: rgba(255,255,255,.14); color: #fff; }
.navlink .count { margin-left: auto; font-size: 12px; opacity: .7; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex: none; border: 1px solid rgba(255,255,255,.4); }
.main { min-width: 0; display: flex; flex-direction: column; }
.top { position: sticky; top: 0; z-index: 20; background: rgba(255,255,255,.96); backdrop-filter: blur(6px); border-bottom: 1px solid var(--line); padding: 12px 32px; display: flex; gap: 16px; align-items: center; }
.search { flex: 1 1 auto; min-width: 0; max-width: 560px; position: relative; margin-right: auto; }
.search input { width: 100%; height: 40px; padding: 0 14px 0 38px; border: 1px solid var(--line); border-radius: var(--r); background: var(--grey); }
.search input:focus { background: #fff; border-color: var(--purple); outline: none; }
.search svg { position: absolute; left: 12px; top: 11px; color: var(--ink-light); }
.user { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--beige); color: var(--purple); display: grid; place-items: center; font-weight: 600; font-size: 13px; }
.content { padding: 32px; max-width: 1480px; width: 100%; }
.btn.menu-btn, .btn.filters-btn { display: none; }

/* ---------- controls ---------- */
.btn { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 18px; border-radius: var(--r); border: 1px solid var(--purple); background: var(--purple); color: #fff; font-weight: 600; font-size: 14px; cursor: pointer; transition: background .15s ease-out; white-space: nowrap; }
.btn:hover { background: var(--purple-mid); border-color: var(--purple-mid); color: #fff; }
.btn:active { background: var(--ink); }
.btn:disabled { background: var(--grey); border-color: var(--line); color: var(--ink-light); cursor: not-allowed; }
.btn.secondary { background: transparent; color: var(--purple); }
.btn.secondary:hover { background: var(--beige-light); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--ink-mid); }
.btn.ghost:hover { background: var(--grey); color: var(--ink); }
.btn.danger { background: transparent; color: var(--red); border-color: var(--red); }
.btn.danger:hover { background: #fff0f0; }
.btn.sm { height: 32px; padding: 0 12px; font-size: 13px; }
.btn.olive { background: var(--olive); border-color: var(--olive); } .btn.olive:hover { background: var(--olive-mid); }
label.f { display: block; font-size: 13px; color: var(--ink-mid); margin-bottom: 4px; }
.input, select.input, textarea.input { width: 100%; min-height: 40px; padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--r); background: #fff; }
.input:focus { border: 2px solid var(--purple); padding: 7px 11px; outline: none; }
textarea.input { min-height: 84px; resize: vertical; }
.field + .field { margin-top: 14px; }
.check { display: flex; gap: 8px; align-items: center; font-size: 14px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--purple); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border: 1px solid var(--line); border-radius: 4px; font-size: 13px; background: #fff; cursor: pointer; color: var(--ink-mid); }
.chip:hover { border-color: var(--purple-light); }
.chip.on { background: rgba(172,155,196,.22); border-color: var(--purple); color: var(--purple); }
.chip .n { font-size: 11px; color: var(--ink-light); }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 2px 8px; border-radius: 4px; font-size: 12px; font-weight: 600; background: var(--grey); color: var(--ink-mid); white-space: nowrap; }
.badge .dot { border: none; width: 8px; height: 8px; }
.tag { display: inline-block; padding: 1px 8px; background: var(--beige-light); border: 1px solid var(--beige-mid); border-radius: 4px; font-size: 12px; color: var(--ink-mid); }

/* ---------- cards & grid ---------- */
.card { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 24px; }
.card.beige { background: var(--beige-light); border-color: var(--beige-mid); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 20px; }
.tile { position: relative; background: #fff; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; cursor: pointer; transition: box-shadow .2s ease-out, border-color .2s; }
.tile:hover { box-shadow: var(--shadow-hi); }
.tile.sel { border-color: var(--purple); box-shadow: 0 0 0 2px var(--purple); }
.thumb { aspect-ratio: 1; background: var(--grey) center/contain no-repeat; position: relative;
  background-image: linear-gradient(45deg, #eee 25%, transparent 25%), linear-gradient(-45deg, #eee 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #eee 75%), linear-gradient(-45deg, transparent 75%, #eee 75%);
  background-size: 16px 16px; background-position: 0 0, 0 8px, 8px -8px, -8px 0; }
.thumb img { width: 100%; height: 100%; object-fit: contain; display: block; }
.thumb .kind { position: absolute; left: 8px; bottom: 8px; background: rgba(26,26,26,.75); color: #fff; font-size: 11px; padding: 2px 6px; border-radius: 3px; letter-spacing: .08em; text-transform: uppercase; }
.thumb .placeholder { position: absolute; inset: 0; display: grid; place-items: center; color: var(--ink-light); font-family: var(--serif); font-size: 22px; background: var(--grey); }
.tile .pick { position: absolute; top: 8px; left: 8px; z-index: 2; width: 22px; height: 22px; accent-color: var(--purple); opacity: 0; transition: opacity .15s; }
.tile:hover .pick, .tile.sel .pick, .selecting .tile .pick { opacity: 1; }
.tile .body { padding: 10px 12px 12px; }
.tile .title { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile .meta { display: flex; justify-content: space-between; gap: 8px; margin-top: 6px; align-items: center; }
.ent-mark { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-mid); }
.ent-mark .dot { border: none; width: 8px; height: 8px; }

/* ---------- library layout ---------- */
.lib { display: grid; grid-template-columns: 220px 1fr; gap: 32px; }
.filters h4 { font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-light); margin: 20px 0 8px; font-weight: 600; }
.filters h4:first-child { margin-top: 0; }
.filters .chips { gap: 4px; }
.bulk { position: sticky; top: 66px; z-index: 10; background: var(--ink); color: #fff; border-radius: 8px; padding: 10px 16px; display: flex; gap: 10px; align-items: center; margin-bottom: 16px; flex-wrap: wrap; }
.bulk .btn.secondary { color: #fff; border-color: rgba(255,255,255,.6); } .bulk .btn.secondary:hover { background: rgba(255,255,255,.1); }
.bulk select { height: 32px; border-radius: var(--r); border: none; padding: 0 8px; }
.empty { padding: 64px 24px; text-align: center; color: var(--ink-mid); border: 1px dashed var(--beige); border-radius: 8px; background: var(--beige-light); }
.empty h3 { color: var(--purple); }

/* ---------- dashboard ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; }
.ent-card { border-top: 4px solid var(--purple); cursor: pointer; transition: box-shadow .2s; }
.ent-card:hover { box-shadow: var(--shadow-hi); }
.ent-card .big { font-family: var(--serif); font-size: 36px; color: var(--ink); line-height: 1; }
.bar { display: flex; height: 8px; border-radius: 4px; overflow: hidden; background: var(--grey); margin: 14px 0 10px; }
.bar span { display: block; height: 100%; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12px; color: var(--ink-mid); }
.legend i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 4px; }
.two { display: grid; grid-template-columns: 1.3fr 1fr; gap: 24px; margin-top: 32px; }
.feed { list-style: none; margin: 0; padding: 0; }
.feed li { padding: 10px 0; border-bottom: 1px solid var(--grey); font-size: 14px; }
.feed li:last-child { border-bottom: none; }
.mini { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 12px; }
.mini .tile .body { padding: 6px 8px; } .mini .tile .title { font-size: 12px; }

/* ---------- board ---------- */
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 1fr); gap: 16px; overflow-x: auto; padding-bottom: 16px; }
.col { background: var(--grey); border-radius: 8px; padding: 12px; min-height: 420px; }
.col.over { background: rgba(172,155,196,.25); outline: 2px dashed var(--purple-mid); }
.col h4 { margin: 0 0 12px; font-size: 13px; letter-spacing: .1em; text-transform: uppercase; display: flex; align-items: center; gap: 8px; }
.col .bcard { background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 8px; margin-bottom: 8px; display: flex; gap: 10px; align-items: center; cursor: grab; }
.col .bcard img, .col .bcard .ph { width: 52px; height: 52px; object-fit: contain; background: var(--grey); border-radius: 4px; flex: none; }
.col .bcard .t { font-size: 13px; font-weight: 600; line-height: 1.3; }

/* ---------- asset page ---------- */
.asset { display: grid; grid-template-columns: minmax(0, 1fr) 420px; gap: 32px; align-items: start; }
.stage { background: var(--grey); border-radius: 8px; min-height: 480px; display: grid; place-items: center; position: relative; overflow: hidden; }
.stage.checker { background-image: linear-gradient(45deg, #eaeaea 25%, transparent 25%), linear-gradient(-45deg, #eaeaea 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #eaeaea 75%), linear-gradient(-45deg, transparent 75%, #eaeaea 75%); background-size: 20px 20px; background-position: 0 0, 0 10px, 10px -10px, -10px 0; }
.stage img, .stage video { max-width: 100%; max-height: 70vh; display: block; }
.stage .doc { padding: 64px; text-align: center; }
.viewtabs { display: flex; gap: 4px; margin-bottom: 12px; flex-wrap: wrap; }
.spin { position: relative; cursor: ew-resize; user-select: none; touch-action: pan-y; width: 100%; display: grid; place-items: center; }
.spin img { pointer-events: none; }
.spin-ctrl { display: flex; gap: 12px; align-items: center; margin-top: 12px; }
.spin-ctrl input[type=range] { flex: 1; accent-color: var(--purple); }
.strip { display: flex; gap: 8px; overflow-x: auto; padding: 12px 0; }
.strip .s { flex: none; width: 84px; height: 84px; border: 1px solid var(--line); border-radius: 6px; background: #fff center/contain no-repeat; cursor: pointer; position: relative; }
.strip .s.on { border-color: var(--purple); box-shadow: 0 0 0 2px var(--purple); }
.strip .s span { position: absolute; bottom: 2px; left: 2px; right: 2px; font-size: 10px; background: rgba(255,255,255,.85); text-align: center; border-radius: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.panel { position: sticky; top: 90px; }
.tabs { display: flex; border-bottom: 1px solid var(--line); margin-bottom: 20px; gap: 4px; overflow-x: auto; }
.tabs button { background: none; border: none; padding: 10px 12px; cursor: pointer; color: var(--ink-mid); border-bottom: 2px solid transparent; font-size: 14px; white-space: nowrap; }
.tabs button.on { color: var(--purple); border-bottom-color: var(--purple); font-weight: 600; }
.kv { display: grid; grid-template-columns: 120px 1fr; gap: 6px 12px; font-size: 14px; }
.kv dt { color: var(--ink-light); } .kv dd { margin: 0; word-break: break-word; }
.status-big { display: flex; align-items: center; gap: 12px; padding: 16px; border-radius: 8px; background: var(--beige-light); border: 1px solid var(--beige-mid); }
.status-big .dot { width: 14px; height: 14px; border: none; }
.steps { display: flex; gap: 4px; margin: 16px 0; flex-wrap: wrap; }
.steps span { font-size: 11px; padding: 3px 8px; border-radius: 3px; background: var(--grey); color: var(--ink-light); }
.steps span.cur { background: var(--purple); color: #fff; }
.timeline { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--beige); }
.timeline li { padding: 0 0 14px 16px; position: relative; font-size: 14px; }
.timeline li::before { content: ""; position: absolute; left: -6px; top: 6px; width: 10px; height: 10px; border-radius: 50%; background: var(--beige); }
.timeline li.transition::before { background: var(--purple); } .timeline li.comment::before { background: var(--olive); }
.timeline .msg { background: var(--beige-light); padding: 6px 10px; border-radius: 6px; margin-top: 4px; }
.proc { border: 1px solid var(--line); border-radius: 8px; margin-bottom: 10px; }
.proc summary { padding: 12px 14px; cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.proc summary::-webkit-details-marker { display: none; }
.proc[open] summary { border-bottom: 1px solid var(--line); background: var(--beige-light); }
.proc .pbody { padding: 14px; }
.proc .grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; align-items: end; }
.proc .grid2 .field + .field, .proc .pbody > .field { margin: 0 0 12px; } .proc .grid2 .field + .field { margin: 0; }
.job { padding: 10px 0; border-bottom: 1px solid var(--grey); font-size: 13px; }
.progress { height: 6px; background: var(--grey); border-radius: 3px; overflow: hidden; margin-top: 6px; }
.progress span { display: block; height: 100%; background: var(--purple); transition: width .4s ease-out; }
.st-queued { color: var(--ink-light); } .st-running { color: var(--purple); } .st-done { color: var(--olive); } .st-failed { color: var(--red); } .st-cancelling { color: var(--red); } .st-cancelled { color: var(--ink-light); }
.files { list-style: none; padding: 0; margin: 0; }
.files li { display: flex; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--grey); font-size: 13px; }
.files .fi { width: 44px; height: 44px; flex: none; border-radius: 4px; background: var(--grey) center/contain no-repeat; border: 1px solid var(--line); }
.files .fn { flex: 1; min-width: 0; } .files .fn b { display: block; font-weight: 600; line-height: 1.35; word-break: break-word; }

/* ---------- tables ---------- */
table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
table.t th { background: var(--purple); color: #fff; text-align: left; padding: 10px 12px; font-weight: 600; font-size: 13px; }
table.t td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.t tr:nth-child(even) td { background: var(--beige-light); }
table.t tr:hover td { background: var(--beige-mid); }
.tablewrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; }

/* ---------- modal / toast / drop ---------- */
.scrim { position: fixed; inset: 0; background: rgba(26,26,26,.6); z-index: 100; display: grid; place-items: center; padding: 16px; animation: fade .2s ease-out; }
.modal { background: #fff; border-radius: 8px; width: min(640px, 100%); max-height: 90vh; overflow: auto; padding: 32px; box-shadow: var(--shadow-hi); }
.modal.wide { width: min(980px, 100%); }
.modal .actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 24px; }
.toasts { position: fixed; bottom: 24px; right: 24px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast { background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 6px; font-size: 14px; max-width: 380px; animation: fade .2s ease-out; }
.toast.err { background: var(--red); } .toast.ok { background: var(--olive); }
.drop { position: fixed; inset: 0; z-index: 150; background: rgba(61,39,92,.85); color: #fff; display: grid; place-items: center; font-family: var(--serif); font-size: 32px; pointer-events: none; }
.dz { border: 2px dashed var(--beige); border-radius: 8px; padding: 32px; text-align: center; background: var(--beige-light); cursor: pointer; }
.dz.over { border-color: var(--purple); background: rgba(172,155,196,.2); }
.uplist { max-height: 180px; overflow: auto; font-size: 13px; margin-top: 12px; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.loading { padding: 48px; text-align: center; color: var(--ink-light); }
.skeleton { background: var(--beige-mid); animation: pulse 1.4s ease-in-out infinite; border-radius: 6px; }
@keyframes pulse { 50% { opacity: .5; } }
code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }
textarea.code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; min-height: 380px; line-height: 1.45; }
.wf-diagram { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 12px 0; }
.wf-diagram .st { padding: 6px 12px; border-radius: 4px; color: #fff; font-size: 13px; font-weight: 600; }
.wf-tr { font-size: 13px; color: var(--ink-mid); }

/* ---------- login ---------- */
.login { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.login .art { background: var(--purple); color: var(--beige-light); padding: 64px; display: flex; flex-direction: column; justify-content: space-between; }
.login .art .word { font-family: var(--serif); letter-spacing: .3em; font-size: 22px; color: #fff; }
.login .art blockquote { font-family: var(--serif); font-size: 36px; line-height: 1.25; margin: 0; color: #fff; max-width: 480px; }
.login .form { display: grid; place-items: center; padding: 32px; }
.login form { width: min(380px, 100%); }

@media (max-width: 1100px) { .asset { grid-template-columns: 1fr; } .panel { position: static; } .two { grid-template-columns: 1fr; } }
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .side { position: fixed; left: 0; top: 0; bottom: 0; width: 270px; z-index: 120; transform: translateX(-100%); transition: transform .25s ease-out; }
  .side.open { transform: none; }
  .btn.menu-btn, .btn.filters-btn { display: inline-flex; }
  #upbtn .lbl { display: none; } #upbtn { padding: 0 12px; }
  .top { padding: 10px 16px; } .content { padding: 20px 16px; }
  .lib { grid-template-columns: 1fr; } .filters { display: none; } .filters.open { display: block; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
  .login { grid-template-columns: 1fr; } .login .art { display: none; }
  .user .name { display: none; }
  .proc .grid2 { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

.psec { grid-column: 1 / -1; font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--purple); font-weight: 600; border-bottom: 1px solid var(--beige); padding: 12px 0 4px; margin-top: 4px; }
.psec:first-child { padding-top: 0; margin-top: 0; }
.proc .grid2 .field:has([data-param=method]), .proc .grid2 .field:has([data-param=animation]) { grid-column: 1 / -1; }
.ent-mark .nm { max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.zoomwrap { width: 100%; display: grid; place-items: center; }
.zoomwrap img { cursor: zoom-in; }
.zoomwrap.actual { display: block; overflow: auto; max-height: 75vh; }
.zoomwrap.actual img { max-width: none; max-height: none; cursor: zoom-out; }
.dimtag { position: absolute; right: 8px; bottom: 8px; background: rgba(26,26,26,.75); color: #fff; font-size: 12px; padding: 2px 8px; border-radius: 3px; pointer-events: none; }

/* "Plus d'infos" panels */
details.more { margin-top: 6px; }
details.more > summary { cursor: pointer; font-size: 12px; color: var(--purple, #3D275C); font-weight: 600; list-style: none; display: inline-flex; align-items: center; gap: 4px; user-select: none; }
details.more > summary::-webkit-details-marker { display: none; }
details.more > summary::after { content: "▾"; font-size: 11px; transition: transform .15s; }
details.more[open] > summary::after { transform: rotate(180deg); }
details.more .morebody { margin-top: 8px; padding: 10px 12px; background: var(--beige-light, #F6F1EA); border-radius: 6px; }
details.more h4 { margin: 10px 0 6px; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-light); }
details.more h4:first-child { margin-top: 0; }
details.more .kv { grid-template-columns: minmax(110px, 40%) 1fr; font-size: 12.5px; gap: 4px 10px; }
details.more .kv dt.kvsec { grid-column: 1 / -1; font-weight: 600; color: var(--ink); margin-top: 4px; }
details.more .kv dd.kvsec { display: none; }
.swatch { display: inline-block; width: 12px; height: 12px; border-radius: 3px; border: 1px solid rgba(0,0,0,.2); vertical-align: -2px; }
.files li { flex-wrap: wrap; }
.files li > details.more { flex: 0 0 100%; margin: -4px 0 2px 54px; max-width: calc(100% - 54px); }

/* panoramic / very wide media */
.asset.wide { grid-template-columns: minmax(0, 1fr); }
.asset.wide .panel { max-width: 960px; }
.viewtabs .vtsp { flex: 1; }
.stage.tall { display: block; overflow-x: auto; min-height: 0; }
.stage.tall img, .stage.tall video, .stage.tall .zoomwrap img { max-width: none; width: auto; height: 68vh; max-height: none; }
.stage.tall .zoomwrap { display: block; }

/* auto-tagging */
.aibox { margin-top: 8px; padding: 10px 12px; border: 1px dashed var(--purple-light); border-radius: var(--r); background: #FAF8FD; }
.aibox.empty { border: none; background: none; padding: 4px 0 0; display: flex; gap: 10px; align-items: center; }
.aibox .chips { margin-top: 8px; gap: 6px; }
.aichip { display: inline-flex; align-items: center; gap: 6px; background: #fff; border: 1px solid var(--purple-light); border-radius: 999px; padding: 2px 4px 2px 10px; font-size: 13px; }
.aichip .pct { font-size: 11px; color: var(--ink-light); }
.aichip button { border: none; background: none; cursor: pointer; width: 22px; height: 22px; border-radius: 50%; font-size: 12px; line-height: 1; color: var(--ink-mid); }
.aichip button[data-ai-ok]:hover { background: var(--olive-light); color: #fff; }
.aichip button[data-ai-no]:hover { background: var(--red); color: #fff; }
.thumb .aisug { position: absolute; right: 8px; top: 8px; background: var(--purple); color: #fff; font-size: 11px; padding: 1px 7px; border-radius: 999px; }
.vocabsum { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px 20px; margin: 14px 0; }
