:root {
  --ink: #17231d;
  --muted: #5e6d65;
  --paper: #f4f6f5;
  --card: #fff;
  --line: #e0e6e2;
  --green: #1d6b4b;
  --green-dark: #124a34;
  --green-soft: #dcecdf;
  --amber: #8b530f;
  --amber-soft: #fff0d4;
  --red: #a43d3d;
  --shadow: 0 8px 28px rgba(31, 48, 39, 0.08);
  font-family: Inter, "Segoe UI", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
}

button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, summary:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 3px;
}

.ambient {
  display: none;
}
.ambient-one { background: #b9dcc1; top: -170px; right: -100px; }
.ambient-two { background: #f3d3a3; bottom: -240px; left: -160px; }

.shell { display: flex; flex-direction: column; width: min(1200px, calc(100% - 48px)); margin: 0 auto; padding: 32px 0 64px; }
.hero { order: 0; }
#statusPanel { order: 1; }
#accountWarning, #configurationWarning { order: 2; }
#nativePayoutPanel { order: 3; margin-top: 14px; }
#nativeUncertain { order: 2; text-align: left; cursor: pointer; }
#nativeUncertain[hidden] { display: none; }
.content-grid { order: 3; }
.advanced-tools { order: 4; }
.hero { display: flex; justify-content: space-between; align-items: center; gap: 24px; margin-bottom: 16px; }
.eyebrow, .section-kicker { margin: 0 0 9px; color: var(--green); letter-spacing: .14em; font-size: 12px; font-weight: 800; }
h1 { margin: 0; font-size: clamp(26px, 3vw, 32px); letter-spacing: -.025em; line-height: 1.3; }
h2 { margin: 0; font-size: 20px; letter-spacing: -.015em; line-height: 1.4; }
h3 { margin: 0; font-size: 16px; }
.hero-copy { max-width: 650px; margin: 8px 0 0; color: var(--muted); font-size: 14px; line-height: 1.6; }
.hero-actions, .status-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.button {
  appearance: none;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 10px 16px;
  min-height: 40px;
  font-weight: 650;
  cursor: pointer;
  text-decoration: none;
  transition: background .15s ease, border-color .15s ease;
}
.button:hover { border-color: #a9b9af; }
.button:disabled { cursor: wait; opacity: .6; }
.button.primary { color: white; background: var(--green); }
.button.primary:hover { background: var(--green-dark); }
.button.secondary { color: var(--ink); background: #fff; border-color: var(--line); }
.button.ghost { color: var(--muted); background: transparent; border-color: transparent; }
.button.ghost:hover { background: #eaf0ec; }
.button.danger { color: var(--red); border-color: #e8c7c7; background: #fff6f6; }
.button.small { min-height: 34px; padding: 7px 11px; border-radius: 7px; font-size: 13px; }
.button.large { padding: 13px 20px; }
.button.full { width: 100%; }
.subtle { box-shadow: none; }

.native-controls, .native-connect, .native-history-actions { display:flex; gap:12px; align-items:end; flex-wrap:wrap; }
.native-controls { margin:18px 0 12px; }
.native-controls label { display:grid; gap:7px; min-width:180px; }
.native-connect { margin-top:12px; }
.native-connect input { flex:1; min-width:220px; }
.native-key-settings summary, .native-history summary { cursor:pointer; font-weight:700; }
.native-key-settings { padding:14px; background:#f2f6f0; border-radius:12px; }
.native-key-settings > summary { display:flex; align-items:center; justify-content:space-between; gap:12px; list-style:none; }
.native-key-settings > summary::-webkit-details-marker { display:none; }
.native-key-heading { display:flex; align-items:center; gap:8px; }
.native-key-heading::before { content:'▸'; }
.native-key-settings[open] .native-key-heading::before { content:'▾'; }
.native-connection-status { display:inline-flex; flex:none; align-items:center; gap:6px; border-radius:99px; padding:4px 10px; font-size:12px; line-height:1.5; color:#59645f; background:#e5eae6; white-space:nowrap; }
.native-connection-status::before { content:''; width:7px; height:7px; border-radius:50%; background:currentColor; }
.native-connection-status[data-state="connected"] { color:#17613e; background:#dceee2; }
.native-connection-status[data-state="checking"], .native-connection-status[data-state="saved"] { color:#80591b; background:#fff0d3; }
.native-connection-status[data-state="offline"], .native-connection-status[data-state="unauthorized"], .native-connection-status[data-state="error"] { color:#a13930; background:#fbe6e2; }
#nativeConnectionDetail { margin:10px 0; font-size:12px; }
.native-table { width:100%; font-size:14px; }
.native-table th { text-align:left; }
.native-table td, .native-table th { padding:12px; border-bottom:1px solid var(--line); }
.native-table small { display:block; color:var(--muted); margin-top:5px; max-width:400px; }
.native-history { border-top:1px solid var(--line); margin-top:18px; padding-top:18px; }
.native-history-actions { margin:14px 0; }
.native-matrix-wrap { overflow-x:auto; border:1px solid var(--line); border-radius:12px; margin:14px 0; }
.native-matrix { width:100%; min-width:1110px; border-collapse:separate; border-spacing:0; font-size:13px; }
.native-matrix th, .native-matrix td { padding:12px 10px; border-right:1px solid var(--line); border-bottom:1px solid var(--line); text-align:center; vertical-align:top; width:10%; }
.native-matrix tr:last-child>* { border-bottom:0; }
.native-matrix tr>*:last-child { border-right:0; }
.native-matrix th { background:#f0f5ee; font-weight:750; }
.native-matrix tr>:first-child { position:sticky; left:0; z-index:1; min-width:112px; box-shadow:3px 0 6px #17231d0a; }
.native-matrix small { display:block; font-size:11px; color:var(--muted); margin-top:6px; font-weight:500; }
.native-matrix .muted { color:var(--muted); }
.native-matrix .waiting { background:#fff7e6; }
.native-matrix .arrived { background:#e8f5e9; }
.native-matrix .arrived small { color:var(--green); font-weight:700; }
.native-matrix .attention { background:#fff0eb; }
.native-matrix .attention small { color:var(--red); }
.native-cell strong { font-size:16px; font-variant-numeric:tabular-nums; }
.native-amount-choice { display:flex; flex-direction:row; gap:7px; align-items:center; justify-content:center; cursor:pointer; }
.native-amount-choice input, .native-selection-bar input { accent-color:var(--green); width:16px; height:16px; flex:0 0 16px; padding:0; }
.native-cell-note { display:block; font-size:11px; line-height:1.5; margin-top:7px; max-width:135px; overflow:hidden; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; }
.native-selection-bar { display:flex; align-items:center; flex-wrap:wrap; gap:14px; padding:10px 0; }
.native-selection-bar label { display:flex; flex-direction:row; align-items:center; gap:7px; white-space:nowrap; }
.native-receipt-export { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:10px; margin-top:14px; padding:12px; border-radius:10px; background:var(--green-soft); font-size:13px; color:var(--green-dark); }
.native-receipt-export[hidden] { display:none; }
#nativeSelectionSummary { flex:1; color:var(--muted); font-size:13px; }
.native-batch { margin:22px 0; }
.native-batch-heading { display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap; }
.native-batch-heading small { display:block; color:var(--muted); margin-top:7px; }
.native-record { border:0; background:transparent; color:inherit; cursor:pointer; width:100%; padding:0; font:inherit; }
.native-record:hover strong { text-decoration:underline; }
.native-record span { display:block; font-size:10px; color:var(--muted); margin-top:7px; }
.native-operation-list { display: grid; gap: 8px; margin-top: 12px; }
.native-operation-list .native-record { padding: 12px; text-align: left; border: 1px solid var(--line); border-radius: 10px; }
.native-operation-list small { display: block; margin-top: 5px; color: var(--muted); }
#nativeAttemptDetails { background:#f2f6f0; border-radius:12px; padding:18px; line-height:1.6; }
.arrival-matrix { table-layout: fixed; min-width: calc(104px + var(--arrival-columns, 9) * 118px); }
.arrival-columns-1 { --arrival-columns: 1; }
.arrival-columns-2 { --arrival-columns: 2; }
.arrival-columns-3 { --arrival-columns: 3; }
.arrival-columns-4 { --arrival-columns: 4; }
.arrival-columns-5 { --arrival-columns: 5; }
.arrival-columns-6 { --arrival-columns: 6; }
.arrival-columns-7 { --arrival-columns: 7; }
.arrival-columns-8 { --arrival-columns: 8; }
.arrival-columns-9 { --arrival-columns: 9; }
.arrival-matrix th, .arrival-matrix td { width: auto; overflow-wrap: anywhere; }
.arrival-matrix tr > :first-child { width: 104px; min-width: 104px; }
.arrival-matrix .evidence-details { font-size:11px; margin-top:8px; text-align:left; }
.arrival-matrix .evidence-details summary { line-height:1.5; }
.native-confirm { border:0; border-radius:18px; padding:24px; width:min(680px,calc(100% - 32px)); max-height:calc(100dvh - 32px); overflow-y:auto; color:var(--ink); box-sizing:border-box; }
.native-confirm::backdrop { background:rgba(18,32,24,.5); }
.native-confirm p { white-space:pre-line; line-height:1.6; margin:12px 0; }
.native-confirm form { display:flex; gap:12px; justify-content:flex-end; }
.native-confirm-items { max-height:42dvh; overflow:auto; border-block:1px solid var(--line); }
.native-confirm-item { display:grid; grid-template-columns:18px minmax(0,1fr) auto; align-items:center; gap:10px; padding:10px 2px; border-bottom:1px solid var(--line); font-size:14px; }
.native-confirm-item:last-child { border-bottom:0; }
.native-confirm-item input { width:16px; height:16px; padding:0; accent-color:var(--green); }
.native-confirm-item small { display:block; margin-top:3px; color:var(--muted); font-weight:400; }
.native-confirm-item strong { white-space:nowrap; font-variant-numeric:tabular-nums; }
.native-confirm .native-confirm-totals { font-weight:700; }
.native-confirm .native-confirm-hint { font-size:12px; color:var(--muted); }
.manual-entry-panel { order: 3; margin-top: 6px; min-width: 0; }
.manual-entry-panel > summary { width: fit-content; padding: 10px 2px; color: var(--muted); font-size: 13px; cursor: pointer; }
.manual-entry-form { padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: white; }
.manual-entry-form .workflow-intro { margin-top: 0; }
.manual-entry-form fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
.manual-entry-date { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font-size: 13px; }
.manual-entry-date input { width: auto; }
.manual-entry-matrix { table-layout: fixed; min-width: 1030px; }
.manual-entry-matrix th { padding: 9px 6px; vertical-align: middle; }
.manual-entry-matrix td { padding: 3px; vertical-align: middle; }
.manual-entry-matrix input { width: 100%; min-width: 0; height: 40px; padding: 6px; border: 1px solid transparent; border-radius: 4px; text-align: right; font-size: 13px; font-variant-numeric: tabular-nums; background: transparent; }
.manual-entry-matrix input:hover { border-color: var(--line); }
.manual-entry-matrix input:focus { outline: 2px solid var(--green); outline-offset: -2px; background: #f0f7f2; }
.manual-entry-matrix input[aria-invalid="true"] { border-color: var(--red); background: #fff0eb; }
.manual-entry-footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
#manualEntrySummary { font-size: 13px; color: var(--muted); }
#manualEntryMessage:empty { display: none; }
@media(max-width:600px){.native-controls label,.native-controls>button{width:100%;}.native-table{min-width:620px;}}

.status-panel {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 24px;
  align-items: center;
  padding: 0 0 16px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
}
.status-item { display: flex; align-items: baseline; flex-wrap: wrap; gap: 5px 8px; min-width: 0; }
.status-label { font-size: 12px; color: var(--muted); }
.status-item strong { font-size: 12px; font-weight: 600; color: var(--green-dark); overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }

.notice { margin-top: 14px; padding: 14px 17px; border-radius: 12px; font-size: 13px; line-height: 1.6; overflow-wrap: anywhere; }
.notice.warning { color: #70420d; background: var(--amber-soft); border: 1px solid #f1d9aa; }
.notice.neutral { color: #4f5f55; background: #edf1eb; border: 1px solid #dde4da; }

.account-panel { margin-top: 14px; padding: 17px; border: 1px solid #d7e0d8; border-radius: 14px; background: rgba(255,255,251,.82); }
.account-panel-heading { display: flex; justify-content: space-between; gap: 16px; }
.account-panel-heading p { margin: 5px 0 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.account-list { display: grid; gap: 9px; margin-top: 13px; }
.account-item { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 13px; border: 1px solid var(--line); border-radius: 11px; background: #fff; }
.account-copy { display: grid; gap: 3px; min-width: 0; }
.account-copy strong { font-size: 13px; }
.account-copy span { overflow-wrap: anywhere; color: var(--muted); font-size: 11px; }
.account-copy .account-error { color: var(--red); }
.mapping-panel { display: block; }
.mapping-panel[hidden] { display: none; }
.mapping-heading { align-items: flex-start; }
.mapping-summary { color: var(--green-dark) !important; font-weight: 750; }
.mapping-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 14px; }
.mapping-item { display: grid; grid-template-columns: minmax(0, 1fr) 150px; gap: 12px; align-items: center; padding: 11px 12px; border: 1px solid var(--line); border-radius: 11px; background: rgba(255,255,255,.72); }
.mapping-account { display: grid; min-width: 0; gap: 3px; }
.mapping-account strong, .mapping-account small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mapping-account small { color: var(--muted); font-size: 10px; }
.mapping-field { display: grid; gap: 4px; }
.mapping-field > span { color: var(--muted); font-size: 10px; font-weight: 750; }
.mapping-field input { min-width: 0; padding: 8px 9px; }

.content-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; margin-top: 24px; }
.entry-card { order: 0; }
.cycles-card { order: 1; }
.comparison-note { margin: 7px 0 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.comparison-actions { display: flex; align-items: center; gap: 9px; }
.entry-summary { display: flex; justify-content: space-between; align-items: center; gap: 12px; cursor: pointer; list-style: none; color: var(--green-dark); font-size: 15px; font-weight: 750; }
.entry-summary::-webkit-details-marker { display: none; }
.entry-summary::marker { content: ""; }
.entry-summary > span, .advanced-title { display: flex; align-items: center; gap: 10px; }
.entry-summary > span::before, .advanced-title::before { content: ""; flex: 0 0 6px; width: 6px; height: 6px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(-45deg); }
#nativePayoutPanel[open] > .entry-summary > span::before, .advanced-tools[open] > summary .advanced-title::before { transform: rotate(45deg); }
.entry-summary small { color: var(--muted); font-size: 12px; font-weight: 500; }
.entry-card[open] .entry-summary { margin-bottom: 22px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.advanced-tools { margin-top: 24px; padding: 16px 0; border-top: 1px solid var(--line); }
.advanced-tools > summary { display: flex; justify-content: space-between; align-items: center; gap: 12px; cursor: pointer; color: var(--muted); font-size: 14px; font-weight: 650; list-style: none; }
.advanced-tools > summary::-webkit-details-marker { display: none; }
.advanced-tools > summary::marker { content: ""; }
.advanced-tools > summary span:not(.advanced-title) { color: var(--muted); font-size: 12px; font-weight: 400; }
.advanced-tools[open] > summary { padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.advanced-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 15px; color: var(--muted); font-size: 12px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; }
.workflow-card { margin-top: 20px; padding: 22px 24px; }
.workflow-card .section-heading { margin-bottom: 10px; }
.workflow-intro { margin: 0 0 13px; color: var(--muted); font-size: 13px; line-height: 1.6; }
.workflow-list { display: grid; gap: 9px; max-height: 500px; overflow: auto; overscroll-behavior: contain; }
.workflow-item { padding: 13px 14px; border: 1px solid var(--line); border-radius: 12px; background: #fff; min-width: 0; }
.workflow-item p { margin: 5px 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.workflow-item small { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; line-height: 1.5; overflow-wrap: anywhere; }
.workflow-item-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.workflow-empty { padding: 17px; border: 1px dashed var(--line); border-radius: 12px; color: var(--muted); font-size: 12px; }
.workflow-actions, .import-controls { display: flex; gap: 9px; align-items: center; flex-wrap: wrap; margin: 11px 0; }
.workflow-actions select, .import-controls select { width: auto; min-width: 170px; }
.import-controls input { width: auto; max-width: 100%; }
.workflow-card textarea { resize: vertical; }
.compact-setting { display: flex; align-items: center; gap: 8px; white-space: nowrap; font-size: 12px; }
.compact-setting select { width: auto; min-width: 145px; padding: 8px; }
.claim-controls { display: grid; grid-template-columns: minmax(210px, 1fr) minmax(230px, 1fr) auto auto; gap: 9px; align-items: center; margin-top: 13px; }
.checkbox-line { display: flex; flex-direction: row; align-items: center; gap: 7px; font-size: 12px; white-space: nowrap; }
.checkbox-line input, .inbox-item input { width: auto; }
.inbox-item { display: flex; align-items: flex-start; gap: 12px; cursor: pointer; font-weight: 400; }
.inbox-item input { flex: 0 0 auto; margin-top: 4px; }
.inbox-item > span { min-width: 0; }
.mini-chip { padding: 4px 7px; border-radius: 999px; background: #edf3ed; color: var(--green-dark); font-size: 10px; font-weight: 800; }
.alert-item { border-color: #e5d8bb; background: #fffcf5; }
.entry-card { padding: 14px 18px; }
.entry-card:not([open]) { background: #fff; }
.cycles-card { padding: 0; border: 0; border-radius: 0; background: transparent; }
.section-heading, .table-heading { display: flex; justify-content: space-between; align-items: center; gap: 18px; }
.section-heading { margin-bottom: 24px; }
.step-badge { padding: 6px 10px; color: var(--green); background: var(--green-soft); border-radius: 999px; font-size: 12px; font-weight: 800; }
.icon-button { width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line); color: var(--ink); background: #fff; cursor: pointer; font-size: 19px; }
.icon-button:hover { border-color: #a9b9af; background: #edf3ef; }
.cycles-card > .section-heading { margin-bottom: 14px; padding: 0 2px; }

.form-grid { display: grid; gap: 14px; }
.two-columns { grid-template-columns: 1fr 1fr; }
label { display: grid; gap: 7px; color: #4c5c52; font-size: 13px; font-weight: 700; }
input, textarea, select {
  width: 100%;
  border: 1px solid #d7ddd4;
  border-radius: 10px;
  padding: 11px 12px;
  color: var(--ink);
  background: rgba(255,255,255,.92);
  outline: none;
}
input:focus, textarea:focus, select:focus { border-color: #61a081; box-shadow: 0 0 0 3px rgba(41, 120, 82, .11); }

.entry-mode-tabs { display: inline-flex; gap: 4px; margin-top: 22px; padding: 4px; border: 1px solid var(--line); border-radius: 12px; background: #eef1eb; }
.entry-mode-button { border: 0; border-radius: 8px; padding: 9px 14px; color: var(--muted); background: transparent; cursor: pointer; font-size: 13px; font-weight: 800; }
.entry-mode-button.active { color: var(--green-dark); background: #fff; box-shadow: 0 3px 10px rgba(30,55,40,.09); }
.entry-mode-panel[hidden] { display: none; }

.matrix-heading { align-items: flex-end; }
.matrix-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 13px; background: rgba(255,255,255,.72); }
.matrix-table { width: 100%; min-width: 1120px; border-collapse: collapse; table-layout: fixed; }
.matrix-table th, .matrix-table td { border-right: 1px solid #e4e8e1; border-top: 1px solid #e7eae3; padding: 8px; text-align: center; }
.matrix-table thead th { border-top: 0; color: #526158; background: #edf1eb; font-size: 12px; }
.matrix-table thead th:first-child { width: 95px; }
.matrix-table thead th:nth-child(2) { width: 108px; }
.matrix-table th:last-child, .matrix-table td:last-child { border-right: 0; }
.matrix-table tbody th { color: var(--ink); background: #f8f9f5; font-size: 13px; letter-spacing: .02em; }
.matrix-table small { display: block; margin-top: 3px; color: #7d8a82; font-size: 9px; }
.matrix-table input { min-width: 86px; padding: 9px 8px; text-align: right; }
.matrix-date { color: var(--muted); white-space: nowrap; font-size: 11px; }
.matrix-table tfoot th, .matrix-table tfoot td { color: var(--green-dark); background: #eef6f0; font-size: 11px; font-weight: 800; }
.matrix-note { margin: 9px 2px 0; color: var(--muted); font-size: 11px; }
.bulk-paste-box { margin: 14px 0; padding: 14px; border: 1px solid #d8e1d9; border-radius: 13px; background: #f3f6f1; }
.bulk-paste-box > label { margin-bottom: 9px; }
.bulk-paste-box textarea { min-height: 132px; resize: vertical; font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 12px; line-height: 1.55; }
.bulk-paste-actions { display: flex; align-items: center; gap: 12px; margin-top: 9px; }
.bulk-paste-actions .form-message { flex: 1; }

.table-heading { margin: 26px 0 12px; }
.table-heading p, .paste-box p { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.payout-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 13px; background: rgba(255,255,255,.65); }
.payout-table { width: 100%; min-width: 500px; border-collapse: collapse; }
.payout-table th { padding: 10px 9px; text-align: left; color: #68766d; background: #eef1eb; font-size: 11px; letter-spacing: .03em; }
.payout-table td { padding: 8px; border-top: 1px solid #e7eae3; }
.payout-table input { min-width: 90px; padding: 9px 10px; }
.payout-table .store-input { min-width: 130px; }
.remove-row { width: 30px; height: 30px; border: 0; border-radius: 8px; background: transparent; color: #9d5b5b; cursor: pointer; font-size: 18px; }
.remove-row:hover { background: #fff0f0; }

.paste-box { margin-top: 14px; padding: 12px 14px; border-radius: 12px; background: #f2f3ee; }
.paste-box summary { cursor: pointer; color: #3d5145; font-size: 13px; font-weight: 800; }
.paste-box textarea { margin: 10px 0; resize: vertical; }
.form-footer { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-top: 20px; }
.form-message { min-height: 20px; margin: 0; color: var(--green); font-size: 13px; overflow-wrap: anywhere; }
.form-message.error { color: var(--red); }

.cycle-list { display: grid; gap: 12px; }
.archive-panel { margin-top: 4px; padding: 16px 0 0; border-top: 1px solid var(--line); }
.archive-panel > summary { cursor: pointer; color: var(--muted); font-size: 13px; font-weight: 750; }
.archive-panel > .archive-items { display: grid; gap: 10px; margin-top: 12px; }
.cycle-item { overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.cycle-item:hover { border-color: #9cbbab; }
.batch-summary { padding: 14px 16px 8px; cursor: pointer; list-style: none; }
.batch-summary::-webkit-details-marker { display: none; }
.batch-summary::marker { content: ""; }
.batch-summary:focus-visible { outline-offset: -3px; border-radius: 11px; }
.batch-item[open] > .batch-summary { border-bottom: 1px solid var(--line); }
.batch-body { padding: 18px 20px; background: #fff; }
.batch-loading { padding: 18px; text-align: center; color: var(--muted); font-size: 12px; }
.batch-attention-list { margin-top: 10px; }
.batch-attention-note { margin: 12px 0 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.arrival-attention-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(170px, .65fr) minmax(225px, .8fr) 124px; align-items: center; gap: 16px; min-height: 44px; padding: 4px 10px; border-top: 1px solid var(--line); border-left: 3px solid transparent; cursor: default; }
.arrival-attention-copy, .arrival-attention-amount, .arrival-attention-state { display: grid; gap: 4px; min-width: 0; overflow-wrap: anywhere; }
.arrival-attention-copy strong { font-size: 14px; font-weight: 650; line-height: 1.6; }
.arrival-attention-amount { display: flex; align-items: baseline; justify-content: flex-end; flex-wrap: wrap; gap: 4px 8px; text-align: right; font-variant-numeric: tabular-nums; }
.arrival-attention-amount span, .arrival-attention-state small { color: var(--muted); font-size: 12px; line-height: 1.5; }
.arrival-attention-amount strong { color: var(--ink); font-size: 16px; line-height: 1.4; font-weight: 700; }
.arrival-attention-state { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; padding-left: 8px; }
.arrival-attention-state strong { color: var(--amber); font-size: 12px; font-weight: 650; line-height: 1.5; }
.arrival-attention-row > .button { color: var(--green); background: transparent; border-color: transparent; min-height: 36px; }
.arrival-attention-row > .button:hover { background: #eaf1ec; }
.arrival-attention-row.overdue .arrival-attention-state strong, .arrival-attention-row.variance .arrival-attention-state strong { color: var(--red); }
.arrival-attention-row.overdue { border-left-color: var(--amber); background: #fffcf5; }
.arrival-attention-row.variance { border-left-color: var(--red); background: #fff8f6; }
@media (hover: hover) { .arrival-attention-row:not(.overdue):not(.variance):hover { background: #f7f9f8; } }
.batch-payout-list { max-height: 420px; overflow: auto; overscroll-behavior: contain; }
.store-settlement-group { margin-top: 12px; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; }
.store-settlement-group:first-child { margin-top: 0; }
.store-settlement-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; color: var(--green-dark); background: #eef6f0; font-size: 12px; }
.store-settlement-heading > div:first-child { display: grid; gap: 2px; }
.store-settlement-heading span { color: var(--muted); font-size: 10px; font-weight: 500; }
.store-settlement-group .detail-row { padding-inline: 12px; }
.evidence-details { padding: 0 12px 12px; color: var(--muted); font-size: 11px; }
.evidence-details summary { cursor: pointer; padding: 4px 0; color: var(--green-dark); font-weight: 700; }
.evidence-timeline { margin: 8px 0 10px; padding-left: 22px; }
.evidence-timeline li { padding: 4px 0; line-height: 1.55; }
.evidence-timeline li strong { color: var(--ink); margin-right: 8px; }
.evidence-timeline li.unknown strong { color: var(--muted); }
.evidence-timeline span { overflow-wrap: anywhere; }
.detail-amount { text-align: right; }
.batch-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 16px; }
.batch-tools { margin-top: 14px; font-size: 12px; color: var(--muted); }
.batch-tools > summary { cursor: pointer; }
.batch-last-check { margin: 12px 0 0; }
.cycle-top { display: flex; justify-content: space-between; gap: 16px; align-items: center; }
.cycle-top > div:first-child { min-width: 0; overflow-wrap: anywhere; }
.cycle-summary-actions { display:flex; justify-content:flex-end; align-items:center; flex-wrap:wrap; gap:8px; }
.cycle-summary-actions > .button { color: var(--green); background: transparent; border-color: transparent; }
.cycle-summary-actions > .button:hover { background: #eaf1ec; }
.cycle-summary-actions .status-chip { order: -1; }
.cycle-title { font-size: 16px; font-weight: 700; line-height: 1.5; }
.cycle-date { margin-top: 3px; color: var(--muted); font-size: 12px; line-height: 1.6; font-variant-numeric: tabular-nums; }
.status-chip { flex: 0 0 auto; padding: 5px 8px; border-radius: 6px; font-size: 12px; font-weight: 650; line-height: 1.5; }
.status-chip.open { color: #7b4a0b; background: #fff0d0; }
.status-chip.completed { color: #18593e; background: #dff0e5; }
.status-chip.archived { color: #66706a; background: #e9ece8; }
.status-chip.attention { color: var(--red); background: #fff0e9; }
.progress-track { margin: 12px 0 5px; }
.progress-bar { display: block; width: 100%; height: 4px; appearance: none; border: 0; border-radius: 999px; background: #e6eae4; }
.progress-bar::-webkit-progress-bar { border-radius: 999px; background: #e6eae4; }
.progress-bar::-webkit-progress-value { border-radius: 999px; background: #328264; }
.progress-bar::-moz-progress-bar { border-radius: 999px; background: #2b865f; }
.progress-meta { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px 16px; min-height: 30px; color: var(--muted); font-size: 12px; }
.progress-meta > span:last-child { display: flex; align-items: center; gap: 9px; color: var(--green); }
.progress-meta > span:last-child::after { content: ""; width: 6px; height: 6px; margin-right: 2px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg); }
.batch-item[open] > .batch-summary .progress-meta > span:last-child::after { transform: rotate(225deg); }
.empty-state { padding: 36px 14px; text-align: center; color: var(--muted); border: 1px dashed #cdd4cb; border-radius: 14px; }

.dialog { width: min(720px, calc(100% - 30px)); max-height: 85vh; border: 0; border-radius: 20px; padding: 24px; color: var(--ink); box-shadow: 0 30px 90px rgba(20,35,26,.25); }
.dialog::backdrop { background: rgba(18, 30, 23, .55); }
.dialog-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 20px; }
.detail-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 16px; }
.detail-stat { padding: 12px; border-radius: 11px; background: #f0f3ee; }
.detail-stat span { display: block; color: var(--muted); font-size: 11px; }
.detail-stat strong { display: block; margin-top: 5px; font-size: 14px; }
.detail-row { display: grid; grid-template-columns: minmax(150px, 1fr) minmax(170px, .8fr) minmax(170px, .8fr) auto; gap: 16px; align-items: center; padding: 13px 0; border-top: 1px solid var(--line); }
.detail-row p { margin: 0; }
.detail-row .sub { margin-top: 5px; color: var(--muted); font-size: 12px; }
.comparison-cell { display: grid; gap: 4px; }
.comparison-cell small { color: var(--muted); font-size: 11px; }
.comparison-cell strong { font-size: 15px; }
.comparison-result { white-space: nowrap; color: var(--amber); font-size: 12px; font-weight: 800; }
.comparison-result.matched { color: var(--green); }
.comparison-result.variance { color: var(--red); }
.dialog-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 10px; margin-top: 18px; }


.toast { position: fixed; z-index: 20; right: 22px; bottom: 22px; max-width: 380px; padding: 12px 15px; color: #fff; background: #173f2e; border-radius: 11px; box-shadow: var(--shadow); opacity: 0; transform: translateY(12px); pointer-events: none; transition: .2s ease; }
.toast.show { opacity: 1; transform: translateY(0); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; }
}

@media (max-width: 900px) {
  .arrival-attention-row { grid-template-columns: minmax(0, 1fr) 140px 152px 116px; gap: 12px; }
  .arrival-attention-state { padding-left: 0; }
  .content-grid { grid-template-columns: 1fr; }
  .detail-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .comparison-result { grid-column: 1 / -1; }
  .status-panel { grid-template-columns: repeat(3, 1fr); }
  .status-actions { grid-column: 1 / -1; }
  .mapping-list { grid-template-columns: 1fr; }
  .claim-controls { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 620px) {
  .arrival-attention-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 4px 12px; padding: 6px 8px; }
  .arrival-attention-copy { align-self: center; }
  .arrival-attention-amount { gap: 2px 8px; }
  .arrival-attention-state { display: grid; grid-column: 1; gap: 2px; padding-left: 0; }
  .arrival-attention-row > .button { grid-column: 2; justify-self: end; min-height: 44px; padding: 8px; font-size: 12px; }
  .shell { width: calc(100% - 32px); padding: 22px 0 40px; }
  .hero { align-items: flex-start; gap: 14px; flex-wrap: wrap; }
  .hero-copy { font-size: 13px; }
  .hero-actions { gap: 6px; }
  .hero-actions .button { min-height: 44px; font-size: 13px; padding-inline: 12px; }
  .status-panel { gap: 7px 20px; padding-bottom: 14px; }
  .content-grid { margin-top: 20px; }
  .cycle-top { align-items: flex-start; gap: 8px; }
  .cycle-title { font-size: 15px; }
  .cycle-summary-actions { flex: 0 0 132px; display: grid; justify-items: end; gap: 2px; }
  .cycle-summary-actions .status-chip { font-size: 11px; white-space: normal; text-align: right; }
  .cycle-summary-actions > .button { min-height: 44px; padding: 6px 8px; font-size: 12px; }
  .batch-summary { padding: 14px 12px 8px; }
  .batch-body { padding: 12px; }
  .batch-attention-list { margin-top: 10px; }
  .cycles-card > .section-heading { margin-bottom: 12px; }
  .cycles-card h2 { font-size: 18px; }
  .icon-button { width: 44px; height: 44px; }
  .toast { right: 16px; bottom: 16px; max-width: calc(100% - 32px); font-size: 13px; }
  .status-panel { grid-template-columns: 1fr 1fr; }
  .status-actions { grid-column: 1 / -1; }
  .two-columns { grid-template-columns: 1fr; }
  .entry-mode-tabs { display: grid; grid-template-columns: 1fr 1fr; width: 100%; }
  .entry-mode-button { padding-inline: 9px; }
  .entry-card { padding: 13px 14px; border-radius: 12px; }
  .cycles-card { padding: 0; border-radius: 0; }
  .entry-summary { align-items: flex-start; flex-direction: column; }
  .comparison-actions .button { padding: 8px 10px; font-size: 12px; }
  .payout-table-wrap { overflow: visible; border: 0; background: transparent; }
  .payout-table { min-width: 0; }
  .payout-table thead { display: none; }
  .payout-table tbody { display: grid; gap: 12px; }
  .payout-table tr {
    position: relative;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding: 13px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: rgba(255,255,255,.72);
  }
  .payout-table td { display: grid; gap: 5px; padding: 0; border: 0; }
  .payout-table td::before { color: var(--muted); font-size: 10px; font-weight: 750; }
  .payout-table td:nth-child(1) { grid-column: 1 / -1; }
  .payout-table td:nth-child(1)::before { content: "店铺 / 站点"; }
  .payout-table td:nth-child(2)::before { content: "国家"; }
  .payout-table td:nth-child(3)::before { content: "金额"; }
  .payout-table td:nth-child(4) { position: absolute; top: 7px; right: 7px; }
  .payout-table td:nth-child(4)::before { content: none; }
  .payout-table input, .payout-table select, .payout-table .store-input { min-width: 0; }
  .form-footer { align-items: stretch; flex-direction: column; }
  .form-footer .button { width: 100%; }
  .detail-summary { grid-template-columns: 1fr; }
  .account-item { align-items: flex-start; }
  .mapping-heading { gap: 12px; flex-direction: column; }
  .mapping-heading .button { width: 100%; }
  .mapping-item { grid-template-columns: 1fr; }
  .bulk-paste-actions { align-items: stretch; flex-direction: column; }
  .workflow-card { padding: 18px; border-radius: 17px; }
  .workflow-card .section-heading { align-items: flex-start; flex-direction: column; }
  .claim-controls { grid-template-columns: 1fr; }
  .workflow-actions select, .import-controls select, .claim-controls .button { width: 100%; }
  .batch-actions { align-items: stretch; flex-direction: column; }
  .store-settlement-heading { align-items: flex-start; flex-direction: column; }
}
