/* iPicBase – Site, Auth & Dashboard */
:root {
  --ink: #0d2444;
  --ink-2: #1c3557;
  --muted: #5d6b80;
  --faint: #8a96a8;
  --line: #e3e7ee;
  --line-2: #eef1f5;
  --paper: #f6f4ef;
  --surface: #ffffff;
  --bg: #f4f6f9;
  --accent: #2b67c7;
  --accent-ink: #1f4f9e;
  --accent-soft: #e9f0fb;
  --success: #17804f;
  --success-soft: #e6f5ed;
  --warn: #a86400;
  --warn-soft: #fdf3e2;
  --danger: #c0352b;
  --danger-soft: #fdecea;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(13, 36, 68, .06), 0 4px 16px rgba(13, 36, 68, .06);
  --shadow-lg: 0 10px 40px rgba(13, 36, 68, .14);
  --sans: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--sans); font-size: 15px; line-height: 1.55; color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
img { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-ink); }
h1, h2, h3, h4 { margin: 0 0 .5em; line-height: 1.2; letter-spacing: -.01em; }
p { margin: 0 0 1em; }
.icon { width: 18px; height: 18px; flex: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.nowrap { white-space: nowrap; }
.stack > * + * { margin-top: 16px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row-between { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: 10px; border: 1px solid transparent; font: 600 14px/1 var(--sans); cursor: pointer; text-decoration: none; transition: background .15s, border-color .15s, color .15s, box-shadow .15s; white-space: nowrap; }
.btn .icon { width: 17px; height: 17px; }
.btn-primary { background: var(--ink); color: #fff; }
.btn-primary:hover { background: var(--ink-2); color: #fff; }
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { background: var(--accent-ink); color: #fff; }
.btn-ghost { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: #c9d1dd; color: var(--ink); background: #fbfcfd; }
.btn-danger { background: var(--surface); color: var(--danger); border-color: #f1c7c3; }
.btn-danger:hover { background: var(--danger-soft); color: var(--danger); }
.btn-danger-solid { background: var(--danger); color: #fff; }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; border-radius: 8px; }
.btn-lg { height: 50px; padding: 0 24px; font-size: 16px; border-radius: 12px; }
.btn-block { width: 100%; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; pointer-events: none; }
.link-btn { background: none; border: 0; padding: 0; font: inherit; color: var(--accent); cursor: pointer; }

/* Forms */
.field { display: block; margin-bottom: 18px; }
.field > span, .label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 6px; color: var(--ink); }
.field small, .hint { display: block; color: var(--muted); font-size: 12.5px; margin-top: 6px; }
.input, input:not([type]), input[type=text], input[type=email], input[type=password], input[type=date], input[type=number], input[type=url], input[type=tel], input[type=search], select, textarea {
  width: 100%; height: 42px; padding: 0 12px; border: 1px solid #d5dbe4; border-radius: 10px; background: #fff; color: var(--ink); font: 15px var(--sans); transition: border-color .15s, box-shadow .15s;
}
textarea { height: auto; min-height: 96px; padding: 10px 12px; resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(43, 103, 199, .15); }
input[type=color] { width: 52px; height: 42px; padding: 4px; border: 1px solid #d5dbe4; border-radius: 10px; background: #fff; cursor: pointer; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; cursor: pointer; }
.check input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--accent); flex: none; }
.field-error { color: var(--danger); font-size: 13px; margin: 6px 0 0; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 18px; }
@media (max-width: 720px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }
.radio-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.radio-card { position: relative; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; cursor: pointer; background: #fff; }
.radio-card input { position: absolute; opacity: 0; }
.radio-card strong { display: block; font-size: 14px; }
.radio-card span { font-size: 12.5px; color: var(--muted); }
.radio-card:has(input:checked) { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(43, 103, 199, .12); }
@media (max-width: 720px) { .radio-cards { grid-template-columns: 1fr; } }

/* Alerts */
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 16px; border-radius: 10px; font-size: 14px; margin-bottom: 20px; border: 1px solid transparent; }
.alert-success { background: var(--success-soft); color: #0f5a37; border-color: #c4e6d3; }
.alert-error { background: var(--danger-soft); color: #8f2119; border-color: #f4c9c4; }
.alert-info { background: var(--accent-soft); color: var(--accent-ink); border-color: #cddcf3; }
.alert-warn { background: var(--warn-soft); color: #7a4800; border-color: #f2dcb4; }
.alert a { color: inherit; font-weight: 600; text-decoration: underline; }

/* Badges */
.badge { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--line-2); color: var(--muted); white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .8; }
.badge-plain::before { display: none; }
.badge-success { background: var(--success-soft); color: var(--success); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-accent { background: var(--accent-soft); color: var(--accent); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }

/* Cards */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 1px 2px rgba(13, 36, 68, .04); }
.card-pad { padding: 24px; }
.card-head { padding: 18px 24px; border-bottom: 1px solid var(--line-2); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.card-head h2, .card-head h3 { margin: 0; font-size: 16px; }
.card-body { padding: 24px; }
.card + .card { margin-top: 20px; }

/* ============ Site (marketing) ============ */
.site { background: var(--paper); }
.wrap { width: min(1160px, 100% - 40px); margin: 0 auto; }
.site-header { position: sticky; top: 0; z-index: 50; background: rgba(246, 244, 239, .86); backdrop-filter: saturate(160%) blur(12px); -webkit-backdrop-filter: saturate(160%) blur(12px); border-bottom: 1px solid rgba(13, 36, 68, .06); }
.site-header .wrap { display: flex; align-items: center; gap: 28px; height: 68px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-size: 19px; color: var(--ink); letter-spacing: -.02em; }
.brand:hover { color: var(--ink); }
.brand-mark { width: 30px; height: 30px; border-radius: 8px; background: var(--ink); display: grid; place-items: center; }
.brand-mark svg { width: 18px; height: 18px; color: #fff; }
.site-nav { display: flex; gap: 26px; margin-left: 8px; }
.site-nav a { color: var(--ink); font-weight: 500; font-size: 14.5px; opacity: .8; }
.site-nav a:hover { opacity: 1; }
.site-actions { margin-left: auto; display: flex; gap: 10px; align-items: center; }
.nav-toggle { display: none; margin-left: auto; background: none; border: 0; color: var(--ink); padding: 8px; cursor: pointer; }
.nav-toggle .icon { width: 24px; height: 24px; }
@media (max-width: 860px) {
  .nav-toggle { display: block; }
  .site-nav, .site-actions { display: none; }
  .site-header.open .wrap { flex-wrap: wrap; height: auto; padding: 14px 0; }
  .site-header.open .site-nav, .site-header.open .site-actions { display: flex; flex-direction: column; width: 100%; margin: 0; gap: 14px; padding: 8px 0; }
  .site-header.open .site-actions .btn { width: 100%; }
}

.hero { padding: 84px 0 40px; position: relative; overflow: hidden; }
.hero-grid { display: grid; grid-template-columns: 1.02fr 1fr; gap: 56px; align-items: center; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); margin-bottom: 18px; }
.eyebrow::before { content: ""; width: 22px; height: 1.5px; background: currentColor; }
.hero h1 { font-family: var(--serif); font-weight: 400; font-size: clamp(40px, 5.4vw, 66px); line-height: 1.04; letter-spacing: -.025em; margin-bottom: 22px; }
.hero h1 em { font-style: italic; color: var(--accent); }
.hero .lead { font-size: 18.5px; color: var(--muted); max-width: 520px; margin-bottom: 30px; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.hero-note { margin-top: 18px; font-size: 13.5px; color: var(--muted); display: flex; gap: 18px; flex-wrap: wrap; }
.hero-note span { display: inline-flex; gap: 6px; align-items: center; }
.hero-note .icon { width: 16px; height: 16px; color: var(--success); }

/* Product mock */
.mock { position: relative; border-radius: 16px; background: #fff; box-shadow: var(--shadow-lg); overflow: hidden; border: 1px solid rgba(13, 36, 68, .08); transform: rotate(.6deg); }
.mock-bar { height: 34px; display: flex; align-items: center; gap: 6px; padding: 0 14px; background: #f3f4f6; border-bottom: 1px solid #e8eaee; }
.mock-bar i { width: 10px; height: 10px; border-radius: 50%; background: #d9dce2; }
.mock-bar b { margin-left: 14px; height: 18px; flex: 1; max-width: 260px; border-radius: 6px; background: #fff; font: 500 11px/18px var(--sans); color: var(--faint); padding: 0 10px; }
.mock-cover { height: 190px; position: relative; background: linear-gradient(160deg, #c8b49a 0%, #8c735a 45%, #3f3428 100%); display: flex; align-items: flex-end; padding: 22px; color: #fff; }
.mock-cover::after { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 75% 25%, rgba(255, 233, 196, .55), transparent 45%); }
.mock-cover div { position: relative; z-index: 1; }
.mock-cover small { font-size: 10px; letter-spacing: .2em; text-transform: uppercase; opacity: .85; }
.mock-cover strong { display: block; font-family: var(--serif); font-weight: 400; font-size: 28px; line-height: 1.1; }
.mock-grid { padding: 10px; columns: 3; column-gap: 8px; }
.mock-grid span { display: block; margin-bottom: 8px; border-radius: 4px; break-inside: avoid; position: relative; }
.mock-grid span.fav::after { content: "♥"; position: absolute; right: 6px; bottom: 4px; font-size: 13px; color: #fff; text-shadow: 0 1px 4px rgba(0, 0, 0, .3); }
.mock-float { position: absolute; left: -26px; bottom: 34px; background: #fff; border-radius: 12px; box-shadow: var(--shadow-lg); padding: 12px 16px; display: flex; gap: 12px; align-items: center; font-size: 13px; transform: rotate(-1.2deg); }
.mock-float b { display: block; font-size: 14px; }
.mock-float .dot { width: 34px; height: 34px; border-radius: 50%; background: var(--success-soft); color: var(--success); display: grid; place-items: center; }

.logos { padding: 30px 0 10px; }
.section { padding: 96px 0; }
.section-tight { padding: 64px 0; }
.section-head { max-width: 640px; margin-bottom: 48px; }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }
.section-head h2 { font-family: var(--serif); font-weight: 400; font-size: clamp(32px, 3.6vw, 44px); letter-spacing: -.02em; }
.section-head p { color: var(--muted); font-size: 17px; }

.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: rgba(13, 36, 68, .08); border-radius: 16px; overflow: hidden; border: 1px solid rgba(13, 36, 68, .08); }
.feature { background: #fffdfa; padding: 30px 28px; }
.feature .ic { width: 42px; height: 42px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; margin-bottom: 18px; }
.feature .ic .icon { width: 21px; height: 21px; }
.feature h3 { font-size: 17px; margin-bottom: 8px; }
.feature p { color: var(--muted); font-size: 14.5px; margin: 0; }

.split { display: grid; grid-template-columns: 1fr 1fr; gap: 64px; align-items: center; }
.steps { counter-reset: step; display: grid; gap: 26px; }
.step { display: grid; grid-template-columns: 44px 1fr; gap: 16px; }
.step::before { counter-increment: step; content: counter(step); width: 44px; height: 44px; border-radius: 50%; border: 1.5px solid var(--ink); display: grid; place-items: center; font-family: var(--serif); font-size: 20px; }
.step h3 { font-size: 17px; margin: 4px 0 4px; }
.step p { color: var(--muted); margin: 0; }
.band { background: var(--ink); color: #dfe6f0; }
.band h2 { color: #fff; }
.band .section-head p { color: #a9b6c9; }
.quote { font-family: var(--serif); font-size: 26px; line-height: 1.35; color: #fff; margin: 0; }

/* Pricing */
.interval-toggle { display: inline-flex; padding: 4px; border-radius: 999px; background: #fff; border: 1px solid var(--line); margin: 0 auto 36px; }
.interval-toggle button { border: 0; background: none; padding: 9px 18px; border-radius: 999px; font: 600 14px var(--sans); color: var(--muted); cursor: pointer; }
.interval-toggle button.on { background: var(--ink); color: #fff; }
.interval-toggle .save { color: var(--success); font-weight: 700; margin-left: 4px; }
.interval-toggle button.on .save { color: #9be2bf; }
.plans { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; align-items: stretch; }
.plan { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 30px 28px; display: flex; flex-direction: column; position: relative; }
.plan.hl { border-color: var(--ink); box-shadow: var(--shadow-lg); }
.plan .tag { position: absolute; top: -12px; left: 28px; background: var(--ink); color: #fff; font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; padding: 4px 10px; border-radius: 999px; }
.plan h3 { font-size: 20px; margin-bottom: 2px; }
.plan .tl { color: var(--muted); font-size: 14px; margin-bottom: 20px; }
.price { display: flex; align-items: baseline; gap: 6px; margin-bottom: 4px; }
.price strong { font-family: var(--serif); font-weight: 400; font-size: 46px; letter-spacing: -.02em; }
.price span { color: var(--muted); }
.price-note { font-size: 13px; color: var(--muted); min-height: 20px; margin-bottom: 22px; }
.plan ul { list-style: none; padding: 0; margin: 0 0 26px; display: grid; gap: 10px; font-size: 14.5px; }
.plan li { display: flex; gap: 10px; }
.plan li .icon { color: var(--success); width: 18px; height: 18px; margin-top: 2px; }
.plan .btn { margin-top: auto; }
[data-interval="monthly"] .yearly-only, [data-interval="yearly"] .monthly-only { display: none !important; }

.faq { max-width: 760px; margin: 0 auto; }
.faq details { border-bottom: 1px solid rgba(13, 36, 68, .1); padding: 20px 0; }
.faq summary { cursor: pointer; font-weight: 600; font-size: 16.5px; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-weight: 400; font-size: 22px; line-height: 1; color: var(--muted); }
.faq details[open] summary::after { content: "–"; }
.faq details p { color: var(--muted); margin: 12px 0 0; }

.cta-box { background: var(--ink); color: #fff; border-radius: 20px; padding: 56px; display: flex; align-items: center; justify-content: space-between; gap: 32px; flex-wrap: wrap; }
.cta-box h2 { font-family: var(--serif); font-weight: 400; font-size: 36px; margin: 0 0 6px; color: #fff; }
.cta-box p { color: #a9b6c9; margin: 0; }
.cta-box .btn-ghost { border-color: transparent; }

.site-footer { padding: 56px 0 40px; font-size: 14px; color: var(--muted); }
.site-footer .wrap { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; border-top: 1px solid rgba(13, 36, 68, .1); padding-top: 32px; }
.site-footer nav { display: flex; gap: 22px; flex-wrap: wrap; }
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--ink); }

.prose { max-width: 760px; margin: 0 auto; padding: 64px 0 96px; }
.prose h1 { font-family: var(--serif); font-weight: 400; font-size: 44px; margin-bottom: 28px; }
.prose h2 { font-size: 20px; margin-top: 36px; }
.prose p, .prose li { color: #34445c; }
.prose .todo { background: var(--warn-soft); border: 1px dashed #e3b766; padding: 12px 16px; border-radius: 10px; font-size: 14px; color: #7a4800; }

@media (max-width: 960px) {
  .hero { padding-top: 48px; }
  .hero-grid, .split { grid-template-columns: 1fr; gap: 44px; }
  .features, .plans { grid-template-columns: 1fr; }
  .mock { transform: none; }
  .mock-float { left: 12px; }
  .section { padding: 72px 0; }
  .cta-box { padding: 36px 28px; }
}

/* ============ Auth ============ */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); background: #fff; }
.auth-aside { background: var(--ink); color: #c5d1e2; padding: 44px 52px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.auth-aside .brand { color: #fff; }
.auth-aside .brand-mark { background: #fff; }
.auth-aside .brand-mark svg { color: var(--ink); }
.auth-aside blockquote { margin: 0; font-family: var(--serif); font-size: 30px; line-height: 1.3; color: #fff; max-width: 440px; position: relative; z-index: 1; }
.auth-aside small { position: relative; z-index: 1; }
.auth-aside .tiles { position: absolute; right: -60px; top: 120px; width: 300px; columns: 2; column-gap: 10px; opacity: .22; transform: rotate(8deg); }
.auth-aside .tiles span { display: block; margin-bottom: 10px; border-radius: 6px; background: #8ea6c9; }
.auth-main { display: flex; align-items: center; justify-content: center; padding: 48px 24px; }
.auth-card { width: 100%; max-width: 400px; }
.auth-card h1 { font-family: var(--serif); font-weight: 400; font-size: 34px; margin-bottom: 6px; }
.auth-card .sub { color: var(--muted); margin-bottom: 28px; }
.auth-foot { margin-top: 22px; font-size: 14px; color: var(--muted); text-align: center; }
@media (max-width: 880px) { .auth { grid-template-columns: 1fr; } .auth-aside { display: none; } }

/* ============ Dashboard ============ */
.app { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
.sidebar { background: var(--ink); color: #b8c5d8; padding: 20px 14px; display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.sidebar .brand { color: #fff; padding: 6px 10px 22px; font-size: 18px; }
.sidebar .brand-mark { background: #fff; width: 28px; height: 28px; }
.sidebar .brand-mark svg { color: var(--ink); }
.side-label { font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: #6f82a0; padding: 16px 12px 6px; }
.side-link { display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 9px; color: #c9d4e4; font-weight: 500; font-size: 14.5px; }
.side-link:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.side-link.on { background: rgba(255, 255, 255, .1); color: #fff; }
.side-link .icon { width: 18px; height: 18px; opacity: .85; }
.side-link .count { margin-left: auto; background: var(--accent); color: #fff; font-size: 11px; font-weight: 700; border-radius: 999px; padding: 1px 7px; }
.side-foot { margin-top: auto; padding: 14px 10px 4px; border-top: 1px solid rgba(255, 255, 255, .08); }
.side-user { display: flex; gap: 10px; align-items: center; margin-bottom: 12px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: #2c4a73; color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 13px; flex: none; }
.side-user strong { display: block; color: #fff; font-size: 13.5px; line-height: 1.2; }
.side-user span { font-size: 12px; color: #8396b3; }
.side-meter { font-size: 12px; color: #8fa1bd; }
.side-meter .meter { background: rgba(255, 255, 255, .1); margin: 6px 0 4px; }
.side-logout { background: none; border: 0; color: #8fa1bd; font: 500 13px var(--sans); display: flex; gap: 8px; align-items: center; padding: 8px 0 0; cursor: pointer; }
.side-logout:hover { color: #fff; }

.main { min-width: 0; padding: 28px 36px 64px; }
.topbar { display: none; }
@media (max-width: 980px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: 270px; z-index: 80; transform: translateX(-100%); transition: transform .2s; }
  .app.nav-open .sidebar { transform: none; box-shadow: var(--shadow-lg); }
  .topbar { display: flex; align-items: center; justify-content: space-between; height: 58px; padding: 0 16px; background: var(--ink); color: #fff; position: sticky; top: 0; z-index: 70; }
  .topbar .brand { color: #fff; font-size: 17px; }
  .topbar .brand-mark { background: #fff; width: 26px; height: 26px; }
  .topbar .brand-mark svg { color: var(--ink); }
  .topbar button { background: none; border: 0; color: #fff; padding: 6px; }
  .topbar .icon { width: 24px; height: 24px; }
  .main { padding: 20px 16px 48px; }
}

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.page-head h1 { font-size: 26px; margin: 0; letter-spacing: -.02em; }
.page-head .crumb { font-size: 13px; color: var(--muted); margin-bottom: 6px; display: flex; gap: 6px; align-items: center; }
.page-head .crumb a { color: var(--muted); }
.page-head .crumb a:hover { color: var(--ink); }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 26px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.stat span { font-size: 12.5px; color: var(--muted); font-weight: 500; }
.stat strong { display: block; font-size: 24px; letter-spacing: -.02em; margin-top: 2px; }
@media (max-width: 900px) { .stats { grid-template-columns: repeat(2, 1fr); } }

.meter { height: 6px; border-radius: 99px; background: var(--line-2); overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--accent); border-radius: 99px; }
.meter.warn i { background: #e0961c; }
.meter.full i { background: var(--danger); }

.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 18px; }
.search { position: relative; flex: 1; min-width: 220px; max-width: 360px; }
.search input { padding-left: 38px; }
.search .icon { position: absolute; left: 12px; top: 12px; color: var(--faint); }
.pills { display: inline-flex; gap: 4px; padding: 4px; background: #fff; border: 1px solid var(--line); border-radius: 10px; }
.pills a { padding: 6px 12px; border-radius: 7px; font-size: 13.5px; font-weight: 500; color: var(--muted); }
.pills a.on { background: var(--ink); color: #fff; }

.gallery-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 18px; }
.g-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; transition: box-shadow .15s, transform .15s; color: var(--ink); }
.g-card:hover { box-shadow: var(--shadow); color: var(--ink); }
.g-cover { display: block; }
.g-body h3 a { color: var(--ink); }
.g-actions { display: flex; gap: 6px; margin-top: 14px; flex-wrap: wrap; }
.g-actions form { margin: 0; }
.g-cover { aspect-ratio: 16 / 10; background: linear-gradient(135deg, #e7ebf1, #d8dfe9); position: relative; overflow: hidden; }
.g-cover img { width: 100%; height: 100%; object-fit: cover; }
.g-cover .empty { position: absolute; inset: 0; display: grid; place-items: center; color: #9aa7b9; }
.g-cover .empty .icon { width: 34px; height: 34px; }
.g-cover .badge { position: absolute; top: 10px; left: 10px; background: rgba(255, 255, 255, .94); }
.g-body { padding: 14px 16px 16px; }
.g-body h3 { font-size: 15.5px; margin: 0 0 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.g-meta { font-size: 13px; color: var(--muted); display: flex; gap: 12px; flex-wrap: wrap; margin-top: 8px; }
.g-meta span { display: inline-flex; gap: 5px; align-items: center; }
.g-meta .icon { width: 14px; height: 14px; }
.empty-state { text-align: center; padding: 64px 24px; background: #fff; border: 1px dashed #cfd6e1; border-radius: var(--radius); }
.empty-state .icon { width: 40px; height: 40px; color: var(--faint); margin: 0 auto 14px; }
.empty-state h2 { font-size: 19px; }
.empty-state p { color: var(--muted); max-width: 420px; margin: 0 auto 20px; }

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 24px; overflow-x: auto; }
.tabs a { display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px; font-weight: 600; font-size: 14px; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a:hover { color: var(--ink); }
.tabs a.on { color: var(--ink); border-bottom-color: var(--ink); }
.tabs .icon { width: 16px; height: 16px; }
.tabs .count { background: var(--accent); color: #fff; font-size: 11px; border-radius: 99px; padding: 1px 7px; }

/* Photo manager */
.pm { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 24px; align-items: start; }
@media (max-width: 980px) { .pm { grid-template-columns: 1fr; } }
.sets { position: sticky; top: 20px; }
.sets a.set { display: flex; justify-content: space-between; align-items: center; padding: 8px 12px; border-radius: 8px; color: var(--ink); font-size: 14px; font-weight: 500; }
.sets a.set:hover { background: #fff; }
.sets a.set.on { background: #fff; box-shadow: inset 0 0 0 1px var(--line); font-weight: 600; }
.sets a.set span { color: var(--faint); font-size: 12.5px; }
.sets form.add-set { display: flex; gap: 6px; margin-top: 10px; }
.sets form.add-set input { height: 34px; font-size: 13.5px; }
.set-edit { margin-top: 14px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.set-edit input { height: 34px; font-size: 13.5px; margin-bottom: 8px; }

.dropzone { border: 1.5px dashed #b9c4d4; border-radius: var(--radius); background: #fff; padding: 26px; text-align: center; transition: border-color .15s, background .15s; margin-bottom: 18px; }
.dropzone.drag { border-color: var(--accent); background: var(--accent-soft); }
.dropzone .icon { width: 30px; height: 30px; margin: 0 auto 8px; color: var(--accent); }
.dropzone strong { display: block; font-size: 15.5px; }
.dropzone p { color: var(--muted); font-size: 13.5px; margin: 4px 0 14px; }
.upload-panel { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 18px; }
.upload-panel[hidden] { display: none; }
.upload-summary { display: flex; justify-content: space-between; font-size: 13.5px; margin-bottom: 8px; gap: 12px; }
.upload-list { max-height: 180px; overflow-y: auto; margin-top: 10px; font-size: 12.5px; display: grid; gap: 4px; }
.upload-list div { display: flex; justify-content: space-between; gap: 10px; color: var(--muted); }
.upload-list .err { color: var(--danger); }
.upload-list .ok { color: var(--success); }

.photo-bar { position: sticky; top: 0; z-index: 20; background: var(--bg); padding: 8px 0 12px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.photo-bar .sel-info { font-size: 13.5px; color: var(--muted); margin-right: 6px; }
.photo-bar select { height: 32px; width: auto; font-size: 13px; padding: 0 8px; border-radius: 8px; }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.ph { position: relative; aspect-ratio: 1; border-radius: 8px; overflow: hidden; background: #e6eaf0; cursor: grab; user-select: none; }
.ph img { width: 100%; height: 100%; object-fit: cover; pointer-events: none; transition: transform .2s; }
.ph .ph-sel { position: absolute; top: 8px; left: 8px; width: 24px; height: 24px; border-radius: 6px; background: rgba(255, 255, 255, .9); border: 1.5px solid rgba(13, 36, 68, .25); display: grid; place-items: center; cursor: pointer; opacity: 0; transition: opacity .15s; }
.ph .ph-sel input { position: absolute; opacity: 0; inset: 0; cursor: pointer; margin: 0; }
.ph .ph-sel .icon { width: 15px; height: 15px; color: #fff; opacity: 0; }
.ph:hover .ph-sel, .photo-grid.selecting .ph-sel { opacity: 1; }
.ph.selected .ph-sel { background: var(--accent); border-color: var(--accent); opacity: 1; }
.ph.selected .ph-sel .icon { opacity: 1; }
.ph.selected { outline: 3px solid var(--accent); outline-offset: -3px; }
.ph .ph-badges { position: absolute; right: 8px; top: 8px; display: flex; gap: 4px; }
.ph .ph-badges span { width: 24px; height: 24px; border-radius: 50%; background: rgba(255, 255, 255, .92); display: grid; place-items: center; }
.ph .ph-badges .icon { width: 13px; height: 13px; }
.ph .ph-badges .fav { color: #d6336c; }
.ph .ph-badges .fav .icon { fill: currentColor; }
.ph .ph-badges .cov { color: #b7791f; }
.ph .ph-badges .cov .icon { fill: currentColor; }
.ph .ph-name { position: absolute; left: 0; right: 0; bottom: 0; padding: 18px 8px 6px; font-size: 11px; color: #fff; background: linear-gradient(transparent, rgba(0, 0, 0, .55)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; opacity: 0; transition: opacity .15s; }
.ph:hover .ph-name { opacity: 1; }
.ph.dragging { opacity: .35; }
.ph.drop-before { box-shadow: -4px 0 0 var(--accent); }
.ph.processing { display: grid; place-items: center; color: var(--muted); font-size: 12px; cursor: default; }

/* Share */
.copy-field { display: flex; gap: 8px; }
.copy-field input { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13.5px; background: #f8fafc; }
.pin-box { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 26px; letter-spacing: .25em; font-weight: 700; padding: 10px 16px; background: #f8fafc; border: 1px solid var(--line); border-radius: 10px; display: inline-block; }
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { display: flex; justify-content: space-between; gap: 14px; padding: 10px 0; border-bottom: 1px solid var(--line-2); font-size: 14px; }
.timeline li:last-child { border-bottom: 0; }
.timeline time { color: var(--faint); font-size: 12.5px; white-space: nowrap; }
.two-col { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 20px; align-items: start; }
@media (max-width: 1100px) { .two-col { grid-template-columns: 1fr; } }

.focal { position: relative; border-radius: 10px; overflow: hidden; cursor: crosshair; max-width: 520px; background: #e6eaf0; }
.focal img { width: 100%; }
.focal .dot { position: absolute; width: 26px; height: 26px; margin: -13px 0 0 -13px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 1.5px rgba(0, 0, 0, .35), 0 2px 8px rgba(0, 0, 0, .3); pointer-events: none; }
.focal-preview { width: 100%; max-width: 520px; aspect-ratio: 21 / 9; border-radius: 10px; background-size: cover; margin-top: 12px; }

.sel-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.sel-list figure { margin: 0; }
.sel-list img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; }
.sel-list figcaption { font-size: 11.5px; color: var(--muted); margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.table td { padding: 12px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.table-wrap { overflow-x: auto; }

.billing-plans { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.billing-plans .plan { padding: 22px; }
.billing-plans .plan.current { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(43, 103, 199, .12); }
.billing-plans .price strong { font-size: 36px; }
@media (max-width: 1100px) { .billing-plans { grid-template-columns: 1fr; } }

.trial-banner { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 16px; border-radius: 10px; background: var(--accent-soft); color: var(--accent-ink); font-size: 14px; margin-bottom: 22px; flex-wrap: wrap; }
.trial-banner.expired { background: var(--danger-soft); color: #8f2119; }
.impersonate-bar { background: #fff4d6; color: #6b4b00; text-align: center; font-size: 13px; padding: 6px; }

dialog.modal { border: 0; border-radius: 16px; padding: 0; width: min(480px, calc(100% - 32px)); box-shadow: var(--shadow-lg); color: var(--ink); }
dialog.modal::backdrop { background: rgba(13, 36, 68, .45); }
dialog.modal .modal-body { padding: 26px; }
dialog.modal h2 { font-size: 19px; }
dialog.modal .modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }

/* Errors / install */
.center-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: var(--paper); }
.center-card { max-width: 520px; width: 100%; text-align: center; }
.center-card .code { font-family: var(--serif); font-size: 84px; line-height: 1; color: var(--ink); opacity: .14; }
.center-card h1 { font-family: var(--serif); font-weight: 400; font-size: 32px; }
.checks { list-style: none; padding: 0; margin: 0 0 20px; text-align: left; font-size: 14px; }
.checks li { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line-2); }
.checks .ok { color: var(--success); }
.checks .no { color: var(--danger); }
.checks small { margin-left: auto; color: var(--muted); text-align: right; word-break: break-all; }

@media (max-width: 640px) {
  .page-head { align-items: flex-start; }
  .page-head > * { width: 100%; }
  .page-head h1 { font-size: 22px; }
  .sets { position: static; }
  .photo-grid { grid-template-columns: repeat(3, 1fr); gap: 6px; }
}
