/* ============================================================
   産地訪問スケジュール調整  スタイル（モバイルファースト）
   ============================================================ */
:root {
  --brand: #2F5496;
  --brand-dark: #1F3864;
  --bg: #F4F6FA;
  --card: #FFFFFF;
  --line: #E1E5EC;
  --text: #22304A;
  --muted: #7A8699;
  --sat: #EAF3FC;
  --sun: #FDECEC;
  --danger: #C00000;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(20, 40, 80, 0.10);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: "Hiragino Kaku Gothic ProN", "Yu Gothic", "Meiryo", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
}
.hidden { display: none !important; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: 15px; }

/* ---------- ログイン ---------- */
.login-view {
  min-height: 100dvh;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  background: linear-gradient(160deg, var(--brand-dark), var(--brand));
}
.login-card {
  background: var(--card); border-radius: 14px; box-shadow: var(--shadow);
  padding: 28px 22px; width: 100%; max-width: 420px; text-align: center;
}
.login-logo { font-size: 12px; color: var(--muted); letter-spacing: 0.1em; }
.login-title { font-size: 20px; color: var(--brand-dark); margin: 6px 0 2px; }
.login-sub { font-size: 13px; color: var(--muted); margin-bottom: 20px; }
.login-label { font-size: 14px; margin: 14px 0 8px; color: var(--text); }
.login-mode-note { font-size: 12px; color: var(--muted); margin-top: 18px; }

.identity-groups { text-align: left; }
.identity-group-label {
  font-size: 12px; color: var(--muted); margin: 12px 0 6px;
}
.identity-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.identity-btn {
  border: 1px solid var(--line); background: #fff; border-radius: 999px;
  padding: 8px 18px; font-size: 15px;
}
.identity-btn:active { background: var(--sat); }

/* ---------- ボタン ---------- */
.btn {
  border: none; border-radius: 8px; padding: 10px 20px; font-size: 15px;
}
.btn-primary { background: var(--brand); color: #fff; }
.btn-danger { background: #fff; color: var(--danger); border: 1px solid var(--danger); }
.email-login-form { display: flex; flex-direction: column; gap: 10px; text-align: left; }
.btn-block { width: 100%; padding: 12px; font-size: 16px; }
.login-error { color: var(--danger); font-size: 13px; margin-top: 10px; }
.link-btn {
  border: none; background: none; color: var(--brand); font-size: 12.5px;
  margin-top: 14px; text-decoration: underline;
}
.btn-icon {
  border: none; background: transparent; font-size: 20px; color: inherit;
  padding: 4px 10px; border-radius: 6px;
}
.help-link {
  text-decoration: none; font-size: 15px; font-weight: 700;
  border: 1.5px solid rgba(255,255,255,0.5); border-radius: 50%;
  width: 26px; height: 26px; display: inline-flex;
  align-items: center; justify-content: center; padding: 0;
}
.help-login-link { color: var(--brand); font-size: 13px; }

/* ---------- ヘッダー ---------- */
.app-header {
  background: var(--brand-dark); color: #fff;
  position: sticky; top: 0; z-index: 20;
}
.header-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px 6px;
}
.app-title { font-size: 16px; font-weight: 700; }
.header-user { display: flex; align-items: center; gap: 4px; }
.user-name { font-size: 13px; opacity: 0.9; }

.tabs { display: flex; }
.tab {
  flex: 1; background: transparent; border: none; color: rgba(255,255,255,0.65);
  padding: 9px 0; font-size: 14px; border-bottom: 3px solid transparent;
}
.tab.active { color: #fff; border-bottom-color: #FFD966; font-weight: 700; }

/* ---------- ツールバー ---------- */
.tab-panel { padding: 10px 10px 60px; max-width: 900px; margin: 0 auto; }
.toolbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; margin-bottom: 8px;
}
.month-nav { display: flex; align-items: center; gap: 2px; }
.month-select {
  border: 1px solid var(--line); border-radius: 8px; padding: 7px 8px;
  background: #fff; font-size: 15px; font-weight: 700; color: var(--brand-dark);
}
.only-planned {
  display: flex; align-items: center; gap: 5px; font-size: 13px; color: var(--muted);
  user-select: none;
}
.only-planned input { width: 16px; height: 16px; }

.filter-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.chip {
  border: 1.5px solid var(--line); background: #fff; border-radius: 999px;
  padding: 4px 12px; font-size: 13px; color: var(--muted);
}
.chip.active { color: #fff; border-color: transparent; }

/* ---------- スケジュールリスト ---------- */
.schedule-list { display: flex; flex-direction: column; gap: 8px; }

.day-card {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  overflow: hidden;
}
.day-card.sat .day-head { background: var(--sat); }
.day-card.sun .day-head { background: var(--sun); }
.day-head {
  display: flex; align-items: baseline; gap: 8px;
  padding: 7px 12px; border-bottom: 1px solid var(--line);
  background: #F8FAFD;
}
.day-date { font-size: 15px; font-weight: 700; }
.day-wd { font-size: 13px; color: var(--muted); }
.day-wd.wd-sat { color: #2F6FB0; }
.day-wd.wd-sun { color: var(--danger); }
.day-holiday { font-size: 12px; color: var(--danger); }

.slot-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px; border-bottom: 1px solid #F0F2F6;
  min-height: 44px;
}
.slot-row:last-child { border-bottom: none; }
.slot-row:active { background: #F4F7FC; }
.slot-label { flex: 0 0 52px; }
.slot-name { font-size: 13px; font-weight: 700; color: var(--brand-dark); }
.slot-time { font-size: 10px; color: var(--muted); display: block; }

.slot-body { flex: 1; min-width: 0; }
.slot-empty { color: #C3CAD6; font-size: 13px; }
.visit-line1 { display: flex; align-items: center; gap: 6px; }
.sanchi-tag {
  color: #fff; font-size: 11px; font-weight: 700;
  border-radius: 4px; padding: 1px 6px; white-space: nowrap;
}
.visit-title {
  font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.visit-marks { font-size: 11.5px; color: var(--muted); margin-top: 2px; line-height: 1.6; }
.ng-list { color: #C99; }
.visit-marks b { color: var(--text); font-weight: 700; }
.my-mark {
  flex: 0 0 auto; font-size: 16px; font-weight: 700; width: 28px; text-align: center;
  color: var(--brand);
}

/* ---------- 複数班（visit-entry） ---------- */
.visit-entry {
  padding: 5px 8px; margin: 2px 0; border-radius: 8px;
  border: 1px solid transparent; cursor: pointer;
}
.visit-entry:hover, .visit-entry:active { background: #F4F7FC; border-color: var(--line); }
.visit-entry + .visit-entry { border-top: 1px dashed var(--line); margin-top: 4px; }
.group-tag {
  background: #5B6B84; color: #fff; font-size: 10px; font-weight: 700;
  border-radius: 4px; padding: 1px 5px; white-space: nowrap;
}
.entry-my-mark {
  margin-left: auto; font-size: 15px; font-weight: 700; color: var(--brand);
  padding-left: 6px;
}
.add-group-btn {
  border: none; background: none; color: var(--muted); font-size: 11.5px;
  padding: 3px 8px; margin-top: 2px; text-align: left; display: block;
}
.add-group-btn:hover { color: var(--brand); }
.empty-slot { cursor: pointer; }

/* ---------- 出欠一覧（マトリクス） ---------- */
.mx-month {
  font-size: 15px; font-weight: 700; color: var(--brand-dark);
  min-width: 100px; text-align: center; display: inline-block;
}
.matrix-wrap {
  overflow-x: auto; background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow); -webkit-overflow-scrolling: touch;
}
.matrix-table { border-collapse: separate; border-spacing: 0; width: 100%; font-size: 13px; }
.matrix-table th, .matrix-table td {
  border-bottom: 1px solid var(--line); border-right: 1px solid #F0F2F6;
  padding: 6px 6px; text-align: center; white-space: nowrap; background: #fff;
}
.matrix-table thead th { background: #F1F4F9; color: var(--brand-dark); position: sticky; top: 0; z-index: 2; }
.matrix-table .mx-group { font-size: 11px; font-weight: 400; }
.matrix-table .mx-name { font-size: 12.5px; min-width: 44px; }
.matrix-table .mx-me { background: #FFF9E6 !important; }
.matrix-table thead .mx-me { font-weight: 700; }
.mx-visit-col {
  position: sticky; left: 0; z-index: 1; text-align: left !important;
  min-width: 150px; max-width: 220px; background: #fff;
  box-shadow: 2px 0 3px rgba(20,40,80,0.06);
}
.matrix-table thead .mx-visit-col { z-index: 3; background: #F1F4F9; }
.mx-when { font-size: 12px; font-weight: 700; color: var(--brand-dark); }
.mx-what { display: flex; align-items: center; gap: 4px; margin-top: 2px; }
.mx-title {
  font-size: 11.5px; color: var(--muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 130px;
}
.matrix-table tbody tr { cursor: pointer; }
.matrix-table tbody tr:active td { background: #F4F7FC; }
.mx-mark { font-size: 15px; font-weight: 700; }
.mx-hint { font-size: 11.5px; color: var(--muted); margin: 0 2px 8px; }
.mx-tools { display: flex; align-items: center; gap: 10px; }
.hl-gear { font-size: 18px; color: var(--muted); padding: 2px 6px; }
.hl-rule {
  display: flex; align-items: center; flex-wrap: wrap; gap: 4px;
  font-size: 13.5px; padding: 2px 0 6px;
}
.hl-num {
  width: 52px; border: 1px solid var(--line); border-radius: 6px;
  padding: 5px 6px; font-size: 14px; text-align: center;
}
.hl-color {
  width: 44px; height: 30px; border: 1px solid var(--line); border-radius: 6px;
  padding: 1px; background: #fff; cursor: pointer;
}
.mx-bulk-btn {
  border: 1px solid var(--brand); background: #fff; color: var(--brand);
  border-radius: 8px; padding: 6px 12px; font-size: 13px; font-weight: 700;
}
.mx-bulk-btn:active { background: var(--sat); }
.bulk-modal { max-width: 420px; }
.bulk-check {
  display: flex; align-items: center; gap: 7px; font-size: 13.5px;
  padding: 4px 0; user-select: none;
}
.bulk-check input { width: 17px; height: 17px; }
.bulk-count { font-size: 14px; font-weight: 700; margin-top: 12px; }
.bulk-mark-btn { max-width: 64px; font-size: 17px; }
.mx-edit {
  cursor: pointer; min-width: 40px;
  box-shadow: inset 0 0 0 1px #E8D48A;
}
.mx-edit:empty::after { content: "・"; color: #D8C97F; font-weight: 400; }
.mx-edit:active { background: #FFEFB0 !important; }
.mx-saving { background: #FFF3C4 !important; }
.mx-visit-col.mx-sat { background: var(--sat); }
.mx-visit-col.mx-sun { background: var(--sun); }
.matrix-table tbody .mx-visit-col { cursor: pointer; }
.mk-◎ { color: #1E7A47; }
.mk-○ { color: #2F6FB0; }
.mk-△ { color: #A87E19; }
.mk-× { color: var(--danger); }

/* ---------- モーダル ---------- */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(15, 25, 45, 0.5);
  display: flex; align-items: flex-end; justify-content: center; z-index: 50;
}
.modal {
  background: #fff; width: 100%; max-width: 560px;
  border-radius: 16px 16px 0 0; max-height: 92dvh;
  display: flex; flex-direction: column;
}
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px 8px; border-bottom: 1px solid var(--line);
}
.modal-date { font-size: 17px; font-weight: 700; color: var(--brand-dark); }
.modal-slot { font-size: 13px; color: var(--muted); }
.modal-body { padding: 12px 16px; overflow-y: auto; }
.modal-foot {
  display: flex; justify-content: space-between; gap: 10px;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
}
.modal-foot .btn-primary { flex: 1; }

.field-label {
  display: block; font-size: 12.5px; font-weight: 700; color: var(--muted);
  margin: 14px 0 6px;
}
.field-label:first-child { margin-top: 2px; }
.text-input {
  width: 100%; border: 1px solid var(--line); border-radius: 8px;
  padding: 9px 10px; font-size: 15px; background: #FDFDFE;
}
.text-input:focus { outline: 2px solid var(--brand); border-color: transparent; }

.sanchi-options { display: flex; flex-wrap: wrap; gap: 7px; }
.sanchi-opt {
  border: 1.5px solid var(--line); background: #fff; border-radius: 8px;
  padding: 7px 12px; font-size: 14px;
}
.sanchi-opt.selected { color: #fff; border-color: transparent; font-weight: 700; }

.attendance-list { display: flex; flex-direction: column; gap: 4px; }
.att-group-label { font-size: 11px; color: var(--muted); margin-top: 6px; }
.att-row {
  display: flex; align-items: center; gap: 8px; padding: 3px 0;
}
.att-row.me .att-name { color: var(--brand); font-weight: 700; }
.att-name { flex: 0 0 64px; font-size: 14px; }
.att-marks { display: flex; gap: 5px; flex: 1; }
.mark-btn {
  flex: 1; max-width: 52px; border: 1.5px solid var(--line); background: #fff;
  border-radius: 8px; padding: 6px 0; font-size: 15px; color: #A8B0BE;
  min-height: 38px;
}
.mark-btn.sel-◎ { background: #E7F4EA; border-color: #3F9B6B; color: #1E7A47; font-weight: 700; }
.mark-btn.sel-○ { background: #EAF3FC; border-color: #2F6FB0; color: #2F6FB0; font-weight: 700; }
.mark-btn.sel-△ { background: #FFF6E0; border-color: #C99A2E; color: #A87E19; font-weight: 700; }
.mark-btn.sel-× { background: #FDECEC; border-color: #D66; color: var(--danger); font-weight: 700; }

/* ---------- 確定バッジ・ステータス ---------- */
.fixed-badge {
  background: #1E7A47; color: #fff; font-size: 10px; font-weight: 700;
  border-radius: 4px; padding: 1px 5px; white-space: nowrap;
}
.status-options { display: flex; gap: 8px; }
.status-opt {
  flex: 1; max-width: 140px; border: 1.5px solid var(--line); background: #fff;
  border-radius: 8px; padding: 8px 0; font-size: 14px; color: #A8B0BE;
}
.status-opt.sel-pending {
  background: #FFF6E0; border-color: #C99A2E; color: #A87E19; font-weight: 700;
}
.status-opt.sel-fixed {
  background: #E7F4EA; border-color: #1E7A47; color: #1E7A47; font-weight: 700;
}

/* ---------- 確定スケジュール ---------- */
.fixed-month-title {
  font-size: 15px; color: var(--brand-dark); margin: 16px 2px 8px;
  border-left: 4px solid var(--brand); padding-left: 8px;
}
.fixed-month:first-child .fixed-month-title { margin-top: 4px; }
.fixed-card {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 10px 14px; margin-bottom: 8px;
  display: flex; gap: 14px; align-items: flex-start; position: relative;
}
.fixed-edit-btn {
  position: absolute; top: 8px; right: 10px;
  border: 1px solid var(--line); background: #fff; border-radius: 6px;
  padding: 3px 10px; font-size: 12px; color: var(--brand);
}
.fixed-edit-btn:active { background: var(--sat); }
.day-card.flash { animation: flash-bg 2s ease-out; }
@keyframes flash-bg {
  0%, 40% { box-shadow: 0 0 0 3px #F5C518, var(--shadow); }
  100% { box-shadow: var(--shadow); }
}
.fixed-when {
  flex: 0 0 108px; font-size: 16px; font-weight: 700; color: var(--brand-dark);
  line-height: 1.35;
}
.fixed-wd { font-size: 12px; color: var(--muted); font-weight: 400; }
.fixed-slot { display: block; font-size: 11px; color: var(--muted); font-weight: 400; }
.fixed-body { flex: 1; min-width: 0; }
.fixed-line1 { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.fixed-title { font-size: 14px; font-weight: 700; }
.fixed-att { font-size: 12.5px; color: var(--text); margin-top: 3px; }
.fixed-maybe { color: var(--muted); }
.fixed-note { font-size: 12px; color: var(--muted); margin-top: 3px; }
.fixed-pending {
  font-size: 11.5px; color: #A87E19; background: #FFF6E0;
  border-radius: 6px; padding: 4px 8px; margin-top: 5px;
}

/* ---------- 集計 ---------- */
.summary-content { display: flex; flex-direction: column; gap: 14px; }
.summary-card {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 14px;
}
.summary-card h3 { font-size: 15px; color: var(--brand-dark); margin-bottom: 10px; }
.summary-table-wrap { overflow-x: auto; }
.summary-table { border-collapse: collapse; width: 100%; font-size: 13px; }
.summary-table th, .summary-table td {
  border: 1px solid var(--line); padding: 6px 8px; text-align: center; white-space: nowrap;
}
.summary-table th { background: #F1F4F9; color: var(--brand-dark); }
.summary-table td.rowhead { background: #F8FAFD; font-weight: 700; }
.summary-table td.zero { color: #C3CAD6; }
.sum-pct { font-size: 10.5px; color: #1E7A47; font-weight: 700; }
.admin-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 6px 0; border-bottom: 1px dashed var(--line); font-size: 13.5px;
}
.admin-fixed { font-size: 11px; color: var(--muted); }

/* ---------- アポイント時間・行程メモ ---------- */
.appt-chip {
  background: #EAF3FC; color: #1F5A94; border: 1px solid #BDD7F0;
  font-size: 11px; font-weight: 700; border-radius: 5px; padding: 1px 6px;
  white-space: nowrap;
}
.meet-chip {
  background: #E7F4EA; color: #1E7A47; border: 1px solid #BCDFC6;
  font-size: 11px; font-weight: 700; border-radius: 5px; padding: 1px 7px;
  white-space: nowrap; text-decoration: none;
}
.meet-chip:active { background: #D5EDDC; }
.itin-line {
  font-size: 11.5px; color: #5B6B84; margin-top: 3px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.fixed-itin {
  font-size: 12.5px; color: var(--text); margin-top: 5px;
  background: #F4F7FC; border-radius: 8px; padding: 7px 10px; line-height: 1.7;
}

/* ---------- 日付紐づけ付箋（スケジュール内表示） ---------- */
.day-notes {
  background: #FFF8B8; border-bottom: 1px solid #EFE49A; padding: 5px 12px;
  display: flex; flex-direction: column; gap: 2px;
}
.day-note { font-size: 12px; color: #6B5F26; line-height: 1.5; word-break: break-word; }
.day-note-author { color: #A29455; font-size: 11px; }
.note-date-chip {
  display: inline-block; background: rgba(255,255,255,0.7); color: #1F5A94;
  font-size: 11px; font-weight: 700; border-radius: 5px; padding: 2px 8px;
  margin-bottom: 4px; border: 1px solid #C8DCEF; cursor: pointer;
}
.note-date-chip:active { background: #EAF3FC; }
.note-date-row { margin-top: 6px; display: flex; flex-direction: column; gap: 3px; }
.note-date-label { font-size: 11px; color: var(--muted); }
.note-date-row input[type="date"] {
  border: 1px solid #D8CE9E; border-radius: 6px; padding: 5px 8px;
  font-size: 13px; background: #fff; width: 100%;
}

/* ---------- 申し送り・メモ（付箋） ---------- */
.notes-pane {
  position: fixed; top: 96px; right: 8px; bottom: 8px; width: 268px;
  background: #F7F5EC; border: 1px solid #E4DFC8; border-radius: 12px;
  padding: 12px; overflow-y: auto; z-index: 40;
  box-shadow: 0 2px 10px rgba(20,40,80,0.10);
}
.notes-head { display: flex; align-items: center; justify-content: space-between; }
.notes-title { font-size: 14px; font-weight: 700; color: var(--brand-dark); }
.notes-close { display: none; font-size: 16px; padding: 2px 8px; }
.notes-sub { font-size: 11px; color: var(--muted); margin: 2px 0 8px; }
.note-add-btn {
  width: 100%; border: 1.5px dashed #C9BE8C; background: #FFFDF2; color: #8A7B36;
  border-radius: 8px; padding: 7px 0; font-size: 13px; margin-bottom: 8px;
}
.note-add-btn:active { background: #FFF7CE; }
.note-editor { margin-bottom: 8px; }
.note-editor textarea, .note-edit-text {
  width: 100%; border: 1px solid #D8CE9E; border-radius: 8px; padding: 8px;
  font-size: 13px; background: #FFFBE6; resize: vertical;
}
.note-editor-btns { display: flex; gap: 6px; justify-content: flex-end; margin-top: 6px; }
.note-btn {
  border: 1px solid var(--line); background: #fff; border-radius: 6px;
  padding: 5px 12px; font-size: 12.5px;
}
.note-btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.notes-empty { font-size: 12px; color: var(--muted); text-align: center; padding: 16px 0; }

.note-card {
  background: #FFF8B8; border-radius: 4px 4px 10px 4px; padding: 10px 10px 8px;
  margin-bottom: 10px; box-shadow: 1px 2px 5px rgba(90,80,20,0.18);
  border-top: 14px solid #F5E98F;
}
.note-text { font-size: 13px; line-height: 1.6; word-break: break-word; }
.note-meta { font-size: 10.5px; color: #8A7B36; margin-top: 6px; }
.note-actions { display: flex; gap: 4px; margin-top: 6px; flex-wrap: wrap; }
.note-act {
  border: none; background: rgba(255,255,255,0.55); border-radius: 5px;
  padding: 3px 7px; font-size: 11px; color: #6B5F26;
}
.note-act:active { background: #fff; }
.note-comments {
  margin-top: 7px; border-top: 1px dashed #D8CE9E; padding-top: 6px;
  display: flex; flex-direction: column; gap: 4px;
}
.note-comment {
  font-size: 11.5px; line-height: 1.5; background: rgba(255,255,255,0.6);
  border-radius: 6px; padding: 4px 7px; word-break: break-word;
}
.note-comment b { color: var(--brand-dark); }
.note-c-date { color: #A29455; font-size: 10px; margin-left: 6px; }
.note-c-input { display: flex; gap: 5px; margin-top: 7px; }
.note-c-input input {
  flex: 1; min-width: 0; border: 1px solid #D8CE9E; border-radius: 6px;
  padding: 5px 8px; font-size: 12.5px; background: #fff;
}

.notes-toggle {
  position: fixed; right: 14px; bottom: 18px; z-index: 45;
  width: 52px; height: 52px; border-radius: 50%; border: none;
  background: #F5C518; font-size: 22px; box-shadow: 0 3px 10px rgba(0,0,0,0.25);
  display: none;
}
.notes-count {
  position: absolute; top: -4px; right: -4px; background: var(--danger); color: #fff;
  font-size: 11px; font-weight: 700; border-radius: 999px; min-width: 18px; height: 18px;
  display: flex; align-items: center; justify-content: center; padding: 0 4px;
}

/* 画面幅が狭いとき: パネルは隠してトグルボタンで開閉 */
@media (max-width: 1439px) {
  .notes-pane { display: none; }
  .notes-pane.open {
    display: block; left: auto; width: min(320px, 92vw);
    top: 90px; box-shadow: -4px 0 20px rgba(0,0,0,0.25);
  }
  .notes-pane.open .notes-close { display: block; }
  .notes-toggle { display: block; }
}
/* 広い画面: 右余白に常時表示（本体は中央寄せのまま） */
@media (min-width: 1440px) {
  .notes-pane { display: block; }
}

/* ---------- 印刷（確定スケジュール出力） ---------- */
.print-root { display: none; }

@media print {
  body.print-mode #login-view,
  body.print-mode #app-view,
  body.print-mode .notes-pane,
  body.print-mode .notes-toggle,
  body.print-mode .modal-backdrop,
  body.print-mode .toast { display: none !important; }
  body.print-mode { background: #fff; }
  body.print-mode .print-root { display: block; }
  @page { margin: 12mm; }
}

.pr-header h1 { font-size: 16pt; color: #1F3864; margin-bottom: 2mm; }
.pr-sub { font-size: 9.5pt; color: #555; margin-bottom: 4mm; }
.pr-month {
  font-size: 12pt; color: #1F3864; border-left: 4px solid #2F5496;
  padding-left: 3mm; margin: 5mm 0 2mm;
}
.pr-table { border-collapse: collapse; width: 100%; font-size: 9pt; }
.pr-table th, .pr-table td {
  border: 1px solid #999; padding: 1.5mm 2mm; text-align: left; vertical-align: top;
}
.pr-table th { background: #EDF1F8; color: #1F3864; }
.pr-table tr { page-break-inside: avoid; }
.pr-nowrap { white-space: nowrap; }
.pr-small { font-size: 8pt; }
.pr-maybe { color: #666; font-size: 8pt; }
.pr-sanchi {
  color: #fff; font-size: 8pt; font-weight: 700; border-radius: 3px;
  padding: 0.3mm 1.5mm; white-space: nowrap;
  -webkit-print-color-adjust: exact; print-color-adjust: exact;
}

.pr-cal-month { margin-bottom: 6mm; }
.pr-break { page-break-before: always; }
.pr-cal { border-collapse: collapse; width: 100%; table-layout: fixed; font-size: 8pt; }
.pr-cal th { border: 1px solid #999; background: #EDF1F8; padding: 1mm; font-size: 9pt; }
.pr-cal td { border: 1px solid #999; vertical-align: top; padding: 1mm; height: 22mm; }
.pr-cal-empty { background: #F5F5F5; }
.pr-cal-day { font-weight: 700; font-size: 9pt; }
.pr-cal-day.pr-sun, th.pr-sun { color: #C00000; }
.pr-cal-day.pr-sat, th.pr-sat { color: #2F6FB0; }
.pr-hol { font-size: 7pt; font-weight: 400; margin-left: 1mm; color: #C00000; }
.pr-cal-item { margin-top: 0.8mm; line-height: 1.35; word-break: break-word; }

/* ---------- 出欠一覧の印刷（A4横） ---------- */
.pr-mx { border-collapse: collapse; width: 100%; font-size: 8pt; }
.pr-mx th, .pr-mx td { border: 1px solid #999; padding: 1mm 1.5mm; }
.pr-mx thead th { background: #EDF1F8; color: #1F3864; }
.pr-mx .pr-mx-grp { font-size: 7.5pt; font-weight: 400; }
.pr-mx .pr-mx-name { font-size: 8.5pt; width: 11mm; text-align: center; }
.pr-mx-visit-h { text-align: left; }
.pr-mx-visit { text-align: left; line-height: 1.4; }
.pr-mx-mark {
  text-align: center; font-size: 10pt; font-weight: 700;
  -webkit-print-color-adjust: exact; print-color-adjust: exact;
}
.pr-mx tr { page-break-inside: avoid; }
.pr-mx .pr-sun { color: #C00000; }
.pr-mx .pr-sat { color: #2F6FB0; }
.pr-mx-g {
  background: #5B6B84; color: #fff; font-size: 7pt; font-weight: 700;
  border-radius: 2px; padding: 0 1mm;
  -webkit-print-color-adjust: exact; print-color-adjust: exact;
}
.pr-mx-appt { color: #1F5A94; font-size: 7.5pt; }
.pr-mx-fixed {
  background: #1E7A47; color: #fff; font-size: 7pt; font-weight: 700;
  border-radius: 2px; padding: 0 1mm;
  -webkit-print-color-adjust: exact; print-color-adjust: exact;
}
.pr-mx-mark.mk-◎ { color: #1E7A47; }
.pr-mx-mark.mk-○ { color: #2F6FB0; }
.pr-mx-mark.mk-△ { color: #A87E19; }
.pr-mx-mark.mk-× { color: #C00000; }

/* ---------- トースト ---------- */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: rgba(30, 42, 66, 0.95); color: #fff; font-size: 14px;
  padding: 10px 22px; border-radius: 999px; z-index: 99;
  box-shadow: 0 4px 14px rgba(0,0,0,0.25);
}

/* ---------- PC レイアウト ---------- */
@media (min-width: 700px) {
  body { font-size: 15px; }
  .tab-panel { padding: 16px 20px 80px; }
  .modal-backdrop { align-items: center; }
  .modal { border-radius: 16px; max-height: 86vh; }
  .att-name { flex-basis: 80px; }
  .mark-btn { max-width: 60px; }
  .slot-label { flex-basis: 72px; }
  .slot-name { font-size: 14px; }
  .slot-time { font-size: 11px; }
  .visit-title { font-size: 14px; }
}
