:root {
  --bg: #f4f6f8;
  --surface: #ffffff;
  --line: #e2e7ec;
  --text: #17202a;
  --muted: #697582;
  --primary: #1667d9;
  --primary-soft: #eaf2ff;
  --green: #16865b;
  --green-soft: #e9f8f1;
  --amber: #986515;
  --amber-soft: #fff6df;
  --danger: #c93e4f;
  --sidebar: 248px;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: "Segoe UI", "Microsoft YaHei", system-ui, sans-serif; letter-spacing: 0; }
button, input, select, textarea { font: inherit; }
button { color: inherit; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: var(--sidebar); background: #111820; color: #dce3ea; padding: 24px 18px; display: flex; flex-direction: column; z-index: 20; }
.brand { display: flex; align-items: center; gap: 12px; padding: 4px 10px 30px; color: white; text-decoration: none; font-size: 19px; font-weight: 700; }
.brand-mark { width: 34px; height: 34px; display: grid; place-items: center; background: white; color: #111820; font-size: 17px; font-weight: 800; }
.nav { display: grid; gap: 6px; }
.nav-item { width: 100%; height: 44px; border: 0; border-radius: 6px; background: transparent; color: #96a2ae; display: flex; align-items: center; gap: 12px; padding: 0 13px; cursor: pointer; text-align: left; }
.nav-count { margin-left: auto; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--primary); color: white; display: grid; place-items: center; font-size: 9px; }
.nav-item svg { width: 19px; }
.nav-item:hover { background: #19232d; color: white; }
.nav-item.active { background: #223246; color: white; }
.sidebar-foot { margin-top: auto; display: grid; gap: 14px; }
.mini-balance { padding: 14px; border: 1px solid #2a3642; border-radius: 6px; display: flex; align-items: end; justify-content: space-between; }
.mini-balance.dual { align-items: stretch; gap: 12px; }
.mini-balance.dual > span { flex: 1; display: grid; gap: 5px; }
.mini-balance.dual > span + span { border-left: 1px solid #2a3642; padding-left: 12px; }
.mini-balance small { font-size: 9px; color: #8d9aa7; }
.mini-balance strong { color: white; font-size: 20px; }
.mini-balance em { color: #73808d; font-size: 8px; font-style: normal; white-space: nowrap; }
.user-switch { border: 0; background: transparent; padding: 8px 5px; display: grid; grid-template-columns: 36px 1fr 18px; gap: 10px; align-items: center; color: white; cursor: pointer; text-align: left; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: #dbe9ff; color: #1459b5; display: grid; place-items: center; font-weight: 700; font-size: 12px; }
.avatar.gray { background: #e7e9ec; color: #616a74; }
.user-copy { min-width: 0; display: grid; gap: 3px; }
.user-copy strong { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-copy small { color: #8d9aa7; font-size: 11px; }
.user-switch svg { width: 16px; color: #7c8996; }
.main { margin-left: var(--sidebar); min-height: 100vh; padding: 0 42px 50px; }
.topbar { height: 110px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.eyebrow { margin: 0 0 8px; color: var(--primary); font-size: 10px; font-weight: 700; letter-spacing: 0; }
h1 { margin: 0; font-size: 25px; line-height: 1; }
.top-actions { display: flex; align-items: center; gap: 10px; }
.icon-button, .filter-button { height: 40px; border: 1px solid var(--line); background: var(--surface); border-radius: 6px; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px; }
.icon-button { width: 40px; position: relative; }
.icon-button svg, .filter-button svg { width: 17px; }
.notification-dot { position: absolute; right: 9px; top: 8px; width: 6px; height: 6px; background: var(--danger); border: 2px solid white; border-radius: 50%; }
.primary-button { height: 40px; border: 0; border-radius: 6px; padding: 0 17px; background: var(--primary); color: white; display: flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 600; }
.primary-button:hover { background: #0e58be; }
.primary-button:disabled { background: #aab4bf; cursor: not-allowed; }
.primary-button svg { width: 17px; }
.view { display: none; padding-top: 28px; }
.view.active { display: block; }
.status-band { min-height: 84px; background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--green); border-radius: 6px; padding: 18px 20px; display: grid; grid-template-columns: 40px 1fr auto; align-items: center; gap: 15px; }
.status-band.readonly { border-left-color: var(--amber); }
.status-icon { width: 40px; height: 40px; border-radius: 50%; background: var(--green-soft); color: var(--green); display: grid; place-items: center; }
.readonly .status-icon { background: var(--amber-soft); color: var(--amber); }
.status-icon svg { width: 20px; }
.status-copy { display: grid; gap: 5px; }
.status-copy span { color: var(--muted); font-size: 12px; }
.status-copy strong { font-size: 14px; }
.credit-pill { min-width: 112px; border-left: 1px solid var(--line); padding-left: 20px; display: grid; gap: 3px; }
.credit-pill span { font-size: 11px; color: var(--muted); }
.credit-pill strong { font-size: 21px; }
.local-notice, .verification-note { margin-top: 12px; min-height: 42px; padding: 10px 13px; border: 1px solid #cfe0f5; border-radius: 5px; background: #f1f7ff; color: #45627f; display: flex; align-items: center; gap: 9px; font-size: 10px; line-height: 1.5; }
.local-notice svg, .verification-note svg { width: 16px; flex: 0 0 auto; color: var(--primary); }
.local-notice strong { color: #174f96; margin-right: 4px; }
.verification-note { margin: -9px 0 14px; border-color: #eadfbf; background: #fffaf0; color: #735d28; }
.verification-note svg { color: #a17312; }
.toolbar { margin: 26px 0 16px; display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.tabs { display: flex; gap: 4px; }
.tab { height: 36px; padding: 0 13px; border: 0; border-radius: 5px; background: transparent; color: var(--muted); cursor: pointer; }
.tab span { margin-left: 5px; color: #9aa5af; font-size: 11px; }
.tab.active { background: var(--surface); color: var(--text); box-shadow: 0 0 0 1px var(--line); }
.toolbar-right { display: flex; gap: 8px; }
.search { width: min(280px, 30vw); height: 40px; display: flex; align-items: center; gap: 8px; padding: 0 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; }
.search svg { width: 16px; color: #88939e; }
.search input { width: 100%; border: 0; outline: 0; background: transparent; font-size: 12px; }
.filter-button { padding: 0 13px; font-size: 12px; flex-shrink: 0; white-space: nowrap; }
.task-list { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.task-item { display: grid; grid-template-columns: 48px minmax(0, 1fr) 150px 124px; align-items: center; gap: 16px; min-height: 112px; padding: 17px 20px; border-bottom: 1px solid var(--line); }
.task-item:last-child { border-bottom: 0; }
.task-item:hover { background: #fbfcfd; }
.task-avatar { width: 44px; height: 44px; border-radius: 50%; background: #edf1f5; display: grid; place-items: center; color: #53606d; font-weight: 700; }
.task-main { min-width: 0; }
.task-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; font-size: 12px; color: var(--muted); margin-bottom: 7px; }
.verified { width: 14px; height: 14px; color: var(--primary); flex-shrink: 0; }
.task-text { margin: 0; font-size: 14px; line-height: 1.65; overflow-wrap: anywhere; }
.task-type { justify-self: start; display: inline-flex; align-items: center; gap: 7px; padding: 7px 9px; border-radius: 4px; background: #f1f4f7; font-size: 11px; }
.task-type svg { width: 15px; }
.task-type.comment { background: var(--primary-soft); color: #165ebc; }
.task-action { justify-self: stretch; height: 36px; border: 1px solid var(--primary); border-radius: 5px; background: white; color: var(--primary); cursor: pointer; font-size: 12px; font-weight: 600; }
.task-action:hover { background: var(--primary-soft); }
.task-action:disabled { border-color: var(--line); color: #98a3ae; cursor: not-allowed; background: #f5f7f9; }
.task-actions { min-width: 0; display: grid; gap: 6px; }
.task-actions .task-action { width: 100%; }
.open-post { min-height: 28px; color: #536b83; text-decoration: none; display: flex; align-items: center; justify-content: center; gap: 5px; font-size: 10px; }
.open-post:hover { color: var(--primary); }
.open-post svg { width: 13px; }
.reservation-actions { grid-template-columns: 1fr; }
.demo-verify { min-height: 31px; padding: 5px 8px; border: 1px solid var(--line); border-radius: 5px; background: white; cursor: pointer; font-size: 10px; }
.demo-verify.pass { border-color: #8bbce9; color: #155aa3; background: #f2f8ff; }
.demo-verify.fail { color: var(--danger); }
.task-side { display: grid; justify-items: start; gap: 8px; }
.seat-status { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 10px; }
.seat-status svg { width: 13px; }
.seat-status.low { color: var(--danger); }
.task-item.incompatible { background: #fafbfc; }
.task-item.incompatible .task-main, .task-item.incompatible .task-avatar { opacity: .58; }
.reservation-summary { display: flex; gap: 8px; }
.reservation-summary span { height: 32px; padding: 0 10px; border: 1px solid var(--line); border-radius: 5px; background: white; color: var(--muted); display: flex; align-items: center; gap: 6px; font-size: 10px; }
.reservation-summary svg { width: 14px; }
.reservation-item { grid-template-columns: 48px minmax(0, 1fr) 160px 124px; }
.countdown { display: grid; gap: 5px; }
.countdown span { color: var(--muted); font-size: 10px; }
.countdown strong { color: var(--primary); font-size: 18px; font-variant-numeric: tabular-nums; }
.countdown.expiring strong { color: var(--danger); }
.countdown.retention strong { font-size: 12px; color: var(--amber); }
.completed-mark { color: var(--green); font-size: 12px; font-weight: 600; }
.completed-mark.rejected, .completed-mark.expired { color: var(--danger); }
.completed-mark.appealed { color: var(--amber); }
.appeal-button { min-height: 31px; border: 1px solid #d5b66b; border-radius: 5px; background: #fffaf0; color: #7d5c14; cursor: pointer; font-size: 10px; }
.appeal-status { color: var(--amber); font-size: 9px; text-align: center; }
.empty-state { padding: 70px 20px; text-align: center; color: var(--muted); }
.error-state { color: var(--danger); }
.section-intro { display: flex; align-items: end; justify-content: space-between; margin-bottom: 22px; }
.section-intro h2 { margin: 0 0 7px; font-size: 20px; }
.section-intro p { margin: 0; color: var(--muted); font-size: 12px; }
.balance-box { text-align: right; display: grid; gap: 3px; }
.balance-box span { font-size: 11px; color: var(--muted); }
.balance-box strong { font-size: 24px; }
.dual-balance { display: flex; gap: 22px; }
.dual-balance > span { display: grid; gap: 3px; }
.dual-balance > span + span { padding-left: 22px; border-left: 1px solid var(--line); }
.dual-balance small { font-size: 10px; color: var(--muted); }
.publish-form { max-width: 850px; padding: 0; }
.form-row { display: grid; gap: 9px; }
.form-row.full { margin-bottom: 24px; }
.form-row label, legend { font-size: 12px; font-weight: 600; }
.input-wrap { height: 44px; border: 1px solid var(--line); border-radius: 5px; display: flex; align-items: center; padding: 0 13px; gap: 9px; }
.input-wrap:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.input-wrap svg { width: 17px; color: var(--muted); }
.input-wrap input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; }
.field-hint { color: var(--muted); font-size: 10px; line-height: 1.5; }
fieldset { margin: 0 0 24px; padding: 0; border: 0; }
legend { margin-bottom: 10px; }
.type-options { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.type-option { height: 70px; border: 1px solid var(--line); border-radius: 6px; padding: 0 16px; display: flex; align-items: center; gap: 12px; cursor: pointer; }
.type-option.active { border-color: var(--primary); background: var(--primary-soft); }
.type-option input { position: absolute; opacity: 0; }
.type-option > svg { width: 20px; color: var(--primary); }
.type-option span { display: grid; gap: 4px; }
.type-option strong { font-size: 13px; }
.type-option small { color: var(--muted); font-size: 11px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.stepper { height: 42px; border: 1px solid var(--line); border-radius: 5px; display: grid; grid-template-columns: 42px 1fr 42px; }
.stepper button { border: 0; background: #f5f7f9; cursor: pointer; font-size: 18px; }
.stepper input { min-width: 0; border: 0; text-align: center; outline: 0; }
select { height: 42px; border: 1px solid var(--line); border-radius: 5px; background: white; padding: 0 11px; }
.comment-config { border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.comment-config-head { height: 43px; padding: 0 15px; background: #f7f8fa; display: flex; align-items: center; justify-content: space-between; }
.comment-config-head span { font-size: 12px; font-weight: 600; }
.comment-config-head small { color: var(--muted); font-size: 10px; }
.tier-picker { min-height: 64px; padding: 10px 15px; border-top: 1px solid var(--line); display: grid; grid-template-columns: 1fr 120px 54px; gap: 18px; align-items: center; }
.tier-picker > div:first-child { display: grid; gap: 4px; }
.tier-picker strong { font-size: 12px; }
.tier-picker small { font-size: 10px; color: var(--muted); }
.tier-picker > b { justify-self: end; font-size: 13px; }
.tier-picker > b::after { content: ' 分'; color: var(--muted); font-size: 9px; font-weight: 400; }
.mini-stepper { height: 32px; border: 1px solid var(--line); border-radius: 4px; display: grid; grid-template-columns: 32px 1fr 32px; }
.mini-stepper button { border: 0; background: #f5f7f9; cursor: pointer; }
.mini-stepper input { width: 100%; min-width: 0; border: 0; text-align: center; outline: 0; }
.comment-duration { padding: 14px 15px; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; }
.comment-duration label { font-size: 11px; font-weight: 600; }
.comment-duration select { width: 180px; }
.comment-requirements { padding: 15px; border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; background: #fbfcfd; }
.comment-requirements label, .comment-expectation { display: grid; gap: 7px; }
.comment-requirements span { color: var(--muted); font-size: 10px; }
.comment-requirements select { width: 100%; height: 36px; font-size: 11px; }
.comment-expectation strong { min-height: 36px; display: flex; align-items: center; padding: 0 11px; border: 1px solid var(--line); background: var(--surface); font-size: 11px; font-weight: 600; }
.hidden { display: none !important; }
.cost-summary { margin-top: 26px; padding-top: 20px; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; }
.cost-summary > div { display: grid; gap: 4px; }
.cost-summary span { color: var(--muted); font-size: 11px; }
.cost-summary strong { font-size: 14px; }
.cost-summary b { font-size: 24px; }
.ledger { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.ledger-row { display: grid; grid-template-columns: 44px minmax(0, 1fr) 140px; gap: 14px; align-items: center; min-height: 72px; padding: 12px 18px; border-bottom: 1px solid var(--line); }
.ledger-row:last-child { border: 0; }
.ledger-icon { width: 34px; height: 34px; border-radius: 50%; background: var(--green-soft); color: var(--green); display: grid; place-items: center; }
.ledger-icon.spend { background: #f2f4f6; color: #68737d; }
.ledger-icon svg { width: 16px; }
.ledger-copy { display: grid; gap: 4px; }
.ledger-copy strong { font-size: 12px; }
.ledger-copy small, .ledger-time { font-size: 11px; color: var(--muted); }
.ledger-points { justify-self: end; color: var(--green); font-weight: 700; }
.ledger-points.spend { color: var(--text); }
.ledger-points small { display: block; margin-top: 3px; color: var(--muted); font-size: 8px; font-weight: 400; text-align: right; }
.published-list { display: grid; gap: 14px; }
.published-empty { border: 1px solid var(--line); border-radius: 6px; background: white; }
.published-card { border: 1px solid var(--line); border-radius: 6px; background: white; padding: 20px; }
.published-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.published-head > div { display: flex; align-items: center; gap: 8px; }
.published-card > p { margin: 14px 0 10px; font-size: 13px; line-height: 1.55; }
.publish-status { display: inline-flex; padding: 5px 7px; border-radius: 4px; background: #f0f2f4; color: var(--muted); font-size: 9px; }
.publish-status.open { background: var(--green-soft); color: var(--green); }
.publish-status.cancelled { background: #fff0f2; color: var(--danger); }
.publish-status.completed { background: var(--primary-soft); color: var(--primary); }
.published-actions { justify-content: flex-end; }
.published-actions button { height: 31px; border: 1px solid #efb7be; border-radius: 5px; background: #fff7f8; color: var(--danger); cursor: pointer; font-size: 10px; padding: 0 10px; }
.ownership-check { display: flex; align-items: center; gap: 6px; color: var(--amber); font-size: 10px; }
.ownership-check svg { width: 14px; }
.allocation-list { margin-top: 15px; border: 1px solid var(--line); border-radius: 5px; overflow: hidden; }
.allocation-row { min-height: 42px; padding: 8px 12px; display: grid; grid-template-columns: minmax(130px, 1.2fr) repeat(3, 1fr); gap: 10px; align-items: center; border-bottom: 1px solid var(--line); font-size: 10px; }
.allocation-row:last-child { border: 0; }
.allocation-row span { color: var(--muted); }
.allocation-row span:first-child { color: var(--text); font-weight: 600; }
.allocation-row strong { justify-self: end; color: var(--primary); }
.published-summary { margin-top: 13px; display: flex; flex-wrap: wrap; gap: 18px; color: var(--muted); font-size: 10px; }
.published-summary strong { margin-left: 3px; color: var(--text); }
.admin-intro { align-items: center; }
.admin-search { width: 310px; }
.admin-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.admin-stats > div { min-height: 82px; padding: 16px; border: 1px solid var(--line); border-radius: 6px; background: white; display: grid; align-content: center; gap: 7px; }
.admin-stats small { color: var(--muted); font-size: 10px; }
.admin-stats strong { font-size: 23px; }
.admin-tabs { margin-top: 18px; display: flex; gap: 5px; border-bottom: 1px solid var(--line); }
.admin-tabs button { min-height: 40px; padding: 0 13px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--muted); cursor: pointer; font-size: 11px; }
.admin-tabs button.active { border-bottom-color: var(--primary); color: var(--primary); font-weight: 600; }
.admin-panel { background: white; border: 1px solid var(--line); border-top: 0; border-radius: 0 0 6px 6px; overflow: hidden; }
.admin-row { min-height: 76px; padding: 12px 15px; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: minmax(220px, 1fr) 90px 75px 210px; gap: 12px; align-items: center; font-size: 10px; }
.admin-row:last-child { border: 0; }
.admin-row > div:first-child { min-width: 0; display: grid; gap: 4px; }
.admin-row strong { font-size: 11px; }
.admin-row small, .admin-row em { color: var(--muted); font-size: 9px; font-style: normal; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.admin-state { justify-self: start; padding: 5px 7px; border-radius: 4px; background: #f1f3f5; color: var(--muted); font-size: 9px; }
.admin-state.active, .admin-state.open, .admin-state.approved { background: var(--green-soft); color: var(--green); }
.admin-state.restricted, .admin-state.frozen, .admin-state.rejected { background: #fff0f2; color: var(--danger); }
.admin-user { display: flex !important; align-items: center; gap: 9px; }
.admin-user > span:last-child { min-width: 0; display: grid; gap: 4px; }
.wallet-inline { display: flex; gap: 7px; color: var(--muted); }
.admin-actions { display: flex; justify-content: flex-end; gap: 6px; }
.admin-actions button { min-height: 31px; padding: 0 9px; border: 1px solid var(--line); border-radius: 5px; background: white; cursor: pointer; font-size: 9px; }
.admin-actions button.approve { border-color: #96d0b7; background: var(--green-soft); color: var(--green); }
.admin-actions button.danger { border-color: #efb7be; background: #fff7f8; color: var(--danger); }
.resolution { white-space: normal !important; }
.audit-row { grid-template-columns: minmax(220px, 1fr) 120px 100px 130px; }
.audit-row time { color: var(--muted); }
.gate-rule { background: #16202a; color: white; min-height: 102px; border-radius: 6px; padding: 22px 25px; display: flex; justify-content: space-between; align-items: center; gap: 30px; }
.gate-rule > div { display: flex; align-items: center; gap: 13px; }
.gate-rule svg { width: 25px; color: #69a7ff; }
.gate-rule span { display: grid; gap: 5px; }
.gate-rule strong { font-size: 14px; }
.gate-rule small { color: #aab6c1; }
.gate-rule p { max-width: 540px; color: #b8c1ca; font-size: 12px; line-height: 1.6; }
.tier-table-wrap { margin-top: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; overflow-x: auto; }
.tier-table { width: 100%; min-width: 700px; border-collapse: collapse; text-align: left; }
.tier-table th { height: 48px; padding: 0 18px; background: #f7f8fa; color: var(--muted); font-size: 11px; font-weight: 600; }
.tier-table td { height: 59px; padding: 0 18px; border-top: 1px solid var(--line); font-size: 12px; }
.tier-table tr.current { background: var(--primary-soft); }
.tier-table tr.readonly { color: #89939d; }
.tag { display: inline-flex; padding: 5px 8px; background: var(--green-soft); color: var(--green); border-radius: 4px; font-size: 10px; }
.tag.muted { background: #f0f2f4; color: #7d8791; }
.tag.current-tag { background: var(--primary); color: white; }
.toast { position: fixed; right: 28px; bottom: 28px; min-width: 260px; min-height: 48px; background: #14221c; color: white; border-radius: 6px; padding: 12px 16px; display: flex; align-items: center; gap: 10px; transform: translateY(90px); opacity: 0; transition: .25s ease; z-index: 50; font-size: 12px; }
.toast.show { transform: translateY(0); opacity: 1; }
.toast svg { width: 18px; color: #55d39b; }
.toast.danger { background: #3a1c22; }
.toast.danger svg { color: #ff8f9d; }
.user-popover { position: fixed; right: 42px; top: 85px; width: min(300px, calc(100vw - 28px)); max-height: min(620px, calc(100dvh - 130px)); overflow-y: auto; padding: 8px; border: 1px solid var(--line); border-radius: 6px; background: white; box-shadow: 0 15px 35px rgba(20,30,40,.18); z-index: 40; }
.user-popover p { margin: 7px 8px 6px; color: var(--muted); font-size: 10px; }
.user-popover button { width: 100%; border: 0; background: transparent; border-radius: 5px; padding: 8px; display: grid; grid-template-columns: 36px 1fr 16px; gap: 9px; align-items: center; cursor: pointer; text-align: left; }
.user-popover button:hover { background: #f3f6f8; }
.user-popover button > span:nth-child(2) { display: grid; gap: 3px; }
.user-popover strong { font-size: 11px; }
.user-popover small { font-size: 9px; color: var(--muted); }
.user-popover svg { width: 15px; color: var(--primary); }
.modal-backdrop { position: fixed; inset: 0; z-index: 100; padding: 20px; background: rgba(12, 19, 27, .56); display: grid; place-items: center; }
.modal-panel { width: min(460px, 100%); max-height: min(720px, calc(100vh - 40px)); overflow-y: auto; border-radius: 7px; background: white; box-shadow: 0 24px 70px rgba(10, 20, 30, .3); }
.modal-head { min-height: 78px; padding: 18px 20px; border-bottom: 1px solid var(--line); display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.modal-head h2 { margin: 0 0 5px; font-size: 17px; }
.modal-head p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.modal-close { width: 32px; height: 32px; border: 0; border-radius: 5px; background: #f2f4f6; cursor: pointer; display: grid; place-items: center; }
.modal-close svg { width: 16px; }
.modal-fields { padding: 20px; display: grid; gap: 15px; }
.modal-field { display: grid; gap: 7px; }
.modal-field > span { font-size: 11px; font-weight: 600; }
.modal-field input, .modal-field select, .modal-field textarea { width: 100%; border: 1px solid var(--line); border-radius: 5px; background: white; outline: 0; font-size: 12px; }
.modal-field input, .modal-field select { height: 42px; padding: 0 11px; }
.modal-field textarea { min-height: 92px; padding: 10px 11px; resize: vertical; line-height: 1.5; }
.modal-field input:focus, .modal-field select:focus, .modal-field textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.modal-field small { color: var(--muted); font-size: 9px; line-height: 1.5; }
.modal-actions { padding: 14px 20px 18px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 9px; }
.modal-cancel { height: 40px; padding: 0 16px; border: 1px solid var(--line); border-radius: 6px; background: white; cursor: pointer; }
.modal-panel.danger .modal-actions .primary-button { background: var(--danger); }

button:disabled { cursor: not-allowed; opacity: .65; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; }
.modal-open { overflow: hidden; }
.account-button { height: 40px; display: flex; align-items: center; gap: 8px; padding: 0 12px; border: 1px solid var(--line); border-radius: 6px; background: white; cursor: pointer; font-size: 12px; min-width: 0; }
.account-button svg { width: 17px; flex-shrink: 0; }
.account-button span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.workspace-status { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; padding: 14px 0 0; font-size: 12px; color: var(--muted); }
.workspace-status > span:first-child { display: flex; align-items: center; gap: 7px; }
.workspace-status strong { font-weight: 500; }
.status-light { width: 7px; height: 7px; border-radius: 50%; background: var(--green); }
.status-light.offline { background: var(--danger); }
.connection-error { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; padding: 12px; background: #fff1f1; border-left: 3px solid var(--danger); color: #953a42; font-size: 13px; line-height: 1.6; }
.connection-error button { flex-shrink: 0; padding: 8px 10px; background: white; border: 1px solid #e3afb4; border-radius: 4px; cursor: pointer; }
.filter-panel { display: flex; flex-wrap: wrap; align-items: end; gap: 14px; padding: 0 0 16px; border-bottom: 1px solid var(--line); }
.filter-panel label, .list-toolbar > label { display: grid; gap: 7px; font-size: 12px; color: var(--muted); }
.filter-panel select { min-width: 130px; }
.checkbox-label { display: flex !important; align-items: center; gap: 7px; min-height: 40px; font-size: 12px; white-space: nowrap; }
input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--primary); }
.text-button { border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 12px; min-height: 32px; padding: 4px 8px; }
.text-button:hover { color: var(--primary); }
.result-count { margin: 12px 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.task-requirements { color: var(--muted); font-size: 12px; line-height: 1.6; margin: 7px 0 0; }
.task-type, .seat-status, .open-post { font-size: 12px; }
.task-action, .demo-verify, .appeal-button { font-size: 12px; }
.task-type { white-space: normal; line-height: 1.5; }
.task-type svg { flex-shrink: 0; }
.evidence-link { display: inline-block; margin-top: 7px; color: var(--primary); font-size: 12px; }
.list-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin: 16px 0; }
.list-toolbar > label { display: flex; align-items: center; }
.list-toolbar > span { color: var(--muted); font-size: 12px; }
.verification-note { flex-wrap: wrap; font-size: 12px; }
.verification-note > span { flex: 1; }
.published-deadline { margin: 8px 0 12px; color: var(--muted); font-size: 12px; }
.published-card p, .ledger-copy small { overflow-wrap: anywhere; }
.publish-form textarea { width: 100%; min-height: 100px; resize: vertical; border: 1px solid var(--line); border-radius: 5px; padding: 12px; font-size: 14px; line-height: 1.6; }
.input-wrap { background: white; }
.cost-summary #costKind { color: var(--text); font-size: 14px; }
#costHint { font-size: 12px; color: var(--muted); }
#costHint.invalid { color: var(--danger); }
.form-error { margin: 12px 0 0; padding: 10px 12px; color: #9b3040; background: #fff0f2; border-radius: 4px; font-size: 13px; line-height: 1.6; }
#appModalError { margin: 0 20px 16px; }
.wallet-summary { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.wallet-summary section { padding: 20px 22px 20px 0; }
.wallet-summary section + section { padding-left: 24px; border-left: 1px solid var(--line); }
.wallet-summary h3 { margin: 0 0 14px; font-size: 14px; }
.wallet-summary dl { display: grid; grid-template-columns: repeat(3, 1fr); margin: 0; gap: 12px; }
.wallet-summary dt { color: var(--muted); font-size: 12px; }
.wallet-summary dd { margin: 6px 0 0; font-size: 23px; font-weight: 600; font-variant-numeric: tabular-nums; }
.wallet-summary dd:first-letter { color: inherit; }
.ledger-copy strong, .admin-row strong, .user-popover strong { font-size: 13px; }
.admin-row small, .admin-row em, .admin-row, .admin-state, .admin-actions button, .admin-tabs button { font-size: 12px; }
.admin-row small, .admin-row em { white-space: normal; overflow-wrap: anywhere; line-height: 1.6; }
.modal-head p, .modal-field > span, .modal-field small, .field-hint, .local-notice { font-size: 12px; }
.modal-head h2 { overflow-wrap: anywhere; }
.modal-close { flex-shrink: 0; }
.toast { max-width: calc(100vw - 28px); min-width: 0; line-height: 1.6; pointer-events: none; }

@media (max-width: 900px) {
  :root { --sidebar: 76px; }
  .sidebar { padding: 20px 12px; }
  .brand span:last-child, .nav-item span, .mini-balance, .user-copy, .user-switch > svg { display: none; }
  .brand { justify-content: center; padding-inline: 0; }
  .nav-item { justify-content: center; padding: 0; }
  .user-switch { display: flex; justify-content: center; }
  .main { padding-inline: 22px; }
  .task-item { grid-template-columns: 46px minmax(0,1fr) 150px; }
  .task-actions { grid-column: 2 / -1; display: flex; justify-content: flex-end; align-items: center; flex-wrap: wrap; gap: 12px; }
  .task-actions .task-action { width: auto; padding: 0 18px; }
  .user-popover { right: 22px; }
  .admin-row { grid-template-columns: minmax(0, 1fr) 90px; }
  .admin-actions { justify-content: flex-start; }
}

@media (max-width: 640px) {
  :root { --sidebar: 0px; }
  .sidebar { position: fixed; inset: auto 0 0; width: 100%; height: 66px; padding: 8px 12px; flex-direction: row; border-top: 1px solid #2a3642; }
  .brand, .sidebar-foot { display: none; }
  .nav { width: 100%; display: grid; grid-template-columns: repeat(7, 1fr); }
  .nav { gap: 2px; }
  .nav-item { height: 50px; flex-direction: column; gap: 4px; }
  .nav-item span { display: block; font-size: 10px; white-space: nowrap; }
  .nav-count { display: none; }
  .main { margin: 0; padding: 0 14px 88px; }
  .topbar { height: auto; min-height: 130px; padding: 18px 0; flex-direction: column; align-items: stretch; gap: 16px; }
  .top-actions { display: grid; grid-template-columns: minmax(0, 1fr) 40px auto; gap: 8px; }
  h1 { font-size: 21px; }
  .icon-button { display: flex; }
  .primary-button { padding-inline: 12px; }
  .status-band { grid-template-columns: 38px 1fr; }
  .credit-pill { grid-column: 2; border: 0; padding: 0; }
  .toolbar { align-items: stretch; flex-direction: column; }
  .toolbar-right { width: 100%; }
  .search { width: 100%; }
  .task-item { grid-template-columns: 42px 1fr; padding: 15px; gap: 10px; }
  .task-actions { grid-column: 2; width: 100%; display: flex; justify-content: flex-start; align-items: center; gap: 8px; }
  .task-actions .task-action { width: auto; padding: 0 12px; }
  .task-type { display: inline-flex; }
  .task-side, .countdown { grid-column: 2; }
  .reservation-summary { display: none; }
  .type-options, .form-grid { grid-template-columns: 1fr; }
  .comment-requirements { grid-template-columns: 1fr; }
  .tier-picker { grid-template-columns: minmax(0, 1fr) 104px 40px; gap: 8px; padding-inline: 10px; }
  .publish-form { padding: 0; }
  .cost-summary { align-items: flex-start; gap: 18px; flex-direction: column; }
  .ledger-row { grid-template-columns: 34px minmax(0, 1fr); padding: 12px; gap: 10px; }
  .ledger-time { display: block; grid-column: 2; }
  .gate-rule { align-items: flex-start; flex-direction: column; }
  .published-card { padding: 15px; }
  .published-head { align-items: flex-start; }
  .published-head > div:first-child { flex-wrap: wrap; }
  .published-actions { flex-direction: column; align-items: flex-end; }
  .allocation-row { grid-template-columns: 1fr 1fr; }
  .allocation-row strong { justify-self: start; }
  .admin-intro { align-items: stretch; flex-direction: column; gap: 14px; }
  .admin-search { width: 100%; }
  .admin-stats { grid-template-columns: repeat(2, 1fr); }
  .admin-tabs { overflow-x: auto; }
  .admin-tabs button { white-space: nowrap; }
  .admin-row, .audit-row { grid-template-columns: 1fr 90px; }
  .admin-row > .open-post { justify-content: flex-start; }
  .admin-actions { justify-content: flex-start; }
  .user-popover { right: 14px; top: 124px; max-height: calc(100dvh - 210px); }
  .section-intro { align-items: flex-start; flex-direction: column; gap: 16px; }
  .section-intro p { line-height: 1.6; }
  .wallet-summary { grid-template-columns: 1fr; }
  .wallet-summary section + section { border-left: 0; border-top: 1px solid var(--line); padding-left: 0; }
  .filter-panel { display: grid; grid-template-columns: 1fr 1fr; }
  .filter-panel select { width: 100%; min-width: 0; }
  .connection-error { align-items: flex-start; flex-direction: column; }
  .toast { right: 14px; bottom: 80px; }
  .tabs { width: 100%; gap: 2px; }
  .tab { padding-inline: 8px; font-size: 13px; }
  .modal-backdrop { padding: 12px; }
  .modal-panel { max-height: calc(100dvh - 24px); }
}
