/* ===========================
   Design System - Variables (Sky Blue Theme)
   =========================== */
:root {
  --bg-primary: #121212;
  --bg-secondary: #1e1e1e;
  --bg-card: #1e1e1e;
  --bg-glass: rgba(30, 30, 30, 0.95);
  --bg-input: #2b2b2b;
  --text-primary: #ffffff;
  --text-secondary: #e0e0e0;
  --text-muted: #a0a0a0;
  --accent-blue: #4f8cff;
  --accent-purple: #8b5cf6;
  --accent-green: #34d399;
  --accent-orange: #fb923c;
  --accent-red: #f87171;
  --accent-pink: #f472b6;
  --accent-cyan: #2dd4bf;
  --gradient-primary: linear-gradient(135deg, #4f8cff 0%, #8b5cf6 100%);
  --gradient-success: linear-gradient(135deg, #34d399, #2dd4bf);
  --gradient-warning: linear-gradient(135deg, #fb923c, #f87171);
  --gradient-header: linear-gradient(135deg, #1e1e1e 0%, #121212 100%);
  --shadow-card: 0 4px 20px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 20px rgba(79, 140, 255, 0.15);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --font-family: "BIZ UDPGothic", "Yu Gothic Medium", "游ゴシック Medium", YuGothic, "游ゴシック体", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Meiryo", sans-serif;
  --nav-height: 68px;
  --header-height: 56px;
  --transition-fast: 0.2s ease;
  --transition-normal: 0.3s ease;
}

/* ===========================
   スマホ標準フォントサイズ最適化 (Base 16px)
   =========================== */
/* PCはコンパクト、iPhone等では16px以上でフォーカス時の自動ズームを防止 */
input, select, textarea, button, option {
  font-size: 12px;
}

/* iPhone 15 系（〜430px）: Safe Area + iOSズーム防止 */
@media (max-width: 430px) {
  html, body {
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
  }

  input, select, textarea {
    font-size: 16px !important;
  }

  #main-content {
    padding-left: max(10px, env(safe-area-inset-left, 0px));
    padding-right: max(10px, env(safe-area-inset-right, 0px));
    padding-bottom: max(88px, calc(68px + env(safe-area-inset-bottom, 0px)));
    min-height: 100dvh;
  }

  #app {
    min-height: 100dvh;
  }

  #bottom-nav {
    height: calc(var(--nav-height) + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
}

.cm-entry-fields {
  display: block !important;
}

.cm-field {
  min-width: 0;
  overflow: hidden;
}

.cm-field label {
  display: block;
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.cm-field input {
  width: 100% !important;
  box-sizing: border-box !important;
  font-size: 12px;
  padding: 10px 12px !important;
  border: 2px solid rgba(59,130,246,0.5);
  border-radius: 6px;
  background: var(--bg-input);
  color: var(--text-primary);
}

.cm-field input::-webkit-inner-spin-button,
.cm-field input::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.cm-field input[type=number] {
  -moz-appearance: textfield;
  appearance: textfield;
}

.cm-entry-fields .cm-field {
  flex: 1;
}

/* ===========================
   Base Reset
   =========================== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 11pt !important;
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-family);
  background: var(--bg-primary);
  color: var(--text-primary);
  font-weight: 500;
  min-height: 100vh;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background:
    radial-gradient(ellipse at 20% 20%, rgba(79, 140, 255, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 80%, rgba(139, 92, 246, 0.06) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

#app {
  position: relative;
  z-index: 1;
}

/* ===========================
   Header
   =========================== */
#app-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: auto;
  min-height: var(--header-height);
  background: var(--gradient-header);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  z-index: 100;
  display: block;
}

.header-content {
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.app-title {
  font-size: 11pt !important;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.title-icon {
  -webkit-text-fill-color: initial;
  font-size: 11pt !important;
}

.header-date {
  font-size: 11pt !important;
  color: var(--text-secondary);
  font-weight: 300;
}

/* ===========================
   Main Content
   =========================== */
#main-content {
  padding-top: calc(var(--header-height) + 4px);
  padding-bottom: calc(var(--nav-height) + 20px);
  padding-left: 12px;
  padding-right: 12px;
  max-width: 100%;
  margin: 0 auto;
  min-height: 100vh;
}

/* ===========================
   Bottom Navigation
   =========================== */
#bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  background: rgba(26, 29, 39, 0.95);
  backdrop-filter: blur(20px);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  justify-content: space-around;
  align-items: center;
  z-index: 100;
  padding-bottom: env(safe-area-inset-bottom, 0);
}

.nav-btn {
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 8px 12px;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    position: relative;
    min-width: 56px;
    /* 未選択時でも文字が読めるように明るさを確保 */
    opacity: 0.9;
    filter: brightness(0.95);
    transform: scale(0.98);
}

.nav-btn .nav-icon {
  font-size: 11pt !important;
  transition: transform var(--transition-fast);
}

.nav-btn .nav-label {
  font-size: 11pt !important;
  color: var(--text-muted);
  font-weight: 400;
  transition: color var(--transition-fast);
}

.nav-btn.active .nav-label {
  color: var(--accent-blue);
  font-weight: 600;
}

.nav-btn.active .nav-icon {
    transform: scale(1.15);
}

/* 選択時の強調 */
.nav-btn.active {
    opacity: 1 !important;
    filter: brightness(1.2) drop-shadow(0 0 8px rgba(255,255,255,0.25)) !important;
    transform: scale(1.02) translateY(-2px) !important;
    box-shadow: inset 0 0 12px rgba(255,255,255,0.1) !important;
    border-width: 2px !important;
}

.nav-btn.active::after {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 24px;
  height: 3px;
  background: var(--gradient-primary);
  border-radius: 0 0 3px 3px;
}

.nav-btn:active {
  transform: scale(0.92);
}

/* ===========================
   Cards
   =========================== */
.card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-bottom: 12px;
  border: 2px solid rgba(59,130,246,0.35);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow-card);
  transition: transform var(--transition-fast);
}

.card:hover {
  transform: translateY(-1px);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.card-title {
  font-size: 11pt !important;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-subtitle {
  font-size: 11pt !important;
  color: var(--text-secondary);
}

/* ===========================
   KPI Metric Cards
   =========================== */
.kpi-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
}

.kpi-card {
  background: var(--bg-glass);
  border-radius: var(--radius-md);
  padding: 14px;
  border: 2px solid rgba(59,130,246,0.3);
  position: relative;
  overflow: hidden;
}

.kpi-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  border-radius: 3px 3px 0 0;
}

.kpi-card.blue::before {
  background: var(--gradient-primary);
}

.kpi-card.green::before {
  background: var(--gradient-success);
}

.kpi-card.orange::before {
  background: var(--gradient-warning);
}

.kpi-card.purple::before {
  background: linear-gradient(135deg, #8b5cf6, #ec4899);
}

.kpi-label {
  font-size: 11pt !important;
  color: var(--text-secondary);
  font-weight: 400;
  margin-bottom: 6px;
}

.kpi-value {
  font-size: 11pt !important;
  font-weight: 700;
  line-height: 1;
}

.kpi-value.blue {
  color: var(--accent-blue);
}

.kpi-value.green {
  color: var(--accent-green);
}

.kpi-value.orange {
  color: var(--accent-orange);
}

.kpi-value.purple {
  color: var(--accent-purple);
}

.kpi-change {
  font-size: 11pt !important;
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 3px;
}

.kpi-change.up {
  color: var(--accent-green);
}

.kpi-change.down {
  color: var(--accent-red);
}

/* ===========================
   Forms
   =========================== */
.form-group {
  margin-bottom: 14px;
}

.form-label {
  display: block;
  font-size: 11pt !important;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.form-input,
.form-select {
  width: 100%;
  padding: 0 14px;
  height: 44px;
  min-height: 44px;
  line-height: normal;
  background: var(--bg-input);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 12px !important;
  font-weight: 500;
  font-family: var(--font-family);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  box-sizing: border-box;
  box-shadow: none;
}
input.form-input:not([type="checkbox"]):not([type="radio"]),
select.form-select {
  max-height: 44px;
}

.form-input::placeholder,
textarea.form-input::placeholder {
  color: var(--text-muted);
  opacity: 1;
}

.form-input {
  -webkit-appearance: none;
  appearance: none;
}

/* textarea は高さを固定しない */
textarea.form-input {
  height: auto;
  min-height: 60px;
  max-height: none;
  padding: 10px 14px;
  line-height: 1.5;
}

.form-input:focus,
.form-select:focus {
  outline: none;
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(79, 140, 255, 0.15);
}

.form-select {
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  -webkit-appearance: none;
  appearance: none;
  background-color: var(--bg-input);
  background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23cbd5e1' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 16px;
  padding: 0 36px 0 14px;
  line-height: normal;
  max-height: 44px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: middle;
}

.form-select option,
select option {
  background: var(--bg-card);
  color: var(--text-primary);
  padding: 8px 12px;
}

.form-select optgroup,
select optgroup {
  font-weight: 600;
  font-size: 13pt !important;
  color: var(--text-muted);
  background: var(--bg-input);
  padding: 8px 0;
}

.form-select optgroup option,
select optgroup option {
  font-weight: 500;
  font-size: 13pt !important;
  color: var(--text-primary);
  padding-left: 12px;
}

/* 全select要素にテーマカラーを適用 */
select {
  background-color: var(--bg-input);
  color: var(--text-primary);
}

/* 日付入力枠 */
#input-date {
  border: 2px solid #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

#input-date:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
}

/* モード別 入力枠カラー（通常時は控えめ、フォーカス時のみ強調） */
.visit-mode-kyotaku .form-input,
.visit-mode-kyotaku .form-select,
.visit-mode-kyotaku ~ .form-group .form-input.cm-detail-text {
  border-color: rgba(59, 130, 246, 0.35);
  box-shadow: none;
}

.visit-mode-kyotaku .form-input:focus,
.visit-mode-kyotaku .form-select:focus,
.visit-mode-kyotaku ~ .form-group .form-input.cm-detail-text:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.visit-mode-home .form-input,
.visit-mode-home .form-select,
.visit-mode-home ~ .form-group .form-input.home-detail-text {
  border-color: rgba(16, 185, 129, 0.35);
  box-shadow: none;
}

.visit-mode-home .form-input:focus,
.visit-mode-home .form-select:focus,
.visit-mode-home ~ .form-group .form-input.home-detail-text:focus {
  border-color: #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

/* ケアマネ検索ドロップダウン */
.cm-search-wrap {
  position: relative;
}

.cm-search-wrap .form-input {
  padding-right: 36px;
}

.cm-toggle-btn {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #9a9ab5;
  font-size: 13pt !important;
  cursor: pointer;
  padding: 4px 6px;
  line-height: 1;
  transition: color 0.15s;
}

.cm-toggle-btn:hover {
  color: var(--accent-blue);
}

.cm-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  max-height: 300px;
  overflow-y: auto;
  background: #1e1e36;
  border: 1px solid rgba(139, 92, 246, 0.3);
  border-radius: 10px;
  margin-top: 4px;
  z-index: 999;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.6);
}

.cm-dropdown.open {
  display: block;
}

.cm-group-label {
  font-size: 13pt !important;
  font-weight: 700;
  color: #b794f4;
  padding: 10px 14px 6px;
  background: rgba(139, 92, 246, 0.15);
  border-bottom: 1px solid rgba(139, 92, 246, 0.2);
  position: sticky;
  top: 0;
  z-index: 1;
}

.cm-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px 10px 24px;
  font-size: 13pt !important;
  color: #f0f0ff;
  cursor: pointer;
  transition: background 0.15s;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.cm-option:hover {
  background: rgba(79, 140, 255, 0.2);
}

.cm-option-rank {
  font-size: 13pt !important;
  margin-left: 8px;
}

/* 居宅ブロック */
.kyotaku-block {
  border-left: 3px solid var(--accent-purple);
}

.kyotaku-block.kyotaku-block-home {
  border-left-color: #10b981 !important;
}

.kyotaku-block-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.kyotaku-block-num {
  font-size: 13pt !important;
  font-weight: 700;
  color: var(--accent-purple);
}

.kyotaku-block-delete {
  background: none;
  border: none;
  color: #666;
  font-size: 13pt !important;
  cursor: pointer;
  padding: 2px 8px;
  border-radius: 4px;
  transition: all 0.15s;
}

.kyotaku-block-delete:hover {
  color: var(--accent-red);
  background: rgba(239, 68, 68, 0.1);
}

.kyotaku-cm-list {
  margin-top: 8px;
}

.cm-entry {
  padding: 8px 0;
  border-bottom: 1px solid rgba(42, 125, 225, 0.1);
}

.cm-entry:last-child {
  border-bottom: none;
}

.cm-entry-header {
  margin-bottom: 6px;
}

.cm-entry-check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13pt !important;
  color: var(--text-primary);
  cursor: pointer;
}

.cm-entry-check input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent-purple);
}

.cm-entry-fields {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  padding-left: 24px;
}

.cm-field {
  display: flex;
  flex-direction: column;
}

.cm-field label {
  font-size: 13pt !important;
  color: var(--text-secondary);
  margin-bottom: 2px;
}

.cm-field .form-input {
  padding: 8px 12px;
  font-size: 13pt !important;
}

.empty-cm-msg {
  font-size: 13pt !important;
  color: var(--text-secondary);
  padding: 12px 0;
  text-align: center;
}

/* 売上内訳 */
.revenue-breakdown {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.rev-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
}

.rev-label {
  font-size: 13pt !important;
  color: var(--text-secondary);
}

.rev-value {
  font-size: 13pt !important;
  font-weight: 600;
  color: var(--text-primary);
}

.rev-total {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  margin-top: 4px;
  padding-top: 12px;
  background: rgba(139, 92, 246, 0.08);
}

.rev-total .rev-label {
  font-weight: 700;
  color: var(--text-primary);
}

.rev-total .rev-value {
  font-size: 13pt !important;
  color: var(--accent-purple);
}

/* 訪問時間スライダー */
.visit-time-display {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 6px 0;
  margin-bottom: 4px;
}

.vt-range-text {
  font-size: 13pt !important;
  font-weight: 700;
  color: var(--accent-purple);
  letter-spacing: 1px;
}

.dual-slider {
  padding: 8px 0 4px;
  user-select: none;
}

.dual-slider-track {
  position: relative;
  height: 12px;
  background: rgba(42, 125, 225, 0.12);
  border-radius: 6px;
  cursor: pointer;
}

.dual-slider-band {
  position: absolute;
  top: 0;
  height: 100%;
  border-radius: 6px;
  background: linear-gradient(90deg, #0fa968, #3498db, #e68a2e);
  opacity: 0.8;
  transition: left 0.05s, width 0.05s;
}

.dual-slider-thumb {
  position: absolute;
  top: 50%;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  cursor: grab;
  z-index: 2;
  transition: left 0.05s, box-shadow 0.15s;
}

.dual-slider-thumb:active {
  cursor: grabbing;
  transform: translate(-50%, -50%) scale(1.15);
}

.thumb-start {
  background: #34d399;
  box-shadow: 0 0 8px rgba(52, 211, 153, 0.5);
  border: 2px solid rgba(52, 211, 153, 0.8);
}

.thumb-start:hover,
.thumb-start:active {
  box-shadow: 0 0 14px rgba(52, 211, 153, 0.7);
}

.thumb-end {
  background: #fb923c;
  box-shadow: 0 0 8px rgba(251, 146, 60, 0.5);
  border: 2px solid rgba(251, 146, 60, 0.8);
}

.thumb-end:hover,
.thumb-end:active {
  box-shadow: 0 0 14px rgba(251, 146, 60, 0.7);
}

.dual-slider-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
  font-size: 13pt !important;
  color: var(--text-muted);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.form-row-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
}

/* 売上横棒グラフ */
.ranking-item-bars {
  flex-direction: column;
  align-items: flex-start !important;
  gap: 4px;
}

.ranking-item-bars>.ranking-info {
  width: 100%;
}

.rev-bars {
  margin-top: 6px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.rev-bar-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.rev-bar-label {
  font-size: 13pt !important;
  font-weight: 700;
  width: 14px;
  text-align: center;
  flex-shrink: 0;
}

.rev-bar-track {
  flex: 1;
  height: 10px;
  background: rgba(42, 125, 225, 0.1);
  border-radius: 5px;
  overflow: hidden;
}

.rev-bar-fill {
  height: 100%;
  border-radius: 5px;
  transition: width 0.4s ease;
}

.rev-bar-fill.rental {
  background: linear-gradient(90deg, #34d399, #6ee7b7);
}

.rev-bar-fill.sales {
  background: linear-gradient(90deg, #4f8cff, #93bbff);
}

.rev-bar-fill.reform {
  background: linear-gradient(90deg, #fb923c, #fdba74);
}

.rev-bar-val {
  font-size: 13pt !important;
  font-weight: 600;
  color: var(--text-secondary);
  width: 40px;
  text-align: right;
  flex-shrink: 0;
}

/* ===========================
   Buttons
   =========================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--font-family);
  font-size: 13pt !important;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  width: 100%;
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: var(--gradient-primary);
  color: white;
  box-shadow: 0 4px 15px rgba(79, 140, 255, 0.3);
}

.btn-primary:hover {
  box-shadow: 0 6px 20px rgba(79, 140, 255, 0.4);
}

.btn-secondary {
  background: var(--bg-glass);
  color: var(--text-primary);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-success {
  background: var(--gradient-success);
  color: white;
  box-shadow: 0 4px 15px rgba(52, 211, 153, 0.3);
}

.btn-sm {
  padding: 8px 14px;
  font-size: 13pt !important;
}

/* ===========================
   Tags / Badges
   =========================== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 13pt !important;
  font-weight: 600;
}

.badge-a {
  background: rgba(52, 211, 153, 0.15);
  color: var(--accent-green);
}

.badge-b {
  background: rgba(251, 146, 60, 0.15);
  color: var(--accent-orange);
}

.badge-c {
  background: rgba(107, 107, 133, 0.15);
  color: var(--text-muted);
}

/* ===========================
   Ranking List
   =========================== */
.ranking-list {
  list-style: none;
}

.ranking-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  transition: background var(--transition-fast);
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.ranking-item:last-child {
  border-bottom: none;
}

.ranking-item:hover {
  background: var(--bg-glass);
}

.ranking-rank {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13pt !important;
  font-weight: 700;
  flex-shrink: 0;
}

.ranking-rank.gold {
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  color: #1a1a2e;
}

.ranking-rank.silver {
  background: linear-gradient(135deg, #d1d5db, #9ca3af);
  color: #1a1a2e;
}

.ranking-rank.bronze {
  background: linear-gradient(135deg, #d97706, #b45309);
  color: white;
}

.ranking-rank.default {
  background: var(--bg-glass);
  color: var(--text-muted);
}

.ranking-info {
  flex: 1;
  min-width: 0;
}

.ranking-name {
  font-size: 13pt !important;
  font-weight: 500;
}

.ranking-detail {
  font-size: 13pt !important;
  color: var(--text-secondary);
  margin-top: 2px;
}

.ranking-value {
  font-size: 13pt !important;
  font-weight: 700;
  text-align: right;
  flex-shrink: 0;
}

/* ===========================
   Progress Bar
   =========================== */
.progress-bar {
  height: 6px;
  background: var(--bg-glass);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 6px;
}

.progress-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.5s ease;
}

.progress-fill.blue {
  background: var(--gradient-primary);
}

.progress-fill.green {
  background: var(--gradient-success);
}

.progress-fill.orange {
  background: var(--gradient-warning);
}

/* ===========================
   Chart Container
   =========================== */
.chart-container {
  position: relative;
  width: 100%;
  padding: 8px 0;
}

.chart-container canvas {
  width: 100% !important;
  max-height: 240px;
}

/* KPI分析ページのチャートは全員表示するため高さ制限を解除 */
#kpia-member-chart,
#kpia-office-chart,
#kpia-kyotaku-chart,
#kpia-cm-chart {
  max-height: none !important;
}

/* ===========================
   Section Headers
   =========================== */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  padding: 0 4px;
}

.section-title {
  font-size: 13pt !important;
  font-weight: 600;
}

.section-action {
  font-size: 13pt !important;
  color: var(--accent-blue);
  cursor: pointer;
  background: none;
  border: none;
  font-family: var(--font-family);
}

/* ===========================
   Tabs
   =========================== */
.tabs {
  display: flex;
  gap: 4px;
  background: var(--bg-glass);
  border-radius: var(--radius-sm);
  padding: 3px;
  margin-bottom: 14px;
}

.tab-btn {
  flex: 1;
  padding: 8px 12px;
  border: none;
  background: none;
  border-radius: 6px;
  font-family: var(--font-family);
  font-size: 13pt !important;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.tab-btn.active {
  background: var(--bg-card);
  color: var(--text-primary);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* ===========================
   Time Breakdown Bar
   =========================== */
.time-bar {
  display: flex;
  height: 24px;
  border-radius: 12px;
  overflow: hidden;
  margin: 8px 0;
}

.time-segment {
  transition: width 0.5s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13pt !important;
  font-weight: 600;
  color: white;
  min-width: 0;
  overflow: hidden;
}

.time-bar .sales {
  background: linear-gradient(135deg, #4f8cff, #6366f1);
}

.time-bar .delivery {
  background: linear-gradient(135deg, #34d399, #22d3ee);
}

.time-bar .paperwork {
  background: linear-gradient(135deg, #fb923c, #f59e0b);
}

.time-bar .monitoring {
  background: linear-gradient(135deg, #ec4899, #f43f5e);
}

.time-bar .other {
  background: linear-gradient(135deg, #6b7280, #9ca3af);
}

.time-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
}

.time-legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 13pt !important;
  color: var(--text-secondary);
}

.time-legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ===========================
   Toast Messages
   =========================== */
.toast {
  position: fixed;
  top: 88px;
  bottom: auto;
  left: 50%;
  transform: translateX(-50%) translateY(-10px);
  background: var(--accent-green);
  color: white;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-size: 13pt !important;
  font-weight: 500;
  box-shadow: 0 8px 24px rgba(52, 211, 153, 0.3);
  opacity: 0;
  transition: all var(--transition-normal);
  z-index: 150;
  pointer-events: none;
  white-space: nowrap;
}

.toast.toast-warning {
  background: var(--accent-orange);
  box-shadow: 0 8px 24px rgba(251, 146, 60, 0.3);
}

.toast.toast-error {
  background: var(--accent-red);
  box-shadow: 0 8px 24px rgba(248, 113, 113, 0.3);
}

.toast.toast-info {
  background: var(--accent-blue);
  box-shadow: 0 8px 24px rgba(79, 140, 255, 0.3);
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ===========================
   Empty State
   =========================== */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
}

.empty-state-icon {
  font-size: 13pt !important;
  margin-bottom: 12px;
}

.empty-state-text {
  font-size: 13pt !important;
}

/* ===========================
   Page Transitions
   =========================== */
.page-enter {
  animation: pageIn 0.3s ease forwards;
}

@keyframes pageIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===========================
   Slider Input
   =========================== */
.slider-group {
  margin-bottom: 12px;
}

.slider-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.slider-label {
  font-size: 13pt !important;
  color: var(--text-secondary);
}

.slider-value {
  font-size: 13pt !important;
  font-weight: 600;
  color: var(--accent-blue);
}

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: var(--bg-glass);
  outline: none;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--gradient-primary);
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(79, 140, 255, 0.4);
}

/* ===========================
   Pareto Chart
   =========================== */
.pareto-info {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 8px;
}

.pareto-stat {
  text-align: center;
}

.pareto-stat-value {
  font-size: 13pt !important;
  font-weight: 700;
}

.pareto-stat-label {
  font-size: 13pt !important;
  color: var(--text-secondary);
}

/* ===========================
   Scrollbar
   =========================== */
::-webkit-scrollbar {
  width: 4px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
}

/* ===========================
   Responsive
   =========================== */
@media (min-width: 768px) {
  html {
    font-size: 13pt !important;
  }

  #main-content {
    padding-left: 4px;
    padding-right: 4px;
  }
}

/* ===========================
   Activity Log List
   =========================== */
.activity-log {
  list-style: none;
}

.activity-log-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: var(--radius-sm);
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.activity-log-item:last-child {
  border-bottom: none;
}

.activity-date {
  font-size: 13pt !important;
  color: var(--text-muted);
  flex-shrink: 0;
  width: 42px;
}

.activity-summary {
  flex: 1;
  font-size: 13pt !important;
}

.activity-count {
  font-size: 13pt !important;
  font-weight: 600;
  color: var(--accent-blue);
  flex-shrink: 0;
}

/* ===========================
   Pulse Animation
   =========================== */
@keyframes pulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.5;
  }
}

.loading {
  animation: pulse 1.5s ease-in-out infinite;
}

/* ===========================
   Master Data Management
   =========================== */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13pt !important;
}

.data-table th {
  text-align: left;
  padding: 8px 6px;
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 13pt !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  white-space: nowrap;
}

.data-table td {
  padding: 5px 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  vertical-align: middle;
}

.data-table tr:last-child td {
  border-bottom: none;
}

.data-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.action-btns {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.btn-icon {
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  padding: 5px 8px;
  cursor: pointer;
  font-size: 13pt !important;
  transition: all var(--transition-fast);
  color: var(--text-primary);
}

.btn-icon:hover {
  background: var(--bg-glass);
}

.btn-icon.edit:hover {
  border-color: var(--accent-blue);
  color: var(--accent-blue);
}

.btn-icon.delete:hover {
  border-color: var(--accent-red);
  color: var(--accent-red);
}

.btn-danger {
  background: linear-gradient(135deg, #f87171, #ef4444);
  color: white;
  box-shadow: 0 4px 15px rgba(248, 113, 113, 0.3);
}

.confirm-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 300;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0
  }

  to {
    opacity: 1
  }
}

.confirm-dialog {
  background: var(--bg-secondary);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
  padding: 24px;
  max-width: 320px;
  width: 90%;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.confirm-dialog p {
  margin-bottom: 18px;
  font-size: 13pt !important;
  line-height: 1.5;
}

.confirm-actions {
  display: flex;
  gap: 10px;
}

.confirm-actions .btn {
  flex: 1;
}

.member-count {
  font-size: 13pt !important;
  color: var(--text-muted);
  margin-left: 8px;
  font-weight: 400;
}

.search-box {
  position: relative;
  margin-bottom: 12px;
}

.search-box .form-input {
  padding-left: 36px;
}

.search-box::before {
  content: '🔍';
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 13pt !important;
  z-index: 1;
}

/* ===========================
   Activity Search
   =========================== */
.search-mode-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 10px;
}

.search-mode-tabs .btn {
  font-size: 13pt !important;
  padding: 5px 12px;
}

.search-mode-tabs .btn.active {
  background: var(--gradient-primary);
  color: white;
}

.search-result-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13pt !important;
}

.search-result-table th {
  text-align: left;
  padding: 6px 8px;
  color: var(--text-muted);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  font-weight: 500;
  font-size: 13pt !important;
  white-space: nowrap;
}

.search-result-table td {
  padding: 6px 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
}

.search-result-table tr {
  animation: fadeSlideIn 0.35s ease both;
}

.search-result-table tr:nth-child(1) {
  animation-delay: 0.05s;
}

.search-result-table tr:nth-child(2) {
  animation-delay: 0.1s;
}

.search-result-table tr:nth-child(3) {
  animation-delay: 0.15s;
}

.search-result-table tr:nth-child(4) {
  animation-delay: 0.2s;
}

.search-result-table tr:nth-child(5) {
  animation-delay: 0.25s;
}

.search-result-table tr:nth-child(6) {
  animation-delay: 0.3s;
}

.search-result-table tr:nth-child(7) {
  animation-delay: 0.35s;
}

.search-result-table tr:nth-child(8) {
  animation-delay: 0.4s;
}

.search-result-table .highlight-val {
  color: var(--accent-blue);
  font-weight: 700;
}

.search-result-table .score-bar {
  display: inline-block;
  height: 6px;
  border-radius: 3px;
  background: var(--gradient-primary);
  min-width: 4px;
  vertical-align: middle;
  margin-left: 4px;
  transition: width 0.5s ease;
}

@keyframes fadeSlideIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* AI Bubble */
.ai-comment-area {
  margin-top: 12px;
  animation: fadeSlideIn 0.5s ease 0.3s both;
}

.ai-bubble {
  background: linear-gradient(135deg, rgba(79, 140, 255, 0.12), rgba(139, 92, 246, 0.08));
  border: 1px solid rgba(79, 140, 255, 0.2);
  border-radius: 16px 16px 16px 4px;
  padding: 14px 16px;
  position: relative;
  font-size: 13pt !important;
  line-height: 1.7;
  color: var(--text-primary);
}

.ai-bubble::before {
  content: '';
  position: absolute;
  left: 12px;
  bottom: -8px;
  border-width: 8px 8px 0;
  border-style: solid;
  border-color: rgba(79, 140, 255, 0.2) transparent transparent;
}

.ai-bubble-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
  font-weight: 600;
  color: var(--accent-blue);
  font-size: 13pt !important;
}

.ai-bubble p {
  margin-bottom: 6px;
}

.ai-bubble .advice-item {
  padding: 4px 0 4px 16px;
  position: relative;
  font-size: 13pt !important;
  color: var(--text-secondary);
}

.ai-bubble .advice-item::before {
  content: '💡';
  position: absolute;
  left: 0;
  top: 4px;
  font-size: 13pt !important;
}

.ai-bubble .advice-good {
  color: var(--accent-green);
}

.ai-bubble .advice-warn {
  color: var(--accent-orange);
}

.btn-speak {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(79, 140, 255, 0.15);
  border: 1px solid rgba(79, 140, 255, 0.3);
  color: var(--accent-blue);
  border-radius: 20px;
  padding: 4px 12px;
  font-size: 13pt !important;
  cursor: pointer;
  transition: all var(--transition-fast);
  margin-top: 8px;
}

.btn-speak:hover {
  background: rgba(79, 140, 255, 0.25);
}

.btn-speak.speaking {
  background: var(--accent-blue);
  color: white;
}

.summary-stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-bottom: 10px;
}

.summary-stat-item {
  background: var(--bg-glass);
  border-radius: 8px;
  padding: 8px;
  text-align: center;
  animation: fadeSlideIn 0.4s ease both;
}

.summary-stat-item:nth-child(1) {
  animation-delay: 0.1s;
}

.summary-stat-item:nth-child(2) {
  animation-delay: 0.15s;
}

.summary-stat-item:nth-child(3) {
  animation-delay: 0.2s;
}

.summary-stat-item:nth-child(4) {
  animation-delay: 0.25s;
}

.summary-stat-item:nth-child(5) {
  animation-delay: 0.3s;
}

.summary-stat-item:nth-child(6) {
  animation-delay: 0.35s;
}

.summary-stat-label {
  font-size: 13pt !important;
  color: var(--text-muted);
}

.summary-stat-value {
  font-size: 13pt !important;
  font-weight: 700;
  color: var(--accent-blue);
}

/* 日次活動入力 - 訪問先ブロック */
.kyotaku-block {
  border-radius: 12px;
  margin-bottom: 12px;
}

.kyotaku-block-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255, 255, 255, 0.03);
  margin: -12px -12px 10px -12px;
  padding: 10px 12px;
  border-radius: 10px 10px 0 0;
  border-bottom: 1px solid rgba(59, 130, 246, 0.2);
}

.kyotaku-block-num {
  font-weight: 700;
  font-size: 13pt !important;
  color: #60a5fa;
}

.kyotaku-block-delete {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #ef4444;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 13pt !important;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.kyotaku-block-delete:hover {
  background: #ef4444;
  color: #fff;
}

/* 入力ガイド - 未入力の選択欄を強調 */
.input-guide {
  border: 2px solid var(--block-act-color, #3b82f6) !important;
  box-shadow: 0 0 0 3px var(--block-shadow-color, rgba(59, 130, 246, 0.2)) !important;
  transition: all 0.3s ease;
}

/* ヘルプチップ（吹き出しツールチップ） */
.help-tip {
  display: inline-block;
  position: relative;
  cursor: help;
  font-size: 13pt !important;
  background: rgba(67, 56, 202, 0.3);
  color: #818cf8;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  text-align: center;
  line-height: 18px;
  vertical-align: middle;
  margin-left: 4px;
}

.help-tip::after {
  content: attr(title);
  position: absolute;
  bottom: 130%;
  left: 50%;
  transform: translateX(-50%);
  background: #1e293b;
  color: #fff;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 13pt !important;
  font-weight: 400;
  line-height: 1.4;
  white-space: normal;
  width: max-content;
  max-width: 220px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  z-index: 100;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.help-tip::before {
  content: '';
  position: absolute;
  bottom: 120%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: #1e293b;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  z-index: 100;
}

.help-tip:hover::after,
.help-tip:hover::before,
.help-tip:active::after,
.help-tip:active::before {
  opacity: 1;
}

/* ===========================
   Voice Input Animations
   =========================== */
@keyframes pulseMic {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
  70% { transform: scale(1.05); box-shadow: 0 0 0 10px rgba(239, 68, 68, 0); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

.pulse-mic {
  animation: pulseMic 1.5s infinite;
}

@keyframes highlightVoiceField {
  0% { box-shadow: 0 0 0 3px rgba(252, 211, 77, 0.2); border-color: #fcd34d; }
  50% { box-shadow: 0 0 12px 3px rgba(252, 211, 77, 0.6); border-color: #fbbf24; }
  100% { box-shadow: 0 0 0 3px rgba(252, 211, 77, 0.2); border-color: #fcd34d; }
}

.voice-highlight {
  animation: highlightVoiceField 1.5s infinite;
  background: rgba(251, 191, 36, 0.1) !important;
  color: #fff !important;
}

/* ===========================
   Dashboard Cards (Settings Menu)
   =========================== */
.dash-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}
.dash-card {
  background: var(--bg-card);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--radius-lg);
  padding: 10px 8px;
  cursor: pointer;
  transition: all 0.25s;
  position: relative;
  overflow: hidden;
  text-align: center;
}
.dash-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  border-radius: 16px 16px 0 0;
}
.dash-card.c-blue::before { background: var(--gradient-primary); }
.dash-card.c-green::before { background: var(--gradient-success); }
.dash-card.c-orange::before { background: var(--gradient-warning); }
.dash-card.c-purple::before { background: linear-gradient(135deg, #8b5cf6, #ec4899); }
.dash-card.c-cyan::before { background: linear-gradient(135deg, #06b6d4, #2dd4bf); }
.dash-card.c-red::before { background: linear-gradient(135deg, #ef4444, #f87171); }
.dash-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.35);
  border-color: rgba(255,255,255,0.12);
}
.dash-card:active { transform: translateY(-1px); }
.dash-icon {
  font-size: 13pt !important;
  margin-bottom: 4px;
  display: block;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.3));
}
.dash-title {
  font-size: 13pt !important;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
}
.dash-count {
  font-size: 13pt !important;
  font-weight: 700;
  line-height: 1;
  margin-bottom: 2px;
}
.dash-count.blue { color: var(--accent-blue); }
.dash-count.green { color: var(--accent-green); }
.dash-count.orange { color: var(--accent-orange); }
.dash-count.purple { color: var(--accent-purple); }
.dash-count.cyan { color: var(--accent-cyan); }
.dash-count.red { color: var(--accent-red); }
.dash-sub {
  font-size: 13pt !important;
  color: var(--text-muted);
  line-height: 1.3;
}
.dash-drag-handle {
  position: absolute;
  top: 6px;
  right: 8px;
  font-size: 13pt !important;
  color: rgba(255,255,255,0.12);
  cursor: grab;
  transition: color 0.2s;
  line-height: 1;
  user-select: none;
  z-index: 2;
}
.dash-card:hover .dash-drag-handle {
  color: rgba(255,255,255,0.35);
}
.dash-drag-handle:active {
  cursor: grabbing;
}
.dash-card.dash-dragging {
  opacity: 0.4;
  transform: scale(0.95);
  box-shadow: none;
}
.dash-card.dash-drag-over {
  border-color: var(--accent-blue) !important;
  box-shadow: 0 0 0 2px rgba(79,140,255,0.3), 0 4px 16px rgba(79,140,255,0.15);
  transform: translateY(-2px) scale(1.02);
}

/* ===========================
   Excel-style Grid Table
   =========================== */
.excel-wrap {
  border: 2px solid rgba(59,130,246,0.4);
  border-radius: 8px;
  overflow: hidden;
  background: #0d0f14;
}
.excel-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  flex-wrap: wrap;
  background: rgba(30,33,48,0.95);
  border-bottom: 2px solid rgba(59,130,246,0.3);
}
.excel-toolbar .excel-title {
  font-size: 13pt !important;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.excel-toolbar .excel-search {
  flex: 1;
  width: 100%;
  max-width: 280px;
  box-sizing: border-box;
  padding: 6px 12px 6px 32px;
  background: rgba(15,17,23,0.8);
  border: 2px solid rgba(59,130,246,0.4);
  border-radius: 6px;
  color: var(--text-primary);
  font-size: 13pt !important;
  font-family: var(--font-family);
}
.excel-toolbar .excel-search:focus {
  outline: none;
  border-color: var(--accent-blue);
}
.excel-search-wrap {
  position: relative;
  flex: 1;
  max-width: 280px;
}
.excel-search-wrap::before {
  content: '🔍';
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 13pt !important;
  opacity: 0.5;
  pointer-events: none;
}
.excel-search-wrap .excel-search {
  padding-left: 32px;
}
.excel-search-clear {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  color: var(--text-secondary);
  border: none;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 2;
  transition: all 0.2s;
  padding: 0;
  line-height: 1;
}
.excel-search-clear:hover {
  background: rgba(255,255,255,0.25);
  color: white;
}

.excel-table-wrap {
  overflow-x: auto;
  max-height: 350px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.15) transparent;
}
table.excel-grid {
  width: 100%;
  border-collapse: collapse;
  font-size: 13pt !important;
  table-layout: auto;
}
table.excel-grid thead {
  position: sticky;
  top: 0;
  z-index: 10;
}
table.excel-grid thead th {
  background: linear-gradient(180deg, #1e2130, #181a26);
  color: var(--text-secondary);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 4px 8px !important;
  line-height: 1.4 !important;
  border-bottom: 2px solid rgba(79,140,255,0.5);
  border-right: 1px solid rgba(79,140,255,0.25);
  text-align: left;
  white-space: nowrap;
  user-select: none;
}
table.excel-grid thead th:first-child {
  width: 36px;
  text-align: center;
  color: var(--text-muted);
}
table.excel-grid thead th:last-child {
  border-right: none;
}
table.excel-grid tbody tr {
  transition: background 0.1s;
}
table.excel-grid tbody tr:nth-child(even) {
  background: rgba(255,255,255,0.015);
}
table.excel-grid tbody tr:hover {
  background: rgba(79,140,255,0.08);
}
table.excel-grid tbody td {
  padding: 2px 8px !important;
  line-height: 1.3 !important;
  border-bottom: 1px solid rgba(79,140,255,0.15);
  border-right: 1px solid rgba(79,140,255,0.12);
  color: var(--text-primary);
  vertical-align: middle;
}
table.excel-grid tbody td:first-child {
  text-align: center;
  color: var(--text-muted);
  font-weight: 500;
  background: rgba(30,33,48,0.5);
  border-right: 1px solid rgba(255,255,255,0.06);
}
table.excel-grid tbody td:last-child {
  border-right: none;
}
table.excel-grid .excel-group-row td {
  background: linear-gradient(135deg, rgba(79,140,255,0.1), rgba(79,140,255,0.03));
  font-weight: 700;
  font-size: 13pt !important;
  padding: 2px 8px !important;
  border-bottom: 1px solid rgba(79,140,255,0.15);
  color: var(--accent-blue);
  letter-spacing: 0.3px;
}
table.excel-grid .excel-group-row td:first-child {
  background: rgba(79,140,255,0.12);
  color: var(--accent-blue);
}

/* ケアマネ情報 — ツリー表示 */
.cm-toolbar-panel {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 10px 14px;
  padding: 10px 14px;
  background: #0f172a;
  border-bottom: 1px solid #334155;
}
.cm-toolbar-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 8px 10px;
  flex: 1 1 280px;
  min-width: 0;
}
.cm-filter-field {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.cm-filter-field--office { flex: 0 1 130px; max-width: 150px; }
.cm-filter-field--sales { flex: 0 1 110px; max-width: 130px; }
.cm-filter-label {
  font-size: 0.68rem;
  font-weight: 600;
  color: #94a3b8;
  letter-spacing: 0.02em;
}
.cm-filter-field .excel-search {
  width: 100%;
  height: 28px;
  font-size: 0.74rem;
  background: #1e293b;
  color: #f1f5f9;
  border: 1px solid #475569;
  border-radius: 6px;
  padding: 0 8px;
  box-sizing: border-box;
}
.cm-filter-field .excel-search:focus {
  border-color: #f59e0b;
  outline: none;
  box-shadow: 0 0 0 2px rgba(245,158,11,0.15);
}
.cm-filter-submit {
  height: 28px;
  padding: 0 12px;
  font-size: 0.76rem;
  flex-shrink: 0;
  align-self: flex-end;
}
.cm-filter-clear {
  height: 28px;
  padding: 0 8px;
  font-size: 0.72rem;
  flex-shrink: 0;
  align-self: flex-end;
  background: #fee2e2;
  color: #dc2626;
  border-color: #fca5a5;
}
.cm-toolbar-view {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  padding: 6px 10px;
  background: rgba(30,41,59,0.65);
  border: 1px solid #334155;
  border-radius: 8px;
}
.cm-toolbar-view-label {
  font-size: 0.7rem;
  color: #64748b;
  font-weight: 600;
  margin-right: 2px;
}
.cm-view-btn {
  padding: 5px 10px;
  font-size: 0.78rem;
  height: 30px;
  border-radius: 6px;
  border: 1px solid #475569;
  background: #1e293b;
  color: #cbd5e1;
  cursor: pointer;
  white-space: nowrap;
}
.cm-view-btn:hover { background: #334155; }
.cm-view-btn.is-active {
  background: #fef3c7;
  color: #b45309;
  border-color: #fde68a;
  font-weight: 700;
}
.cm-view-btn--print {
  background: #e0f2fe;
  color: #0284c7;
  border-color: #7dd3fc;
}
.cm-toolbar-stats {
  flex: 1 1 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px 12px;
  padding-top: 2px;
  border-top: 1px solid rgba(51,65,85,0.6);
  font-size: 0.78rem;
  color: #94a3b8;
}
.cm-toolbar-stats strong { color: #e2e8f0; font-weight: 700; }
table.excel-grid.cm-tree-mode thead th {
  text-align: left;
}
table.excel-grid.cm-tree-mode tbody td.cm-tree-office,
table.excel-grid.cm-tree-mode tbody td.cm-tree-sales,
table.excel-grid.cm-tree-mode tbody td.cm-tree-leaf {
  text-align: left !important;
  background: transparent !important;
  border-right: none !important;
  font-weight: inherit;
  color: inherit;
}
table.excel-grid.cm-tree-mode tbody tr.cm-grp-office-head:hover {
  background: rgba(30,58,138,0.55) !important;
}
table.excel-grid.cm-tree-mode tbody tr.cm-grp-sales-head:hover {
  background: rgba(6,78,59,0.45) !important;
}
table.excel-grid.cm-tree-mode tbody tr.cm-grp-cm-row:hover {
  background: rgba(79,140,255,0.08) !important;
}
.cm-grp-chevron {
  display: inline-block;
  width: 14px;
  font-size: 0.72rem;
  flex-shrink: 0;
  text-align: center;
}
.cm-tree-row-inner {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 0;
  padding: 7px 10px;
  min-width: 0;
}
.cm-tree-gutter {
  flex: 0 0 3em;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  min-width: 3em;
}
.cm-tree-icon {
  font-size: 0.95rem;
  line-height: 1;
}
.cm-tree-name {
  flex: 0 0 auto;
  white-space: nowrap;
  font-weight: 600;
}
.cm-tree-name--lv0 {
  padding-left: 0;
  color: #bfdbfe;
  font-size: 0.88rem;
}
.cm-tree-name--lv1 {
  padding-left: 2em;
  color: #a7f3d0;
  font-size: 0.82rem;
}
.cm-tree-name--lv2 {
  padding-left: 4em;
  color: #f1f5f9;
  font-size: 0.82rem;
}
.cm-tree-no {
  color: #64748b;
  font-size: 0.72rem;
  min-width: 1.8em;
  text-align: right;
  display: inline-block;
}
.cm-tree-detail {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-left: 6px;
  font-size: 0.78rem;
}
.cm-tree-meta {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
  padding-left: 12px;
}
.cm-tree-node {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
}
.cm-tree-count {
  font-weight: normal;
  opacity: 0.75;
  margin-left: 10px;
  font-size: 0.78rem;
}
.cm-tree-office .cm-tree-row-inner { padding-top: 9px; padding-bottom: 9px; }
.cm-tree-sales .cm-tree-row-inner { padding-top: 7px; padding-bottom: 7px; }
.cm-tree-leaf .cm-tree-row-inner { padding-top: 6px; padding-bottom: 6px; }

/* 居宅管理 — コマンドバー・WEB更新注意（フローティング） */
.kyotaku-web-wrap {
  position: relative;
  margin-left: auto;
  flex-shrink: 0;
}
.kyotaku-web-float {
  display: none;
  position: absolute;
  bottom: calc(100% + 10px);
  right: 0;
  width: min(300px, 85vw);
  padding: 10px 12px;
  background: rgba(15, 23, 42, 0.97);
  border: 1px solid rgba(245, 158, 11, 0.45);
  border-left: 4px solid #f59e0b;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  font-size: 0.74rem;
  color: #fcd34d;
  line-height: 1.55;
  z-index: 30;
  pointer-events: none;
}
.kyotaku-web-float strong { color: #fde68a; }
.kyotaku-web-float-icon {
  float: left;
  margin-right: 8px;
  font-size: 1rem;
  line-height: 1.3;
}
.kyotaku-web-float::after {
  content: '';
  position: absolute;
  top: 100%;
  right: 24px;
  border: 7px solid transparent;
  border-top-color: rgba(245, 158, 11, 0.45);
}
.kyotaku-web-wrap:hover .kyotaku-web-float,
.kyotaku-web-wrap:focus-within .kyotaku-web-float {
  display: flex;
  align-items: flex-start;
  gap: 0;
  animation: kyotakuFloatIn 0.15s ease-out;
}
@keyframes kyotakuFloatIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}
.kyotaku-cmd-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  padding: 8px 14px;
  background: #0f172a;
  border-bottom: 1px solid #334155;
}
.kyotaku-cmd-modes {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
  padding-right: 10px;
  border-right: 1px solid #475569;
}
.kyotaku-cmd-modes label {
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 600;
  color: #e2e8f0;
  white-space: nowrap;
}
.kyotaku-cmd-modes label.mode-new { color: #16a34a; }
.kyotaku-cmd-modes label.mode-del { color: #ef4444; }
.kyotaku-cmd-bar #kyo-cmd-search {
  min-width: 140px;
  max-width: 240px;
  height: 32px;
  font-size: 0.82rem;
}
.kyo-cmd-search-wrap {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}
.kyo-cmd-clear {
  width: 26px;
  height: 26px;
  padding: 0;
  flex-shrink: 0;
  border: 1px solid #475569;
  border-radius: 5px;
  background: #1e293b;
  color: #94a3b8;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
}
.kyo-cmd-clear:hover {
  background: #fee2e2;
  color: #dc2626;
  border-color: #fca5a5;
}
.kyotaku-web-btn {
  background: rgba(16, 185, 129, 0.15) !important;
  color: #6ee7b7 !important;
  border: 1px dashed #059669 !important;
  font-size: 0.76rem !important;
  opacity: 0.85;
}
.kyotaku-web-btn:hover { opacity: 1; background: rgba(16, 185, 129, 0.25) !important; }
.kyotaku-web-date {
  display: block;
  font-size: 0.6rem;
  opacity: 0.75;
  font-weight: normal;
}
table.kyt-grid .kyt-phone-cell {
  font-size: calc(0.72rem - 1pt) !important;
  padding-right: 6px !important;
  letter-spacing: -0.02em;
}

/* 営業担当者マスタ — ツリー表示（列: 余白 | ID | 氏名 | 事業所名 | 事業所番号 | 入社年 | 操作） */
table.excel-grid.mem-tree-mode tbody td.mem-tree-office,
table.excel-grid.mem-tree-mode tbody td.mem-tree-member,
table.excel-grid.mem-tree-mode tbody td.mem-tree-edit {
  text-align: left !important;
  background: transparent !important;
  border-right: none !important;
}
.mem-tree-row-inner {
  display: grid;
  grid-template-columns: 2em 4.5em 12em 14em 10em 6em 1fr;
  column-gap: 0;
  align-items: center;
  padding: 7px 10px;
  min-width: 0;
}
.mem-tree-head-row {
  display: grid;
  grid-template-columns: 2em 4.5em 12em 14em 10em 6em 1fr;
  column-gap: 0;
  align-items: center;
  padding: 4px 10px;
  color: #94a3b8;
  font-weight: 600;
  font-size: 0.72rem;
}
.mem-tree-head-row span:nth-child(2),
.mem-tree-head-row span:nth-child(3),
.mem-tree-head-row span:nth-child(4),
.mem-tree-head-row span:nth-child(5),
.mem-tree-head-row span:nth-child(6) {
  padding-left: 2em;
}
.mem-tree-row-inner--office .cm-grp-chevron { grid-column: 1; }
.mem-tree-row-inner--office .mem-tree-icon { grid-column: 2; justify-self: center; }
.mem-tree-row-inner--office .mem-tree-office-name {
  grid-column: 3;
  padding-left: 2em;
}
.mem-tree-row-inner--office .mem-tree-office-no {
  grid-column: 4;
  padding-left: 2em;
}
.mem-tree-row-inner--office .cm-tree-count {
  grid-column: 5;
  padding-left: 0.5em;
}
.mem-tree-row-inner--member .mem-tree-office-no {
  grid-column: 4;
  padding-left: 2em;
}
.mem-tree-row-inner--member .mem-tree-staff-count {
  grid-column: 5;
  padding-left: 0.5em;
  font-size: 0.75rem;
  color: #64748b;
}
.mem-tree-office-name {
  font-weight: 700;
  font-size: 0.88rem;
  color: #bfdbfe;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.mem-tree-office-no {
  font-family: monospace;
  font-size: 0.75rem;
  color: #94a3b8;
  white-space: nowrap;
}
.mem-tree-icon { font-size: 0.95rem; }
.mem-tree-gutter {
  grid-column: 1;
  min-width: 2em;
}
.mem-tree-row-inner--member .mem-tree-id {
  grid-column: 2;
  padding-left: 2em;
  font-family: monospace;
  font-size: 0.72rem;
  color: #64748b;
}
.mem-tree-row-inner--member .mem-tree-name {
  grid-column: 3;
  padding-left: 2em;
  font-weight: 600;
  font-size: 0.82rem;
  color: #f1f5f9;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mem-tree-row-inner--member .mem-tree-year {
  grid-column: 6;
  padding-left: 2em;
  font-size: 0.75rem;
  color: #94a3b8;
  white-space: nowrap;
}
.mem-tree-actions {
  grid-column: 7;
  justify-self: end;
  flex-shrink: 0;
}
.mem-tree-row-inner--edit .mem-tree-id {
  grid-column: 2;
  padding-left: 2em;
  font-family: monospace;
  font-size: 0.72rem;
  color: #64748b;
}
.mem-tree-row-inner--edit .mem-tree-field-name { grid-column: 3; padding-left: 2em; min-width: 0; }
.mem-tree-row-inner--edit .mem-tree-field-office { grid-column: 4; padding-left: 2em; min-width: 0; }
.mem-tree-row-inner--edit .mem-tree-field-offno { grid-column: 5; padding-left: 2em; min-width: 0; }
.mem-tree-row-inner--edit .mem-tree-field-year { grid-column: 6; padding-left: 2em; min-width: 0; }
.mem-tree-row-inner--edit .mem-tree-actions { grid-column: 7; }
.mem-tree-field input,
.mem-tree-field select {
  width: 100%;
  padding: 2px 4px;
  font-size: 12pt;
  background: #1e293b;
  color: #e2e8f0;
  border: 1px solid #4f8cff;
  border-radius: 3px;
  box-sizing: border-box;
}
.mem-tree-field input[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
}
table.excel-grid.mem-tree-mode tbody tr.mem-grp-office-head:hover {
  background: rgba(30, 58, 138, 0.55) !important;
}
table.excel-grid.mem-tree-mode tbody tr.mem-grp-member-row:hover,
table.excel-grid.mem-tree-mode tbody tr.member-adding-row:hover {
  background: rgba(79, 140, 255, 0.08) !important;
}

.excel-statusbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 14px;
  background: rgba(30,33,48,0.8);
  border-top: 1px solid rgba(255,255,255,0.06);
  font-size: 13pt !important;
  color: var(--text-muted);
}
.excel-btn-group {
  display: flex;
  gap: 6px;
  align-items: center;
}
.excel-btn {
  padding: 4px 12px;
  border-radius: 6px;
  border: 2px solid rgba(59,130,246,0.35);
  background: rgba(255,255,255,0.05);
  color: var(--text-secondary);
  font-size: 13pt !important;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  font-family: var(--font-family);
}
.excel-btn:hover {
  background: rgba(79,140,255,0.15);
  border-color: rgba(79,140,255,0.3);
  color: var(--text-primary);
}
.excel-btn.primary {
  background: linear-gradient(135deg, #2563eb, #3b82f6);
  border-color: transparent;
  color: white;
  font-weight: 600;
}
.excel-btn.primary:hover {
  box-shadow: 0 4px 12px rgba(37,99,235,0.3);
}
.excel-btn.active {
  background: rgba(79,140,255,0.2);
  border-color: rgba(79,140,255,0.4);
  color: var(--accent-blue);
  font-weight: 600;
}
.excel-back-btn {
  padding: 5px 14px;
  border-radius: 6px;
  border: 2px solid rgba(59,130,246,0.35);
  background: rgba(255,255,255,0.05);
  color: var(--text-secondary);
  font-size: 13pt !important;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  font-family: var(--font-family);
}
.excel-back-btn:hover {
  background: rgba(255,255,255,0.1);
  color: var(--text-primary);
}
.excel-badge {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 13pt !important;
  font-weight: 600;
}
.excel-badge-a { background: rgba(59,130,246,0.2); color: #60a5fa; }
.excel-badge-b { background: rgba(16,185,129,0.2); color: #34d399; }
.excel-badge-c { background: rgba(156,163,175,0.2); color: #9ca3af; }
.excel-badge-active { background: rgba(79,140,255,0.15); color: var(--accent-blue); }
.excel-badge-retired { background: rgba(239,68,68,0.15); color: #f87171; }
.excel-actions {
  display: flex;
  gap: 4px;
  justify-content: center;
}
.excel-actions button {
  background: none;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 4px;
  padding: 3px 8px;
  font-size: 13pt !important;
  cursor: pointer;
  transition: all 0.15s;
  color: var(--text-secondary);
}
.excel-actions button:hover {
  background: rgba(79,140,255,0.15);
  border-color: rgba(79,140,255,0.3);
}
/* Excel-like Inline Edit Styles */
.excel-edit-input, .excel-edit-select {
  width: 100%;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-primary);
  font-size: 13pt !important;
  padding: 4px 6px;
  border-radius: 4px;
  outline: none;
  transition: all 0.2s;
}
.excel-edit-input:hover, .excel-edit-select:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1);
}
.excel-edit-input:focus, .excel-edit-select:focus {
  background: var(--bg-card);
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 2px rgba(79, 140, 255, 0.2);
}
.excel-edit-select option {
  background: var(--bg-card);
  color: var(--text-primary);
}
.new-row-highlight {
  animation: flashHighlight 1.5s ease;
}
@keyframes flashHighlight {
  0% { background: rgba(16, 185, 129, 0.3) !important; }
  100% { background: transparent; }
}


/* ===========================
   User Custom: Input Field Expansion & Font Unification
   =========================== */

/* Unify font families across all form components */
input, select, textarea, button {
  font-family: inherit;
}

/* Set input text size to a unified size */
.form-input, 
.form-select, 
.cm-field input, 
.excel-search, 
.excel-edit-input, 
.excel-edit-select,
.cm-field .form-input,
select optgroup,
select optgroup option,
select option,
input[type="text"], 
input[type="number"], 
input[type="time"],
input[type="date"],
input[type="tel"],
textarea {
  font-size: 13pt !important;
}

/* Make outside labels the same size as input text */
label,
.form-label,
.cm-field label,
.cm-group-label,
.rev-label,
.vt-range-text,
.kyotaku-block-num,
.cm-entry-check,
.excel-title,
.dash-title {
  font-size: 13pt !important;
}

/* 福祉用具選定シート：アコーディオン（①②③ 1ページ） */
#modal-new-form .welfare-accordion-page {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}

#modal-new-form .welfare-accordion {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  overflow: hidden;
  flex-shrink: 0;
}

#modal-new-form .welfare-accordion-head {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.05);
  border: none;
  border-bottom: 1px solid transparent;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  transition: background 0.15s;
}

#modal-new-form .welfare-accordion-head:hover {
  background: rgba(59, 130, 246, 0.12);
}

#modal-new-form .welfare-accordion.is-open .welfare-accordion-head {
  border-bottom-color: rgba(255, 255, 255, 0.1);
}

#modal-new-form .welfare-accordion-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: #93c5fd;
  flex-shrink: 0;
}

#modal-new-form .welfare-accordion-meta {
  font-size: 0.72rem;
  color: #64748b;
  flex: 1;
  min-width: 0;
}

#modal-new-form .welfare-accordion-status {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  white-space: nowrap;
  flex-shrink: 0;
  line-height: 1.35;
}

#modal-new-form .welfare-accordion-status.is-incomplete {
  color: #fca5a5;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.35);
}

#modal-new-form .welfare-accordion-status.is-complete {
  color: #6ee7b7;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.35);
}

#modal-new-form .welfare-accordion.is-section-incomplete {
  border-color: rgba(239, 68, 68, 0.22);
}

#modal-new-form .welfare-accordion.is-section-complete {
  border-color: rgba(16, 185, 129, 0.22);
}

#modal-new-form #welfare-form-step-badge.is-all-complete {
  color: #6ee7b7;
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.35);
}

#modal-new-form #welfare-form-step-badge.is-partial {
  color: #fca5a5;
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.28);
}

#modal-new-form #btn-submit-new-form:disabled {
  opacity: 0.42 !important;
  cursor: not-allowed !important;
  box-shadow: none !important;
}

#modal-new-form .welfare-accordion-status.is-partial {
  color: #fcd34d;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.4);
}

#modal-new-form .welfare-accordion.is-section-partial {
  border-color: rgba(245, 158, 11, 0.28);
}

#modal-new-form .welfare-field-missing {
  box-shadow: inset 0 0 0 1px rgba(239, 68, 68, 0.55) !important;
  background: rgba(239, 68, 68, 0.07) !important;
}

#modal-new-form #f-basic-info-list input.welfare-field-missing,
#modal-new-form #f-basic-info-list select.welfare-field-missing {
  background: rgba(239, 68, 68, 0.07) !important;
}

.welfare-section-status-bar {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: 6px;
  font-size: 0.78rem;
  line-height: 1.45;
}

.welfare-section-status-bar.is-incomplete {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #fecaca;
}

.welfare-section-status-bar.is-incomplete.is-partial {
  background: rgba(245, 158, 11, 0.1);
  border-color: rgba(245, 158, 11, 0.4);
  color: #fde68a;
}

.welfare-section-status-bar.is-complete {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #6ee7b7;
}

.welfare-status-count {
  font-weight: 700;
}

.welfare-status-missing {
  color: #fca5a5;
  font-weight: 600;
}

.welfare-section-status-bar.is-partial .welfare-status-missing {
  color: #fcd34d;
}

.welfare-status-note {
  font-size: 0.72rem;
  color: #94a3b8;
  font-weight: normal;
}

#modal-new-form .welfare-accordion-chevron {
  font-size: 0.65rem;
  color: #64748b;
  transition: transform 0.2s;
  flex-shrink: 0;
}

#modal-new-form .welfare-accordion.is-open .welfare-accordion-chevron {
  transform: rotate(0deg);
}

#modal-new-form .welfare-accordion:not(.is-open) .welfare-accordion-chevron {
  transform: rotate(-90deg);
}

#modal-new-form .welfare-accordion-body {
  display: none;
  padding: 12px 14px 14px;
}

#modal-new-form .welfare-accordion.is-open .welfare-accordion-body {
  display: block;
}

#modal-new-form #welfare-step-goals {
  margin-top: 0;
}

#modal-new-form #welfare-step-course {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  min-height: 0;
}

#modal-new-form[data-welfare-mode="service_plan"] #welfare-accordion-course,
#modal-new-form[data-welfare-mode="service_plan"] #welfare-step-course {
  display: none !important;
}

/* サービス計画書：計画書を前面、①②は閉じてまとめて下部に */
#modal-new-form[data-welfare-mode="service_plan"] #modal-new-form-body {
  gap: 8px;
  padding: 10px 14px;
  overflow: hidden;
}

#modal-new-form[data-welfare-mode="service_plan"] #welfare-accordion-page {
  display: none !important;
}

#modal-new-form[data-welfare-mode="service_plan"] #welfare-step-service-plan {
  order: 1;
  flex: 1 1 auto;
  min-height: 0;
  gap: 6px;
  overflow: hidden;
}

#modal-new-form[data-welfare-mode="service_plan"] .sp-form-panel-head {
  padding-bottom: 4px;
  gap: 6px 10px;
}

#modal-new-form[data-welfare-mode="service_plan"] .sp-form-panel-title {
  font-size: 0.82rem;
}

#modal-new-form[data-welfare-mode="service_plan"] .sp-form-panel-sub {
  font-size: 0.68rem;
}

#modal-new-form[data-welfare-mode="service_plan"] .sp-form-sheet {
  display: none !important;
}

#modal-new-form[data-welfare-mode="service_plan"] #sp-equip-manager {
  flex: 1 1 auto;
  min-height: 0;
  margin: 0;
  padding: 6px 8px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

#modal-new-form[data-welfare-mode="service_plan"] .sp-equip-manager-head {
  margin-bottom: 4px;
  gap: 8px;
}

#modal-new-form[data-welfare-mode="service_plan"] .sp-equip-manager-title {
  font-size: 0.82rem;
}

#modal-new-form[data-welfare-mode="service_plan"] .sp-equip-manager-add-btn {
  padding: 4px 10px;
  font-size: 0.78rem;
  border-width: 1px;
}

#modal-new-form[data-welfare-mode="service_plan"] .sp-equip-manager-hint {
  display: none;
}

#modal-new-form[data-welfare-mode="service_plan"] .sp-equip-manager-list {
  gap: 6px;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
}

#modal-new-form[data-welfare-mode="service_plan"] .sp-equip-manager-card {
  padding: 6px 8px;
}

#modal-new-form[data-welfare-mode="service_plan"] .sp-equip-manager-grid,
#modal-new-form[data-welfare-mode="service_plan"] .sp-equip-manager-body {
  gap: 4px 8px;
}

#modal-new-form[data-welfare-mode="service_plan"] .sp-equip-mgr-field {
  font-size: 0.68rem;
}

#modal-new-form[data-welfare-mode="service_plan"] .sp-equip-mgr-field input,
#modal-new-form[data-welfare-mode="service_plan"] .sp-equip-mgr-field textarea {
  margin-top: 2px;
  padding: 4px 7px;
  font-size: 0.78rem;
  min-height: 28px;
}

#modal-new-form[data-welfare-mode="service_plan"] .sp-equip-mgr-field--reason textarea {
  min-height: 52px;
  max-height: 68px;
  line-height: 1.35;
}

#modal-new-form[data-welfare-mode="service_plan"] #sp-equip-manager .sp-equip-mgr-field input,
#modal-new-form[data-welfare-mode="service_plan"] #sp-equip-manager .sp-equip-mgr-field textarea {
  min-height: 28px !important;
}

#modal-new-form[data-welfare-mode="service_plan"] .sp-revision-edit-banner {
  padding: 6px 10px;
  margin: 0;
}

#modal-new-form[data-welfare-mode="service_plan"] .sp-revision-edit-banner-note {
  padding: 6px 10px;
  font-size: 0.78rem;
  line-height: 1.4;
}

#modal-new-form[data-welfare-mode="service_plan"] #modal-new-form-footer {
  padding: 10px 14px !important;
}

.btn-save-service-plan-draft {
  background: rgba(148, 163, 184, 0.12);
  border: 1px solid rgba(148, 163, 184, 0.45);
  color: #cbd5e1;
  padding: 10px 18px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.88rem;
  align-items: center;
  gap: 6px;
}

.btn-save-service-plan-draft:hover:not(:disabled) {
  background: rgba(148, 163, 184, 0.22);
  color: #e2e8f0;
}

.btn-save-service-plan-draft:disabled {
  opacity: 0.65;
  cursor: wait;
}

#modal-new-form[data-welfare-mode="service_plan"] > div > div:first-child {
  padding: 12px 14px !important;
}

#modal-new-form[data-welfare-mode="service_plan"] #modal-form-heading {
  font-size: 1.05rem !important;
}

#modal-new-form[data-welfare-mode="service_plan"] .sp-form-sheet {
  display: none !important;
}

/* 発注モード（CM→営業） */
#modal-new-form[data-welfare-mode="order"] #welfare-accordion-goals,
#modal-new-form[data-welfare-mode="order"] #welfare-step-service-plan,
#modal-new-form[data-welfare-mode="order"] #welfare-course-tabs,
#modal-new-form[data-welfare-mode="order"] #purpose-flex-container,
#modal-new-form[data-welfare-mode="order"] #btn-suggest-equipment {
  display: none !important;
}

#modal-new-form[data-welfare-mode="order"] #welfare-accordion-basic .welfare-accordion-head {
  pointer-events: none;
  opacity: 0.85;
}

#modal-new-form[data-welfare-mode="order"] #welfare-accordion-course .welfare-accordion-title {
  color: #6ee7b7;
}

.wf-landing-badge--order {
  background: rgba(16, 185, 129, 0.15);
  color: #6ee7b7;
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.wf-landing-badge--order-pulse {
  animation: wf-plan-recv-pulse 0.85s ease-in-out infinite;
}

.wf-landing-badge--order-sent {
  background: rgba(16, 185, 129, 0.12);
  color: #a7f3d0;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.wf-landing-task-hint--order {
  border-left-color: #34d399;
  background: rgba(16, 185, 129, 0.1);
}

.btn-create-cm-order--pulse,
.btn-open-order-sheet--pulse {
  animation: btn-plan-pdf-pulse 0.9s ease-in-out infinite;
}

@keyframes btn-create-order-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.45); }
  50% { box-shadow: 0 0 16px 2px rgba(16, 185, 129, 0.55); }
}

.btn-create-cm-order--pulse {
  animation: btn-create-order-pulse 0.9s ease-in-out infinite;
}

#modal-new-form .welfare-accordion.is-open #welfare-accordion-course-body {
  display: flex;
  flex-direction: column;
}

/* 福祉用具選定シート：利用者基本情報等 */
#modal-new-form #f-basic-info-list .f-basic-info-row span {
  font-size: calc(0.75rem) !important;
  font-weight: bold !important;
  color: #64748b !important;
}

#modal-new-form #f-basic-info-list input,
#modal-new-form #f-basic-info-list select {
  font-size: calc(0.75rem + 2pt) !important;
  font-weight: normal !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
}

#modal-new-form #f-purpose-extracted-label {
  font-size: calc(0.75rem + 4pt) !important;
  font-weight: bold !important;
  color: #94a3b8 !important;
  line-height: 1.2 !important;
  flex-shrink: 0;
  margin: 0;
}

#modal-new-form #f-right-column-header {
  flex-shrink: 0;
  line-height: 1.2;
}

#modal-new-form #welfare-step-basic #f-basic-info-panel {
  flex: none;
  min-height: auto !important;
}

#modal-new-form #f-basic-info-list.f-basic-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  overflow: visible;
  width: 100%;
}

#modal-new-form #f-basic-info-list .f-basic-info-col {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

#modal-new-form #f-basic-info-list .f-basic-info-col-left {
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

#modal-new-form #f-basic-info-list .f-basic-info-grid-empty {
  visibility: hidden;
  pointer-events: none;
  min-height: 36px !important;
  padding: 8px 12px !important;
  border-bottom: 1px solid transparent;
}

#modal-new-form #f-basic-info-list .f-basic-info-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px !important;
  min-height: 36px !important;
  line-height: 1.3 !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  box-sizing: border-box;
}

#modal-new-form #f-basic-info-list .f-basic-info-row-birth-oneline .f-basic-date-wrap {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
}

#modal-new-form #f-basic-info-list .f-basic-info-row-birth-oneline .f-basic-date-display {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: left !important;
}

#modal-new-form #f-basic-info-list .f-basic-info-row-birth-oneline {
  flex-wrap: nowrap;
}

#modal-new-form #f-basic-info-list .f-basic-info-lbl {
  font-size: 0.75rem;
  font-weight: bold;
  color: #94a3b8;
  white-space: nowrap;
  width: 5.5em;
  flex-shrink: 0;
}

#modal-new-form #f-basic-info-list .f-basic-info-row input,
#modal-new-form #f-basic-info-list .f-basic-info-row select,
#modal-new-form #f-basic-info-list .f-basic-info-row .f-basic-date-wrap {
  flex: 1;
  min-width: 0;
}

#modal-new-form #f-basic-info-list .f-basic-info-row input,
#modal-new-form #f-basic-info-list .f-basic-info-row select {
  background: transparent;
  border: none;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  font-size: calc(0.75rem + 2pt);
  font-weight: normal;
  outline: none;
  text-align: left;
  padding: 0;
  line-height: 1.3;
  min-height: 20px;
  width: 100%;
}

#modal-new-form #f-basic-info-list .f-basic-info-row select {
  cursor: pointer;
  text-align: left;
  text-align-last: left;
  appearance: auto;
  -webkit-appearance: menulist;
  color-scheme: dark;
  background-color: transparent !important;
}

#modal-new-form #f-basic-info-list .f-basic-info-row select option {
  color: #ffffff !important;
  background-color: #1e293b !important;
}

#modal-new-form #f-basic-info-list .f-basic-info-readonly input {
  cursor: default;
}

@media (max-width: 640px) {
  #modal-new-form #f-basic-info-list.f-basic-info-grid {
    grid-template-columns: 1fr;
  }
  #modal-new-form #f-basic-info-list .f-basic-info-col-left {
    border-right: none;
  }
  #modal-new-form #f-basic-info-list .f-basic-info-grid-empty {
    display: none;
  }
}

#modal-new-form #f-left-column,
#modal-new-form #f-right-column {
  align-items: stretch;
}

#modal-new-form #f-basic-info-panel,
#modal-new-form #f-purpose-extracted-panel {
  flex: 1 1 0;
  min-height: 320px;
  background: rgba(255, 255, 255, 0.04) !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  border-radius: 6px;
}

#modal-new-form #f-basic-info-list {
  overflow-y: visible;
}

#modal-new-form #f-basic-info-list input::placeholder,
#modal-new-form #f-purpose-extracted-panel textarea::placeholder {
  color: rgba(148, 163, 184, 0.28) !important;
  opacity: 1 !important;
}

#modal-new-form #f-user-gender:not(.is-empty),
#modal-new-form #f-care-level:not(.is-empty),
#modal-new-form #f-basic-info-list select.f-basic-select-filled {
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  opacity: 1 !important;
}

#modal-new-form #f-care-level:not(.is-empty) option,
#modal-new-form #f-care-level option:checked {
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  background: #1e293b;
}

#modal-new-form #f-basic-info-list select.is-empty {
  color: rgba(148, 163, 184, 0.28) !important;
  -webkit-text-fill-color: rgba(148, 163, 184, 0.28) !important;
}

#modal-new-form #f-basic-info-list select:not(.is-empty),
#modal-new-form #f-basic-info-list select:not(.is-empty) option {
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
}

#modal-new-form #f-user-gender:not(.is-empty),
#modal-new-form #f-care-level:not(.is-empty) {
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
}

/* ② 目標設定 */
#modal-new-form .f-goals-panel {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  overflow: hidden;
  transition: border-color 0.2s;
}

#modal-new-form .f-goals-sample-bar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  padding: 8px 12px 4px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

#modal-new-form #f-goals-sample-buttons {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
  align-items: center;
}

#modal-new-form .f-goals-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

#modal-new-form .f-goals-row:last-child {
  border-bottom: none;
}

#modal-new-form .f-goals-lbl {
  font-size: 0.75rem;
  font-weight: bold;
  color: #94a3b8;
  white-space: nowrap;
  min-width: 6.5em;
  flex-shrink: 0;
  padding-top: 6px;
}

#modal-new-form .f-goals-input {
  flex: 1;
  min-width: 0;
  min-height: 64px;
  background: rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  color: #f1f5f9;
  font-size: 0.78rem;
  line-height: 1.55;
  padding: 8px 10px;
  resize: vertical;
  font-family: inherit;
  box-sizing: border-box;
}

#modal-new-form .f-goals-input::placeholder {
  color: rgba(148, 163, 184, 0.35);
}

#modal-new-form #f-basic-info-list input[readonly]::placeholder {
  color: rgba(148, 163, 184, 0.28) !important;
  opacity: 1 !important;
}

#modal-new-form #f-basic-info-list input[readonly]:not(:placeholder-shown) {
  color: #f1f5f9 !important;
}

#modal-new-form #f-basic-info-list input,
#modal-new-form #f-basic-info-list select {
  min-height: 20px;
}

#modal-new-form #f-basic-info-list .f-basic-date-wrap {
  position: relative;
  min-height: 22px;
  cursor: pointer;
}

#modal-new-form #f-basic-info-list .f-basic-date-display {
  position: relative;
  z-index: 1;
  width: 100%;
  font-size: calc(0.75rem + 2pt) !important;
  font-weight: normal !important;
  line-height: 1.3 !important;
}

#modal-new-form #f-basic-info-list .f-basic-date-display.is-empty {
  color: rgba(148, 163, 184, 0.35) !important;
}

#modal-new-form #f-basic-info-list .f-basic-date-display:not(.is-empty) {
  color: #f1f5f9 !important;
}

#modal-new-form #f-basic-info-list input[type="date"].f-basic-date-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
  opacity: 0;
  pointer-events: none;
}

#modal-new-form .f-basic-date-wrap {
  position: relative;
  display: flex;
  align-items: center;
  gap: 4px;
  min-height: 22px;
}

#modal-new-form .f-basic-date-display {
  flex: 1;
  min-width: 0;
  font-size: calc(0.75rem + 2pt) !important;
  font-weight: normal !important;
  line-height: 1.3 !important;
  ime-mode: active;
}

#modal-new-form .f-basic-date-display.is-empty {
  color: rgba(148, 163, 184, 0.35) !important;
}

#modal-new-form .f-basic-date-display:not(.is-empty) {
  color: #f1f5f9 !important;
}

#modal-new-form .f-basic-date-cal-btn {
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 4px;
  color: #cbd5e1;
  font-size: 0.72rem;
  line-height: 1;
  padding: 2px 5px;
  cursor: pointer;
}

#modal-new-form .f-basic-date-cal-btn:hover {
  background: rgba(59, 130, 246, 0.2);
  border-color: rgba(59, 130, 246, 0.4);
}

#modal-new-form input[type="date"].f-basic-date-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
  opacity: 0;
  pointer-events: none;
}

.sp-form-consent .sp-delivery-date-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0 12px;
}

.sp-form-consent .f-basic-date-wrap {
  min-width: 118px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 4px;
  padding: 2px 6px;
}

.sp-form-consent .f-basic-date-display {
  text-align: left !important;
  color: #e2e8f0 !important;
}

.sp-form-sheet textarea,
.sp-form-sheet input[type="text"],
.sp-form-sheet .sp-footer-input {
  ime-mode: active;
  box-sizing: border-box !important;
  max-width: 100% !important;
  margin: 0 !important;
  text-indent: 0 !important;
  overflow-x: auto !important;
  overflow-y: auto !important;
  scroll-padding-left: 8px;
  scroll-padding-right: 8px;
}

.sp-form-sheet textarea {
  padding: 8px 12px !important;
  min-width: 0;
  word-break: break-word;
}

.sp-form-sheet .sp-plan-equip .sp-cell-edit textarea,
.sp-form-sheet .sp-plan-needs .sp-cell-edit textarea {
  padding-left: 12px !important;
  padding-right: 12px !important;
  overflow-x: visible !important;
}

.sp-form-sheet input[type="text"],
.sp-form-sheet .sp-footer-input {
  padding-left: 10px !important;
  padding-right: 10px !important;
  min-width: 0;
}

/* 福祉用具 工程線図 */
.wf-line-diagram {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.wf-line-diagram--circles {
  display: flex;
  align-items: flex-end;
  width: 100%;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

.wf-circle-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  min-width: 0;
}

.wf-circle-label {
  font-size: 0.62rem;
  color: #94a3b8;
  margin-bottom: 5px;
  white-space: nowrap;
  line-height: 1.2;
  text-align: center;
  letter-spacing: -0.02em;
  min-height: 1.2em;
}

.wf-circle-node:has(.wf-circle-dot.wf-circle--current) .wf-circle-label {
  color: #fca5a5;
  font-weight: 700;
}

.wf-circle-node:has(.wf-circle-dot.wf-circle--done) .wf-circle-label {
  color: #6ee7b7;
}

.wf-circle-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  box-sizing: border-box;
  flex-shrink: 0;
}

.wf-circle-dot.wf-circle--future {
  background: rgba(255, 255, 255, 0.95);
  border: 2px solid #334155;
}

.wf-circle-dot.wf-circle--done {
  background: #34d399;
  border: 2px solid #34d399;
}

.wf-circle-dot.wf-circle--current {
  background: #ef4444;
  border: 2px solid #ef4444;
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.35);
}

@keyframes wf-urgent-pulse {
  0%, 100% {
    background: #ef4444;
    border-color: #ef4444;
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.55), 0 0 10px rgba(239, 68, 68, 0.75);
    transform: scale(1);
  }
  50% {
    background: #fca5a5;
    border-color: #fca5a5;
    box-shadow: 0 0 0 5px rgba(239, 68, 68, 0.45), 0 0 18px rgba(239, 68, 68, 1);
    transform: scale(1.2);
  }
}

.wf-circle-dot.wf-circle--urgent {
  animation: wf-urgent-pulse 0.75s ease-in-out infinite;
}

.wf-circle-dot.wf-circle--wait {
  background: transparent;
  border: 2px dashed #64748b;
  box-shadow: none;
}

.wf-circle-dot.wf-circle--here {
  background: #3b82f6;
  border: 2px solid #3b82f6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.35);
}

@keyframes wf-action-pulse {
  0%, 100% {
    background: #f59e0b;
    border-color: #f59e0b;
    box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.55), 0 0 10px rgba(245, 158, 11, 0.65);
    transform: scale(1);
  }
  50% {
    background: #fcd34d;
    border-color: #fcd34d;
    box-shadow: 0 0 0 5px rgba(245, 158, 11, 0.35), 0 0 16px rgba(245, 158, 11, 0.85);
    transform: scale(1.15);
  }
}

.wf-circle-dot.wf-circle--action {
  animation: wf-action-pulse 0.75s ease-in-out infinite;
  background: #f59e0b;
  border: 2px solid #f59e0b;
}

.wf-circle-node:has(.wf-circle-dot.wf-circle--action) .wf-circle-label,
.wf-mini-step:has(.wf-circle-dot.wf-circle--action) .wf-circle-label {
  color: #fcd34d;
  font-weight: 700;
  animation: wf-label-action 0.75s ease-in-out infinite;
}

.wf-circle-node:has(.wf-circle-dot.wf-circle--here) .wf-circle-label,
.wf-mini-step:has(.wf-circle-dot.wf-circle--here) .wf-circle-label {
  color: #93c5fd;
  font-weight: 600;
}

@keyframes wf-label-action {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

.wf-circle-node:has(.wf-circle-dot.wf-circle--urgent) .wf-circle-label,
.wf-mini-step:has(.wf-circle-dot.wf-circle--urgent) .wf-circle-label {
  color: #fca5a5;
  font-weight: 700;
  animation: wf-label-urgent 0.75s ease-in-out infinite;
}

.wf-circle-node:has(.wf-circle-dot.wf-circle--wait) .wf-circle-label,
.wf-mini-step:has(.wf-circle-dot.wf-circle--wait) .wf-circle-label {
  color: #94a3b8;
  font-weight: 600;
}

@keyframes wf-label-urgent {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}

@keyframes btn-plan-create-pulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(168, 85, 247, 0.65);
    background: rgba(168, 85, 247, 0.2);
  }
  50% {
    box-shadow: 0 0 0 7px rgba(168, 85, 247, 0);
    background: rgba(168, 85, 247, 0.38);
  }
}

.btn-create-service-plan--pulse {
  animation: btn-plan-create-pulse 1.1s ease-in-out infinite;
}

@keyframes btn-send-plan-pulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.75);
    background: rgba(245, 158, 11, 0.28);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(245, 158, 11, 0);
    background: rgba(245, 158, 11, 0.48);
  }
}

.btn-send-service-plan--pulse {
  animation: btn-send-plan-pulse 0.95s ease-in-out infinite;
}

.wf-landing-task-hint {
  margin: 0 0 8px 0;
  padding: 6px 10px;
  background: rgba(168, 85, 247, 0.08);
  border-left: 3px solid rgba(168, 85, 247, 0.55);
  border-radius: 0 4px 4px 0;
}

.wf-landing-task-hint--wait {
  border-left-color: #34d399;
  background: rgba(16, 185, 129, 0.08);
}

.wf-landing-task-hint--wait strong {
  color: #6ee7b7;
}

.wf-landing-task-hint--recv {
  border-left-color: #34d399;
  background: rgba(16, 185, 129, 0.08);
}

.wf-landing-task-hint--recv strong {
  color: #6ee7b7;
}

.wf-landing-task-hint--revision {
  border-left-color: #f59e0b;
  background: rgba(245, 158, 11, 0.14);
  color: #fde68a;
}

.wf-landing-task-hint--revision strong {
  color: #fcd34d;
}

.wf-landing-task-hint--revision.wf-landing-task-hint--revision-solo {
  padding: 0;
  margin: 0 0 4px 0;
  background: transparent;
  border-left: none;
  border-radius: 0;
}

.wf-landing-task-hint--revision.wf-landing-task-hint--revision-solo .wf-revision-request-note {
  margin-top: 0;
  padding: 6px 10px;
}

.wf-landing-task-hint--revision.wf-landing-task-hint--revision-solo .wf-revision-request-note-label {
  margin-bottom: 4px;
  padding: 1px 6px;
  font-size: 0.65rem;
}

.wf-landing-task-hint--revision.wf-landing-task-hint--revision-solo .wf-revision-request-note-text {
  font-size: 0.82rem;
  line-height: 1.45;
}

.wf-revision-request-note {
  margin-top: 8px;
  padding: 10px 12px;
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid rgba(251, 191, 36, 0.55);
  border-radius: 6px;
}

.wf-revision-request-note-label {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #1e293b;
  background: #fcd34d;
  border-radius: 4px;
  padding: 2px 8px;
  margin-bottom: 6px;
}

.wf-revision-request-note-text {
  margin: 0;
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.55;
  color: #fffbeb;
  white-space: pre-wrap;
  word-break: break-word;
}

.wf-landing-task-hint--revision.wf-landing-task-hint--pulse {
  animation: wf-revision-hint-pulse 1.1s ease-in-out infinite;
}

@keyframes wf-revision-hint-pulse {
  0%, 100% {
    border-left-color: #f59e0b;
    background: rgba(245, 158, 11, 0.14);
    box-shadow: none;
  }
  50% {
    border-left-color: #fcd34d;
    background: rgba(245, 158, 11, 0.22);
    box-shadow: 0 0 0 1px rgba(251, 191, 36, 0.25);
  }
}

.wf-circle-seg {
  flex: 1;
  height: 2px;
  background: #334155;
  margin-bottom: 5px;
  min-width: 8px;
}

.wf-circle-seg.wf-circle-seg--done {
  background: #34d399;
}

.wf-line-diagram--mini {
  width: auto;
  min-width: 0;
  flex-shrink: 0;
  overflow: visible;
  background: transparent;
}

.wf-line-diagram--mini.wf-line-diagram {
  overflow: visible;
}

.wf-mini-track {
  display: flex;
  align-items: flex-end;
  width: 100%;
  min-width: 0;
  background: transparent;
}

.wf-mini-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 0 0 auto;
  position: relative;
  z-index: 1;
  gap: 2px;
  background: transparent;
}

.wf-line-diagram--mini .wf-circle-label {
  position: static;
  transform: none;
  font-size: 0.62rem;
  margin: 0;
  line-height: 1.1;
  white-space: nowrap;
  text-align: center;
}

.wf-mini-step--first .wf-circle-label {
  text-align: left;
  align-self: flex-start;
}

.wf-mini-step--last .wf-circle-label {
  text-align: right;
  align-self: flex-end;
}

.wf-mini-seg {
  flex: 1 1 auto;
  min-width: 10px;
  height: 2px;
  background: transparent;
  margin: 0 -5px 4px;
  z-index: 0;
  flex-shrink: 1;
  align-self: flex-end;
}

.wf-mini-seg.wf-mini-seg--done {
  background: #34d399;
}

.wf-mini-seg.wf-mini-seg--recv {
  background: #ef4444;
}

.wf-mini-seg.wf-mini-seg--action {
  background: linear-gradient(90deg, #34d399 0%, #f59e0b 100%);
}

.wf-line-diagram--status .wf-mini-step {
  gap: 1px;
}

.wf-step-status {
  font-size: 0.52rem;
  line-height: 1.1;
  white-space: nowrap;
  letter-spacing: -0.02em;
}

.wf-step-status--done { color: #6ee7b7; }
.wf-step-status--here { color: #93c5fd; font-weight: 600; }
.wf-step-status--action { color: #fcd34d; font-weight: 700; }
.wf-step-status--wait { color: #94a3b8; }
.wf-step-status--future { color: #64748b; }

.wf-step-action-hint {
  font-size: 0.52rem;
  line-height: 1.1;
  color: #fcd34d;
  font-weight: 700;
  white-space: nowrap;
  letter-spacing: -0.02em;
}

.wf-step-wait-hint {
  font-size: 0.52rem;
  line-height: 1.1;
  color: #94a3b8;
  white-space: nowrap;
}

.wf-step-done-mark {
  color: #6ee7b7;
  font-size: 0.58rem;
  margin-right: 1px;
}

.wf-diagram-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  font-size: 0.58rem;
  color: #94a3b8;
  justify-content: flex-start;
  align-items: center;
}

.wf-legend-item--done { color: #6ee7b7; }
.wf-legend-item--here { color: #93c5fd; }
.wf-legend-item--action { color: #fcd34d; }
.wf-legend-item--wait { color: #94a3b8; }
.wf-legend-item--future { color: #64748b; }

.wf-landing-wf-legend {
  margin: 0 0 10px 0;
  padding: 6px 8px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 6px;
}

.wf-landing-diagram-wrap .wf-step-status,
.wf-landing-diagram-wrap .wf-step-action-hint,
.wf-landing-diagram-wrap .wf-step-wait-hint {
  font-size: 0.48rem;
}

.wf-line-diagram--mini .wf-circle-dot.wf-circle--action {
  width: 12px;
  height: 12px;
}

.wf-circle-dot.wf-circle--recv {
  background: #ef4444;
  border: 2px solid #ef4444;
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.35);
}

.wf-mini-step:has(.wf-circle-dot.wf-circle--recv) .wf-circle-label {
  color: #fca5a5;
  font-weight: 700;
}

.wf-line-diagram--mini .wf-circle-dot {
  width: 10px;
  height: 10px;
  position: relative;
  z-index: 1;
}

.wf-line-diagram--mini .wf-circle-dot.wf-circle--current {
  box-shadow: 0 0 0 1px rgba(239, 68, 68, 0.35);
}

.wf-line-diagram--mini .wf-circle-dot.wf-circle--urgent {
  width: 12px;
  height: 12px;
}

.wf-line-diagram--mini .wf-circle-node:has(.wf-circle-dot.wf-circle--current) .wf-circle-label,
.wf-mini-step:has(.wf-circle-dot.wf-circle--current) .wf-circle-label {
  color: #fca5a5;
  font-weight: 700;
}

.wf-line-diagram--mini .wf-circle-node:has(.wf-circle-dot.wf-circle--done) .wf-circle-label,
.wf-mini-step:has(.wf-circle-dot.wf-circle--done) .wf-circle-label {
  color: #6ee7b7;
}

.wf-landing-icon-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
}

.wf-landing-report-icon {
  position: relative;
  width: 72px;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.wf-landing-report-icon__doc {
  width: 46px;
  height: 56px;
  border-radius: 8px;
  background: linear-gradient(160deg, #e2e8f0 0%, #cbd5e1 100%);
  border: 2px solid rgba(148, 163, 184, 0.55);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.35);
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 12px 10px;
  box-sizing: border-box;
}

.wf-landing-report-icon__line {
  display: block;
  height: 4px;
  border-radius: 999px;
  background: rgba(100, 116, 139, 0.55);
}

.wf-landing-report-icon__line--short {
  width: 62%;
}

.wf-landing-report-icon__send {
  position: absolute;
  right: -2px;
  bottom: 4px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.45);
  transform: rotate(-28deg);
}

#equipment-selection-landing.equipment-landing--compact {
  min-height: 0;
  padding: 12px 20px 16px;
  align-items: stretch;
}

#equipment-selection-landing.equipment-landing--compact [data-landing-icon] {
  display: none !important;
}

#equipment-selection-landing.equipment-landing--compact [data-landing-create-wrap] {
  text-align: left;
}

#equipment-selection-landing.equipment-landing--compact #btn-equipment-landing-start,
#equipment-selection-landing.equipment-landing--compact .equipment-landing-create-btn {
  margin-bottom: 0 !important;
}

.equipment-landing-sections {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.equipment-landing-section {
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 12px 14px;
}

.equipment-landing-section--create {
  text-align: left;
}

.equipment-landing-section-title {
  margin: 0 0 10px;
  font-size: 0.82rem;
  font-weight: 700;
  color: #94a3b8;
  letter-spacing: 0.02em;
}

.equipment-landing-create-btn {
  background: rgba(59, 130, 246, 0.25);
  border: 1px solid rgba(59, 130, 246, 0.55);
  color: #bfdbfe;
  padding: 10px 24px;
  border-radius: 8px;
  font-weight: bold;
  cursor: pointer;
  font-size: 0.95rem;
  width: 100%;
  box-sizing: border-box;
}

.equipment-landing-create-btn:hover {
  background: rgba(59, 130, 246, 0.38);
}

.equipment-landing-section--existing {
  text-align: left;
}

.equipment-landing-existing-hint {
  margin: 0 0 10px;
  font-size: 0.78rem;
  color: #94a3b8;
  line-height: 1.55;
}

.equipment-existing-user-search {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(15, 23, 42, 0.55);
  color: #e2e8f0;
  font-size: 0.92rem;
}

.equipment-existing-user-search:focus {
  outline: none;
  border-color: rgba(59, 130, 246, 0.55);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
}

.equipment-existing-user-results {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 220px;
  overflow-y: auto;
}

.equipment-existing-user-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(15, 23, 42, 0.45);
  color: #e2e8f0;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.equipment-existing-user-item:hover {
  background: rgba(59, 130, 246, 0.12);
  border-color: rgba(59, 130, 246, 0.35);
}

.equipment-existing-user-item-name {
  font-size: 0.92rem;
  font-weight: 700;
  color: #f1f5f9;
}

.equipment-existing-user-item-meta {
  font-size: 0.75rem;
  color: #94a3b8;
}

.equipment-existing-user-empty,
.equipment-existing-user-loading {
  padding: 10px 4px;
  font-size: 0.8rem;
  color: #94a3b8;
  text-align: center;
}

.equipment-landing-list-head {
  margin-bottom: 8px;
}

.equipment-landing-period-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin-bottom: 8px;
  padding: 8px 10px;
  background: rgba(15, 23, 42, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
}

.equipment-landing-period-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  color: #94a3b8;
}

.equipment-landing-period-select,
.equipment-landing-period-year {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #e2e8f0;
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 0.78rem;
}

.equipment-landing-period-year {
  width: 72px;
}

.equipment-landing-period-month-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.equipment-landing-period-count {
  margin-left: auto;
  font-size: 0.72rem;
  color: #64748b;
}

.equipment-landing-received-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.equipment-landing-empty {
  color: #64748b;
  font-size: 0.88rem;
  margin: 0;
  padding: 8px 4px;
}

.equipment-landing-new-link {
  display: none;
  margin-top: 12px;
  background: transparent;
  border: 1px solid rgba(59, 130, 246, 0.45);
  color: #93c5fd;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: bold;
  cursor: pointer;
}

.wf-landing-card-actions-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-shrink: 0;
  min-width: 0;
}

.wf-landing-card-actions--primary,
.wf-landing-card-actions--secondary {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.wf-landing-actions-label {
  flex: 0 0 auto;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 2px 6px;
  border-radius: 4px;
  white-space: nowrap;
}

.wf-landing-card-actions--primary .wf-landing-actions-label {
  color: #fcd34d;
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.35);
}

.wf-landing-card-actions--secondary .wf-landing-actions-label {
  color: #93c5fd;
  background: rgba(59, 130, 246, 0.12);
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.wf-landing-card-actions-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  align-items: center;
}

.wf-landing-card {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 6px 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  text-align: left;
}

.wf-landing-card-row1 {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 8px;
  min-width: 0;
  min-height: 0;
  line-height: 1.15;
}

.wf-landing-card-row2 {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px 8px;
  min-width: 0;
  min-height: 0;
  line-height: 1.15;
}

.wf-landing-diagram-wrap {
  flex: 0 0 100%;
  width: 100%;
  min-width: 0;
  padding: 0 0 2px;
  overflow: visible;
  background: transparent;
}

.wf-landing-row1-meta {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 8px;
  min-width: 0;
}

.wf-landing-row1-info {
  flex: 0 1 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 3px 6px;
  line-height: 1.15;
  min-width: 0;
}

.wf-landing-meta-name {
  color: #f1f5f9;
  font-weight: 700;
  font-size: 0.82rem;
  white-space: nowrap;
  flex: 0 0 auto;
  flex-shrink: 0;
}

.wf-landing-diagram-wrap .wf-mini-track {
  padding: 0 4px;
  box-sizing: border-box;
  justify-content: space-between;
}

.wf-landing-diagram-wrap .wf-line-diagram--mini {
  width: 100%;
  overflow: visible;
}

.wf-landing-diagram-wrap .wf-mini-step {
  flex: 1 1 0;
  min-width: 0;
}

.wf-landing-diagram-wrap .wf-mini-step--first,
.wf-landing-diagram-wrap .wf-mini-step--last {
  flex: 0 0 auto;
}

.wf-landing-step-hint {
  font-size: 0.66rem;
  color: #fca5a5;
  font-weight: 700;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 4px;
  padding: 1px 5px;
  white-space: nowrap;
}

.wf-landing-row2-detail {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.wf-landing-equip-inline {
  font-size: 0.72rem;
  color: #94a3b8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
  min-width: 0;
  line-height: 1.15;
}

.wf-landing-card-top {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
}

.wf-landing-top-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.wf-landing-top-btn {
  flex-shrink: 0;
  cursor: pointer;
  border-radius: 6px;
  font-weight: 700;
  line-height: 1;
  transition: background 0.2s;
  font-family: inherit;
}

.wf-landing-top-btn--done {
  padding: 3px 6px;
  font-size: 0.64rem;
  white-space: nowrap;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #6ee7b7;
}

.wf-landing-top-btn--done:hover {
  background: rgba(16, 185, 129, 0.28);
}

.wf-landing-top-btn--del {
  width: 22px;
  height: 22px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #f87171;
}

.wf-landing-top-btn--del:hover {
  background: rgba(239, 68, 68, 0.28);
}

.wf-landing-card-body {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.wf-landing-badge {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  white-space: nowrap;
}

.wf-landing-badge--recv {
  background: rgba(16, 185, 129, 0.15);
  color: #6ee7b7;
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.wf-landing-badge--sent {
  background: rgba(59, 130, 246, 0.15);
  color: #93c5fd;
  border: 1px solid rgba(59, 130, 246, 0.35);
}

.wf-landing-badge--sel {
  background: rgba(59, 130, 246, 0.12);
  color: #bfdbfe;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.wf-landing-badge--plan {
  background: rgba(168, 85, 247, 0.15);
  color: #ddd6fe;
  border: 1px solid rgba(168, 85, 247, 0.35);
}

.wf-landing-badge--plan-pulse {
  animation: wf-plan-recv-pulse 0.85s ease-in-out infinite;
  box-shadow: 0 0 0 0 rgba(168, 85, 247, 0.55);
}

@keyframes wf-plan-recv-pulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(168, 85, 247, 0.55);
  }
  50% {
    transform: scale(1.06);
    box-shadow: 0 0 14px 3px rgba(168, 85, 247, 0.45);
  }
}

.wf-landing-task-hint--pulse {
  animation: wf-plan-hint-pulse 1.1s ease-in-out infinite;
}

@keyframes wf-plan-hint-pulse {
  0%, 100% { border-left-color: #34d399; background: rgba(16, 185, 129, 0.08); }
  50% { border-left-color: #6ee7b7; background: rgba(16, 185, 129, 0.18); }
}

.wf-landing-card--plan-unread {
  box-shadow: 0 0 0 1px rgba(168, 85, 247, 0.35), 0 0 18px rgba(168, 85, 247, 0.12);
}

.btn-open-service-plan-pdf--pulse {
  animation: btn-plan-pdf-pulse 0.9s ease-in-out infinite;
}

@keyframes btn-plan-pdf-pulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(168, 85, 247, 0.45);
    border-color: rgba(168, 85, 247, 0.5);
  }
  50% {
    box-shadow: 0 0 16px 2px rgba(168, 85, 247, 0.55);
    border-color: rgba(216, 180, 254, 0.85);
  }
}

.wf-landing-meta-date {
  color: #94a3b8;
  font-size: 0.72rem;
  white-space: nowrap;
}

.wf-landing-equip {
  font-size: 0.8rem;
  color: #cbd5e1;
  line-height: 1.45;
  word-break: break-word;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.wf-landing-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 6px;
}

.wf-landing-meta-chip {
  font-size: 0.68rem;
  color: #94a3b8;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  padding: 2px 6px;
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wf-landing-status-hint {
  font-size: 0.72rem;
  color: #64748b;
  line-height: 1.35;
}

.wf-landing-status-hint strong {
  color: #bfdbfe;
  font-weight: 600;
}

.wf-landing-meta {
  flex: 1;
  min-width: 0;
  font-size: 0.82rem;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #cbd5e1;
}

.wf-landing-meta-sep {
  color: #475569;
  margin: 0 5px;
}

.wf-landing-meta-content {
  color: #cbd5e1;
}

.wf-landing-card-actions {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
  flex-wrap: wrap;
  justify-content: flex-end;
  max-width: 100%;
}

@media (max-width: 640px) {
  .wf-line-diagram {
    min-width: 0;
  }

  .wf-line-diagram--circles {
    min-width: 0;
  }

  .wf-landing-card-row1 {
    flex-wrap: nowrap;
  }

  .wf-landing-card-row2 {
    flex-wrap: wrap;
  }

  .wf-landing-row2-detail {
    flex-basis: 100%;
    max-width: 100%;
  }

  .wf-landing-card-actions {
    flex-basis: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .wf-landing-card-top {
    flex-wrap: nowrap;
  }

  .wf-landing-card-body {
    flex-wrap: wrap;
  }

  .wf-landing-info {
    flex-basis: 100%;
  }

  .wf-landing-meta {
    flex-basis: 100%;
  }
}

/* 福祉用具サービス計画書フォーム（PDF書式） */
.sp-form-panel {
  overflow-x: auto;
}

.sp-form-sheet {
  --sp-font-size: calc(0.78rem - 1pt);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  padding: 12px;
  min-width: 640px;
  font-size: var(--sp-font-size);
}

.sp-form-sheet .sp-form-title,
.sp-form-sheet .sp-form-table th,
.sp-form-sheet .sp-form-table td,
.sp-form-sheet .sp-col-head,
.sp-form-sheet .sp-col-sub,
.sp-form-sheet .sp-section-head,
.sp-form-sheet .sp-row-num,
.sp-form-sheet .sp-mgmt-no,
.sp-form-sheet .sp-equip-detail-grid label,
.sp-form-sheet .sp-equip-photo-marker,
.sp-form-sheet .sp-form-consent,
.sp-form-sheet .sp-form-footer,
.sp-form-sheet .sp-form-footer label,
.sp-form-sheet textarea,
.sp-form-sheet input[type="text"],
.sp-form-sheet .sp-footer-input,
.sp-form-sheet .f-basic-date-display,
.sp-form-sheet td[id^="sp-preview-"] {
  font-size: var(--sp-font-size) !important;
}

.sp-form-title {
  text-align: center;
  font-weight: 700;
  letter-spacing: 2px;
  color: #e2e8f0;
  padding: 8px 0 12px;
  border-bottom: 2px solid rgba(255, 255, 255, 0.2);
  margin-bottom: 0;
}

.sp-form-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.sp-form-table th,
.sp-form-table td {
  border: 1px solid rgba(255, 255, 255, 0.18);
  padding: 6px 8px;
  vertical-align: top;
  color: #cbd5e1;
}

.sp-form-table th {
  background: rgba(255, 255, 255, 0.06);
  font-weight: 700;
  text-align: center;
  white-space: nowrap;
}

.sp-form-basic td[id^="sp-preview-"] {
  color: #ffffff;
  min-height: 1.2em;
  word-break: break-word;
}

.sp-form-basic #sp-preview-care {
  color: #ffffff !important;
  font-weight: 600;
}

.sp-form-basic .sp-basic-col {
  width: 12.5%;
}

.sp-form-basic #sp-preview-cert-start,
.sp-form-basic #sp-preview-cert-end {
  min-width: 0;
}

.sp-col-head {
  line-height: 1.35;
}

.sp-sub-label {
  font-weight: 700;
  color: #94a3b8;
  padding: 4px 0 2px;
  border: none !important;
  background: transparent !important;
}

.sp-cell-edit {
  padding: 4px 6px !important;
  overflow: visible !important;
  min-width: 0;
}

.sp-form-sheet .sp-form-table td {
  overflow: visible;
  min-width: 0;
}

.sp-form-title-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 2px solid rgba(255, 255, 255, 0.2);
  margin-bottom: 0;
}

.sp-form-title-row .sp-form-title {
  border-bottom: none;
  padding-bottom: 0;
  margin-bottom: 0;
  text-align: left;
  flex: 1;
}

.sp-mgmt-no {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #94a3b8;
  white-space: nowrap;
}

.sp-plan-header td[id^="sp-preview-"] {
  color: #ffffff;
}

.sp-plan-header #sp-preview-care {
  color: #ffffff !important;
  font-weight: 600;
}

.sp-plan-header #sp-preview-kyotaku,
.sp-plan-header #sp-preview-cm-manager {
  word-break: break-word;
}

.sp-col-sub {
  font-weight: normal;
  color: #94a3b8;
}

.sp-section-head {
  text-align: center !important;
  letter-spacing: 1px;
}

.sp-row-num {
  text-align: center !important;
  width: 5%;
}

.sp-equip-photo-cell {
  width: 12%;
  padding: 4px 6px !important;
  vertical-align: stretch;
}

.sp-equip-photo-box {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: stretch;
  min-height: 96px;
  height: 100%;
  background: rgba(0, 0, 0, 0.28);
  border-radius: 4px;
  overflow: hidden;
  cursor: pointer;
}

.sp-equip-photo-marker {
  position: absolute;
  top: 6px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.85);
  line-height: 1;
  pointer-events: none;
}

.sp-equip-photo-img {
  flex: 1 1 auto;
  width: 100%;
  height: 100%;
  min-height: 0;
  max-height: none;
  object-fit: contain;
  object-position: center;
  display: block;
  background: #fff;
}

.sp-equip-photo-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1 1 auto;
  width: 100%;
  min-height: 0;
  font-size: 2rem;
  opacity: 0.55;
}

.sp-equip-row--applied {
  animation: sp-equip-row-flash 1.2s ease-out;
}

@keyframes sp-equip-row-flash {
  0% { background: rgba(52, 211, 153, 0.28); }
  100% { background: transparent; }
}

.sp-equip-apply-toast {
  position: absolute;
  bottom: 6px;
  left: 50%;
  transform: translateX(-50%) translateY(6px);
  z-index: 4;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.92);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.sp-equip-apply-toast--show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.sp-product-picker-select--done {
  background: rgba(16, 185, 129, 0.35) !important;
  border-color: rgba(52, 211, 153, 0.55) !important;
  color: #6ee7b7 !important;
}

.sp-equip-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 42%);
  grid-template-rows: auto auto;
  gap: 4px;
  align-items: stretch;
  min-height: 88px;
}

.sp-equip-detail-grid label {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: calc(0.72rem - 1pt);
  color: #94a3b8;
  min-width: 0;
}

.sp-equip-field-item {
  min-width: 0;
}

.sp-equip-row-head {
  grid-column: 1;
  grid-row: 1;
  display: flex;
  align-items: flex-end;
  gap: 8px;
  min-width: 0;
}

.sp-equip-row-head .sp-equip-field-item {
  flex: 1 1 auto;
  min-width: 0;
}

.sp-equip-row2 {
  grid-column: 1;
  grid-row: 2;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 72px;
  gap: 4px;
  align-items: stretch;
  min-width: 0;
}

.sp-equip-field-units {
  max-width: 96px;
}

.sp-equip-field-reason {
  grid-column: 2;
  grid-row: 1 / 3;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.sp-plan-equip .sp-equip-detail {
  vertical-align: stretch;
  padding: 4px 6px !important;
}

/* 選定理由：品目行と同じ高さから開始し、2行分を占有 */
.sp-plan-equip tbody td {
  vertical-align: stretch;
}

.sp-plan-equip .sp-equip-reason-input {
  flex: 1 1 auto;
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
  resize: none;
  margin: 0;
  box-sizing: border-box;
  background: rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 4px;
  color: #e2e8f0;
  font-size: calc(0.78rem - 1pt);
  line-height: 1.55;
  padding: 8px 12px;
  font-family: inherit;
  overflow-y: auto;
}

.sp-equip-item-input {
  cursor: text;
}

.sp-equip-item-input:focus {
  border-color: rgba(59, 130, 246, 0.55) !important;
  box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.25);
}

.sp-form-panel-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  flex-shrink: 0;
  position: relative;
  z-index: 12;
}

.sp-form-panel-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: #c4b5fd;
  margin: 0;
  flex: 1 1 auto;
  min-width: 180px;
}

.sp-form-panel-sub {
  font-size: 0.72rem;
  color: #64748b;
  flex: 0 0 auto;
}

.sp-equip-toolbar--header {
  flex: 1 1 100%;
  order: 3;
}

.sp-equip-active-dock {
  flex: 1 1 100%;
  width: 100%;
  order: 4;
  flex-shrink: 0;
  margin: 4px 0 0;
  padding: 14px 16px;
  border-radius: 10px;
  background: rgba(16, 185, 129, 0.14);
  border: 2px solid rgba(16, 185, 129, 0.85);
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.18);
  min-height: 220px;
  box-sizing: border-box;
}

.sp-equip-active-dock.is-open {
  display: block !important;
  visibility: visible !important;
}

.sp-equip-active-dock--open {
  animation: sp-equip-dock-open 0.35s ease;
}

@keyframes sp-equip-dock-open {
  from { opacity: 0.5; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.sp-equip-active-dock-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
  color: #ecfdf5;
  font-size: 0.92rem;
}

.sp-equip-active-dock-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.sp-equip-dock-btn {
  background: rgba(16, 185, 129, 0.25);
  border: 1px solid rgba(16, 185, 129, 0.5);
  color: #ecfdf5;
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
}

.sp-equip-dock-btn--ghost {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.25);
  color: #cbd5e1;
}

.sp-equip-dock-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 12px;
}

.sp-equip-dock-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  color: #94a3b8;
}

.sp-equip-dock-field input,
.sp-equip-dock-field textarea {
  width: 100%;
  box-sizing: border-box;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 6px;
  color: #f1f5f9;
  padding: 8px 10px;
  font-size: 0.85rem;
  font-family: inherit;
}

.sp-equip-dock-field--reason {
  grid-column: 1 / -1;
}

.sp-equip-dock-field--reason textarea {
  min-height: 72px;
  resize: vertical;
  line-height: 1.5;
}

.sp-equip-dock-note {
  margin: 10px 0 0;
  font-size: 0.72rem;
  color: #94a3b8;
  line-height: 1.45;
}

@media (max-width: 720px) {
  .sp-equip-dock-grid {
    grid-template-columns: 1fr;
  }
}

.sp-equip-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 14px;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.28);
}

.sp-equip-add-btn {
  background: rgba(16, 185, 129, 0.18);
  border: 1px solid rgba(16, 185, 129, 0.45);
  color: #6ee7b7;
  border-radius: 5px;
  padding: 4px 10px;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
}

#btn-sp-equip-add {
  pointer-events: auto !important;
  cursor: pointer !important;
  position: relative;
  z-index: 20;
}

.sp-equip-add-btn--prominent {
  padding: 10px 20px;
  font-size: 0.92rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: #ecfdf5;
  background: linear-gradient(135deg, #059669 0%, #10b981 55%, #34d399 100%);
  border: 2px solid #6ee7b7;
  border-radius: 8px;
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.55), 0 4px 14px rgba(16, 185, 129, 0.35);
  animation: sp-equip-add-pulse 2.4s ease-in-out infinite;
  transition: transform 0.12s ease, box-shadow 0.12s ease, filter 0.12s ease;
}

.sp-equip-add-btn--prominent:hover {
  transform: translateY(-1px) scale(1.02);
  filter: brightness(1.08);
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.22), 0 6px 18px rgba(16, 185, 129, 0.45);
}

.sp-equip-add-btn--prominent:active {
  transform: translateY(0) scale(0.98);
}

.sp-equip-add-btn--prominent.is-at-limit {
  animation: none;
  filter: saturate(0.85);
  opacity: 0.92;
}

.sp-equip-add-btn--limit {
  animation: sp-equip-add-shake 0.45s ease;
}

@keyframes sp-equip-add-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.45), 0 4px 14px rgba(16, 185, 129, 0.35); }
  50% { box-shadow: 0 0 0 6px rgba(16, 185, 129, 0), 0 4px 14px rgba(16, 185, 129, 0.45); }
}

@keyframes sp-equip-add-shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-4px); }
  40% { transform: translateX(4px); }
  60% { transform: translateX(-3px); }
  80% { transform: translateX(3px); }
}

.sp-equip-row--new {
  animation: sp-equip-row-highlight 2s ease;
  scroll-margin-top: 96px;
  scroll-margin-bottom: 24px;
  outline: 2px solid rgba(16, 185, 129, 0.85);
  outline-offset: 2px;
}

.sp-equip-row {
  scroll-margin-top: 96px;
  scroll-margin-bottom: 24px;
}

.sp-equip-add-toast {
  position: fixed;
  top: 18%;
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  z-index: 30000;
  padding: 12px 20px;
  border-radius: 10px;
  background: rgba(16, 185, 129, 0.95);
  color: #ecfdf5;
  font-size: 0.92rem;
  font-weight: 700;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
  white-space: nowrap;
}

.sp-equip-add-toast--show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.sp-equip-jump-banner {
  padding: 10px 14px !important;
  background: rgba(16, 185, 129, 0.22) !important;
  border: 2px solid rgba(16, 185, 129, 0.75) !important;
  color: #ecfdf5 !important;
  font-size: 0.88rem !important;
  font-weight: 800 !important;
  text-align: center;
  animation: sp-equip-jump-pulse 1.2s ease-in-out 3;
}

@keyframes sp-equip-jump-pulse {
  0%, 100% { background: rgba(16, 185, 129, 0.22); }
  50% { background: rgba(16, 185, 129, 0.42); }
}

@keyframes sp-equip-row-highlight {
  0% { background: rgba(16, 185, 129, 0.5); }
  100% { background: transparent; }
}

.sp-equip-add-btn:disabled {
  opacity: 0.45;
}

.sp-equip-toolbar-hint {
  font-size: 0.72rem;
  color: #94a3b8;
  font-weight: 600;
}

/* 用具入力モーダル */
.sp-equip-input-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 999999;
  background: rgba(0, 0, 0, 0.88);
  align-items: center;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
}

.sp-equip-input-modal.is-open {
  display: flex !important;
}

.sp-equip-input-card {
  width: min(560px, 100%);
  max-height: min(90vh, 720px);
  overflow-y: auto;
  background: #1e293b;
  border: 2px solid rgba(16, 185, 129, 0.75);
  border-radius: 12px;
  padding: 20px 22px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
}

.sp-equip-input-title {
  margin: 0 0 6px;
  color: #6ee7b7;
  font-size: 1.05rem;
}

.sp-equip-input-lead {
  margin: 0 0 14px;
  color: #94a3b8;
  font-size: 0.82rem;
}

.sp-equip-input-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 14px;
}

.sp-equip-input-field {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  color: #94a3b8;
}

.sp-equip-input-field input,
.sp-equip-input-field textarea {
  display: block;
  margin-top: 5px;
  width: 100%;
  box-sizing: border-box;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  color: #f1f5f9;
  padding: 10px 12px;
  font-size: 0.9rem;
  font-family: inherit;
}

.sp-equip-input-field--reason {
  grid-column: 1 / -1;
}

.sp-equip-input-field--reason textarea {
  min-height: 96px;
  resize: vertical;
  line-height: 1.5;
}

.sp-equip-req {
  color: #f87171;
  margin-left: 2px;
  white-space: nowrap;
}

.sp-equip-input-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 16px;
}

.sp-preview-btn-primary {
  background: rgba(16, 185, 129, 0.35) !important;
  border-color: rgba(16, 185, 129, 0.7) !important;
  color: #ecfdf5 !important;
  font-weight: 700 !important;
}

/* 登録済み用具一覧 */
.sp-equip-summary-wrap {
  flex-shrink: 0;
  margin: 0;
  padding: 0 2px 8px;
}

/* 用具インライン入力枠（追加ボタン直下） */
#welfare-step-service-plan .sp-plan-equip {
  display: none !important;
}

/* 用具マネージャ（カード型） */
.sp-revision-edit-banner-note--solo {
  margin-top: 0;
}

.sp-equip-manager {
  flex-shrink: 0;
  margin: 0 0 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.sp-equip-manager-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.sp-equip-manager-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #6ee7b7;
}

.sp-equip-manager-add-btn {
  background: rgba(16, 185, 129, 0.3);
  border: 2px solid rgba(16, 185, 129, 0.75);
  color: #ecfdf5;
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  pointer-events: auto !important;
}

.sp-equip-manager-add-btn:hover {
  background: rgba(16, 185, 129, 0.45);
}

.sp-equip-manager-add-btn.is-at-limit {
  opacity: 0.7;
}

.sp-equip-manager-add-btn:disabled {
  opacity: 1;
  cursor: pointer;
  pointer-events: auto !important;
}

.sp-equip-manager-hint {
  margin: 0 0 10px;
  font-size: 0.75rem;
  color: #94a3b8;
}

.sp-equip-manager-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sp-equip-manager-card {
  padding: 8px 10px 10px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.sp-equip-manager-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(16, 185, 129, 0.25);
  color: #6ee7b7;
  font-weight: 800;
  font-size: 0.82rem;
  flex-shrink: 0;
  grid-column: 1;
  grid-row: 1;
  align-self: start;
  margin-top: 1px;
}

.sp-equip-manager-del-btn {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #fca5a5;
  border-radius: 5px;
  padding: 2px 8px;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
  align-self: start;
  line-height: 1.4;
  white-space: nowrap;
}

.sp-equip-manager-del-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.sp-equip-manager-grid,
.sp-equip-manager-body {
  display: grid !important;
  grid-template-columns: 24px 1fr 1fr;
  gap: 6px 10px;
  min-height: 0 !important;
  visibility: visible !important;
  opacity: 1 !important;
}

.sp-equip-mgr-field--item {
  grid-column: 2;
  grid-row: 1;
}

.sp-equip-mgr-name-row {
  grid-column: 3;
  grid-row: 1;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
}

.sp-equip-mgr-field--name {
  flex: 1;
  min-width: 0;
}

.sp-equip-mgr-field--style {
  grid-column: 2;
  grid-row: 2;
}

.sp-equip-mgr-field--units {
  grid-column: 3;
  grid-row: 2;
}

.sp-equip-mgr-field--reason {
  grid-column: 2 / 4;
  grid-row: 3;
}

.sp-equip-mgr-reason-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 3px;
}

.sp-equip-mgr-reason-label {
  flex: 1;
  min-width: 0;
}

.sp-equip-mgr-ai-reason-btn {
  flex-shrink: 0;
  background: rgba(245, 158, 11, 0.18);
  border: 1px solid rgba(245, 158, 11, 0.45);
  color: #fde68a;
  border-radius: 5px;
  padding: 2px 8px;
  font-size: 0.68rem;
  font-weight: 700;
  cursor: pointer;
  line-height: 1.4;
  white-space: nowrap;
}

.sp-equip-mgr-ai-reason-btn:hover:not(:disabled) {
  background: rgba(245, 158, 11, 0.3);
}

.sp-equip-mgr-ai-reason-btn:disabled {
  opacity: 0.6;
  cursor: wait;
}

#sp-equip-manager .sp-equip-mgr-field {
  display: block !important;
  visibility: visible !important;
}

#sp-equip-manager .sp-equip-mgr-field input,
#sp-equip-manager .sp-equip-mgr-field textarea {
  display: block !important;
  visibility: visible !important;
  min-height: 36px;
}

.sp-equip-req {
  color: #f87171;
  font-weight: 800;
  margin-left: 2px;
  white-space: nowrap;
}

.sp-equip-mgr-field input[readonly] {
  background: rgba(0, 0, 0, 0.18);
  color: #cbd5e1;
}

.sp-equip-mgr-field .sp-equip-item-input[readonly] {
  cursor: pointer;
}

.sp-equip-mgr-field input[readonly]:not(.sp-equip-item-input) {
  cursor: default;
}

.sp-equip-mgr-field {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  color: #94a3b8;
}

.sp-equip-mgr-field input,
.sp-equip-mgr-field textarea {
  display: block;
  margin-top: 3px;
  width: 100%;
  box-sizing: border-box;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  color: #f1f5f9;
  padding: 8px 10px;
  font-size: 0.88rem;
  font-family: inherit;
}

.sp-equip-mgr-field--reason textarea {
  min-height: 52px;
  max-height: 72px;
  resize: vertical;
}

@media (max-width: 640px) {
  .sp-equip-manager-grid,
  .sp-equip-manager-body {
    grid-template-columns: 24px 1fr;
  }

  .sp-equip-mgr-field--item {
    grid-column: 2;
    grid-row: 1;
  }

  .sp-equip-mgr-name-row {
    grid-column: 2;
    grid-row: 2;
  }

  .sp-equip-mgr-field--style {
    grid-column: 2;
    grid-row: 3;
  }

  .sp-equip-mgr-field--units {
    grid-column: 2;
    grid-row: 4;
  }

  .sp-equip-mgr-field--reason {
    grid-column: 1 / -1;
    grid-row: 5;
  }
}

.sp-equip-inline-form-wrap {
  flex-shrink: 0;
  width: 100%;
  margin: 0;
  padding: 0 2px;
}

.sp-equip-inline-form {
  display: none;
  margin: 0 0 10px;
  padding: 14px 16px;
  border-radius: 10px;
  background: rgba(16, 185, 129, 0.12);
  border: 2px solid rgba(16, 185, 129, 0.85);
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.15);
  box-sizing: border-box;
}

.sp-equip-inline-form.is-open {
  display: block !important;
}

.sp-equip-inline-head {
  margin-bottom: 12px;
  color: #6ee7b7;
  font-size: 0.92rem;
  font-weight: 700;
}

.sp-equip-inline-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 12px;
}

.sp-equip-inline-field {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  color: #94a3b8;
}

.sp-equip-inline-field input,
.sp-equip-inline-field textarea {
  display: block;
  margin-top: 4px;
  width: 100%;
  box-sizing: border-box;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  color: #f1f5f9;
  padding: 10px 12px;
  font-size: 0.88rem;
  font-family: inherit;
}

.sp-equip-inline-field--reason {
  grid-column: 1 / -1;
}

.sp-equip-inline-field--reason textarea {
  min-height: 72px;
  resize: vertical;
  line-height: 1.45;
}

.sp-equip-inline-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 12px;
}

@media (max-width: 520px) {
  .sp-equip-inline-grid {
    grid-template-columns: 1fr;
  }
}

.sp-equip-summary-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sp-equip-summary-empty {
  margin: 0;
  padding: 12px 14px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px dashed rgba(148, 163, 184, 0.35);
  color: #94a3b8;
  font-size: 0.8rem;
  line-height: 1.45;
}

.sp-equip-summary-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.sp-equip-summary-marker {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(16, 185, 129, 0.25);
  color: #6ee7b7;
  font-weight: 800;
  font-size: 0.85rem;
}

.sp-equip-summary-body {
  flex: 1 1 auto;
  min-width: 0;
}

.sp-equip-summary-label {
  color: #ecfdf5;
  font-size: 0.85rem;
  font-weight: 700;
}

.sp-equip-summary-sub {
  color: #94a3b8;
  font-size: 0.72rem;
  margin-top: 2px;
}

.sp-equip-summary-actions {
  flex: 0 0 auto;
  display: flex;
  gap: 6px;
}

.sp-equip-summary-edit-btn,
.sp-equip-summary-del-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #e2e8f0;
  border-radius: 5px;
  padding: 5px 10px;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
}

.sp-equip-summary-del-btn {
  color: #fca5a5;
  border-color: rgba(239, 68, 68, 0.35);
  background: rgba(239, 68, 68, 0.12);
}

@media (max-width: 520px) {
  .sp-equip-input-grid {
    grid-template-columns: 1fr;
  }
}

.sp-equip-row-del-btn {
  flex: 0 0 auto;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #fca5a5;
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 0.65rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  margin-bottom: 1px;
}

.sp-equip-row-del-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.sp-revision-edit-banner {
  order: -1;
  margin: 0 0 4px;
  padding: 10px 12px;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-left: 4px solid rgba(245, 158, 11, 0.65);
  border-radius: 0 6px 6px 0;
  color: #fde68a;
  font-size: 0.78rem;
  line-height: 1.45;
  flex-shrink: 0;
}

.sp-revision-edit-banner-note {
  margin-top: 8px;
  padding: 10px 12px;
  background: rgba(15, 23, 42, 0.45);
  border: 1px solid rgba(251, 191, 36, 0.5);
  border-radius: 6px;
  color: #fffbeb;
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}

.sp-revision-edit-banner-note--solo {
  margin-top: 0;
}

.wf-landing-badge--revision {
  background: rgba(245, 158, 11, 0.15);
  color: #fcd34d;
  border: 1px solid rgba(245, 158, 11, 0.35);
}

.wf-landing-badge--revision-pulse {
  animation: wf-label-urgent 0.85s ease-in-out infinite;
}

.sp-preview-btn-warn {
  background: rgba(245, 158, 11, 0.22) !important;
  border-color: rgba(245, 158, 11, 0.55) !important;
  color: #fde68a !important;
  pointer-events: auto;
  position: relative;
  z-index: 2;
}


.sp-revision-request-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 20050;
  background: rgba(0, 0, 0, 0.75);
  align-items: center;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
}

.sp-revision-request-card {
  width: min(520px, 100%);
  background: #1e293b;
  border: 1px solid rgba(245, 158, 11, 0.45);
  border-radius: 12px;
  padding: 18px 20px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
}

.sp-revision-request-title {
  margin: 0 0 8px;
  color: #fde68a;
  font-size: 1rem;
}

.sp-revision-request-lead {
  margin: 0 0 10px;
  color: #94a3b8;
  font-size: 0.78rem;
  line-height: 1.45;
}

.sp-revision-request-note {
  width: 100%;
  box-sizing: border-box;
  min-height: 120px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  color: #e2e8f0;
  font-size: 0.85rem;
  line-height: 1.5;
  padding: 10px 12px;
  resize: vertical;
  font-family: inherit;
}

.sp-revision-request-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 12px;
}

.wf-landing-card-actions .btn-request-plan-revision {
  pointer-events: auto;
  position: relative;
  z-index: 2;
}

#sp-product-picker {
  display: none;
  flex-direction: column;
  position: fixed;
  z-index: 10050;
  background: rgba(15, 23, 42, 0.98);
  border: 1px solid rgba(59, 130, 246, 0.45);
  border-radius: 10px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.55);
  overflow: hidden;
  backdrop-filter: blur(10px);
  max-height: min(88vh, 920px);
}

.sp-product-picker-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: rgba(59, 130, 246, 0.12);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}

.sp-product-picker-content {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
}

.sp-product-picker-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: #93c5fd;
}

.sp-product-picker-sub {
  font-size: 0.68rem;
  color: #64748b;
  flex: 1;
}

.sp-product-picker-close {
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
}

.sp-product-picker-close:hover {
  color: #fff;
}

.sp-product-picker-categories {
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
  background: rgba(15, 23, 42, 0.55);
  padding: 8px 8px 6px;
  position: sticky;
  top: 0;
  z-index: 3;
}

.sp-product-picker-categories-head {
  margin-bottom: 6px;
}

.sp-product-picker-categories-label {
  font-size: 0.68rem;
  font-weight: 700;
  color: #94a3b8;
}

.sp-product-picker-category-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  max-height: 120px;
  overflow-y: auto;
}

.sp-product-picker-category-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 999px;
  background: rgba(30, 41, 59, 0.8);
  color: #cbd5e1;
  font-size: 0.68rem;
  line-height: 1.2;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}

.sp-product-picker-category-chip:hover {
  background: rgba(51, 65, 85, 0.95);
  border-color: rgba(148, 163, 184, 0.45);
  color: #f1f5f9;
}

.sp-product-picker-category-chip--active {
  background: rgba(59, 130, 246, 0.22);
  border-color: rgba(96, 165, 250, 0.65);
  color: #bfdbfe;
  font-weight: 700;
}

.sp-product-picker-category-chip-count {
  font-size: 0.62rem;
  color: #64748b;
  background: rgba(15, 23, 42, 0.5);
  padding: 1px 5px;
  border-radius: 999px;
}

.sp-product-picker-category-chip--active .sp-product-picker-category-chip-count {
  color: #93c5fd;
}

.sp-product-picker-empty--category {
  padding: 24px 16px;
  text-align: center;
  color: #94a3b8;
  font-size: 0.85rem;
}

.sp-product-picker-names {
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
  background: rgba(15, 23, 42, 0.4);
  padding: 6px 8px 4px;
  position: sticky;
  top: 0;
  z-index: 2;
}

.sp-product-picker-names-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.sp-product-picker-names-label {
  font-size: 0.68rem;
  font-weight: 700;
  color: #94a3b8;
  white-space: nowrap;
  flex-shrink: 0;
}

.sp-product-picker-name-search {
  flex: 1 1 auto;
  min-width: 0;
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: rgba(0, 0, 0, 0.25);
  color: #e2e8f0;
  font-size: 0.72rem;
}

.sp-product-picker-name-search:focus {
  outline: none;
  border-color: rgba(96, 165, 250, 0.55);
}

.sp-product-picker-name-chips {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-bottom: 2px;
}

.sp-product-picker-name-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  max-width: none;
  padding: 5px 10px;
  border-radius: 5px;
  border: 1px solid rgba(148, 163, 184, 0.15);
  background: rgba(30, 41, 59, 0.65);
  color: #cbd5e1;
  font-size: 0.72rem;
  line-height: 1.35;
  cursor: pointer;
  text-align: left;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}

.sp-product-picker-name-chip:hover {
  background: rgba(59, 130, 246, 0.18);
  border-color: rgba(96, 165, 250, 0.35);
  color: #e2e8f0;
}

.sp-product-picker-name-chip--active {
  background: rgba(16, 185, 129, 0.22);
  border-color: rgba(52, 211, 153, 0.45);
  color: #6ee7b7;
  font-weight: 700;
}

.sp-product-picker-name-chip-count {
  font-size: 0.62rem;
  color: #64748b;
  font-weight: 500;
  white-space: nowrap;
  flex-shrink: 0;
}

.sp-product-picker-name-chip-label {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sp-product-picker-name-chip--active .sp-product-picker-name-chip-count {
  color: #34d399;
}

.sp-product-picker-name-empty {
  width: 100%;
  padding: 6px 4px;
  font-size: 0.68rem;
  color: #64748b;
}

.sp-product-picker-empty--name span {
  display: block;
  margin-top: 6px;
  font-size: 0.72rem;
  color: #64748b;
}

.sp-product-picker-body {
  padding: 4px 6px 8px;
}

.sp-product-picker-empty {
  padding: 16px 12px;
  text-align: center;
  color: #64748b;
  font-size: 0.8rem;
}

.sp-product-picker-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 24px 16px;
  min-height: 100px;
}

.sp-product-picker-loading__spinner {
  width: 44px;
  height: 44px;
  border: 4px solid rgba(147, 197, 253, 0.2);
  border-top-color: #60a5fa;
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}

.sp-product-picker-loading__text {
  font-size: 0.82rem;
  color: #94a3b8;
  text-align: center;
  line-height: 1.5;
}

.sp-product-picker-item {
  display: grid;
  grid-template-columns: 48px 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 5px 6px;
  border-radius: 6px;
  border: 1px solid transparent;
  transition: background 0.12s, border-color 0.12s;
}

.sp-product-picker-item:hover {
  background: rgba(59, 130, 246, 0.08);
  border-color: rgba(59, 130, 246, 0.2);
}

.sp-product-picker-thumb {
  width: 44px;
  height: 44px;
  border-radius: 6px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sp-product-picker-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #fff;
}

.sp-product-picker-noimg {
  font-size: 1.4rem;
  opacity: 0.5;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.sp-product-picker-name {
  font-size: 0.78rem;
  font-weight: 600;
  color: #e2e8f0;
  line-height: 1.35;
}

.sp-product-picker-model {
  font-weight: 400;
  color: #94a3b8;
  font-size: 0.72rem;
}

.sp-product-picker-meta,
.sp-product-picker-submeta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  margin-top: 4px;
  font-size: 0.68rem;
  color: #94a3b8;
}

.sp-product-picker-meta b {
  color: #34d399;
}

.sp-product-picker-price {
  color: #fbbf24 !important;
  font-weight: 700;
}

.sp-product-picker-submeta span {
  white-space: nowrap;
}

.sp-product-picker-select {
  flex-shrink: 0;
  background: rgba(16, 185, 129, 0.18);
  border: 1px solid rgba(16, 185, 129, 0.45);
  color: #6ee7b7;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s;
}

.prod-img-dropzone {
  position: relative;
  width: 100%;
  min-height: 160px;
  border: 2px dashed rgba(255, 255, 255, 0.25);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  outline: none;
  margin-bottom: 12px;
}

.prod-img-dropzone.prod-img-drop-active,
.prod-img-dropzone:focus {
  border-color: rgba(59, 130, 246, 0.75);
  background: rgba(59, 130, 246, 0.1);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.prod-img-dropzone--compact {
  min-height: 96px;
  width: 96px;
  flex-shrink: 0;
  margin-bottom: 0;
}

.prod-img-preview-inner {
  flex: 1;
  width: 100%;
  min-height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.prod-img-dropzone--compact .prod-img-preview-inner {
  min-height: 72px;
}

.prod-img-drop-hint {
  font-size: 0.72rem;
  color: #64748b;
  text-align: center;
  line-height: 1.55;
  padding: 6px 12px 12px;
  pointer-events: none;
}

.prod-img-dropzone--compact .prod-img-drop-hint {
  display: none;
}

.sp-product-picker-select:hover {
  background: rgba(16, 185, 129, 0.32);
}

.sp-product-picker-select:disabled {
  opacity: 0.38;
  cursor: not-allowed;
  background: rgba(100, 116, 139, 0.12);
  border-color: rgba(100, 116, 139, 0.25);
  color: #64748b;
}

.sp-product-picker-select:disabled:hover {
  background: rgba(100, 116, 139, 0.12);
}

.sp-product-picker-select--ready {
  opacity: 1;
  cursor: pointer;
  background: rgba(16, 185, 129, 0.18);
  border-color: rgba(16, 185, 129, 0.45);
  color: #6ee7b7;
}

.sp-product-picker-confirm-stock {
  flex-shrink: 0;
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.45);
  color: #fcd34d;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s;
}

.sp-product-picker-confirm-stock:hover {
  background: rgba(245, 158, 11, 0.28);
}

.sp-product-picker-confirm-stock--ok {
  background: rgba(16, 185, 129, 0.2);
  border-color: rgba(16, 185, 129, 0.45);
  color: #6ee7b7;
  cursor: default;
  opacity: 1;
}

.sp-product-picker-confirm-stock--ok:hover {
  background: rgba(16, 185, 129, 0.2);
}

.sp-product-picker-recommend {
  display: inline-block;
  margin-right: 6px;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 0.62rem;
  font-weight: 700;
  color: #fcd34d;
  background: rgba(245, 158, 11, 0.18);
  border: 1px solid rgba(245, 158, 11, 0.35);
  vertical-align: middle;
}

.sp-product-picker-nostock {
  display: inline-block;
  margin-right: 6px;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 0.62rem;
  font-weight: 700;
  color: #94a3b8;
  background: rgba(148, 163, 184, 0.12);
  border: 1px solid rgba(148, 163, 184, 0.3);
  vertical-align: middle;
}

.sp-product-picker-item--nostock {
  opacity: 0.82;
}

.sp-product-picker-item--nostock:hover {
  opacity: 1;
}

.sp-product-picker-stock-zero b {
  color: #94a3b8;
}

.sp-product-picker-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-shrink: 0;
  align-items: stretch;
  justify-content: center;
}

.sp-product-picker-thumb {
  cursor: zoom-in;
}

.sp-product-picker-thumb-img:focus {
  outline: 2px solid rgba(59, 130, 246, 0.55);
  outline-offset: 1px;
}

#sp-product-picker-zoom {
  display: none;
  position: fixed;
  z-index: 10060;
  width: 300px;
  height: 300px;
  object-fit: contain;
  background: #fff;
  border: 2px solid rgba(59, 130, 246, 0.55);
  border-radius: 10px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.65);
  padding: 6px;
  pointer-events: none;
}

.sp-form-consent {
  margin: 12px 0;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  color: #94a3b8;
  line-height: 1.7;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
}

.sp-date-input {
  padding: 4px 8px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 4px;
  color: #e2e8f0;
  font-size: 0.76rem;
}

.sp-form-footer-plan {
  flex-wrap: wrap;
  justify-content: flex-start;
}

.sp-footer-wide {
  min-width: 220px !important;
}

.sp-plan-needs th:first-child,
.sp-plan-equip .sp-equip-photo-cell {
  width: 12%;
}

.sp-form-bottom th {
  width: 18%;
}

.sp-form-footer {
  display: flex;
  justify-content: flex-end;
  gap: 24px;
  margin-top: 12px;
  padding-top: 8px;
  color: #94a3b8;
}

.sp-form-footer label {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sp-footer-input {
  min-width: 160px;
  padding: 6px 8px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 4px;
  color: #e2e8f0;
}

/* サービス計画書 プレビューモーダル */
.sp-preview-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 20000;
  background: rgba(0, 0, 0, 0.88);
  align-items: center;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
}

.sp-preview-modal-card {
  width: min(920px, 100%);
  max-height: calc(100vh - 32px);
  display: flex;
  flex-direction: column;
  background: #334155;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

.sp-preview-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  background: #1e293b;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  flex-shrink: 0;
}

.sp-preview-modal-title {
  margin: 0;
  font-size: 1rem;
  color: #e2e8f0;
  font-weight: 700;
}

.sp-preview-modal-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
  position: relative;
  z-index: 3;
}

.sp-preview-btn {
  padding: 8px 14px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.08);
  color: #e2e8f0;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
}

.sp-preview-btn-primary {
  background: rgba(59, 130, 246, 0.35);
  border-color: rgba(59, 130, 246, 0.6);
  color: #bfdbfe;
}

.sp-preview-modal-hint {
  margin: 0;
  padding: 8px 18px;
  font-size: 0.75rem;
  color: #94a3b8;
  background: #293548;
  flex-shrink: 0;
}

.sp-preview-modal-body {
  flex: 1 1 auto;
  overflow: auto;
  padding: 16px;
  background: #525659;
  -webkit-overflow-scrolling: touch;
}

.sp-preview-pdf-frame {
  flex: 1 1 auto;
  width: 100%;
  min-height: 0;
  border: 0;
  background: #525659;
}

.sp-preview-modal-body #contact-print-area {
  margin: 0 auto;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
}

.f-basic-ja-date-picker {
  display: none;
  position: fixed;
  z-index: 4000;
  min-width: 292px;
  padding: 12px;
  border-radius: 10px;
  background: #1e293b;
  border: 1px solid rgba(148, 163, 184, 0.35);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
  color: #f1f5f9;
  font-size: 0.75rem;
}

.f-basic-ja-date-picker-title {
  font-weight: bold;
  color: #94a3b8;
  margin-bottom: 10px;
}

.f-basic-ja-date-picker-row {
  display: grid;
  grid-template-columns: minmax(92px, 1.4fr) minmax(64px, 0.9fr) minmax(64px, 0.9fr);
  gap: 8px;
  margin-bottom: 12px;
}

.f-basic-ja-date-picker-row select {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  background: #0f172a;
  border: 1px solid rgba(148, 163, 184, 0.35);
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 0.75rem;
  font-family: inherit;
  color-scheme: dark;
}

.f-basic-ja-date-picker-row .f-bdp-year {
  min-width: 92px;
  padding-right: 12px;
}

.f-basic-ja-date-picker-row .f-bdp-month,
.f-basic-ja-date-picker-row .f-bdp-day {
  min-width: 64px;
}

.f-basic-ja-date-picker-row select option {
  color: #ffffff !important;
  background-color: #1e293b !important;
}

.f-basic-ja-date-picker-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.f-basic-ja-date-picker-actions button {
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: #0f172a;
  color: #e2e8f0;
  border-radius: 6px;
  padding: 5px 10px;
  font-size: calc(0.75rem - 1pt);
  cursor: pointer;
}

.f-basic-ja-date-picker-actions .f-bdp-ok {
  background: #059669;
  border-color: #059669;
  color: #fff;
  font-weight: bold;
}

.f-basic-ja-date-picker-actions button:hover {
  filter: brightness(1.08);
}

/* 福祉用具選定シート：選定に必要な内容（4項目） */
#modal-new-form #f-purpose-extracted-panel .f-req-section > div,
#modal-new-form #f-purpose-extracted-panel textarea {
  font-size: calc(0.75rem + 4pt) !important;
  font-family: inherit;
}

#modal-new-form #f-purpose-extracted-panel .f-req-section > div {
  font-weight: bold !important;
  color: #64748b !important;
  line-height: 1.2 !important;
  min-height: 14px;
  padding: 2px 8px;
}

#modal-new-form #f-purpose-extracted-panel textarea {
  line-height: 1.2 !important;
  padding: 2px 8px !important;
  min-height: 14px;
  color: #f1f5f9 !important;
  font-weight: normal !important;
}

#modal-new-form #f-purpose-extracted-panel .f-req-section {
  border-bottom: 1px solid rgba(255, 255, 255, 0.05) !important;
}

#modal-new-form #f-purpose-extracted-panel textarea::placeholder {
  color: rgba(148, 163, 184, 0.28) !important;
  opacity: 1 !important;
}

#modal-new-form .req-sample-btn {
  background: transparent;
  border: 1px solid rgba(239, 68, 68, 0.55);
  color: #ef4444;
  border-radius: 4px;
  padding: 1px 5px;
  font-size: 0.65rem;
  font-weight: bold;
  cursor: pointer;
  font-family: inherit;
  line-height: 1.2;
  min-width: 0;
  transition: background 0.2s, color 0.2s;
}

#modal-new-form .req-sample-btn:hover {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
}

/* プロセス：①欄と同位置にチェックリストを配置 */
#modal-new-form #inline-checklist-wrap {
  display: flex;
  flex-direction: column;
  min-height: 0;
  max-height: min(520px, calc(90vh - 260px));
  overflow: hidden;
}

#modal-new-form #inline-checklist-wrap #modal-checklist {
  flex: 1 1 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

#modal-new-form #inline-checklist-wrap #modal-checklist > .chk-shell,
#modal-new-form #inline-checklist-wrap #modal-checklist > div {
  max-width: none !important;
  width: 100% !important;
  margin: 0 !important;
  flex: 1 1 0;
  min-height: 0;
  max-height: min(520px, calc(90vh - 260px));
  border-radius: 6px;
  box-shadow: none;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#modal-new-form #inline-checklist-wrap .chk-shell-inline {
  display: flex !important;
  flex-direction: column !important;
  gap: 0;
  width: 100% !important;
  max-width: none !important;
  --chk-ai-visible-lines: 7;
  --chk-ai-line-height: 1.7;
  --chk-ai-frame-height: 220px;
}

#modal-new-form #inline-checklist-wrap .chk-stages-scroll {
  flex: 1 1 auto;
  min-height: 0;
  max-height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 8px 6px !important;
  -webkit-overflow-scrolling: touch;
  width: 100%;
  box-sizing: border-box;
}

#modal-new-form #inline-checklist-wrap .chk-shell-inline.chk-all-collapsed {
  min-height: 0 !important;
  height: auto !important;
  max-height: min(520px, calc(90vh - 260px)) !important;
  flex: 0 0 auto !important;
}

#modal-new-form #inline-checklist-wrap:has(.chk-all-collapsed) {
  min-height: 0;
}

#modal-new-form #inline-checklist-wrap:has(.chk-all-collapsed) #modal-checklist {
  flex: 0 0 auto;
}

#modal-new-form #inline-checklist-wrap .chk-shell-inline.chk-all-collapsed .chk-stages-scroll {
  flex: 0 0 auto;
  overflow-y: visible;
}

#modal-new-form #inline-checklist-wrap .chk-ai-footer {
  flex: 0 0 auto;
  min-height: calc(var(--chk-ai-frame-height) + 56px);
  width: 100% !important;
  box-sizing: border-box;
  padding: 10px 0 12px !important;
  border-top: 1px solid rgba(255, 255, 255, 0.12) !important;
  background: transparent !important;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
  overflow: visible;
}

#modal-new-form #inline-checklist-wrap .chk-ai-preview-frame {
  flex: 0 0 auto;
  width: 100% !important;
  max-width: none !important;
  box-sizing: border-box;
  display: block;
  height: var(--chk-ai-frame-height) !important;
  min-height: var(--chk-ai-frame-height) !important;
  max-height: var(--chk-ai-frame-height) !important;
  border: 1px solid rgba(16, 185, 129, 0.45);
  border-radius: 8px;
  background: rgba(16, 185, 129, 0.07);
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.18);
  overflow: hidden;
}

#modal-new-form #inline-checklist-wrap #chk-preview-text {
  display: block;
  width: 100% !important;
  max-width: none !important;
  height: 100% !important;
  min-height: var(--chk-ai-frame-height) !important;
  max-height: var(--chk-ai-frame-height) !important;
  box-sizing: border-box;
  border: none !important;
  border-radius: 0;
  background: transparent !important;
  color: #e2e8f0 !important;
  font-size: calc(0.85rem + 3pt) !important;
  line-height: var(--chk-ai-line-height, 1.7) !important;
  padding: 14px !important;
  resize: none;
  overflow-y: auto !important;
  overflow-x: hidden;
}

#modal-new-form #inline-checklist-wrap .acc-btn {
  padding: 10px 14px !important;
  font-size: calc(0.85rem + 2pt) !important;
  line-height: 1.3 !important;
  margin-bottom: 6px !important;
  min-height: 40px;
}

#modal-new-form #inline-checklist-wrap .chk-table th,
#modal-new-form #inline-checklist-wrap .chk-table td {
  padding: 8px 10px !important;
  font-size: calc(0.78rem + 2pt) !important;
  line-height: 1.35 !important;
  vertical-align: top !important;
}

#modal-new-form #inline-checklist-wrap .chk-table th span {
  font-size: calc(0.68rem + 2pt) !important;
}

#modal-new-form #inline-checklist-wrap .chk-table {
  margin-top: 4px !important;
  table-layout: fixed !important;
}

#modal-new-form #inline-checklist-wrap .chk-table th:first-child,
#modal-new-form #inline-checklist-wrap .chk-table td:first-child {
  width: 18% !important;
  max-width: 130px !important;
  padding: 6px 8px !important;
  font-size: calc(0.72rem + 2pt) !important;
  line-height: 1.25 !important;
  word-break: break-word;
}

#modal-new-form #inline-checklist-wrap .chk-table th:last-child,
#modal-new-form #inline-checklist-wrap .chk-table td:last-child {
  width: 82% !important;
}

#modal-new-form #inline-checklist-wrap .chk-opts {
  gap: 4px !important;
  align-items: center !important;
}

#modal-new-form #inline-checklist-wrap .chk-opts label {
  font-size: calc(0.72rem + 2pt) !important;
  line-height: 1.2 !important;
  padding: 4px 6px !important;
  min-height: 0;
  align-items: center !important;
  flex: 0 1 auto !important;
  white-space: nowrap !important;
  display: inline-flex !important;
  max-width: 100%;
}

#modal-new-form #inline-checklist-wrap .chk-group[data-type="radio"] .chk-opts label {
  flex: 0 1 auto !important;
}

#modal-new-form #inline-checklist-wrap .chk-opts input[type="radio"],
#modal-new-form #inline-checklist-wrap .chk-opts input[type="checkbox"] {
  width: 13px !important;
  height: 13px !important;
  margin-top: 0 !important;
  flex-shrink: 0;
}

#modal-new-form #inline-checklist-wrap .acc-content {
  margin-bottom: 8px !important;
}

#modal-new-form #inline-checklist-wrap .acc-content-stage4 .chk-opts label {
  font-size: calc(0.68rem + 2pt) !important;
  padding: 3px 5px !important;
  gap: 2px !important;
}

#modal-new-form #inline-checklist-wrap .acc-content-stage4 .chk-table th,
#modal-new-form #inline-checklist-wrap .acc-content-stage4 .chk-table td {
  padding: 5px 7px !important;
}

#modal-new-form #inline-checklist-wrap .chk-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: rgba(15, 23, 42, 0.95) !important;
}

#modal-new-form #purpose-flex-container[data-tab-mode="process"] {
  min-height: 0;
  max-height: min(520px, calc(90vh - 260px));
}

#modal-new-form[data-purpose-tab="process"] > div > #modal-new-form-body,
#modal-new-form[data-purpose-tab="process"] #modal-new-form-body {
  min-height: 420px !important;
}

/* 福祉用具選定シート：入力タブ（label/button の global 上書きを統一） */
#modal-new-form .form-purpose-tab {
  font-size: calc(0.75rem + 3pt) !important;
  font-weight: bold !important;
  font-family: inherit !important;
  line-height: 1.2 !important;
  padding: 4px 12px !important;
  border-radius: 4px !important;
  cursor: pointer !important;
  transition: 0.2s !important;
  display: inline-flex !important;
  align-items: center !important;
  box-sizing: border-box !important;
  margin: 0 !important;
}

/* ケアプラン 第一表＋関連情報（2列） */
#modal-new-form #purpose-careplan-grid {
  box-sizing: border-box;
}

#modal-new-form .cp-quadrant {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 0;
  min-width: 0;
}

#modal-new-form .cp-quadrant-label {
  font-size: calc(0.75rem + 3pt);
  font-weight: bold;
  color: #94a3b8;
  margin: 0;
  flex-shrink: 0;
  line-height: 1.2;
}

#modal-new-form .cp-quadrant-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

#modal-new-form .cp-t2-file-btn {
  font-size: 0.65rem;
  font-weight: bold;
  color: #60a5fa;
  background: rgba(59, 130, 246, 0.12);
  border: 1px solid rgba(59, 130, 246, 0.35);
  border-radius: 4px;
  padding: 2px 8px;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}

#modal-new-form .cp-t2-file-btn:hover {
  background: rgba(59, 130, 246, 0.25);
}

#modal-new-form .cp-quadrant-body {
  flex: 1 1 0;
  min-height: 0;
  overflow: auto;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  padding: 8px 10px;
  font-size: calc(0.7rem + 3pt);
  line-height: 1.45;
  color: #e2e8f0;
}

#modal-new-form .cp-quadrant-textarea {
  flex: 1 1 0;
  min-height: 0;
  width: 100%;
  box-sizing: border-box;
  resize: none;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(59, 130, 246, 0.35);
  border-radius: 6px;
  padding: 8px 10px;
  color: #e2e8f0;
  font-size: calc(0.7rem + 3pt);
  line-height: 1.45;
  font-family: inherit;
}

#modal-new-form .cp-empty-msg {
  margin: 0;
  padding: 12px 4px;
  color: #64748b;
  font-size: calc(0.7rem + 3pt);
  text-align: center;
  line-height: 1.5;
}

#modal-new-form .cp-t1-basic {
  margin-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 6px;
}

#modal-new-form .cp-ai-badge {
  display: inline-block;
  font-size: calc(0.65rem - 1pt);
  color: #93c5fd;
  background: rgba(59, 130, 246, 0.12);
  border: 1px solid rgba(59, 130, 246, 0.35);
  border-radius: 4px;
  padding: 2px 8px;
  margin-bottom: 6px;
}

#modal-new-form .cp-t1-row {
  display: flex;
  gap: 8px;
  padding: 2px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

#modal-new-form .cp-t1-label {
  flex: 0 0 7.5em;
  font-weight: bold;
  color: #94a3b8;
  white-space: nowrap;
}

#modal-new-form .cp-t1-val {
  flex: 1;
  min-width: 0;
  text-align: right;
  word-break: break-word;
}

#modal-new-form .cp-t1-block {
  margin-top: 8px;
}

#modal-new-form .cp-t1-block-title {
  font-weight: bold;
  color: #60a5fa;
  font-size: calc(0.7rem + 3pt);
  margin-bottom: 4px;
}

#modal-new-form .cp-t1-block-body {
  white-space: pre-wrap;
  word-break: break-word;
}

#modal-new-form .cp-t2-scroll {
  overflow-x: auto;
  width: 100%;
}

#modal-new-form .cp-t2-items {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}

#modal-new-form .cp-t2-item {
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  padding: 6px 8px;
  background: rgba(0, 0, 0, 0.08);
}

#modal-new-form .cp-t2-item-title {
  font-size: 0.7rem;
  font-weight: bold;
  color: #93c5fd;
  margin-bottom: 6px;
  padding-bottom: 4px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

#modal-new-form .cp-t2-block {
  margin-bottom: 8px;
}

#modal-new-form .cp-t2-block:last-child {
  margin-bottom: 0;
}

#modal-new-form .cp-t2-block-label {
  font-size: 0.65rem;
  color: #94a3b8;
  font-weight: bold;
  margin-bottom: 2px;
}

#modal-new-form .cp-t2-block-body {
  font-size: calc(0.7rem + 3pt);
  line-height: 1.55;
  white-space: normal;
  word-break: break-word;
}

#modal-new-form .cp-t2-table {
  width: 100%;
  min-width: 480px;
  border-collapse: collapse;
  font-size: 0.65rem;
}

#modal-new-form .cp-t2-table th,
#modal-new-form .cp-t2-table td {
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 4px 6px;
  vertical-align: top;
  text-align: left;
}

#modal-new-form .cp-t2-table th {
  background: rgba(59, 130, 246, 0.15);
  color: #93c5fd;
  font-weight: bold;
  white-space: nowrap;
}

#modal-new-form .cp-t2-table tr:nth-child(even) td {
  background: rgba(0, 0, 0, 0.12);
}

#modal-new-form {
  box-sizing: border-box;
  overflow: hidden !important;
  flex-direction: column !important;
}

#modal-new-form > #modal-new-form-card,
#modal-new-form > div {
  width: min(1080px, 100%) !important;
  max-width: 100% !important;
  flex: 1 1 auto !important;
  min-height: 0 !important;
  max-height: 100% !important;
  height: auto !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
}

#modal-new-form #modal-new-form-body {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
}

#modal-new-form #modal-new-form-footer {
  position: relative;
  z-index: 50;
  flex-shrink: 0;
  flex: 0 0 auto;
  pointer-events: auto;
  background: var(--bg-secondary, rgba(15, 23, 42, 0.98)) !important;
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.25);
}

#modal-new-form #btn-sp-equip-add {
  pointer-events: auto !important;
  cursor: pointer !important;
}

#modal-new-form #btn-submit-new-form:not(:disabled),
#modal-new-form #btn-next-to-course,
#modal-new-form #btn-cancel-new-form {
  pointer-events: auto !important;
  cursor: pointer !important;
}

#modal-new-form #purpose-flex-container {
  min-height: 280px;
}

#modal-new-form #purpose-free-layout {
  min-height: 280px;
}

/* ===========================
   User Custom: Visit Type Button UI Redesign
   =========================== */
.visit-type-group {
    display: flex;
    gap: 8px;
    background: rgba(15, 23, 42, 0.4);
    padding: 6px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    flex-wrap: wrap;
    width: 100%;
}
.visit-type-tab {
    flex: 1 1 0;
    min-width: 4.5em;
    text-align: center;
    padding: 8px 4px;
    border: none;
    border-radius: 8px;
    font-size: 0.85rem !important;
    font-weight: 700;
    cursor: pointer;
    background: transparent;
    color: #94a3b8;
    transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
    /* 日本語が欠けないよう和文フォントを優先 */
    font-family: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic UI", "Yu Gothic", Meiryo, sans-serif !important;
    position: relative;
    overflow: visible;
    white-space: nowrap;
    text-overflow: clip;
    letter-spacing: 0 !important;
    word-break: keep-all !important;
    -webkit-font-smoothing: antialiased;
}
.visit-type-tab:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #e2e8f0;
}
/* Active states */
.visit-type-tab.active[data-type="kyotaku"] {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: #fff;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}
.visit-type-tab.active[data-type="home"] {
    background: linear-gradient(135deg, #10b981, #059669);
    color: #fff;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}
.visit-type-tab.active[data-type="cityhall"] {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #fff;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4);
}
.visit-type-tab.active[data-type="other"] {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    color: #fff;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.4);
}

/* Voice Input Active Highlighting */
@keyframes voice-pulse {
  0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.5); border-color: rgba(239, 68, 68, 0.8); }
  70% { box-shadow: 0 0 0 8px rgba(239, 68, 68, 0); border-color: rgba(239, 68, 68, 0.5); }
  100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); border-color: rgba(239, 68, 68, 0.8); }
}

.voice-input-active {
  animation: voice-pulse 1.5s infinite ease-in-out !important;
  background: rgba(239, 68, 68, 0.05) !important;
  border-color: #ef4444 !important;
  outline: none !important;
  position: relative;
  z-index: 10;
}

.voice-timer-bar {
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.voice-live-text {
  font-weight: 600 !important;
  border-left: 4px solid #6366f1 !important;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.1);
  animation: slideInUp 0.3s ease-out;
}

@keyframes slideInUp {
  from { transform: translateY(10px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* ===========================
   Tag / Status Badges
   =========================== */
.tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 13pt !important;
  font-weight: 600;
  white-space: nowrap;
}
.tag-green {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.25);
}
.tag-orange {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.25);
}
.tag-blue {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.25);
}
.tag-purple {
  background: rgba(139, 92, 246, 0.15);
  color: #a78bfa;
  border: 1px solid rgba(139, 92, 246, 0.25);
}
.tag-red {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.25);
}

/* ===========================
   Report / Output Format Cards
   =========================== */
.report-card {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 16px;
}
.report-header {
  font-size: 13pt !important;
  font-weight: 700;
  color: #e2e8f0;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 2px solid rgba(59, 130, 246, 0.4);
  display: flex;
  align-items: center;
  gap: 8px;
}
.report-client-info {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  padding: 10px 14px;
  background: rgba(59, 130, 246, 0.06);
  border: 1px solid rgba(59, 130, 246, 0.12);
  border-radius: 8px;
  font-size: 13pt !important;
  color: #cbd5e1;
}
.report-client-info b {
  color: #e2e8f0;
}
.report-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13pt !important;
}
.report-table th,
.report-table td {
  padding: 8px 10px;
  border: 1px solid rgba(255,255,255,0.08);
  text-align: left;
  color: #e2e8f0;
}
.report-table th {
  background: rgba(30, 33, 48, 0.95);
  font-weight: 600;
  font-size: 13pt !important;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.report-table tbody tr:hover {
  background: rgba(79,140,255,0.06);
}
.report-table tfoot td {
  background: rgba(30, 33, 48, 0.6);
}
.report-form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}
.report-field {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 8px;
}
.report-label {
  font-size: 13pt !important;
  color: #64748b;
  min-width: 90px;
  font-weight: 500;
}
.report-value {
  font-size: 13pt !important;
  color: #e2e8f0;
  font-weight: 500;
}

/* ===========================
   Card Payment Overlay
   =========================== */
#card-payment-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(6px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease;
}
.card-payment-modal {
  background: var(--bg-secondary, #1a1d2e);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 16px;
  padding: 24px;
  width: 90%;
  max-width: 440px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.card-payment-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13pt !important;
  font-weight: 700;
  color: #e2e8f0;
  margin-bottom: 16px;
}
.card-payment-brands {
  margin-bottom: 16px;
  padding: 10px;
  background: rgba(255,255,255,0.03);
  border-radius: 8px;
  text-align: center;
}
.card-payment-steps {
  margin-bottom: 20px;
}
.step-indicator {
  display: flex;
  gap: 4px;
}
.step-indicator .step {
  flex: 1;
  text-align: center;
  padding: 8px 4px;
  font-size: 13pt !important;
  font-weight: 600;
  color: #475569;
  background: rgba(255,255,255,0.03);
  border-radius: 6px;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
.step-indicator .step span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: rgba(255,255,255,0.06);
  font-size: 13pt !important;
}
.step-indicator .step.active {
  color: #e2e8f0;
  background: rgba(99,102,241,0.15);
  border: 1px solid rgba(99,102,241,0.3);
}
.step-indicator .step.active span {
  background: #6366f1;
  color: #fff;
}
.card-step {
  animation: fadeIn 0.3s ease;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}


/* 非選択時（yyyy/mm/dd）の文字色を明るくする */
input[type="date"]::-webkit-datetime-edit-year-field,
input[type="date"]::-webkit-datetime-edit-month-field,
input[type="date"]::-webkit-datetime-edit-day-field,
input[type="date"]::-webkit-datetime-edit-text {
    color: #f8fafc;
    opacity: 0.9;
}

/* 値が空の時の表示（yyyy/mm/ddなど）を特に明るく */
input[type="date"]:invalid::-webkit-datetime-edit {
    color: #cbd5e1; 
}
input[type="date"]::-webkit-datetime-edit-day-field,
input[type="date"]::-webkit-datetime-edit-text,
input[type="date"]::-webkit-datetime-edit {
    color: #ffffff !important;
    opacity: 1 !important;
}

/* Force empty state to pure white */
input[type="date"]:invalid::-webkit-datetime-edit,
input[type="date"]:invalid::-webkit-datetime-edit-year-field,
input[type="date"]:invalid::-webkit-datetime-edit-month-field,
input[type="date"]:invalid::-webkit-datetime-edit-day-field {
    color: #ffffff !important;
    opacity: 1 !important;
}

/* Force calendar icon to be pure bright white */
input[type="date"]::-webkit-calendar-picker-indicator,
input[type="datetime-local"]::-webkit-calendar-picker-indicator,
input[type="month"]::-webkit-calendar-picker-indicator {
    filter: brightness(200%) grayscale(100%) !important;
    opacity: 1 !important;
}

/* 日付入力テキストを確実に白色にする */
input[type="date"],
input[type="date"]::-webkit-datetime-edit,
input[type="date"]::-webkit-datetime-edit-fields-wrapper,
input[type="date"]::-webkit-datetime-edit-year-field,
input[type="date"]::-webkit-datetime-edit-month-field,
input[type="date"]::-webkit-datetime-edit-day-field,
input[type="date"]::-webkit-datetime-edit-text {
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    opacity: 1 !important;
}




/* ===========================
   User Custom: Master Data elements precisely 12pt
   =========================== */
.excel-grid,
.excel-grid th,
.excel-grid td,
.excel-grid span,
.excel-grid div,
.excel-grid input,
.excel-grid select,
.excel-title,
.excel-search,
.excel-statusbar,
.excel-btn,
.dash-title {
  font-size: 13pt !important;
}

/* テーブル内ボタンのコンパクト化 */
table.excel-grid .excel-actions {
  display: flex;
  gap: 2px;
  align-items: center;
  padding: 0 !important;
  line-height: 1 !important;
}
table.excel-grid .excel-actions button,
table.excel-grid tbody button {
  padding: 1px 4px !important;
  line-height: 1.2 !important;
  min-height: 0 !important;
  height: auto !important;
}

/* ===========================
   User Custom: Calendar Picker Visibility in Dark Mode
   =========================== */
input[type="date"],
input[type="month"],
input[type="time"] {
  color: #e2e8f0 !important;
  background: var(--bg-input) !important;
  border: 2px solid rgba(59,130,246,0.5) !important;
  border-radius: 6px;
  padding: 6px 10px !important;
  font-weight: 700 !important;
}

/* カレンダーアイコンを白色に */
input[type="date"]::-webkit-calendar-picker-indicator,
input[type="month"]::-webkit-calendar-picker-indicator {
  filter: brightness(2) grayscale(100%);
  cursor: pointer;
  width: 22px;
  height: 22px;
}

input[type="date"]::-webkit-calendar-picker-indicator:hover,
input[type="month"]::-webkit-calendar-picker-indicator:hover,
input[type="time"]::-webkit-calendar-picker-indicator:hover {
  filter: brightness(2) grayscale(100%) drop-shadow(0 0 4px rgba(255,255,255,0.6));
}

/* 入力済みテキスト */
input[type="date"]::-webkit-datetime-edit,
input[type="month"]::-webkit-datetime-edit,
input[type="time"]::-webkit-datetime-edit {
  color: #e2e8f0;
  font-weight: 700;
}

input[type="date"]::-webkit-datetime-edit-fields-wrapper,
input[type="month"]::-webkit-datetime-edit-fields-wrapper {
  color: #e2e8f0;
}

/* フォーカス時の強調 */
input[type="date"]:focus,
input[type="month"]:focus,
input[type="time"]:focus {
  border-color: #3b82f6 !important;
  box-shadow: 0 0 0 3px rgba(59,130,246,0.3) !important;
  outline: none;
}

/* 日付・時間入力欄のダークモード設定 */
input[type="date"], input[type="month"], input[type="time"] {
    color-scheme: dark !important;
    color: #f8fafc;
}

/* カレンダー/時計アイコンを白色に */
input[type="date"]::-webkit-calendar-picker-indicator,
input[type="month"]::-webkit-calendar-picker-indicator,
input[type="time"]::-webkit-calendar-picker-indicator {
    filter: brightness(200%) grayscale(100%) !important;
    opacity: 1 !important;
    cursor: pointer;
}

/* 非選択時（yyyy/mm/dd）の文字色を明るくする */
input[type="date"]::-webkit-datetime-edit-year-field,
input[type="date"]::-webkit-datetime-edit-month-field,
input[type="date"]::-webkit-datetime-edit-day-field,
input[type="date"]::-webkit-datetime-edit-text {
    color: #f8fafc;
    opacity: 0.9;
}

/* 値が空の時の表示（yyyy/mm/ddなど）を特に明るく */
input[type="date"]:invalid::-webkit-datetime-edit {
    color: #cbd5e1; 
}
input[type="date"]::-webkit-datetime-edit-day-field,
input[type="date"]::-webkit-datetime-edit-text,
input[type="date"]::-webkit-datetime-edit {
    color: #ffffff !important;
    opacity: 1 !important;
}

/* Force empty state to pure white */
input[type="date"]:invalid::-webkit-datetime-edit,
input[type="date"]:invalid::-webkit-datetime-edit-year-field,
input[type="date"]:invalid::-webkit-datetime-edit-month-field,
input[type="date"]:invalid::-webkit-datetime-edit-day-field {
    color: #ffffff !important;
    opacity: 1 !important;
}

/* Force calendar icon to be pure bright white */
input[type="date"]::-webkit-calendar-picker-indicator,
input[type="datetime-local"]::-webkit-calendar-picker-indicator,
input[type="month"]::-webkit-calendar-picker-indicator {
    filter: brightness(200%) grayscale(100%) !important;
    opacity: 1 !important;
}

/* 日付入力テキストを確実に白色にする */
input[type="date"],
input[type="date"]::-webkit-datetime-edit,
input[type="date"]::-webkit-datetime-edit-fields-wrapper,
input[type="date"]::-webkit-datetime-edit-year-field,
input[type="date"]::-webkit-datetime-edit-month-field,
input[type="date"]::-webkit-datetime-edit-day-field,
input[type="date"]::-webkit-datetime-edit-text {
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    opacity: 1 !important;
}


/* ===========================
   iPhone / スマホ対応レスポンシブ最適化
   =========================== */
@media (max-width: 768px) {

  /* --- 全体のベースフォント --- */
  html {
    font-size: 11pt !important;
  }

  /* --- フォーム要素を縦並びに（表示切替は .is-open に任せる） --- */
  .kyotaku-second-row,
  .kyotaku-third-row {
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
  }
  .kyotaku-existing-fields > *,
  .kyotaku-new-fields > *,
  .kyotaku-second-row > *,
  .kyotaku-third-row > * {
    width: 100% !important;
    margin-left: 0 !important;
  }

  /* --- 入力欄: テキストを上下中央に整列（selectにdisplay:flexは付けない＝文字重なり防止） --- */
  .form-input,
  input[type="text"],
  input[type="number"],
  input[type="date"],
  input[type="time"] {
    height: 40px !important;
    min-height: 40px !important;
    line-height: 40px !important;
    padding: 0 10px !important;
    font-size: 16px !important;
    box-sizing: border-box !important;
    vertical-align: middle;
  }
  .form-select,
  select.form-select {
    height: 44px !important;
    min-height: 44px !important;
    max-height: 44px !important;
    line-height: normal !important;
    padding: 0 32px 0 10px !important;
    font-size: 16px !important;
    box-sizing: border-box !important;
    display: block !important;
    appearance: none !important;
    -webkit-appearance: none !important;
    background-color: var(--bg-input, #2b2b2b) !important;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23cbd5e1' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 10px center !important;
    background-size: 16px !important;
    color: var(--text-primary, #fff);
    overflow: hidden !important;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  /* textarea は行高固定しない */
  textarea,
  textarea.form-input {
    height: auto !important;
    min-height: 50px !important;
    line-height: 1.5 !important;
    padding: 8px 10px !important;
  }

  /* --- カード余白の最適化 --- */
  .card {
    padding: 12px !important;
    margin-bottom: 10px !important;
    border-radius: 12px !important;
  }

  .card-header {
    margin-bottom: 8px !important;
  }

  /* --- フォームグループ余白 --- */
  .form-group {
    margin-bottom: 10px !important;
  }

  .form-label {
    font-size: 10pt !important;
    margin-bottom: 4px !important;
  }

  /* --- KPIグリッド最適化 --- */
  .kpi-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
  }

  .kpi-card {
    padding: 10px !important;
  }

  .kpi-label {
    font-size: 9pt !important;
    margin-bottom: 4px !important;
  }

  .kpi-value {
    font-size: 10pt !important;
  }

  /* --- ボタン最適化 --- */
  .btn {
    padding: 10px 14px !important;
    font-size: 10pt !important;
  }

  .btn-sm {
    padding: 6px 10px !important;
    font-size: 9pt !important;
  }

  /* --- メインコンテンツ領域 --- */
  #main-content {
    padding-left: 8px !important;
    padding-right: 8px !important;
  }

  /* --- 居宅ブロック整列 --- */
  .kyotaku-block {
    padding: 10px !important;
    margin-bottom: 10px !important;
  }

  .kyotaku-block-header {
    margin-bottom: 8px !important;
  }

  /* --- CM入力フィールド --- */
  .cm-entry-fields {
    display: flex !important;
    flex-direction: column !important;
    gap: 6px !important;
    padding-left: 0 !important;
  }

  .cm-field {
    width: 100% !important;
  }

  .cm-field input {
    width: 100% !important;
    height: 40px !important;
    font-size: 12px !important;
    padding: 0 10px !important;
    line-height: 40px !important;
  }

  /* --- 2列/3列グリッドを1列に --- */
  .form-row {
    grid-template-columns: 1fr !important;
    gap: 8px !important;
  }

  .form-row-3 {
    grid-template-columns: 1fr !important;
    gap: 8px !important;
  }

  /* --- ランキングリスト --- */
  .ranking-item {
    padding: 8px 10px !important;
    gap: 8px !important;
  }

  .ranking-name {
    font-size: 10pt !important;
  }

  .ranking-value {
    font-size: 10pt !important;
  }

  /* --- バッジ --- */
  .badge {
    padding: 2px 8px !important;
    font-size: 9pt !important;
  }

  /* --- 売上内訳 --- */
  .rev-item {
    padding: 6px 10px !important;
  }

  .rev-label {
    font-size: 10pt !important;
  }

  .rev-value {
    font-size: 10pt !important;
  }

  /* --- 訪問時間スライダー --- */
  .vt-range-text {
    font-size: 11pt !important;
  }

  .dual-slider-labels {
    font-size: 9pt !important;
  }

  /* --- ドロップダウン最適化 --- */
  .cm-dropdown {
    max-height: 250px !important;
  }

  .cm-group-label {
    font-size: 10pt !important;
    padding: 8px 12px 4px !important;
  }

  .cm-option {
    padding: 8px 12px 8px 20px !important;
    font-size: 10pt !important;
  }

  /* --- KPIツールチップ --- */
  .kpi-tip .kpi-tip-body {
    min-width: 260px !important;
    max-width: 300px !important;
    font-size: 9pt !important;
    padding: 10px 14px !important;
  }

  /* --- ヘッダーナビボタン全体の最適化 --- */
  .nav-buttons-wrap {
    flex-wrap: wrap !important;
    gap: 4px !important;
  }

  .nav-btn {
    padding: 3px 8px !important;
    border-radius: 6px !important;
    line-height: 1.1 !important;
  }

  .nav-btn span {
    font-size: 8pt !important;
  }

  .nav-btn .nav-btn-icon {
    font-size: 8pt !important;
  }

  .nav-btn .nav-icon {
    font-size: 8pt !important;
  }

  /* ヘッダーエリア全体 */
  .app-header {
    padding: 4px 8px !important;
  }

  .app-title {
    font-size: 9pt !important;
  }

  .title-icon {
    font-size: 9pt !important;
  }

  /* ポータルナビボタン */
  .portal-nav-btn {
    padding: 0 8px !important;
    height: 34px !important;
  }

  .portal-nav-btn .hdr-btn-text {
    font-size: 8pt !important;
  }

  .portal-nav-btn .hdr-btn-icon {
    font-size: 8pt !important;
  }

  /* ログインモード表示 */
  #global-login-mode-desc {
    font-size: 8pt !important;
  }

  /* 戻るボタン */
  .excel-back-btn {
    font-size: 8pt !important;
    padding: 4px 10px !important;
  }

  /* 階層ラベル */
  #layer-label {
    font-size: 8pt !important;
    padding: 3px 8px !important;
  }

  /* 日付入力欄 */
  #activity-date-toggle {
    min-width: 100px !important;
    padding: 0 6px !important;
  }

  /* 未読バッジ */
  .contact-unread-badge,
  #wh-pending-badge {
    font-size: 7pt !important;
    min-width: 16px !important;
    height: 16px !important;
  }

  /* ページ全体の横はみ出し防止 */
  body {
    overflow-x: hidden !important;
  }

  #main-content,
  .page-enter {
    max-width: 100vw !important;
    overflow-x: hidden !important;
    box-sizing: border-box !important;
  }

  /* === 検索画面のスマホ最適化 === */

  /* 検索テーブル全体のフォント縮小 */
  .excel-grid,
  .excel-grid th,
  .excel-grid td,
  .excel-grid span,
  .excel-grid div,
  .excel-grid input,
  .excel-grid select {
    font-size: 8pt !important;
  }

  /* テーブルを横スクロール可能にする */
  .excel-table-wrap {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    max-width: 100vw !important;
  }

  table.excel-grid {
    min-width: 600px !important;
    table-layout: auto !important;
  }

  table.excel-grid thead th {
    padding: 3px 4px !important;
    font-size: 7pt !important;
    letter-spacing: 0 !important;
  }

  table.excel-grid tbody td {
    padding: 2px 4px !important;
    font-size: 7pt !important;
    line-height: 1.2 !important;
  }

  /* テーブルカラムの最小幅を縮小 */
  table.excel-grid thead th,
  table.excel-grid tbody td {
    min-width: unset !important;
  }

  /* 検索フォーム: 入力欄を縦並びにする */
  #search-daily-form,
  #search-monthly-form,
  #search-range-form {
    flex-direction: column !important;
    gap: 4px !important;
    align-items: stretch !important;
  }

  #search-daily-form > *,
  #search-monthly-form > *,
  #search-range-form > * {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }

  /* 期間検索の ～ マーク行を横並びに */
  #search-range-form input[type="date"] {
    width: 45% !important;
    display: inline-block !important;
  }

  /* 検索ツールバー */
  .excel-toolbar {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 4px !important;
    padding: 6px 8px !important;
  }

  .excel-title {
    font-size: 9pt !important;
  }

  .excel-btn-group {
    display: flex !important;
    gap: 4px !important;
  }

  .excel-btn {
    font-size: 8pt !important;
    padding: 4px 8px !important;
  }

  .excel-search {
    font-size: 8pt !important;
    padding: 4px 6px !important;
  }

  /* 検索結果サマリーバー */
  .excel-statusbar {
    font-size: 7pt !important;
    padding: 3px 8px !important;
  }

  /* 検索結果サマリーヘッダー */
  #search-result > .excel-wrap > div:first-child {
    font-size: 7pt !important;
    padding: 4px 8px !important;
    flex-direction: column !important;
    gap: 4px !important;
  }

  #search-result > .excel-wrap > div:first-child > div {
    gap: 6px !important;
    flex-wrap: wrap !important;
  }

  /* AI営業コーチ */
  .ai-comment-area {
    padding: 6px !important;
  }

  .ai-bubble {
    font-size: 8pt !important;
    padding: 8px !important;
  }

  .ai-bubble-header {
    font-size: 8pt !important;
  }

  .advice-item {
    font-size: 8pt !important;
    line-height: 1.4 !important;
  }

  /* Excelラップ全体 */
  .excel-wrap {
    margin: 0 !important;
    border-radius: 4px !important;
  }

  /* === 給付管理画面のスマホ最適化 === */

  /* フィルタグリッドを2列に変更 */
  #benefits-filter-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 6px !important;
  }

  /* ヘッダー部分 */
  .page-enter > div:first-child {
    flex-direction: column !important;
    gap: 8px !important;
    padding-bottom: 8px !important;
    margin-bottom: 12px !important;
  }

  .page-enter > div:first-child h2 {
    font-size: 1rem !important;
  }

  .page-enter > div:first-child p {
    font-size: 0.7rem !important;
  }

  /* サマリーカード: 5列→2列 */
  .page-enter > div:nth-child(3) {
    grid-template-columns: 1fr 1fr !important;
    gap: 6px !important;
  }

  .page-enter > div:nth-child(3) > div {
    padding: 8px !important;
    border-radius: 8px !important;
  }

  .page-enter > div:nth-child(3) > div > div:first-child {
    font-size: 0.65rem !important;
  }

  .page-enter > div:nth-child(3) > div > div:last-child {
    font-size: 1.2rem !important;
    margin-top: 4px !important;
  }

  /* フィルタのselect要素 */
  .page-enter select {
    padding: 6px 8px !important;
    font-size: 0.75rem !important;
  }

  .page-enter label {
    font-size: 0.7rem !important;
  }

  /* 給付テーブルのスクロール */
  #table-benefits {
    font-size: 0.7rem !important;
    min-width: 900px !important;
  }

  #table-benefits th {
    padding: 4px 6px !important;
    font-size: 0.65rem !important;
  }

  #table-benefits td {
    padding: 3px 6px !important;
    font-size: 0.65rem !important;
  }

  /* 介護度別顧客数カードのフォント */
  #sum-benefits-carelevel {
    font-size: 0.7rem !important;
  }

  /* ページネーション */
  #btn-benefits-prev,
  #btn-benefits-next {
    padding: 6px 10px !important;
    font-size: 0.75rem !important;
  }

  #span-benefits-page {
    font-size: 0.7rem !important;
  }

  /* === マスタ画面ダッシュボードのスマホ最適化 === */

  /* カードグリッド: 5列→2列 */
  .dash-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 6px !important;
  }

  /* カードを横書きレイアウトに変更 */
  .dash-card {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    text-align: left !important;
    padding: 8px 10px !important;
    gap: 8px !important;
    min-height: 0 !important;
  }

  /* アイコン: 左側に小さく配置 */
  .dash-icon {
    font-size: 1.2rem !important;
    margin-bottom: 0 !important;
    flex-shrink: 0 !important;
  }

  /* テキスト部分を右に配置 */
  .dash-card .dash-title {
    font-size: 0.65rem !important;
    margin-bottom: 0 !important;
    line-height: 1.2 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  .dash-card .dash-count {
    font-size: 0.7rem !important;
    margin-bottom: 0 !important;
  }

  .dash-card .dash-sub {
    font-size: 0.55rem !important;
    line-height: 1.1 !important;
    display: none !important;
  }

  /* ドラッグハンドル */
  .dash-drag-handle {
    font-size: 0.7rem !important;
    top: 2px !important;
    right: 4px !important;
  }

  /* セクションヘッダー */
  .section-title {
    font-size: 1rem !important;
  }

  /* === 集計モード切替バーのスマホ最適化 === */
  .benefits-view-btn {
    padding: 4px 8px !important;
    font-size: 0.65rem !important;
  }

  /* グループ集計テーブルのスマホ対応 */
  #benefits-group-area table {
    font-size: 0.7rem !important;
    min-width: 500px !important;
  }

  #benefits-group-area th,
  #benefits-group-area td {
    padding: 6px 8px !important;
    font-size: 0.7rem !important;
  }

  /* PDF/CSVボタン */
  #btn-benefits-csv,
  #btn-benefits-pdf {
    padding: 6px 10px !important;
    font-size: 0.7rem !important;
  }

} /* end of @media (max-width: 768px) */

/* ===========================
   KPI Tooltip (フローティング根拠表示)
   =========================== */
.kpi-tip {
  position: relative;
  cursor: help;
} /* end of .kpi-tip */

.kpi-tip .kpi-tip-body,
.kpia-floating-tip {
  min-width: 280px;
  max-width: 380px;
  padding: 10px 12px;
  background: rgba(15, 23, 42, 0.97);
  border: 1px solid rgba(79, 140, 255, 0.35);
  border-radius: 8px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5), 0 0 12px rgba(79, 140, 255, 0.1);
  backdrop-filter: blur(12px);
  font-size: 0.78rem !important;
  line-height: 1.45;
  color: #e2e8f0;
  white-space: normal;
  text-align: left;
} /* end of shared tip panel */

.kpi-tip .kpi-tip-body {
  display: none;
  position: absolute;
  bottom: calc(100% + 6px);
  right: 0;
  z-index: 9999;
  pointer-events: none;
} /* end of .kpi-tip-body */

.kpia-floating-tip {
  display: none;
  position: fixed;
  z-index: 100000;
  pointer-events: none;
}

.kpi-tip--fixed .kpi-tip-body {
  display: none !important;
}

.kpi-tip--fixed:hover .kpi-tip-body {
  display: none !important;
}

.kpi-tip.tip-down-right .kpi-tip-body {
  bottom: auto;
  top: calc(100% + 6px);
  right: auto;
  left: 0;
}

.kpi-tip:not(.kpi-tip--fixed):hover .kpi-tip-body {
  display: block;
} /* end of .kpi-tip:hover */

.kpi-tip:hover {
  z-index: 99999;
}

.kpi-tip-body .tip-title,
.kpia-floating-tip .tip-title {
  font-weight: 700;
  color: #60a5fa;
  font-size: 0.82rem !important;
  margin-bottom: 4px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  padding-bottom: 3px;
} /* end of .tip-title */

.kpi-tip-body .tip-row,
.kpia-floating-tip .tip-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.76rem;
} /* end of .tip-row */

.kpi-tip-body .tip-label,
.kpia-floating-tip .tip-label {
  color: #94a3b8;
  flex-shrink: 0;
} /* end of .tip-label */

.kpi-tip-body .tip-val,
.kpia-floating-tip .tip-val {
  color: #fcd34d;
  font-weight: 600;
} /* end of .tip-val */

.kpi-tip-body .tip-formula,
.kpia-floating-tip .tip-formula {
  color: #34d399;
  font-size: 0.72rem !important;
  margin-top: 5px;
  padding-top: 4px;
  border-top: 1px solid rgba(255,255,255,0.08);
} /* end of .tip-formula */

.kpi-tip-body .tip-context,
.kpia-floating-tip .tip-context {
  font-size: 0.76rem;
}

/* ぐるぐるマーク (CSS Spinner) */
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
.sys-spinner {
  display: inline-block;
  width: 1.2em;
  height: 1.2em;
  border: 3px solid rgba(255, 255, 255, 0.2);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  vertical-align: middle;
  margin-right: 4px;
}

/* ===========================
   音声入力ボタン
   =========================== */
@keyframes voice-pulse {
  0%, 100% {
    box-shadow: 0 0 6px rgba(239, 68, 68, 0.3);
    transform: scale(1);
  }
  50% {
    box-shadow: 0 0 18px rgba(239, 68, 68, 0.6);
    transform: scale(1.12);
  }
} /* end of voice-pulse */

.voice-input-btn:hover {
  background: rgba(59, 130, 246, 0.3) !important;
  transform: scale(1.1);
} /* end of voice-input-btn hover */

.time-voice-btn:hover {
  background: rgba(59, 130, 246, 0.3) !important;
  transform: scale(1.15);
} /* end of time-voice-btn hover */

.time-voice-feedback {
  animation: fadeInDown 0.2s ease;
} /* end of time-voice-feedback */

@keyframes fadeInDown {
  from { opacity: 0; transform: translateX(-50%) translateY(-6px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
} /* end of fadeInDown */

.voice-memo-wrapper {
  position: relative;
} /* end of voice-memo-wrapper */

/* ===========================
   プレースホルダー・説明文は薄灰色（濃度 1/2）
   =========================== */
.form-input::placeholder,
textarea.form-input::placeholder,
input::placeholder,
textarea::placeholder {
  color: #cbd5e1 !important;
  opacity: 0.5 !important;
  -webkit-text-fill-color: rgba(203, 213, 225, 0.5) !important;
}

.form-select option[value=""],
.form-select option:disabled {
  color: rgba(203, 213, 225, 0.5) !important;
}

/* 未選択のセレクト説明文（居宅を選択… 等） */
.form-select:invalid,
.form-select.placeholder-shown,
select.form-select:has(option[value=""]:checked) {
  color: rgba(203, 213, 225, 0.5) !important;
}

.form-input:disabled,
.form-select:disabled,
textarea.form-input:disabled {
  color: #94a3b8 !important;
  opacity: 1 !important;
  -webkit-text-fill-color: #94a3b8 !important;
}

/* 計画書：商品選択後の遅延ローディング */
.sp-product-loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000020;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.82);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.sp-product-loading-overlay__panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 32px 40px;
  border-radius: 16px;
  background: rgba(30, 41, 59, 0.95);
  border: 1px solid rgba(148, 163, 184, 0.25);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
  text-align: center;
  max-width: min(360px, 90vw);
}
.sp-product-loading-overlay__spinner {
  width: 56px;
  height: 56px;
  border: 5px solid rgba(147, 197, 253, 0.2);
  border-top-color: #60a5fa;
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}
.sp-product-loading-overlay__title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #e2e8f0;
  letter-spacing: 0.04em;
}
.sp-product-loading-overlay__msg {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.65;
  color: #94a3b8;
}

/* CM：AI自動提案チェックリスト */
.ai-suggest-checklist-panel {
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.35);
  border-radius: 8px;
  padding: 10px 12px;
}
.ai-suggest-checklist-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}
.ai-suggest-checklist-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: #6ee7b7;
}
.ai-suggest-checklist-actions {
  display: flex;
  gap: 6px;
}
.ai-suggest-checklist-btn {
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid rgba(148, 163, 184, 0.35);
  color: #cbd5e1;
  border-radius: 4px;
  padding: 2px 8px;
  font-size: 0.72rem;
  cursor: pointer;
}
.ai-suggest-checklist-btn:hover {
  background: rgba(59, 130, 246, 0.2);
  border-color: rgba(59, 130, 246, 0.45);
  color: #e2e8f0;
}
.ai-suggest-checklist-lead {
  margin: 0 0 8px;
  font-size: 0.75rem;
  color: #94a3b8;
  line-height: 1.5;
}
.ai-suggest-checklist-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: min(320px, 42vh);
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
.ai-suggest-checklist-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 6px;
  background: rgba(15, 23, 42, 0.45);
  border: 1px solid rgba(52, 211, 153, 0.35);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, opacity 0.15s;
}
.ai-suggest-checklist-item:hover {
  background: rgba(16, 185, 129, 0.12);
}
.ai-suggest-checklist-item--off {
  opacity: 0.55;
  border-color: rgba(148, 163, 184, 0.25);
  background: rgba(15, 23, 42, 0.25);
}
.ai-suggest-checklist-item .ai-suggest-check {
  margin-top: 3px;
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  accent-color: #34d399;
  cursor: pointer;
}
.ai-suggest-checklist-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.ai-suggest-checklist-name {
  font-size: 0.88rem;
  font-weight: 700;
  color: #e2e8f0;
  line-height: 1.35;
}
.ai-suggest-checklist-reason {
  font-size: 0.74rem;
  color: #94a3b8;
  line-height: 1.45;
}

/* 出荷依頼: yyyy/mm/dd 表示用 date ラッパー */
.sr-date-wrap {
  position: relative;
  overflow: hidden;
  cursor: pointer;
}
.sr-date-wrap .sr-date-display-text {
  position: relative;
  z-index: 2;
  pointer-events: none;
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  padding: 0;
  margin: 0;
  color: #fff;
}
.sr-date-wrap .sr-date-display-text::placeholder {
  color: #cbd5e1;
}
.sr-date-wrap input[type="date"].sr-date-hidden {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border: none;
  opacity: 0 !important;
  pointer-events: none !important;
  color: transparent !important;
  background: transparent !important;
  z-index: 1;
  -webkit-appearance: none;
  appearance: none;
}
.sr-date-wrap input[type="date"].sr-date-hidden::-webkit-datetime-edit,
.sr-date-wrap input[type="date"].sr-date-hidden::-webkit-datetime-edit-fields-wrapper,
.sr-date-wrap input[type="date"].sr-date-hidden::-webkit-datetime-edit-text,
.sr-date-wrap input[type="date"].sr-date-hidden::-webkit-datetime-edit-month-field,
.sr-date-wrap input[type="date"].sr-date-hidden::-webkit-datetime-edit-day-field,
.sr-date-wrap input[type="date"].sr-date-hidden::-webkit-datetime-edit-year-field {
  display: none !important;
}
.sr-date-wrap input[type="date"].sr-date-hidden::-webkit-calendar-picker-indicator {
  display: none !important;
  opacity: 0 !important;
  width: 0 !important;
  height: 0 !important;
}

/* ===========================
   日報: フォント統一 ＋ 詳細（広）／時間（2行）
   =========================== */
.activity-page,
.activity-page .activity-sticky-bar,
.activity-page .kyotaku-block,
.activity-page .kyotaku-block *:not(.btn-voice-input):not(.btn-time-voice),
.activity-page .activity-sticky-bar *:not(#activity-page-close) {
  font-family: var(--font-family) !important;
}
.activity-page,
.activity-page .kyotaku-block,
.activity-page .kyotaku-block *:not(.btn-voice-input):not(.btn-time-voice):not(#activity-page-close),
.activity-page .activity-sticky-bar,
.activity-page .activity-sticky-bar button,
.activity-page .activity-sticky-bar span,
.activity-page .activity-sticky-bar input,
.activity-page .activity-top-tabs button:not(#edit-filter-ai-btn) {
  font-size: 14px !important;
  line-height: 1.35 !important;
  -webkit-text-size-adjust: 100%;
}
.activity-page .activity-top-tabs #edit-filter-ai-btn {
  height: 36px !important;
  padding: 0 12px !important;
  font-size: 0.78rem !important;
  line-height: 1 !important;
  align-items: center !important;
  justify-content: center !important;
  box-sizing: border-box;
}
.activity-page #activity-page-close {
  font-size: 1.4rem !important;
}
.activity-page .kyotaku-block .act-field-label,
.activity-page .kyotaku-block .kyotaku-block-num,
.activity-page .kyotaku-block .visit-type-tab,
.activity-page .kyotaku-block .btn-new-customer-toggle,
.activity-page .kyotaku-block .act-time-tag {
  font-weight: 700 !important;
}

.act-detail-time-row {
  display: grid !important;
  grid-template-columns: minmax(0, 1.55fr) minmax(158px, 0.95fr) !important;
  gap: 6px !important;
  margin-top: 6px !important;
  margin-bottom: 6px !important;
  align-items: stretch !important;
}
.act-detail-wrap {
  position: relative !important;
  min-width: 0 !important;
  width: 100% !important;
  overflow: visible !important;
}
.act-detail-wrap .shared-detail-text {
  width: 100% !important;
  height: 100% !important;
  min-height: 64px !important;
  resize: vertical !important;
  box-sizing: border-box !important;
  padding: 8px 36px 8px 10px !important;
}
.act-detail-wrap .btn-voice-input {
  position: absolute !important;
  bottom: 6px !important;
  right: 6px !important;
  top: auto !important;
  left: auto !important;
  background: rgba(255,255,255,0.85) !important;
  border: 1px solid #ccc !important;
  border-radius: 50% !important;
  cursor: pointer !important;
  font-size: 14px !important;
  line-height: 1 !important;
  color: #4f8cff !important;
  padding: 0 !important;
  width: 28px !important;
  height: 28px !important;
  min-width: 28px !important;
  max-width: 28px !important;
  min-height: 28px !important;
  max-height: 28px !important;
  aspect-ratio: 1 / 1 !important;
  box-sizing: border-box !important;
  display: flex !important;
  visibility: visible !important;
  opacity: 1 !important;
  align-items: center !important;
  justify-content: center !important;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15) !important;
  pointer-events: auto !important;
  z-index: 30 !important;
  touch-action: manipulation !important;
  -webkit-tap-highlight-color: transparent;
  flex: none !important;
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
/* 日報ヘッダー日付: 絵文字📅のみ表示（ネイティブアイコン二重表示を防止） */
#activity-date-toggle input.activity-date-native,
#activity-date-toggle input[type="date"].activity-date-native,
#activity-date-toggle input[type="month"].activity-date-native {
  opacity: 0 !important;
  pointer-events: none !important;
  border: none !important;
  background: transparent !important;
  color: transparent !important;
  -webkit-text-fill-color: transparent !important;
}
#activity-date-toggle input.activity-date-native::-webkit-calendar-picker-indicator,
#activity-date-toggle input[type="date"].activity-date-native::-webkit-calendar-picker-indicator,
#activity-date-toggle input[type="month"].activity-date-native::-webkit-calendar-picker-indicator {
  opacity: 0 !important;
  display: none !important;
  width: 0 !important;
  height: 0 !important;
  pointer-events: none !important;
  filter: none !important;
}
#activity-date-toggle input.activity-date-native.is-hidden-picker {
  display: none !important;
}
.act-time-wrap {
  min-width: 0 !important;
  width: 100% !important;
  display: flex !important;
}
.act-time-wrap .time-input-container.act-time-stack {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 4px !important;
  width: 100% !important;
  background: var(--bg-input) !important;
  border-radius: 6px !important;
  border: 1px solid rgba(255,255,255,0.12) !important;
  white-space: nowrap !important;
  min-height: 64px !important;
  height: 100% !important;
  box-sizing: border-box !important;
  position: relative !important;
  /* 右下のマイク（28px + 余白6px）分を確保し、詳細メモ側と高さを揃える */
  padding: 4px 36px 4px 6px !important;
}
.act-time-lines {
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
  justify-content: center !important;
  gap: 4px !important;
  flex: 1 1 auto !important;
  min-width: 0 !important;
}
.act-time-line {
  display: flex !important;
  align-items: center !important;
  gap: 4px !important;
  width: 100% !important;
  min-width: 0 !important;
}
.act-time-tag {
  flex: 0 0 2em !important;
  width: 2em !important;
  color: #94a3b8 !important;
  white-space: nowrap !important;
}
.act-time-wrap .kyotaku-visit-start,
.act-time-wrap .kyotaku-visit-end {
  width: 100% !important;
  min-width: 5.8em !important;
  flex: 1 1 auto !important;
  box-sizing: border-box !important;
  text-align: left !important;
  color: #f8fafc !important;
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
  margin: 0 !important;
  color-scheme: dark !important;
  font-weight: 600 !important;
  height: 26px !important;
  min-height: 26px !important;
  max-height: 26px !important;
}
.act-time-wrap .btn-time-voice {
  /* 詳細メモのマイクと同じ右下位置 */
  position: absolute !important;
  bottom: 6px !important;
  right: 6px !important;
  top: auto !important;
  left: auto !important;
  background: rgba(255,255,255,0.85) !important;
  border: 1px solid #ccc !important;
  border-radius: 50% !important;
  cursor: pointer !important;
  font-size: 14px !important;
  line-height: 1 !important;
  color: #4f8cff !important;
  padding: 0 !important;
  width: 28px !important;
  height: 28px !important;
  min-width: 28px !important;
  max-width: 28px !important;
  min-height: 28px !important;
  max-height: 28px !important;
  aspect-ratio: 1 / 1 !important;
  box-sizing: border-box !important;
  display: flex !important;
  visibility: visible !important;
  opacity: 1 !important;
  align-items: center !important;
  justify-content: center !important;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15) !important;
  flex: none !important;
  margin: 0 !important;
  pointer-events: auto !important;
  z-index: 30 !important;
  touch-action: manipulation !important;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
/* 録音中: マイクをパルス反応 */
@keyframes mic-recording-pulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.55), 0 1px 3px rgba(0,0,0,0.2);
  }
  50% {
    transform: scale(1.14);
    box-shadow: 0 0 0 10px rgba(239, 68, 68, 0), 0 0 14px rgba(248, 113, 113, 0.75);
  }
}
.act-detail-wrap .btn-voice-input.mic-recording,
.act-time-wrap .btn-time-voice.mic-recording,
.btn-voice-input.mic-recording,
.btn-time-voice.mic-recording {
  background: #ef4444 !important;
  border-color: #fca5a5 !important;
  color: #fff !important;
  animation: mic-recording-pulse 0.9s ease-in-out infinite !important;
}
@media (max-width: 430px) {
  .act-detail-time-row {
    grid-template-columns: minmax(0, 1.35fr) minmax(152px, 1fr) !important;
  }
}
html.iphone15-preview .act-detail-time-row {
  grid-template-columns: minmax(0, 1.35fr) minmax(152px, 1fr) !important;
}

/* ===========================
   日報: 左ラベル＋右入力の1行レイアウト
   =========================== */
.act-field-row {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  width: 100% !important;
  min-height: 44px !important;
  box-sizing: border-box !important;
  overflow: visible !important;
}
/* テーマ行を誤表示しない */
.act-field-row-theme,
select.cm-act-select[hidden] {
  display: none !important;
}
.act-field-label {
  flex: 0 0 5.2em !important;
  width: 5.2em !important;
  max-width: 5.2em !important;
  color: #94a3b8 !important;
  font-weight: 700 !important;
  white-space: nowrap !important;
  text-align: left !important;
  overflow: visible !important;
  letter-spacing: 0 !important;
  font-family: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic UI", "Yu Gothic", Meiryo, sans-serif !important;
}
.kyotaku-customer-row .btn-new-customer-toggle {
  font-family: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic UI", "Yu Gothic", Meiryo, sans-serif !important;
  letter-spacing: 0 !important;
  white-space: nowrap !important;
  overflow: visible !important;
  min-width: 4.8em !important;
}
.act-field-control {
  flex: 1 1 auto !important;
  min-width: 0 !important;
  width: auto !important;
}
.kyotaku-existing-fields,
.kyotaku-new-fields,
.kyotaku-second-row {
  display: none;
  flex-direction: column;
  gap: 8px;
  grid-template-columns: none !important;
  margin-bottom: 6px;
}
.kyotaku-existing-fields.is-open,
.kyotaku-new-fields.is-open,
.kyotaku-second-row {
  display: flex !important;
}
/* makeSelectSearchable 後の本体selectは必ず隠す（二重表示の原因） */
.act-searchable-native,
select.form-select[data-searchable="true"],
.kyotaku-existing-fields select.form-select[data-searchable="true"],
.kyotaku-customer-row select.form-select[data-searchable="true"] {
  display: none !important;
  position: absolute !important;
  width: 0 !important;
  height: 0 !important;
  max-height: 0 !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
}
/* 検索＋選択結果を1行表示 */
.act-searchable-wrap {
  position: relative !important;
  width: 100% !important;
  max-width: 100% !important;
  height: 44px !important;
  min-height: 44px !important;
  flex: 0 0 auto !important;
  box-sizing: border-box !important;
  overflow: visible !important;
  z-index: 5;
}
.act-searchable-wrap.is-open {
  z-index: 200;
}
.act-searchable-dropdown,
.act-searchable-dropdown div {
  z-index: 100000 !important;
  font-family: var(--font-family) !important;
  font-size: 14px !important;
  line-height: 1.35 !important;
}
.act-searchable-wrap > input.act-searchable-input,
.act-searchable-wrap > input.form-input {
  width: 100% !important;
  height: 44px !important;
  min-height: 44px !important;
  max-height: 44px !important;
  line-height: normal !important;
  font-size: 14px !important;
  margin: 0 !important;
  padding: 0 32px 0 12px !important;
  box-sizing: border-box !important;
  border: 1px solid rgba(59, 130, 246, 0.45) !important;
  border-radius: 8px !important;
  background: var(--bg-input, #2b2b2b) !important;
  color: #e2e8f0 !important;
  -webkit-text-fill-color: #e2e8f0 !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}
.act-searchable-wrap > input.act-searchable-input:disabled,
.act-searchable-wrap > input.form-input:disabled {
  color: #94a3b8 !important;
  -webkit-text-fill-color: #94a3b8 !important;
}
.kyotaku-new-fields > .form-input {
  width: 100% !important;
  height: 44px !important;
  min-height: 44px !important;
  max-height: 44px !important;
  font-size: 16px !important;
  box-sizing: border-box !important;
  border: 1px solid rgba(59, 130, 246, 0.45) !important;
  border-radius: 8px !important;
}
.kyotaku-customer-row .cm-insured-number-container {
  position: relative !important;
}
.kyotaku-customer-row {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: 6px !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  min-height: 44px !important;
  box-sizing: border-box !important;
  overflow: visible !important;
}
.kyotaku-block.card,
.visit-mode-kyotaku,
.kyotaku-existing-fields,
.act-field-control {
  overflow: visible !important;
}
.act-field-control .act-searchable-wrap,
.act-field-control > .form-select,
.act-field-control > .form-input {
  width: 100% !important;
}
.kyotaku-customer-row .cm-insured-number-container {
  flex: 1 1 auto !important;
  min-width: 0 !important;
  height: 44px !important;
  max-height: 44px !important;
  overflow: hidden !important;
}
.kyotaku-customer-row .form-select,
.kyotaku-customer-row .form-input {
  width: 100% !important;
  height: 44px !important;
  min-height: 44px !important;
  max-height: 44px !important;
  line-height: normal !important;
  margin: 0 !important;
  font-size: 16px !important;
}
.kyotaku-customer-row .btn-new-customer-toggle {
  flex: 0 0 auto !important;
  height: 36px !important;
  align-self: center !important;
}

/* 日報タブ行と #1 行の重なり防止 */
.activity-page .activity-sticky-bar {
  position: sticky;
  top: 0;
  z-index: 90;
  background: var(--bg-primary) !important;
  isolation: isolate;
}
.activity-page .kyotaku-block {
  position: relative;
  z-index: 1;
  margin-top: 0 !important;
  clear: both;
}
.activity-page .kyotaku-block-top {
  position: relative;
  z-index: 1;
  margin-top: 0 !important;
  padding-top: 2px;
}
html.iphone15-preview .activity-page .activity-sticky-bar {
  position: relative !important;
  top: auto !important;
}
html.iphone15-preview #main-content {
  padding-top: 12px !important;
}

@media (max-width: 430px) {
  .visit-type-tab {
    font-size: 12px !important;
    padding: 8px 2px !important;
    min-width: 0 !important;
    overflow: visible !important;
  }
  .visit-type-group {
    width: 100% !important;
    overflow: visible !important;
  }
  .kyotaku-block-top {
    overflow: visible !important;
  }
  .kyotaku-second-row {
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
  }
  .kyotaku-second-row > * {
    width: 100% !important;
    max-width: 100% !important;
    grid-column: auto !important;
    min-width: 0 !important;
  }
  .activity-top-tabs {
    flex-wrap: wrap !important;
  }
  .activity-page .activity-sticky-bar {
    position: relative !important;
    top: auto !important;
  }
  .act-detail-wrap .btn-voice-input,
  .act-time-wrap .btn-time-voice {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: absolute !important;
    bottom: 6px !important;
    right: 6px !important;
    width: 28px !important;
    height: 28px !important;
    max-width: 28px !important;
    max-height: 28px !important;
  }
}

html.iphone15-preview .visit-type-tab {
  font-size: 14px !important;
  padding: 7px 4px !important;
}
html.iphone15-preview .activity-top-tabs {
  flex-wrap: wrap !important;
}
html.iphone15-preview .kyotaku-second-row {
  display: flex !important;
  flex-direction: column !important;
  gap: 8px !important;
}
html.iphone15-preview .kyotaku-second-row > * {
  width: 100% !important;
  grid-column: auto !important;
}

/* 日報 / 記録 / KPI分析 タブ（UA既定の灰ボタンを上書き） */
.activity-page .activity-top-tabs .act-top-tab,
.kpia-page .kpia-sub-nav .kpia-sub-tab {
  height: 34px !important;
  min-height: 34px !important;
  max-height: 34px !important;
  padding: 0 8px !important;
  border-radius: 4px !important;
  font-size: 9pt !important;
  line-height: 1 !important;
  font-family: Meiryo, "Hiragino Sans", "Noto Sans JP", sans-serif !important;
  font-weight: 500 !important;
  font-synthesis: none !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 3px !important;
  cursor: pointer !important;
  white-space: nowrap !important;
  box-sizing: border-box !important;
  flex: 0 0 auto !important;
  -webkit-appearance: none !important;
  appearance: none !important;
  background: rgba(15, 23, 42, 0.95) !important;
  color: #94a3b8 !important;
  border: 1px solid rgba(255, 255, 255, 0.18) !important;
  box-shadow: none !important;
  text-shadow: none !important;
  filter: none !important;
}
.activity-page .activity-top-tabs .act-top-tab {
  height: 36px !important;
  min-height: 36px !important;
  max-height: 36px !important;
}
.activity-page .activity-top-tabs .act-top-tab.is-active.is-record,
.kpia-page .kpia-sub-nav .kpia-sub-tab.is-active.is-record {
  background: #2a7de1 !important;
  border-color: #2a7de1 !important;
  color: #ffffff !important;
}
.activity-page .activity-top-tabs .act-top-tab.is-active.is-edit,
.kpia-page .kpia-sub-nav .kpia-sub-tab.is-active.is-edit {
  background: #f59e0b !important;
  border-color: #f59e0b !important;
  color: #ffffff !important;
}
.activity-page .activity-top-tabs .act-top-tab.is-active.is-kpi,
.kpia-page .kpia-sub-nav .kpia-sub-tab.is-active.is-kpi {
  background: #3b82f6 !important;
  border-color: #3b82f6 !important;
  color: #ffffff !important;
}
.kpia-page .kpia-sub-nav .kpia-sub-tab > span,
.activity-page .activity-top-tabs .act-top-tab > span {
  color: inherit !important;
  text-shadow: none !important;
}
.kpia-page .kpia-sub-nav .kpia-ai-btn {
  height: 34px !important;
  min-height: 34px !important;
  padding: 0 10px !important;
  border-radius: 16px !important;
  border: none !important;
  font-size: 9pt !important;
  font-weight: 500 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 3px !important;
  cursor: pointer !important;
  white-space: nowrap !important;
  -webkit-appearance: none !important;
  appearance: none !important;
  background: linear-gradient(135deg, #8b5cf6, #3b82f6) !important;
  color: #ffffff !important;
  box-shadow: none !important;
  margin-left: auto;
}
.kpia-page .kpia-sub-nav .kpia-ai-btn > span {
  color: #ffffff !important;
}
