/* =============================================
   不動産管理システム - カスタムスタイル
   ============================================= */

:root {
  --primary: #1e3a5f;
  --primary-light: #2d5a8e;
  --primary-pale: #e8f0fb;
  --accent: #c8a96e;
  --accent-light: #f5edd8;
  --success: #16a34a;
  --warning: #d97706;
  --danger: #dc2626;
  --gray-bg: #f7f8fc;
  --sidebar-w: 240px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Hiragino Kaku Gothic Pro', 'Yu Gothic', 'Meiryo', sans-serif; background: var(--gray-bg); color: #1a202c; }

/* ---- サイドバー ---- */
#sidebar {
  position: fixed; top: 0; left: 0; width: var(--sidebar-w);
  height: 100vh; background: var(--primary); z-index: 100;
  display: flex; flex-direction: column; overflow-y: auto;
}
#sidebar .logo {
  padding: 20px 16px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.12);
}
#sidebar .logo h1 { color: #fff; font-size: 13px; font-weight: 700; line-height: 1.4; }
#sidebar .logo .sub { color: var(--accent); font-size: 10px; margin-top: 2px; }

#sidebar nav { padding: 8px 0; flex: 1; }
#sidebar nav .nav-section { color: rgba(255,255,255,0.4); font-size: 10px; font-weight: 700; letter-spacing: 0.08em; padding: 16px 16px 4px; text-transform: uppercase; }
#sidebar nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 16px; color: rgba(255,255,255,0.75); font-size: 13px;
  text-decoration: none; cursor: pointer; transition: all 0.15s;
  border-left: 3px solid transparent;
}
#sidebar nav a:hover { background: rgba(255,255,255,0.08); color: #fff; }
#sidebar nav a.active { background: rgba(200,169,110,0.18); color: var(--accent); border-left-color: var(--accent); }
#sidebar nav a i { width: 16px; text-align: center; font-size: 13px; }
#sidebar nav a.nav-sub-link {
  padding: 8px 16px 8px 34px;
  font-size: 12px;
  color: rgba(255,255,255,0.72);
}
#sidebar nav a.nav-sub-link:hover { color: #fff; }
#sidebar nav a.nav-sub-link.active {
  color: var(--accent);
  background: rgba(200,169,110,0.12);
}
#sidebar nav a.nav-sub-link i { width: 14px; font-size: 11px; }
#mobile-nav-links a.nav-sub-link {
  padding-left: 34px;
  font-size: 13px;
}
.sidebar-user {
  padding: 12px 16px;
  border-top: 1px solid rgba(255,255,255,0.1);
  font-size: 11px;
  color: rgba(255,255,255,0.5);
  display: flex;
  align-items: center;
  gap: 6px;
}
.nav-badge {
  margin-left: auto; min-width: 18px; height: 18px; padding: 0 5px;
  background: #f43f5e; color: #fff; border-radius: 10px;
  font-size: 10px; font-weight: 800; line-height: 18px; text-align: center;
}

/* ---- メインコンテンツ ---- */
#main-content { margin-left: var(--sidebar-w); min-height: 100vh; }

/* ---- トップバー ---- */
#topbar {
  position: sticky; top: 0; background: #fff;
  border-bottom: 1px solid #e5e7eb; padding: 0 24px;
  height: 56px; display: flex; align-items: center; justify-content: space-between;
  z-index: 50; box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}
#topbar .page-title { font-size: 17px; font-weight: 700; color: var(--primary); }
#topbar .topbar-actions { display: flex; gap: 8px; align-items: center; }
.topbar-left { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; }
.topbar-date { font-size: 12px; color: #9ca3af; white-space: nowrap; }
.topbar-user-chip {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 12px; background: #f1f5f9; border-radius: 8px;
}
.topbar-user-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: linear-gradient(135deg,#1e3a5f,#2d6a9f);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 12px; flex-shrink: 0;
}
.topbar-user-meta { line-height: 1.2; min-width: 0; }
.topbar-user-name { font-size: 12px; font-weight: 600; color: #1e293b; }
.topbar-user-role { font-size: 10px; color: #94a3b8; }
.topbar-logout-btn {
  padding: 8px 12px; min-height: 44px;
  background: #fff; border: 1px solid #e2e8f0; border-radius: 8px;
  font-size: 12px; color: #64748b; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
  transition: all .2s;
}
.topbar-logout-btn:hover { background: #fef2f2; color: #dc2626; border-color: #fecaca; }

/* ---- モバイルハンバーガーメニュー ---- */
.mobile-nav-toggle {
  display: none;
  align-items: center; justify-content: center;
  width: 44px; height: 44px; flex-shrink: 0;
  border: 1px solid #e2e8f0; border-radius: 10px;
  background: #fff; color: var(--primary);
  font-size: 18px; cursor: pointer;
}
.mobile-nav-overlay {
  position: fixed; inset: 0; z-index: 300;
  background: rgba(15, 23, 42, 0.55);
  opacity: 0; visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}
.mobile-nav-overlay.is-open { opacity: 1; visibility: visible; }
.mobile-nav-panel {
  position: absolute; top: 0; left: 0; bottom: 0;
  width: min(320px, 88vw);
  background: var(--primary);
  display: flex; flex-direction: column;
  transform: translateX(-100%);
  transition: transform 0.25s ease;
  box-shadow: 4px 0 24px rgba(0,0,0,0.2);
}
.mobile-nav-overlay.is-open .mobile-nav-panel { transform: translateX(0); }
.mobile-nav-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 12px; padding: 18px 16px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.12);
}
.mobile-nav-title { color: #fff; font-size: 14px; font-weight: 700; }
.mobile-nav-title i { color: var(--accent); margin-right: 6px; }
.mobile-nav-sub { color: rgba(255,255,255,0.55); font-size: 11px; margin-top: 4px; }
.mobile-nav-close {
  width: 44px; height: 44px; flex-shrink: 0;
  border: none; border-radius: 10px;
  background: rgba(255,255,255,0.1); color: #fff;
  font-size: 18px; cursor: pointer;
}
.mobile-nav-links {
  flex: 1; overflow-y: auto; padding: 8px 0;
}
.mobile-nav-links .nav-section {
  color: rgba(255,255,255,0.4); font-size: 10px; font-weight: 700;
  letter-spacing: 0.08em; padding: 16px 16px 4px; text-transform: uppercase;
}
.mobile-nav-links a {
  display: flex; align-items: center; gap: 12px;
  min-height: 48px; padding: 12px 16px;
  color: rgba(255,255,255,0.85); font-size: 14px; font-weight: 600;
  text-decoration: none; border-left: 3px solid transparent;
}
.mobile-nav-links a:hover,
.mobile-nav-links a.active {
  background: rgba(200,169,110,0.18); color: var(--accent);
  border-left-color: var(--accent);
}
.mobile-nav-links a i { width: 18px; text-align: center; font-size: 14px; }
.mobile-nav-user {
  padding: 14px 16px;
  border-top: 1px solid rgba(255,255,255,0.1);
  font-size: 12px; color: rgba(255,255,255,0.55);
}
body.mobile-nav-open { overflow: hidden; }

/* ---- ページコンテナ ---- */
.page-container { padding: 24px; max-width: 1400px; }

/* ---- カード ---- */
.card {
  background: #fff; border-radius: 10px; border: 1px solid #e5e7eb;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}
.card-header {
  padding: 10px 18px; border-bottom: 1px solid #e5e7eb;
  display: flex; align-items: center; justify-content: space-between;
  background: #fff;
  border-radius: 10px 10px 0 0;
}
.card-title { font-size: 14px; font-weight: 700; color: var(--primary); display: flex; align-items: center; gap: 8px; }
.card-body { padding: 18px; }

/* ---- 統計カード ---- */
.stat-card {
  background: #fff; border-radius: 10px; border: 1px solid #e5e7eb;
  padding: 18px; display: flex; flex-direction: column; gap: 6px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}
.stat-card .stat-icon { width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 18px; margin-bottom: 4px; }
.stat-card .stat-value { font-size: 28px; font-weight: 800; color: var(--primary); line-height: 1; }
.stat-card .stat-label { font-size: 12px; color: #6b7280; }
.stat-card .stat-sub { font-size: 11px; color: #9ca3af; }

/* ---- ボタン ---- */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; border-radius: 6px; font-size: 13px;
  font-weight: 600; cursor: pointer; transition: all 0.15s;
  border: none; text-decoration: none; line-height: 1;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-light); }
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { background: #b8955a; }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #15803d; }
.btn-outline { background: transparent; color: var(--primary); border: 1px solid #d1d5db; }
.btn-outline:hover { background: #f3f4f6; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #b91c1c; }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-xs { padding: 3px 8px; font-size: 11px; border-radius: 4px; }
.btn-lg { padding: 12px 24px; font-size: 15px; }

/* ---- バッジ ---- */
.badge {
  display: inline-flex; align-items: center; padding: 2px 8px;
  border-radius: 999px; font-size: 11px; font-weight: 600; white-space: nowrap;
}
.badge-blue   { background: #dbeafe; color: #1d4ed8; }
.badge-green  { background: #dcfce7; color: #15803d; }
.badge-yellow { background: #fef3c7; color: #b45309; }
.badge-red    { background: #fee2e2; color: #b91c1c; }
.badge-gray   { background: #f3f4f6; color: #6b7280; }
.badge-purple { background: #ede9fe; color: #7c3aed; }
.badge-orange  { background: #ffedd5; color: #c2410c; }
.badge-indigo  { background: #e0e7ff; color: #4338ca; }

/* ---- 工程管理バッジ（申込詳細 行程管理） ---- */
.step-badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 12px; border-radius: 999px;
  font-size: 12px; font-weight: 600; white-space: nowrap;
  border: 1.5px solid #d1d5db;
  background: #ffffff; color: #6b7280;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s, box-shadow 0.15s;
  user-select: none;
}
.step-badge:hover {
  border-color: #9ca3af; background: #f9fafb;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.step-badge.done {
  background: #16a34a; color: #ffffff;
  border-color: #15803d;
  box-shadow: 0 1px 4px rgba(22,163,74,0.25);
}
.step-badge.done:hover {
  background: #15803d; border-color: #166534;
}
.step-badge.pending { /* 未完了はデフォルトのまま */ }
.step-badge[disabled], .step-badge.cursor-default {
  cursor: default; pointer-events: none; opacity: 0.75;
}

/* ---- テーブル ---- */
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th {
  background: #f9fafb; padding: 10px 12px;
  text-align: left; font-weight: 600; color: #6b7280;
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em;
  border-bottom: 1px solid #e5e7eb; white-space: nowrap;
}
.data-table td { padding: 11px 12px; border-bottom: 1px solid #f3f4f6; vertical-align: middle; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover { background: #fafbff; }
.data-table .clickable { cursor: pointer; }

/* ---- フォーム ---- */
.form-group { display: flex; flex-direction: column; gap: 5px; }

/* 郵便番号 ↔ 住所 相互補完 */
.postal-lookup-wrap { position: relative; }
.postal-lookup-suggest {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  z-index: 1200;
  max-height: 220px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.16);
}
.postal-lookup-suggest-head {
  position: sticky;
  top: 0;
  padding: 6px 10px;
  font-size: 10px;
  font-weight: 700;
  color: #64748b;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
}
.postal-lookup-suggest-item {
  display: block;
  width: 100%;
  padding: 8px 10px;
  border: none;
  border-bottom: 1px solid #f1f5f9;
  background: #fff;
  text-align: left;
  font-size: 12px;
  line-height: 1.45;
  color: #1e293b;
  cursor: pointer;
  font-family: inherit;
}
.postal-lookup-suggest-item:last-child { border-bottom: none; }
.postal-lookup-suggest-item:hover,
.postal-lookup-suggest-item:focus {
  background: #eff6ff;
  outline: none;
}
.form-label { font-size: 12px; font-weight: 600; color: #374151; }
.form-label .required { color: var(--danger); margin-left: 2px; }
.form-input, .form-select, .form-textarea {
  width: 100%; padding: 8px 12px; border: 1px solid #d1d5db;
  border-radius: 6px; font-size: 13px; color: #111827;
  transition: border-color 0.15s, box-shadow 0.15s;
  font-family: inherit;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none; border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(45,90,142,0.12);
}

/* 入力済みフィールド — アプリ全体（薄い緑） */
input.is-filled,
select.is-filled,
textarea.is-filled,
.form-input.is-filled,
.form-select.is-filled,
.form-textarea.is-filled,
input.re-ccd-amount.is-filled,
input.re-ccd-months.is-filled,
input.re-extra-amount.is-filled {
  background-color: #E8F5E9 !important;
  border-color: #A5D6A7;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}
.form-textarea { resize: vertical; min-height: 80px; }
.form-hint { font-size: 11px; color: #9ca3af; }
.form-row { display: grid; gap: 16px; }
.form-row-2 { grid-template-columns: 1fr 1fr; }
.form-row-3 { grid-template-columns: 1fr 1fr 1fr; }
.form-row-4 { grid-template-columns: 1fr 1fr 1fr 1fr; }
.form-section-title {
  font-size: 13px; font-weight: 700; color: var(--primary);
  padding: 7px 12px; border-left: 3px solid var(--primary);
  background: var(--primary-pale);
  border-radius: 0 6px 6px 0;
  margin-bottom: 12px; display: flex; align-items: center; gap: 8px;
}

/* ---- アコーディオン（更新工程） ---- */
.process-item {
  border: 1px solid #e5e7eb; border-radius: 8px; overflow: hidden;
  transition: all 0.2s;
}
.process-item.completed { border-color: #86efac; background: #f0fdf4; }
.process-item.skipped   { border-color: #e5e7eb; background: #fafafa; opacity: 0.6; }
.process-item.active    { border-color: var(--primary-light); box-shadow: 0 0 0 2px rgba(45,90,142,0.12); }

.process-header {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; cursor: pointer; transition: background 0.15s;
}
.process-header:hover { background: rgba(0,0,0,0.02); }

.process-number {
  width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; flex-shrink: 0;
  background: #e5e7eb; color: #6b7280;
}
.completed .process-number { background: var(--success); color: #fff; }
.active .process-number    { background: var(--primary); color: #fff; }

.process-title { flex: 1; font-size: 13px; font-weight: 600; color: #374151; }
.completed .process-title { color: var(--success); }

.process-meta { display: flex; gap: 8px; align-items: center; font-size: 11px; color: #9ca3af; }
.process-body {
  padding: 0 16px 16px; border-top: 1px solid #f0f0f0;
  background: #fafbff;
}
.process-body.hidden { display: none; }

/* ---- ガントチャート風バー ---- */
.gantt-bar {
  height: 24px; border-radius: 4px; background: var(--primary);
  display: flex; align-items: center; padding: 0 8px;
  color: #fff; font-size: 11px; font-weight: 600;
  cursor: pointer; transition: opacity 0.15s; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
.gantt-bar:hover { opacity: 0.85; }
.gantt-bar.completed { background: #86efac; color: #15803d; }
.gantt-bar.overdue   { background: #fca5a5; color: #991b1b; }

/* ---- カレンダー ---- */
.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px; background: #e5e7eb; border-radius: 8px; overflow: hidden; }
.calendar-day {
  background: #fff; min-height: 90px; padding: 6px;
  display: flex; flex-direction: column; gap: 3px;
}
.calendar-day.other-month { background: #fafafa; }
.calendar-day.today { background: #fffbeb; }
.calendar-day .day-number { font-size: 12px; font-weight: 600; color: #374151; }
.calendar-day.today .day-number { color: var(--primary); font-weight: 800; }
.calendar-day .day-event {
  font-size: 10px; background: var(--primary-pale); color: var(--primary);
  padding: 2px 5px; border-radius: 3px; truncate; overflow: hidden;
  white-space: nowrap; text-overflow: ellipsis; cursor: pointer;
}
.calendar-day .day-event:hover { background: var(--primary); color: #fff; }
.calendar-day .day-event.done { background: #dcfce7; color: #15803d; text-decoration: line-through; }

/* ---- プログレスバー ---- */
.progress-bar { background: #e5e7eb; border-radius: 999px; height: 8px; overflow: hidden; }
.progress-fill { height: 100%; border-radius: 999px; background: var(--primary); transition: width 0.4s; }
.progress-fill.complete { background: var(--success); }

/* ---- モーダル ---- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.45);
  display: flex; align-items: flex-start; justify-content: center;
  z-index: 200; padding: 40px 16px; overflow-y: auto;
}
.modal-overlay.hidden { display: none; }
.modal-box {
  background: #fff; border-radius: 12px; width: 100%;
  max-width: 700px; box-shadow: 0 20px 60px rgba(0,0,0,0.2);
  animation: modalIn 0.2s ease;
}
.modal-box.modal-lg { max-width: 900px; }

/* ---- 更新覚書プレビュー編集（ドラッグ） ---- */
.memo-drag-layer {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2;
}
.memo-drag-layer:not(.hidden) { pointer-events: auto; }
#memo-preview-wrap.memo-edit-active { outline: 2px solid #3b82f6; outline-offset: 2px; }
.memo-drag-handle {
  position: absolute;
  transform: translate(-2px, -100%);
  cursor: grab;
  user-select: none;
  max-width: 120px;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(59, 130, 246, 0.85);
  color: #fff;
  font-size: 9px;
  line-height: 1.3;
  box-shadow: 0 1px 4px rgba(0,0,0,0.25);
  border: 1px solid rgba(255,255,255,0.5);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.memo-drag-handle.is-selected {
  background: rgba(220, 38, 38, 0.9);
  z-index: 3;
}
.memo-drag-handle:active { cursor: grabbing; }
body.memo-is-dragging .memo-drag-handle { cursor: grabbing; }
.memo-editor-panel {
  display: flex; flex-direction: column; gap: 10px;
  min-height: 0; overflow: visible;
}
.memo-editor-group {
  border: 1px solid #e5e7eb; border-radius: 8px;
  overflow: visible; background: #fff;
}
.memo-editor-group-title {
  background: #f8fafc; padding: 6px 10px; font-size: 11px; font-weight: 700; color: #475569;
}
.memo-editor-field {
  padding: 10px 10px; border-top: 1px solid #f1f5f9;
  overflow: visible;
  transition: background 0.15s ease;
}
.memo-editor-field--selected {
  background: #f0f9ff;
}
.memo-editor-field--selected .memo-editor-field-label {
  display: inline-block;
  background: #dbeafe;
  color: #1e40af;
  border-radius: 4px;
  padding: 3px 8px;
  margin: -3px -8px 6px;
  font-weight: 700;
}
.memo-editor-label {
  display: block; font-size: 11px; font-weight: 600; color: #64748b; margin-bottom: 4px;
  line-height: 1.45; word-break: break-word;
}
.memo-editor-input,
.memo-editor-textarea {
  font-size: 12px !important; padding: 6px 8px !important;
  width: 100%; box-sizing: border-box;
}
.memo-editor-textarea {
  min-height: 2.6em; max-height: 160px; resize: vertical;
  line-height: 1.45; word-break: break-word; overflow-y: auto;
  field-sizing: content;
}
.memo-editor-pos {
  display: flex; align-items: center; flex-wrap: wrap; gap: 6px;
  margin-top: 6px; font-size: 10px; color: #94a3b8;
}
.memo-pos-input { width: 64px !important; min-width: 64px; font-size: 11px !important; padding: 4px 6px !important; }
.memo-pos-unit { font-size: 10px; }
.memo-editor-field-meta { font-size: 9px; color: #cbd5e1; margin-top: 2px; word-break: break-all; }
.memo-editor-field-note {
  font-size: 9px; color: #94a3b8; margin-top: 4px; line-height: 1.4;
}
.memo-editor-actions {
  display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px;
  padding: 10px 0 4px; border-top: 1px solid #e5e7eb;
  position: sticky; bottom: 0; background: #fff; z-index: 2;
}
.memo-editor-hint { font-size: 11px; color: #64748b; margin: 0 0 10px; line-height: 1.5; }
.memo-editor-hint--template {
  background: #f5f3ff; border: 1px solid #ddd6fe; border-radius: 8px;
  padding: 10px 12px; color: #5b21b6;
}
.memo-editor-font,
.memo-editor-typography {
  display: flex; align-items: center; flex-wrap: wrap; gap: 6px;
  margin-top: 6px; font-size: 10px; color: #94a3b8;
}
.memo-font-input,
.memo-char-gap-input { width: 56px !important; min-width: 56px; font-size: 11px !important; padding: 4px 6px !important; }
.memo-editor-add-box {
  background: #f0fdf4; border: 1px solid #bbf7d0; border-radius: 8px;
  padding: 10px 12px; margin-bottom: 12px;
}
.memo-editor-add-title { font-size: 12px; font-weight: 700; color: #166534; margin-bottom: 8px; }
.memo-editor-add-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.memo-editor-field-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 6px;
  margin-bottom: 4px; flex-wrap: wrap;
}
.memo-editor-label-input {
  font-size: 11px !important; font-weight: 600; padding: 4px 8px !important;
  flex: 1; min-width: 0;
}
.memo-sync-badge {
  display: inline; margin-left: 4px; padding: 1px 6px; border-radius: 4px;
  background: #dbeafe; color: #1d4ed8; font-size: 9px; font-weight: 600;
  white-space: normal; word-break: break-word; vertical-align: middle;
}
.memo-catalog-box {
  background: #eff6ff; border: 1px solid #bfdbfe; border-radius: 8px;
  padding: 10px 12px; margin-bottom: 12px;
}
.memo-catalog-title {
  font-size: 12px; font-weight: 700; color: #1e40af; margin-bottom: 8px;
}
.memo-catalog-search {
  font-size: 12px !important; padding: 6px 10px !important; width: 100%;
  box-sizing: border-box; margin-bottom: 6px;
}
.memo-catalog-hint {
  font-size: 10px; color: #64748b; margin: 0 0 8px; line-height: 1.45;
}
.memo-catalog-list {
  display: flex; flex-direction: column; gap: 6px;
  max-height: 220px; overflow-y: auto;
}
.memo-catalog-row {
  background: #fff; border: 1px solid #e2e8f0; border-radius: 6px;
  padding: 8px 10px;
}
.memo-catalog-row.is-ok { border-left: 3px solid #22c55e; }
.memo-catalog-row.is-warn { border-left: 3px solid #f59e0b; }
.memo-catalog-row.is-muted { border-left: 3px solid #cbd5e1; }
.memo-catalog-row-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; margin-bottom: 4px;
}
.memo-catalog-master {
  font-size: 10px; font-weight: 700; color: #475569;
}
.memo-catalog-status {
  font-size: 9px; font-weight: 700; padding: 1px 6px; border-radius: 4px;
  white-space: nowrap;
}
.memo-catalog-status.is-ok { background: #dcfce7; color: #15803d; }
.memo-catalog-status.is-warn { background: #fef3c7; color: #b45309; }
.memo-catalog-status.is-muted { background: #f1f5f9; color: #64748b; }
.memo-catalog-field {
  font-size: 11px; font-weight: 600; color: #334155; line-height: 1.4;
}
.memo-catalog-arrow {
  font-weight: 500; color: #94a3b8; font-size: 10px;
}
.memo-catalog-note {
  font-size: 9px; color: #94a3b8; margin-top: 2px; line-height: 1.35;
}
.memo-catalog-preview {
  font-size: 10px; color: #64748b; margin-top: 4px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.memo-catalog-actions {
  display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap;
}
.memo-catalog-empty {
  font-size: 11px; color: #64748b; padding: 10px 4px; line-height: 1.5;
}
.memo-remove-btn {
  border: none; background: #fee2e2; color: #dc2626; border-radius: 4px;
  width: 24px; height: 24px; cursor: pointer; font-size: 10px; flex-shrink: 0;
}
.memo-remove-btn:hover { background: #fecaca; }

.draggable-panel.is-resizable { max-height: none; }
.draggable-panel.is-resizable .draggable-panel-body { flex: 1; min-height: 0; overflow-y: auto; }
.draggable-panel.is-resizing { user-select: none; }
.draggable-panel-resize {
  position: absolute; right: 0; bottom: 0; width: 18px; height: 18px;
  cursor: nwse-resize; z-index: 5;
  background: linear-gradient(135deg, transparent 50%, rgba(30,58,95,0.35) 50%);
  border-bottom-right-radius: 12px;
}
.draggable-panel-resize-e {
  position: absolute; top: 40px; right: 0; bottom: 18px; width: 8px;
  cursor: ew-resize; z-index: 4;
}
.draggable-panel-resize-s {
  position: absolute; left: 0; right: 18px; bottom: 0; height: 8px;
  cursor: ns-resize; z-index: 4;
}
.draggable-panel--memo-editor { z-index: 960; min-width: 320px; }
.draggable-panel--memo-editor .draggable-panel-body {
  padding: 12px 14px 8px;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.draggable-panel--memo-editor .memo-editor-add-row span {
  flex: 1 1 100%; line-height: 1.45; word-break: break-word;
}
@keyframes modalIn { from { opacity:0; transform:translateY(-20px); } to { opacity:1; transform:translateY(0); } }
.modal-header {
  padding: 18px 20px; border-bottom: 1px solid #f0f0f0;
  display: flex; align-items: center; justify-content: space-between;
}
.modal-header--draggable {
  cursor: grab;
  user-select: none;
}
.modal-box.is-dragging .modal-header--draggable {
  cursor: grabbing;
}
.modal-box.modal-interactive {
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
}
.modal-box.modal-draggable .modal-body,
.modal-box.modal-resizable .modal-body {
  overflow: hidden;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.modal-interactive-content {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  gap: 16px;
}
.modal-resize {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 18px;
  height: 18px;
  cursor: nwse-resize;
  z-index: 5;
  background: linear-gradient(135deg, transparent 50%, rgba(30, 58, 95, 0.35) 50%);
  border-bottom-right-radius: 12px;
}
.modal-resize-e {
  position: absolute;
  top: 48px;
  right: 0;
  bottom: 18px;
  width: 8px;
  cursor: ew-resize;
  z-index: 4;
}
.modal-resize-s {
  position: absolute;
  left: 0;
  right: 18px;
  bottom: 0;
  height: 8px;
  cursor: ns-resize;
  z-index: 4;
}
.modal-box.is-resizing {
  user-select: none;
}
.modal-title { font-size: 16px; font-weight: 700; color: var(--primary); }
.modal-close { background: none; border: none; cursor: pointer; color: #9ca3af; font-size: 18px; padding: 4px; }
.modal-close:hover { color: #374151; }
.modal-body { padding: 20px; }
.modal-footer { padding: 14px 20px; border-top: 1px solid #f0f0f0; display: flex; justify-content: flex-end; gap: 8px; }

/* ---- トースト通知 ---- */
#toast-container { position: fixed; bottom: 24px; right: 24px; z-index: 999; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: #1f2937; color: #fff; padding: 12px 18px;
  border-radius: 8px; font-size: 13px; box-shadow: 0 4px 20px rgba(0,0,0,0.2);
  display: flex; align-items: center; gap: 10px; min-width: 260px;
  animation: toastIn 0.25s ease;
}
.toast.success { background: #15803d; }
.toast.error   { background: #dc2626; }
.toast.warning { background: #d97706; }
@keyframes toastIn { from { opacity:0; transform:translateX(40px); } to { opacity:1; transform:translateX(0); } }

/* ---- ステータスドット ---- */
.status-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 5px; }
.dot-green  { background: #22c55e; }
.dot-red    { background: #ef4444; }
.dot-yellow { background: #f59e0b; }
.dot-gray   { background: #d1d5db; }
.dot-blue   { background: #3b82f6; }
.dot-orange { background: #f97316; }

/* ---- ヘッドパネル（更新案件詳細） ---- */
.head-panel {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  border-radius: 10px; padding: 20px; color: #fff; margin-bottom: 20px;
}
.head-panel .panel-label { font-size: 11px; color: rgba(255,255,255,0.65); margin-bottom: 2px; }
.head-panel .panel-value { font-size: 14px; font-weight: 700; }
.head-panel .panel-sub { font-size: 12px; color: rgba(255,255,255,0.8); }
.head-panel a { color: var(--accent); text-decoration: none; }
.head-panel a:hover { text-decoration: underline; }

/* ---- タブ ---- */
.tab-bar { display: flex; border-bottom: 2px solid #e5e7eb; gap: 0; }
.tab-btn {
  padding: 10px 20px; font-size: 13px; font-weight: 600; cursor: pointer;
  border: none; background: none; color: #6b7280;
  border-bottom: 2px solid transparent; margin-bottom: -2px;
  transition: all 0.15s;
}
.tab-btn:hover  { color: var(--primary); }
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }

/* ---- スクロールバー ---- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: #9ca3af; }

/* ---- ローダー ---- */
.loader { display: flex; align-items: center; justify-content: center; padding: 60px; }
.spinner { width: 32px; height: 32px; border: 3px solid #e5e7eb; border-top-color: var(--primary); border-radius: 50%; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- 空室管理タブ ---- */
.vacant-tab { padding: 6px 16px; border-radius: 999px; font-size: 12px; font-weight: 600; cursor: pointer; border: 1px solid #e5e7eb; background: #fff; transition: all 0.15s; }
.vacant-tab.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ---- AI パネル ---- */
.ai-panel { background: linear-gradient(135deg, #1e1b4b 0%, #312e81 100%); border-radius: 10px; padding: 16px; color: #fff; }
.ai-panel .ai-title { font-size: 13px; font-weight: 700; color: #a5b4fc; display: flex; align-items: center; gap: 6px; margin-bottom: 12px; }

/* ---- 条件変更バナー ---- */
.change-banner { background: var(--accent-light); border: 1px solid var(--accent); border-radius: 8px; padding: 14px 18px; display: flex; align-items: center; gap: 10px; }
.change-banner i { color: var(--accent); font-size: 18px; }

/* ---- レスポンシブ ---- */
@media (max-width: 768px) {
  #sidebar { transform: translateX(-100%); pointer-events: none; }
  #main-content { margin-left: 0; }
  .mobile-nav-toggle { display: inline-flex; }
  #topbar {
    height: auto; min-height: 56px;
    padding: 8px 12px; gap: 8px; flex-wrap: wrap;
  }
  #topbar .page-title {
    font-size: 15px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .topbar-actions { flex-wrap: wrap; justify-content: flex-end; }
  .topbar-date { display: none; }
  .topbar-user-chip { display: none; }
  .topbar-logout-label { display: none; }
  .page-container { padding: 16px 12px; }
  .form-row-2, .form-row-3, .form-row-4 { grid-template-columns: 1fr; }
  .btn, .btn-sm { min-height: 44px; padding-top: 10px; padding-bottom: 10px; }
  .btn-xs { min-height: 36px; min-width: 36px; padding: 8px 10px; }
  .form-input, .form-input select, .form-input textarea,
  input.form-input, select.form-input, textarea.form-input {
    font-size: 16px;
  }

  /* ---- コックピット UI ---- */
  #vd-root { max-width: 100% !important; gap: 12px !important; }
  .vd-cmd-header-compact { flex-direction: column; align-items: stretch; }
  .vd-cmd-title-line { flex-direction: column; align-items: stretch; }
  .vd-cmd-title-stats { justify-content: flex-start; max-width: 100%; }
  .vd-cmd-actions { width: 100%; justify-content: flex-start; }
  #vd-cmd-title, .vd-cmd-title { font-size: 20px !important; }
  #vd-cmd-actions .btn { flex: 1 1 calc(50% - 4px); justify-content: center; min-width: 0; }
  .vd-cockpit-main-row { grid-template-columns: 1fr; }
  #vd-sec-applications-body,
  #vd-app-list-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  #vd-sec-applications-body table { min-width: 560px; }
  #vd-shared-memo-inline-meta,
  .vd-shared-memo-form-grid {
    grid-template-columns: 1fr !important;
  }
  .vd-shared-memo-meta { flex-direction: column; align-items: flex-start; }
  #vd-app-register-accordion summary,
  #vd-detail-edit-accordion summary,
  .vd-cockpit-accordion-summary {
    min-height: 48px;
    padding: 14px 16px !important;
  }
  .vd-sticky-header {
    margin: -16px -12px 0;
    padding: 12px 12px 10px;
  }
  #vd-command-picker { max-width: 100% !important; }
  .vd-command-room-row { min-height: 56px; }

  .nav-jump-btn { min-height: 36px; padding: 8px 12px; }
  .card-header { flex-wrap: wrap; gap: 8px; }
  .data-table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
}

@media (min-width: 769px) {
  .mobile-nav-overlay { display: none; }
}

/* ---- 申込新規登録（アコーディオン） ---- */
.app-new-accordion {
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
}
.app-new-accordion summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  cursor: pointer;
  list-style: none;
  user-select: none;
  background: linear-gradient(to right, #f8fafc, #fff);
}
.app-new-accordion summary::-webkit-details-marker { display: none; }
.app-new-accordion[open] summary {
  border-bottom: 1px solid #e5e7eb;
}
.app-new-accordion-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
  color: #374151;
}
.app-new-accordion-hint {
  font-size: 11px;
  font-weight: 400;
  color: #9ca3af;
}
.app-new-accordion .acc-chevron {
  flex-shrink: 0;
  color: #9ca3af;
  font-size: 12px;
  transition: transform .2s;
}
.app-new-accordion[open] .acc-chevron {
  transform: rotate(180deg);
}
.app-new-accordion-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* 申込新規ページ2 — 仲介・管理会社 2カラム */
.app-new-broker-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  align-items: start;
}
.app-new-broker-col {
  padding: 14px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #f8fafc;
}
.app-new-broker-col-title {
  font-size: 13px;
  font-weight: 700;
  color: #334155;
  margin: 0 0 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.app-new-broker-col .app-new-broker-col-fields {
  padding: 0;
  gap: 10px 12px;
}
.app-new-broker-group-label {
  grid-column: 1 / -1;
  margin: 6px 0 0;
  padding-top: 8px;
  border-top: 1px solid #e2e8f0;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #64748b;
  text-transform: uppercase;
}
.app-new-broker-group-label:first-of-type {
  margin-top: 4px;
  padding-top: 0;
  border-top: none;
}
.app-detail-section-modal--wide .app-new-broker-col-fields {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
@media (max-width: 900px) {
  .app-new-broker-grid { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .app-new-broker-col-fields,
  .app-detail-section-modal--wide .app-new-broker-col-fields {
    grid-template-columns: 1fr;
  }
}

/* 空室詳細 — タイトル右下の申込登録ボタン */
.vd-cmd-title-wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
}
.vd-cmd-title-register {
  flex-shrink: 0;
  margin-left: auto;
}
.vd-cmd-register-app-btn {
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.35);
}

/* ---- 金額フィールド ---- */
[data-money] {
  text-align: right;
  letter-spacing: 0.03em;
  font-variant-numeric: tabular-nums;
  padding-right: 10px;
}
[data-money]:focus {
  background: #fffbeb;
}
/* 入力欄の左側に「¥」を重ねる */
.money-wrap {
  position: relative;
}
.money-wrap::before {
  content: '¥';
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: #9ca3af;
  font-size: 13px;
  pointer-events: none;
  z-index: 1;
}
.money-wrap [data-money] {
  padding-left: 22px;
}

/* ---- ユーティリティ ---- */
.text-primary { color: var(--primary); }
.text-accent  { color: var(--accent); }
.text-muted   { color: #9ca3af; }
.text-success { color: var(--success); }
.text-danger  { color: var(--danger); }
.font-bold    { font-weight: 700; }
.font-medium  { font-weight: 500; }
.truncate     { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.divider      { border: none; border-top: 1px solid #e5e7eb; margin: 16px 0; }
.empty-state  { text-align: center; padding: 48px 24px; color: #9ca3af; }
.empty-state i { font-size: 40px; margin-bottom: 12px; display: block; }
.empty-state p { font-size: 14px; }

/* ---- 申込詳細ページ セクション見出し (application-detail) ---- */
.section-title {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 14px;
  font-weight: 700;
  color: var(--primary);
  padding: 9px 18px;
  background: var(--primary-pale);
  border-left: 4px solid var(--primary);
  border-bottom: 1px solid #d1d9e6;
  border-radius: 0 6px 0 0;
  margin-bottom: 16px;
  margin-left: -20px;
  margin-right: -20px;
  margin-top: -4px;
  letter-spacing: 0.01em;
  box-shadow: 0 1px 3px rgba(30,58,95,0.07);
}
/* アイコン色をそのまま活かすためiタグの色は継承しない */
.section-title i {
  font-size: 14px;
  opacity: 0.9;
  flex-shrink: 0;
}

/* ---- セクションナビゲーション (application-detail) ---- */
.nav-jump-btn {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  color: #374151;
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
  line-height: 1.5;
}
.nav-jump-btn:hover {
  background: var(--primary-pale);
  border-color: var(--primary-light);
  color: var(--primary);
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(30,58,95,0.12);
}
.nav-jump-btn:active {
  transform: translateY(0);
  box-shadow: none;
}

/* ---- 管理契約詳細：上部固定 + 下部スクロール ---- */
.page-container.mc-detail-page {
  padding: 0;
  max-width: none;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.mc-detail-shell {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  background: #f8fafc;
}

.mc-detail-pinned {
  flex-shrink: 0;
  padding: 16px 20px 0;
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
  z-index: 10;
}

.mc-detail-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.mc-detail-toolbar-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}

.mc-detail-lock-banner {
  margin-bottom: 12px;
  padding: 12px 14px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  font-size: 12px;
  color: #475569;
}

.mc-detail-settings-card {
  margin-bottom: 12px;
}

.mc-detail-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 12px 20px 24px;
  -webkit-overflow-scrolling: touch;
}

@media (max-width: 768px) {
  .mc-detail-pinned {
    padding: 12px 12px 0;
  }
  .mc-detail-scroll {
    padding: 10px 12px 20px;
  }
}

/* ---- 申込詳細：Sticky Header / Footer レイアウト ---- */
.page-container.app-detail-page {
  padding: 0;
  max-width: none;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.app-detail-shell {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  background: #f8fafc;
}

.app-detail-header {
  flex-shrink: 0;
  z-index: 30;
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.app-detail-header-inner {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 20px;
}

.app-detail-back-btn {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  margin-top: 2px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
  color: #6b7280;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
}
.app-detail-back-btn:hover {
  background: #f3f4f6;
  color: #374151;
}

.app-detail-header-main {
  flex: 1;
  min-width: 0;
}

.app-detail-header-title-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.app-detail-header-cond-statuses {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}

.app-detail-cond-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 700;
  border: 1px solid transparent;
  white-space: nowrap;
}

.app-detail-cond-chip--pet {
  background: #fff7ed;
  border-color: #fed7aa;
  color: #c2410c;
}

.app-detail-cond-chip--parking {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #1d4ed8;
}

.app-detail-cond-chip--muted {
  background: #f3f4f6;
  border-color: #e5e7eb;
  color: #9ca3af;
  font-weight: 600;
}

.app-new-condition-fields {
  margin-bottom: 14px;
  padding: 12px 14px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
}

.app-new-condition-checks {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}

.app-new-condition-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: #374151;
  cursor: pointer;
  margin: 0;
}

.app-new-condition-panel {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed #e2e8f0;
}

.app-new-condition-panel[hidden] {
  display: none !important;
}

.app-detail-title {
  font-size: 18px;
  font-weight: 700;
  color: #1f2937;
  line-height: 1.3;
  margin: 0;
}

.app-detail-header-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-top: 6px;
  font-size: 12px;
  color: #6b7280;
}

.app-detail-header-badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}

.app-detail-header-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.3;
  border: 1px solid transparent;
}

.app-detail-header-badge-txn {
  background: #f0fdf4;
  border-color: #bbf7d0;
  color: #166534;
}

.app-detail-header-badge-staff {
  background: #eef2ff;
  border-color: #c7d2fe;
  color: #4338ca;
}

.app-detail-header-badge-contract {
  background: #faf5ff;
  border-color: #ddd6fe;
  color: #6d28d9;
}

.app-detail-header-contract-type {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.app-detail-contract-type-btn {
  border: 1px solid #d1d5db;
  background: #fff;
  color: #475569;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
  padding: 3px 8px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.app-detail-contract-type-btn:hover {
  background: #f8fafc;
  border-color: #94a3b8;
}

.app-detail-contract-type-btn.is-active,
.detail-contract-type-btn.is-active {
  background: #7c3aed;
  border-color: #7c3aed;
  color: #fff;
}

.nf-contract-type-btn.is-active,
.re-contract-type-btn.is-active {
  font-weight: 600;
  opacity: 0.85;
}

.app-detail-header-badge-label {
  font-weight: 600;
  opacity: 0.85;
}

.app-detail-header-badge-value {
  font-weight: 700;
}

.app-detail-header-staff-display {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.app-detail-header-staff-edit {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.app-detail-staff-select {
  font-size: 12px;
  padding: 3px 8px;
  border: 1px solid #c7d2fe;
  border-radius: 6px;
  background: #fff;
  color: #1e293b;
  min-width: 140px;
  max-width: 200px;
}

.app-detail-staff-edit-btn,
.app-detail-staff-cancel-btn {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  padding: 0;
  border: none;
  border-radius: 5px;
  background: transparent;
  color: #6366f1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  transition: background 0.15s;
}

.app-detail-staff-edit-btn:hover,
.app-detail-staff-cancel-btn:hover {
  background: rgba(99, 102, 241, 0.12);
}

.app-detail-broker-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.app-detail-broker-col {
  min-height: 100%;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 14px;
  background: #fff;
}

.app-detail-broker-col-mgmt {
  border-left: 3px solid #0d9488;
}
.app-detail-broker-col-motoduke {
  background: #fafffe;
  border-color: #bbf7d0;
}

.app-detail-broker-col-kyakuduke {
  background: #f8fafc;
  border-color: #bfdbfe;
}

@media (max-width: 768px) {
  .app-detail-broker-grid {
    grid-template-columns: 1fr;
  }
}

/* ---- 申込詳細：金額サマリー / ライフライン 2カラム ---- */
.app-detail-summary-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 20px;
  align-items: stretch;
}

.app-detail-summary-col {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 14px;
  background: #fff;
}

.app-detail-summary-amount {
  background: #fafffe;
  border-color: #bbf7d0;
}

.app-detail-summary-lifeline {
  background: #f0fdfa;
  border-color: #99f6e4;
}

.app-detail-summary-col-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

.app-detail-summary-col-head .app-detail-subsection-title {
  margin-bottom: 0;
  flex: 1;
}

.app-detail-summary-col-body {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.app-detail-summary-copy-btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  color: #0f766e;
  background: #fff;
  border: 1px solid #5eead4;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s;
}

.app-detail-summary-copy-btn:hover {
  background: #ccfbf1;
}

.app-detail-summary-group-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 12px 0 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid #f1f5f9;
}

.app-detail-summary-group-label:first-child {
  margin-top: 0;
}

.app-detail-summary-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

/* シマシマ（ストライプ）金額内訳 */
.app-detail-stripe-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.app-detail-stripe-list--extras {
  margin-top: 4px;
  margin-bottom: 8px;
}

.app-detail-stripe-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 10px;
  font-size: 13px;
  background: #ffffff;
}

.app-detail-stripe-list > .app-detail-stripe-row:nth-child(even) {
  background: #f8fafc;
}

.app-detail-stripe-row-label {
  color: #475569;
  flex: 1;
  min-width: 0;
  line-height: 1.35;
}

.app-detail-stripe-row-value {
  font-weight: 600;
  color: #1e293b;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.app-detail-stripe-row-subtotal {
  margin-top: 6px;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  background: #f8fafc !important;
  font-weight: 700;
}

.app-detail-stripe-row-detail {
  padding: 0 10px 6px;
  font-size: 12px;
}

.app-detail-stripe-row-status {
  background: #fff;
}

.app-detail-stripe-section .app-detail-cost-group-label:first-child {
  margin-top: 0;
}

.app-detail-summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 10px;
  font-size: 13px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.7);
}

.app-detail-summary-row:nth-child(even) {
  background: rgba(248, 250, 252, 0.9);
}

.app-detail-summary-row-label {
  color: #475569;
  flex: 1;
  min-width: 0;
}

.app-detail-summary-row-value {
  font-weight: 600;
  color: #1e293b;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.app-detail-summary-row-detail {
  padding: 0 10px 6px;
}

.app-detail-summary-row-status {
  background: transparent;
}

.app-detail-summary-totals {
  margin-top: auto;
  padding-top: 12px;
  border-top: 2px solid #e2e8f0;
}

.app-detail-summary-row-total {
  background: transparent;
  font-weight: 600;
}

.app-detail-summary-row-subtotal {
  margin-top: 4px;
  padding-top: 8px;
  border-top: 1px dashed #e2e8f0;
  font-weight: 600;
}

.app-detail-summary-row-grand {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
  padding: 10px 12px;
  font-size: 15px;
  font-weight: 800;
  color: #1e293b;
  background: #f1f5f9;
  border-radius: 8px;
}

.app-detail-summary-reward-check {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 12px 0 0;
  padding: 8px 10px;
  font-size: 12px;
  color: #0f766e;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  border-radius: 8px;
  cursor: pointer;
  user-select: none;
}

.app-detail-summary-alt-contact {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed #99f6e4;
}

.app-detail-summary-edit-hint {
  margin-top: auto;
  padding-top: 8px;
}

@media (max-width: 768px) {
  .app-detail-summary-grid {
    grid-template-columns: 1fr;
  }
}

.app-detail-summary-single .app-detail-summary-col {
  border: none;
  padding: 0;
  background: transparent;
}

/* ---- 申込詳細：案件コア（概要・ライフライン・契約・AD） ---- */
.app-detail-core-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  align-items: stretch;
}

.app-detail-core-card {
  margin: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.app-detail-core-card--lifeline {
  background: linear-gradient(180deg, #f0fdfa 0%, #fff 48px);
  border-color: #99f6e4;
}

.app-detail-overview-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 18px;
}

.app-detail-overview-row {
  min-width: 0;
}

.app-detail-lifeline-section-body {
  flex: 1;
  min-width: 0;
}

.app-detail-files-contract-block {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px dashed #e2e8f0;
}

.app-detail-contract-notes-hint {
  margin: 0 0 10px;
  padding: 8px 10px;
  font-size: 11px;
  line-height: 1.45;
  color: #64748b;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
}

.app-detail-body--sections {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

@media (max-width: 900px) {
  .app-detail-core-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .app-detail-overview-grid {
    grid-template-columns: 1fr;
  }
  .app-detail-body {
    padding: 12px 14px 20px;
  }
  .app-detail-section-nav {
    margin-left: -14px;
    margin-right: -14px;
    padding-left: 14px;
    padding-right: 14px;
  }
}

.app-detail-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 16px 20px 24px;
  position: relative;
  -webkit-overflow-scrolling: touch;
  --app-detail-nav-height: 72px;
}

/* セクションジャンプ — ヘッダー直下・スクロール追従 */
.app-detail-section-nav {
  position: sticky;
  top: 0;
  z-index: 25;
  margin: -16px -20px 16px;
  padding: 10px 20px 12px;
  background: rgba(255, 255, 255, 0.97);
  border-bottom: 1px solid #e5e7eb;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.06);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.app-detail-section-nav-label {
  margin: 0 0 8px;
  font-size: 10px;
  font-weight: 600;
  color: #9ca3af;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  display: flex;
  align-items: center;
  gap: 6px;
}

.app-detail-section-nav-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.app-detail-shell .app-detail-scroll-target,
.app-detail-shell [id^="section-"] {
  scroll-margin-top: calc(var(--app-detail-nav-height, 72px) + 12px);
}

.app-detail-footer {
  flex-shrink: 0;
  z-index: 40;
  background: #fff;
  border-top: 1px solid #e5e7eb;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.06);
}

.app-detail-footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 20px;
  flex-wrap: wrap;
}

.app-detail-footer-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  flex-wrap: wrap;
}

.app-detail-footer-delete {
  color: #dc2626;
  border-color: #fecaca;
}
.app-detail-footer-delete:hover {
  background: #fef2f2;
  border-color: #fca5a5;
}

.app-detail-footer-save.is-prominent {
  font-weight: 700;
  box-shadow: 0 2px 10px rgba(37, 99, 235, 0.28);
}

.app-detail-footer-save.is-muted {
  opacity: 0.45;
  pointer-events: none;
}

/* 申込詳細 — セクション編集ボタン */
.app-detail-section-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.app-detail-section-edit-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  color: #6366f1;
  background: #eef2ff;
  border: 1px solid #c7d2fe;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  flex-shrink: 0;
}

.app-detail-section-edit-btn:hover {
  background: #e0e7ff;
  color: #4f46e5;
  border-color: #a5b4fc;
}

.app-detail-section-edit-btn i {
  font-size: 11px;
}

/* 申込詳細 — セクション単位編集モーダル */
.app-detail-section-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9990;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 24px 12px;
  overflow-y: auto;
  background: rgba(15, 23, 42, 0.55);
  animation: modalIn 0.2s ease;
}

.app-detail-section-modal {
  width: 100%;
  max-width: min(920px, 96vw);
  max-height: calc(100vh - 48px);
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 24px 64px rgba(15, 23, 42, 0.28);
  overflow: hidden;
}

.app-detail-section-modal--wide {
  max-width: min(1120px, 98vw);
}

.app-detail-section-modal--contract {
  max-width: min(960px, 98vw);
}

.app-detail-section-modal--contract .app-detail-section-modal-body {
  padding: 16px 20px 20px;
}

/* 申込者情報モーダル — コンパクトカードレイアウト */
.app-detail-applicant-modal-editor {
  padding: 0;
}

.app-detail-applicant-modal-hint {
  font-size: 11px;
  color: #64748b;
  margin: 0 0 10px;
  padding: 6px 10px;
  background: #f8fafc;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
}

.app-detail-applicant-modal-cards {
  gap: 10px;
}

.app-detail-applicant-modal-card {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #fff;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}

.app-detail-applicant-modal-card-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 700;
  color: #334155;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
}

.app-detail-applicant-modal-card-body {
  padding: 10px 12px;
}

.app-detail-edit-fields--compact {
  gap: 8px;
}

.app-detail-edit-fields--compact .app-detail-edit-field {
  gap: 2px;
}

.app-detail-edit-fields--compact .app-detail-edit-label {
  font-size: 11px;
  margin-bottom: 0;
}

.app-detail-edit-fields--compact .form-input {
  padding: 5px 8px;
  font-size: 12px;
  min-height: 30px;
}

.app-detail-applicant-modal-check {
  margin-bottom: 8px;
  font-size: 12px;
  color: #475569;
}

.app-detail-applicant-modal-check label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.app-detail-applicant-modal-resident-fields {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.app-detail-applicant-modal-resident-fields.hidden {
  display: none;
}

/* 申込新規登録モーダル — アコーディオン */
.app-new-modal-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.app-new-modal-accordion {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}
.app-new-modal-accordion-summary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  list-style: none;
  background: #f8fafc;
  border-bottom: 1px solid transparent;
}
.app-new-modal-accordion[open] .app-new-modal-accordion-summary {
  border-bottom-color: #e2e8f0;
}
.app-new-modal-accordion-summary::-webkit-details-marker {
  display: none;
}
.app-new-modal-accordion-body {
  padding: 12px 14px 14px;
}

/* 申込新規 Step 0 — 案件の型 */
.app-new-type-grid {
  display: grid;
  gap: 10px;
}
.app-new-type-grid--2 { grid-template-columns: repeat(2, 1fr); }
.app-new-type-grid--3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 640px) {
  .app-new-type-grid--2,
  .app-new-type-grid--3 { grid-template-columns: 1fr; }
}
.app-new-type-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 12px 14px;
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}
.app-new-type-card:hover:not(.app-new-type-card--disabled) {
  border-color: #a5b4fc;
  background: #f8fafc;
}
.app-new-type-card--selected {
  border-color: #6366f1;
  background: #eef2ff;
  box-shadow: 0 0 0 1px #6366f1;
}
.app-new-type-card--disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.app-new-type-card-icon {
  font-size: 18px;
  color: #6366f1;
}
.app-new-type-card-label {
  font-size: 14px;
  font-weight: 700;
  color: #1e293b;
}
.app-new-type-card-desc {
  font-size: 11px;
  color: #64748b;
  line-height: 1.4;
}
.app-detail-txn-panel {
  margin-bottom: 16px;
  padding: 14px 16px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
}
.app-detail-txn-panel--mismatch {
  background: #fffbeb;
  border-color: #fde68a;
}
.app-detail-txn-panel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.app-detail-txn-mismatch-note {
  font-size: 12px;
  color: #b45309;
  padding: 10px 12px;
  background: #fff7ed;
  border-radius: 8px;
  border: 1px solid #fed7aa;
}
.app-detail-txn-ok-note {
  font-size: 12px;
  color: #15803d;
}
.app-detail-txn-link {
  background: none;
  border: none;
  color: #2563eb;
  text-decoration: underline;
  cursor: pointer;
  font-size: 12px;
  padding: 0;
}

.app-contract-profile-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  margin-bottom: 12px;
  background: linear-gradient(to right, #eef2ff, #f8fafc);
  border: 1px solid #c7d2fe;
  border-radius: 8px;
  font-size: 13px;
  color: #312e81;
}
.app-contract-profile-banner i {
  color: #4f46e5;
}
.app-contract-profile-banner--compact {
  margin-bottom: 8px;
  padding: 8px 12px;
  font-size: 12px;
}
.app-contract-profile-hint {
  font-size: 11px;
  color: #64748b;
}

.app-new-type-preview {
  padding: 12px 14px;
  border-radius: 10px;
  background: #f5f3ff;
  border: 1px solid #ddd6fe;
}
.app-new-type-badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  padding: 10px 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
}
.app-new-type-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
  color: #334155;
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
}
.app-new-type-badge--guarantee {
  color: #92400e;
  background: #fffbeb;
  border-color: #fcd34d;
}
.app-new-type-change-btn {
  margin-left: auto;
  font-size: 11px;
  color: #6366f1;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
}
.app-new-type-change-btn:hover {
  background: #eef2ff;
}

/* 申込新規登録 — 下部固定の登録ボタン */
.app-new-page2-form {
  padding-bottom: 88px;
}
.app-new-page2-footer {
  position: fixed;
  bottom: 0;
  left: var(--sidebar-w);
  right: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding: 14px 24px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  border-top: 1px solid #e2e8f0;
  box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.07);
}
@media (max-width: 768px) {
  .app-new-page2-footer { left: 0; }
}

/* 生年月日 + 年齢（横並び） */
.app-birthdate-age-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.app-birthdate-age-row .form-input[type="date"] {
  flex: 1 1 160px;
  min-width: 140px;
  max-width: 220px;
}

/* 申込者情報 — 申込書形式（◯・レ点） */
.app-maru-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
}
.app-maru-group--inline { align-items: center; }
.app-maru-group--grid {
  display: grid;
  grid-template-columns: repeat(var(--maru-cols, 3), minmax(0, 1fr));
  gap: 8px 10px;
}
@media (max-width: 640px) {
  .app-maru-group--grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.app-maru-option {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-size: 13px;
  color: #334155;
  user-select: none;
}
.app-maru-option--block { font-size: 12px; }
.app-maru-option input { position: absolute; opacity: 0; pointer-events: none; }
.app-maru-circle {
  width: 18px;
  height: 18px;
  border: 1.5px solid #64748b;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: #fff;
}
.app-maru-option input:checked + .app-maru-circle::after {
  content: '';
  width: 10px;
  height: 10px;
  border: 2px solid #1e3a5f;
  border-radius: 50%;
}
.app-maru-sublabel {
  display: block;
  font-size: 10px;
  color: #94a3b8;
  line-height: 1.2;
}
.app-reten-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 13px;
  color: #334155;
}
.app-reten-check input { position: absolute; opacity: 0; pointer-events: none; }
.app-reten-box {
  width: 18px;
  height: 18px;
  border: 1.5px solid #64748b;
  border-radius: 2px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: #1e3a5f;
  background: #fff;
}
.app-reten-check input:checked + .app-reten-box::after {
  content: 'レ';
  line-height: 1;
  transform: scale(0.85);
}
.app-applicant-section-title {
  font-size: 12px;
  font-weight: 700;
  color: #475569;
  padding-bottom: 4px;
  border-bottom: 1px solid #e2e8f0;
}
.app-applicant-address-section,
.app-applicant-workplace-section {
  margin-top: 4px;
  padding-top: 8px;
  border-top: 1px dashed #e2e8f0;
}
.app-workplace-address-preview {
  margin-top: 6px;
  padding: 6px 10px;
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  border-radius: 6px;
  font-size: 12px;
  color: #1e40af;
  line-height: 1.45;
  word-break: break-all;
}
.app-detail-applicant-section-divider {
  grid-column: 1 / -1;
  font-size: 12px;
  font-weight: 700;
  color: #475569;
  padding: 10px 0 4px;
  margin-top: 6px;
  border-top: 1px solid #e2e8f0;
}
.app-birthdate-spaced {
  font-size: 13px;
  font-weight: 600;
  color: #1e40af;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.app-applicant-birth-era-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.app-applicant-birth-era-label {
  font-size: 11px;
  font-weight: 600;
  color: #64748b;
}
.app-balanced-text-input {
  font-size: 13px;
}
.app-balanced-text-preview {
  margin-top: 6px;
  padding: 6px 8px;
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  border-radius: 6px;
  display: grid;
  gap: 4px 8px;
  max-width: 360px;
}
.app-balanced-text-preview--cols-2 {
  grid-template-columns: 1fr 1fr;
}
.app-balanced-text-preview--cols-3 {
  grid-template-columns: 1fr 1fr 1fr;
}
.app-balanced-text-line {
  font-size: 8pt;
  line-height: 1.35;
  color: #334155;
  min-height: 1.35em;
  word-break: break-all;
}

/* 保証申込書テンプレ校正 — プレビュー拡大縮小 */
.gpf-preview-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  flex-shrink: 0;
  padding: 8px 10px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
}
.gpf-preview-toolbar-label {
  font-size: 12px;
  font-weight: 600;
  color: #475569;
  margin-right: 4px;
}
.gpf-zoom-label {
  min-width: 3.2em;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  color: #1e3a5f;
  font-variant-numeric: tabular-nums;
}
.gpf-preview-scroll {
  flex: 1;
  min-height: 120px;
  background: #f1f5f9;
  border-radius: 10px;
  padding: 16px;
  overflow: auto;
}
.gpf-preview-wrap {
  position: relative;
  width: 840px;
  max-width: 840px;
  margin: 0 auto;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

/* 日本セーフティー — 入居者（本人以外） */
.app-ns-occupant-notice {
  margin: 0 0 12px;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 600;
  color: #b45309;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 8px;
}
.app-detail-applicant-modal-card-body > .app-ns-occupant-section,
.app-detail-applicant-modal-card-body > .app-applicant-memo-section {
  grid-column: 1 / -1;
  width: 100%;
  min-width: 0;
}
.app-ns-occupant-section--standalone .app-ns-occupant-slot {
  width: 100%;
  box-sizing: border-box;
}
.app-ns-occupant-section--extra {
  margin-top: 12px;
}
.app-ns-occupant-slot {
  margin-bottom: 14px;
  padding: 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
}
.app-ns-occupant-slot:last-child {
  margin-bottom: 0;
}
.app-ns-occupant-slot-title {
  font-size: 12px;
  font-weight: 700;
  color: #475569;
  margin-bottom: 8px;
}
.app-ns-occupant-view-row {
  padding: 10px 0;
  border-bottom: 1px solid #f1f5f9;
}
.app-ns-occupant-view-row:last-child {
  border-bottom: none;
}
.app-ns-occupant-view-title {
  font-size: 12px;
  font-weight: 700;
  color: #6366f1;
  margin-bottom: 4px;
}

.app-reten-group {
  display: contents;
}
.app-reten-check--block {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  cursor: pointer;
}

.memo-editor-field-tag {
  display: inline-block;
  margin-left: 4px;
  padding: 1px 5px;
  font-size: 9px;
  font-weight: 600;
  color: #0369a1;
  background: #e0f2fe;
  border-radius: 4px;
  vertical-align: middle;
}
.app-age-inline {
  flex: 0 0 auto;
  font-size: 14px;
  font-weight: 600;
  color: #475569;
  min-width: 3em;
  white-space: nowrap;
}
.app-detail-edit-field--birthdate-age .app-detail-edit-label {
  display: block;
  margin-bottom: 4px;
}

.app-detail-applicant-modal-card-body .form-input.is-filled,
.app-detail-applicant-modal-editor .form-input.is-filled,
.app-detail-applicant-modal-editor input.is-filled,
.app-detail-applicant-modal-editor select.is-filled,
.app-detail-applicant-modal-editor textarea.is-filled {
  background-color: #E8F5E9 !important;
  border-color: #A5D6A7;
}

.app-detail-section-modal-header {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid #e2e8f0;
  background: #f8fafc;
}

.app-detail-section-modal-title {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: #1e293b;
  display: flex;
  align-items: center;
  gap: 8px;
}

.app-detail-section-modal-close {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: #64748b;
  cursor: pointer;
  font-size: 16px;
}

.app-detail-section-modal-close:hover {
  background: #e2e8f0;
  color: #334155;
}

.app-detail-section-modal-body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 10px 12px 8px;
  min-height: 0;
}

.app-detail-section-modal-footer {
  flex: 0 0 auto;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 10px 16px;
  border-top: 1px solid #e2e8f0;
  background: #fafafa;
}

/* 物件費用モーダル — コンパクト2段構成 */
.app-detail-cost-modal-editor {
  border: none;
  box-shadow: none;
  margin: 0;
  padding: 0;
}

.app-detail-cost-modal-editor .app-detail-edit-cost-tabs {
  margin: 0 0 8px;
  padding: 0 2px;
}

.app-detail-edit-cost-tabs--modal {
  display: flex;
  gap: 6px;
  border-bottom: 2px solid #e2e8f0;
  padding-bottom: 0;
  margin-bottom: 10px;
}

.app-detail-edit-cost-tabs--modal .app-detail-edit-cost-tab {
  flex: 1 1 0;
  min-width: 0;
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 600;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  border-radius: 6px 6px 0 0;
  background: transparent;
  color: #64748b;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-detail-edit-cost-tabs--modal .app-detail-edit-cost-tab.is-active {
  color: #15803d;
  border-bottom-color: #22c55e;
  background: #E8F5E9;
}

.app-detail-edit-cost-tabs--modal .app-detail-edit-cost-tab:hover:not(.is-active) {
  color: #334155;
  background: #f8fafc;
}

.app-detail-cost-modal-editor .app-detail-edit-cost-tab {
  padding: 6px 12px;
  font-size: 12px;
}

.app-detail-cost-modal-editor .app-detail-edit-cost-cards {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 0 0 8px;
}

.app-detail-cost-modal-editor .app-detail-edit-cost-group--card.app-detail-edit-cost-group--custom {
  margin: 0 0 8px;
}

.app-detail-cost-modal-editor .app-detail-edit-cost-group-head {
  padding: 5px 10px;
  font-size: 11px;
}

.app-detail-cost-modal-editor .app-detail-edit-cost-group-body {
  gap: 6px;
  padding: 8px 10px;
}

.app-detail-cost-modal-editor .app-detail-edit-cost-field {
  gap: 2px;
}

.app-detail-cost-modal-editor .app-detail-edit-label {
  font-size: 11px;
  line-height: 1.25;
  margin-bottom: 0;
}

.app-detail-cost-modal-editor .app-detail-edit-cost-field-inputs {
  gap: 6px;
}

.app-detail-cost-modal-editor .app-detail-edit-cost-input-wrap {
  gap: 2px;
}

.app-detail-cost-modal-editor .app-detail-edit-cost-input-wrap .form-input {
  height: 30px;
  padding: 4px 8px;
  font-size: 12px;
}

.app-detail-cost-modal-editor .app-detail-edit-cost-sublabel {
  font-size: 9px;
}

.app-detail-cost-modal-editor .app-detail-edit-cost-total-bar {
  margin: 6px 0;
  padding: 8px 12px;
  border-radius: 8px;
}

.app-detail-cost-modal-editor .app-detail-edit-cost-export-row {
  padding: 0 0 4px;
  gap: 8px;
  flex-wrap: wrap;
}

.app-detail-cost-modal-editor .app-detail-edit-sync-hint {
  font-size: 11px;
}

.app-detail-cost-modal-editor .app-detail-edit-cost-add-wrap {
  padding: 6px 10px 8px;
}

@media (max-width: 640px) {
  .app-detail-cost-modal-editor .app-detail-edit-cost-cards {
    grid-template-columns: 1fr;
  }
}

/* 申込詳細 — セクション編集モーダル内の入力済み（上記グローバルルールを継承） */

.app-detail-edit-section--focused {
  outline: 2px solid #6366f1;
  outline-offset: 3px;
  border-radius: 12px;
  transition: outline-color 0.25s ease;
}

.ccd-preview-tab {
  cursor: pointer;
}

.app-detail-edit-layer {
  position: absolute;
  inset: 0;
  z-index: 20;
  background: rgba(15, 23, 42, 0.45);
  overflow-y: auto;
  padding: 12px;
  -webkit-overflow-scrolling: touch;
}

.app-detail-edit-panel {
  max-width: min(1120px, 100%);
  margin: 0 auto;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.18);
  overflow: hidden;
}

.app-detail-edit-header {
  position: sticky;
  top: 0;
  z-index: 5;
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
  padding: 14px 16px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.app-detail-edit-body {
  padding: 16px 20px 24px;
}

/* ---- 編集モード専用：3層CSSアーキテクチャ ---- */

/* L1: ページ左右分割 */
.app-detail-edit-columns {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: 16px;
  align-items: start;
}

.app-detail-edit-col-main,
.app-detail-edit-col-sub {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

@media (max-width: 900px) {
  .app-detail-edit-columns {
    grid-template-columns: 1fr;
  }
}

/* L2: セクションカード */
.app-detail-edit-section {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  overflow: hidden;
}

.app-detail-edit-section-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: #f1f5f9;
  border-bottom: 1px solid #e2e8f0;
  font-size: 13px;
  font-weight: 700;
  color: #334155;
}

.app-detail-edit-section-head i {
  color: #64748b;
  font-size: 13px;
}

.app-detail-edit-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 16px;
  padding: 16px 20px 20px;
}

.app-detail-edit-fields--money {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.app-detail-edit-subblock {
  padding: 0 20px 16px;
}

.app-detail-edit-subblock-title {
  font-size: 11px;
  font-weight: 600;
  color: #64748b;
  margin: 0 0 8px;
}

@media (max-width: 640px) {
  .app-detail-edit-fields,
  .app-detail-edit-fields--money {
    grid-template-columns: 1fr;
  }
}

/* L3: フィールド（ラベル上・入力下） */
.app-detail-edit-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.app-detail-edit-field--full {
  grid-column: 1 / -1;
}

.app-detail-edit-label {
  font-size: 11px;
  font-weight: 600;
  color: #64748b;
  line-height: 1.3;
  letter-spacing: 0.02em;
}

.app-detail-edit-field .form-input,
.app-detail-edit-field .form-select,
.app-detail-edit-field textarea.form-input {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  height: 36px;
  padding: 6px 10px;
  font-size: 13px;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
}

.app-detail-edit-field textarea.form-input {
  height: auto;
  min-height: 72px;
  resize: vertical;
}

.app-detail-edit-field--amount .form-input,
.app-detail-edit-field--date .form-input {
  max-width: 160px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.app-detail-edit-field--amount .form-input {
  text-align: right;
}

.app-detail-edit-check-row {
  padding: 12px 20px 0;
}

.app-detail-edit-check-row label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
  color: #475569;
  cursor: pointer;
  user-select: none;
}

.app-detail-edit-divider {
  grid-column: 1 / -1;
  padding-top: 8px;
  border-top: 1px solid #f1f5f9;
}

.app-detail-edit-divider-title {
  font-size: 11px;
  font-weight: 600;
  color: #0d9488;
  margin: 0;
}

/* 動的行（その他費用・BD商品） */
.app-detail-edit-repeat-row {
  display: grid;
  grid-template-columns: 1fr 120px auto;
  gap: 8px;
  align-items: end;
  padding: 8px 20px;
  border-bottom: 1px solid #f1f5f9;
}

.app-detail-edit-repeat-row--product {
  grid-template-columns: 1fr 120px 1fr auto;
}

.app-detail-edit-repeat-row--cohabitant {
  grid-template-columns: 1fr 1fr 120px auto;
}

.app-detail-edit-cohabitants-head {
  display: grid;
  grid-template-columns: 1fr 1fr 120px auto;
  gap: 8px;
  padding: 0 20px 6px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #64748b;
}

.app-detail-edit-cohabitants-list {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 10px;
}

/* 駐車場・駐輪場 — 編集・閲覧 */
.app-detail-edit-section--parkings {
  margin-top: 0;
}

.app-detail-edit-parking-hint {
  margin: 0 20px 12px;
  font-size: 0.8rem;
  color: #64748b;
  line-height: 1.5;
}

.app-detail-edit-parking-head {
  display: grid;
  grid-template-columns: 120px 1fr 120px 1fr;
  gap: 8px;
  padding: 0 20px 6px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #64748b;
}

.app-detail-edit-parking-list {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  overflow: hidden;
  margin: 0 20px 12px;
}

.app-detail-edit-parking-row {
  display: grid;
  grid-template-columns: 120px 1fr 120px 1fr;
  gap: 8px;
  align-items: center;
  padding: 10px 12px;
  border-bottom: 1px solid #f1f5f9;
  background: #fff;
}

.app-detail-edit-parking-row:last-child {
  border-bottom: none;
}

.app-detail-edit-parking-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: #334155;
}

.app-detail-parking-view-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.app-detail-parking-view-row {
  display: grid;
  grid-template-columns: 140px auto 100px 1fr;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  background: #f8fafc;
  border-radius: 8px;
  font-size: 0.875rem;
}

.app-detail-parking-view-label {
  font-weight: 600;
  color: #334155;
}

.app-detail-parking-view-fee {
  font-variant-numeric: tabular-nums;
  color: #475569;
}

.app-detail-parking-view-note {
  font-size: 0.8rem;
  color: #64748b;
}

.app-parking-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 9999px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.app-parking-badge--master {
  background: #e0e7ff;
  color: #3730a3;
}

.app-parking-badge--personal {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fcd34d;
}

.app-detail-edit-repeat-row:last-child {
  border-bottom: none;
}

.app-detail-edit-repeat-row .form-input {
  height: 36px;
  padding: 6px 10px;
  font-size: 13px;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  width: 100%;
  box-sizing: border-box;
}

.app-detail-edit-repeat-row .re-amount-input {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.app-detail-edit-add-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: 4px 20px 0;
  padding: 0;
  border: none;
  background: none;
  font-size: 12px;
  color: #2563eb;
  cursor: pointer;
}

.app-detail-edit-add-btn:hover {
  color: #1d4ed8;
}

.app-detail-edit-sync-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 10px 20px 0;
}

.app-detail-edit-sync-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border: 1px solid #bfdbfe;
  border-radius: 6px;
  background: #eff6ff;
  color: #2563eb;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}

.app-detail-edit-sync-btn:hover {
  background: #dbeafe;
}

.app-detail-edit-sync-hint {
  font-size: 10px;
  color: #94a3b8;
  line-height: 1.4;
}

.app-detail-edit-nested-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 16px;
  grid-column: 1 / -1;
}

.app-detail-edit-nested-fields .app-detail-edit-field--amount .form-input {
  max-width: 100%;
}

/* 入居者登録・編集フォーム（編集UI専用 — 閲覧詳細ページには適用しない） */
.resident-form-edit {
  padding: 0;
}

.resident-form-edit .app-detail-edit-columns {
  gap: 20px;
}

.resident-form-edit .app-detail-edit-section {
  scroll-margin-top: 72px;
}

.resident-form-edit .resident-form-sec-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.resident-form-edit .app-detail-edit-fields--3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.resident-form-edit #resident-layout-order {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.resident-form-edit #resident-layout-order > .app-detail-edit-section[style*="display: none"],
.resident-form-edit #resident-layout-order > .app-detail-edit-section.is-layout-hidden {
  display: none !important;
}

.resident-form-edit .resident-contractor-drawer {
  overflow: hidden;
  transition: max-height 0.35s ease;
}

.resident-form-edit .resident-contractor-drawer.is-open {
  max-height: 4000px;
}

.resident-form-edit .resident-contractor-drawer:not(.is-open) {
  max-height: 0;
}

.resident-form-edit .app-detail-edit-field .money-wrap,
.resident-form-edit .app-detail-edit-field .money-wrap .form-input {
  width: 100%;
  max-width: 100%;
}

.resident-form-edit .app-detail-edit-total-row {
  grid-column: 1 / -1;
  text-align: right;
  font-size: 13px;
  color: #64748b;
  padding-top: 4px;
}

.resident-form-edit .app-detail-edit-total-row strong {
  font-size: 16px;
  color: var(--primary);
}

@media (max-width: 640px) {
  .resident-form-edit .app-detail-edit-fields--3 {
    grid-template-columns: 1fr;
  }
}

/* 申込新規・申込詳細編集：契約形態トグル */
.nf-contract-type-btn.is-active,
.re-contract-type-btn.is-active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

#app-new-form .app-detail-edit-fields-wrap .app-detail-edit-fields {
  padding: 0;
}

/* 契約金明細：合計バー */
.app-detail-edit-cost-total-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 16px 0 12px;
  padding: 12px 16px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 10px;
}

.app-detail-edit-cost-total-label {
  font-size: 13px;
  font-weight: 600;
  color: #1e40af;
}

.app-detail-edit-cost-total-value {
  font-size: 18px;
  font-weight: 700;
  color: #1d4ed8;
  font-variant-numeric: tabular-nums;
}

.app-detail-edit-cost-total-value.is-negative {
  color: #dc2626;
}

.app-detail-edit-cost-export-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 0 20px 8px;
}

/* 物件費用・初期費用：縦積みリスト（このセクションのみ1カラム） */
.app-detail-edit-section--cost-list {
  padding-bottom: 4px;
}

.app-detail-edit-fields--vertical-list {
  display: block;
  padding: 0;
  margin: 0 20px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
}

.app-detail-edit-cost-table.app-detail-edit-fields--vertical-list {
  grid-template-columns: unset;
}

.app-detail-edit-cost-group {
  border-bottom: 1px solid #e2e8f0;
}

.app-detail-edit-cost-group:last-child {
  border-bottom: none;
}

.app-detail-edit-cost-group--custom {
  margin: 12px 20px 0;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
}

.app-detail-edit-cost-group-head {
  padding: 8px 14px;
  background: #f8fafc;
  font-size: 11px;
  font-weight: 700;
  color: #475569;
  letter-spacing: 0.04em;
  border-bottom: 1px solid #e2e8f0;
}

.app-detail-edit-cost-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding: 6px 14px;
  border-bottom: 1px solid #f1f5f9;
  background: #fff;
}

.app-detail-edit-cost-group .app-detail-edit-cost-row:last-child {
  border-bottom: none;
}

.app-detail-edit-cost-row-label {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 0.85rem;
  font-weight: 500;
  color: #334155;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-detail-edit-cost-row-input {
  flex: 0 0 148px;
  width: 148px;
  max-width: 148px;
  height: 34px;
  padding: 6px 10px;
  font-size: 13px;
  text-align: right;
  font-variant-numeric: tabular-nums;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  box-sizing: border-box;
}

.app-detail-edit-cost-row-months {
  flex: 0 0 72px;
  width: 72px;
  max-width: 72px;
  height: 34px;
  padding: 6px 8px;
  font-size: 13px;
  text-align: right;
  font-variant-numeric: tabular-nums;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  box-sizing: border-box;
}

.app-detail-edit-cost-row-months-spacer {
  flex: 0 0 72px;
  width: 72px;
  max-width: 72px;
}

.app-detail-edit-cost-row--months .app-detail-edit-cost-row-label {
  flex: 1 1 120px;
}

.app-detail-edit-cost-row--custom {
  padding-right: 8px;
}

.app-detail-edit-cost-row-label-input {
  flex: 1 1 auto;
  min-width: 0;
  height: 34px;
  padding: 6px 10px;
  font-size: 0.85rem;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  box-sizing: border-box;
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-detail-edit-cost-row-delete {
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: #f87171;
  cursor: pointer;
  border-radius: 6px;
  font-size: 13px;
}

.app-detail-edit-cost-row-delete:hover {
  background: #fef2f2;
  color: #dc2626;
}

.app-detail-edit-cost-custom-list .app-detail-edit-cost-row:last-child {
  border-bottom: none;
}

.app-detail-edit-cost-add-wrap {
  padding: 10px 14px 12px;
  border-top: 1px solid #f1f5f9;
  background: #fafafa;
}

.app-detail-edit-section--cost-list .app-detail-edit-cost-total-bar {
  margin-left: 20px;
  margin-right: 20px;
}

.app-detail-edit-section--cost-list .app-detail-edit-cost-export-row {
  padding-left: 20px;
  padding-right: 20px;
}

/* 物件費用・初期費用：カードグリッド + 2段構成フィールド */
.app-detail-edit-cost-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 12px;
  padding: 0 20px 12px;
}

.app-detail-edit-cost-group--card {
  margin: 0;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
}

.app-detail-edit-cost-group--card.app-detail-edit-cost-group--custom {
  margin: 0 20px 12px;
}

.app-detail-edit-cost-group-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 12px 14px;
}

/* 物件費用・初期費用 — 【その他】項目の区切り */
.app-detail-edit-cost-group-body--other {
  gap: 0;
  padding: 0;
}

.app-detail-edit-cost-group-body--other .app-detail-edit-cost-field {
  padding: 12px 14px;
  border-bottom: 1.5px solid #e8ecf1;
}

.app-detail-edit-cost-group-body--other .app-detail-edit-cost-field:last-child {
  border-bottom: none;
}

.app-detail-edit-cost-group-body--other .re-ccd-amount::placeholder {
  color: #cbd5e1;
  opacity: 1;
}

.app-detail-edit-cost-group-body--custom {
  gap: 10px;
}

.app-detail-edit-cost-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.app-detail-edit-cost-field .app-detail-edit-label {
  display: block;
}

.app-detail-edit-cost-field-inputs {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 8px;
}

.app-detail-edit-cost-field-inputs--custom {
  position: relative;
  padding-right: 32px;
}

.app-detail-edit-cost-input-wrap {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 0 0 88px;
  min-width: 0;
}

.app-detail-edit-cost-input-wrap--amount {
  flex: 1 1 120px;
  min-width: 100px;
}

.app-detail-edit-cost-input-wrap--full {
  flex: 1 1 100%;
}

.app-detail-edit-cost-sublabel {
  font-size: 10px;
  font-weight: 600;
  color: #94a3b8;
  line-height: 1.2;
  letter-spacing: 0.02em;
}

.app-detail-edit-cost-input-wrap .form-input.is-filled,
.app-detail-cost-modal-editor .app-detail-edit-cost-input-wrap .form-input.is-filled {
  background-color: #E8F5E9 !important;
  border-color: #A5D6A7;
}

.app-detail-edit-cost-input-wrap .form-input {
  width: 100%;
  min-width: 0;
  height: 36px;
  padding: 6px 10px;
  font-size: 13px;
  text-align: right;
  font-variant-numeric: tabular-nums;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  box-sizing: border-box;
}

.app-detail-edit-cost-input-wrap--full .form-input {
  text-align: left;
}

.app-detail-edit-cost-field-delete {
  position: absolute;
  top: 0;
  right: 0;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: #f87171;
  cursor: pointer;
  border-radius: 6px;
  font-size: 13px;
}

.app-detail-edit-cost-field-delete:hover {
  background: #fef2f2;
  color: #dc2626;
}

/* 支払者別タブ（法人・社宅代行） */
.app-detail-edit-cost-tabs {
  display: flex;
  gap: 8px;
  padding: 0 20px 12px;
}

.app-detail-edit-cost-tab {
  flex: 1 1 0;
  min-height: 36px;
  padding: 8px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
  color: #475569;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.app-detail-edit-cost-tab.is-active {
  background: #eff6ff;
  border-color: #3b82f6;
  color: #1d4ed8;
}

.app-detail-edit-cost-payer-panels {
  min-height: 0;
}

.app-detail-edit-cost-payer-panel[hidden] {
  display: none !important;
}

.app-detail-summary-payer-label {
  font-size: 11px;
  font-weight: 700;
  color: #4338ca;
  margin: 0 0 4px;
  letter-spacing: 0.02em;
}

.app-detail-cost-group-label {
  font-size: 10px;
  font-weight: 700;
  color: #64748b;
  margin: 6px 0 2px;
  letter-spacing: 0.03em;
}

.app-detail-cost-subtotal--master .app-detail-summary-row-value {
  color: #4338ca;
}

.app-detail-cost-subtotal--tenant .app-detail-summary-row-value {
  color: #db2777;
}

.app-detail-cost-subtotal--grand {
  border-top: 1px solid #e2e8f0;
  margin-top: 4px;
  padding-top: 6px;
  font-weight: 700;
}

.app-detail-cost-subtotal--grand .app-detail-stripe-row-value,
.app-detail-cost-subtotal--grand .app-detail-summary-row-value {
  color: #15803d;
}

/* 費用モーダル — 2カラム（編集 + プレビュー） */
.app-detail-cost-modal-layout {
  display: block;
}

.app-detail-cost-modal-layout--with-preview {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(260px, 0.85fr);
  gap: 16px;
  align-items: start;
}

.app-detail-cost-modal-preview-panel {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: calc(100vh - 180px);
  overflow: auto;
}

.app-detail-cost-modal-date-field {
  padding: 10px 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
}

.app-detail-cost-modal-date-note {
  margin: 2px 0 8px;
  font-size: 11px;
  color: #64748b;
}

.app-detail-cost-modal-preview {
  padding: 10px 12px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
}

.app-detail-cost-modal-preview-title {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 700;
  color: #4338ca;
  display: flex;
  align-items: center;
  gap: 6px;
}

.app-detail-cost-modal-preview-body {
  font-size: 12px;
}

.app-detail-edit-label--with-hint {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}

.app-detail-cost-period-hint {
  font-size: 10px;
  font-weight: 600;
  color: #6366f1;
  letter-spacing: 0.01em;
}

.app-detail-lifeline-fmt-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
  font-size: 13px;
}

.app-detail-lifeline-fmt-row {
  display: grid;
  grid-template-columns: 108px 1fr;
  gap: 10px;
  align-items: start;
  padding: 8px 12px;
  border-bottom: 1px solid #f1f5f9;
  background: #fff;
}

.app-detail-lifeline-fmt-list > .app-detail-lifeline-fmt-row:nth-child(even) {
  background: #f8fafc;
}

.app-detail-lifeline-fmt-row:last-child {
  border-bottom: none;
}

.app-detail-lifeline-fmt-row .detail-field-label {
  font-size: 11px;
  color: #64748b;
  font-weight: 600;
}

.app-detail-lifeline-fmt-row.is-filled-row,
.app-detail-lifeline-fmt-list > .app-detail-lifeline-fmt-row.is-filled-row:nth-child(even) {
  background-color: #E8F5E9 !important;
}

/* 契約関係事項モーダル — 2カラム */
.app-detail-contract-modal-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 20px 28px;
  align-items: start;
}

.app-detail-contract-modal-col {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.app-detail-contract-modal-fields {
  grid-template-columns: 1fr;
  padding: 0;
  gap: 12px;
}

.app-detail-contract-modal-divider {
  grid-column: auto;
  padding-top: 4px;
  margin-top: 4px;
}

.app-detail-contract-modal-divider .app-detail-edit-divider-title {
  color: #6366f1;
}

.app-detail-corp-toggle-btn {
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  border: 1px solid #e2e8f0;
  background: #fff;
  color: #64748b;
  cursor: pointer;
  transition: all 0.15s ease;
}

.app-detail-corp-toggle-btn.is-active {
  background: #16a34a;
  border-color: #16a34a;
  color: #fff;
}

.app-detail-corp-toggle-btn:hover:not(.is-active) {
  border-color: #cbd5e1;
  background: #f8fafc;
}

@media (max-width: 768px) {
  .app-detail-contract-modal-layout {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

.app-detail-lifeline-modal-hint {
  font-size: 12px;
  color: #64748b;
  background: #f0fdfa;
  border: 1px solid #99f6e4;
  border-radius: 8px;
  padding: 10px 12px;
  margin: 0 0 14px;
  line-height: 1.5;
}

.app-detail-section-modal--costs .app-detail-section-modal-body {
  max-width: none;
}

.app-detail-edit-cost-input-wrap .form-input.is-filled,
.app-detail-cost-modal-editor .app-detail-edit-cost-input-wrap .form-input.is-filled {
  background-color: #E8F5E9 !important;
  border-color: #a5d6a7;
}

@media (max-width: 960px) {
  .app-detail-cost-modal-layout--with-preview {
    grid-template-columns: 1fr;
  }

  .app-detail-cost-modal-preview-panel {
    position: static;
    max-height: none;
  }
}

@media (max-width: 480px) {
  .app-detail-edit-cost-cards {
    grid-template-columns: 1fr;
    padding-left: 12px;
    padding-right: 12px;
  }

  .app-detail-edit-cost-group--card.app-detail-edit-cost-group--custom {
    margin-left: 12px;
    margin-right: 12px;
  }

  .app-detail-edit-cost-field-inputs {
    flex-direction: column;
    align-items: stretch;
  }

  .app-detail-edit-cost-input-wrap,
  .app-detail-edit-cost-input-wrap--amount {
    flex: 1 1 100%;
  }

  .app-detail-edit-cost-row {
    flex-wrap: wrap;
    min-height: auto;
    padding-top: 8px;
    padding-bottom: 8px;
  }

  .app-detail-edit-cost-row-label {
    flex: 1 1 100%;
    margin-bottom: 2px;
  }

  .app-detail-edit-cost-row-input {
    flex: 1 1 auto;
    width: 100%;
    max-width: none;
  }
}

/* 申込詳細：閲覧・編集共通のレスポンシブ2カラムグリッド */
.app-detail-section-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: 1rem;
  align-items: start;
}

.app-detail-section-grid-tight {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 160px), 1fr));
  gap: 10px;
}

.app-detail-span-full,
.app-detail-form-span-full {
  grid-column: 1 / -1;
}

.app-detail-form-section {
  padding: 0 16px 16px;
}

/* 閲覧モード用グリッド（編集モードには不使用） */

@media (max-width: 768px) {
  .app-detail-header-inner,
  .app-detail-body,
  .app-detail-footer-inner {
    padding-left: 14px;
    padding-right: 14px;
  }
  .app-detail-title { font-size: 16px; }
  .app-detail-footer-inner {
    flex-direction: column;
    align-items: stretch;
  }
  .app-detail-footer-actions {
    margin-left: 0;
    width: 100%;
  }
  .app-detail-footer-actions .btn {
    flex: 1;
    min-width: 0;
  }
}

/* ---- 申込詳細：申込者情報 カードレイアウト ---- */
.app-detail-applicant-block {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.app-detail-applicant-block-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.app-detail-applicant-block-head-main {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.app-detail-applicant-cards {
  display: grid;
  gap: 16px;
  align-items: stretch;
}

.app-detail-applicant-cards--cols-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.app-detail-applicant-cards--cols-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.app-detail-applicant-cards--personal {
  grid-template-columns: minmax(0, 640px);
  justify-content: center;
  width: 100%;
}

.app-detail-applicant-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: 100%;
  margin: 0;
}

.app-detail-applicant-type-badge {
  margin-bottom: 12px;
}

.app-detail-applicant-card .app-detail-section-header-row {
  margin-bottom: 12px;
}

.app-detail-applicant-card-body {
  flex: 1;
  min-width: 0;
}

.app-detail-applicant-field-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.app-detail-applicant-field-list .flex {
  align-items: flex-start;
}

.app-detail-applicant-field-list .text-gray-500 {
  min-width: 5.5rem;
}

@media (max-width: 1100px) {
  .app-detail-applicant-cards--cols-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  .app-detail-applicant-cards--cols-2,
  .app-detail-applicant-cards--cols-3 {
    grid-template-columns: 1fr;
  }

  .app-detail-applicant-cards--personal {
    grid-template-columns: 1fr;
  }
}

/* ---- 申込詳細：物件情報 2カラム ---- */
.detail-field-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: #9ca3af;
  letter-spacing: 0.02em;
}

.app-detail-property-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.app-detail-subsection-title {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 700;
  color: #475569;
  margin: 0 0 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid #e5e7eb;
}

.app-detail-owner-col {
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 14px;
  min-height: 100%;
}

.app-detail-owner-empty {
  text-align: center;
  padding: 20px 12px;
  color: #9ca3af;
  font-size: 13px;
}
.app-detail-owner-empty i {
  font-size: 28px;
  margin-bottom: 8px;
  display: block;
  color: #d1d5db;
}
.app-detail-owner-empty p {
  margin: 0 0 4px;
  font-weight: 600;
  color: #6b7280;
}

.app-detail-owner-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid #e5e7eb;
}

@media (max-width: 768px) {
  .app-detail-property-grid {
    grid-template-columns: 1fr;
  }
}

.app-new-owner-empty {
  text-align: center;
  padding: 16px 10px;
  color: #9ca3af;
  font-size: 13px;
}
.app-new-owner-empty i {
  font-size: 24px;
  margin-bottom: 6px;
  display: block;
  color: #d1d5db;
}
.app-new-owner-empty p {
  margin: 0 0 4px;
  font-weight: 600;
  color: #6b7280;
}
.app-new-owner-preview-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 13px;
}

/* ---- コックピット：ヘッダー + 物件条件インライン ---- */
.vd-cmd-header {
  background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 50%, #f8fafc 100%);
  border: 1px solid #bbf7d0;
  border-radius: 14px;
  padding: 16px 18px;
}

.vd-cmd-header-compact {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.vd-cmd-header-primary {
  flex: 1;
  min-width: 0;
}

.vd-cmd-title-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px 16px;
  flex-wrap: wrap;
}

.vd-cmd-title-line .vd-cmd-title {
  margin: 0;
  flex: 0 1 auto;
  min-width: 0;
}

.vd-cmd-title-register {
  flex-shrink: 0;
  align-self: flex-end;
  margin-left: auto;
}

.vd-cmd-register-app-btn {
  white-space: nowrap;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(22, 163, 74, 0.25);
}

.vd-cmd-title-stats {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 10px;
  padding: 6px 10px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid #bbf7d0;
  border-radius: 10px;
  flex: 1 1 320px;
  max-width: 100%;
}

.vd-cmd-stat-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  font-size: 11px;
  white-space: nowrap;
}

.vd-cmd-stat-label {
  color: #64748b;
  font-weight: 600;
}

.vd-cmd-stat-value {
  color: #1e293b;
  font-weight: 700;
  font-size: 12px;
}

.vd-cmd-stat-edit {
  margin-left: auto;
  flex-shrink: 0;
}

.vd-cmd-subline {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin-top: 6px;
}

.vd-cmd-subline .vd-cmd-address {
  margin: 0;
}

.vd-cmd-subline .vd-cmd-badges {
  margin-top: 0;
}

.vd-cmd-eyebrow {
  font-size: 11px;
  font-weight: 700;
  color: #16a34a;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
}

.vd-cmd-title {
  font-size: 20px;
  font-weight: 800;
  color: #1e293b;
  margin: 0;
  line-height: 1.25;
}

.vd-cmd-room-number {
  color: #15803d;
}

.vd-cmd-address {
  color: #64748b;
  font-size: 12px;
}

.vd-cmd-badges {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.vd-cmd-days-badge {
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 700;
}

.vd-cmd-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.vd-cmd-conditions-inline {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 10px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid #bbf7d0;
  border-radius: 10px;
  max-width: 100%;
}

.vd-cmd-cond-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  font-size: 11px;
  white-space: nowrap;
}

.vd-cmd-cond-label {
  color: #64748b;
  font-weight: 600;
}

.vd-cmd-cond-value {
  color: #1e293b;
  font-weight: 700;
  font-size: 12px;
}

.vd-cmd-cond-edit {
  margin-left: 2px;
  flex-shrink: 0;
}

/* ---- コックピット：2カラム + アコーディオン ---- */
.vd-cockpit-main-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: start;
}

.vd-cockpit-main-row--single {
  grid-template-columns: 1fr;
}

.vd-shared-memo-list--readonly {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.vd-shared-memo-item--readonly {
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 12px 14px;
  background: #fafafa;
}

.vd-cockpit-col-card {
  margin: 0;
  overflow: hidden;
}

.vd-cockpit-col-card > .vd-cockpit-accordion {
  border: none;
  border-radius: 0;
}

.vd-cockpit-accordion > summary {
  list-style: none;
}

.vd-cockpit-accordion > summary::-webkit-details-marker {
  display: none;
}

.vd-cockpit-accordion-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 18px;
  cursor: pointer;
  user-select: none;
  border-bottom: 1px solid transparent;
  transition: background 0.15s ease;
}

.vd-cockpit-accordion-summary:hover {
  background: #fafffe;
}

.vd-cockpit-accordion[open] > .vd-cockpit-accordion-summary {
  border-bottom-color: #ecfdf5;
  background: #fafffe;
}

.vd-cockpit-accordion-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 14px;
  color: #1e293b;
}

.vd-cockpit-accordion-title i {
  color: #16a34a;
}

.vd-cockpit-accordion-meta {
  font-size: 11px;
  font-weight: 700;
  color: #64748b;
  background: #f1f5f9;
  padding: 3px 10px;
  border-radius: 8px;
  flex-shrink: 0;
}

.vd-cockpit-accordion-meta.is-filled {
  color: #15803d;
  background: #dcfce7;
}

.vd-cockpit-accordion-body {
  padding: 14px 18px 18px;
}

.vd-cockpit-accordion-body .vd-shared-memo-form-area {
  margin: -14px -18px 14px;
  padding: 14px 18px;
}

.vd-cockpit-accordion-body .vd-shared-memo-list-head {
  margin-top: 0;
}

.vd-app-mgmt-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.vd-sec-applications-body {
  padding-top: 4px;
}

.vd-app-list-empty {
  text-align: center;
  color: #94a3b8;
  font-size: 13px;
  padding: 20px 12px;
  background: #f8fafc;
  border: 1px dashed #e2e8f0;
  border-radius: 10px;
}

/* ---- コックピット：物件条件共有メモ ---- */
.vd-cockpit-memos .card-title i { color: #16a34a; }

.vd-cockpit-applications .vd-app-list-details {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #f8fafc;
  overflow: hidden;
}

.vd-cockpit-applications .vd-app-list-details-summary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  font-size: 12px;
  font-weight: 600;
  color: #475569;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.vd-cockpit-applications .vd-app-list-details-summary::-webkit-details-marker {
  display: none;
}

.vd-cockpit-applications .vd-app-list-details-icon {
  font-size: 10px;
  color: #94a3b8;
  transition: transform 0.15s ease;
}

.vd-cockpit-applications .vd-app-list-details[open] .vd-app-list-details-icon {
  transform: rotate(90deg);
}

.vd-cockpit-applications .vd-app-list-details-body {
  padding: 0 12px 12px;
  background: #fff;
  border-top: 1px solid #e2e8f0;
}

.vd-app-mgmt-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  flex-wrap: wrap;
}

.vd-app-mgmt-head-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.vd-app-mgmt-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 14px;
  color: #1e293b;
}

.vd-app-mgmt-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  flex-wrap: wrap;
}

.vd-app-presence-list {
  max-width: 360px;
}

.vd-app-kind-editor {
  padding: 12px 18px 14px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
}

.vd-app-kind-editor-label {
  margin: 0 0 10px;
  font-size: 11px;
  font-weight: 600;
  color: #64748b;
}

.vd-app-kind-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.vd-app-kind-btn {
  padding: 8px 14px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  border: 2px solid #e2e8f0;
  background: #fff;
  color: #374151;
  transition: all 0.15s ease;
}

.vd-app-kind-btn:hover:not(:disabled) {
  border-color: #cbd5e1;
  background: #f8fafc;
}

.vd-app-kind-btn.is-active {
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.04);
}

.vd-app-kind-btn:disabled {
  opacity: 0.6;
  cursor: wait;
}

.vd-shared-memo-count,
.vd-shared-memo-list-count {
  font-size: 11px; font-weight: 700; color: #16a34a;
  background: #dcfce7; padding: 2px 8px; border-radius: 8px;
}
.vd-shared-memo-form-area { background: #fafffe; border-bottom: 1px solid #ecfdf5; }
.vd-shared-memo-form-label {
  font-size: 12px; font-weight: 700; color: #64748b;
  margin-bottom: 12px; display: flex; align-items: center; gap: 6px;
}
.vd-shared-memo-form-label i { color: #16a34a; }
.vd-shared-memo-form { display: flex; flex-direction: column; gap: 12px; }
.vd-shared-memo-form-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
}
.vd-shared-memo-form-actions { display: flex; justify-content: flex-end; gap: 8px; }
.vd-shared-memo-list-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 18px; background: #f8fafc; border-bottom: 1px solid #f1f5f9;
  font-size: 11px; font-weight: 700; color: #64748b; letter-spacing: 0.04em;
}
.vd-shared-memo-list { background: #fff; }
.vd-shared-memo-item {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 14px 18px; border-bottom: 1px solid #f3f4f6;
}
.vd-shared-memo-item:last-child { border-bottom: none; }
.vd-shared-memo-item-body { flex: 1; min-width: 0; }
.vd-shared-memo-meta {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; margin-bottom: 8px;
}
.vd-shared-memo-user {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 600; color: #374151;
}
.vd-shared-memo-avatar {
  display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; border-radius: 999px;
  background: #dbeafe; color: #1d4ed8; font-size: 10px; font-weight: 800;
}
.vd-shared-memo-time {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; color: #94a3b8; white-space: nowrap;
}
.vd-shared-memo-time i { font-size: 10px; }
.vd-shared-memo-text {
  font-size: 13px; color: #1f2937; white-space: pre-wrap;
  line-height: 1.55; margin: 0;
}
.vd-shared-memo-actions { display: flex; gap: 4px; flex-shrink: 0; }
.vd-shared-memo-delete { color: #dc2626 !important; border-color: #fca5a5 !important; }
.vd-shared-memo-empty {
  padding: 24px 18px; text-align: center; color: #94a3b8; font-size: 13px;
}
.vd-shared-memo-empty i {
  font-size: 20px; display: block; margin-bottom: 8px; color: #cbd5e1;
}

/* ---- フローティング保存バー ---- */
#floating-save-bar {
  position: fixed;
  bottom: 0;
  left: var(--sidebar-w);
  right: 0;
  z-index: 200;
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-top: 1px solid #e5e7eb;
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.08);
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  transform: translateY(100%);
  transition: transform 0.25s ease;
}
#floating-save-bar.is-visible { transform: translateY(0); }
#floating-save-bar .fsb-label {
  font-size: 13px;
  color: #64748b;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
#floating-save-bar .fsb-label.is-dirty { color: #b45309; font-weight: 600; }
#floating-save-bar .fsb-actions { display: flex; gap: 10px; flex-shrink: 0; }
.page-container.has-floating-save { padding-bottom: 88px; }

@media (max-width: 768px) {
  #floating-save-bar {
    left: 0;
    right: 0;
    position: fixed;
    bottom: 0;
    padding: 8px 12px;
    padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px));
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.08);
  }
  /* 通常時はラベルを非表示にしてバー高さを抑える */
  #floating-save-bar .fsb-label {
    display: none;
    font-size: 11px;
    line-height: 1.35;
    margin: 0;
  }
  #floating-save-bar .fsb-label.is-dirty {
    display: flex;
  }
  #floating-save-bar .fsb-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr);
    gap: 8px;
    width: 100%;
  }
  #floating-save-bar .fsb-actions .btn {
    min-height: 40px;
    height: 40px;
    max-height: 44px;
    padding: 0 10px;
    font-size: 13px;
    justify-content: center;
    width: 100%;
    margin: 0;
  }
  #floating-save-bar #fsb-save-btn.btn-lg {
    padding: 0 10px;
    font-size: 13px;
    line-height: 1;
  }
  .page-container.has-floating-save {
    padding-bottom: calc(56px + env(safe-area-inset-bottom, 0px));
  }
  body:has(#floating-save-bar.is-visible .fsb-label.is-dirty) .page-container.has-floating-save {
    padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px));
  }
}

/* ---- 入居者詳細ハブ ---- */
.resident-hub-header {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: #fff;
  border-radius: 10px;
  padding: 16px 20px;
  margin-bottom: 16px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 20px;
}
.resident-hub-header .rh-name { font-size: 20px; font-weight: 700; }
.resident-hub-header .rh-meta { font-size: 13px; opacity: 0.9; }
.resident-hub-header .rh-meta a { color: #fff; text-decoration: none; }
.resident-hub-header .rh-meta a:hover { text-decoration: underline; }

.resident-hub-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}
@media (max-width: 1024px) {
  .resident-hub-grid { grid-template-columns: 1fr; }
}

.resident-hub-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.resident-hub-card .hub-card-head {
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 700;
  border-bottom: 1px solid #f0f0f0;
  display: flex;
  align-items: center;
  gap: 8px;
}
.resident-hub-card .hub-card-body {
  padding: 14px;
  flex: 1;
  font-size: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.resident-hub-card .hub-card-foot {
  padding: 10px 14px;
  border-top: 1px solid #f0f0f0;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}
.resident-hub-card.hub-renewal { border-top: 3px solid #7c3aed; }
.resident-hub-card.hub-contract { border-top: 3px solid var(--primary); }
.resident-hub-card.hub-docs     { border-top: 3px solid var(--accent); }

.hub-progress-bar {
  height: 6px;
  background: #e5e7eb;
  border-radius: 3px;
  overflow: hidden;
}
.hub-progress-fill {
  height: 100%;
  background: #7c3aed;
  border-radius: 3px;
}

/* ---- 空室詳細：Sticky ヘッダー + セクションジャンプ ---- */
.vd-detail-page {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: min(1120px, 100%);
  --vd-sticky-header-height: 132px;
  --vd-topbar-offset: 56px;
}

.vd-sticky-header {
  position: sticky;
  top: var(--vd-topbar-offset, 56px);
  z-index: 35;
  margin: -24px -24px 0;
  padding: 16px 24px 12px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 2px 12px rgba(15, 23, 42, 0.08);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.vd-sticky-header #vd-cmd-header {
  margin-bottom: 10px;
  box-shadow: none;
}

.vd-detail-section-nav {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 10px 14px 12px;
  background: #f8fafc;
}

.vd-detail-section-nav-label {
  margin: 0 0 8px;
  font-size: 10px;
  font-weight: 700;
  color: #94a3b8;
  letter-spacing: 0.08em;
  display: flex;
  align-items: center;
  gap: 5px;
}

.vd-detail-section-nav-label i {
  color: #6366f1;
  font-size: 11px;
}

.vd-detail-section-nav-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.vd-detail-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.vd-detail-page .vd-detail-scroll-target,
.vd-detail-page [id^="vd-sec-"] {
  scroll-margin-top: calc(var(--vd-topbar-offset, 56px) + var(--vd-sticky-header-height, 180px) + 8px);
}

.vd-detail-edit-accordion > summary {
  list-style: none;
}

.vd-detail-edit-accordion > summary::-webkit-details-marker {
  display: none;
}

/* 空室詳細 — 初期費用・その他費用（2カラム + 縦積みリスト） */
.vd-fee-section-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 18px;
  border-bottom: 1px solid #f1f5f9;
  font-weight: 700;
  font-size: 14px;
  color: #1e293b;
}

.vd-fee-section-head i {
  color: var(--primary);
}

.vd-fee-section-body {
  padding: 18px;
  font-size: 0.85rem;
}

.vd-fee-layout {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.vd-fee-layout-top {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  align-items: stretch;
}

.vd-fee-layout-left,
.vd-fee-layout-right {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

.vd-fee-layout-left .vd-fee-card {
  flex: 1;
}

.vd-fee-layout-bottom {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* 個別カード（A〜G） */
.vd-fee-card {
  display: flex;
  flex-direction: column;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #fff;
  overflow: hidden;
  margin: 0;
  min-height: 0;
}

.vd-fee-card-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  min-height: 40px;
}

.vd-fee-card-icon {
  color: var(--primary);
  font-size: 12px;
  width: 14px;
  text-align: center;
  flex-shrink: 0;
}

.vd-fee-card-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: #334155;
  flex: 1;
  min-width: 0;
}

.vd-fee-card-action {
  margin-left: auto;
  flex-shrink: 0;
}

.vd-fee-card-body {
  padding: 12px 14px 14px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.vd-fee-card-body .vd-fee-vertical-list {
  border: none;
  border-radius: 0;
}

.vd-fee-card-body .vd-fee-vrow:last-child {
  border-bottom: none;
}

.vd-fee-vertical-list {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
  font-size: 0.85rem;
}

.vd-fee-vrow {
  display: grid;
  grid-template-columns: 108px 1fr;
  gap: 10px;
  align-items: center;
  padding: 10px 14px;
  border-bottom: 1px solid #f1f5f9;
  background: #ffffff;
}

.vd-fee-vertical-list > .vd-fee-vrow:nth-child(even) {
  background: #f8fafc;
}

.vd-fee-vrow--stacked {
  align-items: start;
}

.vd-fee-vrow-label {
  font-weight: 600;
  color: #475569;
}

.vd-fee-vrow-input {
  min-width: 0;
}

.vd-fee-vrow-input--with-unit {
  display: flex;
  align-items: center;
  gap: 6px;
}

.vd-fee-input {
  width: 100%;
  box-sizing: border-box;
  font-size: 0.85rem;
  padding: 6px 10px;
  height: 34px;
}

.vd-fee-mode-toggle {
  display: flex;
  gap: 6px;
  margin-bottom: 8px;
}

.vd-fee-mode-opt {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  font-size: 0.75rem;
  padding: 3px 10px;
  border: 1px solid #e5e7eb;
  border-radius: 9999px;
  color: #6b7280;
}

.vd-fee-mode-opt.is-active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  font-weight: 600;
}

.vd-fee-mode-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.vd-fee-unit {
  font-size: 0.75rem;
  color: #6b7280;
  white-space: nowrap;
  flex-shrink: 0;
}

.vd-fee-month-preview {
  font-size: 0.72rem;
  color: #2563eb;
  white-space: nowrap;
  flex-shrink: 0;
  margin-left: 4px;
}

.vd-deposit-increase-head {
  display: grid;
  grid-template-columns: 1fr 72px 1fr auto;
  gap: 8px;
  padding: 6px 0 6px;
  font-size: 0.75rem;
  font-weight: 600;
  color: #64748b;
}

.vd-deposit-increase-list {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.vd-deposit-increase-row {
  display: grid;
  grid-template-columns: 1fr 72px 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 8px 12px;
  border-bottom: 1px solid #f8fafc;
}

.vd-deposit-increase-row:last-child {
  border-bottom: none;
}

.vd-deposit-increase-row .form-input {
  font-size: 0.85rem;
  height: 34px;
  padding: 6px 10px;
}

.vd-deposit-increase-remove {
  background: none;
  border: none;
  color: #f87171;
  cursor: pointer;
  padding: 4px 8px;
}

.vd-deposit-increase-add-wrap {
  padding: 0;
}

.vd-fee-free-rent-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  color: #0c4a6e;
  margin-bottom: 4px;
}

.vd-fee-extra-list {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.vd-fee-extra-row {
  display: grid;
  grid-template-columns: 1fr 120px auto;
  gap: 8px;
  align-items: center;
  padding: 8px 12px;
  border-bottom: 1px solid #f1f5f9;
  font-size: 0.85rem;
}

.vd-fee-extra-row:last-child {
  border-bottom: none;
}

.vd-fee-extra-row .form-input {
  font-size: 0.85rem;
  height: 34px;
  padding: 6px 10px;
}

.vd-fee-extra-delete {
  background: none;
  border: none;
  color: #f87171;
  cursor: pointer;
  padding: 4px 8px;
}

.vd-fee-extra-empty {
  text-align: center;
  color: #94a3b8;
  font-size: 0.85rem;
  padding: 12px;
}

@media (max-width: 900px) {
  .vd-fee-layout-top {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .vd-fee-vrow,
  .vd-deposit-increase-head,
  .vd-deposit-increase-row,
  .vd-fee-extra-row {
    grid-template-columns: 1fr;
  }

  .vd-fee-free-rent-detail {
    grid-template-columns: 1fr;
  }
}

/* ---- ドラッグ可能フローティングパネル ---- */
.draggable-panel-backdrop {
  position: fixed;
  inset: 0;
  z-index: 900;
  background: transparent;
  pointer-events: none;
}
.draggable-panel-backdrop.hidden { display: none; }

.draggable-panel {
  position: fixed;
  z-index: 950;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(15, 23, 42, 0.22), 0 0 0 1px rgba(148, 163, 184, 0.25);
  display: flex;
  flex-direction: column;
  max-height: min(82vh, 720px);
  overflow: hidden;
}
.draggable-panel.hidden { display: none !important; }
.draggable-panel.is-minimized .draggable-panel-body { display: none; }
.draggable-panel.is-minimized { max-height: none; }
.draggable-panel.is-dragging { user-select: none; cursor: grabbing; }

.draggable-panel-handle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px 10px 14px;
  background: linear-gradient(135deg, #1e3a5f, #2d5a8e);
  color: #fff;
  cursor: grab;
  flex-shrink: 0;
}
.draggable-panel.is-dragging .draggable-panel-handle { cursor: grabbing; }
.draggable-panel-title {
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}
.draggable-panel-handle-actions { display: flex; gap: 4px; }
.draggable-panel-btn {
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 6px;
  background: rgba(255,255,255,0.12);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
}
.draggable-panel-btn:hover { background: rgba(255,255,255,0.22); }

.draggable-panel-body {
  padding: 14px 16px 16px;
  overflow-y: auto;
  font-size: 12px;
  line-height: 1.55;
}
.draggable-panel.is-no-scroll {
  max-height: none;
  overflow: visible;
}
.draggable-panel.is-no-scroll .draggable-panel-body {
  overflow: visible;
}

.draggable-panel.draggable-panel--orm-preview {
  max-height: min(92vh, 920px);
  z-index: 960;
}
.draggable-panel.draggable-panel--orm-preview.is-resizable {
  max-height: none;
}
.draggable-panel.draggable-panel--orm-preview .draggable-panel-body {
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.orm-preview-body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 8px 0;
  background: #f9fafb;
  border-radius: 8px;
}
.orm-preview-resize-hint {
  margin: 8px 0 0;
  font-size: 11px;
  color: #94a3b8;
  flex-shrink: 0;
}
.orm-preview-resize-hint i {
  margin-right: 4px;
}

.fee-sync-hint,
.vd-fee-sync-hint {
  margin: 0 0 12px;
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.5;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1e40af;
}
.vd-fee-sync-hint {
  margin: 0 18px 12px;
}
.vd-fee-sync-hint--muted {
  background: #f8fafc;
  border-color: #e2e8f0;
  color: #64748b;
}
.fee-sync-hint a,
.vd-fee-sync-hint a {
  color: #1d4ed8;
  font-weight: 600;
  text-decoration: underline;
}
.fee-sync-hint i,
.vd-fee-sync-hint i {
  margin-right: 6px;
}

/* 管理契約数値設定 — 縦並びフォーム */
.omc-settings-stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.omc-settings-card {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 12px 14px;
  background: #f8fafc;
}
.omc-settings-card-title {
  font-size: 13px;
  font-weight: 700;
  color: #1e3a5f;
  margin: 0 0 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid #e2e8f0;
}
.omc-settings-field {
  margin-bottom: 10px;
}
.omc-settings-field:last-child {
  margin-bottom: 0;
}
.omc-settings-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: #64748b;
  margin-bottom: 4px;
}
.omc-settings-field .form-input {
  width: 100%;
  box-sizing: border-box;
  padding: 6px 10px;
  font-size: 12px;
}
.omc-settings-check {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  color: #334155;
  cursor: pointer;
  user-select: none;
}
.omc-settings-check input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin-top: 1px;
  flex-shrink: 0;
  accent-color: #2563eb;
  cursor: pointer;
}
.omc-settings-hint {
  font-size: 10px;
  color: #94a3b8;
  margin: 6px 0 0 24px;
  line-height: 1.45;
}
.omc-settings-day-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
}
.omc-settings-day-wrap .form-input {
  width: 72px;
  flex-shrink: 0;
}
.omc-settings-day-suffix {
  font-size: 12px;
  color: #64748b;
}
.omc-settings-footer {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed #e2e8f0;
}

.agreed-terms-section {
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid #e5e7eb;
}
.agreed-terms-section:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.agreed-terms-section h4 {
  font-size: 11px;
  font-weight: 700;
  color: #64748b;
  letter-spacing: 0.04em;
  margin-bottom: 8px;
}
.agreed-terms-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 12px;
}
.agreed-terms-grid .label { color: #94a3b8; font-size: 10px; }
.agreed-terms-grid .value { font-weight: 600; color: #1e293b; }
.agreed-terms-property {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 8px;
}
.agreed-terms-property:last-child { margin-bottom: 0; }
.agreed-terms-property-name {
  font-weight: 700;
  font-size: 13px;
  color: #1e3a5f;
  margin-bottom: 6px;
}

/* ===== 空室詳細 統合UI ===== */
.vu-detail-page .vu-detail-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.vu-legacy-hint {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 14px;
  margin-bottom: 12px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 10px;
  font-size: 12px;
  color: #1e40af;
}
.vu-section {
  overflow: hidden;
  scroll-margin-top: calc(var(--vd-topbar-offset, 56px) + var(--vd-sticky-header-height, 180px) + 8px);
}
.vu-sec-key .vu-kv-table th { background: #fffbeb; }
.vu-sec-key .vu-kv-table td { background: #fffbeb; }
.vu-initial-costs-body { padding: 14px 18px 18px; }
.vu-initial-costs-supplement {
  margin-bottom: 16px;
  border: 1px solid #e9d5ff;
  border-radius: 10px;
  overflow: hidden;
  background: #faf5ff;
}
.vu-initial-costs-supplement .vu-kv-table th { background: #f3e8ff; }
.vu-initial-costs-supplement-head {
  margin: 0;
  padding: 10px 18px;
  font-size: 12px;
  font-weight: 700;
  color: #6b21a8;
  background: #f3e8ff;
  border-bottom: 1px solid #e9d5ff;
}
.vu-initial-costs-detail-label {
  margin: 16px 0 8px;
  font-size: 12px;
  font-weight: 700;
  color: #475569;
}
.vu-initial-costs-notice {
  margin: 0 0 12px;
  padding: 10px 12px;
  font-size: 12px;
  color: #92400e;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 8px;
}
.vu-initial-costs-actions .flex { display: flex; flex-wrap: wrap; gap: 8px; }
.vu-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid #f1f5f9;
}
.vu-section-title {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: #1e293b;
  display: flex;
  align-items: center;
  gap: 8px;
}
.vu-section-body { padding: 0; }
.vu-kv-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.vu-kv-table th {
  width: 30%;
  min-width: 120px;
  padding: 11px 18px;
  text-align: left;
  vertical-align: top;
  font-weight: 600;
  color: #64748b;
  background: #f8fafc;
  border-bottom: 1px solid #f1f5f9;
}
.vu-kv-table td {
  padding: 11px 18px;
  color: #1e293b;
  border-bottom: 1px solid #f1f5f9;
  line-height: 1.55;
}
.vu-kv-table tr:last-child th,
.vu-kv-table tr:last-child td { border-bottom: none; }
.vu-empty { color: #cbd5e1; font-style: italic; }
.vu-empty-block {
  text-align: center;
  color: #94a3b8;
  font-size: 13px;
  padding: 24px 12px;
}
.vu-pre {
  white-space: pre-wrap;
  word-break: break-word;
}
.vu-muted { color: #6b7280; font-size: 12px; }
.vu-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 700;
}
.vu-badge-green { background: #dcfce7; color: #15803d; border: 1px solid #86efac; }
.vu-badge-blue { background: #dbeafe; color: #1d4ed8; border: 1px solid #93c5fd; }
.vu-badge-amber { background: #fef3c7; color: #b45309; border: 1px solid #fcd34d; }
.vu-badge-purple { background: #ede9fe; color: #7c3aed; border: 1px solid #c4b5fd; }
.vu-badge-gray { background: #f3f4f6; color: #6b7280; border: 1px solid #e5e7eb; }
.vu-chip {
  display: inline-block;
  padding: 2px 8px;
  margin: 2px 4px 2px 0;
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
}
.vu-fac-chip {
  display: inline-block;
  padding: 3px 8px;
  margin: 2px 4px 2px 0;
  background: #f0fdf4;
  color: #16a34a;
  border: 1px solid #bbf7d0;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
}
.vu-section-nav {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 14px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
}
.vu-section-nav-label {
  font-size: 11px;
  font-weight: 700;
  color: #94a3b8;
  white-space: nowrap;
}
.vu-section-nav-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  overflow-x: auto;
}
.vu-nav-chip {
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  color: #475569;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.vu-nav-chip:hover { background: #eff6ff; border-color: #93c5fd; color: #1d4ed8; }
.vu-ops-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: start;
}
@media (max-width: 960px) {
  .vu-ops-row { grid-template-columns: 1fr; }
}
.vu-ops-col .card { height: 100%; }
.vu-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 16px;
  border-radius: 12px;
  margin-bottom: 4px;
}
.vu-banner-renewal { background: #f3e8ff; border: 2px solid #7c3aed; color: #4c1d95; }
.vu-banner-occupied { background: #eff6ff; border: 2px solid #2563eb; color: #1e3a8a; cursor: pointer; }
.vu-banner-link { font-size: 12px; font-weight: 700; color: #2563eb; }
.vu-photo-thumb-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 14px;
  background: #0f172a;
  color: #e2e8f0;
  border-radius: 10px;
  font-size: 12px;
  cursor: pointer;
}
.vu-photo-thumb-bar:hover { background: #1e293b; }
.vu-photo-thumb-img {
  width: 56px;
  height: 42px;
  object-fit: cover;
  border-radius: 6px;
  flex-shrink: 0;
  border: 1px solid rgba(255,255,255,.15);
}
.vu-photo-thumb-fallback {
  width: 56px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,.08);
  border-radius: 6px;
  flex-shrink: 0;
}
.vu-memo-flat .vu-section-body { padding: 14px 18px; }
.vu-memo-count {
  font-size: 11px;
  font-weight: 600;
  color: #64748b;
  margin-left: 6px;
}
.vu-photo-list { padding: 14px 18px; display: flex; flex-direction: column; gap: 8px; }
.vu-photo-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0,0,0,.45);
  border: none;
  color: #fff;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  z-index: 2;
}
.vu-photo-nav-prev { left: 10px; }
.vu-photo-nav-next { right: 10px; }
.vu-photo-counter {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,.5);
  color: #fff;
  font-size: 12px;
  padding: 3px 10px;
  border-radius: 12px;
}
.vu-history-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.vu-history-table th {
  padding: 10px 18px;
  text-align: left;
  font-size: 11px;
  color: #6b7280;
  background: #f9fafb;
}
.vu-history-table td { padding: 10px 18px; border-top: 1px solid #f1f5f9; }
.vu-property-summary-summary {
  cursor: pointer;
  list-style: none;
}
.vu-property-summary-summary::-webkit-details-marker { display: none; }
.vu-footer-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 8px 0 20px;
}
.vu-advanced-block { margin-top: 4px; }
.vu-advanced-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  cursor: pointer;
  list-style: none;
}
.vu-advanced-summary::-webkit-details-marker { display: none; }
.vu-advanced-summary-main { flex: 1; min-width: 0; }
.vu-advanced-hint {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: #64748b;
  margin-top: 4px;
}
.vu-advanced-chevron {
  color: #94a3b8;
  font-size: 12px;
  transition: transform 0.2s ease;
  flex-shrink: 0;
}
.vu-advanced-block[open] .vu-advanced-chevron { transform: rotate(180deg); }
.vu-advanced-body {
  border-top: 1px solid #e5e7eb;
  padding: 4px 0 8px;
}
.vu-inner-section {
  padding: 12px 18px;
  border-bottom: 1px solid #f1f5f9;
}
.vu-inner-section:last-child { border-bottom: none; }
.vu-inner-title {
  font-size: 14px;
  font-weight: 700;
  color: #334155;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}
.vu-inner-title i { color: #64748b; font-size: 13px; }
.vu-large-modal-body .vd-fee-section-body,
.vu-large-modal-body .vd-fee-layout-bottom { padding: 0; }
.vu-large-modal-body .card { box-shadow: none; border: none; }
