/* ============================================================
   Restaurant Reservation System - Shared Styles
   ============================================================ */
:root {
  --primary: #8B4513;
  --primary-light: #A0522D;
  --primary-dark: #5C2E0C;
  --accent: #D4A574;
  --bg: #FBF7F2;
  --bg-card: #FFFFFF;
  --text: #2C2C2C;
  --text-light: #6B6B6B;
  --border: #E5DDD0;
  --success: #2E7D32;
  --warning: #E65100;
  --danger: #C62828;
  --info: #1565C0;
  --shadow: 0 2px 8px rgba(0,0,0,0.06);
  --shadow-lg: 0 4px 16px rgba(0,0,0,0.1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic", "Meiryo", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

.container { max-width: 1100px; margin: 0 auto; padding: 20px; }

header {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  padding: 24px 0;
  box-shadow: var(--shadow-lg);
  margin-bottom: 24px;
}
header.admin-header {
  background: linear-gradient(135deg, #2C3E50, #1A252F);
}
header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}
header h1 { font-size: 1.6rem; font-weight: 600; letter-spacing: 0.05em; }
header .subtitle { font-size: 0.85rem; opacity: 0.9; margin-top: 2px; }

.header-link {
  color: white;
  text-decoration: none;
  background: rgba(255,255,255,0.15);
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 0.85rem;
  transition: all 0.2s;
  white-space: nowrap;
}
.header-link:hover { background: rgba(255,255,255,0.25); }

.header-meta {
  display: flex;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
}
.header-info {
  font-size: 0.82rem;
  opacity: 0.95;
  line-height: 1.6;
  text-align: right;
}
.header-info .map-link {
  color: white;
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: opacity 0.2s;
}
.header-info .map-link:hover { opacity: 0.75; }
@media (max-width: 600px) {
  .header-info { text-align: left; font-size: 0.78rem; }
}

.tabs {
  display: flex;
  gap: 4px;
  background: var(--bg-card);
  padding: 6px;
  border-radius: 12px;
  box-shadow: var(--shadow);
  margin-bottom: 24px;
  overflow-x: auto;
}
.tab-btn {
  flex: 0 0 auto;
  min-width: max-content;
  padding: 12px 16px;
  border: none;
  background: transparent;
  color: var(--text-light);
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  border-radius: 8px;
  transition: all 0.2s;
  white-space: nowrap;
}
.tab-btn:hover { background: var(--bg); color: var(--text); }
.tab-btn.active { background: var(--primary); color: white; }

.view { display: none; }
.view.active { display: block; }

.card {
  background: var(--bg-card);
  border-radius: 12px;
  padding: 24px;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
}
.card h2 {
  font-size: 1.2rem;
  margin-bottom: 16px;
  color: var(--primary-dark);
  padding-bottom: 12px;
  border-bottom: 2px solid var(--border);
}

.form-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.form-group { flex: 1; min-width: 200px; }
.form-group label {
  display: block;
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 6px;
  color: var(--text);
}
.form-group input, .form-group select {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 1rem;
  background: white;
  transition: border-color 0.2s;
  font-family: inherit;
}
.form-group input:focus, .form-group select:focus {
  outline: none;
  border-color: var(--primary);
}

/* Party size horizontal scroll (1-20) */
.party-grid {
  display: flex;
  flex-direction: row;
  gap: 8px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 4px 4px 14px 4px;
  margin-bottom: 8px;
  scrollbar-width: thin;
  scrollbar-color: var(--accent) transparent;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x proximity;
}
.party-grid::-webkit-scrollbar { height: 8px; }
.party-grid::-webkit-scrollbar-track { background: transparent; }
.party-grid::-webkit-scrollbar-thumb {
  background: var(--accent);
  border-radius: 4px;
}
.party-size-btn {
  flex: 0 0 76px;
  scroll-snap-align: start;
  padding: 12px 4px;
  border: 2px solid var(--border);
  background: white;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  transition: all 0.2s;
  color: var(--text);
}
.party-size-btn:hover {
  border-color: var(--primary-light);
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}
.party-size-btn.selected {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}
.party-size-btn .size-num {
  font-size: 1.3rem;
  font-weight: 700;
  line-height: 1.1;
}
.party-size-btn .size-unit {
  font-size: 0.75rem;
  opacity: 0.8;
  margin-top: 2px;
}

/* Party size stepper (legacy) */
.party-stepper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 16px 0;
}
.stepper-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 2px solid var(--primary);
  background: white;
  color: var(--primary);
  font-size: 1.5rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.stepper-btn:hover:not(:disabled) {
  background: var(--primary);
  color: white;
}
.stepper-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}
.stepper-display {
  font-size: 2.4rem;
  font-weight: 700;
  color: var(--primary-dark);
  min-width: 100px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.stepper-display .unit {
  font-size: 1rem;
  color: var(--text-light);
  margin-left: 4px;
  font-weight: 400;
}

.party-quick {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 12px;
}
.party-quick-btn {
  padding: 6px 14px;
  border: 1px solid var(--border);
  background: white;
  border-radius: 16px;
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--text-light);
  transition: all 0.2s;
}
.party-quick-btn:hover {
  border-color: var(--primary-light);
  color: var(--primary-dark);
}
.party-quick-btn.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* Calendar */
.calendar { margin-top: 8px; }
.calendar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.calendar-header h3 { font-size: 1.1rem; color: var(--primary-dark); }
.calendar-nav { display: flex; gap: 8px; }
.calendar-nav button {
  padding: 6px 12px;
  border: 1px solid var(--border);
  background: white;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.2s;
}
.calendar-nav button:hover {
  background: var(--bg);
  border-color: var(--primary-light);
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}
.calendar-weekday {
  text-align: center;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 8px;
  color: var(--text-light);
}
.calendar-weekday.sun { color: var(--danger); }
.calendar-weekday.sat { color: var(--info); }

.calendar-day {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: white;
  cursor: pointer;
  transition: all 0.2s;
  padding: 4px;
  font-size: 0.9rem;
}
.calendar-day.empty {
  border: none;
  cursor: default;
  background: transparent;
}
.calendar-day.past {
  color: #ccc;
  cursor: not-allowed;
  background: #f5f5f5;
}
.calendar-day.available { border-color: var(--success); }
.calendar-day.available:hover {
  background: #E8F5E9;
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.calendar-day.full {
  color: var(--text-light);
  background: #FAFAFA;
  cursor: not-allowed;
  border-color: var(--border);
}
.calendar-day.partial { border-color: var(--warning); }
.calendar-day.partial:hover { background: #FFF3E0; }
.calendar-day.closed {
  background: #FFEBEE;
  color: var(--danger);
  border-color: #FFCDD2;
  cursor: not-allowed;
}
.calendar-day.not_yet {
  color: var(--text-light);
  background: #F5F5F5;
  cursor: not-allowed;
  border-color: var(--border);
}
.calendar-day.selected {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}
.day-num { font-weight: 600; }
.day-status { font-size: 0.7rem; margin-top: 2px; }
.calendar-day.available .day-status { color: var(--success); }
.calendar-day.partial .day-status { color: var(--warning); }
.calendar-day.full .day-status { color: var(--text-light); }
.calendar-day.closed .day-status { color: var(--danger); font-weight: 600; }
.calendar-day.not_yet .day-status { color: var(--text-light); font-size: 0.6rem; }
.calendar-day.selected .day-status { color: white; }

.legend {
  display: flex;
  gap: 16px;
  margin-top: 16px;
  flex-wrap: wrap;
  font-size: 0.85rem;
}
.legend-item { display: flex; align-items: center; gap: 6px; }
.legend-box {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  border: 2px solid;
}

/* Time slot */
.time-slot-picker {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 10px;
  margin-top: 8px;
}
.time-slot-btn {
  padding: 12px 8px;
  border: 2px solid var(--border);
  background: white;
  border-radius: 8px;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s;
  font-family: inherit;
}
.time-slot-btn:hover:not(:disabled) { border-color: var(--primary-light); }
.time-slot-btn.selected {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}
.time-slot-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  background: #f5f5f5;
}
.time-slot-time { font-size: 1.1rem; font-weight: 600; }
.time-slot-info { font-size: 0.8rem; margin-top: 4px; opacity: 0.8; }

/* Buttons */
.btn {
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-primary:disabled { background: #ccc; cursor: not-allowed; }
.btn-secondary {
  background: white;
  color: var(--primary);
  border: 1px solid var(--primary);
}
.btn-secondary:hover { background: var(--bg); }
.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { background: #B71C1C; }
.btn-small { padding: 6px 12px; font-size: 0.85rem; }

.btn-row {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 20px;
  flex-wrap: wrap;
}

/* Summary */
.summary-box {
  background: var(--bg);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 16px;
}
.summary-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px dashed var(--border);
}
.summary-row:last-child { border-bottom: none; }
.summary-label { color: var(--text-light); font-size: 0.9rem; }
.summary-value { font-weight: 600; }

/* Reservation list */
.reservation-list { display: flex; flex-direction: column; gap: 12px; }
.reservation-item {
  background: white;
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  border-radius: 8px;
  padding: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}
.reservation-info { flex: 1; min-width: 250px; }
.reservation-name { font-weight: 600; font-size: 1.05rem; }
.reservation-detail {
  font-size: 0.85rem;
  color: var(--text-light);
  margin-top: 4px;
}
.reservation-seats {
  display: inline-block;
  background: var(--accent);
  color: var(--primary-dark);
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 600;
  margin-top: 4px;
}

.filter-bar {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
  align-items: center;
}

/* Seat map */
.seat-map {
  background: var(--bg);
  border-radius: 8px;
  padding: 20px;
  margin-top: 16px;
}
.seat-map h4 {
  font-size: 1rem;
  margin-bottom: 12px;
  color: var(--primary-dark);
}
.seat-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}
.counter-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
}
.seat {
  aspect-ratio: 1.2;
  border: 2px solid var(--border);
  background: white;
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 600;
}
.seat.occupied {
  background: var(--accent);
  border-color: var(--primary-light);
  color: var(--primary-dark);
}
.seat.linked {
  background: #FFE0B2;
  border-color: var(--warning);
}
.seat-id { font-size: 0.85rem; }
.seat-info { font-size: 0.65rem; color: var(--text-light); margin-top: 2px; }
.seat.occupied .seat-info { color: var(--primary-dark); }

/* Seat map - free layout (floor) */
.seatmap-floor {
  position: relative;
  background:
    linear-gradient(var(--border) 1px, transparent 1px) 0 0 / 100% 26px,
    var(--bg-card);
  border: 1px dashed var(--border);
  border-radius: 8px;
  min-height: 360px;
  margin-top: 4px;
  overflow: auto;
}
.seat-node {
  position: absolute;
  width: 144px;
  min-height: 90px;
  border: 2px solid var(--border);
  background: #fff;
  border-radius: 10px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  box-sizing: border-box;
  user-select: none;
}
.seat-node.counter { width: 120px; min-height: 76px; }
.seat-node.occupied { background: var(--accent); border-color: var(--primary-light); color: var(--primary-dark); }
.seat-node.linked { background: #FFE0B2; border-color: var(--warning); }
.seat-node .sn-name { font-weight: 700; font-size: 0.98rem; line-height: 1.25; overflow-wrap: anywhere; }
.seat-node .sn-sub { font-size: 0.74rem; color: var(--text-light); }
.seat-node.occupied .sn-sub { color: var(--primary-dark); }
.seat-node .sn-occ { font-size: 0.82rem; margin-top: auto; overflow-wrap: anywhere; }
.seatmap-floor .seat-node { cursor: pointer; }
.seatmap-floor.editing .seat-node { cursor: grab; box-shadow: var(--shadow-lg); }
.seatmap-floor.editing .seat-node:active { cursor: grabbing; }
/* 目印（ランドマーク） */
.seat-marker {
  position: absolute;
  background: #FFF8E1;
  border: 2px dashed #C9A227;
  color: #7A5C00;
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 0.84rem;
  font-weight: 700;
  user-select: none;
  max-width: 220px;
  overflow-wrap: anywhere;
}
.seatmap-floor.editing .seat-marker { cursor: grab; box-shadow: var(--shadow); }

/* Misc */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-light);
}
.empty-state-icon {
  font-size: 3rem;
  margin-bottom: 12px;
  opacity: 0.4;
}

.alert {
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 16px;
  font-size: 0.9rem;
}
.alert-info { background: #E3F2FD; color: #0D47A1; border-left: 4px solid #1976D2; }
.alert-success { background: #E8F5E9; color: #1B5E20; border-left: 4px solid #2E7D32; }
.alert-warning { background: #FFF3E0; color: #E65100; border-left: 4px solid #F57C00; }

.calendar-sync-mock {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
  background: linear-gradient(135deg, #4285F4, #1565C0);
  color: white;
  border-radius: 8px;
  margin-bottom: 20px;
}
.gcal-icon {
  width: 48px;
  height: 48px;
  background: white;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #1565C0;
  font-size: 1.5rem;
}
.sync-info { flex: 1; }
.sync-info .title { font-size: 1.1rem; font-weight: 600; }
.sync-info .desc { font-size: 0.85rem; opacity: 0.9; margin-top: 2px; }
.sync-status {
  display: inline-block;
  padding: 4px 12px;
  background: rgba(255,255,255,0.2);
  border-radius: 12px;
  font-size: 0.8rem;
  margin-top: 6px;
}

.modal-bg {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 100;
  align-items: center;
  justify-content: center;
  padding: 16px;
  overflow-y: auto;
}
.modal-bg.show { display: flex; }
.modal {
  background: white;
  border-radius: 12px;
  padding: 24px;
  max-width: 500px;
  width: 100%;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  box-sizing: border-box;
}
.modal h3 {
  color: var(--primary-dark);
  margin-bottom: 12px;
}
.modal .summary-box { word-break: break-word; }
.modal .summary-row {
  flex-wrap: wrap;
  gap: 4px 12px;
}
.modal .summary-value { word-break: break-all; min-width: 0; }

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--text);
  color: white;
  padding: 12px 24px;
  border-radius: 8px;
  box-shadow: var(--shadow-lg);
  z-index: 1000;
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}
.toast.show { opacity: 1; }
.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }

.calendar-events { display: grid; gap: 8px; margin-top: 12px; }
.calendar-event {
  background: white;
  border-left: 4px solid #4285F4;
  padding: 10px 14px;
  border-radius: 6px;
  box-shadow: var(--shadow);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9rem;
}
.calendar-event-time { font-weight: 600; color: #1565C0; }

/* Timeline / Schedule (Admin) */
.timeline-wrap {
  overflow: auto;
  max-height: 72vh;
  padding: 4px;
  background: var(--bg);
  border-radius: 8px;
  -webkit-overflow-scrolling: touch;
}
/* 時間行（上）を固定 */
.tl-time-head { position: sticky; top: 0; z-index: 4; }
/* 席名列（左）を固定 */
.tl-seat-label { position: sticky; left: 0; z-index: 3; }
/* 左上の角は最前面で固定 */
.tl-corner { position: sticky; top: 0; left: 0; z-index: 5; }
/* セクション見出しの文字を横スクロールでも左に固定 */
.tl-sticky-label { position: sticky; left: 8px; }
.timeline-grid {
  display: grid;
  gap: 1px;
  background: var(--border);
  padding: 1px;
  border-radius: 4px;
  min-width: max-content;
}
.tl-corner, .tl-time-head, .tl-seat-label, .tl-empty, .tl-occupied {
  background: white;
  font-size: 0.75rem;
  padding: 6px 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  box-sizing: border-box;
}
.tl-corner {
  background: var(--bg-card);
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-light);
}
.tl-time-head {
  background: var(--bg-card);
  font-weight: 600;
  color: var(--primary-dark);
  font-size: 0.7rem;
}
.tl-seat-label {
  background: var(--bg-card);
  font-weight: 700;
  color: var(--primary-dark);
}
.tl-empty {
  background: white;
}
.tl-occupied {
  background: var(--accent);
  color: var(--primary-dark);
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  font-weight: 600;
  border-radius: 3px;
  padding: 4px 8px;
  overflow: visible;
}
.tl-occupied-name {
  font-size: 0.78rem;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.25;
  max-width: 100%;
}
.tl-occupied-meta {
  font-size: 0.65rem;
  font-weight: normal;
  opacity: 0.75;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.25;
  max-width: 100%;
}
.tl-section-label {
  background: var(--primary-dark);
  color: white;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 6px 12px;
  letter-spacing: 0.05em;
}

.step-indicator {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.step-dot {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 16px;
  background: white;
  border: 1px solid var(--border);
  font-size: 0.85rem;
  color: var(--text-light);
}
.step-dot.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}
.step-dot.done {
  background: var(--success);
  color: white;
  border-color: var(--success);
}
.step-dot-num {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(255,255,255,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.75rem;
}
.step-dot:not(.active):not(.done) .step-dot-num {
  background: var(--border);
}

@media (max-width: 600px) {
  .container { padding: 12px; }
  .card { padding: 16px; }
  header h1 { font-size: 1.3rem; }
  .seat-grid { grid-template-columns: repeat(2, 1fr); }
  .counter-grid { grid-template-columns: repeat(3, 1fr); }
  .stepper-display { font-size: 2rem; min-width: 80px; }
  .party-size-btn { flex: 0 0 64px; padding: 10px 2px; }
  .party-size-btn .size-num { font-size: 1.1rem; }
  .modal { padding: 18px; }
  .modal .summary-row { flex-direction: column; align-items: flex-start; }
  .modal .summary-label { font-size: 0.8rem; }
  .modal .summary-value { font-size: 0.95rem; }

  /* カレンダーが画面内に収まるように調整 */
  .calendar-grid { gap: 2px; }
  .calendar-weekday { padding: 4px 0; font-size: 0.7rem; }
  .calendar-day {
    padding: 2px;
    min-width: 0;
    font-size: 0.75rem;
    overflow: hidden;
  }
  .day-num { font-size: 0.85rem; }
  .day-status { font-size: 0.6rem; margin-top: 0; }
  .calendar-day.closed .day-status,
  .calendar-day.not_yet .day-status { font-size: 0.55rem; }

  /* 凡例とカレンダーが重ならないようにスペース確保 */
  .calendar .legend {
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
    flex-direction: column;
    gap: 8px;
    align-items: flex-start;
  }
  .calendar-header h3 { font-size: 1rem; }
  .calendar-nav button { padding: 4px 8px; font-size: 0.8rem; }
}
