/* My Pixelmate — customer dashboard (public/home.html). Tokens follow pixelmate.photo (site.css): warm paper, ink, burnt orange. */
:root {
  --paper: #faf9f7;
  --card: #ffffff;
  --ink: #1c1917;
  --ink-2: #57534e;
  --ink-3: #8a837d;
  --line: #e7e5e4;
  --accent: #c2410c;
  --accent-ink: #ffffff;
  --accent-soft: #fff1e8;
  --ok: #15803d;
  --ok-soft: #e9f6ee;
  --warn: #a15c07;
  --warn-soft: #fdf3dc;
  --no: #b91c1c;
  --ticket: #1c1917;
  --ticket-ink: #faf9f7;
  --ticket-2: #a8a29e;
  --radius: 14px;
  --font: "IBM Plex Sans Thai", "Sarabun", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --display: "Montserrat", "IBM Plex Sans Thai", sans-serif;
  --tabbar: 0px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #141210;
    --card: #1f1c19;
    --ink: #f5f5f4;
    --ink-2: #bdb6af;
    --ink-3: #8a837d;
    --line: #322d28;
    --accent: #fb923c;
    --accent-ink: #1c1917;
    --accent-soft: #3a2413;
    --ok: #4ade80;
    --ok-soft: #14301f;
    --warn: #fbbf24;
    --warn-soft: #3a2c0c;
    --no: #f87171;
    --ticket: #292420;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); color: var(--ink); background: var(--paper); font-size: 16px; line-height: 1.6; -webkit-tap-highlight-color: transparent; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3 { margin: 0; line-height: 1.3; font-weight: 600; text-wrap: balance; }
p { margin: 0; }
.hidden { display: none !important; }
.muted { color: var(--ink-2); }
.small { font-size: 13.5px; }
.center { text-align: center; }
.num { font-variant-numeric: tabular-nums; }
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 16px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 9px 18px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--ink); text-decoration: none; }
.btn:hover { border-color: var(--ink-3); text-decoration: none; }
.btn:disabled { opacity: .55; cursor: default; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.btn.block { display: flex; width: 100%; }
.btn.sm { min-height: 32px; padding: 3px 12px; font-size: 13px; }
.btn.ghost { background: transparent; border-color: transparent; }

/* ---------- brand / header ---------- */
.brand { font-family: var(--display); font-weight: 500; font-size: 18px; letter-spacing: .01em; color: var(--ink); white-space: nowrap; }
.brand b { font-weight: 700; color: var(--accent); }
.brand:hover { text-decoration: none; }
.brand.big { font-size: 30px; }
.top { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 18px; padding: 10px max(16px, calc((100vw - 1008px) / 2)); background: color-mix(in srgb, var(--paper) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); min-height: 58px; }
.nav { display: flex; gap: 2px; flex: 1; }
.nav a { display: flex; align-items: center; gap: 7px; padding: 8px 12px; border-radius: 999px; color: var(--ink-2); font-size: 15px; white-space: nowrap; }
.nav a:hover { color: var(--ink); text-decoration: none; background: color-mix(in srgb, var(--ink) 6%, transparent); }
.nav a[aria-current="page"] { color: var(--accent); font-weight: 600; background: var(--accent-soft); }
.nav svg { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.me { display: flex; align-items: center; gap: 8px; margin-left: auto; padding: 4px 6px 4px 4px; border: 1px solid var(--line); background: var(--card); border-radius: 999px; min-height: 40px; max-width: 46vw; }
.me img { width: 30px; height: 30px; border-radius: 50%; }
.me #meName { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; padding-left: 6px; }
.me-out { font-size: 12.5px; color: var(--ink-3); padding: 0 8px 0 2px; white-space: nowrap; }
.preview { background: var(--warn-soft); color: var(--warn); border-bottom: 1px solid var(--line); padding: 8px 16px; font-size: 13px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

@media (max-width: 760px) {
  :root { --tabbar: calc(60px + env(safe-area-inset-bottom)); }
  .top { backdrop-filter: none; background: var(--paper); } /* a backdrop-filter would make the header the containing block of the fixed tab bar */
  .nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; gap: 0; padding: 4px 4px env(safe-area-inset-bottom); background: var(--card); border-top: 1px solid var(--line); justify-content: space-around; }
  .nav a { flex: 1; flex-direction: column; gap: 1px; padding: 6px 2px; font-size: 11px; border-radius: 10px; min-width: 0; }
  .nav a[aria-current="page"] { background: transparent; }
  .nav svg { width: 23px; height: 23px; }
  .me-out { display: none; }
  .me #meName { padding-right: 8px; }
}

/* ---------- page ---------- */
main { padding-top: 22px; padding-bottom: 44px; outline: none; min-height: 60vh; }
.greet { margin-bottom: 18px; }
.greet .eyebrow, .eyebrow { font-family: var(--display); font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); font-weight: 600; }
.greet h1 { font-size: clamp(24px, 5vw, 32px); margin-top: 2px; }
.page-head { margin-bottom: 16px; }
.page-head h1 { font-size: clamp(22px, 4.6vw, 28px); }
.back { display: inline-flex; align-items: center; gap: 4px; font-size: 14px; color: var(--ink-2); margin-bottom: 8px; min-height: 32px; }
.sec { margin-top: 34px; }
.sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.sec-head h2 { font-size: 19px; }
.sec-head .count { color: var(--ink-3); font-weight: 400; font-size: 15px; margin-left: 6px; }
.sec-head a { font-size: 14px; white-space: nowrap; }
.empty { border: 1px dashed var(--line); border-radius: var(--radius); padding: 22px 18px; color: var(--ink-2); text-align: center; font-size: 15px; }
.notice { display: flex; gap: 10px; background: var(--warn-soft); color: var(--warn); border-radius: 12px; padding: 12px 14px; font-size: 14px; margin-bottom: 16px; }
.notice.info { background: var(--accent-soft); color: var(--ink); }

/* ---------- chips ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 2px 10px; border-radius: 999px; font-size: 13px; line-height: 1.7; background: color-mix(in srgb, var(--ink) 7%, transparent); color: var(--ink-2); white-space: nowrap; }
.chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .75; }
.chip.ok { background: var(--ok-soft); color: var(--ok); }
.chip.warn { background: var(--warn-soft); color: var(--warn); }
.chip.plain::before { display: none; }

/* ---------- next-trip ticket (the one bold element) ---------- */
.ticket { position: relative; display: grid; grid-template-columns: 1fr auto; background: var(--ticket); color: var(--ticket-ink); border-radius: 18px; overflow: hidden; text-decoration: none; }
.ticket:hover { text-decoration: none; }
.ticket-main { padding: 22px 22px 20px; min-width: 0; }
.ticket .eyebrow { color: var(--ticket-2); }
.ticket h2 { font-size: clamp(22px, 5.2vw, 30px); margin: 4px 0 2px; color: var(--ticket-ink); }
.ticket .dates { color: var(--ticket-2); font-size: 15px; }
.ticket .who { color: var(--ticket-2); font-size: 14px; margin-top: 2px; }
.ticket .chips { margin-top: 14px; }
.ticket .chip { background: rgba(255, 255, 255, .1); color: #e7e5e4; }
.ticket .chip.ok { background: rgba(74, 222, 128, .16); color: #86efac; }
.ticket .chip.warn { background: rgba(251, 191, 36, .16); color: #fcd34d; }
.ticket-side { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 18px 26px; min-width: 132px; border-left: 2px dashed rgba(255, 255, 255, .22); text-align: center; }
.ticket-side::before, .ticket-side::after { content: ""; position: absolute; left: -11px; width: 20px; height: 20px; border-radius: 50%; background: var(--paper); }
.ticket-side::before { top: -10px; }
.ticket-side::after { bottom: -10px; }
.ticket-side .n { font-family: var(--display); font-weight: 700; font-size: 46px; line-height: 1; color: #fb923c; font-variant-numeric: tabular-nums; }
.ticket-side .u { font-size: 13px; color: var(--ticket-2); margin-top: 4px; }
.ticket-side .go { margin-top: 12px; font-size: 13px; color: var(--ticket-ink); border-bottom: 1px solid rgba(255, 255, 255, .35); }
@media (max-width: 560px) {
  .ticket { grid-template-columns: 1fr; }
  .ticket-side { flex-direction: row; gap: 10px; align-items: baseline; justify-content: flex-start; padding: 14px 22px 16px; border-left: 0; border-top: 2px dashed rgba(255, 255, 255, .22); }
  .ticket-side::before, .ticket-side::after { top: -11px; bottom: auto; }
  .ticket-side::before { left: -10px; }
  .ticket-side::after { left: auto; right: -10px; }
  .ticket-side .n { font-size: 34px; }
  .ticket-side .u { margin: 0; }
  .ticket-side .go { margin: 0 0 0 auto; }
}

/* ---------- trip cards ---------- */
.trips { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.trip { display: grid; grid-template-columns: 58px 1fr; gap: 14px; padding: 14px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); color: inherit; }
.trip:hover { border-color: var(--accent); text-decoration: none; }
.cal { align-self: start; text-align: center; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); background: var(--paper); }
.cal .m { background: var(--accent); color: var(--accent-ink); font-size: 12px; font-weight: 600; padding: 1px 0; }
.cal .d { font-family: var(--display); font-weight: 700; font-size: 22px; line-height: 1.5; }
.cal .y { font-size: 11px; color: var(--ink-3); padding-bottom: 3px; margin-top: -4px; }
.trip h3 { font-size: 17px; overflow-wrap: anywhere; }
.trip .dates { color: var(--ink-2); font-size: 14px; }
.trip .chips { margin-top: 8px; }
.trip.past .cal .m { background: var(--ink-3); }

/* ---------- albums ---------- */
.albums { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.album { display: block; color: inherit; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.album:hover { border-color: var(--accent); text-decoration: none; }
.album .cover { position: relative; aspect-ratio: 4/3; background: var(--line); }
.album .cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.album .new { position: absolute; top: 8px; left: 8px; padding: 1px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; color: #fff; background: var(--no); }
.album .info { padding: 9px 12px 11px; }
.album .info b { display: block; font-weight: 600; font-size: 15px; line-height: 1.35; overflow-wrap: anywhere; }
.album .info small { color: var(--ink-2); font-size: 12.5px; }

/* ---------- past trips rows ---------- */
.rows { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-top: 1px solid var(--line); }
.row:first-child { border-top: 0; }
.row .yr { font-family: var(--display); font-weight: 600; font-size: 13px; color: var(--ink-3); width: 40px; flex: none; font-variant-numeric: tabular-nums; }
.row .t { flex: 1; min-width: 0; }
.row .t b { display: block; font-weight: 600; overflow-wrap: anywhere; line-height: 1.35; }
.row .t small { color: var(--ink-2); font-size: 13.5px; }
.row .a { flex: none; font-size: 14px; }
.row .a .btn { min-height: 36px; padding: 4px 14px; font-size: 14px; }

/* ---------- trip detail ---------- */
.detail-head .code { font-family: var(--display); font-size: 12.5px; letter-spacing: .1em; color: var(--ink-3); font-weight: 600; }
.detail-head h1 { font-size: clamp(24px, 5.4vw, 34px); margin: 2px 0 4px; }
.detail-head .dates { color: var(--ink-2); }
.detail-head .chips { margin-top: 10px; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; margin-top: 20px; align-items: start; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px 18px; }
.panel h2 { font-size: 16px; margin-bottom: 10px; }
.panel h2 small { font-weight: 400; color: var(--ink-3); font-size: 13.5px; margin-left: 6px; }
.panel + .panel { margin-top: 0; }
.person-tag { display: inline-block; font-size: 13px; font-weight: 600; color: var(--accent); margin-bottom: 6px; }
.ledger { margin: 0; }
.ledger div { display: flex; justify-content: space-between; gap: 16px; padding: 6px 0; border-top: 1px solid var(--line); }
.ledger div:first-child { border-top: 0; padding-top: 0; }
.ledger dt { color: var(--ink-2); }
.ledger dd { margin: 0; font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.ledger .sum dt, .ledger .sum dd { font-weight: 600; color: var(--ink); }
.ledger .due dd { color: var(--accent); font-weight: 600; }
.ledger .paid dd { color: var(--ok); }
.fine { font-size: 12.5px; color: var(--ink-3); margin-top: 8px; line-height: 1.5; }
.room { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.room b { font-size: 18px; font-weight: 600; }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 4px; background: color-mix(in srgb, var(--ink) 6%, transparent); border-radius: 12px; }
.seg button { min-height: 44px; border: 0; border-radius: 9px; background: transparent; color: var(--ink-2); font-weight: 500; }
.seg button[aria-pressed="true"] { background: var(--card); color: var(--ink); font-weight: 600; box-shadow: 0 1px 3px rgba(0, 0, 0, .14); }
.seg button[aria-pressed="true"].yes { color: var(--ok); }
.seg button[aria-pressed="true"].no { color: var(--warn); }
.seg button:disabled { opacity: .6; }
.ask { color: var(--ink-2); font-size: 14.5px; margin: -6px 0 10px; }
.ins-state { font-size: 13.5px; color: var(--ink-2); margin-top: 8px; min-height: 1.6em; }
.doc { display: flex; align-items: center; gap: 12px; }
.doc .ico { flex: none; width: 40px; height: 48px; border-radius: 6px; border: 1.5px dashed var(--line); display: grid; place-items: center; color: var(--ink-3); font-size: 11px; font-family: var(--display); font-weight: 600; }
.doc.ready .ico { border-style: solid; border-color: var(--accent); color: var(--accent); }
.people { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; margin: 0; padding: 0; }
.people li { padding: 3px 12px; border-radius: 999px; border: 1px solid var(--line); font-size: 14.5px; background: var(--paper); }
.people li.self { border-color: var(--accent); background: var(--accent-soft); }
.people li small { color: var(--ink-2); }
.leaders { margin-top: 12px; font-size: 14.5px; color: var(--ink-2); }
.leaders b { color: var(--ink); font-weight: 600; }

/* ---------- profile ---------- */
.kv { margin: 0; display: grid; grid-template-columns: minmax(96px, auto) 1fr; gap: 6px 16px; }
.kv dt { color: var(--ink-2); font-size: 14.5px; }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.kv .mono { font-family: var(--display); font-variant-numeric: tabular-nums; letter-spacing: .04em; }
.reveal { border: 0; background: transparent; color: var(--accent); font-size: 13.5px; padding: 0 0 0 8px; min-height: 28px; }
.sub { font-size: 13px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); font-weight: 600; font-family: var(--display); margin: 16px 0 8px; }

/* ---------- login ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.login-card { width: 100%; max-width: 400px; text-align: center; }
.login-lead { margin: 10px 0 22px; font-size: 17px; }
.gbtn { min-height: 44px; display: flex; justify-content: center; margin-top: 10px; }
.err { color: var(--no); margin-top: 8px; min-height: 1.2em; }
.otp-toggle { flex-direction: column; gap: 0; border-radius: 16px; margin-top: 18px; padding: 10px 16px; white-space: normal; line-height: 1.4; }
.otp-toggle span { font-size: 13.5px; color: var(--ink-2); }
.otp { margin-top: 12px; text-align: left; }
.otp form { display: grid; gap: 10px; }
.otp input { width: 100%; min-height: 46px; padding: 8px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); }
.otp input.code { font-size: 22px; letter-spacing: 6px; text-align: center; }
.otp .hint { min-height: 1.2em; }
.otp .box { background: var(--warn-soft); color: var(--warn); border-radius: 10px; padding: 8px 10px; margin-top: 6px; }
.login-help { margin-top: 26px; }

/* ---------- misc ---------- */
.foot { display: flex; flex-wrap: wrap; gap: 6px 18px; padding-top: 18px; padding-bottom: calc(26px + var(--tabbar)); border-top: 1px solid var(--line); color: var(--ink-3); font-size: 13px; margin-top: -1px; }
.foot a { color: var(--ink-2); }
main + .foot { margin-top: 0; }
.skel { border-radius: var(--radius); background: linear-gradient(90deg, var(--line) 25%, color-mix(in srgb, var(--line) 50%, var(--paper)) 50%, var(--line) 75%); background-size: 200% 100%; animation: skel 1.3s linear infinite; }
@keyframes skel { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .skel { animation: none; } }
.toast { position: fixed; left: 50%; bottom: calc(22px + var(--tabbar)); transform: translateX(-50%); background: var(--ink); color: var(--paper); padding: 9px 18px; border-radius: 999px; font-size: 14.5px; z-index: 60; max-width: 92vw; text-align: center; }
.inapp { display: flex; gap: 10px; align-items: center; background: var(--warn-soft); color: var(--warn); padding: 10px 14px; font-size: 14px; }
