/* ネクアプ共通UI v1。画面専用。帳票 .page / printmode の内部には付けない。 */
/* iPhoneのブラウザが一部の文字だけを勝手に大きくする機能を止める（2026-11-18）。
   これが効くと、役所調査などのPDF（裏で画面を作って画像にする）で文字の大きさがばらつき、枠が崩れていた。 */
html {-webkit-text-size-adjust:100%;text-size-adjust:100%}

@media screen {
  :root {
    color-scheme: light;
    --brand-900:#0f3a56; --brand-700:#1a5f8a; --brand-500:#2e7bad; --brand-100:#dcebf5; --brand-50:#f0f7fb;
    --accent-500:#e8791a; --accent-600:#cf6a12; --accent-700:#934609; --accent-50:#fdf1e6;
    --text:#16202b; --text-sub:#4d5e6d; --text-mute:#596977; --text-on-brand:#fff;
    --bg:#f4f6f8; --surface:#fff; --surface-2:#fafbfc; --border:#d6dee6; --ui-input-border:#8c9ba9;
    --success:#176744; --success-50:#e6f4ee; --warn:#7c5200; --warn-fg:#7c5200; --warn-50:#fbf1dd;
    --danger:#b42318; --danger-50:#fbe9e7; --info:#1a5f8a; --info-50:#e4eff6;
    --ui-space-1:8px; --ui-space-2:16px; --ui-space-3:24px; --ui-space-4:32px; --ui-space-6:48px;
    --r-sm:8px; --r-md:12px; --r-lg:16px; --r-xl:20px; --r-full:999px;
    --shadow-sm:0 1px 2px rgba(16,32,43,.06); --shadow-md:0 4px 12px rgba(16,32,43,.08); --shadow-lg:0 8px 24px rgba(16,32,43,.10);
    --ui-font-xs:12px; --ui-font-sm:14px; --ui-font-md:16px; --ui-font-lg:18px; --ui-font-xl:22px; --ui-font-2xl:28px;
    --font-ui:-apple-system,"Hiragino Sans","Noto Sans JP",Meiryo,system-ui,sans-serif;
    --ease:cubic-bezier(.2,.7,.2,1);
    /* 既存UIの参照名。移行中も値の定義はこのファイルだけに置く。 */
    --font:var(--font-ui); --primary:var(--brand-700); --primary-dark:var(--brand-900); --primary-darker:var(--brand-900);
    --card-bg:var(--surface); --text-muted:var(--text-sub); --success-bg:var(--success-50); --warning:var(--warn);
    --accent:var(--accent-700); --accent-light:var(--accent-500);
    --sp-1:8px; --sp-2:8px; --sp-3:16px; --sp-4:16px; --sp-5:24px; --sp-6:32px; --sp-8:48px; --sp-loose:32px;
  }
  body:not(.printmode) :is(.ui-header,.ui-btn,.ui-card,.ui-input,.ui-choice,.ui-notice,.ui-toast,.ui-badge,.ui-section-title,.ui-dialog,.ui-toolbar,.ui-tabs,.ui-steps,.ui-form,.ui-controls) {box-sizing:border-box;font-family:var(--font-ui)}
  body:not(.printmode) .ui-header {
    display:grid;grid-template-columns:80px minmax(0,1fr) 80px;align-items:center;gap:8px;
    position:sticky;top:0;z-index:100;padding:calc(env(safe-area-inset-top) + 8px) 16px 8px;
    margin:0;background:var(--brand-900);color:#fff;box-shadow:var(--shadow-sm);flex-wrap:nowrap;
  }
  body:not(.printmode) .ui-header-title {display:flex;align-items:center;justify-content:center;gap:8px;min-width:0;margin:0;font-size:var(--ui-font-sm);font-weight:700;line-height:1.4;letter-spacing:0;color:#fff;text-align:center}
  body:not(.printmode) .ui-brand {display:inline-flex;align-items:center;justify-content:center;flex:none;width:24px;height:24px;border:1px solid #a7c5d9;border-radius:8px;background:var(--brand-700);color:#fff;font-size:var(--ui-font-md);font-weight:800;line-height:1}
  body:not(.printmode) .ui-header-end {justify-self:end}
  body:not(.printmode) .ui-header-title svg {width:24px;height:24px;flex:none;margin:0!important;vertical-align:middle}
  body:not(.printmode) .ui-header-title .brand-app {display:inline;margin:0;padding:0;border:0;font:inherit;letter-spacing:0;color:inherit}
  body:not(.printmode) .ui-visually-hidden {position:absolute;width:1px;height:1px;padding:0;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
  body:not(.printmode) .ui-header-meta {grid-column:1/-1;display:flex;align-items:center;justify-content:space-between;gap:8px;color:#fff;font-size:var(--ui-font-xs)}
  body:not(.printmode) .ui-header-meta:has(> :only-child:empty) {display:none}
  body:not(.printmode) :is(.ui-btn,:where(.ui-controls :is(button,a.btn,[role=button],.tab):not(:where(.page *, .flyer *, .mn-sheet *, #formOut *, #frame *)))), body.ui-home:not(.printmode) .hk-btn, body.ui-settlement:not(.printmode) .ex-del {
    display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:44px;min-width:44px;max-width:100%;
    padding:8px 16px;border:1px solid var(--ui-input-border);border-radius:var(--r-md);
    background:var(--surface);color:var(--brand-900);font-size:var(--ui-font-sm);font-weight:600;line-height:1.5;
    text-decoration:none;text-align:center;cursor:pointer;white-space:normal;box-shadow:var(--shadow-sm);touch-action:manipulation;
    transition:background .15s var(--ease),transform .12s var(--ease);
  }
  body:not(.printmode) .ui-btn-primary {background:var(--brand-700);border-color:var(--brand-700);color:#fff}
  body:not(.printmode) .ui-btn-secondary {background:var(--surface);border-color:var(--ui-input-border);color:var(--brand-900)}
  body:not(.printmode) .ui-btn-danger {background:var(--danger);border-color:var(--danger);color:#fff}
  body:not(.printmode) .ui-btn-small {padding:8px;font-size:var(--ui-font-sm);min-height:44px}
  body:not(.printmode) .ui-header .ui-btn {padding:8px;white-space:nowrap;background:transparent;border-color:#92aec2;color:#fff}
  body:not(.printmode) .ui-header .ui-btn-primary {background:var(--brand-700);border-color:#92aec2;color:#fff}
  body:not(.printmode) .ui-btn:disabled {background:var(--surface-2);border-color:var(--border);color:var(--text-sub);box-shadow:none;cursor:default}
  body:not(.printmode) .ui-btn:active:not(:disabled) {transform:translateY(1px)}
  body:not(.printmode) :is(.ui-btn,.ui-input,.ui-choice,.ui-tabs a,.ui-steps li,details.collapsible>summary):focus-visible {outline:3px solid var(--brand-500);outline-offset:3px}
  body:not(.printmode) :is(.ui-section-title,:where(.ui-form :is(.form-group-title):not(:where(.page *, .flyer *, .mn-sheet *, #formOut *, #frame *)))) {display:flex;align-items:baseline;flex-wrap:wrap;gap:8px;margin:24px 0 16px;padding:0 0 8px;border:0;border-bottom:1px solid var(--border);color:var(--brand-900);font-size:var(--ui-font-md);font-weight:700;line-height:1.5;letter-spacing:0}
  body:not(.printmode) .ui-section-title:first-child {margin-top:0}
  body:not(.printmode) .ui-section-title .bar {display:none}
  body:not(.printmode) :is(.ui-card,:where(.ui-form :is(.form-card,.card,.section):not(:where(.page *, .flyer *, .mn-sheet *, #formOut *, #frame *)))) {background:var(--surface);border:1px solid var(--border);border-radius:var(--r-lg);padding:16px;box-shadow:var(--shadow-sm);margin-bottom:16px;min-width:0}
  body:not(.printmode) :is(.ui-input,:where(.ui-settlement .extra-item input[type=text],.ui-settlement .extra-item select,.ui-form :is(input:not([type=checkbox],[type=radio],[type=file],[type=hidden],[type=range]),select,textarea):not(:where(.page *, .flyer *, .mn-sheet *, #formOut *, #frame *)))) {display:block;width:100%;min-width:0;min-height:44px;padding:8px 16px;border:1px solid var(--ui-input-border);border-radius:var(--r-sm);background:var(--surface);color:var(--text);font-size:var(--ui-font-md);font-weight:400;line-height:1.5;box-shadow:none}
  body:not(.printmode) :is(textarea.ui-input,:where(.ui-form textarea:not(:where(.page *, .flyer *, .mn-sheet *, #formOut *, #frame *)))) {min-height:96px;resize:vertical}
  body:not(.printmode) :is(.ui-input,:where(.ui-form :is(input:not([type=checkbox],[type=radio],[type=file],[type=hidden],[type=range]),select,textarea):not(:where(.page *, .flyer *, .mn-sheet *, #formOut *, #frame *))))::placeholder {color:var(--text-mute);opacity:1}
  body:not(.printmode) :is(.ui-input,:where(.ui-form :is(input:not([type=checkbox],[type=radio],[type=file],[type=hidden],[type=range]),select,textarea):not(:where(.page *, .flyer *, .mn-sheet *, #formOut *, #frame *)))):focus {border-color:var(--brand-700);outline:2px solid var(--brand-700);outline-offset:1px;box-shadow:none}
  body:not(.printmode) :is(.ui-input,:where(.ui-form :is(input:not([type=checkbox],[type=radio],[type=file],[type=hidden],[type=range]),select,textarea):not(:where(.page *, .flyer *, .mn-sheet *, #formOut *, #frame *)))):disabled {color:var(--text-sub);background:var(--surface-2)}
  body:not(.printmode) :is(.ui-choice,:where(.ui-settlement .ex-settle-row label,.ui-form label:has(>input:is([type=checkbox],[type=radio])):not(:where(.page *, .flyer *, .mn-sheet *, #formOut *, #frame *)))) {display:inline-flex;align-items:center;gap:8px;min-height:44px;padding:8px;border:1px solid var(--ui-input-border);border-radius:var(--r-sm);background:var(--surface);color:var(--text);font-size:var(--ui-font-sm);cursor:pointer;text-align:left}
  body:not(.printmode) :is(.ui-choice,:where(.ui-settlement .ex-settle-row label,.ui-form label:has(>input:is([type=checkbox],[type=radio])):not(:where(.page *, .flyer *, .mn-sheet *, #formOut *, #frame *)))) input:is([type=checkbox],[type=radio]) {position:static;opacity:1;flex:none;width:20px;height:20px;min-height:20px;margin:0;accent-color:var(--brand-700)}
  body:not(.printmode) :is(.ui-choice,:where(.ui-settlement .ex-settle-row label,.ui-form label:has(>input:is([type=checkbox],[type=radio])):not(:where(.page *, .flyer *, .mn-sheet *, #formOut *, #frame *)))):has(input:checked) {border-color:var(--brand-700);background:var(--brand-50);color:var(--brand-900)}
  body:not(.printmode) :is(.ui-choice,:where(.ui-settlement .ex-settle-row label,.ui-form label:has(>input:is([type=checkbox],[type=radio])):not(:where(.page *, .flyer *, .mn-sheet *, #formOut *, #frame *)))):has(input:focus-visible) {outline:3px solid var(--brand-500);outline-offset:3px}
  body:not(.printmode) .ui-hint {font-size:var(--ui-font-xs);line-height:1.7;color:var(--text-sub);margin:8px 0;overflow-wrap:anywhere}
  body:not(.printmode) .ui-notice {padding:16px;margin-bottom:16px;border:1px solid var(--border);border-left:3px solid currentColor;border-radius:var(--r-sm);background:var(--info-50);color:var(--info);font-size:var(--ui-font-sm);line-height:1.7;overflow-wrap:anywhere}
  body:not(.printmode) .ui-notice-info {background:var(--info-50);color:var(--info)}
  body:not(.printmode) .ui-notice-warn {background:var(--warn-50);color:var(--warn-fg)}
  body:not(.printmode) .ui-notice-danger {background:var(--danger-50);color:var(--danger)}
  body:not(.printmode) details.collapsible {border:1px solid var(--border);border-radius:var(--r-md);background:var(--surface);margin-bottom:16px;overflow:hidden;font-family:var(--font-ui)}
  body:not(.printmode) details.collapsible>summary {cursor:pointer;min-height:44px;padding:16px;color:var(--brand-900);background:var(--surface-2);font-size:var(--ui-font-sm);font-weight:600;line-height:1.5;overflow-wrap:anywhere}
  body:not(.printmode) details.collapsible[open]>summary {border-bottom:1px solid var(--border)}
  body:not(.printmode) details.collapsible>.collapsible-body {padding:16px}
  body:not(.printmode) .ui-toast {position:fixed;top:auto;bottom:calc(24px + env(safe-area-inset-bottom));left:50%;transform:translateX(-50%);z-index:1200;max-width:calc(100vw - 32px);width:max-content;padding:16px 24px;border:0;border-radius:var(--r-md);background:var(--brand-900);color:#fff;font-size:var(--ui-font-sm);font-weight:600;line-height:1.5;white-space:normal;overflow-wrap:anywhere;box-shadow:var(--shadow-md);pointer-events:none}
  body:not(.printmode) .ui-badge {display:inline-flex;align-items:center;gap:8px;padding:8px;border-radius:var(--r-full);background:var(--brand-50);color:var(--brand-900);font-size:var(--ui-font-xs);font-weight:600;line-height:1.4}
  body:not(.printmode) .ui-badge-success {color:var(--success);background:var(--success-50)}
  body:not(.printmode) .ui-badge-warn {color:var(--warn-fg);background:var(--warn-50)}
  body:not(.printmode) .ui-badge-danger {color:var(--danger);background:var(--danger-50)}
  body:not(.printmode) .ui-dialog {padding:24px;margin:16px;max-height:calc(100dvh - 32px);overflow-y:auto;width:calc(100% - 32px);max-width:400px;border:1px solid var(--border);border-radius:var(--r-lg);background:var(--surface);color:var(--text);box-shadow:var(--shadow-lg)}
  body:not(.printmode) .ui-toolbar {display:flex;align-items:center;flex-wrap:wrap;gap:8px;padding:8px 16px;background:var(--surface);border-bottom:1px solid var(--border)}
  body:not(.printmode) .ui-tabs {display:flex;gap:8px;padding:8px 16px;background:var(--surface);overflow-x:auto;font-size:var(--ui-font-sm);border-bottom:1px solid var(--border);scrollbar-width:thin}
  body:not(.printmode) .ui-tabs a {display:inline-flex;align-items:center;justify-content:center;flex:none;min-height:44px;padding:8px;color:var(--text-sub);border:1px solid transparent;border-radius:var(--r-sm);background:var(--surface);font:600 var(--ui-font-sm)/1.4 var(--font-ui);text-decoration:none;white-space:nowrap}
  body:not(.printmode) .ui-tabs a.cur {color:var(--brand-900);border-color:var(--brand-100);background:var(--brand-50);box-shadow:none}
  body:not(.printmode) .ui-steps {display:flex;gap:0;list-style:none;margin:0 0 16px;padding:0;overflow:visible}
  body:not(.printmode) .ui-steps li {display:flex;align-items:center;justify-content:center;flex:1;min-width:0;min-height:44px;padding:8px 0;font-size:var(--ui-font-xs);color:var(--text-sub);border-bottom:3px solid var(--border);text-align:center;cursor:pointer;overflow-wrap:anywhere}
  body:not(.printmode) .ui-steps li.active {color:var(--brand-900);border-color:var(--brand-700);font-weight:700}
  body:not(.printmode) .ui-steps li.done {color:var(--success);border-color:var(--success)}

  /* 移行用アダプター: JSが生成/付け替えする旧クラスは残す。表示状態はJSに任せる。 */
  body.ui-home .badge {display:inline-flex;align-items:center;gap:8px;padding:8px;border-radius:var(--r-full);font-size:var(--ui-font-xs);font-weight:600;line-height:1.4}
  body.ui-home .bcard {background:var(--surface);border:1px solid var(--border);border-radius:var(--r-lg);padding:16px;margin-bottom:8px;box-shadow:var(--shadow-sm)}
  body.ui-home .fold {min-height:44px;border-radius:var(--r-md);font-size:var(--ui-font-sm)}
  body:not(.printmode) .sync-status {font:600 var(--ui-font-xs)/1.5 var(--font-ui);padding:8px;border-radius:var(--r-full);background:var(--surface);color:var(--text-sub);white-space:normal;overflow-wrap:anywhere}
  body:not(.printmode) .sync-status:is(.s-pulling,.s-pending) {background:var(--warn-50);color:var(--warn-fg)}
  body:not(.printmode) .sync-status.s-synced {background:var(--success-50);color:var(--success)}
  body:not(.printmode) .sync-status:is(.s-error,.s-offline) {background:var(--danger-50);color:var(--danger)}
  body.ui-home .info-box {font-size:var(--ui-font-sm);padding:16px;border-radius:var(--r-sm);line-height:1.7;overflow-wrap:anywhere}
  body.ui-home .info-blue {background:var(--info-50);color:var(--info)}
  body.ui-home .info-green {background:var(--success-50);color:var(--success)}
  body.ui-home .info-yellow {background:var(--warn-50);color:var(--warn-fg)}
  body.ui-home .info-red {background:var(--danger-50);color:var(--danger)}
  body.ui-home .tile-status {color:var(--success)}
  body.ui-home .hk-chlen {color:var(--text-sub);font-size:var(--ui-font-xs)}
  body.ui-home .hk-copied {color:var(--success);font-size:var(--ui-font-xs)}
  body.ui-settlement:not(.printmode) .ex-del {border:1px solid var(--danger)!important;background:var(--surface)!important;color:var(--danger);border-radius:var(--r-md)!important}
  body.ui-home .tile .badge-new {background:var(--danger);color:#fff}
  @media (prefers-reduced-motion:reduce) {body:not(.printmode) .ui-btn {transition:none} body:not(.printmode) .ui-btn:active {transform:none}}

  /* 全体移行の互換層。操作画面だけに適用し、帳票・チラシ・生成結果を除外する。 */
  body.ui-app:not(.printmode) {min-width:0}
  body.ui-app:not(.printmode):not(:has(.page)) {background:var(--bg)}
  body.ui-app:not(.printmode) .ui-header {margin-bottom:0;max-width:none}
  body.ui-app:not(.printmode) .ui-header-title {grid-column:2;grid-row:1}
  body.ui-app:not(.printmode) .ui-header-back {grid-column:1;grid-row:1;justify-self:start}
  body.ui-app:not(.printmode) .ui-header-end {grid-column:3;grid-row:1}
  body.ui-app:not(.printmode) .ui-header>div:has(>.ui-header-title) {grid-column:2;grid-row:1;min-width:0}
  body.ui-app:not(.printmode) .ui-header :is(.brand-logo.ui-visually-hidden) {display:none}
  body.ui-app:not(.printmode) .ui-header-meta {grid-column:1/-1;font-size:var(--ui-font-xs);justify-content:center}
  body.ui-app:not(.printmode) :is(.ui-btn,:where(.ui-controls :is(button,a.btn,[role=button],.tab):not(:where(.page *, .flyer *, .mn-sheet *, #formOut *, #frame *)))) {background:var(--surface)!important;color:var(--brand-900)!important;border:1px solid var(--ui-input-border)!important;border-radius:var(--r-md)!important;font-size:var(--ui-font-sm)!important;min-height:44px;min-width:44px;text-decoration:none}
  body.ui-app:not(.printmode) :is(.ui-btn,:where(.ui-controls :is(button,a.btn,[role=button],.tab):not(:where(.page *, .flyer *, .mn-sheet *, #formOut *, #frame *)))):is(.active,.on,.cur,[aria-pressed=true]) {background:var(--brand-50)!important;color:var(--brand-900)!important;border-color:var(--brand-700)!important;box-shadow:inset 0 -2px 0 var(--brand-700)}
  body.ui-app:not(.printmode) .ui-btn-primary {background:var(--brand-700)!important;color:#fff!important;border-color:var(--brand-700)!important}
  body.ui-app:not(.printmode) .ui-btn-danger {background:var(--danger)!important;color:#fff!important;border-color:var(--danger)!important}
  body.ui-app:not(.printmode) :is(.btn-danger,.ht-del,.del):not(:where(.page *, .flyer *, .mn-sheet *, #formOut *, #frame *)) {background:var(--danger)!important;color:#fff!important;border-color:var(--danger)!important}
  body.ui-app:not(.printmode) :is(.ui-btn,:where(.ui-controls :is(button,a.btn,[role=button],.tab):not(:where(.page *, .flyer *, .mn-sheet *, #formOut *, #frame *)))):disabled {background:var(--surface-2)!important;color:var(--text-sub)!important;border-color:var(--border)!important;box-shadow:none}
  body.ui-app:not(.printmode) .ui-header .ui-btn:not(.ui-btn-primary) {background:transparent!important;color:#fff!important;border-color:#92aec2!important;padding:8px}
  body.ui-app:not(.printmode) .ui-header .ui-btn-primary {border-color:#92aec2!important;padding:8px}
  body.ui-app:not(.printmode) :is(.ui-input,:where(.ui-form :is(input:not([type=checkbox],[type=radio],[type=file],[type=hidden],[type=range]),select,textarea):not(:where(.page *, .flyer *, .mn-sheet *, #formOut *, #frame *)))) {color:var(--text)!important;font-size:var(--ui-font-md)!important;border-color:var(--ui-input-border)!important;min-width:0}
  body.ui-app:not(.printmode) :is(.ui-input,:where(.ui-form :is(input:not([type=checkbox],[type=radio],[type=file],[type=hidden],[type=range]),select,textarea):not(:where(.page *, .flyer *, .mn-sheet *, #formOut *, #frame *))))::placeholder {color:var(--text-mute)!important;opacity:1}
  body.ui-app:not(.printmode) :is(.ui-card,:where(.ui-form :is(.form-card,.card,.section):not(:where(.page *, .flyer *, .mn-sheet *, #formOut *, #frame *)))) {background:var(--surface)!important;border-color:var(--border)!important}
  body.ui-app:not(.printmode) .ui-hint {color:var(--text-sub)!important;font-size:var(--ui-font-xs)!important;line-height:1.7}
  body.ui-app:not(.printmode) :is(.ui-hint,.hint,.note,.desc,.muted,.ht-list-meta,.pv-empty,.slot-label):not(:where(.page *, .flyer *, .mn-sheet *, #formOut *, #frame *)) {color:var(--text-sub);font-size:var(--ui-font-xs);line-height:1.7}
  body.ui-app:not(.printmode) .ui-section-title {border-left:0!important;letter-spacing:0}
  body.ui-app:not(.printmode) :is(.form-row,label.fld)>:is(label,.lab), body.ui-app:not(.printmode) .ht-panel .lbl {font-size:var(--ui-font-sm);color:var(--text-sub);line-height:1.6}
  body.ui-app:not(.printmode) .ui-dialog {margin:16px;max-height:calc(100dvh - 32px);z-index:1100}
  body.ui-app:not(.printmode) :is(.modal-bg,.modal-backdrop,.jm-modal-bg) {z-index:1100}
  body.ui-app:not(.printmode) .mbtns {display:flex;flex-wrap:wrap;gap:8px}
  body.ui-app:not(.printmode) .mbtns .ui-btn {flex:1;min-width:80px}
  body.ui-app:not(.printmode) .sync-status {max-width:calc(100vw - 32px)}
  body.ui-app:not(.printmode) .nav-bar~.sync-status {top:64px}
  body.ui-app:not(.printmode) .ui-toolbar {justify-content:flex-end;gap:8px}
  body.ui-app:not(.printmode) .ui-toolbar a {font-size:var(--ui-font-sm);color:var(--brand-900);min-height:44px;display:inline-flex;align-items:center}
  body.ui-app:not(.printmode) .ui-card {margin-bottom:16px}
  body.ui-app:not(.printmode) .ui-choice {min-height:44px}
  body.ui-app:not(.printmode) select.ui-input {appearance:auto}
  body.ui-app:not(.printmode) .head.ui-header {margin-bottom:16px}
  body.ui-app:not(.printmode) .ui-header .ui-hint {color:#fff!important;opacity:1;margin:4px 0 0}
  body.ui-app:not(.printmode) .ui-header .sub {color:#fff}
  body.ui-app:not(.printmode) .ui-section-title>.num {display:none}
  body.ui-app:not(.printmode) .ui-document-viewport {max-width:100%;overflow:auto;overscroll-behavior-x:contain}
  body.ui-app:not(.printmode).ui-page-keiyakusho .fsbar {margin:0;justify-content:flex-end}
  body.ui-app:not(.printmode).ui-page-keiyakusho #drop {display:block}
  /* 生成書類の参照色は従来値を維持。操作UIのトークン変更を継承させない。 */
  body.ui-app:not(.printmode).ui-page-keiyakusho :is(#formOut,#listOut,#kakuOut) {
    --brand-900:#0e3450;--brand-700:#1a5f8a;--brand-500:#2e7bad;--brand-100:#dbeaf6;--brand-50:#f1f7fc;
    --accent-500:#e8791a;--accent-600:#c96509;--bg:#f2f5f8;--surface:#fff;--surface-2:#f8fafc;--border:#dfe6ee;--border-strong:#c8d4e0;
    --text:#131c26;--text-sub:#41505f;--text-mute:#5c6b7a;--success:#12805a;--success-50:#e4f5ee;--warn-fg:#8a5a00;--warn-50:#fdf3de;--danger:#c33a30;--danger-50:#fdecea;
    color:#131c26;font-family:"Hiragino Kaku Gothic ProN","Yu Gothic Medium","Yu Gothic",system-ui,sans-serif;font-size:var(--fs);line-height:1.9;letter-spacing:.02em;
  }
  body.ui-app:not(.printmode).ui-page-juyou .sidebar {background:var(--surface);color:var(--text);border-right:1px solid var(--border)}
  body.ui-app:not(.printmode).ui-page-juyou .sidebar [style*="opacity"] {opacity:1!important}
  body.ui-app:not(.printmode).ui-page-juyou .sidebar .b-item {border-color:var(--border);background:var(--surface-2);min-height:44px}
  body.ui-app:not(.printmode).ui-page-juyou .sidebar .b-item.active {background:var(--brand-50);border-color:var(--brand-700);color:var(--brand-900)}
  body.ui-app:not(.printmode).ui-page-juyou .sidebar :is(.date,.b-empty) {opacity:1;color:var(--text-sub)}
  body.ui-app:not(.printmode).ui-page-juyou .item-row .value.empty {color:var(--text-sub)}
  body.ui-app:not(.printmode).ui-page-kaitsuke .sign-hint {color:var(--text-sub)}
  body.ui-app:not(.printmode).ui-page-sakusei-irai .out-card {background:var(--surface);color:var(--text);border:1px solid var(--border);border-radius:var(--r-lg)}
  body.ui-app:not(.printmode).ui-page-sakusei-irai :is(.out-pre,.out-pre.big) {background:var(--surface-2);color:var(--text);border-color:var(--border)}
  body.ui-app:not(.printmode).ui-page-hanbai .main {padding:16px}
  body.ui-app:not(.printmode).ui-page-hanbai :is(.import-btn,.open-btn) {width:100%;margin-bottom:8px}
  body.ui-app:not(.printmode).ui-page-hanbai :is(.type-tabs,.tpl-tabs) {display:flex;flex-wrap:wrap;gap:8px}
  body.ui-app:not(.printmode).ui-page-hanbai .tab-btn {flex:1;min-width:90px}
  body.ui-app:not(.printmode).ui-page-hanbai .tpl-btn {flex:1;min-width:140px;flex-direction:column;gap:4px;padding:8px}
  body.ui-app:not(.printmode).ui-page-hanbai .tpl-btn small {font-size:var(--ui-font-xs);opacity:1}
  body.ui-app:not(.printmode).ui-page-hanbai :is(.ht-panel,.photo-area,.tag-group) {padding:16px}
  body.ui-app:not(.printmode).ui-page-hanbai .photo-grid {grid-template-columns:repeat(2,minmax(0,1fr))}
  body.ui-app:not(.printmode).ui-page-hanbai .photo-slot :is(.slot-caption,.slot-caption-input) {font-size:var(--ui-font-xs);min-height:44px;background:#263b4e;color:#fff}
  body.ui-app:not(.printmode).ui-page-hanbai .photo-slot .slot-caption-input::placeholder {color:#fff;opacity:1}
  body.ui-app:not(.printmode).ui-page-hanbai .slot-controls {flex-wrap:wrap;max-width:100%;gap:4px}
  body.ui-app:not(.printmode).ui-page-hanbai .slot-controls button {padding:8px;min-height:44px;min-width:44px}
  body.ui-app:not(.printmode).ui-page-hanbai .catch-helper {margin-left:8px;padding:8px;font-size:var(--ui-font-xs)!important}
  body.ui-app:not(.printmode).ui-page-hanbai :is(.catch-item,.pr-option) {min-height:44px;padding:16px;border:1px solid var(--border);border-radius:var(--r-sm);background:var(--surface-2);color:var(--text);font-size:var(--ui-font-sm)}
  body.ui-app:not(.printmode).ui-page-hanbai .pr-option.on {border-color:var(--brand-700);background:var(--brand-50)}
  body.ui-app:not(.printmode).ui-page-hanbai .tag-chips {gap:8px}
  body.ui-app:not(.printmode).ui-page-hanbai .tag-chip {padding:8px;line-height:1.5}
  body.ui-app:not(.printmode).ui-page-hanbai .action-row {flex-wrap:wrap}
  body.ui-app:not(.printmode).ui-page-hanbai .action-row .ui-btn {flex:1;min-width:140px}
  body.ui-app:not(.printmode).ui-page-hanbai .pa-controls {flex-wrap:wrap}
  body.ui-app:not(.printmode).ui-page-hanbai .pa-controls input[type=range] {min-height:44px;accent-color:var(--brand-700)}
  body.ui-app:not(.printmode).ui-page-hanbai .preview-box .pv-empty {color:var(--text-sub)}
  body.ui-app:not(.printmode).ui-page-hanbai .preview-box .pv-row {flex-wrap:wrap}
  body.ui-app:not(.printmode).ui-page-hanbai .preview-box .pv-row .v {min-width:0}
  body.ui-app:not(.printmode).ui-page-hanbai .preview-box strong {color:var(--success)!important}
  body.ui-app:not(.printmode).ui-page-hanbai #premiumPanel :is(.form-row,.form-card) {min-width:0}
  body.ui-app:not(.printmode).ui-page-hanbai #premiumPanel [style*="color:#888"], body.ui-app:not(.printmode).ui-page-hanbai #premiumPanel [style*="color: #888"] {color:var(--text-sub)!important}
  body.ui-app:not(.printmode).ui-page-seisansho-arari .ar-item {flex-wrap:wrap;gap:8px}
  body.ui-app:not(.printmode).ui-page-seisansho-arari .ar-item input {min-width:0}
  body.ui-app:not(.printmode).ui-page-seisansho-arari .ar-item .amtgrp {min-width:120px}
  body.ui-app:not(.printmode).ui-page-juyou .actions {flex-wrap:wrap}
  @media (max-width:700px) {
    body.ui-app:not(.printmode).ui-page-juyou .layout {grid-template-columns:minmax(0,1fr)}
    body.ui-app:not(.printmode).ui-page-juyou .sidebar {max-height:300px}
    body.ui-app:not(.printmode).ui-page-juyou .main {padding:16px;min-width:0}
    body.ui-app:not(.printmode).ui-page-juyou .top-bar {flex-wrap:wrap;gap:16px}
    body.ui-app:not(.printmode).ui-page-juyou .item-row {flex-wrap:wrap;gap:8px}
    body.ui-app:not(.printmode).ui-page-kaitsuke-agent .lockrow {flex-wrap:wrap}
    body.ui-app:not(.printmode).ui-page-kaitsuke-agent .lockval {min-width:140px}
  }

  /* 2026-10-25 iPhoneの日付・時刻欄が幅指定を無視して右にはみ出すのを止める */
  body:not(.printmode) :is(.ui-input,.ui-form input):is([type=date],[type=time],[type=datetime-local],[type=month]):not(:where(.page *, .flyer *, .mn-sheet *, #formOut *, #frame *)) {-webkit-appearance:none;appearance:none;max-width:100%;text-align:left}
  body:not(.printmode) :is(.ui-input,.ui-form input)::-webkit-date-and-time-value {text-align:left;min-height:1.5em}
  /* 2026-10-25 わくわく層 v1.1：色の奥行き・押した手応え・達成感。画面だけ。帳票(.page等)には付けない。 */
  :root {--grad-brand:linear-gradient(135deg,#0f3a56 0%,#174f74 55%,#1d6593 100%);--grad-btn:linear-gradient(135deg,#1a5f8a 0%,#2e7bad 100%);--grad-mark:linear-gradient(180deg,#2e7bad 0%,#e8791a 100%);--glow-brand:0 6px 16px rgba(26,95,138,.28)}
  body:not(.printmode):is(.ui-app,.ui-home,.ui-settlement):not(:has(.page)) {background:radial-gradient(120% 60% at 0% 0%,#e3eff8 0%,rgba(227,239,248,0) 60%),radial-gradient(90% 50% at 100% 0%,#fdf1e6 0%,rgba(253,241,230,0) 55%),var(--bg);background-attachment:fixed}
  body:not(.printmode) .ui-header {background:var(--grad-brand);box-shadow:0 2px 12px rgba(15,58,86,.25)}
  body:not(.printmode) .ui-header::after {content:"";position:absolute;left:0;right:0;bottom:0;height:2px;background:linear-gradient(90deg,rgba(232,121,26,0) 0%,#e8791a 50%,rgba(232,121,26,0) 100%);opacity:.85;pointer-events:none}
  body:not(.printmode) .ui-brand {background:linear-gradient(145deg,#2a78a8 0%,#1a5f8a 100%);border-color:rgba(255,255,255,.55);box-shadow:0 0 0 2px rgba(232,121,26,.35),inset 0 1px 0 rgba(255,255,255,.35)}
  body:not(.printmode) :is(.ui-btn,:where(.ui-controls :is(button,a.btn,[role=button],.tab):not(:where(.page *, .flyer *, .mn-sheet *, #formOut *, #frame *)))) {transition:transform .12s var(--ease),box-shadow .2s var(--ease),background .2s var(--ease)}
  body:not(.printmode) :is(.ui-btn,:where(.ui-controls :is(button,a.btn,[role=button],.tab):not(:where(.page *, .flyer *, .mn-sheet *, #formOut *, #frame *)))):active:not(:disabled) {transform:scale(.96)}
  body.ui-app:not(.printmode) .ui-btn-primary, body:not(.printmode) .ui-btn-primary {background:var(--grad-btn)!important;border-color:transparent!important;box-shadow:var(--glow-brand)}
  body.ui-app:not(.printmode) .ui-header .ui-btn-primary {background:rgba(255,255,255,.08)!important;border-color:rgba(255,255,255,.6)!important;box-shadow:none}
  body:not(.printmode) .ui-section-title::before {content:"";flex:none;align-self:center;width:5px;height:20px;border-radius:3px;background:var(--grad-mark);box-shadow:0 2px 6px rgba(232,121,26,.25)}
  body:not(.printmode) :is(.ui-card,:where(.ui-form :is(.form-card,.card,.section):not(:where(.page *, .flyer *, .mn-sheet *, #formOut *, #frame *)))) {box-shadow:0 1px 2px rgba(16,32,43,.05),0 6px 18px rgba(16,32,43,.06);animation:uiRise .35s var(--ease) both}
  body:not(.printmode) :is(.ui-input,:where(.ui-form :is(input:not([type=checkbox],[type=radio],[type=file],[type=hidden],[type=range]),select,textarea):not(:where(.page *, .flyer *, .mn-sheet *, #formOut *, #frame *)))):focus {box-shadow:0 0 0 4px rgba(46,123,173,.18)}
  body:not(.printmode) :is(.ui-choice,:where(.ui-form label:has(>input:is([type=checkbox],[type=radio])):not(:where(.page *, .flyer *, .mn-sheet *, #formOut *, #frame *)))):has(input:checked) {box-shadow:0 0 0 3px rgba(46,123,173,.14);animation:uiPop .22s var(--ease)}
  body:not(.printmode) .ui-steps li {transition:color .2s var(--ease),border-color .2s var(--ease)}
  body:not(.printmode) .ui-steps li.active {border-image:linear-gradient(90deg,#1a5f8a,#e8791a) 1}
  body:not(.printmode) .ui-steps li.done::before {content:"✓";margin-right:4px;font-weight:800}
  body:not(.printmode) .ui-toast {background:var(--grad-brand);box-shadow:0 10px 28px rgba(15,58,86,.35);animation:uiToast .3s var(--ease)}
  body:not(.printmode) details.collapsible>summary {transition:background .2s var(--ease)}
  body:not(.printmode) details.collapsible[open]>summary {background:var(--brand-50)}
  body:not(.printmode) .ui-tabs a.cur {box-shadow:inset 0 -2px 0 var(--accent-500)}
  /* ホーム：タイルを押した手応え・業務チェックの達成感 */
  body.ui-home:not(.printmode) .tile {transition:transform .15s var(--ease),box-shadow .2s var(--ease)}
  body.ui-home:not(.printmode) .tile:active {transform:scale(.95)}
  body.ui-home:not(.printmode) .tile .chip {transition:transform .25s var(--ease)}
  body.ui-home:not(.printmode) .tile:active .chip {transform:rotate(-6deg) scale(1.08)}
  body.ui-home:not(.printmode) .ck-bar span {background:linear-gradient(90deg,#e8791a,#f4a24c);transition:width .45s var(--ease)}
  body.ui-home:not(.printmode) .ck-card.all-done .ck-bar span {background:linear-gradient(90deg,#176744,#2fa36b,#176744);background-size:200% 100%;animation:uiShine 2.4s linear infinite}
  body.ui-home:not(.printmode) .ck-card.all-done {border-color:#9fd3b8;box-shadow:0 0 0 3px rgba(23,103,68,.10),0 6px 18px rgba(16,32,43,.06)}
  body.ui-home:not(.printmode) .ck-item.done .ck-box {animation:uiPop .25s var(--ease)}
  body:not(.printmode) .ui-card:not(:where(.page *, .flyer *, .mn-sheet *, #formOut *, #frame *)) {background:linear-gradient(90deg,#1a5f8a 0%,#2e7bad 55%,#e8791a 100%) top/100% 3px no-repeat,var(--surface)!important}
  body.ui-home:not(.printmode) .tile {background:linear-gradient(180deg,#fff 0%,#f5f9fc 100%)}
  body.ui-home:not(.printmode) .tile .chip {box-shadow:0 4px 10px rgba(16,32,43,.10)}
  /* 2026-10-25 業務チェック：終わった項目は緑で塗って「済み」が一目で分かるように */
  body.ui-home:not(.printmode) .ck-item.done {background:linear-gradient(135deg,#e6f4ee 0%,#d3eddf 100%)!important;border:1.5px solid #2fa36b!important;color:#176744!important;box-shadow:0 2px 8px rgba(23,103,68,.15)}
  body.ui-home:not(.printmode) .ck-item.done .ck-box {background:#176744;border-color:#176744}
  body.ui-home:not(.printmode) .ck-item.done :is(.ck-nm,.ck-sub) {color:#176744!important}
  @keyframes uiRise {from{opacity:0;transform:translateY(6px)}to{opacity:1;transform:none}}
  @keyframes uiPop {0%{transform:scale(1)}50%{transform:scale(1.04)}100%{transform:scale(1)}}
  @keyframes uiToast {from{opacity:0;transform:translate(-50%,12px)}to{opacity:1;transform:translate(-50%,0)}}
  @keyframes uiShine {from{background-position:200% 0}to{background-position:0 0}}
  @media (prefers-reduced-motion:reduce) {
    body:not(.printmode) :is(.ui-card,.ui-toast,.ui-choice,.ck-item .ck-box,.ck-bar span,.ui-form .form-card,.ui-form .card,.ui-form .section) {animation:none!important}
    body:not(.printmode) :is(.ui-btn,.tile,.tile .chip,.ui-controls button):active {transform:none!important}
  }
}

/* ===== 押し心地 2026-11-17：画面の操作部品だけ。帳票・印刷には適用しない ===== */
@media screen {
  /* 静止時の色・寸法・影は維持。離すときだけ、ごく短く弾んで戻る。 */
  body:not(.printmode) :is(.ui-btn,:where(.ui-controls :is(button,a.btn,[role=button],.tab)),:where(body.ui-home) :is(.tile,.ck-item,.hk-btn)):not(:where(.page *, .flyer *, .mn-sheet *, #formOut *, #frame *)):not(:disabled,[aria-disabled=true]) {
    touch-action:manipulation;
    transition:transform 220ms cubic-bezier(.2,1.55,.4,1),box-shadow 180ms var(--ease);
  }

  /* マウスだけに軽い持ち上がり。タッチ端末にhoverの見た目を残さない。 */
  @media (hover:hover) and (pointer:fine) {
    body:not(.printmode) :is(.ui-btn,:where(.ui-controls :is(button,a.btn,[role=button],.tab)),:where(body.ui-home) :is(.tile,.ck-item,.hk-btn)):not(:where(.page *, .flyer *, .mn-sheet *, #formOut *, #frame *)):not(:disabled,[aria-disabled=true]):hover:not(:active) {
      transform:translateY(-1px);
    }
  }

  /* 44pxの押下範囲を縮めないよう、通常ボタンと業務チェックは沈み込みで表現。 */
  body:not(.printmode) :is(.ui-btn,:where(.ui-controls :is(button,a.btn,[role=button],.tab)),:where(body.ui-home) :is(.tile,.ck-item,.hk-btn)):not(:where(.page *, .flyer *, .mn-sheet *, #formOut *, #frame *)):not(:disabled,[aria-disabled=true]):active {
    transform:translateY(2px);
    /* 完了済みチェックの既存!importantよりも、押している間の影を優先する。 */
    box-shadow:0 1px 1px rgba(16,32,43,.08),inset 0 2px 4px rgba(16,32,43,.16)!important;
    transition:transform 100ms cubic-bezier(.2,.7,.2,1),box-shadow 100ms var(--ease);
  }

  /* 文字の背景色は変えず、内縁の光と縮んだ影で「押せた」を知らせる。 */
  body:not(.printmode) .ui-btn-primary:not(:where(.page *, .flyer *, .mn-sheet *, #formOut *, #frame *)):not(:disabled,[aria-disabled=true]):active {
    box-shadow:0 1px 3px rgba(26,95,138,.18),inset 0 2px 4px rgba(15,58,86,.24),inset 0 0 0 2px rgba(255,255,255,.24)!important;
  }

  /* 選択中のタブなどは、押している間も選択を示す下線を残す。 */
  body.ui-app:not(.printmode) :is(.ui-btn,:where(.ui-controls :is(button,a.btn,[role=button],.tab))):not(:where(.page *, .flyer *, .mn-sheet *, #formOut *, #frame *)):not(:disabled,[aria-disabled=true]):is(.active,.on,.cur,[aria-pressed=true]):active {
    box-shadow:0 1px 1px rgba(16,32,43,.08),inset 0 2px 4px rgba(16,32,43,.16),inset 0 -2px 0 var(--brand-700)!important;
  }

  /* 大きいタイルはわずかに縮め、既存のアイコン装飾・疑似要素はそのまま使う。 */
  body.ui-home:not(.printmode) .tile:not(:where(.page *, .flyer *, .mn-sheet *, #formOut *, #frame *)):not(:disabled,[aria-disabled=true]):active {
    transform:translateY(2px) scale(.985);
  }
  body.ui-home:not(.printmode) .tile:not(:where(.page *, .flyer *, .mn-sheet *, #formOut *, #frame *)):not(:disabled,[aria-disabled=true]) .chip {
    transition:transform 220ms cubic-bezier(.2,1.55,.4,1),box-shadow 180ms var(--ease);
  }
  body.ui-home:not(.printmode) .tile:not(:where(.page *, .flyer *, .mn-sheet *, #formOut *, #frame *)):not(:disabled,[aria-disabled=true]):active .chip {
    transform:scale(.96);
    transition-duration:100ms;
  }

  /* 旧ルールの:activeにも動かされないよう、無効状態を明示する。 */
  body:not(.printmode) :is(.ui-btn,:where(.ui-controls :is(button,a.btn,[role=button],.tab)),:where(body.ui-home) :is(.tile,.ck-item,.hk-btn)):not(:where(.page *, .flyer *, .mn-sheet *, #formOut *, #frame *)):is(:disabled,[aria-disabled=true]),
  body.ui-home:not(.printmode) .tile:not(:where(.page *, .flyer *, .mn-sheet *, #formOut *, #frame *)):is(:disabled,[aria-disabled=true]) .chip {
    transform:none!important;
    transition:none;
  }

  @media (prefers-reduced-motion:reduce) {
    body:not(.printmode) :is(.ui-btn,:where(.ui-controls :is(button,a.btn,[role=button],.tab)),:where(body.ui-home) :is(.tile,.ck-item,.hk-btn)):not(:where(.page *, .flyer *, .mn-sheet *, #formOut *, #frame *)),
    body.ui-home:not(.printmode) .tile:not(:where(.page *, .flyer *, .mn-sheet *, #formOut *, #frame *)) .chip {
      transform:none!important;
      transition:none!important;
      animation:none!important;
    }
  }
}
