/* Belleza Catalogue Studio — admin UI
   Neutral palette only (black / white / greys). Colour comes from the product imagery. */

@font-face { font-family: 'Cormorant Garamond'; font-weight: 300; font-style: normal; font-display: swap; src: url('/fonts/cormorant-garamond-latin-300-normal.woff2') format('woff2'); }
@font-face { font-family: 'Cormorant Garamond'; font-weight: 400; font-style: normal; font-display: swap; src: url('/fonts/cormorant-garamond-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Cormorant Garamond'; font-weight: 500; font-style: normal; font-display: swap; src: url('/fonts/cormorant-garamond-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Cormorant Garamond'; font-weight: 400; font-style: italic; font-display: swap; src: url('/fonts/cormorant-garamond-latin-400-italic.woff2') format('woff2'); }
@font-face { font-family: 'Montserrat'; font-weight: 300; font-display: swap; src: url('/fonts/montserrat-latin-300-normal.woff2') format('woff2'); }
@font-face { font-family: 'Montserrat'; font-weight: 400; font-display: swap; src: url('/fonts/montserrat-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Montserrat'; font-weight: 500; font-display: swap; src: url('/fonts/montserrat-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Montserrat'; font-weight: 600; font-display: swap; src: url('/fonts/montserrat-latin-600-normal.woff2') format('woff2'); }

:root {
  --outer: #d9d9d7;
  --canvas: #ececea;
  --canvas-2: #e6e6e4;
  --card: #ffffff;
  --soft: #f4f4f2;
  --soft-2: #eeeeec;
  --line: #e4e4e2;
  --line-2: #d6d6d4;
  --ink: #111111;
  --ink-2: #4a4a48;
  --mute: #8d8d8b;
  --black: #0f0f0f;
  --r-xl: 30px;
  --r-lg: 24px;
  --r-md: 18px;
  --r-sm: 12px;
  --shadow: 0 1px 0 rgba(0,0,0,.02), 0 14px 34px -18px rgba(0,0,0,.18);
  --shadow-lg: 0 30px 80px -30px rgba(0,0,0,.35);
  --serif: 'Cormorant Garamond', Georgia, serif;
  --sans: 'Montserrat', system-ui, sans-serif;
  --ease: cubic-bezier(.2,.7,.2,1);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--sans); font-size: 13.5px; line-height: 1.5; color: var(--ink);
  background: var(--outer);
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
img { display: block; max-width: 100%; }
::selection { background: #111; color: #fff; }

/* ------------------------------------------------------------ shell */
.shell {
  margin: 16px; min-height: calc(100vh - 32px); border-radius: 36px;
  background:
    radial-gradient(1200px 600px at 85% 110%, #e2e2df 0%, rgba(226,226,223,0) 60%),
    radial-gradient(900px 500px at 0% 0%, #f6f6f4 0%, rgba(246,246,244,0) 60%),
    var(--canvas);
  padding: 22px 26px 30px; position: relative;
}
.topbar { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; }
.logo {
  height: 50px; padding: 0 26px; border-radius: 999px; border: 1px solid rgba(17,17,17,.35);
  display: inline-flex; align-items: center; font-family: var(--serif); font-weight: 500; font-size: 19px;
  letter-spacing: .42em; text-transform: uppercase; text-decoration: none; padding-right: calc(26px - .42em);
  background: rgba(255,255,255,.35);
}
.nav { margin-left: auto; display: flex; gap: 2px; padding: 5px; background: var(--card); border-radius: 999px; box-shadow: var(--shadow); }
.nav a {
  display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 18px; border-radius: 999px;
  text-decoration: none; font-weight: 500; font-size: 13px; color: var(--ink); transition: background .2s var(--ease);
}
.nav a:hover { background: var(--soft); }
.nav a.on { background: var(--black); color: #fff; }
.nav a svg { width: 16px; height: 16px; }
.nav a:not(.on) svg { display: none; }
.top-right { display: flex; align-items: center; gap: 8px; margin-left: 6px; }
.round {
  width: 50px; height: 50px; border-radius: 50%; border: 0; background: var(--card); display: grid; place-items: center;
  box-shadow: var(--shadow); transition: transform .2s var(--ease), background .2s;
}
.round:hover { transform: translateY(-1px); }
.round svg { width: 18px; height: 18px; }
.round.sm { width: 38px; height: 38px; box-shadow: none; border: 1px solid var(--line); }
.round.sm svg { width: 15px; height: 15px; }
.round.dark { background: var(--black); color: #fff; }
.user { display: flex; align-items: center; gap: 10px; background: var(--card); border-radius: 999px; padding: 5px 5px 5px 5px; box-shadow: var(--shadow); }
.avatar { width: 40px; height: 40px; border-radius: 50%; background: #1a1a1a; color: #fff; display: grid; place-items: center; font-family: var(--serif); font-size: 17px; letter-spacing: .04em; }
.user .who { line-height: 1.2; padding-right: 8px; }
.user .who b { display: block; font-weight: 600; font-size: 12.5px; }
.user .who span { font-size: 11px; color: var(--mute); }
.user .round { width: 40px; height: 40px; box-shadow: none; }
.menu { position: absolute; right: 0; top: 56px; background: var(--card); border-radius: var(--r-md); box-shadow: var(--shadow-lg); padding: 6px; min-width: 180px; z-index: 30; }
.menu button { display: flex; width: 100%; gap: 10px; align-items: center; border: 0; background: none; padding: 10px 12px; border-radius: 10px; text-align: left; }
.menu button:hover { background: var(--soft); }

/* ------------------------------------------------------------ type + primitives */
.h-serif { font-family: var(--serif); font-weight: 400; letter-spacing: -.005em; margin: 0; }
.page-title { font-family: var(--serif); font-weight: 400; font-size: 40px; line-height: 1.05; margin: 0; }
.eyebrow { font-size: 10.5px; font-weight: 600; letter-spacing: .2em; text-transform: uppercase; color: var(--mute); }
.muted { color: var(--mute); }
.card { background: var(--card); border-radius: var(--r-xl); box-shadow: var(--shadow); }
.card.pad { padding: 24px; }
.panel { background: rgba(255,255,255,.55); border-radius: 34px; padding: 18px; backdrop-filter: blur(6px); }
.row { display: flex; align-items: center; gap: 10px; }
.grow { flex: 1; min-width: 0; }
.spacer { flex: 1; }
.hide { display: none !important; }

.btn {
  height: 44px; border-radius: 999px; border: 0; padding: 0 20px; display: inline-flex; align-items: center; gap: 10px;
  font-weight: 500; font-size: 13px; background: var(--card); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line);
  transition: background .2s, transform .15s var(--ease); white-space: nowrap; text-decoration: none;
}
.btn:hover { background: var(--soft); }
.btn:active { transform: scale(.98); }
.btn svg { width: 16px; height: 16px; }
.btn.dark { background: var(--black); color: #fff; box-shadow: none; }
.btn.dark:hover { background: #2a2a2a; }
.btn.sm { height: 36px; padding: 0 14px; font-size: 12.5px; }
.btn.ghost { background: transparent; box-shadow: none; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-arrow { /* black pill with a white arrow disc, as in the reference */
  height: 50px; border-radius: 999px; border: 0; background: var(--black); color: #fff; display: inline-flex; align-items: center;
  gap: 14px; padding: 0 5px 0 22px; font-weight: 600; font-size: 13px; transition: background .2s; white-space: nowrap; text-decoration: none;
}
.btn-arrow:hover { background: #262626; }
.btn-arrow .disc { width: 40px; height: 40px; border-radius: 50%; background: #fff; color: #111; display: grid; place-items: center; transition: transform .25s var(--ease); }
.btn-arrow:hover .disc { transform: rotate(45deg); }
.btn-arrow .disc svg { width: 16px; height: 16px; }
.btn-arrow:disabled { opacity: .4; cursor: not-allowed; }

.pills { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.pill {
  height: 40px; padding: 0 18px; border-radius: 999px; border: 0; background: var(--card); font-weight: 500; font-size: 12.5px;
  display: inline-flex; align-items: center; gap: 8px; box-shadow: var(--shadow); white-space: nowrap;
}
.pill.on { background: var(--black); color: #fff; }
.pill svg { width: 15px; height: 15px; }
.pill .n { font-size: 11px; opacity: .55; }
.pill.sm { height: 32px; padding: 0 13px; font-size: 12px; box-shadow: inset 0 0 0 1px var(--line); }
.pill.sm.on { box-shadow: none; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 6px 0 12px; border-radius: 999px; background: var(--black); color: #fff; font-size: 11.5px; font-weight: 500; border: 0; }
.chip button { width: 20px; height: 20px; border-radius: 50%; border: 0; background: rgba(255,255,255,.18); color: #fff; display: grid; place-items: center; padding: 0; }
.chip button svg { width: 10px; height: 10px; }
.tag { display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: 999px; background: var(--soft); font-size: 11px; color: var(--ink-2); white-space: nowrap; }
.tag.dark { background: var(--black); color: #fff; }
.tag.line { background: transparent; box-shadow: inset 0 0 0 1px var(--line-2); }

.search { position: relative; display: flex; align-items: center; }
.search svg { position: absolute; left: 18px; width: 16px; height: 16px; color: var(--ink-2); pointer-events: none; }
.search input { height: 50px; width: 100%; border-radius: 999px; border: 0; background: var(--card); padding: 0 20px 0 46px; box-shadow: var(--shadow); outline: none; }
.search.flat input { box-shadow: inset 0 0 0 1px var(--line); height: 44px; background: var(--soft); }
.search input:focus { box-shadow: 0 0 0 2px var(--ink); }

.field { display: grid; gap: 6px; }
.field > span { font-size: 11px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--mute); }
.input, .field input, .field select, .field textarea {
  width: 100%; border: 0; background: var(--soft); border-radius: 14px; padding: 12px 14px; outline: none; box-shadow: inset 0 0 0 1px transparent;
  transition: box-shadow .15s;
}
.field textarea { resize: vertical; min-height: 92px; line-height: 1.5; }
.input:focus, .field input:focus, .field select:focus, .field textarea:focus { box-shadow: inset 0 0 0 1.5px var(--ink); background: #fff; }
select.input, .field select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23111' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 34px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.toggle { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); cursor: pointer; font-size: 13px; }
.toggle:last-child { border-bottom: 0; }
.switch { width: 40px; height: 24px; border-radius: 999px; background: var(--line-2); position: relative; transition: background .2s; flex: none; }
.switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .2s var(--ease); box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.switch.on { background: var(--black); }
.switch.on::after { transform: translateX(16px); }

.check { width: 18px; height: 18px; border-radius: 6px; box-shadow: inset 0 0 0 1.5px var(--line-2); display: grid; place-items: center; flex: none; background: #fff; }
.check.on { background: var(--black); box-shadow: none; color: #fff; }
.check svg { width: 12px; height: 12px; }

.empty { padding: 60px 20px; text-align: center; color: var(--mute); }
.empty .h-serif { font-size: 28px; color: var(--ink); margin-bottom: 6px; }

/* ------------------------------------------------------------ overview */
.ov-grid { display: grid; grid-template-columns: minmax(300px, 1fr) 2fr; gap: 14px; }
.hero-card { position: relative; border-radius: var(--r-xl); overflow: hidden; min-height: 440px; color: #fff; background: #222; box-shadow: var(--shadow); }
.hero-card .bg { position: absolute; inset: 0; background-size: cover; background-position: center; transition: opacity 1.2s ease, transform 8s ease; }
.hero-card .shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,.05) 30%, rgba(0,0,0,.65) 100%); }
.hero-card .content { position: absolute; left: 30px; right: 30px; bottom: 28px; }
.hero-card .big { font-family: var(--sans); font-weight: 500; font-size: 64px; letter-spacing: -.035em; line-height: 1; }
.hero-card .cap { font-size: 14px; margin-top: 8px; opacity: .9; }
.hero-card .pick { position: absolute; top: 22px; left: 22px; right: 22px; display: flex; justify-content: space-between; align-items: center; }
.hero-card .pick .tag { background: rgba(255,255,255,.88); color: #111; height: 30px; padding: 0 14px; font-weight: 500; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.stat { background: rgba(255,255,255,.62); border-radius: var(--r-xl); padding: 20px; min-height: 213px; display: flex; flex-direction: column; box-shadow: var(--shadow); text-decoration: none; transition: background .2s, transform .2s var(--ease); }
.stat:hover { background: rgba(255,255,255,.9); transform: translateY(-2px); }
.stat .top { display: flex; justify-content: space-between; align-items: center; }
.stat .ic { width: 42px; height: 42px; border-radius: 50%; background: #fff; display: grid; place-items: center; }
.stat .ic svg { width: 17px; height: 17px; }
.stat .label { margin-top: 18px; font-size: 16px; line-height: 1.25; font-weight: 500; }
.stat .bottom { margin-top: auto; display: flex; justify-content: space-between; align-items: flex-end; }
.stat .num { font-weight: 500; font-size: 46px; letter-spacing: -.035em; line-height: 1; }
.stack { display: flex; }
.stack span { width: 30px; height: 30px; border-radius: 50%; border: 2px solid #fff; background-size: cover; background-position: center; margin-left: -9px; background-color: #ccc; }
.stack span:first-child { margin-left: 0; }
.stack .more { background: var(--black); color: #fff; font-size: 10px; display: grid; place-items: center; font-weight: 600; }

.lower { margin-top: 14px; }
.lower-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.looks { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.look { position: relative; height: 230px; border-radius: var(--r-lg); overflow: hidden; color: #fff; border: 0; padding: 0; text-align: left; background: #333; }
.look .bg { position: absolute; inset: 0; background-size: cover; background-position: center; transition: transform .8s var(--ease); }
.look:hover .bg { transform: scale(1.06); }
.look .shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,0) 40%, rgba(0,0,0,.6)); }
.look .t { position: absolute; left: 18px; bottom: 16px; right: 60px; }
.look .t b { display: block; font-family: var(--serif); font-weight: 400; font-size: 26px; line-height: 1; }
.look .t span { font-size: 11.5px; opacity: .85; }
.look .go { position: absolute; right: 14px; bottom: 14px; width: 38px; height: 38px; border-radius: 50%; background: #fff; color: #111; display: grid; place-items: center; transition: transform .25s var(--ease); }
.look:hover .go { transform: rotate(45deg); }
.look .go svg { width: 15px; height: 15px; }
.split { display: grid; grid-template-columns: 1.4fr 1fr; gap: 14px; margin-top: 14px; }
.list-row { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.list-row:last-child { border-bottom: 0; }
.thumb { width: 52px; height: 52px; border-radius: 14px; background-size: cover; background-position: center; background-color: var(--soft-2); flex: none; }

/* ------------------------------------------------------------ create (builder) */
.builder { display: grid; grid-template-columns: 290px minmax(0, 1fr) 370px; gap: 14px; align-items: start; }
.filters { position: sticky; top: 16px; max-height: calc(100vh - 32px); overflow: auto; padding: 20px; }
.filters::-webkit-scrollbar, .compose::-webkit-scrollbar { width: 6px; }
.filters::-webkit-scrollbar-thumb, .compose::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 6px; }
.fgroup { border-top: 1px solid var(--line); padding: 12px 0 6px; }
.fgroup:first-of-type { border-top: 0; }
.fhead { display: flex; align-items: center; justify-content: space-between; width: 100%; border: 0; background: none; padding: 4px 0 8px; font-weight: 600; font-size: 12.5px; }
.fhead svg { width: 14px; height: 14px; transition: transform .2s; }
.fhead.closed svg { transform: rotate(-90deg); }
.fopt { display: flex; align-items: center; gap: 10px; padding: 5px 0; cursor: pointer; font-size: 13px; user-select: none; }
.fopt .c { margin-left: auto; font-size: 11px; color: var(--mute); }
.fopt.zero { opacity: .38; }
.quick { display: flex; flex-wrap: wrap; gap: 6px; margin: 14px 0 6px; }
.results-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 4px 4px 14px; }
.results-head .h-serif { font-size: 34px; line-height: 1; }
.active-chips { display: flex; gap: 6px; flex-wrap: wrap; margin: -4px 4px 14px; }
.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.pcard { position: relative; background: var(--card); border-radius: var(--r-lg); padding: 8px; box-shadow: var(--shadow); cursor: pointer; transition: transform .2s var(--ease), box-shadow .2s; border: 0; text-align: left; }
.pcard:hover { transform: translateY(-2px); }
.pcard.sel { box-shadow: 0 0 0 2px var(--black), var(--shadow); }
.pcard .im { position: relative; aspect-ratio: 1 / 1; border-radius: 18px; overflow: hidden; background: var(--soft-2); }
.pcard .im div { position: absolute; inset: 0; background-size: cover; background-position: center; transition: opacity .5s ease; }
.pcard .im .amb { opacity: 0; }
.pcard:hover .im .amb { opacity: 1; }
.pcard .tick { position: absolute; top: 10px; right: 10px; width: 30px; height: 30px; border-radius: 50%; background: rgba(255,255,255,.92); display: grid; place-items: center; color: transparent; transition: all .2s; }
.pcard.sel .tick { background: var(--black); color: #fff; }
.pcard .tick svg { width: 14px; height: 14px; }
.pcard .status { position: absolute; left: 10px; top: 10px; }
.pcard .meta { padding: 10px 8px 6px; }
.pcard .nm { font-family: var(--serif); font-size: 20px; line-height: 1.1; }
.pcard .sub { font-size: 11px; color: var(--mute); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pcard .sizes { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 8px; }
.pcard.off .im { filter: grayscale(.9); opacity: .65; }

.compose { position: sticky; top: 16px; max-height: calc(100vh - 32px); overflow: auto; padding: 20px; display: grid; gap: 18px; }
.compose h3 { font-family: var(--serif); font-weight: 400; font-size: 28px; margin: 0; line-height: 1; }
.sel-strip { display: grid; gap: 6px; max-height: 236px; overflow: auto; padding-right: 4px; }
.sel-item { display: flex; align-items: center; gap: 10px; padding: 6px; border-radius: 14px; background: var(--soft); }
.sel-item .thumb { width: 38px; height: 38px; border-radius: 10px; }
.sel-item .nm { font-size: 12.5px; font-weight: 500; line-height: 1.2; }
.sel-item .sub { font-size: 11px; color: var(--mute); }
.sel-item .acts { margin-left: auto; display: flex; gap: 2px; }
.icon-btn { width: 28px; height: 28px; border-radius: 50%; border: 0; background: transparent; display: grid; place-items: center; color: var(--ink-2); }
.icon-btn:hover { background: #fff; color: var(--ink); }
.icon-btn svg { width: 14px; height: 14px; }
.tpl-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tpl { border: 0; background: var(--soft); border-radius: 16px; padding: 10px; text-align: left; display: grid; gap: 8px; transition: background .2s, box-shadow .2s; }
.tpl:hover { background: var(--soft-2); }
.tpl.on { background: #fff; box-shadow: inset 0 0 0 2px var(--black); }
.tpl b { font-size: 12.5px; font-weight: 600; }
.tpl .mini { height: 74px; border-radius: 10px; background: #fff; display: grid; place-items: center; }
.tpl.on .mini { background: var(--soft); }
.tpl svg { width: 100%; height: 66px; }
.tpl-blurb { font-size: 12px; color: var(--mute); margin-top: -8px; }
.compose-actions { display: flex; gap: 8px; position: sticky; bottom: -20px; background: linear-gradient(180deg, rgba(255,255,255,0), #fff 30%); padding: 14px 0 0; margin-bottom: -4px; }

/* ------------------------------------------------------------ tables (products, history) */
.page-head { display: flex; align-items: flex-end; gap: 14px; flex-wrap: wrap; margin: 4px 4px 18px; }
.page-head .lead { color: var(--ink-2); max-width: 560px; margin-top: 6px; }
.tbl { width: 100%; border-collapse: separate; border-spacing: 0; }
.tbl th { text-align: left; font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--mute); font-weight: 600; padding: 14px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr:hover td { background: #fafaf9; }
.tbl .nm { font-family: var(--serif); font-size: 19px; line-height: 1.1; }
.tbl .sub { font-size: 11.5px; color: var(--mute); }
.status-select { height: 32px; border-radius: 999px; border: 0; padding: 0 30px 0 12px; font-size: 12px; font-weight: 500; background-color: var(--soft); appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%23111' stroke-width='2.4'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; }
.status-select.available { background-color: var(--black); color: #fff; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2.4'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); }
.date-input { height: 32px; border-radius: 999px; border: 0; background: var(--soft); padding: 0 12px; font-size: 12px; }
.bulkbar { position: sticky; bottom: 18px; margin: 14px auto 0; width: fit-content; display: flex; align-items: center; gap: 8px; background: var(--black); color: #fff; border-radius: 999px; padding: 6px 6px 6px 20px; box-shadow: var(--shadow-lg); z-index: 5; }
.bulkbar .btn { height: 38px; background: #262626; color: #fff; box-shadow: none; }
.bulkbar .btn:hover { background: #3a3a3a; }
.bulkbar input { height: 38px; border-radius: 999px; border: 0; padding: 0 12px; background: #262626; color: #fff; color-scheme: dark; }

/* ------------------------------------------------------------ drawer / modal */
.scrim { position: fixed; inset: 0; background: rgba(15,15,15,.38); backdrop-filter: blur(3px); z-index: 50; animation: fade .2s ease; }
.drawer { position: fixed; top: 12px; right: 12px; bottom: 12px; width: min(720px, calc(100vw - 24px)); background: var(--canvas); border-radius: 30px; z-index: 51; display: flex; flex-direction: column; box-shadow: var(--shadow-lg); animation: slide .3s var(--ease); }
.drawer-head { display: flex; align-items: center; gap: 12px; padding: 18px 18px 14px 26px; }
.drawer-body { overflow: auto; padding: 0 18px 18px; display: grid; gap: 12px; align-content: start; }
.drawer-foot { display: flex; gap: 8px; padding: 14px 18px; border-top: 1px solid var(--line-2); }
.modal { position: fixed; inset: 24px; z-index: 51; background: var(--canvas); border-radius: 32px; display: flex; flex-direction: column; overflow: hidden; box-shadow: var(--shadow-lg); animation: pop .25s var(--ease); }
.modal.small { inset: auto; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 48px); animation: none; }
.modal-head { display: flex; align-items: center; gap: 12px; padding: 16px 16px 16px 26px; }
.modal-body { flex: 1; overflow: auto; }
.preview-frame { width: 100%; height: 100%; border: 0; background: #e6e6e4; }
@keyframes fade { from { opacity: 0; } }
@keyframes slide { from { transform: translateX(40px); opacity: 0; } }
@keyframes pop { from { transform: scale(.98); opacity: 0; } }

.facet-edit { display: flex; flex-wrap: wrap; gap: 6px; }
.facet-edit button { height: 30px; border-radius: 999px; border: 0; padding: 0 12px; font-size: 12px; background: var(--soft); }
.facet-edit button.on { background: var(--black); color: #fff; }
.var-table input { width: 100%; border: 0; background: var(--soft); border-radius: 10px; padding: 8px 10px; font-size: 12.5px; }
.var-table td { padding: 4px; border: 0; }
.var-table th { padding: 4px 4px 6px; font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--mute); text-align: left; font-weight: 600; }
.img-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.img-tile { position: relative; border-radius: 16px; overflow: hidden; background: var(--soft-2); aspect-ratio: 1 / 1; border: 0; padding: 0; }
.img-tile .bg { position: absolute; inset: 0; background-size: cover; background-position: center; }
.img-tile .kind { position: absolute; left: 8px; bottom: 8px; }
.img-tile .x { position: absolute; top: 6px; right: 6px; width: 26px; height: 26px; border-radius: 50%; background: rgba(255,255,255,.92); border: 0; display: grid; place-items: center; }
.img-tile .x svg { width: 12px; height: 12px; }
.img-tile.sel { box-shadow: 0 0 0 3px var(--black); }
.img-tile .tick { position: absolute; top: 8px; right: 8px; width: 26px; height: 26px; border-radius: 50%; background: rgba(255,255,255,.9); display: grid; place-items: center; color: transparent; }
.img-tile.sel .tick { background: var(--black); color: #fff; }
.img-tile .tick svg { width: 12px; height: 12px; }
.kind-select { height: 24px; border-radius: 999px; border: 0; font-size: 11px; padding: 0 8px; background: rgba(255,255,255,.92); }

/* ------------------------------------------------------------ library */
.drop { border-radius: var(--r-xl); border: 1.5px dashed var(--line-2); background: rgba(255,255,255,.5); padding: 28px; display: flex; align-items: center; gap: 22px; transition: background .2s, border-color .2s; }
.drop.over { background: #fff; border-color: var(--ink); }
.drop .round { flex: none; }
.src-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; margin-top: 14px; }
.src { background: var(--card); border-radius: var(--r-xl); padding: 8px; box-shadow: var(--shadow); text-decoration: none; display: block; transition: transform .2s var(--ease); }
.src:hover { transform: translateY(-2px); }
.src .cover { aspect-ratio: 1.6 / 1; border-radius: 22px; background: var(--soft-2) center / cover; position: relative; overflow: hidden; }
.src .meta { padding: 12px 10px 8px; }
.src .nm { font-family: var(--serif); font-size: 22px; line-height: 1.1; }
.counts { display: flex; gap: 14px; margin-top: 8px; font-size: 12px; color: var(--ink-2); }
.counts b { font-weight: 600; color: var(--ink); }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2px solid rgba(0,0,0,.15); border-top-color: var(--ink); animation: spin .8s linear infinite; }
.spinner.light { border-color: rgba(255,255,255,.25); border-top-color: #fff; }
@keyframes spin { to { transform: rotate(360deg); } }
.pages-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.pg { border: 0; padding: 6px; background: var(--card); border-radius: 18px; box-shadow: var(--shadow); text-align: left; }
.pg img { border-radius: 12px; width: 100%; }
.pg span { display: block; font-size: 11px; color: var(--mute); padding: 6px 4px 0; }
.det-group { margin-top: 10px; }
.det-group h4 { margin: 0 0 6px; font-family: var(--serif); font-weight: 400; font-size: 22px; }
.det-row { display: grid; grid-template-columns: 28px 110px 140px 1fr 60px; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; cursor: pointer; font-size: 12.5px; }
.det-row:hover { background: var(--soft); }
.det-row .code { font-weight: 600; }
pre.json { background: #111; color: #e8e8e6; border-radius: 22px; padding: 22px; overflow: auto; max-height: 64vh; font-size: 12px; line-height: 1.55; }

/* ------------------------------------------------------------ toast + result */
.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); background: var(--black); color: #fff; padding: 12px 20px; border-radius: 999px; z-index: 80; box-shadow: var(--shadow-lg); font-size: 13px; animation: pop .2s var(--ease); }
.result-hero { display: flex; gap: 18px; align-items: center; padding: 6px 26px 22px; }
.result-hero .doc { width: 92px; height: 130px; border-radius: 10px; background: #fff center / cover; box-shadow: 0 10px 30px -10px rgba(0,0,0,.35); flex: none; }
.share-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 0 26px 26px; }
.share-grid .btn { justify-content: center; height: 50px; }

/* ------------------------------------------------------------ login */
.login { min-height: 100vh; display: grid; grid-template-columns: 1.15fr 1fr; padding: 16px; gap: 16px; }
.login .art { border-radius: 36px; background: #222 center / cover; position: relative; overflow: hidden; min-height: 300px; }
.login .art::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,.25), rgba(0,0,0,0) 40%, rgba(0,0,0,.55)); }
.login .art .wm { position: absolute; top: 34px; left: 0; right: 0; text-align: center; color: #fff; z-index: 1; font-family: var(--serif); font-size: 22px; letter-spacing: .5em; padding-left: .5em; }
.login .art .cap { position: absolute; left: 36px; bottom: 32px; color: #fff; z-index: 1; font-family: var(--serif); font-size: 34px; line-height: 1.1; max-width: 460px; }
.login .form { border-radius: 36px; background: var(--canvas); display: grid; place-items: center; padding: 40px; }
.login form { width: min(380px, 100%); display: grid; gap: 14px; }
.login h1 { font-family: var(--serif); font-weight: 400; font-size: 46px; margin: 0 0 6px; line-height: 1; }
.err { color: #111; background: #fff; border-radius: 12px; padding: 10px 14px; box-shadow: inset 0 0 0 1px var(--ink); font-size: 12.5px; }

/* ------------------------------------------------------------ responsive */
@media (max-width: 1320px) {
  .builder { grid-template-columns: 260px minmax(0, 1fr); }
  .compose { grid-column: 1 / -1; position: static; max-height: none; }
}
@media (max-width: 1100px) {
  .ov-grid, .split { grid-template-columns: 1fr; }
  .nav a { padding: 0 12px; }
  .user .who { display: none; }
}
@media (max-width: 860px) {
  .shell { margin: 0; border-radius: 0; padding: 14px; }
  .topbar { flex-wrap: wrap; }
  .nav { order: 3; width: 100%; overflow-x: auto; margin-left: 0; }
  .top-right { margin-left: auto; }
  .stats { grid-template-columns: 1fr 1fr; }
  .builder { grid-template-columns: 1fr; }
  .filters { position: static; max-height: none; }
  .login { grid-template-columns: 1fr; }
  .grid2 { grid-template-columns: 1fr; }
  .settings-grid { grid-template-columns: 1fr !important; }
  .drawer { top: 0; right: 0; bottom: 0; border-radius: 0; width: 100vw; }
  .modal { inset: 0; border-radius: 0; }
}
