/* ==========================================================================
   AI営業部 商売繁盛 — デザインシステム
   配色: 藍（主操作・進捗）/ 朱（対応が必要なものだけ）/ 若竹（完了）/ 金茶（注意）
   書体: BIZ UDPGothic（UI全般）/ BIZ UDPMincho（屋号ロゴ・公開ページ見出し・法務文書見出し）
   朱は「要返信」「お支払いの問題」「エラー」にだけ使う。装飾に使わない。
   ========================================================================== */

:root {
  color-scheme: light;

  /* ink */
  --ink: #1a1d24;
  --ink-2: #454c5a;
  --ink-3: #737a88;
  --ink-4: #9aa0ab;

  /* surfaces */
  --paper: #f2f4f7;
  --surface: #ffffff;
  --surface-2: #f8f9fb;
  --line: #e1e5eb;
  --line-strong: #c8ced8;

  /* 藍 primary */
  --ai: #1f3f6e;
  --ai-700: #16304f;
  --ai-500: #2f5a94;
  --ai-100: #dfe8f3;
  --ai-50: #eef3f9;

  /* 朱 attention */
  --shu: #c23b2c;
  --shu-700: #9e2c20;
  --shu-50: #fbeeec;

  /* 若竹 success */
  --take: #2b7a57;
  --take-50: #e6f2ec;

  /* 金茶 warning */
  --kin: #9a6212;
  --kin-50: #fbf2e2;

  --font-ui: "BIZ UDPGothic", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", "Meiryo", sans-serif;
  --font-mark: "BIZ UDPMincho", "Hiragino Mincho ProN", "Yu Mincho", serif;

  --fs-xs: 12px;
  --fs-sm: 13px;
  --fs-md: 15px;
  --fs-lg: 17px;
  --fs-xl: 20px;
  --fs-2xl: 26px;
  --fs-3xl: 34px;

  --r-sm: 4px;
  --r-md: 6px;
  --r-lg: 10px;

  --sidebar-w: 236px;
  --content-max: 1080px;
  --focus: 0 0 0 3px rgba(47, 90, 148, 0.35);
  --shadow-pop: 0 12px 32px rgba(20, 30, 50, 0.16), 0 2px 6px rgba(20, 30, 50, 0.08);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: var(--fs-md);
  line-height: 1.75;
  font-feature-settings: "palt" 0;
  -webkit-font-smoothing: antialiased;
}

img,
svg {
  max-width: 100%;
}

a {
  color: var(--ai-500);
  text-underline-offset: 3px;
}
a:hover {
  color: var(--ai);
}

:focus-visible {
  outline: none;
  box-shadow: var(--focus);
  border-radius: var(--r-sm);
}

[hidden] {
  display: none !important;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  line-height: 1.45;
  font-weight: 700;
  color: var(--ink);
}

p {
  margin: 0;
}

.num {
  font-variant-numeric: tabular-nums;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* --------------------------------------------------------------------------
   屋号ロゴ
   -------------------------------------------------------------------------- */
.wordmark {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  color: var(--ink);
  text-decoration: none;
  line-height: 1;
}
.wordmark:hover {
  color: var(--ink);
}
.wordmark-sub {
  font-size: 11px;
  color: var(--ink-3);
  letter-spacing: 0.08em;
}
.wordmark-main {
  font-family: var(--font-mark);
  font-weight: 700;
  font-size: 22px;
  letter-spacing: 0.12em;
}
.wordmark-seal {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 5px;
  background: var(--shu);
  color: #fff;
  font-family: var(--font-mark);
  font-weight: 700;
  font-size: 15px;
  line-height: 1;
  align-self: center;
}

/* --------------------------------------------------------------------------
   ボタン
   -------------------------------------------------------------------------- */
.btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: var(--r-md);
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}
.btn:disabled,
.btn[aria-disabled="true"] {
  opacity: 0.5;
  cursor: not-allowed;
}
.btn-primary {
  background: var(--ai);
  color: #fff;
}
.btn-primary:hover:not(:disabled) {
  background: var(--ai-700);
  color: #fff;
}
.btn-secondary {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--line-strong);
}
.btn-secondary:hover:not(:disabled) {
  background: var(--surface-2);
  color: var(--ink);
  border-color: var(--ink-4);
}
.btn-ghost {
  background: transparent;
  color: var(--ai-500);
}
.btn-ghost:hover:not(:disabled) {
  background: var(--ai-50);
  color: var(--ai);
}
.btn-danger {
  background: var(--surface);
  color: var(--shu);
  border-color: #e7b9b2;
}
.btn-danger:hover:not(:disabled) {
  background: var(--shu-50);
  color: var(--shu-700);
}
.btn-sm {
  min-height: 32px;
  padding: 0 12px;
  font-size: 13px;
}
.btn-lg {
  min-height: 48px;
  padding: 0 26px;
  font-size: 15px;
}
.btn-block {
  display: flex;
  width: 100%;
}
.btn[aria-busy="true"] {
  position: relative;
  color: transparent !important;
  pointer-events: none;
}
.btn[aria-busy="true"]::after {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-color: rgba(255, 255, 255, 0.9) rgba(255, 255, 255, 0.9) rgba(255, 255, 255, 0.3) rgba(255, 255, 255, 0.3);
  animation: spin 0.7s linear infinite;
}
.btn-secondary[aria-busy="true"]::after,
.btn-ghost[aria-busy="true"]::after,
.btn-danger[aria-busy="true"]::after {
  border-color: var(--ink-3) var(--ink-3) var(--line) var(--line);
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
.btn-row.end {
  justify-content: flex-end;
}

/* --------------------------------------------------------------------------
   フォーム
   -------------------------------------------------------------------------- */
.form-stack {
  display: grid;
  gap: 20px;
}
fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}
legend {
  padding: 0;
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}
.form-grid .span-2 {
  grid-column: 1 / -1;
}
.field {
  display: grid;
  gap: 6px;
  align-content: start;
}
.field-label {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
}
.field-req {
  margin-left: 6px;
  font-size: 11px;
  font-weight: 700;
  color: var(--shu);
}
.field-opt {
  margin-left: 6px;
  font-size: 11px;
  font-weight: 400;
  color: var(--ink-3);
}
.field-hint {
  font-size: var(--fs-sm);
  color: var(--ink-3);
  line-height: 1.6;
}
.field-error {
  font-size: var(--fs-sm);
  color: var(--shu);
  line-height: 1.6;
}
.input,
.select,
.textarea {
  width: 100%;
  min-height: 42px;
  padding: 9px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 15px;
  line-height: 1.5;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}
.input::placeholder,
.textarea::placeholder {
  color: var(--ink-4);
}
.input:hover,
.select:hover,
.textarea:hover {
  border-color: var(--ink-4);
}
.input:focus,
.select:focus,
.textarea:focus {
  outline: none;
  border-color: var(--ai-500);
  box-shadow: var(--focus);
}
.input[aria-invalid="true"],
.select[aria-invalid="true"],
.textarea[aria-invalid="true"] {
  border-color: var(--shu);
}
.input[readonly],
.textarea[readonly] {
  background: var(--surface-2);
}
.textarea {
  min-height: 140px;
  resize: vertical;
}
.select {
  appearance: none;
  padding-right: 36px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23737a88' stroke-width='1.6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}
.check {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 14px;
  line-height: 1.6;
  cursor: pointer;
}
.check input {
  width: 18px;
  height: 18px;
  margin: 2px 0 0;
  accent-color: var(--ai);
  flex: none;
}

/* 選択カード（プラン選択・営業地域など） */
.choice-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}
.choice {
  position: relative;
  display: block;
  padding: 16px 18px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-lg);
  background: var(--surface);
  cursor: pointer;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}
.choice:hover {
  border-color: var(--ink-4);
}
.choice input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.choice:has(input:checked) {
  border-color: var(--ai);
  box-shadow: inset 0 0 0 1px var(--ai);
  background: var(--ai-50);
}
.choice:has(input:focus-visible) {
  box-shadow: var(--focus);
}

/* --------------------------------------------------------------------------
   パネル・区切り
   -------------------------------------------------------------------------- */
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
}
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}
.panel-title {
  font-size: var(--fs-lg);
  font-weight: 700;
}
.panel-desc {
  margin-top: 2px;
  font-size: var(--fs-sm);
  color: var(--ink-3);
}
.panel-body {
  padding: 20px;
}
.panel-foot {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 20px;
  border-top: 1px solid var(--line);
  background: var(--surface-2);
  border-radius: 0 0 var(--r-lg) var(--r-lg);
}
.panel + .panel,
.stack > * + * {
  margin-top: 20px;
}
.stack-sm > * + * {
  margin-top: 10px;
}

.divider {
  height: 1px;
  background: var(--line);
  border: 0;
  margin: 20px 0;
}

.kv {
  display: grid;
  grid-template-columns: minmax(120px, 180px) 1fr;
  margin: 0;
}
.kv dt,
.kv dd {
  margin: 0;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}
.kv dt {
  color: var(--ink-3);
}
.kv dd {
  color: var(--ink);
  word-break: break-word;
}
.kv > :nth-last-child(-n + 2) {
  border-bottom: 0;
}

.muted {
  color: var(--ink-3);
}
.small {
  font-size: var(--fs-sm);
}
.text-attention {
  color: var(--shu);
}
.text-success {
  color: var(--take);
}

/* --------------------------------------------------------------------------
   バッジ・アラート
   -------------------------------------------------------------------------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  background: var(--surface-2);
  color: var(--ink-2);
  border: 1px solid var(--line);
}
.badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.badge-plain::before {
  display: none;
}
.badge-attention {
  background: var(--shu-50);
  color: var(--shu);
  border-color: #f1cdc7;
}
.badge-success {
  background: var(--take-50);
  color: var(--take);
  border-color: #c7e2d4;
}
.badge-warning {
  background: var(--kin-50);
  color: var(--kin);
  border-color: #efd9b0;
}
.badge-info {
  background: var(--ai-50);
  color: var(--ai-500);
  border-color: var(--ai-100);
}

.alert {
  display: grid;
  grid-template-columns: 4px 1fr;
  gap: 14px;
  padding: 14px 16px;
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: 14px;
  line-height: 1.7;
}
.alert::before {
  content: "";
  border-radius: 2px;
  background: var(--ink-4);
}
.alert-title {
  font-weight: 700;
}
.alert-info {
  background: var(--ai-50);
  border-color: var(--ai-100);
}
.alert-info::before {
  background: var(--ai-500);
}
.alert-success {
  background: var(--take-50);
  border-color: #c7e2d4;
}
.alert-success::before {
  background: var(--take);
}
.alert-warning {
  background: var(--kin-50);
  border-color: #efd9b0;
}
.alert-warning::before {
  background: var(--kin);
}
.verify-notice {
  margin-bottom: 20px;
}
.verify-notice-body {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
}
.verify-notice-body p {
  margin: 0;
}
.alert-error {
  background: var(--shu-50);
  border-color: #f1cdc7;
}
.alert-error::before {
  background: var(--shu);
}

/* --------------------------------------------------------------------------
   表
   -------------------------------------------------------------------------- */
.table-wrap {
  width: 100%;
  overflow-x: auto;
}
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.table th,
.table td {
  padding: 12px 16px;
  text-align: left;
  vertical-align: middle;
  border-bottom: 1px solid var(--line);
}
.table th {
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-3);
  background: var(--surface-2);
  white-space: nowrap;
}
.table tbody tr:last-child td {
  border-bottom: 0;
}
.table tr.is-link {
  cursor: pointer;
}
.table tr.is-link:hover td {
  background: var(--ai-50);
}
.table td.num,
.table th.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.table .cell-strong {
  font-weight: 700;
  color: var(--ink);
}
.table .cell-sub {
  display: block;
  font-size: 12px;
  color: var(--ink-3);
}

/* --------------------------------------------------------------------------
   空状態・読み込み
   -------------------------------------------------------------------------- */
.empty {
  padding: 40px 24px;
  text-align: center;
}
.empty-title {
  font-size: var(--fs-lg);
  font-weight: 700;
}
.empty-text {
  max-width: 440px;
  margin: 8px auto 0;
  font-size: 14px;
  color: var(--ink-3);
}
.empty .btn-row {
  justify-content: center;
  margin-top: 18px;
}

.skeleton {
  display: block;
  height: 14px;
  border-radius: 4px;
  background: linear-gradient(90deg, #eceff3 0%, #f5f7f9 50%, #eceff3 100%);
  background-size: 200% 100%;
  animation: shimmer 1.3s ease infinite;
}
@keyframes shimmer {
  to {
    background-position: -200% 0;
  }
}

.spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid var(--line);
  border-top-color: var(--ai-500);
  animation: spin 0.8s linear infinite;
  vertical-align: middle;
}

/* --------------------------------------------------------------------------
   ステップ表示（申込の流れ。実際に順番があるものだけに使う）
   -------------------------------------------------------------------------- */
.steps {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 0;
  margin: 0 0 24px;
  padding: 0;
  list-style: none;
  counter-reset: step;
}
.steps li {
  counter-increment: step;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 8px 0 0;
  font-size: 13px;
  color: var(--ink-3);
  white-space: nowrap;
}
.steps li + li::before {
  content: "";
  width: 14px;
  height: 1px;
  background: var(--line-strong);
  margin-right: 4px;
}
.steps li > span::before {
  content: counter(step);
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  margin-right: 8px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-3);
}
.steps li.is-done > span::before {
  content: "";
  background: var(--take) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='10' viewBox='0 0 12 10'%3E%3Cpath d='M1 5l3.2 3L11 1.5' fill='none' stroke='white' stroke-width='2'/%3E%3C/svg%3E") no-repeat center;
  border-color: var(--take);
}
.steps li.is-current {
  color: var(--ink);
  font-weight: 700;
}
.steps li.is-current > span::before {
  background: var(--ai);
  border-color: var(--ai);
  color: #fff;
}

/* --------------------------------------------------------------------------
   数取り（今回サイクルの新規営業枠。1マス=1社）
   -------------------------------------------------------------------------- */
.tally {
  display: grid;
  grid-template-columns: repeat(50, minmax(0, 1fr));
  gap: 3px;
}
.tally i {
  display: block;
  aspect-ratio: 1 / 2.4;
  border-radius: 2px;
  background: var(--line);
}
.tally i.on {
  background: var(--ai);
}
.tally i.on:nth-child(10n) {
  background: var(--ai-700);
}
.tally.is-300 {
  grid-template-columns: repeat(60, minmax(0, 1fr));
  gap: 2px;
}
@media (max-width: 640px) {
  .tally,
  .tally.is-300 {
    grid-template-columns: repeat(25, minmax(0, 1fr));
  }
}

/* --------------------------------------------------------------------------
   チャット（返信スレッド）
   -------------------------------------------------------------------------- */
.chat {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.chat-msg {
  max-width: min(640px, 88%);
}
.chat-msg.is-out {
  align-self: flex-end;
}
.chat-msg.is-in {
  align-self: flex-start;
}
.chat-meta {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 6px;
  font-size: 12px;
  color: var(--ink-3);
}
.chat-msg.is-out .chat-meta {
  justify-content: flex-end;
}
.chat-bubble {
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: 14px;
  line-height: 1.85;
  white-space: pre-wrap;
  word-break: break-word;
}
.chat-msg.is-out .chat-bubble {
  background: var(--ai-50);
  border-color: var(--ai-100);
  border-top-right-radius: 4px;
}
.chat-msg.is-in .chat-bubble {
  border-top-left-radius: 4px;
}
.chat-quoted {
  margin-top: 12px;
  border-top: 1px dashed var(--line);
  padding-top: 8px;
  white-space: normal;
}
.chat-quoted > summary {
  cursor: pointer;
  width: fit-content;
  font-size: 12px;
  color: var(--ink-3);
}
.chat-quoted > summary:hover {
  color: var(--ink-2);
}
.chat-quoted-text {
  margin-top: 8px;
  padding-left: 12px;
  border-left: 2px solid var(--line);
  color: var(--ink-3);
  font-size: 13px;
  white-space: pre-wrap;
}

/* --------------------------------------------------------------------------
   トースト・ダイアログ
   -------------------------------------------------------------------------- */
.toast-host {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 1000;
  display: grid;
  gap: 8px;
  max-width: min(380px, calc(100vw - 40px));
}
.toast {
  padding: 12px 16px;
  border-radius: var(--r-md);
  background: var(--ink);
  color: #fff;
  font-size: 14px;
  line-height: 1.6;
  box-shadow: var(--shadow-pop);
  animation: toast-in 0.18s ease-out;
}
.toast.is-error {
  background: var(--shu-700);
}
.toast.is-success {
  background: var(--take);
}
@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
}

dialog.modal {
  width: min(480px, calc(100vw - 32px));
  padding: 0;
  border: 0;
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-pop);
  color: var(--ink);
}
dialog.modal::backdrop {
  background: rgba(20, 26, 38, 0.45);
}
.modal-body {
  padding: 22px 22px 8px;
}
.modal-title {
  font-size: var(--fs-lg);
  font-weight: 700;
}
.modal-text {
  margin-top: 8px;
  font-size: 14px;
  color: var(--ink-2);
  white-space: pre-wrap;
}
.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 22px 20px;
}

/* ==========================================================================
   アプリの枠（ログイン後）
   ========================================================================== */
.shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  min-height: 100vh;
}
.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding: 22px 14px 16px;
  background: var(--surface);
  border-right: 1px solid var(--line);
  overflow-y: auto;
}
.sidebar-brand {
  padding: 0 8px 22px;
}
.nav {
  display: grid;
  gap: 2px;
}
.nav-group {
  margin-top: 18px;
  padding: 0 10px 6px;
  font-size: 12px;
  color: var(--ink-4);
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  padding: 0 10px;
  border-radius: var(--r-md);
  color: var(--ink-2);
  font-size: 14px;
  text-decoration: none;
}
.nav-item svg {
  width: 18px;
  height: 18px;
  flex: none;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.nav-item:hover {
  background: var(--surface-2);
  color: var(--ink);
}
.nav-item.is-active {
  background: var(--ai-50);
  color: var(--ai);
  font-weight: 700;
}
.nav-count {
  margin-left: auto;
  min-width: 22px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--shu);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  line-height: 20px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.nav-count.is-quiet {
  background: var(--line);
  color: var(--ink-2);
}
.sidebar-foot {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.account {
  display: grid;
  gap: 2px;
  padding: 6px 10px 10px;
}
.account-name {
  font-size: 14px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.account-mail {
  font-size: 12px;
  color: var(--ink-3);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sidebar-legal {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  padding: 10px 10px 0;
  font-size: 11px;
}
.sidebar-legal a {
  color: var(--ink-3);
  text-decoration: none;
}
.sidebar-legal a:hover {
  color: var(--ink);
  text-decoration: underline;
}

.main {
  min-width: 0;
  padding: 32px 40px 80px;
}
.main-inner {
  max-width: var(--content-max);
  margin: 0 auto;
}
.main-inner.is-narrow {
  max-width: 760px;
}

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px 24px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}
.page-title {
  font-size: var(--fs-2xl);
  letter-spacing: 0.02em;
}
.page-desc {
  margin-top: 6px;
  font-size: 14px;
  color: var(--ink-3);
  max-width: 64ch;
}
.page-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
  font-size: 13px;
  color: var(--ink-3);
  text-decoration: none;
}
.page-back:hover {
  color: var(--ink);
}

.subnav {
  display: flex;
  gap: 4px;
  margin: -8px 0 24px;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
}
.subnav a,
.subnav button {
  appearance: none;
  background: none;
  border: 0;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  padding: 10px 14px;
  font: inherit;
  font-size: 14px;
  color: var(--ink-3);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}
.subnav a:hover,
.subnav button:hover {
  color: var(--ink);
}
.subnav .is-active {
  color: var(--ai);
  border-bottom-color: var(--ai);
  font-weight: 700;
}

/* 指標の並び */
.metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
}
.metric {
  padding: 16px 20px;
}
.metric + .metric {
  border-left: 1px solid var(--line);
}
.metric-label {
  font-size: 13px;
  color: var(--ink-3);
}
.metric-value {
  margin-top: 2px;
  font-size: var(--fs-2xl);
  font-weight: 700;
  line-height: 1.3;
  font-variant-numeric: tabular-nums;
}
.metric-unit {
  margin-left: 4px;
  font-size: 13px;
  font-weight: 400;
  color: var(--ink-3);
}

.topbar {
  display: none;
}

@media (max-width: 960px) {
  .shell {
    grid-template-columns: 1fr;
  }
  .topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 56px;
    padding: 0 16px;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
  }
  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 60;
    width: min(300px, 86vw);
    transform: translateX(-102%);
    transition: transform 0.2s ease;
    box-shadow: var(--shadow-pop);
  }
  body.nav-open .sidebar {
    transform: none;
  }
  .nav-scrim {
    position: fixed;
    inset: 0;
    z-index: 55;
    background: rgba(20, 26, 38, 0.4);
  }
  .main {
    padding: 24px 16px 64px;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .metric + .metric {
    border-left: 0;
    border-top: 1px solid var(--line);
  }
  .kv {
    grid-template-columns: 1fr;
  }
  .kv dt {
    padding-bottom: 0;
    border-bottom: 0;
  }
  .kv dd {
    padding-top: 2px;
  }
}
@media (min-width: 961px) {
  .nav-scrim {
    display: none;
  }
}

.icon-btn {
  appearance: none;
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: var(--r-md);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}
.icon-btn:hover {
  background: var(--surface-2);
}
.icon-btn svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
}

/* ==========================================================================
   公開ページ（トップ・ログイン・法務文書）
   ========================================================================== */
.public {
  background: var(--surface);
}
.public-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: saturate(1.4) blur(8px);
  border-bottom: 1px solid var(--line);
}
.public-header-inner,
.public-container {
  max-width: 1120px;
  margin: 0 auto;
  padding-inline: 24px;
}
.public-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 64px;
}
.public-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}
.public-nav .text-link {
  padding: 8px 10px;
  font-size: 14px;
  color: var(--ink-2);
  text-decoration: none;
}
.public-nav .text-link:hover {
  color: var(--ink);
}
.wordmark,
.public-nav .text-link {
  white-space: nowrap;
}
@media (max-width: 640px) {
  .public-nav .text-link.hide-sm,
  .public-header .wordmark-sub {
    display: none;
  }
  .public-nav {
    gap: 4px;
  }
  .public-header-inner,
  .public-container {
    padding-inline: 16px;
  }
}

.public-footer {
  margin-top: 96px;
  padding-block: 40px;
  background: var(--paper);
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--ink-3);
}
.public-footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
}
.footer-links a {
  color: var(--ink-2);
  text-decoration: none;
}
.footer-links a:hover {
  color: var(--ink);
  text-decoration: underline;
}
.footer-operator {
  line-height: 1.8;
}
.data-attribution {
  margin-top: 40px;
  margin-bottom: 12px;
  font-size: 11px;
  line-height: 1.7;
  color: var(--ink-3);
  overflow-wrap: anywhere;
}
.data-attribution a {
  color: inherit;
}
.public-footer .data-attribution {
  margin-top: 0;
}

/* 認証画面 */
.auth {
  min-height: calc(100vh - 64px);
  display: grid;
  place-items: start center;
  padding: 56px 16px 40px;
  background: var(--paper);
}
.auth-card {
  width: min(440px, 100%);
  padding: 32px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
}
.auth-title {
  font-size: var(--fs-xl);
}
.auth-desc {
  margin-top: 6px;
  font-size: 14px;
  color: var(--ink-3);
}
.auth-alt {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  font-size: 14px;
  text-align: center;
  color: var(--ink-3);
}
@media (max-width: 480px) {
  .auth-card {
    padding: 24px 20px;
  }
}

/* 法務文書 */
.legal {
  max-width: 760px;
  margin: 0 auto;
  padding: 56px 24px 0;
}
.legal-title {
  font-family: var(--font-mark);
  font-size: var(--fs-3xl);
  letter-spacing: 0.06em;
}
.legal-meta {
  margin-top: 10px;
  font-size: 13px;
  color: var(--ink-3);
}
.legal-body {
  margin-top: 36px;
  font-size: 15px;
  line-height: 1.95;
  color: var(--ink-2);
}
.legal-body h2 {
  margin: 40px 0 12px;
  font-size: var(--fs-lg);
  color: var(--ink);
}
.legal-body h3 {
  margin: 24px 0 8px;
  font-size: 15px;
  color: var(--ink);
}
.legal-body p + p {
  margin-top: 12px;
}
.legal-body ol,
.legal-body ul {
  margin: 10px 0;
  padding-left: 1.6em;
}
.legal-body li + li {
  margin-top: 6px;
}
.legal-body table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.legal-body th,
.legal-body td {
  padding: 14px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
.legal-body th {
  width: 32%;
  color: var(--ink);
  font-weight: 700;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* --------------------------------------------------------------------------
   スマホの実機対応（0925 「スマホの時終わってんな」）
   PCのChromeでは見えず、iPhoneで壊れる3点をまとめて直す。
   1) 入力欄の文字が16px未満だと、iOSのSafariは入力欄をタップした時に画面を勝手に拡大し、そのままずれる
   2) フッターの規約リンク・パスワード表示ボタンなど、指で押せない小ささ（14〜32px）
   3) 進捗（.steps）の折り返しで、つなぎ線が行頭に残る
   -------------------------------------------------------------------------- */
@media (max-width: 760px) {
  .input,
  .select,
  .textarea,
  input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
  select,
  textarea {
    font-size: 16px;
  }
  /* 指で押せる大きさ（目安44px）。文中のリンクは崩さず、フッター・サイドバー下部の並びだけ広げる */
  .footer-links a,
  .sidebar-legal a,
  .public-footer .footer-operator a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding-inline: 4px;
  }
  .footer-links { gap: 0 14px; }
  .btn-sm {
    min-height: 40px;   /* 「パスワードを表示する」など小さめのボタンも、指で押せる高さに */
  }
  a, button, summary, label, [role="tab"], [role="button"] {
    touch-action: manipulation;   /* ダブルタップでの拡大待ちをなくす */
  }
  /* 進捗: つなぎ線をやめ、2列に整列（折り返しで線が行頭に残らない） */
  .steps {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 12px;
  }
  .steps li {
    padding: 0;
    white-space: normal;
  }
  .steps li + li::before {
    display: none;
  }
}

/* ==========================================================================
   営業先（v1.2 第1弾）: 一覧・詳細・送信の方法
   既存のトークン・コンポーネントを使い、足りない部品だけをここに足す（既存のルールは変えない）。
   ========================================================================== */

/* --- 一覧: 絞り込み・状態タブ ------------------------------------------- */
.tg-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px 16px;
  margin-bottom: 20px;
}
.tg-filters .field {
  flex: 1 1 180px;
  min-width: 0;
}
.tg-filters .field.is-search {
  flex: 2 1 280px;
}
.tg-filters .field.is-check {
  flex: 0 0 auto;
}
.tg-filters .check {
  align-items: center;
  min-height: 42px;
}
.tg-search {
  display: flex;
  gap: 8px;
}
.tg-search .input {
  flex: 1;
  min-width: 0;
}
.subnav-count {
  margin-left: 6px;
  font-size: 12px;
  font-weight: 400;
  color: var(--ink-4);
  font-variant-numeric: tabular-nums;
}
.subnav .is-active .subnav-count {
  color: var(--ai-500);
}
.subnav .has-attention .subnav-count {
  color: var(--shu);
  font-weight: 700;
}

/* --- 一覧: 表（PC）とカード（スマホ） ------------------------------------ */
.tg-list {
  overflow: hidden;
}
.tg-bulk {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
  font-size: 14px;
}
.tg-table td,
.tg-table th {
  overflow-wrap: anywhere;
}
.tg-table .col-status {
  width: 1%;
  white-space: nowrap;
}
.tg-table .col-time {
  width: 1%;
  white-space: nowrap;
  color: var(--ink-3);
}
.tg-table .col-actions {
  width: 1%;
  white-space: nowrap;
}
.tg-status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.tg-signal {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border-radius: var(--r-sm);
  background: var(--ai-50);
  color: var(--ai-500);
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}
.tg-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}
.tg-card {
  display: grid;
  gap: 4px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}
.tg-card:last-child {
  border-bottom: 0;
}
.tg-card-name {
  font-weight: 700;
  color: var(--ink);
  overflow-wrap: anywhere;
  text-decoration: none;
}
.tg-card-meta {
  font-size: 13px;
  color: var(--ink-3);
  overflow-wrap: anywhere;
  word-break: keep-all;
}
.tg-card-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 12px;
}
.tg-card-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 4px;
}
.tg-pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--ink-3);
}
.tg-list.is-refreshing {
  opacity: 0.6;
  pointer-events: none;
}

/* --- 詳細 ----------------------------------------------------------------- */
.tg-detail {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 20px;
  align-items: start;
}
.tg-detail > * {
  min-width: 0;
}
.tg-detail .kv {
  grid-template-columns: 9.5em minmax(0, 1fr);
}
.tg-link {
  max-width: 100%;
  overflow-wrap: anywhere;
}
.tg-news {
  margin: 0;
  padding: 0;
  list-style: none;
}
.tg-news li {
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.tg-news li:first-child {
  padding-top: 0;
}
.tg-news li:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}
.tg-news-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  margin-bottom: 4px;
  font-size: 12px;
  color: var(--ink-3);
}
.tg-news-text {
  font-size: 14px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.tg-why {
  margin: 0;
  padding-left: 1.3em;
  font-size: 14px;
}
.tg-why li + li {
  margin-top: 6px;
}
.tg-ops {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* 文面のプレビュー・編集。宛名と署名は自動で付くので、薄い地で「触れない」ことを示す */
.mail {
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface);
  overflow: hidden;
}
.mail-subject {
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  font-weight: 700;
  overflow-wrap: anywhere;
}
.mail-label {
  display: block;
  margin-bottom: 2px;
  font-size: 12px;
  font-weight: 400;
  color: var(--ink-4);
}
.mail-part {
  padding: 12px 16px;
  font-size: 14px;
  line-height: 1.85;
}
.mail-part.is-fixed {
  background: var(--surface-2);
  color: var(--ink-3);
  font-size: 13px;
  line-height: 1.7;
}
.mail-part + .mail-part {
  border-top: 1px solid var(--line);
}
.mail-text {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.mail-edit {
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.mail-edit .textarea {
  min-height: 240px;
}
.mail-subject-edit {
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}
.mail-reasons {
  margin: 6px 0 0;
  padding-left: 1.2em;
}
.mail-reasons li + li {
  margin-top: 4px;
}

@media (max-width: 1160px) {
  .tg-detail {
    grid-template-columns: minmax(0, 1fr);
  }
}
@media (max-width: 960px) {
  .tg-detail .kv {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 760px) {
  .tg-link {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
  }
  /* 状態タブ: 横にスクロールさせず、折り返して全部見せる */
  .tg-tabs {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
    margin-top: 0;
    border-bottom: 0;
    overflow: visible;
  }
  .tg-tabs button {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    column-gap: 4px;
    min-height: 44px;
    margin: 0;
    padding: 4px 4px;
    border: 1px solid var(--line-strong);
    border-radius: var(--r-md);
    background: var(--surface);
    font-size: 13px;
    line-height: 1.3;
  }
  .tg-tabs button.is-active {
    border-color: var(--ai);
    background: var(--ai-50);
  }
  .tg-tabs .subnav-count {
    margin-left: 0;
  }
  .tg-filters .field,
  .tg-filters .field.is-search {
    flex: 1 1 100%;
  }
  .tg-filters .field.is-check {
    flex: 1 1 100%;
  }
  .tg-filters .check {
    min-height: 44px;
  }
  .tg-search .btn,
  .tg-card .btn,
  .tg-pager .btn,
  .tg-bulk .btn,
  .tg-ops .btn {
    min-height: 44px;
  }
  .tg-bulk .btn {
    width: 100%;
  }
  .tg-ops {
    flex-direction: column;
  }
  .tg-ops .btn {
    width: 100%;
  }
  .mail-part,
  .mail-subject,
  .mail-edit,
  .mail-subject-edit {
    padding-inline: 12px;
  }
}

/* ==========================================================================
   ナレッジ・文面の設定（v1.2 第2弾）
   既存のトークン・コンポーネントを使い、足りない部品だけをここに足す（既存のルールは変えない）。
   ========================================================================== */

/* --- 共通: メール未確認の案内・入力欄・文字数 -------------------------------- */
.kn-gate {
  margin-bottom: 20px;
}
.kn-fieldset > legend {
  margin-bottom: 8px;
}
.kn-fieldset .field-hint {
  margin-top: 8px;
}
.kn-choices {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.kn-choices .choice {
  min-height: 44px;
}
.kn-choices .sendmode-name {
  display: block;
  font-weight: 700;
}
.kn-choices .sendmode-desc {
  display: block;
  margin-top: 4px;
  font-size: var(--fs-sm);
  color: var(--ink-3);
  line-height: 1.6;
}
.kn-scope {
  display: flex;
  flex-wrap: wrap;
  gap: 0 24px;
}
.kn-scope-item {
  align-items: center;
  min-height: 44px;
}
.kn-file {
  width: 100%;
  min-height: 44px;
  padding: 5px 8px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 15px;
}
.kn-file::file-selector-button {
  min-height: 32px;
  margin-right: 12px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  background: var(--surface-2);
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}
.kn-count {
  font-size: var(--fs-sm);
  color: var(--ink-3);
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.kn-count.is-over {
  color: var(--shu);
  font-weight: 700;
}
.kn-actions .btn {
  min-width: 140px;
}
.kn-stale {
  padding: 8px 12px;
  border-radius: var(--r-md);
  background: var(--kin-50);
  color: var(--kin);
}

/* --- ナレッジ: 使用量・一覧・空の状態 ---------------------------------------- */
.kn-usage {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.kn-usage-text {
  font-size: 14px;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}
.kn-usage-text.is-near {
  font-weight: 700;
  color: var(--kin);
}
.kn-usage-note {
  flex: 1 1 100%;
}
.kn-list {
  margin: 0;
  padding: 0;
  list-style: none;
}
.kn-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.kn-item:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}
.kn-item-main {
  flex: 1 1 auto;
  min-width: 0;
}
.kn-item-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;
}
.kn-item-title {
  overflow-wrap: anywhere;
}
.kn-item-meta {
  margin-top: 2px;
  overflow-wrap: anywhere;
}
.kn-item-preview {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  margin-top: 6px;
  overflow: hidden;
  overflow-wrap: anywhere;
  font-size: 14px;
  color: var(--ink-2);
}
.kn-item-actions {
  display: flex;
  flex: none;
  gap: 8px;
}
.kn-empty {
  padding: 20px 8px;
  text-align: center;
}
.kn-empty-body {
  margin-top: 10px;
}
.kn-examples {
  display: inline-block;
  margin: 6px 0 0;
  padding-left: 1.3em;
  text-align: left;
  font-size: 14px;
  color: var(--ink-2);
}

/* 本文を読むダイアログ（長い時は中で縦にスクロールする） */
dialog.modal-wide {
  width: min(720px, calc(100vw - 32px));
}
dialog.modal-wide[open] {
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
}
dialog.modal-wide .modal-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
}
dialog.modal-wide .modal-foot {
  flex: none;
}
.kn-view-title,
.kn-view-meta {
  overflow-wrap: anywhere;
}
.kn-view-text {
  margin: 12px 0 8px;
  font-size: 14px;
  line-height: 1.85;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* --- 文面の設定: 本文・差し込み・注意書き ------------------------------------ */
.ms-body {
  min-height: 260px;
  line-height: 1.7;
}
.ms-ph {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface-2);
}
.ms-ph-title {
  font-size: var(--fs-md);
}
.ms-ph-list {
  display: grid;
  gap: 10px;
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
}
.ms-ph-item {
  display: grid;
  grid-template-columns: 9.5em minmax(0, 1fr);
  gap: 4px 12px;
  align-items: start;
}
.ms-ph-btn {
  justify-content: center;
  justify-self: start;
  min-width: 8.5em;
  min-height: 36px;
}
.ms-ph-text {
  display: grid;
  gap: 0;
  font-size: 14px;
  overflow-wrap: anywhere;
}
.ms-notes {
  margin: 0;
  padding-left: 1.3em;
  color: var(--ink-2);
}
.ms-notes li + li {
  margin-top: 4px;
}

@media (max-width: 760px) {
  .kn-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .kn-actions .btn,
  .kn-item-actions .btn,
  .ms-ph-btn,
  dialog.modal .modal-foot .btn {
    min-height: 44px;
  }
  .kn-item {
    flex-direction: column;
  }
  .kn-item-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }
  .ms-ph-item {
    grid-template-columns: minmax(0, 1fr);
  }
  #kn-heading .page-back,
  #ms-heading .page-back {
    min-height: 44px;
    margin-bottom: 4px;
  }
}
@media (max-width: 480px) {
  .kn-choices {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* 1009 スマホ: ログイン・新規登録の補助リンクと同意欄のリンクを押しやすく（44px） */
@media (max-width: 760px) {
  .auth-alt a, .check a { min-height: 44px; display: inline-flex; align-items: center; }
}

/* ==========================================================================
   UI 作り替え 第1弾（0926）: 骨格・営業状況・営業先
   既存のクラス名は変えず、ここで上書きして足す。ログイン後の画面（layouts/app.html が付ける body.app）
   だけに効かせる。公開ページ（トップLP・ログイン・新規登録・規約 = body.public）と運営管理には効かせない。
   トークン（--ink-3 など）は :root ではなく body.app の中だけで上書きする。:where() で特異度を上げないので、
   各ページの <style> に書いた個別の指定はそのまま勝つ。

   方針: 藍・朱の配色とフォントは維持。密度・階層・幅・コントラスト・情報の選び方を変える。
   文字は本文15px・表とカード内の補助14px・最小13px（12pxは使わない）。補助色は白地で 4.5:1 以上。
   装飾（グラデーション・重ねた影・過剰な角丸）は使わない。
   ========================================================================== */

body.app {
  --paper: #eef1f5;
  --ink-2: #3a4150;
  --ink-3: #5b6270;   /* 白地 6.1:1 / 背景(paper)上 5.4:1 */
  --ink-4: #667080;   /* 入力例・ラベル。白地 5.0:1 */
  --line: #dbe0e7;
  --line-strong: #c1c8d3;
  --kin: #8a5610;     /* 金茶（白抜き文字 6.1:1・金茶の地の上 5.5:1） */
  --take: #24704f;
  --content-max: 1280px;
  --sidebar-w: 232px;
  --r-lg: 8px;
  --fs-xs: 13px;
  --fs-sm: 14px;
  --shadow-card: 0 1px 2px rgba(20, 30, 50, 0.05);
  line-height: 1.65;
}

/* --- 文字の下限 ------------------------------------------------------------- */
:where(body.app) .wordmark-sub,
:where(body.app) .nav-group,
:where(body.app) .field-req,
:where(body.app) .field-opt,
:where(body.app) .sidebar-legal,
:where(body.app) .data-attribution,
:where(body.app) .table .cell-sub,
:where(body.app) .chat-meta,
:where(body.app) .chat-quoted > summary,
:where(body.app) .subnav-count,
:where(body.app) .mail-label,
:where(body.app) .tg-news-head,
:where(body.app) .account-mail {
  font-size: 13px;
}
:where(body.app) .data-attribution {
  margin-top: 32px;
  line-height: 1.7;
}

/* --- カード・見出し ---------------------------------------------------------- */
:where(body.app) .panel,
:where(body.app) .metrics {
  box-shadow: var(--shadow-card);
}
:where(body.app) .panel-head {
  padding: 14px 20px;
}
:where(body.app) .panel-title {
  font-size: 16px;
  line-height: 1.5;
}
:where(body.app) .panel-desc {
  font-size: 14px;
}
:where(body.app) .panel-body {
  padding: 18px 20px;
}
:where(body.app) .panel + .panel,
:where(body.app) .stack > * + * {
  margin-top: 16px;
}
:where(body.app) .empty {
  padding: 32px 24px;
}
:where(body.app) .empty-title {
  font-size: 16px;
}
:where(body.app) .empty-text {
  font-size: 14px;
}
:where(body.app) .alert {
  font-size: 15px;
  padding: 14px 18px;
}
:where(body.app) .field-hint,
:where(body.app) .field-error,
:where(body.app) .small {
  font-size: 14px;
}

/* --- 状態のチップ（色と文言で分かる。色だけに頼らない） ---------------------- */
:where(body.app) .badge {
  height: 26px;
  padding: 0 10px;
  font-size: 13px;
  background: #e9edf2;
  color: var(--ink-2);
  border-color: #d3d9e2;
}
:where(body.app) .badge-attention {
  background: var(--shu-50);
  color: #a5301f;
  border-color: #efc4bd;
}
:where(body.app) .badge-success {
  background: var(--take-50);
  color: var(--take);
  border-color: #bfdccc;
}
:where(body.app) .badge-warning {
  background: var(--kin-50);
  color: var(--kin);
  border-color: #ebd0a0;
}
:where(body.app) .badge-info {
  background: var(--ai-50);
  color: var(--ai);
  border-color: #c9d8ea;
}
:where(body.app) .tg-signal {
  height: 24px;
  font-size: 13px;
  background: #fff;
  border: 1px solid #c9d8ea;
  color: var(--ai);
}

/* --- ボタン ------------------------------------------------------------------ */
:where(body.app) .btn-sm {
  min-height: 34px;
  font-size: 14px;
}

/* --- 表 ---------------------------------------------------------------------- */
:where(body.app) .table th {
  padding: 10px 16px;
  font-size: 13px;
  color: var(--ink-2);
  border-bottom-color: var(--line-strong);
}
:where(body.app) .table td {
  padding: 12px 16px;
}
:where(body.app) .table .cell-strong {
  text-decoration: none;
}
:where(body.app) .table tr.is-link:hover .cell-strong {
  color: var(--ai-500);
  text-decoration: underline;
}

/* --- サイドバー -------------------------------------------------------------- */
:where(body.app) .sidebar {
  padding: 20px 12px 14px;
}
:where(body.app) .sidebar-brand {
  padding: 2px 10px 20px;
}
:where(body.app) .nav-item {
  position: relative;
  min-height: 42px;
  padding: 0 12px;
  font-size: 15px;
  color: var(--ink-2);
}
:where(body.app) .nav-item.is-active {
  background: var(--ai-50);
  color: var(--ai);
}
:where(body.app) .nav-item.is-active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 9px;
  bottom: 9px;
  width: 3px;
  border-radius: 2px;
  background: var(--ai);
}
:where(body.app) .nav-count {
  min-width: 24px;
  height: 22px;
  font-size: 13px;
  line-height: 22px;
}
/* 件数の色は、チップと同じ意味にする: 承認待ち・手動送信=金茶（操作待ち）、返信=朱、お知らせ=藍 */
:where(body.app) .nav-count[data-count="pending_approval"],
:where(body.app) .nav-count[data-count="manual_pending"] {
  background: var(--kin);
}
:where(body.app) .nav-count[data-count="notifications"] {
  background: var(--ai);
}
:where(body.app) .account-name {
  font-size: 15px;
}

/* --- 本文の幅・ページ見出し（見出しは左・そのページの主な操作は右で1行） ------- */
:where(body.app) .main {
  padding: 24px 32px 64px;
}
:where(body.app) .page-head {
  align-items: center;
  gap: 12px 24px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line-strong);
}
:where(body.app) .page-head:has(+ .subnav) {
  padding-bottom: 0;
  margin-bottom: 8px;
  border-bottom: 0;
}
:where(body.app) .page-head > div:first-child {
  display: flex;
  flex: 1 1 320px;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0 14px;
  min-width: 0;
}
:where(body.app) .page-head > div:first-child > .page-back {
  flex: 0 0 100%;
}
:where(body.app) .page-title {
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  font-size: 22px;
  line-height: 1.45;
  letter-spacing: 0.02em;
  white-space: nowrap;
  text-overflow: ellipsis;
}
:where(body.app) .page-desc {
  margin-top: 0;
  font-size: 14px;
  max-width: none;
}
:where(body.app) .page-back {
  margin-bottom: 4px;
  font-size: 14px;
  color: var(--ink-3);
}
:where(body.app) .page-head > :not(:first-child) {
  margin-left: auto;
}
:where(body.app) .steps li {
  font-size: 14px;
}

/* --- タブ（サブナビ）と件数 -------------------------------------------------- */
:where(body.app) .subnav a,
:where(body.app) .subnav button {
  padding: 10px 16px;
  font-size: 15px;
  color: var(--ink-2);
}
:where(body.app) .subnav .is-active {
  color: var(--ai);
}
:where(body.app) .subnav-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 22px;
  margin-left: 8px;
  padding: 0 7px;
  border-radius: 11px;
  background: #e3e8ee;
  color: var(--ink-2);
  font-weight: 700;
  line-height: 1;
}
:where(body.app) .subnav .is-active .subnav-count {
  background: var(--ai);
  color: #fff;
}
:where(body.app) .subnav .has-attention .subnav-count {
  background: var(--kin);
  color: #fff;
}

/* --- 営業状況: 送信の状態バナー ---------------------------------------------- */
.send-banner {
  --c: var(--ink-3);
  --c-bg: #eef1f5;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: inset 4px 0 0 var(--c), var(--shadow-card);
}
.send-banner .icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: var(--r-md);
  background: var(--c-bg);
  color: var(--c);
}
.send-banner .icon svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.send-banner-title {
  font-size: 17px;
  font-weight: 700;
  line-height: 1.5;
}
.send-banner-detail {
  margin-top: 2px;
  font-size: 15px;
  line-height: 1.65;
  color: var(--ink-2);
  overflow-wrap: anywhere;
}
.send-banner.is-sending {
  --c: var(--ai);
  --c-bg: var(--ai-50);
}
.send-banner.is-restricted {
  --c: var(--kin);
  --c-bg: #f6e6c6;
  background: var(--kin-50);
  border-color: #ebd0a0;
}
.send-banner.is-paused {
  --c: var(--shu);
  --c-bg: #f6dcd8;
  background: var(--shu-50);
  border-color: #efc4bd;
}
.send-banner.is-error {
  --c: var(--ink-4);
}

/* --- 営業状況: 数字の4枚 ----------------------------------------------------- */
.kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}
.kpi {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 16px 20px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--shadow-card);
  color: var(--ink);
  text-decoration: none;
}
a.kpi:hover {
  border-color: var(--ink-4);
  color: var(--ink);
}
.kpi-label {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.5;
  color: var(--ink-2);
}
.kpi-value {
  margin-top: 4px;
  font-size: 32px;
  font-weight: 700;
  line-height: 1.25;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.kpi-value small {
  margin-left: 6px;
  font-size: 16px;
  font-weight: 400;
  color: var(--ink-3);
}
.kpi-sub {
  margin-top: auto;
  padding-top: 8px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink-3);
}
.kpi-bar {
  height: 6px;
  margin-top: 10px;
  border-radius: 3px;
  background: var(--line);
  overflow: hidden;
}
.kpi-bar > i {
  display: block;
  height: 100%;
  border-radius: 3px;
  background: var(--ai);
}
.kpi.is-warn {
  border-color: #ebd0a0;
}
.kpi.is-warn .kpi-value,
.kpi-sub.is-warn {
  color: var(--kin);
}
.kpi.is-alert .kpi-value,
.kpi-sub.is-alert {
  color: var(--shu);
}
.kpi-sub.is-warn,
.kpi-sub.is-alert {
  font-weight: 700;
}

/* --- 営業状況: 直近の営業先と返信 -------------------------------------------- */
.dash-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}
.dash-grid > * {
  min-width: 0;
  margin-top: 0 !important;
}
.panel-head .panel-link {
  flex: none;
  font-size: 14px;
  white-space: nowrap;
}
.dash-table td {
  padding-block: 10px;
}
.dash-table .cell-sub {
  display: inline-block;
  margin-left: 10px;
  white-space: nowrap;
}
.dash-table .col-route,
.dash-table .col-time {
  width: 1%;
  white-space: nowrap;
  color: var(--ink-3);
}
.dash-table .col-status {
  width: 1%;
  white-space: nowrap;
}
.reply-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  text-decoration: none;
}
.reply-row:last-child {
  border-bottom: 0;
}
.reply-row:hover {
  background: var(--ai-50);
}
.reply-row strong {
  flex: 1 1 100%;
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 15px;
}
.panel-note {
  padding: 16px 20px;
  font-size: 14px;
  color: var(--ink-3);
}

/* 畳んでおく詳細（処理の状況） */
.fold > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 48px;
  padding: 10px 20px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}
.fold > summary::-webkit-details-marker {
  display: none;
}
.fold > summary::after {
  content: "";
  flex: none;
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--ink-3);
  border-bottom: 2px solid var(--ink-3);
  transform: rotate(45deg);
  transition: transform 0.15s ease;
}
.fold[open] > summary::after {
  transform: rotate(-135deg);
}
.fold[open] > summary {
  border-bottom: 1px solid var(--line);
}
.fold-desc {
  margin-bottom: 8px;
  font-size: 14px;
  color: var(--ink-3);
}
.fold .kv dt,
.fold .kv dd {
  padding: 10px 0;
}

/* 営業状況の骨組み（読み込み中） */
.skeleton-card {
  display: block;
  height: 84px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
}
.skeleton-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}
.skeleton-kpis .skeleton-card {
  height: 128px;
}

/* --- 営業先の一覧 ------------------------------------------------------------ */
:where(body.app) .tg-filters {
  align-items: center;
  gap: 10px 16px;
  margin-bottom: 16px;
}
:where(body.app) .tg-filters .field {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 1 auto;
}
:where(body.app) .tg-filters .field.is-search {
  flex: 1 1 320px;
}
:where(body.app) .tg-filters .field.is-search .field-label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
:where(body.app) .tg-filters .field-label {
  flex: none;
  font-size: 14px;
  font-weight: 400;
  color: var(--ink-2);
  white-space: nowrap;
}
:where(body.app) .tg-filters .select {
  width: auto;
  min-width: 190px;
}
:where(body.app) .tg-search {
  flex: 1;
  min-width: 0;
}
:where(body.app) .tg-tabs {
  margin: 0 0 16px;
}
:where(body.app) .tg-bulk {
  padding: 12px 20px;
  background: var(--kin-50);
  color: var(--ink);
}
.tg-table .col-place {
  min-width: 260px;
}
.tg-table .col-industry {
  color: var(--ink-2);
}
.tg-table .col-route,
.tg-table .col-signal {
  width: 1%;
  white-space: nowrap;
  color: var(--ink-2);
}
.tg-table .col-time {
  color: var(--ink-3);
}
.tg-table .cell-name {
  display: block;
  font-size: 15px;
}
.tg-table .cell-sub {
  margin-top: 1px;
}
.tg-table .is-none {
  color: var(--ink-4);
}
:where(body.app) .tg-pager {
  padding: 12px 20px;
  font-size: 14px;
}
:where(body.app) .tg-card {
  gap: 6px;
  padding: 14px 16px;
}
:where(body.app) .tg-card-name {
  font-size: 15px;
}
:where(body.app) .tg-card-meta {
  font-size: 14px;
}

/* --- 営業先の詳細 ------------------------------------------------------------ */
.tg-detail {
  grid-template-columns: minmax(380px, 4fr) minmax(0, 8fr);
  grid-template-areas: "side main";
  gap: 16px;
}
/* 縦の間隔は gap で持つ（隠れた要素が間に入っても、先頭の余白が空かない） */
.tg-detail > .tg-main,
.tg-detail > .tg-side {
  display: grid;
  gap: 16px;
  align-content: start;
}
.tg-detail > .tg-main > *,
.tg-detail > .tg-side > * {
  margin-top: 0;
}
.tg-detail > .tg-main {
  grid-area: main;
}
.tg-detail > .tg-side {
  grid-area: side;
}
.tg-detail .kv {
  grid-template-columns: 6.2em minmax(0, 1fr);
  column-gap: 8px;
}
.tg-detail .kv dt {
  overflow-wrap: anywhere;
}
.tg-detail .kv dt,
.tg-detail .kv dd {
  padding: 8px 0;
  font-size: 14px;
  line-height: 1.6;
}
.tg-detail .kv dt {
  font-size: 13px;
  padding-top: 9px;
}
.td-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}
.td-actions[hidden] {
  display: none;
}
.td-hint {
  font-size: 14px;
  color: var(--ink-3);
}
.tg-detail .mail-part,
.tg-detail .mail-subject {
  font-size: 15px;
}
.tg-detail .mail-part.is-fixed {
  font-size: 14px;
}
.tg-detail .panel-foot {
  flex-wrap: wrap;
  justify-content: flex-start;
}
@media (max-width: 1160px) {
  .tg-detail {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "main" "side";
  }
}

/* --- 画面幅ごとの調整 -------------------------------------------------------- */
@media (max-width: 1100px) {
  .dash-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .kpis,
  .skeleton-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 960px) {
  :where(body.app) .main {
    padding: 20px 16px 56px;
  }
  /* 指で押せる大きさ（44px）。メニューの開閉・項目・屋号のリンク */
  :where(body.app) .icon-btn {
    width: 44px;
    height: 44px;
  }
  :where(body.app) .nav-item {
    min-height: 44px;
  }
  :where(body.app) .topbar .wordmark,
  :where(body.app) .sidebar-brand .wordmark {
    min-height: 44px;
    align-items: center;
  }
}
@media (max-width: 760px) {
  :where(body.app) .page-title {
    font-size: 20px;
  }
  :where(body.app) .page-head {
    margin-bottom: 16px;
    padding-bottom: 12px;
  }
  :where(body.app) .page-head > :not(:first-child) {
    margin-left: 0;
  }
  :where(body.app) .tg-filters .field,
  :where(body.app) .tg-filters .field.is-search {
    display: grid;
    flex: 1 1 100%;
    gap: 6px;
  }
  :where(body.app) .tg-filters .field.is-search .field-label {
    position: static;
    width: auto;
    height: auto;
    clip: auto;
    overflow: visible;
  }
  :where(body.app) .tg-filters .select {
    width: 100%;
  }
  :where(body.app) .btn,
  :where(body.app) .btn-sm,
  :where(body.app) .tg-link {
    min-height: 44px;
  }
  .panel-head .panel-link {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
  }
  .send-banner {
    grid-template-columns: 36px minmax(0, 1fr);
    gap: 4px 12px;
    padding: 14px 16px;
  }
  .send-banner .icon {
    width: 36px;
    height: 36px;
  }
  .send-banner-action {
    grid-column: 1 / -1;
  }
  .send-banner-action .btn {
    width: 100%;
    min-height: 44px;
  }
  .kpis,
  .skeleton-kpis {
    gap: 10px;
  }
  .kpi {
    padding: 14px 16px;
  }
  .kpi-value {
    font-size: 28px;
  }
  .dash-table thead {
    display: none;
  }
  .dash-table,
  .dash-table tbody {
    display: block;
  }
  .dash-table tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "name status" "route time";
    gap: 2px 12px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--line);
  }
  .dash-table tbody tr:last-child {
    border-bottom: 0;
  }
  .dash-table td {
    padding: 0;
    border: 0;
  }
  .dash-table .col-name {
    grid-area: name;
  }
  .dash-table .cell-sub {
    display: block;
    margin-left: 0;
    white-space: normal;
  }
  .dash-table .col-status {
    grid-area: status;
    width: auto;
  }
  .dash-table .col-route {
    grid-area: route;
    width: auto;
    font-size: 14px;
  }
  .dash-table .col-time {
    grid-area: time;
    width: auto;
    font-size: 14px;
    text-align: right;
  }
  .td-actions {
    flex-direction: column-reverse;   /* 主ボタン（承認）を先に。押しやすい位置に */
    align-items: stretch;
  }
  .td-actions .btn {
    flex: 1 1 100%;
    min-height: 44px;
  }
  .fold > summary {
    min-height: 48px;
  }
  .reply-row {
    min-height: 44px;
  }
}

/* 1009 レビュー対応（ログイン後の画面だけ） */
/* 署名の見本: 区切り線（全角の罫線）や長いURLで枠からはみ出さない */
body.app .signature-preview { white-space: pre-wrap; overflow-wrap: anywhere; word-break: break-all; max-width: 100%; overflow: hidden; font-size: 0.875rem; line-height: 1.7; }
/* 選んだ値の札（×で外す）と入力候補（無料診断の市区町村） */
body.app .chip-list { display: flex; flex-wrap: wrap; gap: 6px; }
body.app .chip-list:empty { display: none; }
body.app .chip { display: inline-flex; align-items: center; gap: 4px; padding: 4px 4px 4px 12px; border-radius: 999px; background: var(--surface-2, #eef2f7); border: 1px solid var(--line, #d8dee8); font-size: 0.9rem; max-width: 100%; }
body.app .chip > span { overflow-wrap: anywhere; }
body.app .chip-remove { border: 0; background: transparent; cursor: pointer; width: 32px; height: 32px; border-radius: 999px; font-size: 1.1rem; line-height: 1; color: inherit; }
body.app .chip-remove:hover, body.app .chip-remove:focus-visible { background: rgba(0,0,0,.08); }
body.app .suggest-wrap { position: relative; }
body.app .suggest-list { position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 4px); margin: 0; padding: 4px 0; list-style: none; background: var(--surface, #fff); border: 1px solid var(--line, #d8dee8); border-radius: 10px; box-shadow: 0 8px 24px rgba(15,23,42,.12); max-height: 280px; overflow: auto; }
body.app .suggest-item, body.app .suggest-empty { padding: 10px 14px; cursor: pointer; min-height: 40px; }
body.app .suggest-empty { color: var(--muted, #64748b); cursor: default; }
body.app .suggest-item:hover, body.app .suggest-item.is-active { background: var(--surface-2, #eef2f7); }
/* 長い会社名などでダイアログ・トーストからはみ出さない（ダイアログは body 直下に出るので各画面の折り返し指定が届かない） */
body.app .modal-title, body.app .modal-text, body.app .toast { overflow-wrap: anywhere; }
/* 入力欄の見本の文字が途中で切れる時は「…」にする */
body.app .input { text-overflow: ellipsis; }
/* 設定のサブタブ: スマホは短いラベル */
body.app .label-short { display: none; }
@media (max-width: 760px) {
  body.app .subnav .label-long { display: none; }
  body.app .subnav .label-short { display: inline; }
  body.app .subnav a, body.app .subnav button { white-space: nowrap; padding-inline: 10px; }
  body.app .page-back { min-height: 44px; display: inline-flex; align-items: center; }
}
/* 道筋の外のメニュー（無料診断・営業開始の前）は灰色で押せない */
body.app .nav-item.is-disabled { opacity: .42; cursor: not-allowed; }
body.app .nav-item.is-disabled:hover { background: none; }
/* 無料診断の進み具合 */
body.app .progress-bar { height: 10px; border-radius: 999px; background: var(--line, #e2e8f0); overflow: hidden; }
body.app .progress-bar-fill { height: 100%; width: 0; background: var(--accent, #1f3a5f); border-radius: 999px; transition: width .6s ease; }
body.app .progress-label { font-weight: 700; }
body.app .topbar a.is-disabled, body.app .sidebar a.is-disabled { opacity: .42; cursor: not-allowed; }
body.app .mail-rule { border: 0; border-top: 1px solid currentColor; opacity: .6; margin: 6px 0; width: 100%; }
body.app .mail-line { white-space: pre-wrap; overflow-wrap: anywhere; }
body.app .choice-body { display: flex; flex-direction: column; gap: 4px; }
body.app .choice-title { display: block; }
