/* 喵的，又要上班了 v4 — 九命夢境風格（紙卡＋縫線皮革），淺色與深色（夜班）兩套.
   Sections: 1 font + tokens (light, dark, shift colours) · 2 shell · 3 paper cards, stitches, leather ·
   4 chips · 5 page header · 6 bottom nav + cat button · 7 overview · 8 schedule · 9 salary · 10 me · 11 sheets.
   Every colour that differs between the themes is a --v4-* token; leather (brown, red, gold) stays the same in both. */

/* ── 1. Font + tokens ── */
@font-face{font-family:"Meow Serif TC";src:url("./v4/meow-serif-v4.woff") format("woff");font-weight:900;font-style:normal;font-display:swap}
html.v4{
  --v4-bg-top:#eadfcb;--v4-bg-bottom:#e1d1b6;--v4-bg-rgb:225,209,182;
  --v4-card:#f6eee1;--v4-card-gold:#f8e8cc;--v4-card-line:#8a6a4f;--v4-stitch:rgba(168,132,100,.6);
  --v4-tile:#efe3cf;--v4-tile-line:#d6c2a4;--v4-track:#e6d8c0;--v4-field:#fbf6ec;--v4-input:#fffaf2;--v4-sel:rgba(239,227,207,.7);--v4-placeholder:#a58a74;
  --v4-ink:#3b2417;--v4-title:#4a2a1a;--v4-sub:#5b3a29;--v4-muted:#7a5d4a;--v4-nav:#6b4a36;
  /* Muted text straight on the page paper (not on a card) is a shade darker to stay at 4.5:1. */
  --v4-muted-bg:#6e5241;
  --v4-red:#bb453d;--v4-red-text:#a83d35;--v4-green:#3b7536;--v4-orange:#c96614;--v4-brown:#8a5c3f;
  --v4-purple:#6a3fa0;--v4-blue:#2c5c8c;--v4-leaf:#4c6b35;--v4-rose:#b23a57;--v4-danger:#b23a3a;
  --v4-shadow:0 8px 18px rgba(90,58,38,.1),0 2px 0 rgba(90,58,38,.12);
  --v4-shadow-float:0 12px 28px rgba(90,58,38,.22),0 3px 0 rgba(90,58,38,.18);
  --v4-shadow-dialog:0 18px 40px rgba(59,36,23,.28),0 3px 0 rgba(90,58,38,.18);
  --v4-backdrop:rgba(59,36,23,.38);--v4-hairline:rgba(168,132,100,.45);
  --v4-switch-off:#e6d8c0;--v4-switch-line:#b9a284;
  --v4-pro-bg:#3b2417;--v4-pro-ink:#f6e3c0;
  --v4-toast-bg:#3b2417;--v4-toast-ink:#fff7ec;--v4-toast-bad:#a83d35;--v4-toast-act:#ffd9a6;--v4-toast-btn-line:rgba(255,241,226,.5);--v4-toast-btn-bg:rgba(255,247,236,.12);
  --v4-red-line:#9b4334;--v4-red-dash:rgba(168,61,53,.45);
  --v4-ok-bg:#e1efd9;--v4-ok-line:#a9cf9a;--v4-ok-ink:#3b7536;
  --v4-warn-bg:#fbe3df;--v4-warn-line:#e0a49c;
  --v4-danger-press:#f3e2d6;--v4-ring-top:#f6ead6;--v4-ring-bottom:#e2cba6;
  /* The shift palette (班別顏色): ten colours, each [bg, line, ink] in both themes. assets/meow-v4-theme.js keeps the
     same values for the share image and the widget. */
  --v4-p-amber-bg:#f7e3b8;--v4-p-amber-line:#dcb06c;--v4-p-amber-ink:#86470a;
  --v4-p-peach-bg:#fde2cc;--v4-p-peach-line:#e9a774;--v4-p-peach-ink:#93430f;
  --v4-p-brick-bg:#f6dcd6;--v4-p-brick-line:#e3a79e;--v4-p-brick-ink:#9b2f27;
  --v4-p-rose-bg:#fbe3e8;--v4-p-rose-line:#d9667f;--v4-p-rose-ink:#b23a57;
  --v4-p-purple-bg:#efe4fa;--v4-p-purple-line:#8e5cc4;--v4-p-purple-ink:#6a3fa0;
  --v4-p-indigo-bg:#e3e4f6;--v4-p-indigo-line:#a9acd8;--v4-p-indigo-ink:#3c3f8f;
  --v4-p-blue-bg:#dde8f3;--v4-p-blue-line:#a7c0da;--v4-p-blue-ink:#2c5c8c;
  --v4-p-teal-bg:#d9e9e6;--v4-p-teal-line:#9cc3bd;--v4-p-teal-ink:#2c5e5a;
  --v4-p-green-bg:#e3ecd9;--v4-p-green-line:#b9cda5;--v4-p-green-ink:#4c6b35;
  --v4-p-cocoa-bg:#ecdfd1;--v4-p-cocoa-line:#c4a587;--v4-p-cocoa-ink:#6b4429;
  /* Each shift key points at a palette colour; a custom choice only re-points these, so it follows the theme by itself.
     --v4-work-* is set only when 上班 has its own colour (otherwise it takes 早班's, as the shift name decides). */
  --v4-early-bg:var(--v4-p-amber-bg);--v4-early-line:var(--v4-p-amber-line);--v4-early-ink:var(--v4-p-amber-ink);
  --v4-middle-bg:var(--v4-p-blue-bg);--v4-middle-line:var(--v4-p-blue-line);--v4-middle-ink:var(--v4-p-blue-ink);
  --v4-night-bg:var(--v4-p-teal-bg);--v4-night-line:var(--v4-p-teal-line);--v4-night-ink:var(--v4-p-teal-ink);
  --v4-off-bg:var(--v4-p-green-bg);--v4-off-line:var(--v4-p-green-line);--v4-off-ink:var(--v4-p-green-ink);
  --v4-leave-bg:var(--v4-p-rose-bg);--v4-leave-line:var(--v4-p-rose-line);--v4-leave-ink:var(--v4-p-rose-ink);
  --v4-ot-bg:var(--v4-p-purple-bg);--v4-ot-line:var(--v4-p-purple-line);--v4-ot-ink:var(--v4-p-purple-ink);
  --v4-hol-bg:var(--v4-p-rose-bg);--v4-hol-line:var(--v4-p-rose-line);--v4-hol-ink:var(--v4-p-rose-ink);
  --v4-pick-bg:var(--v4-p-amber-bg);--v4-pick-line:var(--v4-orange);--v4-pick-ink:var(--v4-p-amber-ink);
  --v4-new-bg:var(--v4-p-brick-bg);--v4-new-line:var(--v4-p-brick-line);--v4-new-ink:var(--v4-p-brick-ink);
  --v4-serif:"Meow Serif TC","Noto Serif TC","Songti TC","STSongti-TC-Bold","Source Han Serif TC",serif;
  --v4-sans:-apple-system,BlinkMacSystemFont,"PingFang TC","Noto Sans TC","Microsoft JhengHei",sans-serif;
  --v4-leather-brown:linear-gradient(180deg,#986e51 0%,#8a5c3f 18%,#8a5c3f 84%,#906446 100%);
  --v4-leather-gold:linear-gradient(180deg,#e3ac55 0%,#d39a3a 20%,#d39a3a 85%,#d8a246 100%);
  --v4-leather-red:linear-gradient(180deg,#c55d51 0%,#bb453d 16%,#bb453d 84%,#c4584b 100%);
  --v4-safe-top:env(safe-area-inset-top,0px);--v4-safe-bottom:env(safe-area-inset-bottom,0px);--v4-safe-left:env(safe-area-inset-left,0px);--v4-safe-right:env(safe-area-inset-right,0px);
  color-scheme:light;
}
/* Night version: dark walnut paper and worn leather, warm cream ink. Text pairs pass WCAG AA (4.5:1) on cards and tiles. */
html.v4.dark{
  --v4-bg-top:#2b2019;--v4-bg-bottom:#1e1611;--v4-bg-rgb:30,22,17;
  --v4-card:#35281f;--v4-card-gold:#3d2e1d;--v4-card-line:#7a5c43;--v4-stitch:rgba(224,186,142,.34);
  --v4-tile:#2a1f18;--v4-tile-line:#5a4336;--v4-track:#4a382a;--v4-field:#211916;--v4-input:#211916;--v4-sel:rgba(122,92,67,.38);--v4-placeholder:#9a7f66;
  --v4-ink:#f4e8d6;--v4-title:#f7e1c1;--v4-sub:#e2c9ab;--v4-muted:#c9b5a7;--v4-nav:#d7bd9f;--v4-muted-bg:#c9b5a7;
  --v4-red:#f0907f;--v4-red-text:#f5a090;--v4-green:#a3d18f;--v4-orange:#f2a65a;--v4-brown:#c99a72;
  --v4-purple:#cfb0f2;--v4-blue:#9fc6ee;--v4-leaf:#b2d69a;--v4-rose:#f3a1b5;--v4-danger:#f0907f;
  --v4-shadow:0 8px 18px rgba(0,0,0,.32),0 2px 0 rgba(0,0,0,.28);
  --v4-shadow-float:0 12px 28px rgba(0,0,0,.5),0 3px 0 rgba(0,0,0,.36);
  --v4-shadow-dialog:0 18px 40px rgba(0,0,0,.55),0 3px 0 rgba(0,0,0,.36);
  --v4-backdrop:rgba(8,5,3,.6);--v4-hairline:rgba(224,186,142,.28);
  --v4-switch-off:#4a382a;--v4-switch-line:#7a5c43;
  --v4-pro-bg:#f0d9b0;--v4-pro-ink:#3b2417;
  --v4-toast-bg:#f0e2cc;--v4-toast-ink:#2b1d14;--v4-toast-bad:#f0907f;--v4-toast-act:#9b4a12;--v4-toast-btn-line:rgba(43,29,20,.3);--v4-toast-btn-bg:rgba(43,29,20,.06);
  --v4-red-line:#c0604f;--v4-red-dash:rgba(245,160,144,.55);
  --v4-ok-bg:#253a22;--v4-ok-line:#5f8f52;--v4-ok-ink:#a3d18f;
  --v4-warn-bg:#47231f;--v4-warn-line:#b4574a;
  --v4-danger-press:#4a2a22;--v4-ring-top:#2e2219;--v4-ring-bottom:#1a120d;
  --v4-p-amber-bg:#4a3418;--v4-p-amber-line:#a77a36;--v4-p-amber-ink:#f6d08c;
  --v4-p-peach-bg:#4b2b18;--v4-p-peach-line:#b8743f;--v4-p-peach-ink:#f8c39b;
  --v4-p-brick-bg:#4b231e;--v4-p-brick-line:#b4574a;--v4-p-brick-ink:#f6aca0;
  --v4-p-rose-bg:#47212b;--v4-p-rose-line:#b0566c;--v4-p-rose-ink:#f6a9bb;
  --v4-p-purple-bg:#33244a;--v4-p-purple-line:#9a72cf;--v4-p-purple-ink:#d8bdf6;
  --v4-p-indigo-bg:#262a4c;--v4-p-indigo-line:#6a70b8;--v4-p-indigo-ink:#c0c4f6;
  --v4-p-blue-bg:#1f3346;--v4-p-blue-line:#4f7aa3;--v4-p-blue-ink:#acd0f3;
  --v4-p-teal-bg:#1b3633;--v4-p-teal-line:#4b8a82;--v4-p-teal-ink:#a3dfd6;
  --v4-p-green-bg:#263521;--v4-p-green-line:#5e8048;--v4-p-green-ink:#bbdca3;
  --v4-p-cocoa-bg:#3c2b1f;--v4-p-cocoa-line:#8c6a4f;--v4-p-cocoa-ink:#ebcaab;
  color-scheme:dark;
}

/* ── 2. Shell: one paper background, no illustrated header, no sidebar ── */
html.v4,html.v4 body{background:linear-gradient(180deg,var(--v4-bg-top),var(--v4-bg-bottom)) fixed!important;background-color:var(--v4-bg-bottom)!important;color:var(--v4-ink)}
html.v4 body{font-family:var(--v4-sans)}
html.v4 .shell{display:block!important;max-width:none!important}
html.v4 .sidebar,html.v4 .hero-wrap,html.v4 #mobileRestCard{display:none!important}
html.v4 .main{padding:0!important;margin:0!important;background:none!important;max-width:none!important;width:100%!important}
html.v4 #page-dashboard>:not(.v4-page):not(dialog),
html.v4 #page-calendar>:not(.v4-page):not(dialog),
html.v4 #page-salary>:not(.v4-page):not(dialog),
html.v4 #page-settings>:not(.v4-page):not(dialog){display:none!important}
html.v4 .page{padding:0!important;margin:0!important;background:none!important}
html.v4 .page.active{display:block}
html.v4 #page-attendance.active{padding:calc(var(--v4-safe-top) + 14px) 16px calc(120px + var(--v4-safe-bottom))!important;max-width:520px;margin:0 auto!important}

.v4-page{box-sizing:border-box;width:100%;max-width:460px;margin:0 auto;padding:calc(var(--v4-safe-top) + 12px) 16px calc(128px + var(--v4-safe-bottom));color:var(--v4-ink);font-family:var(--v4-sans);-webkit-font-smoothing:antialiased}
.v4-page *,.v4-sheet *{box-sizing:border-box}
:where(.v4-page,.v4-sheet) button{font:inherit;color:inherit;-webkit-tap-highlight-color:transparent}
.v4-stack{display:flex;flex-direction:column;gap:12px}
.v4-row2{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.v4-serif{font-family:var(--v4-serif);font-weight:900}
.v4-ic{width:1em;height:1em;flex:none;fill:none;stroke:currentColor;stroke-width:2.2;stroke-linecap:round;stroke-linejoin:round;display:block}
.v4-hidden{display:none!important}

/* ── 3. Paper cards, stitches, leather ── */
.v4-card{position:relative;background:var(--v4-card);border:1.25px solid var(--v4-card-line);border-radius:16px;box-shadow:var(--v4-shadow);padding:16px;display:flex;flex-direction:column;gap:10px;min-width:0}
.v4-card::before{content:"";position:absolute;inset:3.75px;border:1px dashed var(--v4-stitch);border-radius:11px;pointer-events:none}
.v4-card.compact{padding:14px}
.v4-card.gold{background:var(--v4-card-gold)}
.v4-card.list{padding:12px;gap:0}
.v4-card>*{position:relative}
button.v4-card{text-align:left;width:100%;font:inherit;cursor:pointer}
.v4-card-head{display:flex;align-items:center;gap:8px;min-width:0}
.v4-card-head h3{flex:1;min-width:0;margin:0;font-family:var(--v4-serif);font-weight:900;font-size:15px;line-height:22px;letter-spacing:.04em;color:var(--v4-title);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.v4-card.compact .v4-card-head h3{font-size:14px}
.v4-aside{flex:none;font-size:12px;line-height:16px;font-weight:700;color:var(--v4-muted);white-space:nowrap}
.v4-page .v4-link,.v4-sheet .v4-link{flex:none;font-size:13px;line-height:18px;font-weight:700;color:var(--v4-red-text);background:none;border:0;padding:0;cursor:pointer}

.v4-lic{position:relative;flex:none;display:grid;place-items:center;width:24px;height:24px;border-radius:7px;border:1px solid #755136;background:var(--v4-leather-brown);box-shadow:0 2px 0 #5a3a26,inset 0 1px 0 rgba(255,255,255,.14);color:#fff7ec;font-size:13px}
.v4-lic.sm{width:22px;height:22px;font-size:12px}
.v4-lic.md{width:32px;height:32px;border-radius:10px;font-size:18px}
.v4-lic.row{width:30px;height:30px;border-radius:9px;font-size:17px}
.v4-lic.lg{width:40px;height:40px;border-radius:12px;font-size:22px}
.v4-lic.gold{border-color:#b0782a;background:var(--v4-leather-gold);box-shadow:0 2px 0 #8a5714,inset 0 1px 0 rgba(255,255,255,.14)}

.v4-btn{position:relative;display:inline-flex;align-items:center;justify-content:center;gap:6px;height:44px;padding:0 16px;border-radius:14px;border:1px solid #9b4334;background:var(--v4-leather-red);box-shadow:0 7px 14px rgba(127,36,28,.22),0 3px 0 #7f241c,inset 0 1px 0 rgba(255,255,255,.16);color:#fff7ec;font-family:var(--v4-serif);font-weight:900;font-size:15px;line-height:22px;letter-spacing:.1em;text-shadow:0 1px 0 rgba(70,16,10,.45);cursor:pointer;white-space:nowrap}
.v4-btn::before{content:"";position:absolute;inset:3px;border:1.5px dashed rgba(255,241,226,.6);border-radius:10px;pointer-events:none}
.v4-btn.brown{border-color:#755136;background:var(--v4-leather-brown);box-shadow:0 7px 14px rgba(70,40,20,.2),0 3px 0 #5a3a26,inset 0 1px 0 rgba(255,255,255,.16)}
.v4-btn.block{display:flex;width:100%}
.v4-btn.sm{height:40px;border-radius:12px;font-size:14px;letter-spacing:.1em;padding:0 10px}
.v4-btn.sm::before{border-radius:8px}
.v4-btn:active{transform:translateY(2px);box-shadow:0 3px 8px rgba(70,40,20,.2),0 1px 0 #5a3a26}
.v4-btn[disabled]{opacity:.55;cursor:default}

.v4-track{height:8px;border-radius:4px;background:var(--v4-track);overflow:hidden;width:100%}
.v4-track>i{display:block;height:100%;border-radius:4px;background:var(--v4-orange)}
.v4-track.brown>i{background:var(--v4-brown)}
.v4-dash{height:0;border-top:1px dashed var(--v4-stitch);width:100%;margin:0}

.v4-switch{position:relative;flex:none;width:50px;height:30px;border-radius:15px;border:1px solid var(--v4-switch-line);background:var(--v4-switch-off);cursor:pointer;padding:0}
.v4-switch::after{content:"";position:absolute;top:2px;left:2px;width:24px;height:24px;border-radius:50%;background:#fff7ec;box-shadow:0 1px 2px rgba(59,36,23,.25);transition:left .18s}
.v4-switch.on{border-color:#755136;background:linear-gradient(180deg,#986e51,#8a5c3f)}
.v4-switch.on::after{left:22px}

/* ── 4. Chips (each shift key reads its own colour tokens, so a custom colour reaches every chip) ── */
.v4-chip{display:inline-flex;align-items:center;justify-content:center;gap:3px;padding:2px 7px;border-radius:6px;border:1px solid var(--v4-tile-line);background:var(--v4-tile);color:var(--v4-sub);font-size:11px;line-height:16px;font-weight:700;white-space:nowrap}
.v4-chip .v4-ic{font-size:12px}
.v4-chip.early{background:var(--v4-early-bg);border-color:var(--v4-early-line);color:var(--v4-early-ink)}
.v4-chip.middle{background:var(--v4-middle-bg);border-color:var(--v4-middle-line);color:var(--v4-middle-ink)}
.v4-chip.night{background:var(--v4-night-bg);border-color:var(--v4-night-line);color:var(--v4-night-ink)}
.v4-chip.work{background:var(--v4-work-bg,var(--v4-early-bg));border-color:var(--v4-work-line,var(--v4-early-line));color:var(--v4-work-ink,var(--v4-early-ink))}
.v4-chip.off{background:var(--v4-off-bg);border-color:var(--v4-off-line);color:var(--v4-off-ink)}
.v4-chip.ot{background:var(--v4-ot-bg);border:1.5px solid var(--v4-ot-line);color:var(--v4-ot-ink)}
.v4-chip.holiday{background:var(--v4-hol-bg);border:1px dashed var(--v4-hol-line);color:var(--v4-hol-ink)}
.v4-chip.leave{background:var(--v4-leave-bg);border-color:var(--v4-leave-line);color:var(--v4-leave-ink)}
.v4-chip.today{position:relative;border-color:#9b4334;background:var(--v4-leather-red);color:#fff7ec;text-shadow:0 1px 0 rgba(70,16,10,.45);box-shadow:0 4px 8px rgba(127,36,28,.22),0 2px 0 #7f241c;padding:2px 8px}
.v4-chip.today::before{content:"";position:absolute;inset:1px;border:1.2px dashed rgba(255,241,226,.62);border-radius:4px}
.v4-pro{display:inline-flex;align-items:center;padding:2px 5px;border-radius:5px;background:var(--v4-pro-bg);border:1px solid var(--v4-pro-bg);color:var(--v4-pro-ink);font-size:10px;line-height:15px;font-weight:700}
/* The optional emoji a shift type can carry (班型與班別時間 › 班別顏色). */
.v4-emo{display:inline-block;flex:none;font-style:normal;font-weight:400;line-height:1;text-shadow:none;margin-right:1px}

/* ── 5. Page header ── */
.v4-head{display:flex;align-items:flex-start;gap:12px;margin:0 0 14px;min-height:62px}
.v4-head-text{flex:1;min-width:0;padding-left:4px}
.v4-head-sub{margin:0;font-size:13px;line-height:18px;font-weight:700;color:var(--v4-muted-bg);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.v4-head-title{margin:0;font-family:var(--v4-serif);font-weight:900;font-size:30px;line-height:40px;letter-spacing:.04em;color:var(--v4-title);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.v4-head-side{flex:none;display:flex;gap:8px;align-items:center;margin-top:16px}
.v4-avatar{position:relative;width:46px;height:46px;border-radius:14px;border:1.25px solid var(--v4-card-line);background:var(--v4-tile);overflow:hidden;padding:0;cursor:pointer;flex:none}
.v4-avatar img{position:absolute;left:6%;top:3%;width:82%;height:94%;object-fit:contain}
.v4-avatar img.photo{inset:0;width:100%;height:100%;object-fit:cover;left:0;top:0}
.v4-sq{position:relative;display:grid;place-items:center;width:40px;height:40px;border-radius:12px;border:1px solid #755136;background:var(--v4-leather-brown);box-shadow:0 2px 0 #5a3a26,inset 0 1px 0 rgba(255,255,255,.14);color:#fff7ec;font-size:22px;cursor:pointer;padding:0}
.v4-select{position:relative;display:inline-flex;align-items:center;gap:4px;height:40px;padding:0 12px;border-radius:12px;border:1px solid #755136;background:var(--v4-leather-brown);box-shadow:0 6px 12px rgba(70,40,20,.2),0 3px 0 #5a3a26,inset 0 1px 0 rgba(255,255,255,.14);color:#fff7ec;font-family:var(--v4-serif);font-weight:900;font-size:15px;letter-spacing:.06em;text-shadow:0 1px 0 rgba(70,16,10,.45)}
.v4-select::before{content:"";position:absolute;inset:2.5px;border:1.2px dashed rgba(255,241,226,.55);border-radius:8.5px;pointer-events:none}
.v4-select select{position:absolute;inset:0;opacity:0;width:100%;height:100%;font-size:16px;cursor:pointer}
.v4-select .v4-ic{font-size:16px}

/* ── 6. Bottom nav + cat button ── */
html.v4 body nav.bottom-nav{display:flex!important;position:fixed!important;left:max(calc(var(--v4-safe-left) + 16px),calc(var(--v4-safe-left) + (100% - var(--v4-safe-left) - var(--v4-safe-right))/2 - 214px))!important;right:auto!important;bottom:max(14px,calc(var(--v4-safe-bottom) - 8px))!important;top:auto!important;transform:none!important;
  width:calc(min(100vw - var(--v4-safe-left) - var(--v4-safe-right),460px) - 108px)!important;height:66px!important;margin:0!important;padding:7px!important;gap:3px!important;border-radius:24px!important;
  background:var(--v4-card)!important;border:1.25px solid var(--v4-card-line)!important;box-shadow:var(--v4-shadow-float)!important;
  -webkit-backdrop-filter:none!important;backdrop-filter:none!important;z-index:40!important;overflow:visible!important}
html.v4 body nav.bottom-nav::before{content:"";position:absolute;inset:2.75px;border:1px dashed var(--v4-stitch);border-radius:20px;pointer-events:none;display:block!important;background:none!important}
html.v4 body nav.bottom-nav::after{display:none!important}
html.v4 body nav.bottom-nav>button{position:relative;flex:1 1 0!important;min-width:0!important;height:52px!important;margin:0!important;padding:0!important;border:0!important;border-radius:17px!important;background:none!important;box-shadow:none!important;
  display:flex!important;flex-direction:column!important;align-items:center!important;justify-content:center!important;gap:2px!important;color:var(--v4-nav)!important;font-family:var(--v4-sans)!important;font-size:11px!important;font-weight:700!important;line-height:14px!important;transform:none!important}
html.v4 body nav.bottom-nav>button[data-tab="attendance"]{display:none!important}
html.v4 body nav.bottom-nav>button>svg{width:21px!important;height:21px!important;font-size:21px!important;margin:0!important;color:inherit!important;filter:none!important}
html.v4 body nav.bottom-nav>button>span{font-size:11px!important;line-height:14px!important;color:inherit!important;margin:0!important}
html.v4 body nav.bottom-nav>button.active{border:1px solid #755136!important;background:var(--v4-leather-brown)!important;box-shadow:0 6px 12px rgba(70,40,20,.2),0 3px 0 #5a3a26,inset 0 1px 0 rgba(255,255,255,.14)!important;color:#fff7ec!important}
html.v4 body nav.bottom-nav>button.active::before{content:"";position:absolute;inset:2.5px;border:1.2px dashed rgba(255,241,226,.55);border-radius:13.5px;pointer-events:none;display:block!important;background:none!important}
html.v4 body nav.bottom-nav>button.active>span{font-family:var(--v4-serif)!important;font-weight:900!important;letter-spacing:.06em;text-shadow:0 1px 0 rgba(70,16,10,.45)}
html.v4 body nav.bottom-nav>button::after{display:none!important}
html.v4 .v4-nav-fade{position:fixed;left:0;right:0;bottom:0;height:calc(150px + var(--v4-safe-bottom));background:linear-gradient(180deg,rgba(var(--v4-bg-rgb),0),rgba(var(--v4-bg-rgb),.82) 50%,rgba(var(--v4-bg-rgb),.96));pointer-events:none;z-index:30}
html.v4 #meowAssistantFab{position:fixed!important;left:auto!important;top:auto!important;right:max(calc(var(--v4-safe-right) + 16px),calc(var(--v4-safe-right) + (100% - var(--v4-safe-left) - var(--v4-safe-right))/2 - 214px))!important;bottom:max(14px,calc(var(--v4-safe-bottom) - 8px))!important;
  width:66px!important;height:66px!important;min-width:66px!important;min-height:66px!important;border-radius:22px!important;border:1.25px solid var(--v4-card-line)!important;background:var(--v4-card)!important;
  box-shadow:var(--v4-shadow-float)!important;padding:0!important;overflow:hidden!important;z-index:41!important;transform:none!important;display:block!important;animation:none!important}
html.v4 #meowAssistantFab::before{content:"";position:absolute;inset:2.75px;border:1px dashed var(--v4-stitch);border-radius:18px;pointer-events:none;z-index:1}
html.v4 #meowAssistantFab>img{position:absolute!important;left:8px!important;top:5px!important;width:50px!important;height:58px!important;object-fit:contain!important;transform:none!important;filter:none!important;border-radius:0!important}
html.v4 #meowAssistantFab::after{display:none!important}
html.v4.v3-sheet-open .bottom-nav,html.v4.v3-sheet-open #meowAssistantFab,html.v4.meow-welcome-open .bottom-nav,html.v4.meow-welcome-open #meowAssistantFab{visibility:hidden}

/* ── 7. Overview ── */
.v4-today-time{display:flex;flex-wrap:wrap;align-items:flex-end;gap:4px 8px}
.v4-today-range{flex:1 1 auto;min-width:0;font-size:28px;line-height:36px;font-weight:900;color:var(--v4-ink);white-space:nowrap}
.v4-today-range.rest{font-family:var(--v4-serif);font-size:24px;letter-spacing:.04em}
.v4-count{flex:none;margin-left:auto;display:flex;flex-direction:column;align-items:flex-end}
.v4-count b{font-size:28px;line-height:34px;font-weight:900;color:var(--v4-orange)}
.v4-count small{font-size:12px;line-height:16px;font-weight:700;color:var(--v4-muted)}
.v4-next{display:flex;align-items:center;gap:8px;min-width:0}
.v4-next>.lbl{font-size:13px;line-height:18px;font-weight:700;color:var(--v4-muted)}
.v4-next>.time{font-size:15px;line-height:20px;font-weight:700;color:var(--v4-ink);white-space:nowrap}
.v4-next>.fill{flex:1}
.v4-payday{display:flex;align-items:center;gap:16px}
.v4-payday-num{flex:none;display:flex;flex-direction:column}
.v4-payday-num small{font-size:13px;line-height:16px;font-weight:700;color:var(--v4-muted)}
.v4-payday-num span{display:flex;align-items:baseline;gap:4px}
.v4-payday-num b{font-size:52px;line-height:58px;font-weight:900;color:var(--v4-red)}
.v4-payday-num em{font-style:normal;font-size:17px;line-height:22px;font-weight:700;color:var(--v4-sub)}
.v4-payday-info{flex:1;min-width:0;display:flex;flex-direction:column;gap:5px}
.v4-payday-info .d{font-size:16px;line-height:22px;font-weight:700;color:var(--v4-ink)}
.v4-payday-info .n{font-size:13px;line-height:18px;font-weight:700;color:var(--v4-sub)}
.v4-payday-info .p{font-size:11px;line-height:15px;font-weight:500;color:var(--v4-muted)}
.v4-ring-row{display:flex;flex-wrap:wrap;align-items:center;gap:6px 10px}
.v4-ring{width:58px;height:58px;flex:none}
.v4-ring circle{fill:none;stroke-width:7.54}
.v4-ring .track{stroke:var(--v4-track)}
.v4-big{display:flex;align-items:baseline;gap:2px}
.v4-big b{font-size:28px;line-height:34px;font-weight:900;color:var(--v4-ink)}
.v4-big em{font-style:normal;font-size:13px;line-height:18px;font-weight:700;color:var(--v4-sub)}
/* 特休 in hours (a Korean part-timer): the longer figure and unit stay inside the half-width card. */
.v4-ring-hr{min-width:0}
.v4-ring-hr .v4-big{flex-wrap:wrap}
.v4-ring-hr .v4-big b{font-size:24px;line-height:30px}
.v4-ring-hr .v4-mini{white-space:normal}
.v4-mini{font-size:11px;line-height:15px;font-weight:700;color:var(--v4-muted);white-space:nowrap}
.v4-mini.purple{color:var(--v4-purple)}
.v4-card.compact>.v4-mini{white-space:normal;overflow-wrap:anywhere}
.v4-note{font-size:11px;line-height:15px;font-weight:500;color:var(--v4-muted)}
.v4-quota{display:flex;flex-direction:column;gap:10px}
.v4-quota-row{display:flex;flex-direction:column;gap:5px;min-width:0}
.v4-quota-top{display:flex;align-items:baseline;justify-content:space-between;gap:8px}
.v4-quota-top span{min-width:0;font-size:13px;line-height:18px;font-weight:700;color:var(--v4-sub)}
.v4-quota-top b{flex:none;font-size:15px;line-height:20px;font-weight:900;color:var(--v4-ink)}
.v4-week{display:flex;gap:5px}
.v4-wd{position:relative;flex:1;min-width:0;display:flex;flex-direction:column;align-items:center;gap:2px;padding:7px 0;border-radius:10px;border:1px solid var(--v4-tile-line);background:var(--v4-tile);cursor:pointer}
.v4-wd small{font-size:11px;line-height:14px;font-weight:700;color:var(--v4-muted)}
.v4-wd b{font-size:17px;line-height:22px;font-weight:900;color:var(--v4-ink)}
.v4-wd i{font-style:normal;font-size:12px;line-height:16px;font-weight:700;white-space:nowrap}
.v4-wd.early{background:var(--v4-early-bg);border-color:var(--v4-early-line)}.v4-wd.early i{color:var(--v4-early-ink)}
.v4-wd.middle{background:var(--v4-middle-bg);border-color:var(--v4-middle-line)}.v4-wd.middle i{color:var(--v4-middle-ink)}
.v4-wd.night{background:var(--v4-night-bg);border-color:var(--v4-night-line)}.v4-wd.night i{color:var(--v4-night-ink)}
.v4-wd.work{background:var(--v4-work-bg,var(--v4-early-bg));border-color:var(--v4-work-line,var(--v4-early-line))}.v4-wd.work i{color:var(--v4-work-ink,var(--v4-early-ink))}
.v4-wd.off{background:var(--v4-off-bg);border-color:var(--v4-off-line)}.v4-wd.off i{color:var(--v4-off-ink)}
.v4-wd.leave{background:var(--v4-leave-bg);border-color:var(--v4-leave-line)}.v4-wd.leave i{color:var(--v4-leave-ink)}
.v4-wd.ot{background:var(--v4-ot-bg);border-color:var(--v4-ot-line)}.v4-wd.ot i{color:var(--v4-ot-ink)}
.v4-wd.holiday{border:1.5px dashed var(--v4-hol-line)}.v4-wd.holiday b,.v4-wd.sun b{color:var(--v4-rose)}
.v4-wd.today{border-color:#9b4334;background:var(--v4-leather-red);box-shadow:0 4px 8px rgba(127,36,28,.22),0 2px 0 #7f241c,inset 0 1px 0 rgba(255,255,255,.16)}
.v4-wd.today::before{content:"";position:absolute;inset:2px;border:1.2px dashed rgba(255,241,226,.62);border-radius:7px;pointer-events:none}
.v4-wd.today small,.v4-wd.today b,.v4-wd.today i{color:#fff7ec!important;text-shadow:0 1px 0 rgba(70,16,10,.45)}
.v4-assist{overflow:hidden;gap:6px}
.v4-assist .say{position:relative;z-index:1;font-family:var(--v4-serif);font-weight:900;font-size:13px;line-height:19px;color:var(--v4-ink);overflow-wrap:anywhere}
.v4-mic{position:relative;display:grid;place-items:center;width:38px;height:38px;border-radius:19px;border:1px solid #9b4334;background:var(--v4-leather-red);box-shadow:0 6px 12px rgba(127,36,28,.22),0 3px 0 #7f241c,inset 0 1px 0 rgba(255,255,255,.14);color:#fff7ec;font-size:18px;cursor:pointer;padding:0;z-index:1}
.v4-mic::before{content:"";position:absolute;inset:2.5px;border:1.2px dashed rgba(255,241,226,.55);border-radius:50%;pointer-events:none}
.v4-assist-cat{position:absolute!important;right:-2px;bottom:-12px;width:64px;height:73px;object-fit:contain;pointer-events:none}
.v4-net{display:flex;flex-wrap:wrap;align-items:flex-end;justify-content:flex-end;gap:8px 12px}
.v4-net-num{flex:1 1 auto;min-width:0;display:flex;flex-direction:column;gap:2px}
.v4-net-num>.v4-delta{width:0;min-width:100%}
.v4-money{display:flex;align-items:baseline;gap:4px;white-space:nowrap}
.v4-money small{font-size:15px;line-height:20px;font-weight:700;color:var(--v4-sub)}
.v4-money b{font-size:34px;line-height:42px;font-weight:900;color:var(--v4-ink)}
.v4-delta{font-size:12px;line-height:16px;font-weight:700;color:var(--v4-green)}
.v4-delta.down{color:var(--v4-red-text)}
.v4-bars{flex:none;display:flex;align-items:flex-end;gap:7px}
.v4-bars>span{display:flex;flex-direction:column;align-items:center;gap:3px}
.v4-bars i{display:block;width:13px;border-radius:4px;background:var(--v4-tile-line)}
.v4-bars em{font-style:normal;font-size:10px;line-height:13px;font-weight:700;color:var(--v4-muted)}
.v4-bars .now i{background:var(--v4-red)}.v4-bars .now em{color:var(--v4-ink)}
.v4-ev{display:flex;align-items:center;gap:12px;min-width:0;background:none;border:0;padding:0;text-align:left;cursor:pointer;width:100%}
.v4-ev-date{flex:none;display:flex;flex-direction:column;align-items:center;justify-content:center;width:48px;height:46px;border-radius:10px;border:1px solid var(--v4-tile-line);background:var(--v4-tile)}
.v4-ev-date b{font-size:14px;line-height:18px;font-weight:900;color:var(--v4-ink)}
.v4-ev-date small{font-size:10px;line-height:13px;font-weight:700;color:var(--v4-muted)}
.v4-ev-text{flex:1;min-width:0;display:flex;flex-direction:column;gap:1px}
.v4-ev-text>span{display:flex;align-items:center;gap:6px;min-width:0}
.v4-ev-text b{font-size:15px;line-height:21px;font-weight:700;color:var(--v4-ink);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.v4-ev-text small{font-size:12px;line-height:17px;color:var(--v4-muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.v4-empty{margin:0;font-size:13px;line-height:20px;color:var(--v4-muted)}
.v4-center{display:flex;justify-content:center}

/* ── 8. Schedule ── */
.v4-month{display:flex;align-items:center;gap:8px;padding:0 0 8px 4px}
.v4-month h3{flex:1;min-width:0;margin:0;font-family:var(--v4-serif);font-weight:900;font-size:20px;line-height:28px;letter-spacing:.04em;color:var(--v4-title)}
.v4-cal{padding:11.25px;touch-action:pan-y pinch-zoom}
.v4-cal.v4-cal-next{animation:v4CalNext .22s ease-out}
.v4-cal.v4-cal-prev{animation:v4CalPrev .22s ease-out}
@keyframes v4CalNext{from{opacity:.4;transform:translateX(28px)}to{opacity:1;transform:none}}
@keyframes v4CalPrev{from{opacity:.4;transform:translateX(-28px)}to{opacity:1;transform:none}}
@media (prefers-reduced-motion:reduce){.v4-cal.v4-cal-next,.v4-cal.v4-cal-prev{animation:none}}
.v4-cal-week,.v4-cal-row{display:grid;grid-template-columns:repeat(7,minmax(0,1fr))}
.v4-cal-week{height:26px;align-items:center;text-align:center;font-size:12px;font-weight:700;color:var(--v4-muted);border-bottom:1px dashed var(--v4-stitch)}
.v4-cal-week span:last-child{color:var(--v4-rose)}
.v4-cal-row{border-bottom:1px dashed var(--v4-stitch)}
.v4-cal-row:last-child{border-bottom:0}
.v4-cell{position:relative;display:flex;flex-direction:column;align-items:center;gap:3px;min-height:80px;padding:5px 3px;background:none;border:0;border-radius:10px;cursor:pointer;min-width:0}
.v4-cell>b{font-size:15px;line-height:20px;font-weight:900;color:var(--v4-ink)}
.v4-cell.red>b{color:var(--v4-rose)}
.v4-cell.out{opacity:.45}
.v4-cell .v4-chip{width:100%;padding:2px;font-size:11px}
.v4-cell .v4-chip.small{font-size:10px;line-height:15px;padding:2px 1px}
.v4-cell .v4-chip .v4-ic{font-size:11px}
.v4-cell .v4-chip .v4-emo{font-size:10px;margin-right:0}
.v4-cell.sel:not(.today){box-shadow:inset 0 0 0 1.5px var(--v4-brown);background:var(--v4-sel)}
.v4-cell.today{border:1px solid #9b4334;background:var(--v4-leather-red);box-shadow:0 4px 8px rgba(127,36,28,.22),0 2px 0 #7f241c,inset 0 1px 0 rgba(255,255,255,.16);padding:5px;z-index:1}
.v4-cell.today::before{content:"";position:absolute;inset:2px;border:1.2px dashed rgba(255,241,226,.62);border-radius:7px;pointer-events:none}
.v4-cell.today>b{color:#fff7ec;text-shadow:0 1px 0 rgba(70,16,10,.45)}
.v4-legend{display:flex;flex-wrap:wrap;gap:6px;padding:0 2px}
.v4-day-title{display:flex;align-items:center;gap:8px}
.v4-day-title h3{flex:1;margin:0;font-family:var(--v4-serif);font-weight:900;font-size:18px;line-height:26px;letter-spacing:.04em;color:var(--v4-title)}
.v4-day-sub{margin:0;font-size:12px;line-height:16px;font-weight:500;color:var(--v4-muted)}
.v4-item{display:flex;align-items:center;gap:10px;width:100%;padding:10px 12px;border-radius:12px;border:1px solid var(--v4-tile-line);background:var(--v4-tile);text-align:left;cursor:pointer;min-width:0}
.v4-item>i.bar{flex:none;width:4px;height:34px;border-radius:2px;background:var(--v4-red-text)}
.v4-item>span:not(.v4-lic){flex:1;min-width:0;display:flex;flex-direction:column;gap:1px}
.v4-item b{font-size:15px;line-height:21px;font-weight:700;color:var(--v4-ink);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.v4-item small{font-size:12px;line-height:17px;color:var(--v4-muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.v4-item>strong{flex:none;font-size:16px;line-height:22px;font-weight:900;color:var(--v4-purple)}
.v4-item.early{background:var(--v4-early-bg);border-color:var(--v4-early-line)}.v4-item.early>i.bar{background:var(--v4-early-ink)}
.v4-item.middle{background:var(--v4-middle-bg);border-color:var(--v4-middle-line)}.v4-item.middle>i.bar{background:var(--v4-middle-ink)}
.v4-item.night{background:var(--v4-night-bg);border-color:var(--v4-night-line)}.v4-item.night>i.bar{background:var(--v4-night-ink)}
.v4-item.work{background:var(--v4-work-bg,var(--v4-early-bg));border-color:var(--v4-work-line,var(--v4-early-line))}.v4-item.work>i.bar{background:var(--v4-work-ink,var(--v4-early-ink))}
.v4-item.off{background:var(--v4-off-bg);border-color:var(--v4-off-line)}.v4-item.off>i.bar{background:var(--v4-off-ink)}
.v4-item.ot{background:var(--v4-ot-bg);border:1.5px solid var(--v4-ot-line)}.v4-item.ot>i.bar{background:var(--v4-ot-ink)}.v4-item.ot>strong{color:var(--v4-ot-ink)}
.v4-item.leave{background:var(--v4-leave-bg);border-color:var(--v4-leave-line)}.v4-item.leave>i.bar{background:var(--v4-leave-ink)}
/* On a coloured shift tile the small line keeps the tile's own ink, so it stays readable on any palette colour. */
.v4-item:is(.early,.middle,.night,.work,.off,.ot,.leave) small{color:var(--v4-sub)}
.v4-actions{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px}
.v4-action{display:flex;flex-direction:column;align-items:center;gap:6px;padding:12px 0 10px;border-radius:12px;border:1px solid var(--v4-tile-line);background:var(--v4-tile);cursor:pointer;min-width:0}
.v4-action span{font-size:12px;line-height:16px;font-weight:700;color:var(--v4-sub);white-space:nowrap}

/* ── 9. Salary ── */
.v4-seg{position:relative;display:flex;gap:5px;padding:5px;background:var(--v4-card);border:1.25px solid var(--v4-card-line);border-radius:16px;box-shadow:var(--v4-shadow)}
.v4-seg::before{content:"";position:absolute;inset:3.75px;border:1px dashed var(--v4-stitch);border-radius:11px;pointer-events:none}
.v4-seg>button{position:relative;flex:1;min-width:0;height:40px;display:flex;align-items:center;justify-content:center;gap:4px;border:0;border-radius:11px;background:none;font-size:14px;line-height:20px;font-weight:700;color:var(--v4-sub);cursor:pointer;white-space:nowrap}
.v4-seg>button.on{border:1px solid #755136;background:var(--v4-leather-brown);box-shadow:0 6px 12px rgba(70,40,20,.2),0 3px 0 #5a3a26,inset 0 1px 0 rgba(255,255,255,.14);color:#fff7ec;font-family:var(--v4-serif);font-weight:900;letter-spacing:.06em;text-shadow:0 1px 0 rgba(70,16,10,.45)}
.v4-seg>button.on::before{content:"";position:absolute;inset:2.5px;border:1.2px dashed rgba(255,241,226,.55);border-radius:7.5px;pointer-events:none}
.v4-money.lg small{font-size:17px;line-height:22px}
.v4-money.lg b{font-size:40px;line-height:48px}
.v4-stack-bar{display:flex;gap:2px;height:12px;border-radius:6px;overflow:hidden;background:var(--v4-track)}
.v4-stack-bar i{display:block;height:100%}
.v4-legend-dots{display:flex;gap:12px;flex-wrap:wrap}
.v4-legend-dots span{display:flex;align-items:center;gap:4px;font-size:11px;line-height:15px;font-weight:700;color:var(--v4-muted)}
.v4-legend-dots i{width:8px;height:8px;border-radius:50%}
.v4-amount{font-size:26px;line-height:32px;font-weight:900;white-space:nowrap}
.v4-amount.plus{color:var(--v4-purple)}.v4-amount.minus{color:var(--v4-red)}
/* Phones narrower than the design: amounts in the half-width cards shrink, rings make room for their numbers. */
@media (max-width:379.98px){
  .v4-amount{font-size:22px;line-height:28px}
  .v4-seg>button{flex:1 1 auto;padding:0 2px;font-size:13px;letter-spacing:0}
}
@media (max-width:359.98px){
  .v4-amount{font-size:19px;line-height:26px}
  .v4-ring-row>span{min-width:0}
  .v4-ring-row .v4-mini{white-space:normal;overflow-wrap:anywhere}
}
.v4-group-title{display:flex;align-items:center;gap:6px;margin:4px 0 -2px;padding:0 6px;font-family:var(--v4-serif);font-weight:900;font-size:15px;line-height:20px;letter-spacing:.08em;color:var(--v4-sub)}
.v4-group-title svg{width:14px;height:14px;flex:none}
.v4-line{display:flex;align-items:center;gap:12px;width:100%;min-height:40px;padding:9px 0;background:none;border:0;text-align:left;cursor:pointer}
.v4-line>span:not(.v4-lic){flex:1;min-width:0;display:flex;flex-direction:column}
.v4-line b{font-size:15px;line-height:21px;font-weight:700;color:var(--v4-ink)}
.v4-line small{font-size:12px;line-height:17px;color:var(--v4-muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.v4-line>strong{flex:none;font-size:16px;line-height:22px;font-weight:900;color:var(--v4-ink)}
.v4-line>strong.purple{color:var(--v4-purple)}
.v4-card.list .v4-line{padding-left:2px;padding-right:2px}
.v4-desc{margin:0;font-size:13px;line-height:20px;font-weight:500;color:var(--v4-sub)}
.v4-legacy-slot{display:flex;flex-direction:column;gap:12px}
.v4-legacy-slot .salary-pane{display:block}
.v4-legacy-slot .salary-pane.hidden{display:none!important}

/* ── 10. Me ── */
.v4-profile{display:flex;align-items:center;gap:12px;background:none;border:0;padding:0;text-align:left;cursor:pointer;width:100%}
.v4-profile .v4-avatar{width:64px;height:64px;border-radius:16px}
.v4-profile-text{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px}
.v4-profile-text b{font-family:var(--v4-serif);font-weight:900;font-size:20px;line-height:28px;letter-spacing:.04em;color:var(--v4-title);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.v4-profile-text small{font-size:12px;line-height:17px;font-weight:500;color:var(--v4-muted);overflow-wrap:anywhere}
.v4-profile-text small.warn{font-weight:700;color:var(--v4-red-text)}
.v4-profile-text small.ok{font-weight:700;color:var(--v4-green)}
.v4-chev{flex:none;width:18px;height:18px;color:var(--v4-card-line);font-size:18px}
.v4-pro-row{display:flex;align-items:center;gap:12px}
.v4-pro-row>span:not(.v4-lic){flex:1;min-width:0;display:flex;flex-direction:column;gap:2px}
.v4-pro-row b{font-family:var(--v4-serif);font-weight:900;font-size:17px;line-height:24px;letter-spacing:.04em;color:var(--v4-title)}
.v4-pro-row small{font-size:12px;line-height:17px;font-weight:500;color:var(--v4-muted)}
.v4-set{display:flex;align-items:center;gap:12px;width:100%;padding:8px 0;background:none;border:0;text-align:left;cursor:pointer;min-height:48px;text-decoration:none}
.v4-set>b{flex:1;min-width:0;font-size:15px;line-height:21px;font-weight:700;color:var(--v4-ink)}
.v4-set>em{flex:none;font-style:normal;font-size:13px;line-height:18px;font-weight:500;color:var(--v4-muted);white-space:nowrap;max-width:46%;overflow:hidden;text-overflow:ellipsis}
.v4-foot{margin:6px 0 0;text-align:center;font-size:12px;line-height:16px;font-weight:500;color:var(--v4-muted-bg)}

/* ── 11. Sheets (v3 dialogs and new v4 ones) in the paper style ── */
html.v4 dialog.v3-sheet{background:linear-gradient(180deg,var(--v4-bg-top),var(--v4-bg-bottom))!important;color:var(--v4-ink)!important;box-sizing:border-box;padding-left:var(--v4-safe-left)!important;padding-right:var(--v4-safe-right)!important}
html.v4 dialog.v3-sheet .v3-sheet-top{background:transparent!important;border:0!important}
html.v4 dialog.v3-sheet .v3-sheet-top h2{font-family:var(--v4-serif)!important;font-weight:900!important;color:var(--v4-title)!important;letter-spacing:.04em}
html.v4 dialog.v3-sheet .v3-sheet-back{border:1px solid #755136!important;background:var(--v4-leather-brown)!important;color:#fff7ec!important;box-shadow:0 2px 0 #5a3a26!important;border-radius:12px!important}
html.v4 dialog.v3-sheet .card,html.v4 dialog.v3-sheet .v3-group,html.v4 dialog.v3-sheet .ref-settings-card,html.v4 dialog.v3-sheet .salary-section{background:var(--v4-card)!important;border:1.25px solid var(--v4-card-line)!important;border-radius:16px!important;box-shadow:var(--v4-shadow)!important;color:var(--v4-ink)!important}
html.v4 dialog.v3-sheet input,html.v4 dialog.v3-sheet select,html.v4 dialog.v3-sheet textarea{background:var(--v4-input)!important;border:1px solid var(--v4-tile-line)!important;color:var(--v4-ink)!important;border-radius:10px!important}
html.v4 dialog.v3-sheet .v3-group-title,html.v4 dialog.v3-sheet .salary-section-title{font-family:var(--v4-serif)!important;font-weight:900!important;color:var(--v4-sub)!important}
html.v4 dialog.v3-sheet small,html.v4 dialog.v3-sheet .hint,html.v4 dialog.v3-sheet label{color:var(--v4-muted)}
.v4-sheet-body{display:flex;flex-direction:column;gap:12px;padding:4px 16px calc(32px + var(--v4-safe-bottom))}
.v4-sheet-body .salary-section{padding:14px!important;margin:0!important}
.v4-sheet-body .salary-grid{gap:10px!important}

html.v4 body{padding-top:0!important}

/* ── 12. Sub-pages (full-screen, under the bottom nav) ── */
.v4-sub{position:fixed;inset:0;box-sizing:border-box;padding-left:var(--v4-safe-left);padding-right:var(--v4-safe-right);z-index:25;overflow-y:auto;overscroll-behavior:contain;-webkit-overflow-scrolling:touch;background:linear-gradient(180deg,var(--v4-bg-top),var(--v4-bg-bottom)) fixed;background-color:var(--v4-bg-bottom)}
.v4-sub[hidden]{display:none}
html.v4.v4-sub-open body{overflow:hidden}
.v4-crumb{display:block;margin:0;padding:0;border:0;background:none;font-size:13px;line-height:18px;font-weight:700;color:var(--v4-red-text);cursor:pointer;text-align:left;white-space:nowrap}
.v4-sub-body{display:flex;flex-direction:column;gap:12px}
.v4-sub-body .salary-section{background:var(--v4-card)!important;border:1.25px solid var(--v4-card-line)!important;border-radius:16px!important;box-shadow:var(--v4-shadow)!important;padding:14px!important;margin:0!important}
.v4-sub-body .salary-section-title{font-family:var(--v4-serif)!important;font-weight:900!important;color:var(--v4-sub)!important}
.v4-sub-body input,.v4-sub-body select,.v4-sub-body textarea{background:var(--v4-input)!important;border:1px solid var(--v4-tile-line)!important;color:var(--v4-ink)!important;border-radius:10px!important}
.v4-sub-body input:is([type=time],.t24){width:124px;height:36px;padding:0 8px;font:inherit;font-size:15px;font-weight:700}
.v4-sub-body .card{background:var(--v4-card)!important;border:1.25px solid var(--v4-card-line)!important;border-radius:16px!important;box-shadow:var(--v4-shadow)!important;color:var(--v4-ink)!important}

/* ── 13. The app's own dialogs in paper (day status, event, todo, shift change, rotation, assistant) ── */
html.v4 dialog.dialog:not(#welcomeDialog):not(.v3-sheet),html.v4 #scheduleAddDialog,html.v4 #scheduleAddDialog form,
html.v4 #scheduleAddDialog .dialog-head,html.v4 #scheduleAddDialog .dialog-body,html.v4 #scheduleAddDialog .dialog-actions{background:var(--v4-card)!important;color:var(--v4-ink)!important}
html.v4 dialog.dialog:not(#welcomeDialog):not(.v3-sheet){border:1.25px solid var(--v4-card-line)!important;box-shadow:var(--v4-shadow-dialog)!important}
html.v4 :is(dialog.dialog,dialog.work-date-dialog,dialog.rotation-dialog,dialog.itinerary-conflict-dialog,dialog.meow-assistant-month-dialog):not(#welcomeDialog):not(.v3-sheet),html.v4 #scheduleAddDialog{left:var(--v4-safe-left);right:var(--v4-safe-right);max-width:calc(100vw - var(--v4-safe-left) - var(--v4-safe-right) - 20px)!important}
html.v4 dialog.dialog:not(#welcomeDialog):not(.v3-sheet)::backdrop{background:var(--v4-backdrop)!important}
html.v4 dialog.dialog .dialog-head b,html.v4 dialog.dialog .dialog-head h2,html.v4 dialog.dialog .dialog-head h3,html.v4 dialog.dialog .itinerary-sheet-head b,html.v4 #eventDialogTitle,html.v4 #dialogDate{font-family:var(--v4-serif)!important;font-weight:900!important;color:var(--v4-title)!important;letter-spacing:.04em}
html.v4 dialog.dialog .dialog-head,html.v4 dialog.dialog .dialog-actions,html.v4 dialog.dialog .dialog-foot{border-color:var(--v4-hairline)!important;background:transparent!important}
html.v4 dialog.dialog .dialog-close{width:40px!important;height:40px!important;border-radius:12px!important;border:1px solid #755136!important;background:var(--v4-leather-brown)!important;color:#fff7ec!important;box-shadow:0 2px 0 #5a3a26,inset 0 1px 0 rgba(255,255,255,.14)!important;font-size:24px!important;line-height:1!important;display:grid!important;place-items:center!important;padding:0!important}
html.v4 dialog.dialog input,html.v4 dialog.dialog select,html.v4 dialog.dialog textarea{background:var(--v4-input)!important;border:1px solid var(--v4-tile-line)!important;color:var(--v4-ink)!important;border-radius:12px!important}
html.v4 dialog.dialog label,html.v4 dialog.dialog .field>span,html.v4 dialog.dialog .hint,html.v4 dialog.dialog small{color:var(--v4-muted)!important}
html.v4 dialog.dialog .event-sheet-row,html.v4 dialog.dialog .itinerary-field,html.v4 dialog.dialog .sheet-row{background:var(--v4-tile)!important;border-color:var(--v4-tile-line)!important}
html.v4 #meowAssistantDialog .assistant-panel{background:var(--v4-card)!important;border-color:var(--v4-card-line)!important}

/* ── 14. 行程與待辦 (reached from 近期行程 › 查看全部) ── */
html.v4 #page-attendance .v4-att-head{max-width:460px;margin:0 auto}
html.v4 #page-attendance :is(.card,.v219-board-card,.v219-today-card,.v219-todo-card,.v219-conflict-card){background:var(--v4-card)!important;border:1.25px solid var(--v4-card-line)!important;border-radius:16px!important;box-shadow:var(--v4-shadow)!important;color:var(--v4-ink)!important}
html.v4 #page-attendance :is(h2,h3,.v219-card-title,.section-title){font-family:var(--v4-serif)!important;font-weight:900!important;color:var(--v4-title)!important}
html.v4 #page-attendance .attendance-tab.active,html.v4 #page-attendance [aria-selected="true"].attendance-tab{border:1px solid #755136!important;background:var(--v4-leather-brown)!important;color:#fff7ec!important;font-family:var(--v4-serif)!important;font-weight:900!important;box-shadow:0 3px 0 #5a3a26!important}
html.v4 #page-attendance .attendance-tab{background:var(--v4-card)!important;border:1.25px solid var(--v4-card-line)!important;color:var(--v4-sub)!important}
html.v4 #page-attendance .v219-event-item,html.v4 #page-attendance .v219-todo-item{background:var(--v4-tile)!important;border-color:var(--v4-tile-line)!important}
html.v4 dialog.dialog .itinerary-form-row{background:var(--v4-tile)!important;border:1px solid var(--v4-tile-line)!important;border-radius:12px!important}
html.v4 dialog.dialog .itinerary-form-row :is(input,select,textarea){background:transparent!important;border:0!important;box-shadow:none!important}
html.v4 dialog.dialog .itinerary-form-icon{color:var(--v4-brown)!important}
html.v4 dialog.dialog .itinerary-time-inputs>span{color:var(--v4-muted)!important}
html.v4 #page-attendance #attendanceTabEvents,html.v4 #page-attendance #attendanceTabTodos{background:var(--v4-card)!important;border:1.25px solid var(--v4-card-line)!important;color:var(--v4-sub)!important;box-shadow:none!important}
html.v4 #page-attendance #attendanceTabEvents.active,html.v4 #page-attendance #attendanceTabTodos.active{border-color:#755136!important;background:var(--v4-leather-brown)!important;color:#fff7ec!important;font-family:var(--v4-serif)!important;font-weight:900!important;box-shadow:0 3px 0 #5a3a26!important}
html.v4 #page-attendance :is(.v219-timeline-row>div:last-child,.v219-todo-row,.v219-conflict-item){background:var(--v4-tile)!important;border-color:var(--v4-tile-line)!important}

/* ── 15. Boot splash: paper + 3D paw clock, same as the native launch screen ── */
#app-splash{background-color:#0e1a35!important}

/* ── 16. The older settings sheets live in #page-settings; keep that page rendered (empty) on every tab so they can open anywhere ── */
html.v4 #page-settings{display:block!important}
html.v4:not([data-active-tab="settings"]) #page-settings{height:0!important;min-height:0!important;overflow:visible!important}
html.v4:not([data-active-tab="settings"]) #page-settings>.v4-page{display:none!important}

.v4-group-title svg{color:var(--v4-red-text)}

/* ── 17. Night touches: things that are fine on paper but sink on the dark walnut ── */
html.v4.dark .v4-chev{color:var(--v4-muted)}
html.v4.dark .v4-switch::after{box-shadow:0 1px 2px rgba(0,0,0,.45)}

/* ── 18. Night: the older dark styles (html.dark in index.html and meow-v3.css) still reach the app's own pages,
   dialogs and sheets. Their colour variables point at the walnut paper here, and the few hard-coded spots that show
   inside v4 are set back to the tokens. */
html.v4.dark{
  --bg:var(--v4-bg-bottom)!important;--paper:var(--v4-field)!important;--card:var(--v4-card)!important;--ink:var(--v4-ink)!important;
  --brown:var(--v4-brown)!important;--muted:var(--v4-muted)!important;--line:var(--v4-tile-line)!important;--shadow:var(--v4-shadow)!important;
  --mobile-surface:var(--v4-card)!important;--mobile-field:var(--v4-field)!important;--mobile-soft:var(--v4-tile)!important;--mobile-text:var(--v4-ink)!important;
  --mobile-muted:var(--v4-muted)!important;--mobile-line:var(--v4-tile-line)!important;--mobile-track:var(--v4-track)!important;
}
html.v4.dark #page-dashboard,html.v4.dark #page-calendar,html.v4.dark #page-attendance,html.v4.dark #page-salary,html.v4.dark #page-settings{background:none!important;background-image:none!important;color:var(--v4-ink)!important}
html.v4.dark dialog.dialog .dialog-body,html.v4.dark dialog.dialog .dialog-foot{background:transparent!important}
html.v4 dialog.dialog .btn.danger,html.v4.dark dialog.v3-sheet .btn.danger{background:var(--v4-p-rose-bg)!important;border-color:var(--v4-p-rose-line)!important;color:var(--v4-p-rose-ink)!important}
html.v4.dark dialog.dialog .itinerary-sheet-handle{background:var(--v4-tile-line)!important}
html.v4.dark #page-attendance .attendance-v142-tabs{background:var(--v4-card)!important;border-color:var(--v4-card-line)!important}
html.v4.dark #page-attendance .v219-card-add{background:var(--v4-tile)!important;border-color:var(--v4-tile-line)!important;color:var(--v4-red-text)!important}
html.v4 #page-attendance :is(#v219TodoCount,.v219-todo-empty,#v219ConflictContent>div){color:var(--v4-muted)!important}
/* The 待辦 date line used the dark theme's muted colour in light mode too (1.5:1 on the paper); 行程 times like
   10/20 19:00 ran under the dot in the narrow column and now wrap to two lines. */
html.v4 #page-attendance :is(.v219-todo-main small,.v219-todo-reminder,.v219-todo-note){color:var(--v4-muted)!important}
html.v4 #page-attendance .v219-timeline-row time{white-space:normal!important;line-height:1.3}
html.v4.dark dialog.v3-sheet[open]:not(#\#),html.v4.dark #proPlanDialog[open]{background:linear-gradient(180deg,var(--v4-bg-top),var(--v4-bg-bottom))!important;background-color:var(--v4-bg-bottom)!important}
/* 喵助理 keeps its own light palette on paper; at night it takes the walnut one. */
html.v4.dark #meowAssistantDialog{--assistant-surface:var(--v4-card);--assistant-soft:var(--v4-tile);--assistant-field:var(--v4-field);--assistant-ink:var(--v4-ink);
  --assistant-muted:var(--v4-muted);--assistant-line:var(--v4-tile-line);--assistant-action:#8a5c3f;--assistant-on-action:#fff7ec;--assistant-focus:var(--v4-brown)}
html.v4.dark #meowAssistantDialog h2 span{color:var(--v4-p-amber-ink)}
html.v4.dark #meowAssistantDialog .assistant-reply-bubble,html.v4.dark #meowAssistantDialog .assistant-panel-chat[data-state="error"] .assistant-reply-bubble{background:var(--v4-tile)!important;color:var(--v4-ink)!important}
html.v4.dark #meowAssistantDialog #meowAssistantMic.listening{background:var(--v4-p-amber-bg)!important;color:var(--v4-p-amber-ink)!important}
/* html.dark small / input::placeholder carry !important; the v4 ones that are not the plain muted colour come back here. */
html.v4.dark :is(.v4-money,.v4pl-price,.v4pl-active-text,.v4pl-me-text) small,html.v4.dark .v4-item:is(.early,.middle,.night,.work,.off,.ot,.leave) small{color:var(--v4-sub)!important}
html.v4.dark :is(.v4-profile-text,.v4pl-me-text) small.warn{color:var(--v4-red-text)!important}
html.v4.dark .v4-profile-text small.ok{color:var(--v4-green)!important}
html.v4.dark .v4-wd.today small{color:#fff7ec!important}
html.v4.dark .v4pa-auto .v4pa-box input:placeholder-shown:not(#\#)::placeholder{color:var(--v4-ink)!important}
/* 公司實際入帳: 儲存 writes it. A Pro plan keeps this one card under its reconcile tools. */
.salary-actual-actions{display:flex;gap:8px;margin-top:10px}
.salary-actual-actions .v4-btn{flex:1;min-width:0}
.salary-actual-actions .v4-btn[disabled]{opacity:.55}
.salary-actual-actions .hidden{display:none}
#salaryReconcilePane.pro-actual .salary-section-title,#salaryReconcilePane.pro-actual .salary-free-estimated-card,#salaryReconcilePane.pro-actual #compareDiffCard{display:none!important}
#salaryReconcilePane.pro-actual .salary-free-reconcile-grid{grid-template-columns:minmax(0,1fr)!important}
.v4-line b .v4-pro{margin-left:6px}

/* The narrowest phones, where longer languages run out of room. */
@media(max-width:340px){
  .v4-month{gap:4px}
  .v4-month h3{font-size:17px;letter-spacing:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .v4-card-head{flex-wrap:wrap;row-gap:2px}
  .v4-card-head h3{flex:1 1 100%;white-space:normal}
  html.v4 body nav.bottom-nav>button>span{font-size:10px!important;letter-spacing:0!important;white-space:nowrap}
  #dayDialog .dialog-foot{display:grid;grid-template-columns:1fr 1fr;padding-left:12px;padding-right:12px}
  #dayDialog .dialog-foot .btn{width:100%;min-width:0}
  #dayDialog .dialog-foot #saveDay{grid-column:1/-1}
  #scheduleAddClear{grid-column:1/-1}
}
