
/* Main site design tokens: one light palette, two role accents, system-aware theme. */
:root {
  color-scheme: light;
  --app-viewport-height: 100vh;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --content-group-gap: var(--space-4);
  --message-card-height: 84px;
  --message-card-inline-padding: 20px;
  --message-delete-width: 88px;
  --chat-room-bottom-clearance: calc(env(safe-area-inset-bottom, 0px) + 64px);
  --field-control-gap: 7px;
  --form-field-gap: 18px;
  --section-heading-control-gap: 16px;
  --seg-inset: 4px;
  --font-display: "Noto Sans TC","PingFang TC","Heiti TC","Microsoft JhengHei",sans-serif;
  --font-body: var(--font-display);
  --text-xs: 12px;
  --text-sm: 14px;
  --text-md: 16px;
  --button-height-sm: 40px;
  --button-height-md: 52px;
  --button-height-lg: 60px;
  --control-height: 48px;
  --radius-control: 12px;
  --radius-card: 18px;
  --radius-panel: 22px;
  --shadow: 0 8px 24px rgba(23,43,77,.07);
  --shadow-raised: 0 18px 60px rgba(28,22,16,.22);
  --bg: #f4f7fb;
  --surface: #fff;
  --surface-2: #edf2f8;
  --filter-option-surface: #f8fafc;
  --post-muted-surface: #e9edf2;
  --fg: #172b4d;
  --muted: #66758a;
  --line: #dce5ef;
  --ask: #e56851;
  --ask-deep: #c94f3b;
  --ask-ink: #b44735;
  --ask-soft: #fff0ec;
  --offer: #287a70;
  --offer-deep: #1e625c;
  --offer-ink: #21685f;
  --offer-soft: #e9f5f2;
  --danger: #b44735;
  --success: #21685f;
  --glow-ask: rgba(229,104,81,.2);
  --glow-offer: rgba(40,122,112,.18);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #111b2b;
    --surface: #19263a;
    --surface-2: #24344b;
    --filter-option-surface: #2b3b53;
    --post-muted-surface: #293645;
    --fg: #f2f6fb;
    --muted: #a8b6c9;
    --line: #33445c;
    --ask: #ee806b;
    --ask-deep: #c95d4c;
    --ask-ink: #ffb0a0;
    --ask-soft: #3b292d;
    --offer: #53aa9b;
    --offer-deep: #388b80;
    --offer-ink: #8bd4c8;
    --offer-soft: #1d3839;
    --danger: #ff9d8b;
    --success: #8bd4c8;
    --shadow: 0 8px 24px rgba(0,0,0,.2);
    --shadow-raised: 0 20px 70px rgba(0,0,0,.45);
    --glow-ask: rgba(238,128,107,.2);
    --glow-offer: rgba(83,170,155,.18);
  }
}
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #111b2b;
  --surface: #19263a;
  --surface-2: #24344b;
  --filter-option-surface: #2b3b53;
  --post-muted-surface: #293645;
  --fg: #f2f6fb;
  --muted: #a8b6c9;
  --line: #33445c;
  --ask: #ee806b;
  --ask-deep: #c95d4c;
  --ask-ink: #ffb0a0;
  --ask-soft: #3b292d;
  --offer: #53aa9b;
  --offer-deep: #388b80;
  --offer-ink: #8bd4c8;
  --offer-soft: #1d3839;
  --danger: #ff9d8b;
  --success: #8bd4c8;
  --shadow: 0 8px 24px rgba(0,0,0,.2);
  --shadow-raised: 0 20px 70px rgba(0,0,0,.45);
  --glow-ask: rgba(238,128,107,.2);
  --glow-offer: rgba(83,170,155,.18);
}

* { box-sizing: border-box; }
html { min-height: 100%; scrollbar-gutter: stable; }
@supports (height: 100dvh) {
  :root { --app-viewport-height: 100dvh; }
}
body {
  min-height: 100vh;
  min-height: var(--app-viewport-height, 100vh);
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
.wrap {
  max-width: 540px;
  min-height: 100vh;
  min-height: var(--app-viewport-height, 100vh);
  margin: 0 auto;
  padding: 0 16px;
  padding-block: calc(env(safe-area-inset-top,0px) + 20px) calc(env(safe-area-inset-bottom,0px) + 96px);
  overflow-anchor: none;
}
h1, h2, p { margin: 0; }
h1, h2 { font-weight: 900; }
button { font-family: inherit; }
button, input, textarea { -webkit-tap-highlight-color: transparent; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
[hidden] { display: none !important; }
.identity-badge { display:inline-block; margin-right:5px; padding:1px 5px; border-radius:5px; font-size:11px; font-weight:700; vertical-align:middle; }
.identity-badge.is-verified { background:#e8f5eb; color:#24713a; }
.identity-badge.is-unverified { background:#f1f3f5; color:#68717d; }
.identity-fields { display:grid; gap:var(--form-field-gap); }
.identity-page-heading > div { display:grid; gap:6px; min-width:0; }
.identity-page-heading .form-hint { margin:0; line-height:1.5; }
.identity-status-pill { display:inline-flex; align-items:center; width:max-content; max-width:100%; margin-top:5px; padding:3px 8px; border-radius:999px; font-size:11px; font-weight:700; line-height:1.4; }
.identity-status-pill::before { content:""; width:6px; height:6px; flex:none; margin-right:6px; border-radius:50%; background:currentColor; }
.identity-status-pill.is-unverified { background:#f1f3f5; color:#68717d; }
.identity-status-pill.is-pending { background:#fff5dc; color:#805b10; }
.identity-status-pill.is-verified { background:#e8f5eb; color:#24713a; }
.identity-status-pill.is-high-risk { background:#ffeded; color:#b42318; }
.identity-entry { display:grid; gap:var(--form-field-gap); }
.identity-camera-preview { display:block; width:100%; max-width:420px; max-height:320px; border-radius:12px; background:#101828; object-fit:cover; }
.identity-camera-preview[hidden] { display:none; }
.identity-camera-actions { display:flex; flex-wrap:wrap; gap:8px; }
.identity-camera-actions #identity-record-start.is-recording:disabled { opacity:1; cursor:progress; }
.identity-camera-status { margin-top:calc(var(--form-field-gap) - var(--field-control-gap)); line-height:1.5; }
.identity-file-status { color:var(--muted); font-size:13px; overflow-wrap:anywhere; }
.identity-submit-status { min-height:1.5em; margin:0; color:var(--muted); font-size:13px; }
.identity-submit-status:empty { display:none; }
.identity-submit-status.is-error { color:var(--danger); }
.identity-submit-status.is-success { color:var(--offer-ink); }

/* ---------- 首頁：只有兩個圓形按鈕 ---------- */
#view-home {
  min-height: calc(100vh - 116px);
  min-height: calc(var(--app-viewport-height, 100vh) - env(safe-area-inset-top,0px) - env(safe-area-inset-bottom,0px) - 116px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}
@media (max-width: 600px) {
  #view-home { margin-bottom: 120px; }
}
.hero { text-align: center; margin-bottom: 40px; }
.hero h1 {
  font-family: var(--font-display);
  font-size: 34px;
  line-height: 1.2;
}
.hero .tag {
  margin: 10px auto 0;
  font-size: 14px;
  color: var(--muted);
  letter-spacing: .04em;
}

.doorways { display: flex; justify-content: center; align-items: center; gap: min(5vw, 20px); }
.door {
  position: relative;
  width: min(42vw, 188px);
  aspect-ratio: 1;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #FFF8F3;
  transition: transform .12s ease, box-shadow .12s ease;
}
.door:active { transform: scale(.965); }
.door.ask {
  background: radial-gradient(circle at 32% 26%, var(--ask), var(--ask-deep) 78%);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.28),
    inset 0 -10px 24px rgba(0,0,0,.14),
    0 16px 34px -14px var(--glow-ask);
}
.door.offer {
  background: radial-gradient(circle at 32% 26%, var(--offer), var(--offer-deep) 78%);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.28),
    inset 0 -10px 24px rgba(0,0,0,.14),
    0 16px 34px -14px var(--glow-offer);
}
.door:focus-visible { outline: 3px solid var(--fg); outline-offset: 4px; }
.door-role {
  position: absolute; top: 18px; left: 18px;
  padding: 4px 9px; border: 1px solid rgba(255,255,255,.42); border-radius: 999px;
  color: #fff; font-size: 12px; font-weight: 700; letter-spacing: .04em;
}
.door .chars {
  writing-mode: vertical-rl;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 18px;
  letter-spacing: .06em;
  line-height: 1.4;
}

.foot { margin-top: 34px; font-size: 12px; color: var(--muted); text-align: center; line-height: 1.7; }

/* ---------- 子頁共用標頭 ---------- */
.page-head { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.back {
  border: 0; background: var(--surface-2); color: var(--fg);
  flex: none; width: 38px; height: 38px; padding: 0; border-radius: 12px; cursor: pointer;
  display: grid; place-items: center; font-size: 18px; line-height: 1;
}
.back svg { display: block; width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.eyebrow { font-size: 12px; letter-spacing: .18em; color: var(--muted); }
.page-head h2 { font-family: var(--font-display); font-size: 23px; line-height: 1.25; }
.lead { margin-bottom: 18px; font-size: 14px; color: var(--muted); }

/* ---------- 選項清單（類型 / 地區共用） ---------- */
.opt-list { display: grid; gap: 12px; }
.opt {
  display: flex; align-items: center; gap: 14px; width: 100%;
  padding: 14px 16px; border-radius: 16px; border: 1.5px solid var(--line);
  background: var(--surface); box-shadow: var(--shadow); cursor: pointer; text-align: left;
  transition: border-color .12s ease, background .12s ease, transform .12s ease;
}
.opt:active { transform: scale(.99); }
.opt .mark {
  flex: none; width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center;
  font-family: var(--font-display); font-weight: 900; font-size: 22px;
  background: var(--surface-2); color: var(--fg);
}
#view-type.ask .opt .mark, #view-region.ask .opt .mark { background: var(--ask); color: #FFF8F3; }
#view-type.offer .opt .mark, #view-region.offer .opt .mark { background: var(--offer); color: #F0FBF6; }
.opt .rt { min-width: 0; }
.opt .name { display: block; font-size: 17px; font-weight: 700; color: var(--fg); }
.opt .sub { display: block; margin-top: 2px; font-size: 13px; color: var(--muted); }
.opt .arrow { margin-left: auto; flex: none; font-size: 18px; color: var(--muted); }
#view-type.ask .opt.selected, #view-region.ask .opt.selected { border-color: var(--ask); background: var(--ask-soft); }
#view-type.offer .opt.selected, #view-region.offer .opt.selected { border-color: var(--offer); background: var(--offer-soft); }
#view-type.ask .opt.selected .arrow, #view-region.ask .opt.selected .arrow { color: var(--ask-ink); }
#view-type.offer .opt.selected .arrow, #view-region.offer .opt.selected .arrow { color: var(--offer-ink); }

/* ---------- 表單 ---------- */
/* 已確認的表單基準：欄位間距、標籤與輸入控制項間距、提示文字間距及按鈕尺寸／外觀，以求買／求帶為準；旅人表單沿用相同共用類別。 */
.form { display: grid; gap: var(--form-field-gap); }
.form-field-group { display: grid; gap: var(--form-field-gap); }
.region-pin {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface-2); border-radius: 12px; padding: 11px 14px;
}
.region-pin .k { font-size: 13px; font-weight: 700; color: var(--muted); }
.region-pin .k b { color: var(--danger); font-weight: 700; }
.region-pin .v { font-size: 15px; font-weight: 700; color: var(--fg); }
.region-pin .change {
  margin-left: auto; border: 0; background: transparent; color: var(--fg);
  font-size: 13px; font-weight: 700; cursor: pointer; text-decoration: underline;
}
.field { display: grid; gap: var(--field-control-gap); min-width: 0; }
.field label { font-size: 13px; font-weight: 700; color: var(--muted); }
.field label b { color: var(--danger); font-weight: 700; }
.field input, .field textarea, .field select {
  width: 100%; min-width: 0; font-family: inherit; font-size: 16px; color: var(--fg);
  min-height: var(--control-height); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-control);
  padding: 12px 14px; outline: none;
}
.password-reveal { position: relative; display: block; min-width: 0; }
.field .password-reveal input { padding-right: 52px; }
.password-reveal-button {
  position: absolute; top: 50%; right: 4px; transform: translateY(-50%);
  display: grid; place-items: center; width: 40px; height: 40px;
  padding: 0; border: 0; border-radius: 10px; background: transparent;
  color: var(--muted); cursor: pointer; touch-action: none;
}
.password-reveal-button svg { width: 21px; height: 21px; }
.password-reveal-button:hover { color: var(--fg); }
.password-reveal-button:focus-visible { outline: 2px solid var(--ask); outline-offset: -3px; }
.field textarea { resize: vertical; min-height: 70px; }
.field input::placeholder, .field textarea::placeholder { color: var(--muted); opacity: .7; }
.field select.is-placeholder { color: var(--muted); }
.field select:not([id$="-admin"]) {
  -webkit-appearance: none;
  appearance: none;
  padding-right: 42px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'%3E%3Cpath d='m1 1 4 4 4-4' fill='none' stroke='%2366758a' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-position: right 14px center;
  background-size: 10px 6px;
  background-repeat: no-repeat;
}
.field select[id$="-admin"] {
  -webkit-appearance: none;
  appearance: none;
  padding-right: 42px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'%3E%3Cpath d='m1 1 4 4 4-4' fill='none' stroke='%2366758a' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-position: right 12px center;
  background-size: 10px 6px;
  background-repeat: no-repeat;
}
.submit {
  width: 100%; min-height: var(--button-height-md); border: 0; border-radius: var(--radius-control); padding: 0 16px;
  background: var(--ask); color: #fff; font: inherit; font-size: var(--text-md); font-weight: 700; cursor: pointer;
  transition: background .15s ease, transform .15s ease, box-shadow .15s ease;
}
.submit:not(:disabled):hover { background: var(--ask-deep); }
.formview.ask .submit { background: var(--ask); }
.formview.ask .submit:not(:disabled):hover { background: var(--ask-deep); }
.formview.offer .submit { background: var(--offer); }
.formview.offer .submit:not(:disabled):hover { background: var(--offer-deep); }
.submit:active { transform: scale(.99); }
.submit:focus-visible, .btn-secondary:focus-visible, .btn-tertiary:focus-visible, .btn-danger:focus-visible { outline: 2px solid var(--ask); outline-offset: 3px; }
.formview.offer .submit:focus-visible { outline-color: var(--offer); }
.submit:disabled, .btn-secondary:disabled, .btn-tertiary:disabled, .btn-danger:disabled { opacity: .5; cursor: not-allowed; transform: none; }
#send-login-code:disabled { opacity: 1; background: var(--surface-2); color: var(--muted); }
.btn-secondary, .btn-tertiary, .btn-danger { min-height: var(--button-height-md); padding: 0 16px; border: 1px solid var(--line); border-radius: var(--radius-control); background: var(--surface); color: var(--fg); font: inherit; font-size: var(--text-md); font-weight: 700; cursor: pointer; transition: background .15s ease, border-color .15s ease, color .15s ease; }
.btn-sm { min-height: var(--button-height-sm); padding-inline: 12px; font-size: var(--text-sm); }
.btn-lg { min-height: var(--button-height-lg); padding-inline: 20px; }
.btn-secondary:hover { border-color: var(--muted); background: var(--surface-2); }
.btn-tertiary { border-color: transparent; background: transparent; color: var(--muted); }
.btn-tertiary:hover { background: var(--surface-2); color: var(--fg); }
.btn-danger { border-color: var(--danger); background: var(--danger); color: var(--bg); }
.btn-danger:hover { filter: brightness(.92); }
.form-hint { font-size: 12px; color: var(--muted); margin-top: -6px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 420px) { .row2 { grid-template-columns: 1fr; } }

/* ---------- 商品來源（實體 / 電商） ---------- */
.src-group { display: grid; gap: 10px; }
.buy-extras { display: grid; gap: 16px; } /* 幫人買才顯示：在哪買 / 型號規格 / 數量 / 預算 */
.src-label { font-size: 13px; font-weight: 700; color: var(--muted); }
.src-label b { color: var(--danger); font-weight: 700; }
.src-tabs, .hv-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.src-tab, .hv-tab {
  border: 1.5px solid var(--line); background: var(--surface); color: var(--muted);
  border-radius: 12px; padding: 12px; font-size: 15px; font-weight: 700; cursor: pointer;
  transition: border-color .12s ease, background .12s ease, color .12s ease;
}
.src-tab.on, .hv-tab.on { border-color: var(--ask); color: var(--ask-ink); background: var(--ask-soft); }
.src-cond { margin-top: 2px; }
.src-cond input {
  font-variant-numeric: normal;
}
.hv-group { display: grid; gap: 10px; }

/* ---------- 底部 tab：發布 / 訊息 / 我的 ---------- */
.tabbar {
  position: fixed; inset: auto 0 0;
  margin: 0;
  transform: none;
  display: flex;
  background: var(--surface);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  z-index: 40;
}
.tab-btn {
  position: relative;
  flex: 1; border: 0; background: transparent; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 8px 0 7px;
  color: var(--muted); font-size: 11px; font-weight: 700;
  transition: color .12s ease;
}
.tab-icon-wrap { position: relative; display: block; flex: none; width: 24px; height: 24px; }
.tab-ic { display: grid; place-items: center; width: 24px; height: 24px; font-size: 0; line-height: 1; }
.tab-ic svg { display: block; width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tab-btn.on { color: var(--fg); }

/* ---------- 我的（註冊 / 個人檔案） ---------- */
.tip {
  background: var(--surface-2); border-radius: 12px; padding: 12px 14px;
  font-size: 13px; color: var(--fg); line-height: 1.6;
}
.support-group { display: grid; gap: var(--space-3); }
.support-card { display: grid; gap: var(--space-2); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-card); }
.support-card p { margin: 0; }
.support-email { width: fit-content; color: var(--ask-ink); font-weight: 700; overflow-wrap: anywhere; }
.support-email:focus-visible { outline: 2px solid var(--ask); outline-offset: 3px; border-radius: 2px; }
#form-email-login .submit.primary, #login-with-password { box-shadow: var(--shadow); }
#email-code-login { display: grid; gap: 18px; }
#password-login-panel { display: contents; }
.login-status { margin: 0; min-height: 1.5em; color: var(--muted); font-size: 13px; line-height: 1.6; }
.login-status:empty { display: none; }
.login-status.error { color: var(--danger); }
.login-status.success { color: var(--offer); }
.login-method-toggle { display: block; margin: 8px auto 0; padding: 8px 12px; border: 0; background: transparent; color: var(--ask-ink); font: inherit; font-size: 14px; font-weight: 700; text-decoration: underline; cursor: pointer; }
.login-method-toggle.accepted { color: var(--muted); }
#form-email-login .login-method-toggle { margin-top: 0; }
.profile-card {
  position: relative;
  display: grid; gap: 14px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px;
  padding: 16px;
  box-shadow: var(--shadow);
}
.profile-card-details { display: flex; align-items: center; gap: 14px; min-width: 0; }
.pc-av {
  width: 54px; height: 54px; border-radius: 50%; flex: none;
  display: grid; place-items: center;
  background: radial-gradient(circle at 32% 26%, var(--ask), var(--ask-deep) 78%);
  color: #FFF8F3; font-size: 22px; font-weight: 900;
}
.pc-info { flex: 1; min-width: 0; display: grid; gap: 2px; }
.pc-name { display:flex; align-items:center; flex-wrap:wrap; gap:6px; font-size:17px; font-weight:900; }
.pc-contact { font-size: 13px; color: var(--muted); word-break: break-all; }
.pc-since { font-size: 12px; color: var(--muted); }
.pc-edit {
  flex: none; border: 1.5px solid var(--line); background: var(--surface);
  color: var(--fg); border-radius: 10px; padding: 8px 14px;
  font-size: 13px; font-weight: 700; cursor: pointer;
}

/* ---------- 訊息：通知 / 聊天 ---------- */
.seg { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 16px; }
.auth-mode-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.seg-btn {
  border: 1.5px solid var(--line); background: var(--surface); color: var(--muted);
  border-radius: 12px; padding: 10px; font-size: 15px; font-weight: 700; cursor: pointer;
  transition: border-color .12s ease, background .12s ease, color .12s ease;
}
.seg-btn.on { border-color: var(--fg); color: var(--fg); background: var(--surface-2); }
.msg-empty { color: var(--muted); font-size: 13px; line-height: 1.7; text-align: center; padding: 30px 12px; }
.ghost {
  border: 1.5px dashed var(--line); background: transparent; color: var(--muted);
  border-radius: 10px; padding: 7px 14px; font-size: 12px; font-weight: 700; cursor: pointer; margin-top: 12px;
}
.notice-card {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: var(--space-3); position: relative;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  box-sizing: border-box; height: var(--message-card-height); overflow: hidden;
  padding: 0 var(--message-card-inline-padding); margin-bottom: 12px;
  cursor: default; text-align: left; color: inherit; width: 100%; font: inherit;
}
.notice-card:focus-visible { border-color: var(--line); outline: 2px solid var(--fg); outline-offset: -2px; }
.notice-card.notice-unread { cursor: pointer; }
.notice-card.notice-unread { border-left: 4px solid #e5484d; padding-left: calc(var(--message-card-inline-padding) - 3px); }
.notice-card.notice-unread:hover { background: color-mix(in srgb, var(--surface-2) 70%, var(--surface)); }
.notice-card.notice-read { background: var(--surface-2); }
.notice-card.notice-read .nc-title { color: var(--muted); }
.message-preview-content { display: grid; align-content: center; gap: var(--space-1); min-width: 0; height: 100%; }
.message-preview-content > .nc-title, .message-preview-content > .nc-text { min-width: 0; margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.message-preview-content > .nc-text { color: var(--muted); }
.notice-row { position: relative; height: var(--message-card-height); margin-bottom: 12px; overflow: hidden; border-radius: var(--radius-card); background: var(--surface); }
.notice-row .notice-card { position: relative; z-index: 1; margin: 0; border-radius: var(--radius-card); transition: transform .24s cubic-bezier(.2,.75,.25,1); }
.notice-row.is-delete-open .notice-card { transform: translateX(calc(-1 * var(--message-delete-width))); }
.notice-row:has(.chat-delete:focus-visible) .notice-card { transform: translateX(calc(-1 * var(--message-delete-width))); }
.notice-row .chat-delete { height: 100%; }
.notice-row .chat-delete::before, .chat-row .chat-delete::before { display: none; }
.notice-preview { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 1; overflow: hidden; }
.notice-body-outcome { display: flex; align-items: flex-end; gap: 8px; min-width: 0; }
.notice-body-outcome .notice-preview { flex: 1; min-width: 0; margin: 0; }
.notice-body-outcome .match-outcome-badge { flex: none; margin-bottom: 1px; }
.nc-badge {
  background: var(--ask-soft); color: var(--ask-ink);
  font-size: 12px; font-weight: 900; padding: 3px 10px; border-radius: 999px;
}
.match-outcome-badge { display: inline-flex; align-items: center; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 800; }
.match-outcome-accepted { background: var(--offer-soft); color: var(--offer-ink); }
.match-outcome-declined { background: var(--surface-2); color: var(--muted); }
.match-outcome-pending { background: var(--ask-soft); color: var(--ask-ink); }
.match-outcome-row { display: flex; justify-content: flex-end; margin-top: 4px; }
.pending-action-count, .unread-count { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: #e5484d; color: #fff; font-size: 10px; font-weight: 900; line-height: 18px; text-align: center; font-variant-numeric: tabular-nums; vertical-align: middle; }
.pending-action-count[hidden], .unread-count[hidden] { display: none; }
.seg-btn .pending-action-count { margin-left: 5px; }
.seg-btn .unread-count { margin-left: 5px; }
#message-tabs .seg-btn { display: flex; align-items: center; justify-content: center; gap: 5px; white-space: nowrap; }
#message-tabs .pending-action-count, #message-tabs .unread-count { margin-left: 0; }
.message-tab-count { position: absolute; top: -4px; left: calc(100% - 1px); }
.nc-time { align-self: start; margin-top: var(--space-4); font-size: 12px; color: var(--muted); text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.nc-title { font-size: 16px; font-weight: 900; }
.notice-earnings { display: flex; flex-wrap: wrap; align-items: baseline; gap: 5px 9px; width: fit-content; margin: 5px 0; padding: 6px 10px; border: 1px solid color-mix(in srgb, currentColor 22%, var(--line)); border-radius: 10px; background: var(--surface-2); color: var(--fg); }
.notice-earnings-label { font-size: 12px; font-weight: 750; }
.notice-earnings-amount { font-size: 20px; font-weight: 900; letter-spacing: -.02em; }
#notice-dialog-content, .notice-dialog-content { display: grid; gap: 8px; }
#decline-reason-content { min-width: 0; }
#notice-dialog-content > .notice-earnings { gap: 4px 8px; margin: 0; padding: 5px 9px; }
#notice-dialog-content > .notice-earnings .notice-earnings-amount { font-size: 18px; }
#notice-dialog-content > .nc-text, .notice-dialog-content > .nc-text { margin: 0; }
.nc-route { font-size: 13px; color: var(--muted); }
.notice-summary { display: grid; gap: 5px; margin: 0; }
.notice-summary-row { display: grid; grid-template-columns: 42px minmax(0, 1fr); gap: 8px; font-size: 13px; line-height: 1.45; }
.notice-summary-label { color: var(--muted); }
.notice-summary-value { min-width: 0; overflow-wrap: anywhere; }
.nc-text { font-size: 13px; line-height: 1.5; }
.notice-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
#notice-dialog-content > .notice-actions, .notice-dialog-content > .notice-actions { margin-top: 2px; }
.pending-action-card { align-items: stretch; height: var(--message-card-height); min-height: var(--message-card-height); overflow: hidden; cursor: default; }
.pending-action-preview { align-self: stretch; justify-items: start; min-width: 0; padding: 0; border: 0; background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.pending-action-card:focus-within { background: var(--surface-2); }
.pending-action-preview .nc-title { max-width: 100%; }
.pending-action-preview .nc-text { max-width: 100%; color: var(--muted); }
.pending-action-preview:focus-visible { border-radius: 8px; outline: none; }
.pending-action-card > .notice-actions { justify-self: end; margin: 0; gap: 8px; align-self: center; flex-wrap: nowrap; }
.notice-actions .ghost { margin-top: 0; }
.notice-decline-form { display: grid; gap: var(--form-field-gap); }
.notice-decline-form .field { gap: var(--field-control-gap); }
.notice-decline-reasons { min-width: 0; margin: 0; padding: 0; border: 0; }
.notice-decline-options { display: grid; gap: 8px; }
.notice-decline-option { display: flex; align-items: center; gap: 9px; min-height: 42px; padding: 8px 11px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); color: var(--fg); cursor: pointer; }
.notice-decline-option input { width: 18px; height: 18px; margin: 0; accent-color: var(--ask); }
.notice-decline-other[hidden] { display: none; }
.decline-reason-page { display: grid; gap: var(--form-field-gap); width: min(100%, 420px); box-sizing: border-box; margin: 0 auto; padding: 16px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); box-shadow: var(--shadow); }
.decline-reason-page[hidden] { display: none; }
.decline-reason-page > .notice-dialog-title { margin: 0; }
.btn-go:disabled { cursor: default; }
.notice-dialog {
  position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: min(620px, calc(100vw - 28px)); max-height: min(82vh, 680px); margin: 0;
  overflow: auto; border: 1px solid var(--line); border-radius: 18px; outline: none; padding: 14px 54px 14px 18px;
  background: var(--surface); color: var(--fg); box-shadow: var(--shadow-raised);
}
.notice-dialog.notice-dialog-compact { width: min(480px, calc(100vw - 28px)); padding: var(--space-5); }
.notice-dialog-compact #notice-dialog-content { gap: var(--content-group-gap); }
.notice-dialog-compact .notice-dialog-title { margin: 0; padding-right: var(--space-6); font-size: 20px; line-height: 1.35; }
.notice-dialog-compact .notice-summary, .notice-dialog-compact .invitation-details { padding: var(--space-4); border: 1px solid var(--line); border-radius: var(--radius-card); background: var(--surface-2); }
.notice-dialog-compact .notice-summary { gap: var(--space-3); }
.notice-dialog-compact .notice-summary-row { grid-template-columns: 48px minmax(0, 1fr); gap: var(--space-3); line-height: 1.5; }
.notice-dialog-compact #notice-dialog-content > .nc-text { margin: 0; color: var(--fg); font-size: 14px; line-height: 1.6; }
.notice-dialog-compact .invitation-details { gap: var(--space-3); }
.notice-dialog-compact .invitation-details-title { margin: 0; font-size: 15px; }
.notice-dialog-compact .invitation-detail-row { grid-template-columns: minmax(78px, .8fr) minmax(0, 1.4fr); gap: var(--space-3); }
.notice-dialog-compact .invitation-details-list dd { line-height: 1.5; }
.notice-dialog:focus { outline: none; }
.notice-dialog::backdrop { background: #17212b66; }
.dialog-close { position: absolute; top: 9px; right: 11px; display: grid; place-items: center; width: 30px; height: 30px; padding: 0; border: 0; border-radius: 50%; outline: none; background: var(--surface-2); color: var(--muted); cursor: pointer; }
.dialog-close svg { display: block; width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-width: 1.8; }
.dialog-close:focus { outline: none; box-shadow: none; }
.dialog-close:focus-visible { outline: 2px solid var(--ask); outline-offset: 2px; }
.dialog-close:hover { color: var(--fg); background: var(--line); }
.notice-dialog-title { margin: 0 0 2px; font-size: 18px; line-height: 1.35; }
.invitation-details { display: grid; margin: 0; padding: 8px 0 0; border-top: 1px solid var(--line); }
.invitation-details-title { margin: 0 0 var(--field-control-gap); font-size: 14px; line-height: 1.4; font-weight: 800; }
.invitation-details-list { display: grid; gap: var(--space-3); margin: 0; font-size: 13px; line-height: 1.45; }
.invitation-detail-row { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.4fr); align-items: start; column-gap: var(--space-2); }
.invitation-details-list dt { min-width: 0; color: var(--muted); font-size: 13px; font-weight: 700; }
.invitation-details-list dd { min-width: 0; margin: 0; color: var(--fg); font-weight: 600; overflow-wrap: anywhere; }
.seg-btn[data-msg] { position: relative; }
.unread-dot { display: inline-block; width: 8px; height: 8px; margin-left: 6px; vertical-align: 1px; border-radius: 50%; background: #e5484d; }
.unread-dot[hidden] { display: none; }
.btn-go {
  justify-self: start; border: 0; background: var(--ask); color: #FFF8F3;
  border-radius: 10px; padding: 8px 16px; font-size: 13px; font-weight: 700; cursor: pointer;
}
.chat-item {
  display: flex; align-items: center; gap: 12px; width: 100%;
  border: 1px solid var(--line); background: var(--surface); border-radius: 14px;
  box-sizing: border-box; height: var(--message-card-height); overflow: hidden;
  padding: 10px 14px; margin-bottom: 10px; cursor: pointer; text-align: left;
}
.chat-row { position: relative; height: var(--message-card-height); margin-bottom: 10px; overflow: hidden; border-radius: var(--radius-card); background: var(--surface); }
.chat-row .chat-item { position: relative; z-index: 1; margin: 0; border-radius: var(--radius-card); transition: transform .24s cubic-bezier(.2,.75,.25,1); }
.chat-row.is-delete-open .chat-item { transform: translateX(calc(-1 * var(--message-delete-width))); }
.chat-row:has(.chat-delete:focus-visible) .chat-item { transform: translateX(calc(-1 * var(--message-delete-width))); }
.chat-delete {
  position: absolute; inset: 0 0 0 auto; display: flex; align-items: center; justify-content: center; gap: 7px;
  width: var(--message-delete-width); padding: 0 5px 0 11px; border: 0; border-radius: 15px 0 0 15px;
  background: linear-gradient(145deg, #e94e55, #d93643); color: #fff;
  font: inherit; font-size: 13px; font-weight: 800; cursor: pointer;
  box-shadow: inset 1px 0 0 rgba(255,255,255,.14);
}
.chat-delete::before {
  content: ""; position: absolute; left: -1px; top: 50%; width: 11px; height: 28px;
  transform: translateY(-50%); border-radius: 0 999px 999px 0;
  background: var(--surface); box-shadow: 2px 0 4px rgba(102, 24, 31, .12);
}
.chat-delete svg { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.chat-delete:focus-visible { outline: 2px solid #fff; outline-offset: -4px; }
.chat-delete:disabled { opacity: .7; cursor: wait; }
.list-delete-context-menu { position: fixed; z-index: 1000; left: 0; top: 0; width: max-content; min-width: 0; max-width: calc(100vw - 16px); box-sizing: border-box; padding: 4px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); box-shadow: 0 10px 28px rgba(12, 23, 39, .2); }
.list-delete-context-option { display: flex; align-items: center; justify-content: center; width: auto; min-height: 40px; padding: 0 14px; border: 0; border-radius: 8px; background: transparent; color: var(--danger); font: inherit; font-size: 14px; font-weight: 700; text-align: center; white-space: nowrap; cursor: pointer; }
.list-delete-context-option:hover, .list-delete-context-option:focus-visible { background: color-mix(in srgb, var(--danger) 9%, var(--surface)); outline: none; }
.chat-item.has-unread { border-color: color-mix(in srgb, #e5484d 35%, var(--line)); }
.ci-av {
  width: 42px; height: 42px; border-radius: 50%; flex: none;
  display: grid; place-items: center;
  background: var(--offer-soft); color: var(--offer-ink); font-size: 17px; font-weight: 900;
}
.ci-info { flex: 1; min-width: 0; display: grid; gap: 2px; }
.ci-unread-dot { flex: none; width: 10px; height: 10px; margin: 0 2px 0 8px; box-shadow: 0 0 0 2px var(--surface); }
.ci-name { font-size: 15px; font-weight: 900; }
.ci-last {
  font-size: 12px; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.chat-thread { display: flex; flex-direction: column; gap: 10px; padding: 2px 0 14px; }
.msg-line { display: flex; flex-direction: column; align-items: flex-start; }
.msg-line.me { align-items: flex-end; }
.bubble {
  max-width: 78%; padding: 10px 13px; border-radius: 16px;
  font-size: 14px; line-height: 1.55; word-break: break-word; white-space: pre-line;
}
.msg-line.me .bubble { background: var(--ask); color: #FFF8F3; border-bottom-right-radius: 5px; }
.msg-line.them .bubble { background: var(--surface); border: 1px solid var(--line); border-bottom-left-radius: 5px; }
.msg-time { font-size: 10px; color: var(--muted); margin-top: 3px; padding: 0 4px; }
.chat-image-link { display: block; min-height: 0; max-width: 78%; padding: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-2); color: inherit; text-align: left; cursor: pointer; }
.chat-image { display: block; width: auto; max-width: min(260px, 72vw); max-height: 360px; object-fit: contain; }
.chat-input {
  position: sticky; bottom: calc(env(safe-area-inset-bottom, 0px) + 64px);
  display: flex; gap: 8px; background: var(--bg); padding: 10px 0;
}
.chat-input input { flex: 1; }
.send {
  flex: none; width: 46px; border: 0; border-radius: 12px;
  background: var(--ask); color: #FFF8F3; font-size: 16px; cursor: pointer;
}

/* ---------- toast ---------- */
#toast {
  position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom,0px) + 34px);
  box-sizing: border-box; width: max-content; min-width: min(86vw, 320px); max-width: min(92vw, 560px); text-align: center;
  transform: translateX(-50%) translateY(6px);
  background: #2B2418; color: #FFF8F3; font-size: 14px;
  padding: 12px 22px; border-radius: 999px; box-shadow: var(--shadow);
  opacity: 0; pointer-events: none; transition: opacity .18s ease, transform .18s ease;
  z-index: 50;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* ---- 以下原為 <body> 內 #view-home 的覆寫 ---- */

      .hero h1 {
        font-size: clamp(32px, 5vw, 56px);
      }
      .hero .tag {
        font-size: clamp(14px, 2vw, 22px);
      }

body { background: var(--bg); letter-spacing: .01em; }
.wrap { max-width: 560px; padding-inline: 20px; }
#view-home { align-items: stretch; }
.hero { text-align: left; width: 100%; margin-bottom: 32px; }
.hero h1 { color: var(--fg); font-size: clamp(34px, 8vw, 46px); letter-spacing: -.04em; }
.hero .tag { margin: 10px 0 0; letter-spacing: 0; line-height: 1.7; }
.doorways { width: 100%; display: grid; grid-template-columns: 1fr; gap: 14px; }
.door { width: 100%; min-height: 130px; aspect-ratio: auto; border-radius: 22px; padding: 44px 24px 18px; align-items: flex-start; justify-content: center; flex-direction: column; gap: 5px; color: white; text-align: left; }
.door.ask { background: linear-gradient(120deg, var(--ask), var(--ask-deep)); box-shadow: 0 12px 26px -12px var(--glow-ask); }
.door.offer { background: linear-gradient(120deg, var(--offer), var(--offer-deep)); box-shadow: 0 12px 26px -12px var(--glow-offer); }
.door-icon { position: absolute; right: 22px; top: 18px; width: 38px; height: 38px; border: 1px solid rgba(255,255,255,.38); border-radius: 50%; display: grid; place-items: center; font-size: 22px; }
.door .chars { writing-mode: horizontal-tb; font-size: 20px; letter-spacing: 0; line-height: 1.4; }
.door-note { font-size: 13px; opacity: .85; }
.foot { text-align: left; width: 100%; margin-top: 22px; }
.page-head { gap: 14px; margin-bottom: 22px; }
.back { background: var(--surface); border: 1px solid var(--line); border-radius: 50%; width: 42px; height: 42px; font-size: 23px; }
.page-head h2 { font-size: 25px; letter-spacing: -.02em; }
.eyebrow { letter-spacing: .08em; margin-bottom: 3px; }
.lead { line-height: 1.75; }
.opt-list { gap: 10px; }
.opt { border: 1px solid var(--line); border-radius: 18px; padding: 16px; box-shadow: var(--shadow); }
.opt .mark { border-radius: 14px; }
.form { gap: var(--form-field-gap); }
.region-pin { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; }
.field { gap: var(--field-control-gap); }
.field label, .src-label { color: var(--fg); font-size: 14px; }
.field input, .field textarea { border-radius: var(--radius-control); border-color: var(--line); padding: 11px 14px; }
.date-range { display: grid; grid-template-columns: minmax(0, 1fr) 24px minmax(0, 1fr); align-items: center; gap: 8px; color: var(--muted); font-size: 14px; }
.date-range > span { min-width: 0; text-align: center; white-space: nowrap; }
input[type="date"]:not(:disabled) { cursor: pointer; }
.date-range input { display: block; box-sizing: border-box; min-width: 0; max-width: 100%; width: 100%; height: 48px; font-family: inherit; font-size: 16px; line-height: normal; color: var(--fg); background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 13px 10px; -webkit-appearance: none; appearance: none; }
.date-range input::-webkit-date-and-time-value { min-width: 0; text-align: left; }
.date-range input:focus { outline: none; border-color: var(--ask); box-shadow: 0 0 0 3px var(--ask-soft); }
.date-range input:disabled { border-color: var(--line); background: var(--surface-2); color: var(--muted); opacity: .55; cursor: not-allowed; }
.date-hint { margin-top: -2px; color: var(--muted); font-size: 12px; }
@media (max-width: 600px) {
  .date-range { grid-template-columns: minmax(0, 1fr) 32px minmax(0, 1fr); gap: 6px; }
  .date-range input { padding-inline: 8px; }
}
.reward-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 4px; border-radius: 14px; background: var(--surface-2); }
.reward-mode { border: 0; border-radius: 10px; background: transparent; color: var(--muted); padding: 10px 8px; font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; }
.reward-mode.on { color: var(--fg); background: var(--surface); box-shadow: 0 1px 4px rgba(23,43,77,.1); }
.reward-slider { display: grid; gap: 7px; padding: 12px 2px 0; }
.reward-value, .range-limits { display: flex; align-items: center; justify-content: space-between; }
.reward-value { color: var(--muted); font-size: 13px; }
.reward-value output { color: var(--fg); font-size: 19px; font-weight: 900; font-variant-numeric: tabular-nums; }
.reward-estimate { margin-left: auto; color: var(--muted); font-size: 11px; font-weight: 500; text-align: right; }
.product-value-field { margin: 2px 0 4px; }
.reward-currency-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.reward-currency-row label { color: var(--muted); font-size: 12px; }
.reward-currency-fixed { display: inline-flex; align-items: center; min-height: 42px; padding: 0 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--fg); font-size: 14px; }
.reward-amount-entry { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 0; min-height: 48px; overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.value-entry.reward-amount-entry { grid-template-columns: auto minmax(0, 1fr); gap: 0; }
.currency-prefix { padding: 0 0 0 14px; color: var(--muted); font-size: 15px; font-weight: 700; }
.reward-amount-entry input { box-sizing: border-box; width: 100%; min-width: 0; min-height: 48px; padding: 11px 13px; border: 0; border-radius: 0; outline: none; background: transparent; color: var(--fg); font: inherit; font-size: 16px; }
.formview.ask .field .reward-amount-entry input:focus,
.formview.offer .field .reward-amount-entry input:focus { border: 0; outline: none; box-shadow: none; }
input[type="number"] { -moz-appearance: textfield; appearance: textfield; }
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button { margin: 0; -webkit-appearance: none; }
.reward-amount-entry:focus-within { border-color: var(--ask); box-shadow: 0 0 0 3px var(--ask-soft); }
#mine-posts, #mine-settings { margin-top: var(--space-4); }
.my-posts { display: grid; gap: var(--content-group-gap); }
.content-stack { display: grid; gap: var(--content-group-gap); }
.profile-account-group { display: grid; gap: var(--space-3); }
#mine-settings { gap: var(--form-field-gap); }
.profile-card #pc-logout { position: absolute; top: 50%; right: 16px; transform: translateY(-50%); }
.profile-card .profile-heading { padding-right: 96px; }
.profile-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.profile-heading .section-title { margin: 0; }
.section-title { margin: 0; color: var(--fg); font-size: 18px; font-weight: 900; }
.my-posts-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.my-posts-head h3 { margin: 0; color: var(--fg); font-size: 19px; font-weight: 900; }
.my-posts-head > span { color: var(--muted); font-size: 12px; }
.post-filters { display: flex; flex-wrap: wrap; gap: 7px; width: fit-content; max-width: 100%; }
.post-filter { border: 1px solid var(--line); border-radius: 999px; padding: 6px 11px; background: var(--surface); color: var(--muted); font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; transition: color .12s ease, background .12s ease, border-color .12s ease; }
.post-filter.on { border-color: var(--ask); background: var(--ask-soft); color: var(--ask); }
.post-filter:focus-visible { outline: 2px solid var(--ask); outline-offset: 2px; }
.my-posts-gate { display: grid; gap: 12px; }
.my-posts-gate p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.6; }
.my-posts-gate .submit.primary { background: var(--ask); }
.my-posts-empty { margin: 0; padding: 18px; border: 1px dashed var(--line); border-radius: 16px; color: var(--muted); background: var(--surface); font-size: 13px; line-height: 1.7; }
#my-posts-list { display: grid; gap: 12px; }
.my-post-card { display: grid; gap: 7px; padding: 15px; border: 1px solid var(--line); border-radius: 17px; background: var(--surface); box-shadow: var(--shadow); }
.browse-post-card { display: grid; gap: 6px; padding: 16px 2px; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: transparent; box-shadow: none; }
.browse-post-card[role="button"] { cursor: pointer; }
.browse-post-card[role="button"]:focus-visible { outline: 2px solid var(--ask); outline-offset: -2px; }
.browse-detail-card { gap: 8px; margin-bottom: 14px; }
#browse-contact { width: 100%; }
#browse-post-list { display: block; }
.browse-post-card[role="button"]:hover { background: color-mix(in srgb, var(--surface-2) 45%, transparent); }
.browse-post-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.browse-post-author { min-width: 0; overflow: hidden; color: var(--fg); font-size: 13px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.browse-post-title { margin: 0; color: var(--fg); font-size: 16px; font-weight: 750; line-height: 1.45; overflow-wrap: anywhere; }
.browse-title-traveler { color: var(--offer-ink); }
.browse-title-requester { color: var(--ask-ink); }
.browse-post-title .browse-kind-label { color: inherit; font-size: inherit; font-weight: inherit; }
.browse-post-route { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.browse-ad-slot { padding: 16px 2px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.browse-ad-slot::before { content: "廣告"; display: block; margin-bottom: 6px; font-size: 11px; }
.home-steps, .browse-next-hint { margin: 12px 0; color: var(--muted); font-size: 14px; line-height: 1.7; }
.test-notice { margin: 14px 0 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--fg); font-size: 13px; line-height: 1.6; }
.browse-empty { display: grid; gap: 14px; padding: 20px; border: 1px solid var(--line); border-radius: var(--radius-card); background: var(--surface); }
.browse-empty p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.7; }
.browse-empty-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.browse-empty-actions .submit.offer { background: var(--offer); }
.browse-empty-actions .submit.offer:hover { background: var(--offer-deep); }
.browse-post-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.browse-post-head .mpc-title { min-width: 0; }
.browse-post-head .mpc-time { flex: none; }
.browse-post-note { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.browse-route-filter { display: grid; gap: var(--form-field-gap); margin: 0 0 var(--content-group-gap); padding: var(--space-4); border: 1px solid var(--line); border-radius: var(--radius-card); background: var(--surface); box-shadow: var(--shadow); }
.browse-route-fields { display: grid; grid-template-columns: minmax(0, 1fr) 18px minmax(0, 1fr) auto; grid-template-rows: auto var(--button-height-sm); align-items: center; column-gap: var(--space-1); row-gap: var(--field-control-gap); }
.browse-route-label { grid-row: 1; color: var(--muted); font-size: 12px; font-weight: 700; }
.browse-route-label[for="browse-origin"] { grid-column: 1; }
.browse-route-label[for="browse-destination"] { grid-column: 3; }
.browse-route-fields select { -webkit-appearance: none; appearance: none; box-sizing: border-box; grid-row: 2; width: 100%; min-width: 0; height: var(--button-height-sm); padding: 0 24px 0 8px; border: 1px solid var(--line); border-radius: var(--radius-control); background-color: var(--surface); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'%3E%3Cpath d='m1 1 4 4 4-4' fill='none' stroke='%2366758a' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); background-position: right 8px center; background-size: 10px 6px; background-repeat: no-repeat; color: var(--fg); font: inherit; font-size: 14px; }
.browse-route-fields select:focus-visible { border-color: var(--ask); box-shadow: 0 0 0 3px var(--ask-soft); }
#browse-origin { grid-column: 1; }
#browse-destination { grid-column: 3; }
.browse-route-arrow { display: grid; grid-column: 2; grid-row: 2; place-items: center; height: var(--button-height-sm); color: var(--muted); }
.browse-route-fields .browse-filter-trigger { grid-column: 4; grid-row: 2; align-self: center; height: var(--button-height-sm); min-width: 0; padding-inline: 8px; border-radius: var(--radius-control); gap: 5px; font-size: 12px; }
.browse-filter-toolbar { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); }
.browse-filter-toolbar h3 { margin: 0; color: var(--fg); font-size: 15px; font-weight: 800; }
.browse-filter-trigger { display: inline-flex; align-items: center; gap: var(--field-control-gap); min-height: var(--button-height-sm); padding: 0 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface-2); color: var(--fg); font: inherit; font-size: 13px; font-weight: 750; white-space: nowrap; cursor: pointer; }
.browse-filter-trigger::before { content: '☷'; color: var(--muted); font-size: 16px; line-height: 1; }
.browse-filter-trigger:focus-visible, .browse-filter-chip:focus-visible { outline: 2px solid var(--ask); outline-offset: 2px; }
.browse-filter-count { display: inline-grid; place-items: center; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 999px; background: var(--ask); color: #fff; font-size: 11px; font-weight: 800; }
.browse-filter-footer { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: var(--space-2); }
.browse-filter-footer #browse-filter-clear { margin-left: auto; }
.browse-filter-chips { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.browse-filter-chips:empty { display: none; }
.browse-filter-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 28px; padding: 0 9px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface-2); color: var(--fg); font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; }
.browse-filter-chip span { color: var(--muted); font-size: 15px; line-height: 1; }
.browse-filter-dialog { box-sizing: border-box; max-height: min(86vh, 760px); overflow: auto; padding: var(--space-4); }
.browse-filter-form { display: grid; gap: var(--form-field-gap); }
.browse-filter-heading { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); }
.auth-dialog.browse-filter-dialog .browse-filter-heading h3 { margin: 0; color: var(--fg); font-size: 20px; line-height: 1.3; font-weight: 800; }
.browse-filter-close { display: grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: 50%; background: var(--surface-2); color: var(--muted); font: inherit; font-size: 24px; line-height: 1; cursor: pointer; }
.browse-filter-close:hover, .browse-filter-close:focus-visible { outline: none; background: var(--line); color: var(--fg); }
.browse-filter-group { display: grid; gap: var(--section-heading-control-gap); min-width: 0; padding: var(--space-4); border: 1px solid var(--line); border-radius: var(--radius-card); background: var(--surface-2); }
.browse-filter-group h4 { margin: 0; color: var(--fg); font-size: 15px; font-weight: 800; line-height: 1.4; }
.browse-filter-type-groups { display: grid; gap: var(--form-field-gap); }
.browse-filter-type-group { display: grid; gap: var(--section-heading-control-gap); }
.auth-dialog.browse-filter-dialog .browse-filter-type-group > p { margin: 0; color: var(--muted); font-size: 13px; font-weight: 800; line-height: 1.4; }
.auth-dialog.browse-filter-dialog .browse-filter-type-group.is-requester > p { color: var(--ask-ink); }
.auth-dialog.browse-filter-dialog .browse-filter-type-group.is-traveler > p { color: var(--offer-ink); }
.browse-filter-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-2); }
.browse-filter-options label { display: flex; align-items: center; gap: var(--space-2); min-width: 0; min-height: var(--button-height-sm); padding: 0 11px; border: 1px solid var(--line); border-radius: var(--radius-control); background: var(--filter-option-surface); color: var(--fg); font-size: 14px; font-weight: 700; overflow-wrap: anywhere; cursor: pointer; }
.browse-filter-type-group.is-requester .browse-filter-options label:has(input:checked) { background: var(--ask-soft); color: var(--ask-ink); }
.browse-filter-type-group.is-traveler .browse-filter-options label:has(input:checked) { background: var(--offer-soft); color: var(--offer-ink); }
.browse-filter-options input { appearance: none; -webkit-appearance: none; flex: none; width: 18px; height: 18px; margin: 0; border: 1.5px solid var(--muted); border-radius: 5px; background-color: var(--surface-2); cursor: pointer; }
.browse-filter-options input:checked { border-color: var(--ask); background-color: var(--ask); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='m3 8 3.2 3.2L13 4.5' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); background-position: center; background-repeat: no-repeat; background-size: 14px; }
.browse-filter-type-group.is-traveler .browse-filter-options input:checked { border-color: var(--offer); background-color: var(--offer); }
.browse-filter-options input:focus-visible { outline: 2px solid var(--ask); outline-offset: 2px; }
.browse-filter-type-group.is-traveler .browse-filter-options input:focus-visible { outline-color: var(--offer); }
.browse-filter-type-group.is-traveler .browse-filter-options label:last-child { grid-column: 1 / -1; }
.browse-filter-help { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.browse-date-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--form-field-gap); min-width: 0; }
.browse-date-fields .field > span { color: var(--muted); font-size: 12px; font-weight: 700; }
.browse-date-fields input { display: block; max-width: 100%; padding: 8px 10px; font-size: 14px; -webkit-appearance: none; appearance: none; }
.browse-date-fields input::-webkit-date-and-time-value { min-width: 0; text-align: left; }
.browse-filter-actions { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-3); }
.browse-filter-actions > * { min-width: 0; }
.browse-filter-actions .submit { width: 100%; }
.browse-filter-actions #browse-filter-cancel { width: 100%; }
.auth-dialog.browse-filter-dialog { width: min(480px, calc(100vw - 32px)); padding: var(--space-4); }
.auth-dialog.browse-filter-dialog::backdrop { background: rgba(17, 27, 43, .48); }
@media (max-width: 600px) {
  .auth-dialog.browse-filter-dialog { width: 100%; max-width: none; max-height: min(90dvh, 800px); margin: auto 0 0; padding: var(--space-4) var(--space-4) calc(var(--space-4) + env(safe-area-inset-bottom, 0px)); border-radius: 22px 22px 0 0; }
  .browse-date-fields { grid-template-columns: minmax(0, 1fr); gap: var(--space-2); }
}
@media (max-width: 360px) {
  .browse-route-fields { grid-template-columns: minmax(0, 1fr) 18px minmax(0, 1fr); grid-template-rows: auto var(--button-height-sm) var(--button-height-sm); }
  .browse-route-fields .browse-filter-trigger { grid-column: 1 / -1; grid-row: 3; width: 100%; justify-content: center; }
}
.my-post-card.is-completed, .my-post-card.is-expired { background: var(--post-muted-surface); box-shadow: none; }
.mpc-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.mpc-badge { padding: 4px 10px; border-radius: 999px; background: var(--offer-soft); color: var(--offer-ink); font-size: 12px; font-weight: 900; }
.mpc-badge.ask { background: var(--ask-soft); color: var(--ask-ink); }
.mpc-status { margin-left: auto; padding: 4px 9px; border-radius: 999px; background: var(--surface-2); color: var(--muted); font-size: 12px; font-weight: 800; }
.mpc-stage { color: var(--muted); font-size: 12px; font-weight: 800; }
.match-progress-list { display: grid; gap: 16px; }
.match-progress-match { display: grid; gap: 10px; }
.match-progress-partner { margin: 0; color: var(--fg); font-size: 14px; font-weight: 800; }
.match-progress-track { display: flex; align-items: flex-start; padding: 0 2px; }
.match-progress-step { position: relative; z-index: 0; display: grid; flex: 1; justify-items: center; gap: 5px; min-width: 0; text-align: center; }
.match-progress-step::before { position: absolute; z-index: -1; top: 7px; right: 50%; width: 100%; height: 3px; background: var(--line); content: ''; }
.match-progress-step:first-child::before { display: none; }
.match-progress-step.reached::before { background: var(--ask); }
.match-progress-dot { width: 17px; height: 17px; border: 3px solid var(--line); border-radius: 50%; background: var(--surface); }
.match-progress-step.reached .match-progress-dot { border-color: var(--ask); background: var(--ask); }
.match-progress-label { display: flex; align-items: flex-start; justify-content: center; min-height: 2.5em; color: var(--muted); font-size: 11px; line-height: 1.3; white-space: pre-line; overflow-wrap: anywhere; }
.match-progress-step.reached .match-progress-label { color: var(--ask-ink); font-weight: 800; }
.mpc-time { color: var(--muted); font-size: 12px; }
.mpc-title { margin: 0; color: var(--fg); font-size: 16px; font-weight: 900; overflow-wrap: anywhere; }
.mpc-route { margin: 0; color: var(--muted); font-size: 13px; }
.mpc-details { display: grid; gap: 6px; margin: 2px 0 0; padding: 10px 0 0; border-top: 1px solid var(--line); list-style: none; color: var(--muted); font-size: 13px; line-height: 1.55; }
.mpc-details li { overflow-wrap: anywhere; }
.seg-btn[data-mine]:not(.on), .seg-btn[data-msg]:not(.on) { color: var(--muted); background: transparent; }
.seg-btn[data-mine].on, .seg-btn[data-msg].on { color: var(--ask); background: var(--surface); }
.reward-slider input[type="range"] { appearance: auto; display: block; width: 100%; height: 24px; margin: 5px 0; padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; accent-color: var(--ask); }
.range-limits { color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.value-entry { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.volume-inputs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.volume-inputs input { width: 100%; min-width: 0; padding: 12px 10px; text-align: center; }
.value-entry input { min-width: 0; }
.value-entry select { width: 160px; max-width: 52vw; min-width: 145px; padding: 0 30px 0 12px; border: 1px solid var(--line); border-radius: 14px; background-color: var(--surface); color: var(--fg); font: inherit; font-size: 14px; }
.value-entry select:focus { outline: none; border-color: var(--offer); box-shadow: 0 0 0 3px var(--offer-soft); }
.field input:focus-visible, .field textarea:focus-visible, .field select:focus-visible { border-color: var(--ask); box-shadow: 0 0 0 3px var(--ask-soft); }
.formview.ask .field input:focus-visible, .formview.ask .field textarea:focus-visible, .formview.ask .field select:focus-visible { border-color: var(--ask); box-shadow: 0 0 0 3px var(--ask-soft); }
.formview.offer .field input:focus-visible, .formview.offer .field textarea:focus-visible, .formview.offer .field select:focus-visible { border-color: var(--offer); box-shadow: 0 0 0 3px var(--offer-soft); }
.submit { border-radius: var(--radius-control); min-height: var(--button-height-md); box-shadow: var(--shadow); }
.btn-go:active, .send:active { transform: scale(.99); }
.tip, .profile-card, .notice-card, .chat-item, .my-post-card, .msg-empty { border-radius: var(--radius-card); }
.tabbar { background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(16px); border-top-color: var(--line); padding-top: 2px; }
.tab-btn { padding: 4px 0 5px; }
.tab-btn.on { color: var(--ask); }
.trip-form-fields { gap: var(--form-field-gap); }
.accepted-goods > label { color: var(--fg); font-size: 14px; font-weight: 700; }
.trip-route-field { gap: var(--field-control-gap); }
.trip-route-button { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; height: 48px; padding: 0 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--fg); text-align: left; font: inherit; font-size: 16px; cursor: pointer; }
.trip-route-value { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.trip-route-button .arrow { color: var(--muted); font-size: 22px; line-height: 1; }
.trip-type-field, .trip-direction-field { gap: var(--field-control-gap); }
.trip-type-options { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.trip-type-option { min-height: 48px; padding: 12px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--muted); font: inherit; font-size: 15px; font-weight: 700; cursor: pointer; }
.trip-type-option.on { border-color: var(--offer); background: var(--offer-soft); color: var(--offer-ink); }
.trip-direction-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.trip-direction-option { min-width: 0; min-height: 48px; padding: 10px 6px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--muted); font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; }
.trip-direction-option.on { border-color: var(--offer); background: var(--offer-soft); color: var(--offer-ink); }
#view-trip:not([hidden]) + #view-form-buy { margin-top: var(--form-field-gap); }
.trip-route-button:focus-visible { outline: 2px solid var(--offer); outline-offset: 2px; }
.formview.offer #trip-departure-date, .formview.offer #trip-return-date { width: 100%; min-width: 0; height: 48px; box-sizing: border-box; padding: 13px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--fg); font: inherit; font-size: 16px; }
.formview.offer #trip-departure-date:focus, .formview.offer #trip-return-date:focus { outline: none; border-color: var(--offer); box-shadow: 0 0 0 3px var(--offer-soft); }
.seg { padding: var(--seg-inset); background: var(--surface-2); border-radius: 14px; gap: 4px; }
#message-tabs.is-single { grid-template-columns: minmax(0, 1fr); }
.seg-btn { border: 0; background: transparent; border-radius: 11px; }
.seg-btn.on { background: var(--surface); box-shadow: 0 1px 4px rgba(23,43,77,.1); }
.mine-sections { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.mine-sections.account-only { grid-template-columns: minmax(0, 1fr); }
.mine-sections .seg-btn { text-align: center; }
@media (max-width: 380px) {
  .mine-sections .seg-btn { padding-inline: 4px; font-size: 13px; }
}
.msg-empty { background: var(--surface); border: 1px dashed var(--line); border-radius: 18px; margin-top: 14px; }
.msg-empty.message-auth-empty { padding: 0; background: transparent; border: 0; }
.message-auth-button { box-shadow: var(--shadow); }
@media (min-width: 600px) {
  #view-home { align-items: center; }
  .hero { text-align: center; }
  .hero .tag { margin-inline: auto; }
  .doorways { grid-template-columns: 1fr 1fr; }
  .door { min-height: 190px; }
  .foot { text-align: center; }
}


.auth-dialog {
  width: min(420px, calc(100vw - 32px));
  border: 1px solid var(--line, #e8e1d8);
  border-radius: 18px;
  padding: 24px;
  background: var(--surface);
  color: var(--fg);
  box-shadow: var(--shadow-raised);
}
.auth-dialog::backdrop { background: rgba(25, 22, 18, .38); }
.auth-dialog h3 { margin: 0 0 8px; color: var(--ask-ink); font-size: 19px; font-weight: 800; }
.auth-dialog p { margin: 0 0 20px; color: var(--muted, #77716a); }
.auth-dialog-actions { display: grid; gap: 10px; }
.auth-dialog .submit.primary { box-shadow: none; }
.auth-dialog .submit.primary:focus-visible {
  outline: 2px solid var(--ask);
  outline-offset: 3px;
}
.legal-register { display: grid; gap: var(--space-1); }
.legal-register .login-method-toggle { display: flex; align-items: center; justify-content: flex-start; gap: var(--space-2); margin: 0; padding: 4px 0; text-align: left; text-decoration: none; }
.legal-register .login-method-toggle::before { content: ''; display: grid; flex: none; width: 18px; height: 18px; place-items: center; border: 1px solid var(--line); border-radius: 4px; background: var(--surface); color: #fff; }
.legal-register .login-method-toggle.accepted::before { content: '✓'; border-color: var(--offer); background: var(--offer); font-size: 13px; font-weight: 900; line-height: 1; }
.legal-register .login-method-toggle > span { text-decoration: underline; }
.legal-register .login-method-toggle:focus-visible { outline: 2px solid var(--ask); outline-offset: 2px; border-radius: 4px; }
.login-secondary-actions { display: grid; justify-items: start; gap: var(--space-1); }
.login-secondary-actions .login-method-toggle { margin: 0; padding: 4px 0; text-align: left; }
.legal-register-status { color: var(--muted); font-size: 12px; }
.legal-register-status.accepted { color: var(--offer-ink); font-weight: 800; }
.legal-dialog {
  width: min(560px, calc(100vw - 32px)); max-height: min(86vh, 760px); overflow: auto;
  border: 1px solid var(--line); border-radius: 18px; padding: 24px;
  background: var(--surface); color: var(--fg); box-shadow: var(--shadow-raised);
}
.legal-dialog::backdrop { background: #17212b66; }
.legal-dialog h3 { margin: 0 0 6px; font-size: 16px; }
.legal-draft-note { margin: 0 0 14px; color: var(--muted); font-size: 14px; }
.legal-consent-body { display: grid; gap: 14px; max-height: 46vh; overflow: auto; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.legal-consent-body p { margin: 0 0 12px; font-size: 14px; line-height: 1.7; }
.legal-consent-body p:last-child { margin-bottom: 0; }
.legal-document-intro { margin: 0 !important; color: var(--fg); }
.legal-section { display: grid; gap: 4px; }
.legal-section-title { margin: 0; color: var(--fg); font-size: 16px; font-weight: 900; line-height: 1.6; }
.legal-section-items { display: grid; gap: 8px; margin: 0; padding-left: 1.6em; color: var(--fg); font-size: 14px; line-height: 1.7; }
.legal-section-subitems, .legal-section-notes { display: grid; gap: 4px; margin: 6px 0 0; padding-left: 1.5em; font-size: 14px; line-height: 1.7; }
.legal-section-intro, .legal-section-details p { margin: 0; color: var(--fg); font-size: 14px; line-height: 1.7; }
.legal-section-details { display: grid; gap: 2px; }
.legal-consent-check { display: flex; align-items: flex-start; gap: 9px; margin: 16px 0; font-size: 14px; line-height: 1.5; }
.legal-consent-check input { flex: none; width: 18px; height: 18px; margin: 0; accent-color: var(--ask); }
.legal-dialog .auth-dialog-actions { grid-template-columns: 1fr 1fr; }
.legal-dialog.read-only .auth-dialog-actions { grid-template-columns: 1fr; }
.legal-dialog .submit.primary:disabled { opacity: .48; cursor: not-allowed; }

/* Add scroll room only while the iPhone keyboard covers the auth form. */
.auth-keyboard-open .wrap {
  padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 96px + var(--auth-keyboard-space, 0px));
}

/* Modern chat composer */
.chat-input {
  z-index: 30;
  align-items: center;
  gap: 8px;
  margin: 12px 0 0;
  padding: 4px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  box-shadow: 0 6px 20px rgba(23, 43, 77, .08);
  backdrop-filter: blur(12px);
}
.chat-input input {
  flex: 1;
  min-width: 0;
  height: 36px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  outline: 0;
  background: transparent;
  color: var(--fg);
  font: inherit;
  font-size: 16px;
  box-shadow: none;
}
.chat-input input::placeholder { color: var(--muted); opacity: .85; }
.chat-input input:focus { border: 0; outline: 0; box-shadow: none; }
.chat-input:focus-within {
  border-color: color-mix(in srgb, var(--ask) 55%, var(--line));
  box-shadow: 0 0 0 3px var(--ask-soft), 0 6px 20px rgba(23, 43, 77, .08);
}
.chat-input .send {
  display: grid;
  place-items: center;
  flex: none;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: var(--ask);
  color: #fff;
  cursor: pointer;
  transition: background .15s ease, transform .15s ease;
}
.chat-input .send:hover { background: var(--ask-deep); }
.chat-input .send:disabled { opacity: .55; cursor: wait; }
.chat-input .send:focus-visible { outline: 2px solid var(--ask); outline-offset: 3px; }
.chat-input .send svg { width: 20px; height: 20px; }
.chat-input .chat-image-input { display: none; }
.chat-input .chat-more-button, .chat-input .chat-image-clear {
  display: grid; place-items: center; flex: none; width: 36px; height: 36px; padding: 0;
  border: 0; border-radius: 50%; background: var(--surface-2); color: var(--muted); cursor: pointer;
}
.chat-input .chat-more-button svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.chat-input .chat-more-button:hover, .chat-input .chat-image-clear:hover { color: var(--fg); background: var(--line); }
.chat-input .chat-more-button:focus-visible, .chat-input .chat-image-clear:focus-visible { outline: 2px solid var(--ask); outline-offset: 2px; }
.chat-more-menu { position: absolute; z-index: 1; left: var(--space-2); bottom: calc(100% + var(--space-2)); display: grid; gap: var(--space-1); min-width: max-content; padding: var(--space-1); border: 1px solid var(--line); border-radius: var(--radius-card); background: var(--surface); box-shadow: var(--shadow); }
.chat-more-menu[hidden] { display: none; }
.chat-more-option { display: flex; align-items: center; gap: var(--space-2); min-height: var(--button-height-sm); padding: 0 var(--space-3); border: 0; border-radius: var(--radius-control); background: transparent; color: var(--fg); font: inherit; font-size: var(--text-sm); text-align: left; cursor: pointer; }
.chat-more-option:hover, .chat-more-option:focus-visible { background: var(--surface-2); outline: none; }
.chat-more-option svg { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.chat-input .chat-image-name { max-width: 90px; overflow: hidden; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.chat-input .chat-image-name[hidden], .chat-input .chat-image-clear[hidden] { display: none; }
.chat-post-dialog { width: min(420px, calc(100vw - 32px)); max-height: 86vh; overflow: hidden; }
.chat-post-dialog[open] { display: grid; grid-template-rows: auto auto minmax(0, 1fr) auto; gap: var(--content-group-gap); }
.chat-post-dialog h3, .chat-post-dialog p { margin: 0; }
.chat-post-dialog h3 { padding-right: 36px; }
.chat-post-dialog > p { color: var(--muted); font-size: var(--text-sm); line-height: 1.5; }
.chat-post-list { display: grid; gap: var(--space-2); min-height: 0; overflow: auto; }
.chat-post-list[hidden], .chat-post-preview[hidden] { display: none; }
.chat-post-card { width: 100%; padding: 15px; color: var(--fg); font: inherit; text-align: left; cursor: pointer; }
.chat-post-card:hover, .chat-post-card:focus-visible { border-color: var(--ask); outline: none; }
.chat-post-preview { min-height: 0; overflow: auto; }
.chat-post-preview .mpc-details { overflow-wrap: anywhere; }
.chat-post-actions { grid-template-columns: 1fr 1fr; }
.chat-post-actions #chat-post-back[hidden] + #chat-post-send { grid-column: 1 / -1; }
.chat-post-actions .submit:disabled { opacity: .5; cursor: not-allowed; }
#chat-room {
  position: fixed;
  top: calc(env(safe-area-inset-top, 0px) + 20px);
  bottom: var(--chat-room-bottom-clearance);
  left: 50%;
  display: flex;
  flex-direction: column;
  width: min(520px, calc(100% - 32px));
  min-height: 0;
  padding-bottom: 0;
  transform: translateX(-50%);
}
#chat-room > .page-head { position: relative; display: grid; grid-template-columns: 42px minmax(0, 1fr) 42px; flex: none; }
#chat-room > .page-head .back { flex: none; }
#chat-room > .page-head > div { min-width: 0; }
#chat-room > .page-head h2 { min-width: 0; overflow-wrap: anywhere; }
.chat-room-more { display: grid; place-items: center; width: 42px; height: 42px; padding: 0; border: 1px solid var(--line); border-radius: 50%; background: var(--surface); color: var(--muted); cursor: pointer; }
.chat-room-more svg { width: 20px; height: 20px; fill: currentColor; }
.chat-room-more:hover { color: var(--fg); background: var(--surface-2); }
.chat-room-more:focus-visible { outline: 2px solid var(--ask); outline-offset: 2px; }
.chat-room-menu { position: absolute; z-index: 2; top: calc(100% - var(--space-2)); right: 0; display: grid; min-width: max-content; padding: var(--space-1); border: 1px solid var(--line); border-radius: var(--radius-card); background: var(--surface); box-shadow: var(--shadow); }
.chat-room-menu[hidden] { display: none; }
.chat-room-menu-option { min-height: var(--button-height-sm); padding: 0 var(--space-3); border: 0; border-radius: var(--radius-control); background: transparent; color: var(--danger); font: inherit; text-align: left; cursor: pointer; }
.chat-room-menu-option:hover, .chat-room-menu-option:focus-visible { background: var(--surface-2); outline: none; }
.chat-report-dialog { width: min(420px, calc(100vw - 32px)); }
.chat-report-dialog h3 { margin: 0 36px 0 0; }
.chat-report-dialog > p { margin: 0; color: var(--muted); font-size: var(--text-sm); line-height: 1.6; }
.chat-report-form { display: grid; gap: var(--form-field-gap); margin-top: var(--content-group-gap); }
.chat-report-field { display: grid; gap: var(--field-control-gap); color: var(--fg); font-size: var(--text-sm); font-weight: 700; }
.chat-report-field select, .chat-report-field textarea { width: 100%; min-width: 0; box-sizing: border-box; padding: var(--space-3); border: 1px solid var(--line); border-radius: var(--radius-control); background-color: var(--surface); color: var(--fg); font: inherit; }
.chat-report-field select { -webkit-appearance: none; appearance: none; padding-right: 42px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'%3E%3Cpath d='m1 1 4 4 4-4' fill='none' stroke='%2366758a' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); background-position: right 14px center; background-size: 10px 6px; background-repeat: no-repeat; }
.chat-report-field textarea { resize: vertical; }
.chat-report-error { margin: 0; color: var(--danger); font-size: var(--text-sm); }
.chat-report-actions { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-2); }
.chat-report-actions .submit { min-height: var(--button-height-md); }
#chat-thread { display:flex; flex: 1; flex-direction:column; gap:10px; min-height:0; overflow-y:auto; overscroll-behavior:contain; padding:2px 0 14px; }
.msg-read-status { align-self:flex-end; color:var(--muted); font-size:11px; }
.chat-first-message-hint { align-self:center; margin:auto; padding:10px 14px; border-radius:12px; background:var(--surface-2); color:var(--muted); font-size:13px; text-align:center; }
.chat-input {
  position: relative;
  left: auto;
  right: auto;
  bottom: auto;
  flex: none;
  width: 100%;
  margin: 0;
  transform: none;
}
.mpc-actions { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 4px; }
.mpc-action { border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; background: var(--surface); color: var(--fg); font: inherit; font-size: 12px; font-weight: 750; cursor: pointer; }
.mpc-action:hover { border-color: var(--ask); color: var(--ask); }
.mpc-action.danger { color: #a34836; }
.mpc-action.danger:hover { border-color: #a34836; }
.post-status-filter { display: block; width: fit-content; max-width: 100%; min-width: 0; }
.post-status-filter select { appearance: none; -webkit-appearance: none; display: block; width: 112px; max-width: 100%; min-width: 0; min-height: 40px; box-sizing: border-box; padding: 8px 36px 8px 12px; border: 1px solid var(--line); border-radius: 12px; background-color: var(--surface); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='m1 1 5 5 5-5' fill='none' stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; background-size: 12px 8px; color: var(--fg); font: inherit; font-size: 13px; cursor: pointer; }
.post-filter-level { display: grid; gap: var(--section-heading-control-gap); }

/* Clear hierarchy for the two starting paths. */
#view-home { min-height: 0; justify-content: flex-start; align-items: stretch; padding-top: 8px; }
.hero { width: 100%; margin: 0 0 28px; text-align: left; }
.home-brand { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 44px; color: var(--fg); font-size: 14px; font-weight: 700; }
.home-brand > span > span { color: var(--muted); font-weight: 500; }
.home-beta { padding: 4px 9px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: 12px; white-space: nowrap; }
.hero h1 { color: var(--fg); font-size: clamp(28px, 7.5vw, 36px); line-height: 1.3; letter-spacing: -.03em; }
.hero .tag { margin: 12px 0 0; color: var(--muted); font-size: 15px; line-height: 1.6; }
.doorways { display: grid; grid-template-columns: 1fr; gap: 12px; }
.door { position: relative; display: grid; justify-content: stretch; gap: 4px; width: 100%; min-height: 0; padding: 20px 56px 20px 20px; border: 1px solid var(--line); border-radius: var(--radius-card); background: var(--surface); color: var(--fg); box-shadow: none; text-align: left; }
.door.ask, .door.offer { background: var(--surface); box-shadow: none; }
.door:hover { border-color: var(--muted); }
.door-role { position: static; width: fit-content; padding: 0; border: 0; border-radius: 0; color: var(--ask-ink); font-size: 12px; letter-spacing: 0; }
.door.offer .door-role { color: var(--offer-ink); }
.door .chars { color: var(--fg); font-size: 19px; font-weight: 700; line-height: 1.4; }
.door-note { color: var(--muted); font-size: 14px; line-height: 1.5; opacity: 1; }
.door-icon { top: 50%; right: 20px; width: 34px; height: 34px; transform: translateY(-50%); border: 0; background: var(--surface-2); color: var(--fg); font-size: 18px; }
.home-test-note { margin: 22px 0 0; color: var(--fg); font-size: 13px; line-height: 1.6; }
.home-steps { margin: 12px 0 0; color: var(--muted); font-size: 13px; line-height: 1.7; }
.home-steps span { padding: 0 2px; }
@media (min-width: 600px) {
  #view-home { align-items: stretch; }
  .hero { text-align: left; }
  .hero .tag { margin-left: 0; }
  .doorways { grid-template-columns: 1fr; }
  .door { min-height: 0; }
}

/* Action colors use white text with sufficient contrast in either theme. */
.submit, .formview.ask .submit, .my-posts-gate .submit.primary, .btn-go { background: #a83e2e; color: #fff; box-shadow: none; }
.submit:not(:disabled):hover, .formview.ask .submit:not(:disabled):hover { background: #8e3326; }
.formview.offer .submit { background: #21685f; color: #fff; }
.formview.offer .submit:not(:disabled):hover { background: #19554e; }
.btn-go { min-height: 40px; font-size: 14px; }
.btn-go:focus-visible { outline: 2px solid var(--fg); outline-offset: 3px; }
.my-post-card, .opt { box-shadow: none; }
.browse-post-note { font-size: 14px; line-height: 1.6; }
.post-filter { min-height: 40px; font-size: 14px; }
.post-filter.on { color: var(--ask-ink); }
.support-email { display: inline-flex; align-items: center; min-height: 44px; text-decoration: underline; text-underline-offset: 3px; }
#view-mine > .page-head, #view-messages > .page-head { margin-bottom: calc(var(--section-heading-control-gap) - var(--seg-inset)); }
#view-browse > .page-head { margin-bottom: var(--section-heading-control-gap); }
.my-posts-toolbar { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); width: 100%; }
.my-posts-count-wrap { margin-left: auto; color: var(--muted); font-size: 12px; }
.mpc-status-detail { margin: -2px 0 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.product-photo-preview, .product-photo-gallery, .invitation-product-photos { display: flex; flex-wrap: wrap; gap: 10px; }
.product-photo-preview { margin-top: 2px; }
.product-photo-tile { position: relative; width: 92px; height: 92px; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.product-photo-tile img, .product-photo-gallery img, .invitation-product-photos img { display: block; width: 100%; height: 100%; object-fit: cover; }
.product-photo-remove { position: absolute; top: 4px; right: 4px; display: grid; width: 24px; height: 24px; place-items: center; border: 0; border-radius: 50%; background: rgba(18, 28, 43, .82); color: #fff; font-size: 18px; line-height: 1; cursor: pointer; }
.product-photo-gallery { margin: 10px 0; }
.product-photo-gallery button, .invitation-product-photos button { display: block; width: 76px; height: 76px; overflow: hidden; padding: 0; border: 0; border-radius: 10px; background: var(--surface-2); cursor: pointer; }
.invitation-product-photos { margin-top: var(--form-field-gap); }
.invitation-product-photos button { width: 88px; height: 88px; }
.product-photo-viewer { position: fixed; top: 50%; left: 50%; grid-template-columns: 42px minmax(0, 1fr) 42px; grid-template-rows: minmax(100px, 1fr) auto; align-items: center; justify-items: center; gap: 10px; width: min(720px, calc(100vw - 28px)); max-height: min(86vh, 760px); margin: 0; padding: 42px 16px 14px; transform: translate(-50%, -50%); overflow: visible; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); color: var(--fg); box-shadow: var(--shadow-raised); }
.product-photo-viewer.chat-photo-viewer { grid-template-columns: 34px minmax(0, 1fr) 34px; gap: 8px; width: min(540px, calc(100vw - 40px)); max-height: min(72vh, 600px); padding: 38px 12px 12px; }
.product-photo-viewer:not([open]) { display: none; }
.product-photo-viewer[open] { display: grid; }
.product-photo-viewer::backdrop { background: #17212b99; }
.product-photo-viewer > img { grid-column: 2; grid-row: 1; display: block; max-width: 100%; max-height: min(70vh, 620px); object-fit: contain; touch-action: pan-y; user-select: none; -webkit-user-drag: none; }
.product-photo-viewer.chat-photo-viewer > img { max-height: min(58vh, 480px); }
.product-photo-viewer .dialog-close { z-index: 1; top: 8px; right: 8px; font-size: 22px; line-height: 1; }
.product-photo-viewer .dialog-close:focus, .product-photo-viewer .dialog-close:focus-visible { outline: none; box-shadow: none; }
.product-photo-viewer-nav { grid-row: 1; display: grid; width: 38px; height: 38px; place-items: center; padding: 0; border: 1px solid var(--line); border-radius: 50%; background: var(--surface-2); color: var(--fg); font-size: 28px; line-height: 1; cursor: pointer; }
.chat-photo-viewer .product-photo-viewer-nav { width: 32px; height: 32px; font-size: 24px; }
.product-photo-viewer-nav.previous { grid-column: 1; }
.product-photo-viewer-nav.next { grid-column: 3; }
.product-photo-viewer-position { grid-column: 1 / -1; grid-row: 2; margin: 0; color: var(--muted); font-size: 12px; }
.site-version { padding: 8px 16px calc(72px + env(safe-area-inset-bottom)); color: var(--muted); font-size: 11px; text-align: center; }
