:root {
  scrollbar-gutter:stable;
  color-scheme:light;
  --blue:#1263e5;
  --text:#0f172a;
  --muted:#74839e;
  --line:#e6eaf2;
  --bg:#f6f8fb;
  --surface:#fff;
  font-family:-apple-system,BlinkMacSystemFont,"PingFang SC","Microsoft YaHei",sans-serif;
  font-size:15px;
  color:var(--text);
  background:var(--bg);
}
* {
  box-sizing:border-box;
}
body {
  margin:0;
  min-width:0;
}
button,input,select,textarea {
  font:inherit;
}
button,a,input,select,textarea {
  -webkit-tap-highlight-color:transparent;
}
button {
  cursor:pointer;
}
button:disabled {
  cursor:default;
  opacity:.48;
}
a {
  color:inherit;
  text-decoration:none;
}
button {
  color:inherit;
}
button:focus-visible,a:focus-visible {
  outline:3px solid #a6c8ff;
  outline-offset:3px;
}
input:focus,select:focus,textarea:focus {
  outline:2px solid #a6c8ff;
  outline-offset:1px;
}
button,.button {
  touch-action:manipulation;
}
h1,h2,p {
  margin:0;
}
h1 {
  font-size:36px;
  line-height:1.4;
  letter-spacing:-.8px;
}
h2 {
  font-size:22px;
  line-height:1.5;
}
.icon {
  display:inline-block;
  width:21px;
  height:21px;
  background:currentColor;
  mask:var(--icon) center/contain no-repeat;
  -webkit-mask:var(--icon) center/contain no-repeat;
  flex:none;
  vertical-align:middle;
}
.mobile-copy {
  display:none;
}
[hidden] {
  display:none!important;
}
.app-shell {
  max-width:1040px;
  margin:34px auto;
  background:#fff;
  border:1px solid var(--line);
  border-radius:12px;
  overflow:hidden;
}
.topbar {
  display:flex;
  align-items:center;
  gap:70px;
  height:76px;
  padding:0 52px;
  border-bottom:1px solid var(--line);
}
.brand {
  display:flex;
  align-items:center;
  gap:14px;
  font-size:21px;
  font-weight:700;
  white-space:nowrap;
}
.brand-mark {
  width:40px;
  height:40px;
  display:flex;
  align-items:center;
  justify-content:center;
  background:var(--blue);
  color:#fff;
  border-radius:10px;
}
.brand-mark .icon {
  width:25px;
  height:25px;
}
.tabs {
  display:flex;
  align-self:stretch;
  gap:32px;
}
.tabs button {
  position:relative;
  border:0;
  background:none;
  font-weight:600;
  color:#64748b;
  min-width:44px;
  padding:0 6px;
}
.tabs button.active {
  color:var(--blue);
}
.tabs button.active:after {
  content:"";
  position:absolute;
  height:3px;
  bottom:0;
  left:0;
  right:0;
  background:var(--blue);
}
main {
  padding:0 52px 24px;
}
.intro {
  text-align:center;
  padding:44px 0 26px;
}
.intro p {
  margin-top:12px;
  line-height:1.7;
  color:var(--muted);
  font-size:16px;
}
.dropzone {
  width:100%;
  min-height:230px;
  border:1px dashed #a8ceff;
  background:#f4f9ff;
  border-radius:9px;
  display:flex;
  align-items:center;
  justify-content:center;
  flex-direction:column;
  gap:18px;
  color:var(--muted);
  font-size:14px;
}
.dropzone strong {
  font-size:22px;
  font-weight:600;
  color:var(--text);
}
.dropzone .link-blue {
  color:var(--blue);
}
.upload-icon {
  color:var(--blue);
  display:block;
  margin-bottom:6px;
}
.upload-icon .icon {
  width:58px;
  height:58px;
}
.dropzone.dragging {
  background:#e8f0fe;
  border-color:var(--blue);
}
.import-actions {
  display:flex;
  gap:0;
  margin:23px 0;
  align-items:center;
  color:var(--blue);
}
.import-actions button {
  display:flex;
  align-items:center;
  justify-content:center;
  gap:12px;
  background:none;
  border:0;
  padding:0 28px;
  font-weight:600;
  font-size:16px;
  height:28px;
}
.import-actions button[data-action="scan"] {
  padding-left:0;
}
.import-actions .manual-action {
  border-left:1px solid var(--line);
}
.selected-file {
  display:flex;
  gap:16px;
  align-items:center;
  min-height:74px;
  padding:14px 20px;
  background:#f5f7fa;
  border-radius:9px;
  margin-bottom:16px;
}
.file-icon {
  width:42px;
  height:46px;
  background:#ef4444;
  border-radius:4px;
  display:flex;
  align-items:center;
  justify-content:center;
  color:#fff;
  font-size:12px;
  font-weight:600;
  flex:none;
}
.selected-file>div {
  flex:1;
  min-width:0;
}
.selected-file strong {
  display:block;
  font-size:15px;
  overflow-wrap:anywhere;
  font-weight:600;
}
.selected-file small {
  display:block;
  color:var(--muted);
  margin-top:6px;
}
.icon-button {
  display:flex;
  align-items:center;
  justify-content:center;
  border:0;
  background:none;
  color:#64748b;
  width:38px;
  height:38px;
  border-radius:6px;
  flex:none;
}
.button {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:9px;
  min-height:39px;
  padding:8px 15px;
  border:1px solid #d6dfea;
  border-radius:6px;
  background:#fff;
  font-weight:600;
  white-space:nowrap;
}
.button.primary {
  color:#fff;
  border-color:var(--blue);
  background:var(--blue);
}
.submit-button {
  width:100%;
  min-height:52px;
  font-size:17px;
  letter-spacing:.2px;
}
.billing-note {
  text-align:center;
  font-size:12px;
  color:var(--muted);
  line-height:1.6;
  margin-top:12px;
}
.text-button {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  background:none;
  border:0;
  color:var(--blue);
  font-weight:600;
  padding:9px 0;
}
.error {
  color:#b45309;
  background:#fffbeb;
  padding:12px;
  border-radius:6px;
  line-height:1.7;
  margin-top:12px;
}
.manual-heading {
  display:flex;
  justify-content:space-between;
  align-items:center;
  margin-bottom:20px;
}
.form-grid {
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:22px 24px;
  margin-bottom:26px;
}
label {
  display:flex;
  flex-direction:column;
  gap:9px;
  font-weight:600;
  font-size:14px;
}
input,select,textarea {
  border:1px solid #d6dfea;
  border-radius:6px;
  background:#fff;
  color:var(--text);
  padding:11px 13px;
  min-width:0;
  min-height:44px;
  width:100%;
}
input::placeholder,textarea::placeholder {
  color:#94a3b8;
}
input[type=checkbox] {
  width:17px;
  min-height:17px;
  height:17px;
  accent-color:var(--blue);
  flex:none;
}
.required {
  color:#dc2626;
}
.result-summary {
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:16px;
  background:#f8fafc;
  border:1px solid var(--line);
  border-radius:8px;
  margin-top:24px;
  padding:20px;
}
.result-summary h2 {
  margin-bottom:10px;
}
.result-summary p {
  overflow-wrap:anywhere;
  line-height:1.8;
}
.result-summary p strong {
  margin-left:16px;
}
.result-summary small {
  color:var(--muted);
}
.result-summary>div:last-child {
  display:flex;
  flex-direction:column;
  align-items:flex-end;
  flex:none;
}
.recent-records {
  margin-top:26px;
  border-top:1px solid var(--line);
}
.history-section {
  padding-top:24px;
}
.section-heading {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  margin-bottom:16px;
}
.history-section h1 {
  font-size:28px;
}
.history-actions {
  display:flex;
  gap:10px;
}
.history-tools {
  display:flex;
  gap:12px;
  margin-bottom:16px;
}
.search-field {
  display:flex;
  align-items:center;
  flex:1;
  position:relative;
  min-width:0;
}
.search-field .icon {
  position:absolute;
  left:13px;
  color:var(--muted);
  width:18px;
  height:18px;
  pointer-events:none;
}
.search-field input {
  padding-left:42px;
}
.history-tools select {
  width:190px;
  color:#334155;
}
.record-row,.record-header {
  display:grid;
  grid-template-columns:minmax(200px,1.6fr) minmax(100px,.8fr) minmax(130px,1fr) minmax(155px,1fr);
  gap:14px;
  align-items:center;
  padding:16px 20px;
}
.record-header {
  background:#f7f9fc;
  color:#64748b;
  font-weight:600;
  padding-top:13px;
  padding-bottom:13px;
}
.record-row {
  border-bottom:1px solid var(--line);
  font-size:16px;
  min-height:58px;
}
.record-number {
  border:0;
  padding:0;
  background:none;
  text-align:left;
  overflow-wrap:anywhere;
  min-width:0;
  font-variant-numeric:tabular-nums;
}
.record-money {
  font-variant-numeric:tabular-nums;
  white-space:nowrap;
}
.record-time {
  font-size:14px;
  line-height:1.6;
  color:var(--muted);
}
.record-number:hover {
  color:var(--blue);
  text-decoration:underline;
}
.badge {
  display:inline-flex;
  align-items:center;
  gap:7px;
  background:#f1f5f9;
  color:#64748b;
  border-radius:20px;
  padding:5px 11px;
  font-size:13px;
  line-height:1.4;
  font-weight:600;
  max-width:100%;
}
.badge:before {
  content:"";
  width:6px;
  height:6px;
  background:currentColor;
  border-radius:50%;
  flex:none;
}
.badge.passed {
  color:#15803d;
  background:#ecfdf5;
}
.badge.mismatch {
  color:#c66a08;
  background:#fff7e8;
}
.badge.duplicate, .badge.duplicate_recognized {
  color:#7c3aed;
  background:#f5f3ff;
}
.history-footer {
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:16px;
  color:var(--muted);
  font-size:13px;
  padding-top:15px;
}
.history-footer>div {
  display:flex;
  align-items:center;
  gap:20px;
}
.selection-toolbar {
  display:flex;
  gap:20px;
  align-items:center;
  margin:15px 0;
  color:var(--muted);
}
.selection-toolbar label {
  display:flex;
  flex-direction:row;
  align-items:center;
  gap:7px;
}
.selecting .record-row,.selecting .record-header {
  grid-template-columns:20px minmax(180px,1.6fr) minmax(90px,.8fr) minmax(120px,1fr) minmax(150px,1fr);
}
.danger {
  color:#dc2626;
}
.empty-state {
  text-align:center;
  color:var(--muted);
  padding:36px 16px;
  line-height:1.8;
}
.bottom-nav {
  display:none;
}
dialog {
  border:1px solid var(--line);
  border-radius:12px;
  padding:24px;
  width:min(540px,calc(100% - 32px));
  max-height:85vh;
  color:var(--text);
  box-shadow:0 24px 60px #0f172a25;
  overflow:auto;
}
dialog::backdrop {
  background:#0f172a55;
}
.dialog-header {
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:16px;
  margin-bottom:20px;
}
.dialog-header h2 {
  font-size:21px;
}
dialog>p {
  color:var(--muted);
  line-height:1.7;
}
.dialog-actions {
  display:flex;
  justify-content:flex-end;
  gap:12px;
  margin-top:24px;
}
.danger-button {
  color:#fff;
  background:#dc2626;
  border-color:#dc2626;
}
dl {
  margin:20px 0 0;
}
dl>div {
  display:grid;
  grid-template-columns:110px minmax(0,1fr);
  gap:14px;
  padding:12px 0;
  border-bottom:1px solid var(--line);
}
dt {
  color:var(--muted);
}
dd {
  margin:0;
  overflow-wrap:anywhere;
  line-height:1.6;
}
details {
  margin-top:20px;
  color:var(--muted);
  font-size:12px;
}
details p {
  margin-top:12px;
  overflow-wrap:anywhere;
}
summary {
  cursor:pointer;
}
#scan-video {
  display:block;
  background:#f6f8fb;
  width:100%;
  height:200px;
  object-fit:cover;
  border-radius:8px;
}
#scan-status {
  font-size:13px;
  margin:12px 0;
  line-height:1.7;
}
.scan-actions {
  display:flex;
  gap:12px;
  margin:16px 0;
}
.scan-actions label {
  flex-direction:row;
  cursor:pointer;
}
.scan-dialog textarea {
  margin-top:9px;
}
.scan-dialog>.submit-button {
  margin-top:18px;
}
.toast {
  position:fixed;
  bottom:28px;
  left:50%;
  transform:translateX(-50%);
  padding:12px 20px;
  border-radius:8px;
  background:#0f172a;
  color:#fff;
  max-width:calc(100vw - 32px);
  width:max-content;
  box-shadow:0 5px 20px #0f172a25;
  z-index:10;
  line-height:1.7;
}
@media(hover:hover) {
  .button:hover:not(:disabled) {
    background:#f8fafc;
  }
  .primary:hover:not(:disabled) {
    background:#0b4fc4;
  }
  .dropzone:hover:not(:disabled) {
    background:#edf5ff;
  }
  .text-button:hover:not(:disabled) {
    color:#0b4fc4;
  }
  .icon-button:hover {
    background:#f1f5f9;
  }
}
@media(min-width:761px) and (max-width:1200px) {
  .app-shell {
    margin:24px;
  }
  .topbar {
    padding:0 36px;
  }
  main {
    padding:0 36px 24px;
  }
  .record-row,.record-header {
    padding-left:12px;
    padding-right:12px;
    grid-template-columns:minmax(160px,1.4fr) 100px 130px 145px;
    gap:10px;
  }
  .selecting .record-row,.selecting .record-header {
    grid-template-columns:20px minmax(130px,1.4fr) 90px 120px 135px;
    gap:8px;
  }
}
@media(max-width:760px) {
  :root {
    background:#fff;
  }
  .app-shell {
    margin:0;
    border:0;
    border-radius:0;
    min-height:100dvh;
    overflow:visible;
  }
  .topbar {
    height:76px;
    padding:0 22px;
    justify-content:space-between;
    gap:18px;
  }
  .brand {
    font-size:20px;
    gap:10px;
  }
  .brand-mark {
    width:36px;
    height:36px;
    border-radius:9px;
  }
  .brand-mark .icon {
    width:23px;
    height:23px;
  }
  .tabs {
    gap:18px;
  }
  .tabs button {
    font-size:13px;
    padding:0;
    min-width:34px;
  }
  .mobile-copy {
    display:inline;
  }
  .desktop-copy {
    display:none;
  }
  main {
    padding:0 22px calc(108px + env(safe-area-inset-bottom));
  }
  .intro {
    padding:24px 0 18px;
    text-align:left;
  }
  .intro h1 {
    font-size:27px;
    letter-spacing:-.3px;
  }
  .intro p {
    font-size:14px;
    margin-top:10px;
    line-height:1.7;
  }
  .dropzone {
    min-height:216px;
    gap:18px;
    padding:20px 14px;
    text-align:center;
  }
  .dropzone strong {
    font-size:20px;
  }
  .dropzone>span:last-child {
    font-size:12px;
    line-height:1.8;
    max-width:240px;
  }
  .upload-icon .icon {
    width:54px;
    height:54px;
  }
  .import-actions {
    justify-content:center;
    margin:18px 0 20px;
  }
  .import-actions button {
    padding:0 16px;
    height:28px;
    font-size:15px;
    gap:8px;
    color:var(--blue);
  }
  .import-actions button[data-action="scan"] {
    padding-left:16px;
  }
  .import-actions .icon {
    color:var(--blue);
  }
  .selected-file {
    padding:14px 16px;
    gap:12px;
    min-height:76px;
    margin-bottom:18px;
  }
  .selected-file strong {
    font-size:14px;
  }
  .file-icon {
    width:38px;
    height:44px;
  }
  .selected-file small {
    font-size:12px;
  }
  .submit-button {
    min-height:52px;
    font-size:17px;
  }
  .billing-note {
    margin-top:13px;
  }
  .recent-records {
    display:none;
  }
  .bottom-nav {
    display:flex;
    position:fixed;
    bottom:0;
    left:0;
    right:0;
    justify-content:space-around;
    gap:24px;
    border-top:1px solid var(--line);
    background:#fff;
    padding:11px 22px calc(11px + env(safe-area-inset-bottom));
    z-index:2;
  }
  .bottom-nav button {
    display:flex;
    align-items:center;
    justify-content:center;
    flex-direction:column;
    gap:6px;
    background:none;
    border:0;
    color:#64748b;
    min-height:49px;
    flex:1;
    font-size:13px;
    font-weight:600;
  }
  .bottom-nav button.active {
    color:var(--blue);
  }
  .bottom-nav .icon {
    width:23px;
    height:23px;
  }
  .form-grid {
    grid-template-columns:1fr;
    gap:18px;
    margin-bottom:22px;
  }
  .manual-heading h2 {
    font-size:19px;
  }
  .manual-heading .text-button {
    font-size:13px;
  }
  .history-section {
    padding-top:26px;
  }
  .history-section h1 {
    font-size:23px;
  }
  .section-heading {
    gap:8px;
  }
  .history-actions {
    gap:8px;
  }
  .history-actions .button {
    padding:8px 10px;
    font-size:12px;
    min-height:36px;
  }
  .history-tools {
    flex-wrap:wrap;
    gap:10px;
  }
  .search-field {
    flex-basis:100%;
  }
  .history-tools select {
    width:100%;
  }
  .record-header {
    display:none;
  }
  .record-row {
    grid-template-columns:minmax(0,1fr) auto;
    gap:10px 12px;
    padding:19px 0;
  }
  .record-number {
    grid-column:1;
    grid-row:1;
    font-size:13px;
  }
  .record-money {
    grid-column:2;
    grid-row:1;
    font-size:13px;
    font-weight:600;
  }
  .record-status {
    grid-column:2;
    grid-row:2;
    text-align:right;
  }
  .record-time {
    grid-column:1;
    grid-row:2;
    font-size:12px;
  }
  .record-time {
    max-width:190px;
  }
  .badge {
    font-size:11px;
    padding:4px 9px;
  }
  .history-footer {
    font-size:12px;
    flex-wrap:wrap;
  }
  .history-footer>div {
    gap:14px;
  }
  .selection-toolbar {
    gap:12px;
    flex-wrap:wrap;
    font-size:12px;
  }
  .selecting .record-row {
    grid-template-columns:18px minmax(0,1fr) auto;
    gap:10px;
  }
  .selecting .record-row>input {
    grid-column:1;
    grid-row:1/3;
  }
  .selecting .record-number,.selecting .record-time {
    grid-column:2;
  }
  .selecting .record-money,.selecting .record-status {
    grid-column:3;
  }
  .result-summary {
    padding:16px;
    align-items:flex-start;
    flex-direction:column;
  }
  .result-summary>div:last-child {
    flex-direction:row;
    width:100%;
    justify-content:space-between;
    align-items:center;
  }
  .result-summary p {
    font-size:12px;
  }
  .result-summary p strong {
    margin-left:8px;
  }
  .toast {
    bottom:calc(92px + env(safe-area-inset-bottom));
    font-size:13px;
  }
  dialog {
    padding:20px;
    max-height:85dvh;
  }
  dl>div {
    grid-template-columns:88px minmax(0,1fr);
    font-size:13px;
    gap:10px;
  }
  .scan-actions .button {
    font-size:12px;
  }
}
@media(prefers-reduced-motion:reduce) {
  * {
    scroll-behavior:auto!important;
  }
}

.record-number-cell { min-width: 0; }
@media(max-width:760px) {
  .record-number-cell { grid-column: 1; grid-row: 1; }
  .selecting .record-number-cell { grid-column: 2; }
}
/* Shared history controls and local QR upload state. */
.history-tools #page-size { width: 135px; flex-shrink: 0; }
.recent-records .record-time { display:flex; align-items:center; justify-content:space-between; gap:8px; max-width:none; }
.record-delete { flex-shrink:0; padding:8px 4px; min-height:44px; font-size:12px; }
.recognition-button { display:block; margin:12px auto 0; }
.history-footer > div { flex-wrap:wrap; }
@media(max-width:760px) {
  .history-tools #status-filter, .history-tools #page-size { width:calc(50% - 5px); flex:1; }
  .record-delete { font-size:11px; padding:8px 2px; }
  .history-footer { flex-wrap:wrap; gap:12px; }
  .history-footer > div { gap:10px; }
}
@media(max-width:760px) {
  .recent-records { display:block; margin-top:28px; }
}
@media(max-width:760px) {
  .recent-records .record-row { grid-template-columns:minmax(0,1fr) 120px; }
  .recent-records .record-money { text-align:right; }
  .recent-records .record-status .badge { max-width:100%; white-space:normal; }
}

@supports not (scrollbar-gutter:stable) {
  :root { overflow-y:scroll; }
}
.edition-switch { margin-left:auto; display:flex; align-items:center; gap:8px; flex-shrink:0; font-size:12px; color:var(--muted); }
.edition-switch select { width:100px; min-height:36px; padding:6px 10px; }
.badge.recognized { background:#eff6ff; color:#2563eb; }
.billing-note a { color:var(--blue); text-decoration:underline; }
@media(max-width:760px) {
  .topbar { height:auto; min-height:76px; flex-wrap:wrap; padding-top:16px; padding-bottom:12px; gap:12px; }
  .edition-switch { flex-basis:100%; justify-content:flex-end; }
  .edition-switch select { width:112px; }
}

.account-name { max-width:120px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.edition-switch .text-button { color:var(--muted); font-size:12px; }

/* Personal center uses the same content boundary and project tokens. */
.account-center { padding-top:36px; }
.account-heading { display:flex; align-items:center; justify-content:space-between; gap:16px; margin-bottom:24px; }
.account-heading h1 { font-size:28px; }
.account-heading p { margin-top:8px; color:var(--muted); }
.account-grid { align-items:start; display:grid; grid-template-columns:1fr 1fr; gap:20px; }
.account-panel { min-width:0; padding:24px; border:1px solid var(--line); border-radius:12px; }
.account-panel h2 { font-size:18px; margin-bottom:20px; }
.account-wide { grid-column:1 / -1; }
.account-panel .section-heading { flex-wrap:wrap; margin-bottom:20px; }
.account-panel .section-heading h2 { flex-shrink:0; margin-bottom:0; }
.account-panel .section-heading select { width:auto; max-width:100%; min-width:0; }
.account-info { margin:0 0 20px; }
.account-info > div { display:flex; justify-content:space-between; gap:16px; padding:8px 0; }
.account-info dt { color:var(--muted); flex:none; }
.account-info dd { margin:0; overflow-wrap:anywhere; text-align:right; }
.profile-edit { display:flex; gap:12px; margin-top:10px; }
.profile-edit input { min-width:0; width:100%; }
.profile-edit .button { flex:none; }
.account-note { font-size:12px; color:var(--muted); line-height:1.8; margin-top:12px; }
.account-description { line-height:1.8; margin:12px 0; }
.edition-title { display:block; font-size:26px; color:var(--blue); }
.account-panel > .button { margin-top:24px; }
.usage-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:16px; }
.usage-item { min-width:0; padding:16px; background:var(--bg); border-radius:10px; }
.usage-item > span,.usage-item > small { display:block; color:var(--muted); font-size:12px; }
.usage-item > strong { display:block; font-size:28px; margin:10px 0; overflow-wrap:anywhere; }
.usage-item strong small { font-weight:400; font-size:12px; color:var(--muted); }
.usage-log-row { display:grid; grid-template-columns:minmax(0,1fr) 80px 100px; gap:12px; align-items:center; padding:16px 0; border-top:1px solid var(--line); font-size:13px; }
.usage-log-row strong { font-weight:500; }
.usage-log-row small { display:block; font-size:12px; margin-top:6px; color:var(--muted); }
.usage-log-row > span { text-align:right; }
@media (min-width:761px) and (max-width:1000px) { .topbar { gap:24px; } .tabs { gap:20px; } }
@media (max-width:760px) {
  .account-center { padding-top:24px; }
  .account-heading h1 { font-size:26px; }
  .account-heading p { font-size:13px; }
  .account-grid { grid-template-columns:1fr; gap:16px; }
  .account-panel { padding:18px; }
  .usage-grid { grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
  .usage-item { padding:12px; }
  .usage-log-row { grid-template-columns:minmax(0,1fr) 54px 64px; gap:8px; font-size:12px; }
}

/* Date filters share the existing modal on every screen size. */
.time-filter { width:135px; flex-shrink:0; flex-direction:column; gap:3px; }
.time-filter.active { color:var(--blue); }
.period-summary { font-size:10px; line-height:1.3; overflow-wrap:anywhere; }
.history-footer #page-size { width:120px; flex-shrink:0; }
.period-options { border:0; padding:0; margin:20px 0; display:flex; gap:24px; flex-wrap:wrap; }
.period-options legend { color:var(--muted); font-size:13px; margin-bottom:12px; }
.period-options label { display:flex; flex-direction:row; align-items:center; gap:8px; min-height:44px; }
.period-options input { width:17px; height:17px; min-height:17px; padding:0; flex:none; accent-color:var(--blue); }
.period-dates { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:12px; margin:20px 0; }
.period-dates label { display:flex; flex-direction:column; gap:8px; color:var(--muted); font-size:13px; min-width:0; }
.period-dates input { width:100%; min-width:0; }
.period-dialog .dialog-actions { margin-top:24px; flex-wrap:wrap; gap:12px; }
.period-dialog .dialog-actions .text-button { margin-right:auto; }
@media (max-width:760px) {
  .history-tools .time-filter { width:calc(50% - 5px); flex:1; }
}

.result-summary .duplicate-notice { text-align:left; line-height:1.6; margin-top:8px; }

.purchase-options { display:grid; gap:12px; margin:20px 0; }
.purchase-option { display:flex; align-items:center; justify-content:space-between; gap:16px; border:1px solid var(--line); border-radius:12px; padding:16px; }
.purchase-option p { margin:6px 0 0; }
@media(max-width:600px) { .purchase-option { align-items:flex-start; flex-direction:column; } }

.account-usage .usage-grid { grid-template-columns:repeat(2,minmax(0,1fr)); margin-top:20px; }
.quota-summary { display:flex; align-items:center; justify-content:space-between; gap:16px; padding:16px 0; border-block:1px solid var(--line); margin-top:20px; }
.quota-summary span { display:block; color:var(--muted); font-size:12px; }
.quota-summary strong { display:block; font-size:24px; margin-top:8px; }
.quota-summary .button { flex-shrink:0; }
.usage-log-row.usage-event { grid-template-columns:minmax(0,1fr) auto; }
.purchase-dialog { width:min(640px,calc(100vw - 32px)); }
.purchase-dialog .account-panel { border:0; padding:0; }
@media(max-width:600px) { .purchase-dialog .usage-log-row { grid-template-columns:minmax(0,1fr) auto; } .purchase-dialog .usage-log-row > span:last-child { grid-column:1 / -1; } }

.purchase-dialog .purchase-options { margin-top:0; }
.purchase-orders-title { font-size:15px; margin-top:24px; margin-bottom:12px; }

.account-left { min-width:0; display:grid; gap:20px; }
.lookup-results { display:flex; flex-wrap:wrap; gap:8px; margin-top:16px; }
.lookup-user { align-items:flex-start; flex-direction:column; min-width:0; max-width:100%; }
.lookup-user span,.lookup-user small { overflow-wrap:anywhere; }
.lookup-user small { color:var(--muted); font-weight:400; }
.lookup-user.active { border-color:var(--blue); }
.lookup-summary { margin-top:20px; border-top:1px solid var(--line); padding-top:16px; }
.lookup-summary .section-heading { gap:12px; }
.lookup-summary .section-heading strong { font-size:14px; overflow-wrap:anywhere; }
.lookup-summary select { width:auto; }
.lookup-summary .account-info { margin-bottom:0; font-size:13px; }

.cart-section { margin:24px 0; padding-top:20px; border-top:1px solid var(--line); }
.cart-section h3,.checkout-summary h3 { font-size:17px; }
.cart-section .section-heading { margin-bottom:12px; }
.cart-row { display:flex; justify-content:space-between; align-items:center; gap:12px; padding:12px 0; border-bottom:1px solid var(--line); }
.cart-row > div:first-child { min-width:0; }
.cart-row strong { font-size:14px; overflow-wrap:anywhere; }
.cart-row small { display:block; color:var(--muted); font-size:12px; margin-top:6px; }
.cart-controls { display:flex; align-items:center; gap:8px; flex-shrink:0; }
.cart-controls .button { padding:0; min-width:36px; min-height:36px; }
.cart-controls .text-button { font-size:12px; }
.cart-next { margin-top:16px; width:100%; }
.checkout-lines { margin:20px 0; }
.checkout-lines > div { display:flex; justify-content:space-between; gap:16px; font-size:14px; padding:12px 0; border-bottom:1px solid var(--line); }
.checkout-lines span { overflow-wrap:anywhere; }
.checkout-lines strong { flex-shrink:0; }
.checkout-total { margin-top:20px; }
.checkout-total > div:last-child { font-size:18px; padding-top:16px; border-top:1px solid var(--line); }
.checkout-summary .dialog-actions { margin-top:20px; flex-wrap:wrap; }
@media(max-width:600px) { .cart-row { align-items:flex-start; flex-direction:column; } .cart-controls { align-self:flex-end; } }
