:root {
  color-scheme: light;
  --bg: #fff;
  --surface: #fff;
  --surface-muted: #fafafa;
  --surface-hover: #f4f4f5;
  --sidebar: #f8f8fa;
  --text: #18181b;
  --muted: #52525b;
  --border: #e4e4e7;
  --border-strong: #d4d4d8;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --success: #16834b;
  --danger: #b33434;
  font: 13px/1.5 -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
}
* { box-sizing: border-box; }
body, h1, h2, p { margin: 0; }
body { min-height: 100dvh; background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased; }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; }
button:disabled { opacity: .5; cursor: default; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.skip { position: fixed; left: 16px; top: -100px; z-index: 20; background: var(--surface); padding: 10px; }
.skip:focus { top: 12px; }
.app-shell { min-height: 100dvh; }
.app-shell.signed-in { display: grid; grid-template-columns: 214px minmax(0,1fr); }
.sidebar {
  position: sticky; top: 0; height: 100dvh; display: flex; flex-direction: column;
  background: var(--sidebar); border-right: 1px solid var(--border); padding: 18px 10px 12px;
}
.brand { padding: 0 11px; margin-bottom: 21px; font-size: 15px; font-weight: 660; }
#nav { display: grid; gap: 2px; }
#nav a, .session-button { display: flex; align-items: center; min-height: 35px; border-radius: 6px; padding: 6px 11px; color: var(--muted); white-space: nowrap; }
#nav a:hover, .session-button:hover { color: var(--text); background: var(--surface-hover); }
#nav a[aria-current] { color: var(--text); background: #eeeeef; font-weight: 650; }
#session-action { margin-top: auto; }
.session-button { border: 0; background: transparent; width: 100%; text-align: left; }
.main-column { min-width: 0; }
.topbar {
  height: 58px; display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: 0 24px; border-bottom: 1px solid var(--border);
}
.topbar h1 { font-size: 16px; font-weight: 650; }
#page-actions { display: flex; align-items: center; gap: 10px; }
.shell { width: min(100%,1260px); padding: 22px 24px 54px; }
.overview-grid { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 14px; margin-bottom: 19px; }
.card { border: 1px solid var(--border); background: var(--surface); border-radius: 6px; padding: 14px 16px; min-width: 0; }
.card h2, .section-head h2 { font-size: 14px; font-weight: 650; }
.card-head, .section-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.card-head { margin: 0 0 8px; }
.section-head { min-height: 46px; padding: 8px 14px; }
.section-panel { border: 1px solid var(--border); border-radius: 6px; background: var(--surface); overflow: hidden; margin-bottom: 15px; }
.section-panel .table-wrap { border: 0; border-radius: 0; border-top: 1px solid var(--border); }
.account-preview strong, .account-preview small { display: block; overflow-wrap: anywhere; }
.small, .account-preview small { font-size: 12px; color: var(--muted); }
.currency, .stat { font-variant-numeric: tabular-nums; font-weight: 660; font-size: 23px; line-height: 1.25; letter-spacing: -.025em; }
.status { color: var(--muted); white-space: nowrap; }
.status[data-state="ready"], .status[data-state="complete"], .status[data-state="paid"] { color: var(--success); }
.status[data-state="blocked"], .status[data-state="expired"], .status[data-state="review"], .status[data-state="failed"] { color: var(--danger); }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 33px; border: 1px solid transparent; border-radius: 5px; background: var(--accent); color: #fff; padding: 5px 11px; font-weight: 600; white-space: nowrap; }
.button:hover { background: var(--accent-hover); }
.button.secondary { border-color: var(--border); background: var(--surface); color: var(--text); }
.button.secondary:hover { background: var(--surface-hover); }
.text-action { color: var(--accent); font: inherit; font-weight: 560; background: none; border: 0; padding: 0; text-align: left; white-space: nowrap; }
.text-action:hover { text-decoration: underline; text-underline-offset: 3px; }
.table-wrap { border: 1px solid var(--border); border-radius: 6px; overflow-x: auto; background: var(--surface); }
table { border-collapse: collapse; width: 100%; text-align: left; }
thead { background: var(--surface-muted); color: var(--muted); }
th, td { padding: 9px 13px; border-bottom: 1px solid var(--border); text-align: left; }
th { font-size: 12px; font-weight: 540; white-space: nowrap; }
td { min-width: 80px; }
tr:last-child td { border-bottom: 0; }
td small { color: var(--muted); display: block; font-size: 12px; }
td .text-action + .text-action { margin-left: 12px; }
.empty, .loading { color: var(--muted); padding: 16px 14px; }
.wallet-card { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.auth { width: min(360px,100%); margin: min(15vh,110px) auto 20px; padding: 24px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); }
.auth h1 { margin-bottom: 17px; font-size: 18px; font-weight: 650; }
.auth-actions { display: flex; gap: 14px; margin-top: 15px; }
.registration-code { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: end; gap: 8px; }
.registration-code .button { min-height: 36px; }
#job-preview { display: block; width: 100%; height: auto; margin-top: 12px; border: 1px solid var(--border); border-radius: 5px; }
.verify-email { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.verify-email p { margin-top: 3px; overflow-wrap: anywhere; }
form { display: grid; gap: 12px; }
form > .button { justify-self: start; }
label { display: grid; gap: 4px; font-weight: 550; }
input, select { width: 100%; min-height: 36px; border: 1px solid var(--border-strong); border-radius: 5px; background: var(--surface); color: var(--text); padding: 6px 9px; }
dialog { width: min(410px,calc(100% - 28px)); padding: 19px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); box-shadow: 0 16px 42px #1113; }
dialog::backdrop { background: #1117; }
.dialog-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 15px; }
.dialog-heading h2 { font-size: 16px; }
.close { border: 0; background: transparent; color: var(--muted); padding: 0 5px; font-size: 23px; line-height: 1; }
.dialog-amount { display: flex; justify-content: space-between; border-top: 1px solid var(--border); padding-top: 9px; }
dialog:has([data-form="order"]) { width: min(544px,calc(100% - 28px)); max-height: calc(100dvh - 28px); }
dialog[open]:has([data-form="order"]) { display: flex; flex-direction: column; overflow: hidden; }
dialog:has([data-form="order"]) .dialog-heading { flex: none; }
dialog:has([data-form="order"]) #modal-body { display: flex; min-height: 0; }
[data-form="order"] { flex: 1; min-height: 0; grid-template-rows: minmax(0,1fr) auto; gap: 0; }
.order-body { min-height: 0; overflow-y: auto; display: grid; align-content: start; gap: 12px; padding: 4px 4px 12px; }
.order-footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 4px 0; border-top: 1px solid var(--border); }
.order-footer .form-error { flex-basis: 100%; }
.order-footer .dialog-amount { border: 0; padding: 0; gap: 8px; }
.task-preset { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 6px; }
.task-preset span { color: var(--muted); font-variant-numeric: tabular-nums; }
.task-preset-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.task-preset-status { flex-basis: 100%; }
.task-toolbar { display: flex; justify-content: flex-end; align-items: center; gap: 14px; margin: 8px 0; }
.task-group { border-top: 1px solid var(--border); }
.task-group > summary { cursor: pointer; font-weight: 600; padding: 10px 4px; }
.task-row { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: start; border-top: 1px solid var(--border); padding: 6px 4px; }
.task-choice, .task-switch { display: flex; align-items: center; min-height: 28px; gap: 8px; font-weight: 400; cursor: pointer; }
.task-row input[type="checkbox"] { padding: 0; width: 15px; min-height: 0; height: 15px; margin: 0; accent-color: var(--accent); flex: none; }
.task-edit { min-width: 0; padding-top: 4px; }
.task-edit summary { text-align: right; color: var(--accent); cursor: pointer; white-space: nowrap; }
.task-edit[open] { grid-column: 1 / -1; padding: 2px 0 5px 23px; }
.task-edit[open] > summary { text-align: left; margin-bottom: 6px; }
.task-options { display: grid; gap: 8px; }
.task-option > label:not(.task-switch) { grid-template-columns: minmax(70px,1fr) minmax(0,1.3fr); align-items: center; }
.task-option select, .task-option input:not([type="checkbox"]) { min-height: 32px; min-width: 0; }
.task-option fieldset { margin: 0; min-width: 0; border: 1px solid var(--border); border-radius: 5px; }
.task-option fieldset legend { padding: 0 4px; }
.task-switch { flex-direction: row-reverse; justify-content: flex-end; }
.managed-tasks { padding: 0 0 0 18px; margin: 0; }
.managed-tasks li { padding: 4px 0; }
.managed-tasks small { display: block; color: var(--muted); }
.order-options summary, .order-execution summary { cursor: pointer; }
.order-options summary { font-weight: 600; }
.order-options .task-edit summary { font-weight: 500; }
.task-edit p { margin-bottom: 6px; }
.order-execution summary { color: var(--accent); }
.order-execution ul { padding-left: 18px; margin: 5px 0; }
.qr { display: grid; gap: 10px; justify-items: center; text-align: center; }
.qr img { width: min(235px,100%); aspect-ratio: 1; object-fit: contain; background: #fff; padding: 6px; }
.form-error { color: var(--danger); }
#feedback { position: fixed; z-index: 30; inset: auto 16px 16px auto; color: #fff; background: #27272a; padding: 9px 12px; border-radius: 6px; max-width: calc(100vw - 32px); }
@media (max-width: 760px) {
  .app-shell.signed-in { display: block; }
  .sidebar { position: static; height: auto; padding: 0 14px; border-right: 0; border-bottom: 1px solid var(--border); display: grid; grid-template-columns: 1fr auto; align-items: center; }
  .brand { margin: 0; padding: 12px 0; }
  #session-action { grid-column: 2; grid-row: 1; margin: 0; }
  #nav { grid-row: 2; grid-column: 1 / -1; grid-template-columns: repeat(4,1fr); margin-bottom: 4px; }
  #nav a { justify-content: center; padding: 6px; }
  .topbar { height: 49px; padding: 0 14px; }
  .shell { padding: 14px 12px 34px; }
  .overview-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .overview-grid > :first-child { grid-column: span 2; }
  .card { padding: 12px; }
  .topbar .small { display: none; }
  .order-table, .order-table tbody { display: block; }
  .order-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .order-table tr { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 0 9px; padding: 8px 12px; }
  .order-table tr + tr { border-top: 1px solid var(--border); }
  .order-table td { min-width: 0; border: 0; padding: 2px 0; overflow-wrap: anywhere; }
  .order-table td:nth-child(2) { grid-area: 2 / 1; }
  .order-table td:nth-child(3) { grid-area: 1 / 2; text-align: right; }
  .order-table td:nth-child(4) { grid-area: 2 / 2; text-align: right; color: var(--muted); font-size: 12px; }
  .order-table td:last-child { grid-column: 1 / -1; }
}
