/* Jobtag — styles */
:root {
  --bg: #F5F6F2;
  --surface: #FFFFFF;
  --surface-2: #EEF1EC;
  --text: #15201B;
  --muted: #5D6A63;
  --line: #E0E5DE;
  --brand: #0E8A6A;
  --brand-strong: #0A6F55;
  --brand-soft: #DDF2EA;
  --brand-ink: #FFFFFF;
  --accent: #F2643A;
  --accent-soft: #FFE8DF;
  --ok: #1B8A4E; --ok-soft: #DDF4E6;
  --warn: #A66F00; --warn-soft: #FFF1CC;
  --bad: #8B9590; --bad-soft: #F0F2EF;
  --hi: #12966F; --mid: #D99A00; --lo: #B7BFBA;
  /* tag categories */
  --c-skill-bg: #E6EDFF; --c-skill: #2848A6;
  --c-exp-bg: #F0E7FF; --c-exp: #6A3DB5;
  --c-edu-bg: #E3F1FB; --c-edu: #1D5F8C;
  --c-lang-bg: #DFF4F1; --c-lang: #0E6C63;
  --c-person-bg: #F3EFE7; --c-person: #6A583A;
  --c-trait-bg: #FFEEDD; --c-trait: #95500F;
  --c-deal-bg: #E3F4EA; --c-deal: #17704A;
  --c-money-bg: #FFF4CF; --c-money: #7F5E00;
  --c-other-bg: #EEF0EE; --c-other: #4A5550;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(20, 32, 27, .05), 0 6px 20px rgba(20, 32, 27, .05);
  --font: 'Anuphan', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --display: 'Prompt', 'Anuphan', system-ui, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0F1513; --surface: #171F1C; --surface-2: #1E2824; --text: #E6EDE9; --muted: #98A7A0; --line: #2A3631;
    --brand: #2FC195; --brand-strong: #5AD6AE; --brand-soft: #173A30; --brand-ink: #062019;
    --accent: #FF8A63; --accent-soft: #3A2219;
    --ok: #5CD394; --ok-soft: #173424; --warn: #F2C04D; --warn-soft: #3A2E10; --bad: #7E8B85; --bad-soft: #1E2622;
    --hi: #2FC195; --mid: #E6B23A; --lo: #4A5752;
    --c-skill-bg: #1D2747; --c-skill: #A9BDFF; --c-exp-bg: #2B2143; --c-exp: #CDB4FF; --c-edu-bg: #16293A; --c-edu: #9ED0F2;
    --c-lang-bg: #13302C; --c-lang: #8BE0D4; --c-person-bg: #2C271F; --c-person: #DCC8A5; --c-trait-bg: #36261A; --c-trait: #F3BE8A;
    --c-deal-bg: #16301F; --c-deal: #92DDB0; --c-money-bg: #332A10; --c-money: #F0CF6A; --c-other-bg: #222B27; --c-other: #B7C2BC;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0F1513; --surface: #171F1C; --surface-2: #1E2824; --text: #E6EDE9; --muted: #98A7A0; --line: #2A3631;
  --brand: #2FC195; --brand-strong: #5AD6AE; --brand-soft: #173A30; --brand-ink: #062019;
  --accent: #FF8A63; --accent-soft: #3A2219;
  --ok: #5CD394; --ok-soft: #173424; --warn: #F2C04D; --warn-soft: #3A2E10; --bad: #7E8B85; --bad-soft: #1E2622;
  --hi: #2FC195; --mid: #E6B23A; --lo: #4A5752;
  --c-skill-bg: #1D2747; --c-skill: #A9BDFF; --c-exp-bg: #2B2143; --c-exp: #CDB4FF; --c-edu-bg: #16293A; --c-edu: #9ED0F2;
  --c-lang-bg: #13302C; --c-lang: #8BE0D4; --c-person-bg: #2C271F; --c-person: #DCC8A5; --c-trait-bg: #36261A; --c-trait: #F3BE8A;
  --c-deal-bg: #16301F; --c-deal: #92DDB0; --c-money-bg: #332A10; --c-money: #F0CF6A; --c-other-bg: #222B27; --c-other: #B7C2BC;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.6 var(--font); overflow-x: hidden; }
h1, h2, h3 { font-family: var(--display); line-height: 1.25; margin: 0 0 .4em; letter-spacing: -.01em; }
h1 { font-size: clamp(1.6rem, 3.2vw, 2.2rem); }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 .6em; }
a { color: var(--brand-strong); }
button, input, select, textarea { font: inherit; color: inherit; }
.muted { color: var(--muted); }
.sm { font-size: .86rem; }
.grow { flex: 1; min-width: 0; }
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 16px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 12px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 8px; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 55%, transparent); outline-offset: 2px; }

.ic { width: 1em; height: 1em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: -.14em; flex: none; }

/* ---------- top bar ---------- */
.topbar { position: sticky; top: 0; z-index: 1000; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.topbar-in { display: flex; align-items: center; gap: 16px; min-height: 60px; flex-wrap: wrap; }
.logo { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--text); font: 700 1.3rem var(--display); }
.logo svg { width: 30px; height: 30px; }
.logo svg rect { fill: var(--brand); }
.logo svg path { fill: none; stroke: var(--brand-ink); stroke-width: 2.4; stroke-linejoin: round; }
.logo svg circle { fill: var(--brand-ink); }
.logo b { color: var(--brand); }
.nav { display: flex; gap: 4px; flex: 1; overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav a { padding: 7px 12px; border-radius: 999px; text-decoration: none; color: var(--muted); font-weight: 500; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.nav a:hover { background: var(--surface-2); color: var(--text); }
.nav a.on { background: var(--brand-soft); color: var(--brand-strong); }
.badge { background: var(--accent); color: #fff; border-radius: 999px; font-size: .72rem; min-width: 18px; height: 18px; padding: 0 5px; display: inline-grid; place-items: center; font-weight: 700; }
.acct { display: flex; align-items: center; gap: 8px; font-size: .85rem; color: var(--muted); }
.acct select { max-width: 200px; }
.bell { position: relative; display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; color: var(--text); font-size: 1.2rem; }
.bell:hover, .bell.on { background: var(--surface-2); }
.bell .badge { position: absolute; top: 1px; right: -2px; }
.me-link { display: flex; align-items: center; gap: 6px; text-decoration: none; color: var(--text); font-weight: 600; }
select, input[type="text"], input:not([type]), input[type="tel"], input[type="email"], input[type="number"], input[type="date"], input[type="time"], textarea {
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; width: 100%;
}
select { width: auto; }
textarea { resize: vertical; }
@media (max-width: 760px) {
  .topbar-in { gap: 8px; padding-top: 8px; }
  .nav { order: 3; flex-basis: 100%; padding-bottom: 8px; }
  .acct { margin-left: auto; }
  .acct .who-l, .acct .pill, .me-link span { display: none; }
  .acct select { max-width: 140px; }
}

/* ---------- basics ---------- */
main { padding-top: 24px; padding-bottom: 40px; min-height: 70vh; outline: none; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--text); text-decoration: none; font-weight: 600; cursor: pointer; transition: background .15s, transform .1s; white-space: nowrap; }
.btn:hover { background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn.primary:hover { background: var(--brand-strong); }
.btn.on { background: var(--brand-soft); color: var(--brand-strong); border-color: transparent; }
.btn.mutual { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.ghost { background: transparent; }
.btn.sm { padding: 6px 12px; font-size: .88rem; }
.btn.xs { padding: 3px 10px; font-size: .8rem; }
.btn.lg { padding: 12px 20px; font-size: 1rem; }
.icon-btn { border: 0; background: transparent; padding: 6px; border-radius: 8px; cursor: pointer; color: var(--muted); }
.icon-btn:hover { background: var(--surface-2); color: var(--accent); }
.link { background: none; border: 0; padding: 0; color: var(--brand-strong); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.link.on { font-weight: 700; text-decoration: none; }
.pill { display: inline-flex; align-items: center; gap: 4px; font-size: .75rem; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); color: var(--muted); white-space: nowrap; vertical-align: middle; }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.brand { background: var(--brand-soft); color: var(--brand-strong); }
.pill.hot { background: var(--accent-soft); color: var(--accent); }
.pill.urgent { background: var(--accent); color: #fff; }
.verified { color: var(--brand); }
.page-head { margin-bottom: 18px; }
.sec-title { margin: 26px 0 12px; }
.empty { text-align: center; padding: 36px 20px; }
.empty-line { padding: 14px 0 6px; }
.back { display: inline-block; margin-bottom: 12px; text-decoration: none; }
.hint { font-size: .84rem; color: var(--muted); margin: 8px 0 0; }
.note { font-size: .84rem; background: var(--warn-soft); color: var(--warn); border-radius: 10px; padding: 8px 10px; margin: 8px 0 0; }
.warn { font-size: .85rem; color: var(--accent); background: var(--accent-soft); border-radius: 10px; padding: 6px 10px; margin-top: 10px; }
.warn.soft { color: var(--warn); background: var(--warn-soft); }
.check { display: flex; gap: 8px; align-items: center; font-size: .9rem; cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--brand); }

/* ---------- avatar / chips / ring ---------- */
.avatar { --h: 160; width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; flex: none; font: 700 1.15rem var(--display); color: hsl(var(--h) 45% 28%); background: hsl(var(--h) 60% 88%); }
.avatar.logo { background: var(--surface-2); font-size: 1.5rem; }
.avatar.lg { width: 72px; height: 72px; border-radius: 20px; font-size: 1.8rem; }
.avatar.lg.logo { font-size: 2.2rem; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .avatar:not(.logo) { color: hsl(var(--h) 70% 82%); background: hsl(var(--h) 30% 24%); } }
:root[data-theme="dark"] .avatar:not(.logo) { color: hsl(var(--h) 70% 82%); background: hsl(var(--h) 30% 24%); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 999px; font-size: .84rem; font-weight: 500; line-height: 1.5; border: 1px solid transparent; background: var(--c-other-bg); color: var(--c-other); white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.chip .must { color: var(--accent); display: inline-flex; }
.chip .must .ic { fill: currentColor; }
.cat-skill { background: var(--c-skill-bg); color: var(--c-skill); }
.cat-exp { background: var(--c-exp-bg); color: var(--c-exp); }
.cat-edu { background: var(--c-edu-bg); color: var(--c-edu); }
.cat-lang { background: var(--c-lang-bg); color: var(--c-lang); }
.cat-person { background: var(--c-person-bg); color: var(--c-person); }
.cat-trait { background: var(--c-trait-bg); color: var(--c-trait); }
.cat-deal { background: var(--c-deal-bg); color: var(--c-deal); }
.cat-money { background: var(--c-money-bg); color: var(--c-money); }
.cat-other { background: var(--c-other-bg); color: var(--c-other); }
.st-yes { background: var(--ok-soft); color: var(--ok); border-color: color-mix(in srgb, var(--ok) 25%, transparent); }
.st-partial { background: var(--warn-soft); color: var(--warn); border-color: color-mix(in srgb, var(--warn) 25%, transparent); }
.st-unknown { background: transparent; color: var(--muted); border: 1px dashed var(--line); }
.st-no { background: var(--bad-soft); color: var(--bad); text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--bad) 60%, transparent); }
.chip.add { cursor: pointer; background: transparent; border: 1px dashed var(--line); color: var(--muted); }
.chip.add:hover { border-color: var(--brand); color: var(--brand-strong); }

.ring { --p: 0; --c: var(--lo); width: 58px; height: 58px; border-radius: 50%; flex: none; display: grid; place-items: center; background: conic-gradient(var(--c) calc(var(--p) * 1%), var(--surface-2) 0); }
.ring.hi { --c: var(--hi); } .ring.mid { --c: var(--mid); } .ring.lo { --c: var(--lo); }
.ring span { width: calc(100% - 10px); height: calc(100% - 10px); border-radius: 50%; background: var(--surface); display: grid; place-items: center; font: 700 1.05rem var(--display); }
.ring small { font-size: .6em; margin-left: 1px; }
.ring span { display: flex; align-items: center; justify-content: center; }
.ring.big { width: 104px; height: 104px; }
.ring.big span { width: calc(100% - 16px); height: calc(100% - 16px); font-size: 1.8rem; }

.bars { display: grid; gap: 6px; margin: 12px 0 4px; }
.bar-l { display: flex; justify-content: space-between; font-size: .8rem; color: var(--muted); }
.bar-l b { color: var(--text); }
.bar-t { height: 6px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.bar-t i { display: block; height: 100%; border-radius: 99px; background: var(--lo); }
.bar-t i.hi { background: var(--hi); } .bar-t i.mid { background: var(--mid); }

/* ---------- home ---------- */
.hero { display: grid; grid-template-columns: 1.1fr 1fr; gap: 32px; align-items: center; padding: 20px 0 36px; }
.eyebrow { display: inline-flex; gap: 6px; align-items: center; font-size: .85rem; font-weight: 600; color: var(--brand-strong); background: var(--brand-soft); padding: 4px 12px; border-radius: 999px; margin-bottom: 14px; }
.hero h1 { font-size: clamp(2rem, 5vw, 3.3rem); line-height: 1.15; }
.hero h1 em { font-style: normal; color: var(--brand); }
.lead { font-size: 1.05rem; color: var(--muted); line-height: 2; }
.lead .chip { vertical-align: middle; }
.cta { display: flex; gap: 10px; flex-wrap: wrap; margin: 20px 0 10px; }
.play { display: grid; gap: 10px; }
.play-head { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; align-items: baseline; }
.play-out { display: flex; gap: 18px; align-items: center; padding-top: 10px; border-top: 1px solid var(--line); }
.play-out .bars { flex: 1; margin: 0; }
.field { display: grid; gap: 4px; font-size: .88rem; }
.field > span { color: var(--muted); font-weight: 500; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 40px; }
.step .num { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 10px; background: var(--brand); color: var(--brand-ink); font-weight: 700; margin-bottom: 10px; }
.step p, .feature p { color: var(--muted); font-size: .92rem; margin: 0; }
.features h2 { margin-bottom: 16px; }
.fgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.feature { padding: 18px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }
.f-ic { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand-strong); font-size: 1.2rem; margin-bottom: 10px; }
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; }
  .steps, .fgrid { grid-template-columns: 1fr; }
}

/* ---------- search ---------- */
.search-grid { display: grid; grid-template-columns: 330px minmax(0, 1fr); gap: 18px; align-items: start; }
.side { display: grid; gap: 14px; position: sticky; top: 76px; max-height: calc(100vh - 90px); overflow: auto; padding-bottom: 4px; scrollbar-width: thin; }
.me-row { display: flex; gap: 10px; align-items: center; margin-bottom: 12px; }
.lbl { font-size: .8rem; font-weight: 600; color: var(--muted); margin: 10px 0 6px; text-transform: uppercase; letter-spacing: .02em; display: block; }
.me-card select { width: 100%; }
.controls { display: grid; gap: 16px; }
.ctl-head { display: flex; justify-content: space-between; align-items: baseline; font-weight: 600; font-size: .92rem; }
.ctl-head b { color: var(--brand-strong); font-family: var(--display); font-size: 1.1rem; }
input[type="range"] { width: 100%; accent-color: var(--brand); margin: 8px 0 4px; }
.quick { display: flex; gap: 6px; flex-wrap: wrap; }
.quick button, .seg button { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 3px 10px; font-size: .8rem; cursor: pointer; }
.quick button:hover { border-color: var(--brand); }
.seg { display: flex; background: var(--surface-2); border-radius: 999px; padding: 3px; }
.seg button { flex: 1; border: 0; background: transparent; padding: 5px 8px; }
.seg button.on { background: var(--surface); color: var(--brand-strong); font-weight: 600; box-shadow: var(--shadow); }
.tips h3 { font-size: .98rem; display: flex; align-items: center; gap: 6px; color: var(--brand-strong); }
.tip-list { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 8px; }
.tip-list li { display: flex; align-items: center; gap: 8px; }
.tip-list li > div { flex: 1; min-width: 0; font-size: .85rem; }
.gain { font-weight: 700; font-size: .82rem; color: var(--ok); white-space: nowrap; }
.map-card { padding: 0; overflow: hidden; }
.map { height: 340px; width: 100%; background: var(--surface-2); position: relative; z-index: 0; isolation: isolate; }
.map.small { height: 260px; border-radius: 12px; margin-top: 10px; border: 1px solid var(--line); }
.map-fallback { height: 100%; display: grid; place-items: center; text-align: center; color: var(--muted); padding: 20px; }
.rhead { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; align-items: center; margin: 16px 2px 12px; }
.rcount b { font: 700 1.4rem var(--display); color: var(--brand-strong); }
.rhints { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; font-size: .88rem; }
.results { display: grid; gap: 12px; }
@media (max-width: 900px) {
  .search-grid { grid-template-columns: 1fr; }
  .side { position: static; max-height: none; overflow: visible; }
  .map { height: 260px; }
}

/* result card */
.result { transition: box-shadow .2s, border-color .2s; }
.result.is-mutual { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.result.flash { animation: flash 1.2s ease; }
@keyframes flash { 0%, 100% { box-shadow: var(--shadow); } 30% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 40%, transparent); } }
.r-top { display: flex; gap: 12px; align-items: flex-start; }
.r-title { flex: 1; min-width: 0; }
.r-title h3 { margin: 0; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.sub { color: var(--muted); font-size: .9rem; }
.r-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; color: var(--muted); font-size: .84rem; margin-top: 10px; }
.r-meta > span { display: inline-flex; gap: 5px; align-items: center; }
.crow { display: grid; grid-template-columns: 112px 1fr; gap: 8px; margin-top: 8px; align-items: start; }
.crow-l { font-size: .78rem; color: var(--muted); padding-top: 4px; font-weight: 600; }
.r-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.contact { margin-top: 12px; background: var(--accent-soft); color: var(--text); border-radius: 12px; padding: 10px 12px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: .92rem; }
.contact .ic { color: var(--accent); }
.contact .dot { width: 4px; height: 4px; border-radius: 50%; background: var(--muted); margin: 0 6px; }
@media (max-width: 560px) {
  .crow { grid-template-columns: 1fr; gap: 4px; }
  .ring { width: 50px; height: 50px; }
}

/* map markers */
.mk { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font: 700 12px var(--display); color: #fff; background: var(--lo); border: 2px solid #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, .25); cursor: pointer; }
.mk.hi { background: var(--hi); } .mk.mid { background: var(--mid); } .mk.lo { background: #8C9892; }
.mk-me { width: 22px; height: 22px; border-radius: 50%; background: color-mix(in srgb, var(--accent) 30%, transparent); display: grid; place-items: center; animation: pulse 2s infinite; }
.mk-me span { width: 12px; height: 12px; border-radius: 50%; background: var(--accent); border: 2px solid #fff; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 50%, transparent); } 70% { box-shadow: 0 0 0 14px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
.jt-circle { stroke: var(--brand); stroke-width: 2; fill: var(--brand); fill-opacity: .07; stroke-dasharray: 6 6; }
.leaflet-container { font-family: var(--font); background: var(--surface-2); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .jt-tiles { filter: invert(1) hue-rotate(180deg) brightness(.9) contrast(.9) saturate(.6); } }
:root[data-theme="dark"] .jt-tiles { filter: invert(1) hue-rotate(180deg) brightness(.9) contrast(.9) saturate(.6); }
@media (prefers-reduced-motion: reduce) { .mk-me, .result.flash { animation: none; } }

/* ---------- editor ---------- */
.editor { display: grid; gap: 16px; max-width: 820px; }
.form-card { display: grid; gap: 12px; }
.form-card h2 { margin: 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 600px) { .grid2 { grid-template-columns: 1fr; } }
.loc-row { display: flex; gap: 8px; flex-wrap: wrap; }
.loc-row select { flex: 1; min-width: 160px; }
.post-head { display: flex; gap: 10px; align-items: center; }
.post-head .post-title { font-weight: 600; font-size: 1.05rem; }
.post-head .check { white-space: nowrap; }
.save-bar { display: flex; gap: 10px; flex-wrap: wrap; position: sticky; bottom: 0; padding: 12px 0; background: linear-gradient(transparent, var(--bg) 30%); }

.te { position: relative; }
.te-box { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 8px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); cursor: text; min-height: 48px; }
.te-box:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 20%, transparent); }
.te-chips { display: contents; }
.te-input { border: 0 !important; flex: 1; min-width: 180px; padding: 4px !important; outline: none; background: transparent !important; }
.chip.edit { padding: 2px 4px 2px 2px; gap: 2px; }
.chip.edit button { border: 0; background: transparent; cursor: pointer; padding: 2px 4px; border-radius: 99px; color: inherit; opacity: .55; display: inline-flex; }
.chip.edit button:hover { opacity: 1; background: color-mix(in srgb, currentColor 12%, transparent); }
.chip.edit .star.on { opacity: 1; color: var(--accent); }
.chip.edit .star.on .ic { fill: currentColor; }
.te-sugg { position: absolute; left: 0; right: 0; top: 100%; margin-top: 4px; z-index: 20; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); overflow: hidden; max-height: 280px; overflow-y: auto; }
.te-sugg button { display: flex; width: 100%; justify-content: space-between; gap: 10px; padding: 8px 12px; border: 0; background: transparent; cursor: pointer; text-align: left; }
.te-sugg button:hover { background: var(--surface-2); }
.te-sugg small { color: var(--muted); }
.te-preview { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 8px; }
.te-preview:empty { display: none; }
.pv { display: inline-flex; flex-direction: column; gap: 2px; }
.pv small { font-size: .72rem; color: var(--muted); padding-left: 6px; }
.te-quick { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 10px; }

/* ---------- view / matches ---------- */
.view-head { display: flex; gap: 16px; align-items: flex-start; margin-bottom: 8px; }
.view-head h1 { display: flex; gap: 8px; align-items: center; }
.msec { margin-bottom: 28px; }
.msec h2 { display: flex; align-items: center; gap: 8px; }
.count { font-size: .8rem; background: var(--surface-2); color: var(--muted); padding: 1px 9px; border-radius: 99px; font-family: var(--font); }

/* ---------- insights ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
.stat { display: grid; gap: 2px; }
.stat span { color: var(--muted); font-size: .86rem; display: flex; gap: 6px; align-items: center; }
.stat b { font: 700 1.8rem var(--display); }
@media (max-width: 800px) { .stats { grid-template-columns: 1fr 1fr; } }
.legend { display: flex; gap: 16px; font-size: .84rem; color: var(--muted); margin-bottom: 10px; }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 4px; vertical-align: -1px; margin-right: 4px; }
.lg-d, .mb i.d { background: var(--brand); }
.lg-s, .mb i.s { background: var(--accent); }
.mtable { display: grid; }
.mrow { display: grid; grid-template-columns: minmax(120px, 1.2fr) 2fr 100px 110px; gap: 12px; align-items: center; padding: 10px 6px; border-top: 1px solid var(--line); }
.mrow.mine { background: var(--brand-soft); border-radius: 10px; }
.m-name { font-weight: 600; font-size: .92rem; }
.m-bars { display: grid; gap: 4px; }
.mb { display: flex; align-items: center; gap: 6px; font-size: .78rem; color: var(--muted); }
.mb i { display: block; height: 8px; border-radius: 99px; min-width: 2px; }
.m-pay { font-size: .88rem; text-align: right; font-variant-numeric: tabular-nums; }
@media (max-width: 640px) {
  .mrow { grid-template-columns: 1fr 1fr; }
  .m-bars { grid-column: 1 / -1; grid-row: 2; }
  .m-pay { text-align: left; }
}

/* ---------- ideas ---------- */
.idea-list { display: grid; gap: 4px; }
.idea { display: grid; grid-template-columns: 56px 1fr; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.idea:first-child { border-top: 0; }
.idea .pill { justify-self: start; margin-top: 3px; }
.idea p { margin: 2px 0 0; font-size: .9rem; }

/* ---------- footer / toast ---------- */
.foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; padding-top: 18px; padding-bottom: 28px; border-top: 1px solid var(--line); color: var(--muted); font-size: .84rem; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 30px); opacity: 0; pointer-events: none; background: var(--text); color: var(--bg); padding: 10px 18px; border-radius: 999px; font-weight: 500; box-shadow: var(--shadow); transition: .25s; z-index: 2000; max-width: calc(100% - 32px); text-align: center; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- v2: accounts, shifts, reviews, inbox, admin ---------- */
.avatar.sm { width: 38px; height: 38px; border-radius: 12px; font-size: .95rem; }
.avatar.xs { width: 28px; height: 28px; border-radius: 9px; font-size: .8rem; }
.avatar.logo.sm { font-size: 1.2rem; } .avatar.logo.xs { font-size: 1rem; }
.stars { display: inline-flex; align-items: center; gap: 3px; color: var(--warn); font-weight: 600; font-size: .85rem; white-space: nowrap; }
.stars .ic { fill: currentColor; }
.stars small { color: var(--muted); font-weight: 400; }
.gold { color: #E0A100; letter-spacing: 1px; }
.nowrap { white-space: nowrap; }
.mono { font-family: ui-monospace, Menlo, monospace; font-size: .85rem; }
.loading { padding: 40px 0; text-align: center; }
.btn.danger { color: #C4402B; border-color: color-mix(in srgb, #C4402B 35%, var(--line)); }
.btn.danger:hover { background: #FBE6E2; }
.btn.line { background: #06C755; border-color: #06C755; color: #fff; }
.btn.line:hover { background: #05a647; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.hint.bad { color: #C4402B; }

.switch { display: flex; align-items: center; gap: 10px; cursor: pointer; font-size: .92rem; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch span { width: 40px; height: 22px; border-radius: 99px; background: var(--line); position: relative; flex: none; transition: background .2s; }
.switch span::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.switch input:checked + span { background: var(--brand); }
.switch input:checked + span::after { transform: translateX(18px); }
.switch input:focus-visible + span { outline: 3px solid color-mix(in srgb, var(--brand) 55%, transparent); outline-offset: 2px; }
.ready-card.on { border-color: color-mix(in srgb, var(--brand) 50%, var(--line)); background: color-mix(in srgb, var(--brand-soft) 45%, var(--surface)); }

.shifts { margin-bottom: 14px; border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }
.shifts h3 { display: flex; align-items: center; gap: 6px; color: var(--accent); }
.shift-list { display: grid; gap: 10px; }
.shift-row { display: flex; gap: 10px; align-items: flex-start; padding-top: 10px; border-top: 1px solid var(--line); }
.shift-row:first-child { border-top: 0; padding-top: 0; }
.shift-side { display: grid; justify-items: end; gap: 4px; text-align: right; }
.score { font: 700 1.1rem var(--display); }
.score.hi { color: var(--hi); } .score.mid { color: var(--mid); } .score.lo { color: var(--muted); }
.sm-chips { margin-top: 6px; }
.sm-chips .chip { font-size: .75rem; padding: 1px 8px; }
.shift-info { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 6px; }
.kind-seg { max-width: 360px; margin-bottom: 4px; }
.kind-seg button { display: inline-flex; align-items: center; justify-content: center; gap: 5px; }
.shift-fields { display: grid; grid-template-columns: 1.3fr 1fr 1fr .8fr; gap: 10px; margin-top: 8px; }
.shift-fields input { width: 100%; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 7px 8px; }
@media (max-width: 600px) { .shift-fields { grid-template-columns: 1fr 1fr; } }

.review-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 12px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); }
.rf-head { font-weight: 600; font-size: .88rem; flex-basis: 100%; }
.review-form input[name="comment"] { flex: 1; min-width: 160px; }
.rate { display: inline-flex; flex-direction: row-reverse; }
.rate input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.rate label { font-size: 1.5rem; line-height: 1; color: var(--line); cursor: pointer; padding: 0 1px; }
.rate input:checked ~ label, .rate label:hover, .rate label:hover ~ label { color: #E0A100; }
.rate input:focus-visible + label { outline: 2px solid var(--brand); border-radius: 4px; }
.review-done { margin-top: 12px; font-size: .88rem; color: var(--muted); }
.reviews { display: grid; gap: 12px; }
.rv { border-top: 1px solid var(--line); padding-top: 10px; }
.rv:first-child { border-top: 0; padding-top: 0; }
.rv-head { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.rv p { margin: 4px 0 0; }

.inbox-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
@media (max-width: 860px) { .inbox-grid { grid-template-columns: 1fr; } }
.inbox { padding: 6px; }
.note { display: flex; gap: 12px; align-items: flex-start; padding: 12px; border-radius: 12px; text-decoration: none; color: var(--text); }
.note:hover { background: var(--surface-2); }
.note .grow { display: grid; gap: 2px; }
.note.unread { background: color-mix(in srgb, var(--brand-soft) 60%, transparent); }
.note.unread b::after { content: ''; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); margin-left: 6px; vertical-align: middle; }
.note-ic { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; flex: none; background: var(--brand-soft); color: var(--brand-strong); font-size: 1.05rem; }
.note-ic.k-shift, .note-ic.k-match { background: var(--accent-soft); color: var(--accent); }
.note-ic.k-review { background: var(--warn-soft); color: var(--warn); }
.line-preview h3 { display: flex; gap: 6px; align-items: center; }
.lp-phone { background: #8CABD9; border-radius: 16px; padding: 18px 14px; margin: 10px 0; }
.lp-bubble { background: #fff; color: #111; border-radius: 14px; padding: 12px 14px; display: grid; gap: 4px; box-shadow: 0 1px 3px rgba(0,0,0,.15); }
.lp-bubble small { color: #0E8A6A; font-weight: 700; }
.lp-bubble span { font-size: .85rem; color: #555; }
.lp-bubble i { font-style: normal; text-align: center; background: #0E8A6A; color: #fff; border-radius: 8px; padding: 6px; margin-top: 6px; font-size: .85rem; font-weight: 600; }

.auth { max-width: 460px; margin: 20px auto; display: grid; gap: 12px; text-align: center; }
.auth .btn { width: 100%; }
.auth .field { text-align: left; }
.otp { display: grid; gap: 10px; }
.or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: .85rem; }
.or::before, .or::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.onboard { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; max-width: 760px; }
.choice { text-decoration: none; color: var(--text); transition: border-color .15s, transform .15s; }
.choice:hover { border-color: var(--brand); transform: translateY(-2px); }
@media (max-width: 600px) { .onboard { grid-template-columns: 1fr; } }
.consent { align-items: flex-start; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
.consent input { margin-top: 4px; }
.editor.extra { margin-top: 16px; }
.line-status { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); }
.line-status.ok b { color: #06C755; }
.ok-line { color: var(--ok); font-weight: 600; margin: 0; }
.form-card h2 .pill { margin-left: 6px; }

.admin-sec { margin-bottom: 16px; }
.admin-list { display: grid; }
.admin-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.admin-row select { max-width: 220px; }
.prose { max-width: 780px; }
.prose ul { padding-left: 20px; }
.prose li { margin-bottom: 6px; }
.prose h2 { margin-top: 20px; }

/* guest browsing (live mode, not signed in) */
.guest-card { display: grid; gap: 6px; }
.guest-card .me-row { margin-bottom: 4px; }
.guest-card select, .guest-card > .btn { width: 100%; }

/* ---------- v3: compact result cards ---------- */
.r-key { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; margin-top: 10px; }
.r-sum { font-size: .82rem; color: var(--muted); white-space: nowrap; }
.r-sum b { color: var(--text); }
.r-more { margin-top: 10px; padding-top: 4px; border-top: 1px dashed var(--line); }
.r-more .bars { margin-top: 10px; }
.more-btn .ic { transition: transform .2s; }
.more-btn[aria-expanded="true"] .ic { transform: rotate(180deg); }
.result.is-open { border-color: color-mix(in srgb, var(--brand) 35%, var(--line)); }
@media (max-width: 560px) {
  .hide-xs { display: none !important; }
  .result { padding: 14px; }
  .r-actions { gap: 6px; }
  .r-actions .btn { flex: 1 1 auto; padding-left: 10px; padding-right: 10px; }
}

/* ---------- v3: mobile search — filter sheet + list/map toggle ---------- */
.m-bar, .sheet-head, .sheet-foot, .sheet-backdrop { display: none; }
@media (max-width: 900px) {
  .m-bar { display: flex; gap: 8px; align-items: center; justify-content: space-between; position: sticky; top: var(--topbar-h, 58px); z-index: 900; margin: -8px -16px 12px; padding: 8px 16px; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
  .m-bar > .btn { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
  .m-sum { color: var(--muted); font-weight: 500; overflow: hidden; text-overflow: ellipsis; }
  .m-view { flex: none; }
  .m-view button { display: inline-flex; align-items: center; gap: 4px; padding: 6px 12px; }
  .page-head p { display: none; }
  .page-head { margin-bottom: 12px; }

  .side { position: fixed; left: 0; right: 0; bottom: 0; top: auto; z-index: 1300; max-height: 88vh; overflow-y: auto; overscroll-behavior: contain;
    background: var(--bg); border-radius: 22px 22px 0 0; padding: 0 16px; box-shadow: 0 -12px 40px rgba(0, 0, 0, .28);
    transform: translateY(105%); visibility: hidden; transition: transform .28s cubic-bezier(.2, .8, .2, 1), visibility .28s; }
  .side.open { transform: none; visibility: visible; }
  .side { grid-template-columns: minmax(0, 1fr); overflow-x: hidden; }
  .side > * { min-width: 0; }
  .sheet-head { display: flex; justify-content: space-between; align-items: center; position: sticky; top: 0; z-index: 2; background: var(--bg); padding: 18px 0 10px; }
  .sheet-head::before { content: ''; position: absolute; top: 7px; left: 50%; width: 40px; height: 4px; border-radius: 4px; background: var(--line); transform: translateX(-50%); }
  .sheet-foot { display: block; position: sticky; bottom: 0; z-index: 2; padding: 14px 0 calc(14px + env(safe-area-inset-bottom)); background: linear-gradient(transparent, var(--bg) 35%); }
  .sheet-foot .btn { width: 100%; }
  .sheet-backdrop { display: block; position: fixed; inset: 0; z-index: 1250; background: rgba(8, 12, 10, .45); opacity: 0; pointer-events: none; transition: opacity .2s; }
  .sheet-open .sheet-backdrop { opacity: 1; pointer-events: auto; }
  body.no-scroll { overflow: hidden; }

  .search-grid[data-view="list"] .map-card { display: none; }
  .search-grid[data-view="map"] .map { height: calc(100vh - 260px); min-height: 320px; }
  .search-grid[data-view="map"] #results, .search-grid[data-view="map"] #shifts, .search-grid[data-view="map"] .rhints { display: none; }
}
@media (prefers-reduced-motion: reduce) { .side, .sheet-backdrop { transition: none; } }

/* ---------- v3: phone bottom tab bar ---------- */
.tabbar { display: none; }
@media (max-width: 760px) {
  :root { --topbar-h: 57px; }
  .topbar-in { min-height: 56px; padding-top: 0; flex-wrap: nowrap; }
  .nav, .acct .bell { display: none; }
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 1100;
    background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(12px); border-top: 1px solid var(--line);
    padding: 4px 4px calc(4px + env(safe-area-inset-bottom)); }
  .tabbar a { position: relative; isolation: isolate; display: grid; justify-items: center; gap: 1px; padding: 7px 0 5px; text-decoration: none; color: var(--muted); font-size: .7rem; font-weight: 600; }
  .tabbar a .ic { font-size: 1.3rem; }
  .tabbar a.on { color: var(--brand-strong); }
  .tabbar a.on::before { content: ''; position: absolute; z-index: -1; top: 4px; left: 50%; width: 52px; height: 28px; border-radius: 14px; background: var(--brand-soft); transform: translateX(-50%); }
  .tabbar .badge { position: absolute; top: 2px; left: calc(50% + 8px); font-style: normal; }
  body { padding-bottom: calc(66px + env(safe-area-inset-bottom)); }
  .toast { bottom: calc(80px + env(safe-area-inset-bottom)); }
  .save-bar { bottom: calc(60px + env(safe-area-inset-bottom)); }
  .foot { padding-bottom: 12px; }
}

/* ---------- v3: tap-to-pick tags ---------- */
.te-pick-toggle { display: inline-flex; align-items: center; gap: 6px; margin-top: 10px; padding: 4px 0; border: 0; background: none; color: var(--brand-strong); font-weight: 600; cursor: pointer; }
.te-pick-toggle .ic:last-child { transition: transform .2s; }
.te-pick-toggle[aria-expanded="true"] .ic:last-child { transform: rotate(180deg); }
.te-pick { margin-top: 6px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); overflow: hidden; }
.pick-tabs { display: flex; gap: 4px; overflow-x: auto; padding: 6px; background: var(--surface-2); border-bottom: 1px solid var(--line); scrollbar-width: none; }
.pick-tabs::-webkit-scrollbar { display: none; }
.pick-tabs button { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border: 0; border-radius: 999px; background: transparent; color: var(--muted); font-weight: 600; font-size: .85rem; white-space: nowrap; cursor: pointer; }
.pick-tabs button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.pick-tabs i { font-style: normal; min-width: 18px; padding: 0 5px; border-radius: 99px; background: var(--brand); color: var(--brand-ink); font-size: .7rem; line-height: 18px; text-align: center; }
.pick-tabs i:empty { display: none; }
.pick-grid { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px; max-height: 264px; overflow-y: auto; }
.pick { display: inline-flex; align-items: center; gap: 5px; min-height: 40px; padding: 7px 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--text); font-size: .9rem; cursor: pointer; transition: border-color .15s, transform .1s; }
.pick .ic { color: var(--muted); }
.pick:hover { border-color: var(--brand); }
.pick:active { transform: scale(.97); }
.pick.on { border-color: transparent; font-weight: 600; }
.pick.on .ic { color: currentColor; }

.te-input { min-width: 120px; }
.te-box, .te-pick, .pick-grid { min-width: 0; }
/* grid children default to min-width:auto, which lets the scrolling tag tabs stretch whole cards */
.guest-card, .controls, .form-card { grid-template-columns: minmax(0, 1fr); }
.guest-card > *, .controls > *, .form-card > *, .te, .te-pick { min-width: 0; max-width: 100%; }

/* first-visit guest prompt */
.welcome { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; border-color: color-mix(in srgb, var(--brand) 40%, var(--line)); background: color-mix(in srgb, var(--brand-soft) 50%, var(--surface)); }
.welcome h3 { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }
.welcome p { margin: 0; }

/* Google sign-in button (white, official G mark) */
.btn.google { background: #fff; color: #1f1f1f; border: 1px solid #dadce0; font-weight: 600; }
.btn.google:hover { background: #f7f8f8; }
.btn.google .g-logo { width: 20px; height: 20px; }

/* sign-in buttons for channels that aren't switched on yet, and extra OAuth providers */
.btn.soon { opacity: .55; filter: grayscale(.4); cursor: help; }
.soon-badge { font-size: .7rem; font-weight: 700; padding: 1px 8px; border-radius: 99px; background: rgba(0, 0, 0, .12); margin-left: 4px; }
.btn.line .soon-badge { background: rgba(255, 255, 255, .25); }
.oauth-facebook { background: #1877F2; border-color: #1877F2; color: #fff; }
.oauth-facebook:hover { background: #166fe0; }
.fb-f { font: 700 1.2rem/1 system-ui, sans-serif; }
.oauth-apple { background: #000; border-color: #000; color: #fff; }
.oauth-apple:hover { background: #222; }
.oauth-azure { background: #fff; border-color: #dadce0; color: #1f1f1f; }
.ms-logo { display: inline-grid; grid-template-columns: 8px 8px; gap: 2px; }
.ms-logo i { width: 8px; height: 8px; }
.ms-logo i:nth-child(1) { background: #F25022; } .ms-logo i:nth-child(2) { background: #7FBA00; }
.ms-logo i:nth-child(3) { background: #00A4EF; } .ms-logo i:nth-child(4) { background: #FFB900; }
