/* Shop calendar (0097) — shared by calendar.html, calendar-item.html, calendar-edit.html.
   Phone-width first (Kyle uses it on his phone), inside the app's .page cap. */
.cal-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.cal-head h1 { font-size: 20px; font-weight: 500; margin: 0; flex: 1; }
.cal-add { font-weight: 600; }

.cal-tabs { display: flex; gap: 6px; overflow-x: auto; margin: 0 -16px 14px; padding: 0 16px 2px; -webkit-overflow-scrolling: touch; }
.cal-tabs a {
  flex: none; font-size: 13px; padding: 7px 12px; border-radius: 999px; white-space: nowrap;
  border: 0.5px solid var(--border-strong); background: var(--surface-2); color: var(--text-secondary);
}
.cal-tabs a.active { background: var(--text-primary); color: #fff; border-color: var(--text-primary); }

.cal-chip {
  display: inline-block; font-size: 11px; font-weight: 600; line-height: 1.5; padding: 0 7px; border-radius: 5px;
  white-space: nowrap; vertical-align: 1px;
}
.cal-chip-holiday { background: #e8e8e4; color: #5f6366; }
.cal-holiday-name { font-size: 13px; color: var(--text-secondary); }

.cal-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 14px; }
.cal-stat { background: var(--surface-2); border: 0.5px solid var(--border); border-radius: 10px; padding: 10px 12px; }
.cal-stat b { display: block; font-size: 20px; font-weight: 600; line-height: 1.2; }
.cal-stat span { font-size: 12px; color: var(--text-secondary); }

.cal-panel { background: var(--surface-2); border: 0.5px solid var(--border); border-radius: 12px; padding: 12px 14px; margin-bottom: 14px; }
.cal-panel h2 { font-size: 13px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--text-secondary); margin: 0 0 6px; }
.cal-panel.coming { background: var(--accent-bg); border-color: transparent; }
.cal-empty { font-size: 13px; color: var(--text-muted); margin: 4px 0; }

.cal-row { display: flex; align-items: center; gap: 10px; padding: 7px 0; color: var(--text-primary); border-top: 0.5px solid var(--border); }
.cal-row:first-of-type { border-top: none; }
.cal-link { flex: 1; min-width: 0; display: flex; align-items: baseline; gap: 8px; color: inherit; }
/* Part 2: 44px round tick; filled when done, and the row's title is struck through. */
.cal-tick {
  flex: none; width: 44px; height: 44px; padding: 0; border-radius: 50%;
  border: 1.5px solid var(--border-strong); background: var(--surface-2); color: transparent;
  font-size: 20px; font-weight: 700; line-height: 1; display: inline-flex; align-items: center; justify-content: center;
}
.cal-tick:hover { color: var(--text-muted); }
.cal-tick.on { background: var(--success-fill); border-color: var(--success-fill); color: #fff; }
.cal-row.done .cal-t { text-decoration: line-through; color: var(--text-muted); }
.cal-row.done .cal-amt { color: var(--text-muted); }
.cal-panel.overdue { background: #fbefe2; border-color: #f0d6b8; }
.cal-panel.overdue h2 { color: #9a4f0f; }
.cal-row .cal-when { flex: none; min-width: 64px; font-size: 13px; color: var(--text-secondary); }
.cal-row .cal-title { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.cal-row .cal-amt { flex: none; font-variant-numeric: tabular-nums; font-size: 14px; }
.cal-row .cal-sub { display: block; font-size: 12px; color: var(--text-muted); }

.cal-day { padding: 8px 0 4px; border-top: 0.5px solid var(--border); }
.cal-day:first-child { border-top: none; }
.cal-day-h { font-size: 13px; font-weight: 600; color: var(--text-secondary); margin-bottom: 2px; }
.cal-day.today .cal-day-h { color: var(--accent-text); }
.cal-day.today { background: linear-gradient(90deg, var(--accent-bg), transparent 70%); margin: 0 -14px; padding-left: 14px; padding-right: 14px; border-radius: 8px; }
.cal-day .cal-row { border-top: none; padding: 4px 0; }
.cal-gap { font-size: 13px; color: var(--text-muted); padding: 8px 0; border-top: 0.5px solid var(--border); }
.cal-week-h { font-size: 12px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--text-muted); margin: 14px 0 4px; }
.cal-total { font-size: 14px; color: var(--text-secondary); margin: -4px 0 12px; }
.cal-total b { color: var(--text-primary); }

/* Month */
.cal-month-nav { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.cal-month-nav h2 { flex: 1; text-align: center; font-size: 17px; font-weight: 500; margin: 0; }
.cal-month-nav button { min-width: 44px; min-height: 40px; font-size: 18px; }
.cal-toggle { display: inline-flex; border: 0.5px solid var(--border-strong); border-radius: var(--radius); overflow: hidden; margin-bottom: 10px; }
.cal-toggle button { border: none; border-radius: 0; padding: 7px 14px; font-size: 13px; }
.cal-toggle button + button { border-left: 0.5px solid var(--border-strong); }
.cal-toggle button.active { background: var(--text-primary); color: #fff; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 2px; margin-bottom: 12px; }
.cal-grid .dow { font-size: 11px; text-align: center; color: var(--text-muted); padding-bottom: 2px; }
.cal-cell {
  min-height: 64px; padding: 3px 2px; border-radius: 6px; background: var(--surface-2); border: 0.5px solid var(--border);
  display: flex; flex-direction: column; gap: 2px; text-align: left; font: inherit; cursor: pointer; overflow: hidden;
}
.cal-cell.out { opacity: .45; }
.cal-cell.today { border: 1.5px solid var(--accent-text); }
.cal-cell.sel { background: var(--accent-bg); }
.cal-cell .n { font-size: 12px; font-weight: 600; line-height: 1; padding: 2px 2px 1px; }
.cal-cell.holiday .n::after { content: " PH"; font-size: 9px; font-weight: 600; color: #6f7377; }
.cal-bar { display: block; font-size: 10px; line-height: 14px; color: #fff; border-radius: 3px; padding: 0 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-more { font-size: 10px; color: var(--text-secondary); padding: 0 3px; }

/* Year */
.cal-switch { display: flex; align-items: center; gap: 8px; font-size: 14px; margin-bottom: 8px; cursor: pointer; }
.cal-switch input { width: 18px; height: 18px; }
.cal-hidden-note { border: 1px dashed var(--border-strong); border-radius: 8px; padding: 8px 10px; font-size: 13px; color: var(--text-secondary); margin-bottom: 12px; }
.cal-month-card h3 { font-size: 15px; font-weight: 600; margin: 0 0 4px; }

/* Item + edit */
.cal-detail h1 { font-size: 22px; font-weight: 600; margin: 4px 0 6px; }
.cal-detail .cal-big { font-size: 17px; margin: 10px 0 2px; }
.cal-dl { margin: 12px 0 0; }
.cal-dl dt { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); margin-top: 12px; }
.cal-dl dd { margin: 2px 0 0; }
.cal-form label.cal-l { display: block; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--text-secondary); margin: 16px 0 6px; }
.cal-form input[type="text"], .cal-form input[type="date"], .cal-form input[type="time"], .cal-form input[type="number"], .cal-form textarea, .cal-form select {
  width: 100%; font-size: 16px; min-height: 44px; padding: 8px 10px;
}
.cal-form .cal-inline { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.cal-form .cal-inline > input, .cal-form .cal-inline > select { width: auto; flex: 1; min-width: 110px; }
.cal-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.cal-pills button { font-size: 14px; padding: 8px 12px; border-radius: 999px; min-height: 38px; }
.cal-pills button.active { background: var(--text-primary); color: #fff; border-color: var(--text-primary); }
.cal-pills .rem { background: var(--accent-bg); color: var(--accent-text); border-color: transparent; }
.cal-pills .rem b { margin-left: 6px; font-weight: 700; }
.cal-preview { background: var(--surface-1); border-radius: 8px; padding: 8px 10px; font-size: 14px; margin-top: 10px; }
.cal-preview b { font-weight: 600; }
.cal-check { display: flex; align-items: center; gap: 10px; font-size: 15px; margin-top: 14px; cursor: pointer; }
.cal-check input { width: 20px; height: 20px; }
.cal-hint { font-size: 12px; color: var(--text-muted); margin: 4px 0 0; }
.cal-actions { display: flex; gap: 10px; margin-top: 22px; flex-wrap: wrap; }
.cal-actions button { min-height: 46px; font-size: 16px; padding: 10px 18px; }
/* Renewals (expiry items) */
.cal-renew { background: var(--accent-bg); border-radius: 12px; padding: 12px 14px; margin-top: 18px; }
.cal-renew h2 { font-size: 15px; font-weight: 600; margin: 0 0 8px; }
.cal-renew .cal-inline { display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-end; }
.cal-renew label { font-size: 12px; font-weight: 600; color: var(--text-secondary); display: block; margin-bottom: 4px; }
.cal-renew input { font-size: 16px; min-height: 44px; padding: 8px 10px; width: 100%; }
.cal-renew button { min-height: 44px; }
.cal-history { list-style: none; padding: 0; margin: 6px 0 0; font-size: 14px; }
.cal-history li { padding: 6px 0; border-top: 0.5px solid var(--border); }
.cal-history li:first-child { border-top: none; }
.cal-err { color: var(--danger-text); font-size: 14px; margin-top: 10px; min-height: 1.2em; }
