:root {
    --bg: #101416;
    --surface: #181e20;
    --surface-2: #202729;
    --line: #344044;
    --text: #f7f4ef;
    --muted: #aab3b5;
    --coral: #c93473;
    --coral-strong: #ff8ab5;
    --accent-gradient: linear-gradient(135deg, #a92365 0%, #c93473 52%, #d8437b 100%);
    --accent-gradient-hover: linear-gradient(135deg, #b3296d 0%, #d13b7b 52%, #e04c88 100%);
    --teal: #5eb6a5;
    --yellow: #e4c66c;
    --danger: #e46f79;
    --header-h: 64px;
}

* { box-sizing: border-box; }
html { color-scheme: dark; background: var(--bg); }
body {
    margin: 0;
    min-width: 320px;
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
    font-family: Inter, "Zen Kaku Gothic New", system-ui, sans-serif;
    letter-spacing: 0;
}
button, input, select, textarea { font: inherit; letter-spacing: 0; }
button, a { -webkit-tap-highlight-color: transparent; }
button:disabled { cursor: not-allowed; opacity: .52; }
a { color: inherit; }
[hidden] { display: none !important; }
.companion-app-entered #guestView { display: none; }

.topbar {
    position: sticky;
    top: 0;
    z-index: 30;
    height: var(--header-h);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 max(18px, calc((100vw - 1120px) / 2));
    border-bottom: 1px solid rgba(255,255,255,.1);
    background: rgba(16,20,22,.94);
    backdrop-filter: blur(14px);
}
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 800; }
.brand img { width: 28px; height: 28px; object-fit: contain; }
.brand-product { color: var(--coral-strong); font-size: .9rem; font-weight: 700; }
.icon-btn {
    width: 40px; height: 40px; display: inline-grid; place-items: center;
    border: 1px solid var(--line); border-radius: 6px; color: var(--text); background: var(--surface);
    cursor: pointer;
}
.icon-btn:hover { border-color: var(--coral); }
.icon-btn svg { width: 20px; height: 20px; }

.hero {
    min-height: min(760px, calc(100vh - var(--header-h)));
    display: grid;
    align-items: center;
    position: relative;
    isolation: isolate;
    background: #171c1e url('/together/assets/companion-hero.jpg') center/cover no-repeat;
}
.hero::before {
    content: ""; position: absolute; inset: 0; z-index: -1;
    background: linear-gradient(90deg, rgba(12,16,18,.94) 0%, rgba(12,16,18,.8) 38%, rgba(12,16,18,.18) 70%, rgba(12,16,18,.08) 100%);
}
.hero-copy { width: min(1120px, calc(100% - 36px)); margin: 0 auto; padding: 64px 0 92px; }
.eyebrow { color: var(--teal); font-weight: 800; font-size: .82rem; margin: 0 0 14px; }
.hero h1 { max-width: 640px; margin: 0; font-size: clamp(2.25rem, 6vw, 4.8rem); line-height: 1.08; }
.hero h1 span { display: block; white-space: nowrap; }
.hero-lead { max-width: 500px; margin: 20px 0 28px; color: #d7ddde; font-size: clamp(1rem, 2vw, 1.22rem); line-height: 1.9; }
.primary-btn, .secondary-btn, .danger-btn, .text-btn {
    min-height: 46px; display: inline-flex; align-items: center; justify-content: center; gap: 9px;
    border-radius: 6px; padding: 0 18px; font-weight: 800; cursor: pointer; text-decoration: none;
}
.primary-btn {
    border: 1px solid #d84a82; background: var(--accent-gradient); color: #fff;
    box-shadow: 0 6px 18px rgba(201,52,115,.18); text-shadow: 0 1px 1px rgba(73,8,39,.2);
}
.primary-btn:hover { background: var(--accent-gradient-hover); box-shadow: 0 8px 22px rgba(201,52,115,.28); }
.secondary-btn { border: 1px solid var(--line); background: var(--surface); color: var(--text); }
.secondary-btn:hover { border-color: var(--teal); }
.danger-btn { border: 1px solid rgba(228,111,121,.6); background: transparent; color: #ff9ca4; }
.text-btn { border: 0; background: transparent; color: var(--teal); padding-inline: 8px; }
.primary-btn svg, .secondary-btn svg, .danger-btn svg { width: 18px; height: 18px; }
.trust-strip { display: flex; flex-wrap: wrap; gap: 10px 22px; margin-top: 34px; color: #e2e7e7; font-size: .88rem; }
.trust-strip span { display: inline-flex; align-items: center; gap: 7px; }
.trust-strip svg { width: 16px; color: var(--teal); }

.safety-band { background: #f2eee8; color: #202526; padding: 58px 18px; }
.safety-inner { width: min(1120px, 100%); margin: 0 auto; }
.safety-inner h2 { font-size: clamp(1.55rem, 3vw, 2.4rem); margin: 0 0 30px; }
.safety-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
.safety-item { border-top: 3px solid var(--coral); padding-top: 18px; }
.safety-item svg { width: 25px; height: 25px; color: #347f72; }
.safety-item h3 { margin: 12px 0 7px; font-size: 1rem; }
.safety-item p { margin: 0; color: #566062; font-size: .88rem; line-height: 1.7; }

.app-shell { width: min(1120px, calc(100% - 28px)); margin: 0 auto; padding: 28px 0 110px; }
.app-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
.app-head h1 { margin: 0; font-size: clamp(1.65rem, 4vw, 2.35rem); }
.app-head p { margin: 8px 0 0; color: var(--muted); }
.women-only-label {
    display: inline-flex; align-items: center; gap: 7px; margin-bottom: 10px;
    color: #ffc0b2; font-size: .78rem; font-weight: 800;
}
.women-only-label svg { width: 17px; height: 17px; color: var(--coral-strong); }
.status-pill { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line); border-radius: 999px; padding: 7px 10px; color: var(--muted); font-size: .8rem; white-space: nowrap; }
.app-head .status-pill { justify-self: start; }
.status-pill.approved { color: #8ee1d0; border-color: rgba(94,182,165,.5); }
.status-pill.pending { color: #f0d888; border-color: rgba(228,198,108,.5); }
.status-pill.rejected, .status-pill.suspended { color: #ff9ca4; border-color: rgba(228,111,121,.5); }

.tabs { display: flex; gap: 4px; overflow-x: auto; padding-bottom: 1px; border-bottom: 1px solid var(--line); scrollbar-width: none; }
.tab { min-width: max-content; border: 0; border-bottom: 3px solid transparent; background: transparent; color: var(--muted); padding: 13px 15px; font-weight: 700; cursor: pointer; }
.tab.active { color: var(--text); border-bottom-color: var(--coral); }
.tab-panel { padding-top: 24px; }

.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 18px; }
.toolbar h2, .section-title { margin: 0; font-size: 1.18rem; }
.discover-title { display: grid; gap: 4px; }
.discover-title span { color: var(--muted); font-size: .78rem; }
.filter-row { display: flex; gap: 8px; }
.select-control, .field input, .field select, .field textarea {
    width: 100%; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--text); padding: 11px 12px;
}
.select-control { width: auto; min-width: 130px; }
.store-filter-row .select-control { min-width: 220px; }
.timing-filter { display: flex; gap: 8px; margin: -2px 0 14px; overflow-x: auto; scrollbar-width: none; }
.filter-chip {
    flex: none; min-height: 38px; border: 1px solid var(--line); border-radius: 6px;
    padding: 0 14px; color: var(--muted); background: transparent; font-weight: 700; cursor: pointer;
}
.filter-chip.active {
    color: #fff; border-color: #d84a82; background: var(--accent-gradient);
    box-shadow: 0 5px 15px rgba(201,52,115,.2); text-shadow: 0 1px 1px rgba(73,8,39,.2);
}
.post-list, .request-list, .match-list { display: grid; gap: 12px; }
.post-card, .request-row, .match-row {
    border: 1px solid var(--line); border-radius: 8px; background: var(--surface); padding: 18px;
}
.post-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; }
.post-main { min-width: 0; }
.post-person {
    display: flex; align-items: center; gap: 10px; margin-bottom: 10px; padding-bottom: 11px;
    border-bottom: 1px solid rgba(255,255,255,.08);
}
.post-avatar {
    width: 36px; height: 36px; flex: none; display: grid; place-items: center; border-radius: 50%;
    color: #ff9bc0; background: rgba(201,52,115,.14); border: 1px solid rgba(201,52,115,.4);
}
.post-avatar svg { width: 19px; height: 19px; }
.post-person h3 { margin: 0; display: flex; align-items: baseline; gap: 4px; line-height: 1.15; }
.post-person h3 small { color: var(--muted); font-size: .76rem; font-weight: 700; }
.post-identity { min-width: 0; display: grid; gap: 4px; }
.women-marker {
    width: max-content; display: inline-flex; align-items: center; gap: 4px;
    color: var(--muted); font-size: .68rem; font-weight: 700;
}
.women-marker svg { width: 13px; height: 13px; color: var(--teal); }
.post-visit-summary {
    display: flex; align-items: center; flex-wrap: wrap; gap: 7px 14px; margin: 11px 0 12px;
    padding: 9px 0; border-top: 1px solid rgba(255,255,255,.07); border-bottom: 1px solid rgba(255,255,255,.07);
}
.visit-detail { min-width: 0; display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font-size: .78rem; }
.visit-detail svg { width: 14px; height: 14px; flex: none; color: var(--muted); }
.visit-detail strong { color: #dce3e2; font-size: .82rem; }
.visit-detail small { color: var(--muted); font-size: .68rem; }
.visit-detail.timing-today strong { color: #ff9bc0; }
.visit-detail.timing-tomorrow strong { color: #8ee1d0; }
.visit-detail.timing-discuss strong { color: #f0d888; }
.visit-store { flex: 1 1 180px; }
.visit-store svg { color: var(--teal); }
.visit-store strong { overflow-wrap: anywhere; }
.companion-ineligible .tabs,
.companion-ineligible .toolbar,
.companion-ineligible .timing-filter,
.companion-ineligible .post-list,
.companion-ineligible .fab { display: none !important; }
.companion-ineligible #discoverNotice { margin-top: 36px; }
.companion-ineligible #discoverNotice .notice { padding: 24px; font-size: .96rem; line-height: 1.8; }
.post-meta { display: flex; flex-wrap: wrap; gap: 7px 12px; color: var(--muted); font-size: .82rem; }
.post-meta span { display: inline-flex; align-items: center; gap: 5px; }
.post-meta svg { width: 15px; height: 15px; }
.post-card h3 { font-size: 1.35rem; }
.post-owner { color: #fff; font-weight: 900; }
.post-message { color: #eef2f2; font-size: .98rem; line-height: 1.65; margin: 0; white-space: pre-wrap; }
.post-message > span { display: block; margin-bottom: 3px; color: #ff8ab5; font-size: .67rem; font-weight: 700; }
.tags { display: flex; flex-wrap: wrap; gap: 7px; }
.tag { border: 1px solid var(--line); border-radius: 4px; padding: 4px 7px; color: var(--muted); font-size: .76rem; }
.tag.beginner { color: #f0d888; border-color: rgba(228,198,108,.45); }
.card-actions { display: flex; flex-direction: column; justify-content: center; min-width: 146px; }
.own-post-actions { min-width: 174px; gap: 8px; }
.own-post-actions > div { display: flex; gap: 7px; }
.own-post-actions button { min-height: 42px; padding-inline: 12px; flex: 1; }
.own-post-label { color: var(--muted); font-size: .72rem; font-weight: 700; text-align: center; }
.expiry-status { width: min(520px, 100%); margin-top: 14px; }
.expiry-copy { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 6px; font-size: .72rem; }
.expiry-copy span { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); }
.expiry-copy svg { width: 14px; height: 14px; }
.expiry-copy strong { color: #8ee1d0; font-size: .78rem; }
.expiry-gauge { height: 6px; overflow: hidden; border-radius: 999px; background: #293235; }
.expiry-gauge span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #3b887a, var(--teal)); transition: width .25s ease; }
.expiry-status.soon .expiry-copy strong { color: #f0d888; }
.expiry-status.soon .expiry-gauge span { background: linear-gradient(90deg, #a98224, var(--yellow)); }
.expiry-status.urgent .expiry-copy strong { color: #ff8ab5; }
.expiry-status.urgent .expiry-gauge span { background: var(--accent-gradient); }

.request-row, .match-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.row-main { min-width: 0; }
.row-main h3 { margin: 0 0 6px; font-size: 1rem; }
.row-main p { margin: 0; color: var(--muted); line-height: 1.55; }
.row-actions { display: flex; gap: 8px; flex-shrink: 0; }

.empty-state { border: 1px dashed var(--line); border-radius: 8px; padding: 48px 20px; text-align: center; color: var(--muted); }
.empty-state svg { width: 34px; height: 34px; margin-bottom: 12px; color: var(--teal); }
.notice { border-left: 4px solid var(--yellow); background: #252720; padding: 14px 16px; margin-bottom: 18px; color: #e8e0c1; line-height: 1.65; }
.notice.success { border-left-color: var(--teal); background: #192624; color: #b9e4db; }
.notice.danger { border-left-color: var(--danger); background: #2a1c1f; color: #ffc2c7; }

.profile-layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 28px; align-items: start; }
.profile-summary { border-left: 3px solid var(--teal); padding: 4px 0 4px 18px; }
.profile-summary h2 { margin: 0 0 8px; }
.profile-summary p { margin: 0; color: var(--muted); line-height: 1.7; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field { display: grid; gap: 7px; }
.field.full { grid-column: 1 / -1; }
.field label, .fieldset-label { color: #d7dddd; font-size: .84rem; font-weight: 700; }
.field small { color: var(--muted); line-height: 1.5; }
.choice-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.choice { position: relative; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice span { display: inline-flex; min-height: 40px; align-items: center; border: 1px solid var(--line); border-radius: 6px; padding: 0 11px; color: var(--muted); cursor: pointer; }
.choice input:checked + span { color: #15211f; background: var(--teal); border-color: var(--teal); font-weight: 800; }
.schedule-field { gap: 9px; }
.schedule-choice-grid { display: grid; gap: 8px; }
.schedule-choice-grid.three-up { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.schedule-choice-grid.two-up { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.schedule-choice { position: relative; min-width: 0; }
.schedule-choice input { position: absolute; opacity: 0; pointer-events: none; }
.schedule-choice > span {
    min-height: 78px; display: grid; place-content: center; justify-items: center; gap: 3px;
    border: 1px solid var(--line); border-radius: 6px; padding: 9px 7px;
    background: #13191b; color: var(--muted); text-align: center; cursor: pointer;
}
.schedule-choice strong { color: var(--text); font-size: 1rem; }
.schedule-choice small { font-size: .67rem; }
.schedule-choice svg { width: 19px; height: 19px; color: var(--yellow); }
.schedule-choice input:checked + span { border-color: var(--coral); background: #291824; box-shadow: inset 0 0 0 1px var(--coral), 0 5px 18px rgba(201,52,115,.12); }
.schedule-choice input:checked + span strong { color: #ff8ab5; }
.duration-choices .schedule-choice > span { min-height: 72px; }
.consent-group { display: grid; gap: 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.check-row {
    width: 100%; display: grid; grid-template-columns: 20px minmax(0, 1fr); align-items: start;
    gap: 12px; margin: 0; padding: 13px 2px; color: var(--muted); line-height: 1.55; font-size: .88rem;
}
.check-row + .check-row { border-top: 1px solid rgba(255,255,255,.08); }
.check-row input { width: 18px; height: 18px; margin: 2px 0 0; padding: 0; accent-color: var(--teal); }
.check-row span { min-width: 0; }
.check-row a { color: var(--text); text-underline-offset: 3px; }

.fab {
    position: fixed; right: max(18px, calc((100vw - 1120px) / 2)); bottom: 22px; z-index: 25;
    width: 124px; height: 54px; border-radius: 999px; border: 0; padding: 0 17px;
    background: var(--accent-gradient); color: #fff; display: inline-flex; align-items: center;
    justify-content: center; gap: 7px; font-weight: 800; text-shadow: 0 1px 1px rgba(73,8,39,.2);
    box-shadow: 0 12px 30px rgba(201,52,115,.32); cursor: pointer;
}
.fab svg { width: 21px; height: 21px; flex: none; }
.fab span { white-space: nowrap; }
.fab:hover { background: var(--accent-gradient-hover); box-shadow: 0 14px 34px rgba(201,52,115,.4); }

dialog { width: min(620px, calc(100% - 24px)); max-height: calc(100vh - 28px); overflow: auto; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--text); padding: 0; }
dialog::backdrop { background: rgba(0,0,0,.76); backdrop-filter: blur(4px); }
.dialog-head { position: sticky; top: 0; z-index: 2; display: flex; justify-content: space-between; align-items: center; padding: 17px 18px; border-bottom: 1px solid var(--line); background: var(--surface); }
.dialog-head h2 { margin: 0; font-size: 1.08rem; }
.dialog-body { padding: 20px 18px; }
.dialog-actions { position: sticky; bottom: 0; display: flex; justify-content: flex-end; gap: 9px; padding: 14px 18px; border-top: 1px solid var(--line); background: var(--surface); }

.toast { position: fixed; left: 50%; bottom: 24px; z-index: 100; transform: translate(-50%, 16px); opacity: 0; pointer-events: none; background: #f3efe8; color: #1b2021; border-radius: 6px; padding: 12px 16px; box-shadow: 0 12px 34px rgba(0,0,0,.4); transition: .2s ease; max-width: calc(100% - 28px); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.loading { display: inline-flex; align-items: center; gap: 9px; color: var(--muted); }
.loading::before { content: ""; width: 16px; height: 16px; border: 2px solid var(--line); border-top-color: var(--teal); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.chat-shell { width: min(820px, 100%); height: calc(100vh - var(--header-h)); margin: 0 auto; display: grid; grid-template-rows: auto auto 1fr auto; }
.chat-person { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.chat-person h1 { margin: 0; font-size: 1.05rem; }
.chat-person p { margin: 4px 0 0; color: var(--muted); font-size: .8rem; }
.plan-bar { padding: 10px 16px; border-bottom: 1px solid var(--line); background: #182522; display: flex; align-items: center; justify-content: space-between; gap: 12px; color: #b9e4db; font-size: .85rem; }
.message-list { overflow-y: auto; padding: 18px 16px; display: flex; flex-direction: column; gap: 10px; }
.message { max-width: 78%; border-radius: 8px; padding: 10px 12px; line-height: 1.55; background: var(--surface-2); }
.message.mine { align-self: flex-end; background: #842553; }
.message.theirs { align-self: flex-start; }
.message time { display: block; margin-top: 5px; color: rgba(255,255,255,.58); font-size: .67rem; text-align: right; }
.quick-row { display: flex; gap: 7px; overflow-x: auto; padding: 8px 12px 0; scrollbar-width: none; }
.quick-btn { flex: none; border: 1px solid var(--line); border-radius: 999px; background: transparent; color: var(--muted); padding: 7px 10px; cursor: pointer; font-size: .78rem; }
.composer { border-top: 1px solid var(--line); background: var(--surface); padding: 8px 12px 12px; }
.composer-form { display: grid; grid-template-columns: 1fr 44px; gap: 8px; }
.composer textarea { resize: none; min-height: 44px; max-height: 120px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); color: var(--text); padding: 10px 12px; }
.chat-safety-note { display: flex; align-items: center; gap: 7px; margin: 0; padding: 8px 12px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: .7rem; background: var(--surface); }
.chat-safety-note svg { width: 15px; height: 15px; flex: none; color: var(--teal); }

.admin-shell { width: min(1200px, calc(100% - 28px)); margin: 0 auto; padding: 28px 0 80px; }
.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 20px 0 28px; }
.metric { border: 1px solid var(--line); padding: 15px; }
.metric strong { display: block; font-size: 1.8rem; margin-top: 4px; }
.table-wrap { overflow: auto; border: 1px solid var(--line); margin-top: 12px; }
table { width: 100%; border-collapse: collapse; min-width: 780px; }
th, td { padding: 11px 12px; border-bottom: 1px solid var(--line); text-align: left; font-size: .82rem; vertical-align: top; }
th { color: var(--muted); background: var(--surface); }

@media (max-width: 760px) {
    .hero { min-height: calc(100svh - var(--header-h) - 44px); background-position: 62% center; align-items: end; }
    .hero::before { background: linear-gradient(0deg, rgba(12,16,18,.98) 0%, rgba(12,16,18,.82) 52%, rgba(12,16,18,.2) 100%); }
    .hero-copy { padding: 38px 0 48px; }
    .hero h1 { font-size: 2.35rem; max-width: 340px; }
    .hero-lead { max-width: 340px; font-size: .98rem; line-height: 1.75; }
    .trust-strip { display: grid; gap: 8px; }
    .safety-grid { grid-template-columns: 1fr 1fr; gap: 24px 16px; }
    .app-shell { width: min(100% - 36px, 1120px); padding-top: 20px; }
    .app-head { display: grid; gap: 12px; }
    .toolbar { align-items: flex-end; }
    .filter-row { width: 100%; }
    .select-control { min-width: 0; flex: 1; }
    .store-filter-row .select-control { min-width: 0; }
    .post-card { grid-template-columns: 1fr; }
    .card-actions { min-width: 0; }
    .own-post-actions { width: 100%; }
    .own-post-actions > div { width: 100%; }
    .request-row, .match-row { align-items: flex-start; flex-direction: column; }
    .row-actions { width: 100%; }
    .row-actions > * { flex: 1; }
    .profile-layout { grid-template-columns: 1fr; gap: 20px; }
    .form-grid { grid-template-columns: 1fr; }
    .field.full { grid-column: auto; }
    .fab { right: 16px; bottom: 16px; width: 118px; height: 52px; }
    .metric-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 430px) {
    .safety-grid { grid-template-columns: 1fr; }
    .hero h1 { font-size: 2.08rem; }
    .tabs { gap: 0; margin-inline: -8px; padding-inline: 8px; }
    .tab { padding-inline: 8px; font-size: .88rem; }
    .toolbar { display: grid; align-items: stretch; }
    .timing-filter { margin-inline: -4px; padding-inline: 4px; }
    .visit-store { flex-basis: 100%; }
    .schedule-choice > span { min-height: 76px; padding-inline: 4px; }
    .metric-grid { grid-template-columns: 1fr; }
}
