/* ==========================================================================
   Terrago Solar Care
   แนวดีไซน์: เรียบ แบน ขาว-ดำ ใช้สีเขียวแบรนด์เป็นจุดเน้นเล็ก ๆ
   โครง: 1) สี/ธีม  2) พื้นฐาน  3) ส่วนประกอบ  4) หน้าต่าง ๆ  5) ขนาดจอ
   ========================================================================== */

/* ── 1) สีและธีม ──────────────────────────────────────────────────────────
   ค่าเริ่มต้นตามการตั้งค่าเครื่อง ปุ่มสลับจะใส่ data-theme ที่ <html> */
:root {
  --bg: #ffffff;
  --bg-2: #f4f4f4;
  --bg-3: #e9e9ea;
  --text: #171a20;
  --text-2: #5c5e62;
  --text-3: #8a8c90;
  --line: #e6e6e6;
  --btn: #171a20;
  --btn-ink: #ffffff;
  --accent: #6f8a1f;
  --warn: #b86e00;
  --danger: #c4372b;
  --line-green: #06c755;
  --topbar-bg: rgba(255, 255, 255, .88);
  --frame: #0a0a0a;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #000000;
  --bg-2: #141516;
  --bg-3: #1f2022;
  --text: #eeeeee;
  --text-2: #a4a6a9;
  --text-3: #6f7276;
  --line: #222326;
  --btn: #eeeeee;
  --btn-ink: #000000;
  --accent: #a6c34c;
  --warn: #f0a43a;
  --danger: #f2685c;
  --topbar-bg: rgba(0, 0, 0, .82);
  --frame: #000000;
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #000000;
    --bg-2: #141516;
    --bg-3: #1f2022;
    --text: #eeeeee;
    --text-2: #a4a6a9;
    --text-3: #6f7276;
    --line: #222326;
    --btn: #eeeeee;
    --btn-ink: #000000;
    --accent: #a6c34c;
    --warn: #f0a43a;
    --danger: #f2685c;
    --topbar-bg: rgba(0, 0, 0, .82);
    --frame: #000000;
    color-scheme: dark;
  }
}

:root {
  --r: 4px;            /* ปุ่ม ช่องกรอก */
  --r-lg: 10px;        /* กล่อง */
  --gutter: 20px;
  --max: 1180px;
  --read: 680px;
  --topbar-h: 56px;
  --ease: cubic-bezier(.3, 0, .2, 1);
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
}

/* ── 2) พื้นฐาน ───────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--topbar-h) + 16px); }
body {
  min-height: 100vh;
  min-height: 100svh;
  background: var(--bg);
  color: var(--text);
  font-family: 'Prompt', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
  transition: background-color .25s, color .25s;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; }
b, strong { font-weight: 500; color: var(--text); }
:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
[hidden] { display: none !important; }

.ic { width: 20px; height: 20px; flex-shrink: 0; }
.boot { padding: 40vh 0 0; text-align: center; color: var(--text-3); font-size: 14px; }
.noscript { padding: 24px; text-align: center; }

.container {
  width: 100%; max-width: var(--max); margin: 0 auto;
  padding-left: calc(var(--gutter) + var(--safe-l));
  padding-right: calc(var(--gutter) + var(--safe-r));
}
.narrow { max-width: calc(var(--read) + var(--gutter) * 2); }

.kicker { font-size: 13px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: var(--text-2); }
.muted { color: var(--text-2); }
.num { font-variant-numeric: tabular-nums; letter-spacing: -.01em; }

@media (prefers-reduced-motion: no-preference) {
  .fade { animation: fade .45s var(--ease) both; }
  @keyframes fade { from { opacity: 0; } to { opacity: 1; } }
}

/* ── 3) ส่วนประกอบ ────────────────────────────────────────────────────── */

/* Topbar */
.topbar {
  position: sticky; top: 0; z-index: 50;
  padding-top: var(--safe-t);
  background: var(--topbar-bg);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner { height: var(--topbar-h); display: flex; align-items: center; gap: 16px; }
.topbar-logo { display: flex; align-items: center; height: 100%; }
.topbar-logo img { height: 30px; width: auto; }
.topnav { display: none; margin: 0 auto; gap: 4px; }
.topnav a {
  padding: 6px 14px; border-radius: var(--r);
  font-size: 14px; font-weight: 500; color: var(--text);
  transition: background .2s;
}
.topnav a:hover { background: var(--bg-2); }
.topnav a[aria-current="page"] { background: var(--bg-2); }
.topbar-actions { display: flex; gap: 2px; margin-left: auto; }
.icon-btn {
  width: 44px; height: 44px; border-radius: var(--r);
  display: grid; place-items: center; color: var(--text);
  transition: background .2s;
}
.icon-btn:hover { background: var(--bg-2); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 24px; border-radius: var(--r);
  font-size: 15px; font-weight: 500; letter-spacing: .01em;
  transition: background .2s, opacity .2s, transform .12s;
}
.btn:active { transform: scale(.985); }
.btn-block { width: 100%; }
.btn-primary { background: var(--btn); color: var(--btn-ink); }
.btn-primary:hover { opacity: .88; }
.btn-primary:disabled { opacity: .55; cursor: progress; }
.btn-secondary { background: var(--bg-2); color: var(--text); }
.btn-secondary:hover { background: var(--bg-3); }
.btn-line { background: var(--line-green); color: #fff; }
.btn-line:hover { opacity: .9; }
.btn-line .ic { width: 22px; height: 22px; }
.spinner {
  width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid currentColor; border-right-color: transparent;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Hairline list */
.list { border-top: 1px solid var(--line); }
.list-row {
  display: flex; align-items: center; gap: 16px;
  min-height: 72px; padding: 14px 4px;
  border-bottom: 1px solid var(--line);
  transition: background .2s;
}
.list-row:hover { background: var(--bg-2); }
.list-row .ic { color: var(--text-2); }
.list-body { flex: 1; min-width: 0; }
.list-title { font-size: 17px; font-weight: 500; line-height: 1.4; }
.list-desc { font-size: 14px; color: var(--text-2); line-height: 1.5; }
.list-row .chev { color: var(--text-3); width: 18px; height: 18px; }

/* Section heading */
.sec { padding: 40px 0 0; }
.sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.sec-head h2 { font-size: 22px; font-weight: 500; line-height: 1.3; }
.sec-head p { font-size: 14px; color: var(--text-2); }

/* Status dot */
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); vertical-align: middle; margin-right: 8px; }

/* Thin progress */
.meter { height: 3px; background: var(--bg-3); border-radius: 3px; overflow: hidden; margin-top: 14px; }
.meter > i { display: block; height: 100%; width: 0; background: var(--accent); transition: width 1.1s var(--ease); }
.meter.is-warn > i { background: var(--warn); }
.meter.is-empty > i { background: var(--danger); }

/* Note */
.note { display: flex; gap: 10px; font-size: 14px; line-height: 1.6; color: var(--text-2); padding: 14px 16px; background: var(--bg-2); border-radius: var(--r-lg); }
.note .ic { width: 18px; height: 18px; margin-top: 2px; }
.note-warn .ic { color: var(--warn); }

/* Floating */
.to-top {
  position: fixed; z-index: 40;
  right: calc(16px + var(--safe-r)); bottom: calc(16px + var(--safe-b));
  width: 46px; height: 46px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--btn); color: var(--btn-ink);
}
.toast {
  position: fixed; z-index: 60; left: 50%; bottom: calc(20px + var(--safe-b));
  transform: translateX(-50%); max-width: calc(100% - 32px);
  padding: 12px 18px; border-radius: var(--r);
  background: var(--btn); color: var(--btn-ink); font-size: 14px;
}

/* Zoom */
.zoom { border: 0; padding: 0; background: transparent; max-width: 100vw; max-height: 100vh; width: 100%; height: 100%; margin: 0; overflow: auto; }
.zoom::backdrop { background: rgba(0, 0, 0, .92); }
.zoom[open] { display: grid; place-items: center; }
.zoom img { width: auto; max-width: min(720px, calc(100vw - 24px)); max-height: none; margin: 72px auto 32px; border-radius: 18px; }
.zoom-close { position: fixed; top: calc(12px + var(--safe-t)); right: calc(12px + var(--safe-r)); background: rgba(255, 255, 255, .12); color: #fff; border-radius: 50%; }
.zoom-close:hover { background: rgba(255, 255, 255, .24); }

/* ── 4) หน้าต่าง ๆ ─────────────────────────────────────────────────────── */

/* Login */
.login { display: flex; flex-direction: column; min-height: 100vh; min-height: 100svh; }
.login-visual {
  position: relative; overflow: hidden; color: #fff; background: #000;
  min-height: 300px; height: 46svh;
  display: flex; flex-direction: column; justify-content: space-between;
  padding: calc(20px + var(--safe-t)) calc(var(--gutter) + var(--safe-r)) 28px calc(var(--gutter) + var(--safe-l));
}
.login-visual .bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 40%; }
.login-visual::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,.55) 0%, rgba(0,0,0,.05) 40%, rgba(0,0,0,.75) 100%); }
.login-visual > :not(.bg) { position: relative; z-index: 1; }
.login-logo { height: 52px; width: auto; align-self: flex-start; }
.login-visual h1 { font-size: clamp(30px, 8.5vw, 56px); font-weight: 500; line-height: 1.08; letter-spacing: -.01em; }
.login-visual p { margin-top: 10px; font-size: 15px; color: rgba(255, 255, 255, .8); }

.login-panel { flex: 1; display: flex; justify-content: center; padding: 32px calc(var(--gutter) + var(--safe-r)) calc(36px + var(--safe-b)) calc(var(--gutter) + var(--safe-l)); }
.login-form { width: 100%; max-width: 400px; }
.login-form h2 { font-size: 26px; font-weight: 500; line-height: 1.25; }
.login-form .lead { font-size: 14px; color: var(--text-2); margin: 6px 0 28px; }

.field { margin-bottom: 18px; }
.field label { display: block; font-size: 14px; font-weight: 500; color: var(--text-2); margin-bottom: 6px; }
.field input {
  width: 100%; height: 52px; padding: 0 16px;
  font-size: 17px; background: var(--bg-2); color: var(--text);
  border: 1px solid transparent; border-radius: var(--r);
  transition: border-color .2s, background .2s;
}
.field input::placeholder { color: var(--text-3); }
.field input:focus { outline: none; border-color: var(--text); background: var(--bg); }
.field.has-error input { border-color: var(--danger); }
.field-hint { font-size: 13px; color: var(--text-3); margin-top: 6px; }
.field-hint a { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }
.field-error { font-size: 13px; color: var(--danger); margin-top: 6px; }
.form-error { margin: 0 0 16px; padding: 12px 14px; border-radius: var(--r); background: var(--bg-2); border-left: 3px solid var(--danger); font-size: 14px; }
.privacy { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 18px; font-size: 13px; color: var(--text-3); }
.privacy .ic { width: 15px; height: 15px; }

/* Home: hero band */
.band {
  position: relative; overflow: hidden; color: #fff; background: #000;
  padding: 44px 0 36px;
}
.band .bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 45%; opacity: .5; }
.band::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(0,0,0,.65), rgba(0,0,0,.15)); }
.band .container { position: relative; z-index: 1; }
.band .kicker { color: rgba(255, 255, 255, .75); }
.band h1 { font-size: clamp(26px, 6.6vw, 44px); font-weight: 500; line-height: 1.18; margin-top: 8px; max-width: 18ch; }
.band .meta { margin-top: 14px; font-size: 14px; color: rgba(255, 255, 255, .82); display: flex; flex-wrap: wrap; gap: 4px 18px; }
.band .meta .dot { background: #a6c34c; }

/* Home: รายงานพลังงาน (กล่องมืดใต้แถวประกัน) */
.impact-wrap {
  margin-top: 20px; padding: 22px 16px 14px; border-radius: var(--r-lg); color: #fff;
  background: linear-gradient(100deg, rgba(0, 0, 0, .82), rgba(0, 0, 0, .55)), url('../images/hero.webp') center 60% / cover, #0b0c0b;
}
.impact-kicker { font-size: 11.5px; line-height: 1.5; color: rgba(255, 255, 255, .65); }
.impact-title { font-size: 15px; font-weight: 500; line-height: 1.4; color: rgba(255, 255, 255, .92); margin-top: 2px; }
.impact { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 16px; }
.impact-cell { padding: 2px 10px 2px 0; min-width: 0; }
.impact-cell + .impact-cell { border-left: 1px solid rgba(255, 255, 255, .16); padding-left: 10px; }
.impact-label { display: flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 500; line-height: 1.3; color: rgba(255, 255, 255, .78); white-space: nowrap; }
.impact-label .ic { width: 15px; height: 15px; color: #a6c34c; }
.impact-value { font-size: clamp(20px, 6.2vw, 42px); font-weight: 500; line-height: 1.15; margin-top: 6px; color: #fff; white-space: nowrap; }
.impact-value small { display: block; font-size: 12px; font-weight: 400; color: rgba(255, 255, 255, .72); margin: 2px 0 0; }
.impact-sub { font-size: 11.5px; line-height: 1.4; color: rgba(255, 255, 255, .7); margin-top: 4px; }
.impact-note { margin-top: 16px; font-size: 12px; line-height: 1.6; color: rgba(255, 255, 255, .62); }
.impact-info { margin-top: 2px; font-size: 13px; color: rgba(255, 255, 255, .7); max-width: 72ch; }
.impact-info summary { cursor: pointer; list-style: none; display: inline-flex; align-items: center; gap: 6px; padding: 6px 0; }
.impact-info summary::-webkit-details-marker { display: none; }
.impact-info summary .ic { width: 16px; height: 16px; }
.impact-info p { margin-top: 4px; line-height: 1.7; }
.impact-info b { color: #fff; }

/* Home: แถวประกัน / ล้างแผง / วันติดตั้ง (3 ช่องทุกขนาดจอ) */
.metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-bottom: 1px solid var(--line); }
.metric { padding: 18px 8px 18px 0; min-width: 0; }
.metric + .metric { border-left: 1px solid var(--line); padding-left: 10px; }
.metric-label { font-size: 11.5px; font-weight: 500; line-height: 1.35; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.metric-value { font-size: clamp(22px, 7vw, 40px); font-weight: 500; line-height: 1.15; margin-top: 6px; }
.metric-value small { display: block; font-size: 12px; font-weight: 400; color: var(--text-2); margin-top: 2px; }
.metric-value.is-date { font-size: clamp(14px, 4.2vw, 30px); white-space: nowrap; padding-top: 4px; }
.metric-value.is-warn { color: var(--warn); }
.metric-value.is-empty { color: var(--danger); }
.metric-sub { font-size: 11.5px; line-height: 1.45; color: var(--text-2); margin-top: 8px; }
.metrics .meter { margin-top: 10px; }
.history { margin-top: 6px; font-size: 11.5px; color: var(--text-2); }
.history summary { cursor: pointer; list-style: none; display: inline-flex; align-items: center; gap: 4px; text-decoration: underline; text-underline-offset: 3px; }
.history summary::-webkit-details-marker { display: none; }
.history ol { margin: 6px 0 0 20px; }
.offline-note { margin-top: 16px; }
.skeleton { padding: 40px 0; color: var(--text-3); font-size: 14px; }

/* Home: คู่มือของคุณ (การ์ดใหญ่) */
.tile {
  position: relative; display: flex; flex-direction: column; overflow: hidden;
  margin-bottom: 12px; border-radius: var(--r-lg); background: var(--bg-2);
  transition: background .2s;
}
.tile:hover { background: var(--bg-3); }
.tile-media {
  height: 220px; overflow: hidden; display: flex; justify-content: center; padding-top: 16px;
  background: radial-gradient(110% 90% at 50% 100%, #34373b 0%, #121315 55%, #08090a 100%);
}
.tile-media img { width: 46%; max-width: 240px; height: auto; align-self: flex-start; border-radius: 14px 14px 0 0; transition: transform .5s var(--ease); }
.tile:hover .tile-media img { transform: translateY(-4px); }
.tile-body { padding: 18px 18px 20px; }
.tile-name { display: flex; align-items: center; gap: 14px; }
.tile-brand { font-size: 12.5px; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; color: var(--text-2); }
.tile-title { font-size: 24px; font-weight: 500; line-height: 1.2; }
.tile-desc { margin-top: 12px; }
.tile-tag {
  position: absolute; top: 12px; left: 12px; z-index: 1;
  font-size: 12px; font-weight: 500; padding: 4px 10px; border-radius: 99px;
  background: #fff; color: #171a20;
}
.tile .app-icon { width: 56px; height: 56px; }
.tile-cta { display: inline-flex; align-items: center; gap: 4px; margin-top: 12px; font-size: 14px; font-weight: 500; }
.tile-cta .ic { width: 16px; height: 16px; }

/* Home: คู่มือยี่ห้ออื่น */
.apps { display: grid; grid-template-columns: 1fr; gap: 8px; }
.app-row {
  display: flex; align-items: center; gap: 14px; min-height: 76px; padding: 14px 16px;
  border-radius: var(--r-lg); background: var(--bg-2); transition: background .2s;
}
.app-row:hover { background: var(--bg-3); }
.app-row .chev { color: var(--text-3); width: 18px; height: 18px; }

/* โลโก้แอป */
.app-icon { width: 44px; height: 44px; border-radius: 22.5%; flex-shrink: 0; }
.app-icon.is-lg { width: 64px; height: 64px; }
.guide-title { display: flex; align-items: center; gap: 16px; margin-top: 14px; }
.guide-title h1 { margin-top: 0; }

/* Page header */
.page-top { padding: 28px 0 8px; }
.crumb { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; margin-left: -4px; padding: 0 6px; border-radius: var(--r); font-size: 14px; color: var(--text-2); }
.crumb:hover { color: var(--text); background: var(--bg-2); }
.crumb .ic { width: 18px; height: 18px; }
.page-top h1 { font-size: clamp(30px, 8vw, 48px); font-weight: 500; line-height: 1.12; letter-spacing: -.01em; margin-top: 10px; }
.page-top .lead { font-size: 16px; color: var(--text-2); margin-top: 8px; }

/* Guide */
.guide { display: block; }
.toc { display: none; }
.steps { display: flex; flex-direction: column; }
.step { padding: 36px 0; border-top: 1px solid var(--line); }
.step:first-child { border-top: 0; padding-top: 24px; }
.step-no { font-size: 13px; font-weight: 500; letter-spacing: .1em; color: var(--accent); }
.step h2 { font-size: clamp(21px, 5.4vw, 28px); font-weight: 500; line-height: 1.3; margin-top: 4px; }
.step-sub { color: var(--text-2); margin-top: 4px; }
.step-body { margin-top: 20px; }

.shots { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; margin: 0 calc(-1 * var(--gutter)); padding: 0 var(--gutter) 4px; }
.shots::-webkit-scrollbar { display: none; }
.shots.single { justify-content: center; }
.shot {
  position: relative; flex: 0 0 auto; width: min(250px, 68vw);
  scroll-snap-align: center; border-radius: 26px; overflow: hidden;
  background: var(--frame); border: 1px solid var(--line);
}
.shots.single .shot { width: min(290px, 78vw); }
.shot img { width: 100%; height: auto; }
.shot-zoom { position: absolute; right: 10px; bottom: 10px; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: rgba(0, 0, 0, .6); color: #fff; }
.shot-zoom .ic { width: 17px; height: 17px; }
.shot-num { position: absolute; left: 10px; top: 10px; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: #fff; color: #171a20; font-size: 13px; font-weight: 500; }
.shots-hint { text-align: center; font-size: 13px; color: var(--text-3); margin-top: 10px; }

.points { list-style: none; margin-top: 24px; border-top: 1px solid var(--line); }
.point { display: flex; gap: 14px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.point:last-child { border-bottom: 0; }
.point-mark { width: 22px; flex-shrink: 0; color: var(--text-2); padding-top: 2px; }
.point-mark .ic { width: 20px; height: 20px; }
.points.numbered .point-mark { width: 26px; height: 26px; border-radius: 50%; padding: 0; display: grid; place-items: center; background: var(--btn); color: var(--btn-ink); font-size: 13px; font-weight: 500; }
.point-title { font-weight: 500; line-height: 1.45; }
.point-text { color: var(--text-2); font-size: 15px; line-height: 1.65; margin-top: 2px; }

.tips { display: grid; grid-template-columns: 1fr; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.tip { background: var(--bg); padding: 18px; display: flex; gap: 14px; }
.tip .point-mark { color: var(--accent); }
.tip-title { font-weight: 500; line-height: 1.45; }
.tip-text { font-size: 14.5px; color: var(--text-2); margin-top: 2px; }

.help { margin: 48px 0 0; padding: 28px 24px; border-radius: var(--r-lg); background: var(--bg-2); display: flex; flex-direction: column; gap: 16px; }
.help h2 { font-size: 20px; font-weight: 500; }
.help p { font-size: 14.5px; color: var(--text-2); margin-top: 2px; }

/* FAQ */
.search { position: relative; margin-top: 22px; }
.search .ic { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--text-3); }
.search input { width: 100%; height: 52px; padding: 0 16px 0 46px; font-size: 16px; background: var(--bg-2); color: var(--text); border: 1px solid transparent; border-radius: var(--r); }
.search input:focus { outline: none; border-color: var(--text); background: var(--bg); }
.tabs { display: flex; gap: 4px; margin-top: 16px; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--line); }
.tabs::-webkit-scrollbar { display: none; }
.tab { flex-shrink: 0; padding: 10px 14px; font-size: 15px; font-weight: 500; color: var(--text-2); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tab[aria-pressed="true"] { color: var(--text); border-bottom-color: var(--text); }
.faq-group { margin-top: 36px; }
.faq-group h2 { font-size: 20px; font-weight: 500; }
.faq-group .sub { font-size: 13.5px; color: var(--text-2); margin-bottom: 12px; }
.qa { border-bottom: 1px solid var(--line); }
.faq-items { border-top: 1px solid var(--line); }
.qa summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 2px; min-height: 64px; font-size: 16.5px; font-weight: 500; line-height: 1.45; }
.qa summary::-webkit-details-marker { display: none; }
.qa summary .pm { position: relative; width: 14px; height: 14px; flex-shrink: 0; }
.qa summary .pm::before, .qa summary .pm::after { content: ''; position: absolute; left: 0; top: 6px; width: 14px; height: 2px; background: var(--text-2); transition: transform .25s var(--ease); }
.qa summary .pm::after { transform: rotate(90deg); }
.qa[open] summary .pm::after { transform: rotate(0); }
.qa-body { padding: 0 2px 22px; color: var(--text-2); font-size: 15.5px; line-height: 1.75; max-width: 62ch; }
.qa-body ul, .qa-body ol { margin: 6px 0 6px 22px; }
.qa-body li { margin: 3px 0; }
.qa-body a { color: var(--text); font-weight: 500; text-decoration: underline; text-underline-offset: 3px; }
.qa-img { position: relative; display: block; width: 100%; max-width: 420px; margin-top: 14px; border-radius: var(--r-lg); overflow: hidden; background: var(--frame); }
.qa-img { background: #fff; }
.qa-img img { width: 100%; height: auto; max-height: 340px; object-fit: cover; object-position: top; }
.qa-img span { position: absolute; left: 12px; bottom: 12px; display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 99px; background: rgba(0, 0, 0, .65); color: #fff; font-size: 13px; }
.qa-img .ic { width: 16px; height: 16px; }
.empty { padding: 32px 0; color: var(--text-2); }
.empty .btn { margin-top: 14px; }

/* Contact */
.contact-hero { padding: 28px 24px; border-radius: var(--r-lg); background: var(--bg-2); margin-top: 24px; }
.contact-hero .label { font-size: 13px; font-weight: 500; letter-spacing: .04em; color: var(--text-2); }
.contact-hero .value { font-size: clamp(28px, 7vw, 36px); font-weight: 500; line-height: 1.2; margin-top: 4px; }
.contact-hero .hours { color: var(--text-2); font-size: 14.5px; }
.contact-hero .btn { margin-top: 20px; }
.contact-tip { margin-top: 16px; }

.footer { padding: 56px 0 calc(40px + var(--safe-b)); font-size: 13px; color: var(--text-3); }
.footer a:hover { color: var(--text); }

/* ── 5) ขนาดจอ ────────────────────────────────────────────────────────── */

/* มือถือจอเล็ก (เช่น iPhone SE รุ่นแรก) */
@media (max-width: 359px) {
  :root { --gutter: 16px; }
  .tile-media { height: 190px; }
  .page-top h1 { font-size: 28px; }
  .impact-label .ic { display: none; }
  .impact-cell { padding-right: 6px; }
  .impact-cell + .impact-cell { padding-left: 8px; }
  .metric { padding-right: 5px; }
  .metric + .metric { padding-left: 7px; }
  .metric-label { font-size: 10.5px; }
  .metric-value.is-date { font-size: 12.5px; }
}

/* มือถือแนวนอน: ไม่ให้ภาพปกกินจอ */
@media (max-height: 500px) and (orientation: landscape) {
  .login { flex-direction: row; }
  .login-visual { height: auto; min-height: 100svh; flex: 1; }
  .login-panel { flex: 1.2; align-items: center; }
}

/* แท็บเล็ตขึ้นไป */
@media (min-width: 640px) {
  :root { --gutter: 32px; }
  .metric { padding: 26px 24px 26px 0; }
  .metric + .metric { padding-left: 24px; }
  .metric-label { font-size: 13px; }
  .metric-value small { display: inline; font-size: .5em; margin: 0 0 0 4px; }
  .metric-sub, .history { font-size: 13.5px; }
  .impact-wrap { margin-top: 28px; padding: 32px 32px 18px; }
  .apps { grid-template-columns: repeat(3, 1fr); gap: 12px; }
  .impact-cell { padding-right: 24px; }
  .impact-cell + .impact-cell { padding-left: 24px; }
  .impact-kicker { font-size: 13px; }
  .impact-title { font-size: 20px; color: #fff; }
  .impact-label { font-size: 13px; gap: 8px; }
  .impact-label .ic { width: 18px; height: 18px; }
  .impact-value small { display: inline; font-size: .4em; margin-left: 6px; }
  .impact-sub { font-size: 13.5px; }
  .tile { flex-direction: row; margin-bottom: 12px; }
  .tile-media { height: auto; min-height: 280px; flex: 1.2; padding-top: 28px; }
  .tile-media img { width: 52%; }
  .tile-body { flex: 1; padding: 28px; display: flex; flex-direction: column; justify-content: center; }
  .tile-title { font-size: 28px; }
  .tips { grid-template-columns: 1fr 1fr; }
  .help { flex-direction: row; align-items: center; justify-content: space-between; padding: 28px 32px; }
  .band { padding: 64px 0 56px; }
  .step-body.has-single { display: grid; grid-template-columns: minmax(220px, 300px) 1fr; gap: 40px; align-items: start; }
  .step-body.has-single .shots { margin: 0; padding: 0; }
  .step-body.has-single .shot { width: 100%; }
  .step-body.has-single .points { margin-top: 0; }
}

/* จอคอม */
@media (min-width: 960px) {
  :root { --topbar-h: 64px; }
  .topnav { display: flex; }
  .topbar-logo img { height: 34px; }

  .login { flex-direction: row; }
  .login-visual { flex: 1.5; height: auto; min-height: 100svh; position: sticky; top: 0; padding: 40px 56px 56px; }
  .login-logo { height: 64px; }
  .login-panel { flex: 1; align-items: center; padding: 56px; }
  .login-form h2 { font-size: 30px; }

  .band { padding: 88px 0 72px; }

  .guide { display: grid; grid-template-columns: 220px 1fr; gap: 56px; align-items: start; }
  .toc { display: block; position: sticky; top: calc(var(--topbar-h) + 28px); padding-top: 24px; }
  .toc ol { list-style: none; border-left: 1px solid var(--line); }
  .toc a { display: block; padding: 7px 0 7px 16px; margin-left: -1px; border-left: 2px solid transparent; font-size: 14px; color: var(--text-2); line-height: 1.4; }
  .toc a:hover { color: var(--text); }
  .toc a.is-active { color: var(--text); border-left-color: var(--text); font-weight: 500; }
  .toc .toc-label { font-size: 12px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); margin-bottom: 10px; }
  .guide-main { max-width: 820px; }
}

@media (min-width: 1280px) {
  .tile-media { min-height: 340px; }
  .tile-media img { width: 36%; }
  .tile-body { padding: 40px 48px; }
}
