/* =============================================================================
   v6.273.0: 管制設定ページの再設計 CSS（サンプル準拠・DESIGN.md 準拠）
   =============================================================================
   グループ化 + 通知カード 4 枚（リマインド/アラート統合）+ メッセージエディタ。
   - 色は既存 CSS 変数（--color-primary, --navy, --gray-*, --danger, --success, --shadow-*）流用。
   - 2 カラム grid は minmax(0,1fr) で min-width:0 罠を回避（feedback_design_md_compliance.md）。
   - ピル型ボタン（border-radius:9999px, height:44px）＝ DESIGN.md 準拠。 */

/* --- 共通ページ枠 --- */
body { background: #f3f4f6; }
.kansei-settings-wrap {
  max-width: 1000px;
  margin: 0 auto;
  padding: 24px 16px 80px;
}
.kansei-settings-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}
.kansei-settings-header h1 { font-size: 20px; font-weight: 700; color: var(--navy); margin: 0; }
.kansei-settings-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.kansei-info-bar {
  background: var(--navy-pale);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 13px;
  margin-bottom: 20px;
}
.kansei-info-bar .name { font-weight: 700; color: var(--navy); }

/* --- グループ見出し --- */
.group-heading {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 700;
  color: var(--navy);
  margin: 28px 0 6px;
  padding-left: 10px;
  border-left: 4px solid var(--color-primary);
  line-height: 1.4;
}
.group-heading:first-of-type { margin-top: 8px; }
.group-heading .g-icon { width: 18px; height: 18px; color: var(--color-primary); flex-shrink: 0; }
.group-note {
  font-size: 12px;
  color: var(--gray-600);
  margin: 0 0 14px 14px;
  line-height: 1.6;
}
.group-note .remind-hint { color: var(--color-primary); font-weight: 600; }
.group-note .alert-hint  { color: var(--danger); font-weight: 600; }

/* --- 小型設定カード（受付時間・OK取り・イベントサポーター）--- */
.simple-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));  /* min-width:0 罠回避 */
  gap: 12px;
}
.simple-card {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  box-shadow: var(--shadow-sm);
}
.simple-card-info { min-width: 0; flex: 1; }
.simple-card-label { font-size: 13.5px; font-weight: 700; color: var(--navy); }
.simple-card-desc {
  font-size: 11.5px;
  color: var(--gray-600);
  margin-top: 3px;
  line-height: 1.5;
  word-break: break-word;
}
.simple-card-input {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.num-input {
  width: 64px;
  height: 38px;
  border: 1.5px solid var(--gray-200);
  border-radius: 8px;
  text-align: center;
  font-size: 14px;
  font-family: inherit;
  background: #fff;
  color: var(--gray-800);
}
.num-input:focus {
  outline: none;
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(26, 58, 92, 0.12);
}
.unit-label { font-size: 12px; color: var(--gray-600); white-space: nowrap; }
.save-btn {
  height: 38px;
  padding: 0 16px;
  background: var(--color-primary);
  color: #fff;
  border: none;
  border-radius: 9999px;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
}
.save-btn:hover { background: var(--color-primary-hover, #1558b0); }
.save-btn:disabled { background: var(--gray-400); cursor: not-allowed; }

/* --- 通知カード 4 枚（前日確認 / 出発 / 上番 / 下番）--- */
.notify-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.notify-card {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.notify-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid #f0f0f0;
  background: #fafbfc;
}
.notify-card-icon {
  width: 34px; height: 34px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.notify-card-icon.c-preconfirm { background: #e8f0fe; color: #1a56c4; }  /* 前日確認 = 青 */
.notify-card-icon.c-departure  { background: #e6f4ea; color: #188038; }  /* 出発 = 緑 */
.notify-card-icon.c-checkin    { background: #fef7e0; color: #b06000; }  /* 上番 = 琥珀 */
.notify-card-icon.c-checkout   { background: #fce8e6; color: #c5221f; }  /* 下番 = 赤 */
.notify-card-icon svg { width: 18px; height: 18px; }
.notify-card-title { font-size: 15px; font-weight: 700; color: var(--navy); }
.notify-card-sub { font-size: 11.5px; color: var(--gray-600); margin-top: 2px; }

.notify-row { padding: 14px 18px; }
.notify-row + .notify-row { border-top: 1px dashed #eee; }
.notify-row-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.notify-row-type {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  color: var(--gray-800);
}
.type-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.type-dot.remind { background: var(--color-primary); }
.type-dot.alert  { background: var(--danger); }
.notify-timing {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.notify-timing .prefix { font-size: 12px; color: var(--gray-600); white-space: nowrap; }

/* v6.273.2: 上番リマインド行の補足テキスト（「＝報告受付開始と同時」）。
   prefix を短縮して 1 行右揃えを維持しつつ、業務担当者向けの補足説明を入力行の下に
   小さく muted 表示する（他 7 行のレイアウトに影響なし・display:none 時は非表示）。 */
.notify-timing-hint {
  font-size: 11px;
  color: var(--gray-600);
  text-align: right;
  margin: 4px 0 0;
  line-height: 1.5;
  padding: 0 2px;
}

.msg-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--navy);
  cursor: pointer;
  background: none;
  border: none;
  padding: 8px 0 0;
  font-family: inherit;
  font-weight: 600;
}
.msg-toggle:hover { color: var(--color-primary); }
.msg-toggle .caret {
  width: 12px; height: 12px;
  transition: transform 0.15s;
  display: inline-block;
}
.msg-toggle.open .caret { transform: rotate(90deg); }

.msg-editor {
  display: none;
  margin-top: 10px;
  background: #f8f9fa;
  border: 1px solid var(--gray-200);
  border-radius: 10px;
  padding: 12px;
}
.msg-editor.open { display: block; }
.msg-field { margin-bottom: 10px; }
.msg-field label {
  display: block;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--gray-800);
  margin-bottom: 4px;
}
.msg-field input,
.msg-field textarea {
  width: 100%;
  border: 1.5px solid var(--gray-200);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 12.5px;
  font-family: inherit;
  background: #fff;
  color: var(--gray-800);
  box-sizing: border-box;
}
.msg-field input:focus,
.msg-field textarea:focus {
  outline: none;
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(26, 58, 92, 0.12);
}
.msg-field textarea { min-height: 64px; resize: vertical; }
.msg-field .char-count {
  font-size: 10.5px;
  color: var(--gray-600);
  text-align: right;
  margin-top: 3px;
}
.var-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 6px;
}
.var-chip {
  font-size: 10.5px;
  background: #e8f0fe;
  color: #1a56c4;
  border-radius: 6px;
  padding: 2px 8px;
  font-family: 'Menlo', 'Consolas', monospace;
  cursor: pointer;
  user-select: none;
  border: none;
}
.var-chip:hover { background: #d5e3fd; }
.var-hint {
  font-size: 10.5px;
  color: var(--gray-600);
  margin: 0 0 10px;
  line-height: 1.5;
}
.msg-editor-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.reset-link {
  font-size: 11.5px;
  color: var(--gray-600);
  background: none;
  border: none;
  cursor: pointer;
  text-decoration: underline;
  font-family: inherit;
  padding: 4px 0;
}
.reset-link:hover { color: var(--danger); }

/* --- スマホ幅で 1 カラムに折り返し --- */
@media (max-width: 720px) {
  .simple-grid,
  .notify-grid {
    grid-template-columns: 1fr;
  }
  .simple-card {
    flex-direction: column;
    align-items: stretch;
  }
  .simple-card-input {
    justify-content: flex-start;
  }
  .notify-row-head {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  .notify-timing {
    justify-content: flex-start;
  }
}

/* --- 戻るボタン（ピル型・DESIGN.md 準拠）--- */
.back-btn-pill {
  height: 40px;
  padding: 0 16px;
  border: 1.5px solid var(--gray-200);
  border-radius: 9999px;
  background: #fff;
  font-size: 13px;
  color: var(--navy);
  cursor: pointer;
  font-family: inherit;
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}
.back-btn-pill:hover { background: var(--navy-pale); border-color: var(--navy); }

/* --- トースト（旧 CSS からそのまま流用）--- */
.toast {
  position: fixed; top: 72px; right: 16px; z-index: 800;
  padding: 10px 18px; border-radius: var(--radius-sm);
  color: #fff; font-size: 13px; font-weight: 500;
  box-shadow: var(--shadow-md); opacity: 0; transform: translateY(-10px);
  transition: opacity 0.25s, transform 0.25s;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast.success { background: var(--success); }
.toast.error   { background: var(--danger); }
.toast.info    { background: var(--navy); }
