/* ─────────────────────────────────────────────────────────
   Revue maquettes — interface
   ───────────────────────────────────────────────────────── */

:root {
    --bg: #f5f6f8;
    --surface: #ffffff;
    --ink: #0f1115;
    --muted: #5d6470;
    --line: #e3e6ec;
    --accent: #0045ff;
    --accent-hover: #002fbf;
    --accent-soft: #e6edff;
    --pw-teal: #00cea3;
    --pw-orange: #ffa200;
    --pw-pink: #ff0077;
    --pw-blue: #0045ff;
    --pin: #ff0077;
    --pin-ink: #ffffff;
    --shadow-sm: 0 1px 2px rgba(15, 17, 21, 0.06), 0 0 0 1px rgba(15, 17, 21, 0.04);
    --shadow-md: 0 8px 28px rgba(15, 17, 21, 0.10), 0 1px 2px rgba(15, 17, 21, 0.04);
    --radius: 10px;
    --radius-sm: 6px;
    --font: "Inter Tight", "Inter", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

.pw-stripe {
    height: 3px;
    width: 100%;
    display: block;
    background: linear-gradient(
        to right,
        var(--pw-teal)   0%,   var(--pw-teal)   25%,
        var(--pw-orange) 25%,  var(--pw-orange) 50%,
        var(--pw-pink)   50%,  var(--pw-pink)   75%,
        var(--pw-blue)   75%,  var(--pw-blue)   100%
    );
}

.pw-logo {
    display: inline-block;
    height: 22px;
    width: auto;
    flex: 0 0 auto;
}
.pw-logo svg, .pw-logo img { display: block; height: 100%; width: auto; }
.pw-logo-sm { height: 16px; }

.brand {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    text-decoration: none;
    color: inherit;
}
.brand-compact { gap: 0; padding: 4px 8px; border-radius: var(--radius-sm); transition: background .12s; }
.brand-compact:hover { background: var(--bg); }
.brand-divider {
    width: 1px;
    height: 22px;
    background: var(--line);
    flex: 0 0 auto;
}
.brand-label {
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
    font-weight: 500;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    font-family: var(--font);
    color: var(--ink);
    background: var(--bg);
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
button { font-family: inherit; }

/* ── Gallery ─────────────────────────────────────────── */

.topbar {
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    padding: 20px 32px 22px;
}
.topbar-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
}
.topbar h1 {
    margin: 0;
    font-size: 20px;
    font-weight: 500;
    letter-spacing: -0.01em;
}
.muted { color: var(--muted); margin: 4px 0 0; font-size: 13px; }
.meta { display: flex; gap: 8px; }
.badge {
    background: var(--accent-soft);
    color: var(--accent);
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 500;
}

.gallery-grid {
    max-width: 1200px;
    margin: 32px auto;
    padding: 0 32px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.card {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 18px 20px 14px;
    transition: box-shadow .15s ease, transform .15s ease;
}
.card:hover { box-shadow: var(--shadow-md); }
.card h2 {
    margin: 0 0 12px;
    font-size: 15px;
    font-weight: 500;
    color: var(--ink);
}

.card-client {
    display: flex;
    flex-direction: column;
    gap: 4px;
    text-decoration: none;
    color: inherit;
    padding: 20px 22px 18px;
    position: relative;
    overflow: hidden;
}
.card-client:hover { transform: translateY(-1px); }
.card-client h2 { margin: 12px 0 2px; font-size: 17px; }
.client-slug {
    font-size: 12px;
    color: var(--muted);
    margin: 0 0 14px;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.client-mark {
    display: flex;
    gap: 4px;
}
.client-mark .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}
.client-stats {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12.5px;
    color: var(--muted);
}
.dot-sep { opacity: 0.4; }

.card-empty pre {
    background: var(--bg);
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    overflow-x: auto;
    margin: 10px 0 0;
}
.card-empty code {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 12px;
}
.card-empty p code {
    background: var(--bg);
    padding: 1px 6px;
    border-radius: 4px;
}

.crumb {
    margin: 0 0 2px;
    font-size: 11px;
    color: var(--muted);
    letter-spacing: 0.06em;
    text-transform: uppercase;
}
.crumb a { color: var(--accent); text-decoration: none; }
.crumb a:hover { text-decoration: underline; }
.crumb span { margin: 0 4px; }

.client-chip {
    font-size: 11px;
    background: var(--accent-soft);
    color: var(--accent);
    padding: 3px 9px;
    border-radius: 999px;
    letter-spacing: 0.03em;
    font-weight: 500;
}

/* ── Auth pages ─────────────────────────────────── */

body.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: var(--bg);
}
.auth-card {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    padding: 36px 40px 30px;
    width: 100%;
    max-width: 380px;
}
.auth-card-wide { max-width: 460px; }
.auth-brand {
    margin: -10px -10px 18px;
}
.auth-logo {
    height: 22px;
    width: auto;
    display: block;
    margin: 0 auto 16px;
}
.auth-brand .pw-stripe {
    height: 3px;
    border-radius: 2px;
    width: 64px;
    margin: 0 auto;
}
.auth-card h1 {
    margin: 0 0 6px;
    font-size: 20px;
    font-weight: 500;
    text-align: center;
}
.auth-card p.muted {
    text-align: center;
    margin-bottom: 22px;
}
.auth-error {
    background: #fff1f3;
    border: 1px solid #ffd5dc;
    color: #b00020;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    margin: 0 0 16px;
}
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.auth-form label {
    font-size: 12px;
    color: var(--muted);
    margin-top: 6px;
}
.auth-form input[type="password"], .auth-form input[type="text"] {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    font-family: inherit;
    font-size: 14px;
    background: white;
    color: var(--ink);
}
.auth-form input:focus { outline: 0; border-color: var(--accent); }
.auth-form button {
    margin-top: 14px;
    justify-content: center;
    padding: 10px 14px;
    font-size: 14px;
}
.auth-footnote {
    text-align: center;
    margin: 18px 0 0;
    font-size: 11.5px;
}

/* ── Staff client card (admin index) ─────────────── */

.card-client-admin {
    padding: 0;
    overflow: hidden;
}
.card-client-link {
    display: block;
    text-decoration: none;
    color: inherit;
    padding: 20px 22px 14px;
}
.card-client-link:hover { background: var(--bg); }
.card-client-link h2 { margin: 12px 0 2px; font-size: 17px; }

.share-row {
    border-top: 1px solid var(--line);
    padding: 12px 16px 14px;
    background: #fbfbfc;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.share-row label {
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
}
.share-input {
    display: flex;
    align-items: stretch;
    gap: 6px;
}
.share-input input {
    flex: 1;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 6px 10px;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 11.5px;
    background: white;
    color: var(--ink);
    min-width: 0;
}
.share-input input:focus { outline: 0; border-color: var(--accent); }
.iconbtn-text {
    padding: 6px 10px;
    font-size: 12px;
    border: 1px solid var(--line);
    background: var(--surface);
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--ink);
    font-family: inherit;
}
.iconbtn-text:hover { background: var(--bg); }
.iconbtn-text.is-copied {
    background: var(--accent-soft);
    color: var(--accent);
    border-color: var(--accent);
}
.link-btn {
    background: none;
    border: 0;
    padding: 4px 0 0;
    font-size: 11.5px;
    color: var(--muted);
    cursor: pointer;
    text-align: left;
    font-family: inherit;
}
.link-btn:hover { color: var(--accent); text-decoration: underline; }

.btn.btn-ghost {
    background: transparent;
    border-color: transparent;
    color: var(--muted);
    padding: 6px 10px;
}
.btn.btn-ghost:hover { background: var(--bg); color: var(--ink); }

.variants {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.variant {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    text-decoration: none;
    color: var(--ink);
    transition: background .12s ease;
}
.variant:hover { background: var(--bg); }
.variant-icon {
    color: var(--muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.variant-label { flex: 1; font-size: 13px; }
.pill {
    background: var(--pin);
    color: white;
    border-radius: 999px;
    font-size: 11px;
    padding: 2px 7px;
    font-weight: 500;
    min-width: 18px;
    text-align: center;
}

.footnote {
    max-width: 1200px;
    margin: 24px auto 48px;
    padding: 0 32px;
    color: var(--muted);
    font-size: 12px;
}
.footnote p { margin: 6px 0; }
.signature { letter-spacing: 0.04em; }
.signature a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
}
.signature a:hover { text-decoration: underline; }

/* ── Viewer layout ───────────────────────────────────── */

body.viewer {
    height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background: #ece9e3;
}

.viewer-bar {
    flex: 0 0 auto;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    padding: 10px 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 56px;
}
.viewer-bar .brand-compact + .back { margin-left: 4px; }
.back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    color: var(--muted);
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    transition: background .12s, color .12s;
}
.back:hover { background: var(--bg); color: var(--ink); }

.viewer-title {
    flex: 1;
    display: flex;
    align-items: baseline;
    gap: 14px;
    min-width: 0;
}
.viewer-title strong {
    font-weight: 500;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sibling {
    font-size: 12px;
    color: var(--muted);
    text-decoration: none;
    padding: 3px 8px;
    border-radius: 999px;
    background: var(--bg);
    white-space: nowrap;
}
.sibling:hover { color: var(--accent); }

.viewer-tools {
    display: flex;
    align-items: center;
    gap: 8px;
}

.who {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px 4px 12px;
    background: var(--bg);
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    transition: border-color .12s;
}
.who:focus-within { border-color: var(--line); background: var(--surface); }
.who label { color: var(--muted); font-size: 12px; }
.who input {
    border: 0;
    background: transparent;
    outline: 0;
    font-family: inherit;
    font-size: 13px;
    width: 140px;
    color: var(--ink);
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--surface);
    border: 1px solid var(--line);
    color: var(--ink);
    padding: 7px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 13px;
    transition: background .12s, border-color .12s, color .12s;
}
.btn:hover { background: var(--bg); }
.btn.btn-primary {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}
.btn.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn[aria-pressed="true"] {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

.iconbtn {
    background: transparent;
    border: 0;
    cursor: pointer;
    font-size: 20px;
    color: var(--muted);
    width: 28px;
    height: 28px;
    border-radius: var(--radius-sm);
}
.iconbtn:hover { background: var(--bg); color: var(--ink); }

#count-badge {
    background: var(--pin);
    color: white;
    padding: 1px 7px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    min-width: 18px;
    text-align: center;
}
#count-badge:empty, #count-badge[data-zero]:not([data-zero=""]) { display: none; }

.menu { position: relative; }
.menu-pop {
    position: absolute;
    right: 0;
    top: calc(100% + 4px);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-md);
    padding: 4px;
    min-width: 160px;
    z-index: 10;
}
.menu-pop a {
    display: block;
    text-decoration: none;
    color: var(--ink);
    padding: 7px 10px;
    border-radius: 4px;
    font-size: 13px;
}
.menu-pop a:hover { background: var(--bg); }

/* ── Viewer main ─────────────────────────────────────── */

.viewer-main {
    flex: 1;
    display: flex;
    min-height: 0;
}

.frame-wrap {
    flex: 1;
    overflow: auto;
    background: #ece9e3;
    display: flex;
    justify-content: center;
    padding: 16px;
}
.frame-wrap.wrap-mobile {
    align-items: flex-start;
    padding: 24px 16px;
}

#page-frame {
    border: 0;
    background: white;
    box-shadow: var(--shadow-md);
    border-radius: 4px;
    width: 1440px;
    min-height: calc(100vh - 88px);
    display: block;
}
.wrap-mobile #page-frame {
    width: 390px;
    min-height: 844px;
    border-radius: 20px;
    border: 8px solid #1a1614;
}

/* ── Annotation cursor (parent overlay safety) ───────── */

body.annotate-on .frame-wrap { cursor: crosshair; }

/* ── Side panel ──────────────────────────────────────── */

.panel {
    flex: 0 0 340px;
    background: var(--surface);
    border-left: 1px solid var(--line);
    display: flex;
    flex-direction: column;
    min-height: 0;
}
.panel.hidden { display: none; }

.panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid var(--line);
}
.panel-head h2 {
    margin: 0;
    font-size: 14px;
    font-weight: 500;
}

.panel-list {
    flex: 1;
    overflow-y: auto;
    padding: 12px 14px 24px;
}
.empty {
    color: var(--muted);
    font-size: 13px;
    text-align: center;
    margin: 32px 12px;
}

.comment {
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: border-color .12s, background .12s;
}
.comment:hover { border-color: var(--accent); }
.comment.active { border-color: var(--accent); background: var(--accent-soft); }

.comment-head {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}
.comment-index {
    background: var(--pin);
    color: white;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 600;
    flex: 0 0 auto;
}
.comment-author { font-weight: 500; font-size: 13px; }
.comment-date { color: var(--muted); font-size: 11px; margin-left: auto; }
.comment-text {
    font-size: 13px;
    color: var(--ink);
    margin: 0;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.replies {
    margin-top: 8px;
    padding-left: 12px;
    border-left: 2px solid var(--line);
}
.reply {
    margin-top: 6px;
    padding-top: 6px;
}
.reply-head {
    display: flex;
    gap: 8px;
    align-items: baseline;
    margin-bottom: 2px;
}
.reply-author { font-size: 12px; font-weight: 500; }
.reply-date { font-size: 11px; color: var(--muted); }
.reply-text { font-size: 12.5px; margin: 0; white-space: pre-wrap; word-wrap: break-word; }

.reply-form {
    display: none;
    margin-top: 8px;
    gap: 6px;
    flex-direction: column;
}
.comment.active .reply-form { display: flex; }
.reply-form textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 4px;
    padding: 6px 8px;
    font-family: inherit;
    font-size: 12.5px;
    resize: vertical;
    min-height: 50px;
    background: white;
}
.reply-form textarea:focus { outline: 0; border-color: var(--accent); }
.reply-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 6px;
}
.reply-form .btn { padding: 4px 10px; font-size: 12px; }

/* ── Modal ───────────────────────────────────────────── */

.modal {
    position: fixed;
    inset: 0;
    background: rgba(26, 22, 20, 0.42);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    padding: 16px;
}
.modal[hidden] { display: none; }
.modal-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 22px;
    max-width: 440px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0,0,0,0.25);
}
.modal-card h3 { margin: 0 0 6px; font-weight: 500; font-size: 16px; }
.modal-card textarea, .modal-card input[type="text"] {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    font-family: inherit;
    font-size: 14px;
    background: white;
    color: var(--ink);
    margin-top: 12px;
}
.modal-card textarea { resize: vertical; min-height: 90px; }
.modal-card textarea:focus, .modal-card input:focus {
    outline: 0;
    border-color: var(--accent);
}
.modal-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 14px;
}

/* ── Pin (rendered inside iframe document) ───────────── */

/* Defined here for reference; injected into iframe via JS */
