/* CalPrintable interactive tool — vanilla CSS, mobile-first */
.cal-tool{background:var(--paper);border:1px solid var(--line);border-radius:20px;
  box-shadow:var(--shadow);padding:26px;margin:24px 0;max-width:860px;margin-left:auto;margin-right:auto}
.cal-toolbar{display:flex;flex-wrap:wrap;gap:10px;align-items:center;justify-content:center;margin-bottom:18px}
.cal-toolbar select{font:inherit;font-weight:700;color:var(--navy);background:#fff;border:1.5px solid var(--line);
  border-radius:12px;padding:10px 14px;cursor:pointer;min-height:44px}
.cal-toolbar select:hover{border-color:var(--amber)}
.cal-toggles{display:flex;flex-wrap:wrap;gap:8px;justify-content:center;width:100%;margin-top:4px}
.cal-toggle{display:inline-flex;align-items:center;gap:7px;font-size:.86rem;font-weight:600;color:var(--muted);
  background:#f2f4f9;border:1.5px solid var(--line);border-radius:999px;padding:7px 14px;cursor:pointer;user-select:none;
  min-height:44px;-webkit-tap-highlight-color:transparent}
.cal-toggle[aria-pressed="true"]{background:var(--amber-soft);border-color:var(--amber);color:var(--amber-dark)}
.cal-toggle .dot{width:8px;height:8px;border-radius:50%;background:var(--line)}
.cal-toggle[aria-pressed="true"] .dot{background:var(--amber)}

.cal-actions{display:flex;gap:10px;flex-wrap:wrap;justify-content:center;margin:16px 0 6px}
.cal-actions.sticky-mobile{position:sticky;bottom:0}

.cal-head{display:flex;align-items:center;justify-content:space-between;margin:14px 0 10px}
.cal-head h2{margin:0;font-size:1.5rem;letter-spacing:-.5px}
.cal-nav-btn{background:#fff;border:1.5px solid var(--line);border-radius:10px;width:44px;height:44px;
  font-size:1.2rem;cursor:pointer;color:var(--navy);line-height:1;-webkit-tap-highlight-color:transparent}
.cal-nav-btn:hover{border-color:var(--amber);color:var(--amber-dark)}

.cal-grid{width:100%;border-collapse:separate;border-spacing:6px;table-layout:fixed;touch-action:pan-y}
.cal-grid th{font-size:.78rem;text-transform:uppercase;letter-spacing:1px;color:var(--muted);padding:8px 0;font-weight:700}
.cal-grid td{background:#f4f6fb;border-radius:10px;text-align:center;padding:0;height:64px;vertical-align:top;
  position:relative;cursor:pointer;transition:background .12s}
.cal-grid td .d{display:block;font-size:1.15rem;font-weight:600;color:var(--ink);padding-top:8px}
.cal-grid td:hover{background:#e9edf7}
.cal-grid td.today .d{background:var(--amber);color:#fff;width:34px;height:34px;line-height:34px;border-radius:50%;
  margin:6px auto 0;padding:0}
.cal-grid td.weekend .d{color:#b03a4b}
.cal-grid td.other-month{visibility:hidden}
.cal-grid td.has-holiday{border-bottom:3px solid var(--amber)}
.cal-grid td.has-holiday .d{font-weight:800}
.cal-grid .hol{font-size:.62rem;color:var(--amber-dark);font-weight:700;display:block;padding:0 4px;
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis;line-height:1.3}
.cal-grid td.has-note::after{content:"";position:absolute;top:7px;right:9px;width:7px;height:7px;
  border-radius:50%;background:var(--navy)}
.cal-grid td.blank-mode{background:#fff;border:1.5px dashed var(--line);cursor:default}
.cal-grid td.blank-mode:hover{background:#fff}

/* print header inside print area */
.cal-print-title{display:none}

/* ---------- Theme variants (body[data-cal-theme]) ---------- */
body[data-cal-theme="colorful"] .cal-grid td{background:#fff7ed}
body[data-cal-theme="colorful"] .cal-grid td .d{color:#9a3412}
body[data-cal-theme="colorful"] .cal-grid td:nth-child(odd){background:#eff6ff}
body[data-cal-theme="colorful"] .cal-grid td:nth-child(odd) .d{color:#1d4ed8}
body[data-cal-theme="colorful"] .cal-head h2{color:#c2410c}

body[data-cal-theme="pastel"] .cal-grid td{background:#fdf2f8}
body[data-cal-theme="pastel"] .cal-grid td .d{color:#831843;font-weight:500}
body[data-cal-theme="pastel"] .cal-grid th{color:#a78bfa}
body[data-cal-theme="pastel"] .cal-tool{border-color:#f5d0e8}

body[data-cal-theme="floral"] .cal-grid td{background:#f0fdf4;border-radius:18px}
body[data-cal-theme="floral"] .cal-grid td .d{color:#166534}
body[data-cal-theme="floral"] .cal-head h2::before{content:"❀ ";color:#f472b6}
body[data-cal-theme="floral"] .cal-grid th{color:#65a30d}

/* ---------- Notes modal ---------- */
.cal-note-backdrop{position:fixed;inset:0;background:rgba(13,26,48,.5);display:none;align-items:center;
  justify-content:center;z-index:200;padding:20px}
.cal-note-backdrop.open{display:flex}
.cal-note-box{background:#fff;border-radius:16px;padding:24px;max-width:380px;width:100%;box-shadow:var(--shadow)}
.cal-note-box h3{margin-top:0}
.cal-note-box input{width:100%;font:inherit;padding:12px;border:1.5px solid var(--line);border-radius:10px;margin:10px 0}
.cal-note-box .row{display:flex;gap:10px;justify-content:flex-end}

/* ---------- Responsive ---------- */
/* Tablet: roomier grid, keep holiday labels */
@media (min-width:641px) and (max-width:1024px){
  .cal-tool{padding:22px;max-width:720px}
  .cal-grid td{height:60px}
  .cal-grid td .d{font-size:1.1rem}
  .cal-grid .hol{font-size:.58rem}
  .cal-head h2{font-size:1.35rem}
}
@media (max-width:640px){
  .cal-tool{padding:16px;border-radius:16px}
  .cal-grid{border-spacing:3px}
  .cal-grid td{height:52px;border-radius:8px}
  .cal-grid td .d{font-size:1rem}
  .cal-grid .hol{display:none}
  .cal-grid td.has-holiday{border-bottom-width:3px}
  .cal-actions{position:sticky;bottom:10px;z-index:20;padding-bottom:env(safe-area-inset-bottom)}
  .cal-actions .btn{flex:1;justify-content:center;min-height:48px}
}
