/* Shared type scale: keep these tokens aligned with local/dist/ui-system.css. */
:root {
  --font-ui: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  --font-code: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --text-caption: .8125rem;
  --text-body: .875rem;
  --text-label: 1rem;
  --text-heading: 1.125rem;
  --text-title: 1.25rem;
  --text-display: 1.75rem;
  --control-height: 42px;
  --control-radius: 9px;
  --muted: #586b87;
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  color-scheme: light;
}
body { font-size: var(--text-body); }
button, input, select, textarea { font-family: var(--font-ui); line-height: 1.5; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button, a { touch-action: manipulation; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; }
input, select, textarea { min-width: 0; max-width: 100%; }
input::placeholder, textarea::placeholder { color: #6b7d96; opacity: 1; font-weight: 400; }
small { font-size: var(--text-caption); }
h1, h2, h3, h4 { font-family: var(--font-ui); line-height: 1.4; letter-spacing: normal; }
h1 { font-size: var(--text-display); }
h2 { font-size: var(--text-heading); }
h3 { font-size: var(--text-label); }
:is(button, a, input, select, textarea, [tabindex]):focus-visible {
  outline: 3px solid #6395ed;
  outline-offset: 3px;
}
[hidden] { display: none !important; }

/* Meeting assistant, expert form and browser-local agreement generator. */
body { font-family: var(--font-ui); }
.muted, .small, .helper, .meeting-meta, .form-intro, .number, .secure-note,
.file-limits, .form-footer, .login-note, .app-footer, .cell-secondary, .card-count,
.meeting-card .meta, .eyebrow, #filehint, footer, .options span { color: var(--muted); }
.small, .helper, .meeting-meta, .form-intro, .secure-note, .file-limits,
.form-footer, .login-note, .app-footer, .cell-secondary, footer, #filehint {
  font-size: var(--text-caption); line-height: 1.7;
}
h1, .login-card h1 { font-size: 1.5rem; line-height: 1.5; letter-spacing: normal; }
h2, .detail-heading h2, .dialog-heading h2, .settings-grid h2 { font-size: var(--text-title); line-height: 1.5; }
h3, .meeting-card h3 { font-size: var(--text-label); line-height: 1.6; }
.eyebrow, .brand { letter-spacing: .04em; }
button, .button { min-height: var(--control-height); border-radius: var(--control-radius); font-size: var(--text-body); font-weight: 600; line-height: 1.5; }
.text-button, .text-link, .attachment-link { font-size: var(--text-caption); }
.text-button, .text-link { min-height: 36px; padding-block: 7px; }
.icon-button { font-size: 24px; min-width: 36px; min-height: 36px; padding: 0; }
input, .question > input, .url-field input, input[type=date] {
  min-width: 0; min-height: var(--control-height); font-size: var(--text-body);
  border-radius: var(--control-radius); padding: 10px 12px; line-height: 1.5;
}
input::placeholder, .question > input::placeholder { font-size: inherit; color: #6b7d96; }
input[type=checkbox] { width: 18px; min-height: 0; height: 18px; flex-shrink: 0; padding: 0; accent-color: var(--accent); }
label { font-size: var(--text-body); line-height: 1.6; }
.form-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.question > label:first-child { font-size: var(--text-label); }
.number { font-size: var(--text-caption); }
.questionnaire, .workspace, .panel, .share-content, .meeting-card { min-width: 0; }
.page-heading > div, .detail-heading > div, .section-heading > div { min-width: 0; }
.page-heading h1, .detail-heading h2, .meeting-card h3 { overflow-wrap: anywhere; }
.badge, .count { font-size: var(--text-caption); line-height: 1.5; }
.badge { max-width: 100%; white-space: normal; }
.card-count { font-size: var(--text-caption); }
.record-total { font-size: var(--text-display); letter-spacing: normal; }
.record-total small { font-size: var(--text-caption); }
.export-actions .button, .export-actions button, .url-field button { font-size: var(--text-body); }
.export-panel .muted, .cell-secondary, .cell-warning, .permission-note { font-size: var(--text-caption); }
.url-field { flex-wrap: wrap; }
.url-field input { flex: 1 1 150px; }
.sharing-panel { min-width: 0; }
table { font-size: var(--text-body); }
th { font-size: var(--text-caption); font-weight: 600; color: var(--muted); line-height: 1.6; }
td { font-size: var(--text-body); line-height: 1.7; }
.cell-name { font-size: var(--text-body); }
.table-wrap { max-width: 100%; overscroll-behavior-x: contain; }
dialog { max-height: calc(100dvh - 32px); overflow-y: auto; overscroll-behavior: contain; }
.dialog-heading { gap: 16px; }
.dialog-actions { flex-wrap: wrap; }
.actions:not(.small-actions), .export-actions, .dialog-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 140px), 1fr));
  grid-auto-rows: 1fr;
  align-items: stretch;
  gap: 10px;
  min-width: 0;
}
.detail-heading > .actions { width: min(100%, 340px); }
.actions:not(.small-actions) > :is(button, a),
.export-actions > :is(button, a), .dialog-actions > :is(button, a) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  width: 100%;
  height: 100%;
  min-height: var(--control-height);
  margin: 0;
  white-space: normal;
  overflow-wrap: anywhere;
  text-align: center;
}
.login-card { padding: 32px; }
.login-view { min-height: 100dvh; }
.form-top { min-height: 66px; height: auto; flex-wrap: wrap; padding-block: 14px; white-space: normal; }
.form-top > span { min-width: 0; }
.secure-note { margin-left: 38px; }
.upload-box { min-width: 0; }
.upload-box small { font-size: var(--text-caption); line-height: 1.7; }
.file-list li, .file-list li > span { min-width: 0; overflow-wrap: anywhere; }
.consent { font-size: var(--text-body); line-height: 1.7; }
.options { flex-wrap: wrap; }
.options label { flex: 1 1 200px; }
.options input { flex: 1 1 150px; }
details { font-size: var(--text-caption); }
@media (max-width: 680px) {
  :root { --control-height: 44px; }
  .header-inner { flex-wrap: wrap; gap: 12px; min-height: 74px; height: auto; padding-block: 14px; }
  .account { flex: 1 1 auto; min-width: 0; }
  .workspace { padding: 24px 16px 36px; }
  .section-heading { flex-wrap: wrap; gap: 14px; }
  .section-heading .muted { max-width: none; font-size: var(--text-caption); }
  .section-heading > .primary { font-size: var(--text-body); }
  .ui-responsive-table, .ui-responsive-table tbody { display: block; width: 100%; white-space: normal; }
  .ui-responsive-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .ui-responsive-table tbody { display: grid; gap: 12px; padding: 0 14px 14px; }
  .ui-responsive-table tbody tr {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px;
    padding: 16px; border: 1px solid var(--line); border-radius: 10px;
  }
  .ui-responsive-table tbody td {
    display: block; min-width: 0; max-width: none; width: auto; padding: 0; border: 0;
    white-space: normal; overflow-wrap: anywhere; font-size: var(--text-body);
  }
  .ui-responsive-table td[data-label]:before {
    content: attr(data-label); display: block; font-size: var(--text-caption);
    font-weight: 600; line-height: 1.6; color: var(--muted); margin-bottom: 4px;
  }
  .ui-responsive-table tbody td:is(.cell-copy, .invoice-buyer-info, .amount, [colspan]),
  .ui-responsive-table tbody td:has(.row-actions), .ui-responsive-table tbody td:has(.cell-warning) { grid-column: 1 / -1; }
  .ui-responsive-table tbody td.amount { white-space: nowrap; }
  .ui-responsive-table tbody td[colspan]:before { content: none; }
  .ui-responsive-table .row-actions { justify-content: flex-start; }
  .attachment-link { max-width: 100%; white-space: normal; overflow-wrap: anywhere; }
  .form-row { grid-template-columns: minmax(0, 1fr); }
  input:not([type=checkbox]):not([type=radio]):not([type=file]),
  .question > input, .url-field input, input[type=date] { font-size: 16px; }
  .question { padding: 22px 18px; }
  .form-cover { padding: 24px 18px; }
  .questionnaire { width: calc(100% - 24px); margin-top: 20px; }
  .questionnaire h1 { font-size: var(--text-title); }
  .form-top { padding-inline: 16px; }
  .login-view { padding: 20px 16px; }
  .login-card { padding: 28px 22px; }
  .brand { white-space: normal; }
  .brand a { font-size: var(--text-caption); }
  .export-actions { flex-wrap: wrap; }
  .export-actions > * { flex: 1 1 130px; }
  main:not(.workspace):not(.questionnaire) { width: calc(100% - 32px); margin-top: 40px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *:before, *:after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
