:root {
  color-scheme: light;
  font-family: "Inter", "Segoe UI", "Microsoft YaHei UI", "PingFang SC", sans-serif;
  --canvas: #f2f4ef;
  --panel: #fff;
  --ink: #172720;
  --subtle: #64746b;
  --border: #dce4db;
  --forest: #152a23;
  --green: #245841;
  --lime: #d3f499;
  --mint: #e7f1e5;
  --red: #a13742;
  background: var(--canvas);
  color: var(--ink);
  font-synthesis: none;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-width: 320px; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .52; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid #6ab287;
  outline-offset: 2px;
}
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
input, select, textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid #cbd8ce;
  border-radius: 7px;
  padding: 9px 11px;
  background: #fff;
  color: var(--ink);
  line-height: 1.4;
}
input::placeholder, textarea::placeholder { color: #718077; }
input[type="checkbox"] { width: 15px; height: 15px; accent-color: var(--green); }
input[readonly] { background: var(--canvas); }
textarea { resize: vertical; }
label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
}
fieldset { min-width: 0; padding: 0; border: 0; margin: 0; }
legend { font-size: 13px; font-weight: 600; margin-bottom: 8px; }
h1, h2, p { margin: 0; }
button { color: inherit; }
[hidden] { display: none !important; }
.quiet-text { color: var(--subtle); font-size: 13px; }
.left-text { text-align: left; }
.mono, .numeric { font-variant-numeric: tabular-nums; }
.mono { font-family: "Cascadia Mono", Consolas, monospace; }
.numeric { white-space: nowrap; }
.negative-text { color: var(--red); }
.positive-text { color: #146449; }
.form-error { color: var(--red); font-size: 13px; line-height: 1.5; }
.primary, .quiet, .pill-button, .icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border-radius: 7px;
  font-weight: 650;
  min-height: 39px;
  padding: 8px 13px;
  line-height: 1.3;
  flex-shrink: 0;
}
.primary { color: #fff; background: var(--green); border: 1px solid var(--green); }
.primary:hover:not(:disabled) { background: #1b4432; }
.quiet, .pill-button, .icon-button { background: #fff; border: 1px solid var(--border); color: #2b4537; }
.quiet:hover:not(:disabled), .pill-button:hover:not(:disabled), .icon-button:hover:not(:disabled) { background: var(--mint); }
.text-button { padding: 2px 0; border: 0; background: none; color: var(--green); font-size: inherit; font-weight: 650; }
.text-button:hover { text-decoration: underline; text-underline-offset: 3px; }
.initial-status { color: var(--subtle); padding: 2rem; }

.brand-mark {
  display: flex;
  align-items: end;
  justify-content: center;
  gap: 3px;
  width: 34px;
  height: 34px;
  padding: 8px 8px 9px;
  border-radius: 9px;
  background: var(--lime);
  box-shadow: inset 0 0 0 1px #cbe98f;
}
.brand-mark i { display: block; flex: 1; min-width: 3px; border-radius: 3px; background: #213b2a; }
.brand-mark i:nth-child(1) { height: 7px; }
.brand-mark i:nth-child(2) { height: 12px; }
.brand-mark i:nth-child(3) { height: 16px; }
.sign-in {
  min-height: 100vh;
  display: grid;
  align-content: center;
  justify-items: center;
  background: radial-gradient(ellipse at 50% 16%, #e4efde, #f5f7f1 64%);
  padding: 30px 18px;
}
.sign-in-identity {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--forest);
  font-size: 22px;
  font-weight: 700;
  line-height: 34px;
  margin-bottom: 20px;
}
.sign-in-panel { width: min(100%, 365px); background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 23px; box-shadow: 0 10px 30px #26463410; }
.sign-in-panel h1 { font-size: 23px; line-height: 1.2; letter-spacing: -.03em; margin: 9px 0 19px; }
.local-label { display: inline-flex; gap: 7px; align-items: center; color: #335642; font-size: 13px; font-weight: 650; }
.local-label span, .presence { width: 7px; height: 7px; border-radius: 50%; background: #68a47a; flex: 0 0 auto; }
#login-form { display: grid; gap: 7px; }
#login-form > input, .verification-row { margin-bottom: 9px; }
#login-form input { min-height: 45px; }
.verification-row { display: flex; align-items: stretch; gap: 10px; }
.verification-image { display: block; padding: 0; background: #f9f9f9; border: 1px solid var(--border); border-radius: 7px; overflow: hidden; flex: 0 0 auto; }
.verification-image img { display: block; }
.sign-in-submit { min-height: 45px; margin-top: 7px; }
.sign-in-tools { display: flex; justify-content: space-between; gap: 16px; margin-top: 20px; font-size: 13px; }

.desk-shell { min-height: 100vh; display: flex; flex-direction: column; }
.portal-width { width: min(100%, 1120px); margin-inline: auto; padding-inline: clamp(12px, 2vw, 22px); }
.portal-header { position: relative; z-index: 3; }
.portal-utility { background: #21342d; color: #e8f1ea; border-bottom: 1px solid #4e685b; }
.utility-inner { display: flex; align-items: center; gap: 14px; min-height: 40px; padding-block: 5px; }
.desk-brand {
  display: flex; align-items: center; text-align: left; gap: 8px; padding: 0;
  border: 0; background: none; color: #f5faf5;
  font-size: 15px; font-weight: 750; white-space: nowrap; flex: 0 0 auto;
}
.desk-brand .brand-mark { flex: 0 0 auto; width: 27px; height: 27px; padding: 5px 6px 6px; border-radius: 6px; }
.advanced-link { display: flex; align-items: center; gap: 8px; white-space: nowrap; font-size: 12px; }
.advanced-link span, .login-history span { color: #b5c8bd; }
.advanced-link button { border: 1px solid #c8ddca; border-radius: 5px; color: var(--green); background: #eaf3e8; padding: 5px 9px; font-size: 12px; font-weight: 650; }
.quick-search { display: flex; gap: 4px; width: min(24vw, 185px); min-width: 140px; }
.quick-search input { min-height: 28px; padding: 4px 7px; font-size: 12px; }
.quick-search .quiet { padding: 4px 8px; min-height: 28px; font-size: 12px; }
.login-history { display: flex; align-items: center; gap: 8px; white-space: nowrap; font-size: 12px; margin-left: auto; }
.login-history .text-button { color: #e4efdf; }
.portal-main-nav { background: #e6efdf; color: #264537; border-bottom: 1px solid #bccdbb; }
.nav-inner { display: flex; align-items: stretch; justify-content: space-between; gap: 11px; min-height: 36px; }
.portal-nav { display: flex; flex-wrap: wrap; align-items: stretch; min-width: 0; }
.portal-nav > button, .drop-trigger {
  border: 0; border-right: 1px solid #d0ddcb; background: transparent; color: #294d38; padding: 7px 13px; min-height: 35px;
  font-size: 13px; font-weight: 640; white-space: nowrap;
}
.portal-nav > button:hover, .drop-trigger:hover { background: #d7e7ce; }
.portal-nav > button[aria-current="page"], .portal-dropdown.is-selected .drop-trigger { background: #cfe3c6; color: #173922; box-shadow: inset 0 -2px #4e8059; }
.portal-nav .portal-help { font-family: Consolas, monospace; font-size: 14px; }
.portal-dropdown { position: relative; }
.portal-dropdown .drop-trigger span { margin-left: 4px; opacity: .7; }
.portal-submenu {
  display: none; position: absolute; top: 100%; left: 0; min-width: 132px; padding: 4px;
  background: #fcfefa; border: 1px solid #cddace; box-shadow: 0 7px 15px #17272020; border-radius: 0 0 5px 5px;
}
.portal-dropdown:hover .portal-submenu, .portal-dropdown.is-open .portal-submenu { display: grid; }
.portal-submenu button {
  background: transparent; border: 0; text-align: left; color: var(--green); border-radius: 4px; white-space: nowrap;
  padding: 8px 10px; font-size: 13px;
}
.portal-submenu button:hover, .portal-submenu button[aria-current="page"] { background: var(--mint); color: var(--forest); }
.operator-tools { display: flex; align-items: center; gap: 11px; font-size: 12px; white-space: nowrap; }
.operator-tools .text-button { color: #234b36; }
.local-tag { border: 1px solid #b5ccaf; color: #3a6348; border-radius: 4px; padding: 2px 5px; font-size: 11px; }
.menu-toggle { display: none; }
.workspace { flex: 1; min-width: 0; padding-block: 19px 24px; }
.portal-footer { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding-block: 8px; border-top: 1px solid var(--border); font-size: 12px; color: var(--subtle); }
.portal-footer > div { display: flex; align-items: center; gap: 12px; }
.portal-footer .quiet { min-height: 30px; padding: 4px 8px; }
.quick-quota { display: flex; gap: 4px; align-items: center; }
.quick-quota input { width: 94px; padding: 4px 7px; min-height: 30px; font-size: 12px; }
.portal-footer .footer-quota { display: none; }
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 13px; padding: 0 0 10px; border-bottom: 1px solid var(--border); }
.page-head h1 { font-size: 19px; letter-spacing: -.015em; line-height: 1.23; }
.page-head p { margin-top: 5px; color: var(--subtle); font-size: 12px; line-height: 1.5; }
.page-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.panel { background: var(--panel); border: 1px solid var(--border); border-radius: 5px; margin-bottom: 14px; min-width: 0; }
.narrow-panel { max-width: 780px; }
.panel-head {
  border-bottom: 1px solid var(--border); align-items: center; display: flex; justify-content: space-between; gap: 10px;
  padding: 10px 13px; background: #f2f6ef;
}
.panel-head h2 { font-size: 14px; line-height: 1.3; }
.home-grid { display: grid; grid-template-columns: minmax(0, 2.2fr) minmax(220px, 1fr); gap: 12px; align-items: start; }
.product-notice { display: grid; gap: 7px; padding: 15px 13px; color: var(--subtle); font-size: 13px; }
.filter-bar, .filters { padding: 12px 13px; }
.filter-bar { display: flex; flex-wrap: wrap; align-items: end; gap: 9px; }
.filter-bar label { min-width: 106px; }
.filter-bar .grow { flex: 1 1 160px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
.filters .form-grid { max-width: 580px; }
.choice-row { display: flex; flex-wrap: wrap; gap: 8px 15px; margin: 17px 0; }
.choice { flex-direction: row; align-items: center; gap: 5px; font-weight: 500; }
.date-filter { display: flex; align-items: end; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.date-filter label { flex: 0 0 155px; }
.presets { display: flex; gap: 5px; flex-wrap: wrap; }
.pill-button { min-height: 33px; padding: 5px 9px; font-size: 12px; }
.submit-row { display: flex; gap: 9px; justify-content: flex-end; margin-top: 18px; }
.table-scroll { overflow: auto; scrollbar-width: thin; }
table { border-collapse: collapse; width: 100%; font-size: 13px; text-align: left; }
th, td { padding: 8px 10px; text-align: left; vertical-align: middle; border-bottom: 1px solid #e9eee8; }
th { white-space: nowrap; color: #42574b; background: #f1f5ee; font-weight: 700; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: #f8faf6; }
td:first-child, .report-totals strong { font-variant-numeric: tabular-nums; }
td .text-button { white-space: nowrap; }
.table-meta { padding: 0 18px 12px; color: var(--subtle); font-size: 12px; }
.table-footer { border-top: 1px solid var(--border); display: flex; align-items: center; justify-content: flex-end; gap: 12px; padding: 11px 15px; font-size: 12px; color: var(--subtle); }
.row-actions { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; }
.account-cell { display: flex; gap: 7px; align-items: center; white-space: nowrap; }
.account-cell small { color: var(--subtle); }
.account-name { white-space: nowrap; }
.quota-cell { display: grid; gap: 3px; padding: 0; border: 0; background: transparent; text-align: left; color: var(--green); font-size: 12px; white-space: nowrap; }
.quota-cell:hover { text-decoration: underline; text-underline-offset: 3px; }
.status {
  display: inline-flex; align-items: center; gap: 5px; max-width: max-content;
  white-space: nowrap; font-size: 11px; font-weight: 650; background: #edf0ed; color: #58675b; padding: 4px 7px; border-radius: 5px;
}
.status i { width: 5px; height: 5px; background: currentColor; border-radius: 50%; }
.status.positive { background: #e5f2e6; color: #2a6140; }
.star { background: none; border: 0; color: #78877a; font-size: 19px; line-height: 1.1; }
.star.is-starred { color: #90620e; }
.empty { min-height: 115px; display: grid; align-content: center; justify-items: center; gap: 5px; color: var(--subtle); padding: 18px; font-size: 13px; }
.empty span { color: #4e8060; font-size: 21px; letter-spacing: .12em; }
.tab-strip, .arena-nav { display: flex; gap: 6px; flex-wrap: wrap; padding: 11px 16px; background: #f9fbf7; border-bottom: 1px solid var(--border); border-radius: 10px 10px 0 0; }
.tab { padding: 7px 10px; font-size: 13px; color: #42574b; background: transparent; border: 1px solid transparent; border-radius: 6px; }
.tab.is-active { background: #e4efdf; color: #214b35; border-color: #d5e4d1; font-weight: 700; }
.tab:hover { background: #edf3e9; }
.report-totals { display: flex; gap: 22px; padding: 14px 18px; flex-wrap: wrap; }
.report-totals > span { color: var(--subtle); font-size: 12px; }
.report-totals strong { margin-left: 8px; color: var(--ink); font-size: 14px; }
.arena-nav { margin-bottom: 15px; border: 1px solid var(--border); border-radius: 10px; }
.board-info { display: flex; gap: 15px 36px; align-items: center; flex-wrap: wrap; padding: 14px 17px; }
.board-info div { display: grid; gap: 5px; font-size: 13px; }
.board-info div > span:first-child { color: var(--subtle); }
.board-info button { margin-left: auto; }
.number-ball { display: inline-grid; justify-items: center; min-width: 30px; padding: 5px 8px; border-radius: 20px; background: #e9efe4; color: #29513a; font-weight: 700; }
.game-group { border-top: 1px solid var(--border); }
.game-group h3 { font-size: 13px; margin: 0; padding: 8px 10px; background: #eff4ec; }
.game-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(190px, 100%), 1fr)); gap: 1px; background: var(--border); }
.game-entry { display: grid; gap: 6px; min-width: 0; padding: 9px 10px; background: var(--panel); font-size: 13px; }
.game-entry .row-actions { font-size: 12px; }

.dialog { width: min(500px, calc(100% - 24px)); max-height: calc(100vh - 26px); border: 1px solid #bdd1c1; border-radius: 11px; padding: 0; box-shadow: 0 24px 85px #10261c3d; color: var(--ink); }
.dialog::backdrop { background: #152a2370; }
.dialog-head, .dialog-foot { display: flex; gap: 10px; align-items: center; padding: 14px 17px; }
.dialog-head { justify-content: space-between; border-bottom: 1px solid var(--border); }
.dialog-head h2 { font-size: 18px; }
.dialog-foot { justify-content: flex-end; border-top: 1px solid var(--border); background: #f9fbf7; }
.icon-button { width: 34px; padding: 0; min-height: 34px; font-size: 20px; }
.dialog-content { padding: 17px; font-size: 13px; }
.dialog-error { padding: 0 17px 12px; }
.field-stack { display: grid; gap: 12px; }
.prefix-field { display: flex; gap: 7px; align-items: center; }
.prefix-field input { min-width: 60px; }
.prefix-field button { flex-shrink: 0; }
.inline-status:empty { display: none; }
.inline-status { font-size: 12px; color: var(--green); }
.detail-list { display: grid; grid-template-columns: auto 1fr; gap: 9px 16px; margin: 0 0 14px; }
.detail-list dt { color: var(--subtle); }
.detail-list dd { margin: 0; font-weight: 650; overflow-wrap: anywhere; }
.dialog-tools { display: flex; flex-wrap: wrap; gap: 7px; }
.multiline { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.7; margin-top: 9px; }
.toast { position: fixed; bottom: 22px; right: 20px; z-index: 100; max-width: calc(100vw - 40px); background: #214735; color: #fff; padding: 12px 15px; border-radius: 8px; box-shadow: 0 12px 30px #16352940; font-size: 13px; }
.error-toast { background: #82313a; }

@media (max-width: 1040px) {
  .utility-inner { gap: 10px; }
  .portal-nav > button, .drop-trigger { padding-inline: 10px; }
  .login-history time { display: none; }
}
@media (max-width: 720px) {
  .login-history, .password-link { display: none; }
  .nav-inner { min-height: 39px; flex-wrap: wrap; align-items: center; }
  .menu-toggle { display: inline-flex; min-height: 29px; margin-block: 4px; font-size: 12px; }
  .portal-nav { display: none; order: 3; width: 100%; }
  .menu-open .portal-nav { display: flex; padding-bottom: 6px; }
  .operator-tools { margin-left: auto; }
  .quick-search { width: auto; flex: 1 1 110px; min-width: 105px; }
  .workspace { padding-top: 13px; }
  .portal-footer .quick-quota { display: none; }
  .portal-footer .footer-quota { display: inline-flex; }
  .home-grid { grid-template-columns: 1fr; gap: 0; }
  .page-head { align-items: start; flex-wrap: wrap; }
  .page-actions { justify-content: flex-start; }
  .filter-bar, .filters { padding: 12px; gap: 8px; }
  .filter-bar label { flex: 1 1 110px; }
  .form-grid { gap: 8px; }
  .table-scroll td, .table-scroll th { padding: 10px 11px; }
}
.device-mobile .desk-shell, .device-mobile .sign-in { max-width: 600px; margin: 0 auto; border-inline: 1px solid var(--border); }
.device-mobile .menu-toggle { display: inline-flex; }
.device-mobile .nav-inner { align-items: center; flex-wrap: wrap; }
.device-mobile .operator-tools { margin-left: auto; }
.device-mobile .portal-nav, .device-mobile .login-history, .device-mobile .quick-quota { display: none; }
.device-mobile .portal-footer .footer-quota { display: inline-flex; }
.device-mobile .menu-open .portal-nav { display: flex; width: 100%; order: 3; }
.device-mobile .quick-search { width: auto; flex: 1 1 100px; }
.device-mobile .home-grid { grid-template-columns: 1fr; }
@media (max-width: 420px) {
  .utility-inner { flex-wrap: wrap; gap: 7px; }
  .advanced-link { margin-left: auto; }
  .utility-inner .quick-search { flex-basis: 100%; }
}
