:root {
  --theme-primary: #4a90a4;
  --theme-secondary: #7cb9b8;
  --color-text: #2c3e50;
  --color-text-light: #5d6d7e;
  --color-white: #ffffff;
  --color-bg: #f5f7fa;
  --color-border: #e0e6ed;
  --color-success: #27ae60;
  --color-danger: #c53030;
  --font-main:
    'Hiragino Sans', 'Noto Sans JP', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  overflow: hidden;
}

body {
  font-family: var(--font-main);
  background: var(--color-bg);
  display: flex;
  flex-direction: column;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

/* ヘッダー — 縦を詰めて表示領域を確保 */
.header {
  background: var(--color-white);
  padding: 0.4rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.04);
  flex-shrink: 0;
  border-bottom: 1px solid rgba(224, 230, 237, 0.8);
}

.header__title {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.header__back {
  background: none;
  border: 1.5px solid var(--color-border);
  padding: 0.25rem 0.6rem;
  border-radius: 0.4rem;
  font-size: 0.8rem;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  color: var(--color-text);
  transition: all 0.2s;
  line-height: 1.2;
}

.header__back:hover {
  background: var(--theme-primary);
  border-color: var(--theme-primary);
  color: white;
}

.header__h1 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-text);
  line-height: 1.2;
}

.header__clinic {
  font-size: 0.8rem;
  color: var(--color-text-light);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

/* メインコンテナ */
.main-container {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0.55rem 0.75rem 0.65rem;
  gap: 0.55rem;
}

/* タブナビゲーション — 常に表示 */
.tabs {
  display: flex;
  gap: 0.25rem;
  background: var(--color-white);
  padding: 0.2rem;
  border-radius: 0.65rem;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.04);
  flex-shrink: 0;
  position: relative;
  z-index: 20;
}

.tab-btn {
  flex: 1;
  padding: 0.25rem 0.45rem;
  border: none;
  background: transparent;
  border-radius: 0.45rem;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--color-text-light);
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  line-height: 1.15;
  min-height: 1.45rem;
}

.tab-btn:hover {
  background: var(--color-bg);
}

.tab-btn--active {
  background: linear-gradient(135deg, var(--theme-primary), var(--theme-secondary));
  color: white;
  box-shadow: 0 2px 8px rgba(74, 144, 164, 0.26);
}

.tab-icon {
  font-size: 0.9rem;
}

/* タブコンテンツ */
.tab-panels {
  flex: 1;
  min-height: 0;
  position: relative;
  overflow: hidden;
}

.tab-content {
  position: absolute;
  inset: 0;
  background: var(--color-white);
  border-radius: 0.75rem;
  padding: 0.7rem 0.9rem;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.04);
  overflow-x: hidden;
  overflow-y: auto;
  display: none;
  -webkit-overflow-scrolling: touch;
  min-height: 0;
  max-height: 100%;
}

.tab-content--active {
  display: block;
}

/* 音声タブ: シェル＋左メイン＋右チャイム — スタイリッシュ版 */
#tab-voice {
  --voice-ink: #16323f;
  --voice-muted: #6b818c;
  --voice-line: rgba(74, 144, 164, 0.18);
  --voice-teal: #3e8a9c;
  --voice-teal-deep: #2f6f7e;
  --voice-teal-soft: rgba(62, 138, 156, 0.1);
  --voice-surface: #ffffff;
  --voice-gap: clamp(0.45rem, 0.35rem + 0.55vw, 0.8rem);
  --voice-section-gap: clamp(0.85rem, 0.65rem + 0.9vw, 1.35rem);
  --voice-pad: clamp(0.5rem, 0.35rem + 0.65vw, 0.9rem);
  overflow: hidden;
}

.voice-shell {
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: transparent;
  border: none;
  margin: 0;
  padding: 0;
  overflow: hidden;
}

/* 2列 — 左:音声選択 / 右:チャイム（最低幅を確保して潰れ防止） */
.voice-grid {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) minmax(17rem, 20rem) !important;
  gap: var(--voice-gap);
  align-items: stretch;
  flex: 1;
  min-height: 0;
  height: 100%;
  overflow: hidden;
}

.voice-col {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: var(--voice-section-gap);
  border-radius: clamp(10px, 0.5rem + 0.4vw, 14px);
  overflow: hidden;
  padding: var(--voice-pad) clamp(0.55rem, 0.4rem + 0.75vw, 0.95rem);
}

/* 左カード（音声選択）— 他タブ同様の白基調 */
.voice-col--voice {
  background: #ffffff !important;
  border: 1px solid #e0e6ed !important;
  box-shadow: none;
  container-type: inline-size;
  container-name: voice-main;
}

/* 右カード（チャイム選択） */
.voice-col--chime {
  background: #ffffff !important;
  border: 1px solid #e0e6ed !important;
  box-shadow: none;
  overflow: hidden;
}
.voice-col--chime .voice-side-card {
  background: #ffffff;
  border: 1px solid #e0e6ed;
  box-shadow: none;
}
.voice-col--chime .voice-side-card--chime {
  background: #ffffff;
}

/* タイトル行（カード内ヘッダー） */
.voice-col__head {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  padding-bottom: clamp(0.25rem, 0.2rem + 0.25vw, 0.4rem);
  margin: 0;
  border-bottom: 1px solid #e0e6ed;
  min-height: clamp(1.5rem, 1.2rem + 0.8vw, 2rem);
}
.voice-col--chime .voice-col__head {
  border-bottom-color: #e0e6ed;
}
.voice-col--chime .voice-section-label__title {
  color: var(--voice-ink, #16323f);
}
.voice-col--chime .voice-section-label__mark {
  background: linear-gradient(180deg, var(--voice-teal, #3e8a9c), var(--voice-teal-deep, #2f6f7e));
  box-shadow: 0 2px 6px rgba(47, 111, 126, 0.25);
}

/* 旧クラス互換 */
.voice-grid__main,
.voice-grid__side {
  min-width: 0;
}
.voice-toprow,
.voice-current-card,
.voice-current-inline {
  display: none !important;
}

@media (max-width: 1100px) {
  .voice-grid {
    grid-template-columns: 1fr !important;
  }
  .voice-col--chime {
    min-height: 0;
  }
}

/* セクション見出し */
.voice-section-label {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.45rem;
  margin: 0;
  min-height: 0;
  flex-shrink: 0;
}
.voice-section-label__mark {
  width: 0.3rem;
  height: clamp(0.85rem, 1.5vh, 1.05rem);
  border-radius: 999px;
  background: linear-gradient(180deg, var(--voice-teal, #3e8a9c), var(--voice-teal-deep, #2f6f7e));
  box-shadow: 0 2px 6px rgba(47, 111, 126, 0.35);
  flex-shrink: 0;
}
.voice-section-label__title {
  margin: 0;
  font-size: clamp(0.88rem, 0.7rem + 0.55vw, 1.05rem);
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--voice-ink, #16323f);
  white-space: nowrap;
  line-height: 1;
}
.voice-section-label__line {
  display: none;
}

/* 旧ツールバー（互換） */
.voice-toolbar {
  display: none;
}

/* 旧ヒーロー / 旧トップ（互換） */
.voice-hero,
.voice-top,
.voice-layout,
.voice-header-bar {
  display: none !important;
}
.voice-hero__eyebrow {
  margin: 0 0 0.25rem;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--theme-primary);
}
.voice-hero__title {
  margin: 0;
  font-size: 1.45rem;
  font-weight: 900;
  color: #1a2b3a;
  letter-spacing: -0.02em;
  line-height: 1.25;
}
.voice-hero__lead {
  margin: 0.45rem 0 0;
  max-width: 36rem;
  font-size: 0.88rem;
  line-height: 1.55;
  color: var(--color-text-light);
}
.voice-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.voice-header .section-title {
  margin: 0;
}
.voice-test-big {
  padding: 0.45rem 1.15rem;
  font-size: 0.82rem;
  font-weight: 800;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--voice-teal, #3e8a9c), var(--voice-teal-deep, #2f6f7e));
  border: none;
  box-shadow: 0 6px 16px rgba(47, 111, 126, 0.28);
  white-space: nowrap;
  flex-shrink: 0;
  min-height: 2.15rem;
  line-height: 1.15;
  letter-spacing: 0.02em;
}
.voice-test-big:hover {
  filter: brightness(1.05);
  transform: translateY(-1px);
}

/* モード選択 — タイトル下・設定上と均等スペース（親 gap で制御） */
.voice-pick {
  display: flex;
  flex-direction: column;
  gap: 0;
  position: relative;
  flex-shrink: 0;
  margin: 0;
}
.voice-pick__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.voice-pick__title {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--color-text-light);
  letter-spacing: 0.02em;
  line-height: 1.2;
}
.voice-pick__title--sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.voice-pick__hint {
  margin: 0;
  font-size: 0.75rem;
  color: var(--color-text-light);
}
.voice-mode-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(0.4rem, 0.8vw, 0.65rem);
  margin: 0;
}
@media (max-width: 900px) {
  .voice-mode-tabs {
    grid-template-columns: 1fr;
    gap: 0.45rem;
  }
}
.voice-mode-card {
  display: flex;
  align-items: center;
  gap: clamp(0.45rem, 0.8vw, 0.65rem);
  padding: clamp(0.55rem, 1vh, 0.75rem) clamp(0.55rem, 1vw, 0.85rem);
  background: #ffffff;
  border: 1px solid #d0dae3;
  border-radius: 12px;
  cursor: pointer;
  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    opacity 0.18s ease,
    background 0.18s ease;
  position: relative;
  min-width: 0;
  min-height: 3rem;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  overflow: hidden;
}
.voice-mode-card::before {
  display: none;
}
.voice-mode-card:hover {
  border-color: rgba(62, 138, 156, 0.45);
  box-shadow: 0 2px 6px rgba(47, 111, 126, 0.08);
}
.voice-mode-card input[type='radio'] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.voice-mode-card--active {
  border-color: var(--voice-teal, #3e8a9c);
  background: #ffffff;
  box-shadow: 0 2px 8px rgba(47, 111, 126, 0.12);
  opacity: 1;
}
.voice-mode-card--active::before {
  display: none;
}
.voice-mode-card--dimmed {
  opacity: 0.62;
  background: #f8fafc;
  box-shadow: none;
}
.voice-mode-card--dimmed:hover {
  opacity: 0.82;
}
.voice-mode-card--active .voice-mode-card__icon {
  background: linear-gradient(145deg, var(--voice-teal, #3e8a9c), var(--voice-teal-deep, #2f6f7e));
  color: #fff;
  box-shadow: 0 4px 10px rgba(47, 111, 126, 0.28);
}
.voice-mode-card__recommend {
  position: static;
  top: auto;
  right: auto;
  font-size: 0.55rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #fff;
  background: linear-gradient(135deg, var(--voice-teal, #3e8a9c), var(--voice-teal-deep, #2f6f7e));
  border: none;
  padding: 0.12rem 0.4rem;
  border-radius: 999px;
  line-height: 1.2;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(47, 111, 126, 0.28);
}
.voice-mode-card__title-row {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  min-width: 0;
}
.voice-mode-card__icon {
  font-size: 0.9rem;
  line-height: 1;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #eef4f7;
  border-radius: 9px;
  flex-shrink: 0;
  transition:
    background 0.18s ease,
    box-shadow 0.18s ease,
    color 0.18s ease;
}
.voice-mode-card__body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.08rem;
  padding-right: 0.9rem;
}
.voice-mode-card__title {
  font-weight: 800;
  color: var(--voice-ink, #16323f);
  font-size: clamp(0.88rem, 0.8rem + 0.4vw, 1.02rem);
  line-height: 1.3;
  display: block;
  letter-spacing: -0.01em;
}
.voice-mode-card__paren {
  font-weight: 600;
  font-size: clamp(0.72rem, 0.68rem + 0.25vw, 0.82rem);
  color: var(--voice-muted, #6b818c);
}
.voice-mode-card__desc {
  display: none;
}
.voice-mode-card--saved:not(.voice-mode-card--active) {
  border-color: #cbd5e0;
}
.voice-mode-card__saved-badge {
  display: inline-flex;
  align-items: center;
  margin-top: 0;
  font-size: 0.52rem;
  font-weight: 800;
  color: #166534;
  background: #dcfce7;
  padding: 0.05rem 0.3rem;
  border-radius: 999px;
  border: 1px solid #bbf7d0;
  line-height: 1.15;
  width: fit-content;
}
.voice-mode-card__badge {
  display: inline-flex;
  align-items: center;
  margin-top: 0;
  font-size: 0.52rem;
  font-weight: 800;
  color: #b45309;
  background: #fffbeb;
  padding: 0.05rem 0.3rem;
  border-radius: 999px;
  border: 1px solid #fde68a;
  line-height: 1.15;
  width: fit-content;
}
.voice-mode-card__badge:empty,
.voice-mode-card__saved-badge:empty {
  display: none;
}
.voice-mode-card__check {
  position: absolute;
  right: 0.55rem;
  top: 50%;
  transform: translateY(-50%);
  width: 0.9rem;
  height: 0.9rem;
  border-radius: 50%;
  border: 2px solid #d0d9e0;
  background: #fff;
  transition:
    border-color 0.18s,
    background 0.18s,
    box-shadow 0.18s;
}
.voice-mode-card--active .voice-mode-card__check {
  border-color: transparent;
  background: linear-gradient(145deg, var(--voice-teal, #3e8a9c), var(--voice-teal-deep, #2f6f7e));
  box-shadow: 0 2px 6px rgba(47, 111, 126, 0.35);
}
.voice-mode-card--active .voice-mode-card__check::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 45%;
  width: 0.28rem;
  height: 0.45rem;
  border: solid #fff;
  border-width: 0 1.5px 1.5px 0;
  transform: translate(-50%, -55%) rotate(45deg);
}

.voice-mode-desc {
  display: none !important;
}

.voice-panel-intro {
  display: none !important;
}

.voice-controls-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin: 0.35rem 0 0.65rem;
}
@media (max-width: 560px) {
  .voice-controls-grid {
    grid-template-columns: 1fr;
  }
}

.voice-danger-details {
  margin: 0.35rem 0 0;
  border: 1px dashed #e2e8f0;
  border-radius: 10px;
  padding: 0.55rem 0.75rem;
  background: #f8fafc;
}
.voice-danger-details > summary {
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--color-text-light);
  list-style: none;
}
.voice-danger-details > summary::-webkit-details-marker {
  display: none;
}
.voice-danger-details[open] > summary {
  margin-bottom: 0.65rem;
  color: #b45309;
}

/*
 * STEP レイアウト — ①② 縦積み（一本道）
 */
.voice-steps-row,
.voice-steps-row.voice-steps-row--force-row,
.voice-steps-row.voice-steps-row--stack {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: none;
  flex-direction: unset !important;
  flex-wrap: unset !important;
  align-items: stretch;
  gap: clamp(0.4rem, 0.3rem + 0.45vw, 0.6rem);
  flex: 1 1 auto;
  width: 100%;
  height: auto;
  min-height: 0;
  max-height: 100%;
  overflow: hidden;
  position: relative;
}
.voice-steps-row::before {
  display: none;
}
.voice-steps-row > .voice-card:nth-child(1),
.voice-steps-row > .voice-card:nth-child(2) {
  grid-column: 1;
  grid-row: auto;
  align-self: stretch;
  min-height: 0;
  overflow: visible;
}
.voice-steps-row > .voice-card {
  flex: none !important;
  min-width: 0 !important;
  width: auto !important;
  max-width: none;
  display: flex;
  flex-direction: column;
  overflow: visible;
  position: relative;
  z-index: 1;
  min-height: 0;
  height: auto;
  padding: 0.55rem 0.65rem !important;
}
.voice-steps-row .voice-file-list--step1,
.voice-steps-row #preset-list.preset-card-grid,
.voice-steps-row #downloaded-preset-list.preset-card-grid,
.voice-steps-row .voice-room-list {
  flex: 0 0 auto;
  min-height: 0;
  overflow: visible;
  max-height: none;
}
.voice-steps-row .voice-step-badge {
  min-width: 1.35rem;
  width: 1.35rem;
  height: 1.35rem;
  padding: 0;
  font-size: 0.68rem;
  border-radius: 999px;
}
.voice-steps-row .voice-step-status {
  font-size: 0.62rem;
  padding: 0.12rem 0.35rem;
}
.voice-steps-row .voice-card__title {
  font-size: 0.8rem;
  line-height: 1.25;
  flex: 1 1 auto;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 0;
}
.voice-steps-row .form-row {
  grid-template-columns: 1fr 1fr;
  gap: 0.4rem;
}
@media (max-width: 560px) {
  .voice-steps-row .form-row {
    grid-template-columns: 1fr;
  }
}
.voice-steps-row .form-group {
  margin-bottom: 0.35rem;
}
.voice-steps-row .form-group:last-child {
  margin-bottom: 0;
}
.voice-card__compact-field {
  margin-bottom: 0.3rem;
}
.voice-steps-row .preset-list-loading {
  padding: 0.5rem 0.25rem;
  font-size: 0.75rem;
}
.voice-steps-row .btn--block {
  font-size: 0.78rem;
  padding: 0.55rem 0.65rem;
  white-space: normal;
  line-height: 1.3;
  min-height: 2.1rem;
  margin-top: auto;
  border-radius: 10px;
}
@media (max-width: 900px) {
  .voice-steps-row,
  .voice-steps-row.voice-steps-row--force-row,
  .voice-steps-row.voice-steps-row--stack {
    grid-template-columns: 1fr;
  }
}
.voice-step-status {
  font-size: 0.72rem;
  font-weight: 800;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  letter-spacing: 0.02em;
  flex-shrink: 0;
}
.voice-step-status--done {
  color: #1b5e20;
  background: #e8f5e9;
  border: 1px solid #a5d6a7;
}
.voice-step-status--warn {
  color: #e65100;
  background: #fff3e0;
  border: 1px solid #ffb74d;
}
.voice-step-status--pending {
  color: #1565c0;
  background: #e3f2fd;
  border: 1px solid #90caf9;
}

/*
 * モードパネル — アクティブのみ表示（余った高さは使いつつ縦スクロールを出さない）
 */
.voice-panel-stack {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.voice-mode-panel {
  display: none;
  flex-direction: column;
  gap: clamp(0.3rem, 0.7vh, 0.45rem);
  min-width: 0;
  min-height: 0;
  flex: 1 1 auto;
  height: 100%;
  overflow: hidden;
}
.voice-mode-panel.is-active {
  display: flex;
}
.voice-mode-panel.is-active .voice-steps-row {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}
@keyframes voice-panel-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
#preset-library-settings.voice-mode-panel,
#audio-file-settings.voice-mode-panel,
#tts-settings.voice-mode-panel {
  min-height: 0;
}
#tab-voice.tab-content--active,
#tab-highlight.tab-content--active {
  overflow: hidden;
}
#tab-voice.tab-content--active {
  display: flex !important;
  flex-direction: column;
  padding: clamp(0.35rem, 0.25rem + 0.45vw, 0.6rem) clamp(0.4rem, 0.3rem + 0.55vw, 0.75rem);
  overflow: hidden !important;
  overflow-y: hidden !important;
}
#tab-voice .voice-shell {
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
#tab-voice .voice-grid {
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.voice-card {
  background: #ffffff;
  border-radius: 12px;
  padding: 0.75rem 0.9rem;
  border: 1px solid #d8e2ea;
  box-shadow: 0 1px 2px rgba(22, 50, 63, 0.05);
  position: relative;
}
.voice-card--step {
  border-color: #d8e2ea;
}
.voice-card--action {
  background: #ffffff;
  border-color: #e0e6ed;
  box-shadow: none;
}
.voice-card__head {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.35rem;
  padding-bottom: 0.3rem;
  border-bottom: 1px solid #eef2f6;
  flex-shrink: 0;
}
.voice-step-badge {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.55rem;
  width: 1.55rem;
  height: 1.55rem;
  padding: 0;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0;
  color: #fff;
  background: linear-gradient(145deg, var(--voice-teal, #3e8a9c), var(--voice-teal-deep, #2f6f7e));
  border: none;
  border-radius: 999px;
  line-height: 1;
  box-shadow: 0 3px 8px rgba(47, 111, 126, 0.32);
}
.voice-step-badge--muted {
  color: var(--voice-muted, #6b818c);
  background: #f1f5f7;
  border: 1px solid #e2e8f0;
  box-shadow: none;
}
.voice-card__title {
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--voice-ink, #16323f);
  margin: 0;
  line-height: 1.3;
  letter-spacing: -0.01em;
}
.voice-card__hint {
  font-size: 0.76rem;
  color: var(--color-text-light);
  margin: 0 0 0.55rem;
  line-height: 1.4;
}
.voice-card__actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
}
.voice-delete-actions .btn {
  flex: 1 1 auto;
  min-width: 9rem;
}
.voice-delete-section {
  margin-bottom: 0.65rem;
}
.voice-delete-section__label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--color-text-light);
  margin-bottom: 0.35rem;
}
.voice-place-layout-note {
  margin: 0 0 0.65rem;
  padding: 0.5rem 0.65rem;
  background: rgba(74, 144, 164, 0.08);
  border-radius: 6px;
  border: 1px solid rgba(74, 144, 164, 0.18);
}
.voice-place-layout-note--compact {
  margin-bottom: 0.45rem;
  padding: 0.45rem 0.55rem;
  font-size: 0.8rem;
  line-height: 1.4;
}
.voice-clinic-audio-policy {
  margin: 0 0 0.75rem;
  padding: 0.7rem 0.85rem;
  background: rgba(74, 144, 164, 0.08);
  border-radius: 10px;
  border: 1px solid rgba(74, 144, 164, 0.2);
  font-size: 0.82rem;
  line-height: 1.55;
}
#audio-step-upload {
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.voice-step1-head {
  flex-wrap: wrap;
  gap: 0.35rem 0.5rem;
}
.voice-step1-head__count {
  margin-left: auto;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--color-text-light);
  background: var(--color-bg);
  padding: 0.12rem 0.45rem;
  border-radius: 4px;
  border: 1px solid var(--color-border);
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}
.voice-step1-progress-row {
  margin-bottom: 0.35rem;
}
.voice-step1-progress-row .voice-step1-progress {
  margin-bottom: 0;
}
.voice-step1-progress-row .voice-upload-activity {
  margin-top: 0.35rem;
  margin-bottom: 0;
}
.voice-step1-body {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  flex: 0 0 auto;
  min-height: 0;
  width: 100%;
}
.voice-audio-block {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  width: 100%;
  padding: 0.55rem 0.65rem;
  background: #f7fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
}
.voice-audio-block__head {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.voice-audio-block__title {
  margin: 0;
  font-size: clamp(0.85rem, 0.78rem + 0.35vw, 0.98rem);
  font-weight: 800;
  color: var(--color-text);
  line-height: 1.3;
}
.voice-audio-block__hint {
  margin: 0;
  font-size: clamp(0.72rem, 0.68rem + 0.25vw, 0.82rem);
  color: var(--color-text-light);
  line-height: 1.35;
}
.voice-step1-numbers {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.45rem;
  width: 100%;
}
.voice-step1-numbers .voice-section-head__count {
  font-size: clamp(0.72rem, 0.68rem + 0.2vw, 0.8rem);
  padding: 0.15rem 0.5rem;
}
.voice-step1-numbers .btn {
  min-height: 2.25rem;
  padding: 0.4rem 0.75rem;
  font-size: clamp(0.78rem, 0.72rem + 0.3vw, 0.88rem);
  flex: 1 1 auto;
}
.voice-step1-places {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-height: 0;
  width: 100%;
}
.voice-step1-places__head {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}
.voice-step1-places__label {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--color-text);
}
.voice-step1-places__hint {
  font-size: 0.68rem;
  color: var(--color-text-light);
}
/* 場所名カード: 横1行（名前の横に選択・試聴）＋画面幅で折り返し */
.place-audio-strip,
#room-audio-list.place-audio-strip,
#room-audio-list.voice-room-list {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 0.45rem !important;
  align-items: stretch !important;
  width: 100% !important;
  max-width: 100% !important;
  padding: 0 !important;
  min-height: 0 !important;
  max-height: none !important;
  overflow: visible !important;
  flex: none !important;
}
@media (max-width: 700px) {
  .place-audio-strip,
  #room-audio-list.place-audio-strip,
  #room-audio-list.voice-room-list {
    grid-template-columns: minmax(0, 1fr) !important;
  }
}
.place-audio-card {
  display: grid !important;
  grid-template-columns: auto minmax(0, 1fr) auto !important;
  align-items: center !important;
  justify-content: stretch !important;
  gap: 0.35rem 0.45rem !important;
  box-sizing: border-box !important;
  min-width: 0 !important;
  width: 100% !important;
  max-width: none !important;
  min-height: 0 !important;
  height: auto !important;
  padding: 0.4rem 0.5rem !important;
  margin: 0 !important;
  background: #ffffff !important;
  border: 1.5px solid #d0dae3 !important;
  border-radius: 10px !important;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04) !important;
  grid-template-rows: none !important;
  cursor: pointer;
}
.place-audio-card:hover {
  border-color: rgba(62, 138, 156, 0.45) !important;
  box-shadow: 0 2px 6px rgba(47, 111, 126, 0.08) !important;
}
.place-audio-card--ok {
  border-color: #68b87d !important;
  background: #f3faf5 !important;
}
.place-audio-card--warn {
  border-color: #e6a23c !important;
  background: #fff8eb !important;
}
.place-audio-card--missing {
  border-color: #d0dae3 !important;
}
.place-audio-card__status {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 0.9rem !important;
  line-height: 1 !important;
  text-align: center !important;
  min-width: 1.25rem !important;
  flex-shrink: 0 !important;
}
.place-audio-card__name {
  display: block !important;
  font-size: clamp(0.82rem, 0.76rem + 0.3vw, 0.92rem) !important;
  font-weight: 700 !important;
  line-height: 1.25 !important;
  text-align: left !important;
  width: auto !important;
  min-width: 0 !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
  color: var(--color-text) !important;
}
.place-audio-card__actions {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  gap: 0.3rem !important;
  width: auto !important;
  margin-top: 0 !important;
  flex-shrink: 0 !important;
  grid-template-columns: none !important;
}
.place-audio-card__actions .btn,
.place-audio-card__actions .btn--small {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: auto !important;
  flex: 0 0 auto !important;
  min-width: 3.2rem !important;
  min-height: 2rem !important;
  height: auto !important;
  padding: 0.28rem 0.55rem !important;
  font-size: 0.78rem !important;
  font-weight: 700 !important;
  white-space: nowrap !important;
  overflow: visible !important;
}
.voice-step1-cloud {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem 0.5rem;
}
.voice-step1-cloud .btn--small {
  min-height: 1.65rem;
  padding: 0.2rem 0.5rem;
  font-size: 0.72rem;
}
.voice-step1-cloud .voice-field-note--push {
  margin: 0;
  font-size: 0.66rem;
  line-height: 1.25;
}
.voice-step2-status-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.55rem;
}
.voice-step2-status-row .voice-status-line {
  font-size: 0.72rem;
  line-height: 1.3;
  margin: 0;
}
.voice-step2-status-row .voice-step2-download-actions {
  margin: 0;
  flex: 0 0 auto;
}
.voice-step1-progress {
  margin-bottom: 0.5rem;
}
.voice-file-list--step1 {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.5rem;
  align-items: stretch;
  flex: 1 1 auto;
  min-height: 0;
}
@media (max-width: 900px) {
  .voice-file-list--step1 {
    grid-template-columns: 1fr;
  }
  .voice-file-card--numbers .voice-card__actions {
    flex-direction: row;
    flex-wrap: wrap;
  }
  .voice-file-card--numbers .voice-card__actions .btn {
    width: auto;
    flex: 1 1 calc(50% - 0.25rem);
    min-height: 2.35rem;
    font-size: 0.82rem;
    padding: 0.45rem 0.55rem;
  }
}
.voice-file-list--step1 .voice-file-card {
  padding: 0.45rem 0.55rem;
  border-radius: 10px;
  box-shadow: none;
  min-height: 0;
  height: auto;
  background: #fafbfc;
  border: 1px solid #e8edf2;
  overflow: visible;
}
.voice-file-card--cloud-push {
  padding: 0.45rem 0.55rem;
  border-radius: 10px;
  background: #fafbfc;
  border: 1px solid #e8edf2;
  box-shadow: none;
  flex-shrink: 0;
}
.voice-field-note--push {
  margin: 0.25rem 0 0;
  font-size: 0.72rem;
  line-height: 1.3;
}
.voice-file-list--step1 .voice-file-card__head {
  font-size: 0.84rem;
  font-weight: 800;
  margin-bottom: 0.45rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}
.voice-file-card--numbers {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.voice-file-card--numbers .voice-card__actions {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 0.35rem;
  margin-top: 0;
}
.voice-file-card--numbers .voice-card__actions .btn {
  width: auto;
  flex: 1 1 auto;
  font-size: 0.78rem;
  padding: 0.4rem 0.55rem;
  white-space: nowrap;
  min-height: 2rem;
}
.voice-file-card--places {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-height: 0;
  height: auto;
}
.voice-file-card--places .voice-room-list {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.35rem;
  min-height: 0;
  overflow: visible;
  flex: 0 0 auto;
}
.voice-file-card--places .voice-room-list .audio-file-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 0.25rem;
  padding: 0.35rem 0.25rem;
  min-width: 0;
  background: #ffffff;
  border: 1px solid #e8edf2;
  border-radius: 8px;
}
.voice-file-card--places .voice-room-list .audio-file-slot {
  width: 1.35rem;
  height: 1.35rem;
  font-size: 0.68rem;
}
.voice-file-card--places .voice-room-list .audio-file-label {
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.25;
  text-align: center;
  word-break: break-all;
  width: 100%;
  min-width: 0;
}
.voice-file-card--places .voice-room-list .audio-file-status {
  font-size: 0.82rem;
  min-width: auto;
  line-height: 1;
}
.voice-file-card--places .voice-room-list .audio-file-row .btn--small {
  width: 100%;
  min-width: 0;
  min-height: 1.75rem;
  padding: 0.22rem 0.3rem;
  font-size: 0.68rem;
}
@media (max-width: 1100px) {
  .voice-file-card--places .voice-room-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (max-width: 640px) {
  .voice-file-card--places .voice-room-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.voice-file-list--step1 .audio-file-row {
  padding: 0.28rem 0.4rem;
  gap: 0.3rem;
  grid-template-columns: 1.4rem minmax(3rem, 1fr) auto auto auto;
  align-items: center;
}
.voice-file-list--step1 .audio-file-slot {
  width: 1.35rem;
  height: 1.35rem;
  font-size: 0.7rem;
}
.voice-file-list--step1 .audio-file-label {
  font-size: 0.82rem;
  font-weight: 600;
}
.voice-file-list--step1 .audio-file-row .btn--small {
  font-size: 0.74rem;
  padding: 0.28rem 0.42rem;
  min-width: 2.35rem;
  min-height: 1.85rem;
}
.voice-file-list--step1 .audio-file-status {
  font-size: 0.82rem;
  min-width: 1.25rem;
}
#audio-step-upload .voice-section-head {
  margin-bottom: 0.35rem;
}
#audio-step-upload .voice-card__head {
  margin-bottom: 0.4rem;
  padding-bottom: 0.4rem;
}
.voice-upload-activity {
  margin-bottom: 0.55rem;
  padding: 0.55rem 0.65rem;
  border-radius: 8px;
  border: 1px solid rgba(74, 144, 164, 0.28);
  background: linear-gradient(180deg, rgba(74, 144, 164, 0.1) 0%, rgba(74, 144, 164, 0.04) 100%);
}
.voice-upload-activity[hidden] {
  display: none !important;
}
.voice-upload-activity__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--color-text);
}
.voice-upload-activity__bar {
  margin: 0;
}
.voice-upload-activity--warn {
  border-color: rgba(230, 81, 0, 0.35);
  background: linear-gradient(180deg, rgba(255, 243, 224, 0.95) 0%, rgba(255, 248, 240, 0.9) 100%);
}
.voice-upload-activity--done {
  border-color: rgba(46, 125, 50, 0.35);
  background: linear-gradient(180deg, rgba(232, 245, 233, 0.95) 0%, rgba(241, 248, 244, 0.9) 100%);
}
.audio-file-status--uploading {
  animation: voice-upload-pulse 1s ease-in-out infinite;
}
@keyframes voice-upload-pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.45;
  }
}

/* プレビュー iframe コンテナ（全タブ共通） */
.preview-iframe-container {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 0.5rem;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  background: #f0f0f0;
}

.preview-iframe-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 1920px;
  height: 1080px;
  border: none;
  background: #fff;
  transform-origin: 0 0;
  display: block;
}

.preview-status {
  min-height: 1.25rem;
  text-align: center;
  margin-top: 0.45rem;
  font-size: 0.85rem;
  color: #aaa;
}

/* フォーム */
.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  font-weight: 600;
  color: #334155;
  margin-bottom: 0.45rem;
  font-size: 0.88rem;
}

.form-group input[type='text'],
.form-group input[type='password'],
.form-group select {
  width: 100%;
  padding: 0.62rem 0.85rem;
  border: 1.5px solid #e2e8f0;
  border-radius: 0.7rem;
  font-size: 0.95rem;
  font-family: inherit;
  background: #fff;
  color: #1f2937;
  transition:
    border-color 0.18s,
    box-shadow 0.18s,
    background 0.18s;
}

.form-group input[type='text']:hover,
.form-group select:hover {
  border-color: #cbd5e1;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--theme-primary);
  box-shadow: 0 0 0 3px rgba(74, 144, 164, 0.15);
}

/* 音声ファイル行 — 上記 .audio-file-row で定義 */
.audio-file-desc {
  font-size: 0.85rem;
  color: #666;
}
.audio-file-status {
  font-size: 1rem;
  text-align: center;
  min-width: 24px;
}
.btn--small {
  padding: 0.3rem 0.6rem;
  font-size: 0.8rem;
  border-radius: 0.4rem;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

/* お知らせリスト */
.announcement-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: calc(100vh - 400px);
  overflow-y: auto;
}

.announcement-item {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.announcement-item input {
  flex: 1;
  padding: 0.5rem 0.75rem;
  border: 2px solid var(--color-border);
  border-radius: 0.5rem;
  font-size: 0.9rem;
  font-family: inherit;
}

.announcement-item__btn {
  background: var(--color-danger);
  color: white;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 0.5rem;
  cursor: pointer;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
}

.announcement-item__btn:hover {
  transform: scale(1.1);
}

.add-btn {
  background: var(--theme-primary);
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  font-size: 0.9rem;
  font-family: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.75rem;
  transition: all 0.2s;
}

.add-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(74, 144, 164, 0.3);
}

/* レンジスライダー */
.range-group {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.range-group input[type='range'] {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 7px;
  background: #e6ebf1;
  border-radius: 999px;
  outline: none;
  cursor: pointer;
}

.range-group input[type='range']::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 22px;
  height: 22px;
  background: var(--theme-primary);
  border: 3px solid #fff;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(74, 144, 164, 0.45);
  transition:
    transform 0.12s,
    box-shadow 0.12s;
}

.range-group input[type='range']::-webkit-slider-thumb:hover {
  transform: scale(1.12);
  box-shadow: 0 3px 10px rgba(74, 144, 164, 0.55);
}

.range-group input[type='range']::-moz-range-thumb {
  width: 22px;
  height: 22px;
  background: var(--theme-primary);
  border: 3px solid #fff;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(74, 144, 164, 0.45);
}

.range-value {
  min-width: 52px;
  text-align: center;
  font-weight: 700;
  color: var(--theme-primary);
  font-size: 0.85rem;
  background: rgba(74, 144, 164, 0.1);
  padding: 0.25rem 0.5rem;
  border-radius: 999px;
}

/* テーマプレビュー */
.theme-preview {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.45rem;
}

.theme-preview__item {
  aspect-ratio: 2.2;
  border-radius: 0.55rem;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
  overflow: hidden;
}

.theme-preview__item:hover {
  transform: scale(1.05);
}

.theme-preview__item--selected {
  box-shadow: 0 0 0 3px var(--theme-primary);
}

.theme-preview__label {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 0.3rem;
  background: rgba(0, 0, 0, 0.6);
  color: white;
  font-size: 0.75rem;
  text-align: center;
}

/* カラーピッカー */
.color-picker-group {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
  margin-top: 1rem;
}

.color-picker {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
}

.color-picker input[type='color'] {
  width: 40px;
  height: 32px;
  border: 2px solid var(--color-border);
  border-radius: 0.5rem;
  padding: 2px;
  cursor: pointer;
}

.color-picker-group--inline {
  grid-template-columns: 1fr;
}

.color-picker--header-line {
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 0.5rem;
  width: 100%;
}

.color-picker--header-line input[type='color'] {
  flex-shrink: 0;
}

.color-picker--header-line label {
  text-align: left;
  flex: 1;
}

.color-picker label {
  font-size: 0.75rem;
  color: var(--color-text-light);
  text-align: center;
}

/* 認証セクション */
.auth-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.auth-box {
  padding: 1rem;
  border-radius: 0.75rem;
}

.auth-box--info {
  background: #f0fff4;
  border: 2px solid #a9dfbf;
}

.auth-box--change {
  background: #fff5f5;
  border: 2px solid #feb2b2;
}

.auth-box__title {
  font-weight: 700;
  margin-bottom: 0.75rem;
  font-size: 0.95rem;
}

/* ボタン */
.btn {
  padding: 0.6rem 1.2rem;
  border: none;
  border-radius: 0.5rem;
  font-size: 0.95rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.3s;
}

.btn--primary {
  background: linear-gradient(135deg, var(--theme-primary), var(--theme-secondary));
  color: white;
  box-shadow: 0 4px 15px rgba(74, 144, 164, 0.3);
}

.btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(74, 144, 164, 0.4);
}

.btn--secondary {
  background: var(--color-border);
  color: var(--color-text);
}

.btn--secondary:hover {
  background: #d5dbe3;
}

.audio-file-row {
  display: grid;
  grid-template-columns: 2rem minmax(5rem, 1fr) auto auto auto;
  gap: 0.5rem;
  align-items: center;
  padding: 0.5rem;
  background: #fafafa;
  border-radius: 0.5rem;
}
.audio-file-slot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.65rem;
  height: 1.65rem;
  border-radius: 999px;
  background: var(--color-white);
  border: 1px solid var(--color-border);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--color-text-light);
}
.audio-file-label {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--color-text);
}
.voice-card--action .voice-card__hint {
  margin-bottom: 0.85rem;
}
.voice-card--warn {
  border-color: #e0e6ed;
}
.voice-field-note {
  font-size: 0.8rem;
  color: var(--color-text-light);
  margin-top: 0.35rem;
  line-height: 1.45;
}
.voice-field-note code {
  background: var(--color-bg);
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  border: 1px solid var(--color-border);
}
.voice-inline-status {
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: var(--color-text-light);
  min-height: 0;
}
.voice-status-line {
  font-size: 0.85rem;
  color: var(--color-text-light);
  line-height: 1.45;
}
.voice-status-line + .voice-status-line {
  margin-top: 0.25rem;
}

/* プログレスバー（単色・シンプル） */
.voice-progress {
  margin-top: 0.75rem;
}
.voice-progress__labels {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.35rem;
  font-size: 0.85rem;
  color: var(--color-text-light);
}
.voice-progress__track {
  background: var(--color-border);
  border-radius: 4px;
  height: 8px;
  overflow: hidden;
}
.voice-progress__bar {
  background: var(--theme-primary);
  height: 100%;
  width: 0%;
  transition: width 0.3s;
}

.preset-empty-hint {
  font-size: 0.88rem;
  color: var(--color-text-light);
  background: var(--color-bg);
  border: 1px dashed var(--color-border);
  border-radius: 8px;
  padding: 0.7rem 0.85rem;
  line-height: 1.5;
  margin-bottom: 0.75rem;
}
.preset-library-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  align-items: start;
}
@media (max-width: 960px) {
  .preset-library-columns {
    grid-template-columns: 1fr;
  }
}

/* この端末の音声設定バナー — 非表示（シンプルヘッダーへ移行） */
.voice-device-status {
  display: none !important;
}
.voice-device-status--ok {
  border-color: #22c55e;
  border-left-color: #16a34a;
  background: linear-gradient(135deg, #dcfce7 0%, #f0fdf4 100%);
  box-shadow: none;
}
.voice-device-status--warn {
  border-color: #f97316;
  border-left-color: #ea580c;
  background: linear-gradient(135deg, #ffedd5 0%, #fff7ed 100%);
  box-shadow: none;
}
.voice-device-status--unset {
  border-color: #38bdf8;
  border-left-color: #0ea5e9;
  background: linear-gradient(135deg, #e0f2fe 0%, #f0f9ff 100%);
  box-shadow: none;
}
.voice-device-status__icon {
  font-size: 0.8rem;
  line-height: 1;
  flex-shrink: 0;
}
.voice-device-status__body {
  flex: 1;
  min-width: 0;
}
.voice-device-status__label {
  display: inline;
  font-size: 0.62rem;
  font-weight: 700;
  color: #0369a1;
  letter-spacing: 0.02em;
  margin: 0;
  padding: 0;
  border: none;
  background: none;
  border-radius: 0;
  white-space: nowrap;
  flex-shrink: 0;
}
.voice-device-status--ok .voice-device-status__label {
  color: #15803d;
  border-color: transparent;
}
.voice-device-status--warn .voice-device-status__label {
  color: #c2410c;
  border-color: transparent;
}
.voice-device-status__title {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--color-text);
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.voice-device-status__detail {
  font-size: 0.68rem;
  color: var(--color-text-light);
  margin: 0;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  flex: 1;
}
.voice-device-status__detail:empty {
  display: none;
}
.voice-device-status__action {
  flex-shrink: 0;
  align-self: center;
  padding: 0.1rem 0.35rem !important;
  font-size: 0.62rem !important;
  min-height: 0 !important;
}
.voice-global-status {
  display: none;
}
.voice-global-status:has(.voice-test-status:not(:empty)) {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-height: 0;
  margin: 0;
  flex-shrink: 0;
}
.voice-test-status {
  min-height: 0;
  font-size: 0.78rem;
  color: var(--color-text-light);
  line-height: 1.3;
  margin: 0;
}
.voice-test-status:empty {
  display: none;
}
.voice-saved-mode-hint {
  display: none !important;
}
.voice-saved-mode-hint--draft {
  color: var(--color-text);
}
.voice-saved-mode-hint:empty {
  display: none;
}
.voice-step2-download-actions {
  margin-top: 0.65rem;
  margin-bottom: 1.1rem;
}
.voice-step2-audio-controls {
  margin-top: 0;
  padding-top: 1rem;
  border-top: 1px solid var(--color-border);
  display: grid;
  gap: 0.65rem;
}

/* 自院音声: ファイル行 */
.voice-section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}
.voice-section-head__count {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-text-light);
  background: var(--color-bg);
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
  border: 1px solid var(--color-border);
}
.voice-file-list {
  display: grid;
  gap: 0.85rem;
}
.voice-file-card {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 1rem 1.1rem;
}
.voice-file-card__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-bottom: 0.55rem;
  font-weight: 700;
  color: var(--color-text);
  font-size: 0.9rem;
}
.voice-file-card__hint {
  font-size: 0.82rem;
  color: var(--color-text-light);
  margin-bottom: 0.75rem;
  line-height: 1.5;
}
.voice-file-card__hint code {
  background: var(--color-white);
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  border: 1px solid var(--color-border);
}
.voice-room-list {
  display: grid;
  gap: 0.5rem;
}

.preset-card-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.4rem;
}
.voice-steps-row.voice-steps-row--stack .preset-card-grid,
.voice-steps-row--stack .preset-card-grid,
.voice-steps-row .preset-card-grid {
  grid-template-columns: 1fr;
}
.voice-steps-row #preset-list.preset-card-grid,
.voice-steps-row #downloaded-preset-list.preset-card-grid {
  flex: 0 0 auto;
  min-height: 0;
  overflow: visible;
  max-height: none;
  align-content: start;
}
.voice-steps-row .voice-card {
  padding: 0.55rem 0.6rem;
}
.preset-current-panel {
  background: #ffffff;
  border: 1px solid #d8e2ea;
  border-radius: 8px;
  box-shadow: none;
  padding: 0.35rem 0.55rem;
  margin-bottom: 0.35rem;
}
.preset-current-panel__row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.preset-current-panel__label {
  font-weight: 600;
  margin-right: 0.25rem;
  color: var(--color-text-light);
  font-size: 0.72rem;
}
.preset-current-panel__name {
  color: var(--color-text);
  font-weight: 700;
  font-size: 0.78rem;
}
.preset-current-panel__actions {
  display: flex;
  gap: 0.35rem;
  align-items: center;
  flex-wrap: wrap;
}
.preset-current-panel__cache {
  font-size: 0.72rem;
  color: var(--color-text-light);
}
.preset-list-loading {
  text-align: center;
  padding: 1.25rem 0.75rem;
  color: var(--color-text-light);
}
.preset-list-error {
  text-align: center;
  padding: 1.25rem 0.75rem;
  color: var(--color-danger);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 8px;
}
.preset-card {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 0.45rem 0.55rem;
  transition: border-color 0.15s;
}
.preset-card:hover {
  border-color: #cbd5e0;
}
.preset-card--active {
  border-color: var(--theme-primary);
  box-shadow: 0 0 0 1px var(--theme-primary);
}
.preset-card--legacy {
  border-color: #d5dbe3;
  background: var(--color-bg);
}
.preset-card__header {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.35rem 0.45rem;
  align-items: start;
}
.preset-card__icon {
  font-size: 1.1rem;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 7px;
  background: var(--color-bg);
  flex-shrink: 0;
  grid-row: 1;
}
.preset-card__info {
  min-width: 0;
  grid-column: 2;
}
.preset-card__name {
  font-weight: 700;
  font-size: 0.78rem;
  color: var(--color-text);
  margin-bottom: 0.05rem;
  line-height: 1.25;
  word-break: normal;
  overflow-wrap: break-word;
}
.preset-card__voice {
  font-size: 0.68rem;
  color: var(--color-text-light);
  margin-bottom: 0.2rem;
  line-height: 1.4;
  word-break: normal;
  overflow-wrap: break-word;
}
.preset-card__desc {
  font-size: 0.68rem;
  color: var(--color-text-light);
  line-height: 1.3;
  word-break: normal;
  overflow-wrap: break-word;
}
.preset-card__actions {
  display: flex;
  gap: 0.3rem;
  flex-wrap: wrap;
  align-items: stretch;
  grid-column: 1 / -1;
  margin-top: 0.1rem;
}
.preset-card__actions .btn {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 1.7rem;
  padding: 0.25rem 0.4rem;
  font-size: 0.68rem;
  white-space: nowrap;
}
.preset-card__badge {
  background: var(--color-bg);
  color: var(--color-text);
  font-size: 0.72rem;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  font-weight: 600;
  border: 1px solid var(--color-border);
  float: none;
  display: inline-block;
  margin-bottom: 0.35rem;
}
.btn--block {
  display: block;
  width: 100%;
  text-align: center;
}
.voice-side-card {
  background: #ffffff;
  border-radius: 14px;
  padding: 0;
  border: 1px solid #d8e2ea;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(22, 50, 63, 0.05);
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.voice-side-card--chime {
  border-color: #c5dce8;
  box-shadow: 0 1px 3px rgba(47, 111, 126, 0.08);
  background: #ffffff;
}
.voice-side-card__title {
  font-weight: 700;
  font-size: 0.82rem;
  color: #1f2937;
  margin-bottom: 0.4rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.55rem 0.7rem 0;
}
.voice-side-card .form-row {
  margin-bottom: 0.35rem;
}
.voice-side-card .form-group {
  margin-bottom: 0.35rem;
}
.voice-side-card .form-group:last-child {
  margin-bottom: 0;
}
.voice-side-card__note {
  font-size: 0.72rem;
  color: var(--color-text-light);
  margin: 0.4rem 0 0;
  line-height: 1.35;
}
.voice-side-card__fields {
  display: grid;
  gap: 0.35rem;
}
.voice-side-card__bar {
  display: flex;
  align-items: stretch;
  gap: 0;
  min-height: 2.2rem;
  flex-shrink: 0;
}
.voice-side-card__enable {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.15rem;
  margin: 0;
  padding: 0.5rem 0.55rem;
  background: linear-gradient(180deg, rgba(62, 138, 156, 0.14), rgba(62, 138, 156, 0.06));
  border-right: 1px solid rgba(62, 138, 156, 0.16);
  cursor: pointer;
  flex-shrink: 0;
  min-width: 3.25rem;
}
.voice-side-card__enable input {
  width: 1.15rem;
  height: 1.15rem;
  margin: 0;
  accent-color: var(--voice-teal, #3e8a9c);
}
.voice-side-card__enable-text {
  font-size: 0.65rem;
  font-weight: 800;
  color: var(--voice-teal-deep, #2f6f7e);
  letter-spacing: 0.06em;
}
.voice-side-card__toggle {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
  border: none;
  background: transparent;
  padding: 0.7rem 0.85rem;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  color: var(--color-text);
  min-width: 0;
}
.voice-side-card__toggle:hover {
  background: rgba(74, 144, 164, 0.06);
}
.voice-side-card__toggle--solo {
  width: 100%;
}
.voice-side-card__toggle-title {
  font-size: 0.9rem;
  font-weight: 800;
  flex: 0 1 auto;
  color: var(--voice-ink, #16323f);
  letter-spacing: -0.01em;
}
.voice-side-card--chime .voice-side-card__bar {
  border-bottom: 1px solid rgba(62, 138, 156, 0.1);
}
.voice-side-card--chime .voice-side-card__body {
  border-top-color: rgba(62, 138, 156, 0.12);
}
.voice-side-card--chime #chime-preview-btn {
  width: 100%;
  margin-top: 0.15rem;
  border-radius: 10px;
  font-weight: 700;
  border-color: rgba(62, 138, 156, 0.28);
  color: var(--voice-teal-deep, #2f6f7e);
  background: rgba(62, 138, 156, 0.06);
}
.voice-side-card--chime #chime-preview-btn:hover {
  background: rgba(62, 138, 156, 0.12);
}
.voice-side-card__summary {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-text-light);
  flex: 1 1 auto;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.voice-side-card__chevron {
  margin-left: auto;
  font-size: 0.95rem;
  color: var(--color-text-light);
  transition: transform 0.2s ease;
  flex-shrink: 0;
}
.voice-side-card__body {
  padding: 0.45rem 0.7rem 0.65rem;
  border-top: 1px solid #e2e8f0;
  min-height: 0;
  overflow-y: auto;
  flex: 1 1 auto;
}
.voice-side-card__body > :first-child {
  margin-top: 0;
}

/* 狭い画面: 折りたたみ（ヘッダーボタンのみ） */
@media (max-width: 991px) {
  .voice-side-card--collapsible.is-collapsed-mobile .voice-side-card__body {
    display: none;
  }
  .voice-side-card--collapsible.is-open-mobile .voice-side-card__body {
    display: block;
  }
  .voice-side-card--collapsible.is-open-mobile .voice-side-card__chevron {
    transform: rotate(180deg);
  }
}

/* PC（右サイドバー表示時）: チャイムは常に展開。ONのみ表示 */
@media (min-width: 992px) {
  .voice-side-card--collapsible .voice-side-card__body {
    display: block !important;
  }
  .voice-side-card--collapsible .voice-side-card__chevron {
    display: none;
  }
  .voice-side-card--collapsible .voice-side-card__summary {
    display: none;
  }
  .voice-side-card--collapsible .voice-side-card__toggle {
    display: none;
  }
  .voice-side-card--chime .voice-side-card__bar {
    min-height: 0;
  }
  .voice-side-card--chime .voice-side-card__enable {
    flex-direction: row;
    gap: 0.4rem;
    width: 100%;
    min-width: 0;
    padding: 0.45rem 0.75rem;
    border-right: none;
    border-bottom: 1px solid rgba(62, 138, 156, 0.12);
    justify-content: flex-start;
  }
}

.voice-mode-help-section {
  font-size: 0.72rem;
  color: #4b5563;
  line-height: 1.4;
  display: none;
}
.voice-mode-help-section.is-active {
  display: block;
}
.voice-mode-help-section strong {
  color: #1f2937;
}
.voice-mode-help-section ul {
  margin: 0.25rem 0 0 1rem;
  padding: 0;
}
.voice-mode-help-section li {
  margin-bottom: 0.1rem;
}

/* フッターボタン — 左:リセット / 中央:現在の音声 / 右:保存 */
.footer-buttons {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0.4rem 0.75rem;
  background: var(--color-white);
  border-radius: 0.7rem;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.04);
  flex-shrink: 0;
  gap: 0.5rem;
}
.footer-buttons > #reset-btn {
  justify-self: start;
}
.footer-save-actions {
  justify-self: end;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.4rem;
  max-width: min(100%, 36rem);
}
.footer-save-actions .btn {
  min-height: 2.4rem;
  padding: 0.4rem 0.75rem;
  font-size: 0.82rem;
  white-space: nowrap;
}
.btn--cloud {
  background: #ebf8ff;
  color: #2b6cb0;
  border: 1px solid #90cdf4;
}
.btn--cloud:hover {
  background: #bee3f8;
}
.footer-cloud-status {
  width: 100%;
  margin: 0;
  text-align: right;
  font-size: 0.72rem;
  color: #718096;
  line-height: 1.3;
}
.footer-voice-card {
  justify-self: center;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: clamp(0.35rem, 0.25rem + 0.45vw, 0.65rem);
  padding: clamp(0.45rem, 0.35rem + 0.4vw, 0.7rem) clamp(0.85rem, 0.6rem + 1.1vw, 1.45rem);
  border-radius: clamp(10px, 0.45rem + 0.35vw, 14px);
  background: #fff6e0;
  border: 2px solid #d4a017;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.9) inset,
    0 6px 18px rgba(180, 130, 0, 0.18);
  white-space: nowrap;
  max-width: min(100%, 28rem);
  line-height: 1.25;
}
.footer-voice-card__label {
  font-size: clamp(0.78rem, 0.68rem + 0.35vw, 0.92rem);
  font-weight: 700;
  color: #6b4e0a;
}
.footer-voice-card__method {
  font-size: clamp(0.95rem, 0.82rem + 0.5vw, 1.15rem);
  font-weight: 900;
  letter-spacing: -0.02em;
  color: #1a3d4a;
}
.footer-voice-card__test {
  margin-left: clamp(0.15rem, 0.1rem + 0.25vw, 0.35rem);
  padding: 0;
  background: none;
  border: none;
  color: #2f6f7e;
  font-size: clamp(0.8rem, 0.72rem + 0.3vw, 0.92rem);
  font-weight: 800;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 2px;
  min-height: 0;
  line-height: 1.3;
}
.footer-voice-card__test:hover {
  color: #1a5566;
}
.footer-voice-card__test:focus-visible {
  outline: 2px solid #3e8a9c;
  outline-offset: 2px;
  border-radius: 4px;
}

/* 通知 */
.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--color-success);
  color: white;
  padding: 0.75rem 1.5rem;
  border-radius: 0.75rem;
  font-weight: 600;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  opacity: 0;
  transition: all 0.3s;
  z-index: 1000;
}

.toast--show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.hidden {
  display: none !important;
}

/* レイアウトプリセット */
.layout-presets {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0.35rem;
}

.layout-preset {
  background: var(--color-bg);
  border: 1.5px solid var(--color-border);
  border-radius: 0.4rem;
  padding: 0.25rem;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}

.layout-preset:hover {
  border-color: var(--theme-primary);
}

.layout-preset--selected {
  border-color: var(--theme-primary);
  background: rgba(74, 144, 164, 0.1);
}

.layout-preset__preview {
  aspect-ratio: 16/8;
  background: white;
  border-radius: 0.25rem;
  padding: 2px;
  margin-bottom: 0.2rem;
}

.preview-grid {
  width: 100%;
  height: 100%;
  display: grid;
  gap: 2px;
}

.preview-grid--1 {
  grid-template-columns: 1fr;
}
.preview-grid--2 {
  grid-template-columns: repeat(2, 1fr);
}
.preview-grid--3 {
  grid-template-columns: repeat(3, 1fr);
}
.preview-grid--4 {
  grid-template-columns: repeat(2, 1fr);
  grid-template-rows: repeat(2, 1fr);
}
.preview-grid--5 {
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(2, 1fr);
}
.preview-grid--6 {
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(2, 1fr);
}

.preview-cell {
  background: var(--theme-primary);
  border-radius: 2px;
  opacity: 0.7;
}

.preview-cell--large {
  opacity: 0.9;
}

.preview-cell--info {
  background: var(--color-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.5rem;
  opacity: 1;
}

.layout-preset__name {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--color-text);
}

/* 呼び出し場所リスト */
.places-list {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.place-item {
  display: grid;
  grid-template-columns: 22px 1fr 30px;
  gap: 0.4rem;
  align-items: center;
  background: var(--color-bg);
  padding: 0.3rem 0.5rem;
  border-radius: 0.4rem;
}

.place-item__number {
  width: 22px;
  height: 22px;
  background: var(--theme-primary);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.75rem;
}

.place-item__name {
  padding: 0.3rem 0.5rem;
  border: 2px solid var(--color-border);
  border-radius: 0.4rem;
  font-size: 0.85rem;
  font-family: inherit;
}

.place-item__color {
  width: 30px;
  height: 26px;
  border: 2px solid var(--color-border);
  border-radius: 0.4rem;
  padding: 2px;
  cursor: pointer;
}

.place-item__id {
  display: none;
}

/* レイアウト/表示/テーマ/強調 — 左:設定(スクロール) / 右:プレビュー(固定) */
.layout-editor,
.display-editor,
.theme-editor,
.highlight-editor {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 0.7rem;
  align-items: stretch;
  height: 100%;
  min-height: 0;
}

.layout-editor__settings,
.display-editor__settings,
.theme-editor__settings,
.highlight-editor__settings {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  padding-right: 0.25rem;
}

#tab-highlight .highlight-editor__settings {
  overflow: hidden;
  justify-content: flex-start;
}

#tab-highlight .setting-group {
  margin-bottom: 0.25rem;
}

#tab-highlight .setting-label {
  font-size: clamp(0.72rem, 0.65rem + 0.25vw, 0.95rem);
  margin-bottom: 0.25rem;
}

#tab-highlight .section-title {
  font-size: clamp(0.82rem, 0.75rem + 0.3vw, 1.1rem);
  margin-bottom: 0.2rem;
}

.highlight-actions {
  display: flex;
  gap: 0.45rem;
  margin-top: 0.25rem !important;
  flex-wrap: wrap;
}
.highlight-actions .btn {
  flex: 1 1 auto;
  min-height: 2rem;
  padding: 0.4rem 0.7rem;
  font-size: clamp(0.75rem, 0.7rem + 0.2vw, 0.95rem);
}

/* アニメーションプリセット — コンパクト */
.highlight-animation-presets {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.35rem;
}

.highlight-animation-preset {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.3rem 0.25rem;
  border: 1.5px solid #e2e8f0;
  border-radius: 0.45rem;
  cursor: pointer;
  transition: all 0.15s;
  background: white;
}

.highlight-animation-preset:hover {
  border-color: var(--theme-primary, #4a90a4);
}

.highlight-animation-preset--selected {
  border-color: var(--theme-primary, #4a90a4);
  background: #ebf8ff;
}

.highlight-animation-preset span {
  font-size: clamp(0.65rem, 0.6rem + 0.2vw, 0.85rem);
  color: #4a5568;
  margin-top: 0.15rem;
  line-height: 1.15;
}

.animation-preview {
  width: clamp(22px, 2vw + 14px, 36px);
  height: clamp(22px, 2vw + 14px, 36px);
  border-radius: 5px;
  background: #e53e3e;
  opacity: 0.8;
}

#tab-highlight .range-slider {
  height: 6px;
}
#tab-highlight .range-slider::-webkit-slider-thumb {
  width: 18px;
  height: 18px;
  border-width: 2px;
}
#tab-highlight .range-slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-width: 2px;
}
#tab-highlight .color-picker-group {
  gap: 0.4rem;
}
#tab-highlight .color-picker input[type='color'] {
  width: clamp(2rem, 1.5rem + 1vw, 2.75rem);
  height: clamp(1.6rem, 1.3rem + 0.8vw, 2.2rem);
}
#tab-highlight .color-picker label {
  font-size: clamp(0.65rem, 0.6rem + 0.15vw, 0.8rem);
}

@media (min-width: 1400px) {
  #tab-highlight .highlight-editor__settings {
    gap: 0.55rem;
  }
  #tab-highlight .setting-group {
    margin-bottom: 0.4rem;
  }
}

.layout-editor__preview,
.display-editor__preview,
.theme-editor__preview,
.highlight-editor__preview {
  background: #2a2a2a;
  border-radius: 0.75rem;
  padding: 0.65rem;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  overflow-y: auto;
  overflow-x: hidden;
  min-width: 0;
  min-height: 0;
}

.layout-editor__preview .section-title,
.display-editor__preview .section-title,
.theme-editor__preview .section-title,
.highlight-editor__preview .section-title {
  color: #fff;
  margin-bottom: 0.35rem;
}

.setting-group {
  margin-bottom: 0.45rem;
}

.admin-content {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
  padding-bottom: env(safe-area-inset-bottom);
}

.section-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 0.3rem;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  line-height: 1.2;
}

.test-btn {
  margin-left: auto;
}

.setting-group {
  margin-bottom: 0.75rem;
}

.setting-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: #4a5568;
  margin-bottom: 0.4rem;
}

.range-slider {
  width: 100%;
  height: 8px;
  -webkit-appearance: none;
  appearance: none;
  background: #e2e8f0;
  border-radius: 4px;
  outline: none;
  cursor: pointer;
}

.range-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 24px;
  height: 24px;
  background: linear-gradient(135deg, #4299e1, #3182ce);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(66, 153, 225, 0.4);
  border: 3px solid white;
  transition:
    transform 0.15s,
    box-shadow 0.15s;
}

.range-slider::-webkit-slider-thumb:hover {
  transform: scale(1.1);
  box-shadow: 0 3px 10px rgba(66, 153, 225, 0.5);
}

.range-slider::-moz-range-thumb {
  width: 24px;
  height: 24px;
  background: linear-gradient(135deg, #4299e1, #3182ce);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(66, 153, 225, 0.4);
  border: 3px solid white;
}

.range-slider::-moz-range-thumb:hover {
  transform: scale(1.1);
}

/* スライダートラック（進行部分）のスタイル */
.range-slider::-webkit-slider-runnable-track {
  height: 8px;
  background: #e2e8f0;
  border-radius: 4px;
}

.range-slider::-moz-range-track {
  height: 8px;
  background: #e2e8f0;
  border-radius: 4px;
}

/* アニメーションプリセット（旧定義は上部のコンパクト版を優先） */

.animation-preview--pulse {
  animation: preview-pulse 1.5s ease-in-out infinite;
}

.animation-preview--blink {
  animation: preview-blink 1s ease-in-out infinite;
}

.animation-preview--glow {
  animation: preview-glow 1.5s ease-in-out infinite;
}

.animation-preview--bounce {
  animation: preview-bounce 1s ease-in-out infinite;
}

.animation-preview--shake {
  animation: preview-shake 0.5s ease-in-out infinite;
}

.animation-preview--none {
  /* no animation */
}

@keyframes preview-pulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 0.8;
  }
  50% {
    transform: scale(1.1);
    opacity: 1;
  }
}

@keyframes preview-blink {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.3;
  }
}

@keyframes preview-glow {
  0%,
  100% {
    box-shadow: 0 0 5px 2px rgba(229, 62, 62, 0.5);
  }
  50% {
    box-shadow: 0 0 15px 5px rgba(229, 62, 62, 0.8);
  }
}

@keyframes preview-bounce {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-5px);
  }
}

@keyframes preview-shake {
  0%,
  100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-3px);
  }
  75% {
    transform: translateX(3px);
  }
}

.btn--large {
  padding: 1rem 2rem;
  font-size: 1rem;
}

/* プリセット番号範囲選択モーダル */
.preset-range-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.preset-range-modal {
  background: #fff;
  border-radius: 1rem;
  max-width: min(1100px, 96vw);
  width: 100%;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}

.preset-range-modal__header {
  padding: 1.25rem 1.5rem 0.75rem;
  border-bottom: 1px solid #e2e8f0;
}

.preset-range-modal__header h2 {
  margin: 0 0 0.25rem;
  font-size: 1.15rem;
}

.preset-range-modal__subtitle {
  margin: 0;
  color: #666;
  font-size: 0.9rem;
}

.preset-range-modal__body {
  padding: 1rem 1.5rem;
  overflow-y: auto;
  flex: 1;
}

.preset-range-modal__footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid #e2e8f0;
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}

.preset-range-section {
  margin-bottom: 1.25rem;
}

.preset-range-section h3 {
  margin: 0 0 0.5rem;
  font-size: 0.95rem;
  color: #333;
}

.preset-range-bundles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.5rem;
}

.preset-range-bundle {
  text-align: left;
  padding: 0.75rem 1rem;
  border: 2px solid #e2e8f0;
  border-radius: 0.75rem;
  background: #fafafa;
  cursor: pointer;
  transition:
    border-color 0.15s,
    background 0.15s;
}

.preset-range-bundle:hover {
  border-color: #90caf9;
}

.preset-range-bundle--active {
  border-color: #1565c0;
  background: #e3f2fd;
}

.preset-range-bundle__label {
  display: block;
  font-weight: 700;
  color: #333;
}

.preset-range-bundle__desc {
  display: block;
  font-size: 0.8rem;
  color: #666;
  margin-top: 0.15rem;
}

.preset-range-blocks {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 0.5rem;
}

.preset-range-block {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
  cursor: pointer;
  font-size: 0.9rem;
}

.preset-range-block input {
  margin-right: 0.35rem;
}

.preset-range-block__desc {
  font-size: 0.75rem;
  color: #888;
  padding-left: 1.25rem;
}

.preset-range-custom {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.preset-range-custom input[type='number'] {
  width: 6rem;
  padding: 0.4rem 0.5rem;
  border: 1px solid #cbd5e0;
  border-radius: 0.375rem;
}

.preset-range-custom-list {
  margin: 0.5rem 0 0;
  padding-left: 1.25rem;
  font-size: 0.85rem;
  color: #555;
}

.preset-range-custom-remove {
  background: none;
  border: none;
  color: #c53030;
  cursor: pointer;
  font-size: 0.8rem;
  text-decoration: underline;
}

.preset-range-places p {
  margin: 0;
  font-size: 0.85rem;
  color: #555;
}

.preset-range-places__hint {
  margin: 0 0 0.5rem;
  color: #666;
  font-size: 0.85rem;
}

.preset-range-places__toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}

.preset-range-places__search {
  flex: 1 1 10rem;
  min-width: 8rem;
  padding: 0.35rem 0.55rem;
  border: 1px solid #d0dae3;
  border-radius: 8px;
  font-size: 0.85rem;
}

.preset-range-place--layout em {
  font-style: normal;
  font-size: 0.75em;
  color: #2f6f7e;
  margin-left: 0.25rem;
}

.place-audio-card--assign {
  grid-template-columns: auto minmax(0, 1fr) minmax(9rem, 1.6fr) !important;
  cursor: default !important;
}

.place-audio-card__assign {
  display: flex;
  gap: 0.35rem;
  align-items: center;
  min-width: 0;
}

.preset-place-assign-select {
  flex: 1;
  min-width: 0;
  max-width: 100%;
  padding: 0.3rem 0.4rem;
  border: 1px solid #c5d0da;
  border-radius: 8px;
  font-size: 0.82rem;
  background: #fff;
}

.preset-range-places__empty {
  margin: 0;
  padding: 0.75rem 1rem;
  background: #fff5f5;
  border: 1px solid #feb2b2;
  border-radius: 0.5rem;
  color: #c53030;
  font-size: 0.9rem;
  line-height: 1.5;
}

.preset-range-places-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.5rem;
}

.preset-range-place {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
  cursor: pointer;
  font-size: 0.9rem;
  background: #fafafa;
}

.preset-range-place:hover {
  border-color: #90caf9;
}

.preset-range-place input {
  margin: 0;
}

.preset-range-summary {
  background: #f7fafc;
  border-radius: 0.75rem;
  padding: 0.75rem 1rem;
  font-size: 0.85rem;
  line-height: 1.6;
  margin-bottom: 1rem;
}

.preset-range-summary__ok {
  color: #2f855a;
  margin-top: 0.35rem;
}

.preset-range-summary__warn {
  color: #c05621;
  margin-top: 0.35rem;
}

.preset-range-notice {
  font-size: 0.8rem;
  color: #555;
  background: #fffbeb;
  border-radius: 0.75rem;
  padding: 0.75rem 1rem;
  border-left: 3px solid #ecc94b;
}

.preset-range-notice ul {
  margin: 0.35rem 0 0;
  padding-left: 1.25rem;
}

.preset-range-notice li {
  margin-bottom: 0.25rem;
}

/* ============================================================
   レスポンシブ（ノートPCの狭い窓〜タブレット〜スマホ）
   ============================================================ */
@media (max-width: 1100px) {
  .main-container {
    padding: 0.75rem;
    gap: 0.75rem;
  }

  .tabs {
    flex-wrap: wrap;
    gap: 0.4rem;
    padding: 0.45rem;
  }

  .tab-btn {
    flex: 1 1 calc(33.333% - 0.3rem);
    min-width: 5.5rem;
    padding: 0.3rem 0.4rem;
    font-size: 0.8rem;
    gap: 0.3rem;
    min-height: 1.45rem;
  }

  .tab-icon {
    font-size: 0.88rem;
  }

  .tab-content {
    padding: 0.9rem 1rem;
  }

  .layout-editor,
  .display-editor,
  .theme-editor,
  .highlight-editor {
    grid-template-columns: 1fr;
    height: auto;
    min-height: 0;
    gap: 1rem;
  }

  .layout-editor__settings,
  .display-editor__settings,
  .theme-editor__settings,
  .highlight-editor__settings,
  .layout-editor__preview,
  .display-editor__preview,
  .theme-editor__preview,
  .highlight-editor__preview {
    overflow: visible;
    min-height: 0;
    padding-right: 0;
    max-height: none;
  }

  .voice-col,
  .voice-grid__main,
  .voice-grid__side {
    max-height: none;
  }

  .voice-card {
    padding: 1rem 1.1rem;
  }

  .voice-card__title {
    font-size: 1rem;
  }

  .voice-mode-card {
    padding: 0.3rem 0.5rem;
    min-height: 0;
  }

  .voice-mode-card__title {
    font-size: 0.76rem;
  }

  .voice-device-status {
    padding: 0.15rem 0.4rem;
    min-height: 1.55rem;
    width: 100%;
  }

  .voice-device-status__title {
    font-size: 0.72rem;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .layout-presets {
    grid-template-columns: repeat(3, 1fr);
    gap: 0.4rem;
  }

  .theme-preview {
    grid-template-columns: repeat(2, 1fr);
  }

  .color-picker-group {
    grid-template-columns: repeat(2, 1fr);
  }

  .voice-header {
    flex-direction: column;
    align-items: stretch;
    gap: 0.45rem;
  }

  .voice-toolbar,
  .voice-top {
    flex-direction: column;
    align-items: stretch;
    gap: 0.3rem;
  }

  .voice-toolbar__left,
  .voice-top__row {
    flex-direction: row;
    align-items: center;
    gap: 0.35rem;
  }

  .voice-toolbar__title,
  .voice-top__title {
    font-size: 0.85rem;
  }

  .voice-hero {
    flex-direction: column;
    align-items: stretch;
  }

  .voice-hero__title {
    font-size: 1.1rem;
  }

  .voice-test-big {
    width: auto;
    min-height: 1.45rem;
  }

  .btn {
    min-height: 2.5rem;
  }

  .btn--small {
    min-height: 2.35rem;
    padding: 0.45rem 0.7rem;
    font-size: 0.85rem;
  }

  .voice-status-line {
    font-size: 0.88rem;
    line-height: 1.45;
  }

  .voice-field-note,
  .voice-clinic-audio-policy,
  .voice-card__hint {
    font-size: 0.85rem;
    line-height: 1.5;
  }

  .footer-buttons {
    gap: 0.75rem;
    padding: 0.85rem 1rem;
  }

  .footer-buttons .btn {
    min-height: 2.85rem;
    font-size: 0.95rem;
    padding: 0.7rem 1.1rem;
  }

  .footer-voice-card {
    max-width: min(100%, 22rem);
  }

  .preset-card-grid {
    grid-template-columns: 1fr;
  }
  .voice-steps-row #preset-list.preset-card-grid,
  .voice-steps-row #downloaded-preset-list.preset-card-grid {
    overflow: visible;
    flex: none;
  }
}

@media (max-width: 720px) {
  .header {
    padding: 0.4rem 0.7rem;
    flex-wrap: wrap;
    gap: 0.35rem;
  }

  .header__title {
    gap: 0.5rem;
    flex-wrap: wrap;
  }

  .header__back {
    padding: 0.3rem 0.55rem;
    font-size: 0.8rem;
    min-height: 0;
  }

  .header__h1 {
    font-size: 0.95rem;
  }

  .header__clinic {
    font-size: 0.78rem;
    width: 100%;
  }

  .tab-btn {
    flex: 1 1 calc(50% - 0.25rem);
    font-size: 0.78rem;
    min-height: 1.4rem;
    padding: 0.25rem 0.35rem;
  }

  .voice-mode-card__icon {
    width: 22px;
    height: 22px;
    font-size: 0.8rem;
  }

  .voice-file-list--step1 .audio-file-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem;
    padding: 0.65rem 0.7rem;
  }
  .voice-file-list--step1 .audio-file-slot {
    flex: 0 0 auto;
  }
  .voice-file-list--step1 .audio-file-label {
    flex: 1 1 calc(100% - 3rem);
    min-width: 0;
    font-size: 0.95rem;
  }
  .voice-file-list--step1 .audio-file-status {
    flex: 0 0 auto;
  }
  .voice-file-list--step1 .audio-file-row .btn--small {
    flex: 1 1 auto;
    min-width: 4.5rem;
    min-height: 2.5rem;
  }

  .layout-presets {
    grid-template-columns: repeat(2, 1fr);
  }

  .preset-library-columns {
    grid-template-columns: 1fr;
  }

  .voice-delete-actions .btn {
    min-width: 0;
    flex: 1 1 100%;
  }

  .voice-col--chime,
  .voice-grid__side {
    width: 100%;
  }

  .range-group input[type='range'] {
    min-height: 1.5rem;
    height: 10px;
  }
  .range-group input[type='range']::-webkit-slider-thumb {
    width: 28px;
    height: 28px;
  }
  .range-group input[type='range']::-moz-range-thumb {
    width: 28px;
    height: 28px;
  }
}

@media (max-width: 480px) {
  .main-container {
    padding: 0.4rem;
    gap: 0.4rem;
  }

  .tab-btn {
    flex: 1 1 calc(50% - 0.2rem);
    padding: 0.25rem 0.3rem;
    font-size: 0.75rem;
    min-height: 1.4rem;
  }

  .tab-btn .tab-icon {
    display: inline;
  }

  .tab-content {
    padding: 0.55rem;
    border-radius: 0.65rem;
  }

  .footer-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    padding: 0.75rem;
  }

  .footer-buttons > #reset-btn,
  .footer-buttons > #save-btn,
  .footer-save-actions,
  .footer-voice-card {
    justify-self: stretch;
    width: 100%;
  }
  .footer-save-actions {
    justify-content: stretch;
  }
  .footer-save-actions .btn {
    flex: 1 1 100%;
  }
  .footer-cloud-status {
    text-align: center;
  }

  .footer-voice-card {
    justify-content: center;
    order: -1;
  }

  .footer-buttons .btn {
    width: 100%;
  }

  .voice-steps-row .voice-card__title {
    font-size: 0.95rem;
  }

  .voice-step-badge {
    min-width: auto;
    font-size: 0.7rem;
  }

  .section-title {
    font-size: 0.95rem;
  }

  .toast {
    left: 0.75rem;
    right: 0.75rem;
    bottom: 1rem;
    transform: translateY(100px);
    width: auto;
    text-align: center;
    font-size: 0.9rem;
    padding: 0.85rem 1rem;
  }

  .toast--show {
    transform: translateY(0);
  }
}

/* =============================================================================
   音声タブ — 最終レイアウト（高優先度・CloudFront は ?v= 無視のため末尾に配置）
   ============================================================================= */
#tab-voice.tab-content--active {
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
  overflow-y: hidden !important;
  min-height: 0 !important;
  height: 100% !important;
  max-height: 100% !important;
  padding: clamp(0.35rem, 0.25rem + 0.4vw, 0.55rem) clamp(0.4rem, 0.3rem + 0.5vw, 0.65rem) !important;
  background: var(--color-white, #ffffff) !important;
  box-shadow: none !important;
}

#tab-voice .voice-shell,
#tab-voice .voice-grid {
  flex: 1 1 0 !important;
  min-height: 0 !important;
  max-height: 100% !important;
  overflow: hidden !important;
}

#tab-voice .voice-grid {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) minmax(17rem, 20rem) !important;
  gap: clamp(0.5rem, 0.35rem + 0.55vw, 0.75rem) !important;
  padding: 0 !important;
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

#tab-voice .voice-col {
  display: flex !important;
  flex-direction: column !important;
  gap: 1.15rem !important;
  min-height: 0 !important;
  min-width: 0 !important;
  padding: clamp(0.65rem, 0.5rem + 0.55vw, 1rem) !important;
  border-radius: 12px !important;
  overflow: hidden !important;
}

#tab-voice .voice-col--voice {
  background: #ffffff !important;
  border: 1px solid #e0e6ed !important;
  box-shadow: none !important;
}

#tab-voice .voice-col--chime {
  background: #ffffff !important;
  border: 1px solid #e0e6ed !important;
  box-shadow: none !important;
}

#tab-voice .voice-col__head {
  flex-shrink: 0 !important;
  margin: 0 !important;
  padding-bottom: 0.4rem !important;
  border-bottom: 1px solid #e0e6ed !important;
}

#tab-voice .voice-col--chime .voice-col__head {
  border-bottom-color: #e0e6ed !important;
}

#tab-voice .voice-col--chime .voice-section-label__title {
  color: var(--color-text, #2c3e50) !important;
}

#tab-voice .voice-pick {
  flex-shrink: 0 !important;
  margin: 0 !important;
}

#tab-voice .voice-panel-stack {
  flex: 1 1 0 !important;
  min-height: 0 !important;
  max-height: 100% !important;
  overflow: hidden !important;
  display: flex !important;
  flex-direction: column !important;
}

#tab-voice .voice-mode-panel.is-active {
  flex: 1 1 0 !important;
  min-height: 0 !important;
  max-height: 100% !important;
  overflow: hidden !important;
  display: flex !important;
  flex-direction: column !important;
}

/*
 * STEP: ①②とも内容高さ（auto）。余白で①を引き伸ばさない。
 * 画面が狭いときだけパネル全体をスクロール。
 */
#tab-voice .voice-mode-panel.is-active .voice-steps-row {
  display: flex !important;
  flex-direction: column !important;
  flex: 1 1 0 !important;
  min-height: 0 !important;
  max-height: 100% !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  align-items: stretch !important;
  gap: 0.45rem !important;
  justify-content: flex-start !important;
}

#tab-voice .voice-steps-row > .voice-card:nth-child(1) {
  flex: 0 0 auto !important;
  min-height: 0 !important;
  height: auto !important;
  max-height: none !important;
  overflow: visible !important;
  display: flex !important;
  flex-direction: column !important;
  align-self: stretch !important;
}

#tab-voice .voice-steps-row > .voice-card:nth-child(2) {
  flex: 0 0 auto !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  overflow: visible !important;
  align-self: stretch !important;
  padding: 0.35rem 0.5rem !important;
  gap: 0.2rem !important;
}

#tab-voice .voice-steps-row > .voice-card:nth-child(2) .btn--block,
#tab-voice .voice-steps-row > .voice-card:nth-child(2) .voice-card__actions {
  margin-top: 0.2rem !important;
}

.voice-listen-save {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 0.45rem;
  margin-top: 0.25rem;
}
.preset-step2-selected {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.4rem 0.65rem;
  margin: 0 0 0.55rem;
  padding: 0.45rem 0.65rem;
  border-radius: 8px;
  background: #eef8f6;
  border: 1px solid #b7e0d8;
  font-size: 0.92rem;
}
.preset-step2-selected[hidden],
#preset-step2-empty[hidden] {
  display: none !important;
}
/* ②では音声カードを出さない（選択中ラベル＋音量のみ） */
#downloaded-preset-list {
  display: none !important;
}
.preset-step2-selected__label {
  font-size: 0.75rem;
  font-weight: 700;
  color: #0f766e;
  letter-spacing: 0.02em;
}
.preset-step2-selected__name {
  font-weight: 700;
  color: #134e4a;
}
#downloaded-presets-section > .preset-empty-hint {
  margin: 0 0 0.55rem;
  font-size: 0.85rem;
  color: #64748b;
}
.voice-listen-save .voice-card__actions,
.voice-listen-save .voice-save-actions {
  display: flex;
  flex: 1 1 auto;
  gap: 0.45rem;
  margin-top: 0 !important;
  min-width: 0;
}
.voice-listen-save .voice-card__actions .btn,
.voice-listen-save .voice-save-actions .btn {
  flex: 1 1 auto;
  min-width: 6rem;
  min-height: 2.1rem;
}
.voice-listen-save--clinic {
  flex-direction: column;
  border-top: 1px solid #eef2f6;
  padding-top: 0.35rem;
  margin-top: 0.35rem;
}

/* ①のリストだけ必要時にスクロール */
#tab-voice .voice-steps-row #preset-list.preset-card-grid,
#tab-voice .voice-steps-row .voice-step1-body {
  flex: 0 0 auto !important;
  min-height: 0 !important;
  max-height: none !important;
  overflow: visible !important;
}

#tab-voice #audio-step-upload .place-audio-strip,
#tab-voice #room-audio-list {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 0.45rem !important;
  width: 100% !important;
  max-width: 100% !important;
  max-height: none !important;
  overflow: visible !important;
}

#tab-voice #audio-step-upload .place-audio-card {
  display: grid !important;
  grid-template-columns: auto minmax(0, 1fr) auto !important;
  align-items: center !important;
  min-height: 0 !important;
  height: auto !important;
  width: 100% !important;
  max-width: none !important;
  padding: 0.4rem 0.5rem !important;
  gap: 0.35rem 0.45rem !important;
}

#tab-voice #audio-step-upload .place-audio-card__name {
  text-align: left !important;
  white-space: nowrap !important;
}

#tab-voice #audio-step-upload .place-audio-card__actions {
  display: flex !important;
  flex-direction: row !important;
  gap: 0.3rem !important;
  width: auto !important;
  margin-top: 0 !important;
  grid-template-columns: none !important;
}

#tab-voice #audio-step-upload .place-audio-card__actions .btn,
#tab-voice #audio-step-upload .place-audio-card__actions .btn--small {
  width: auto !important;
  min-width: 3.2rem !important;
  min-height: 2rem !important;
  font-size: 0.78rem !important;
  white-space: nowrap !important;
  padding: 0.28rem 0.55rem !important;
}

#tab-voice #audio-step-upload .voice-audio-block {
  width: 100% !important;
}

#tab-voice #audio-step-upload .voice-step1-body {
  gap: 0.55rem !important;
  flex: 0 0 auto !important;
  overflow: visible !important;
  width: 100% !important;
}

#tab-voice #audio-step-upload .voice-card__head {
  margin-bottom: 0.25rem !important;
  padding-bottom: 0.25rem !important;
}

#tab-voice #audio-step-cloud.voice-card--listen-save {
  max-height: none !important;
  overflow: visible !important;
}

/* チャイム列: 潰れ防止・文字が切れないように */
#tab-voice .voice-col--chime {
  overflow-x: hidden !important;
  overflow-y: auto !important;
  min-width: 17rem !important;
}
#tab-voice .voice-col--chime .form-group label {
  font-size: 0.78rem !important;
  white-space: nowrap !important;
}
#tab-voice .voice-col--chime select,
#tab-voice .voice-col--chime .range-value {
  font-size: 0.78rem !important;
  max-width: 100% !important;
}
#tab-voice .voice-col--chime .range-group {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto !important;
  align-items: center !important;
  gap: 0.35rem !important;
  min-width: 0 !important;
}
#tab-voice .voice-col--chime .range-group input[type='range'] {
  width: 100% !important;
  min-width: 0 !important;
}
#tab-voice .voice-col--chime .range-value {
  min-width: 2.6rem !important;
  text-align: right !important;
  flex-shrink: 0 !important;
}
#tab-voice .voice-col--chime .voice-mode-help-section,
#tab-voice .voice-col--chime .voice-mode-help-section li,
#tab-voice .voice-col--chime .voice-side-card__toggle-title {
  font-size: 0.75rem !important;
  word-break: break-word !important;
  overflow-wrap: anywhere !important;
}

#tab-voice .voice-steps-row #downloaded-preset-list.preset-card-grid {
  flex: 0 0 auto !important;
  min-height: 0 !important;
  max-height: min(28vh, 12rem) !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
}

#tab-voice .voice-steps-row .voice-file-list--step1 {
  flex: 0 0 auto !important;
  min-height: 0 !important;
  max-height: none !important;
  overflow: visible !important;
}

#tab-voice .voice-step2-download-actions {
  margin-top: 0.25rem !important;
  margin-bottom: 0.2rem !important;
}

#tab-voice .voice-step2-audio-controls {
  padding-top: 0.3rem !important;
  gap: 0.25rem !important;
  border-top: 1px solid #eef2f6;
  margin-top: 0.25rem;
}

#tab-voice .voice-steps-row > .voice-card:nth-child(2) .voice-controls-grid,
#tab-voice .voice-steps-row > .voice-card:nth-child(2) .form-group,
#tab-voice .voice-steps-row > .voice-card:nth-child(2) .voice-card__compact-field {
  margin-bottom: 0.15rem !important;
}

#tab-voice .voice-steps-row > .voice-card:nth-child(2) .voice-status-line {
  margin-bottom: 0.1rem !important;
  line-height: 1.3 !important;
  font-size: 0.75rem !important;
}

#tab-voice .voice-steps-row > .voice-card:nth-child(2) .voice-danger-details {
  margin-top: 0.3rem !important;
}

#tab-voice .voice-steps-row > .voice-card:nth-child(2) .voice-danger-details:not([open]) {
  margin-bottom: 0 !important;
  padding: 0.2rem 0.4rem !important;
}

#tab-voice .voice-col--chime .voice-side-card {
  background: #ffffff !important;
  border: 1px solid #e0e6ed !important;
  box-shadow: none !important;
}

#tab-voice .voice-mode-card {
  background: #ffffff !important;
  border: 1px solid #d0dae3 !important;
  box-shadow: none !important;
}

#tab-voice .voice-mode-card--active {
  border-color: #3e8a9c !important;
  box-shadow: none !important;
}

#tab-voice .voice-card {
  background: #ffffff !important;
  border: 1px solid #e0e6ed !important;
  box-shadow: none !important;
}

#tab-voice .voice-file-list--step1 .voice-file-card,
#tab-voice .voice-file-card--cloud-push {
  background: #fafbfc !important;
  border: 1px solid #e8edf2 !important;
  box-shadow: none !important;
}

.voice-save-actions {
  display: flex;
  gap: 0.45rem;
  align-items: stretch;
  flex-wrap: wrap;
}
.voice-save-actions .btn {
  flex: 1 1 auto;
  min-width: 5.5rem;
  min-height: 2.1rem;
  font-size: 0.82rem;
  padding: 0.4rem 0.7rem;
}
.voice-danger-details--compact {
  margin: 0.3rem 0 0;
  padding: 0.25rem 0.45rem;
  border: 1px solid #eef2f6;
  border-radius: 8px;
  background: #fafbfc;
}
.voice-danger-details--compact > summary {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--color-text-light);
  cursor: pointer;
}
.voice-danger-details--compact[open] > summary {
  margin-bottom: 0.35rem;
  color: var(--color-text-light);
}
.voice-danger-details--compact .voice-delete-section {
  margin-bottom: 0.35rem;
}
.voice-danger-details--compact .voice-delete-section:last-child {
  margin-bottom: 0;
}
.voice-danger-details--compact .voice-delete-section__label {
  font-size: 0.7rem;
  margin-bottom: 0.2rem;
}

@media (max-width: 1100px) {
  #tab-voice .voice-grid {
    grid-template-columns: 1fr !important;
  }
  #tab-voice .voice-col--chime {
    min-width: 0 !important;
  }
}

@media (max-width: 900px) {
  #tab-voice .voice-mode-panel.is-active .voice-steps-row {
    display: flex !important;
    flex-direction: column !important;
    overflow-y: auto !important;
  }
  #tab-voice .voice-steps-row > .voice-card:nth-child(1),
  #tab-voice .voice-steps-row > .voice-card:nth-child(2) {
    flex: 0 0 auto !important;
    max-height: none !important;
  }
  #tab-voice #audio-step-upload .place-audio-strip,
  #tab-voice #room-audio-list {
    grid-template-columns: minmax(0, 1fr) !important;
  }
  #tab-voice .voice-mode-card {
    min-height: 3.25rem !important;
    padding: 0.7rem 0.85rem !important;
  }
  #tab-voice .voice-mode-card__title {
    font-size: 0.95rem !important;
  }
  #tab-voice .place-audio-card__name {
    font-size: 0.9rem !important;
  }
  #tab-voice .place-audio-card {
    min-height: 0 !important;
  }
}

@media (max-width: 560px) {
  #tab-voice .voice-grid {
    grid-template-columns: 1fr !important;
  }
  #tab-voice #audio-step-upload .place-audio-strip,
  #tab-voice #room-audio-list {
    grid-template-columns: minmax(0, 1fr) !important;
  }
  #tab-voice #audio-step-upload .place-audio-card {
    grid-template-columns: auto minmax(0, 1fr) !important;
  }
  #tab-voice #audio-step-upload .place-audio-card__actions {
    grid-column: 1 / -1 !important;
    width: 100% !important;
    justify-content: stretch !important;
  }
  #tab-voice #audio-step-upload .place-audio-card__actions .btn,
  #tab-voice #audio-step-upload .place-audio-card__actions .btn--small {
    flex: 1 1 auto !important;
    min-height: 2.4rem !important;
    font-size: 0.88rem !important;
  }
}

@media (min-width: 992px) {
  #tab-voice .voice-side-card__body {
    overflow-y: hidden !important;
    flex: 0 1 auto !important;
  }
}

.footer-voice-card {
  justify-self: center !important;
  display: flex !important;
  align-items: center !important;
  flex-wrap: wrap !important;
  gap: 0.5rem 0.75rem !important;
  padding: 0.65rem 1.35rem !important;
  border-radius: 12px !important;
  background: #ffe9b8 !important;
  border: 3px solid #c8860a !important;
  box-shadow: 0 6px 20px rgba(160, 100, 0, 0.22) !important;
  max-width: min(100%, 32rem) !important;
}

.footer-voice-card__label {
  font-size: clamp(0.82rem, 0.72rem + 0.35vw, 0.95rem) !important;
  font-weight: 800 !important;
  color: #6b4e0a !important;
}

.footer-voice-card__method {
  font-size: clamp(1rem, 0.88rem + 0.5vw, 1.2rem) !important;
  font-weight: 900 !important;
  color: #142a35 !important;
}

.footer-voice-card__test {
  background: none !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
  min-height: 0 !important;
  color: #1d5c6e !important;
  font-size: clamp(0.85rem, 0.78rem + 0.3vw, 0.95rem) !important;
  font-weight: 800 !important;
  text-decoration: underline !important;
  text-underline-offset: 3px !important;
  cursor: pointer !important;
}

.footer-voice-card__test:hover {
  color: #0d3a48 !important;
  transform: none !important;
  filter: none !important;
}

@media (max-width: 560px) {
  #tab-voice .voice-grid {
    grid-template-columns: 1fr !important;
  }
}
