:root {
  --ink: #172033;
  --ink-strong: #0d1526;
  --muted: #647084;
  --line: #e1e6ee;
  --line-strong: #cbd4e1;
  --paper: #ffffff;
  --canvas: #f6f8fb;
  --primary: #2563eb;
  --primary-deep: #1847b8;
  --primary-soft: #edf3ff;
  --teal: #07705f;            /* 旧 #087f6b = 4.46:1 不適合 -> 5.44:1 */
  --teal-soft: #e7f7f2;
  --coral: #b8412f;           /* 旧 #c94f42 = 4.05:1 不適合 -> 4.94:1 */
  --coral-soft: #fff0ee;
  --amber: #8a6100;
  --amber-soft: #fff6d8;
  --line-green: #06c755;      /* LINEブランド色。装飾・ロゴのみ（白文字で 2.26:1 のため文字背景に使わない） */
  --line-green-action: #038438; /* ボタン背景用。白文字で 4.81:1 */
  font-family: Inter, "Noto Sans JP", "Yu Gothic UI", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
html { background: var(--canvas); }
body { margin: 0; color: var(--ink); background: var(--canvas); font-size: 14px; }
button, input, select, textarea { font: inherit; letter-spacing: 0; }
button, summary { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .48; }
a { color: inherit; }
h1, h2, h3, h4, p, strong, small { overflow-wrap: anywhere; letter-spacing: 0; }

.portal-boot { min-height: 100vh; padding: 24px; display: grid; place-items: center; align-content: center; gap: 14px; text-align: center; }
.portal-boot img { width: 112px; height: 112px; object-fit: contain; }
.portal-boot strong, .portal-boot span { display: block; }
.portal-boot strong { color: var(--ink-strong); font-size: 20px; }
.portal-boot span { margin-top: 7px; color: var(--muted); font-size: 12px; }

.portal-shell { min-height: 100vh; display: grid; grid-template-columns: 252px minmax(0, 1fr); }
.portal-sidebar { position: sticky; top: 0; height: 100vh; padding: 24px 18px 18px; border-right: 1px solid var(--line); background: var(--paper); display: flex; flex-direction: column; gap: 30px; }
.portal-brand { min-width: 0; min-height: 48px; display: flex; align-items: center; gap: 12px; }
.portal-brand img, .portal-mark { width: 44px; height: 44px; flex: 0 0 44px; border-radius: 8px; object-fit: cover; }
.portal-mark { display: grid; place-items: center; color: #fff; background: var(--primary); font-size: 18px; font-weight: 900; }
.portal-brand strong, .portal-brand small { display: block; }
.portal-brand strong { color: var(--ink-strong); font-size: 18px; line-height: 1.1; }
.portal-brand small { margin-top: 4px; color: var(--muted); font-size: 12px; font-weight: 700; }
.portal-nav { display: grid; gap: 6px; }
.portal-nav button, .portal-mobile-nav button, .portal-account button { min-height: 46px; border: 0; border-radius: 8px; }
.portal-nav button { padding: 0 12px; color: #526076; background: transparent; display: flex; align-items: center; gap: 12px; text-align: left; }
.portal-nav button .portal-icon { flex: 0 0 auto; color: #78869a; }
.portal-nav button.active .portal-icon { color: currentColor; }
.portal-nav button b { font-size: 13px; }
.portal-nav button:hover { color: var(--ink); background: #f1f4f8; }
.portal-nav button.active { color: var(--primary-deep); background: var(--primary-soft); }
.portal-nav button.active span { color: var(--primary); }
.portal-account { min-width: 0; margin-top: auto; padding-top: 18px; border-top: 1px solid var(--line); display: grid; gap: 12px; }
.portal-account small, .portal-account strong { display: block; }
.portal-account small { color: var(--muted); font-size: 12px; }
.portal-account strong { margin-top: 5px; font-size: 13px; }
.portal-account button { padding: 0 12px; color: #48566b; background: #f1f4f8; text-align: left; font-weight: 800; }
.portal-account button:hover { color: var(--coral); background: var(--coral-soft); }
.portal-mobile-nav { display: none; }

.portal-main { min-width: 0; padding: 26px clamp(20px, 3vw, 48px) 72px; }
.portal-content, .portal-topbar { width: min(1040px, 100%); margin-inline: auto; }
.portal-topbar { min-height: 48px; margin-bottom: 22px; display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.portal-topbar h1 { margin: 0; color: var(--ink-strong); font-size: 24px; line-height: 1.25; }
.portal-top-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.portal-icon-button { min-width: 44px; min-height: 44px; padding: 0 12px; border: 1px solid var(--line); border-radius: 8px; color: #435066; background: #fff; display: inline-flex; align-items: center; justify-content: center; gap: 7px; }
.portal-icon-button span { font-size: 16px; font-weight: 900; }
.portal-icon-button b { font-size: 12px; }
.portal-language { width: 100%; min-height: 44px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: 8px; background: #fff; }
.portal-profile-menu { position: relative; }
.portal-profile-menu summary { min-height: 44px; padding: 0 12px; border: 1px solid var(--line); border-radius: 8px; list-style: none; background: #fff; display: flex; align-items: center; font-size: 12px; font-weight: 800; }
.portal-profile-menu summary::-webkit-details-marker { display: none; }
.portal-profile-menu-body { position: absolute; z-index: 12; top: calc(100% + 8px); right: 0; width: 200px; padding: 14px; border: 1px solid var(--line); border-radius: 8px; background: #fff; box-shadow: 0 18px 44px rgba(31, 42, 68, .14); }
.portal-profile-menu-body label { display: block; margin-bottom: 7px; color: var(--muted); font-size: 12px; }

.portal-overview { min-height: 182px; padding: 28px; border-radius: 8px; color: #fff; background: #17324d; display: flex; align-items: flex-end; justify-content: space-between; gap: 28px; }
.portal-kicker, .portal-eyebrow { color: #5d82be; font-size: 12px; font-weight: 900; }
.portal-overview .portal-kicker { color: #74d9c2; }
.portal-overview h2 { margin: 8px 0 5px; font-size: 28px; line-height: 1.3; }
.portal-overview p { margin: 0; color: #cbd8e5; }
.portal-overview-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.portal-button.overview-primary { color: #10273c; background: #fff; }
.portal-refresh { min-height: 44px; padding: 0 13px; border: 1px solid #62788d; border-radius: 8px; color: #fff; background: #24445f; display: inline-flex; align-items: center; gap: 8px; font-weight: 800; }
.portal-refresh .portal-icon { flex: 0 0 auto; }
.portal-refresh b { font-size: 12px; }
.portal-refresh:hover { background: #30526f; }

.portal-quick-stats { min-height: 84px; margin: 12px 0; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.portal-quick-stats div { min-width: 0; padding: 18px 20px; display: flex; align-items: baseline; gap: 9px; }
.portal-quick-stats div + div { border-left: 1px solid var(--line); }
.portal-quick-stats strong { color: var(--ink-strong); font-size: 25px; }
.portal-quick-stats span { color: var(--muted); font-size: 12px; }

.portal-section, .portal-detail-block { margin-top: 12px; padding: 22px 24px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); }
.portal-section-head, .portal-card-head, .portal-row, .portal-actions, .portal-status-line { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.portal-section-head { min-height: 40px; margin-bottom: 12px; }
.portal-section-head > div { min-width: 0; }
.portal-section-head h2, .portal-section-head h3, .portal-section h2, .portal-detail-block h3 { margin: 0; }
.portal-section-head h2, .portal-section h2 { color: var(--ink-strong); font-size: 19px; }
.portal-section-head h3, .portal-detail-block h3 { color: var(--ink-strong); font-size: 16px; }
/* CS採点監査 C-3: 登録情報は「本人のこと／組織のこと／お知らせのこと」の3群。
   群見出しが最上位、各節はその下の h3 になる。 */
.portal-group-title { margin: var(--space-6) 0 var(--space-3); color: var(--ink-strong); font-size: 19px; font-weight: 850; }
.portal-group-title:first-child { margin-top: 0; }
.portal-section h3 { margin: 0; color: var(--ink-strong); font-size: 16px; }
.portal-section-head p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.portal-text-button { min-height: 44px; padding: 0; border: 0; color: var(--primary-deep); background: transparent; font-weight: 850; }
.portal-text-button:hover { color: var(--primary); }

.portal-action-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.portal-action-button { min-width: 0; min-height: 92px; padding: 14px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); background: #fbfcfe; display: grid; grid-template-columns: 36px minmax(0, 1fr); grid-template-rows: auto auto; column-gap: 10px; text-align: left; }
.portal-action-button > span { grid-row: 1 / 3; width: 36px; height: 36px; border-radius: 8px; color: var(--primary); background: var(--primary-soft); display: grid; place-items: center; font-weight: 900; }
.portal-action-button strong { align-self: end; font-size: 13px; }
.portal-action-button small { align-self: start; margin-top: 4px; color: var(--muted); font-size: 12px; }
.portal-action-button:hover { border-color: #9eb8e7; background: var(--primary-soft); }

.portal-service-intro { min-height: 102px; margin: -6px 0 10px; padding: 10px 0 12px; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 82px minmax(0, 1fr) auto; align-items: center; gap: 16px; }
.portal-service-intro > img { width: 72px; height: 88px; object-fit: contain; object-position: center bottom; }
.portal-service-intro h2 { margin: 4px 0 3px; font-size: 21px; }
.portal-service-intro p { margin: 0; color: var(--muted); font-size: 12px; }
.portal-service-head-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.portal-interpreter-symbol { width: 64px; height: 64px; border: 1px solid #cfd9ec; border-radius: 8px; color: #40547a; background: #f2f5fb; display: grid; place-items: center; font-size: 20px; font-weight: 900; }
.portal-service-intro.is-interpreter .portal-eyebrow { color: #65759a; }
.portal-interpreter-card { min-height: 168px; margin: 12px 0 4px; padding: 22px; border: 1px solid #ccd8e9; border-radius: 8px; background: #f6f9fd; display: grid; grid-template-columns: 58px minmax(0, 1fr) auto; align-items: center; gap: 18px; }
.portal-interpreter-card-symbol { width: 58px; height: 58px; border-radius: 18px 18px 18px 6px; color: #fff; background: #193a5a; display: grid; place-items: center; font-size: 22px; font-weight: 900; }
.portal-interpreter-card h3 { margin: 4px 0 6px; color: var(--ink-strong); font-size: 20px; }
.portal-interpreter-card p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.portal-interpreter-card-tags { margin-top: 12px; display: flex; gap: 6px; flex-wrap: wrap; }
.portal-interpreter-card-tags span { min-height: 25px; padding: 0 8px; border-radius: 99px; color: #415574; background: #e6edf7; display: inline-flex; align-items: center; font-size: 12px; font-weight: 800; }
.portal-feature-head { margin-top: 22px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.portal-feature-head h3 { margin: 0; font-size: 15px; }
.portal-feature-head p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.portal-feature-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 22px; }
.portal-feature-row { min-height: 78px; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 40px minmax(0, 1fr) minmax(96px, auto); align-items: center; gap: 10px; }
.portal-feature-row > :last-child { justify-self: end; }
.portal-feature-symbol { width: 38px; height: 38px; border-radius: 12px 12px 12px 4px; color: #40547a; background: #eef2f9; display: grid; place-items: center; font-size: 12px; font-weight: 900; }
.portal-feature-row h3 { margin: 0; font-size: 13px; }
.portal-feature-row p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }

.portal-product { min-height: 94px; padding: 14px 0; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 50px minmax(0, 1fr) minmax(188px, auto); align-items: center; gap: 14px; }
.portal-product:last-child { border-bottom: 0; }
.portal-product-mark { width: 48px; height: 48px; border-radius: 8px; display: grid; place-items: center; overflow: hidden; font-size: 15px; font-weight: 900; }
.portal-product-mark.is-chat { border: 1px solid #d8e2f2; background: #fff; }
.portal-product-mark.is-chat img { width: 100%; height: 100%; object-fit: cover; }
.portal-product-mark.is-interpreter { border: 1px solid #cfe4fb; background: #fff; }
.portal-product-mark.is-interpreter img { width: 100%; height: 100%; object-fit: cover; }
.portal-interpreter-symbol img, .portal-interpreter-card-symbol img { width: 100%; height: 100%; display: block; object-fit: cover; border-radius: inherit; }
.portal-product-copy { min-width: 0; }
.portal-product-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.portal-product h3 { margin: 0; color: var(--ink-strong); font-size: 15px; line-height: 1.35; }
.portal-product p { margin: 5px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.portal-product-actions { min-width: 0; display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.portal-trials { border-color: #b9e4d8; background: #f8fdfb; }
.portal-trials .portal-section-head p { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.portal-trial-row { min-height: 112px; padding: 16px 0; border-bottom: 1px solid #d9e9e4; display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; align-items: center; gap: 14px; }
.portal-trial-row:last-child { border-bottom: 0; padding-bottom: 0; }
.portal-trial-row > img { width: 52px; height: 52px; border: 1px solid #d7e4e0; border-radius: 8px; object-fit: cover; background: #fff; }
.portal-trial-copy { min-width: 0; }
.portal-trial-copy h3 { margin: 0; color: var(--ink-strong); font-size: 15px; }
.portal-trial-copy p { margin: 6px 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.portal-trial-remaining { color: var(--teal); font-size: 12px; }
.portal-trial-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.portal-lp-link { min-height: 44px; padding: 0 4px; color: #59667a; display: inline-flex; align-items: center; font-size: 12px; font-weight: 800; text-decoration: none; }
.portal-lp-link:hover { color: var(--primary); }
.portal-button.product-action { min-width: 148px; }
.portal-row-action { width: 44px; height: 44px; flex: 0 0 44px; border: 1px solid var(--line-strong); border-radius: 8px; color: var(--primary-deep); background: #fff; display: inline-grid; place-items: center; font-size: 17px; font-weight: 850; text-decoration: none; }
.portal-row-action:hover { border-color: var(--primary); background: var(--primary-soft); }

.portal-status, .portal-pill, .portal-sync-state { display: inline-flex; align-items: center; min-height: 25px; padding: 0 8px; border-radius: 99px; background: #eef1f5; color: #596579; font-size: 12px; font-weight: 850; white-space: nowrap; }
.portal-status.good, .portal-pill.ok { color: var(--teal); background: var(--teal-soft); }
.portal-pill.info { color: var(--primary-deep); background: var(--primary-soft); }
.portal-pill.wait { color: var(--amber); background: var(--amber-soft); }
.portal-pill.stop { color: var(--coral); background: var(--coral-soft); }
/* CS採点監査 B-2: バッジは4語に統一し、手続き中であることだけ小さく添える。 */
.portal-pill-group { display: inline-flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.portal-pill-note { font-size: 12px; line-height: 1.5; color: var(--muted); white-space: nowrap; }

.portal-inline-form { max-width: 720px; margin-top: 12px; display: grid; grid-template-columns: 150px minmax(0, 1fr); align-items: center; gap: 12px; }
.portal-inline-form label { font-size: 13px; font-weight: 800; }
.portal-inline-form > div { min-width: 0; display: flex; gap: 8px; }
.portal-inline-form input, .portal-field input, .portal-field select, .portal-field textarea, .portal-setting-row select, .portal-language-search { width: 100%; min-width: 0; min-height: 46px; padding: 9px 12px; border: 1px solid var(--line-strong); border-radius: 8px; color: var(--ink); background: #fff; }
input:focus, select:focus, textarea:focus { outline: 3px solid rgba(37, 99, 235, .15); border-color: var(--primary); }

.portal-button { min-height: 44px; padding: 0 14px; border: 0; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; font-weight: 850; text-decoration: none; text-align: center; }
.portal-button.primary { color: #fff; background: var(--primary); }
.portal-button.secondary { color: #075f51; background: var(--teal-soft); }
.portal-button.outline { color: #36445a; background: #fff; border: 1px solid var(--line-strong); }
.portal-button.line { color: #fff; background: var(--line-green-action); }  /* §8.2 最重要導線のコントラスト是正 */
.portal-button.danger { color: var(--coral); background: var(--coral-soft); }
.portal-button.lp { min-width: 44px; min-height: 44px; color: var(--primary-deep); background: var(--primary-soft); font-size: 12px; }
.portal-button:hover { filter: brightness(.97); }
.portal-button:focus-visible, button:focus-visible, a:focus-visible, summary:focus-visible { outline: 3px solid rgba(37, 99, 235, .22); outline-offset: 2px; }

.portal-workspace { padding-bottom: 28px; }
.portal-back { min-height: 44px; margin-bottom: 10px; padding: 0 4px; border: 0; color: #536176; background: transparent; font-weight: 800; }
.portal-back:hover { color: var(--primary); }
.portal-workspace-head { min-height: 148px; padding: 26px; border-radius: 8px; color: #fff; background: #17324d; display: flex; align-items: flex-end; justify-content: space-between; gap: 22px; }
.portal-workspace-head .portal-eyebrow { color: #74d9c2; }
.portal-workspace-head h2 { margin: 7px 0 4px; font-size: 26px; }
.portal-workspace-head p { margin: 0; color: #cbd8e5; }
.portal-workspace-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.portal-workspace-head .portal-button.outline { color: #fff; border-color: #71869a; background: #24445f; }
.portal-workspace-head .portal-status { color: #d9f6ee; background: #245b55; }
.portal-detail-block { padding-inline: 22px; }
.portal-contract-row { min-height: 70px; padding: 12px 0; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.portal-contract-row:last-of-type { border-bottom: 0; }
.portal-contract-row span, .portal-contract-row strong { display: block; }
.portal-contract-row strong { margin-top: 4px; font-size: 15px; }
.portal-contract-list { margin-top: 16px; display: grid; gap: 10px; }
.portal-contract-summary { padding: 17px; border: 1px solid var(--line); border-radius: 8px; background: #fbfcfe; }
.portal-contract-summary h3 { margin: 3px 0 0; font-size: 16px; }
.portal-contract-summary > p { margin: 10px 0 0; }
.portal-contract-facts { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.portal-contract-facts span, .portal-contract-facts strong { display: block; }
.portal-contract-facts span { color: var(--muted); font-size: 12px; }
.portal-contract-facts strong { margin-top: 4px; font-size: 13px; }
.portal-subheading { margin: 24px 0 0; font-size: 16px; }
.portal-invoice-list { margin-top: 14px; border-top: 1px solid var(--line); }
.portal-invoice-row { min-height: 78px; padding: 13px 0; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: minmax(0, 1fr) minmax(120px, auto) auto; align-items: center; gap: 14px; }
.portal-invoice-row strong, .portal-invoice-row small { display: block; }
.portal-invoice-row small { margin-top: 4px; color: var(--muted); font-size: 12px; }
.portal-capacity { margin-top: 14px; padding-top: 15px; border-top: 1px solid var(--line); }
.portal-capacity > div:first-child { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.portal-capacity span { color: var(--muted); font-size: 12px; }
.portal-capacity-track { height: 8px; margin-top: 10px; overflow: hidden; border-radius: 99px; background: #e9edf3; }
.portal-capacity-track i { display: block; height: 100%; border-radius: inherit; background: var(--teal); }
.portal-workspace-summary { width: 100%; min-height: 64px; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; display: flex; align-items: center; justify-content: space-between; text-align: left; }
.portal-workspace-summary span strong, .portal-workspace-summary span small { display: block; }
.portal-workspace-summary span small { margin-top: 4px; color: var(--muted); }
.portal-workspace-summary b { color: var(--primary); font-size: 12px; }

.portal-room-list { margin-top: 4px; }
.portal-room-row { min-height: 104px; padding: 14px 0; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; align-items: center; gap: 14px; }
.portal-room-number { width: 36px; height: 36px; border-radius: 50%; color: var(--teal); background: var(--teal-soft); display: grid; place-items: center; font-size: 12px; font-weight: 900; }
.portal-room-number.large { width: 48px; height: 48px; font-size: 15px; }
.portal-room-copy { min-width: 0; }
.portal-room-copy > div { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.portal-room-copy h4 { margin: 0; font-size: 15px; }
.portal-room-copy p, .portal-room-copy small { display: block; margin: 4px 0 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.portal-button.room-action { min-width: 104px; }
.portal-add-room { width: 100%; min-height: 56px; margin-top: 12px; padding: 0 14px; border: 1px dashed #8fbcae; border-radius: 8px; color: var(--teal); background: #f4fbf8; display: flex; align-items: center; justify-content: center; gap: 8px; font-weight: 850; }
.portal-add-room:hover { border-color: var(--teal); background: var(--teal-soft); }

.portal-room-head { min-height: 112px; padding: 20px; border: 1px solid var(--line); border-radius: 8px; background: #fff; display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; align-items: center; gap: 14px; }
.portal-room-head h2 { margin: 4px 0; font-size: 22px; }
.portal-room-head p { margin: 0; color: var(--muted); font-size: 12px; }
.portal-readback { min-height: 44px; margin-top: 10px; padding: 0 14px; border-radius: 8px; display: flex; align-items: center; gap: 9px; font-size: 12px; font-weight: 800; }
.portal-readback span { width: 8px; height: 8px; border-radius: 50%; }
.portal-readback.ok { color: var(--teal); background: var(--teal-soft); }
.portal-readback.ok span { background: var(--teal); }
.portal-readback.wait { color: var(--amber); background: var(--amber-soft); }
.portal-readback.wait span { background: var(--amber); }
.portal-settings-form .portal-detail-block { margin-top: 10px; }
.portal-setting-progress { margin: 12px 0 0; padding: 0 10px; list-style: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.portal-setting-progress li { min-width: 0; position: relative; }
.portal-setting-progress li + li::before { content: ""; position: absolute; top: 18px; right: calc(50% + 18px); left: calc(-50% + 18px); height: 2px; background: #dfe4eb; }
.portal-setting-progress button { width: 100%; min-height: 62px; border: 0; color: #8a95a6; background: transparent; display: grid; place-items: center; align-content: center; gap: 4px; position: relative; z-index: 1; }
.portal-setting-progress button span { width: 34px; height: 34px; border: 2px solid #d8dee7; border-radius: 50%; background: #fff; display: grid; place-items: center; font-size: 12px; font-weight: 900; }
.portal-setting-progress button b { font-size: 12px; }
.portal-setting-progress li.active button { color: var(--primary-deep); }
.portal-setting-progress li.active button span { border-color: var(--primary); color: #fff; background: var(--primary); }
.portal-setting-progress li.done button { color: var(--primary-deep); }
.portal-setting-progress li.done button span { border-color: var(--primary); color: var(--primary-deep); background: #eefaf6; }
.portal-setting-progress li.done + li::before { background: var(--primary); }
.portal-setting-panel { scroll-margin-top: 82px; }
.portal-selection-count { color: var(--muted); font-size: 12px; }
.portal-language-search { margin: 8px 0 12px; }
.portal-language-picker { max-height: 278px; overflow: auto; padding: 2px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.portal-language-picker.primary { max-height: none; overflow: visible; margin-top: 14px; }
.portal-more-languages { margin-top: 16px; border-top: 1px solid var(--line); }
.portal-more-languages summary { min-height: 52px; cursor: pointer; color: var(--primary-deep); display: flex; align-items: center; font-size: 12px; font-weight: 850; }
.portal-language-choice { min-width: 0; min-height: 64px; padding: 6px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; display: grid; grid-template-columns: 58px minmax(0, 1fr); align-items: center; gap: 9px; background: #fff; overflow: hidden; }
.portal-language-choice input { position: absolute; opacity: 0; pointer-events: none; }
.portal-language-choice:has(input:focus-visible) { outline: 3px solid rgba(37, 99, 235, .15); border-color: var(--primary); }
.portal-language-choice:has(input:checked) { border-color: #6a95e6; color: var(--primary-deep); background: var(--primary-soft); box-shadow: inset 0 0 0 1px #6a95e6; }
.portal-language-choice:has(input:disabled) { opacity: .55; cursor: not-allowed; }
.portal-language-visual { width: 58px; height: 42px; border-radius: 6px; display: grid; place-items: center; overflow: hidden; background: #eef3f7; }
.portal-language-image { width: 100%; height: 100%; display: block; object-fit: cover; }
.portal-language-flag { font-size: 25px; line-height: 1; }
.portal-language-name { min-width: 0; color: #4f5d70; text-align: left; }
.portal-language-name strong, .portal-language-name small { display: block; overflow-wrap: anywhere; }
.portal-language-name strong { font-size: 12px; }
.portal-language-name small { margin-top: 3px; color: var(--muted); font-size: 12px; font-weight: 700; }
.portal-setting-list { border-top: 1px solid var(--line); }
.portal-setting-row { min-height: 72px; padding: 11px 2px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.portal-setting-row span { min-width: 0; }
.portal-setting-row strong, .portal-setting-row small { display: block; }
.portal-setting-row strong { font-size: 14px; }
.portal-setting-row small { margin-top: 4px; color: var(--muted); font-size: 12px; }
.portal-setting-row select { width: 140px; flex: 0 0 140px; }
.portal-setting-row.is-fixed b { color: var(--muted); font-size: 12px; }
.portal-switch { width: 48px; height: 28px; flex: 0 0 48px; appearance: none; border-radius: 99px; background: #cbd3dd; position: relative; transition: background .16s ease; }
.portal-switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.2); transition: transform .16s ease; }
.portal-switch:checked { background: var(--teal); }
.portal-switch:checked::after { transform: translateX(20px); }
.portal-fieldset { margin: 10px 0 0; padding: 16px 20px 18px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.portal-fieldset legend { padding: 0 5px; font-size: 14px; font-weight: 850; }
.portal-scope-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.portal-check { min-height: 44px; display: flex; align-items: center; gap: 9px; font-size: 13px; }
.portal-check input:not(.portal-switch) { width: 20px; height: 20px; accent-color: var(--primary); }
.portal-save-bar { position: sticky; bottom: 10px; z-index: 5; min-height: 72px; margin-top: 12px; padding: 11px 12px 11px 18px; border: 1px solid var(--line-strong); border-radius: 8px; background: rgba(255,255,255,.97); box-shadow: 0 14px 34px rgba(31, 42, 68, .14); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.portal-save-bar span { color: var(--muted); font-size: 12px; }
.portal-step-actions { margin-top: 18px; display: flex; justify-content: flex-end; gap: 8px; }
.portal-step-actions.split { justify-content: space-between; }
.portal-setting-review { margin-top: 16px; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.portal-setting-review > div { min-height: 70px; padding: 12px 14px; background: #fff; display: grid; align-content: center; gap: 5px; }
.portal-setting-review > div + div { border-top: 1px solid var(--line); }
.portal-setting-review span { color: var(--muted); font-size: 12px; }
.portal-setting-review strong { font-size: 14px; line-height: 1.5; }
.portal-task-list { margin-top: 18px; border-top: 1px solid var(--line); }
/* 使い方監査 H-9: 番号丸(portal-task-number)は前回のC-2で削除済み。
   42px列を残すと本文が番号用の42px幅へ落ちて、1タスクが665pxに伸びる。 */
.portal-task { padding: 16px 2px; border-bottom: 1px solid var(--line); }
.portal-task h3 { margin: 3px 0 5px; font-size: 16px; }
.portal-task p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.7; }
.portal-task .portal-actions { margin-top: 12px; }
.portal-danger-link { width: 100%; min-height: 46px; margin-top: 24px; border: 0; color: var(--coral); background: transparent; font-size: 12px; font-weight: 850; }

.portal-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.portal-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.portal-card { min-width: 0; padding: 17px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.portal-card h2, .portal-card h3 { margin: 0; }
.portal-card h2 { font-size: 18px; }
.portal-card h3 { font-size: 15px; }
.portal-label { color: var(--muted); font-size: 12px; }
.portal-value { margin-top: 5px; color: var(--ink-strong); font-size: 25px; font-weight: 850; }
.portal-muted { color: var(--muted); line-height: 1.6; }
.portal-actions { justify-content: flex-start; flex-wrap: wrap; margin-top: 14px; }
.portal-actions.end { justify-content: flex-end; }
.portal-divider { margin: 18px 0; border: 0; border-top: 1px solid var(--line); }
.portal-table-wrap { overflow-x: auto; }
.portal-table { width: 100%; min-width: 620px; border-collapse: collapse; }
.portal-table th, .portal-table td { padding: 12px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.portal-table th { color: var(--muted); font-size: 12px; }
.portal-room { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.portal-room:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.portal-room h3 { margin: 0 0 5px; font-size: 15px; }
.portal-room-meta { margin-top: 8px; display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.portal-alert { margin: 10px 0; padding: 13px 14px; border-left: 4px solid var(--amber); border-radius: 0 8px 8px 0; color: #6e5005; background: var(--amber-soft); line-height: 1.55; }
.portal-error { border-left-color: var(--coral); color: #85372f; background: var(--coral-soft); }
.portal-empty { padding: 24px 8px; color: var(--muted); text-align: center; }
.portal-empty.compact { padding: 12px 0; text-align: left; }

.portal-login { min-height: 100vh; padding: 20px; background: #f3f6fa; display: grid; place-items: center; }
.portal-login-card { width: min(440px, 100%); padding: 30px; border: 1px solid var(--line); border-radius: 8px; background: #fff; box-shadow: 0 22px 60px rgba(30, 42, 68, .1); }
.portal-login-card .portal-brand small { color: var(--muted); }
.portal-login-card h1 { margin: 24px 0 7px; color: var(--ink-strong); font-size: 26px; }
.portal-login-subtitle { margin: 18px 0 0; color: var(--ink-strong); font-size: 17px; }
.portal-login-form { margin-top: 20px; display: grid; gap: 14px; }
.portal-login-form label { display: grid; gap: 7px; font-size: 13px; font-weight: 800; }
.portal-login-form input { min-height: 48px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 8px; }
.portal-login-card > .portal-button { margin-top: 10px; }
.portal-login-form .portal-button { min-height: 48px; }
.portal-create-account { width: 100%; }
.portal-first-registration { margin-top: 20px; padding: 18px; border: 2px solid #276f78; border-radius: 12px; background: linear-gradient(145deg, #f2fbf9, #f8fbff); display: grid; gap: 7px; }
.portal-first-registration > span { color: #17645f; font-size: 12px; font-weight: 900; letter-spacing: .08em; }
.portal-first-registration > strong { color: var(--ink-strong); font-size: 20px; }
.portal-first-registration > p { margin: 0 0 5px; color: #526176; font-size: 12px; line-height: 1.6; }
.portal-login-choice-separator { margin-top: 22px; }
.portal-registration-choice .portal-safety-note { margin-top: 14px; }
.portal-safety-note { padding: 12px 14px; border: 1px solid #cfe0f5; border-radius: 8px; color: #41516a; background: #f4f8fd; display: grid; gap: 4px; font-size: 12px; line-height: 1.6; }
.portal-password-rules { margin-top: -7px; padding: 9px 11px; border-radius: 8px; color: #485a73; background: #f3f6fa; font-size: 12px; line-height: 1.55; }
.portal-registration-result { padding-top: 24px; text-align: center; }
.portal-registration-result > span { width: 54px; height: 54px; margin: 0 auto 16px; border-radius: 50%; color: #fff; background: var(--teal); display: grid; place-items: center; font-size: 25px; font-weight: 900; }
.portal-registration-result h1 { margin-top: 0; }
.portal-oauth { margin-top: 20px; }
.portal-oauth-buttons { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.portal-oauth-button { min-height: 50px; padding: 0 14px; border: 1px solid var(--line-strong); border-radius: 8px; color: var(--ink-strong); background: #fff; display: flex; align-items: center; justify-content: center; gap: 9px; font: inherit; cursor: pointer; }
.portal-oauth-button:hover { border-color: #95a9bd; background: #f8fafc; }
.portal-oauth-button:focus-visible { outline: 3px solid rgba(30, 117, 154, .24); outline-offset: 2px; }
.portal-oauth-icon { width: 24px; height: 24px; flex: 0 0 24px; }
.portal-oauth-icon.discord { color: #5865f2; }
.portal-oauth-button b { font-size: 13px; }
.portal-registration-steps { margin: 18px 0 2px; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.portal-registration-steps li { min-width: 0; display: grid; justify-items: center; gap: 5px; color: var(--muted); font-size: 12px; text-align: center; }
.portal-registration-steps li > span { width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--line-strong); background: #fff; display: grid; place-items: center; font-weight: 900; }
.portal-registration-steps li.current { color: #17645f; }
.portal-registration-steps li.current > span { border-color: #17645f; color: #fff; background: #17645f; }
.portal-login-separator { margin: 17px 0 0; color: var(--muted); display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 11px; font-size: 12px; }
.portal-login-separator::before, .portal-login-separator::after { content: ""; height: 1px; background: var(--line); }

@media (max-width: 520px) {
  .portal-login { padding: 10px; place-items: start center; }
  .portal-login-card { padding: 22px 18px; border-radius: 10px; }
  .portal-oauth-buttons { grid-template-columns: 1fr; }
  .portal-oauth-button { justify-content: flex-start; padding-left: 22px; }
}

.portal-management-dashboard { margin-top: 14px; }
.portal-management-grid { margin-top: 16px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.portal-management-item { min-width: 0; min-height: 142px; padding: 16px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); background: #fff; display: flex; flex-direction: column; align-items: flex-start; text-align: left; }
.portal-management-item > span { color: var(--muted); font-size: 12px; font-weight: 800; }
.portal-management-item > strong { margin-top: 10px; color: var(--ink-strong); font-size: 21px; }
.portal-management-item > small { margin-top: 5px; color: var(--muted); font-size: 12px; }
.portal-management-item > b { margin-top: auto; padding-top: 11px; color: var(--primary-deep); font-size: 12px; }
.portal-management-item:hover { border-color: #9fb9e8; background: #f8fbff; }
.portal-next-action { min-height: 82px; margin-top: 12px; padding: 14px 16px; border: 1px solid #b9d8d0; border-radius: 8px; background: #f0faf7; display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.portal-next-action span, .portal-next-action strong, .portal-next-action small { display: block; }
.portal-next-action span { color: var(--teal); font-size: 12px; font-weight: 900; }
.portal-next-action strong { margin-top: 4px; font-size: 16px; }
.portal-next-action small { margin-top: 3px; color: #526b66; }
.portal-queue-stats { margin-top: 15px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.portal-queue-stats > div { min-height: 76px; padding: 13px; display: grid; place-items: center; align-content: center; gap: 4px; text-align: center; }
.portal-queue-stats > div + div { border-left: 1px solid var(--line); }
.portal-queue-stats strong { font-size: 20px; }
.portal-queue-stats span { color: var(--muted); font-size: 12px; }
.portal-trial-authority { display: block; margin-top: 8px; color: #526176; font-size: 12px; font-weight: 750; }
.portal-toast { position: fixed; z-index: 100; right: 18px; bottom: 18px; max-width: min(420px, calc(100vw - 36px)); padding: 14px 16px; border-radius: 8px; color: #fff; background: #17324d; box-shadow: 0 14px 30px rgba(0,0,0,.18); }
.portal-request-progress { position: fixed; z-index: 130; left: 50%; bottom: 24px; width: min(520px, calc(100vw - 32px)); min-height: 68px; padding: 10px 14px; border: 1px solid #d8e2eb; border-radius: 18px; background: rgba(255,255,255,.98); box-shadow: 0 16px 48px rgba(24,54,73,.16); display: grid; grid-template-columns: 46px minmax(0, 1fr) auto; align-items: center; gap: 11px; transform: translate(-50%, 18px); opacity: 0; transition: opacity .18s ease, transform .18s ease; pointer-events: none; }
.portal-request-progress.visible { opacity: 1; transform: translate(-50%, 0); }
.portal-request-progress > img, .portal-request-symbol { width: 46px; height: 46px; border-radius: 14px; object-fit: cover; }
.portal-request-symbol { color: #fff; background: #31566b; display: grid; place-items: center; font-size: 15px; font-weight: 900; }
.portal-request-symbol.billing { color: #146354; background: #e5f5ef; }
.portal-request-symbol.interpreter { color: #40547a; background: #eef2f9; }
.portal-request-progress strong, .portal-request-progress span { display: block; }
.portal-request-progress strong { color: var(--ink-strong); font-size: 13px; }
.portal-request-progress span { margin-top: 3px; color: var(--muted); font-size: 12px; }
.portal-request-progress > i { display: flex; gap: 4px; }
.portal-request-progress > i b { width: 6px; height: 6px; border-radius: 50%; background: #4b91b0; animation: portal-request-dot .9s ease-in-out infinite; }
.portal-request-progress > i b:nth-child(2) { animation-delay: .14s; }
.portal-request-progress > i b:nth-child(3) { animation-delay: .28s; }
@keyframes portal-request-dot { 0%, 100% { opacity: .25; transform: translateY(0); } 50% { opacity: 1; transform: translateY(-4px); } }
.portal-hidden, [hidden] { display: none !important; }
.portal-visually-hidden { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }

body.portal-guide-open { overflow: hidden; }
.portal-guide-overlay { position: fixed; z-index: 80; inset: 0; padding: 18px; background: rgba(13, 21, 38, .62); display: grid; place-items: center; }
.portal-guide-dialog { width: min(920px, 100%); max-height: calc(100vh - 36px); overflow: auto; border-radius: 20px; background: #fff; box-shadow: 0 30px 90px rgba(8, 17, 34, .28); }
.portal-guide-header { min-height: 70px; padding: 12px 18px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.portal-guide-header > div { min-width: 0; display: flex; align-items: center; gap: 10px; }
.portal-guide-header img { width: 42px; height: 42px; border-radius: 12px; object-fit: cover; }
.portal-guide-header b, .portal-guide-header small { display: block; }
.portal-guide-header b { color: var(--ink-strong); font-size: 15px; }
.portal-guide-header small { margin-top: 3px; color: var(--muted); font-size: 12px; }
.portal-guide-header > button { width: 44px; height: 44px; flex: 0 0 44px; border: 0; border-radius: 50%; color: #5d697b; background: #f0f3f7; font-size: 25px; line-height: 1; }
.portal-guide-progress { margin: 0; padding: 14px 24px; border-bottom: 1px solid var(--line); list-style: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.portal-guide-progress li { min-width: 0; color: #929bab; display: flex; align-items: center; justify-content: center; gap: 4px; flex-direction: column; position: relative; }
.portal-guide-progress li + li::before { content: ""; position: absolute; right: calc(50% + 18px); left: calc(-50% + 18px); top: 15px; height: 2px; background: #e4e8ee; }
.portal-guide-progress li.done + li::before { background: #8ddbad; }
.portal-guide-progress span { position: relative; z-index: 1; width: 30px; height: 30px; flex: 0 0 30px; border: 2px solid #d9dfe8; border-radius: 50%; background: #fff; display: grid; place-items: center; font-size: 12px; font-weight: 900; }
.portal-guide-progress b { font-size: 12px; }
.portal-guide-progress .active { color: var(--ink); }
.portal-guide-progress .active span { border-color: var(--line-green); color: #fff; background: var(--line-green); }
.portal-guide-progress .done { color: var(--teal); }
.portal-guide-progress .done span { border-color: #9adcb6; color: var(--teal); background: #eaf8f0; }
.portal-guide-body { min-height: 550px; }
.portal-guide-layout { min-height: 550px; padding: 34px clamp(24px, 5vw, 58px); display: grid; grid-template-columns: minmax(250px, 340px) minmax(0, 1fr); align-items: center; gap: clamp(32px, 6vw, 72px); }
.portal-guide-copy { min-width: 0; }
.portal-guide-kicker { display: inline-block; color: var(--primary); font-size: 12px; font-weight: 900; }
.portal-guide-kicker.success { color: var(--teal); }
.portal-guide-copy h2 { margin: 8px 0 14px; color: var(--ink-strong); font-size: 30px; line-height: 1.35; }
.portal-guide-lead { margin: 0 0 18px; color: var(--muted); line-height: 1.7; }
.portal-guide-mini-steps { margin: 18px 0 22px; display: grid; gap: 10px; }
.portal-guide-mini-steps p { margin: 0; display: flex; align-items: center; gap: 10px; font-weight: 800; }
.portal-guide-mini-steps b { width: 28px; height: 28px; flex: 0 0 28px; border-radius: 50%; color: var(--primary); background: var(--primary-soft); display: grid; place-items: center; font-size: 12px; }
.portal-guide-actions { margin-top: 16px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.portal-guide-actions .portal-button { min-height: 48px; padding-inline: 18px; }
.portal-guide-actions.stacked { align-items: stretch; flex-direction: column; }
.portal-guide-actions.stacked .portal-button { width: 100%; }
.portal-guide-code { min-width: 0; margin-top: 10px; padding: 10px 10px 10px 14px; border: 1px solid #cbd8ef; border-radius: 10px; background: #f5f8ff; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 3px 10px; }
.portal-guide-code small { grid-column: 1 / -1; color: #66768f; font-size: 12px; font-weight: 850; }
.portal-guide-code code { min-width: 0; overflow-wrap: anywhere; color: #163e91; font-family: "SFMono-Regular", Consolas, monospace; font-size: 14px; font-weight: 850; }
.portal-guide-code button { min-width: 74px; min-height: 44px; border: 0; border-radius: 8px; color: #fff; background: var(--primary); font-size: 12px; font-weight: 850; }
.portal-guide-code.compact { background: #fbfcfe; border-color: var(--line); }
.portal-guide-code.compact code { color: #59677d; font-size: 12px; }
.portal-guide-code.compact button { color: #48566c; background: #e9edf3; }
.portal-guide-code.language { grid-template-columns: 1fr; }
.portal-guide-wait, .portal-guide-detected { min-height: 58px; margin-top: 14px; padding: 10px 12px; border-radius: 10px; display: flex; align-items: center; gap: 10px; }
.portal-guide-wait { color: #725914; background: var(--amber-soft); }
.portal-guide-wait > span { width: 18px; height: 18px; flex: 0 0 18px; border: 2px solid #d5b354; border-top-color: transparent; border-radius: 50%; animation: portal-guide-spin .9s linear infinite; }
.portal-guide-wait.error { color: var(--coral); background: var(--coral-soft); }
.portal-guide-wait.error > span { border: 0; animation: none; display: grid; place-items: center; font-weight: 900; }
.portal-guide-detected { color: #076b59; background: var(--teal-soft); }
.portal-guide-detected > span { width: 28px; height: 28px; flex: 0 0 28px; border-radius: 50%; color: #fff; background: var(--teal); display: grid; place-items: center; font-weight: 900; }
.portal-guide-wait b, .portal-guide-wait small, .portal-guide-detected b, .portal-guide-detected small { display: block; }
.portal-guide-wait b, .portal-guide-detected b { font-size: 12px; }
.portal-guide-wait small, .portal-guide-detected small { margin-top: 3px; opacity: .82; font-size: 12px; }
.portal-guide-password { margin-top: 12px; padding: 14px; border: 1px solid #cfd9e8; border-radius: 10px; background: #fbfcfe; }
.portal-guide-password label { font-weight: 850; }
.portal-guide-password p { margin: 4px 0 10px; color: var(--muted); font-size: 12px; line-height: 1.55; }
.portal-guide-password > div { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.portal-guide-password input, .portal-guide-language-selects select { width: 100%; min-width: 0; min-height: 46px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 8px; background: #fff; }
.portal-guide-restart { width: 100%; margin-top: 10px; }
.portal-guide-language-selects { margin: 16px 0 12px; display: grid; gap: 10px; }
.portal-guide-language-selects label { display: grid; gap: 6px; color: #4e5b70; font-size: 12px; font-weight: 850; }
.portal-guide-footnote { margin: 10px 0 0; color: var(--muted); text-align: center; font-size: 12px; }
.portal-guide-phone { width: min(100%, 270px); aspect-ratio: 10 / 16; justify-self: center; overflow: hidden; border: 8px solid #1d2533; border-radius: 34px; background: #eef1f5; box-shadow: 0 22px 50px rgba(23, 32, 51, .18); }
.portal-guide-phone-bar { height: 62px; padding: 20px 14px 8px; border-bottom: 1px solid rgba(0,0,0,.08); color: #263244; background: #fff; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.portal-guide-phone-bar strong { font-size: 12px; }
.portal-guide-phone-bar span { min-width: 24px; color: #2785df; font-size: 12px; font-weight: 850; }
.portal-guide-phone-bar span:last-child { text-align: right; }
.portal-guide-member { min-height: 72px; margin: 0 12px; padding: 10px 4px; border-bottom: 1px solid #dde3ea; display: grid; grid-template-columns: 46px minmax(0, 1fr) 24px; align-items: center; gap: 10px; }
.portal-guide-member img, .portal-guide-avatar { width: 46px; height: 46px; border-radius: 50%; object-fit: cover; object-position: center 18%; background: #fff; }
.portal-guide-avatar.person { color: #fff; background: #5c7fb4; display: grid; place-items: center; font-weight: 900; }
.portal-guide-member b, .portal-guide-member small { display: block; }
.portal-guide-member b { font-size: 12px; }
.portal-guide-member small { margin-top: 4px; color: #7a8494; font-size: 9px; }
.portal-guide-member i { width: 22px; height: 22px; border: 2px solid #cbd2dc; border-radius: 50%; color: transparent; display: grid; place-items: center; font-size: 12px; font-style: normal; }
.portal-guide-member.selected { margin-top: 8px; border: 1px solid #9dddb8; border-radius: 12px; background: #f4fbf7; }
.portal-guide-member.selected i { border-color: var(--line-green); color: #fff; background: var(--line-green); }
.portal-guide-chat { background: #9db4c8; }
.portal-guide-chat .portal-guide-phone-bar { background: rgba(255,255,255,.96); }
.portal-guide-chat-day { width: fit-content; margin: 12px auto; padding: 4px 9px; border-radius: 99px; color: #fff; background: rgba(48, 70, 90, .38); font-size: 8px; font-weight: 800; }
.portal-guide-bubble { width: fit-content; max-width: 80%; margin: 14px 12px; padding: 10px 12px; border-radius: 14px; font-size: 12px; line-height: 1.5; }
.portal-guide-bubble.mine { margin-left: auto; border-bottom-right-radius: 4px; color: #153527; background: #8ee59e; }
.portal-guide-bubble.mine code { overflow-wrap: anywhere; font-family: "SFMono-Regular", Consolas, monospace; font-size: 12px; font-weight: 900; }
.portal-guide-bubble.cotoa { padding: 0; background: transparent; display: flex; align-items: flex-start; gap: 7px; }
.portal-guide-bubble.cotoa img { width: 34px; height: 34px; flex: 0 0 34px; border-radius: 50%; object-fit: cover; object-position: center 18%; background: #fff; }
.portal-guide-bubble.cotoa span { padding: 9px 10px; border-radius: 4px 14px 14px; background: #fff; }
@keyframes portal-guide-spin { to { transform: rotate(360deg); } }

.portal-action-dialog { width: min(860px, 100%); }
.portal-action-form { min-height: 520px; display: grid; grid-template-rows: minmax(0, 1fr) auto; }
.portal-action-layout { min-height: 0; display: grid; grid-template-columns: minmax(210px, 270px) minmax(0, 1fr); }
.portal-action-visual { min-height: 100%; padding: 26px 20px; background: #edf7f4; display: grid; place-items: center; }
.portal-action-character { width: 100%; display: grid; place-items: center; gap: 12px; }
.portal-action-character img { width: min(180px, 76%); max-height: 230px; object-fit: contain; object-position: center bottom; }
.portal-action-character span, .portal-action-symbol span { color: #315b55; font-size: 12px; font-weight: 850; text-align: center; }
.portal-action-symbol { display: grid; place-items: center; gap: 14px; }
.portal-action-symbol b { width: 96px; height: 96px; border: 1px solid #c7d6e4; border-radius: 30px 30px 30px 9px; color: #31506e; background: #fff; display: grid; place-items: center; font-size: 28px; }
.portal-action-copy { min-width: 0; padding: 34px clamp(24px, 5vw, 48px); overflow: auto; }
.portal-action-copy h2 { margin: 7px 0 10px; color: var(--ink-strong); font-size: 26px; line-height: 1.35; }
.portal-field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.portal-field { margin-top: 14px; display: grid; gap: 7px; }
.portal-field > span, .portal-choice-field legend { color: #445166; font-size: 12px; font-weight: 850; }
.portal-field textarea { resize: vertical; }
.portal-choice-field { min-width: 0; margin: 18px 0 0; padding: 0; border: 0; }
.portal-choice-field legend { margin-bottom: 8px; }
.portal-choice-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.portal-choice-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.portal-choice-grid label, .portal-topup-grid label { min-width: 0; cursor: pointer; position: relative; }
.portal-choice-grid input, .portal-topup-grid input { position: absolute; opacity: 0; pointer-events: none; }
.portal-choice-grid label > span { min-height: 104px; padding: 13px; border: 1px solid var(--line); border-radius: 8px; background: #fff; display: grid; align-content: start; }
.portal-choice-grid b, .portal-choice-grid small { display: block; }
.portal-choice-grid b { color: var(--ink-strong); font-size: 12px; }
.portal-choice-grid small { margin-top: 6px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.portal-choice-grid label:has(input:checked) > span, .portal-topup-grid label:has(input:checked) > span { border-color: #5592df; background: var(--primary-soft); box-shadow: inset 0 0 0 1px #5592df; }
.portal-choice-grid label:has(input:focus-visible) > span, .portal-topup-grid label:has(input:focus-visible) > span { outline: 3px solid rgba(37, 99, 235, .18); outline-offset: 2px; }
.portal-topup-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.portal-topup-grid label > span { min-height: 106px; padding: 13px; border: 1px solid var(--line); border-radius: 8px; background: #fff; display: grid; align-content: center; }
.portal-topup-grid small, .portal-topup-grid b, .portal-topup-grid strong { display: block; }
.portal-topup-grid small { color: var(--teal); font-size: 9px; font-weight: 850; }
.portal-topup-grid b { margin-top: 5px; font-size: 17px; }
.portal-topup-grid strong { margin-top: 4px; color: var(--primary-deep); font-size: 13px; }
.portal-action-facts { margin-top: 16px; border-top: 1px solid var(--line); }
.portal-action-facts > div { min-height: 58px; padding: 10px 2px; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: minmax(100px, .42fr) minmax(0, 1fr); align-items: center; gap: 12px; }
.portal-action-facts span { color: var(--muted); font-size: 12px; }
.portal-action-facts strong { font-size: 12px; line-height: 1.55; }
.portal-action-note, .portal-action-warning { margin-top: 15px; padding: 12px 14px; border-radius: 8px; font-size: 12px; line-height: 1.6; }
.portal-action-note { color: #315b55; background: #edf7f4; }
.portal-action-warning { color: #7a4d07; background: var(--amber-soft); }
.portal-action-footer { min-height: 76px; padding: 12px 18px; border-top: 1px solid var(--line); background: #fff; display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.portal-action-footer .portal-button { min-height: 48px; padding-inline: 20px; }

.portal-loading-shell { min-height: 320px; padding: 24px; display: grid; place-items: center; align-content: center; gap: 16px; }
.portal-loading-shell.standalone { min-height: 100vh; background: #f3f7f8; }
.portal-loading-shell-brand { width: min(680px, 100%); display: flex; justify-content: center; }
.portal-loading-shell:not(.standalone) .portal-loading-shell-brand { display: none; }
.portal-loading-shell:focus { outline: none; }
.portal-loading-status, .portal-loading-error { width: min(680px, 100%); min-height: 48px; padding: 10px 14px; border-radius: 8px; display: flex; align-items: center; justify-content: center; gap: 10px; }
.portal-loading-status { color: #146354; background: #e8f6f1; }
.portal-loading-status > span { width: 18px; height: 18px; flex: 0 0 18px; border: 2px solid #57a997; border-top-color: transparent; border-radius: 50%; animation: portal-guide-spin .8s linear infinite; }
.portal-loading-status b { font-size: 12px; }
.portal-loading-error { color: var(--coral); background: var(--coral-soft); flex-wrap: wrap; }
.portal-loading-error strong, .portal-loading-error span { font-size: 12px; }
.portal-loading-error .portal-button { min-height: 44px; }

@media (max-width: 980px) {
  .portal-shell { --portal-mobile-nav-height: calc(64px + max(8px, env(safe-area-inset-bottom, 0px))); }
  .portal-shell { grid-template-columns: 1fr; }
  .portal-sidebar { position: relative; z-index: 10; height: auto; min-height: 68px; padding: 10px 18px; border-right: 0; border-bottom: 1px solid var(--line); flex-direction: row; align-items: center; justify-content: space-between; }
  .portal-sidebar .portal-nav { display: none; }
  .portal-account { margin: 0; padding: 0; border: 0; display: flex; align-items: center; }
  .portal-account > div { display: none; }
  .portal-account button { min-width: 84px; padding: 0 12px; text-align: center; }
  .portal-main { padding: 20px 18px calc(var(--portal-mobile-nav-height) + 16px); }
  .portal-mobile-nav { box-sizing: border-box; position: fixed; z-index: 20; left: 0; right: 0; bottom: 0; height: var(--portal-mobile-nav-height); min-height: var(--portal-mobile-nav-height); padding: 4px 8px max(8px, env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--line); background: #fff; display: grid; grid-template-columns: repeat(5, minmax(44px, 1fr)); }
  .portal-mobile-nav button { box-sizing: border-box; min-width: 44px; min-height: 44px; padding: 4px 2px; color: #6a7688; background: transparent; display: grid; place-items: center; align-content: center; gap: 4px; position: relative; }
  .portal-mobile-nav button .portal-icon { flex: 0 0 auto; }
  .portal-mobile-nav button b { max-width: 100%; overflow: hidden; font-size: clamp(10px, 3vw, 12px); line-height: 1.1; white-space: nowrap; }
  .portal-mobile-nav button.active { color: var(--primary); background: var(--primary-soft); }
}

@media (max-width: 720px) {
  .portal-action-grid { grid-template-columns: 1fr; }
  .portal-action-button { min-height: 76px; }
  .portal-product { grid-template-columns: 48px minmax(0, 1fr); }
  .portal-product-actions { grid-column: 2; justify-content: flex-start; flex-wrap: wrap; }
  .portal-trial-row { grid-template-columns: 48px minmax(0, 1fr); }
  .portal-trial-row > img { width: 48px; height: 48px; }
  .portal-trial-actions { grid-column: 2; justify-content: flex-start; flex-wrap: wrap; }
  .portal-button.product-action { min-width: 174px; }
  .portal-service-intro { grid-template-columns: 68px minmax(0, 1fr); }
  .portal-service-intro > img { width: 60px; height: 78px; }
  .portal-service-intro > .portal-status, .portal-service-intro > .portal-button, .portal-service-intro > .portal-service-head-actions { grid-column: 2; justify-self: start; }
  .portal-interpreter-card { grid-template-columns: 52px minmax(0, 1fr); }
  .portal-interpreter-card .portal-product-actions { grid-column: 2; }
}

@media (max-width: 620px) {
  .portal-request-progress { bottom: 88px; width: calc(100vw - 24px); min-height: 64px; border-radius: 16px; grid-template-columns: 42px minmax(0, 1fr) auto; }
  .portal-request-progress > img, .portal-request-symbol { width: 42px; height: 42px; }
  .portal-brand img, .portal-mark { width: 40px; height: 40px; flex-basis: 40px; }
  .portal-brand strong { font-size: 16px; }
  .portal-brand small { font-size: 12px; }
  .portal-main { padding: 14px 12px calc(var(--portal-mobile-nav-height) + 16px); }
  .portal-topbar { min-height: 44px; margin-bottom: 12px; align-items: flex-start; flex-wrap: wrap; }
  .portal-topbar > div:first-child { flex: 0 0 auto; max-width: 100%; }
  .portal-topbar h1 { margin-top: 8px; font-size: 19px; }
  .portal-top-actions { gap: 5px; margin-left: auto; max-width: 100%; }
  .portal-button.lp { width: 44px; padding: 0; overflow: hidden; color: transparent; position: relative; }
  .portal-button.lp::after { content: "LP"; position: absolute; inset: 0; color: var(--primary-deep); display: grid; place-items: center; font-size: 12px; }
  .portal-icon-button { width: 44px; padding: 0; }
  .portal-icon-button b { display: none; }
  .portal-profile-menu summary { width: 44px; padding: 0; overflow: hidden; color: transparent; position: relative; }
  .portal-profile-menu summary::after { content: "文"; position: absolute; inset: 0; color: var(--ink); display: grid; place-items: center; }
  .portal-overview { min-height: 206px; padding: 22px; align-items: flex-start; flex-direction: column; }
  .portal-overview h2 { font-size: 23px; }
  .portal-overview-actions { width: 100%; justify-content: flex-start; }
  .portal-overview-actions .overview-primary { flex: 1 1 170px; }
  .portal-refresh b { display: none; }
  .portal-refresh { width: 44px; padding: 0; justify-content: center; }
  .portal-quick-stats div { padding: 14px 6px; align-items: center; flex-direction: column; gap: 3px; text-align: center; }
  .portal-quick-stats strong { font-size: 22px; }
  .portal-quick-stats span { font-size: 9px; }
  .portal-management-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .portal-management-item { min-height: 132px; padding: 13px; }
  .portal-management-item > strong { font-size: 18px; }
  .portal-next-action { align-items: stretch; flex-direction: column; }
  .portal-next-action .portal-button { width: 100%; }
  .portal-queue-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .portal-queue-stats > div:nth-child(3) { border-left: 0; border-top: 1px solid var(--line); }
  .portal-queue-stats > div:nth-child(4) { border-top: 1px solid var(--line); }
  .portal-section, .portal-detail-block { padding: 18px 15px; }
  .portal-section-head { align-items: flex-start; }
  .portal-section-head h2 { font-size: 18px; }
  .portal-text-button { font-size: 12px; }
  .portal-service-intro { min-height: 94px; margin-top: -4px; gap: 10px; }
  .portal-service-intro h2 { font-size: 19px; }
  .portal-product { gap: 11px; }
  .portal-product-mark { width: 46px; height: 46px; }
  .portal-product-title .portal-status { display: inline-flex; }
  .portal-product-actions { gap: 6px; }
  .portal-lp-link { min-height: 44px; }
  .portal-button.product-action { flex: 1 1 180px; }
  .portal-interpreter-card { min-height: 0; padding: 16px; gap: 12px; }
  .portal-interpreter-card-symbol { width: 48px; height: 48px; border-radius: 15px 15px 15px 5px; }
  .portal-interpreter-card h3 { font-size: 18px; }
  .portal-interpreter-card-tags span { font-size: 9px; }
  .portal-feature-list { grid-template-columns: 1fr; }
  .portal-inline-form { grid-template-columns: 1fr; gap: 8px; }
  .portal-inline-form > div { flex-direction: column; }
  .portal-inline-form .portal-button { width: 100%; }
  .portal-workspace-head { min-height: 176px; padding: 22px; align-items: flex-start; flex-direction: column; }
  .portal-workspace-head h2 { font-size: 23px; }
  .portal-workspace-actions { width: 100%; justify-content: flex-start; }
  .portal-room-row { grid-template-columns: 36px minmax(0, 1fr); gap: 10px; }
  .portal-button.room-action { grid-column: 2; width: 100%; }
  .portal-room-head { grid-template-columns: 48px minmax(0, 1fr); }
  .portal-room-head > .portal-pill { grid-column: 2; justify-self: start; }
  .portal-language-picker { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .portal-setting-progress { padding-inline: 0; }
  .portal-setting-progress button b { font-size: 12px; }
  .portal-step-actions, .portal-step-actions.split { display: grid; grid-template-columns: 1fr; }
  .portal-step-actions .portal-button { width: 100%; }
  .portal-grid, .portal-grid.two, .portal-scope-grid { grid-template-columns: 1fr; }
  .portal-contract-facts { grid-template-columns: 1fr; gap: 10px; }
  .portal-contract-facts div { min-height: 44px; padding: 8px 10px; border-radius: 8px; background: #fff; }
  .portal-invoice-row { grid-template-columns: 1fr; align-items: start; }
  .portal-invoice-row .portal-button { width: 100%; }
  .portal-card-head, .portal-row, .portal-status-line { align-items: flex-start; flex-direction: column; }
  .portal-save-bar { bottom: 80px; }
  .portal-save-bar span { display: none; }
  .portal-save-bar .portal-button { width: 100%; white-space: normal; line-height: 1.3; }
  .portal-login { padding: 12px; }
  .portal-login-card { padding: 24px 19px; }
  .portal-guide-overlay { padding: 0; place-items: stretch; }
  .portal-guide-dialog { width: 100%; max-height: 100vh; min-height: 100vh; border-radius: 0; box-shadow: none; }
  .portal-guide-header { min-height: 62px; padding: 9px 12px; }
  .portal-guide-header img { width: 38px; height: 38px; }
  .portal-guide-progress { padding: 10px 8px; }
  .portal-guide-progress li { gap: 4px; flex-direction: column; }
  .portal-guide-progress li + li::before { right: calc(50% + 18px); left: calc(-50% + 18px); top: 14px; }
  .portal-guide-progress span { width: 28px; height: 28px; flex-basis: 28px; }
  .portal-guide-progress b { font-size: 9px; }
  .portal-guide-body { min-height: 0; }
  .portal-guide-layout { min-height: 0; padding: 20px 16px 34px; grid-template-columns: 1fr; gap: 20px; }
  .portal-guide-phone { width: min(68vw, 230px); border-width: 6px; border-radius: 28px; }
  .portal-guide-phone-bar { height: 50px; padding-top: 14px; }
  .portal-guide-member { min-height: 58px; grid-template-columns: 38px minmax(0, 1fr) 22px; }
  .portal-guide-member img, .portal-guide-avatar { width: 38px; height: 38px; }
  .portal-guide-copy h2 { margin: 6px 0 10px; font-size: 23px; }
  .portal-guide-lead { margin-bottom: 12px; font-size: 12px; }
  .portal-guide-mini-steps { margin: 12px 0 14px; gap: 8px; }
  .portal-guide-mini-steps p { font-size: 12px; }
  .portal-guide-actions { display: grid; grid-template-columns: 1fr; }
  .portal-guide-actions .portal-button { width: 100%; }
  .portal-guide-code code { font-size: 12px; }
  .portal-guide-password > div { grid-template-columns: 1fr; }
  .portal-action-form { min-height: calc(100vh - 62px); }
  .portal-action-layout { grid-template-columns: 1fr; align-content: start; }
  .portal-action-visual { min-height: 126px; padding: 12px 16px; }
  .portal-action-character { grid-template-columns: 82px minmax(0, 1fr); gap: 12px; }
  .portal-action-character img { width: 82px; height: 108px; }
  .portal-action-character span { text-align: left; }
  .portal-action-symbol { grid-template-columns: 64px minmax(0, 1fr); gap: 12px; }
  .portal-action-symbol b { width: 64px; height: 64px; border-radius: 20px 20px 20px 7px; font-size: 20px; }
  .portal-action-symbol span { text-align: left; }
  .portal-action-copy { padding: 24px 16px; overflow: visible; }
  .portal-action-copy h2 { font-size: 22px; }
  .portal-field-grid, .portal-choice-grid, .portal-choice-grid.two { grid-template-columns: 1fr; }
  .portal-choice-grid label > span { min-height: 74px; }
  .portal-action-facts > div { grid-template-columns: 92px minmax(0, 1fr); }
  .portal-action-footer { position: sticky; bottom: 0; z-index: 2; padding-bottom: max(12px, env(safe-area-inset-bottom)); }
  .portal-action-footer .portal-button { flex: 1 1 0; min-width: 0; padding-inline: 10px; }
  .portal-loading-shell { min-height: calc(100vh - 210px); padding: 16px 12px; }
  .portal-loading-shell.standalone { min-height: 100vh; }
  .portal-loading-status, .portal-loading-error { min-height: 44px; }
}

@media (max-width: 380px) {
  .portal-sidebar { width: 100%; min-width: 0; box-sizing: border-box; padding-inline: 12px; }
  .portal-account { min-width: 0; flex: 0 1 auto; }
  .portal-account button { min-width: 70px; max-width: 100%; box-sizing: border-box; }
  .portal-topbar h1 { max-width: 120px; }
  .portal-overview-actions .overview-primary { width: calc(100% - 52px); padding-inline: 10px; }
  .portal-language-picker { grid-template-columns: 1fr 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}

/* ===========================================================================
   HQ UI/UX 凍結仕様 v1.0 — CV-SPEC-COTOA-ACCOUNT-UIUX-20260828
   §4.0 未認証画面クローム / §8.3 タイポグラフィ最小値
   =========================================================================== */

/* §8.3 本文 14px 未満・補助 12px 未満を作らない（P1: 40〜60代を前提） */
.portal-brand small { font-size: 12px; }
.portal-first-registration span,
.portal-first-registration p,
.portal-muted,
.portal-safety-note span,
.portal-field-note { font-size: 14px; line-height: 1.7; }
.portal-login-card small,
.portal-public-footer { font-size: 12px; }

/* 未認証画面のヘッダー：ブランドと言語切替を常設する（§4.0 U-3） */
.portal-public-header {
  width: min(420px, 100%);
  margin: 0 auto 12px;
  padding: 4px 2px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.portal-public-language { display: flex; align-items: center; gap: 8px; }
.portal-public-language label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
.portal-public-language select {
  min-height: 44px;
  padding: 6px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--paper);
  color: var(--ink);
  font-size: 14px;
}

/* 未認証画面のフッター：法定表示と問い合わせを常設する（§4.0 U-4 / U-5） */
.portal-public-footer {
  width: min(420px, 100%);
  margin: 14px auto 24px;
  padding: 14px 2px 0;
  border-top: 1px solid var(--line);
}
.portal-legal-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 16px;
}
.portal-legal-links a,
.portal-legal-links .portal-text-button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  color: var(--primary-deep);
  font-size: 12px;
  font-weight: 750;
}

/* §9.3 特定商取引法に基づく表記は、外部文書に依存せず画面内に表示する */
.portal-legal-notice { margin-top: 6px; }
.portal-legal-notice > summary {
  min-height: 44px;
  display: flex;
  align-items: center;
  color: var(--primary-deep);
  font-size: 12px;
  font-weight: 750;
  cursor: pointer;
}
.portal-legal-rows { margin: 8px 0 0; display: grid; gap: 8px; }
.portal-legal-rows > div {
  display: grid;
  grid-template-columns: minmax(0, 8em) minmax(0, 1fr);
  gap: 4px 12px;
}
.portal-legal-rows dt { color: var(--muted); font-size: 12px; font-weight: 750; }
.portal-legal-rows dd { margin: 0; color: var(--ink); font-size: 13px; line-height: 1.7; }
.portal-legal-pending { margin-top: 10px; display: grid; gap: 4px; }

/* §4.2 みなし同意の明示（LR-5） */
.portal-consent-note {
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--canvas);
  color: var(--ink);
  font-size: 13px;
  line-height: 1.75;
}
.portal-consent-note a { color: var(--primary-deep); font-weight: 750; }

/* 入力欄に関連付ける補足文（§4.4 A-4） */
.portal-field-note {
  margin: -6px 0 4px;
  color: var(--muted);
}

/* §4.1 新規登録ブロックはログインの下位に置く */
.portal-first-registration strong { display: block; font-size: 16px; }

@media (min-width: 720px) {
  .portal-public-header,
  .portal-public-footer { width: min(520px, 100%); }
}

/* CS-07 遷移先のリード文（廃止したショートカット群の補足説明を保持） */
.portal-view-lead {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

/* §8.4 単色SVGアイコン。currentColor に追従し、拡大しても字形が崩れない。 */
.portal-icon { display: inline-block; vertical-align: -.18em; flex: 0 0 auto; }
.portal-text-button { display: inline-flex; align-items: center; gap: .35em; }
.portal-management-item b { display: inline-flex; align-items: center; gap: .3em; }

/* §9 製品別の特定商取引法に基づく表記への導線 */
.portal-legal-products { margin-top: 10px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; }
.portal-legal-products span { color: var(--muted); font-size: 12px; font-weight: 700; }
.portal-legal-products a { min-height: 44px; display: inline-flex; align-items: center; color: var(--primary-deep); font-size: 12px; font-weight: 750; }

/* §9.3 特商法の単独ページへの導線（印刷・共有用） */
.portal-legal-standalone { display: inline-flex; align-items: center; min-height: 44px; margin-top: 6px; color: var(--primary-deep); font-size: 12px; font-weight: 750; }

/* 規約 附則2項・3項 同意確認画面 */
.portal-consent-card .portal-consent-meta { display: flex; flex-wrap: wrap; gap: 8px 22px; margin: 4px 0 14px; }
.portal-consent-meta > div { display: flex; align-items: baseline; gap: 8px; }
.portal-consent-meta span { color: var(--muted); font-size: 12px; font-weight: 700; }
.portal-consent-meta strong { font-size: 14px; font-variant-numeric: tabular-nums; }
.portal-consent-points { margin: 0 0 14px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--canvas); }
.portal-consent-points > strong { display: block; margin-bottom: 6px; font-size: 14px; }
.portal-consent-points p { margin: 0 0 8px; font-size: 13px; }
.portal-consent-points ol { margin: 0; padding-left: 1.3em; }
.portal-consent-points li { margin-bottom: 6px; font-size: 14px; line-height: 1.75; }
.portal-consent-points li:last-child { margin-bottom: 0; }

/* 第15条2項 規約変更の予告掲示 */
.portal-terms-notice {
  margin: 0 0 18px; padding: 14px 16px; border: 1px solid var(--amber);
  border-left-width: 4px; border-radius: 12px; background: var(--amber-soft);
  display: grid; gap: 6px; justify-items: start;
}
.portal-terms-notice strong { color: var(--amber); font-size: 15px; }
.portal-terms-notice span { font-size: 14px; line-height: 1.7; }

/* ===========================================================================
   デザイン再構築 v1.0 — CV-SPEC-COTOA-ACCOUNT-DESIGN-20260830
   §5 間隔と階層のトークン / §2 課金の正当性
   =========================================================================== */

:root {
  /* §5.1 間隔。4の倍数に統一する（現行は 15px 13px 8px が個別に散っていた） */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
}

/* §5.3 数値は桁を揃える。金額・日付・件数が並ぶ場面で読み違えを防ぐ */
.portal-num, .portal-money strong, .portal-money b,
.portal-invoice-row strong, .portal-contract-facts strong {
  font-variant-numeric: tabular-nums;
}

/* §5.2 第1階層 ─ 判断に必要な要約。影を1段だけ持たせて浮かせる */
.portal-money {
  padding: var(--space-5);
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--paper);
  box-shadow: 0 1px 2px rgba(23, 32, 51, .06), 0 8px 20px -14px rgba(23, 32, 51, .25);
  display: grid;
  gap: var(--space-3);
}
.portal-money h2 { margin: 0; font-size: 16px; }

/* 自動請求の有無を最初に言い切る（§2.1 P-1 / 監査 L-1） */
.portal-money-headline { display: grid; gap: var(--space-1); }
.portal-money-headline strong { font-size: 20px; font-weight: 850; line-height: 1.45; }
.portal-money-headline span { color: var(--muted); font-size: 14px; line-height: 1.7; }
.portal-money-headline.is-auto strong { font-size: 24px; }

.portal-money-row {
  display: flex; flex-wrap: wrap; align-items: baseline;
  justify-content: space-between; gap: var(--space-2);
  padding-top: var(--space-3); border-top: 1px solid var(--line);
}
.portal-money-row > span { color: var(--muted); font-size: 14px; font-weight: 700; }
.portal-money-row > strong { font-size: 16px; font-weight: 850; }

/* §5.2 第3階層 ─ 明細の行。罫線だけで区切る */
.portal-money-lines { padding-top: var(--space-3); border-top: 1px solid var(--line); display: grid; gap: var(--space-2); }
.portal-money-line {
  display: flex; flex-wrap: wrap; align-items: baseline;
  justify-content: space-between; gap: var(--space-2);
  font-size: 14px; line-height: 1.7;
}
.portal-money-line b { font-size: 16px; font-weight: 850; font-variant-numeric: tabular-nums; }

/* §2.1 P-5 未確定は、理由と次の行動を必ず添えて出す（監査 L-3） */
.portal-amount-pending { display: grid; gap: 2px; justify-items: end; text-align: right; }
.portal-amount-pending b { color: var(--amber); font-size: 15px; font-weight: 850; }
.portal-amount-pending small { color: var(--muted); font-size: 12px; line-height: 1.6; max-width: 30ch; }

/* §3.1 HM-4 ホームのお金1行 */
.portal-money-line-home {
  width: 100%; margin-bottom: var(--space-5);
  padding: var(--space-4) var(--space-5);
  border: 1px solid var(--line); border-radius: 14px;
  background: var(--paper); text-align: left;
  box-shadow: 0 1px 2px rgba(23, 32, 51, .06), 0 8px 20px -14px rgba(23, 32, 51, .25);
  display: grid; gap: var(--space-1);
}
.portal-money-line-home > span { color: var(--muted); font-size: 12px; font-weight: 800; letter-spacing: .04em; }
.portal-money-line-home > strong { font-size: 17px; font-weight: 850; }
.portal-money-line-home > small { color: var(--muted); font-size: 13px; }
.portal-money-line-home > b {
  margin-top: var(--space-1); color: var(--primary-deep);
  font-size: 13px; font-weight: 800; display: inline-flex; align-items: center; gap: .3em;
}

/* §3.1 HM-3 正常な項目は折り畳む。件数は必ず見せる（監査 C-2） */
.portal-management-rest { margin-top: var(--space-3); }
.portal-management-rest > summary {
  min-height: 44px; display: flex; align-items: center;
  color: var(--primary-deep); font-size: 13px; font-weight: 800; cursor: pointer;
}
.portal-management-rest > summary::marker { color: var(--muted); }
.portal-management-rest .portal-management-grid { margin-top: var(--space-3); }

/* §2.2 無料テストは、残り日数・終了日・課金されない事実を同じ視野に置く */
.portal-trial-status { margin-top: var(--space-2); display: grid; gap: 2px; }
.portal-trial-ends { color: var(--muted); font-size: 13px; font-weight: 700; }
.portal-trial-safe { color: var(--teal); font-size: 13px; font-weight: 750; }

/* §2.1 P-2 税込は明細全体の注記として1回だけ出す（CS体験監査 E-1） */
.portal-money-tax { margin: var(--space-2) 0 0; color: var(--muted); font-size: 13px; }

/* §3.1 ホームの製品一覧は状態の要約に徹する（操作は利用中サービスで行う） */
.portal-home-product {
  display: flex; align-items: center; gap: var(--space-3);
  padding: var(--space-3) 0; border-top: 1px solid var(--line);
}
.portal-home-product img { flex: 0 0 auto; border-radius: 8px; }
.portal-home-product > span { flex: 1 1 auto; min-width: 0; font-size: 14px; font-weight: 700; }
.portal-home-services > .portal-button { margin-top: var(--space-4); width: 100%; }
.portal-home-new-service { margin-top: 12px; }
.portal-home-new-service > summary {
  min-height: 48px; padding: 0 16px; border: 1px solid var(--line); border-radius: 8px;
  color: var(--primary-deep); background: var(--paper); display: flex; align-items: center;
  font-weight: 800; cursor: pointer;
}
.portal-home-new-service[open] > summary { border-color: #b9e4d8; border-radius: 8px 8px 0 0; }
.portal-home-new-service > .portal-muted { margin: 10px 4px; }
.portal-home-new-service .portal-trials { margin-top: 0; }

/* .portal-management-grid の display:grid が、閉じた <details> の非表示を上書きしてしまう。
   閉じている間は明示的に隠す（CS体験監査で検出）。 */
.portal-management-rest:not([open]) .portal-management-grid { display: none; }

/* ブランドはホームへの導線（HQ指摘 2026-08-30） */
button.portal-brand { width: 100%; padding: 0; border: 0; background: transparent; text-align: left; cursor: pointer; }
button.portal-brand:hover strong { color: var(--primary); }
@media (max-width: 980px) {
  .portal-sidebar { gap: 12px; }
  .portal-sidebar > button.portal-brand { width: auto; flex: 1 1 0; min-width: 0; }
  .portal-sidebar > button.portal-brand > span { min-width: 0; overflow-wrap: anywhere; }
  .portal-sidebar > .portal-account { flex: 0 0 auto; }
}

/* 認証済みシェルでも法定表示フッターを出す（凍結仕様 §5.1 / CS採点監査 B-1） */
.portal-shell .portal-public-footer { width: min(920px, 100%); margin: var(--space-6) auto 96px; }
.portal-loading-error .portal-actions { margin-top: var(--space-3); display: flex; flex-wrap: wrap; gap: var(--space-2); }
