/* ---------- fonts ----------
   Google Fonts (loaded in index.html): Urbanist (Latin/UI) + Anuphan (Thai).
   Google Sans Thai is NOT on Google Fonts (the css2 API returns 400 for it), so it
   cannot be fetched. The rule below is a hook: drop a .woff2 into public/fonts/ under
   any of the filenames listed and Thai text switches to it automatically — no code
   change. Until then the family fails to load and Thai falls through to Anuphan.
   See public/fonts/README.md. */
@font-face {
  font-family: 'Google Sans Thai';
  font-style: normal;
  font-weight: 100 900;          /* covers a variable file; a static file renders at its own weight */
  font-display: swap;
  src: url('fonts/GoogleSansThai.woff2') format('woff2'),
       url('fonts/google-sans-thai.woff2') format('woff2'),
       url('fonts/GoogleSansThai-Regular.woff2') format('woff2');
}

/* ==========================================================================
   TOKENS

   LEGACY TOKENS (--ink, --accent, --green, --blue, --line, --sheet, --grey,
   --grey-soft, --green-soft, --blue-soft, --bar-empty) ARE FROZEN.
   The report slides render from these values and go to clients. Do not retune
   them for the app UI — add a --ui-* token instead.
   ========================================================================== */
:root {
  /* --- frozen: report slides depend on these --- */
  --ink: #1f1f1f;
  --ink-soft: #3a3a3a;
  --sheet: #ffffff;
  --line: #d2d2d2;
  --accent: #f04e23;
  --green: #00a651;
  --green-soft: #e6f7ee;
  --blue: #1560bd;
  --blue-soft: #e7f0fb;
  --grey: #6b6b6b;
  --grey-soft: #ededed;
  --bar-empty: #b4b4b4;

  /* --- app skin (bento / sleek tech) --- */
  --ui-floor: #e9eeea;          /* page ground */
  --ui-card: #ffffff;
  --ui-ink: #0b0d0c;            /* near-black for app chrome */
  --ui-ink-2: #5c635e;          /* secondary text */
  --ui-ink-3: #8d948f;          /* tertiary / labels */
  --ui-lime: #edff8c;           /* highlight accent */
  --ui-mint: #cfe1ca;
  --ui-haze: #d8dfe9;
  --ui-line: rgba(11, 13, 12, .09);
  --ui-line-2: rgba(11, 13, 12, .16);
  --ui-hover: rgba(11, 13, 12, .045);
  --ui-danger: #c0391a;

  --r-card: 26px;
  --r-inner: 16px;
  --r-pill: 999px;
  --gap: 14px;
  --shadow-card: 0 1px 2px rgba(11, 13, 12, .04), 0 8px 24px -18px rgba(11, 13, 12, .28);
  --shadow-pop: 0 10px 34px -10px rgba(11, 13, 12, .3);

  /* legacy aliases still referenced by shared rules */
  --floor: var(--ui-floor);
  --radius: var(--r-card);
  --shadow: var(--shadow-card);

  /* Urbanist has no Thai glyphs, so Latin resolves to Urbanist and Thai falls through
     to Google Sans Thai (if present) and then Anuphan. */
  --font-app: 'Urbanist', 'Google Sans Thai', 'Anuphan', system-ui, sans-serif;
  /* Report slides stay on the font already used in client-facing PDFs. */
  --font-slide: 'Noto Sans Thai', system-ui, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  font-family: var(--font-app);
  background: var(--ui-floor);
  color: var(--ui-ink);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--ui-ink); }
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -.02em; }
::selection { background: var(--ui-lime); color: var(--ui-ink); }

:focus-visible { outline: 2px solid var(--ui-ink); outline-offset: 2px; border-radius: 6px; }

/* ---------- form controls ----------
   เบราว์เซอร์วาด select / range / checkbox เป็นสไตล์ของระบบปฏิบัติการ ซึ่งไม่เข้ากับหน้าตาแอป
   บล็อกนี้อยู่ต้นไฟล์โดยตั้งใจ กฎที่เจาะจงกว่า (เช่นในฟอร์ม drawer) จึงยังทับได้ตามเดิม
   สไลด์ไม่มีฟอร์มคอนโทรลเลยสักตัว — slide-guard ยืนยันว่าไม่มีอะไรรั่วไปถึง PDF */
select, textarea,
input[type="text"], input[type="number"], input[type="date"], input[type="password"],
input[type="email"], input[type="tel"], input[type="search"], input:not([type]) {
  border: 1px solid var(--ui-line); border-radius: 10px; background: var(--ui-card);
  padding: 7px 10px; font-size: 13.5px; color: var(--ui-ink);
  transition: border-color .12s, box-shadow .12s;
}
select:hover, textarea:hover,
input[type="text"]:hover, input[type="number"]:hover, input[type="date"]:hover, input:not([type]):hover {
  border-color: var(--ui-line-2);
}
select:focus, textarea:focus, input:focus {
  outline: none; border-color: var(--ui-ink); box-shadow: 0 0 0 3px rgba(11, 13, 12, .07);
}
/* ตัว <select> จริงถูกซ่อน แล้ววาด .tsel แทน (ดู upgradeSelect ใน app.js) —
   รายการที่ OS กางให้ปรับธีมไม่ได้ จึงต้องวาดเองทั้งใบ ไม่ใช่แค่แต่งกล่องที่ปิดอยู่ */
select.tsel-native {
  position: absolute; width: 1px; height: 1px; padding: 0; border: 0;
  opacity: 0; pointer-events: none; overflow: hidden;
}
.tsel {
  display: inline-flex; align-items: center; gap: 6px; width: 100%;
  border: 1px solid var(--ui-line); border-radius: 10px; background: var(--ui-card);
  padding: 7px 9px 7px 11px; font: inherit; font-size: 13.5px; color: var(--ui-ink);
  cursor: pointer; text-align: left; transition: border-color .12s, box-shadow .12s;
}
.tsel:hover:not(:disabled) { border-color: var(--ui-line-2); }
.tsel:focus-visible { outline: none; border-color: var(--ui-ink); box-shadow: 0 0 0 3px rgba(11, 13, 12, .07); }
.tsel:disabled { background: var(--ui-floor); border-color: transparent; color: var(--ui-ink-2); cursor: default; }
.tsel-v { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tsel-arrow { display: grid; place-items: center; flex: none; color: var(--ui-ink-3); }
.tsel-arrow .ico { width: 15px; height: 15px; }
.tsel:disabled .tsel-arrow { display: none; }
.tsel-pop { padding: 6px; max-height: 300px; overflow: auto; }
.tsel-item {
  padding: 8px 11px; border-radius: 10px; font-size: 13.5px; cursor: pointer;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tsel-item:hover, .tsel-item.cursor { background: var(--ui-hover); }
.tsel-item.on { background: var(--ui-lime); font-weight: 600; }
input[type="date"] { cursor: pointer; }
input[type="checkbox"] { width: 17px; height: 17px; accent-color: var(--ui-ink); cursor: pointer; }

/* แถวที่แก้ไม่ได้ (ไม่ใช่ผู้รับผิดชอบ) ต้องอ่านออกว่า "ล็อกอยู่" ไม่ใช่ดูเหมือนช่องว่าง
   ค่าเริ่มต้นของเบราว์เซอร์จางจนเข้าใจผิดว่างานหาย */
select:disabled, textarea:disabled, input:disabled {
  background: var(--ui-floor); border-color: transparent;
  color: var(--ui-ink-2); -webkit-text-fill-color: var(--ui-ink-2); opacity: 1; cursor: default;
}
select:disabled { background-image: none; }

/* แถบเลื่อนต้องวาดเองทั้งราง ทั้งหัวจับ และต้องเขียนซ้ำสำหรับ Firefox ที่ใช้คนละ pseudo-element */
input[type="range"] {
  -webkit-appearance: none; appearance: none; height: 20px; background: transparent; cursor: pointer;
}
input[type="range"]::-webkit-slider-runnable-track { height: 6px; border-radius: var(--r-pill); background: var(--ui-line-2); }
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 16px; height: 16px; margin-top: -5px;
  border-radius: 50%; background: var(--ui-ink); box-shadow: 0 1px 3px rgba(11, 13, 12, .3);
}
input[type="range"]::-moz-range-track { height: 6px; border-radius: var(--r-pill); background: var(--ui-line-2); }
input[type="range"]::-moz-range-thumb {
  width: 16px; height: 16px; border: 0;
  border-radius: 50%; background: var(--ui-ink); box-shadow: 0 1px 3px rgba(11, 13, 12, .3);
}
input[type="range"]:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 4px rgba(11, 13, 12, .15); }

/* ---------- login ---------- */
.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: var(--ui-floor);
  padding: 24px;
}
.login-card {
  width: 100%;
  max-width: 400px;
  background: var(--ui-card);
  border-radius: var(--r-card);
  padding: 38px 34px;
  box-shadow: var(--shadow-card);
}
/* โลโก้ตัวเต็มเป็น svg สัดส่วนกว้างมาก (1920×337) จึงคุมด้วยความสูงแล้วปล่อยความกว้างตามจริง */
.login-card .wordmark { display: block; height: 34px; width: auto; margin-bottom: 18px; }
.login-card h1 { font-size: 30px; letter-spacing: -.03em; font-weight: 700; }
.login-card p.sub { margin: 4px 0 26px; color: var(--ui-ink-3); font-size: 13.5px; }
.login-card label { display: block; font-size: 12.5px; margin: 14px 0 6px; font-weight: 600; color: var(--ui-ink-2); }
.login-card input {
  width: 100%; padding: 12px 14px; border: 1.5px solid var(--ui-line);
  border-radius: 13px; background: #fbfcfb;
}
.login-card input:focus { outline: 0; border-color: var(--ui-ink); background: #fff; }
.login-hint { margin-top: 20px; font-size: 12px; color: var(--ui-ink-2); background: var(--ui-floor); padding: 11px 13px; border-radius: 12px; }


/* ---------- avatar stack on project tiles ----------
   วงกลมซ้อนกัน ขอบวงใช้สีพื้นของไทล์เอง (--tile-bg) จึงดูเหมือนเจาะออกมาจากการ์ด
   ไม่ใช่วงกลมลอยทับ และยังอ่านออกบนไทล์สีเข้มอย่างสีกรม */
.mini-av.xs { width: 26px; height: 26px; font-size: 11.5px; }
.avstack { display: flex; align-items: center; }
.avstack .mini-av { box-shadow: 0 0 0 2px var(--tile-bg, var(--ui-card)); cursor: pointer; transition: transform .12s; }
.avstack .mini-av + .mini-av { margin-left: -9px; }
.avstack .mini-av:hover { transform: translateY(-2px); position: relative; z-index: 2; }
.avstack .more { background: rgba(11, 13, 12, .5); }
.tile-people { display: flex; justify-content: flex-end; margin-top: -4px; min-height: 26px; }

/* ---------- รูปโปรไฟล์ ----------
   ใช้ element คนละชนิดกับวงกลมตัวอักษร (img กับ span) แต่ต้องออกมาหน้าตาเดียวกันเป๊ะ
   ทุกที่ที่เคยวาง .mini-av ไว้ ขนาดจึงคุมจากคลาสเดียวกัน แล้วให้รูป cover ลงกรอบ */
.mini-av.has-photo { object-fit: cover; background: var(--ui-floor); }
.mini-av.big { width: 56px; height: 56px; font-size: 22px; }
.mini-av.av { width: 34px; height: 34px; font-size: 13px; }
.photo-row { display: flex; align-items: center; gap: 14px; margin-bottom: 4px; }
.photo-row .btn { margin-right: 6px; }
.photo-row .hint { margin-top: 6px; }

/* ---------- ตัวครอปรูป ----------
   ตัวอย่างที่เห็นคือ canvas ที่วาดด้วยสูตรเดียวกับตอนส่งออก จึงได้ผลตรงกับที่เห็น */
.cropbox {
  position: fixed; z-index: 421; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: min(380px, calc(100vw - 32px)); background: var(--ui-card);
  border-radius: 24px; box-shadow: var(--shadow-pop); padding: 24px;
}
.cropbox h3 { font-size: 18px; margin-bottom: 14px; }
.crop-stage {
  width: 300px; max-width: 100%; aspect-ratio: 1; margin: 0 auto;
  border-radius: 14px; overflow: hidden; background: var(--ui-floor);
  box-shadow: inset 0 0 0 1px var(--ui-line);
}
.crop-stage.round { border-radius: 50%; }
.crop-stage canvas { display: block; width: 100%; height: 100%; cursor: grab; touch-action: none; }
.crop-stage canvas:active { cursor: grabbing; }
.crop-zoom { display: flex; align-items: center; gap: 10px; margin: 16px 0 6px; }
.crop-zoom input[type="range"] { flex: 1; }
.cropbox .hint { text-align: center; }

/* ---------- กล่องยืนยัน ----------
   อยู่เหนือ drawer เพราะบางทีถูกเรียกจากในฟอร์มที่เปิดค้างอยู่ */
.confirm-back { z-index: 420; }
.confirmbox {
  position: fixed; z-index: 421; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: min(460px, calc(100vw - 32px)); background: var(--ui-card);
  border-radius: 24px; box-shadow: var(--shadow-pop); padding: 26px 26px 20px;
}
.confirmbox h3 { font-size: 19px; margin-bottom: 10px; }
.confirm-body { font-size: 14px; line-height: 1.65; color: var(--ui-ink-2); }
.confirm-body p { margin: 0 0 10px; }
.confirm-body b { color: var(--ui-ink); }
.confirm-foot { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }
.btn.done { background: var(--green); color: #fff; border-color: var(--green); }
.notice.done { background: var(--ui-mint); }

/* ---------- โปรเจคที่ปิดงานแล้ว ----------
   ไม่ทำเป็นสีเขียวทับสีลูกค้า เพราะสีบนไทล์คือสีประจำลูกค้า ใช้สื่ออย่างอื่นแทน:
   ลดความอิ่มสีลง ติดป้ายเขียว และยกไปไว้ท้ายสุดใต้เส้นคั่น */
.tile-done { filter: saturate(.35); opacity: .82; }
.tile-done:hover { filter: saturate(.9); opacity: 1; }
.tile-done .tile-track i { background: var(--green); }
.tile-flag {
  display: inline-flex; align-items: center; gap: 4px; flex: none;
  background: var(--green); color: #fff; border-radius: var(--r-pill);
  padding: 3px 9px; font-size: 11.5px; font-weight: 700; white-space: nowrap;
}
.tile-flag .ico { width: 12px; height: 12px; }
.cards-split {
  display: flex; align-items: center; gap: 12px; margin: 26px 0 16px;
  font-size: 12.5px; font-weight: 600; color: var(--ui-ink-3); text-transform: uppercase; letter-spacing: .06em;
}
.cards-split::after { content: ''; flex: 1; height: 1px; background: var(--ui-line); }

/* ---------- กล่องงานที่ปิดแล้ว ---------- */
.dlist { display: flex; flex-direction: column; }
.drow {
  display: flex; align-items: center; gap: 11px; padding: 11px 18px; cursor: pointer;
  border-bottom: 1px solid var(--ui-line);
}
.drow:last-child { border-bottom: 0; }
.drow:hover { background: var(--ui-hover); }
.drow .tick {
  width: 26px; height: 26px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: var(--ui-mint); color: #1d4a2b;
}
.drow .tick .ico { width: 15px; height: 15px; }
.drow .nm { font-size: 13.5px; font-weight: 600; }
.drow .when { font-size: 12.5px; color: var(--ui-ink-3); white-space: nowrap; }
.finish-btn { white-space: nowrap; }
.finish-btn .ico { width: 14px; height: 14px; }

/* ---------- inline task controls (การ์ดงานที่ฉันต้องส่ง) ---------- */
.mini-sel { padding: 5px 7px 5px 10px; font-size: 12.5px; border-radius: 9px; }
.mini-sel:hover { border-color: var(--ui-line-2); }
.mini-sel.done { background: #e8f5ec; }
.mini-sel.doing { background: #e9f0fb; }
.mini-sel.feedback { background: #fdece6; }
.inline-prog { display: flex; align-items: center; gap: 8px; }
.inline-prog input[type="range"] { flex: 1; min-width: 64px; accent-color: var(--ui-ink); }
.inline-prog .pv { font-size: 12.5px; color: var(--ui-ink-2); width: 36px; text-align: right; font-variant-numeric: tabular-nums; }
tr.saving { opacity: .5; }

/* ---------- contact chips (หน้าโปรไฟล์) ---------- */
h2 .alias { font-size: 15px; font-weight: 500; color: var(--ui-ink-3); }
.contact-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.cchip {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: var(--r-pill);
  background: var(--ui-card); border: 1px solid var(--ui-line); font-size: 13px; text-decoration: none;
}
.cchip:hover { border-color: var(--ui-line-2); background: var(--ui-hover); }
.cchip .ico { width: 15px; height: 15px; color: var(--ui-ink-3); }
.checkline { display: flex; align-items: center; gap: 9px; font-weight: 500; margin-top: 14px; }


/* ---------- แถบข่าววิ่งบนสุด ----------
   วิ่งด้วย CSS animation ล้วน ๆ ไม่มี timer ต่อเฟรม เนื้อหาถูกวางสองชุดต่อกัน
   พอชุดแรกเลื่อนพ้นจอ ชุดสองมาต่อพอดี ภาพจึงวนได้โดยไม่มีรอยสะดุด */
.ticker {
  display: flex; align-items: stretch; gap: 0; overflow: hidden;
  background: var(--ui-ink); color: #fff; border-radius: var(--r-pill);
  margin: 0 clamp(12px, 2.2vw, 40px) 10px; height: 38px; flex: none;
}
.ticker-tag {
  display: grid; place-items: center; flex: none; padding: 0 14px;
  background: var(--ui-lime); color: var(--ui-ink); font-size: 11px; font-weight: 800; letter-spacing: .12em;
  border-radius: var(--r-pill);
}
.ticker-view { position: relative; flex: 1; min-width: 0; overflow: hidden; display: flex; align-items: center; }
.ticker-run {
  display: flex; align-items: center; gap: 40px; white-space: nowrap; padding-left: 24px;
  animation: tickscroll 40s linear infinite; will-change: transform;
}
.ticker:hover .ticker-run { animation-play-state: paused; }
@keyframes tickscroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.tick-item { display: inline-flex; align-items: center; gap: 9px; font-size: 13px; }
.tick-item b { color: var(--ui-lime); font-weight: 600; }
.tick-dot { width: 7px; height: 7px; border-radius: 50%; flex: none; background: var(--ui-lime); }

/* ---------- นาฬิกาในหัวหน้า ---------- */
.clockw { text-align: right; line-height: 1.15; margin-right: 4px; }
.clockw .ct { font-size: 30px; font-weight: 300; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.clockw .ct .sep { animation: blink 2s steps(1) infinite; }
.clockw .ct .ss { font-size: 15px; color: var(--ui-ink-3); margin-left: 4px; }
.clockw .cd { font-size: 12.5px; color: var(--ui-ink-2); }
@keyframes blink { 0%, 50% { opacity: 1; } 51%, 100% { opacity: .25; } }
@media (max-width: 900px) { .clockw { display: none; } }

/* ---------- dock: เมนูสร้างใหม่ ---------- */
.dockgroup { position: relative; display: flex; }
.dockmenu {
  position: absolute; bottom: calc(100% + 10px); left: 0; min-width: 232px;
  background: var(--ui-card); border-radius: 18px; box-shadow: var(--shadow-pop); padding: 7px;
  display: flex; flex-direction: column; gap: 2px;
  opacity: 0; visibility: hidden; transform: translateY(8px); transition: opacity .14s, transform .14s, visibility .14s;
}
.dockgroup:hover .dockmenu, .dockgroup:focus-within .dockmenu { opacity: 1; visibility: visible; transform: none; }
.dockmenu button {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 11px 13px;
  border: 0; border-radius: 13px; background: transparent; font: inherit; font-size: 13.5px; font-weight: 600;
  cursor: pointer; text-align: left; color: var(--ui-ink);
}
.dockmenu button:hover { background: var(--ui-lime); }
.dockmenu .ico { width: 17px; height: 17px; }

/* ---------- dock: คำขอระหว่างกันเอง ----------
   ต่ำกว่า drawer (300+) เสมอ เพื่อไม่ให้ลอยทับหน้าต่างที่กำลังเปิดอยู่ */
.dock { position: fixed; right: 26px; bottom: 26px; z-index: 120; display: flex; align-items: center; gap: 10px; }
.dockbtn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  height: 56px; padding: 0 20px;
  border: 1px solid var(--ui-line); border-radius: var(--r-pill); background: var(--ui-card); color: var(--ui-ink);
  font: inherit; font-size: 15px; font-weight: 600; cursor: pointer; box-shadow: var(--shadow-pop);
  transition: transform .12s, box-shadow .12s;
}
.dockbtn.round { width: 56px; padding: 0; }
.dockbtn .ico { width: 21px; height: 21px; }
.dockbtn:hover { transform: translateY(-1px); }
.dockbtn.primary { background: var(--ui-ink); color: #fff; border-color: var(--ui-ink); }
.dockbtn.primary .ico { color: var(--ui-lime); }
.dockbtn .dot {
  position: absolute; top: -3px; right: -3px; min-width: 21px; height: 21px; padding: 0 6px;
  border-radius: var(--r-pill); background: var(--ui-ink); color: #fff; font-size: 11px; font-weight: 700;
  display: grid; place-items: center; box-shadow: 0 0 0 2px var(--ui-floor);
}
.dockbtn .dot.hot { background: var(--ui-danger); }

.dockpanel {
  position: fixed; right: 26px; bottom: 92px; z-index: 121;
  width: min(420px, calc(100vw - 36px)); max-height: min(70vh, 600px);
  background: var(--ui-card); border-radius: 22px; box-shadow: var(--shadow-pop);
  display: flex; flex-direction: column; overflow: hidden;
}
.dp-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--ui-line); }
.dp-tabs { display: flex; gap: 4px; }
.dp-tabs button {
  border: 0; background: transparent; font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer;
  padding: 6px 12px; border-radius: var(--r-pill); color: var(--ui-ink-3);
}
.dp-tabs button.on { background: var(--ui-lime); color: var(--ui-ink); }
.dp-body { overflow: auto; }
.dp-row { display: flex; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--ui-line); cursor: pointer; }
.dp-row:hover { background: var(--ui-hover); }
.dp-row.unread { background: #fbffe6; }
.dp-row.resolved { opacity: .5; }
.dp-top { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 3px; }
.dp-text {
  font-size: 13.5px; line-height: 1.45;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.badge.ok { background: var(--ui-mint); color: #1d4a2b; }

/* ---------- thread ในหน้าต่างอ่านคำขอ ---------- */
.thread { display: flex; flex-direction: column; gap: 12px; margin: 4px 0 18px; }
.msg { background: var(--ui-floor); border-radius: 14px; padding: 10px 13px; }
.msg.first { background: var(--ui-lime); }
.msg.mine { background: var(--ui-haze); }
.msg-who { display: flex; align-items: center; gap: 7px; font-size: 12.5px; margin-bottom: 5px; }
.msg-who .sub { margin-left: auto; }
.msg-text { font-size: 13.5px; line-height: 1.5; white-space: pre-wrap; }

@media (max-width: 760px) {
  .dock { right: 12px; bottom: 12px; gap: 8px; }
  .dockbtn { height: 50px; padding: 0 16px; }
  .dockbtn.round { width: 50px; }
  .ticker { margin: 0 12px 8px; }
  .dockbtn.primary span { display: none; }
  .dockbtn.primary { padding: 0 13px; }
  .dockpanel { right: 12px; left: 12px; width: auto; bottom: 70px; }
}

/* ==========================================================================
   APP SHELL — top pill nav
   ========================================================================== */
.app { min-height: 100vh; display: flex; flex-direction: column; }

.topbar {
  display: flex; align-items: center; gap: 10px;
  padding: 14px clamp(12px, 2.2vw, 40px); flex-wrap: wrap;
  position: sticky; top: 0; z-index: 30;
  background: color-mix(in srgb, var(--ui-floor) 88%, transparent);
  backdrop-filter: blur(12px);
}
.topbar .mark {
  width: 40px; height: 40px; border-radius: 12px; flex: none; display: block;
}
.pillnav { display: flex; gap: 6px; background: transparent; flex-wrap: wrap; }
.pillnav button {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--ui-card); border: 0; color: var(--ui-ink-2);
  padding: 10px 18px; border-radius: var(--r-pill); cursor: pointer;
  font-size: 14px; font-weight: 500; white-space: nowrap;
  transition: background .14s, color .14s;
}
.pillnav button:hover { background: #fff; color: var(--ui-ink); }
.pillnav button.on { background: var(--ui-ink); color: #fff; font-weight: 600; }
.pillnav .ico { width: 15px; height: 15px; flex: none; }
.topbar .spacer { flex: 1; }

.userchip {
  display: inline-flex; align-items: center; gap: 10px;
  background: var(--ui-card); border-radius: var(--r-pill); padding: 6px 8px 6px 16px;
}
.userchip .who { font-size: 13.5px; font-weight: 600; line-height: 1.15; }
.userchip .role { font-size: 11.5px; color: var(--ui-ink-3); line-height: 1.15; }
.userchip .av {
  width: 34px; height: 34px; border-radius: 50%; background: var(--ui-mint);
  display: grid; place-items: center; font-weight: 700; font-size: 14px; color: var(--ui-ink);
}

/* full-bleed: the studio works on wide monitors, so use the whole screen and let
   padding scale with the viewport instead of capping the content width */
.work { padding: 8px clamp(12px, 2.2vw, 40px) 80px; width: 100%; flex: 1; }

/* ---------- page head ---------- */
.crumb { display: flex; align-items: center; gap: 8px; color: var(--ui-ink-3); font-size: 13px; margin-bottom: 6px; }
.crumb b { color: var(--ui-ink-2); font-weight: 500; }
.crumb .sep { opacity: .55; }

.page-head { display: flex; align-items: flex-end; gap: 16px; margin: 6px 0 22px; flex-wrap: wrap; }
.page-head h2 {
  font-size: clamp(34px, 4.2vw, 54px); font-weight: 600; letter-spacing: -.035em; line-height: 1.02;
}
.page-head .sub { color: var(--ui-ink-3); font-size: 13.5px; }
.page-head .spacer { flex: 1; }
.page-head .tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* ---------- bento grid ---------- */
.bento { display: grid; grid-template-columns: repeat(12, 1fr); gap: var(--gap); align-items: start; }
.bento > .c3  { grid-column: span 3; }
.bento > .c4  { grid-column: span 4; }
.bento > .c5  { grid-column: span 5; }
.bento > .c6  { grid-column: span 6; }
.bento > .c7  { grid-column: span 7; }
.bento > .c8  { grid-column: span 8; }
.bento > .c9  { grid-column: span 9; }
.bento > .c12 { grid-column: span 12; }
@media (max-width: 1180px) {
  .bento > .c3, .bento > .c4, .bento > .c5 { grid-column: span 6; }
  .bento > .c7, .bento > .c8, .bento > .c9 { grid-column: span 12; }
}
@media (max-width: 720px) { .bento > * { grid-column: span 12 !important; } }

/* ---------- cards / panels ---------- */
.panel, .card {
  background: var(--ui-card); border-radius: var(--r-card);
  box-shadow: var(--shadow-card); overflow: hidden; margin-bottom: var(--gap);
}
.bento .panel, .bento .card { margin-bottom: 0; height: 100%; }

.panel > header {
  background: transparent; color: var(--ui-ink);
  padding: 18px 20px 10px; font-weight: 600; font-size: 16.5px; letter-spacing: -.02em;
  display: flex; align-items: center; gap: 10px;
}
.panel > header .spacer { flex: 1; }
.panel > header .hint { font-size: 12.5px; color: var(--ui-ink-3); font-weight: 400; }
.panel-body { padding: 4px 20px 20px; }
.panel.flush .panel-body { padding: 0; }

/* card with a tinted ground, used for accent tiles in the bento */
.card.lime { background: var(--ui-lime); }
.card.mint { background: var(--ui-mint); }
.card.haze { background: var(--ui-haze); }
.card.dark { background: var(--ui-ink); color: #fff; }
.card.dark .k, .card.dark .sub { color: rgba(255, 255, 255, .62); }

.card-head { display: flex; align-items: center; gap: 10px; padding: 18px 20px 0; }
.card-head h3 { font-size: 16.5px; font-weight: 600; }
.card-head .sub { font-size: 12.5px; color: var(--ui-ink-3); }
.card-head .spacer { flex: 1; }

/* ---------- buttons ---------- */
.btn {
  border: 0; background: var(--ui-ink); color: #fff;
  padding: 10px 18px; border-radius: var(--r-pill); cursor: pointer;
  font-size: 14px; font-weight: 500; white-space: nowrap;
  display: inline-flex; align-items: center; gap: 7px;
  transition: background .14s, opacity .14s;
}
.btn:hover { background: #000; }
.btn.accent { background: var(--ui-lime); color: var(--ui-ink); font-weight: 600; }
.btn.accent:hover { background: #e4fa6a; }
.btn.ghost { background: var(--ui-card); color: var(--ui-ink); border: 0; }
.btn.ghost:hover { background: #fff; box-shadow: inset 0 0 0 1.5px var(--ui-line-2); }
.btn.small { padding: 6px 13px; font-size: 12.5px; }
.btn.danger { background: transparent; color: var(--ui-danger); box-shadow: inset 0 0 0 1.5px rgba(192, 57, 26, .25); }
.btn.danger:hover { background: rgba(192, 57, 26, .07); }
.btn:disabled { opacity: .4; cursor: not-allowed; }

.iconbtn {
  width: 40px; height: 40px; border-radius: 50%; border: 0; flex: none;
  background: var(--ui-card); color: var(--ui-ink); cursor: pointer;
  display: grid; place-items: center; position: relative;
  transition: background .14s, transform .14s;
}
.iconbtn:hover { background: #fff; transform: translateY(-1px); }
.iconbtn.on { background: var(--ui-ink); color: #fff; }
.iconbtn.small { width: 32px; height: 32px; }
.iconbtn .dot {
  position: absolute; top: -2px; right: -2px; min-width: 17px; height: 17px; padding: 0 4px;
  border-radius: 9px; background: var(--ui-lime); color: var(--ui-ink);
  font-size: 10.5px; font-weight: 700; display: grid; place-items: center;
  box-shadow: 0 0 0 2px var(--ui-floor);
}
.ico { width: 16px; height: 16px; display: block; }

/* ---------- tables (app) — slides are locked separately, see SLIDE LOCK ---------- */
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th {
  background: transparent; color: var(--ui-ink-3); font-weight: 600;
  padding: 10px 14px; text-align: left; font-size: 11.5px;
  text-transform: uppercase; letter-spacing: .06em;
  border-bottom: 1px solid var(--ui-line);
}
td { border: 0; border-bottom: 1px solid var(--ui-line); padding: 9px 14px; vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tr:hover td { background: var(--ui-hover); }
td.center, th.center { text-align: center; }
td input, td select, td textarea {
  width: 100%; border: 1.5px solid transparent; background: transparent;
  padding: 6px 9px; border-radius: 10px;
}
td input:hover, td select:hover, td textarea:hover { border-color: var(--ui-line-2); background: #fff; }
td input:focus, td select:focus, td textarea:focus { outline: 0; border-color: var(--ui-ink); background: #fff; }

/* ---------- pills / bars (app) ---------- */
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 13px; border-radius: var(--r-pill);
  font-size: 12.5px; font-weight: 600; white-space: nowrap;
}
.pill::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill.done { background: var(--green-soft); color: var(--green); }
.pill.doing { background: var(--blue-soft); color: var(--blue); }
.pill.pending { background: var(--grey-soft); color: #444; }
.pill.feedback { background: #fdece6; color: var(--accent); }

.bar { display: flex; align-items: center; gap: 9px; }
.bar .track {
  flex: 1; height: 8px; border-radius: var(--r-pill);
  background: rgba(11, 13, 12, .1); overflow: hidden; min-width: 54px;
}
.bar .fill { height: 100%; border-radius: var(--r-pill); background: var(--ui-ink); transition: width .2s; }
.bar .fill.doing { background: var(--blue); }
.bar .fill.pending { background: var(--ui-ink-3); }
.bar .fill.feedback { background: var(--accent); }
.bar .num { font-size: 12.5px; width: 40px; color: var(--ui-ink-2); font-weight: 600; font-variant-numeric: tabular-nums; }

/* ---------- stats ---------- */
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(148px, 1fr)); gap: var(--gap); margin-bottom: var(--gap); }
.stat { background: var(--ui-card); border-radius: var(--r-card); padding: 18px 20px; box-shadow: var(--shadow-card); }
.stat .n { font-size: 38px; font-weight: 600; line-height: 1.05; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.stat .l { font-size: 12.5px; color: var(--ui-ink-3); margin-top: 2px; }
.stat.a .n { color: var(--accent); }
.stat.g .n { color: var(--green); }
.stat.b .n { color: var(--blue); }

/* big figure inside a bento tile */
.figure { padding: 20px; }
.figure .k { font-size: 12.5px; color: var(--ui-ink-3); }
.figure .v { font-size: 44px; font-weight: 600; letter-spacing: -.045em; line-height: 1.05; font-variant-numeric: tabular-nums; }
.badge {
  display: inline-flex; align-items: center; gap: 5px; background: var(--ui-lime); color: var(--ui-ink);
  border-radius: var(--r-pill); padding: 3px 11px; font-size: 12.5px; font-weight: 600;
}
.badge.quiet { background: var(--ui-floor); color: var(--ui-ink-2); }
.badge.warn { background: #fdece6; color: var(--accent); }

/* ---------- project cards ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: var(--gap); }
.pcard {
  background: var(--ui-card); border-radius: var(--r-card); padding: 20px; cursor: pointer;
  box-shadow: var(--shadow-card); transition: transform .14s, box-shadow .14s;
  display: flex; flex-direction: column; gap: 12px;
}
.pcard:hover { transform: translateY(-3px); box-shadow: var(--shadow-pop); }
.pcard .top { display: flex; align-items: center; gap: 12px; }
.pcard .client { font-size: 12.5px; color: var(--ui-ink-3); }
.pcard h3 { font-size: 17px; letter-spacing: -.025em; }
.pcard .meta { display: flex; gap: 14px; font-size: 12.5px; color: var(--ui-ink-3); flex-wrap: wrap; }
.pcard .meta b { color: var(--ui-ink); }

/* client logo / fallback monogram */
.logo-badge {
  width: 46px; height: 46px; border-radius: 14px; flex: none;
  display: grid; place-items: center; overflow: hidden;
  font-weight: 700; font-size: 18px; color: #fff; letter-spacing: -.02em;
  background: var(--ui-ink);
}
.logo-badge img { width: 100%; height: 100%; object-fit: cover; display: block; }
.logo-badge.round { border-radius: 50%; }
.logo-badge.sm { width: 32px; height: 32px; font-size: 13px; border-radius: 10px; }

/* ---------- form grid ---------- */
.form-grid {
  display: grid; grid-template-columns: 190px 1fr; gap: 0;
  border: 1px solid var(--ui-line); border-radius: var(--r-inner); overflow: hidden;
}
.form-grid > div { padding: 11px 14px; border-bottom: 1px solid var(--ui-line); }
.form-grid > div:nth-child(odd) { background: #fafbfa; font-weight: 600; font-size: 13px; color: var(--ui-ink-2); }
.form-grid > div:nth-last-child(-n+2) { border-bottom: 0; }
.form-grid input, .form-grid select, .form-grid textarea {
  width: 100%; border: 1.5px solid transparent; background: transparent;
  padding: 5px 8px; border-radius: 10px; resize: vertical;
}
.form-grid input:hover, .form-grid select:hover, .form-grid textarea:hover { border-color: var(--ui-line-2); background: #fff; }
.form-grid input:focus, .form-grid select:focus, .form-grid textarea:focus { outline: 0; border-color: var(--ui-ink); background: #fff; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap); align-items: start; }
@media (max-width: 1080px) { .two-col { grid-template-columns: 1fr; } }

/* health grid — app copy, decoupled from the slide's .s-health */
.health-grid { display: grid; grid-template-columns: repeat(5, 1fr); border: 1px solid var(--ui-line); border-radius: var(--r-inner); overflow: hidden; }
.health-grid > div { padding: 16px 14px; border-right: 1px solid var(--ui-line); }
.health-grid > div:last-child { border-right: 0; }
.health-grid h4 { font-size: 14.5px; }
.health-grid select, .health-grid input {
  border: 1.5px solid var(--ui-line); border-radius: 10px; padding: 5px 9px; background: #fff;
}
.health-grid select:focus, .health-grid input:focus { outline: 0; border-color: var(--ui-ink); }
@media (max-width: 1080px) { .health-grid { grid-template-columns: repeat(2, 1fr); } }

/* ---------- calendar (app) ---------- */
.cal { width: 100%; border-collapse: separate; border-spacing: 4px; background: transparent; table-layout: fixed; }
.cal th {
  background: transparent; color: var(--ui-ink-3); padding: 6px; text-align: center;
  font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; border: 0;
}
.cal td {
  border: 0; background: #fafbfa; border-radius: 14px;
  height: 118px; vertical-align: top; padding: 8px;
}
.cal tr:hover td { background: #fafbfa; }
.cal td.dim { background: transparent; color: var(--ui-ink-3); }
.cal td.today { background: var(--ui-lime); }
.cal .dnum { font-size: 14px; font-weight: 600; margin-bottom: 5px; color: var(--ui-ink-2); }
.cal td.today .dnum { color: var(--ui-ink); }

.chip {
  display: block; font-size: 11.5px; padding: 3px 9px; border-radius: 8px; margin-bottom: 4px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; color: #fff;
  font-weight: 500;
}
.chip.send { background: #c77dd8; }
.chip.feedback { background: var(--blue); }
.chip.final { background: var(--accent); }
.chip.due { background: #4a4a4a; }
.chip.milestone { background: var(--green); }

.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12.5px; color: var(--ui-ink-3); margin: 14px 4px 0; }
.legend span::before { content: ''; display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.legend .s::before { background: #c77dd8; } .legend .f::before { background: var(--blue); }
.legend .n::before { background: var(--accent); } .legend .d::before { background: #4a4a4a; }

/* ---------- tabs ---------- */
.tabs { display: flex; gap: 6px; margin-bottom: 18px; flex-wrap: wrap; }
.tabs button {
  background: var(--ui-card); border: 0; padding: 10px 18px; border-radius: var(--r-pill);
  cursor: pointer; font-size: 14px; color: var(--ui-ink-2); font-weight: 500;
  transition: background .14s, color .14s;
}
.tabs button:hover { color: var(--ui-ink); }
.tabs button.on { background: var(--ui-ink); color: #fff; font-weight: 600; }

/* ---------- misc ---------- */
.toast {
  position: fixed; right: 22px; bottom: 22px; background: var(--ui-ink); color: #fff;
  padding: 13px 20px; border-radius: 14px; font-size: 14px; z-index: 99; box-shadow: var(--shadow-pop);
}
.toast.err { background: var(--ui-danger); }
.empty { padding: 38px; text-align: center; color: var(--ui-ink-3); }
.row-actions { display: flex; gap: 6px; justify-content: center; }
.tag { display: inline-block; background: var(--ui-floor); border-radius: 8px; padding: 3px 9px; font-size: 12.5px; margin: 0 4px 4px 0; }
.tag button { border: 0; background: none; cursor: pointer; color: var(--ui-ink-3); padding: 0 0 0 4px; }
.tag button:hover { color: var(--ui-danger); }


/* ---------- dashboard: lists inside bento cards ---------- */
.sub { color: var(--ui-ink-3); font-size: 12.5px; }
.card-body { padding: 6px 20px 20px; }
.plist, .wlist, .dl { padding: 4px 10px 12px; }
.prow, .wrow, .dl-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 10px; border-radius: var(--r-inner); cursor: pointer;
  transition: background .12s;
}
.prow:hover, .wrow:hover, .dl-row:hover { background: var(--ui-hover); }
.prow .grow, .wrow .grow, .dl-row .grow { flex: 1; min-width: 0; }
.prow .nm, .wrow .nm, .dl-row .nm {
  font-weight: 600; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.prow .sub, .wrow .sub, .dl-row .sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.prow .counts { display: flex; gap: 12px; font-size: 12.5px; color: var(--ui-ink-3); flex: none; }
.prow .counts b { color: var(--ui-ink); }
.prow .barwrap { width: 160px; flex: none; }
.wrow .num { font-size: 22px; font-weight: 600; font-variant-numeric: tabular-nums; flex: none; }
.mini-av {
  width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center;
  font-weight: 700; font-size: 14px; color: #fff; flex: none;
}
.dl-row .dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.dl-row .pill { flex: none; }
.dl-more { padding: 6px 12px 2px; font-size: 12.5px; color: var(--ui-ink-3); }
@media (max-width: 900px) {
  .prow .counts, .prow .barwrap { display: none; }
  .dl-row .pill { display: none; }
}

/* ---------- client logo ---------- */
.logo-wrap { position: relative; flex: none; }
.logo-edit {
  position: absolute; right: -5px; bottom: -5px;
  width: 20px; height: 20px; border-radius: 50%; border: 0; padding: 0;
  background: var(--ui-ink); color: #fff; cursor: pointer;
  font-size: 13px; line-height: 1; display: grid; place-items: center;
  box-shadow: 0 0 0 2px var(--ui-card); opacity: 0; transition: opacity .12s;
}
.logo-wrap:hover .logo-edit, .logo-edit:focus-visible { opacity: 1; }
.pcard .top .grow { min-width: 0; }
.pcard .top h3 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.logo-row { display: flex; align-items: center; gap: 14px; }
.logo-row .hint { font-size: 12.5px; color: var(--ui-ink-3); }


/* ---------- assignee picker (multi-select in a table cell) ---------- */
td.acell { padding: 4px 8px; }
.apick {
  display: flex; flex-wrap: wrap; gap: 4px; align-items: center;
  min-height: 32px; padding: 4px 6px; border-radius: 10px;
  border: 1.5px solid transparent; cursor: pointer;
}
.apick:hover { border-color: var(--ui-line-2); background: #fff; }
.apick:focus-visible { outline: 0; border-color: var(--ui-ink); background: #fff; }
.apick-empty { color: var(--ui-ink-3); font-size: 13px; }
.achip {
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--ui-floor); border-radius: var(--r-pill);
  padding: 2px 4px 2px 6px; font-size: 12.5px; font-weight: 500; white-space: nowrap;
}
.achip i { width: 7px; height: 7px; border-radius: 50%; background: var(--c, var(--ui-ink)); flex: none; }
.achip button {
  border: 0; background: none; cursor: pointer; color: var(--ui-ink-3);
  font-size: 14px; line-height: 1; padding: 0 3px; border-radius: 50%;
}
.achip button:hover { color: var(--ui-danger); background: rgba(192, 57, 26, .1); }

.apick-pop {
  position: fixed; z-index: 320; background: var(--ui-card);
  border-radius: 18px; box-shadow: var(--shadow-pop); padding: 10px;
  max-height: 300px; display: flex; flex-direction: column;
}
.apick-search {
  width: 100%; border: 1.5px solid var(--ui-line); border-radius: 11px;
  padding: 8px 11px; font-size: 13.5px; background: #fbfcfb;
}
.apick-search:focus { outline: 0; border-color: var(--ui-ink); background: #fff; }
.apick-list { overflow-y: auto; margin-top: 8px; flex: 1; }
.apick-item {
  display: flex; align-items: center; gap: 9px; padding: 7px 9px;
  border-radius: 12px; cursor: pointer; font-size: 13.5px;
}
.apick-item:hover { background: var(--ui-hover); }
.apick-item.on { background: var(--ui-lime); }
.apick-item .grow { flex: 1; min-width: 0; }
.apick-item .mini-av { width: 26px; height: 26px; font-size: 11.5px; }
.apick-item .sub { font-size: 11.5px; }
.apick-check { color: var(--ui-ink); font-weight: 700; }
.apick-none { padding: 14px 10px; color: var(--ui-ink-3); font-size: 13px; text-align: center; }
.apick-add:empty { display: none; }
.apick-addbtn {
  display: flex; align-items: center; gap: 7px; width: 100%; margin-top: 6px;
  padding: 9px 11px; border: 1px dashed var(--ui-line-2); border-radius: 12px;
  background: var(--ui-card); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; text-align: left;
}
.apick-addbtn:hover { background: var(--ui-lime); border-style: solid; border-color: var(--ui-ink); }
.apick-addbtn:disabled { opacity: .5; cursor: default; }
.apick-addbtn .ico { width: 16px; height: 16px; }
.apick-foot { font-size: 11px; color: var(--ui-ink-3); padding: 8px 4px 2px; border-top: 1px solid var(--ui-line); margin-top: 6px; }


/* ---------- calendar: drag to move, click to edit ---------- */
.cal td[data-date] .chip[draggable="true"] { cursor: grab; }
.cal td[data-date] .chip.dragging { opacity: .4; cursor: grabbing; }
.cal td.drop { background: var(--ui-lime); box-shadow: inset 0 0 0 2px var(--ui-ink); }
.cal td.drop .dnum { color: var(--ui-ink); }

/* ---------- edit drawer ---------- */
.drawer-back {
  position: fixed; inset: 0; background: rgba(11, 13, 12, .34);
  z-index: 300; animation: fade .14s ease-out;
}
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(420px, 100vw);
  background: var(--ui-card); z-index: 301; display: flex; flex-direction: column;
  box-shadow: -18px 0 50px -20px rgba(11, 13, 12, .45);
  animation: slidein .16s ease-out;
}
@keyframes fade { from { opacity: 0; } }
@keyframes slidein { from { transform: translateX(24px); opacity: .6; } }
.drawer > header { display: flex; align-items: center; gap: 10px; padding: 20px 20px 12px; }
.drawer > header h3 { font-size: 19px; }
.drawer > header .spacer { flex: 1; }
.drawer-body { padding: 4px 20px 20px; overflow-y: auto; flex: 1; }
.drawer-body label {
  display: block; font-size: 12px; font-weight: 600; color: var(--ui-ink-2);
  margin: 16px 0 6px; text-transform: uppercase; letter-spacing: .05em;
}
.drawer-body label b { color: var(--ui-ink); font-size: 13px; }
.drawer-body input, .drawer-body textarea, .drawer-body select {
  width: 100%; border: 1.5px solid var(--ui-line); border-radius: 12px;
  padding: 9px 12px; background: #fbfcfb; resize: vertical;
}
.drawer-body input:focus, .drawer-body textarea:focus, .drawer-body select:focus {
  outline: 0; border-color: var(--ui-ink); background: #fff;
}
.drawer-body input[type="range"] { padding: 0; border: 0; background: transparent; accent-color: var(--ui-ink); }
.drawer-body .apick { border: 1.5px solid var(--ui-line); background: #fbfcfb; min-height: 40px; }
.drawer > footer {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 20px 18px; border-top: 1px solid var(--ui-line);
}
.drawer > footer .spacer { flex: 1; }


/* ---------- team page: expandable people ---------- */
.tlist { padding: 4px 10px 12px; }
.tperson { border-radius: var(--r-inner); overflow: hidden; margin-bottom: 2px; }
.tperson.open { background: #fafbfa; }
.trow {
  display: flex; align-items: center; gap: 12px; padding: 11px 10px;
  border-radius: var(--r-inner); cursor: pointer; transition: background .12s;
}
.trow:hover { background: var(--ui-hover); }
.trow:focus-visible { outline: 2px solid var(--ui-ink); outline-offset: -2px; }
.trow .grow { flex: 1; min-width: 0; }
.trow .nm { font-weight: 600; font-size: 14.5px; }
.trow .nm .sub { display: inline; font-size: 12px; }
.trow .chev {
  width: 16px; flex: none; color: var(--ui-ink-3); font-size: 17px;
  transition: transform .16s; display: inline-block; text-align: center;
}
.tperson.open .chev { transform: rotate(90deg); color: var(--ui-ink); }
.trow .tstats { display: flex; gap: 6px; flex: none; flex-wrap: wrap; }
.trow .barwrap { width: 150px; flex: none; }

.tdetail { padding: 0 10px 14px 38px; }
.tdetail-body { border: 1px solid var(--ui-line); border-radius: var(--r-inner); overflow: hidden; background: var(--ui-card); }
.tdetail table { font-size: 13.5px; }
.tdetail td .sub { font-size: 11.5px; }
.tdetail tr.late td { background: #fff7f4; }
.tdetail tr.late:hover td { background: #ffefe9; }
.pdot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 7px; vertical-align: 0; }
.tsum { padding: 10px 14px; font-size: 12.5px; color: var(--ui-ink-3); border-top: 1px solid var(--ui-line); }
.tsum b { color: var(--ui-ink); font-size: 14px; }
@media (max-width: 900px) {
  .trow .barwrap, .trow .tstats { display: none; }
  .tdetail { padding-left: 10px; }
}


/* ---------- read-only / locked state ---------- */
.is-locked { opacity: .92; }
.is-locked input, .is-locked select, .is-locked textarea {
  background: transparent !important; border-color: transparent !important;
  cursor: default; color: var(--ui-ink-2);
}
.apick.locked { cursor: default; }
.apick.locked .achip button { display: none; }
.notice {
  background: var(--ui-haze); color: var(--ui-ink); border-radius: var(--r-inner);
  padding: 11px 16px; font-size: 13px; margin-bottom: var(--gap);
}
.chip-locked { cursor: default; }
tr.t-done td { background: rgba(0, 166, 81, .05); }

/* ---------- team row: profile affordance ---------- */
.chev-open {
  font-size: 12.5px; color: var(--ui-ink-3); white-space: nowrap; flex: none;
  padding: 5px 11px; border-radius: var(--r-pill); background: var(--ui-floor);
}
.chev-open:hover { background: var(--ui-ink); color: #fff; }

/* ---------- investor health card ---------- */
.hlist { padding: 4px 10px 12px; }
.hrow {
  display: flex; align-items: center; gap: 12px; padding: 10px;
  border-radius: var(--r-inner); cursor: pointer;
}
.hrow:hover { background: var(--ui-hover); }
.hrow .grow { flex: 1; min-width: 0; }
.hrow .nm { font-weight: 600; font-size: 14px; }
.hdots { display: flex; gap: 5px; flex: none; }
.hdot { width: 11px; height: 11px; border-radius: 50%; display: inline-block; }
.hdot.ok { background: var(--green); }
.hdot.warn { background: #f0a323; }
.hdot.bad { background: var(--accent); }

/* ---------- member profile ---------- */
.memos { padding: 4px 16px 16px; }
.memo-form { display: grid; gap: 8px; margin-bottom: 14px; }
.memo-form select, .memo-form textarea {
  width: 100%; border: 1.5px solid var(--ui-line); border-radius: 12px;
  padding: 9px 12px; background: #fbfcfb; resize: vertical;
}
.memo-form select:focus, .memo-form textarea:focus { outline: 0; border-color: var(--ui-ink); background: #fff; }
.memo-form .btn { justify-self: start; }
.memo {
  border-left: 3px solid var(--ui-line-2); padding: 10px 0 10px 12px; margin-bottom: 10px;
}
.memo.unread { border-left-color: var(--ui-lime); background: rgba(237, 255, 140, .18); border-radius: 0 12px 12px 0; }
.memo-top { display: flex; align-items: center; gap: 8px; margin-bottom: 5px; flex-wrap: wrap; }
.memo-top .spacer { flex: 1; }
.memo-text { font-size: 14px; white-space: pre-wrap; }

.hist { padding: 6px 16px 16px; display: grid; gap: 10px; }
.hist-group { border: 1px solid var(--ui-line); border-radius: var(--r-inner); overflow: hidden; }
.hist-head {
  display: flex; align-items: center; gap: 9px; padding: 10px 14px;
  background: #fafbfa; cursor: pointer; font-size: 13.5px;
}
.hist-head:hover { background: var(--ui-hover); }
.hist-head .spacer { flex: 1; }
.hist-items { display: flex; flex-wrap: wrap; gap: 6px; padding: 12px 14px; }
.hist-item {
  font-size: 12.5px; background: var(--ui-floor); border-radius: var(--r-pill);
  padding: 4px 11px; color: var(--ui-ink-2);
}


/* ---------- budget on project cards (co-founder / investor only) ---------- */
.pcard .money {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  border-top: 1px solid var(--ui-line); padding-top: 11px; margin-top: 2px;
}
.pcard .money .amount { font-weight: 600; font-size: 15px; font-variant-numeric: tabular-nums; }
.pcard .money .badge .ico { width: 13px; height: 13px; }

/* ---------- quotations ---------- */
.qlist { display: grid; gap: 8px; margin-bottom: 12px; }
.qrow {
  display: flex; align-items: center; gap: 12px; padding: 11px 14px;
  border: 1px solid var(--ui-line); border-radius: var(--r-inner); background: #fbfcfb;
}
.qrow .grow { flex: 1; min-width: 0; }
.qrow .nm { font-weight: 600; font-size: 14px; word-break: break-word; }
.qicon { color: var(--ui-ink-2); display: grid; place-items: center; flex: none; }
.qicon .ico { width: 22px; height: 22px; }
.qrow a.btn { text-decoration: none; }
.qrow a.btn .ico { width: 14px; height: 14px; }
.panel-body .hint { font-size: 12px; color: var(--ui-ink-3); }

/* ---------- calendar: clearer month ---------- */
.cal-head {
  display: flex; align-items: center; gap: 10px;
  padding: 16px 20px 4px; flex-wrap: wrap;
}
.cal-head .spacer { flex: 1; }
.cal-month {
  font-size: 22px; font-weight: 600; letter-spacing: -.02em; min-width: 190px; text-align: center;
}
.cal-month span { color: var(--ui-ink-3); font-weight: 500; }
.cal td.dim { background: transparent; opacity: .35; }
.cal td.today { background: var(--ui-lime); box-shadow: inset 0 0 0 2px var(--ui-ink); }
.cal td.packed .chip:nth-of-type(n+4) { display: none; }
.cal td.packed.open .chip:nth-of-type(n+4) { display: block; }
.cal-more {
  border: 0; background: transparent; color: var(--ui-ink-3); cursor: pointer;
  font-size: 11px; padding: 2px 6px; border-radius: 6px; font-weight: 600;
}
.cal-more:hover { background: var(--ui-line); color: var(--ui-ink); }
.cal td.packed.open { min-height: 0; height: auto; }

/* ---------- calendar hover card ---------- */
.hovercard {
  position: fixed; z-index: 250; width: 290px; pointer-events: none;
  background: var(--ui-card); border-radius: 18px; padding: 14px 16px;
  box-shadow: var(--shadow-pop);
}
.hovercard .hc-top { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--ui-ink-2); }
.hovercard .hc-title { font-size: 15px; font-weight: 600; margin-top: 5px; letter-spacing: -.01em; }
.hovercard .hc-detail { font-size: 12.5px; color: var(--ui-ink-3); margin-top: 3px; }
.hovercard .hc-who { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 8px; }
.hc-person {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 500;
  background: var(--ui-floor); border-radius: var(--r-pill); padding: 3px 10px;
}
.hc-person i { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.hovercard .hc-row { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.hovercard .hc-bar { margin-bottom: 8px; }
.hovercard .hc-foot { font-size: 12px; color: var(--ui-ink-3); border-top: 1px solid var(--ui-line); padding-top: 8px; }


/* ==========================================================================
   RESPONSIVE — phone and iPad
   The app is used on a laptop at the desk, an iPad in the studio and a phone on
   set, so each breakpoint targets a real posture rather than just shrinking.
   ========================================================================== */

/* ---------- iPad landscape / small laptop (<= 1200px) ---------- */
@media screen and (max-width: 1200px) {
  .bento { gap: 12px; }
  .page-head h2 { font-size: clamp(28px, 4.6vw, 40px); }
  .prow .barwrap, .trow .barwrap { width: 120px; }
}

/* ---------- iPad portrait (<= 1024px) ---------- */
@media screen and (max-width: 1024px) {
  .topbar { gap: 8px; padding-top: 10px; padding-bottom: 10px; }
  .pillnav button { padding: 10px 14px; }
  .userchip { padding: 5px 6px 5px 12px; }
  .userchip .who { max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .two-col { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 150px 1fr; }
  .health-grid { grid-template-columns: repeat(2, 1fr); }
  /* wide tables get their own scroller instead of squeezing the columns */
  .card-body.flush, .tdetail-body, .panel > .panel-body > table { overflow-x: auto; }
  .card-body.flush table, .tdetail-body table { min-width: 680px; }
}

/* ---------- phone (<= 760px) ---------- */
@media screen and (max-width: 760px) {
  html, body { font-size: 14.5px; }
  .work { padding: 4px 12px 90px; }
  .topbar {
    padding: 10px 12px; gap: 8px;
    /* the nav scrolls sideways rather than wrapping onto three rows */
    flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none;
  }
  .topbar::-webkit-scrollbar { display: none; }
  .topbar .mark { width: 34px; height: 34px; font-size: 15px; }
  .pillnav { flex-wrap: nowrap; }
  .pillnav button { padding: 9px 12px; font-size: 13px; }
  .pillnav button span, .userchip > div:first-child { display: none; }   /* icons only */
  .userchip { padding: 4px; }
  .iconbtn { width: 36px; height: 36px; }

  .page-head { gap: 10px; margin: 4px 0 16px; align-items: flex-start; flex-direction: column; }
  .page-head .tools { width: 100%; }
  .page-head .tools .btn, .page-head .tools select { flex: 1; justify-content: center; }
  .crumb { font-size: 12px; }

  .bento { gap: 10px; }
  .card, .panel { border-radius: 20px; }
  .figure { padding: 16px; }
  .figure .v { font-size: 34px; }

  /* lists: drop the columns that do not survive a narrow screen */
  .prow, .wrow, .dl-row, .trow, .hrow { padding: 12px 8px; gap: 10px; }
  .prow .counts, .prow .barwrap, .trow .barwrap, .trow .tstats, .dl-row .pill { display: none; }
  .chev-open { padding: 6px 10px; }

  .tabs { overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; padding-bottom: 2px; }
  .tabs::-webkit-scrollbar { display: none; }
  .tabs button { white-space: nowrap; }

  .form-grid { grid-template-columns: 1fr; }
  .form-grid > div:nth-child(odd) { padding-bottom: 2px; border-bottom: 0; }
  .form-grid > div:nth-child(even) { padding-top: 2px; }
  .health-grid { grid-template-columns: 1fr; }
  .health-grid > div { border-right: 0; border-bottom: 1px solid var(--ui-line); }

  .drawer { width: 100%; border-radius: 22px 22px 0 0; top: auto; height: 88vh; }
  .apick-pop { width: calc(100vw - 24px) !important; left: 12px !important; }
  .hovercard { display: none; }          /* no hover on touch — tap opens the drawer */
  .qrow { flex-wrap: wrap; }
  .qrow .grow { flex-basis: 100%; }

  /* touch targets */
  .btn { padding: 11px 16px; }
  .btn.small { padding: 8px 13px; }
  td input, td select, td textarea { padding: 9px; }
}

/* ---------- phone: the month grid becomes an agenda ----------
   A 7-column month is unreadable at 360px, so on a phone the calendar collapses to
   a list of the days that actually have something on them. */
@media screen and (max-width: 700px) {
  .cal { border-spacing: 0; display: block; }
  .cal thead { display: none; }
  .cal tbody, .cal tr { display: block; }
  .cal td {
    display: block; width: auto; height: auto; min-height: 0;
    border-radius: 14px; margin-bottom: 6px; padding: 10px 12px;
  }
  .cal td.dim { display: none; }
  .cal td:not(:has(.chip)) { display: none; }        /* empty days add nothing here */
  .cal td.packed .chip:nth-of-type(n+4) { display: block; }   /* no need to collapse */
  .cal-more { display: none; }
  .cal .dnum { font-size: 15px; margin-bottom: 6px; }
  .cal-head { padding: 14px 14px 2px; }
  .cal-month { font-size: 19px; min-width: 0; flex: 1; }
  .legend { font-size: 11.5px; gap: 10px; }
}

/* landscape phone: keep the top bar from eating the screen */
@media (max-height: 480px) and (orientation: landscape) {
  .topbar { position: static; }
}


/* ---------- archive ---------- */
tr.t-archived td { background: rgba(11, 13, 12, .035); }
tr.t-archived td input, tr.t-archived td select { color: var(--ui-ink-3); }
tr.t-archived td:first-child::after {
  content: 'คลัง'; display: block; font-size: 9.5px; color: var(--ui-ink-3);
  letter-spacing: .06em; margin-top: 2px;
}
.prow.arch { opacity: .72; }
.prow.arch .nm { color: var(--ui-ink-2); }

/* archived items stay visible in the calendar but clearly retired */
.cal td[data-date] .chip.arch {
  background: transparent !important; color: var(--ui-ink-3) !important;
  box-shadow: inset 0 0 0 1px var(--ui-line-2);
  text-decoration: line-through; text-decoration-thickness: 1px;
}
.cal td[data-date] .chip.arch:hover { background: var(--ui-floor) !important; }

/* ---------- monthly overview ---------- */
.mlist { padding: 4px 10px 12px; }
.mrow {
  display: flex; align-items: center; gap: 12px; padding: 9px 10px;
  border-radius: var(--r-inner); cursor: pointer; transition: background .12s;
}
.mrow:hover { background: var(--ui-hover); }
.mrow.on { background: var(--ui-lime); }
.mrow .mname { width: 150px; flex: none; font-weight: 600; font-size: 13.5px; }
.mrow .mname .badge { font-size: 10.5px; padding: 1px 7px; }
.mrow .grow { flex: 1; min-width: 0; }
.mrow .mcount { font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums; flex: none; width: 34px; text-align: right; }
.mbar { height: 9px; border-radius: var(--r-pill); background: rgba(11, 13, 12, .07); overflow: hidden; margin-bottom: 4px; }
.mbar > span { display: block; height: 100%; border-radius: var(--r-pill); background: rgba(11, 13, 12, .22); }
.mbar > span > i { display: block; height: 100%; border-radius: var(--r-pill); background: var(--green); }
@media screen and (max-width: 760px) {
  .mrow .mname { width: 108px; font-size: 12.5px; }
  .mrow .mname .badge { display: none; }
}


/* ---------- alerts panel (top-bar bell) ---------- */
.iconbtn .dot.hot { background: var(--accent); color: #fff; }
.alerts {
  position: fixed; z-index: 260; width: min(360px, calc(100vw - 24px));
  background: var(--ui-card); border-radius: 20px; box-shadow: var(--shadow-pop);
  overflow: hidden; max-height: min(70vh, 560px); display: flex; flex-direction: column;
}
.alerts-head {
  display: flex; align-items: baseline; gap: 8px;
  padding: 15px 18px 10px; border-bottom: 1px solid var(--ui-line);
}
.alerts-head b { font-size: 14.5px; }
.alerts-body { overflow-y: auto; padding: 6px; }
.alert-row {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  border-radius: 14px; cursor: pointer;
}
.alert-row:hover { background: var(--ui-hover); }
.alert-row .grow { flex: 1; min-width: 0; }
.alert-row .nm { font-weight: 600; font-size: 13.5px; }
.alert-row .adot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--ui-ink-3); }
.alert-row.late .adot { background: var(--accent); }
.alert-row.soon .adot { background: #f0a323; }

/* ---------- priority list: late reads hotter than upcoming ---------- */
.dl-row.late { background: rgba(240, 78, 35, .05); }
.dl-row.late:hover { background: rgba(240, 78, 35, .09); }
.dl-row.today { background: rgba(240, 163, 35, .07); }
.dl-row .nm .badge { font-size: 10.5px; padding: 1px 7px; }

/* a project card that is slipping says so */
.pcard.has-late { box-shadow: var(--shadow-card), inset 0 0 0 1.5px rgba(240, 78, 35, .35); }
.pcard .top .badge.warn { flex: none; }

/* ---------- quick jump ---------- */
.jump-back {
  position: fixed; inset: 0; z-index: 400; background: rgba(11, 13, 12, .35);
  display: flex; justify-content: center; padding: 12vh 16px 16px;
  animation: fade .12s ease-out;
}
.jump {
  width: min(620px, 100%); background: var(--ui-card); border-radius: 22px;
  box-shadow: var(--shadow-pop); overflow: hidden; display: flex; flex-direction: column;
  max-height: 70vh;
}
.jump-input {
  width: 100%; border: 0; border-bottom: 1px solid var(--ui-line);
  padding: 18px 22px; font-size: 16px; background: transparent;
}
.jump-input:focus { outline: 0; }
.jump-list { overflow-y: auto; padding: 8px; flex: 1; }
.jump-row {
  display: flex; align-items: center; gap: 11px; padding: 10px 12px;
  border-radius: 14px; cursor: pointer;
}
.jump-row.on { background: var(--ui-lime); }
.jump-row .grow { flex: 1; min-width: 0; }
.jump-row .nm { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.jump-row .sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.jump-row .dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.jump-foot {
  padding: 10px 20px; font-size: 11.5px; color: var(--ui-ink-3);
  border-top: 1px solid var(--ui-line);
}
@media screen and (max-width: 760px) {
  .jump-back { padding-top: 6vh; }
  .jump-foot { display: none; }
}


/* ==========================================================================
   PROJECT TILES
   Each project is a colour tile: a pale tint of its own colour, black text and a
   big mark in the corner. The tint is computed from --pc rather than using the raw
   project colour, because client colours run from #EDFF8C to #1B1464 and black text
   has to stay readable on every one of them.
   ========================================================================== */
.cards { grid-template-columns: repeat(auto-fill, minmax(232px, 1fr)); }

.pcard.tile {
  --tile-bg: color-mix(in srgb, var(--pc, #6B7280) 20%, #fff);
  --tile-deep: color-mix(in srgb, var(--pc, #6B7280) 88%, #000);
  background: var(--tile-bg);
  color: var(--ui-ink);
  border-radius: 24px;
  padding: 18px;
  min-height: 216px;
  display: flex; flex-direction: column; gap: 0;
  box-shadow: none;
  transition: transform .14s, box-shadow .14s;
}
.pcard.tile:hover { transform: translateY(-3px); box-shadow: var(--shadow-pop); }

.tile-head { display: flex; align-items: flex-start; gap: 8px; }
.tile-label {
  flex: 1; min-width: 0;
  font-size: 15px; font-weight: 600; letter-spacing: -.02em; line-height: 1.25;
  /* long client names wrap to two lines rather than being cut mid-word */
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; word-break: break-word;
}
.tile-late {
  flex: none; min-width: 22px; height: 22px; padding: 0 6px;
  border-radius: var(--r-pill); background: var(--ui-ink); color: #fff;
  font-size: 12px; font-weight: 700; display: grid; place-items: center;
}
.tile-name {
  font-size: 12.5px; line-height: 1.35; margin-top: 3px;
  color: color-mix(in srgb, var(--ui-ink) 62%, var(--tile-bg));
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

/* the big mark, in the reference's bottom-left position */
.tile-mark { flex: 1; display: flex; align-items: flex-end; padding: 14px 0 12px; }
.tile-mark .logo-wrap { flex: none; }
.pcard.tile .logo-badge.lg {
  width: 52px; height: 52px; border-radius: 16px;
  font-size: 24px; font-weight: 800; letter-spacing: -.04em;
  background: var(--tile-deep); color: #fff;
}
.pcard.tile .logo-badge.lg img { border-radius: 16px; }
.pcard.tile .logo-edit { box-shadow: 0 0 0 2px var(--tile-bg); }

.tile-foot { display: grid; gap: 7px; }
.tile-row { display: flex; align-items: baseline; gap: 8px; }
.tile-pct {
  font-size: 20px; font-weight: 700; letter-spacing: -.03em;
  font-variant-numeric: tabular-nums; line-height: 1;
}
.tile-counts {
  flex: 1; min-width: 0; text-align: right; font-size: 11.5px;
  color: color-mix(in srgb, var(--ui-ink) 55%, var(--tile-bg));
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tile-track {
  height: 6px; border-radius: var(--r-pill);
  background: color-mix(in srgb, var(--ui-ink) 12%, transparent);
  overflow: hidden;
}
.tile-track > i { display: block; height: 100%; border-radius: var(--r-pill); background: var(--tile-deep); }

.tile-money {
  display: flex; align-items: center; gap: 8px;
  border-top: 1px solid color-mix(in srgb, var(--ui-ink) 12%, transparent);
  padding-top: 7px; margin-top: 1px;
}
.tile-money .amount {
  flex: 1; min-width: 0; font-size: 13px; font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tile-doc {
  flex: none; display: inline-flex; align-items: center; gap: 4px;
  font-size: 11.5px; font-weight: 600;
  color: color-mix(in srgb, var(--ui-ink) 65%, var(--tile-bg));
}
.tile-doc .ico { width: 13px; height: 13px; }

@media screen and (max-width: 760px) {
  .cards { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
  .pcard.tile { min-height: 178px; padding: 14px; border-radius: 20px; }
  .tile-label { font-size: 13.5px; }
  .pcard.tile .logo-badge.lg { width: 42px; height: 42px; font-size: 19px; border-radius: 13px; }
  .tile-pct { font-size: 17px; }
  .tile-counts { font-size: 10.5px; }
}

/* ==========================================================================
   REPORT SLIDES
   Client-facing. Appearance is frozen — see CLAUDE.md hard rule 5.
   ========================================================================== */
.slide-tools { display: flex; gap: 10px; align-items: center; margin-bottom: 16px; flex-wrap: wrap; }
.slide {
  /* Deliberate: slides keep Noto Sans Thai so the client-facing PDF format is unchanged
     by the app font switch. Remove this line to unify the app and the report. */
  font-family: var(--font-slide);
  width: 1600px; height: 900px; background: var(--sheet); padding: 34px 38px;
  transform-origin: top left; margin-bottom: 22px; position: relative; overflow: hidden;
  font-size: 19px; box-shadow: 0 2px 14px rgba(0, 0, 0, .13);
  color: var(--ink); line-height: 1.5; letter-spacing: normal;
}
.slide-scaler { overflow: hidden; }
.s-head { display: flex; align-items: stretch; border-radius: 18px; background: var(--ink); overflow: hidden; margin-bottom: 26px; }
.s-head .logo { background: var(--ink); color: #fff; width: 210px; display: grid; place-items: center; font-weight: 800; letter-spacing: .12em; font-size: 22px; text-align: center; line-height: 1.15; }
.s-head .logo small { display: block; font-size: 9px; letter-spacing: .25em; color: #a5a5a5; }
.s-head .mid { flex: 1; background: #fff; padding: 14px 30px; display: flex; flex-direction: column; justify-content: center; }
.s-head .mid h1 { font-size: 46px; line-height: 1.1; font-weight: 700; letter-spacing: -.01em; }
.s-head .mid p { margin: 3px 0 0; font-size: 20px; color: #4a4a4a; }
.s-head .date { background: var(--ink); color: #fff; padding: 14px 30px; display: flex; flex-direction: column; justify-content: center; align-items: flex-end; border-radius: 16px; margin: 8px; }
.s-head .date span { font-size: 19px; color: #d0d0d0; }
.s-head .date b { font-size: 27px; }
.s-panel { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.s-panel > h3 { background: var(--ink); color: #fff; padding: 10px 18px; font-size: 21px; font-weight: 600; letter-spacing: -.01em; }
.slide .note { display: flex; gap: 10px; font-size: 15.5px; color: #444; margin: 12px 4px; }
.slide .note i { color: var(--accent); font-style: normal; font-size: 19px; }
.s-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px 8px; padding: 16px; }
.s-summary div { text-align: center; }
.s-summary .k { font-size: 17px; color: #333; }
.s-summary .v { font-size: 29px; font-weight: 800; }
.s-health { display: grid; grid-template-columns: repeat(5, 1fr); }
.s-health > div { padding: 16px 12px; text-align: center; border-right: 1px solid var(--line); }
.s-health > div:last-child { border-right: 0; }
.s-health h4 { font-size: 23px; font-weight: 700; }
.s-health .ok { color: var(--green); font-weight: 700; font-size: 18px; }
.s-health .warn { color: var(--accent); font-weight: 700; font-size: 18px; }
.s-health p { margin: 4px 0 0; font-size: 15px; color: #4a4a4a; }

/* --------------------------------------------------------------------------
   SLIDE LOCK
   The slides share generic classes with the app (table/th/td, .pill, .bar,
   .cal, .chip). These rules re-assert the slides' original appearance at a
   higher specificity than the app rules above, so restyling the app can never
   leak into a client PDF. Values here are the pre-redesign ones — do not
   "tidy" them to match the app.
   -------------------------------------------------------------------------- */
.slide table { width: 100%; border-collapse: collapse; border-spacing: 0; font-size: 17px; }
.slide th {
  background: var(--ink); color: #fff; font-weight: 600; padding: 8px 10px;
  text-align: left; font-size: 16.5px; text-transform: none; letter-spacing: normal;
  border: 0; border-bottom: 0;
}
.slide td { border: 1px solid var(--line); padding: 7px 10px; vertical-align: middle; background: transparent; }
.slide tbody tr:last-child td { border-bottom: 1px solid var(--line); }
.slide tr:hover td { background: transparent; }
.slide td.center, .slide th.center { text-align: center; }

.slide .pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 14px;
  border-radius: 999px; font-size: 15px; font-weight: 600; white-space: nowrap;
}
.slide .pill::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.slide .pill.done { background: var(--green-soft); color: var(--green); }
.slide .pill.doing { background: var(--blue-soft); color: var(--blue); }
.slide .pill.pending { background: var(--grey-soft); color: #444; }
.slide .pill.feedback { background: #fdece6; color: var(--accent); }

.slide .bar { display: flex; align-items: center; gap: 8px; }
.slide .bar .track { flex: 1; height: 19px; border-radius: 999px; background: var(--bar-empty); overflow: hidden; min-width: 60px; }
.slide .bar .fill { height: 100%; border-radius: 999px; background: var(--green); transition: none; }
.slide .bar .fill.doing { background: var(--blue); }
.slide .bar .fill.pending { background: var(--bar-empty); }
.slide .bar .fill.feedback { background: var(--bar-empty); }
.slide .bar .num { font-size: 12.5px; width: 38px; color: var(--grey); font-weight: 400; font-variant-numeric: normal; }
/* the global h1-h4 tracking changed for the app; slides keep the original */
.slide h1, .slide h2, .slide h3, .slide h4 { letter-spacing: -.01em; }

.slide .cal { width: 100%; border-collapse: collapse; border-spacing: 0; background: var(--sheet); table-layout: fixed; }
.slide .cal th { background: var(--ink); color: #fff; padding: 8px 10px; text-align: center; font-size: 16.5px; text-transform: none; letter-spacing: normal; }
.slide .cal td { border: 1px solid var(--line); height: 118px; vertical-align: top; padding: 7px 10px; background: transparent; border-radius: 0; }
.slide .cal td.dim { background: #f6f6f6; color: #b0b0b0; opacity: 1; }
.slide .cal td.today { background: #fff6f2; box-shadow: inset 0 0 0 2px var(--accent); }
.slide .cal .dnum { font-size: 20px; font-weight: 600; margin-bottom: 4px; color: var(--ink); }
.slide .chip {
  display: block; font-size: 14px; padding: 2px 7px; border-radius: 6px; margin-bottom: 3px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #fff; font-weight: 400;
}
.slide .chip.send { background: #c77dd8; }
.slide .chip.feedback { background: var(--blue); }
.slide .chip.final { background: var(--accent); }
.slide .chip.due { background: #4a4a4a; }
.slide .chip.milestone { background: var(--green); }

/* ---------- print ---------- */
@media print {
  @page { size: A4 landscape; margin: 0; }
  body { background: #fff; }
  /* every piece of app chrome must be hidden — add new chrome classes here */
  .topbar, .side, .slide-tools, .page-head, .crumb, .tabs, .toast, .drawer, .drawer-back, .hovercard, .cal-head, .alerts, .jump-back, .notice, .dock, .dockpanel, .ticker, .dockmenu, .no-print { display: none !important; }
  .work { padding: 0; max-width: none; }
  .app, .shell { display: block; }
  .slide-scaler { width: auto !important; height: auto !important; overflow: visible; }
  .slide { transform: none !important; zoom: .70; width: 1600px; height: 900px; page-break-after: always; box-shadow: none; margin: 0; }
}
