/* ページごとの規則（app.css の土台・枠・共通の部品の上に足す）。
   Task 2〜6 で、各ページを作り直すときに、そのページの分をここに書く。 */

/* ==========================================================================
   ログイン前の画面（ログイン・コード・リカバリー・招待・エラー）
   ========================================================================== */
.app-auth-title { margin: 0 0 8px; font-size: 1.375rem; font-weight: 700; line-height: 1.45; letter-spacing: 0.01em; }
.app-auth-lead { margin: 0 0 20px; font-size: 0.875rem; line-height: 1.7; color: var(--brand-mute); }
.app-auth-card--center { text-align: center; }
.app-auth-card .app-button-full { width: 100%; box-sizing: border-box; justify-content: center; text-decoration: none; }
.app-auth-card .app-button-icon { gap: 8px; align-items: center; }
.app-auth-card .app-button-icon .app-icon { width: 20px; height: 20px; }
.app-auth-card .app-form-stack { margin-top: 20px; }
.app-auth-card .dads-notification-banner { margin: 0 0 20px; }
.app-auth-card .app-help { margin-top: 20px; text-align: left; }
.app-auth-card .app-help a { color: var(--color-key-900); text-decoration: underline; text-decoration-color: var(--color-key-300); text-underline-offset: 3px; }
.app-auth-card .app-webauthn { margin: 20px 0 0; }
.app-auth-card .app-webauthn__unsupported,
.app-auth-card .app-webauthn__status { margin: 12px 0 0; font-size: 0.8125rem; text-align: center; }
.app-auth-card .app-webauthn__unsupported { color: var(--brand-mute); }
.app-auth-action { margin: 20px 0 0; }

/* 箱の下の一言（招待制） */
.app-auth-after { margin: 20px 0 0; max-width: 420px; font-size: 0.8125rem; line-height: 1.7; color: var(--brand-mute); text-align: center; }

/* ← パスキーでログイン */
.app-auth-back { margin: 0 0 16px; font-size: 0.8125rem; }
.app-auth-back a { color: var(--brand-mute); text-decoration: none; }
.app-auth-back a:hover { color: var(--color-key-900); text-decoration: underline; text-underline-offset: 3px; }

/* 上のアイコン（メール） */
.app-auth-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin: 0 0 16px;
  border-radius: 12px;
  background: var(--color-key-100);
  color: var(--color-key-900);
}
.app-auth-icon .app-icon { width: 22px; height: 22px; }

/* コードの欄：大きな等幅の数字を中央に */
.app-auth-card .app-code-input {
  max-width: none;
  font-family: var(--font-family-mono);
  font-size: 1.5rem;
  font-weight: 500;
  letter-spacing: 0.4em;
  text-align: center;
  text-indent: 0.4em;
}
.app-recovery-input { font-family: var(--font-family-mono); letter-spacing: 0.08em; }
.app-recovery-input::placeholder { color: var(--brand-mute); }

/* 招待の状態の箱 */
.app-status-box {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin: 20px 0 0;
  padding: 16px;
  border-radius: 10px;
  text-align: left;
  font-size: 0.875rem;
  line-height: 1.7;
}
.app-status-box__icon { flex: none; display: inline-flex; margin-top: 2px; }
.app-status-box__icon .app-icon { width: 20px; height: 20px; }
.app-status-box__text { min-width: 0; }
.app-status-box__title { margin: 0 0 4px; font-weight: 700; }
.app-status-box__body { margin: 0; font-weight: 400; }
.app-status-box--warn { background: var(--color-primitive-yellow-50); color: var(--color-primitive-yellow-1000); }
.app-status-box--brand { background: var(--color-key-100); color: var(--brand-ink); }
.app-status-box--brand .app-status-box__icon { color: var(--color-key-900); }
.app-status-box--ok { background: var(--color-primitive-green-50); color: var(--color-primitive-green-800); }

/* 回転の印（動きを減らす設定では回さない） */
.app-spinner {
  width: 28px;
  height: 28px;
  margin: 8px auto 16px;
  border: 3px solid var(--color-key-200);
  border-top-color: var(--color-key-900);
  border-radius: 50%;
  animation: app-spin 0.9s linear infinite;
}
@keyframes app-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .app-spinner { animation: none; border-top-color: var(--color-key-200); border-right-color: var(--color-key-900); }
}
.app-auth-card--center #invite-status,
.app-auth-card--center #invite-unusable,
.app-auth-card--center #invite-retry { margin: 0; font-size: 0.875rem; line-height: 1.7; color: var(--brand-mute); }
.app-auth-card--center #invite-unusable,
.app-auth-card--center #invite-retry { text-align: left; }

/* 誤りの画面の番号（大きく淡い灰） */
.app-error-code {
  margin: 0 0 4px;
  font-size: 4.5rem;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: 0.02em;
  color: #D3D3DC;
}
.app-auth-card--center .app-auth-lead { margin-bottom: 24px; }

@media (max-width: 480px) {
  .app-error-code { font-size: 3.5rem; }
}

/* ==========================================================================
   登録の流れ（同意・パスキー・認証アプリ・リカバリーコード・完了・登録し直し・再同意）
   ========================================================================== */

/* 欄（app.css の .app-field の大きさを DADS の data-size より優先する）。select も幅いっぱい。 */
.dads-form-control-label.app-field .dads-form-control-label__label { font-size: 0.8125rem; line-height: 1.5; }
.dads-form-control-label.app-field .dads-form-control-label__support-text { margin: 0; font-size: 0.75rem; line-height: 1.5; color: var(--brand-mute); }
/* 入力欄の下の説明は、欄との間を 6px あける（詰めると欄の一部に見える）。ラベルの下の説明は今のまま */
.dads-form-control-label.app-field .dads-form-control-label__field .dads-form-control-label__support-text { margin-top: 6px; }
.app-field .dads-select__control { width: 100%; }
.app-field .dads-input-text__error-text,
.app-field .dads-select__error-text,
.app-field .dads-textarea__error-text { font-size: 0.8125rem; }

/* 進み具合（3 段）。番号の丸は飾り。済んだ段は紫の塗りに白の印、今の段は紫の枠。 */
.app-steps {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 24px;
  padding: 0;
  list-style: none;
  font-size: 0.75rem;
  line-height: 1.4;
  color: var(--brand-mute);
}
.app-steps__item { display: flex; align-items: center; gap: 6px; min-width: 0; }
.app-steps__item + .app-steps__item::before {
  content: "";
  flex: none;
  width: 24px;
  height: 2px;
  margin-right: 2px;
  border-radius: 1px;
  background: #DADAE2;
}
.app-steps__item.is-done + .app-steps__item::before { background: var(--color-key-900); }
.app-steps__num {
  flex: none;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: 22px;
  height: 22px;
  border: 1.5px solid #C9C9D2;
  border-radius: 50%;
  font-size: 0.6875rem;
  font-weight: 700;
  background: var(--app-surface);
}
.app-steps__item[aria-current="step"] { color: var(--brand-ink); font-weight: 700; }
.app-steps__item[aria-current="step"] .app-steps__num { border-color: var(--color-key-900); color: var(--color-key-900); }
.app-steps__item.is-done .app-steps__num { border-color: var(--color-key-900); background: var(--color-key-900); color: transparent; }
.app-steps__item.is-done .app-steps__num::after {
  content: "";
  position: absolute;
  left: 7px;
  top: 3px;
  width: 4px;
  height: 9px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.app-steps__label { white-space: nowrap; }
@media (forced-colors: active) {
  .app-steps__item.is-done .app-steps__num { color: CanvasText; }
  .app-steps__item.is-done .app-steps__num::after { display: none; }
}

/* 見出しの左に印（パスキーの登録・登録し直し） */
.app-auth-head { display: flex; gap: 16px; align-items: flex-start; margin: 0; }
.app-auth-head .app-auth-icon { flex: none; margin: 0; }
.app-auth-head__text { min-width: 0; }
.app-auth-head .app-auth-lead { margin-bottom: 0; }
.app-auth-head + .dads-notification-banner.app-callout { margin-top: 20px; }
.app-auth-remaining {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 2px 0 0;
  font-size: 0.8125rem;
  color: var(--brand-mute);
}

/* 本文の下の小さな道 */
.app-auth-card .app-help a { overflow-wrap: anywhere; }
.app-auth-foot { margin-top: 20px; }

/* 見出しのすぐ下の誤りの要約・まとまりは少しあける */
.app-auth-title + .app-invite-meta,
.app-auth-title + .dads-notification-banner.app-callout { margin-top: 16px; }

/* 招待先と期限のまとまり */
.app-invite-meta {
  display: flex;
  gap: 12px;
  align-items: center;
  margin: 0 0 18px;
  padding: 12px 14px;
  border: 1px solid var(--app-line);
  border-radius: 10px;
}
.app-invite-meta__icon {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--color-key-50);
  color: var(--color-key-900);
}
.app-invite-meta__icon .app-icon { width: 16px; height: 16px; }
.app-invite-meta__text { margin: 0; min-width: 0; font-size: 0.8125rem; line-height: 1.6; overflow-wrap: anywhere; }
.app-invite-meta__text strong { font-weight: 700; }
.app-invite-meta__sub { display: block; color: var(--brand-mute); }

/* 規約の要点（淡い灰の箱。全文のリンクも中に置く） */
.app-terms-box {
  margin: 0 0 22px;
  padding: 14px 16px;
  border: 1px solid var(--app-line);
  border-radius: 10px;
  background: var(--app-bg);
}
.app-terms-box__title { margin: 0; font-size: 0.8125rem; font-weight: 700; line-height: 1.5; }
.app-terms-box__list { margin: 8px 0; padding-left: 1.25em; font-size: 0.8125rem; line-height: 1.7; color: var(--app-ink-2); }
.app-terms-box__list li { margin: 2px 0; }
.app-terms-box__link { margin: 0; font-size: 0.8125rem; }
.app-terms-box__link a {
  color: var(--color-key-900);
  text-decoration: underline;
  text-decoration-color: var(--color-key-300);
  text-underline-offset: 3px;
  overflow-wrap: anywhere;
}

/* 同意のチェック：区切り線のあと、文の左にボックス */
.app-checks { display: flex; flex-direction: column; gap: 8px; padding-top: 18px; border-top: 1px solid var(--app-line); }
.dads-checkbox.app-check { display: block; width: auto; padding: 0; }
.app-check .dads-checkbox__label {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 0.84375rem;
  line-height: 1.6;
  color: var(--brand-ink);
  cursor: pointer;
}
.app-check .dads-checkbox__checkbox { flex: none; top: 0; margin: -5px 0 0 -4px; }
.app-check__text { min-width: 0; padding-top: 1px; }
/* 誤りの文は、チェックの文の頭（箱 32px − 4px ＋ 間 10px）にそろえる */
.app-check .dads-form-control-label__error-text { margin: 4px 0 0 38px; font-size: 0.8125rem; }
/* 枠で囲む同意（カードの追加・自動チャージ）。箱は 4px 左にはみ出す作りなので、枠の内側に左右 16px をとる。
   .dads-checkbox.app-check の padding: 0 より強くする（同じ 2 クラスの後ろに置く） */
.dads-checkbox.app-check--box { padding: 14px 16px; border: 1px solid var(--app-line-strong); border-radius: 8px; background: var(--app-surface); }
.dads-checkbox.app-check--box:has(.dads-checkbox__input[aria-invalid="true"]) { border-color: var(--color-semantic-error-1); }
/* 自動チャージの同意：目立たせる（青い 2px の縁・薄い青の背景・大きなチェック・太字）。未チェックで送ると赤い縁（上の aria-invalid） */
.dads-checkbox.app-check--strong { padding: 16px 18px; border: 2px solid var(--color-key-900); background: var(--color-key-50); }
.dads-checkbox.app-check--strong:has(.dads-checkbox__input[aria-invalid="true"]) { border-color: var(--color-semantic-error-1); background: var(--color-primitive-red-50); }
.app-check--strong .dads-checkbox__label { font-size: 0.9375rem; font-weight: 700; }
.app-check--strong .dads-checkbox__label { align-items: center; }
.app-check--strong .dads-checkbox__checkbox { margin: 0 0 0 -4px; }
.app-check--strong .app-check__text { padding-top: 0; }
.app-checks + .app-button-full,
.app-form-stack > .app-check + .app-button-full { margin-top: 6px; }

/* 警告の淡い黄色の面（DADS の帯の構造と role はそのまま） */
.dads-notification-banner.app-callout {
  grid-template-columns: 20px 1fr;
  grid-template-rows: auto;
  column-gap: 12px;
  row-gap: 2px;
  margin: 0 0 20px;
  padding: 12px 14px;
  border: 0;
  border-radius: 10px;
  font-size: 0.8125rem;
  line-height: 1.65;
}
.dads-notification-banner.app-callout--warn { background: var(--color-primitive-yellow-50); color: var(--color-primitive-yellow-1000); }
.app-callout .dads-notification-banner__icon { width: 20px; height: 20px; margin: 1px 0 0; padding: 0; color: var(--color-primitive-yellow-900); }
.app-callout .dads-notification-banner__heading-text { padding-top: 0; font-size: 0.84375rem; line-height: 1.6; color: #5C3D00; }
.app-callout .dads-notification-banner__body { grid-column: 2; }
.app-callout .dads-notification-banner__body p { margin: 0; color: #5C3D00; }
@media (forced-colors: active) {
  .dads-notification-banner.app-callout { border: 1px solid CanvasText; }
}

/* 認証アプリ：QR を左、手順を右 */
.app-totp { display: grid; grid-template-columns: 168px minmax(0, 1fr); gap: 24px; align-items: start; margin: 0 0 4px; }
.app-totp__qr {
  display: block;
  box-sizing: border-box;
  width: 168px;
  height: 168px;
  padding: 8px;
  border: 1px solid var(--app-line);
  border-radius: 10px;
  background: #fff;
  image-rendering: pixelated;
}
.app-totp__steps { margin: 0; padding: 0; list-style: none; counter-reset: app-totp; }
.app-totp__step { position: relative; counter-increment: app-totp; padding-left: 32px; margin: 0 0 16px; font-size: 0.84375rem; line-height: 1.65; }
.app-totp__step:last-child { margin-bottom: 0; }
.app-totp__step::before {
  content: counter(app-totp);
  position: absolute;
  left: 0;
  top: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--color-key-50);
  color: var(--color-key-1000);
  font-size: 0.6875rem;
  font-weight: 700;
}
.app-totp__step > p { margin: 0; }
.app-totp__key-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 6px; }
.app-totp__key {
  padding: 6px 10px;
  border-radius: 6px;
  background: var(--app-hover);
  font-family: var(--font-family-mono);
  font-size: 0.8125rem;
  letter-spacing: 0.06em;
  overflow-wrap: anywhere;
}
.app-copy-status { margin: 6px 0 0; font-size: 0.8125rem; }
.app-totp__step .app-form-stack { margin-top: 0; }
.app-totp__step .app-help { margin-top: 8px; }

/* ボタンの中の印（どの枠でも） */
.dads-button.app-button-icon { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.dads-button.app-button-icon[data-size="sm"] { gap: 6px; }
/* JS が出すまで隠すボタン（コピーなど）。display の指定より hidden を優先する */
.dads-button[hidden] { display: none; }
.app-webauthn .app-button-full { width: 100%; box-sizing: border-box; }

/* リカバリーコードの箱：見出しに数・コピー・保存。コードは番号付きで 2 列（列ごとに上から）。
   1 行におよそ 200px 要るので、列の幅を 13rem より狭くしない（入らなければ 1 列になる）。
   箱は overflow で切らない（角の丸みは見出しの地にも付ける）。 */
.app-codes-box { margin: 0 0 18px; border: 1px solid var(--app-line); border-radius: 10px; background: var(--app-surface); }
.app-codes-box__head {
  border-radius: 9px 9px 0 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px 8px 14px;
  border-bottom: 1px solid var(--app-line);
  background: var(--app-bg);
}
.app-codes-box__title { font-size: 0.75rem; font-weight: 700; color: var(--brand-mute); }
.app-codes-box__actions { display: flex; flex-wrap: wrap; gap: 6px; }
.app-codes-box__actions[hidden] { display: none; }
.app-codes {
  margin: 0;
  padding: 14px 18px;
  list-style: none;
  counter-reset: app-code;
  columns: 2 13rem;
  column-gap: 24px;
}
.app-codes li { counter-increment: app-code; break-inside: avoid; padding: 3px 0; white-space: nowrap; }
.app-codes li::before {
  content: counter(app-code, decimal-leading-zero);
  display: inline-block;
  width: 2em;
  margin-right: 8px;
  color: #9AA3A7;
  font-family: var(--font-family-mono);
  font-size: 0.6875rem;
}
.app-codes code { font-family: var(--font-family-mono); font-size: 0.875rem; letter-spacing: 0.04em; }
.app-recovery .app-status { margin: 0 0 12px; font-size: 0.8125rem; }

/* 登録の完了 */
.app-done { align-items: center; margin: 0 0 20px; padding: 14px 16px; }
.app-done .app-status-box__icon { margin: 0; }
.app-done .app-status-box__icon .app-icon { width: 22px; height: 22px; }
.app-done__title { margin: 0; font-size: 1.375rem; font-weight: 700; line-height: 1.45; color: var(--brand-ink); }
.app-done__sub { margin: 0 0 6px; font-size: 0.9375rem; font-weight: 700; line-height: 1.5; }
.app-choice { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 0 0 20px; padding: 0; list-style: none; }
.app-choice__item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--app-line);
  border-radius: 10px;
  font-size: 0.8125rem;
  line-height: 1.5;
}
.app-choice__icon { display: inline-flex; margin-bottom: 6px; color: var(--color-key-900); }
.app-choice__icon .app-icon { width: 20px; height: 20px; }
.app-choice__name { font-weight: 700; }
.app-choice__note { color: var(--brand-mute); }
.app-auth-buttons { display: flex; flex-wrap: wrap; gap: 10px; }
.app-auth-buttons .dads-button { box-sizing: border-box; justify-content: center; text-decoration: none; }
.app-auth-buttons .dads-button[data-type="solid-fill"] { flex: 1 1 220px; }
.app-auth-buttons .dads-button[data-type="outline"] { flex: 0 1 auto; }

/* 再同意：箱の下の小さなログアウト（.app-logout と同じ見た目） */
.app-auth__main > .app-logout { margin: 16px 0 0; }

@media (max-width: 560px) {
  .app-totp { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .app-totp__qr { margin: 0 auto; }
  .app-steps { gap: 6px; }
}
@media (max-width: 480px) {
  /* 狭い幅では、今の段だけ文字を見せる（ほかの段の文字は読み上げにだけ残す） */
  .app-steps__item:not([aria-current="step"]) .app-steps__label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
  }
  .app-steps__item + .app-steps__item::before { width: 20px; }
  .app-choice { grid-template-columns: minmax(0, 1fr); }
  .app-auth-buttons .dads-button { flex: 1 1 100%; }
  .app-auth-head { gap: 12px; }
}

/* ホーム：はじめに・タイル・接続先 */
.app-onboarding { margin: 0 0 18px; }
.app-onboarding__head { align-items: flex-start; }
.app-onboarding__side { flex: none; display: flex; align-items: center; gap: 8px; }
.app-progress-text { font-size: 0.75rem; color: var(--brand-mute); white-space: nowrap; }
.app-onboarding__toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--app-radius-control);
  color: var(--app-ink-2);
  font-weight: 700;
  list-style: none;
  cursor: pointer;
}
.app-onboarding__toggle::-webkit-details-marker { display: none; }
.app-onboarding__toggle::marker { content: ""; }
@media (hover: hover) {
  .app-onboarding__toggle:hover { background: var(--app-hover); }
}
.app-onboarding__steps {
  counter-reset: onboarding;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
  padding: 20px;
  list-style: none;
}
.app-onboarding__step {
  counter-increment: onboarding;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  padding: 14px 16px;
  border: 1px solid var(--app-line);
  border-radius: var(--app-radius-control);
}
.app-onboarding__step.is-current { border: 2px solid var(--color-key-900); padding: 13px 15px; }
.app-onboarding__top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.app-onboarding__mark {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border: 1.5px solid var(--app-line-strong);
  border-radius: 50%;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1;
}
.app-onboarding__mark:empty::before { content: counter(onboarding); }
/* 完了は緑の ✓（番号の代わり）と「完了」の札 */
.app-onboarding__step--done .app-onboarding__mark { border-color: var(--color-primitive-green-700); background: var(--color-primitive-green-700); color: #fff; }
.app-onboarding__step--done .app-onboarding__mark:empty::before { content: "✓"; }
.app-onboarding__state--done { color: var(--color-primitive-green-800); font-weight: 700; }
.app-onboarding__state { font-size: 0.75rem; color: var(--brand-mute); white-space: nowrap; }
.app-onboarding__label { margin: 0; font-size: 0.875rem; font-weight: 700; line-height: 1.5; overflow-wrap: anywhere; }
.app-onboarding__step--skipped .app-onboarding__label,
.app-onboarding__step--soon .app-onboarding__label { color: var(--brand-mute); }
.app-onboarding__note { margin: 0; }
.app-onboarding__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: auto; padding-top: 6px; }
.app-onboarding__actions form { margin: 0; }
.app-onboarding__actions .dads-button { text-decoration: none; white-space: nowrap; }
.app-onboarding__off { display: inline-flex; align-items: center; gap: 6px; font-size: 0.8125rem; color: var(--app-off); cursor: default; }
.app-onboarding__off .app-sidenav__soon { margin-left: 0; }

.app-home-tiles {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin: 0 0 18px;
  padding: 0;
  list-style: none;
}
.app-home-tile { min-width: 0; margin: 0; padding: 16px 20px; }
.app-home-tile__link { display: block; margin: -16px -20px; padding: 16px 20px; color: inherit; text-decoration: none; }
.app-home-tile__link:hover .app-home-tile__value { text-decoration: underline; }
.app-home-tile__label { display: flex; align-items: center; gap: 6px; margin: 0; font-size: 0.8125rem; color: var(--brand-mute); }
.app-home-tile__label .app-icon { width: 16px; height: 16px; color: var(--app-icon); }
.app-home-tile__label .app-sidenav__soon { margin-left: 4px; }
.app-home-tile__value { margin: 6px 0 0; font-size: 1.25rem; font-weight: 700; line-height: 1.4; overflow-wrap: anywhere; }
.app-home-tile--off .app-home-tile__value { color: var(--app-off); }
.app-home-connect__list { display: grid; grid-template-columns: max-content minmax(0, 1fr); align-items: center; gap: 12px 16px; margin: 0; }
.app-home-connect__list dt { font-size: 0.8125rem; font-weight: 700; color: var(--brand-mute); }
.app-home-connect__list dd { min-width: 0; margin: 0; }
.app-home-connect__list .app-code { margin: 0; }
/* 1 行の URL がコピーのボタンの下に潜らないよう、右に余白を取る */
.app-home-connect__list .app-code__pre,
.app-home-connect__list .app-code--copy .app-code__pre { padding-top: 12px; padding-right: 112px; }
.app-home-links { display: flex; flex-wrap: wrap; gap: 8px 20px; margin: 16px 0 0; padding: 0; list-style: none; font-size: 0.875rem; }
.app-home-links a { font-weight: 700; }
@media (max-width: 768px) {
  .app-onboarding__steps { grid-template-columns: minmax(0, 1fr); padding: 16px; }
  .app-home-tiles { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .app-home-connect__list { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .app-home-connect__list dd + dt { margin-top: 8px; }
  /* 狭い画面では URL の横に余白を取る幅がないので、ほかのコードブロックと同じくボタンを URL の上に置く */
  .app-home-connect__list .app-code__pre { padding-right: 16px; }
  .app-home-connect__list .app-code--copy .app-code__pre { padding-top: 40px; padding-right: 16px; }
}
/* ==========================================================================
   セキュリティ（カード 4 枚）と本人確認のダイアログ
   ========================================================================== */

/* 変更が済んだ知らせ（#security-status）。security.js がフォーカスするので、文の幅の小さな札にして、
   フォーカスの枠（DADS の黄＋黒）がその札だけを囲むようにする。 */
.app-security > .app-status {
  display: flex;
  align-items: center;
  width: fit-content;
  max-width: 100%;
  box-sizing: border-box;
  margin: 0 0 18px;
  padding: 8px 14px;
  border-radius: var(--app-radius-control);
  background: var(--color-primitive-green-50);
  color: var(--color-primitive-green-800);
  font-size: 0.8125rem;
  line-height: 1.5;
}
.app-security > .app-status:empty { display: none; }
.app-security .app-card { position: relative; }
.app-security .app-card__head .app-help { max-width: 40rem; }

/* パスキーを追加：summary をカードの見出しの右に置く。開いた中身は見出しと表の間に出る。 */
.app-security__head { padding-right: 180px; }
.app-security__add > summary.dads-button {
  position: absolute;
  top: 16px;
  right: 20px;
  list-style: none;
  cursor: pointer;
  gap: 4px;
}
.app-security__add > summary::-webkit-details-marker { display: none; }
.app-security__add > summary::marker { content: ""; }
.app-security__add[open] > summary.dads-button { background-color: var(--app-sub); }
.app-security__add-panel { padding: 20px; border-bottom: 1px solid var(--app-line); background: var(--app-bg); }
.app-security__add-panel .app-webauthn { max-width: 420px; margin: 0; }
.app-security__hint { padding: 12px 20px; border-bottom: 1px solid var(--app-line); }

/* 表（DADS の表の包み。見出しは淡い地の小さな灰、行の間は細い線、操作は右寄せ） */
.dads-table.app-table { display: block; font-size: 0.84375rem; letter-spacing: 0.01em; line-height: 1.5; color: var(--brand-ink); }
/* カードの中の表は、カードの枠をそのまま使う（ドキュメントの表 .app-table の枠・角・下の余白を持ち込まない。二重の枠になる） */
.app-card .dads-table.app-table { margin: 0; border: 0; border-radius: 0; }
/* カードの本文（絞り込みなど）の後に続く表は、上に区切りの線を引く */
.app-card__body + .dads-table.app-table { border-top: 1px solid var(--app-line); }
.app-table .dads-table__table { width: 100%; }
.app-table .dads-table__table th {
  padding: 10px 20px;
  background: var(--app-bg);
  border-bottom: 1px solid var(--app-line);
  color: var(--brand-mute);
  font-size: 0.75rem;
  font-weight: 700;
  white-space: nowrap;
}
.app-table .dads-table__table td {
  padding: 12px 20px;
  border-bottom: 1px solid var(--app-line-soft);
  vertical-align: middle;
  overflow-wrap: anywhere;
}
.app-table tbody tr:last-child td { border-bottom: 0; }
/* 日付・IP は折り返さない（長い名前は名前の列で折り返す） */
.dads-table.app-table td[data-label]:not(.app-table__main) { white-space: nowrap; }
.app-table .dads-table__table .app-table__ops { text-align: right; white-space: nowrap; width: 1%; }
.app-table .dads-table__table td.app-table__ops { overflow-wrap: normal; }
.app-table__ops .dads-button { white-space: nowrap; }
.app-table__ops > details,
.app-table__ops > form { display: inline-block; margin: 0; vertical-align: middle; }
/* 表の中の操作は文字だけのボタン（幅を詰める） */
.app-table .dads-button[data-type="text"] { min-width: 0; padding: 2px 8px; }
/* JS なしで「名前を変更」を開いたら、フォームを操作の列の中で縦に置く */
.app-table__ops > details[open] { display: block; }
.app-table__mono { font-family: var(--font-family-mono); font-size: 0.78125rem; overflow-wrap: anywhere; }
/* 長い IPv6 は折り返す（td[data-label] の nowrap より強く） */
.dads-table.app-table td[data-label].app-table__mono { white-space: normal; overflow-wrap: anywhere; }
.app-table__empty td { color: var(--brand-mute); }
.app-table .app-table__error td { padding-top: 0; }
.app-table tr:has(+ .app-table__error) td { border-bottom: 0; }

/* 名前（鍵の印付き）と端末 */
.app-security__name { display: inline-flex; align-items: center; gap: 10px; min-width: 0; font-weight: 700; }
.app-security__name[hidden] { display: none; }
.app-field[hidden] { display: none; }
.app-security__name .app-icon {
  box-sizing: border-box;
  width: 28px;
  height: 28px;
  padding: 6px;
  border-radius: 8px;
  background: var(--color-key-50);
  color: var(--color-key-900);
}
.app-security__name > span { min-width: 0; }
.app-security__device { font-weight: 700; }
.app-table__main .app-pill { margin-left: 4px; }

/* 名前の変更。JS がなければ <details> が「名前を変更」の下に開く。JS があれば同じフォームが名前のセルに入る（.is-inline）。 */
.app-security__rename > summary { list-style: none; cursor: pointer; }
.app-security__rename > summary::-webkit-details-marker { display: none; }
.app-security__rename > summary::marker { content: ""; }
.app-security__rename-form { display: grid; gap: 8px; margin: 8px 0; min-width: 16rem; text-align: left; white-space: normal; }
.app-security__rename-form .dads-form-control-label__label { grid-area: auto; font-size: 0.8125rem; font-weight: 700; }
.app-security__rename-form .dads-input-text__input { width: 100%; box-sizing: border-box; }
.app-security__rename-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.app-security__rename-form.is-inline { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0; min-width: 0; }
.app-security__rename-form.is-inline .dads-input-text { flex: 1 1 12rem; max-width: 20rem; }
.app-security__rename-form.is-inline .dads-input-text__input[data-size="md"] { height: 36px; }
.app-security__rename-form.is-inline .dads-form-control-label__label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

/* カードの中の赤い帯（行の誤り・認証アプリの誤り） */
.app-inline-error {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0;
  padding: 10px 12px;
  border-radius: var(--app-radius-control);
  background: var(--color-primitive-red-50);
  color: var(--color-semantic-error-1);
  font-size: 0.8125rem;
  font-weight: 700;
  line-height: 1.6;
}
.app-inline-error .app-icon { width: 16px; height: 16px; margin-top: 2px; }
.app-card__body .app-inline-error { margin-top: 14px; }
@media (forced-colors: active) {
  .app-inline-error { border: 1px solid CanvasText; }
}

/* 状態と操作の 1 行（説明は左、ボタンは右） */
.app-security__line { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; }
.app-security__line .app-help { margin: 0; }
.app-security__line form { margin: 0; }
.app-security__line .dads-button { text-decoration: none; }

/* リカバリーコードの残り（10 の目盛り。3 以下は黄色） */
.app-meter { display: flex; gap: 3px; margin: 0 0 14px; }
.app-meter__seg { flex: 1; height: 6px; border-radius: 3px; background: var(--app-line); }
.app-meter__seg.is-on { background: var(--color-primitive-green-600); }
.app-meter--warn .app-meter__seg.is-on { background: var(--color-primitive-yellow-700); }
@media (forced-colors: active) {
  .app-meter__seg { border: 1px solid CanvasText; }
  .app-meter__seg.is-on { background: CanvasText; }
}
.app-security .dads-notification-banner.app-callout { margin: 0 0 14px; }
.app-security__codes { margin-top: 18px; }
.app-security__codes .app-codes-box { margin-bottom: 0; }
.app-security__codes .app-callout { margin-bottom: 14px; }

/* 切断しようとした端末がもう無い */
.app-security__notice { margin: 0; padding: 10px 20px; border-bottom: 1px solid var(--app-line-soft); font-size: 0.8125rem; }

/* ==========================================================================
   タブ（請求の画面）と、組織の設定・メンバー
   ========================================================================== */

/* タブはリンクの並び。今のタブ（aria-current="page"）は下線と濃い文字。狭い幅では横に流す（はみ出さず折り返す）。 */
.app-tabs { margin: -8px 0 24px; border-bottom: 1px solid var(--app-line); }
.app-tabs__list { display: flex; flex-wrap: wrap; gap: 0 4px; margin: 0; padding: 0; list-style: none; }
.app-tabs__item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: -1px;
  padding: 10px 12px;
  border-bottom: 2px solid transparent;
  color: var(--brand-mute);
  font-size: 0.875rem;
  font-weight: 700;
  line-height: 1.5;
  text-decoration: none;
}
@media (hover: hover) {
  a.app-tabs__item:hover:not(:focus-visible) { color: var(--brand-ink); background: var(--app-hover); }
}
.app-tabs__item[aria-current="page"] { border-bottom-color: var(--color-key-900); color: var(--brand-ink); }
.app-tabs__item--off { color: var(--app-off); cursor: default; }
.app-tabs__soon,
.app-soon-button__soon {
  padding: 0 6px;
  border: 1px solid #DADAE2;
  border-radius: 999px;
  font-size: 0.625rem;
  font-weight: 400;
  line-height: 1.6;
  color: var(--app-off);
  white-space: nowrap;
}
@media (forced-colors: active) {
  .app-tabs__item[aria-current="page"] { border-bottom-color: Highlight; }
}

/* 押せない操作（近日）。ボタンの形だけ借り、灰色で押せないと分かるようにする。 */
.app-soon-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border: 1px solid var(--app-line);
  border-radius: var(--app-radius-control);
  color: var(--app-off);
  font-size: 0.8125rem;
  font-weight: 700;
  line-height: 1.5;
  cursor: default;
  white-space: nowrap;
}

.app-settings__member { font-weight: 700; overflow-wrap: anywhere; }
/* セキュリティの下の、ログイン用のメール（表示のみ） */
.app-security__email { margin: 16px 0 0; overflow-wrap: anywhere; }
/* 組織の設定の編集のフォーム（管理者）。広い画面でも入力欄を読みやすい幅に留める。 */
.app-settings__form { max-width: 560px; }
.app-settings__form .app-actions { margin-bottom: 0; }

/* 本人確認（ダイアログと画面ごとの版） */
.app-dialog__heading,
.app-reauth__title {
  width: fit-content;
  max-width: 100%;
  margin: 0 0 6px;
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1.5;
}
.app-dialog__text { margin: 0 0 18px; font-size: 0.84375rem; line-height: 1.65; color: var(--brand-mute); }
.app-dialog__actions { justify-content: flex-end; gap: 8px; margin: 20px 0 0; }
.app-dialog__actions .dads-button { text-decoration: none; }
.app-reauth__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  margin: 0 0 12px;
  border-radius: 10px;
  background: var(--color-key-100);
  color: var(--color-key-900);
}
.app-reauth__icon .app-icon { width: 20px; height: 20px; }
.app-reauth .app-button-full { width: 100%; box-sizing: border-box; justify-content: center; }
.app-reauth .app-webauthn__unsupported,
.app-reauth .app-webauthn__status { margin: 10px 0 0; font-size: 0.8125rem; }
.app-reauth .app-webauthn__unsupported { color: var(--brand-mute); }
.app-reauth__totp { margin: 16px 0 0; }
details.app-reauth__totp { padding-top: 14px; border-top: 1px solid var(--app-line); }
.app-reauth__totp > summary {
  width: fit-content;
  cursor: pointer;
  font-size: 0.8125rem;
  color: var(--color-key-900);
  text-decoration: underline;
  text-decoration-color: var(--color-key-300);
  text-underline-offset: 3px;
}
details.app-reauth__totp > form { margin-top: 14px; }
.app-reauth .app-field .dads-input-text,
.app-reauth .app-field .dads-input-text__input { width: 100%; box-sizing: border-box; }
.app-reauth .app-code-input {
  max-width: none;
  font-size: 1.375rem;
  font-weight: 500;
  letter-spacing: 0.4em;
  text-align: center;
  text-indent: 0.4em;
}
.app-reauth-page { max-width: 480px; margin: 0 auto; }

@media (max-width: 640px) {
  /* 表は行ごとのカードに積む（見出しは読み上げにだけ残し、各セルの左に data-label を出す）。
     ここは DADS の表（.dads-table.app-table）だけ。ドキュメントの表（Markdown・料金・モデル一覧）は 768px 以下で別にカードにする（下の .app-docs__body の規則）。 */
  .dads-table.app-table .dads-table__table,
  .dads-table.app-table tbody,
  .dads-table.app-table tr,
  .dads-table.app-table td { display: block; width: auto; }
  .dads-table.app-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
  }
  .dads-table.app-table tbody tr { padding: 12px 16px; border-bottom: 1px solid var(--app-line-soft); }
  .dads-table.app-table tbody tr:last-child { border-bottom: 0; }
  .dads-table.app-table tr:has(+ .app-table__error) { border-bottom: 0; padding-bottom: 4px; }
  .app-table .dads-table__table td { display: flex; gap: 12px; padding: 3px 0; border-bottom: 0; white-space: normal; }
  .app-table .dads-table__table td[data-label]::before {
    content: attr(data-label);
    flex: none;
    width: 7.5rem;
    color: var(--brand-mute);
    font-size: 0.75rem;
    line-height: 1.9;
  }
  .app-table .dads-table__table td.app-table__main { padding-bottom: 6px; }
  .app-table .dads-table__table td.app-table__main::before { display: none; }
  .app-table .dads-table__table .app-table__ops { width: auto; text-align: left; white-space: normal; margin-top: 4px; }
  .app-table .dads-table__table td.app-table__ops { flex-wrap: wrap; gap: 4px 8px; }
  .app-table .dads-table__table td.app-table__ops:empty { display: none; }
  .app-table__ops > details,
  .app-table__ops > form { display: block; flex: none; }
  .app-table__ops > details[open] { flex: 1 1 100%; }
  .app-table__ops .dads-button[data-type="text"] { margin-left: -8px; }
  /* カードの値は枠に収める（上の「日付・IP は折り返さない」の nowrap が、枠の外へ文字を押し出していた） */
  .dads-table.app-table td[data-label]:not(.app-table__main) { white-space: normal; overflow-wrap: anywhere; min-width: 0; }
  .app-table .dads-table__table td { min-width: 0; }
  .dads-table.app-table .app-table__error td,
  .dads-table.app-table .app-table__empty td { display: block; }
  .app-security__rename-form { min-width: 0; }

  /* 追加のボタンは見出しの下に（流れの中に）置く */
  .app-security__head { padding-right: 16px; }
  .app-security__add > summary.dads-button { position: relative; top: auto; right: auto; margin: 12px 16px; }
  .app-security__add { border-bottom: 1px solid var(--app-line); }
  .app-security__add[open] > summary.dads-button { margin-bottom: 12px; }
  .app-security__add-panel { padding: 16px; border-bottom: 0; }
  .app-security__hint { padding: 12px 16px; }
  .app-security__notice { padding: 10px 16px; }
}

/* 文書（特商法・規約）。枠は app.css の .app-doc */
.app-docbody .app-page-lead { margin-bottom: 20px; }
.dads-table.app-legal { display: block; font-size: 0.875rem; line-height: 1.6; color: var(--brand-ink); border: 1px solid var(--app-line); border-radius: 12px; overflow: hidden; background: var(--app-surface); }
.app-legal .dads-table__table th[scope="row"] {
  width: 200px;
  padding: 12px 20px;
  background: var(--app-bg);
  border-bottom: 1px solid var(--app-line-soft);
  border-right: 1px solid var(--app-line-soft);
  color: var(--brand-ink);
  font-size: 0.8125rem;
  font-weight: 700;
  text-align: left;
  vertical-align: top;
  white-space: normal;
  overflow-wrap: anywhere;
}
.app-legal .dads-table__table { width: 100%; }
.app-legal .dads-table__table td { padding: 12px 20px; border-bottom: 1px solid var(--app-line-soft); vertical-align: top; overflow-wrap: anywhere; }
.app-legal tbody tr:last-child th,
.app-legal tbody tr:last-child td { border-bottom: 0; }
.app-terms--toc { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 40px; align-items: start; }
.app-toc { position: sticky; top: 16px; font-size: 0.8125rem; line-height: 1.6; }
.app-toc__title { font-weight: 700; color: var(--brand-ink); cursor: pointer; list-style: none; padding: 4px 0 8px; }
.app-toc__title::-webkit-details-marker { display: none; }
.app-toc__list { margin: 0; padding: 0; list-style: none; border-left: 1px solid var(--app-line); }
.app-toc__list li { margin: 0; }
.app-toc__list a { display: block; padding: 4px 0 4px 12px; color: var(--brand-mute); text-decoration: none; overflow-wrap: anywhere; }
.app-toc__list a:hover { color: var(--brand-ink); }
/* 本文：墨の色・14px・行間 1.9。見出しはページの見出し（22px）より小さく、20px・15px。文書の題（# ）は h1 にせず小さな題の行。 */
.app-prose { min-width: 0; font-size: 0.875rem; line-height: 1.9; color: var(--brand-ink); overflow-wrap: anywhere; }
.app-prose .dads-heading { color: var(--brand-ink); letter-spacing: 0.01em; }
.app-prose__title { margin: 0 0 16px; font-size: 1rem; font-weight: 700; line-height: 1.6; color: var(--brand-ink); }
/* h2 は上に余白と区切りの線。手順の見出し（## 1. 〜）は番号を丸の札（.app-step）にする */
.app-prose .dads-heading[data-size="24"] { margin: 48px 0 12px; padding-top: 24px; border-top: 1px solid var(--app-line); font-size: 1.25rem; font-weight: 700; line-height: 1.5; scroll-margin-top: 16px; }
.app-prose .dads-heading[data-size="24"]:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.app-step { display: inline-flex; align-items: center; justify-content: center; min-width: 1.75rem; height: 1.75rem; margin-right: 10px; padding: 0 6px; border: 1px solid transparent; border-radius: 999px; background: var(--color-key-50); color: var(--color-key-1000); font-size: 0.875rem; font-weight: 700; line-height: 1; vertical-align: 0.1em; }
.app-prose .dads-heading[data-size="20"] { margin: 24px 0 8px; font-size: 0.9375rem; font-weight: 700; line-height: 1.6; }
.app-prose p, .app-prose ul { margin: 0 0 12px; }
.app-prose ul { padding-left: 1.5em; }
/* 引用（【仮】の断り書きなど）：左に線を引いた淡い箱。字下げは線の内側だけ */
.app-prose blockquote { margin: 0 0 24px; padding: 10px 16px; border-left: 3px solid var(--app-line-strong); border-radius: 0 8px 8px 0; background: var(--app-bg); color: var(--brand-mute); font-size: 0.8125rem; line-height: 1.8; }
.app-prose blockquote p { margin: 0; }
/* 個別規定（/payment-info）の詳細の折りたたみ。素直な <details>（JS なし。閉じていてもページ内検索で見つかる）。印刷では開いて出す */
.app-fold { margin: 0 0 8px; border: 1px solid var(--app-line); border-radius: 8px; background: var(--app-surface); }
.app-fold__title { padding: 10px 14px; font-weight: 700; cursor: pointer; }
.app-fold__body { padding: 0 14px 4px; }
.app-fold__body .dads-heading[data-size="20"]:first-child { margin-top: 4px; }
@media print {
  .app-fold::details-content { content-visibility: visible; display: block; }
}
/* 行の中のコード・コードブロック（等幅と背景色だけ。色付けはしない）。ブロックは中だけ横に流し、右上に「コピー」 */
.app-prose code { font-family: var(--font-family-mono); font-size: 0.8125rem; padding: 1px 5px; border-radius: 4px; background: var(--app-sub); overflow-wrap: anywhere; }
/* 囲み（> [!NOTE]・> [!WARNING]）。左に色の線、淡い地、題は太字 */
.app-callout { margin: 0 0 20px; padding: 12px 16px; border-left: 4px solid var(--color-key-900); border-radius: 0 8px 8px 0; background: var(--color-key-50); color: var(--brand-ink); }
.app-callout--warn { border-left-color: var(--color-primitive-yellow-800); background: var(--color-primitive-yellow-50); }
.app-callout__title { margin: 0 0 4px; font-size: 0.8125rem; font-weight: 700; color: var(--color-key-1000); }
.app-callout--warn .app-callout__title { color: var(--color-primitive-yellow-1100); }
.app-prose .app-callout p:last-child { margin-bottom: 0; }
/* 表の札（使える・違う・使えない） */
/* 表の札。色＋記号（.app-badge__mark）＋文字で見分ける（色だけに頼らない）。
   コントラスト（WCAG AA 4.5:1 以上）：使える 緑 900/50 約 7.3:1、一部 黄 1000/50 約 5.2:1、使えない 赤 1000/50 約 6.9:1、
   違う 青 1000/50 約 12.5:1、ピーク 橙 1000/50 約 7.3:1、オフピーク 緑 900/50 約 7.3:1 */
.app-badge { display: inline-flex; align-items: center; gap: 4px; padding: 0 8px; border: 1px solid transparent; border-radius: 999px; font-size: 0.75rem; font-weight: 700; line-height: 1.8; white-space: nowrap; }
.app-badge__mark { font-size: 0.6875rem; line-height: 1; }
.app-badge--ok,
.app-badge--offpeak { background: var(--color-primitive-green-50); color: var(--color-primitive-green-900); }
.app-badge--warn { background: var(--color-primitive-yellow-50); color: var(--color-primitive-yellow-1000); }
.app-badge--ng { background: var(--color-primitive-red-50); color: var(--color-primitive-red-1000); }
.app-badge--diff { background: var(--color-primitive-blue-50); color: var(--color-primitive-blue-1000); }
.app-badge--peak { background: var(--color-primitive-orange-50); color: var(--color-primitive-orange-1000); }
@media (forced-colors: active) {
  .app-step, .app-badge { border-color: CanvasText; }
  .app-callout { border: 1px solid CanvasText; border-left-width: 4px; }
}
/* コードの箱（ドキュメント・設定の生成・ホームの接続先）は黒地。色は箱の中だけの変数にまとめる（本文の行の中のコードは明るいまま）。
   コントラスト（WCAG AA）：地 #16161d に対し 文字 #e8e8f0 は約 14.8:1、色のうち最も低いコメント #8b8ba0 でも約 5.4:1。帯 #22222b に対し 帯の文字 #a9a9b8 は約 6.8:1、「コピー」の #ddd は約 11.6:1 */
.app-code {
  --app-code-bg: #16161d;
  --app-code-bar: #22222b;
  --app-code-line: #33333d;
  --app-code-ink: #e8e8f0;
  --app-code-mute: #a9a9b8;
  --app-code-accent: #8f8bff;
  --app-code-btn-ink: #ddd;
  --app-code-btn-line: #44444f;
  --app-code-hover: #2e2e38;
  --app-code-focus: #fff;
  position: relative;
  margin: 0 0 16px;
}
.app-code__pre { margin: 0; padding: 12px 16px; border: 1px solid var(--app-code-bg); border-radius: 8px; background: var(--app-code-bg); color: var(--app-code-ink); overflow-x: auto; font-size: 0.8125rem; line-height: 1.7; white-space: pre; overflow-wrap: normal; user-select: text; scrollbar-color: var(--app-code-btn-line) transparent; }
.app-code .app-code__pre code { padding: 0; border: 0; border-radius: 0; background: none; color: inherit; overflow-wrap: normal; }
/* 黒地では既定の黒い枠が見えないので、白い枠を内側に出す */
.app-code .app-code__pre:focus-visible { outline: calc(3 / 16 * 1rem) solid var(--app-code-focus); outline-offset: calc(-3 / 16 * 1rem); box-shadow: none; }
/* JS がボタンを見せたブロック（.app-code--copy）は、上に余白を取って 1 行目がボタンの下に潜らないようにする */
.app-code--copy .app-code__pre { padding-top: 40px; }
.app-code__copy { position: absolute; top: 6px; right: 6px; min-height: 28px; padding: 0 10px; border: 1px solid var(--app-code-btn-line); border-radius: var(--app-radius-control); background: var(--app-code-bar); color: var(--app-code-btn-ink); font: inherit; font-size: 0.75rem; cursor: pointer; }
.app-code .app-code__copy:focus-visible { outline: calc(2 / 16 * 1rem) solid var(--app-code-focus); outline-offset: calc(2 / 16 * 1rem); box-shadow: none; }
@media (hover: hover) {
  .app-code__copy:hover { background: var(--app-code-hover); }
}
/* ドキュメントのコードの箱（markdown.go）：上に見出しの帯（左に言語の名前、右に「コピー」）。帯と中身を 1 つの枠で囲む */
.app-code--bar,
.app-code--tabs { border: 1px solid var(--app-code-bar); border-radius: 8px; background: var(--app-code-bar); }
.app-code--bar .app-code__pre,
.app-code--tabs .app-code__pre { border: 0; border-top: 1px solid var(--app-code-line); border-radius: 0 0 7px 7px; }
.app-code__bar { display: flex; align-items: center; gap: 8px; min-height: 36px; padding: 4px 6px 4px 14px; }
/* JS がなく（ボタンが hidden）言語の名前もない帯は、空になるので出さない */
.app-code__bar:not(:has(.app-code__lang)):has(.app-code__copy[hidden]) { display: none; }
.app-code__bar:not(:has(.app-code__lang)):has(.app-code__copy[hidden]) + .app-code__pre { border-top: 0; border-radius: 7px; }
.app-code__lang { margin-right: auto; font-size: 0.75rem; font-weight: 700; line-height: 1.4; color: var(--app-code-mute); overflow-wrap: anywhere; }
.app-code__bar .app-code__copy { position: static; flex: none; margin-left: auto; }
/* タブ：radio をすべて先に、次にタブの帯（label を並べた .app-code__tabbar）、最後に中身を並べる（markdown.go）。
   k 番目の radio が :checked なら k 番目の label を選んだ形にし、k 番目の中身を出す（中身は div の k+1 番目。1 番目は帯）。
   帯は折り返さず、入らなければ帯の中だけ横に流す。右の 88px は「コピー」のぶん（「コピー失敗」も入る）。切り替えは :checked だけで JS は使わない。
   規則は maxTabs（8）まで */
.app-code__radio { position: absolute; top: 0; left: 0; width: 1px; height: 1px; margin: 0; opacity: 0; pointer-events: none; }
.app-code__tabbar { display: flex; margin-right: 88px; padding-left: 6px; overflow-x: auto; scrollbar-width: thin; scrollbar-color: var(--app-code-btn-line) transparent; }
.app-code__tab { display: flex; flex: none; align-items: center; min-height: 36px; padding: 4px 10px; border-bottom: 2px solid transparent; color: var(--app-code-mute); font-size: 0.75rem; font-weight: 700; line-height: 1.4; white-space: nowrap; cursor: pointer; }
.app-code__panel { display: none; }
.app-code__radio:nth-of-type(1):checked ~ .app-code__tabbar .app-code__tab:nth-of-type(1),
.app-code__radio:nth-of-type(2):checked ~ .app-code__tabbar .app-code__tab:nth-of-type(2),
.app-code__radio:nth-of-type(3):checked ~ .app-code__tabbar .app-code__tab:nth-of-type(3),
.app-code__radio:nth-of-type(4):checked ~ .app-code__tabbar .app-code__tab:nth-of-type(4),
.app-code__radio:nth-of-type(5):checked ~ .app-code__tabbar .app-code__tab:nth-of-type(5),
.app-code__radio:nth-of-type(6):checked ~ .app-code__tabbar .app-code__tab:nth-of-type(6),
.app-code__radio:nth-of-type(7):checked ~ .app-code__tabbar .app-code__tab:nth-of-type(7),
.app-code__radio:nth-of-type(8):checked ~ .app-code__tabbar .app-code__tab:nth-of-type(8) { border-bottom-color: var(--app-code-accent); color: #fff; }
.app-code__radio:nth-of-type(1):checked ~ .app-code__panel:nth-of-type(2),
.app-code__radio:nth-of-type(2):checked ~ .app-code__panel:nth-of-type(3),
.app-code__radio:nth-of-type(3):checked ~ .app-code__panel:nth-of-type(4),
.app-code__radio:nth-of-type(4):checked ~ .app-code__panel:nth-of-type(5),
.app-code__radio:nth-of-type(5):checked ~ .app-code__panel:nth-of-type(6),
.app-code__radio:nth-of-type(6):checked ~ .app-code__panel:nth-of-type(7),
.app-code__radio:nth-of-type(7):checked ~ .app-code__panel:nth-of-type(8),
.app-code__radio:nth-of-type(8):checked ~ .app-code__panel:nth-of-type(9) { display: block; }
/* radio は見えないので、キーボードで radio に来たときの枠は label に出す（黒地なので白い枠） */
.app-code__radio:nth-of-type(1):focus-visible ~ .app-code__tabbar .app-code__tab:nth-of-type(1),
.app-code__radio:nth-of-type(2):focus-visible ~ .app-code__tabbar .app-code__tab:nth-of-type(2),
.app-code__radio:nth-of-type(3):focus-visible ~ .app-code__tabbar .app-code__tab:nth-of-type(3),
.app-code__radio:nth-of-type(4):focus-visible ~ .app-code__tabbar .app-code__tab:nth-of-type(4),
.app-code__radio:nth-of-type(5):focus-visible ~ .app-code__tabbar .app-code__tab:nth-of-type(5),
.app-code__radio:nth-of-type(6):focus-visible ~ .app-code__tabbar .app-code__tab:nth-of-type(6),
.app-code__radio:nth-of-type(7):focus-visible ~ .app-code__tabbar .app-code__tab:nth-of-type(7),
.app-code__radio:nth-of-type(8):focus-visible ~ .app-code__tabbar .app-code__tab:nth-of-type(8) {
  outline: calc(2 / 16 * 1rem) solid var(--app-code-focus);
  outline-offset: calc(-2 / 16 * 1rem);
  border-radius: calc(4 / 16 * 1rem);
}
.app-code__radio:focus-visible { outline: none; box-shadow: none; }
/* 中身の「コピー」は箱の右上（帯の行）に置く。出ているのは選んだタブの中身のボタンだけ */
.app-code--tabs .app-code__copy { top: 4px; right: 6px; }
@media (hover: hover) {
  .app-code__tab:hover { color: #fff; }
}
@media (forced-colors: active) {
  .app-code__radio:nth-of-type(1):checked ~ .app-code__tabbar .app-code__tab:nth-of-type(1),
  .app-code__radio:nth-of-type(2):checked ~ .app-code__tabbar .app-code__tab:nth-of-type(2),
  .app-code__radio:nth-of-type(3):checked ~ .app-code__tabbar .app-code__tab:nth-of-type(3),
  .app-code__radio:nth-of-type(4):checked ~ .app-code__tabbar .app-code__tab:nth-of-type(4),
  .app-code__radio:nth-of-type(5):checked ~ .app-code__tabbar .app-code__tab:nth-of-type(5),
  .app-code__radio:nth-of-type(6):checked ~ .app-code__tabbar .app-code__tab:nth-of-type(6),
  .app-code__radio:nth-of-type(7):checked ~ .app-code__tabbar .app-code__tab:nth-of-type(7),
  .app-code__radio:nth-of-type(8):checked ~ .app-code__tabbar .app-code__tab:nth-of-type(8) { border-bottom-color: CanvasText; }
}
/* コードの色（markdown.go の writeCode が書く span.tok-*。class は highlight.go の固定の組だけ）。どれも地 #16161d に対し AA を満たす */
.app-code .tok-keyword { color: #ff9ac1; }
.app-code .tok-string { color: #a6e3a1; }
.app-code .tok-comment { color: #8b8ba0; }
.app-code .tok-number { color: #fab387; }
.app-code .tok-key { color: #89b4fa; }
.app-code .tok-command { color: #f9e2af; }
.app-code .tok-flag { color: #94e2d5; }
/* 狭い画面でもコードの改行位置を保ち、各コードブロックで横にスクロールする。 */
@media (max-width: 768px) {
  /* タブの左右の余白を詰める（入らなければ帯の中だけ横に流れる） */
  .app-code__tabbar { padding-left: 2px; }
  .app-code__tab { padding: 4px 8px; }
}
/* 表（Markdown の | 区切り）。狭い画面では表の中だけ横に流す */
.app-table { margin: 0 0 16px; overflow-x: auto; border: 1px solid var(--app-line); border-radius: 8px; }
.app-table table { width: 100%; border-collapse: collapse; font-size: 0.8125rem; line-height: 1.6; }
.app-table th, .app-table td { padding: 8px 12px; border-bottom: 1px solid var(--app-line-soft); text-align: left; vertical-align: top; overflow-wrap: normal; }
.app-table th { background: var(--app-bg); font-weight: 700; white-space: nowrap; }
.app-table tbody tr:last-child td { border-bottom: 0; }
/* ドキュメントの表：見出しの行は軽く（小さめの灰色の字）、行の区切りは薄く、マウスを載せた行を薄く強調 */
.app-docs__body .app-table thead th { padding-top: 6px; padding-bottom: 6px; border-bottom-color: var(--app-line); color: var(--brand-mute); font-size: 0.75rem; letter-spacing: 0.03em; }
@media (hover: hover) {
  .app-docs__body .app-table tbody tr:not(.app-table__group):hover > :is(td, th) { background: var(--color-key-50); }
}
/* 帯の行（| **見出し** | | | ）：グループの区切り */
.app-table tbody tr.app-table__group > th { padding-top: 4px; padding-bottom: 4px; background: var(--app-sub); color: var(--brand-ink); font-size: 0.75rem; font-weight: 700; letter-spacing: 0.03em; }
/* 数字の列（料金）：右寄せ・桁そろえ */
.app-table .app-num { text-align: right; font-variant-numeric: tabular-nums; }

/* 料金の表（prices.go）。JS があれば税抜／税込・ピーク／オフピークを切り替える（prices.js）。JS が無ければ両方の表と両方の値が並ぶ */
.app-price__switch { display: flex; flex-wrap: wrap; gap: 8px 12px; margin: 0 0 8px; }
.app-price__switch[hidden] { display: none; }
.app-seg { display: inline-flex; border: 1px solid var(--app-line); border-radius: 8px; overflow: hidden; }
.app-seg__item { min-height: 32px; padding: 0 14px; border: 0; background: var(--app-surface); color: var(--brand-mute); font: inherit; font-size: 0.8125rem; font-weight: 700; cursor: pointer; }
.app-seg__item + .app-seg__item { border-left: 1px solid var(--app-line); }
.app-seg__item[aria-pressed="true"] { background: var(--color-key-900); color: #fff; }
@media (hover: hover) {
  .app-seg__item[aria-pressed="false"]:hover { background: var(--app-hover); color: var(--brand-ink); }
}
@media (forced-colors: active) {
  .app-seg__item[aria-pressed="true"] { outline: 2px solid Highlight; outline-offset: -2px; }
}
.app-price__unit { margin: 0 0 8px; color: var(--brand-mute); font-size: 0.8125rem; }
.app-price__title { margin-top: 16px; }
.app-price__precision { display: block; color: var(--brand-mute); font-size: 0.75rem; font-weight: 400; white-space: normal; }
.app-table--price tbody th { white-space: nowrap; }
.app-price__v { white-space: nowrap; }
/* 切り替えのとき：選んでいない表と、選んでいない時間帯の値・区切り・「各欄は…」の説明を隠す */
.app-price.is-switchable .app-price__nojs,
.app-price.is-switchable .app-price__sep,
.app-price.is-switchable .app-price__title,
.app-price.is-switchable[data-tax="ex"] .app-price__block[data-tax="in"],
.app-price.is-switchable[data-tax="in"] .app-price__block[data-tax="ex"],
.app-price.is-switchable[data-period="peak"] .app-price__v[data-period="off"],
.app-price.is-switchable[data-period="off"] .app-price__v[data-period="peak"] { display: none; }
/* 行の見出し（モデル一覧の公開名）は地の色のまま */
.app-table tbody th { background: transparent; }
.app-table tbody tr:last-child th { border-bottom: 0; }
/* 表の中のコードは、入らなければ折り返す（長い欄の名前の列だけが広がって、ほかの列が細くならないように）。
   anywhere ではなく break-word にする：anywhere は列の最小の幅まで縮めてしまい、reasoning_effort のような 1 語が
   途中で折れる。break-word なら列の最小の幅は いちばん長い 1 語になり、折るのは語の間（入らない 1 語だけは途中で）。 */
.app-prose .app-table code { white-space: normal; overflow-wrap: break-word; }
/* コードは 1 つの塊（inline-block）にして、コードとコードの間（「・」の後など）で折れるようにする。
   「・/v1/…」のように記号が続くと、文字のままでは折れる所が無く、表が右で切れていた（/docs/connect のエンドポイントの列）。
   1 つのコードが列より長いときだけ、その中で折る（max-width と上の break-word） */
/* 1 列目が短い名前だけの表（markdown.go の labelColumn）は、1 列目を折らずに狭くし、残りをほかの列に回す（広い画面だけ） */
@media (min-width: 769px) {
  .app-prose .app-table--label tbody td:first-child { width: 1%; white-space: nowrap; }
}
.app-prose .app-table code { display: inline-block; max-width: 100%; box-sizing: border-box; vertical-align: top; }
/* ただし、行の見出しのある表（モデル一覧：公開名と使える口の道。<br> で 1 行に 1 つ）は、広い画面では途中で折らない。
   幅が足りなければ .app-table の中だけ横に流す（狭い画面ではカードにして折り返す） */
@media (min-width: 769px) {
  .app-prose .app-table:has(tbody th) code { white-space: nowrap; overflow-wrap: normal; }
  /* 「項目／扱い（札）／補足」の 3 列の表は、列の幅を決めて割り振る（table-layout: fixed）：項目 3 割、札の列は札の幅、
     残りを補足に。中身の長さだけで割り振ると、長いコードの並ぶ表では補足が、短い表では項目が細くなる */
  .app-prose .app-table:has(thead th:nth-child(3):last-child):has(tbody td:nth-child(2) > .app-badge) table { table-layout: fixed; }
  .app-prose .app-table:has(thead th:nth-child(3):last-child):has(tbody td:nth-child(2) > .app-badge) thead th:first-child { width: 30%; }
  .app-prose .app-table:has(thead th:nth-child(3):last-child):has(tbody td:nth-child(2) > .app-badge) thead th:nth-child(2) { width: 6.5rem; }
}
/* 狭い画面では、見出しのあるドキュメントの表を 1 行 1 枚のカードにする（各セルの上に data-label の列の名前）。
   見出しは読み上げにだけ残す。見出しのない表は上のとおり横に流す */
@media (max-width: 768px) {
  .app-docs__body .app-table:has(thead) { overflow-x: visible; border: 0; border-radius: 0; }
  .app-docs__body .app-table:has(thead) :is(table, tbody, tr, th, td) { display: block; width: auto; }
  .app-docs__body .app-table:has(thead) thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
  }
  .app-docs__body .app-table:has(thead) tbody tr { margin: 0 0 8px; padding: 8px 12px; border: 1px solid var(--app-line); border-radius: 8px; background: var(--app-surface); }
  .app-docs__body .app-table:has(thead) tbody tr:last-child { margin-bottom: 0; }
  .app-docs__body .app-table:has(thead) :is(tbody th, td) { padding: 2px 0; border-bottom: 0; white-space: normal; overflow-wrap: anywhere; }
  .app-docs__body .app-table:has(thead) td[data-label]::before { content: attr(data-label); display: block; color: var(--brand-mute); font-size: 0.6875rem; font-weight: 700; line-height: 1.5; }
  /* 行の最初のセル（項目の名前）はカードの題：太字にし、列の名前は出さない。札のセルは題の下の行に出る */
  .app-docs__body .app-table:has(thead) tbody tr > :first-child { padding-top: 0; font-size: 0.875rem; font-weight: 700; }
  .app-docs__body .app-table:has(thead) tbody tr > td:first-child::before { content: none; }
  /* 札だけのセル（扱い）は札そのものが意味を言うので、列の名前を出さず、題のすぐ下に札を置く */
  .app-docs__body .app-table:has(thead) td:has(> .app-badge:only-child)::before { content: none; }
  .app-docs__body .app-table:has(thead) code { white-space: normal; overflow-wrap: anywhere; }
  /* 中身のないセル（補足のない行など）は、カードでは見出しだけが残るので出さない */
  .app-docs__body .app-table:has(thead) td:empty { display: none; }
  /* 帯の行はカードにせず、次のカードたちの小見出しにする */
  .app-docs__body .app-table:has(thead) tbody tr.app-table__group { margin: 12px 0 6px; padding: 0; border: 0; background: none; }
  .app-docs__body .app-table:has(thead) tbody tr.app-table__group:first-child { margin-top: 0; }
  .app-docs__body .app-table:has(thead) tbody tr.app-table__group > th { padding: 2px 8px; border-radius: 6px; font-size: 0.75rem; }
  /* 札のセルは、札を題の下の行に左寄せで置く（札の幅だけ） */
  .app-docs__body .app-table:has(thead) td:has(> .app-badge:only-child) { padding-top: 4px; }
  /* 料金のカード：題（モデル名・精度）の下に「列の名前 … 値（右寄せ）」を 1 行ずつ */
  .app-docs__body .app-table--price tbody td.app-num { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; text-align: right; }
  .app-docs__body .app-table--price tbody td.app-num::before { flex: none; text-align: left; font-size: 0.75rem; }
  .app-docs__body .app-table--price tbody td.app-num > .app-price__v:first-of-type { margin-left: auto; }
  .app-docs__body .app-table--price tbody th { white-space: normal; }
}

/* ドキュメント：本文（最大 720px）・ページ内の見出し（右、1200px 以上）の 2 列。目次は左のメニューの下に入れた。
   本文の上の目次（.app-docs__nav）は 768px 以下だけ出す（規約の .app-toc と同じたたみ） */
.app-docs { display: grid; grid-template-columns: minmax(0, 720px) 180px; gap: 32px; align-items: start; }
.app-docs__nav { display: none; }
.app-docs__body { min-width: 0; }
.app-docs__body .app-page-title { margin-bottom: 20px; }
.app-docs__group { margin: 16px 0 4px; font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.06em; color: var(--app-off); }
.app-docs__nav .app-toc__title + .app-docs__group { margin-top: 4px; }
.app-docs__nav .app-toc__list a[aria-current="page"] { margin-left: -1px; border-left: 2px solid var(--color-key-900); padding-left: 11px; color: var(--color-key-1000); font-weight: 700; }
.app-docs__outline { position: sticky; top: 16px; font-size: 0.8125rem; line-height: 1.6; }
@media (max-width: 1199px) {
  .app-docs { grid-template-columns: minmax(0, 720px); }
  .app-docs__outline { display: none; }
}

/* 前へ・次へ */
.app-docs__pager { display: flex; justify-content: space-between; gap: 12px; margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--app-line); }
.app-docs__pager-link { display: flex; flex-direction: column; gap: 4px; min-width: 0; max-width: 48%; padding: 10px 14px; border: 1px solid var(--app-line); border-radius: 8px; color: var(--brand-ink); text-decoration: none; }
.app-docs__pager-link--next { margin-left: auto; text-align: right; align-items: flex-end; }
.app-docs__pager-dir { font-size: 0.75rem; font-weight: 700; color: var(--brand-mute); }
.app-docs__pager-title { font-size: 0.875rem; overflow-wrap: anywhere; }
@media (hover: hover) {
  .app-docs__pager-link:hover:not(:focus-visible) { background: var(--app-hover); }
}

@media (max-width: 768px) {
  .app-terms--toc,
  .app-docs { display: block; }
  .app-docs__nav { display: block; }
  .app-docs__pager-link { max-width: 100%; flex: 1; }
  .app-docs__pager { flex-direction: column; }
  .app-docs__pager-link--next { margin-left: 0; }
  .app-toc { position: static; margin-bottom: 24px; border: 1px solid var(--app-line); border-radius: 8px; padding: 0 16px; background: var(--app-surface); }
  .app-toc__title { cursor: pointer; padding: 12px 0; }
  .app-toc__fold[open] > .app-toc__title { padding-bottom: 8px; }
  .app-toc__list { margin-bottom: 12px; }
}
@media (max-width: 640px) {
  /* 表は行ごとに積む：項目名を上に、値をその下に */
  .app-legal .dads-table__table,
  .app-legal tbody,
  .app-legal tr,
  .app-legal th,
  .app-legal td { display: block; width: auto; }
  .app-legal .dads-table__table th[scope="row"] { width: auto; padding: 10px 16px 0; border-right: 0; border-bottom: 0; background: var(--app-bg); }
  .app-legal .dads-table__table td { padding: 8px 16px 12px; border-bottom: 1px solid var(--app-line-soft); background: var(--app-surface); }
  .app-legal tbody tr:last-child td { border-bottom: 0; }
}

/* ツールの設定の生成（/docs/tools）。フォームは本文の幅の中で狭く、結果は本文と同じ流れ。 */
.app-tools-form { max-width: 480px; margin: 16px 0 24px; }
.app-tools-result { margin-top: 8px; }

/* ==========================================================================
   チャージ・請求（請求の設計書 §4。見本 mock-*.html の mock.css を console の色と寸法に寄せたもの）
   ========================================================================== */
/* 上のバーの残高・ホームの残高のタイル */
.app-topbal { margin-left: auto; font-size: 0.8125rem; line-height: 1.5; border: 1px solid var(--app-line); border-radius: 999px; padding: 3px 12px; background: var(--app-surface); color: var(--brand-ink); white-space: nowrap; }
.app-topbal b { font-variant-numeric: tabular-nums; }
.app-home-tile__unit { margin-left: 4px; font-size: 0.8125rem; font-weight: 600; color: var(--brand-mute); }
.app-home-tile__help { margin: 4px 0 0; }

/* 知らせの帯（状態の箱の色を使う） */
.app-bill-note-box { margin: 0 0 16px; padding: 12px 16px; border-radius: 8px; font-size: 0.875rem; line-height: 1.7; }
.app-bill-note-box a { color: inherit; text-decoration: underline; }
.app-bill-text { margin: 0 0 12px; line-height: 1.8; }
.app-bill-text--last { margin: 0; }
.app-bill-list { margin: 0 0 14px; padding-left: 20px; line-height: 1.9; }
.app-bill-list--dots { list-style: disc; }
.app-bill-list--last { margin-bottom: 0; }
.app-bill-empty { margin: 0; color: var(--brand-mute); }
.app-bill-note { margin: 10px 0 0; font-size: 0.8125rem; line-height: 1.7; color: var(--brand-mute); }
.app-bill-pagenote { margin: 0 0 24px; }
.app-bill-sub { font-size: 0.75rem; color: var(--brand-mute); }
.app-bill-num,
.app-table .dads-table__table .app-bill-num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.app-bill-nw { white-space: nowrap; }
.app-bill-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 6px; }
.app-bill-actions form { margin: 0; }

/* 残高 */
.app-bill-big { margin: 0; font-size: 2.125rem; font-weight: 800; line-height: 1.3; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.app-bill-big small { margin-left: 6px; font-size: 0.9375rem; font-weight: 600; color: var(--brand-mute); }
.app-bill-meta { margin: 4px 0 0; font-size: 0.875rem; color: var(--brand-mute); }
.app-bill-balance { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 16px 32px; }
.app-bill-balance__act { margin-left: auto; }

/* カードの札 */
.app-bill-brand { display: inline-grid; place-items: center; flex: none; width: 42px; height: 26px; margin-right: 6px; border-radius: 5px; background: #1a1f71; color: #fff; font-size: 0.6875rem; font-weight: 800; letter-spacing: 0.03em; vertical-align: middle; }
.app-bill-brand--mc { background: #252525; }
.app-bill-brand--jcb { background: #0b6b3a; }

/* チャージ：左に数とカード、右（狭い幅では下）に内容 */
.app-bill-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; align-items: start; }
.app-bill-amounts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 0 0 14px; padding: 0; list-style: none; }
.app-bill-choice { display: flex; flex-direction: column; gap: 2px; min-width: 0; padding: 12px 14px; border: 1px solid var(--app-line-strong); border-radius: 10px; background: var(--app-surface); color: var(--brand-ink); text-decoration: none; }
.app-bill-choice b { font-size: 1.0625rem; font-variant-numeric: tabular-nums; }
.app-bill-choice small { font-size: 0.78125rem; color: var(--brand-mute); }
.app-bill-choice:hover { border-color: var(--color-key-900); }
.app-bill-choice.is-on { padding: 11px 13px; border: 2px solid var(--color-key-900); background: var(--color-key-50); }
.app-bill-other { margin: 0; }
.app-bill-inline { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.app-bill-inline .dads-input-text { flex: 1 1 12rem; min-width: 0; }
.app-bill-cards { margin: 0; padding: 0; border: 0; min-width: 0; }
.app-bill-legend { margin: 0 0 8px; padding: 0; font-weight: 700; }
.app-bill-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin: 0 0 8px; padding: 12px 14px; border: 1px solid var(--app-line-strong); border-radius: 10px; background: var(--app-surface); cursor: pointer; }
.app-bill-row:has(.app-bill-radio:checked) { padding: 11px 13px; border: 2px solid var(--color-key-900); background: var(--color-key-50); }
.app-bill-radio { flex: none; width: 18px; height: 18px; margin: 0 4px 0 0; accent-color: var(--color-key-900); }
.app-bill-row__sub { margin-left: auto; font-size: 0.8125rem; color: var(--brand-mute); }
.app-bill-sum { position: sticky; top: 16px; }
.app-bill-sum dl { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 0; margin: 0 0 14px; }
.app-bill-sum dt { padding-right: 12px; color: var(--brand-mute); }
.app-bill-sum dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.app-bill-sum dd small { color: var(--brand-mute); }
.app-bill-sum .app-bill-total { padding-top: 10px; border-top: 1px solid var(--app-line); font-size: 1.125rem; font-weight: 800; color: var(--brand-ink); }

/* 支払いのあと・準備中・移る前（真ん中の 1 枚） */
.app-bill-center { max-width: 560px; margin: 40px auto; text-align: center; }
.app-bill-center h2,
.app-bill-center__title { margin: 0 0 8px; font-size: 1.375rem; line-height: 1.5; }
.app-bill-center p { margin: 0 0 6px; color: var(--brand-mute); }
.app-bill-mark { display: grid; place-items: center; width: 56px; height: 56px; margin: 0 auto 14px; border-radius: 50%; font-size: 1.75rem; font-weight: 800; }
.app-bill-mark--ok { background: var(--color-primitive-green-50); color: var(--color-primitive-green-800); }
.app-bill-mark--wait { background: var(--color-primitive-yellow-50); color: var(--color-primitive-yellow-1000); }
.app-bill-mark--ng { background: var(--color-primitive-red-50); color: var(--color-primitive-red-900); }
.app-bill-buttons { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 18px; }

/* 自動チャージ */
.app-bill-rule-set { margin: 0; padding: 0; border: 0; min-width: 0; }
.app-bill-rule { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.app-bill-short { flex: none; width: 130px; }
.dads-form-control-label__field.app-bill-rule { display: flex; }
.app-bill-rule .dads-input-text.app-bill-short { flex: none; width: 130px; }
.app-bill-select { max-width: 420px; }

/* 一覧の絞り込み・ページ送り・書類のリンク */
.app-bill-filter-wrap { padding-bottom: 0; }
.app-bill-filter { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; margin: 0 0 16px; }
.app-bill-filter .app-field { min-width: 160px; margin: 0; }
.app-bill-filter__csv { margin-left: auto; }
.app-bill-pager { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; font-size: 0.8125rem; color: var(--brand-mute); }
.app-bill-docs { display: flex; flex-wrap: wrap; gap: 2px 12px; margin: 0; padding: 0; list-style: none; }
.app-bill-revised { font-size: 0.75rem; }
.app-bill-who { overflow-wrap: anywhere; }
.dads-table.app-table.app-bill-table td.app-bill-who { white-space: normal; }

/* 書類（印刷向けの 1 枚） */
.app-bill-printbar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; max-width: 760px; margin: 0 auto 16px; }
.app-bill-doc-flag { max-width: 760px; margin-left: auto; margin-right: auto; box-sizing: border-box; }
.app-bill-doc { box-sizing: border-box; max-width: 760px; margin: 0 auto 24px; padding: 48px 56px; border: 1px solid var(--app-line); background: #fff; color: var(--brand-ink); font-size: 0.875rem; line-height: 1.8; }
.app-bill-doc p { margin: 0; }
.app-bill-doc__head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 8px 24px; margin: 0 0 8px; }
.app-bill-doc__title { margin: 0; font-size: 1.625rem; letter-spacing: 0.4em; }
.app-bill-doc__title--long { font-size: 1.5rem; letter-spacing: 0.15em; }
.app-bill-doc__meta { font-size: 0.8125rem; text-align: right; }
.app-bill-doc__two { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; margin: 0 0 24px; }
.app-bill-doc__to { flex: 1; min-width: 0; }
.app-bill-doc__to > p + p { margin-top: 8px; }
.app-bill-doc__name { display: inline-block; margin: 18px 0 18px; padding: 0 40px 2px 0; border-bottom: 1px solid var(--brand-ink); font-size: 1.1875rem; overflow-wrap: anywhere; }
.app-bill-doc__amount { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 4px 12px; max-width: 420px; margin: 8px 0 0; padding: 12px 16px; border-radius: 6px; background: #f6f6f9; }
.app-bill-doc__yen { font-size: 1.5rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.app-bill-doc__yen small { font-size: 0.8125rem; font-weight: 400; }
.app-bill-doc .app-bill-doc__small { margin-top: 10px; font-size: 0.8125rem; }
.app-bill-doc__mute { color: var(--brand-mute); }
/* お支払い状況：札・日付・方法をそれぞれ折らずに並べ、入らなければ塊ごと次の行へ */
.app-bill-doc__status { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 10px; }
.app-bill-doc__status > span { white-space: nowrap; }
.app-bill-doc__status > span:first-child { margin-right: -6px; }
.app-bill-doc__paid { display: inline-block; padding: 0 8px; border: 2px solid #0f7b4f; border-radius: 6px; color: #0f7b4f; font-size: 0.75rem; font-weight: 800; }
.app-bill-doc__from { flex: 0 1 280px; min-width: 230px; padding-top: 18px; font-size: 0.8125rem; }
.app-bill-doc__issuer { font-size: 0.9375rem; }
.app-bill-doc__table { width: 100%; margin: 16px 0; border-collapse: collapse; }
.app-bill-doc__table th,
.app-bill-doc__table td { padding: 8px 10px; border: 1px solid #cfd3da; vertical-align: top; }
.app-bill-doc__table th { background: #f6f6f9; text-align: left; font-weight: 600; white-space: nowrap; } /* 見出しは折らない（列の幅を確保） */
.app-bill-doc__table--half { width: 50%; margin: 0; }
.app-bill-doc__table--tax { width: 60%; margin: 16px 0 0 auto; font-size: 0.8125rem; }
.app-bill-doc__table--kv { font-size: 0.8125rem; }
.app-bill-doc__table--kv th { width: 30%; }
.app-bill-doc__r { text-align: right; font-variant-numeric: tabular-nums; }

@media (max-width: 900px) {
  .app-bill-grid { grid-template-columns: minmax(0, 1fr); }
  .app-bill-sum { position: static; }
}
@media (max-width: 700px) {
  .app-bill-doc { padding: 20px 16px; font-size: 0.8125rem; }
  .app-bill-doc__two { flex-wrap: wrap; }
  .app-bill-doc__from { flex: 1 1 100%; min-width: 0; padding-top: 0; }
  .app-bill-doc__table,
  .app-bill-doc__table--half,
  .app-bill-doc__table--tax { width: 100%; font-size: 0.75rem; }
  .app-bill-doc__table th,
  .app-bill-doc__table td { padding: 6px; }
  .app-bill-doc__table th { white-space: normal; } /* 狭い画面は表を横にはみ出させない（見出しは折ってよい） */
  .app-bill-doc__title { letter-spacing: 0.2em; }
  .app-bill-doc__title--long { font-size: 1.25rem; letter-spacing: 0.05em; }
}
@media (max-width: 640px) {
  .app-bill-amounts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .app-bill-balance__act { margin-left: 0; }
  .app-bill-filter .app-field { min-width: 0; flex: 1 1 140px; }
  .app-bill-filter__csv { margin-left: 0; }
  .dads-table.app-table.app-bill-table td.app-table__main { flex-wrap: wrap; align-items: center; gap: 4px 6px; }
  .app-bill-table .app-bill-actions { justify-content: flex-start; }
  .app-table .dads-table__table td.app-bill-num { text-align: left; }
  .app-topbal__unit { display: none; }
}

/* 印刷：枠（サイドバー・上のバー・戻るのリンク）を消し、書類だけを 1 枚に */
@media print {
  @page { size: A4; margin: 12mm; }
  .app-side,
  .app-topbar,
  .app-skip,
  .app-bill-printbar { display: none !important; }
  .app-body,
  .app-shell,
  .app-content { display: block; background: #fff; }
  .app-body--app .app-main { max-width: none; padding: 0; }
  .app-bill-doc { max-width: none; margin: 0; padding: 0; border: 0; font-size: 10.5pt; line-height: 1.6; break-inside: avoid; }
  .app-bill-doc-flag { border: 1px solid currentColor; }
}

/* 自動チャージの「しくみ」の図（partials/auto_chart.html。固定の見本の SVG。色はここだけで決める） */
.app-chart { margin: 0; }
.app-chart__key { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 0 0 8px; font-size: 0.8125rem; }
.app-chart__swatch { display: inline-block; flex: none; }
.app-chart__swatch--line { width: 22px; height: 0; border-top: 3px solid var(--color-key-900); }
.app-chart__swatch--bar { width: 12px; height: 12px; margin-left: 10px; border-radius: 2px; background: var(--color-key-300); }
.app-chart__svg { display: block; width: 100%; height: auto; }
.app-chart__narrow { display: none; }
.app-chart .c-stop { fill: var(--app-sub); }
.app-chart .c-grid { stroke: var(--brand-line); stroke-width: 1; }
.app-chart .c-tick { fill: var(--brand-mute); }
.app-chart .c-tick--b { fill: var(--brand-ink); font-weight: 700; }
.app-chart .c-bar { fill: var(--color-key-300); }
.app-chart .c-bar--cap { fill: var(--color-key-1000); }
.app-chart .c-val, .app-chart .c-limt, .app-chart .c-lowt { paint-order: stroke; stroke: #fff; stroke-width: 3px; stroke-linejoin: round; }
.app-chart .c-val { fill: var(--color-key-1000); font-weight: 700; }
.app-chart .c-unit { fill: var(--brand-ink); font-weight: 700; }
.app-chart .c-val--cap { fill: var(--color-key-1200); }
.app-chart .c-lim { stroke: var(--color-primitive-red-900); stroke-width: 2; stroke-dasharray: 7 4; }
.app-chart .c-limt { fill: var(--color-primitive-red-1000); font-weight: 700; }
.app-chart .c-low { stroke: var(--color-key-900); stroke-width: 1; stroke-dasharray: 3 4; opacity: 0.6; }
.app-chart .c-lowt { fill: var(--color-key-1000); font-weight: 700; }
.app-chart .c-bal { fill: none; stroke: var(--color-key-900); stroke-width: 2.6; stroke-linejoin: round; }
.app-chart .c-mon { stroke: var(--brand-ink); stroke-width: 1; stroke-dasharray: 2 3; }
.app-chart .c-stopt { fill: var(--brand-ink); font-weight: 700; }
.app-chart .c-n--key, .app-chart .c-n--ok, .app-chart .c-n--cap { fill: var(--brand-ink); }
.app-chart .c-nt { fill: #fff; font-weight: 700; }
.app-chart__cap { margin: 4px 0 12px; font-size: 0.75rem; color: var(--brand-mute); }
.app-chart__steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: 0.9375rem; line-height: 1.7; }
.app-chart__steps li { display: flex; gap: 10px; align-items: flex-start; }
.app-chart__n { flex: none; width: 22px; height: 22px; margin-top: 2px; border-radius: 50%; color: #fff; font-size: 0.75rem; font-weight: 700; line-height: 22px; text-align: center; }
.app-chart__n--key, .app-chart__n--ok, .app-chart__n--cap { background: var(--brand-ink); }
@media (max-width: 640px) {
  .app-chart__wide { display: none; }
  .app-chart__narrow { display: block; }
}

/* --- API キーの一覧（/keys）。表は 390px では app-table の積み重ね（data-label）。長いキー・メールは折り返して横にはみ出させない --- */
.app-project-filter { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 0; min-width: 0; max-width: 100%; }
.app-project-filter .dads-select__control, .app-key-project-select .dads-select__control { min-width: 0; max-width: 100%; }
.app-project-filter__label { font-weight: 700; }
.app-project-filter__select { min-width: 0; max-width: 100%; }
.app-project-filter__select .dads-select__select { max-width: 100%; text-overflow: ellipsis; }
.app-key-project-select { min-width: 0; max-width: 100%; }
.app-key-project-select .dads-select__select { max-width: 100%; text-overflow: ellipsis; }
.app-keys-controls { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; }
.app-keys-controls__link, .app-keys-controls__link:hover { white-space: nowrap; text-decoration: none; font-weight: 700; }
.app-keys-controls > * { min-width: 0; max-width: 100%; }
.app-keys-empty { overflow-wrap: anywhere; }
.app-page-head > .app-actions { margin: 0; }
/* カード見出しは flex の子。長いキー名（空白なし 60 字）で縮めないと 390px で横にはみ出す */
.app-card__head > .app-card__title { min-width: 0; max-width: 100%; overflow-wrap: anywhere; }
.app-kv dd { min-width: 0; overflow-wrap: anywhere; }
.app-keys-filter { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 0; }
/* キー一覧（6 列）：固定の列幅で、横スクロールを出さない。長い名前・プロジェクト名・メールは折り返す。操作は右端の「操作 ▾」 */
.app-keys-table .dads-table__table { table-layout: fixed; width: 100%; }
.app-keys-table .dads-table__table th:nth-child(1) { width: 28%; }
.app-keys-table .dads-table__table th:nth-child(2) { width: 19%; }
.app-keys-table .dads-table__table th:nth-child(3) { width: 15%; }
.app-keys-table .dads-table__table th:nth-child(4) { width: 12%; }
.app-keys-table .dads-table__table th:nth-child(5) { width: 18%; }
.app-keys-table .dads-table__table th:nth-child(6) { width: 8%; }
.app-keys-table .dads-table__table td { overflow-wrap: anywhere; word-break: normal; padding: 12px 8px; font-size: 0.875rem; }
.app-keys-table .dads-table__table td:first-child, .app-keys-table .dads-table__table th:first-child { padding-left: 20px; }
.app-keys-table .dads-table__table td:last-child, .app-keys-table .dads-table__table th:last-child { padding-right: 20px; }
.dads-table.app-table.app-keys-table td[data-label]:not(.app-table__main) { white-space: normal; }
.app-keys-table .app-table__mono { font-size: 0.8125rem; overflow-wrap: anywhere; white-space: normal; }
.app-keys-cell { min-width: 0; flex: 1 1 auto; }
.app-keys-name { font-weight: 700; }
.app-keys-sub { margin: 2px 0 0; font-size: 0.75rem; }
.app-keys-table td.app-keys-table__act[data-label] { white-space: nowrap; overflow-wrap: normal; overflow: visible; }
/* 「操作 ▾」：<details>（JS なしでも開閉）。メニューは app-popover を右端にそろえて開く */
.app-opmenu { position: relative; display: inline-block; text-align: left; }
.app-opmenu .app-popover { right: 0; left: auto; min-width: 200px; z-index: 5; }
.app-opbtn {
  display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 12px;
  border: 1px solid var(--app-line-strong); border-radius: 8px; background: var(--app-surface, #fff);
  font-size: 0.8125rem; font-weight: 700; color: var(--brand-ink); cursor: pointer; list-style: none; white-space: nowrap;
}
.app-opbtn::-webkit-details-marker { display: none; }
.app-opbtn:hover, .app-opmenu[open] .app-opbtn { background: var(--app-sub); border-color: var(--color-key-900); }
.app-opmenu .app-popover__item--danger { color: var(--color-semantic-error-1); }
.app-opbtn:focus-visible { outline: 2px solid var(--color-key-900); outline-offset: 2px; }
.app-opbtn__caret { font-size: 0.7rem; color: var(--brand-mute); }
@media (max-width: 560px) {
  /* 行ごとのカード：文字は枠に収める（td[data-label] の nowrap を打ち消す）。メニューは画面の内側に開く */
  .dads-table.app-table.app-keys-table td[data-label]:not(.app-table__main), .app-keys-table .dads-table__table td { white-space: normal; overflow-wrap: anywhere; min-width: 0; }
  .dads-table.app-table.app-keys-table td.app-keys-table__act[data-label] { white-space: normal; overflow: visible; }
  .app-keys-table .dads-table__table td:first-child, .app-keys-table .dads-table__table td:last-child { padding-left: 0; padding-right: 0; }
  .app-keys-table td.app-keys-table__act:empty { display: none; }
  .app-opmenu .app-popover { left: 0; right: auto; max-width: calc(100vw - 48px); }
}
.app-projects-table td, .app-projects-table th { overflow-wrap: anywhere; }
.dads-table.app-table.app-projects-table td[data-label]:not(.app-table__ops) { white-space: normal; }
/* プロジェクトの操作：ボタンを間をあけて 1 行（入らなければ折り返す）。名前の変更を開くとフォームはボタンの下 */
.app-projects-ops { display: flex; flex-wrap: nowrap; align-items: center; justify-content: flex-end; gap: 8px; }
.app-projects-ops .dads-button { white-space: nowrap; }
@media (max-width: 640px) { .app-projects-ops { flex-wrap: wrap; justify-content: flex-start; } }

/* --- キーの作成（/keys。作った直後の 1 回だけの表示）。長い英数字のキーは折り返して 390px でもはみ出させない --- */
.app-key-secret { margin: 16px 0; padding: 12px 16px; border: 1px solid var(--app-line); border-radius: 8px; background: var(--app-surface-muted, rgb(0 0 0 / 0.04)); }
.app-key-secret__text { display: block; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.9375rem; line-height: 1.7; overflow-wrap: anywhere; word-break: break-all; user-select: all; }
/* 確認ダイアログ（失効・アーカイブ）：項目の表と警告の帯の間をあける。 */
.app-modal .app-kv + .app-callout { margin-top: 16px; }

/* ヘルプチップ（タイトルの横の「？ しくみ」）と、押すと開くフロート（popover）。位置は forms.js、狭い画面は下のシート。 */
.app-help-title { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.app-help-chip { display: inline-flex; align-items: center; gap: 5px; padding: 2px 10px 2px 5px; border: 1px solid var(--app-line-strong); border-radius: 999px; background: #fff; color: var(--brand-ink); font: inherit; font-size: 0.75rem; font-weight: 700; line-height: 1.5; cursor: pointer; }
.app-help-chip:hover { background: #EBEBF0; }
.app-help-chip[aria-expanded="true"], .app-help-chip:has(+ .app-help-pop:popover-open) { border-color: var(--color-key-900); background: var(--color-key-50, #F0EFFF); color: var(--color-key-900); }
.app-help-chip__mark { display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; border-radius: 50%; background: var(--color-key-900); color: #fff; font-size: 0.6875rem; line-height: 1; }
.app-help-pop { box-sizing: border-box; width: min(760px, calc(100vw - 32px)); max-height: calc(100vh - 32px); margin: 0; padding: 14px 16px; overflow: auto; border: 1px solid var(--app-line-strong); border-radius: 10px; background: #fff; color: var(--brand-ink); box-shadow: 0 8px 28px rgba(23, 44, 52, 0.22); }
.app-help-pop::backdrop { background: transparent; }
.app-help-pop__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 8px; }
.app-help-pop__title { margin: 0; font-size: 1rem; }
.app-help-pop__close { flex: none; width: 32px; height: 32px; border: 0; border-radius: 6px; background: transparent; color: var(--brand-mute); font: inherit; font-size: 1rem; cursor: pointer; }
.app-help-pop__close:hover { background: #EBEBF0; color: var(--brand-ink); }
@media (max-width: 640px) {
  .app-help-pop { inset: auto 0 0 0; width: 100%; max-width: none; max-height: 85vh; border-radius: 14px 14px 0 0; border-width: 1px 0 0; }
}

/* 自動チャージ：いまの設定の帯・購入の前の黄色の帯・未保存の表示・保存した直後の光り方。 */
.app-auto-sum { display: flex; align-items: flex-start; gap: 8px; margin: 0 0 16px; padding: 10px 14px; border: 1px solid var(--app-line); border-radius: 8px; background: #F1F1F4; color: var(--brand-ink); font-size: 0.875rem; line-height: 1.6; }
.app-auto-sum--on { border-color: var(--color-primitive-green-200); background: var(--color-primitive-green-50); color: var(--color-primitive-green-900); }
.app-auto-sum__mark { flex: none; font-weight: 700; }
.app-callout[data-auto-summary] { margin: 0 0 16px; }
.app-callout[data-auto-now] { margin: 0; }
.app-auto-actions { align-items: center; }
.app-auto-dirty { color: var(--color-primitive-yellow-1000, #7a5200); font-size: 0.8125rem; font-weight: 700; }
.app-auto-saved { color: var(--color-primitive-green-900); font-size: 0.8125rem; font-weight: 700; }
.app-auto-actions [data-auto-save]:disabled { opacity: 1; background: var(--color-neutral-solid-gray-400, #B3B3B3); border-color: var(--color-neutral-solid-gray-400, #B3B3B3); color: #fff; cursor: default; }
.is-flash { animation: app-auto-flash 1.8s ease-out 0.15s both; }
@keyframes app-auto-flash { from { box-shadow: 0 0 0 4px rgba(26, 140, 90, 0.4); } to { box-shadow: 0 0 0 0 rgba(26, 140, 90, 0); } }
@media (prefers-reduced-motion: reduce) { .is-flash { animation: none; } }
.app-callout[data-auto-now][hidden], .app-bill-note[data-auto-nonow][hidden] { display: none; }
.app-modal .app-kv + .app-help { margin-top: 12px; }
.app-help-pop__note { margin: 12px 0 0; padding: 8px 12px; border: 1px solid var(--color-key-200); border-radius: 8px; background: var(--color-key-50); font-size: 0.875rem; line-height: 1.7; }

/* 利用量（/usage）：絞り込みパネル（独立したカード）と結果カードを 24px 離す */
.um2-panel { margin: 0 0 24px; }
.um2-filter__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.um2-filter__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 24px; }
.um2-filter__actions .dads-button[data-type="text"] { min-width: 0; padding-left: 8px; padding-right: 8px; }

/* 結果カード：上段 = 結果の要約（左）と操作（右）、下 = 表。カードと注記は 16px */
.um2-results { margin-bottom: 16px; }
.um2-results__head .app-help { margin: 0; }
.um2-results__head .dads-button { flex: none; }

/* 表の見出しを画面に貼り付ける（広い画面のみ。表の横スクロール枠は外す） */
@media (min-width: 1100px) {
  .um2-results .dads-table.app-table { overflow: visible; }
  .um2-results .dads-table.app-table .dads-table__table th { position: sticky; top: 0; z-index: 1; box-shadow: 0 1px 0 var(--app-line); }
}
@media (max-width: 900px) {
  .um2-filter__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .um2-filter__grid { grid-template-columns: minmax(0, 1fr); }
  .um2-filter__actions { flex-direction: column; align-items: stretch; }
  .um2-filter__actions .dads-button { width: 100%; }
  .um2-results__head { flex-direction: column; align-items: stretch; }
  .um2-results__head .dads-button { width: 100%; }
}

/* アーカイブ済みのプロジェクトの折りたたみ（プロジェクトのページ。控えめな灰色。承認済みのモックの um3-quiet） */
.app-quiet { margin: 24px 0 0; border-top: 1px solid var(--app-line); }
.app-quiet__sum { cursor: pointer; list-style: none; padding: 16px 4px; color: var(--brand-mute); font-size: 0.9375rem; }
.app-quiet__sum::-webkit-details-marker { display: none; }
.app-quiet__sum::before { content: "▸ "; }
.app-quiet[open] > .app-quiet__sum::before { content: "▾ "; }
.app-quiet[open] { padding-bottom: 8px; }
.app-quiet__foot { margin: 0; padding: 16px 4px; }
.app-link-strong, .app-link-strong:hover { font-weight: 700; }

/* ホーム：直近 30 日のグラフ（縦軸・横軸・吹き出し。SVG はサーバーで描き、viewBox で幅に追従）・利用の多いキー・空の案内 */
.app-home-chart { position: relative; padding-top: 8px; }
.app-home-chart__sub { margin: 4px 0 0; }
.app-home-chart__total { text-align: right; line-height: 1.4; flex: none; }
.app-home-chart__total b { display: block; font-size: 1.25rem; }
.app-home-chart__svg { display: block; width: 100%; height: auto; }
.app-home-chart__grid { stroke: var(--app-line, #d8dbe3); stroke-width: 1; }
.app-home-chart__ytick, .app-home-chart__xtick { fill: var(--brand-mute); font-size: 11px; }
.app-home-chart__bar { fill: var(--color-key-900, #5b3fd4); opacity: 0.85; }
.app-home-chart__bar--zero { opacity: 0.3; }
.app-home-chart__bar:hover, .app-home-chart__bar:focus { opacity: 1; outline: none; }
.app-home-chart__bar:focus-visible { stroke: var(--brand-ink, #101828); stroke-width: 2; }
.app-home-chart__tip {
  position: absolute; transform: translate(-50%, -100%); z-index: 2; pointer-events: none;
  background: #101828; color: #fff; padding: 8px 12px; border-radius: 8px;
  font-size: 0.8125rem; line-height: 1.5; white-space: nowrap; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}
.app-home-chart__tip[hidden] { display: none; }
.app-home-chart__foot { padding: 12px 24px; border-top: 1px solid var(--app-line-soft); }
.app-home-note { margin: 16px 0; }
.app-home-tile__value--off { color: var(--app-off); }


/* メンバー（/organization/members）：タブ（メンバー／招待中）・件数・「…」メニュー・停止のラジオ・招待の結果。
   タブは請求のタブ（.app-tabs）をカードの中に置く形。メニューは <details> で JS なしで開閉する。 */
.app-tabs-wrap { padding-bottom: 0; }
.app-tabs--card { margin: 0; border-bottom: 0; }
.app-tabs--card .app-tabs__item { min-height: 44px; padding: 0 12px; }
.app-count {
  display: inline-block;
  min-width: 24px;
  padding: 0 8px;
  border-radius: 12px;
  background: var(--app-sub);
  font-size: 0.8125rem;
  font-weight: 700;
  line-height: 1.6;
  text-align: center;
}

/* ==========================================================================
   MCP 連携（stream 3。UI-3 で「組織の設定」のタブになった。モックの um3-*・um4-* を、既存の命名・トークンに合わせて取り込む）
   タブは .um3-tabs（組織の設定のタブ・ツールのタブ）。有効・無効は、行動を書いたボタン（有効にする＝POST、無効にする＝確認ページへのリンク）。
   ========================================================================== */
.app-card .app-tabs-wrap + .dads-table.app-table { border-top: 1px solid var(--app-line); }
.app-foot { margin: 0; padding: 16px 20px; }
.app-menu { position: relative; display: inline-block; text-align: left; }
.app-menu[open] .app-onboarding__toggle { background: var(--app-sub); }
.app-menu .app-popover { right: 0; left: auto; min-width: 220px; z-index: 5; }
.app-popover__item--danger { color: var(--color-semantic-error-1); }

/* 停止・リセットの確かめ：情報の下の注意の帯と、この人が作ったキー（ラジオ 2 つ） */
.app-card__body .app-kv + .dads-notification-banner.app-callout { margin-top: 16px; }
.app-card__body .dads-notification-banner.app-callout + .app-help,
.app-card__body .dads-notification-banner.app-callout + form { margin-top: 16px; }
.app-radios { min-width: 0; margin: 16px 0 0; padding: 0; border: 0; }
.app-radios__legend { margin-bottom: 8px; padding: 0; font-weight: 700; }
.app-radio {
  display: block;
  margin-bottom: 8px;
  padding: 12px;
  border: 1px solid var(--app-field-line);
  border-radius: var(--app-radius-control);
}
.app-radio small { display: block; margin-left: 24px; color: var(--brand-mute); }

/* 招待の結果（宛先ごとの 1 行） */
.app-results { margin: 0 0 16px; padding: 0; list-style: none; }
.app-results__item { display: flex; flex-wrap: wrap; gap: 4px 16px; padding: 10px 0; border-bottom: 1px solid var(--app-line-soft); }
.app-results__item:last-child { border-bottom: 0; }
.app-results__mail { font-weight: 700; overflow-wrap: anywhere; }
.app-results__text { color: var(--brand-mute); }
.app-results__text--ok { color: var(--color-primitive-green-800); }
.app-results__text--warn { color: var(--color-primitive-yellow-1000); }

@media (max-width: 640px) {
  .app-foot { padding: 16px; }
  .app-tabs-wrap { padding-left: 8px; padding-right: 8px; }
  .app-menu .app-popover { min-width: 200px; }
}

.app-mcp__act { display: flex; justify-content: space-between; align-items: center; gap: 16px 24px; flex-wrap: wrap; }
.app-mcp__act-t { margin: 0; min-width: 0; flex: 1 1 280px; }
.app-mcp__act .dads-button { text-decoration: none; }
.app-mcp__alt { margin: 8px 0 0; }
.app-mcp__kv { margin: 0 0 16px; }
.app-mcp__steps { padding-left: 24px; line-height: 1.9; }
.app-mcp__steps li { margin: 12px 0; }
.app-mcp__consent-set { margin: 0; padding: 0; border: 0; }
.app-mcp__consent-act { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 12px; margin-top: 8px; }

/* 監査ログ（/audit）：プランの帯・タブ・詳細・ページ送り（手本 m7-audit-*.html の um3.css のうち必要な分） */
.um3-infobar { margin: 0 0 16px; padding: 12px 16px; border: 1px solid var(--color-key-200); border-radius: 8px; background: var(--color-key-50); line-height: 1.7; }
.um3-sep { margin-bottom: 16px; }
.um3-tabs-wrap { padding-bottom: 0; }
.um3-tabs { display: flex; flex-wrap: wrap; gap: 24px; border-bottom: 1px solid var(--app-line); }
.um3-tab { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 4px; margin-bottom: -1px; border-bottom: 3px solid transparent; color: var(--brand-mute); font-weight: 700; text-decoration: none; }
.um3-tab[aria-current="page"] { color: var(--brand-ink); border-bottom-color: var(--color-key-900); }
.um3-h3 { margin: 24px 0 8px; font-size: 1rem; }
.um3-h3--first { margin-top: 0; }
.um3-kv0 { margin: 0 0 16px; }
.um3-link { color: var(--color-key-900); font-weight: 700; }
.um3-detail { margin-top: 4px; font-size: 0.8125rem; }
.um3-detail > summary { cursor: pointer; color: var(--color-key-900); }
.um3-detail__list { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 2px 12px; margin: 8px 0 0; }
.um3-detail__list dt { color: var(--brand-mute); }
.um3-detail__list dd { margin: 0; overflow-wrap: anywhere; }
.um3-pager { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 12px; padding: 16px 24px; border-top: 1px solid var(--app-line); }
.um2-results .dads-table__table td:first-child, .um2-results .dads-table__table th:first-child { white-space: nowrap; }
@media (min-width: 901px) {
  .um2-filter__grid.um3-grid4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .um3-pager { flex-direction: column; align-items: stretch; }
  .um3-pager .dads-button { width: 100%; }
}
.um2-panel .app-help { margin: 0 0 16px; }
.um2-filter__grid + .app-help, .um2-filter__actions + .app-help { margin: 16px 0 0; }

/* 監査ログの表：枠を突き抜けない（承認済みのモックの um4-audit）。
   操作ログは 5 列（日時・操作した人（IP アドレスを下に小さく）・操作・対象・結果）の固定の比率（11 / 27 / 26 / 24 / 12 %）で、長い文言は折り返す。
   API アクセスログ・書き出しは列が多いので、表の外側を横スクロールの枠にする（ページ全体は横にはみ出さない）。 */
.app-audit .dads-table.app-table { overflow-x: auto; }
.app-audit--events .dads-table__table { table-layout: fixed; width: 100%; }
.app-audit--events .dads-table__table th:nth-child(1) { width: 11%; }
.app-audit--events .dads-table__table th:nth-child(2) { width: 27%; }
.app-audit--events .dads-table__table th:nth-child(3) { width: 26%; }
.app-audit--events .dads-table__table th:nth-child(4) { width: 24%; }
.app-audit--events .dads-table__table th:nth-child(5) { width: 12%; }
.app-audit--events .dads-table__table th, .app-audit--events .dads-table__table td { padding-left: 8px; padding-right: 8px; }
.app-audit--events .dads-table__table th:first-child, .app-audit--events .dads-table__table td:first-child { padding-left: 20px; }
.app-audit--events .dads-table__table th:last-child, .app-audit--events .dads-table__table td:last-child { padding-right: 20px; }
.app-audit--events .dads-table__table td { overflow-wrap: anywhere; font-size: 0.8125rem; }
.app-audit--events .dads-table.app-table td[data-label], .app-audit--events .dads-table__table td:first-child { white-space: normal; }
.app-audit__cell { display: block; min-width: 0; }
.app-audit__l1, .app-audit__sub { display: block; overflow-wrap: anywhere; }
.app-audit__sub { margin: 2px 0 0; font-size: 0.75rem; }
.app-audit .app-table__mono { overflow-wrap: anywhere; }
/* 「詳細」は 1 文字ずつ折り返さない */
.um3-detail > summary { white-space: nowrap; min-width: 3em; }
/* API アクセスログは 9 列：操作ログと同じ固定レイアウトで枠に収める（日時・リクエスト ID・キー・モデルは省略表示、IP は収まる幅を取る） */
.app-audit--access .dads-table__table { table-layout: fixed; width: 100%; }
.app-audit--access .dads-table__table th:nth-child(1) { width: 11%; }
.app-audit--access .dads-table__table th:nth-child(2) { width: 12%; }
.app-audit--access .dads-table__table th:nth-child(3) { width: 12%; }
.app-audit--access .dads-table__table th:nth-child(4) { width: 14%; }
.app-audit--access .dads-table__table th:nth-child(5) { width: 8%; }
.app-audit--access .dads-table__table th:nth-child(6) { width: 7%; }
.app-audit--access .dads-table__table th:nth-child(7) { width: 11%; }
.app-audit--access .dads-table__table th:nth-child(8) { width: 8%; }
.app-audit--access .dads-table__table th:nth-child(9) { width: 17%; }
.app-audit--access .dads-table__table th, .app-audit--access .dads-table__table td { padding-left: 8px; padding-right: 8px; }
.app-audit--access .dads-table__table th:first-child, .app-audit--access .dads-table__table td:first-child { padding-left: 20px; }
.app-audit--access .dads-table__table th:last-child, .app-audit--access .dads-table__table td:last-child { padding-right: 20px; }
.app-audit--access .dads-table__table td { font-size: 0.8125rem; }
.app-audit--access .dads-table__table th { white-space: normal; }
.app-audit--access .dads-table.app-table td[data-label] { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.app-audit--access .dads-table.app-table td[data-label="IP アドレス"], .app-audit--access .dads-table.app-table td[data-label="結果"] { overflow: visible; }
.app-audit--access .app-audit__sub { white-space: normal; }
@media (max-width: 640px) {
  .app-audit--access .dads-table__table { table-layout: auto; }
  .app-audit--access .dads-table__table th, .app-audit--access .dads-table__table td,
  .app-audit--access .dads-table__table td:first-child, .app-audit--access .dads-table__table td:last-child { width: auto; padding-left: 0; padding-right: 0; }
  .app-audit--access .dads-table.app-table td[data-label] { white-space: normal; overflow: visible; text-overflow: clip; }
}
@media (max-width: 640px) {
  .app-audit--events .dads-table__table { table-layout: auto; }
  .app-audit--events .dads-table__table th, .app-audit--events .dads-table__table td,
  .app-audit--events .dads-table__table td:first-child, .app-audit--events .dads-table__table td:last-child { width: auto; padding-left: 0; padding-right: 0; }
}

/* ==========================================================================
   組織の設定（UI-3）：タブ・契約プランのカード（手本 m8-org-basic*.html・m11-org-basic-ded.html の um4-*）
   ========================================================================== */
.app-orgtabs { margin: 0 0 16px; }
.app-card__sub { margin: 4px 0 0; }
.app-plan { border-left: 4px solid var(--app-line-strong); }
.app-plan--ent { border-left-color: var(--color-key-900); background: var(--color-key-50); }
.app-plan--ded { border-left-color: #0f766e; background: #f0faf8; }
.app-plan__body { display: flex; justify-content: space-between; align-items: center; gap: 24px; flex-wrap: wrap; padding: 20px 24px; }
.app-plan__label { margin: 0; font-size: 0.8125rem; color: var(--brand-mute); }
.app-plan__name { margin: 0; font-size: 2rem; font-weight: 700; line-height: 1.3; overflow-wrap: anywhere; }
.app-plan--ent .app-plan__name { color: var(--color-key-900); }
.app-plan--ded .app-plan__name { color: #0f766e; }
/* スマホ幅：行ごとのカードの中で、ラベルと値が枠の外に出ない（既存の td[data-label] の nowrap を、この画面の表だけ打ち消す） */
@media (max-width: 560px) {
  .app-table--wrap td { min-width: 0; }
  .app-table--wrap td[data-label]:not(.app-table__main) { white-space: normal; overflow-wrap: anywhere; min-width: 0; }
  .app-plan__body { padding: 16px; }
  .app-plan__name { font-size: 1.5rem; }
  .app-orgtabs, .um3-tabs { gap: 16px; }
}

/* メトリクス連携の「提供するメトリクス」: 名前はアンダースコアの後ろ（<wbr>）だけで折り返す。ラベルは空白で折り返す */
.dads-table.app-table td[data-label].app-metrics__labels { white-space: normal; overflow-wrap: normal; }
.app-table .app-metrics__name { overflow-wrap: normal; word-break: normal; }
@media (max-width: 560px) {
  .app-table .app-metrics__name { overflow-wrap: anywhere; }
}

/* MCP の中継画面（mcp_redirect）: 3 秒のカウントダウン。リング・数字・ステップだけ。meta refresh の 3 秒と同期。JS なし。 */
.app-relay__who { margin: 0 0 16px; font-size: 0.9375rem; line-height: 1.7; overflow-wrap: anywhere; }
.app-relay__who code { font-size: 0.875em; }
.app-relay__count { display: flex; align-items: center; gap: 16px; margin: 0 0 16px; }
.app-relay__hint { font-size: 0.875rem; color: var(--brand-mute); }
.app-relay__still { display: none; }
.app-relay__ring { position: relative; flex: none; width: 64px; height: 64px; }
.app-relay__ring svg { display: block; transform: rotate(-90deg); }
.app-relay__ring circle { fill: none; stroke-width: 6; }
.app-relay__ring-bg { stroke: var(--color-key-100); }
.app-relay__ring-fg { stroke: var(--color-key-900); stroke-linecap: round; stroke-dasharray: 176; stroke-dashoffset: 0; animation: app-relay-ring 3s linear forwards; }
.app-relay__num { position: absolute; inset: 0; display: grid; place-items: center; font-size: 1.4rem; font-weight: 700; color: var(--brand-ink); }
.app-relay__num::after { content: "3"; animation: app-relay-num 3s steps(1) forwards; }
@keyframes app-relay-ring { from { stroke-dashoffset: 0; } to { stroke-dashoffset: 176; } }
@keyframes app-relay-num { 0% { content: "3"; } 33.3% { content: "2"; } 66.6% { content: "1"; } 100% { content: "0"; } }
.app-relay__steps { display: flex; flex-wrap: wrap; gap: 8px 20px; margin: 0 0 20px; padding: 0; list-style: none; font-size: 0.875rem; color: var(--brand-mute); }
.app-relay__step { display: flex; align-items: center; gap: 8px; }
.app-relay__dot { display: grid; place-items: center; flex: none; width: 22px; height: 22px; border: 2px solid var(--brand-mute); border-radius: 50%; font-size: 0.75rem; font-weight: 700; }
.app-relay__step--done { color: var(--brand-ink); }
.app-relay__step--done .app-relay__dot { border-color: var(--color-primitive-green-800); background: var(--color-primitive-green-800); color: #fff; }
.app-relay__step--now { color: var(--brand-ink); font-weight: 700; }
.app-relay__step--now .app-relay__dot { border-color: var(--color-key-900); color: var(--color-key-900); animation: app-relay-pulse 1s ease-in-out infinite; }
@keyframes app-relay-pulse { 50% { box-shadow: 0 0 0 6px var(--color-key-100); } }
@media (max-width: 560px) {
  .app-relay__steps { flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) {
  .app-relay__ring-fg { animation: none; stroke-dashoffset: 176; }
  .app-relay__num { display: none; }
  .app-relay__step--now .app-relay__dot { animation: none; }
  .app-relay__still { display: inline; }
}

/* 組織のコンソール用の IP 制限で断られたページ（403）。接続元は長い IPv6 でも枠の中で折り返し、操作はスマホ幅で縦に積む */
.app-ip-blocked__ip {
  font-family: var(--font-family-mono);
  font-weight: 700;
  color: var(--brand-ink, inherit);
  overflow-wrap: anywhere;
  word-break: break-all;
}
.app-ip-blocked__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin: 0;
}
.app-ip-blocked__actions form { margin: 0; }
@media (max-width: 480px) {
  .app-ip-blocked__actions { flex-direction: column; align-items: stretch; }
  .app-ip-blocked__actions .dads-button { width: 100%; justify-content: center; }
}

/* 組織のセキュリティ */
.app-ip__form, .app-ip__add, .app-ip__check {
  display: grid;
  gap: 1rem;
}
.app-ip__line, .app-ip__check-row, .app-ip__ack {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}
.app-ip__line, .app-ip__table td {
  overflow-wrap: anywhere;
}
.app-ip__box {
  padding: 1rem;
  border-radius: 0.5rem;
}
.app-ip__box--danger, .app-ip__errs {
  color: var(--color-primitive-red-1000);
  background: var(--color-primitive-red-50);
}
.app-ip__notes {
  margin-block-start: 1rem;
  padding-inline-start: 1.5rem;
}

.app-guard-options {
  min-inline-size: 0;
  margin: 0;
  padding: 1rem;
  border: 1px solid var(--app-line);
  border-radius: var(--app-radius-control);
}
.app-guard-options legend { padding-inline: 0.25rem; font-weight: 700; }
.app-guard-options__choices { display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; }
.app-guard-options__value { margin: 0; }
.app-guard-options label { display: flex; align-items: baseline; gap: 0.375rem; }
.app-guard-options > label { margin-block-start: 0.75rem; }

/* API キーのタブ、ネットワークポリシー、プロジェクトの操作欄。 */
.app-key-tabs { margin-bottom: 16px; }
.app-network-toolbar > p { margin: 0; }
.app-network-toolbar > .dads-button,
.app-keys-controls > .app-actions { margin-left: auto; }
.app-project-toolbar { padding-top: 12px; padding-bottom: 8px; }
.app-network-standard { padding-top: 0; }
dialog.app-network-editor--form { max-width: 680px; }
.app-network-editor .app-field { margin-bottom: 12px; }
.app-network-editor fieldset { margin-bottom: 12px; }
.app-network-states { display: grid; gap: 10px; }
.app-network-states label { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: start; gap: 8px; }
.app-network-states input { margin: 0.25em 0 0; }
.app-network-states .app-help { display: block; margin-top: 2px; }
.app-network-entry { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; gap: 8px 12px; align-items: end; margin-block-end: 12px; }
.app-network-entry label { min-width: 0; display: grid; gap: 4px; }
.app-network-entry .dads-input-text__input { width: 100%; min-width: 0; }
.app-network-entry > button { min-height: 2.5rem; }
.app-network-addresses summary { cursor: pointer; }
.app-network-addresses ul { margin: 4px 0 0; padding-inline-start: 1em; }
.app-network-addresses code { overflow-wrap: anywhere; }
.app-network-actions { display: flex; flex-wrap: wrap; gap: 4px 12px; }
.app-network-policies .app-help { margin-block: 0; }
@media (max-width: 540px) {
  dialog.app-network-editor--form { padding: 16px; }
  .app-network-entry { grid-template-columns: minmax(0, 1fr) auto; }
  .app-network-entry label:first-child { grid-column: 1 / -1; }
  .app-network-entry + .app-network-entry { border-top: 1px solid var(--app-line); padding-top: 12px; }
}

/* Seven columns share the same table with the network policy feature on. */
.app-key-list--policy .app-keys-table .dads-table__table th:nth-child(1) { width: 22%; }
.app-key-list--policy .app-keys-table .dads-table__table th:nth-child(2) { width: 17%; }
.app-key-list--policy .app-keys-table .dads-table__table th:nth-child(3) { width: 13%; }
.app-key-list--policy .app-keys-table .dads-table__table th:nth-child(4) { width: 11%; }
.app-key-list--policy .app-keys-table .dads-table__table th:nth-child(5) { width: 13%; }
.app-key-list--policy .app-keys-table .dads-table__table th:nth-child(6) { width: 13%; }
.app-key-list--policy .app-keys-table .dads-table__table th:nth-child(7) { width: 11%; }
