/* ============================================================
 * Lumen UI — 比較用テーマ(html[data-ui-theme="lumen"] のときだけ有効)
 *
 * 構成: 細いアイコンレール+⌘K 横断検索+すりガラスのパネル。
 * 配色: 白に近い青みのグレー地に、ラベンダーとミントがにじむ。文字はスレート(黒は使わない)。
 * グラフ: ミント→空色のグラデーション棒・なめらかな面・同心円リング・濃淡ヒートマップ・ゲージ
 *        (部品は src/components/lumen/*。現行テーマでは描画されない)
 *
 * 画面用スタイルのみ。/print・印刷メディア・帳票(.sheet / .print-page)は対象外。
 * data-ui-theme を外せば現行UIへ即復帰する(このファイルはDB・会社設定に触れない)。
 * ============================================================ */

/* ---------- 切替スイッチ(現行テーマ側でも表示) ---------- */
.brand-lockup,
.theme-section-icon,
.dashboard-today { display: none; }

.appearance-switch { min-width: 0; }
.appearance-label { display: block; margin-bottom: 8px; color: #686a65; font-size: 12px; }
.appearance-options { display: inline-flex; gap: 3px; padding: 3px; border-radius: 10px; background: #e9eae7; }
.appearance-options button {
  display: inline-flex; justify-content: center; align-items: center; gap: 5px;
  min-height: 32px; padding: 5px 12px; border: 0; border-radius: 7px;
  background: transparent; color: #50524d; box-shadow: none; font-size: 13px;
}
.appearance-options button[aria-pressed="true"] { color: #20231e; background: #fff; box-shadow: 0 1px 4px #00000015; }
.appearance-switch.is-compact { margin: 14px 18px; }
.appearance-switch.is-compact .appearance-options { display: flex; }
.appearance-switch.is-compact button { flex: 1; padding-inline: 6px; }
.appearance-switch p { margin: 12px 0 0; font-size: 13px; line-height: 1.6; }
.mobile-menu-sheet .appearance-switch { margin: 18px 0 0; }
.mobile-menu-sheet .appearance-label { color: #d2d8d2; }
.mobile-menu-sheet .appearance-options button { min-height: 44px; color: #50524d; }
.appearance-options button:focus-visible { outline: 2px solid #3cc79a; outline-offset: 3px; }

/* ---------- 横断検索(テーマに関係なく、開いたときだけ存在する) ---------- */
.command-palette-backdrop {
  position: fixed; inset: 0; z-index: 200;
  display: flex; justify-content: center; align-items: flex-start;
  padding: min(14vh, 120px) 16px 16px;
  background: #e9edf4a6;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  animation: lumen-fade .16s ease both;
}
.command-palette {
  width: min(640px, 100%); max-height: min(70vh, 560px);
  display: flex; flex-direction: column; overflow: hidden;
  color: #3b4252; background: #fbfcfe; border: 1px solid #fff; border-radius: 20px;
  box-shadow: 0 1px 2px #3b42520f, 0 30px 70px -24px #3b425259;
  animation: lumen-pop .22s cubic-bezier(.2, .8, .2, 1) both;
}
.command-palette-input { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid #e8ecf3; }
.command-palette-input svg { width: 20px; height: 20px; flex-shrink: 0; fill: none; stroke: #8a92a5; stroke-width: 1.8; stroke-linecap: round; }
.command-palette-input input {
  flex: 1; min-width: 0; padding: 4px 0; border: 0 !important; outline: none; box-shadow: none !important;
  background: transparent !important; color: #3b4252; font-size: 16px;
}
.command-palette-input kbd, .command-palette-foot span {
  font: inherit; font-size: 11px; color: #8a92a5; padding: 2px 7px; border-radius: 6px; background: #eef1f6;
}
.command-palette-list { overflow-y: auto; padding: 6px 8px 8px; }
.command-palette-group { margin: 10px 10px 4px; font-size: 11px; font-weight: 700; letter-spacing: .08em; color: #9aa1b2; }
.command-palette-item {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 42px;
  padding: 8px 12px; border: 0; border-radius: 12px; background: transparent; box-shadow: none;
  color: #3b4252; text-align: left; font-size: 14px; cursor: pointer;
}
.command-palette-item strong { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.command-palette-item span { margin-left: auto; padding-left: 12px; color: #8a92a5; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 55%; }
.command-palette-item.is-active { background: #e8f6f0; }
.command-palette-dot { width: 8px; height: 8px; flex-shrink: 0; border-radius: 50%; background: #b7bfcc; }
.command-palette-dot.is-page { background: #5b9be6; }
.command-palette-dot.is-doc { background: #3cc79a; }
.command-palette-dot.is-client { background: #9b87e6; }
.command-palette-dot.is-payable { background: #e9b45a; }
.command-palette-empty { padding: 28px; text-align: center; color: #8a92a5; font-size: 13px; }
.command-palette-foot { display: flex; gap: 8px; padding: 10px 16px; border-top: 1px solid #e8ecf3; margin: 0; }

@keyframes lumen-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes lumen-pop { from { opacity: 0; transform: translateY(-8px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes lumen-rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes lumen-grow { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes lumen-draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }

@media screen {
  html[data-ui-theme="lumen"]:not(:has(.print-page)),
  html[data-ui-theme="lumen"] body:not(:has(.print-page)) {
    background-color: #f3f5f9;
    background-image:
      radial-gradient(55vw 50vh at 100% 0%, #e6e2fb, transparent 70%),
      radial-gradient(50vw 55vh at 0% 100%, #d9f2e7, transparent 70%),
      radial-gradient(40vw 35vh at 40% 0%, #e4effb, transparent 70%);
    background-attachment: fixed;
  }

  html[data-ui-theme="lumen"] .app:not(:has(.print-page)) {
    --ink: #3b4252;
    --muted: #8a92a5;
    --line: #e6eaf1;
    --panel: #ffffff;
    --bg: transparent;
    --accent: #2fae86;
    --accent-dark: #23966f;
    --accent-tint: #e3f6ee;
    --accent-tint2: #f0faf6;
    --danger: #d9634a;
    --apple-text: #3b4252;
    --apple-secondary: #8a92a5;
    --apple-accent: #23966f;
    --apple-accent-strong: #1d8061;
    --apple-blue: #23966f;
    --proof-row-hover: #f2f6fb;
    --proof-row-selected: #e3f6ee;
    --lu-glass: linear-gradient(180deg, #ffffffe6, #ffffffbf);
    --lu-border: #ffffff;
    --lu-shadow: 0 1px 2px #3b42520a, 0 14px 32px -20px #3b425238;
    --lu-shadow-lift: 0 2px 4px #3b42520f, 0 22px 40px -20px #3b42524d;
    --lu-mint: #3cc79a;
    --lu-sky: #5b9be6;
    --lu-ease: cubic-bezier(.2, .8, .2, 1);
    background: transparent;
    color: var(--ink);
    font-feature-settings: "palt" 1;

    &::before { display: none; }
    & > .main { padding: 26px 32px 44px 22px; }
    & > .main > div { max-width: none; animation: lumen-rise .34s var(--lu-ease) both; }

    /* ======================= アイコンレール ======================= */
    & .sidebar {
      width: 72px; top: 14px; height: calc(100dvh - 28px);
      margin: 14px 0 14px 14px; padding: 16px 0 12px;
      display: flex; flex-direction: column; align-items: center;
      color: var(--ink); background: #ffffffa6;
      border: 1px solid #fff; border-radius: 24px;
      box-shadow: 0 1px 2px #3b42520a, 0 20px 44px -28px #3b425255;
      backdrop-filter: blur(22px) saturate(160%); -webkit-backdrop-filter: blur(22px) saturate(160%);
      overflow: visible; z-index: 30;
    }
    & .sidebar .sidebar-brand { padding: 0 0 18px; display: flex; flex-direction: column; align-items: center; gap: 6px; }
    & .sidebar .brand-default-logo { display: none; }
    & .sidebar .brand-lockup { display: flex; }
    & .sidebar .brand-lockup img:first-child { width: 34px; height: 34px; }
    & .sidebar .brand-lockup img:last-child { display: none; }
    & .sidebar .demo-pill {
      order: 2; margin: 0; padding: 1px 6px; font-size: 8.5px; letter-spacing: .14em; text-indent: .14em;
      color: #c0644c; background: #fbe8e2; border: 0;
    }
    & .sidebar nav { padding: 0; gap: 6px; align-items: center; }
    & .sidebar nav a,
    & .sidebar .rail-tool {
      position: relative; display: grid; place-items: center;
      width: 46px; height: 46px; min-height: 0; padding: 0; margin: 0;
      color: #9aa1b2; border: 0; border-radius: 14px; background: transparent; box-shadow: none;
      transition: background-color .18s var(--lu-ease), color .18s var(--lu-ease), box-shadow .18s var(--lu-ease);
    }
    & .sidebar nav a .nav-icon { width: 22px; height: 22px; color: inherit; }
    & .sidebar nav a:hover, & .sidebar .rail-tool:hover { color: var(--ink); background: #ffffffcc; }
    & .sidebar nav a.active {
      color: var(--accent-dark); background: #fff;
      box-shadow: 0 1px 2px #3b42520f, 0 8px 18px -10px #2fae8666;
    }
    & .sidebar nav a.active::before {
      content: ""; position: absolute; left: -13px; top: 50%; width: 4px; height: 18px; margin-top: -9px;
      border-radius: 0 4px 4px 0; background: linear-gradient(180deg, var(--lu-mint), var(--lu-sky));
    }
    /* ラベルはツールチップとして右へ浮かせる */
    & .sidebar .nav-label {
      position: absolute; left: calc(100% + 14px); top: 50%; z-index: 40;
      padding: 6px 11px; border-radius: 10px; white-space: nowrap;
      color: var(--ink); background: #fff; font-size: 12.5px; font-weight: 600;
      box-shadow: 0 1px 2px #3b42521a, 0 10px 24px -10px #3b425259;
      opacity: 0; pointer-events: none; transform: translate(-4px, -50%);
      transition: opacity .14s ease, transform .14s ease;
    }
    & .sidebar :is(nav a, .rail-tool):is(:hover, :focus-visible) .nav-label { opacity: 1; transform: translate(0, -50%); }
    & .sidebar :is(nav a, .rail-tool):focus-visible { outline: 2px solid var(--lu-mint); outline-offset: 2px; }

    & .sidebar .rail-tools {
      margin-top: auto; padding: 12px 0 0; display: flex; flex-direction: column; align-items: center; gap: 4px;
      border-top: 1px solid #e3e8f0; width: 46px;
    }
    & .sidebar .rail-tool svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
    & .sidebar .rail-avatar {
      display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%;
      color: #6b5aa8; background: linear-gradient(135deg, #ece8fb, #dfe9fb); font-size: 13px; font-weight: 700;
    }
    & .sidebar .sidebar-foot { display: none; }

    /* ======================= 見出し・タイポ ======================= */
    & .page-title { font-size: clamp(24px, 1.9vw, 28px); font-weight: 650; line-height: 1.2; letter-spacing: -.02em; color: var(--ink); }
    & .section-label { font-size: 14.5px; font-weight: 650; color: var(--ink); }
    & .section-label .sec-no {
      display: inline-flex; align-items: center; justify-content: center;
      min-width: 24px; height: 24px; padding: 0 6px; border-radius: 8px;
      font-size: 11px; font-weight: 700; color: var(--accent-dark); background: var(--accent-tint);
    }
    & .muted { color: var(--muted); }
    & :is(td, .kpi-value, .analytics-summary-item strong, .num) { font-variant-numeric: tabular-nums; }
    & .theme-section-icon {
      display: inline-flex; align-items: center; justify-content: center;
      flex: 0 0 28px; width: 28px; height: 28px; border-radius: 9px;
      color: var(--accent-dark); background: linear-gradient(135deg, #e3f6ee, #e3eefb);
    }
    & .theme-section-icon svg { width: 16px; height: 16px; }

    & .dashboard-title-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 4px; }
    & .dashboard-title-row .page-title { margin-bottom: 14px; }
    & .dashboard-today {
      display: inline-flex; align-items: center; gap: 8px; margin-bottom: 14px;
      padding: 7px 14px; border-radius: 12px;
      color: var(--muted); font-size: 12.5px; white-space: nowrap;
      background: #ffffffb3; border: 1px solid #fff; box-shadow: var(--lu-shadow);
    }

    /* ======================= パネル ======================= */
    & :is(.card, .kpi, .analytics-summary, .mobile-document-card, .client-card, .totals-card) {
      border: 1px solid var(--lu-border); border-radius: 20px; background: var(--lu-glass);
      box-shadow: var(--lu-shadow);
      backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    }
    & .card { padding: 18px 20px; }
    & .card .mobile-document-card, & .card .mobile-document-card:hover {
      border: 0; border-bottom: 1px solid var(--line); border-radius: 0; box-shadow: none; background: transparent;
      backdrop-filter: none; -webkit-backdrop-filter: none;
    }

    /* ======================= KPI ======================= */
    & .kpi-row { gap: 12px; margin-bottom: 14px; }
    & .kpi-row .kpi {
      min-height: 0; padding: 16px 18px 14px;
      transition: transform .22s var(--lu-ease), box-shadow .22s var(--lu-ease);
    }
    & .kpi-row .kpi:hover { transform: translateY(-2px); box-shadow: var(--lu-shadow-lift); }
    & .kpi-row .kpi-label { margin-bottom: 8px; font-size: 12px; font-weight: 600; letter-spacing: .02em; color: var(--muted); }
    & .kpi-row .kpi-value { margin: 0 0 6px; font-weight: 650; line-height: 1.05; letter-spacing: -.025em; color: var(--ink); }
    & .kpi-row .kpi-value .kpi-num { font-weight: 650; font-size: clamp(22px, 13cqw, 34px); letter-spacing: -.025em; }
    & .kpi-row .kpi-unit { font-size: 18px; font-weight: 500; margin-right: 2px; color: inherit; opacity: .55; }
    & .kpi-row .kpi-sub { font-size: 11.5px; line-height: 1.6; color: var(--muted); }
    & .kpi-row .kpi-sub-danger { color: var(--danger); font-weight: 600; }
    & .kpi-row .kpi:first-child {
      background: linear-gradient(135deg, #e3f7ef, #e5eefb);
      border-color: #d6f0e5;
    }
    & .kpi-row .kpi:first-child .kpi-value { color: #1f7f62; }
    & .kpi-value.kpi-danger { color: var(--danger); }

    /* ======================= ダッシュボードのセクション ======================= */
    & .dashboard-page .dashboard-section-card { border-top: 1px solid var(--lu-border); }
    & .dashboard-section-card .dash-section-head {
      margin: 0 0 8px; padding: 0 0 10px; min-height: 0;
      background: transparent; border-radius: 0; border-bottom: 1px solid var(--line);
    }
    & .dash-section-head > span:first-child { gap: 10px; }
    & .dash-section-head > span:first-child::before { display: none; }
    & .dash-section-meta { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
    & .dash-section-link {
      display: inline-grid; place-items: center;
      border-radius: 10px; background: #eef2f8; border: 0; color: #6b7386;
      transition: background-color .18s var(--lu-ease), color .18s var(--lu-ease), transform .18s var(--lu-ease);
    }
    & .dash-section-link:hover { background: var(--accent-tint); color: var(--accent-dark); transform: translateX(2px); }
    & :is(.dash-more-row td, button.dash-more-row) { color: var(--accent-dark); font-weight: 600; }
    & .dash-work-row { border-radius: 0; }

    /* ======================= テーブル ======================= */
    & table.list { border: 0; border-radius: 14px; background: transparent; overflow: hidden; border-collapse: separate; border-spacing: 0; }
    & table.list th { background: transparent; color: #9aa1b2; font-size: 11.5px; font-weight: 600; letter-spacing: .03em; border-bottom: 1px solid var(--line); }
    & table.list td { color: #4a5263; border-bottom: 1px solid #edf0f5; font-size: 13.5px; transition: background-color .14s ease; }
    & table.list tr:last-child td { border-bottom: 0; }
    & table.list tr.clickable:hover td { background: #f2f6fb; }
    & table.list tr.clickable:hover td:first-child { box-shadow: inset 3px 0 0 var(--lu-mint); }
    & table.list tr.row-selected td { background: var(--accent-tint); }
    & table.list tr.row-paid td { color: #a3aabb; background: transparent; }
    & > .main > div > table.list { background: var(--lu-glass); border: 1px solid #fff; box-shadow: var(--lu-shadow); }
    & :is(.documents-list, .payables-list) td { padding-top: 13px; padding-bottom: 13px; }

    /* ======================= バッジ(状態の点) ======================= */
    & .badge:not(.sh-reimbursement-badge) {
      display: inline-flex; align-items: center; gap: 6px;
      padding: 3px 10px 3px 8px; border: 0; border-radius: 999px;
      font-size: 11.5px; font-weight: 600; color: #6b7386; background: #eef1f6; white-space: nowrap;
    }
    & .badge:not(.sh-reimbursement-badge)::before {
      content: ""; width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0;
      background: currentColor; box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 18%, transparent);
    }
    & .badge.sent { color: #23966f; background: #e3f6ee; }
    & .badge.sent.quote-sent { color: #3f7fcb; background: #e5effb; }
    & .badge.in_progress, & .badge.due-soon { color: #b07a22; background: #fbf1de; }
    & .badge.overdue { color: #cc5a42; background: #fbe8e2; }
    & .badge.paid { color: #8a92a5; background: #eef1f6; }
    & .badge.dropped { color: #a3aabb; background: #f2f4f8; }

    /* ======================= ボタン ======================= */
    & :is(button, .btn):not(.sheet *) {
      border-radius: 11px;
      transition: background-color .16s var(--lu-ease), border-color .16s var(--lu-ease), color .16s var(--lu-ease),
        box-shadow .16s var(--lu-ease), transform .12s var(--lu-ease);
    }
    & :is(button, .btn):not(.sheet *):not(:disabled):not(.dash-work-row):active { transform: scale(.98); }
    & .btn-primary {
      color: #fff; border-color: transparent; font-weight: 600;
      background: linear-gradient(135deg, #3cc79a, #4aa6e0);
      box-shadow: 0 1px 0 #ffffff40 inset, 0 8px 18px -8px #3cc79a99;
    }
    & .btn-primary:hover { border-color: transparent; filter: saturate(1.1) brightness(.98); box-shadow: 0 1px 0 #ffffff40 inset, 0 12px 22px -10px #3cc79aad; }
    & :is(button, .btn):not(.sheet *):focus-visible { outline: 2px solid var(--lu-mint); outline-offset: 2px; }

    & :is(.tabs, .pill-toggle, .analytics-metric-toggle) { padding: 3px; gap: 2px; background: #e8ecf3b3; border: 0; border-radius: 12px; }
    & :is(.tabs, .pill-toggle, .analytics-metric-toggle) button { color: #7d8598; background: transparent; border: 0; box-shadow: none; border-radius: 9px; font-weight: 500; }
    & :is(.tabs, .pill-toggle, .analytics-metric-toggle) button:hover { color: var(--ink); }
    & :is(.tabs, .pill-toggle, .analytics-metric-toggle) button.on {
      color: var(--accent-dark); font-weight: 650; background: #fff;
      box-shadow: 0 1px 2px #3b425214, 0 6px 12px -8px #3b425240;
    }

    & :is(input, select, textarea):not(.status-badge select):not([type="checkbox"]):not([type="radio"]) {
      color: var(--ink); border-color: #dfe4ec; background-color: #ffffffd9; border-radius: 11px;
      transition: border-color .16s var(--lu-ease), box-shadow .16s var(--lu-ease);
    }
    & :is(input, select, textarea):focus { border-color: var(--lu-mint); box-shadow: 0 0 0 4px #3cc79a24; outline: none; }
    & :is(input[type="checkbox"], input[type="radio"]) { accent-color: var(--accent); }

    & :is(.modal, .about-modal) { background: #fbfcfe; border: 1px solid #fff; border-radius: 22px; box-shadow: 0 30px 80px -24px #3b425259; }
    & .editor-preview { background: #e9edf4b3; border-radius: 20px; box-shadow: 0 0 0 1px #ffffffb3 inset; }
    & .editor-section-secondary { background: #f6f8fb; }

    /* ======================= 分析 ======================= */
    & .analytics-summary { padding: 14px 0; }
    & .analytics-summary-item { padding: 4px 20px; border-left-color: var(--line); }
    & .analytics-summary-item.is-primary { background: transparent; }
    & .analytics-summary-item > span { font-size: 12px; font-weight: 600; letter-spacing: .02em; }
    & .analytics-summary-item > strong { margin: 8px 0; font-weight: 650; letter-spacing: -.025em; color: var(--ink); }
    & .analytics-summary-item.is-primary > strong {
      background: linear-gradient(90deg, #23966f, #3f7fcb); -webkit-background-clip: text; background-clip: text; color: transparent;
    }
    & .analytics-panel .section-label { display: flex; align-items: center; gap: 10px; }
    & .analytics-panel-note { color: var(--muted); }
    & .analytics-delta { color: var(--accent-dark); }
    & .analytics-delta.is-negative { color: var(--danger); }
    & :is(.analytics-bar-legend, .analytics-line-legend) i.is-current { background: linear-gradient(180deg, var(--lu-mint), var(--lu-sky)); }
    & :is(.analytics-bar-legend, .analytics-line-legend) i.is-previous { background: #dfe4ec; }
    & :is(.analytics-bar-legend, .analytics-line-legend) i.is-forecast { background: repeating-linear-gradient(45deg, #3cc79a66 0 2px, #3cc79a22 2px 4px); }
    & .analytics-amount-bar { border-radius: 999px; overflow: hidden; gap: 3px; }
    & .analytics-amount-bar i:nth-child(1) { background: #dfe4ec !important; }
    & .analytics-amount-bar i:nth-child(2) { background: #a9d0f3 !important; }
    & .analytics-amount-bar i:nth-child(3) { background: #7fd7b8 !important; }
    & .analytics-amount-bar i:nth-child(4) { background: linear-gradient(90deg, #3cc79a, #5b9be6) !important; }
    & .analytics-amount-list > div, & .analytics-status-list > div { background: #f3f6fa; border-radius: 12px; }

    /* ---- Lumen グラフ部品 ---- */
    & .lumen-chart { position: relative; margin-top: 6px; }
    & .lumen-chart svg { display: block; width: 100%; height: auto; overflow: visible; }
    & .lumen-grid { stroke: #e9edf3; stroke-width: 1; }
    & .lumen-zero { stroke: #d5dbe5; stroke-width: 1; }
    & .lumen-axis { fill: #9aa1b2; font-size: 11px; font-family: inherit; }
    & .lumen-hit { fill: transparent; }
    & .lumen-slot.is-hover .lumen-hit { fill: #eef3fa; }
    & .lumen-ghost { fill: #e6ebf2; }
    & .lumen-slot.is-hover .lumen-ghost { fill: #dbe2ec; }
    & .lumen-bar {
      filter: drop-shadow(0 6px 10px #3cc79a40);
      transform-box: fill-box; transform-origin: 50% 100%;
      animation: lumen-grow .7s var(--lu-ease) both; animation-delay: calc(var(--i, 0) * 35ms);
    }
    & .lumen-bar.is-forecast { filter: none; }
    & .lumen-line { fill: none; stroke-linecap: round; stroke-linejoin: round; }
    & .lumen-line.is-current { stroke: var(--lu-mint); stroke-width: 3; filter: drop-shadow(0 4px 8px #3cc79a59); }
    & .lumen-line.is-previous { stroke: #b9c2d0; stroke-width: 2; stroke-dasharray: 5 6; }
    & .lumen-line.is-forecast { stroke: var(--lu-sky); stroke-width: 2; stroke-dasharray: 2 5; }
    & .lumen-line.is-net { stroke: #9b87e6; stroke-width: 2; stroke-dasharray: 3 5; }
    & .lumen-net-dot { fill: #fff; stroke: #9b87e6; stroke-width: 2; }
    & .lumen-area { animation: lumen-fade .9s ease both; }
    & .lumen-halo { fill: #3cc79a2e; }
    & .lumen-dot { fill: #fff; stroke: var(--lu-mint); stroke-width: 3; }
    & .lumen-cash-in {
      fill: var(--lu-mint); filter: drop-shadow(0 4px 8px #3cc79a40);
      transform-box: fill-box; transform-origin: 50% 100%; animation: lumen-grow .7s var(--lu-ease) both; animation-delay: calc(var(--i, 0) * 35ms);
    }
    & .lumen-cash-out {
      fill: #f2a690;
      transform-box: fill-box; transform-origin: 50% 0%; animation: lumen-grow .7s var(--lu-ease) both; animation-delay: calc(var(--i, 0) * 35ms);
    }
    & .lumen-tip {
      position: absolute; top: 0; z-index: 5; transform: translateX(-50%);
      display: grid; gap: 3px; min-width: 168px; padding: 9px 12px;
      color: var(--ink); background: #ffffffeb; border: 1px solid #fff; border-radius: 12px;
      box-shadow: 0 12px 30px -12px #3b42524d; font-size: 12px; pointer-events: none; white-space: nowrap;
    }
    & .lumen-tip b { font-size: 12.5px; }
    & .lumen-tip span { display: flex; align-items: center; gap: 6px; color: #5b6375; font-variant-numeric: tabular-nums; }
    & .lumen-tip i { width: 8px; height: 8px; border-radius: 3px; background: #dfe4ec; }
    & .lumen-tip i.is-current, & .lumen-tip i.is-in { background: var(--lu-mint); }
    & .lumen-tip i.is-forecast { background: #3cc79a66; }
    & .lumen-tip i.is-out { background: #f2a690; }
    & .lumen-tip i.is-net { background: #9b87e6; }

    & .lumen-rings-layout { display: grid; grid-template-columns: minmax(180px, 240px) minmax(0, 1fr); gap: 20px; align-items: center; margin-top: 8px; }
    & .lumen-rings { width: 100%; height: auto; }
    & .lumen-ring-track { fill: none; stroke: #edf0f5; }
    & .lumen-ring { animation: lumen-fade .8s ease both; animation-delay: calc(var(--i, 0) * 70ms); }
    & .lumen-ring-center { fill: var(--ink); font-size: 17px; font-weight: 650; font-variant-numeric: tabular-nums; }
    & .lumen-ring-legend { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; font-size: 12.5px; }
    & .lumen-ring-legend li { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; column-gap: 9px; align-items: center; }
    & .lumen-ring-legend i { width: 10px; height: 10px; border-radius: 4px; }
    & .lumen-ring-legend span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: #4a5263; }
    & .lumen-ring-legend strong { font-variant-numeric: tabular-nums; color: var(--ink); }
    & .lumen-ring-legend small { grid-column: 2 / -1; color: var(--muted); font-size: 11px; margin-top: -2px; }

    & .lumen-status-rings { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 10px; text-align: center; }
    & .lumen-status-rings > div { display: grid; justify-items: center; gap: 2px; padding: 10px 6px; border-radius: 16px; background: #f5f7fb; }
    & .lumen-status-rings span { font-size: 12px; color: var(--muted); font-weight: 600; }
    & .lumen-status-rings strong { font-size: 14px; color: var(--ink); font-variant-numeric: tabular-nums; }
    & .lumen-status-rings small { font-size: 11px; color: var(--muted); }
    & .lumen-mini-ring .lumen-ring-value { fill: var(--ink); font-size: 14px; font-weight: 700; }

    & .lumen-gauge { display: block; width: 100%; max-width: 280px; margin: 6px auto 0; }
    & .lumen-gauge-arc { filter: drop-shadow(0 4px 10px #3cc79a59); }
    & .lumen-gauge-value { fill: var(--ink); font-size: 26px; font-weight: 650; font-variant-numeric: tabular-nums; }

    & .lumen-heat { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 5px; margin-top: 12px; }
    & .lumen-heat-cell { display: grid; gap: 4px; text-align: center; }
    & .lumen-heat-cell i { display: block; aspect-ratio: 1; border-radius: 7px; background: #edf1f6; }
    & .lumen-heat-cell i.is-peak { box-shadow: 0 6px 14px -4px #3cc79a99; }
    & .lumen-heat-cell span { font-size: 10px; color: #a3aabb; font-variant-numeric: tabular-nums; }
    & .lumen-pulse-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin-top: 14px; }
    & .lumen-pulse-stats div { padding: 9px 10px; border-radius: 12px; background: #f5f7fb; }
    & .lumen-pulse-stats span { display: block; font-size: 10.5px; color: var(--muted); }
    & .lumen-pulse-stats strong { display: block; margin-top: 2px; font-size: 14px; color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
    & .lumen-pulse-stats .is-positive { color: var(--accent-dark); }
    & .lumen-pulse-stats .is-negative { color: var(--danger); }

    /* ======================= SP ======================= */
    & .mobile-topbar { background: #f3f5f9d9; border-bottom: 1px solid #e3e8f0; backdrop-filter: blur(18px) saturate(160%); -webkit-backdrop-filter: blur(18px) saturate(160%); }
    & .mobile-topbar .mobile-title { color: var(--ink); font-weight: 650; }
    & .mobile-topbar :is(.mobile-title-icon, .hamburger) { color: #6b7386; }
    & .mobile-bottom-nav {
      background: #fbfcfee0; border-top: 1px solid #e3e8f0; box-shadow: 0 -10px 30px -20px #3b425240;
      backdrop-filter: blur(20px) saturate(160%); -webkit-backdrop-filter: blur(20px) saturate(160%);
    }
    & .mobile-bottom-nav :is(a, button) { color: #9aa1b2; }
    & .mobile-bottom-nav a.active { color: var(--ink); }
    & .mobile-bottom-nav a.active .mobile-nav-icon { color: var(--accent-dark); }
    & .mobile-bottom-nav .mobile-nav-create .mobile-nav-icon {
      color: #fff; background: linear-gradient(135deg, #3cc79a, #4aa6e0); box-shadow: 0 8px 18px -8px #3cc79ab3;
    }
    & .mobile-menu-sheet { color: var(--ink); background: #f3f5f9eb; backdrop-filter: blur(24px) saturate(150%); -webkit-backdrop-filter: blur(24px) saturate(150%); }
    & .mobile-menu-sheet-head { border-bottom-color: #e3e8f0; }
    & .mobile-menu-sheet-head button { color: #6b7386; }
    & .mobile-menu-brand-type { filter: none; opacity: .85; }
    & .mobile-menu-sheet nav a { color: #6b7386; }
    & .mobile-menu-sheet nav a.active { color: var(--ink); }
    & .mobile-menu-sheet nav a.active .mobile-menu-icon { color: var(--accent-dark); }
    & .mobile-menu-sheet .appearance-label { color: var(--muted); }
    & .mobile-menu-sheet .appearance-options { background: #e6ebf2; }
    & .mobile-menu-create { color: #fff; border-color: transparent; background: linear-gradient(135deg, #3cc79a, #4aa6e0); box-shadow: 0 12px 24px -12px #3cc79ab3; }
  }

  html[data-ui-theme="lumen"] .app:not(:has(.print-page)) > .main:has(.login-wrap) { padding-top: 30px; }

  @media (min-width: 769px) {
    html[data-ui-theme="lumen"] .app:not(:has(.print-page)) {
      & .document-table-scroll {
        display: block; max-width: 100%; overflow-x: auto;
        border-radius: 18px; background: var(--lu-glass); border: 1px solid #fff; box-shadow: var(--lu-shadow);
      }
      & .document-table-scroll table.documents-list { min-width: 1240px; }
      & .dashboard-section-card > .desktop-only { overflow-x: auto; }
      & .dashboard-doc-table th:nth-child(4) { min-width: 190px; }
      /* 件名・取引先以外(番号・種別・日付・金額・状態)は折り返さない */
      & .dashboard-doc-table :is(th, td):not(:nth-child(3)):not(:nth-child(4)) { white-space: nowrap; }
    }
  }

  /* 広い画面: ダッシュボードを「左=動いている案件 / 右=今期のリズム」の2カラムに */
  @media (min-width: 1180px) {
    html[data-ui-theme="lumen"] .app:not(:has(.print-page)) .dashboard-page {
      display: grid; grid-template-columns: minmax(0, 1fr) clamp(280px, 24vw, 340px); column-gap: 14px; align-items: start;
      & > :is(.dashboard-title-row, .kpi-row, .dash-half-row) { grid-column: 1 / -1; }
      & > .dashboard-title-row { grid-row: 1; }
      & > .kpi-row { grid-row: 2; }
      & > .dash-card-work { grid-column: 1; grid-row: 3; }
      & > .dash-card-waiting { grid-column: 1; grid-row: 4; }
      & > .lumen-pulse { grid-column: 2; grid-row: 3 / span 2; }
      & > .dash-half-row { grid-row: 5; }
    }
  }

  @media (min-width: 769px) and (max-height: 760px) {
    html[data-ui-theme="lumen"] .app:not(:has(.print-page)) .sidebar {
      & nav { gap: 2px; }
      & :is(nav a, .rail-tool) { width: 42px; height: 40px; }
      & .sidebar-brand { padding-bottom: 10px; }
    }
  }

  @media (max-width: 768px) {
    html[data-ui-theme="lumen"]:not(:has(.print-page)),
    html[data-ui-theme="lumen"] body:not(:has(.print-page)) { background-attachment: scroll; }
    html[data-ui-theme="lumen"] .app:not(:has(.print-page)) {
      & > .main { padding: 18px 12px calc(118px + env(safe-area-inset-bottom)); }
      & .sidebar { display: none; }
      & .card { padding: 16px 14px; border-radius: 18px; }
      & .dashboard-today { display: none; }
      & .kpi-row { gap: 8px; }
      & .kpi-row .kpi { padding: 14px 14px 12px; }
      & .kpi-row .kpi-value .kpi-num { font-size: clamp(20px, 13cqw, 30px); }
      & .kpi-row .kpi-unit { font-size: 14px; }
      & .kpi-row .kpi-label { font-size: 11px; }
      & .kpi-row .kpi-sub { font-size: 11px; }
      & :is(input, select, textarea) { font-size: 16px; }
      & .theme-section-icon { flex-basis: 24px; width: 24px; height: 24px; border-radius: 8px; }
      & .theme-section-icon svg { width: 14px; height: 14px; }
      & .analytics-summary { padding: 0; }
      & .analytics-summary-item { padding: 14px 12px; }
      & .lumen-rings-layout { grid-template-columns: 1fr; justify-items: center; }
      & .lumen-rings { max-width: 220px; }
      & .lumen-ring-legend { width: 100%; }
      & .lumen-tip { min-width: 150px; font-size: 11.5px; }
    }
  }

  @media (prefers-reduced-motion: reduce) {
    html[data-ui-theme="lumen"] * { animation: none !important; transition: none !important; }
  }
}

@media print {
  .appearance-switch, .appearance-settings, .brand-lockup,
  .theme-section-icon, .dashboard-today, .command-palette-backdrop { display: none !important; }
}
