/* Holdings page styles */
/* Uses unified design system variables from variables.css */

body {
  background:
    radial-gradient(circle at top left, rgba(59, 130, 246, 0.12), transparent 24%),
    radial-gradient(circle at top right, rgba(14, 165, 233, 0.1), transparent 18%),
    var(--bg);
}

:root[data-theme="dark"] body {
  background:
    radial-gradient(circle at top left, rgba(56, 189, 248, 0.18), transparent 24%),
    radial-gradient(circle at top right, rgba(45, 212, 191, 0.14), transparent 18%),
    var(--bg);
}
    .action-bar {
      position: sticky;
      top: 72px;
      z-index: 1;
      background: var(--ios-surface-muted);
      border-bottom: 1px solid var(--ios-border);
      backdrop-filter: blur(14px);
    }
    .action-bar-inner {
      max-width: 100%;
      margin: 0 auto;
      padding: 10px 20px;
      display: flex;
      align-items: center;
      gap: 10px;
    }
    .action-bar-left {
      display: flex;
      align-items: center;
      gap: 10px;
      flex-wrap: wrap;
    }
    .action-bar button,
    .action-bar select {
      height: 36px;
      border: 1px solid var(--border);
      border-radius: 8px;
      padding: 0 14px;
      background: var(--surface-1);
      color: var(--text);
      cursor: pointer;
      font-weight: 600;
      font-size: 13px;
      transition: background 0.18s ease, border-color 0.18s ease;
    }
    .action-bar button:hover {
      background: var(--surface-hover);
      border-color: var(--accent);
    }
    .action-bar button.primary {
      background: var(--accent);
      color: var(--text-inverse);
      border-color: var(--accent);
    }
    .action-bar button.primary:hover {
      background: var(--accent);
    }
    .action-bar select {
      height: 36px;
      padding: 0 10px;
      font-size: 13px;
    }
    .toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-left: auto; }
    .history-panel {
      background: var(--panel);
      border: 1px solid var(--border);
      border-radius: 18px;
      padding: 16px;
      margin-bottom: 16px;
      box-shadow: var(--shadow);
      backdrop-filter: blur(18px);
    }
    .history-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      margin-bottom: 10px;
    }
    .history-title {
      margin: 0;
      font-size: 16px;
    }
    .history-meta {
      color: var(--muted);
      font-size: 13px;
    }
    .history-range {
      display: flex;
      gap: 4px;
      margin-top: 8px;
    }
    .history-range button {
      padding: 4px 12px;
      border: 1px solid var(--border);
      border-radius: 6px;
      background: transparent;
      color: var(--muted);
      font-size: 12px;
      cursor: pointer;
      transition: all 0.15s;
    }
    .history-range button:hover {
      background: var(--bg-surface);
      color: var(--text);
    }
    .history-range button.active {
      background: var(--accent);
      color: white;
      border-color: var(--accent);
    }
    .performance-summary {
      display: grid;
      grid-template-columns: repeat(4, minmax(0, 1fr));
      gap: 10px;
      margin: 14px 0;
    }
    .performance-metric {
      min-width: 0;
      padding: 13px 14px;
      border: 1px solid var(--border);
      border-radius: 10px;
      background: var(--bg-surface);
    }
    .performance-metric span,
    .performance-metric small {
      display: block;
      color: var(--muted);
      font-size: 12px;
    }
    .performance-metric strong {
      display: block;
      margin: 5px 0 4px;
      overflow: hidden;
      color: var(--text);
      font-size: 20px;
      line-height: 1.2;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
    .performance-metric.up strong { color: var(--up); }
    .performance-metric.down strong { color: var(--down); }
    .profit-breakdown {
      display: grid;
      grid-template-columns: repeat(4, minmax(0, 1fr));
      gap: 10px;
      margin: 0 0 14px;
      padding: 12px 14px;
      border: 1px solid var(--border);
      border-radius: 10px;
      background: var(--panel);
    }
    .profit-breakdown[hidden] { display: none; }
    .profit-breakdown-item span,
    .profit-breakdown-note {
      display: block;
      color: var(--muted);
      font-size: 12px;
    }
    .profit-breakdown-item strong {
      display: block;
      margin-top: 4px;
      font-size: 15px;
    }
    .profit-breakdown-note {
      grid-column: 1 / -1;
      padding-top: 8px;
      border-top: 1px solid var(--border);
    }
    .dimension-performance {
      margin-top: 14px;
      padding: 14px;
      border: 1px solid var(--border);
      border-radius: 12px;
      background: var(--panel);
    }
    .dimension-performance-head,
    .dimension-controls,
    .dimension-tabs {
      display: flex;
      align-items: center;
      gap: 10px;
    }
    .dimension-performance-head {
      justify-content: space-between;
      margin-bottom: 10px;
    }
    .dimension-performance h3 { margin: 2px 0 0; font-size: 15px; }
    .dimension-kicker { color: var(--muted); font-size: 10px; letter-spacing: .12em; }
    .dimension-tabs {
      gap: 3px;
      padding: 3px;
      border-radius: 8px;
      background: var(--bg-surface);
    }
    .dimension-tabs button {
      padding: 5px 10px;
      border: 0;
      border-radius: 6px;
      background: transparent;
      color: var(--muted);
      cursor: pointer;
    }
    .dimension-tabs button.active { background: var(--accent); color: #fff; }
    .dimension-controls label { color: var(--muted); font-size: 12px; }
    .dimension-controls select { margin-left: 4px; min-width: 96px; }
    .dimension-reconciliation {
      min-height: 18px;
      margin-bottom: 6px;
      color: var(--muted);
      font-size: 12px;
    }
    .dimension-reconciliation.partial { color: var(--danger); }
    .dimension-table-wrap { overflow-x: auto; }
    .dimension-table { width: 100%; border-collapse: collapse; font-size: 13px; }
    .dimension-table th,
    .dimension-table td { padding: 9px 8px; border-bottom: 1px solid var(--border); text-align: right; }
    .dimension-table th:first-child,
    .dimension-table td:first-child { min-width: 150px; text-align: left; }
    .dimension-table th { color: var(--muted); font-size: 11px; font-weight: 600; }
    .dimension-name { display: grid; gap: 2px; }
    .dimension-name small { color: var(--muted); font-size: 11px; }
    .dimension-value.up { color: var(--up); }
    .dimension-value.down { color: var(--down); }
    .history-chart-wrap {
      position: relative;
      width: 100%;
      height: 300px;
    }
    .history-chart {
      width: 100% !important;
      height: 100% !important;
    }
    .history-analysis {
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 12px;
      margin-top: 12px;
    }
    .history-card {
      border: 1px solid var(--border);
      border-radius: 8px;
      padding: 12px;
      background: var(--panel);
      min-height: 132px;
    }
    .history-card h3 {
      margin: 0 0 10px;
      font-size: 14px;
    }
    .analysis-list {
      display: grid;
      gap: 9px;
      font-size: 13px;
    }
    .analysis-row {
      display: grid;
      grid-template-columns: minmax(0, 1fr) auto;
      gap: 8px;
      align-items: center;
    }
    .analysis-row span {
      color: var(--muted);
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
    .analysis-row strong {
      font-variant-numeric: tabular-nums;
    }
    .analysis-bar {
      grid-column: 1 / -1;
      height: 6px;
      border-radius: 999px;
      background: var(--border);
      overflow: hidden;
    }
    .analysis-bar i {
      display: block;
      height: 100%;
      border-radius: inherit;
      background: var(--accent);
    }
    .trend-list {
      display: grid;
      gap: 8px;
      font-size: 13px;
    }
    .trend-item {
      display: grid;
      gap: 3px;
    }
    .trend-item span {
      display: flex;
      justify-content: space-between;
      gap: 8px;
      color: var(--muted);
    }
    .decision-panel {
      background: var(--panel);
      border: 1px solid var(--border);
      border-radius: 18px;
      padding: 16px;
      margin-bottom: 16px;
      box-shadow: var(--shadow);
      backdrop-filter: blur(18px);
    }
    .decision-header {
      display: flex;
      justify-content: space-between;
      align-items: flex-start;
      gap: 12px;
      margin-bottom: 12px;
    }
    .decision-title { margin: 0; font-size: 16px; }
    .decision-grid {
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 12px;
    }
    .decision-card {
      border: 1px solid var(--border);
      border-radius: 16px;
      padding: 14px;
      background: var(--surface-1);
      min-height: 128px;
    }
    .decision-card h3 {
      margin: 0 0 8px;
      font-size: 14px;
    }
    .decision-list {
      display: grid;
      gap: 8px;
      font-size: 13px;
    }
    .decision-item {
      border-top: 1px solid var(--border);
      padding-top: 8px;
      line-height: 1.45;
    }
    .decision-item:first-child { border-top: 0; padding-top: 0; }
    .decision-item strong { display: block; }
    .decision-item span { color: var(--muted); }
    .severity-high strong { color: var(--danger); }
    .severity-medium strong { color: var(--warning); }
    .target-editor,
    .expense-editor,
    .budget-editor {
      margin-top: 12px;
      display: grid;
      gap: 8px;
    }
    .target-row {
      display: grid;
      grid-template-columns: 1.1fr 110px 1fr repeat(4, 86px) 70px;
      gap: 8px;
      align-items: center;
    }
    .expense-row {
      display: grid;
      grid-template-columns: 1.2fr 110px 130px 110px 1fr 70px;
      gap: 8px;
      align-items: center;
    }
    .budget-editor {
      grid-template-columns: repeat(5, minmax(120px, 1fr));
    }
    .budget-editor label {
      display: grid;
      gap: 4px;
      color: var(--muted);
      font-size: 12px;
    }
    .history-point-label {
      font-size: 9px;
      font-weight: 500;
      text-anchor: middle;
      fill: var(--muted);
    }
    .import-panel {
      background: var(--panel);
      border: 1px solid var(--border);
      border-radius: 8px;
      padding: 14px;
      margin-bottom: 14px;
      box-shadow: var(--shadow);
    }
    .import-header {
      display: flex;
      align-items: flex-start;
      justify-content: space-between;
      gap: 12px;
      margin-bottom: 12px;
    }
    .import-title {
      margin: 0;
      font-size: 16px;
    }
    .import-meta {
      color: var(--muted);
      font-size: 13px;
      line-height: 1.5;
    }
    .import-actions {
      display: grid;
      grid-template-columns: 160px 180px 1.2fr auto auto;
      gap: 10px;
      align-items: center;
      margin-bottom: 10px;
    }
    .data-date-label {
      display: flex;
      align-items: center;
      gap: 6px;
      font-size: 13px;
      color: var(--muted);
      cursor: pointer;
    }
    .data-date-label span {
      white-space: nowrap;
      font-weight: 600;
      color: var(--text);
    }
    .data-date-label input[type="date"] {
      width: 100%;
      min-width: 0;
      color-scheme: light dark;
      -webkit-appearance: auto;
    }
    .data-date-label input[type="date"]::-webkit-calendar-picker-indicator {
      cursor: pointer;
      opacity: 0.8;
    }
    .data-date-label input[type="date"]::-webkit-calendar-picker-indicator:hover {
      opacity: 1;
    }
    .import-toolbar {
      display: flex;
      gap: 10px;
      flex-wrap: wrap;
      margin-bottom: 10px;
    }
    .import-preview {
      display: grid;
      grid-template-columns: repeat(4, minmax(150px, 1fr));
      gap: 10px;
      margin-bottom: 10px;
    }
    .import-preview-card {
      border: 1px solid var(--border);
      border-radius: 12px;
      padding: 12px;
      background: var(--surface-1);
    }
    .import-preview-card span {
      display: block;
      color: var(--muted);
      font-size: 12px;
      margin-bottom: 6px;
    }
    .import-preview-card strong {
      display: block;
      font-size: 20px;
      letter-spacing: -0.02em;
    }
    .import-preview-card small {
      color: var(--muted);
      font-size: 12px;
    }
    .import-preview-card strong.up { color: var(--danger); font-weight: 700; }
    .import-preview-card strong.down { color: var(--ok); font-weight: 700; }
    .attribution-summary {
      display: grid;
      grid-template-columns: repeat(4, minmax(150px, 1fr));
      gap: 10px;
      margin-bottom: 10px;
    }
    .attribution-summary[hidden] {
      display: none;
    }
    .attribution-summary-card {
      border: 1px solid var(--border);
      border-radius: 8px;
      padding: 12px;
      background: var(--surface-2);
    }
    .attribution-summary-card span {
      display: block;
      color: var(--muted);
      font-size: 12px;
      margin-bottom: 6px;
    }
    .attribution-summary-card strong {
      display: block;
      font-size: 18px;
    }
    .attribution-summary-card.warn {
      border-color: rgba(245, 158, 11, 0.45);
      background: rgba(245, 158, 11, 0.08);
    }
    .attribution-summary-card.error {
      border-color: rgba(220, 38, 38, 0.45);
      background: rgba(220, 38, 38, 0.08);
    }
    .attribution-summary-note {
      grid-column: 1 / -1;
      color: var(--muted);
      font-size: 13px;
      line-height: 1.5;
    }
    .attribution-summary-note.warn {
      color: var(--warning);
    }
    .attribution-summary-note.error {
      color: var(--danger);
      font-weight: 700;
    }
    .import-image-results {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
      gap: 10px;
      margin: 10px 0;
    }
    .import-image-result {
      display: grid;
      grid-template-columns: minmax(0, 1fr) auto;
      gap: 8px 12px;
      align-items: center;
      padding: 12px;
      border: 1px solid var(--border);
      border-radius: 8px;
      background: var(--surface-1);
    }
    .import-image-result.success { border-color: rgba(22, 163, 74, 0.35); }
    .import-image-result.failed { border-color: rgba(220, 38, 38, 0.35); }
    .import-image-result strong,
    .import-image-result small { display: block; }
    .import-image-result strong {
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
    .import-image-result small,
    .import-image-result-detail {
      color: var(--muted);
      font-size: 12px;
    }
    .import-image-result-detail { grid-column: 1 / -1; }
    .import-image-result-detail strong {
      display: inline;
      color: var(--text);
    }
    .import-image-result-detail small {
      margin-top: 4px;
    }
    .import-route-link,
    .import-route-note {
      grid-column: 1 / -1;
      justify-self: start;
      font-size: 12px;
    }
    .import-route-link {
      color: var(--accent);
      font-weight: 700;
    }
    .import-route-note {
      color: var(--muted);
    }
    .import-image-result button {
      grid-column: 1 / -1;
      justify-self: start;
    }
    .import-text {
      width: 100%;
      min-height: 88px;
      resize: vertical;
      border: 1px solid var(--border);
      border-radius: 6px;
      padding: 10px;
      font: inherit;
      color: var(--text);
      background: var(--surface-1);
      margin-bottom: 10px;
    }
    .import-table-wrap {
      overflow-x: auto;
      border: 1px solid var(--border);
      border-radius: 8px;
    }
    .import-table {
      min-width: 1600px;
      table-layout: fixed;
    }
    .import-table th:nth-child(1), .import-table td:nth-child(1) { width: 44px; text-align: center; }
    .import-table th:nth-child(2), .import-table td:nth-child(2) { width: 220px; }
    .import-table th:nth-child(3), .import-table td:nth-child(3) { width: 280px; }
    .import-table th:nth-child(4), .import-table td:nth-child(4),
    .import-table th:nth-child(5), .import-table td:nth-child(5),
    .import-table th:nth-child(6), .import-table td:nth-child(6) { width: 100px; }
    .import-table th:nth-child(7), .import-table td:nth-child(7),
    .import-table th:nth-child(8), .import-table td:nth-child(8),
    .import-table th:nth-child(9), .import-table td:nth-child(9) { width: 110px; }
    .import-table th:nth-child(10), .import-table td:nth-child(10) { width: 160px; }
    .import-table th:nth-child(11), .import-table td:nth-child(11) { width: 76px; }
    .import-table th:nth-child(12), .import-table td:nth-child(12) { width: 140px; }
    .import-table th,
    .import-table td {
      padding: 8px;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
    .import-table input,
    .import-table select {
      width: 100%;
      box-sizing: border-box;
    }
    .import-row-actions {
      display: flex;
      gap: 8px;
      flex-wrap: wrap;
    }
    .import-status-tag {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      min-width: 68px;
      padding: 4px 8px;
      border-radius: 999px;
      background: rgba(148, 163, 184, 0.14);
      color: var(--muted);
      font-size: 12px;
      font-weight: 700;
    }
    .import-status-tag.matched {
      background: rgba(22, 163, 74, 0.12);
      color: var(--ok);
    }
    .import-status-tag.need-match {
      background: rgba(220, 38, 38, 0.1);
      color: var(--danger);
    }
    .import-status-tag.needs-confirmation {
      background: rgba(202, 138, 4, 0.12);
      color: var(--warning);
    }
    .import-empty {
      color: var(--muted);
      font-size: 13px;
      padding: 12px;
    }
    .import-report {
      margin-top: 12px;
      border: 1px solid var(--border);
      border-radius: 8px;
      overflow: hidden;
    }
    .import-report-header {
      background: rgba(22, 163, 74, 0.1);
      color: var(--ok);
      padding: 10px 12px;
      font-size: 14px;
      font-weight: 700;
      display: flex;
      align-items: center;
      gap: 8px;
    }
    .import-report-body {
      padding: 12px;
    }
    .import-report-overview {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
      gap: 10px;
      margin-bottom: 12px;
    }
    .import-report-card {
      background: var(--panel);
      border: 1px solid var(--border);
      border-radius: 6px;
      padding: 10px;
      text-align: center;
    }
    .import-report-card .label {
      font-size: 11px;
      color: var(--muted);
      margin-bottom: 4px;
    }
    .import-report-card .value {
      font-size: 16px;
      font-weight: 700;
    }
    .import-report-card .sub {
      font-size: 11px;
      color: var(--muted);
    }
    .import-report-account-table {
      width: 100%;
      border-collapse: collapse;
      font-size: 13px;
    }
    .import-report-account-table th {
      text-align: left;
      color: var(--muted);
      font-size: 11px;
      font-weight: 700;
      padding: 6px 8px;
      border-bottom: 1px solid var(--border);
    }
    .import-report-account-table td {
      padding: 6px 8px;
      border-bottom: 1px solid var(--border);
    }
    .import-report-account-table tr:last-child td { border-bottom: 0; }
    .import-report-items-table {
      width: 100%;
      border-collapse: collapse;
      font-size: 13px;
      margin-top: 10px;
    }
    .import-report-items-table th {
      text-align: left;
      color: var(--muted);
      font-size: 11px;
      font-weight: 700;
      padding: 6px 8px;
      border-bottom: 1px solid var(--border);
    }
    .import-report-items-table td {
      padding: 6px 8px;
      border-bottom: 1px solid var(--border);
    }
    .import-report-items-table tr:last-child td { border-bottom: 0; }
    .correction-panel {
      margin-top: 12px;
      border: 1px solid var(--border);
      border-radius: 8px;
      overflow: hidden;
    }
    .correction-row,
    .correction-header {
      display: grid;
      grid-template-columns: 1.4fr 120px 140px 120px;
      gap: 10px;
      padding: 9px 10px;
      align-items: center;
      border-bottom: 1px solid var(--border);
      font-size: 13px;
    }
    .correction-header {
      background: var(--panel);
      color: var(--muted);
      font-size: 12px;
      font-weight: 700;
    }
    .correction-row:last-child { border-bottom: 0; }
    .import-history {
      margin-top: 12px;
      border: 1px solid var(--border);
      border-radius: 8px;
      overflow: hidden;
    }
    .import-history-header,
    .import-history-row {
      display: grid;
      grid-template-columns: 160px 90px 90px 90px 110px 1fr 80px;
      gap: 10px;
      padding: 9px 10px;
      align-items: center;
      font-size: 13px;
      border-bottom: 1px solid var(--border);
    }
    .import-history-header {
      background: var(--panel);
      color: var(--muted);
      font-size: 12px;
      font-weight: 700;
    }
    .import-history-row:last-child { border-bottom: 0; }
    .settings-panel {
      background: var(--panel);
      border: 1px solid var(--border);
      border-radius: 8px;
      padding: 14px;
      margin-bottom: 14px;
      box-shadow: var(--shadow);
    }
    .settings-header {
      display: flex;
      align-items: flex-start;
      justify-content: space-between;
      gap: 12px;
      margin-bottom: 12px;
    }
    .settings-title {
      margin: 0;
      font-size: 16px;
    }
    .settings-meta {
      color: var(--muted);
      font-size: 13px;
      line-height: 1.5;
    }
    .time-list {
      display: grid;
      gap: 8px;
      margin-bottom: 10px;
      max-width: 520px;
    }
    .time-row {
      display: grid;
      grid-template-columns: 1fr auto;
      gap: 8px;
      align-items: center;
    }
    .plan-panel {
      background: var(--panel);
      border: 1px solid var(--border);
      border-radius: 8px;
      padding: 14px;
      margin-bottom: 14px;
      box-shadow: var(--shadow);
    }
    .plan-header {
      display: flex;
      justify-content: space-between;
      gap: 12px;
      align-items: flex-start;
      margin-bottom: 12px;
    }
    .plan-title {
      margin: 0;
      font-size: 16px;
    }
    .plan-meta {
      color: var(--muted);
      font-size: 13px;
      white-space: nowrap;
    }
    .phase-grid {
      display: grid;
      grid-template-columns: repeat(5, minmax(140px, 1fr));
      gap: 10px;
      margin-bottom: 12px;
    }
    .phase {
      border: 1px solid var(--border);
      border-radius: 8px;
      padding: 10px;
      min-height: 112px;
    }
    .phase strong {
      display: block;
      font-size: 14px;
      margin-bottom: 4px;
    }
    .phase span {
      display: block;
      color: var(--muted);
      font-size: 12px;
      line-height: 1.45;
      min-height: 34px;
    }
    .progress {
      height: 8px;
      border-radius: 999px;
      background: var(--border);
      overflow: hidden;
      margin: 10px 0 6px;
    }
    .progress i {
      display: block;
      height: 100%;
      background: var(--accent);
    }
    .phase small {
      color: var(--muted);
      font-size: 12px;
    }
    .plan-list {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: 10px;
    }
    .plan-column {
      border-top: 1px solid var(--border);
      padding-top: 10px;
    }
    .plan-column h3 {
      margin: 0 0 8px;
      font-size: 13px;
    }
    .plan-column ul {
      margin: 0;
      padding-left: 18px;
      color: var(--text);
      font-size: 13px;
      line-height: 1.6;
    }
    .deploy-status {
      margin-top: 10px;
      color: var(--muted);
      font-size: 13px;
      line-height: 1.5;
    }
    .deploy-status strong {
      color: var(--text);
    }
    .deploy-log {
      margin-top: 10px;
      background: #16191d;
      color: #e6e1d6;
      border-radius: 8px;
      padding: 10px;
      max-height: 180px;
      overflow: auto;
      white-space: pre-wrap;
      line-height: 1.45;
      font-size: 12px;
    }
    .snapshot-panel {
      background: var(--panel);
      border: 1px solid var(--border);
      border-radius: 8px;
      padding: 14px;
      margin-bottom: 14px;
      box-shadow: var(--shadow);
    }
    .snapshot-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      margin-bottom: 10px;
    }
    .snapshot-title {
      margin: 0;
      font-size: 16px;
    }
    .snapshot-meta {
      color: var(--muted);
      font-size: 13px;
    }
    .snapshot-grid {
      display: grid;
      grid-template-columns: repeat(5, minmax(150px, 1fr));
      gap: 10px;
    }
    .snapshot-item {
      border: 1px solid var(--border);
      border-radius: 8px;
      padding: 10px;
      min-height: 96px;
    }
    .snapshot-item strong {
      display: block;
      font-size: 14px;
      margin-bottom: 6px;
    }
    .snapshot-item span {
      display: block;
      color: var(--muted);
      font-size: 12px;
      line-height: 1.5;
    }
    .audit-panel,
    .transaction-panel {
      background: var(--panel);
      border: 1px solid var(--border);
      border-radius: 8px;
      overflow: hidden;
      margin-bottom: 14px;
      box-shadow: var(--shadow);
    }
    .audit-header,
    .transaction-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      padding: 12px;
      border-bottom: 1px solid var(--border);
    }
    .audit-title,
    .transaction-title {
      margin: 0;
      font-size: 16px;
    }
    .audit-meta,
    .transaction-meta {
      color: var(--muted);
      font-size: 13px;
    }
    .audit-list,
    .transaction-list {
      display: grid;
      gap: 0;
    }
    .audit-item {
      display: grid;
      grid-template-columns: 140px 1fr 100px 100px 100px;
      gap: 10px;
      padding: 10px 12px;
      border-bottom: 1px solid var(--border);
      align-items: center;
      font-size: 13px;
    }
    .transaction-item {
      display: grid;
      grid-template-columns: 110px 1fr 120px 120px 140px;
      gap: 10px;
      padding: 10px 12px;
      border-bottom: 1px solid var(--border);
      align-items: center;
      font-size: 13px;
    }
    .audit-item:last-child,
    .transaction-item:last-child { border-bottom: 0; }
    .audit-item span,
    .transaction-item span { color: var(--muted); }
    .audit-item {
      cursor: pointer;
    }
    .audit-item:hover {
      background: rgba(255,255,255,0.06);
    }
    .audit-detail {
      border-bottom: 1px solid var(--border);
      padding: 12px;
      background: var(--panel);
      display: grid;
      gap: 10px;
    }
    .audit-detail-header {
      display: flex;
      justify-content: space-between;
      gap: 12px;
      align-items: flex-start;
      color: var(--muted);
      font-size: 13px;
    }
    .audit-detail-grid {
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 10px;
    }
    .audit-detail-block {
      border: 1px solid var(--border);
      border-radius: 8px;
      padding: 10px;
      background: var(--panel);
      min-height: 92px;
    }
    .audit-detail-block strong {
      display: block;
      margin-bottom: 8px;
      font-size: 13px;
    }
    .audit-change {
      padding: 8px 0;
      border-top: 1px solid var(--border);
      font-size: 13px;
    }
    .audit-change:first-of-type { border-top: 0; padding-top: 0; }
    .audit-change span {
      color: var(--muted);
      display: block;
      margin-top: 3px;
      word-break: break-word;
    }
    td input, td select { width: 100%; box-sizing: border-box; }
    /* ── Rebalance table (7 cols) ── */
    .rebalance-table { min-width: 760px; }
    .rebalance-table th:nth-child(1), .rebalance-table td:nth-child(1) { width: 100px; }
    .rebalance-table th:nth-child(2), .rebalance-table td:nth-child(2) { width: 100px; text-align: right; }
    .rebalance-table th:nth-child(3), .rebalance-table td:nth-child(3) { width: 100px; text-align: right; }
    .rebalance-table th:nth-child(4), .rebalance-table td:nth-child(4) { width: 80px; text-align: right; }
    .rebalance-table th:nth-child(5), .rebalance-table td:nth-child(5) { width: 80px; }
    .rebalance-table th:nth-child(6), .rebalance-table td:nth-child(6) { width: 120px; text-align: right; }
    .rebalance-table th:nth-child(7), .rebalance-table td:nth-child(7) { width: auto; }
    /* ── Market state table (8 cols) ── */
    .market-table { min-width: 700px; }
    .market-table th:nth-child(1), .market-table td:nth-child(1) { width: 100px; }
    .market-table th:nth-child(2), .market-table td:nth-child(2) { width: 80px; }
    .market-table th:nth-child(3), .market-table td:nth-child(3) { width: 60px; }
    .market-table th:nth-child(4), .market-table td:nth-child(4) { width: 80px; }
    .market-table th:nth-child(5), .market-table td:nth-child(5) { width: 80px; }
    .market-table th:nth-child(6), .market-table td:nth-child(6) { width: 80px; }
    .market-table th:nth-child(7), .market-table td:nth-child(7) { width: 80px; }
    .market-table th:nth-child(8), .market-table td:nth-child(8) { width: 80px; }
    /* ── Asset library table (6 cols) ── */
    .assets-table { min-width: 640px; }
    .assets-table th:nth-child(1), .assets-table td:nth-child(1) { width: 100px; }
    .assets-table th:nth-child(2), .assets-table td:nth-child(2) { width: auto; }
    .assets-table th:nth-child(3), .assets-table td:nth-child(3) { width: 80px; }
    .assets-table th:nth-child(4), .assets-table td:nth-child(4) { width: 100px; text-align: right; }
    .assets-table th:nth-child(5), .assets-table td:nth-child(5) { width: 80px; text-align: right; }
    .assets-table th:nth-child(6), .assets-table td:nth-child(6) { width: 100px; text-align: center; }
    /* ── Daily update tables ── */
    .daily-table { min-width: 480px; }
    .daily-table th, .daily-table td { white-space: nowrap; }
    /* ── Positions tables (4 cols) ── */
    .positions-table th:nth-child(1), .positions-table td:nth-child(1) { width: 100px; }
    .positions-table th:nth-child(4), .positions-table td:nth-child(4) { width: 100px; }
    @media (max-width: 768px) {
      .history-header { flex-direction: column; align-items: flex-start; }
      .performance-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
      .profit-breakdown { grid-template-columns: repeat(2, minmax(0, 1fr)); }
      .dimension-performance-head { align-items: flex-start; flex-direction: column; }
      .dimension-controls { width: 100%; justify-content: space-between; }
      .import-header { flex-direction: column; }
      .import-actions { grid-template-columns: 1fr; }
      .import-preview { grid-template-columns: 1fr 1fr; }
      .attribution-summary { grid-template-columns: 1fr 1fr; }
      .history-analysis { grid-template-columns: 1fr; }
      .decision-grid,
      .budget-editor { grid-template-columns: 1fr; }
      .target-row,
      .expense-row { grid-template-columns: 1fr; }
      .import-history-header,
      .import-history-row { grid-template-columns: 1fr; }
      .correction-header,
      .correction-row { grid-template-columns: 1fr; }
      .settings-header { flex-direction: column; }
      .phase-grid { grid-template-columns: repeat(2, 1fr); }
      .snapshot-grid { grid-template-columns: repeat(2, 1fr); }
      .audit-item,
      .transaction-item { grid-template-columns: 1fr; }
      .audit-detail-grid { grid-template-columns: 1fr; }
      .plan-list { grid-template-columns: 1fr; }
      .plan-header { flex-direction: column; }
      .plan-meta { white-space: normal; }
      .panel { overflow-x: auto; }
      table { min-width: 1080px; }
    }

    @media (max-width: 480px) {
      .action-bar-left {
        gap: 6px;
      }
      .action-bar button,
      .action-bar select {
        min-height: 44px;
        flex: 1 1 calc(50% - 3px);
        font-size: 13px;
      }
      .action-bar select {
        flex-basis: 100%;
      }
    }
  /* import-table column widths handled by table-layout: fixed */
