:root{
  --bg:#f6f7fb; --text:#222; --muted:#667085; --border:#e5e7eb;
  --primary:#005bac; --primary-contrast:#fff;
  --radius:12px; --shadow:0 1px 2px rgba(0,0,0,.06);
  --max:1200px;

  /* button semantics */
  --btn-back-bg:#f3f4f6; --btn-back-text:#374151; --btn-back-border:#e5e7eb;
  --btn-cta-shadow:0 10px 22px rgba(0,91,172,.22);
  /* CIC (orange) */
  --cic:#f97316; --cic-contrast:#fff; --cic-shadow:0 10px 22px rgba(249,115,22,.22);
  /* pre-contract (distinct) */
  --precontract:#7c3aed; --precontract-contrast:#fff; --precontract-shadow:0 10px 22px rgba(124,58,237,.22);

  /* download (distinct) */
  --download:#0ea5e9; --download-contrast:#fff; --download-shadow:0 10px 22px rgba(14,165,233,.18);

}
*{ box-sizing:border-box; }
body{ margin:0; font-family: system-ui, -apple-system, "Yu Gothic", "Meiryo", sans-serif; background:var(--bg); color:var(--text); line-height:1.6; }
.l-header{ background:var(--primary); color:var(--primary-contrast); }
.l-header.l-header--company{
  /* 不動産会社管理画面：一目で区別できるようにグリーン系 */
  background:linear-gradient(90deg, #0f3d2e, #14532d);
}
.l-header__inner{ max-width:var(--max); margin:0 auto; padding:18px 16px; display:flex; align-items:center; }
.l-header--company .l-header__inner{ padding:22px 16px; }
.l-header__nav{ margin-left:auto; display:flex; gap:10px; align-items:center; flex-wrap:wrap; justify-content:flex-end; }
.l-header__link{ color:var(--primary-contrast); text-decoration:none; font-weight:700; font-size:13px; padding:6px 10px; border-radius:10px; }
.l-header__link:hover{ background:rgba(255,255,255,.12); }
.l-header--company .l-header__link:hover{ background:rgba(255,255,255,.16); }

/* company portal: emphasize "依頼一覧" and keep logout as icon */
.l-header--company .l-header__link--companyHome{
  font-size:15px;
  padding:10px 14px;
  background:rgba(255,255,255,.14);
  border:1px solid rgba(255,255,255,.22);
}
.l-header--company .l-header__link--companyHome:hover{ background:rgba(255,255,255,.18); }
.l-header--company .l-header__link--icon{ padding:8px 10px; }
.l-header__icon{ display:inline-flex; align-items:center; justify-content:center; }
.l-brand{ display:flex; gap:10px; align-items:center; }
.l-brand__dot{ width:10px; height:10px; border-radius:999px; background:rgba(255,255,255,.9); }
.l-brand__name{ font-weight:700; }
.c-chip{ background:rgba(255,255,255,.18); border:1px solid rgba(255,255,255,.25); padding:2px 8px; border-radius:999px; font-size:12px; }
.l-main{ padding:32px 16px 48px; }
.l-container{ max-width:var(--max); margin:0 auto; }
.c-card{ border:1px solid var(--border); border-radius:var(--radius); box-shadow:0 1px 2px rgba(0,0,0,.05); padding:20px; background:#fff; }
.c-card + .c-card{ margin-top:18px; }
.c-h1{ margin:0 0 10px 0; font-size:19px; }
.page-title{ text-align:center; font-size:28px; font-weight:800; margin:2px 0 18px; letter-spacing:.02em; }

.c-headrow{ display:flex; align-items:flex-start; justify-content:space-between; gap:12px; background:#f8fafc; border:1px solid var(--border); padding:14px 16px; border-radius:12px; margin:0 0 14px 0;  flex-wrap:wrap;}
.c-headrow > div{ min-width:0; }
.c-text{ margin:0; color:var(--muted); }
.c-btn{ appearance:none; border:1px solid var(--border); border-radius:10px; padding:10px 14px; cursor:pointer; font-weight:600; display:inline-flex; align-items:center; justify-content:center; text-align:center; text-decoration:none; }
.c-btn:hover{ text-decoration:none; }
/* size helpers (buttons in tables etc.) */
.c-btn--sm{ padding:9px 12px; border-radius:10px; font-size:14px; }
.c-btn--xs{ padding:7px 10px; border-radius:10px; font-size:13px; line-height:1.1; }
.c-btn--xs{ padding:8px 10px; border-radius:10px; font-size:13px; }
.c-btn--primary{ background:var(--primary); color:var(--primary-contrast); border-color:transparent; }
.c-btn--primary:visited{ color:var(--primary-contrast); }
.c-btn--primary:hover,.c-btn--cta:hover{ filter:brightness(.98); }
.c-btn--secondary{ background:#fff; color:var(--text); }
.c-btn--secondary:visited{ color:var(--text); }
.c-btn--back{ background:var(--btn-back-bg); color:var(--btn-back-text); border-color:var(--btn-back-border); }
.c-btn--cta{ background:var(--primary); color:var(--primary-contrast); border-color:transparent; box-shadow:var(--btn-cta-shadow); }
.c-btn:disabled{ opacity:.55; cursor:not-allowed; }
.c-btn[aria-busy="true"]{ position:relative; }
.c-btn[aria-busy="true"]::after{
  content:"";
  width:14px; height:14px;
  margin-left:8px;
  border-radius:999px;
  border:2px solid currentColor;
  border-top-color:transparent;
  display:inline-block;
  animation:c-spin .9s linear infinite;
}
@keyframes c-spin{ to{ transform:rotate(360deg);} }
.c-btn--muted{ background:#f3f4f6; color:#6b7280; border-color:#e5e7eb; cursor:default; }
.c-alert{ border:1px solid var(--border); border-radius:12px; padding:10px 12px; margin:0 0 12px 0; }
.c-alert--info{ background:#f7fafc; }
.c-alert--success{ background:#f0fdf4; }
.c-alert--error{ background:#fef2f2; }
.c-alert--warn{ background:#fffbeb; }
.c-alert__title{ font-weight:700; margin-bottom:6px; }
.c-alert__list{ margin:0; padding-left:18px; }

.c-fieldset-reset{ border:0; padding:0; margin:0; }

.c-modal{ display:none; }
.c-modal.is-open{ display:block; }
.c-modal__backdrop{ position:fixed; inset:0; background:rgba(0,0,0,.35); }
.c-modal__panel{ position:fixed; left:50%; top:50%; transform:translate(-50%,-50%); width:min(520px, calc(100% - 32px)); background:#fff; border-radius:16px; border:1px solid var(--border); box-shadow:0 12px 30px rgba(0,0,0,.2); padding:16px; }
.c-modal__actions{ display:flex; justify-content:flex-end; gap:8px; margin-top:12px; }


/* form basics (shared) */
.c-form{ display:flex; flex-direction:column; gap:16px; margin-top:14px; }
.c-field{ display:flex; flex-direction:column; gap:8px; margin-bottom:14px; }
.c-label{ font-weight:700; font-size:14px; }

/* keep labels vertically consistent even inside complex rows */
.c-field > .c-label{ line-height:1.25; margin:0; }
.c-input,.c-textarea{
  width:100%;
  border:1px solid var(--border);
  border-radius:12px;
  padding:12px 12px;
  font-size:16px;
}

.c-select{
  width:100%;
  border:1px solid var(--border);
  border-radius:12px;
  padding:12px 12px;
  font-size:16px;
  background:#fff;
}
.c-select--xs{ width:auto; min-width:8ch; }
.c-grid3--tight{ display:grid; grid-template-columns:auto 1fr 1fr; gap:12px; align-items:end; }
.c-textarea{ resize:vertical; }
.c-actions{ margin-top:14px; display:flex; gap:10px; justify-content:flex-end; flex-wrap:wrap; }
.c-actions--row{ justify-content:space-between; }
.c-actions--row .c-btn{ min-width:160px; }
.c-actions--center{ justify-content:center; }
.c-actions--left{ justify-content:flex-start; }
.c-actions--right{ justify-content:flex-end; }

/* spacing utilities (avoid inline styles) */
.u-mt12{ margin-top:12px; }
.u-mb12{ margin-bottom:12px; }
.u-my12{ margin:12px 0; }

@media (max-width: 520px){
  @media (max-width: 768px){
  .c-actions{ flex-direction:column; align-items:stretch; }
  .c-actions .c-btn{ width:100%; }
}
}
.c-btn--block{ width:100%; }

/* grid helpers (shared across portals)
   - PC: columns as specified
   - SP: stack to 1 column for readability */
.c-grid2{ display:grid; grid-template-columns: 1fr 1fr; gap:12px; margin-bottom:14px; }
.c-grid3{ display:grid; grid-template-columns: 1fr 1fr 1fr; gap:12px; margin-bottom:14px; }
.c-grid3--id{ display:grid; grid-template-columns: 140px 1fr 1fr; gap:12px; margin-bottom:14px; }
.c-grid4{ display:grid; grid-template-columns: 1fr 1fr 1fr 1fr; gap:12px; margin-bottom:14px; }
.c-grid5{ display:grid; grid-template-columns: 1fr 1fr 1fr 1fr 1fr; gap:12px; margin-bottom:14px; }
/* birth row: 性別 + 元号 + 年/月/日（入力幅に合わせて列幅を最適化） */
.c-gridBirth{ display:grid; grid-template-columns: minmax(180px, 260px) 1fr; gap:10px; align-items:stretch; }

/* era select should feel same as other fields */
.c-select--era{ width:auto; min-width:7ch; }

/* small spacing utility for the gender field */
.c-field--mr10{ margin-right:10px; }

/* address kana inline row (label + input) */
.c-kanaInline{ display:flex; gap:10px; align-items:center; }
.c-kanaInline .c-label{ width:110px; flex:0 0 110px; white-space:nowrap; }
.c-kanaInline .c-input{ flex:1 1 auto; min-width:0; }

/* address row (public): 郵便番号+検索ボタン列と都道府県が離れすぎないように、1列目を控えめ固定＋gapも縮小 */
.c-grid3--addr{ display:grid; grid-template-columns: 180px 1fr 1fr; gap:6px; margin-bottom:14px; }
.c-grid4--addr{ display:grid; grid-template-columns: 220px 120px 1fr 1.8fr; gap:10px; margin-bottom:14px; }
.c-grid2 > .c-field,
.c-grid3 > .c-field,
.c-grid4 > .c-field,
.c-grid5 > .c-field,
.c-gridBirth > .c-field,
.c-gridBirth--tight > .c-field,
.c-grid3--addr > .c-field,
.c-grid4--addr > .c-field{ min-width:0; margin-bottom:0; }

/* within grids, spacing is handled by grid gap */
.c-grid2 > .c-field,
.c-grid3 > .c-field,
.c-grid4 > .c-field,
.c-grid5 > .c-field,
.c-gridBirth > .c-field,
.c-gridBirth--tight > .c-field,
.c-grid3--addr > .c-field{ margin-bottom:0; }

/* ensure split action buttons feel same size */
.c-actions--split .c-btn{ min-width:160px; }

/* 郵便番号 + 住所検索ボタン */
.c-ziprow{ display:flex; gap:8px; align-items:center; }
.c-ziprow .c-input{ flex:1 1 auto; min-width:0; }
.c-ziprow .c-btn{ flex:0 0 auto; white-space:nowrap; }

/* birth row (public/confirm)
   - 生年月日（元号）ラベルが折り返さない幅に
   - 性別と生年月日ブロックの間は少し空ける（年/月/日は詰めたまま） */
.c-gridBirth--tight{
  display:flex;
  flex-wrap:wrap;
  align-items:flex-end;
  column-gap:10px;
  row-gap:8px;
}
/* 性別と元号の間は少し広め */
.c-gridBirth--tight > .c-field:nth-child(2){ margin-left:10px; }
/* 1項目が潰れないように */
.c-gridBirth--tight > .c-field{ flex:0 0 auto; }
.c-gridBirth--tight .c-label{ white-space:nowrap; }
/* 性別（1列目）と生年月日（2列目以降）の間だけ少し空ける */
.c-gridBirth--tight > :nth-child(2){ margin-left:14px; }
@media (max-width: 767px){
  .c-grid2, .c-grid3, .c-grid4, .c-grid5, .c-gridBirth, .c-grid3--addr, .c-grid4--addr, .c-gridBirth--tight{ grid-template-columns: 1fr; }
}

/* display blocks (readonly-like, used in confirm screens) */
.c-display{
  width:100%;
  border:1px solid var(--border);
  border-radius:12px;
  padding:12px 12px;
  font-size:16px;
  background:#f9fafb;
}

/* checkbox row */
.c-check{ display:flex; gap:10px; align-items:center; font-weight:700; }


/* header branding */
.l-brand__logoLink{ display:flex; align-items:center; }
.l-brand__logoImg{ height:28px; width:auto; display:block; filter:brightness(0) invert(1); }

/* Sections / cards */
.c-card{ padding:24px; }
.c-card + .c-card{ margin-top:22px; }

/* Make section boundaries clearer */
.c-tablewrap{ background:#fff; border:1px solid var(--border); border-radius:var(--radius); overflow:hidden; }
.c-search{ background:#f8fafc; border:1px solid var(--border); border-radius:var(--radius); padding:14px; }

/* inner section blocks (detail / edit pages) */
.c-section{ border:1px solid var(--border); border-radius:var(--radius); background:#fff; padding:16px; }
.c-section + .c-section{ margin-top:14px; }
.c-section__title{ margin:0 0 10px 0; font-size:16px; font-weight:800; border-left:4px solid var(--primary); padding-left:10px; }

/* ===== Section tones (for long forms) ===== */
.c-section[class*="c-section--tone"]{ position:relative; }
.c-section[class*="c-section--tone"] .c-h2{ margin-top:0; padding:10px 12px; border-radius:12px; }
.c-section--toneA{ border-left:6px solid #0ea5e9; }
.c-section--toneA .c-h2{ background: rgba(14,165,233,.08); }
.c-section--toneB{ border-left:6px solid #22c55e; }
.c-section--toneB .c-h2{ background: rgba(34,197,94,.08); }
.c-section--toneC{ border-left:6px solid #a855f7; }
.c-section--toneC .c-h2{ background: rgba(168,85,247,.08); }
.c-section--toneD{ border-left:6px solid #f59e0b; }
.c-section--toneD .c-h2{ background: rgba(245,158,11,.10); }
.c-section--toneE{ border-left:6px solid #ef4444; }
.c-section--toneE .c-h2{ background: rgba(239,68,68,.08); }
.c-section--toneF{ border-left:6px solid #14b8a6; }
.c-section--toneF .c-h2{ background: rgba(20,184,166,.08); }
.c-section--toneG{ border-left:6px solid #64748b; }
.c-section--toneG .c-h2{ background: rgba(100,116,139,.10); }

/* Topbar (detail / form pages) */
.detail-topbar{display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap;}
.detail-actions{display:flex; gap:8px; align-items:center; justify-content:flex-end;}
.l-brand__stack{ display:flex; gap:10px; align-items:center; flex-wrap:wrap; }
.l-brand__title{ font-weight:800; letter-spacing:.02em; }
.l-brand__companyName{ font-weight:900; font-size:18px; letter-spacing:.01em; line-height:1.1; padding:2px 0; }
/* company portal: make the company name stand out */
.l-header--company .l-brand__companyName{
  font-size:24px;
  font-weight:900;
  letter-spacing:.02em;
  padding:6px 12px;
  border-radius:999px;
  background:rgba(255,255,255,.14);
  border:1px solid rgba(255,255,255,.18);
}
body[data-portal="company"] .l-brand__stack{ gap:6px 12px; }
@media (max-width: 768px){
  .l-brand__companyName{ font-size:16px; }
  .l-header--company .l-brand__companyName{ font-size:18px; padding:6px 10px; }
}

@media (max-width: 520px){ .l-brand__title{ display:none; } }


/* tables */
.c-table{ width:100%; border-collapse:separate; border-spacing:0; background:#fff; border:1px solid var(--border); border-radius:14px; overflow:hidden; }
.c-table th,.c-table td{ padding:12px 12px; border-bottom:1px solid var(--border); vertical-align:top; }

/* List tables: keep rows compact and vertically centered */
.c-table--list th,.c-table--list td{ vertical-align:middle; padding-top:10px; padding-bottom:10px; }
.c-table thead th{ background:#f8fafc; position:sticky; top:0; z-index:1; font-size:13px; color:#334155; }
.c-table tbody tr:nth-child(even){ background:#fbfdff; }
.c-table tbody tr:hover{ background:#f3f8ff; }
.c-table tbody tr.c-row--readonly{ background:#f1f5f9; }
.c-table tbody tr.c-row--readonly:hover{ background:#e8eef6; }
.c-table tbody tr.c-row--paid{ background:#f0fdf4; }
.c-table tbody tr.c-row--paid:hover{ background:#e7fbe9; }
.c-table tbody tr:last-child td{ border-bottom:none; }


/* input sizing helpers */
.c-input--xs{ max-width:10ch; text-align:center; }
.c-input--sm{ max-width:16ch; }
.c-input--md{ max-width:24ch; }
.c-input--lg{ max-width:40ch; }
.c-select--sm{ max-width:18ch; }


/* button variants */
.c-btn--cic{ background:var(--cic); color:var(--cic-contrast); border-color:rgba(0,0,0,0); box-shadow:var(--cic-shadow); }
.c-btn--cic:hover{ filter:brightness(.97); }
.c-btn--precontract{ background:var(--precontract); color:var(--precontract-contrast); border-color:rgba(0,0,0,0); box-shadow:var(--precontract-shadow); }
.c-btn--precontract:hover{ filter:brightness(.97); }

.c-btn--download{ background:var(--download); color:var(--download-contrast); border-color:rgba(0,0,0,0); box-shadow:var(--download-shadow); }
.c-btn--paid{ background:#f0fdf4; color:#166534; border-color:#86efac; box-shadow:none; }
.c-btn--download:hover{ filter:brightness(.97); }

.c-kv--start{ justify-content:flex-start; align-items:flex-start; }
.c-kv--start > span:first-child{ flex:0 0 110px; }
.c-kv--start > span:last-child{ flex:1 1 auto; text-align:left; }

/* pre-contract info box (company/admin shareable) */
.c-precontractbox .c-note{ font-size:14px; }

/* readonly emphasis (e.g. contract status) */
.c-card--readonly{ background:#f8fafc; }

/* status line in table */
.c-statusline{ display:flex; flex-wrap:nowrap; align-items:center; gap:6px; white-space:nowrap; }
.c-statusline .c-badge{ flex:0 0 auto; }

.c-badges{ display:flex; gap:6px; flex-wrap:wrap; align-items:center; }

.c-badge--info{
  background: #e0f2fe;
  color: #075985;
}
.c-badge--warn{
  background: #ffedd5;
  color: #9a3412;
}


/* small table action buttons */
.c-btn--table{ padding:8px 12px; line-height:1; border-radius:10px; }

/* Default table action buttons (to prevent row height bloating) */
.c-table a.c-btn, .c-table button.c-btn{ padding:8px 12px; font-size:13px; line-height:1.1; }


/* themed cards */
.c-card--cic{ border-left:4px solid var(--cic); }
.c-card--precontract{ border-left:4px solid var(--precontract); }

/* Company top help (what to do next) */
.c-flow{ margin:6px 0 0 0; padding:0; list-style:none; }
.c-flow__item{ display:flex; gap:12px; padding:12px 0; border-top:1px dashed var(--border); }
.c-flow__item:first-child{ border-top:0; padding-top:6px; }
.c-flow__badge{ min-width:28px; height:28px; border-radius:999px; background:var(--primary); color:var(--primary-contrast); display:flex; align-items:center; justify-content:center; font-weight:800; font-size:13px; }
.c-flow__item strong{ display:block; margin:0 0 4px 0; }
.c-flow__item p{ margin:0; color:var(--muted); line-height:1.6; }
.c-flow__note{ margin:12px 0 0 0; color:var(--muted); font-size:13px; }
.c-flow__title{ margin:0 0 8px 0; }


/* CIC theme focus */
.c-theme-cic .c-input:focus,
.c-theme-cic .c-select:focus,
.c-theme-cic .c-textarea:focus{ outline:none; border-color:rgba(249,115,22,.65); box-shadow:0 0 0 4px rgba(249,115,22,.18); }


/* =========================
   Help Dock (right fixed)
   ========================= */

.c-helpdock__btn{
  position: fixed;
  right: 0;
  top: 30%;
  z-index: 9999;
  width: 44px;
  height: 160px;
  padding: 10px 0;
  border-radius: 14px 0 0 14px;
  border: 1px solid var(--border);
  border-right: none;
  background: #ffffff;
  color: var(--text);
  font-weight: 900;
  box-shadow: -6px 10px 24px rgba(0,0,0,.10);
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  letter-spacing: .08em;
}
.c-helpdock__btn:hover{ background:#f8fafc; }
.c-helpdock__btn:focus{ outline: none; box-shadow: 0 0 0 4px rgba(0,91,172,.16), -6px 10px 24px rgba(0,0,0,.10); }


.c-helpdock{
  position: fixed;
  right: 0;
  top: 0;
  height: 100vh;
  width: 420px;
  max-width: 92vw;
  z-index: 9998;
  background: #fff;
  border-left: 1px solid var(--border);
  box-shadow: -16px 0 32px rgba(0,0,0,.14);
  transform: translateX(0);
  transition: transform .18s ease;
  display: flex;
  flex-direction: column;
}
.c-helpdock:not(.is-open){ transform: translateX(105%); }

.c-helpdock__head{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, #ffffff 0%, #fafbff 100%);
}
.c-helpdock__title{ font-size: 16px; font-weight: 900; letter-spacing: .02em; }
.c-helpdock__close{
  border: 1px solid var(--border);
  background: #fff;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.c-helpdock__close:hover{ background: #f3f4f6; }

.c-helpdock__body{
  padding: 14px 14px 22px;
  overflow: auto;
}
.c-helpdock__body::-webkit-scrollbar{ width: 10px; }
.c-helpdock__body::-webkit-scrollbar-thumb{ background: #d1d5db; border-radius: 999px; border: 2px solid #fff; }
.c-helpdock__body::-webkit-scrollbar-track{ background: #fff; }

.c-help__block{
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 12px;
  box-shadow: 0 1px 0 rgba(0,0,0,.02);
}
.c-help__block + .c-help__block{ margin-top: 12px; }

.c-help__h3{
  font-size: 15px;
  margin: 0 0 8px;
  font-weight: 900;
  display: flex;
  align-items: center;
  gap: 8px;
}
.c-help__h3:before{
  content: '';
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--primary);
  box-shadow: 0 0 0 4px rgba(0,91,172,.12);
}
.c-help__p{ margin: 0 0 10px; line-height: 1.75; font-size: 15.5px; color: var(--text); }
.c-help__list{ margin: 0; padding-left: 18px; font-size: 15.5px; line-height: 1.75; color: var(--text); }

/* Important cautions (stand out) */
.c-help__warn{
  border: 1px solid rgba(217,45,32,.35);
  background: rgba(217,45,32,.06);
  border-radius: 16px;
  padding: 12px 12px;
 margin-top:12px;}
.c-help__warnTitle{
  font-weight: 900;
  font-size: 15px;
  margin: 0 0 8px 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.c-help__warnTitle:before{
  content: '⚠';
}
.c-help__warnList{ margin: 0; padding-left: 18px; font-size: 15.5px; line-height: 1.75; }
.c-help__warnList li{ margin: 6px 0; }
.c-help__flow{ margin: 0; padding-left: 18px; font-size: 15.5px; line-height: 1.75; color: var(--text); }
.c-help__list li + li, .c-help__flow li + li{ margin-top: 6px; }

.c-help__note{
  margin: 10px 0 0;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.7;
}

.c-accordionCard{
  margin-top:14px;
  border:1px solid var(--border);
  border-radius:16px;
  background:#fff;
  overflow:hidden;
}
.c-accordionCard summary::-webkit-details-marker{ display:none; }
.c-accordionCard__summary{
  list-style:none;
  cursor:pointer;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:14px 16px;
  font-weight:700;
}
.c-accordionCard__summary::after{
  content:'＋';
  flex:0 0 auto;
  color:var(--muted);
  font-size:18px;
  line-height:1;
}
.c-accordionCard[open] .c-accordionCard__summary::after{ content:'−'; }
.c-accordionCard__title{
  display:inline-flex;
  align-items:center;
  gap:8px;
  color:var(--text);
}
.c-accordionCard__meta{
  margin-left:auto;
  color:var(--muted);
  font-size:13px;
  font-weight:500;
}
.c-accordionCard__body{
  border-top:1px solid var(--border);
  padding:16px;
  background:var(--bg-soft,#fafbfc);
}
.c-help__alert{
  margin-top: 10px;
  padding: 10px 10px;
  border-radius: 12px;
  border: 1px solid rgba(249,115,22,.35);
  background: rgba(249,115,22,.08);
  font-size: 13px;
  line-height: 1.7;
}

.c-card form.c-actions{ margin-left:auto; max-width: 420px; }

.c-headrow .c-actions{ align-self:flex-start; }


/* Help dock behavior (avoid overlap) */
:root{ --helpdock-width: 420px; }

body.is-help-open .c-helpdock__btn{ display: none; }

/* shift main content left by help width when dock is open */
body.is-help-open .l-main{
  padding-right: min(var(--helpdock-width), 92vw);
  box-sizing: border-box;
}

/* On small screens, keep content full width (dock overlays) */
@media (max-width: 900px){
  body.is-help-open .l-main{ padding-right: 0; }
}

/* PDF embed (billing preview etc.) */
.c-embed{ width:100%; }
.c-embed__frame{ width:100%; height:100%; border:0; display:block; background:#fff; }


/* emphasis */
.u-red{ color:#dc2626; font-weight:700; }


/* Flash toast (fixed) */
.c-toast{position:fixed;left:50%;bottom:18px;transform:translateX(-50%);z-index:9999;display:flex;align-items:center;gap:10px;max-width:min(680px,calc(100% - 24px));padding:12px 14px;border-radius:10px;box-shadow:0 6px 18px rgba(0,0,0,.18);background:#111;color:#fff;opacity:0;pointer-events:none;transition:opacity .2s ease, transform .2s ease;}
.c-toast.is-show{opacity:1;pointer-events:auto;transform:translateX(-50%) translateY(0);}
.c-toast__msg{font-size:14px;line-height:1.4;}
.c-toast__close{border:0;background:transparent;color:inherit;font-size:18px;line-height:1;padding:0 4px;cursor:pointer;}
.c-toast--success{background:#1f7a4a;}
.c-toast--warn{background:#b7791f;}
.c-toast--error{background:#b91c1c;}


/* file input row */
.c-fileRow{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.c-fileName{font-size:12px;color:#555}
.c-input--file{max-width:320px}


/* Actions layout: back (left) + next/submit (right) */
.c-actions{display:flex;flex-wrap:wrap;align-items:center;gap:12px;margin-top:16px}
.c-actions--split{justify-content:space-between}
.c-actions__right{display:flex;flex-wrap:wrap;gap:8px;justify-content:flex-end}
.c-actions--left{justify-content:flex-start}
.c-actions--right{justify-content:flex-end}
.c-btn--ghost{background:transparent;border:1px solid var(--c-border);color:inherit}

.c-field--full{grid-column:1/-1}


/* Readonly layer for confirm pages */
.c-layer{padding:10px 12px;background:#f7f7f7;border:1px solid #e5e5e5;border-radius:10px;min-height:40px;display:flex;align-items:center;}
.c-readonly .c-field .c-label{margin-bottom:6px;}
.c-card--sub{border:1px solid #eee;border-radius:14px;padding:12px;}
.c-card--sub .c-card__title{font-weight:700;margin-bottom:8px;}


/* Pre-contract box readability */
.c-precontractbox__lead{
  background: rgba(2,132,199,.06);
  border: 1px solid rgba(2,132,199,.18);
  border-radius: 14px;
  padding: 14px 16px;
  font-size: 15.5px;
  line-height: 1.85;
}
.c-precontractbox__lead .c-note{ margin: 6px 0; font-size: inherit; line-height: inherit; color: var(--text); }

/* Subsection inside a section */
.c-hr{ height:1px; background: var(--border); margin: 16px 0; }
.c-subsection__title{ font-weight: 900; font-size: 15px; margin: 0 0 10px 0; }

/* Actions between */
.c-actions--between{ display:flex; align-items:center; justify-content:space-between; gap: 10px; flex-wrap:wrap; }


/* Pre-contract section title emphasis */
.c-precontractbox{ --precontract-accent: var(--precontract); }
.c-precontractbox__title{
  padding: 10px 0 10px 14px;
  border-left: 6px solid var(--precontract-accent);
}
.c-precontractbox--spacious{ margin-top: 22px; margin-bottom: 22px; }
.c-precontractbox--spacious .c-headrow{ padding-top: 6px; padding-bottom: 12px; }

/* ===============================
   Loading overlay (PDF作成中など)
================================ */
html.is-loading, html.is-loading body {
  cursor: progress;
}
.c-loadingOverlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,.35);
  backdrop-filter: blur(1px);
}
.c-loadingOverlay__box {
  width: min(520px, calc(100vw - 40px));
  background: #fff;
  border-radius: 14px;
  padding: 22px 22px 18px;
  box-shadow: 0 18px 60px rgba(0,0,0,.25);
  text-align: center;
}
.c-loadingOverlay__spinner {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  border: 4px solid rgba(0,0,0,.12);
  border-top-color: rgba(0,0,0,.55);
  margin: 0 auto 14px;
  animation: cSpin 0.9s linear infinite;
}
.c-loadingOverlay__title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 8px;
}
.c-loadingOverlay__desc {
  font-size: 14px;
  line-height: 1.7;
  color: rgba(0,0,0,.7);
}
@keyframes cSpin { to { transform: rotate(360deg); } }

/* ===== Dev Tools (DEV ONLY) ===== */
.c-devTool{
  margin: 14px 0 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.c-devTool__note{
  font-size: 12px;
  opacity: .75;
}

/* ===== Checkbox Grid (shared) ===== */
.c-checkgrid{ display:grid; grid-template-columns: 1fr; gap:8px; }
@media(min-width:900px){ .c-checkgrid{ grid-template-columns: 1fr 1fr; } }
.c-check{ display:flex; gap:8px; align-items:flex-start; padding:8px 10px; border:1px solid #e5e7eb; border-radius:10px; background:#fff; }
.c-check input{ margin-top:2px; }

/* checked highlight */
.c-check.is-checked{ background: rgba(20,184,166,.08); border-color: rgba(20,184,166,.45); }
.c-check.is-checked input{ accent-color: #14b8a6; }

.c-actions--footer{ display:flex; gap:10px; justify-content:space-between; align-items:center; margin-top:18px; }

/* ---------------------------------
   Form validation UI
---------------------------------- */
.c-field.is-error .c-input,
.c-field.is-error select,
.c-field.is-error textarea{
  border-color:#d93025;
  box-shadow:0 0 0 3px rgba(217,48,37,.12);
}
.c-errorText{
  margin-top:6px;
  font-size:12px;
  color:#d93025;
}
.c-errorSummary{
  margin:0 0 14px 0;
  padding:12px 14px;
  border:1px solid rgba(217,48,37,.35);
  background:rgba(217,48,37,.06);
  border-radius:12px;
}
.c-errorSummary__title{
  font-weight:700;
  margin-bottom:6px;
  color:#b3261e;
}
.c-errorSummary__list{
  margin:0;
  padding-left:18px;
}

/* Dev dummy missing banner */
.c-devMissing{position:fixed;right:16px;bottom:16px;z-index:9999;max-width:360px;background:#fff3f3;border:1px solid #ffb3b3;border-radius:12px;box-shadow:0 8px 24px rgba(0,0,0,.12);padding:12px 12px 10px;font-size:14px}
.c-devMissing__title{font-weight:700;margin-bottom:8px}
.c-devMissing__list{margin:0;padding-left:18px}
.c-devMissing__list li{margin:6px 0}
.c-devMissing__list button{all:unset;cursor:pointer;color:#b00020;text-decoration:underline}
.c-input.is-flash{outline:3px solid rgba(255,0,0,.35);animation:flashOutline 1.8s ease}
@keyframes flashOutline{0%{outline-color:rgba(255,0,0,.5)}100%{outline-color:rgba(255,0,0,0)}}


/* === Missing fields floating panel === */
.c-missingPanel{
  position: fixed;
  right: 16px;
  bottom: 16px;
  width: min(360px, calc(100vw - 32px));
  background: #fff;
  border: 1px solid #ffd4d4;
  box-shadow: 0 10px 30px rgba(0,0,0,.12);
  border-radius: 14px;
  z-index: 9999;
  overflow: hidden;
}
.c-missingPanel__head{
  padding: 10px 12px;
  font-weight: 700;
  background: #fff3f3;
  border-bottom: 1px solid #ffd4d4;
}
.c-missingPanel__list{
  list-style: none;
  margin: 0;
  padding: 8px 12px 12px;
  max-height: 45vh;
  overflow: auto;
}
.c-missingPanel__list li{ margin: 6px 0; }
.c-missingPanel__list a{
  display: block;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid #ffd4d4;
  background: #fff;
  color: #a40000;
  text-decoration: none;
}
.c-missingPanel__list a:hover{ background: #fff3f3; }

.c-field.is-error--blink{
  animation: cErrorBlink 1.2s ease-in-out 1;
}
@keyframes cErrorBlink{
  0%{ box-shadow: 0 0 0 0 rgba(255,0,0,.0); }
  20%{ box-shadow: 0 0 0 4px rgba(255,0,0,.22); }
  50%{ box-shadow: 0 0 0 6px rgba(255,0,0,.18); }
  100%{ box-shadow: 0 0 0 0 rgba(255,0,0,.0); }
}


/* ---- Requests list readability tweaks ---- */
.c-company-small{font-size:0.85em;opacity:0.85;}
.c-customer{font-weight:700;font-size:1.05em;display:inline-block;white-space:nowrap;}
.c-tooltip{position:relative;}
.c-tooltip[data-tip=""]{cursor:default;}
.c-tooltip:hover::after{content:attr(data-tip);position:absolute;left:0;top:100%;margin-top:6px;background:#111;color:#fff;padding:6px 8px;border-radius:10px;font-size:12px;white-space:nowrap;z-index:60;box-shadow:0 10px 24px rgba(0,0,0,.25);}
.c-tooltip[data-tip=""]:hover::after{content:none;}

/* --- Funding report form helpers --- */
.c-inputGroup{ display:flex; gap:8px; align-items:center; }
.c-inputGroup .c-input{ flex:1 1 auto; min-width:0; }
.c-btn--sm{ padding:8px 10px; font-size:0.9rem; line-height:1; }
.c-field--span3{ grid-column: 2 / -1; }

.c-select--era{ width:72px; }

.c-grid3--tight > .c-field:first-child{ justify-self:start; }
.c-grid3--tight > .c-field:first-child .c-select{ width:auto; min-width:78px; }

.c-zip-btn{ white-space:nowrap; }


/* zip search button aligns with input height */
.c-inputGroup--stretch{ align-items:stretch; }
.c-inputGroup--stretch .c-zip-btn{ height:auto; padding:12px 14px; white-space:nowrap; }


/* --- Funding report form layout tweaks --- */
.c-field-inline{
  display:flex;
  gap:8px;
  align-items:center;
}
.c-field-inline .c-label{
  width:110px;
  margin:0;
  white-space:nowrap;
}
.c-field-inline .c-input{
  flex:1 1 auto;
}

/* Era select compact */
.c-select--era{ min-width: 10ch; }

/* Birth row: make select/input heights align */
.c-gridBirth .c-select,
.c-gridBirth .c-input{ padding-top:12px; padding-bottom:12px; }


/* === Funding report form layout tweaks (fix25) === */
.c-grid3.c-grid3--pack{ grid-template-columns: auto auto auto; justify-content:start; column-gap:14px; row-gap:12px; }
.c-grid3.c-grid3--pack .c-input{ width:auto; }
.c-grid3.c-grid3--pack .c-input--md{ min-width:220px; }
.c-grid3.c-grid3--pack .c-input--sm{ min-width:120px; }
.c-grid3 .c-label{ display:block; margin:0 0 6px 0; line-height:1.2; }
.c-label--inline{ display:block; margin:0; }
.c-grid4.addr.addr-kana{ grid-template-columns: max-content 1fr 1fr 1fr; align-items:end; }
.c-grid4.addr.addr-kana .c-field--span3{ grid-column: 2 / span 3; }
.c-grid4.addr.addr-kana .c-label--inline{ margin-bottom:6px; }
.c-field--mr10{ margin-right:10px !important; }



.c-grid2--compact{ grid-template-columns:minmax(0,220px) minmax(0,220px); justify-content:start; column-gap:12px; row-gap:12px; }
.c-rateRows{ display:grid; grid-template-columns:1fr; gap:10px; margin-bottom:14px; }
.c-rateRow{ display:grid; grid-template-columns:140px minmax(0,1fr); gap:12px; align-items:center; }
.c-rateRow__label{ font-weight:700; color:var(--text); }
.c-rateRow__inputs{ display:flex; gap:8px; align-items:center; flex-wrap:nowrap; min-width:0; }
.c-rateRow__inputs .c-input{ min-width:0; }
.c-input--rateYear{ width:90px; max-width:100%; }
.c-input--ratePct{ width:120px; max-width:100%; }
.c-rateRows--display .c-rateRow{ align-items:start; }
.c-rateRows--display .c-display, .c-rateRows--display .c-layer, .c-rateRows--display .c-input--static{ width:100%; }
@media (max-width: 900px){
  .c-grid2--compact{ grid-template-columns:1fr; }
  .c-rateRow{ grid-template-columns:1fr; }
  .c-rateRow__inputs{ flex-wrap:wrap; }
}

.c-alert__actions{margin-top:6px}
.c-link{color:var(--primary);text-decoration:underline}
.c-toast__link{margin-left:10px;color:inherit;text-decoration:underline}


/* PDF preview: clickable iframe */
.c-pdfpreview{ display:flex; gap:10px; align-items:center; flex-wrap:wrap; }
.c-pdfbox{ position:relative; width:420px; max-width:100%; height:260px; border:1px solid rgba(0,0,0,.15); border-radius:10px; overflow:hidden; background:#fff; }
.c-pdfbox__frame{ width:100%; height:100%; border:0; }
.c-pdfbox__link{ position:absolute; inset:0; z-index:2; display:block; cursor:pointer; }
.c-pdfbox__link:focus{ outline:3px solid rgba(0,0,0,.3); outline-offset:-3px; }


.c-link--pdf{display:inline-flex;align-items:center;gap:6px;padding:10px 12px;border:1px solid rgba(0,0,0,.15);border-radius:10px;background:#fff;text-decoration:none;}


/* fix112 static boxed */
.c-static--boxed{padding:10px 12px;border:1px solid var(--border);border-radius:12px;background:#fff;}







/* === fix127: restore section separation for .p-section (admin/company forms) === */
.p-section{
  border:1px solid var(--border);
  border-radius:var(--radius);
  background:#fff;
  padding:16px;
}
.p-section + .p-section{ margin-top:14px; }
.p-section__title{
  margin:0 0 10px 0;
  font-size:16px;
  font-weight:800;
  border-left:4px solid var(--primary);
  padding-left:10px;
}



/* === fix128: address row layout (PC only) === */
@media (min-width: 768px) {
  .c-addressRow{
    display: grid !important;
    grid-template-columns:
      minmax(110px, 140px)  /* zip */
      auto                 /* search button */
      minmax(120px, 180px) /* pref */
      minmax(160px, 240px) /* city */
      1fr;                 /* line */
    gap: 10px 12px;
    align-items: center;
    width: 100%;
  }
  .c-addressRow__zip,
  .c-addressRow__btn,
  .c-addressRow__pref,
  .c-addressRow__city,
  .c-addressRow__line{ min-width:0; }

  .c-addressRow__btn .c-btn{ white-space: nowrap; }

  .c-addressRow .c-display{
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}



/* === fix132: restore p-section separated design (admin/company) === */
body[data-portal="admin"] .p-section,
body[data-portal="company"] .p-section{
  border:1px solid var(--border);
  border-radius:var(--radius);
  background:#fff;
  padding:16px;
}
body[data-portal="admin"] .p-section + .p-section,
body[data-portal="company"] .p-section + .p-section{
  margin-top:14px;
}
body[data-portal="admin"] .p-section__title,
body[data-portal="company"] .p-section__title{
  margin:0 0 10px 0;
  font-size:16px;
  font-weight:800;
  border-left:4px solid var(--primary);
  padding-left:10px;
}



/* === fix137: shared birthgrid layout (flex) for all portals === */
:root{
  --w-birth-era: 6.0em;
  --w-birth-year: 6.0em;
  --w-birth-md: 4.0em;
}
@media (min-width: 640px){
  :root{
    --w-birth-era: 7.0em;   /* 元号は少し広め */
    --w-birth-year: 7.0em;
    --w-birth-md: 5.0em;
  }
}
.c-birthgrid{
  display:flex;
  gap:8px;
  align-items:center;
  width:100%;
  flex-wrap: nowrap; /* 横並び固定 */
}
.c-birthgrid__item{ min-width:0; }
.c-birthgrid__item--era{ flex:0 0 var(--w-birth-era); }
.c-birthgrid__item--year{ flex:0 0 var(--w-birth-year); }
.c-birthgrid__item--md{ flex:0 0 var(--w-birth-md); }
.c-birthgrid__item--month{ flex:0 0 var(--w-birth-md); }
.c-birthgrid__item--day{ flex:0 0 var(--w-birth-md); }

.c-birthgrid select,
.c-birthgrid input,
.c-birthgrid .c-display{
  width:100%;
  max-width:100%;
  min-width:0;
  box-sizing:border-box;
}



/* === fix140: header height + clarity for admin/cic (visual only) === */
body[data-portal="admin"] .l-header,
body[data-portal="cic"] .l-header{
  padding-top: 8px;
  padding-bottom: 8px;
}
body[data-portal="admin"] .l-header__inner,
body[data-portal="cic"] .l-header__inner{
  min-height: 72px; /* match company feel */
  align-items: center;
}
body[data-portal="admin"] .l-brand__stack .l-brand__title,
body[data-portal="cic"] .l-brand__stack .l-brand__title{
  font-size: 16px;
}
body[data-portal="admin"] .c-chip,
body[data-portal="cic"] .c-chip{
  font-weight: 800;
}



/* === fix141: icon-only bold header for admin/cic === */
body[data-portal="admin"] .l-brand__stack,
body[data-portal="cic"] .l-brand__stack{
  align-items:center;
}

body[data-portal="admin"] .c-chip,
body[data-portal="cic"] .c-chip{
  font-size: 20px;
  padding: 8px 18px;
  border-radius: 999px;
  font-weight: 900;
}

body[data-portal="admin"] .l-brand__title,
body[data-portal="cic"] .l-brand__title{
  display:none; /* タイトルテキスト削除 */
}

body[data-portal="admin"] .l-header__inner,
body[data-portal="cic"] .l-header__inner{
  min-height: 84px; /* さらに目立たせる */
}



/* === fix142: header visual restyle (no functional changes) === */
/* Goals: cleaner spacing, clearer hierarchy, nicer nav links, consistent height */
.l-header{
  background: #ffffff;
  border-bottom: 1px solid var(--border);
}

.l-header__inner{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 16px;
}

/* brand area */
.l-brand{
  display:flex;
  align-items:center;
  gap: 12px;
  min-width: 0;
}
.l-brand__logoImg{
  height: 34px;
  width: auto;
  display:block;
}
.l-brand__stack{
  display:flex;
  flex-direction:column;
  gap: 4px;
  min-width: 0;
}
/* company name line (already exists) */
.l-brand__companyName{
  font-weight: 800;
  font-size: 14px;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 38vw;
}

/* chip (portal badge) */
.c-chip{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap: 6px;
  border: 1px solid var(--border);
  background: #f8fafc;
  color: #0f172a;
  padding: 6px 12px;
  border-radius: 999px;
  font-weight: 900;
  letter-spacing: .02em;
}

/* navigation */
.l-header__nav{
  display:flex;
  flex-wrap: wrap;
  align-items:center;
  gap: 8px;
  justify-content:flex-end;
}
.l-header__link{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid transparent;
  color: #0f172a;
  text-decoration:none;
  font-weight: 700;
  line-height: 1;
  background: transparent;
  transition: background .15s ease, border-color .15s ease, transform .05s ease;
}
.l-header__link:hover{
  background: #f8fafc;
  border-color: var(--border);
}
.l-header__link:active{
  transform: translateY(1px);
}
/* "logout" feels like a button but still link */
.l-header__link[href*="logout"]{
  background: #0f172a;
  color: #ffffff;
  border-color: #0f172a;
}
.l-header__link[href*="logout"]:hover{
  background: #111827;
  border-color: #111827;
}

/* Make header height comfortable across portals */
@media (min-width: 768px){
  .l-header{ padding: 10px 0; }
  .l-header__inner{ min-height: 78px; }
}
@media (max-width: 767px){
  .l-header{ padding: 8px 0; }
  .l-header__inner{ min-height: 64px; }
  .l-brand__companyName{ max-width: 60vw; }
}

/* Portal accent (subtle): keep minimal and not gaudy */
body[data-portal="admin"] .c-chip{
  background: rgba(14,165,233,.10);
  border-color: rgba(14,165,233,.25);
}
body[data-portal="cic"] .c-chip{
  background: rgba(34,197,94,.10);
  border-color: rgba(34,197,94,.25);
}
body[data-portal="company"] .c-chip{
  background: rgba(99,102,241,.10);
  border-color: rgba(99,102,241,.25);
}

/* Ensure fix141's intent (icon-only emphasis) still applies but looks refined */
body[data-portal="admin"] .c-chip,
body[data-portal="cic"] .c-chip{
  font-size: 18px;
  padding: 8px 16px;
}

/* If any previous fixes forced extra padding/min-height, normalize here */
body[data-portal="admin"] .l-header,
body[data-portal="cic"] .l-header{
  padding-top: 10px;
  padding-bottom: 10px;
}



/* === fix143: restore original header palette + keep usability tweaks === */
/* Restore original header colors (fix142 had forced white background). */
.l-header:not(.l-header--company){
  background: var(--primary) !important;
  color: var(--primary-contrast) !important;
  border-bottom: 0 !important;
}
/* Company header keeps its gradient; just ensure text uses contrast */
.l-header.l-header--company{
  color: #ffffff !important;
}

/* Nav links: inherit header color, button-like hit area without changing palette */
.l-header__link{
  color: inherit !important;
  background: transparent !important;
  border: 1px solid rgba(255,255,255,.18) !important;
  border-radius: 10px !important;
  padding: 8px 12px !important;
  font-weight: 800 !important;
  text-decoration: none !important;
}
.l-header__link:hover{
  background: rgba(255,255,255,.10) !important;
  border-color: rgba(255,255,255,.28) !important;
}
.l-header__link:active{
  transform: translateY(1px);
}

/* Logout as emphasized button, still in same palette */
.l-header__link[href*="logout"]{
  background: rgba(255,255,255,.18) !important;
  border-color: rgba(255,255,255,.35) !important;
  color: inherit !important;
}

/* Portal chip: big & readable on colored header without changing colors */
.c-chip{
  background: rgba(255,255,255,.14) !important;
  border: 1px solid rgba(255,255,255,.26) !important;
  color: inherit !important;
}

/* Keep fix141 intent (bigger chip on admin/cic) but color-safe */
body[data-portal="admin"] .c-chip,
body[data-portal="cic"] .c-chip{
  font-size: 18px !important;
  padding: 8px 16px !important;
  font-weight: 900 !important;
}



/* === fix144: public header stays white + nav buttons refined & distinguishable === */
/* Public (住宅ローンプランニング申込フォームなど): keep white header */
body[data-portal="public"] .l-header{
  background:#ffffff !important;
  color:#0f172a !important;
  border-bottom:1px solid var(--border) !important;
}
body[data-portal="public"] .l-header__link{
  color:#0f172a !important;
  border:1px solid var(--border) !important;
  background:#ffffff !important;
}
body[data-portal="public"] .l-header__link:hover{
  background:#f8fafc !important;
}
body[data-portal="public"] .l-header__link[href*="logout"]{
  background:#0f172a !important;
  border-color:#0f172a !important;
  color:#ffffff !important;
}

/* Make nav feel more "button-like" without changing portal palettes */
.l-header__nav{
  gap:10px !important;
}
.l-header__link{
  letter-spacing:.01em;
  box-shadow: 0 0 0 0 rgba(0,0,0,0);
}
.l-header__link:hover{
  box-shadow: 0 1px 0 0 rgba(0,0,0,.06);
}

/* Stronger visual separation between brand and nav (all portals) */
.l-header__inner{
  gap: 18px !important;
}
.l-brand__logoImg{
  height: 36px !important;
}

/* Portal distinction cue: subtle top accent line (no color change of main bg) */
body[data-portal="admin"] .l-header{ box-shadow: inset 0 3px 0 rgba(255,255,255,.22); }
body[data-portal="cic"] .l-header{ box-shadow: inset 0 3px 0 rgba(255,255,255,.18); }
body[data-portal="company"] .l-header{ box-shadow: inset 0 3px 0 rgba(255,255,255,.16); }
body[data-portal="public"] .l-header{ box-shadow: none; }



/* === fix145: admin header nav order + icon buttons (visual only) === */
.l-header__nav .l-header__link{
  display:inline-flex !important;
  align-items:center !important;
  gap:10px !important;
  padding: 12px 14px !important;
  border-radius: 12px !important;
  line-height: 1 !important;
  min-height: 44px !important;
}

/* icon container */
.c-ico{
  display:inline-block;
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  position: relative;
}
.c-ico::before{
  content:"";
  position:absolute;
  inset:0;
  border:2px solid currentColor;
  border-radius:4px;
  opacity:.85;
}

/* variant shapes */
.c-ico[data-ico="list"]::after{
  content:"";
  position:absolute;
  left:4px; right:4px;
  top:5px;
  height:2px;
  background: currentColor;
  box-shadow: 0 5px 0 currentColor, 0 10px 0 currentColor;
  opacity:.85;
}
.c-ico[data-ico="building"]::after{
  content:"";
  position:absolute;
  left:5px; right:5px;
  bottom:4px;
  height:8px;
  background: currentColor;
  clip-path: polygon(0 100%,0 35%,50% 0,100% 35%,100% 100%);
  opacity:.75;
}
.c-ico[data-ico="yen"]::after{
  content:"¥";
  position:absolute;
  inset:0;
  display:flex;
  align-items:center;
  justify-content:center;
  font-weight:900;
  font-size: 14px;
}
.c-ico[data-ico="report"]::after{
  content:"";
  position:absolute;
  left:5px; right:5px;
  top:5px; bottom:5px;
  border-left:2px solid currentColor;
  border-bottom:2px solid currentColor;
  transform: skew(-12deg);
  opacity:.85;
}
.c-ico[data-ico="user"]::after{
  content:"";
  position:absolute;
  left:6px; right:6px;
  top:4px;
  height:6px;
  border-radius:999px;
  background: currentColor;
  opacity:.85;
}
.c-ico[data-ico="users"]::after{
  content:"";
  position:absolute;
  left:4px; right:4px;
  bottom:4px;
  height:6px;
  border-radius:999px;
  background: currentColor;
  opacity:.75;
}
.c-ico[data-ico="log"]::after{
  content:"";
  position:absolute;
  left:5px; right:5px;
  top:6px;
  height:2px;
  background: currentColor;
  box-shadow: 0 5px 0 currentColor;
  opacity:.85;
}
.c-ico[data-ico="alert"]::after{
  content:"!";
  position:absolute;
  inset:0;
  display:flex;
  align-items:center;
  justify-content:center;
  font-weight:900;
  font-size: 14px;
}
.c-ico[data-ico="logout"]::after{
  content:"↩";
  position:absolute;
  inset:0;
  display:flex;
  align-items:center;
  justify-content:center;
  font-weight:900;
  font-size: 14px;
}



/* === fix147: header menu icon above text (vertical layout) === */
.l-header__nav .l-header__link{
  flex-direction: column !important;
  justify-content: center !important;
  align-items: center !important;
  gap: 4px !important;
  min-width: 86px;
  padding: 10px 10px !important;
  text-align: center;
}

.l-header__nav .c-ico{
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
}



/* === fix148: header UI level-up (tile menu) for admin/company/cic === */
/* Grid-like nav */
.l-header__nav--grid{
  display:flex;
  flex-wrap: wrap;
  gap: 10px !important;
  justify-content: flex-end;
}

/* Tile button (icon top, label bottom) */
.l-header__link--tile{
  display:flex !important;
  flex-direction: column !important;
  align-items:center !important;
  justify-content:center !important;
  gap: 6px !important;
  min-width: 86px;
  min-height: 54px !important;
  padding: 10px 12px !important;
  border-radius: 14px !important;
  text-align:center;
  font-weight: 800 !important;
  line-height: 1.05 !important;
  border: 1px solid rgba(255,255,255,.18) !important;
  background: rgba(255,255,255,.08) !important;
  backdrop-filter: blur(2px);
}

/* Public header is white; make tiles look clean there too */
body[data-portal="public"] .l-header__link--tile{
  border-color: var(--border) !important;
  background: #ffffff !important;
}

.l-header__link--tile:hover{
  background: rgba(255,255,255,.12) !important;
  border-color: rgba(255,255,255,.28) !important;
  transform: translateY(-1px);
}
body[data-portal="public"] .l-header__link--tile:hover{
  background:#f8fafc !important;
}

.l-header__link--tile:active{
  transform: translateY(0px);
}

/* Icon sizing */
.l-header__link--tile .c-ico{
  width: 22px !important;
  height: 22px !important;
  flex: 0 0 22px !important;
}
.l-header__link--tile .c-ico::before{
  border-radius: 6px;
}

/* Add a clear active style for current page if class is applied later (optional) */
.l-header__link--tile.is-active{
  background: rgba(255,255,255,.18) !important;
  border-color: rgba(255,255,255,.38) !important;
}

/* Extra icons */
.c-ico[data-ico="queue"]::after{
  content:"";
  position:absolute;
  left:4px; right:4px;
  top:5px; bottom:5px;
  border:2px dashed currentColor;
  border-radius:6px;
  opacity:.75;
}
.c-ico[data-ico="batch"]::after{
  content:"";
  position:absolute;
  inset:4px;
  border:2px solid currentColor;
  border-radius:3px;
  box-shadow: 6px 6px 0 -4px currentColor;
  opacity:.75;
}


/* === fix149: spacing between icon and text === */
.l-header__link--tile{
  gap:10px !important;
}

/* accordion style for master links */
.l-header__accordion summary{
  list-style:none;
  cursor:pointer;
}
.l-header__accordionBody{
  display:flex;
  flex-direction:column;
  gap:6px;
  margin-top:6px;
}


/* === fix150: SVG icons + active highlight + smooth accordion === */

/* more space between icon and label */
.l-header__link--tile{ gap: 12px !important; }

/* SVG icon sizing */
.l-header__link--tile .c-ico{
  width: 24px !important;
  height: 24px !important;
  flex: 0 0 24px !important;
  display:block;
}
.l-header__link--tile .c-ico path{ fill: currentColor; }

/* current page highlight */
.l-header__link--tile.is-active{
  background: rgba(255,255,255,.20) !important;
  border-color: rgba(255,255,255,.45) !important;
  box-shadow: 0 6px 16px rgba(0,0,0,.12);
}
body[data-portal="public"] .l-header__link--tile.is-active{
  background: #f1f5f9 !important;
  border-color: var(--border) !important;
}

/* accordion */
.l-header__accordion{
  display:block;
}
.l-header__accordionSummary{
  user-select:none;
}
.l-header__accordionSummary::-webkit-details-marker{ display:none; }

/* smooth expand using max-height */
.l-header__accordionBody{
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition: max-height .25s ease, opacity .2s ease;
  display:flex;
  flex-direction:column;
  gap: 8px;
  margin-top: 8px;
}
.l-header__accordion[open] .l-header__accordionBody{
  max-height: 260px; /* enough for 3 tiles */
  opacity: 1;
}

/* make the accordion tiles slightly narrower so it doesn't overflow */
.l-header__accordionBody .l-header__link--tile{
  min-width: 86px;
}



/* === fix152: accordion dropdown overlay (prevent header height jump) === */
.l-header__nav--grid{
  position: relative; /* anchor for dropdown */
}
.l-header__accordion{
  position: relative;
}

/* dropdown panel overlays instead of pushing layout */
.l-header__accordionBody{
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 50;
  width: max-content;
  min-width: 240px;
  padding: 10px;
  border-radius: 14px;
  background: rgba(255,255,255,.14);
  border: 1px solid rgba(255,255,255,.28);
  box-shadow: 0 12px 30px rgba(0,0,0,.22);
  backdrop-filter: blur(6px);
  margin-top: 0 !important;
}

/* keep smooth animation without changing header height */
.l-header__accordionBody{
  max-height: 0;
  opacity: 0;
  transform: translateY(-4px);
  pointer-events: none;
  transition: max-height .2s ease, opacity .18s ease, transform .18s ease;
}
.l-header__accordion[open] .l-header__accordionBody{
  max-height: 420px;
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* On public white header, dropdown should look clean */
body[data-portal="public"] .l-header__accordionBody{
  background: #ffffff;
  border-color: var(--border);
  box-shadow: 0 12px 28px rgba(0,0,0,.12);
}

/* ensure dropdown tiles are full width within panel */
.l-header__accordionBody .l-header__link--tile{
  width: 100%;
  min-width: 0 !important;
}



/* === fix153: dropdown accordion contrast (visible text/tiles) === */
/* In colored headers (admin/cic/company), dropdown panel is translucent white;
   ensure text and inner tiles have enough contrast */
body[data-portal="admin"] .l-header__accordionBody,
body[data-portal="cic"] .l-header__accordionBody,
body[data-portal="company"] .l-header__accordionBody{
  color: var(--primary-contrast);
}

/* Inner tiles in dropdown: slightly stronger background/border so text/icons are readable */
body[data-portal="admin"] .l-header__accordionBody .l-header__link--tile,
body[data-portal="cic"] .l-header__accordionBody .l-header__link--tile,
body[data-portal="company"] .l-header__accordionBody .l-header__link--tile{
  background: rgba(255,255,255,.16) !important;
  border-color: rgba(255,255,255,.30) !important;
  color: inherit !important;
}

/* Hover state in dropdown */
body[data-portal="admin"] .l-header__accordionBody .l-header__link--tile:hover,
body[data-portal="cic"] .l-header__accordionBody .l-header__link--tile:hover,
body[data-portal="company"] .l-header__accordionBody .l-header__link--tile:hover{
  background: rgba(255,255,255,.22) !important;
  border-color: rgba(255,255,255,.40) !important;
}

/* If header background is dark, ensure dropdown background isn't too white to wash text */
body[data-portal="admin"] .l-header__accordionBody,
body[data-portal="cic"] .l-header__accordionBody,
body[data-portal="company"] .l-header__accordionBody{
  background: rgba(15,23,42,.92) !important; /* dark panel */
  border-color: rgba(255,255,255,.18) !important;
}



/* audit log chips */
.c-auditEvent,
.c-auditResult{
  display:inline-flex;
  align-items:center;
  gap:6px;
  min-height:30px;
  padding:4px 10px;
  border-radius:999px;
  font-size:13px;
  font-weight:700;
  border:1px solid #d1d5db;
  background:#f8fafc;
  color:#334155;
  white-space:nowrap;
}
.c-auditEvent--info{ background:#eff6ff; border-color:#bfdbfe; color:#1d4ed8; }
.c-auditEvent--success{ background:#ecfdf5; border-color:#bbf7d0; color:#15803d; }
.c-auditEvent--muted{ background:#f8fafc; border-color:#cbd5e1; color:#475569; }
.c-auditEvent--danger{ background:#fef2f2; border-color:#fecaca; color:#b91c1c; }

.c-auditEvent--warn{ background:#fff7ed; border-color:#fdba74; color:#c2410c; }

.c-logSearch__row{
  display:grid;
  grid-template-columns:minmax(220px,2.2fr) minmax(160px,1.3fr) minmax(110px,.9fr) minmax(90px,.7fr) minmax(90px,.7fr) minmax(150px,1fr) minmax(150px,1fr) auto;
  gap:10px;
  align-items:center;
}
.c-logSearch__field{ width:100%; min-width:0; }
.c-logSearch__actions{ display:flex; gap:8px; justify-content:flex-end; white-space:nowrap; }
.c-logSearch__actions .c-btn{ min-width:88px; }
@media (max-width: 1200px){
  .c-logSearch__row{
    grid-template-columns:minmax(220px,2fr) minmax(160px,1.2fr) minmax(110px,.8fr) minmax(90px,.7fr) minmax(90px,.7fr) minmax(150px,1fr) minmax(150px,1fr);
  }
  .c-logSearch__actions{ grid-column:1 / -1; justify-content:flex-end; }
}
@media (max-width: 860px){
  .c-logSearch__row{
    grid-template-columns:repeat(2, minmax(0,1fr));
  }
  .c-logSearch__actions{ justify-content:stretch; }
  .c-logSearch__actions .c-btn{ flex:1 1 auto; }
}

.c-auditResult--ok{ background:#ecfdf5; border-color:#bbf7d0; color:#15803d; }
.c-auditResult--ng{ background:#fef2f2; border-color:#fecaca; color:#b91c1c; }


.c-actions--request-edit{width:100%;margin-top:28px;padding-top:12px;border-top:1px solid #e5e7eb;display:flex;align-items:flex-end;justify-content:space-between;gap:12px;}
.c-actions--request-edit > .c-actions__left{display:flex;justify-content:flex-start;flex:1 1 0;}
.c-actions--request-edit > .c-actions__right{display:flex;justify-content:flex-end;flex:1 1 0;margin-left:auto;}
.c-actions--request-edit .c-btn{min-width:160px;}
@media (max-width: 640px){
  .c-actions--request-edit{flex-direction:column;align-items:stretch;}
  .c-actions--request-edit > .c-actions__left,
  .c-actions--request-edit > .c-actions__right{width:100%;}
  .c-actions--request-edit > .c-actions__right{justify-content:flex-end;}
}


.bank-suggest{position:relative;z-index:20;}
.bank-suggest .suggest-list{position:absolute;left:0;top:4px;width:100%;background:#fff;border:1px solid #d7dce3;border-radius:8px;box-shadow:0 8px 20px rgba(0,0,0,.08);max-height:240px;overflow:auto;}
.bank-suggest .suggest-item{display:block;width:100%;text-align:left;padding:8px 10px;border:0;background:#fff;cursor:pointer;}
.bank-suggest .suggest-item:hover,.bank-suggest .suggest-item.is-active{background:#f5f7fb;}

.bank-suggest-box{background:#fff;border:1px solid #cfd6dd;border-radius:8px;box-shadow:0 8px 24px rgba(0,0,0,.12);max-height:260px;overflow:auto}.bank-suggest__item{display:block;width:100%;padding:10px 12px;text-align:left;border:0;background:#fff;cursor:pointer}.bank-suggest__item:hover,.bank-suggest__item.is-active{background:#f3f7fb}


/* 請求管理の確認アラートが送信ログテーブルの背面に潜らないための修正 */
.c-modal{
  display:none;
  position:fixed;
  inset:0;
  z-index:10000;
}
.c-modal.is-open{
  display:block;
}
.c-modal__backdrop{
  position:fixed;
  inset:0;
  background:rgba(0,0,0,.35);
  z-index:10001;
}
.c-modal__panel{
  position:fixed;
  left:50%;
  top:50%;
  transform:translate(-50%,-50%);
  width:min(520px, calc(100% - 32px));
  background:#fff;
  border-radius:16px;
  border:1px solid var(--border);
  box-shadow:0 12px 30px rgba(0,0,0,.2);
  padding:16px;
  z-index:10002;
}


/* admin logs: compact accordion */
.c-card--subtle{ background:#f8fafc; }
.c-logCompactList{ display:grid; gap:10px; }
.c-logItem{
  border:1px solid var(--border);
  border-radius:12px;
  background:#fff;
  box-shadow:0 1px 2px rgba(0,0,0,.04);
  overflow:hidden;
}
.c-logItem[open]{ box-shadow:0 8px 20px rgba(15,23,42,.06); }
.c-logItem__summary{
  list-style:none;
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:14px;
  padding:12px 14px;
  cursor:pointer;
}
.c-logItem__summary::-webkit-details-marker{ display:none; }
.c-logItem__summary::after{
  content:"＋";
  flex:0 0 auto;
  color:#64748b;
  font-weight:700;
  line-height:1;
  margin-top:4px;
}
.c-logItem[open] .c-logItem__summary::after{ content:"－"; }
.c-logItem__main{ min-width:0; flex:1 1 auto; }
.c-logItem__topline{
  display:flex;
  align-items:center;
  gap:8px 10px;
  flex-wrap:wrap;
  margin-bottom:4px;
}
.c-logItem__time,
.c-logItem__actor{
  color:var(--muted);
  font-size:13px;
}
.c-logItem__text{
  font-size:14px;
  line-height:1.5;
  color:#111827;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.c-logItem__side{
  display:flex;
  gap:6px;
  flex-wrap:wrap;
  justify-content:flex-end;
  max-width:260px;
  padding-right:8px;
}
.c-logChip{
  display:inline-flex;
  align-items:center;
  padding:4px 8px;
  border-radius:999px;
  background:#f8fafc;
  border:1px solid #e2e8f0;
  color:#334155;
  font-size:12px;
  white-space:nowrap;
}
.c-logItem__body{
  border-top:1px solid var(--border);
  padding:14px;
  background:#fcfdff;
}
.c-logDetailGrid{
  display:grid;
  grid-template-columns:repeat(3, minmax(0,1fr));
  gap:10px;
  margin-bottom:12px;
}
.c-logDetail{
  border:1px solid #e5e7eb;
  border-radius:10px;
  padding:10px 12px;
  background:#fff;
}
.c-logDetail__label,
.c-logMeta__label,
.c-logRaw__label{
  font-size:12px;
  color:var(--muted);
  margin-bottom:4px;
}
.c-logDetail__value,
.c-logMeta__value{
  font-size:14px;
  word-break:break-word;
}
.c-logMeta{
  display:grid;
  gap:8px;
  margin-bottom:12px;
}
.c-logMeta__row{
  display:grid;
  grid-template-columns:140px 1fr;
  gap:10px;
  align-items:start;
  border:1px solid #e5e7eb;
  border-radius:10px;
  padding:8px 10px;
  background:#fff;
}
.c-logRaw__pre{
  margin:0;
  padding:10px 12px;
  border:1px solid #e5e7eb;
  border-radius:10px;
  background:#fff;
  color:#334155;
  white-space:pre-wrap;
  word-break:break-word;
  font-size:12px;
  line-height:1.55;
  max-height:220px;
  overflow:auto;
}
@media (max-width: 900px){
  .c-logItem__summary{ padding:12px; }
  .c-logItem__side{
    max-width:none;
    justify-content:flex-start;
    padding-right:0;
  }
  .c-logDetailGrid{ grid-template-columns:repeat(2, minmax(0,1fr)); }
}
@media (max-width: 640px){
  .c-logItem__summary{
    display:block;
  }
  .c-logItem__summary::after{
    float:right;
    margin-top:-18px;
  }
  .c-logItem__side{
    margin-top:8px;
  }
  .c-logItem__text{
    white-space:normal;
    overflow:visible;
    text-overflow:clip;
  }
  .c-logDetailGrid{ grid-template-columns:1fr; }
  .c-logMeta__row{ grid-template-columns:1fr; }
}

/* nonbank-db-display-fixed */
.c-nonbankBadge--on {
  background:#e0f2fe !important;
  color:#075985 !important;
  border:1px solid #7dd3fc !important;
}
.c-nonbankBadge--off {
  background:#f1f5f9 !important;
  color:#94a3b8 !important;
  border:1px solid #e2e8f0 !important;
  opacity:.72;
}
.pre-contract-review .c-layer,
.pre-contract-review .c-input--static,
.pre-contract-review .c-display,
.c-card--precontract .c-layer,
.c-card--precontract .c-input--static,
.c-card--precontract .c-display,
.c-cardSection .c-layer,
.c-cardSection .c-input--static,
.c-cardSection .c-display {
  min-height:42px !important;
  display:flex;
  align-items:center;
  box-sizing:border-box;
}

/* company-pre-contract-lock-fixed */
.c-badge--muted {
  background:#f1f5f9 !important;
  color:#64748b !important;
  border-color:#cbd5e1 !important;
}
.c-note--warn {
  color:#92400e;
  background:#fffbeb;
  border:1px solid #fde68a;
  border-radius:8px;
  padding:8px 10px;
}

/* nonbank-restore-gray-fix */
.c-nonbankBadge--on{background:#e0f2fe!important;color:#075985!important;border:1px solid #7dd3fc!important;}
.c-nonbankBadge--off{background:#f1f5f9!important;color:#94a3b8!important;border:1px solid #e2e8f0!important;opacity:.72;}
