/* Levine/Leavitt – visual admin. Tokens follow the Figma "Collection v2 – Visual refresh" frame. */
:root {
  --ink: #161616;
  --muted: #606367;
  --soft: #767676;
  --faint: #999;
  --line: #d8d8d8;
  --hair: #ececec;
  --hair2: #e4e4e4;
  --tile: #ececec;
  --admin: #f6f6f6;
  --green: #46b450;
  --amber: #dba617;
  --red: #d63638;
  --ui: 'Schibsted Grotesk', system-ui, -apple-system, 'Helvetica Neue', Arial, sans-serif;
  --display: var(--ui);
  --serif: var(--ui);
  --topbar: 44px;
  --panel: 360px;
  --ease: cubic-bezier(.2, .8, .2, 1);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: #fff; color: var(--ink);
  font: 400 13px/1.3 var(--ui); -webkit-font-smoothing: antialiased;
}
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
img { display: block; }
h1, h2, h3, h4, p { margin: 0; }
[hidden] { display: none !important; }
.ic { flex: none; display: block; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
body.is-dragging, body.is-dragging * { cursor: grabbing !important; user-select: none !important; }

/* ───────── Top bar ───────── */
.topbar {
  position: sticky; top: 0; z-index: 60; height: var(--topbar);
  display: flex; align-items: center; background: #fff; border-bottom: 1px solid var(--hair);
  padding-right: 20px;
}
.menu-tab {
  width: 16px; height: 30px; background: var(--ink); color: #fff; display: grid; place-items: center;
  margin-right: 12px; transition: width .2s var(--ease);
}
.menu-tab:hover { width: 22px; }
.brand { display: block; }
.brand img { width: 156px; height: 12px; }
.topbar__nav { display: flex; align-items: center; gap: 26px; margin-left: 36px; }
.topbar__nav a { display: flex; align-items: center; gap: 6px; font-size: 12px; line-height: 1.3; }
.topbar__nav a:hover { text-decoration: underline; text-underline-offset: 3px; }
.topbar__user { margin-left: auto; display: flex; align-items: center; gap: 12px; font-size: 16px; }
.avatar { width: 20px; height: 20px; border: 1px solid var(--faint); background: var(--tile); position: relative; overflow: hidden; }
.avatar::after { content: 'L'; position: absolute; inset: 0; display: grid; place-items: center; font: 500 10px var(--ui); color: var(--muted); }

/* Slide-over menu */
.sidemenu-backdrop { position: fixed; inset: var(--topbar) 0 0 0; z-index: 70; background: rgba(22, 22, 22, .28); opacity: 0; pointer-events: none; transition: opacity .25s; }
.sidemenu {
  position: fixed; z-index: 71; top: var(--topbar); bottom: 0; left: 0; width: 264px; background: #fff;
  border-right: 1px solid var(--hair); transform: translateX(-102%); transition: transform .3s var(--ease);
  overflow: auto; padding: 8px 0 24px;
}
body.menu-open .sidemenu { transform: none; box-shadow: 0 20px 60px rgba(0, 0, 0, .12); }
body.menu-open .sidemenu-backdrop { opacity: 1; pointer-events: auto; }
.sidemenu a, .sidemenu button.mi {
  display: flex; align-items: center; gap: 10px; width: 100%; height: 44px; padding: 0 18px; font-size: 12px; text-align: left;
}
.sidemenu .mi:hover { background: var(--admin); }
.sidemenu .mi.is-active { background: var(--ink); color: #fff; }
.sidemenu .mi.is-soon { color: var(--soft); }
.sidemenu hr { border: 0; border-top: 1px solid var(--hair2); margin: 10px 18px; }
.sidemenu .sec { font: 400 16px var(--serif); padding: 14px 18px 6px; color: var(--ink); }

/* ───────── Layout ───────── */
.app { display: flex; align-items: flex-start; min-height: calc(100vh - var(--topbar)); }
.main { flex: 1; min-width: 0; padding: 40px 48px 140px; }
.panel {
  position: sticky; top: var(--topbar); height: calc(100vh - var(--topbar)); width: 0; flex: none;
  overflow: hidden; background: #fff; border-left: 1px solid transparent; transition: width .3s var(--ease), border-color .3s;
}
.panel.is-open { width: var(--panel); border-left-color: var(--hair); }
.panel__inner { width: var(--panel); height: 100%; display: flex; flex-direction: column; }
.panel__head { display: flex; justify-content: space-between; align-items: center; padding: 28px 28px 0; }
.panel__title { font: 400 28px/32px var(--display); letter-spacing: -.02em; }
.panel__body { flex: 1; overflow: auto; padding: 20px 28px 32px; scrollbar-width: thin; }
.panel__foot { border-top: 1px solid var(--hair); padding: 20px 28px; display: flex; gap: 12px; background: #fff; }
.panel__foot .btn--solid { flex: 1; }
.iconbtn { width: 30px; height: 30px; display: grid; place-items: center; }
.iconbtn:hover { background: var(--admin); }

@media (max-width: 1180px) {
  .panel { position: fixed; right: 0; top: var(--topbar); z-index: 55; width: min(var(--panel), 100vw); transform: translateX(102%); transition: transform .3s var(--ease); border-left-color: var(--hair); box-shadow: -20px 0 60px rgba(0, 0, 0, .1); }
  .panel.is-open { width: min(var(--panel), 100vw); transform: none; }
  .main { padding: 32px 28px 120px; }
}

/* ───────── Page header ───────── */
.eyebrow { font: 500 11px/1 var(--ui); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.pagehead { display: flex; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; gap: 24px 32px; padding-bottom: 32px; border-bottom: 1px solid var(--hair); }
.titleblock { min-width: 0; }
.page-title {
  margin-top: 10px; font: 400 56px/64px var(--display); letter-spacing: -.03em; outline: none; display: inline-block; max-width: 100%;
  border-radius: 2px; cursor: text; position: relative;
}
.page-title:hover { box-shadow: 0 2px 0 0 var(--hair2); }
.page-title:focus { box-shadow: 0 2px 0 0 var(--ink); }
.titlewrap { display: flex; align-items: center; gap: 14px; }
.titlewrap .ic { color: var(--faint); opacity: 0; transition: opacity .15s; }
.titlewrap:hover .ic { opacity: 1; }

.permalink {
  margin-top: 10px; display: inline-flex; align-items: center; height: 41px; border: 1px solid var(--line);
  border-radius: 999px; padding: 0 7px 0 17px; gap: 12px; max-width: 100%; background: #fff;
}
.permalink__label { font: 500 10px/1 var(--ui); letter-spacing: .14em; color: var(--faint); }
.permalink__sep { width: 1px; height: 16px; background: var(--line); flex: none; }
.permalink__url { font-size: 14px; color: #3d4043; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; }
.permalink__url b { font-weight: 500; color: var(--ink); }
.permalink__url input { font: inherit; border: 0; outline: 0; border-bottom: 1px solid var(--ink); background: none; width: 15ch; padding: 0; color: var(--ink); font-weight: 500; }
.permalink__note { font-size: 12px; color: var(--soft); padding-right: 12px; }
.pill {
  height: 27px; padding: 0 12px; background: var(--ink); color: #fff; display: inline-flex; align-items: center; gap: 6px; font: 500 12px var(--ui);
}
.pill:hover { background: #000; }

.actions { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.status { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); min-width: 118px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); flex: none; transition: background .2s; }
.status[data-state='saving'] .dot { background: var(--amber); }
.btn {
  height: 42px; padding: 0 22px; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: 500 13px var(--ui); background: #fff; color: var(--ink); border: 1px solid var(--line); white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s;
}
.btn:hover { border-color: var(--ink); }
.btn--solid { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn--solid:hover { background: #000; }
.btn--sm { height: 32px; padding: 0 14px; font-size: 12px; }
.btn[disabled] { opacity: .4; pointer-events: none; }

/* ───────── Section bar ───────── */
.sectionbar { display: flex; justify-content: space-between; align-items: center; margin: 32px 0 24px; gap: 16px; flex-wrap: wrap; }
.sectionbar h2 { font: 400 30px/40px var(--display); letter-spacing: -.015em; display: flex; align-items: flex-start; gap: 3px; }
.sectionbar h2 sup { font: 400 12px/15px var(--ui); color: var(--muted); letter-spacing: 0; margin-top: 4px; }
.sectionbar__actions { display: flex; align-items: center; gap: 20px; }
.drag-hint { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.vsep { width: 1px; height: 24px; background: var(--line); }
.txtbtn { font: 500 11px/1 var(--ui); letter-spacing: .08em; text-transform: uppercase; color: var(--ink); padding: 6px 2px; }
.txtbtn:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ───────── Artist works grid ───────── */
.works { --h: clamp(230px, 22vw, 380px); display: flex; flex-wrap: wrap; gap: 28px 25px; align-items: flex-start; }
.tile { position: relative; flex: 0 1 calc(var(--h) * var(--w, .8)); min-width: 150px; user-select: none; touch-action: pan-y; }
.tile__img { position: relative; height: var(--h); overflow: hidden; cursor: grab; }
.tile__img img { width: 100%; height: 100%; object-fit: contain; object-position: center top; pointer-events: none; -webkit-user-drag: none; transition: transform .5s var(--ease); }
.tile:hover .tile__img img { transform: scale(1.015); }
.tile__check, .tile__grip {
  position: absolute; top: 14px; width: 28px; height: 28px; display: grid; place-items: center; background: var(--ink); color: #fff; pointer-events: none;
}
.tile__check { left: 14px; border-radius: 50%; opacity: 0; transform: scale(.7); transition: .18s var(--ease); }
.tile__grip { right: 14px; border-radius: 6px; opacity: 0; transition: opacity .15s; }
.tile:hover .tile__grip { opacity: .92; }
.tile.is-selected .tile__img { outline: 2px solid var(--ink); outline-offset: 0; }
.tile.is-selected .tile__check { opacity: 1; transform: none; }
.tile__state { position: absolute; left: 14px; bottom: 14px; background: #fff; font: 500 10px/1 var(--ui); letter-spacing: .12em; padding: 6px 8px; text-transform: uppercase; }
.tile.is-draft .tile__img img { opacity: .45; }
.tile__cap { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; margin-top: 14px; }
.tile__cap h3 { font: 400 18px/22px var(--display); letter-spacing: -.01em; }
.tile__cap .meta { margin-top: 4px; font: 400 10px/12px var(--ui); letter-spacing: .12em; text-transform: uppercase; color: var(--faint); }
.more { width: 32px; height: 22px; display: grid; place-items: center; color: var(--ink); margin-top: -2px; }
.more:hover { background: var(--admin); }

.tile--add {
  flex: 0 1 calc(var(--h) * .8); min-width: 150px; background: var(--tile); height: var(--h); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
  color: var(--muted); font: 400 16px var(--serif); transition: background .15s; align-self: flex-start;
}
.tile--add:hover { background: var(--hair2); color: var(--ink); }
.tile--add .ic { color: var(--soft); }

.tile.is-placeholder .tile__img { background: transparent; outline: 1px dashed #b6b6b6; outline-offset: -1px; }
.tile.is-placeholder .tile__img > * { visibility: hidden; }
.tile.is-placeholder .tile__img::after {
  content: ''; position: absolute; inset: 0; background: linear-gradient(var(--ink), var(--ink)) center 42%/1px 30px no-repeat, linear-gradient(var(--ink), var(--ink)) center 42%/30px 1px no-repeat; opacity: .6;
}
.tile.is-placeholder .tile__img::before {
  content: 'Drop here'; position: absolute; left: 0; right: 0; top: 56%; text-align: center; font: 400 16px var(--serif); color: var(--muted); z-index: 1;
}
.tile.is-placeholder .tile__cap { visibility: hidden; }

.ghost {
  position: fixed; left: 0; top: 0; z-index: 400; pointer-events: none; background: #fff; padding: 8px 8px 12px;
  box-shadow: 0 22px 48px rgba(0, 0, 0, .2), 0 3px 8px rgba(0, 0, 0, .1); will-change: transform;
}
.ghost .tile { flex: none; width: 100%; min-width: 0; }
.ghost .tile__img { height: calc(var(--h) * .74); cursor: grabbing; }
.ghost .tile__grip { opacity: 1; left: 10px; right: auto; top: 10px; }
.ghost .tile__check, .ghost .tile__state { display: none; }
.ghost .tile__cap { margin-top: 10px; }

/* ───────── Menu / popover ───────── */
.menu {
  position: fixed; z-index: 300; background: #fff; border: 1px solid var(--line); box-shadow: 0 14px 40px rgba(0, 0, 0, .14);
  min-width: 190px; padding: 6px 0; animation: pop .14s var(--ease);
}
@keyframes pop { from { opacity: 0; transform: translateY(-4px); } }
.menu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 14px; font-size: 13px; text-align: left; }
.menu button:hover { background: var(--admin); }
.menu button.danger { color: var(--red); }
.menu hr { border: 0; border-top: 1px solid var(--hair); margin: 6px 0; }
.menu .ic { color: var(--muted); }
.menu button.danger .ic { color: var(--red); }

/* ───────── Panel fields ───────── */
.preview { position: relative; height: 340px; overflow: hidden; }
.preview img { width: 100%; height: 100%; object-fit: contain; object-position: center top; }
.preview--focal { cursor: crosshair; }
.preview .ring { position: absolute; width: 34px; height: 34px; border: 2px solid #fff; border-radius: 50%; box-shadow: 0 0 0 1px rgba(0, 0, 0, .35), inset 0 0 0 1px rgba(0, 0, 0, .25); transform: translate(-50%, -50%); pointer-events: none; }
.preview .ring::after { content: ''; position: absolute; inset: 50% auto auto 50%; width: 4px; height: 4px; margin: -2px; background: #fff; border-radius: 50%; }
.preview__replace {
  position: absolute; left: 14px; bottom: 14px; height: 34px; padding: 0 14px 0 12px; background: #fff; display: inline-flex; align-items: center; gap: 8px; font: 500 12px var(--ui);
  box-shadow: 0 2px 10px rgba(0, 0, 0, .12);
}
.preview__trash { position: absolute; right: 14px; bottom: 14px; width: 38px; height: 38px; background: #fff; display: grid; place-items: center; box-shadow: 0 2px 10px rgba(0, 0, 0, .12); }
.preview__replace:hover, .preview__trash:hover { background: var(--ink); color: #fff; }
.preview__empty { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; color: var(--muted); font-size: 12px; gap: 8px; align-content: center; }
.filemeta { margin-top: 12px; font-size: 11px; color: var(--faint); display: flex; gap: 6px; flex-wrap: wrap; }
.filemeta b { font-weight: 500; color: var(--ink); }

.field { margin-top: 22px; position: relative; }
.field > label, .field > .lbl { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.acf { font: 500 9px/1 var(--ui); letter-spacing: .08em; padding: 3px 6px; background: var(--hair); color: var(--soft); border-radius: 3px; }
.input, .select, .textarea {
  width: 100%; height: 43px; border: 1px solid var(--line); background: #fff; padding: 0 15px; font: 400 14px var(--ui); color: var(--ink); border-radius: 0; outline: none; transition: border-color .15s;
}
.input:hover, .select:hover, .textarea:hover { border-color: #b6b6b6; }
.input:focus, .select:focus, .textarea:focus, .tagbox:focus-within { border-color: var(--ink); }
.select { appearance: none; -webkit-appearance: none; font: 400 16px var(--serif); padding-right: 40px; cursor: pointer; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23161616' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 14px center; }
.select--dot { padding-left: 34px; }
.select-dot { position: absolute; left: 15px; bottom: 17px; width: 8px; height: 8px; border-radius: 50%; pointer-events: none; }
.textarea { height: auto; min-height: 79px; padding: 13px 15px 30px; line-height: 1.45; resize: none; display: block; }
.counter { position: absolute; left: 15px; bottom: 9px; font-size: 11px; color: var(--faint); pointer-events: none; }
.counter.is-over { color: var(--red); }

.tagbox { border: 1px solid var(--line); padding: 11px; transition: border-color .15s; background: #fff; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; background: var(--ink); color: #fff; padding: 5px 7px 5px 11px; font-size: 12px; line-height: 15px; }
.chip button { width: 14px; height: 14px; display: grid; place-items: center; opacity: .8; }
.chip button:hover { opacity: 1; background: rgba(255, 255, 255, .2); }
.tagbox hr { border: 0; border-top: 1px solid var(--hair); margin: 10px 0; }
.chips:empty + hr { display: none; }
.tagadd { display: flex; align-items: center; gap: 8px; color: var(--faint); }
.tagadd input { flex: 1; border: 0; outline: 0; font: 400 13px var(--ui); color: var(--ink); background: none; min-width: 0; padding: 0; height: 18px; }
.tagadd input::placeholder { color: var(--faint); }
kbd { font: 400 10px/1 var(--ui); color: var(--faint); border: 1px solid var(--hair2); border-radius: 3px; padding: 3px 6px; }
.suggest { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 8px; }
.suggest .lbl { font-size: 11px; color: var(--faint); margin-right: 2px; }
.sugchip { border: 1px solid var(--line); padding: 3px 10px 3px 8px; font-size: 11px; color: var(--muted); display: inline-flex; align-items: center; gap: 4px; transition: .15s; }
.sugchip:hover { border-color: var(--ink); color: var(--ink); }

.sizes { display: grid; grid-template-columns: repeat(var(--n, 3), 1fr); gap: 10px; }
.size { display: flex; flex-direction: column; align-items: center; gap: 8px; font-size: 11px; color: var(--muted); }
.size__tile { width: 100%; height: 54px; border: 1px solid var(--line); display: grid; place-items: center; background: #fff; transition: border-color .15s; }
.size__tile i { display: block; background: var(--line); transition: background .15s; }
.size:hover .size__tile { border-color: #b6b6b6; }
.size.is-on { color: var(--ink); }
.size.is-on .size__tile { border: 2px solid var(--ink); }
.size.is-on .size__tile i { background: var(--ink); }

.seg { display: inline-flex; border: 1px solid var(--line); }
.seg button { height: 32px; padding: 0 12px; font: 500 11px var(--ui); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); border-right: 1px solid var(--line); }
.seg button:last-child { border-right: 0; }
.seg button.is-on { background: var(--ink); color: #fff; }
.seg button:not(.is-on):hover { color: var(--ink); background: var(--admin); }
.seg--full { display: flex; } .seg--full button { flex: 1; }

.switch { display: flex; align-items: center; gap: 12px; cursor: pointer; font-size: 13px; padding: 4px 0; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch i { position: relative; width: 34px; height: 20px; border-radius: 999px; background: var(--line); transition: background .2s; flex: none; }
.switch i::after { content: ''; position: absolute; left: 2px; top: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .2s var(--ease); box-shadow: 0 1px 2px rgba(0, 0, 0, .25); }
.switch input:checked + i { background: var(--ink); }
.switch input:checked + i::after { transform: translateX(14px); }
.switch input:focus-visible + i { outline: 2px solid var(--ink); outline-offset: 2px; }

.discs { display: flex; flex-wrap: wrap; gap: 6px; }
.discs button { border: 1px solid var(--line); padding: 5px 11px; font-size: 12px; color: var(--muted); transition: .15s; }
.discs button:hover { border-color: var(--ink); color: var(--ink); }
.discs button.is-on { background: var(--ink); border-color: var(--ink); color: #fff; }
.hint { font-size: 11px; color: var(--faint); margin-top: 8px; line-height: 1.4; }
.linkbtn { font-size: 12px; text-decoration: underline; text-underline-offset: 3px; color: var(--ink); display: inline-flex; align-items: center; gap: 4px; }

/* ───────── Toast ───────── */
.toast {
  position: fixed; left: 50%; bottom: 28px; z-index: 600; transform: translate(-50%, 20px); opacity: 0; background: var(--ink); color: #fff; padding: 12px 18px; font-size: 13px;
  display: flex; align-items: center; gap: 10px; transition: .28s var(--ease); pointer-events: none; max-width: 90vw; box-shadow: 0 10px 30px rgba(0, 0, 0, .25);
}
.toast.is-on { transform: translate(-50%, 0); opacity: 1; }
.toast .ic { color: var(--green); }
.toast__act { font: 600 12px var(--ui); letter-spacing: .06em; text-transform: uppercase; text-decoration: underline; text-underline-offset: 3px; margin-left: 6px; color: #fff; }

/* Front-end artist page (preview) */
.fe-artist { padding: 24px 40px 0; }
.fe-artist h1 { font: 400 clamp(40px, 7cqw, 84px)/1 var(--display); letter-spacing: -.035em; }
.fe-artist .roles { margin-top: 14px; font: 500 11px var(--ui); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.fe-masonry { margin-top: 44px; column-count: 3; column-gap: 24px; }
.fe-masonry figure { margin: 0 0 28px; break-inside: avoid; }
.fe-masonry img { width: 100%; height: auto; }
.fe-masonry figcaption { margin-top: 10px; font-size: 12px; display: flex; justify-content: space-between; gap: 10px; }
.fe-masonry figcaption span { color: var(--faint); font-size: 10px; letter-spacing: .12em; text-transform: uppercase; }
@container (max-width: 900px) { .fe-masonry { column-count: 2; } .fe-artist { padding: 20px; } }
@container (max-width: 520px) { .fe-masonry { column-count: 1; } }

/* ───────── Modal ───────── */
.modal { position: fixed; inset: 0; z-index: 500; display: grid; place-items: center; background: rgba(22, 22, 22, .5); padding: 24px; animation: fade .2s; }
@keyframes fade { from { opacity: 0; } }
.modal__dialog { background: #fff; width: min(880px, 100%); max-height: min(86vh, 800px); display: flex; flex-direction: column; box-shadow: 0 30px 80px rgba(0, 0, 0, .3); animation: rise .28s var(--ease); }
@keyframes rise { from { transform: translateY(14px); opacity: 0; } }
.modal__head { display: flex; justify-content: space-between; align-items: center; padding: 26px 28px 0; }
.modal__head h2 { font: 400 28px/32px var(--display); letter-spacing: -.02em; }
.modal__body { padding: 20px 28px; overflow: auto; flex: 1; min-height: 0; }
.modal__foot { padding: 18px 28px; border-top: 1px solid var(--hair); display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.tabs { display: flex; gap: 22px; border-bottom: 1px solid var(--hair); margin-bottom: 20px; }
.tabs button { font: 500 11px/1 var(--ui); letter-spacing: .1em; text-transform: uppercase; color: var(--faint); padding: 0 0 13px; margin-bottom: -1px; border-bottom: 2px solid transparent; }
.tabs button.is-on { color: var(--ink); border-bottom-color: var(--ink); }
.lib { display: grid; grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 12px; }
.lib__item { position: relative; aspect-ratio: 4/5; overflow: hidden; text-align: left; }
.lib__item img { width: 100%; height: 100%; object-fit: contain; object-position: center top; transition: transform .4s var(--ease); }
.lib__item:hover img { transform: scale(1.04); }
.lib__item span { position: absolute; left: 0; right: 0; bottom: 0; padding: 18px 8px 7px; font-size: 10px; color: #fff; background: linear-gradient(transparent, rgba(0, 0, 0, .6)); opacity: 0; transition: opacity .15s; }
.lib__item:hover span { opacity: 1; }
.lib__item.is-on { outline: 2px solid var(--ink); outline-offset: -2px; }
.lib__item .tick { position: absolute; top: 8px; left: 8px; width: 24px; height: 24px; border-radius: 50%; background: var(--ink); color: #fff; display: none; place-items: center; }
.lib__item.is-on .tick { display: grid; }
.drop { display: grid; place-items: center; text-align: center; gap: 10px; min-height: 260px; border: 1px dashed #b6b6b6; color: var(--muted); cursor: pointer; padding: 24px; transition: .15s; }
.drop:hover, .drop.is-over { background: var(--admin); border-color: var(--ink); color: var(--ink); }
.drop b { font: 400 22px var(--display); color: var(--ink); }
.search { position: relative; margin-bottom: 16px; }
.search .ic { position: absolute; left: 14px; top: 14px; color: var(--faint); }
.search input { padding-left: 40px; }
.pick { display: flex; align-items: center; gap: 14px; width: 100%; padding: 8px 10px; text-align: left; border-bottom: 1px solid var(--hair); }
.pick:hover { background: var(--admin); }
.pick img, .pick .ph { width: 42px; height: 52px; object-fit: contain; object-position: center top; flex: none; }
.pick .ph { background: var(--tile); }
.pick b { display: block; font: 500 13px var(--ui); }
.pick small { color: var(--faint); font-size: 11px; }

/* ───────── Rich-text toolbar ───────── */
.rt { position: fixed; z-index: 450; display: flex; background: var(--ink); color: #fff; padding: 0; opacity: 0; pointer-events: none; transition: opacity .12s; box-shadow: 0 8px 24px rgba(0, 0, 0, .22); }
.rt.is-on { opacity: 1; pointer-events: auto; }
.rt button { height: 28px; min-width: 30px; padding: 0 9px; font: 600 11px var(--ui); color: #fff; }
.rt button:hover { background: #333; }
.rt i { width: 1px; background: #444; margin: 6px 0; }

/* ───────── Preview overlay ───────── */
.pv { position: fixed; inset: 0; z-index: 480; background: #e9e9e9; display: flex; flex-direction: column; animation: fade .2s; }
.pv__bar { height: 52px; flex: none; background: #fff; border-bottom: 1px solid var(--hair); display: flex; align-items: center; justify-content: space-between; padding: 0 16px 0 24px; gap: 16px; }
.pv__bar .l { display: flex; align-items: center; gap: 12px; font-size: 12px; color: var(--muted); }
.pv__bar .l b { color: var(--ink); font-weight: 500; }
.pv__stage { flex: 1; overflow: auto; padding: 24px; display: flex; justify-content: center; align-items: flex-start; }
.pv__frame { background: #fff; width: 100%; min-height: 100%; transition: width .35s var(--ease); box-shadow: 0 10px 40px rgba(0, 0, 0, .12); container-type: inline-size; }
.pv__frame[data-device='tablet'] { width: 820px; }
.pv__frame[data-device='mobile'] { width: 390px; }

/* Front-end chrome used in previews */
.fe { color: var(--ink); font-family: var(--ui); }
.fe-head { display: flex; align-items: center; justify-content: space-between; padding: 26px 40px 22px; gap: 20px; }
.fe-head img { width: 190px; height: auto; }
.fe-head nav { display: flex; gap: 28px; font: 500 12px var(--ui); letter-spacing: .1em; text-transform: uppercase; }
.fe-foot { padding: 70px 40px 50px; border-top: 1px solid var(--hair); margin-top: 90px; font-size: 12px; color: var(--muted); display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; line-height: 1.6; }
.fe-foot b { color: var(--ink); font-weight: 500; display: block; margin-bottom: 6px; letter-spacing: .08em; text-transform: uppercase; font-size: 11px; }
@container (max-width: 640px) {
  .fe-head { padding: 20px; flex-direction: column; align-items: flex-start; }
  .fe-head img { width: 150px; }
  .fe-head nav { gap: 16px; font-size: 11px; flex-wrap: wrap; }
  .fe-foot { grid-template-columns: 1fr; padding: 40px 20px; }
}

@media (max-width: 760px) {
  .page-title { font-size: 40px; line-height: 46px; }
  .topbar__nav { display: none; }
  .topbar__user span { display: none; }
}

/* ───────── Portfolio tabs ───────── */
.tabsbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px 24px; margin-top: 28px; border-bottom: 1px solid var(--hair); flex-wrap: wrap; }
.tabs-list { display: flex; align-items: flex-end; gap: 4px 30px; flex-wrap: wrap; }
.ptab { position: relative; display: flex; align-items: center; gap: 8px; padding: 0 0 14px; margin-bottom: -1px; border-bottom: 2px solid transparent; color: var(--faint); transition: color .15s, border-color .15s; }
.ptab:hover { color: var(--ink); }
.ptab.is-on { color: var(--ink); border-bottom-color: var(--ink); }
.ptab__name { display: inline-flex; align-items: center; height: 22px; font: 500 11px/1 var(--ui); letter-spacing: .12em; text-transform: uppercase; color: inherit; padding: 0; white-space: nowrap; }   /* same 22px row as the count + menu button, so every tab label (incl. Bio) lines up */
.ptab__n { font: 400 10px/1 var(--ui); color: var(--faint); }
.ptab__more { width: 22px; height: 22px; display: grid; place-items: center; opacity: 0; color: var(--ink); margin-left: -2px; }
.ptab:hover .ptab__more, .ptab.is-on .ptab__more, .ptab__more:focus-visible { opacity: 1; }
.ptab__more:hover { background: var(--admin); }
.ptab.is-hidden .ptab__name { text-decoration: line-through; text-decoration-thickness: 1px; }
.ptab__hid { display: inline-flex; color: var(--faint); }
.ptab-add { display: inline-flex; align-items: center; gap: 6px; box-sizing: border-box; height: 38px; padding: 0 0 14px; border-bottom: 2px solid transparent; font: 500 11px/1 var(--ui); letter-spacing: .12em; text-transform: uppercase; color: var(--ink); }
.ptab-add:hover { text-decoration: underline; text-underline-offset: 4px; }
.sec-title { outline: none; cursor: text; border-radius: 2px; min-width: 2ch; }
.sec-title:hover { box-shadow: 0 2px 0 0 var(--hair2); }
.sec-title:focus { box-shadow: 0 2px 0 0 var(--ink); }
.sectionbar__actions .seg button { height: 32px; }

/* ───────── Works grid: same sizing system as the homepage (standard · wide · tall · large) ───────── */
.works { --cols: 4; --gap: 24px; display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); gap: 28px var(--gap); align-items: start; }
.works > .tile { flex: none; min-width: 0; }
/* size = width (standard 1 col · wide 2 cols · large 3 cols); each frame follows its media so the title sits directly beneath it */
.works .tile__img { height: auto; aspect-ratio: auto; }
.works .tile__img img { height: auto; object-fit: initial; display: block; }
.works .tile[data-span='2'] { grid-column: span 2; }
.works .tile[data-span='3'] { grid-column: span 3; }
.works .tile[data-span='4'] { grid-column: span 4; }
.works .tile[data-span='5'] { grid-column: span 5; }
.works > .tile--add { grid-column: 1; flex: none; min-width: 0; height: auto; aspect-ratio: 4 / 5; }
@media (max-width: 1180px) { .works { --cols: 3 !important; } .works .tile[data-span='4'], .works .tile[data-span='5'] { grid-column: 1 / -1; } }
@media (max-width: 760px) { .works { --cols: 2 !important; } .works .tile[data-span='3'], .works .tile[data-span='4'], .works .tile[data-span='5'] { grid-column: 1 / -1; } }
.ghost { --h: 300px; }
.ghost .tile__img { aspect-ratio: auto !important; }

/* preview tabs */
.fe-tabs { display: flex; gap: 28px; margin-top: 36px; border-bottom: 1px solid var(--hair); flex-wrap: wrap; }
.fe-tabs button { font: 500 11px/1 var(--ui); letter-spacing: .12em; text-transform: uppercase; color: var(--faint); padding: 0 0 14px; margin-bottom: -1px; border-bottom: 2px solid transparent; }
.fe-tabs button.is-on { color: var(--ink); border-bottom-color: var(--ink); }
.fe-works { margin-top: 36px; --cols: 3; }
.fe-works .tile__img { cursor: default; }
.fe-works .tile__cap { justify-content: flex-start; }
@container (max-width: 900px) { .fe-works { --cols: 2 !important; } .fe-works .tile[data-span='3'], .fe-works .tile[data-span='4'], .fe-works .tile[data-span='5'] { grid-column: 1 / -1; } }
@container (max-width: 520px) { .fe-works { --cols: 1 !important; } .fe-works .tile[data-span] { grid-column: auto; } }

/* media library: video tiles + type filter */
.libbar { display: flex; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.libbar .search { flex: 1; min-width: 220px; }
.libbar .seg button { height: 43px; }
.lib__item video { width: 100%; height: 100%; object-fit: contain; object-position: center top; display: block; pointer-events: none; }
.lib__item .vbadge { position: absolute; right: 8px; top: 8px; width: 24px; height: 24px; border-radius: 50%; background: rgba(22, 22, 22, .8); color: #fff; display: grid; place-items: center; padding-left: 1px; }

/* drag the right edge of a tile to change its width */
.tile__resize { position: absolute; top: 0; right: 0; bottom: 0; width: 16px; z-index: 4; cursor: ew-resize; display: grid; place-items: center; opacity: 0; touch-action: none; transition: opacity .15s; }
.tile__resize::before { content: ''; width: 4px; height: 46px; max-height: 60%; background: var(--ink); border-radius: 2px; box-shadow: 0 0 0 2px #fff; }
.tile:hover .tile__resize, .tile.is-selected .tile__resize, .tile.is-resizing .tile__resize, .tile__resize:focus-visible { opacity: 1; }
.tile.is-resizing body.is-resizing, body.is-resizing * { cursor: ew-resize !important; user-select: none !important; }
.ghost .tile__resize { display: none; }

/* bio tab: pinned to the right end of the tab row */
.tabs-left { display: flex; align-items: flex-end; gap: 4px 30px; flex-wrap: wrap; }
.ptab--bio { margin-left: 0; }
.bio { margin-top: 8px; max-width: 820px; }
.biosec { padding: 28px 0 30px; border-bottom: 1px solid var(--hair); position: relative; }
.biosec:last-child { border-bottom: 0; }
.biosec__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.biosec__title { font: 400 22px/1.2 var(--display); letter-spacing: -.015em; outline: none; cursor: text; border-radius: 2px; min-width: 4ch; }
.biosec__title:hover, .biosec__body:hover { background: rgba(22, 22, 22, .04); }
.biosec__title:focus, .biosec__body:focus { background: rgba(22, 22, 22, .06); }
.biosec__body { font: 400 17px/1.65 var(--ui); color: #3d4043; outline: none; cursor: text; border-radius: 2px; min-height: 3em; }
.biosec__body p { margin: 0 0 1em; }
.biosec__body[data-ph]:empty::before, .biosec__title[data-ph]:empty::before { content: attr(data-ph); color: var(--faint); }
.biosec__del { opacity: 0; transition: opacity .15s; }
.biosec:hover .biosec__del, .biosec__del:focus-visible { opacity: 1; }
.bio-empty { padding: 40px 0; color: var(--muted); }
.fe-bio { margin-top: 36px; max-width: 760px; }
.fe-bio .fe-bio__sec { margin-bottom: 36px; }
.fe-bio h3 { font: 400 22px/1.2 var(--display); letter-spacing: -.015em; margin: 0 0 12px; }
.fe-bio .fe-bio__txt { font: 400 17px/1.65 var(--ui); color: #3d4043; }
.fe-bio .fe-bio__txt p { margin: 0 0 1em; }
