:root {
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
  --bg: #f4f6f8;
  --panel: #ffffff;
  --line: #d8dee6;
  --text: #17212b;
  --muted: #637083;
  --brand: #1264a3;
  --brand-2: #0b7285;
  --ok: #16803c;
  --warn: #b7791f;
  --bad: #b42318;
  --soft: #eef6fb;
  --soft-green: #edf8f1;
  --soft-warn: #fff7e6;
  --shadow: 0 12px 30px rgba(23, 33, 43, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-size: 13px;
  line-height: 1.35;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.desktop-app {
  min-height: 100vh;
  padding: 14px;
}

.desktop-shell {
  max-width: 1440px;
  min-height: calc(100vh - 28px);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 248px 1fr;
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.sidebar {
  background: #132033;
  color: #e7eef7;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.brand {
  height: 58px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.brand-mark,
.login-mark {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: #1f9bcf;
  display: grid;
  place-items: center;
  font-weight: 800;
  color: white;
}

.brand-title {
  font-weight: 800;
  font-size: 15px;
}

.brand-sub {
  color: #aebed0;
  font-size: 12px;
  margin-top: 2px;
}

.nav {
  padding: 10px 8px;
  overflow: auto;
}

.nav-section {
  margin: 10px 8px 6px;
  color: #8fa2b8;
  font-size: 12px;
  font-weight: 700;
}

.nav-item {
  width: 100%;
  height: 34px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #d9e4f0;
  font-size: 13px;
  white-space: nowrap;
  text-align: left;
}

.nav-item.active {
  background: #1d75a6;
  color: white;
}

.nav-icon {
  width: 22px;
  text-align: center;
  color: #bcd1e4;
  font-size: 15px;
}

.sidebar-footer {
  margin-top: auto;
  padding: 14px 18px 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  color: #b9c8d7;
  font-size: 13px;
}

.desktop-main {
  min-width: 0;
  background: #f7f9fb;
  display: flex;
  flex-direction: column;
}

.topbar {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 16px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}

.crumb {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 4px;
}

.top-title {
  font-size: 18px;
  font-weight: 800;
}

.top-meta {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.button,
.icon-button,
.mini-action {
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  border-radius: 6px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 10px;
  font-weight: 700;
  font-size: 13px;
  white-space: nowrap;
}

.button.primary,
.mini-action.primary {
  background: var(--brand);
  border-color: var(--brand);
  color: white;
}

.button.wide {
  width: 100%;
}

.icon-button {
  width: 36px;
  padding: 0;
}

.mini-action {
  height: 28px;
  padding: 0 9px;
  font-size: 12px;
}

.mini-action.danger {
  color: var(--bad);
  border-color: #f1c5c1;
  background: #fff5f4;
}

.content {
  padding: 12px 16px 16px;
  min-width: 0;
}

.notice {
  background: #fff9e8;
  border: 1px solid #ead99f;
  border-radius: 8px;
  padding: 12px 14px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 16px;
}

.notice strong {
  display: block;
  font-size: 14px;
  margin-bottom: 2px;
}

.notice span {
  color: #695420;
  font-size: 13px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 10px;
}

.metric {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  min-height: 82px;
}

.metric-label {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 10px;
}

.metric-value {
  font-size: 21px;
  font-weight: 850;
  line-height: 1;
  margin-bottom: 12px;
}

.metric-foot {
  color: var(--muted);
  font-size: 12px;
}

.metric.good .metric-value {
  color: var(--ok);
}

.metric.warn .metric-value {
  color: var(--warn);
}

.metric.brand .metric-value {
  color: var(--brand);
}

.dashboard-stack {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  min-width: 0;
  overflow: hidden;
  margin-bottom: 10px;
}

.panel-head {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
}

.panel-title {
  font-weight: 800;
  font-size: 15px;
}

.tabs {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
}

.tab {
  height: 30px;
  min-width: 64px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 13px;
  border: 0;
  border-right: 1px solid var(--line);
  background: var(--panel);
}

.tab:last-child {
  border-right: 0;
}

.tab.active {
  background: var(--soft);
  color: var(--brand);
  font-weight: 800;
}

.table-scroll {
  overflow-x: auto;
}

.platform-table-note {
  color: var(--muted);
  font-size: 12px;
  padding: 0 16px 8px;
}

.table-action-note {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

th,
td {
  padding: 8px 10px;
  border-bottom: 1px solid #e8edf2;
  font-size: 13px;
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

th {
  color: var(--muted);
  font-weight: 800;
  background: #fbfcfd;
}

td.amount {
  font-weight: 800;
}

.status {
  display: inline-flex;
  align-items: center;
  height: 24px;
  border-radius: 999px;
  padding: 0 9px;
  font-size: 12px;
  font-weight: 800;
}

.status.ok {
  color: var(--ok);
  background: var(--soft-green);
}

.status.warn {
  color: var(--warn);
  background: var(--soft-warn);
}

.status.neutral {
  color: var(--muted);
  background: #edf0f3;
}

.assistant-box {
  padding: 14px;
}

.assistant-card {
  border: 1px solid #c7dceb;
  background: #f1f8fc;
  border-radius: 8px;
  padding: 14px;
}

.assistant-card.large {
  min-width: 0;
}

.assistant-card h3 {
  font-size: 16px;
  margin: 0 0 8px;
}

.assistant-card p {
  color: var(--muted);
  font-size: 13px;
  margin: 0 0 12px;
}

.prompt-row,
.assistant-form {
  display: flex;
  gap: 8px;
  align-items: center;
}

.assistant-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 14px;
  padding: 14px;
}

.assistant-prompts {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
  padding: 12px;
}

.assistant-prompt-title {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 10px;
}

.assistant-prompt {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
  color: var(--ink);
  padding: 10px;
  text-align: left;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 8px;
}

.assistant-thread {
  min-height: 300px;
  max-height: 520px;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.assistant-message,
.assistant-empty {
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

.assistant-question {
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
  margin-bottom: 8px;
}

.assistant-answer,
.assistant-empty {
  color: var(--brand);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.6;
  white-space: pre-wrap;
}

.assistant-simple {
  display: grid;
  gap: 10px;
  padding: 12px;
}

.assistant-composer {
  margin-top: 12px;
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 8px;
  align-items: stretch;
}

.assistant-query-bar {
  margin-top: 0;
  grid-template-columns: 1fr;
}

.assistant-input-area {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.assistant-input-area .button {
  min-height: 44px;
  padding-inline: 18px;
}

.prompt-row textarea,
.assistant-form input,
.assistant-composer textarea,
.assistant-composer select,
.assistant-form select {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 13px;
  background: white;
}

.assistant-composer select,
.assistant-form select {
  height: 38px;
  padding: 0 10px;
}

.assistant-task-select {
  display: none;
}

.assistant-task-buttons {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
}

.assistant-task-button {
  border: 1px solid var(--line);
  background: white;
  color: var(--text);
  border-radius: 6px;
  min-height: 34px;
  font-size: 12px;
  font-weight: 800;
}

.assistant-task-button.active {
  background: var(--brand);
  border-color: var(--brand);
  color: white;
}

.assistant-template {
  display: grid;
  gap: 5px;
  color: var(--muted);
  background: #f7f9fb;
  border: 1px solid #e5ebf1;
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 12px;
}

.assistant-template div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.assistant-template em {
  min-width: 0;
  color: #7b8796;
  font-style: normal;
  overflow-wrap: anywhere;
}

.assistant-template button {
  flex: 0 0 auto;
  border: 0;
  background: transparent;
  color: var(--brand);
  font-size: 12px;
  font-weight: 800;
}

.assistant-input {
  width: 100%;
  min-height: 44px;
  max-height: 260px;
  padding: 11px 12px;
  line-height: 1.55;
  resize: vertical;
  overflow: auto;
}

.dashboard-assistant-input {
  min-height: 44px;
  max-height: 72px;
}

.assistant-composer .assistant-input {
  min-height: 180px;
}

.assistant-query-bar .assistant-input {
  min-height: 44px;
  max-height: 72px;
}

.prompt-row textarea,
.assistant-form input,
.assistant-composer textarea {
  flex: 1;
}

.assistant-reply {
  margin-top: 10px;
  color: var(--brand);
  font-size: 13px;
  font-weight: 700;
}

.assistant-current-result {
  margin-top: 12px;
  display: grid;
  gap: 10px;
}

.assistant-draft-meta {
  font-size: 12px;
  color: #607080;
}

.assistant-result-title {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.assistant-confirm-notice {
  color: var(--ok);
  background: var(--soft-green);
  border: 1px solid #bfe6ca;
  border-radius: 6px;
  padding: 9px 10px;
  font-size: 13px;
  font-weight: 800;
}

.assistant-empty.compact {
  min-height: 0;
}

.assistant-result {
  display: grid;
  gap: 10px;
}

.assistant-result-summary {
  color: var(--brand);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.6;
}

.assistant-result-warnings {
  display: grid;
  gap: 4px;
  color: var(--bad);
  background: #fff5f4;
  border: 1px solid #f1c5c1;
  border-radius: 6px;
  padding: 9px 10px;
  font-size: 13px;
  font-weight: 800;
}

.assistant-result-notices {
  display: grid;
  gap: 4px;
  color: #6d5200;
  background: #fff8db;
  border: 1px solid #ead58a;
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 800;
}

.assistant-field-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.assistant-field-card {
  min-width: 0;
  min-height: 54px;
  display: grid;
  align-content: center;
  gap: 3px;
  background: white;
  border: 1px solid #dbe4ed;
  border-radius: 6px;
  padding: 8px 10px;
}

.assistant-field-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.assistant-field-card strong {
  min-width: 0;
  color: var(--text);
  font-size: 14px;
  overflow-wrap: anywhere;
}

.assistant-field-missing {
  background: var(--soft-warn);
  border-color: #ead58a;
}

.assistant-field-missing strong {
  color: var(--warn);
}

.assistant-result-table table {
  background: white;
}

.assistant-result-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.assistant-result-actions .button {
  min-width: 116px;
}

.assistant-follow-up {
  display: grid;
  gap: 7px;
  color: var(--text);
  background: #f7f9fb;
  border: 1px solid #e5ebf1;
  border-radius: 6px;
  padding: 9px 10px;
  font-size: 12px;
}

.assistant-follow-up strong {
  font-size: 13px;
}

.assistant-follow-up span {
  color: var(--muted);
}

.assistant-follow-options {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.assistant-follow-options button {
  border: 1px solid var(--line);
  background: white;
  color: var(--brand);
  border-radius: 999px;
  min-height: 28px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 800;
}

.assistant-extra-table {
  display: grid;
  gap: 6px;
}

.assistant-extra-table-title {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.assistant-mobile-results {
  display: grid;
  gap: 6px;
}

.assistant-mobile-card {
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
}

.assistant-mobile-card.compact {
  padding: 7px 8px;
  line-height: 1.25;
}

.assistant-mobile-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  border-bottom: 1px solid #edf1f5;
  padding-bottom: 5px;
  margin-bottom: 6px;
}

.assistant-mobile-card-head strong,
.assistant-mobile-card-head b {
  display: block;
  font-size: 13px;
}

.assistant-mobile-card-head span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-top: 1px;
}

.assistant-mobile-primary-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
  margin-bottom: 6px;
}

.assistant-mobile-primary-fields div {
  min-width: 0;
  border: 1px solid #edf1f5;
  border-radius: 6px;
  padding: 5px 6px;
  background: #fbfcfd;
}

.assistant-mobile-primary-fields span {
  display: block;
  color: var(--muted);
  font-size: 10px;
  margin-bottom: 1px;
}

.assistant-mobile-primary-fields strong {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 12px;
}

.assistant-mobile-fields {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px 8px;
}

.assistant-mobile-fields div {
  min-width: 0;
}

.assistant-mobile-fields span {
  display: block;
  color: var(--muted);
  font-size: 10px;
  margin-bottom: 1px;
}

.assistant-mobile-fields strong {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 11px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px;
  padding: 10px 12px 12px;
}

.form-grid label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.form-grid input,
.form-grid select {
  min-width: 0;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 8px;
  background: white;
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
}

.form-grid .span-2 {
  grid-column: span 2;
}

.form-grid .button {
  align-self: end;
}

.form-grid .checkbox-label {
  align-self: end;
  min-height: 32px;
  flex-direction: row;
  align-items: center;
  color: var(--text);
}

.form-grid .checkbox-label input {
  width: auto;
  height: auto;
}

.mobile-app {
  min-height: 100vh;
  padding: 16px 0;
  background: #e8edf3;
}

.mobile-wrap {
  max-width: 430px;
  margin: 0 auto;
  padding: 14px;
  background: #111827;
  border-radius: 28px;
  box-shadow: var(--shadow);
}

.mobile-shell {
  background: #f5f7f9;
  border-radius: 20px;
  overflow: hidden;
  min-height: 820px;
  border: 1px solid #232f3e;
  position: relative;
}

.mobile-top {
  background: var(--panel);
  padding: 18px 16px 12px;
  border-bottom: 1px solid var(--line);
}

.mobile-status {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 14px;
}

.mobile-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.mobile-head h2 {
  font-size: 18px;
  line-height: 1.2;
  margin: 0;
}

.mobile-head p {
  color: var(--muted);
  font-size: 12px;
  margin: 3px 0 0;
}

.mobile-head-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.mobile-text-action {
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  color: var(--text);
  padding: 0 8px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.mobile-body {
  padding: 14px 14px calc(82px + env(safe-area-inset-bottom));
}

.mobile-notice {
  background: #fff9e8;
  border: 1px solid #ead99f;
  border-radius: 8px;
  padding: 10px;
  margin-bottom: 12px;
  font-size: 12px;
  color: #604b1d;
}

.mobile-ai {
  background: #eaf6fb;
  border: 1px solid #c5deec;
  border-radius: 8px;
  padding: 13px;
  margin-bottom: 12px;
}

.mobile-ai-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.mobile-ai h3 {
  font-size: 16px;
  margin: 0;
}

.mobile-ai p {
  color: var(--muted);
  font-size: 12px;
  margin: 0;
}

.mobile-input {
  height: 38px;
  border: 1px solid var(--line);
  background: white;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 8px 0 10px;
  color: var(--muted);
  font-size: 13px;
}

.mobile-input button {
  height: 28px;
  border: 0;
  background: var(--brand);
  color: white;
  border-radius: 5px;
  padding: 0 10px;
  font-weight: 800;
}

.mobile-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.mobile-metric {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  min-height: 82px;
}

.mobile-metric span {
  color: var(--muted);
  font-size: 12px;
}

.mobile-metric strong {
  display: block;
  margin-top: 8px;
  font-size: 20px;
}

.mobile-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.mobile-action {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 74px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

.mobile-action i {
  font-style: normal;
  font-size: 20px;
}

.mobile-list {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.mobile-list-head {
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  font-weight: 800;
  font-size: 14px;
}

.mobile-list-head button {
  border: 0;
  background: transparent;
  color: var(--brand);
  font-size: 12px;
  font-weight: 800;
}

.mobile-row {
  padding: 12px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid #e8edf2;
  font-size: 13px;
}

.mobile-row:last-child {
  border-bottom: 0;
}

.mobile-row small {
  display: block;
  color: var(--muted);
  margin-top: 2px;
}

.mobile-row strong {
  white-space: nowrap;
}

.mobile-order-list {
  display: grid;
  gap: 7px;
}

.mobile-order-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  line-height: 1.25;
}

.mobile-order-head,
.mobile-order-main,
.mobile-order-money {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.mobile-order-head strong,
.mobile-order-head b {
  font-size: 13px;
}

.mobile-order-main {
  margin-top: 4px;
  font-size: 12px;
  font-weight: 800;
}

.mobile-order-main span,
.mobile-order-main em {
  min-width: 0;
  overflow-wrap: anywhere;
}

.mobile-order-main em {
  color: var(--muted);
  font-style: normal;
  text-align: right;
}

.mobile-order-meta {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
  margin-top: 6px;
  color: var(--muted);
  font-size: 10px;
}

.mobile-order-meta span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.mobile-order-money {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid #edf1f5;
  font-size: 11px;
  font-weight: 800;
}

.mobile-order-actions {
  display: flex;
  gap: 6px;
  margin-top: 6px;
}

.mobile-order-actions:empty {
  display: none;
}

.mobile-order-actions .mini-action {
  min-height: 28px;
  padding: 4px 8px;
}

.mobile-ledger-list {
  display: grid;
  gap: 7px;
}

.mobile-ledger-record-list {
  display: grid;
  gap: 7px;
}

.mobile-product-list {
  display: grid;
  gap: 7px;
}

.mobile-product-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 8px;
  line-height: 1.25;
}

.mobile-product-head,
.mobile-product-main,
.mobile-product-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.mobile-product-head strong {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 13px;
}

.mobile-product-head span {
  display: block;
  color: var(--muted);
  font-size: 10px;
  margin-top: 1px;
}

.mobile-product-main {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.mobile-product-main span,
.mobile-product-meta span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.mobile-product-meta {
  margin-top: 5px;
  padding-top: 5px;
  border-top: 1px solid #edf1f5;
  color: var(--muted);
  font-size: 10px;
}

.mobile-product-head b {
  white-space: nowrap;
  font-size: 13px;
}

.mobile-ledger-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  line-height: 1.25;
}

.mobile-ledger-head,
.mobile-ledger-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.mobile-ledger-head strong {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 13px;
}

.mobile-ledger-head span,
.mobile-ledger-meta {
  color: var(--muted);
  font-size: 11px;
}

.mobile-ledger-money {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
  margin: 6px 0;
}

.mobile-ledger-money div {
  min-width: 0;
  border: 1px solid #edf1f5;
  border-radius: 6px;
  padding: 5px;
  background: #fbfcfd;
}

.mobile-ledger-money span {
  display: block;
  color: var(--muted);
  font-size: 10px;
}

.mobile-ledger-money b {
  display: block;
  margin-top: 1px;
  overflow-wrap: anywhere;
  font-size: 11px;
}

.mobile-ledger-record-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  line-height: 1.25;
}

.mobile-ledger-record-head,
.mobile-ledger-record-main,
.mobile-ledger-record-meta,
.mobile-ledger-record-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.mobile-ledger-record-head strong,
.mobile-ledger-record-head b {
  font-size: 13px;
}

.mobile-ledger-record-main {
  margin-top: 4px;
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
}

.mobile-ledger-record-main span,
.mobile-ledger-record-meta span,
.mobile-ledger-record-foot span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.mobile-ledger-record-meta {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid #edf1f5;
  color: var(--muted);
  font-size: 10px;
  flex-wrap: wrap;
}

.mobile-ledger-record-foot {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid #edf1f5;
}

.mobile-share-button {
  border: 1px solid var(--line);
  background: var(--soft);
  color: var(--brand);
  border-radius: 6px;
  min-height: 28px;
  padding: 0 8px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.mobile-tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: 64px;
  max-width: 430px;
  margin: 0 auto;
  padding-bottom: env(safe-area-inset-bottom);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  background: var(--panel);
  border-top: 1px solid var(--line);
}

.mobile-tab {
  border: 0;
  background: transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.mobile-tab.active {
  color: var(--brand);
}

.mobile-tab i {
  font-style: normal;
  font-size: 18px;
}

.login {
  max-width: 380px;
  margin: 12vh auto;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 24px;
  box-shadow: var(--shadow);
}

.login h1 {
  margin: 14px 0 4px;
  font-size: 22px;
}

.login p,
.login small {
  color: var(--muted);
}

.login-demo-notice {
  margin: 12px 0;
  padding: 9px 10px;
  border: 1px solid #ead99f;
  border-radius: 6px;
  background: #fff9e8;
  color: #695420;
  font-size: 12px;
  line-height: 1.5;
}

.login input {
  width: 100%;
  margin: 8px 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.login textarea,
.form-grid textarea {
  width: 100%;
  min-height: 120px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  resize: vertical;
}

.login-agreement {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 10px 0 12px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.login-agreement input {
  width: auto;
  margin: 3px 0 0;
}

.login-remember {
  margin: 8px 0 4px;
}

.login a,
.legal-page a {
  color: var(--brand);
  font-weight: 700;
  text-decoration: none;
}

.login-legal-links {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 12px 0 8px;
  color: var(--muted);
  font-size: 12px;
}

.legal-app {
  min-height: 100vh;
  padding: 24px;
}

.legal-page {
  max-width: 880px;
  margin: 0 auto;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.legal-head {
  padding: 24px 28px 18px;
  border-bottom: 1px solid var(--line);
  background: #f8fafc;
}

.legal-back {
  display: inline-flex;
  margin-bottom: 14px;
}

.legal-head h1 {
  margin: 0 0 8px;
  font-size: 24px;
}

.legal-head p {
  margin: 0;
  color: var(--muted);
}

.legal-content {
  padding: 8px 28px 28px;
}

.legal-content article {
  padding-top: 18px;
}

.legal-content h2 {
  margin: 0 0 8px;
  font-size: 16px;
}

.legal-content p {
  margin: 8px 0 0;
  color: #344052;
  line-height: 1.7;
}

@media (max-width: 1100px) {
  .dashboard-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-stack {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .desktop-app {
    padding: 0;
  }

  .desktop-shell {
    grid-template-columns: 1fr;
    min-height: 100vh;
    border: 0;
  }

  .sidebar {
    display: none;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .content {
    padding: 14px;
  }

  .login {
    margin: 8vh 14px;
  }

  .legal-app {
    padding: 0;
  }

  .legal-page {
    min-height: 100vh;
    border: 0;
    border-radius: 0;
  }

  .legal-head,
  .legal-content {
    padding-left: 18px;
    padding-right: 18px;
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .mobile-wrap {
    max-width: none;
    min-height: 100vh;
    padding: 0;
    border-radius: 0;
  }

  .mobile-shell {
    min-height: 100vh;
    border-radius: 0;
    border: 0;
  }

  .assistant-form,
  .assistant-composer,
  .assistant-input-area,
  .assistant-layout,
  .prompt-row,
  .form-grid {
    align-items: stretch;
    display: flex;
    flex-direction: column;
  }

  .assistant-thread {
    min-height: 220px;
    max-height: 420px;
  }

  .mobile-app .assistant-simple {
    display: flex;
    flex-direction: column;
    padding: 0;
  }

  .mobile-app .assistant-composer {
    position: sticky;
    top: 0;
    z-index: 2;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 10px;
  }

  .mobile-app .assistant-current-result {
    max-height: 52vh;
    overflow: auto;
    padding-right: 2px;
  }

  th,
  td {
    padding: 10px;
  }
}
