/* ═══════════════════════════════════════════════════════════════════════
   1860 Travels — Activity Provider portal
   Same design language as the OMS Knowledge Base / Help Center / Devin:
   Geist type, warm #f6f5f1 canvas, white cards on #e7e4dc hairlines,
   near-black primary actions. Everything is ap- prefixed and scoped under
   .ap-app / .ap-auth, so nothing here can leak into other pages.
   All sizes are px — the public site's root font-size is 10px.
   ═══════════════════════════════════════════════════════════════════════ */

.ap-app, .ap-auth, .ap-modal-back, .ap-toasts {
    --bg: #f6f5f1;
    --surface: #ffffff;
    --surface-2: #fafaf7;
    --surface-3: #f1efe9;
    --border: #e7e4dc;
    --border-strong: #d6d2c7;
    --text: #16170f;
    --text-2: #57584b;
    --text-3: #8b8c7d;
    --text-4: #b3b3a3;
    --accent: oklch(0.55 0.11 250);
    --accent-soft: oklch(0.96 0.025 250);
    --accent-fg: oklch(0.42 0.13 250);
    --ok: oklch(0.50 0.12 155);
    --ok-bg: oklch(0.96 0.035 155);
    --warn: oklch(0.56 0.12 70);
    --warn-bg: oklch(0.965 0.045 85);
    --bad: oklch(0.53 0.17 25);
    --bad-bg: oklch(0.965 0.03 25);
    --violet: oklch(0.50 0.13 295);
    --violet-bg: oklch(0.96 0.03 295);
    --r-sm: 6px;
    --r-md: 10px;
    --r-lg: 14px;
    --r-xl: 18px;
    --shadow-1: 0 1px 0 rgba(20,21,14,0.04), 0 1px 3px rgba(20,21,14,0.04);
    --shadow-2: 0 6px 24px -8px rgba(20,21,14,0.12), 0 2px 6px rgba(20,21,14,0.05);
    --shadow-3: 0 24px 60px -18px rgba(20,21,14,0.28), 0 4px 14px rgba(20,21,14,0.06);
    --sans: "Geist", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
    --mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
    --side-w: 248px;

    font-family: var(--sans);
    font-size: 14px;
    line-height: 1.5;
    color: var(--text);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
.ap-app *, .ap-app *::before, .ap-app *::after,
.ap-auth *, .ap-auth *::before, .ap-auth *::after,
.ap-modal-back *, .ap-modal-back *::before, .ap-modal-back *::after { box-sizing: border-box; }
/* :where() keeps this reset at element specificity so .ap-btn-primary etc. win on <a> buttons */
:where(.ap-app, .ap-auth) a { color: inherit; text-decoration: none; }
.ap-app button, .ap-auth button, .ap-app input, .ap-app select, .ap-app textarea,
.ap-auth input, .ap-auth select { font-family: inherit; }
.ap-app :focus-visible, .ap-auth :focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ap-mono { font-family: var(--mono); font-size: 0.92em; letter-spacing: -0.01em; }
.ap-muted { color: var(--text-3); }
.ap-hide { display: none !important; }

/* ── Shell ─────────────────────────────────────────────────────────────── */
body.ap-body { margin: 0; background: #f6f5f1; }
.ap-app { display: flex; min-height: 100vh; background: var(--bg); }

.ap-side {
    position: fixed; inset: 0 auto 0 0; width: var(--side-w); z-index: 40;
    display: flex; flex-direction: column;
    background: #fbfaf7; border-right: 1px solid var(--border);
}
.ap-brand { display: flex; align-items: center; gap: 10px; padding: 18px 18px 14px; }
.ap-brand img { height: 30px; width: auto; display: block; }
.ap-brand-tag {
    font-size: 10px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
    color: var(--text-3); border: 1px solid var(--border-strong); border-radius: 999px; padding: 2px 8px;
}
.ap-org {
    margin: 2px 12px 10px; padding: 10px 12px; border-radius: var(--r-md);
    background: var(--surface); border: 1px solid var(--border);
    display: flex; align-items: center; gap: 10px;
}
.ap-org-mark {
    width: 32px; height: 32px; border-radius: 9px; flex-shrink: 0;
    display: grid; place-items: center; font-weight: 700; font-size: 13px;
    background: linear-gradient(140deg, #2d2e25, #16170f); color: #f1efe6;
}
.ap-org-name { font-size: 13px; font-weight: 600; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ap-org-status { font-size: 11px; color: var(--text-3); display: flex; align-items: center; gap: 5px; margin-top: 1px; }
.ap-org-verify { border: 0; background: none; padding: 0; font: inherit; cursor: pointer; color: var(--warn); font-weight: 600; }
.ap-org-verify:hover { text-decoration: underline; }
.ap-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--text-4); display: inline-block; flex-shrink: 0; }
.ap-dot.ok { background: var(--ok); }
.ap-dot.warn { background: var(--warn); }
.ap-dot.bad { background: var(--bad); }

.ap-nav { flex: 1; overflow-y: auto; padding: 4px 10px 12px; }
.ap-nav-label {
    font-size: 10.5px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
    color: var(--text-4); padding: 14px 10px 6px;
}
.ap-nav-item {
    display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px;
    font-size: 13.5px; font-weight: 500; color: var(--text-2);
    transition: background 120ms, color 120ms;
}
.ap-nav-item svg { width: 16px; height: 16px; flex-shrink: 0; color: var(--text-3); transition: color 120ms; }
.ap-nav-item:hover { background: var(--surface-3); color: var(--text); }
.ap-nav-item:hover svg { color: var(--text-2); }
.ap-nav-item.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-1); border: 1px solid var(--border); padding: 7px 9px; }
.ap-nav-item.active svg { color: var(--text); }
.ap-nav-count {
    margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px;
    display: inline-grid; place-items: center; font-size: 11px; font-weight: 600; font-family: var(--mono);
    background: var(--surface-3); color: var(--text-2);
}
.ap-nav-count.hot { background: var(--text); color: #fff; }

.ap-side-foot { border-top: 1px solid var(--border); padding: 12px; display: flex; align-items: center; gap: 10px; }
.ap-avatar {
    width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0;
    display: grid; place-items: center; font-size: 12px; font-weight: 700;
    background: var(--surface-3); color: var(--text-2); border: 1px solid var(--border);
}
.ap-side-user { min-width: 0; flex: 1; }
.ap-side-user b { display: block; font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ap-side-user span { display: block; font-size: 11px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.ap-main { flex: 1; min-width: 0; margin-left: var(--side-w); display: flex; flex-direction: column; }

.ap-top {
    position: sticky; top: 0; z-index: 30; height: 60px;
    display: flex; align-items: center; gap: 12px; padding: 0 28px;
    background: color-mix(in oklab, var(--bg) 82%, transparent);
    backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px);
    border-bottom: 1px solid transparent; transition: border-color 160ms;
}
.ap-top.scrolled { border-bottom-color: var(--border); }
.ap-crumbs { display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--text-3); min-width: 0; }
.ap-crumbs a:hover { color: var(--text); }
.ap-crumbs .sep { color: var(--text-4); }
.ap-crumbs .current { color: var(--text); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ap-top-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.ap-icon-btn.ap-menu-btn { display: none; }

.ap-icon-btn {
    position: relative; width: 36px; height: 36px; border-radius: 9px; border: 1px solid var(--border);
    background: var(--surface); color: var(--text-2); cursor: pointer;
    display: grid; place-items: center; transition: background 120ms, color 120ms, border-color 120ms;
}
.ap-icon-btn:hover { background: var(--surface-3); color: var(--text); border-color: var(--border-strong); }
.ap-icon-btn svg { width: 16px; height: 16px; }
.ap-badge-dot {
    position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; padding: 0 5px;
    border-radius: 999px; background: var(--bad); color: #fff; border: 2px solid var(--bg);
    font-size: 10px; font-weight: 700; display: grid; place-items: center; font-family: var(--mono);
}

.ap-content { padding: 8px 28px 56px; width: 100%; max-width: 1240px; }

/* Bell dropdown */
.ap-pop {
    position: absolute; top: calc(100% + 8px); right: 0; width: 360px; max-width: calc(100vw - 32px);
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
    box-shadow: var(--shadow-3); display: none; overflow: hidden; z-index: 60;
}
.ap-pop.open { display: block; animation: apPop 140ms ease-out; }
@keyframes apPop { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.ap-pop-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.ap-pop-head b { font-size: 13px; font-weight: 600; }
.ap-pop-list { max-height: 380px; overflow-y: auto; }
.ap-pop-foot { display: block; text-align: center; padding: 10px; font-size: 12.5px; font-weight: 500; color: var(--text-2); border-top: 1px solid var(--border); background: var(--surface-2); }
.ap-pop-foot:hover { color: var(--text); }

/* Embedded in the OMS (_LayoutAdmin) for the staff review screens */
.ap-app.ap-oms { display: block; min-height: calc(100vh - 60px); padding: 18px 24px 48px; }
.ap-app.ap-oms .ap-page-head { padding-top: 4px; }
@media (max-width: 900px) { .ap-app.ap-oms { padding: 14px 14px 40px; } }

/* ── Page head ─────────────────────────────────────────────────────────── */
.ap-page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 14px 0 22px; }
.ap-title-wrap { display: flex; align-items: center; gap: 14px; min-width: 0; }
.ap-mod-icon {
    width: 42px; height: 42px; border-radius: 12px; flex-shrink: 0; display: grid; place-items: center;
    background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-1); color: var(--text);
}
.ap-mod-icon svg { width: 19px; height: 19px; }
.ap-h1 { font-size: 22px; font-weight: 600; letter-spacing: -0.02em; margin: 0; line-height: 1.2; }
.ap-sub { font-size: 13px; color: var(--text-3); margin: 3px 0 0; }
.ap-head-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.ap-hero {
    position: relative; overflow: hidden; border-radius: var(--r-xl); padding: 26px 28px;
    margin: 6px 0 22px; color: #f4f2ea;
    background:
        radial-gradient(120% 140% at 100% 0%, rgba(122,150,255,0.22) 0%, rgba(122,150,255,0) 55%),
        radial-gradient(90% 120% at 0% 100%, rgba(255,186,120,0.16) 0%, rgba(255,186,120,0) 55%),
        linear-gradient(135deg, #22231b 0%, #16170f 100%);
    box-shadow: var(--shadow-2);
}
.ap-hero::after {
    content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0.35;
    background-image: radial-gradient(rgba(255,255,255,0.10) 1px, transparent 1px);
    background-size: 18px 18px; mask-image: linear-gradient(90deg, transparent 40%, #000);
    -webkit-mask-image: linear-gradient(90deg, transparent 40%, #000);
}
.ap-hero > * { position: relative; z-index: 1; }
.ap-hero-eyebrow { font-size: 11px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: rgba(244,242,234,0.6); }
.ap-hero h2 { font-size: 24px; font-weight: 600; letter-spacing: -0.02em; margin: 6px 0 6px; color: #fff; }
.ap-hero p { margin: 0; font-size: 13.5px; color: rgba(244,242,234,0.72); max-width: 560px; }
.ap-hero-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.ap-hero .ap-btn { background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.18); color: #fff; }
.ap-hero .ap-btn:hover { background: rgba(255,255,255,0.16); color: #fff; }
.ap-hero .ap-btn-primary { background: #fff; color: #16170f; border-color: #fff; }
.ap-hero .ap-btn-primary:hover { background: #ecebe4; color: #16170f; }

/* ── Buttons ───────────────────────────────────────────────────────────── */
.ap-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    height: 36px; padding: 0 14px; border-radius: 9px; border: 1px solid var(--border-strong);
    background: var(--surface); color: var(--text); font-size: 13px; font-weight: 500;
    cursor: pointer; white-space: nowrap; transition: background 120ms, border-color 120ms, transform 80ms, box-shadow 120ms;
}
.ap-btn:hover { background: var(--surface-3); color: var(--text); }
.ap-btn:active { transform: translateY(1px); }
.ap-btn svg { width: 15px; height: 15px; flex-shrink: 0; }
.ap-btn-primary { background: var(--text); border-color: var(--text); color: #fff; box-shadow: 0 1px 2px rgba(20,21,14,0.25), inset 0 1px 0 rgba(255,255,255,0.08); }
.ap-btn-primary:hover { background: #000; color: #fff; }
.ap-btn-ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.ap-btn-ok:hover { background: color-mix(in oklab, var(--ok) 88%, black); color: #fff; }
.ap-btn-danger { color: var(--bad); border-color: color-mix(in oklab, var(--bad) 28%, var(--border)); }
.ap-btn-danger:hover { background: var(--bad-bg); color: var(--bad); }
.ap-btn-ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.ap-btn-ghost:hover { background: var(--surface-3); color: var(--text); }
.ap-btn-sm { height: 30px; padding: 0 10px; font-size: 12.5px; border-radius: 8px; }
.ap-btn-lg { height: 44px; padding: 0 20px; font-size: 14px; border-radius: 11px; }
.ap-btn-block { width: 100%; }
.ap-btn[disabled], .ap-btn.loading { opacity: 0.55; pointer-events: none; }
.ap-btn.loading::after {
    content: ""; width: 13px; height: 13px; border-radius: 50%;
    border: 2px solid currentColor; border-right-color: transparent; animation: apSpin 700ms linear infinite;
}
@keyframes apSpin { to { transform: rotate(360deg); } }

/* ── Cards ─────────────────────────────────────────────────────────────── */
.ap-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-1); }
.ap-card + .ap-card { margin-top: 16px; }
.ap-card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.ap-card-title { font-size: 13.5px; font-weight: 600; display: flex; align-items: center; gap: 8px; margin: 0; }
.ap-card-title svg { width: 15px; height: 15px; color: var(--text-3); }
.ap-card-sub { font-size: 12px; color: var(--text-3); margin-top: 1px; }
.ap-card-body { padding: 18px; }
.ap-card-link { font-size: 12.5px; font-weight: 500; color: var(--text-2); display: inline-flex; align-items: center; gap: 4px; }
.ap-card-link:hover { color: var(--text); }

.ap-grid { display: grid; gap: 16px; }
.ap-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ap-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ap-grid-main { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; }
.ap-stack { display: flex; flex-direction: column; gap: 16px; }

/* KPI tiles */
.ap-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.ap-kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 16px 18px; box-shadow: var(--shadow-1); position: relative; transition: border-color 120ms, box-shadow 120ms, transform 120ms; }
a.ap-kpi:hover { border-color: var(--border-strong); box-shadow: var(--shadow-2); transform: translateY(-1px); }
.ap-kpi-label { font-size: 12px; color: var(--text-3); font-weight: 500; display: flex; align-items: center; gap: 6px; }
.ap-kpi-label svg { width: 13px; height: 13px; }
.ap-kpi-value { font-size: 26px; font-weight: 600; letter-spacing: -0.03em; margin-top: 6px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.ap-kpi-value small { font-size: 13px; font-weight: 500; color: var(--text-3); letter-spacing: 0; margin-right: 3px; }
.ap-kpi-foot { font-size: 11.5px; color: var(--text-3); margin-top: 6px; }
.ap-kpi.attention { border-color: color-mix(in oklab, var(--warn) 40%, var(--border)); background: linear-gradient(180deg, var(--warn-bg), var(--surface) 70%); }
.ap-kpi.attention .ap-kpi-value { color: color-mix(in oklab, var(--warn) 70%, var(--text)); }

/* ── Pills ─────────────────────────────────────────────────────────────── */
.ap-pill {
    display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 9px; border-radius: 999px;
    font-size: 11.5px; font-weight: 600; white-space: nowrap; background: var(--surface-3); color: var(--text-2);
}
.ap-pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: 0.85; }
.ap-pill.ok { background: var(--ok-bg); color: var(--ok); }
.ap-pill.warn { background: var(--warn-bg); color: var(--warn); }
.ap-pill.bad { background: var(--bad-bg); color: var(--bad); }
.ap-pill.info { background: var(--accent-soft); color: var(--accent-fg); }
.ap-pill.violet { background: var(--violet-bg); color: var(--violet); }
.ap-pill.plain::before { display: none; }
.ap-tag { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 500; padding: 2px 7px; border-radius: 6px; background: var(--surface-3); color: var(--text-2); }

/* ── Segmented filter + toolbar ────────────────────────────────────────── */
.ap-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.ap-seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 10px; background: var(--surface-3); border: 1px solid var(--border); flex-wrap: wrap; }
.ap-seg button, .ap-seg a {
    border: 0; background: transparent; height: 28px; padding: 0 11px; border-radius: 7px; cursor: pointer;
    font-size: 12.5px; font-weight: 500; color: var(--text-2); display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
}
.ap-seg button:hover, .ap-seg a:hover { color: var(--text); }
.ap-seg .active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-1); }
.ap-seg-count { font-family: var(--mono); font-size: 11px; color: var(--text-3); }
.ap-seg .active .ap-seg-count { color: var(--text-2); }
.ap-search { position: relative; flex: 1; min-width: 200px; max-width: 340px; margin-left: auto; }
.ap-search svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; color: var(--text-3); pointer-events: none; }
.ap-app .ap-search input {
    width: 100%; height: 34px; border-radius: 9px; border: 1px solid var(--border-strong); background: var(--surface);
    padding: 0 12px 0 34px; font-size: 13px; color: var(--text); outline: none; margin: 0; box-shadow: none;
}
.ap-app .ap-search input:focus { border-color: var(--text-3); box-shadow: 0 0 0 3px color-mix(in oklab, var(--accent) 12%, transparent); }

/* ── Tables ────────────────────────────────────────────────────────────── */
.ap-table-wrap { overflow-x: auto; }
table.ap-table { width: 100%; border-collapse: collapse; }
.ap-table th {
    text-align: left; padding: 10px 16px; background: var(--surface-2); border-bottom: 1px solid var(--border);
    font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-3); white-space: nowrap;
}
.ap-table td { padding: 13px 16px; border-bottom: 1px solid var(--border); font-size: 13px; vertical-align: middle; }
.ap-table tr:last-child td { border-bottom: 0; }
.ap-table tbody tr { transition: background 100ms; }
.ap-table tbody tr:hover td { background: var(--surface-2); }
.ap-table tr.clickable { cursor: pointer; }
.ap-cell-strong { font-weight: 600; color: var(--text); }
.ap-cell-sub { font-size: 11.5px; color: var(--text-3); margin-top: 2px; }
.ap-num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Compact list rows (dashboard) */
.ap-row { display: flex; align-items: center; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--border); transition: background 100ms; }
.ap-row:last-child { border-bottom: 0; }
a.ap-row:hover { background: var(--surface-2); }
.ap-row-icon { width: 36px; height: 36px; border-radius: 10px; flex-shrink: 0; display: grid; place-items: center; background: var(--surface-3); color: var(--text-2); }
.ap-row-icon svg { width: 16px; height: 16px; }
.ap-row-main { min-width: 0; flex: 1; }
.ap-row-title { font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ap-row-sub { font-size: 12px; color: var(--text-3); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ap-row-end { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.ap-date-chip { width: 44px; flex-shrink: 0; text-align: center; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: var(--surface); }
.ap-date-chip b { display: block; font-size: 16px; font-weight: 600; line-height: 1; padding: 6px 0 3px; letter-spacing: -0.02em; }
.ap-date-chip span { display: block; font-size: 9.5px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-3); background: var(--surface-2); padding: 2px 0 4px; border-top: 1px solid var(--border); }

/* Empty states */
.ap-empty { text-align: center; padding: 48px 24px; }
.ap-empty-icon { width: 52px; height: 52px; border-radius: 14px; margin: 0 auto 14px; display: grid; place-items: center; background: var(--surface-3); border: 1px solid var(--border); color: var(--text-3); }
.ap-empty-icon svg { width: 22px; height: 22px; }
.ap-empty h3 { font-size: 15px; font-weight: 600; margin: 0 0 4px; }
.ap-empty p { font-size: 13px; color: var(--text-3); margin: 0 auto 16px; max-width: 380px; }
.ap-empty-sm { padding: 26px 18px; text-align: center; font-size: 13px; color: var(--text-3); }

/* ── Listing cards ─────────────────────────────────────────────────────── */
.ap-listing-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; padding: 16px; }
.ap-listing {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden;
    display: flex; flex-direction: column; transition: border-color 140ms, box-shadow 140ms, transform 140ms;
}
.ap-listing:hover { border-color: var(--border-strong); box-shadow: var(--shadow-2); transform: translateY(-2px); }
.ap-listing-media { position: relative; aspect-ratio: 16 / 10; background: var(--surface-3); overflow: hidden; }
.ap-listing-media img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 400ms ease; }
.ap-listing:hover .ap-listing-media img { transform: scale(1.03); }
.ap-listing-media .ap-pill { position: absolute; top: 10px; left: 10px; background: rgba(255,255,255,0.94); backdrop-filter: blur(6px); box-shadow: 0 1px 3px rgba(0,0,0,0.12); }
.ap-listing-noimg { width: 100%; height: 100%; display: grid; place-items: center; color: var(--text-4); }
.ap-listing-noimg svg { width: 30px; height: 30px; }
.ap-listing-body { padding: 14px 16px 12px; flex: 1; display: flex; flex-direction: column; gap: 4px; }
.ap-listing-title { font-size: 14.5px; font-weight: 600; letter-spacing: -0.01em; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ap-listing-meta { font-size: 12px; color: var(--text-3); display: flex; gap: 10px; flex-wrap: wrap; }
.ap-listing-meta span { display: inline-flex; align-items: center; gap: 4px; }
.ap-listing-meta svg { width: 12px; height: 12px; }
.ap-listing-price { margin-top: auto; padding-top: 8px; font-size: 13px; color: var(--text-3); }
.ap-listing-price b { font-size: 16px; color: var(--text); font-weight: 600; letter-spacing: -0.01em; }
.ap-listing-note { margin: 4px 0 0; padding: 8px 10px; border-radius: 8px; background: var(--warn-bg); color: color-mix(in oklab, var(--warn) 75%, var(--text)); font-size: 12px; line-height: 1.45; }
.ap-listing-foot { display: flex; align-items: center; gap: 6px; padding: 10px 12px; border-top: 1px solid var(--border); background: var(--surface-2); }
.ap-listing-foot .ap-spacer { flex: 1; }

/* Kebab menu */
.ap-menu { position: relative; }
.ap-menu-list {
    position: absolute; right: 0; bottom: calc(100% + 6px); min-width: 180px; padding: 5px; z-index: 20;
    background: var(--surface); border: 1px solid var(--border); border-radius: 11px; box-shadow: var(--shadow-3); display: none;
}
.ap-menu.open .ap-menu-list { display: block; animation: apPop 120ms ease-out; }
.ap-menu-list button, .ap-menu-list a {
    width: 100%; display: flex; align-items: center; gap: 9px; padding: 8px 10px; border-radius: 7px; border: 0;
    background: transparent; font-size: 13px; color: var(--text); cursor: pointer; text-align: left;
}
.ap-menu-list button:hover, .ap-menu-list a:hover { background: var(--surface-3); }
.ap-menu-list svg { width: 14px; height: 14px; color: var(--text-3); }
.ap-menu-list .danger { color: var(--bad); }
.ap-menu-list .danger svg { color: var(--bad); }
.ap-menu-sep { height: 1px; background: var(--border); margin: 4px 2px; }

/* ── Forms ─────────────────────────────────────────────────────────────── */
.ap-form-section { padding: 20px 22px; border-bottom: 1px solid var(--border); display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 28px; }
.ap-form-section:last-child { border-bottom: 0; }
.ap-form-aside h3 { font-size: 14px; font-weight: 600; margin: 0 0 4px; letter-spacing: -0.01em; }
.ap-form-aside p { font-size: 12.5px; color: var(--text-3); margin: 0; line-height: 1.55; }
.ap-fields { display: grid; gap: 14px; }
.ap-fields-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.ap-fields-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.ap-field label { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; font-size: 12.5px; font-weight: 600; color: var(--text-2); margin-bottom: 6px; }
.ap-field label .opt { font-weight: 400; color: var(--text-4); font-size: 11.5px; }
.ap-app .ap-field input, .ap-app .ap-field select, .ap-app .ap-field textarea,
.ap-modal-back .ap-field input, .ap-modal-back .ap-field textarea,
.ap-auth .ap-field input, .ap-auth .ap-field select {
    width: 100%; height: 40px; border: 1px solid var(--border-strong); border-radius: 9px; background: var(--surface);
    padding: 0 12px; font-size: 13.5px; color: var(--text); outline: none; margin: 0; box-shadow: none;
    transition: border-color 120ms, box-shadow 120ms;
}
.ap-app .ap-field textarea, .ap-modal-back .ap-field textarea { height: auto; min-height: 110px; padding: 10px 12px; line-height: 1.6; resize: vertical; }
.ap-app .ap-field select, .ap-auth .ap-field select {
    appearance: none; -webkit-appearance: none; padding-right: 34px; cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238b8c7d' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 12px center;
}
.ap-app .ap-field input:focus, .ap-app .ap-field select:focus, .ap-app .ap-field textarea:focus,
.ap-modal-back .ap-field input:focus, .ap-modal-back .ap-field textarea:focus,
.ap-auth .ap-field input:focus, .ap-auth .ap-field select:focus {
    border-color: var(--text-2); box-shadow: 0 0 0 3px color-mix(in oklab, var(--accent) 14%, transparent);
}
.ap-app .ap-field input::placeholder, .ap-app .ap-field textarea::placeholder, .ap-auth .ap-field input::placeholder { color: var(--text-4); }
.ap-field .ap-hint { font-size: 11.5px; color: var(--text-3); margin-top: 6px; line-height: 1.5; }
.ap-field .ap-err-text, .field-validation-error { font-size: 12px; color: var(--bad); margin-top: 5px; display: block; }
.ap-input-group { position: relative; }
.ap-input-group .ap-prefix { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); font-family: var(--mono); font-size: 12px; color: var(--text-3); pointer-events: none; }
.ap-app .ap-input-group input { padding-left: 50px; font-variant-numeric: tabular-nums; }
.ap-counter { font-family: var(--mono); font-size: 11px; color: var(--text-4); font-weight: 400; }

/* Upload */
.ap-drop {
    border: 1.5px dashed var(--border-strong); border-radius: var(--r-lg); background: var(--surface-2);
    padding: 22px; text-align: center; cursor: pointer; transition: border-color 140ms, background 140ms;
    position: relative; display: block;
}
.ap-drop:hover, .ap-drop.drag { border-color: var(--text-2); background: var(--surface-3); }
.ap-drop input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.ap-drop-icon { width: 40px; height: 40px; border-radius: 11px; margin: 0 auto 10px; display: grid; place-items: center; background: var(--surface); border: 1px solid var(--border); color: var(--text-2); }
.ap-drop-icon svg { width: 18px; height: 18px; }
.ap-drop b { display: block; font-size: 13px; font-weight: 600; }
.ap-drop span { display: block; font-size: 12px; color: var(--text-3); margin-top: 2px; }
.ap-cover { position: relative; border-radius: var(--r-lg); overflow: hidden; aspect-ratio: 16 / 8; background: var(--surface-3); border: 1px solid var(--border); }
.ap-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ap-cover .ap-cover-swap { position: absolute; right: 10px; bottom: 10px; }
.ap-thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; margin-top: 12px; }
.ap-thumb { position: relative; aspect-ratio: 4 / 3; border-radius: 10px; overflow: hidden; background: var(--surface-3); border: 1px solid var(--border); }
.ap-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ap-thumb button {
    position: absolute; top: 6px; right: 6px; width: 24px; height: 24px; border-radius: 7px; border: 0; cursor: pointer;
    background: rgba(22,23,15,0.72); color: #fff; display: grid; place-items: center; opacity: 0; transition: opacity 120ms;
}
.ap-thumb:hover button { opacity: 1; }
.ap-thumb button svg { width: 12px; height: 12px; }
.ap-thumb.new::after { content: "New"; position: absolute; left: 6px; bottom: 6px; font-size: 10px; font-weight: 600; padding: 1px 6px; border-radius: 5px; background: rgba(255,255,255,0.92); color: var(--text); }

/* Sticky save bar */
.ap-savebar {
    position: sticky; bottom: 16px; z-index: 20; margin-top: 18px;
    display: flex; align-items: center; gap: 10px; padding: 10px 12px 10px 18px;
    background: rgba(22,23,15,0.94); color: #ecebe4; border-radius: 14px; box-shadow: var(--shadow-3);
    backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.ap-savebar-msg { font-size: 13px; flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; }
.ap-savebar .ap-btn { border-color: rgba(255,255,255,0.18); background: rgba(255,255,255,0.06); color: #fff; }
.ap-savebar .ap-btn:hover { background: rgba(255,255,255,0.14); }
.ap-savebar .ap-btn-primary { background: #fff; color: #16170f; border-color: #fff; }
.ap-savebar .ap-btn-primary:hover { background: #ecebe4; color: #16170f; }

/* Readiness checklist */
.ap-checklist { list-style: none; margin: 0; padding: 6px 0; }
.ap-check { display: flex; align-items: flex-start; gap: 11px; padding: 9px 18px; font-size: 13px; }
.ap-check-mark { width: 20px; height: 20px; border-radius: 50%; flex-shrink: 0; display: grid; place-items: center; border: 1.5px solid var(--border-strong); background: var(--surface); margin-top: 1px; }
.ap-check-mark svg { width: 11px; height: 11px; opacity: 0; }
.ap-check.done .ap-check-mark { background: var(--ok); border-color: var(--ok); color: #fff; }
.ap-check.done .ap-check-mark svg { opacity: 1; }
.ap-check.done .ap-check-text { color: var(--text-3); }
.ap-check-text b { display: block; font-weight: 600; color: var(--text); font-size: 13px; }
.ap-check.done .ap-check-text b { color: var(--text-2); text-decoration: line-through; text-decoration-color: var(--text-4); }
.ap-check-text span { display: block; font-size: 12px; color: var(--text-3); margin-top: 1px; }
.ap-check-text a { color: var(--accent-fg); font-weight: 500; }
.ap-progress { height: 6px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.ap-progress > i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #2d2e25, #16170f); transition: width 400ms ease; }

/* Callouts */
.ap-callout { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--r-md); border: 1px solid var(--border); background: var(--surface-2); font-size: 13px; margin-bottom: 16px; }
.ap-callout svg { width: 17px; height: 17px; flex-shrink: 0; margin-top: 1px; }
.ap-callout b { display: block; font-weight: 600; margin-bottom: 1px; }
.ap-callout p { margin: 0; color: var(--text-2); line-height: 1.55; }
.ap-callout .ap-callout-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-shrink: 0; }
.ap-callout.warn { background: var(--warn-bg); border-color: color-mix(in oklab, var(--warn) 30%, var(--border)); }
.ap-callout.warn svg { color: var(--warn); }
.ap-callout.info { background: var(--accent-soft); border-color: color-mix(in oklab, var(--accent) 25%, var(--border)); }
.ap-callout.info svg { color: var(--accent-fg); }
.ap-callout.bad { background: var(--bad-bg); border-color: color-mix(in oklab, var(--bad) 25%, var(--border)); }
.ap-callout.bad svg { color: var(--bad); }
.ap-callout.ok { background: var(--ok-bg); border-color: color-mix(in oklab, var(--ok) 25%, var(--border)); }
.ap-callout.ok svg { color: var(--ok); }

/* OTP */
.ap-otp { display: flex; gap: 8px; }
.ap-app .ap-otp input, .ap-modal-back .ap-otp input {
    width: 44px; height: 50px; text-align: center; font-family: var(--mono); font-size: 20px; font-weight: 600;
    border: 1px solid var(--border-strong); border-radius: 10px; background: var(--surface); color: var(--text); outline: none; padding: 0; margin: 0;
}
.ap-app .ap-otp input:focus, .ap-modal-back .ap-otp input:focus { border-color: var(--text); box-shadow: 0 0 0 3px color-mix(in oklab, var(--accent) 14%, transparent); }

/* ── Key/value detail lists ────────────────────────────────────────────── */
.ap-kv { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 10px 16px; font-size: 13px; margin: 0; }
.ap-kv dt { color: var(--text-3); }
.ap-kv dd { margin: 0; color: var(--text); font-weight: 500; overflow-wrap: anywhere; }
.ap-guest { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.ap-guest:last-child { border-bottom: 0; }

/* Booking hero (detail page) */
.ap-bk-head { display: flex; gap: 18px; align-items: stretch; padding: 18px; }
.ap-bk-img { width: 132px; flex-shrink: 0; border-radius: 12px; overflow: hidden; background: var(--surface-3); aspect-ratio: 1; }
.ap-bk-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ap-bk-title { font-size: 18px; font-weight: 600; letter-spacing: -0.02em; margin: 6px 0 4px; line-height: 1.3; }
.ap-bk-facts { display: flex; gap: 22px; flex-wrap: wrap; margin-top: 12px; }
.ap-bk-fact { font-size: 12px; color: var(--text-3); }
.ap-bk-fact b { display: block; font-size: 14px; color: var(--text); font-weight: 600; margin-top: 2px; font-variant-numeric: tabular-nums; }

/* Decision panel */
.ap-decide { padding: 18px; }
.ap-decide h3 { font-size: 15px; font-weight: 600; margin: 0 0 4px; letter-spacing: -0.01em; }
.ap-decide p { font-size: 13px; color: var(--text-3); margin: 0 0 14px; }
.ap-decide-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ap-decided { display: flex; align-items: center; gap: 12px; padding: 16px 18px; }
.ap-decided-icon { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0; }
.ap-decided-icon svg { width: 18px; height: 18px; }
.ap-decided.ok .ap-decided-icon { background: var(--ok-bg); color: var(--ok); }
.ap-decided.bad .ap-decided-icon { background: var(--bad-bg); color: var(--bad); }

/* ── Message thread (Devin-style) ──────────────────────────────────────── */
.ap-thread { display: flex; flex-direction: column; min-height: 420px; max-height: 640px; }
.ap-thread-scroll { flex: 1; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 12px; background: var(--surface-2); }
.ap-thread-scroll::-webkit-scrollbar { width: 6px; }
.ap-thread-scroll::-webkit-scrollbar-thumb { background: #d8d5cc; border-radius: 3px; }
.ap-msg { display: flex; flex-direction: column; gap: 4px; max-width: 82%; }
.ap-msg.mine { align-self: flex-end; align-items: flex-end; }
.ap-msg-who { font-size: 11.5px; color: var(--text-3); display: flex; align-items: center; gap: 6px; padding: 0 4px; }
.ap-msg-who b { color: var(--text-2); font-weight: 600; }
.ap-bubble {
    background: var(--surface); border: 1px solid var(--border); border-radius: 14px; border-bottom-left-radius: 4px;
    padding: 10px 14px; font-size: 13.5px; line-height: 1.6; color: var(--text); white-space: pre-wrap; overflow-wrap: anywhere;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}
.ap-msg.mine .ap-bubble { background: #16170f; color: #ecebe4; border-color: transparent; border-bottom-left-radius: 14px; border-bottom-right-radius: 4px; }
.ap-msg.system { align-self: center; max-width: 90%; }
.ap-msg.system .ap-bubble { background: transparent; border: 1px dashed var(--border-strong); color: var(--text-3); font-size: 12px; box-shadow: none; text-align: center; }
.ap-day-sep { align-self: center; font-size: 11px; font-weight: 600; color: var(--text-4); text-transform: uppercase; letter-spacing: 0.08em; padding: 4px 0; }
.ap-composer { padding: 12px 14px 14px; border-top: 1px solid var(--border); background: var(--surface); border-radius: 0 0 var(--r-lg) var(--r-lg); }
.ap-composer-row { position: relative; background: #edecea; border-radius: 24px; padding: 11px 52px 11px 18px; }
.ap-app .ap-composer textarea {
    display: block; width: 100%; border: 0; outline: none; background: transparent; resize: none; padding: 0; margin: 0;
    font-size: 13.5px; line-height: 1.55; color: var(--text); min-height: 22px; max-height: 160px; box-shadow: none; height: 22px;
}
.ap-app .ap-composer textarea::placeholder { color: #aaa89a; }
.ap-send {
    position: absolute; right: 6px; bottom: 6px; width: 34px; height: 34px; border-radius: 50%; border: 0; cursor: pointer;
    background: #16170f; color: #fff; display: grid; place-items: center; transition: opacity 120ms, transform 80ms;
}
.ap-send:hover { opacity: 0.85; }
.ap-send:active { transform: scale(0.92); }
.ap-send svg { width: 15px; height: 15px; }
.ap-send[disabled] { opacity: 0.35; pointer-events: none; }
.ap-composer-hint { font-size: 11px; color: var(--text-4); margin: 7px 4px 0; }

/* Inbox list */
.ap-inbox-row { display: flex; gap: 14px; padding: 14px 18px; border-bottom: 1px solid var(--border); transition: background 100ms; position: relative; }
.ap-inbox-row:last-child { border-bottom: 0; }
.ap-inbox-row:hover { background: var(--surface-2); }
.ap-inbox-row.unread::before { content: ""; position: absolute; left: 6px; top: 50%; width: 6px; height: 6px; margin-top: -3px; border-radius: 50%; background: var(--accent); }
.ap-inbox-main { min-width: 0; flex: 1; }
.ap-inbox-top { display: flex; align-items: baseline; gap: 10px; }
.ap-inbox-title { font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ap-inbox-row.unread .ap-inbox-title { color: var(--text); }
.ap-inbox-time { margin-left: auto; font-size: 11.5px; color: var(--text-3); white-space: nowrap; flex-shrink: 0; }
.ap-inbox-sub { font-size: 12px; color: var(--text-3); margin-top: 1px; }
.ap-inbox-preview { font-size: 13px; color: var(--text-2); margin-top: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ap-inbox-preview b { font-weight: 600; color: var(--text); }

/* Notifications */
.ap-note { display: flex; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--border); transition: background 100ms; }
.ap-note:last-child { border-bottom: 0; }
.ap-note:hover { background: var(--surface-2); }
.ap-note-icon { width: 32px; height: 32px; border-radius: 9px; flex-shrink: 0; display: grid; place-items: center; background: var(--surface-3); color: var(--text-2); }
.ap-note-icon svg { width: 15px; height: 15px; }
.ap-note-icon.Booking { background: var(--ok-bg); color: var(--ok); }
.ap-note-icon.Message { background: var(--accent-soft); color: var(--accent-fg); }
.ap-note-icon.Listing { background: var(--violet-bg); color: var(--violet); }
.ap-note-icon.Account { background: var(--warn-bg); color: var(--warn); }
.ap-note-main { min-width: 0; flex: 1; }
.ap-note-title { font-size: 13px; font-weight: 600; line-height: 1.35; }
.ap-note-body { font-size: 12.5px; color: var(--text-3); margin-top: 2px; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ap-note-time { font-size: 11px; color: var(--text-4); margin-top: 4px; }
.ap-note.unread { background: color-mix(in oklab, var(--accent-soft) 55%, var(--surface)); }
.ap-note.unread .ap-note-title::after { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); margin-left: 7px; vertical-align: middle; }

/* ── Timeline (history) ────────────────────────────────────────────────── */
.ap-timeline { list-style: none; margin: 0; padding: 8px 18px 14px; }
.ap-tl-day { font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-4); padding: 16px 0 6px 40px; }
.ap-tl { position: relative; display: flex; gap: 14px; padding: 8px 0; }
.ap-tl::before { content: ""; position: absolute; left: 13px; top: 0; bottom: 0; width: 1px; background: var(--border); }
.ap-tl:first-of-type::before { top: 18px; }
.ap-tl-icon { position: relative; z-index: 1; width: 27px; height: 27px; border-radius: 50%; flex-shrink: 0; display: grid; place-items: center; background: var(--surface); border: 1px solid var(--border-strong); color: var(--text-2); }
.ap-tl-icon svg { width: 13px; height: 13px; }
.ap-tl-icon.ok { background: var(--ok-bg); border-color: color-mix(in oklab, var(--ok) 30%, var(--border)); color: var(--ok); }
.ap-tl-icon.bad { background: var(--bad-bg); border-color: color-mix(in oklab, var(--bad) 30%, var(--border)); color: var(--bad); }
.ap-tl-icon.info { background: var(--accent-soft); border-color: color-mix(in oklab, var(--accent) 30%, var(--border)); color: var(--accent-fg); }
.ap-tl-icon.violet { background: var(--violet-bg); border-color: color-mix(in oklab, var(--violet) 30%, var(--border)); color: var(--violet); }
.ap-tl-main { min-width: 0; flex: 1; padding-top: 3px; }
.ap-tl-title { font-size: 13px; font-weight: 600; }
.ap-tl-title a { color: var(--accent-fg); }
.ap-tl-detail { font-size: 12.5px; color: var(--text-2); margin-top: 1px; overflow-wrap: anywhere; }
.ap-tl-meta { font-size: 11.5px; color: var(--text-3); margin-top: 2px; }

/* ── Modal ─────────────────────────────────────────────────────────────── */
.ap-modal-back { position: fixed; inset: 0; z-index: 90; background: rgba(20,21,14,0.42); backdrop-filter: blur(2px); display: none; align-items: center; justify-content: center; padding: 16px; }
.ap-modal-back.open { display: flex; animation: apFade 140ms ease-out; }
@keyframes apFade { from { opacity: 0; } to { opacity: 1; } }
.ap-modal { width: 100%; max-width: 460px; background: var(--surface); border-radius: var(--r-xl); box-shadow: var(--shadow-3); overflow: hidden; animation: apRise 180ms cubic-bezier(.2,.8,.2,1); }
@keyframes apRise { from { transform: translateY(8px) scale(0.98); opacity: 0; } to { transform: none; opacity: 1; } }
.ap-modal-body { padding: 22px 22px 6px; }
.ap-modal-icon { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--surface-3); color: var(--text); margin-bottom: 14px; }
.ap-modal-icon svg { width: 19px; height: 19px; }
.ap-modal-icon.bad { background: var(--bad-bg); color: var(--bad); }
.ap-modal-icon.ok { background: var(--ok-bg); color: var(--ok); }
.ap-modal h3 { font-size: 16px; font-weight: 600; margin: 0 0 6px; letter-spacing: -0.01em; }
.ap-modal p { font-size: 13.5px; color: var(--text-2); margin: 0 0 14px; line-height: 1.55; }
.ap-modal .ap-field { margin-bottom: 8px; }
.ap-modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 22px 20px; }

/* ── Toast ─────────────────────────────────────────────────────────────── */
.ap-toasts { position: fixed; z-index: 100; bottom: 88px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.ap-toast {
    pointer-events: auto; display: flex; align-items: center; gap: 10px; padding: 10px 16px 10px 12px; border-radius: 12px;
    background: #16170f; color: #ecebe4; font-size: 13px; font-weight: 500; box-shadow: var(--shadow-3);
    animation: apRise 200ms cubic-bezier(.2,.8,.2,1); max-width: min(520px, calc(100vw - 32px));
}
.ap-toast svg { width: 16px; height: 16px; flex-shrink: 0; }
.ap-toast.ok svg { color: #7ad3a0; }
.ap-toast.err svg { color: #ff9b8a; }
.ap-toast.out { opacity: 0; transform: translateY(6px); transition: opacity 200ms, transform 200ms; }

/* ── Auth (sign up / sign in) ──────────────────────────────────────────── */
body.ap-auth-body { margin: 0; background: #f6f5f1; }
.ap-auth { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); min-height: 100vh; background: var(--bg); }
.ap-auth-art {
    position: relative; overflow: hidden; color: #f4f2ea; padding: 44px 52px; display: flex; flex-direction: column;
    background: #16170f;
}
.ap-auth-art::before {
    content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
    background:
        radial-gradient(70% 55% at 100% 0%, rgba(122,150,255,0.22), transparent 60%),
        radial-gradient(60% 50% at 0% 100%, rgba(255,176,110,0.16), transparent 60%),
        linear-gradient(160deg, #23241b 0%, #16170f 60%, #111209 100%);
}
.ap-auth-art::after {
    content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none; opacity: 0.4;
    background-image: radial-gradient(rgba(255,255,255,0.09) 1px, transparent 1px);
    background-size: 20px 20px;
    mask-image: radial-gradient(80% 70% at 70% 30%, #000, transparent);
    -webkit-mask-image: radial-gradient(80% 70% at 70% 30%, #000, transparent);
}

/* Live-catalogue mosaic on the art panel */
.ap-mosaic { display: grid; grid-template-columns: 1.25fr 1fr 1fr; grid-template-rows: 200px 160px; gap: 12px; margin: 34px 0 30px; max-width: 600px; }
.ap-tile { position: relative; overflow: hidden; border-radius: 14px; background: #2a2b22; box-shadow: 0 18px 40px -18px rgba(0,0,0,0.7); border: 1px solid rgba(255,255,255,0.08); }
.ap-tile:first-child { grid-row: span 2; }
.ap-tile img { width: 100%; height: 100%; object-fit: cover; display: block; transform: scale(1.02); transition: transform 1.2s ease; }
.ap-tile:hover img { transform: scale(1.07); }
.ap-tile::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 45%, rgba(10,10,6,0.82)); }
.ap-tile figcaption { position: absolute; left: 10px; right: 10px; bottom: 9px; z-index: 1; font-size: 11.5px; font-weight: 600; color: #fff; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ap-tile figcaption span { display: block; font-size: 10.5px; font-weight: 500; color: rgba(255,255,255,0.65); margin-top: 1px; }
.ap-tile.yours { display: grid; place-items: center; text-align: center; background: rgba(255,255,255,0.04); border: 1.5px dashed rgba(255,255,255,0.28); box-shadow: none; }
.ap-tile.yours::after { display: none; }
.ap-tile.yours div { font-size: 12px; font-weight: 600; color: rgba(255,255,255,0.86); padding: 10px; }
.ap-tile.yours svg { width: 20px; height: 20px; display: block; margin: 0 auto 6px; color: rgba(255,255,255,0.75); }
.ap-auth-art > * { position: relative; z-index: 1; }
.ap-auth-logo-chip { display: inline-flex; align-items: center; background: #fff; border-radius: 12px; padding: 7px 12px; box-shadow: 0 10px 30px -12px rgba(0,0,0,0.6); }
.ap-auth-logo { height: 32px; width: auto; display: block; }
.ap-auth-pitch { margin-top: auto; max-width: 520px; }
.ap-auth-eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 11px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: rgba(244,242,234,0.75); padding: 5px 11px; border-radius: 999px; border: 1px solid rgba(255,255,255,0.2); background: rgba(255,255,255,0.06); backdrop-filter: blur(6px); }
.ap-auth-pitch h1 { font-size: 40px; line-height: 1.08; letter-spacing: -0.035em; font-weight: 600; margin: 18px 0 14px; color: #fff; }
.ap-auth-pitch h1 em { font-style: normal; color: #c9d4ff; }
.ap-auth-pitch p { font-size: 15px; line-height: 1.6; color: rgba(244,242,234,0.78); margin: 0; }
.ap-auth-points { list-style: none; padding: 0; margin: 22px 0 0; display: grid; gap: 10px; }
.ap-auth-points li { display: flex; gap: 12px; align-items: flex-start; font-size: 13.5px; color: rgba(244,242,234,0.86); line-height: 1.5; }
.ap-auth-points li svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 1px; padding: 3px; border-radius: 6px; background: rgba(255,255,255,0.12); color: #fff; box-sizing: content-box; }
.ap-auth-points b { color: #fff; font-weight: 600; }
.ap-auth-stats { display: flex; gap: 0; margin-top: 30px; border-top: 1px solid rgba(255,255,255,0.14); padding-top: 18px; }
.ap-auth-stat { flex: 1; padding-right: 16px; }
.ap-auth-stat + .ap-auth-stat { padding-left: 16px; border-left: 1px solid rgba(255,255,255,0.14); }
.ap-auth-stat b { display: block; font-size: 22px; font-weight: 600; letter-spacing: -0.02em; color: #fff; }
.ap-auth-stat span { font-size: 12px; color: rgba(244,242,234,0.62); }

.ap-auth-panel { display: flex; flex-direction: column; padding: 32px 48px; overflow-y: auto; }
.ap-auth-top { display: flex; justify-content: space-between; align-items: center; font-size: 13px; color: var(--text-3); }
.ap-auth-top a { color: var(--text); font-weight: 600; }
.ap-auth-top a:hover { text-decoration: underline; }
.ap-auth-card { width: 100%; max-width: 420px; margin: auto; padding: 28px 0; }
.ap-auth-card h2 { font-size: 26px; font-weight: 600; letter-spacing: -0.03em; margin: 0 0 6px; }
.ap-auth-card .ap-auth-lead { font-size: 14px; color: var(--text-3); margin: 0 0 24px; line-height: 1.55; }
.ap-auth-card .ap-field { margin-bottom: 14px; }
.ap-auth-card .ap-fields-2 { row-gap: 0; }
.ap-auth .ap-field input { height: 44px; border-radius: 10px; font-size: 14px; }
.ap-pw { position: relative; }
.ap-auth .ap-pw input { padding-right: 44px; }
.ap-pw-toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); background: none; border: none; cursor: pointer; padding: 8px; color: var(--text-3); display: flex; border-radius: 7px; }
.ap-pw-toggle:hover { color: var(--text); background: var(--surface-3); }
.ap-pw-toggle svg { width: 17px; height: 17px; }
.ap-pw-toggle .off { display: none; }
.ap-pw-toggle.on .on { display: none; }
.ap-pw-toggle.on .off { display: block; }
.ap-strength { display: flex; gap: 4px; margin-top: 8px; }
.ap-strength i { flex: 1; height: 3px; border-radius: 3px; background: var(--surface-3); transition: background 200ms; }
.ap-strength[data-s="1"] i:nth-child(-n+1) { background: var(--bad); }
.ap-strength[data-s="2"] i:nth-child(-n+2) { background: var(--warn); }
.ap-strength[data-s="3"] i:nth-child(-n+3) { background: var(--ok); }
.ap-strength[data-s="4"] i { background: var(--ok); }
.ap-terms { display: flex; gap: 10px; align-items: flex-start; font-size: 12.5px; color: var(--text-2); margin: 6px 0 18px; line-height: 1.5; cursor: pointer; }
.ap-auth .ap-terms input[type=checkbox] { width: 17px; height: 17px; margin: 1px 0 0; accent-color: #16170f; flex-shrink: 0; cursor: pointer; }
.ap-auth-alert { padding: 11px 14px; border-radius: 10px; font-size: 13px; margin-bottom: 16px; background: var(--bad-bg); color: var(--bad); border: 1px solid color-mix(in oklab, var(--bad) 22%, var(--border)); }
.ap-auth-foot { font-size: 12px; color: var(--text-4); text-align: center; margin-top: 18px; }
.ap-auth-foot a { color: var(--text-2); }
.ap-steps { display: flex; gap: 6px; margin-bottom: 20px; }
.ap-steps span { flex: 1; font-size: 11px; font-weight: 600; color: var(--text-3); letter-spacing: 0.04em; padding-top: 8px; border-top: 2px solid var(--border-strong); }
.ap-steps span.on { color: var(--text); border-top-color: var(--text); }
.ap-steps span.done { color: var(--text-2); border-top-color: var(--text-2); }

/* OMS sign-in / 2FA / password reset (same shell, a few extra pieces) */
/* The OMS panel keeps the blue of the old staff sign-in instead of the partner portal's near-black. */
.ap-auth-art.ap-auth-art-oms { background: #1d4079; }
.ap-auth-art.ap-auth-art-oms::before {
    background:
        radial-gradient(70% 55% at 100% 0%, rgba(140,180,255,0.22), transparent 60%),
        linear-gradient(180deg, #1d4079 0%, #24518f 60%, #2a5b9e 100%);
}
.ap-auth-art.ap-auth-art-oms::after {
    opacity: 1;
    background-image:
        linear-gradient(rgba(255,255,255,0.06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.06) 1px, transparent 1px);
    background-size: 72px 72px;
    mask-image: none; -webkit-mask-image: none;
}
.ap-auth-art-oms .ap-auth-pitch h1 em { color: #ffd59a; }
.ap-auth-art-oms .ap-auth-pitch p { color: rgba(255,255,255,0.82); }
.ap-auth-art-oms .ap-tile { box-shadow: 0 22px 44px -18px rgba(5,15,40,0.75); }
/* ...and the form picks up the same blue: primary buttons, focus rings, checkbox, active step. */
.ap-auth.ap-auth-oms { --accent: #2a5b9e; --accent-soft: #eaf0fa; --accent-fg: #1d4079; }
.ap-auth-oms .ap-btn-primary {
    background: #24518f; border-color: #24518f; color: #fff;
    box-shadow: 0 1px 2px rgba(20,40,90,0.3), 0 8px 20px -10px rgba(36,81,143,0.7), inset 0 1px 0 rgba(255,255,255,0.12);
}
.ap-auth-oms .ap-btn-primary:hover { background: #1d4079; border-color: #1d4079; color: #fff; }
.ap-auth.ap-auth-oms .ap-field input:focus { border-color: #2a5b9e; }
.ap-auth.ap-auth-oms .ap-terms input[type=checkbox] { accent-color: #24518f; }
.ap-auth-oms .ap-steps span.on { color: #1d4079; border-top-color: #24518f; }
/* "Send my code by" — Email / Text message choice cards on the OMS password reset */
.ap-auth fieldset.ap-channel { border: 0; padding: 0; margin: 0 0 14px; min-width: 0; }
.ap-channel legend { padding: 0; font-size: 12.5px; font-weight: 600; color: var(--text-2); margin-bottom: 6px; }
.ap-channel-opts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
/* .ap-field label (a flex row with a bottom margin) would otherwise shrink these to their text */
.ap-field .ap-channel-opt { position: relative; cursor: pointer; display: block; margin: 0; }
.ap-channel-opt input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.ap-channel-opt span {
    display: flex; align-items: center; justify-content: center; gap: 8px; height: 46px; padding: 0 10px;
    border: 1px solid var(--border-strong); border-radius: 10px; background: var(--surface);
    font-size: 13.5px; font-weight: 600; color: var(--text-2); transition: border-color 120ms, background 120ms, color 120ms;
}
.ap-channel-opt span svg { width: 17px; height: 17px; flex-shrink: 0; color: var(--text-3); }
.ap-channel-opt:hover span { border-color: var(--text-3); }
.ap-channel-opt input:checked + span { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-fg); box-shadow: 0 0 0 1px var(--accent); }
.ap-channel-opt input:checked + span svg { color: var(--accent); }
.ap-channel-opt input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.ap-mosaic.ap-mosaic-single { grid-template-columns: minmax(0, 1fr); grid-template-rows: 320px; max-width: 560px; }
.ap-mosaic-single .ap-tile { border-radius: 18px; grid-row: auto; }
.ap-mosaic-single .ap-tile figcaption { font-size: 13px; left: 16px; bottom: 14px; }
.ap-mosaic-single .ap-tile figcaption span { font-size: 11.5px; }
@media (max-width: 900px) {
    .ap-mosaic.ap-mosaic-single { grid-template-columns: minmax(0, 1fr); grid-template-rows: 120px; }
    .ap-mosaic-single .ap-tile figcaption { display: none; }
}
.ap-auth-alert.info { background: var(--accent-soft); color: var(--accent-fg); border-color: color-mix(in oklab, var(--accent) 25%, var(--border)); }
.ap-auth-alert.ok { background: var(--ok-bg); color: var(--ok); border-color: color-mix(in oklab, var(--ok) 25%, var(--border)); }
.ap-auth-card .ap-field label a { font-weight: 500; color: var(--text-2); }
.ap-auth-card .ap-field label a:hover { color: var(--text); text-decoration: underline; }
.ap-auth-icon { width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-1); margin-bottom: 18px; color: var(--text); }
.ap-auth-icon svg { width: 21px; height: 21px; }
.ap-auth .ap-field input.ap-code {
    height: 58px; text-align: center; font-family: var(--mono); font-size: 26px; font-weight: 600;
    letter-spacing: 0.42em; padding: 0 0 0 0.42em; font-variant-numeric: tabular-nums;
}
.ap-auth .ap-field input.ap-code::placeholder { letter-spacing: 0.3em; }
.ap-auth-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 2px 0 18px; }
.ap-auth-row .ap-terms { margin: 0; }
.ap-auth-links { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 16px; font-size: 13px; color: var(--text-3); }
.ap-auth-links a { color: var(--text-2); font-weight: 500; }
.ap-auth-links a:hover { color: var(--text); text-decoration: underline; }
.ap-auth-links button.ap-link { background: none; border: 0; padding: 0; font: inherit; font-weight: 500; color: var(--text-2); cursor: pointer; }
.ap-auth-links button.ap-link:hover:not([disabled]) { color: var(--text); text-decoration: underline; }
.ap-auth-links button.ap-link[disabled] { color: var(--text-4); cursor: default; }
.ap-rules { list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 5px; font-size: 12px; color: var(--text-3); }
.ap-rules li { display: flex; align-items: center; gap: 7px; }
.ap-rules li::before { content: ""; width: 14px; height: 14px; border-radius: 50%; border: 1.5px solid var(--border-strong); flex-shrink: 0; box-sizing: border-box; }
.ap-rules li.met { color: var(--ok); }
.ap-rules li.met::before { border-color: var(--ok); background: var(--ok) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5L20 7'/%3E%3C/svg%3E") center / 9px no-repeat; }
.ap-qr { display: flex; justify-content: center; margin: 4px 0 10px; }
.ap-qr img { width: 188px; height: 188px; border: 1px solid var(--border); border-radius: 14px; padding: 10px; background: #fff; }
.ap-qr-key { text-align: center; font-size: 12px; color: var(--text-3); margin-bottom: 18px; }
.ap-qr-key code { display: inline-block; margin-top: 4px; font-family: var(--mono); font-size: 13px; color: var(--text); background: var(--surface-3); border: 1px solid var(--border); border-radius: 8px; padding: 5px 9px; letter-spacing: 0.04em; user-select: all; }
.ap-auth-steps-list { margin: 0 0 16px; padding-left: 20px; color: var(--text-2); line-height: 1.6; font-size: 13.5px; }
.ap-auth-steps-list b { color: var(--text); font-weight: 600; }
.ap-add-app { display: none; margin: 4px 0 6px; }
.ap-add-app-or { display: none; text-align: center; font-size: 12px; color: var(--text-3); margin: 6px 0 2px; }
.ap-step-phone { display: none; }
@media (pointer: coarse) and (max-width: 820px) {
    .ap-add-app { display: flex; }
    .ap-add-app-or { display: block; }
    .ap-step-desktop { display: none; }
    .ap-step-phone { display: list-item; }
}

/* ── Responsive ────────────────────────────────────────────────────────── */
@media (max-width: 1100px) {
    .ap-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .ap-grid-main { grid-template-columns: minmax(0, 1fr); }
    .ap-grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
    .ap-side { transform: translateX(-100%); transition: transform 220ms cubic-bezier(.2,.8,.2,1); box-shadow: none; }
    .ap-app.nav-open .ap-side { transform: none; box-shadow: var(--shadow-3); }
    .ap-scrim { position: fixed; inset: 0; z-index: 35; background: rgba(20,21,14,0.36); display: none; }
    .ap-app.nav-open .ap-scrim { display: block; }
    .ap-main { margin-left: 0; }
    .ap-icon-btn.ap-menu-btn { display: grid; }
    .ap-top { padding: 0 16px; }
    .ap-content { padding: 6px 16px 48px; }
    .ap-form-section { grid-template-columns: minmax(0, 1fr); gap: 14px; padding: 18px 16px; }
    .ap-auth { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; }
    /* Phone: a short hero (logo, three-photo strip, headline) so the form starts near the top. */
    .ap-auth-art { padding: 16px 16px 22px; min-height: 0; }
    .ap-auth-logo-chip { padding: 5px 9px; border-radius: 10px; }
    .ap-auth-logo { height: 26px; }
    .ap-auth-eyebrow, .ap-auth-points, .ap-auth-stats { display: none; }
    .ap-mosaic { grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-rows: 96px; gap: 8px; margin: 16px 0; max-width: none; }
    .ap-tile { border-radius: 12px; }
    .ap-tile:first-child { grid-row: auto; }
    .ap-tile:nth-child(n+4) { display: none; }
    .ap-tile figcaption { display: none; }
    .ap-tile::after { background: linear-gradient(180deg, transparent 60%, rgba(10,10,6,0.35)); }
    .ap-auth-pitch { margin-top: 0; }
    .ap-auth-pitch h1 { font-size: 25px; line-height: 1.12; margin: 0 0 8px; }
    .ap-auth-pitch p { font-size: 14px; line-height: 1.5; }
    .ap-auth-panel { padding: 14px 16px 28px; }
    .ap-auth-top { font-size: 12.5px; }
    .ap-auth-card { padding: 18px 0 8px; }
    .ap-auth-card h2 { font-size: 22px; }
    .ap-auth-card .ap-auth-lead { margin-bottom: 18px; font-size: 13.5px; }
    .ap-steps { margin-bottom: 16px; }
}
@media (max-width: 640px) {
    .ap-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .ap-kpi { padding: 13px 14px; }
    .ap-kpi-value { font-size: 21px; }
    .ap-grid-2, .ap-grid-3, .ap-fields-2, .ap-fields-3 { grid-template-columns: minmax(0, 1fr); }
    .ap-h1 { font-size: 19px; }
    .ap-hero { padding: 20px; }
    .ap-hero h2 { font-size: 20px; }
    .ap-bk-head { flex-direction: column; }
    .ap-bk-img { width: 100%; aspect-ratio: 16 / 9; }
    .ap-kv { grid-template-columns: minmax(0, 1fr); gap: 2px 0; }
    .ap-kv dd { margin-bottom: 8px; }
    .ap-msg { max-width: 92%; }
    .ap-search { max-width: none; margin-left: 0; min-width: 0; flex-basis: 100%; }
    .ap-table .hide-sm { display: none; }
    .ap-decide-actions { grid-template-columns: minmax(0, 1fr); }
    .ap-callout { flex-wrap: wrap; }
    .ap-callout .ap-callout-actions { margin-left: 29px; }
}
@media (prefers-reduced-motion: reduce) {
    .ap-app *, .ap-auth * { animation: none !important; transition: none !important; }
}
