/* Studio console */

:root {
  --bg: #f6f4ef;
  --panel: #ffffff;
  --side: #fbfaf7;
  --ink: #1b1a17;
  --ink-2: #4b473f;
  --muted: #8a847a;
  --line: #ebe6dc;
  --line-2: #ddd6c9;
  --hover: #f4f1ea;
  --brand: #7c3450;
  --brand-soft: #f6ebef;
  --ok: #2f6b45; --ok-bg: #e8f2ea;
  --warn: #8a5a12; --warn-bg: #fbf1de;
  --info: #2d5a8a; --info-bg: #e8eff7;
  --danger: #a3293a; --danger-bg: #f8e6e8;
  --serif: "Cormorant Garamond", "Iowan Old Style", Georgia, serif;
  --sans: "Inter", -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: "SFMono-Regular", ui-monospace, Menlo, Consolas, monospace;
  --r: 12px;
  --r-sm: 8px;
  --shadow: 0 1px 2px rgba(27, 26, 23, .04);
  --shadow-lg: 0 24px 60px -24px rgba(27, 26, 23, .28);
  --ease: cubic-bezier(.2, .7, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 14px/1.55 var(--sans); -webkit-font-smoothing: antialiased; font-feature-settings: "cv11", "ss01"; }
a { color: inherit; }
img { display: block; max-width: 100%; }
p { margin: 0; }
h1, h2, h3 { margin: 0; line-height: 1.15; }
h1 { font-family: var(--serif); font-weight: 500; font-size: 40px; letter-spacing: -.01em; }
h2 { font-size: 15px; font-weight: 600; letter-spacing: -.005em; }
h3 { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); font-weight: 600; margin: 22px 0 12px; }
small { display: block; color: var(--muted); font-size: 12.5px; font-weight: 400; }
code { font-family: var(--mono); font-size: .9em; background: var(--hover); padding: 2px 6px; border-radius: 5px; }
.i { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.inline { display: inline; }
.stack { display: grid; gap: 10px; }
.stack-lg { display: grid; gap: 20px; align-content: start; }
.eyebrow { font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); font-weight: 500; }
.warn-text { color: var(--warn); }

/* App frame */
.app { display: grid; grid-template-columns: 252px minmax(0, 1fr); min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; background: var(--side); border-right: 1px solid var(--line); display: flex; flex-direction: column; padding: 18px 14px; gap: 22px; }
.side-brand { display: flex; align-items: center; gap: 12px; text-decoration: none; padding: 4px 8px 14px; border-bottom: 1px solid var(--line); }
.side-brand img { width: 40px; height: 40px; object-fit: contain; }
.mark-word { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; background: var(--ink); color: #fff; font-family: var(--serif); font-size: 18px; letter-spacing: .04em; }
.side-brand b { display: block; font-family: var(--serif); font-weight: 600; font-size: 17px; line-height: 1.15; }
.side-brand small { font-size: 10.5px; letter-spacing: .18em; text-transform: uppercase; margin-top: 2px; }
.side-nav { display: grid; gap: 2px; }
.side-nav a { display: flex; align-items: center; gap: 11px; height: 38px; padding: 0 12px; border-radius: var(--r-sm); text-decoration: none; color: var(--ink-2); font-weight: 500; transition: background .15s; }
.side-nav a:hover { background: var(--hover); color: var(--ink); }
.side-nav a[aria-current] { background: var(--panel); color: var(--ink); box-shadow: 0 0 0 1px var(--line), var(--shadow); }
.side-nav a[aria-current] .i { color: var(--brand); }
.dot-count { margin-left: auto; font-style: normal; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--brand); color: #fff; font-size: 11px; font-weight: 600; display: grid; place-items: center; }
.side-foot { margin-top: auto; display: grid; gap: 10px; }
.side-link { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: var(--r-sm); text-decoration: none; color: var(--muted); font-size: 13px; }
.side-link:hover { background: var(--hover); color: var(--ink); }
.side .me { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; padding: 12px 8px 4px; border-top: 1px solid var(--line); }
.me-text { min-width: 0; }
.me-text b { display: block; font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-text small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 11.5px; }
.main { padding: 34px clamp(20px, 3.5vw, 48px) 80px; display: grid; gap: 24px; align-content: start; max-width: 1440px; width: 100%; }

/* Flash */
.flash { display: flex; align-items: center; gap: 10px; background: var(--ink); color: #f6f4ef; padding: 12px 14px 12px 16px; border-radius: var(--r-sm); box-shadow: var(--shadow-lg); position: fixed; right: 24px; bottom: 24px; z-index: 90; max-width: 480px; animation: rise .35s var(--ease); }
.flash .i { color: #9fd3ae; }
.flash-x { margin-left: 8px; border: 0; background: none; color: #b8b2a8; cursor: pointer; display: grid; place-items: center; }
@keyframes rise { from { transform: translateY(12px); opacity: 0; } }

/* Page head */
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap; padding-bottom: 4px; }
.page-head .eyebrow { margin-bottom: 8px; display: block; }
.page-head .sub { color: var(--muted); margin-top: 8px; max-width: 64ch; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.head-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.back { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); text-decoration: none; font-size: 13px; margin-bottom: 10px; }
.back:hover { color: var(--ink); }
.back .i { width: 15px; height: 15px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 38px; padding: 0 16px; border-radius: var(--r-sm); border: 1px solid transparent; font: 500 13.5px var(--sans); text-decoration: none; cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s, box-shadow .15s; }
.btn .i { width: 16px; height: 16px; }
.btn-primary { background: var(--ink); color: #fff; }
.btn-primary:hover { background: #33302b; }
.btn-secondary { background: var(--panel); color: var(--ink); border-color: var(--line-2); box-shadow: var(--shadow); }
.btn-secondary:hover { border-color: #c9c1b2; background: #fdfcfa; }
.btn-ghost { background: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--hover); color: var(--ink); }
.btn-ghost-dark { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .25); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #8a2131; }
.btn.danger, .icon-btn.danger { color: var(--danger); }
.btn-lg { height: 46px; font-size: 14.5px; }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; }
.btn-xs { height: 28px; padding: 0 10px; font-size: 12.5px; border-radius: 7px; }
.btn-block { width: 100%; }
.btn.is-armed, .icon-btn.is-armed { background: var(--danger) !important; color: #fff !important; border-color: var(--danger) !important; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.icon-btn { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: var(--r-sm); border: 0; background: none; color: var(--ink-2); cursor: pointer; }
.icon-btn:hover { background: var(--hover); color: var(--ink); }
.icon-btn.sm { width: 28px; height: 28px; }
.icon-btn:disabled { opacity: .3; cursor: default; }
.linkish { background: none; border: 0; color: inherit; cursor: pointer; font: inherit; text-decoration: underline; opacity: .8; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* Pills */
.pill { display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: 11px; font-size: 11.5px; font-weight: 600; letter-spacing: .01em; background: var(--hover); color: var(--ink-2); white-space: nowrap; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; margin-right: 6px; opacity: .8; }
.pill-active, .pill-o-paid, .pill-g-published { background: var(--ok-bg); color: var(--ok); }
.pill-invited, .pill-o-deposit, .pill-g-draft { background: var(--warn-bg); color: var(--warn); }
.pill-not_invited, .pill-o-pending, .pill-g-hidden { background: var(--hover); color: var(--muted); }
.pill-expired, .pill-disabled, .pill-o-refunded, .pill-o-canceled { background: var(--danger-bg); color: var(--danger); }
.pill-o-comp { background: var(--brand-soft); color: var(--brand); }
.chip-tag { font-style: normal; font-size: 10.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--brand); background: var(--brand-soft); padding: 2px 6px; border-radius: 4px; }

/* Avatars */
.avatar { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: #efe9df; color: var(--ink-2); font-weight: 600; font-size: 12px; letter-spacing: .02em; flex: none; }
.avatar.sm { width: 28px; height: 28px; font-size: 11px; }
.avatar.lg { width: 76px; height: 76px; font-size: 24px; font-family: var(--serif); font-weight: 500; }
.who { display: flex; align-items: center; gap: 12px; text-decoration: none; min-width: 0; }
.who b { display: block; font-weight: 600; }
.who small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who:hover b { text-decoration: underline; text-underline-offset: 3px; }
.who.lg { margin-bottom: 16px; }

/* Cards */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); padding: 22px 24px; }
.card-flush { padding: 0; overflow: hidden; }
.card-flush > .card-h { padding: 18px 24px 0; }
.card-h { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; }
.card-h h2 { display: inline-flex; align-items: center; gap: 8px; }
.card-h a { color: var(--muted); font-size: 13px; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
.card-h a:hover { color: var(--ink); }
.card-f { display: flex; gap: 10px; justify-content: flex-end; border-top: 1px solid var(--line); margin: 22px -24px -22px; padding: 14px 24px; background: #fcfbf9; border-radius: 0 0 var(--r) var(--r); }
details.card > summary { list-style: none; cursor: pointer; margin-bottom: 0; }
details.card > summary::-webkit-details-marker { display: none; }
details.card[open] > summary { margin-bottom: 18px; }
.cols { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(300px, 1fr); gap: 20px; align-items: start; }
.empty { text-align: center; display: grid; justify-items: center; gap: 10px; padding: 64px 24px; }
.empty h2 { font-family: var(--serif); font-weight: 500; font-size: 28px; }
.empty p { color: var(--muted); max-width: 52ch; }
.empty .btn { margin-top: 8px; }
.empty-icon { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; background: var(--hover); color: var(--ink-2); margin-bottom: 6px; }
.empty-icon .i { width: 22px; height: 22px; }
.empty-sm { color: var(--muted); padding: 10px 0; display: grid; gap: 10px; justify-items: start; }
.empty-sm.center { justify-items: center; padding: 36px; }
.danger-card { display: flex; justify-content: space-between; align-items: center; gap: 20px; border-color: #efd5d9; }
.danger-card h2 { margin-bottom: 4px; }

/* Callouts */
.callout { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--r-sm); font-size: 13.5px; border: 1px solid transparent; }
.callout .i { margin-top: 1px; }
.callout-ok { background: var(--ok-bg); color: var(--ok); }
.callout-warn { background: var(--warn-bg); color: var(--warn); }
.callout-danger { background: var(--danger-bg); color: var(--danger); }
.callout-key { background: var(--panel); border-color: var(--line-2); box-shadow: var(--shadow); padding: 18px 20px; }
.callout-key b { display: block; font-size: 14px; margin-bottom: 4px; }
.callout-key p { color: var(--ink-2); display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 6px 0; }
.callout-icon { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); flex: none; }
.temp { font-size: 18px; letter-spacing: .12em; padding: 6px 12px; background: var(--ink); color: #fff; border-radius: 6px; }

/* Forms */
.field { display: grid; gap: 7px; align-content: start; margin-bottom: 16px; border: 0; padding: 0; min-width: 0; }
.field > span:first-child { font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.field i { font-style: normal; font-weight: 400; color: var(--muted); }
input, select, textarea { width: 100%; height: 40px; padding: 0 12px; font: 14px var(--sans); color: var(--ink); background: var(--panel); border: 1px solid var(--line-2); border-radius: var(--r-sm); box-shadow: inset 0 1px 1px rgba(27, 26, 23, .03); transition: border-color .15s, box-shadow .15s; }
textarea { height: auto; padding: 10px 12px; resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(27, 26, 23, .07); }
input[type="checkbox"], input[type="radio"] { width: auto; height: auto; accent-color: var(--ink); box-shadow: none; }
input[type="range"] { height: 24px; padding: 0; box-shadow: none; border: 0; accent-color: var(--ink); }
input[type="file"] { height: auto; padding: 8px; border-style: dashed; }
.grid2, .grid3, .grid4 { display: grid; gap: 0 16px; }
.grid2 { grid-template-columns: 1fr 1fr; }
.grid3 { grid-template-columns: repeat(3, 1fr); }
.grid4 { grid-template-columns: repeat(4, 1fr); }
.span3 { grid-column: 1 / -1; }
.affix { display: flex; align-items: center; border: 1px solid var(--line-2); border-radius: var(--r-sm); background: var(--panel); overflow: hidden; }
.affix i { font-style: normal; color: var(--muted); padding-left: 12px; }
.affix input { border: 0; box-shadow: none; padding-left: 6px; }
.affix:focus-within { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(27, 26, 23, .07); }
.checks { display: grid; gap: 12px; margin: 4px 0 6px; }
.checks.two-col { grid-template-columns: 1fr 1fr; gap: 14px 24px; }
.inline-checks { grid-template-columns: 1fr; }
.check { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.check input { margin-top: 3px; }
.check b { font-weight: 500; }
.radio-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; margin-bottom: 18px; }
.radio-card { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border: 1px solid var(--line-2); border-radius: var(--r-sm); cursor: pointer; background: var(--panel); transition: border-color .15s, box-shadow .15s; margin-bottom: 8px; }
.radio-row .radio-card { margin-bottom: 0; }
.radio-card input { margin-top: 3px; }
.radio-card b { display: block; font-weight: 600; }
.radio-card:has(input:checked) { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.radio-card select { margin-top: 8px; }
.divider { height: 1px; background: var(--line); margin: 6px 0 18px; }
.toggle { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; white-space: nowrap; }
.toggle input { position: absolute; opacity: 0; }
.toggle span { width: 32px; height: 18px; border-radius: 9px; background: var(--line-2); position: relative; transition: background .2s; }
.toggle span::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .2); transition: transform .2s var(--ease); }
.toggle input:checked + span { background: var(--ink); }
.toggle input:checked + span::after { transform: translateX(14px); }
.toggle input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }
.file-row { display: flex; align-items: center; gap: 14px; }
.file-row.dark { background: #1b1a17; padding: 8px; border-radius: var(--r-sm); }
.file-row.dark input { color: #ddd; border-color: #444; }
.logo-prev { height: 44px; width: auto; }
.login-prev { width: 90px; height: 120px; object-fit: cover; border-radius: 6px; }
.form-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.record-form.bordered { border-top: 1px solid var(--line); margin-top: 18px; padding-top: 4px; }

/* Password show/hide */
.pw { position: relative; display: block; }
.pw input { padding-right: 46px; }
.pw-toggle { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 36px; height: 32px; border: 0; border-radius: 6px; background: none; color: var(--muted); cursor: pointer; display: grid; place-items: center; }
.pw-toggle:hover { color: var(--ink); background: var(--hover); }
.pw-toggle[aria-pressed="true"] { color: var(--ink); }

/* Toolbar, segmented, search */
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; }
.seg { display: inline-flex; padding: 3px; gap: 2px; background: #ece8df; border-radius: 10px; }
.seg a, .seg button { height: 30px; padding: 0 13px; display: inline-flex; align-items: center; border-radius: 7px; text-decoration: none; color: var(--ink-2); font-size: 13px; font-weight: 500; border: 0; background: none; cursor: pointer; }
.seg a:hover, .seg button:hover { color: var(--ink); }
.seg [aria-current], .seg [aria-pressed="true"] { background: var(--panel); color: var(--ink); box-shadow: 0 1px 2px rgba(27, 26, 23, .1); }
.seg.sm a, .seg.sm button { height: 26px; padding: 0 10px; font-size: 12px; }
.search { display: flex; align-items: center; gap: 8px; width: min(340px, 100%); height: 38px; padding: 0 12px; background: var(--panel); border: 1px solid var(--line-2); border-radius: var(--r-sm); color: var(--muted); }
.search input { border: 0; box-shadow: none; padding: 0; height: 100%; }
.search:focus-within { border-color: var(--ink); }
.search.sm { width: 100%; height: 34px; }

/* Tables */
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 11.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: 12px 16px; border-bottom: 1px solid var(--line); background: #fcfbf9; white-space: nowrap; }
.table td { padding: 13px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table td small { margin-top: 1px; }
.table a { text-decoration: none; }
.row-link { cursor: pointer; transition: background .12s; }
.row-link:hover { background: #fcfbf8; }
.table th.num, .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.row-tools { text-align: right; white-space: nowrap; }
.row-tools > * { margin-left: 4px; }
.link-inline { display: inline-flex; gap: 6px; }
.link-inline select { height: 28px; font-size: 12.5px; width: 180px; padding: 0 8px; }

/* Dashboard */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); padding: 18px 20px; display: grid; gap: 4px; }
.stat span { font-size: 12.5px; color: var(--muted); font-weight: 500; }
.stat b { font-family: var(--serif); font-size: 34px; font-weight: 500; line-height: 1.1; letter-spacing: -.01em; font-variant-numeric: lining-nums; }
.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: start; padding: 12px 0; border-bottom: 1px solid var(--line); }
.feed li:last-child { border-bottom: 0; }
.feed-lg li { padding: 16px 24px; }
.feed li.is-unread b::after { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--brand); margin-left: 8px; vertical-align: middle; }
.feed a { text-decoration: none; min-width: 0; }
.feed a b { font-weight: 600; }
.feed a:hover b { text-decoration: underline; text-underline-offset: 3px; }
.feed time { color: var(--muted); font-size: 12px; white-space: nowrap; }
.feed-icon { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--hover); color: var(--ink-2); }
.feed-icon .i { width: 15px; height: 15px; }
.feed-payment { background: var(--ok-bg); color: var(--ok); }
.feed-download { background: var(--info-bg); color: var(--info); }
.feed-activated { background: var(--brand-soft); color: var(--brand); }
.mini-list { list-style: none; margin: 0; padding: 0; display: grid; }
.mini-list a { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); text-decoration: none; }
.mini-list li:last-child a { border-bottom: 0; }
.mini-list b { font-weight: 600; display: block; }
.mini-thumb { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; background: var(--hover); }

/* Thumbs */
.thumb-empty { display: grid !important; place-items: center; color: var(--muted); background: var(--hover); }
.thumb-empty .i { width: 18px; height: 18px; }

/* Client profile */
.profile { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 20px; align-items: start; }
.profile-card { display: grid; justify-items: center; text-align: center; gap: 10px; padding-top: 30px; position: sticky; top: 24px; }
.profile-card h2 { font-family: var(--serif); font-weight: 500; font-size: 26px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 10px 12px; text-align: left; width: 100%; margin: 14px 0 4px; padding-top: 16px; border-top: 1px solid var(--line); font-size: 13.5px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.kv dd a { text-decoration: none; }
.kv-text { grid-template-columns: 110px 1fr; border-top: 0; padding-top: 0; }
.note { background: var(--warn-bg); color: #6d4a12; font-size: 13px; padding: 10px 12px; border-radius: var(--r-sm); text-align: left; width: 100%; }
.profile-actions { display: grid; gap: 4px; width: 100%; border-top: 1px solid var(--line); padding-top: 10px; margin-top: 6px; }
.gal-list { list-style: none; margin: 0 0 14px; padding: 0; }
.gal-list li { display: grid; grid-template-columns: 1fr auto auto; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.gal-link { display: flex; gap: 14px; align-items: center; text-decoration: none; min-width: 0; }
.gal-link b { display: block; font-weight: 600; }
.gal-thumb { width: 64px; height: 48px; border-radius: 6px; object-fit: cover; background: var(--hover); flex: none; }
.link-row { display: flex; gap: 8px; flex-wrap: wrap; }
.link-row select { width: auto; flex: 1; min-width: 200px; height: 32px; font-size: 13px; }
.timeline { list-style: none; margin: 0; padding: 0 0 0 4px; }
.timeline li { display: grid; grid-template-columns: 14px 1fr auto; gap: 12px; align-items: baseline; padding: 7px 0; position: relative; }
.timeline li::before { content: ""; position: absolute; left: 3px; top: 0; bottom: 0; width: 1px; background: var(--line); }
.timeline li:first-child::before { top: 14px; }
.timeline li:last-child::before { bottom: calc(100% - 14px); }
.tl-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--line-2); position: relative; z-index: 1; }
.timeline time { color: var(--muted); font-size: 12px; white-space: nowrap; }

/* Galleries grid */
.gal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px; }
.gal-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); overflow: hidden; text-decoration: none; display: grid; transition: box-shadow .2s, transform .2s var(--ease); }
.gal-card:hover { box-shadow: 0 10px 30px -14px rgba(27, 26, 23, .3); transform: translateY(-2px); }
.gal-card-media { aspect-ratio: 16 / 10; background: var(--hover); overflow: hidden; }
.gal-card-img { width: 100%; height: 100%; object-fit: cover; }
.gal-card-body { padding: 16px 18px 18px; display: grid; gap: 4px; }
.gal-card-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.gal-card-top b { font-family: var(--serif); font-weight: 600; font-size: 20px; line-height: 1.15; }
.gal-card-stats { display: flex; gap: 14px; margin-top: 8px; color: var(--ink-2); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.gal-card-stats span { display: inline-flex; align-items: center; gap: 5px; }
.gal-card-stats .i { width: 14px; height: 14px; color: var(--muted); }

/* Workspace */
.ws-head { display: grid; gap: 6px; }
.ws-row { display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap; }
.ws-title { display: flex; gap: 18px; align-items: center; }
.ws-title h1 { font-size: 36px; }
.ws-title .sub { color: var(--muted); margin-top: 6px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.ws-thumb { width: 64px; height: 64px; border-radius: 12px; object-fit: cover; background: var(--hover); }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-top: 18px; overflow-x: auto; }
.tabs a { padding: 10px 14px; text-decoration: none; color: var(--muted); font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a:hover { color: var(--ink); }
.tabs a[aria-current] { color: var(--ink); border-bottom-color: var(--ink); }
.ws-body { display: grid; gap: 20px; }

/* Photos tab */
.photos-layout { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 20px; align-items: start; }
.people { position: sticky; top: 20px; max-height: calc(100vh - 40px); display: grid; grid-template-rows: auto auto minmax(0, 1fr) auto; gap: 12px; padding: 18px; }
.people .card-h { margin-bottom: 0; }
.people-list { list-style: none; margin: 0 -8px; padding: 0; overflow-y: auto; }
.people-list a { display: grid; grid-template-columns: 34px 1fr auto; gap: 8px; align-items: center; padding: 8px; border-radius: var(--r-sm); text-decoration: none; }
.people-list a:hover { background: var(--hover); }
.people-list a[aria-current] { background: var(--ink); color: #fff; }
.people-list a[aria-current] small, .people-list a[aria-current] .pcount { color: #bdb7ad; }
.pnum { font-family: var(--serif); font-size: 18px; text-align: center; font-weight: 600; }
.pname { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 500; }
.pname small { font-size: 11px; color: var(--warn); }
.pcount { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.add-people summary { list-style: none; }
.add-people summary::-webkit-details-marker { display: none; }
.add-people[open] summary { margin-bottom: 12px; }
.photo-pane { display: grid; gap: 18px; }
.pane-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.pane-head h2 { font-family: var(--serif); font-weight: 500; font-size: 28px; }
.pane-head .sub { color: var(--muted); margin-top: 4px; }
.pane-head .sub a { color: var(--ink); }
.person-edit { border: 1px solid var(--line); border-radius: var(--r-sm); padding: 12px 16px; }
.person-edit summary { cursor: pointer; color: var(--ink-2); display: flex; align-items: center; gap: 8px; font-weight: 500; }
.person-edit[open] summary { margin-bottom: 16px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chips a { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 14px; border: 1px solid var(--line-2); border-radius: 17px; text-decoration: none; font-weight: 500; font-size: 13px; background: var(--panel); }
.chips a em { font-style: normal; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.chips a[aria-current] { background: var(--ink); color: #fff; border-color: var(--ink); }
.chips a[aria-current] em { color: #c9c3b9; }
.chips a[aria-current] .chip-tag { background: rgba(255, 255, 255, .14); color: #f3d9e2; }
.chips .chip-add { border-style: dashed; color: var(--muted); }
.dropzone { border: 1.5px dashed var(--line-2); border-radius: var(--r); padding: 28px; text-align: center; display: grid; justify-items: center; gap: 6px; background: #fcfbf9; transition: background .2s, border-color .2s; }
.dropzone.is-over { border-color: var(--ink); background: var(--hover); }
.dz-icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--panel); border: 1px solid var(--line); margin-bottom: 4px; }
.uploads { border: 1px solid var(--line); border-radius: var(--r-sm); padding: 14px 16px; display: grid; gap: 8px; }
.upload-plan { display: grid; gap: 4px; }
.bar-outer { height: 4px; background: var(--hover); border-radius: 2px; overflow: hidden; }
.bar-inner { height: 100%; background: var(--ink); width: 0; transition: width .25s; }
.upload-errors { color: var(--danger); font-size: 12.5px; max-height: 120px; overflow: auto; }
.error { color: var(--danger); }
.selbar { position: sticky; top: 14px; z-index: 6; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; background: var(--ink); color: #fff; padding: 10px 14px; border-radius: var(--r-sm); box-shadow: var(--shadow-lg); }
.selbar select { width: auto; height: 30px; font-size: 12.5px; background: #2e2b27; color: #fff; border-color: #48443e; }
.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.pcell { margin: 0; position: relative; aspect-ratio: 1; border-radius: 8px; overflow: hidden; background: var(--hover); cursor: pointer; }
.pcell img { width: 100%; height: 100%; object-fit: cover; }
.pcell figcaption { position: absolute; left: 0; right: 0; bottom: 0; padding: 4px 8px; font-size: 11px; color: #fff; background: rgba(27, 26, 23, .6); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; opacity: 0; transition: opacity .15s; }
.pcell figcaption i { font-style: normal; color: #f3c8d6; }
.pcell:hover figcaption { opacity: 1; }
.pcheck { position: absolute; top: 7px; left: 7px; z-index: 2; background: rgba(255, 255, 255, .95); border-radius: 5px; padding: 2px 4px; opacity: 0; transition: opacity .15s; display: flex; }
.pcell:hover .pcheck, .pcell.is-selected .pcheck, .pgrid.selecting .pcheck { opacity: 1; }
.pcell.is-selected { box-shadow: 0 0 0 3px var(--ink); }
.pstate { display: grid; place-items: center; height: 100%; font-size: 12px; color: var(--muted); }
.pcell.is-processing .pstate { animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .45; } }
.pcell.is-error .pstate { color: var(--danger); }

/* Pricing */
.set-row { display: grid; grid-template-columns: minmax(180px, 1fr) auto 130px auto; gap: 14px; align-items: center; }
.set-row input[name="name"] { height: 34px; }
.set-row .affix input { height: 34px; }
.add-row { display: grid; grid-template-columns: 1fr auto auto; gap: 12px; align-items: center; padding: 14px 16px; border-top: 1px solid var(--line); background: #fcfbf9; }
.add-row input[name="name"] { height: 34px; }

/* Design */
.design { display: grid; grid-template-columns: 430px minmax(0, 1fr); gap: 20px; align-items: start; }
.design-form h3:first-of-type { margin-top: 0; }
.opts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.opt { position: relative; display: grid; gap: 6px; justify-items: start; padding: 10px; border: 1px solid var(--line-2); border-radius: var(--r-sm); cursor: pointer; font-weight: 500; font-size: 13px; }
.opt small { font-size: 11.5px; }
.opt input { position: absolute; opacity: 0; }
.opt:has(input:checked) { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.opt:has(input:focus-visible) { outline: 2px solid var(--brand); outline-offset: 2px; }
.swatch { width: 100%; height: 40px; border-radius: 6px; border: 1px solid var(--line); display: grid; place-items: center; font-family: var(--serif); font-size: 18px; }
.font-demo { font-size: 26px; line-height: 1; height: 32px; }
.f-editorial { font-family: var(--serif); font-weight: 500; }
.f-classic { font-family: var(--serif); font-weight: 400; font-style: italic; }
.f-clean { font-family: var(--sans); font-weight: 500; letter-spacing: -.03em; }
.f-bold { font-family: var(--sans); font-weight: 600; letter-spacing: .08em; font-size: 20px; }
.layout-demo { width: 100%; height: 40px; display: grid; gap: 3px; }
.layout-demo i { background: #d9d0c2; border-radius: 2px; }
.l-columns { grid-template-columns: repeat(3, 1fr); grid-template-rows: 1.4fr 1fr; }
.l-columns i:nth-child(2) { grid-row: span 2; }
.l-rows { grid-template-columns: 1.4fr 1fr 1fr; grid-template-rows: 1fr 1fr; }
.l-sheet { grid-template-columns: repeat(4, 1fr); padding: 6px 0; }
.l-sheet i { border: 2px solid #fff; outline: 1px solid var(--line-2); }
.preview { position: sticky; top: 20px; }
.preview-bar { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.preview-bar span:first-child { display: inline-flex; gap: 8px; align-items: center; }
.preview iframe { display: block; width: 100%; height: calc(100vh - 140px); border: 0; margin: 0 auto; background: #f7f5f0; transition: width .25s var(--ease); }
.preview.is-phone iframe { width: 390px; border-left: 1px solid var(--line); border-right: 1px solid var(--line); }

/* Sales, orders */
.methods { display: flex; flex-wrap: wrap; gap: 12px; }
.method { border: 1px solid var(--line); border-radius: var(--r-sm); padding: 12px 16px; min-width: 160px; display: grid; gap: 2px; }
.method span { color: var(--muted); font-size: 12.5px; }
.method b { font-family: var(--serif); font-size: 26px; font-weight: 500; }
.lines { border-top: 1px solid var(--line); margin-bottom: 14px; }
.line { display: flex; justify-content: space-between; gap: 14px; padding: 11px 0; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.line-strong { font-weight: 600; }
.line-due { color: var(--warn); font-weight: 600; }
.pay-list { list-style: none; margin: 0; padding: 0; }
.pay-list li { display: grid; grid-template-columns: auto 1fr auto auto 28px; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.pay-list b { font-weight: 600; font-variant-numeric: tabular-nums; }
.pay-icon { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--ok-bg); color: var(--ok); }

/* Settings */
.settings { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 28px; align-items: start; }
.settings-nav { display: grid; gap: 2px; position: sticky; top: 20px; }
.settings-nav a { padding: 8px 12px; border-radius: var(--r-sm); text-decoration: none; color: var(--ink-2); font-weight: 500; }
.settings-nav a:hover { background: var(--hover); }
.settings-nav a[aria-current] { background: var(--panel); color: var(--ink); box-shadow: 0 0 0 1px var(--line), var(--shadow); }
.settings-body { max-width: 900px; display: grid; gap: 20px; align-content: start; }
.team-card { overflow: visible; }
.team-card .table th:first-child { border-top-left-radius: 0; }
.wm-preview { width: 100%; border-radius: var(--r-sm); }

/* Team password menu */
.pw-menu { display: inline-block; position: relative; text-align: left; }
.pw-menu summary { list-style: none; }
.pw-menu summary::-webkit-details-marker { display: none; }
.pw-panel { position: absolute; right: 0; top: calc(100% + 8px); z-index: 20; width: 300px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-lg); padding: 16px; white-space: normal; }
.pw-panel b { font-weight: 600; }
.pw-panel .divider { margin: 14px 0; }

/* Drawer */
.drawer { position: fixed; inset: 0; z-index: 80; visibility: hidden; }
.drawer::before { content: ""; position: absolute; inset: 0; background: rgba(27, 26, 23, .32); opacity: 0; transition: opacity .25s var(--ease); }
.drawer-body { position: absolute; top: 0; right: 0; bottom: 0; width: min(480px, 100%); background: var(--panel); box-shadow: var(--shadow-lg); padding: 26px 28px 0; overflow-y: auto; display: flex; flex-direction: column; transform: translateX(100%); transition: transform .32s var(--ease); }
.drawer.is-open { visibility: visible; }
.drawer.is-open::before { opacity: 1; }
.drawer.is-open .drawer-body { transform: none; }
.drawer-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 22px; }
.drawer-head h2 { font-family: var(--serif); font-weight: 500; font-size: 28px; margin-top: 4px; }
.drawer-foot { position: sticky; bottom: 0; margin: auto -28px 0; padding: 16px 28px; background: var(--panel); border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 10px; }

/* Login */
.login-body { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: var(--bg); }
.login { width: min(420px, 100%); display: grid; gap: 24px; justify-items: center; }
.login-mark img { height: 84px; width: auto; }
.login-mark .mark-word { width: 64px; height: 64px; font-size: 28px; border-radius: 16px; }
.login-card { width: 100%; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-lg); padding: 34px 32px; }
.login-form { display: grid; gap: 4px; }
.login-form h1 { font-size: 34px; }
.login-form .sub { color: var(--muted); margin: 4px 0 18px; }
.login-form .callout { margin-bottom: 14px; }
.muted-link { display: block; text-align: center; color: var(--muted); font-size: 13px; text-decoration: none; margin-top: 14px; }
.muted-link:hover { color: var(--ink); }
.login-foot { color: var(--muted); font-size: 12px; }

@media (max-width: 1180px) {
  .cols, .design { grid-template-columns: 1fr; }
  .preview { position: static; }
  .profile { grid-template-columns: 1fr; }
  .profile-card { position: static; }
  .stats { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 10px 14px; gap: 10px; }
  .side-brand { border: 0; padding: 0; }
  .side-brand span { display: none; }
  .side-nav { display: flex; overflow-x: auto; flex: 1; }
  .side-nav a span { display: none; }
  .side-foot { display: none; }
  .main { padding: 22px 16px 60px; }
  h1 { font-size: 32px; }
  .photos-layout, .settings { grid-template-columns: 1fr; }
  .people { position: static; max-height: 380px; }
  .settings-nav { position: static; display: flex; overflow-x: auto; }
  .grid2, .grid3, .grid4, .checks.two-col { grid-template-columns: 1fr; }
  .set-row { grid-template-columns: 1fr auto; }
  .table th:nth-child(n+4), .table td:nth-child(n+4) { display: none; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
