/* ==========================================================================
   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);
  }
}
