/* Adapted from Credit × CDK UI Starter: Credit (Apache-2.0).
 * Tokens/layout/component geometry adapted for this FastAPI platform; see NOTICE.md. */
:root {
  --radius: 0.625rem;
  --background: oklch(1 0 0);
  --foreground: oklch(0.141 0.005 285.823);
  --card: oklch(1 0 0);
  --primary: oklch(58.5% 51% 277.117);
  --primary-foreground: oklch(0.985 0 0);
  --secondary: oklch(0.967 0.001 286.375);
  --muted: oklch(0.967 0.001 286.375);
  --muted-foreground: oklch(0.5 0.016 285.938);
  --border: oklch(0.92 0.004 286.32);
  --sidebar: hsl(0 0% 98%);
  --accent: hsl(240 4.8% 95.9%);
  --green: #147d55;
  --green-bg: #eaf7ef;
  --amber: #95650a;
  --amber-bg: #fff5dd;
  --red: #bf3646;
  --red-bg: #fdf0f1;
  --shadow: 0 1px 3px #18181b06;
  --sidebar-width: 224px;
  color-scheme: light;
}
.dark {
  --background: oklch(0.141 0.005 285.823);
  --foreground: oklch(0.985 0 0);
  --card: oklch(0.21 0.006 285.885);
  --primary: oklch(0.92 0.004 286.32);
  --primary-foreground: oklch(0.21 0.006 285.885);
  --secondary: oklch(0.274 0.006 286.033);
  --muted: oklch(0.274 0.006 286.033);
  --muted-foreground: oklch(0.705 0.015 286.067);
  --border: oklch(1 0 0 / 10%);
  --sidebar: hsl(240 5.9% 10%);
  --accent: hsl(240 3.7% 15.9%);
  --green: #78d5a7;
  --green-bg: #17352b;
  --amber: #e7bf69;
  --amber-bg: #382f1a;
  --red: #f1949f;
  --red-bg: #3d242b;
  --shadow: none;
  color-scheme: dark;
}
.portal-page {
  scrollbar-width: none;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  color: var(--foreground);
  background: var(--background);
  font-family:
    "Geist",
    "Noto Sans SC",
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    "Microsoft YaHei",
    sans-serif;
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
button,
input,
select {
  font: inherit;
}
button,
a,
input,
select {
  touch-action: manipulation;
}
button {
  cursor: pointer;
}
button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
a {
  color: inherit;
  text-decoration: none;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--primary) 40%, transparent);
  outline-offset: 3px;
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1 {
  font-size: 26px;
  font-weight: 650;
  letter-spacing: -0.8px;
  line-height: 1.4;
}
h2 {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.3px;
}
h3 {
  font-size: 14px;
  font-weight: 600;
}
.muted {
  color: var(--muted-foreground);
}
.mono {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
  letter-spacing: 0.02em;
}
.eyebrow {
  display: block;
  color: var(--muted-foreground);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  vertical-align: middle;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.65;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.button {
  height: 36px;
  border: 1px solid transparent;
  background: var(--primary);
  color: var(--primary-foreground);
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 14px;
  font-size: 13px;
  font-weight: 550;
  white-space: nowrap;
  transition:
    background 0.15s,
    opacity 0.15s;
}
.button:hover {
  opacity: 0.87;
}
.button.secondary {
  background: var(--card);
  color: var(--foreground);
  border-color: var(--border);
  box-shadow: var(--shadow);
}
.button.ghost {
  color: var(--muted-foreground);
  background: transparent;
}
.button.small {
  height: 30px;
  padding: 0 10px;
  font-size: 12px;
}
.icon-button {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 6px;
  color: var(--muted-foreground);
  background: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}
.icon-button:hover {
  background: var(--accent);
  color: var(--foreground);
}
.actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: 5px;
  padding: 2px 7px;
  font-size: 11px;
  font-weight: 550;
  line-height: 1.7;
  white-space: nowrap;
  color: var(--muted-foreground);
  background: var(--secondary);
}
.badge.success,
.badge.valid {
  color: var(--green);
  background: var(--green-bg);
}
.badge.partial,
.badge.unknown,
.badge.queued,
.badge.running {
  color: var(--amber);
  background: var(--amber-bg);
}
.badge.expired,
.badge.error,
.badge.failed,
.badge.network_error,
.badge.interrupted {
  color: var(--red);
  background: var(--red-bg);
}
.dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  display: inline-block;
}
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-width);
  padding: 24px 14px 16px;
  background: var(--sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 30;
  transition:
    transform 0.2s,
    width 0.2s;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px 30px;
  font-weight: 650;
  letter-spacing: -0.4px;
  font-size: 17px;
}
.brand img {
  width: 34px;
  height: 34px;
}
.brand small {
  font-size: 10px;
  color: var(--muted-foreground);
  font-weight: 400;
  letter-spacing: 1px;
  display: block;
  line-height: 1.2;
}
.nav-label {
  font-size: 10px;
  letter-spacing: 1.6px;
  color: var(--muted-foreground);
  padding: 12px 14px 8px;
}
.nav-link {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  margin: 3px 0;
  border-radius: 7px;
  font-size: 13px;
  color: var(--muted-foreground);
  font-weight: 500;
}
.nav-link:hover {
  background: var(--accent);
  color: var(--foreground);
}
.nav-link.active {
  background: var(--accent);
  color: var(--foreground);
  font-weight: 600;
}
.nav-link.active:after {
  content: "";
  margin-left: auto;
  width: 5px;
  height: 5px;
  background: var(--primary);
  border-radius: 50%;
}
.sidebar-bottom {
  margin-top: auto;
}
.workspace-switch {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  margin-bottom: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 12px;
}
.workspace-switch .icon {
  color: var(--muted-foreground);
}
.workspace-switch span:last-child {
  margin-left: auto;
}
.user-block {
  padding: 14px 8px 0;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}
.avatar {
  width: 34px;
  height: 34px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--secondary);
  display: grid;
  place-items: center;
  color: var(--foreground);
  font-weight: 600;
  flex-shrink: 0;
}
.user-meta {
  min-width: 0;
  flex: 1;
}
.user-meta strong {
  font-size: 12px;
  font-weight: 550;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
}
.user-meta small {
  color: var(--muted-foreground);
  font-size: 10px;
}
.shell {
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  transition: margin-left 0.2s;
}
.topbar {
  height: 60px;
  border-bottom: 1px solid var(--border);
  padding: 0 36px;
  display: flex;
  align-items: center;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--background);
}
.crumb {
  font-size: 12px;
  color: var(--muted-foreground);
}
.crumb b {
  color: var(--foreground);
  font-weight: 500;
}
.topbar-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 15px;
}
.timezone {
  font-size: 11px;
  color: var(--muted-foreground);
  display: flex;
  align-items: center;
  gap: 6px;
}
.sidebar-toggle {
  flex-shrink: 0;
}
.content {
  max-width: 1320px;
  margin: auto;
  padding: 38px 40px 20px;
  min-width: 0;
}
.page-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 27px;
}
.page-heading p {
  font-size: 12px;
  color: var(--muted-foreground);
  margin-top: 7px;
}
.card {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.card-heading {
  padding: 20px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.card-heading p {
  font-size: 12px;
  color: var(--muted-foreground);
  margin-top: 4px;
}
.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}
.stat {
  padding: 19px 20px;
}
.stat-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted-foreground);
  font-size: 12px;
}
.stat-label .icon {
  width: 16px;
  height: 16px;
}
.stat-value {
  font-size: 28px;
  letter-spacing: -1px;
  font-weight: 600;
  margin: 10px 0 5px;
  line-height: 1.2;
}
.stat-note {
  font-size: 10px;
  color: var(--muted-foreground);
}
.workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 20px;
  align-items: start;
}
.stack {
  display: grid;
  gap: 20px;
}
.account-list {
  padding: 0 20px 4px;
}
.account-row {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  align-items: center;
  gap: 13px;
  padding: 20px 0;
  border-top: 1px solid var(--border);
  min-width: 0;
}
.account-row .avatar {
  width: 40px;
  height: 40px;
  border-radius: 11px;
}
.account-name {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 0;
}
.account-name strong {
  font-weight: 600;
  font-size: 13px;
  overflow-wrap: anywhere;
}
.account-meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 10px;
  color: var(--muted-foreground);
  margin-top: 4px;
}
.account-body {
  flex: 1;
  min-width: 0;
}
.account-controls {
  display: flex;
  grid-column: 2;
  flex-wrap: wrap;
  gap: 6px;
  flex-shrink: 0;
}
.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  justify-content: center;
  padding: 46px 20px;
  color: var(--muted-foreground);
  min-height: 200px;
}
.empty-icon {
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  border: 1px solid var(--border);
  border-radius: 14px;
  margin-bottom: 16px;
  background: var(--secondary);
}
.empty-icon .icon {
  width: 23px;
  height: 23px;
}
.empty h3 {
  color: var(--foreground);
  margin-bottom: 6px;
}
.empty p {
  font-size: 12px;
  margin-bottom: 18px;
  max-width: 300px;
}
.empty.compact {
  min-height: 180px;
  padding: 25px 18px;
}
.plan-content {
  padding: 0 22px 21px;
}
.plan-clock {
  font-size: 40px;
  font-weight: 550;
  letter-spacing: -2px;
  line-height: 1.4;
}
.plan-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 15px 0 0;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  font-size: 12px;
}
.plan-content .button {
  width: 100%;
  margin-top: 15px;
}
.plan-content p {
  font-size: 11px;
  margin-top: 9px;
}
.plan-form {
  display: grid;
  gap: 16px;
}
.plan-form label {
  font-size: 12px;
  font-weight: 500;
  display: grid;
  gap: 6px;
}
.plan-form input[type="time"] {
  font-size: 25px;
  letter-spacing: 1px;
  height: 58px;
  width: 100%;
  font-variant-numeric: tabular-nums;
}
.switch-row {
  display: flex !important;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
  padding: 4px 0;
}
.switch-row small {
  display: block;
  font-size: 11px;
  color: var(--muted-foreground);
  font-weight: 400;
  margin-top: 4px;
}
.switch {
  appearance: none;
  width: 34px;
  height: 19px;
  border-radius: 20px;
  background: var(--border);
  position: relative;
  cursor: pointer;
  transition: background 0.2s;
  flex-shrink: 0;
}
.switch:before {
  content: "";
  position: absolute;
  left: 3px;
  top: 3px;
  border-radius: 50%;
  width: 13px;
  height: 13px;
  background: var(--card);
  box-shadow: 0 1px 2px #0002;
  transition: transform 0.2s;
}
.switch:checked {
  background: var(--primary);
}
.switch:checked:before {
  transform: translateX(15px);
  background: var(--primary-foreground);
}
.input,
input:not([type="checkbox"]),
select {
  height: 36px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--background);
  color: var(--foreground);
  padding: 0 10px;
  min-width: 0;
  max-width: 100%;
  font-size: 12px;
}
input::placeholder {
  color: var(--muted-foreground);
}
.table-scroll {
  overflow-x: auto;
  max-width: 100%;
}
table {
  border-collapse: collapse;
  width: 100%;
  text-align: left;
  font-size: 12px;
  white-space: nowrap;
}
th {
  height: 40px;
  color: var(--muted-foreground);
  font-weight: 450;
  background: var(--sidebar);
  font-size: 11px;
}
th,
td {
  padding: 12px 20px;
  border-top: 1px solid var(--border);
}
td {
  height: 63px;
}
td .secondary-text {
  display: block;
  font-size: 10px;
  color: var(--muted-foreground);
  margin-top: 2px;
}
td.wrap {
  white-space: normal;
  min-width: 190px;
  max-width: 320px;
  overflow-wrap: anywhere;
}
td:first-child strong {
  font-weight: 550;
}
.table-bottom {
  padding: 13px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--border);
  color: var(--muted-foreground);
  font-size: 11px;
}
.table-bottom .actions {
  gap: 7px;
}
.filters {
  padding: 0 20px 20px;
  display: flex;
  align-items: end;
  gap: 10px;
  flex-wrap: wrap;
}
.filters label {
  display: grid;
  gap: 5px;
  font-size: 10px;
  color: var(--muted-foreground);
  flex: 1;
  min-width: 115px;
}
.filters label.narrow {
  flex: 0.7;
}
.filters input,
.filters select {
  width: 100%;
}
.filters .button {
  flex-shrink: 0;
}
.section-gap {
  margin-top: 22px;
}
.info-card {
  padding: 20px 22px;
}
.info-card h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}
.info-card p {
  font-size: 12px;
  line-height: 1.9;
  color: var(--muted-foreground);
}
.info-card .icon {
  width: 16px;
  height: 16px;
}
.info-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  padding: 11px 0;
  border-top: 1px solid var(--border);
}
.info-row:first-of-type {
  border-top: 0;
}
.footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--muted-foreground);
  font-size: 10px;
  padding: 27px 0 10px;
  gap: 12px;
}
.footer span:last-child {
  display: flex;
  align-items: center;
  gap: 6px;
}
.notice {
  padding: 12px 15px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 20px;
  background: var(--sidebar);
}
.notice.warning {
  color: var(--amber);
  background: var(--amber-bg);
  border: 0;
}
.error-box {
  color: var(--red);
  background: var(--red-bg);
  border-radius: 8px;
  padding: 14px 16px;
  margin: 10px 0;
  font-size: 12px;
}
.settings-grid {
  display: grid;
  grid-template-columns: minmax(0, 760px);
  gap: 20px;
}
.settings-form {
  padding: 4px 24px 24px;
}
.settings-form .plan-clock {
  display: none;
}
.detail-list {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}
.detail-list div {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  font-size: 12px;
}
.detail-list span:first-child {
  color: var(--muted-foreground);
}
dialog {
  width: min(420px, calc(100% - 32px));
  max-height: calc(100vh - 32px);
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--card);
  color: var(--foreground);
  padding: 24px;
  box-shadow: 0 20px 70px #0002;
}
dialog::backdrop {
  background: #09090b66;
  backdrop-filter: blur(3px);
}
.dialog-top {
  display: flex;
  justify-content: space-between;
  align-items: start;
  margin-bottom: 12px;
}
.dialog-top h2 {
  font-size: 19px;
}
.dialog-top .eyebrow {
  font-size: 10px;
}
.dialog-top + p {
  font-size: 12px;
}
.qr-body {
  height: 235px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 20px 0;
  flex-direction: column;
  gap: 12px;
}
.qr-body img {
  width: 210px;
  height: 210px;
  padding: 12px;
  background: #fff;
  border-radius: 8px;
  border: 1px solid var(--border);
  image-rendering: pixelated;
}
.dialog-footer {
  border-top: 1px solid var(--border);
  padding-top: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-size: 12px;
}
#toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  max-width: calc(100% - 32px);
  padding: 12px 18px;
  background: var(--foreground);
  color: var(--background);
  border-radius: 9px;
  box-shadow: 0 4px 20px #0002;
  font-size: 13px;
  z-index: 100;
}
.initial-loading {
  height: 100vh;
  display: grid;
  place-items: center;
  color: var(--muted-foreground);
}
.loading-line {
  padding: 35px;
  text-align: center;
  color: var(--muted-foreground);
  font-size: 12px;
}
.skeleton {
  background: var(--secondary);
  border-radius: 6px;
  height: 24px;
  width: 40%;
  animation: pulse 1.6s infinite;
}
.stat-value.skeleton {
  height: 34px;
}
.login-shell {
  position: relative;
  isolation: isolate;
  display: grid;
  place-items: center;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 80px 20px 52px;
  background: color-mix(in srgb, var(--background) 88%, var(--muted));
}
/* Credit's Aurora layout, using a softer sky-to-violet wash for this portal. */
.login-aurora {
  position: absolute;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
  mask-image: radial-gradient(ellipse at 100% 0%, #000 6%, transparent 73%);
}
.login-aurora::before {
  content: "";
  position: absolute;
  inset: -32px;
  background: repeating-linear-gradient(104deg, transparent 0 5%, #b9d8fc 9%, #dbe7ff 13%, #dcd7fc 18%, transparent 24%);
  filter: blur(20px);
  opacity: 0.82;
  animation: login-aurora 22s ease-in-out infinite alternate;
}
.dark .login-aurora::before {
  background: repeating-linear-gradient(104deg, transparent 0 5%, #26518f 9%, #304b83 13%, #493570 18%, transparent 24%);
  opacity: 0.58;
}
@keyframes login-aurora {
  from { transform: translateX(0); }
  to { transform: translateX(-5%); }
}
.login-theme {
  position: absolute;
  right: max(18px, env(safe-area-inset-right));
  top: max(18px, env(safe-area-inset-top));
  width: 42px;
  height: 42px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--card);
}
.auth-box {
  width: 100%;
  max-width: 368px;
}
.login-heading {
  text-align: center;
  margin-bottom: 28px;
}
.login-heading h1 {
  font-size: clamp(28px, 6vw, 34px);
  font-weight: 750;
  letter-spacing: -0.045em;
}
.login-heading em {
  color: var(--primary);
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 700;
  letter-spacing: -0.055em;
  white-space: nowrap;
}
.login-heading p,
.auth-help {
  color: var(--muted-foreground);
  text-align: center;
}
.login-heading p {
  margin-top: 7px;
  font-size: 14px;
}
.auth-form-surface {
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: color-mix(in srgb, var(--card) 94%, transparent);
  box-shadow: 0 12px 35px rgb(24 24 27 / 5%);
}
.auth-help {
  margin: 18px auto 0;
  font-size: 12px;
}
@media (prefers-reduced-motion: reduce) {
  .login-aurora::before { animation: none; }
}
.backdrop {
  display: none;
}
[hidden] {
  display: none !important;
}
@keyframes pulse {
  50% {
    opacity: 0.4;
  }
}
@keyframes enter {
  from {
    opacity: 0;
    transform: translateY(5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.content > section {
  animation: enter 0.25s ease-out;
}
.workspace-home {
  max-width: 1080px;
  margin: 0 auto;
}
.plan-summary {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 19px 22px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--sidebar);
  margin-bottom: 32px;
}
.plan-summary-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--card);
  color: var(--muted-foreground);
}
.plan-summary-text {
  flex: 1;
  min-width: 0;
}
.plan-summary-text > div {
  display: flex;
  align-items: center;
  gap: 10px;
}
.plan-summary-text strong {
  font-size: 13px;
  font-weight: 600;
}
.plan-summary-text p {
  color: var(--muted-foreground);
  font-size: 12px;
  margin-top: 4px;
}
.plan-summary-text b {
  color: var(--foreground);
  font-weight: 500;
}
.plan-summary-text p span {
  margin-left: 12px;
}
.workspace-accounts-heading,
.workspace-activity-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  gap: 12px;
}
.workspace-accounts-heading h2 {
  display: flex;
  align-items: center;
  gap: 10px;
}
.workspace-date {
  color: var(--muted-foreground);
  font-size: 12px;
}
.workspace-home .account-list {
  padding: 0 24px;
}
.workspace-account {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 0.8fr) auto;
  gap: 24px;
  padding: 26px 0;
  align-items: center;
}
.workspace-account + .workspace-account {
  border-top: 1px solid var(--border);
}
.account-identity {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-width: 0;
}
.account-identity .avatar {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  margin-top: 2px;
  flex-shrink: 0;
}
.workspace-account .account-name strong {
  font-size: 14px;
}
.account-scope {
  font-size: 12px;
  color: var(--muted-foreground);
  margin-top: 5px;
}
.account-uid {
  font-size: 11px;
  color: var(--muted-foreground);
  margin-top: 2px;
  overflow-wrap: anywhere;
}
.account-outcome strong {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 500;
}
.account-outcome strong .icon {
  width: 16px;
  height: 16px;
}
.account-outcome p {
  font-size: 11px;
  color: var(--muted-foreground);
  margin-top: 5px;
}
.account-outcome.success strong {
  color: var(--green);
}
.account-outcome.expired strong {
  color: var(--red);
}
.account-outcome.running strong {
  color: var(--amber);
}
.account-outcome.waiting strong,
.account-outcome.paused strong {
  color: var(--muted-foreground);
}
.account-row-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-end;
}
.account-row-actions .button {
  font-size: 12px;
  min-width: 74px;
  padding: 0 12px;
}
.account-secondary-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 4px 14px;
}
.account-detail-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--muted-foreground);
  font-size: 12px;
  background: transparent;
  border: 0;
  padding: 4px 0;
}
.account-detail-link:hover {
  color: var(--foreground);
}
.account-detail-link .icon {
  width: 13px;
  height: 13px;
}
.workspace-activity {
  margin-top: 32px;
}
.workspace-activity h2 {
  font-size: 14px;
}
.activity-row {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 15px 0;
  border-top: 1px solid var(--border);
}
.activity-mark {
  display: grid;
  place-items: center;
  background: var(--secondary);
  width: 30px;
  height: 30px;
  border-radius: 50%;
  flex-shrink: 0;
  color: var(--muted-foreground);
}
.activity-mark .icon {
  width: 16px;
  height: 16px;
}
.activity-mark.success {
  color: var(--green);
  background: var(--green-bg);
}
.activity-copy {
  flex: 1;
  min-width: 0;
}
.activity-copy strong {
  font-size: 12px;
  font-weight: 500;
  overflow-wrap: anywhere;
}
.activity-copy p,
.activity-row time {
  color: var(--muted-foreground);
  font-size: 11px;
}
.activity-empty {
  font-size: 12px;
  padding: 20px 0;
  color: var(--muted-foreground);
  border-top: 1px solid var(--border);
}
@media (min-width: 641px) and (max-width: 1150px) {
  .workspace-account {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 14px 20px;
  }
  .account-outcome {
    grid-column: 1;
    margin-left: 54px;
  }
  .account-row-actions {
    grid-column: 2;
    grid-row: 1 / 3;
  }
}
@media (max-width: 640px) {
  .plan-summary {
    padding: 16px;
    gap: 10px;
    margin-bottom: 26px;
  }
  .plan-summary-icon {
    display: none;
  }
  .plan-summary-text p span {
    display: block;
    margin: 2px 0 0;
    font-size: 11px;
  }
  .plan-summary > button {
    padding: 0 10px;
    height: 34px;
  }
  .workspace-home .account-list {
    padding: 0 16px;
  }
  .workspace-account {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
    padding: 20px 0;
  }
  .workspace-account .account-identity {
    gap: 10px;
  }
  .account-outcome {
    margin-left: 52px;
  }
  .account-outcome p {
    margin-top: 3px;
  }
  .account-row-actions {
    gap: 5px;
    padding-top: 2px;
  }
  .account-row-actions .button {
    min-height: 38px;
    padding: 0 13px;
  }
  .account-row-actions .actions {
    flex-wrap: nowrap;
  }
  .account-row-actions .account-detail-link {
    padding: 10px 0;
    font-size: 12px;
  }
  .workspace-activity {
    margin-top: 26px;
  }
  .activity-row {
    flex-wrap: wrap;
    gap: 8px 10px;
  }
  .activity-row time {
    width: 100%;
    padding-left: 40px;
    margin-top: -5px;
    font-size: 10px;
  }
}
.range-stats {
  padding: 0 20px;
}
.range-stats .stat {
  box-shadow: none;
  background: var(--sidebar);
}
@media (min-width: 1500px) {
  .content {
    padding-top: 45px;
  }
  .workspace-grid {
    grid-template-columns: minmax(0, 1fr) 320px;
  }
}
@media (max-width: 1150px) {
  :root {
    --sidebar-width: 196px;
  }
  .content {
    padding: 28px 24px;
  }
  .topbar {
    padding: 0 24px;
  }
  .workspace-grid {
    grid-template-columns: minmax(0, 1fr) 260px;
  }
  .account-row {
    flex-wrap: wrap;
  }
  .account-controls {
    margin-left: 0;
  }
  .stats {
    gap: 10px;
  }
  .stat {
    padding: 17px 15px;
  }
}
@media (max-width: 850px) {
  .workspace-grid {
    grid-template-columns: 1fr;
  }
  .workspace-grid > .stack {
    grid-template-columns: 1fr 1fr;
  }
  .settings-grid {
    grid-template-columns: 1fr;
  }
  .account-row {
    flex-wrap: nowrap;
  }
  .account-controls {
    margin-left: 0;
  }
  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 640px) {
  .sidebar {
    transform: translateX(-100%);
    width: 224px;
  }
  .shell {
    margin-left: 0;
  }
  .nav-open .sidebar {
    transform: translateX(0);
  }
  .nav-open .backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: #0006;
    z-index: 25;
    border: 0;
  }
  .mobile-menu {
    display: inline-flex;
  }
  .topbar {
    height: 56px;
    padding: 0 15px;
    gap: 9px;
  }
  .topbar-right {
    gap: 7px;
  }
  .timezone {
    font-size: 10px;
  }
  .timezone .icon {
    display: none;
  }
  .content {
    padding: 25px 16px 15px;
  }
  .page-heading {
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 22px;
  }
  .page-heading h1 {
    font-size: 23px;
  }
  .page-heading > .actions .button {
    padding: 0 10px;
  }
  .page-heading p {
    font-size: 11px;
    max-width: 220px;
  }
  .eyebrow {
    font-size: 9px;
  }
  .stats {
    gap: 10px;
    margin-bottom: 18px;
  }
  .stat {
    padding: 16px;
  }
  .stat-value {
    font-size: 26px;
  }
  .stat-note {
    font-size: 10px;
  }
  .workspace-grid {
    gap: 16px;
  }
  .workspace-grid > .stack {
    grid-template-columns: 1fr;
  }
  .account-row {
    align-items: start;
  }
  .account-controls {
    grid-column: 1 / -1;
    margin-left: 0;
    padding-top: 4px;
    gap: 8px;
  }
  .account-controls .button {
    flex: 1 1 auto;
    min-height: 40px;
  }
  .account-meta > span {
    overflow-wrap: anywhere;
  }
  .account-list {
    padding: 0 16px 3px;
  }
  .card-heading {
    padding: 18px;
  }
  .card-heading h2 {
    font-size: 15px;
  }
  .card-heading p {
    font-size: 11px;
  }
  .filters {
    padding: 0 16px 16px;
    gap: 8px;
  }
  .filters label {
    min-width: calc(50% - 8px);
  }
  .table-bottom {
    padding: 13px 15px;
  }
  th,
  td {
    padding: 11px 16px;
  }
  .footer {
    font-size: 9px;
    padding-top: 23px;
  }
  .settings-form {
    padding: 0 20px 20px;
  }
  .page-heading .eyebrow {
    margin-bottom: 5px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *:before {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

/* Operational copy stays readable at desktop and phone sizes. */
.stat-note {
  font-size: 11px;
}
.account-meta {
  font-size: 12px;
}
.badge {
  font-size: 12px;
}
.nav-link {
  font-size: 14px;
}
table {
  font-size: 13px;
}
th {
  font-size: 12px;
}
td .secondary-text {
  font-size: 11px;
}
.plan-form label {
  font-size: 13px;
}
.auth-form small {
  font-size: 11px;
}
.footer {
  font-size: 11px;
}
.card-heading p {
  font-size: 12px;
}
@media (max-width: 640px) {
  .account-meta {
    font-size: 11px;
  }
  .stat-note {
    font-size: 11px;
  }
  .button.small {
    height: 34px;
  }
  .footer {
    font-size: 10px;
  }
}

/* Desktop rail keeps every navigation destination available by icon. */
@media (min-width: 641px) {
  .sidebar-collapsed {
    --sidebar-width: 72px;
  }
  .sidebar-collapsed .sidebar {
    padding-inline: 14px;
  }
  .sidebar-collapsed .sidebar .brand {
    padding-inline: 0;
    justify-content: center;
  }
  .sidebar-collapsed .sidebar .brand > span,
  .sidebar-collapsed .nav-label,
  .sidebar-collapsed .nav-text,
  .sidebar-collapsed .user-meta,
  .sidebar-collapsed .workspace-switch > span,
  .sidebar-collapsed .nav-link.active:after {
    display: none;
  }
  .sidebar-collapsed .sidebar nav {
    margin-top: 20px;
  }
  .sidebar-collapsed .nav-link {
    padding: 12px;
    justify-content: center;
  }
  .sidebar-collapsed .workspace-switch {
    padding: 12px;
    justify-content: center;
  }
  .sidebar-collapsed .user-block {
    flex-direction: column;
    padding: 14px 0 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  .sidebar,
  .shell {
    transition: none;
  }
}

/* Client navigation follows Credit UI Starter's CDK FloatingDock. */
.client-header {
  width: min(1144px, 100%);
  height: 92px;
  margin: 0 auto;
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.client-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}
.client-brand img {
  width: 34px;
  height: 34px;
}
.client-brand > span {
  font-size: 17px;
  font-weight: 650;
  line-height: 1.3;
}
.client-brand small {
  display: block;
  font-size: 9px;
  letter-spacing: 0.12em;
  color: var(--muted-foreground);
  font-weight: 400;
  margin-top: 3px;
}
.client-account {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  color: var(--muted-foreground);
}
.client-account > span:first-child {
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.client-account .avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  color: var(--foreground);
}
.client-mode .client-content {
  width: 100%;
  max-width: 1144px;
  padding: 28px 32px 140px;
  margin: 0 auto;
}
.client-mode .page-heading {
  margin-bottom: 28px;
}
.client-mode .page-heading h1 {
  font-size: 28px;
  letter-spacing: -0.8px;
}
.client-dock {
  position: fixed;
  bottom: max(16px, env(safe-area-inset-bottom));
  left: 50%;
  translate: -50% 0;
  z-index: 20;
}
.dock-nav,
.dock-toggle {
  border: 1px solid color-mix(in srgb, var(--border) 60%, transparent);
  background: color-mix(in srgb, var(--card) 74%, transparent);
  backdrop-filter: blur(14px);
  box-shadow: 0 8px 18px rgb(24 24 27 / 12%), 0 2px 4px rgb(24 24 27 / 5%);
}
.dock-nav {
  display: flex;
  align-items: end;
  gap: 8px;
  height: 64px;
  padding: 0 15px 11px;
  border-radius: 15px;
}
.dock-link,
.dock-toggle {
  position: relative;
  display: grid;
  place-items: center;
  flex: none;
  border-radius: 50%;
  color: var(--foreground);
}
.dock-link {
  width: calc(40px + var(--dock-grow, 0) * 30px);
  height: calc(40px + var(--dock-grow, 0) * 30px);
  background: color-mix(in srgb, var(--secondary) 94%, var(--foreground));
  transition: width 150ms ease-out, height 150ms ease-out, background-color 150ms;
}
.dock-link .icon {
  width: calc(20px + var(--dock-grow, 0) * 15px);
  height: calc(20px + var(--dock-grow, 0) * 15px);
  stroke-width: 1.75;
  transition: width 150ms ease-out, height 150ms ease-out;
}
.dock-link[aria-current="page"] {
  background: color-mix(in srgb, var(--secondary) 85%, var(--foreground));
}
.dock-label {
  position: absolute;
  bottom: calc(100% + 9px);
  left: 50%;
  translate: -50% 4px;
  padding: 2px 7px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--card);
  box-shadow: var(--shadow);
  font-size: 12px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 150ms, translate 150ms;
}
.dock-link:is(:hover, :focus-visible) .dock-label {
  opacity: 1;
  translate: -50% 0;
}
.dock-divider {
  width: 1px;
  height: 38px;
  margin: 0 3px 1px;
  background: var(--border);
}
.dock-toggle {
  display: none;
}
@media (max-width: 760px) {
  .client-dock {
    left: 50%;
    right: auto;
    bottom: max(12px, env(safe-area-inset-bottom));
    translate: -50% 0;
  }
  .dock-toggle {
    display: none;
  }
  .dock-nav {
    display: flex;
    position: static;
    flex-direction: row;
    align-items: center;
    height: 58px;
    padding: 5px 8px;
    gap: 4px;
    border-radius: 999px;
  }
  .dock-link {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    width: auto;
    min-width: 68px;
    height: 46px;
    padding: 4px 12px;
    border-radius: 999px;
    background: transparent;
    color: var(--muted-foreground);
  }
  .dock-link .icon {
    width: 18px;
    height: 18px;
  }
  .dock-link[aria-current="page"] {
    background: var(--secondary);
    color: var(--foreground);
  }
  .dock-label,
  .dock-link:is(:hover, :focus-visible) .dock-label {
    position: static;
    opacity: 1;
    translate: none;
    padding: 0;
    border: 0;
    background: none;
    box-shadow: none;
    font-size: 11px;
    line-height: 1;
    color: inherit;
  }
  .dock-divider {
    height: 24px;
    margin: 0 2px;
  }
}
.client-mode #toast {
  bottom: calc(118px + env(safe-area-inset-bottom));
}
.client-profile {
  max-width: 880px;
  margin: 0 auto;
}
.profile-identity {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 0 28px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--border);
}
.profile-identity .avatar {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  font-size: 21px;
  flex-shrink: 0;
}
.profile-identity h2 {
  font-size: 18px;
  overflow-wrap: anywhere;
}
.profile-identity p {
  color: var(--muted-foreground);
  font-size: 12px;
  margin-top: 3px;
}
.profile-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  align-items: start;
  gap: 24px;
}
.profile-preferences {
  display: grid;
  gap: 18px;
  min-width: 0;
}
.profile-appearance {
  padding: 0 22px 22px;
}
.profile-action {
  padding: 18px 22px;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  border: 0;
  text-align: left;
  background: transparent;
  font-size: 13px;
  color: var(--foreground);
}
.profile-action:hover {
  background: var(--accent);
}
.profile-action + .profile-action {
  border-top: 1px solid var(--border);
}
.profile-action .icon {
  width: 16px;
  height: 16px;
  color: var(--muted-foreground);
}
.profile-action .icon:last-child {
  margin-left: auto;
}
.plan-guide {
  border-top: 1px solid var(--border);
  padding-top: 16px;
  margin-top: 22px;
  font-size: 12px;
  color: var(--muted-foreground);
}
.plan-guide summary {
  cursor: pointer;
  width: fit-content;
}
.plan-guide p {
  margin-top: 10px;
  line-height: 1.9;
}
@media (max-width: 760px) {
  .profile-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
  }
}
@media (max-width: 640px) {
  .client-header {
    height: 76px;
    padding: 0 20px;
  }
  .client-brand img {
    width: 32px;
    height: 32px;
  }
  .client-brand small {
    font-size: 8px;
  }
  .client-account > span:first-child {
    display: none;
  }
  .client-mode .client-content {
    padding: 18px 16px 116px;
  }
  .client-mode .page-heading {
    margin-bottom: 24px;
  }
  .client-mode .page-heading h1 {
    font-size: 25px;
  }
  .profile-identity {
    padding-bottom: 22px;
    margin-bottom: 20px;
  }
  .client-profile .settings-form {
    padding: 0 20px 22px;
  }
  .profile-appearance {
    padding: 0 20px 20px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .dock-link,
  .dock-link .icon,
  .dock-label,
  .dock-toggle .icon {
    transition: none;
  }
  .dock-toggle[aria-expanded="true"] + .dock-nav {
    animation: none;
  }
}

/* Client records: Credit-style table and check-in receipt. */
.personal-runs h2 {
  font-size: 16px;
  font-weight: 650;
  margin-bottom: 12px;
}
.run-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
.run-stat-tile {
  min-width: 0;
  border-radius: var(--radius);
  background: var(--muted);
  padding: 14px 16px;
}
.run-stat-tile > div {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  color: var(--muted-foreground);
  font-size: 13px;
}
.run-stat-tile > strong {
  display: block;
  margin-top: 5px;
  font-size: 27px;
  line-height: 1.3;
  font-variant-numeric: tabular-nums;
}
.run-stat-icon {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--background);
}
.run-stat-icon .icon { width: 15px; height: 15px; }
.run-stat-icon.success { background: var(--green-bg); color: var(--green); }
.run-stat-icon.failed { background: var(--red-bg); color: var(--red); }
.run-stat-icon.signed {
  background: color-mix(in srgb, var(--primary) 12%, var(--background));
  color: var(--primary);
}
.run-records { margin-top: 28px; }
.run-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  margin-bottom: 12px;
}
.personal-runs .credit-filter-form {
  align-items: center;
  gap: 6px;
  padding: 0;
}
.personal-runs .credit-filter-form > .credit-field {
  flex: 0 1 auto;
  width: 112px;
  min-width: 0;
}
.personal-runs .credit-filter-form > .credit-field-account {
  width: 168px;
}
.personal-runs .credit-filter-form [data-slot="label"] {
  position: absolute;
  clip-path: inset(50%);
  width: 1px;
  height: 1px;
  overflow: hidden;
  white-space: nowrap;
}
.personal-runs .credit-filter-form :is(input:not([type="hidden"]), button:not(.credit-date-preset)) {
  height: 32px;
  padding-inline: 8px;
}
.personal-runs .credit-filter-form :is(input:not([type="hidden"]), button:not([data-action]):not(.credit-date-preset)) {
  border: 1px dashed var(--border);
  border-radius: 8px;
}
.run-pager, .run-page-stepper {
  display: flex;
  align-items: center;
}
.run-pager {
  gap: 8px;
  color: var(--muted-foreground);
  font-size: 12px;
}
.run-page-stepper, .personal-runs .run-refresh {
  border: 1px dashed var(--border);
  border-radius: 8px;
  height: 32px;
  background: var(--background);
}
.run-page-stepper > span {
  padding-inline: 8px;
  border-inline: 1px dashed var(--border);
  line-height: 30px;
}
.run-page-stepper button {
  width: 29px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--foreground);
  font-size: 18px;
  line-height: 1;
}
.run-page-stepper button:hover:not(:disabled) { background: var(--muted); }
.personal-runs .run-refresh { width: 32px; padding: 0; }
.run-table-frame {
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}
.personal-run-table :is(th, td) {
  height: auto;
  padding: 6px 10px;
  border-top: 0;
  border-bottom: 1px dashed var(--border);
}
.personal-run-table th {
  padding-block: 10px;
  background: transparent;
  color: var(--foreground);
  font-weight: 600;
}
.personal-run-table tr:last-child td { border-bottom: 0; }
.personal-run-table tbody tr:hover { background: var(--sidebar); }
.personal-run-table :is(th, td):last-child { text-align: right; }
.personal-run-table .run-account-name,
.personal-run-table .run-note > span {
  display: block;
  max-width: 200px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.personal-run-table .run-note { color: var(--muted-foreground); }
.personal-run-table .badge, .run-receipt-fields .badge {
  padding: 2px 8px;
  border-radius: 999px;
}
.personal-run-table .badge .dot, .run-receipt-fields .badge .dot { display: none; }
.personal-run-table .run-detail-button { gap: 4px; padding-inline: 6px; }
.personal-run-table .run-detail-button .icon { width: 14px; height: 14px; }

.portal-page:has(.run-receipt[open]) { overflow: hidden; }
.run-receipt {
  position: fixed;
  inset: 0;
  width: min(480px, calc(100% - 24px));
  max-height: calc(100dvh - 32px);
  margin: auto;
  padding: 0;
  border-radius: 16px;
  overscroll-behavior: contain;
}
.run-receipt::backdrop { background: #09090b80; backdrop-filter: none; }
.run-receipt-paper { position: relative; padding: 24px; }
.run-receipt-paper .run-receipt-close {
  position: absolute;
  inset: 8px 8px auto auto;
  width: 36px;
  height: 36px;
  padding: 0;
  color: var(--muted-foreground);
  font-size: 22px;
  line-height: 1;
}
.run-receipt-paper .run-receipt-header {
  padding: 0 24px 18px;
  text-align: center;
  border-bottom: 2px dashed var(--border);
}
.run-receipt-header h2 {
  margin: 0 0 4px;
  font-size: 23px;
  font-weight: 750;
  letter-spacing: 0.08em;
}
.run-receipt-header p { color: var(--muted-foreground); font-size: 12px; }
.run-receipt-total {
  display: grid;
  justify-items: center;
  gap: 3px;
  padding: 18px 0 22px;
  color: var(--muted-foreground);
  font-size: 13px;
}
.run-receipt-total strong {
  font-size: 46px;
  line-height: 1.08;
  font-variant-numeric: tabular-nums;
  color: var(--foreground);
}
.run-receipt-paper .run-receipt-fields {
  margin: 0;
  padding: 9px 0;
  border-block: 2px dashed var(--border);
  font-size: 13px;
}
.run-receipt-fields > div {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  padding-block: 7px;
  border-bottom: 1px dashed var(--border);
}
.run-receipt-fields > div:last-child { border-bottom: 0; }
.run-receipt-fields dt { color: var(--muted-foreground); }
.run-receipt-fields dd { margin: 0; text-align: right; overflow-wrap: anywhere; }
.run-receipt-topics { padding-top: 15px; }
.run-receipt-topics h3 { font-size: 13px; font-weight: 650; }
.run-receipt-topics .run-topics-content { min-width: 0; max-width: none; }
.run-receipt-topics .run-topics-content .topic-list { max-height: none; }
.run-receipt-topics .topic-list > li { padding: 7px 0; border-bottom-style: dashed; }

@media (max-width: 850px) {
  .personal-run-table .col-note { display: none; }
}
@media (max-width: 560px) {
  .run-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .client-mode .personal-runs .page-heading { margin-bottom: 16px; }
  .run-stat-tile { padding: 8px 12px; }
  .run-stat-icon { width: 24px; height: 24px; }
  .run-stat-tile > strong { font-size: 23px; }
  .run-records { margin-top: 18px; }
  .personal-runs .credit-filter-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }
  .personal-runs .credit-filter-form > .credit-field,
  .personal-runs .credit-filter-form > .credit-field-account { width: auto; }
  .personal-runs .credit-date-presets,
  .personal-runs .credit-filter-actions { grid-column: 1 / -1; }
  .personal-runs .credit-filter-form :is(input:not([type="hidden"]), button:not(.credit-date-preset)) { height: 36px; }
  .personal-run-table { table-layout: fixed; }
  .personal-run-table :is(th, td) { padding-inline: 5px; font-size: 12px; }
  .personal-run-table .col-counts,
  .personal-run-table .col-trigger,
  .personal-run-table .col-user { display: none; }
  .personal-run-table .col-account { width: 32%; }
  .personal-run-table .col-time { width: 28%; }
  .personal-run-table .col-actions { width: 46px; }
  .personal-run-table :is(.run-time, .badge) { white-space: normal; }
  .personal-run-table .badge { line-height: 1.3; font-size: 11px; }
  .personal-run-table .secondary-text { overflow: hidden; text-overflow: ellipsis; }
  .personal-run-table .run-detail-button { width: 36px; height: 36px; }
  .personal-run-table .run-detail-button span { display: none; }
  .run-receipt-paper { padding: 20px 16px; }
}
/* Batch 1 & 2 UI polish: header theme toggle, account menu, clickable stats, admin flat tables */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.client-header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.workspace-home .card:has(.account-list),
.workspace-home .account-list {
  overflow: visible;
}

.account-more {
  position: relative;
}
.account-more > summary {
  list-style: none;
  cursor: pointer;
  user-select: none;
  padding: 4px 8px;
  border-radius: 999px;
  line-height: 1;
  letter-spacing: 0.08em;
}
.account-more > summary::-webkit-details-marker {
  display: none;
}
.account-more > summary:hover,
.account-more[open] > summary {
  background: var(--accent);
  color: var(--foreground);
}
.account-more-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 15;
  min-width: 124px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--card);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.12);
  display: grid;
  gap: 2px;
}
.dark .account-more-menu {
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
}
.account-more-item {
  width: 100%;
  text-align: left;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--foreground);
  font-size: 12px;
  padding: 7px 10px;
  cursor: pointer;
  white-space: nowrap;
}
.account-more-item:hover {
  background: var(--accent);
}

.credit-plan-form button[type="submit"] {
  width: 100%;
}
.client-profile .credit-plan-form button[type="submit"] {
  width: auto;
  justify-self: start;
  padding-inline: 18px;
}

.stat-link {
  display: block;
  color: inherit;
  text-decoration: none;
  transition: border-color 0.16s ease, background-color 0.16s ease, transform 0.16s ease;
}
.stat-link:hover {
  border-color: color-mix(in oklab, var(--foreground) 22%, var(--border));
  background: color-mix(in oklab, var(--accent) 45%, var(--card));
  transform: translateY(-1px);
}
.stat-link:focus-visible {
  outline: 2px solid var(--foreground);
  outline-offset: 2px;
}
.stat-alert {
  border-color: color-mix(in oklab, var(--red) 35%, var(--border));
  background: color-mix(in oklab, var(--red-bg) 55%, var(--card));
}
.stat-alert:hover {
  border-color: color-mix(in oklab, var(--red) 55%, var(--border));
  background: color-mix(in oklab, var(--red-bg) 78%, var(--card));
}
.stat-alert .stat-label .icon,
.stat-alert .stat-value {
  color: var(--red);
}

.overview-section {
  margin-top: 28px;
}
.overview-section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 14px;
  margin-bottom: 12px;
}
.overview-section-head h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
}
.overview-section-head p {
  margin: 3px 0 0;
  font-size: 12px;
  color: var(--muted-foreground);
}

.anomaly-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.anomaly-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 11px;
  border: 1px dashed var(--border);
  border-radius: 999px;
  background: var(--background);
  color: var(--muted-foreground);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.14s ease, color 0.14s ease, border-color 0.14s ease;
}
.anomaly-pill:hover {
  background: var(--accent);
  color: var(--foreground);
}
.anomaly-pill[aria-pressed="true"] {
  border-style: solid;
  border-color: var(--foreground);
  background: var(--foreground);
  color: var(--background);
}
.anomaly-pill .mono {
  font-size: 11px;
  opacity: 0.85;
}

.anomaly-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  white-space: nowrap;
}

.admin-flat-table {
  width: 100%;
}
.admin-flat-table :is(th, td) {
  height: auto;
  padding: 8px 10px;
  border-top: 0;
  border-bottom: 1px dashed var(--border);
}
.admin-flat-table th {
  padding-block: 10px;
  background: transparent;
  color: var(--foreground);
  font-weight: 600;
  white-space: nowrap;
}
.admin-flat-table tr:last-child td {
  border-bottom: 0;
}
.admin-flat-table tbody tr:hover {
  background: var(--sidebar);
}
.admin-flat-table :is(th, td):last-child {
  text-align: right;
}
.admin-flat-table .badge {
  padding: 2px 8px;
  border-radius: 999px;
}
.admin-flat-table .badge .dot {
  display: none;
}

.admin-users .users-toolbar-host {
  margin-bottom: 12px;
}
.admin-users .credit-users-toolbar {
  padding: 0;
}
.admin-users .credit-user-search > .credit-field {
  width: 220px;
}
.admin-runs .credit-filter-form > .credit-field,
.admin-logs .credit-filter-form > .credit-field {
  width: 124px;
}

@media (max-width: 640px) {
  .client-header-right {
    gap: 6px;
  }
  .overview-section-head {
    align-items: flex-start;
  }
  .run-toolbar {
    align-items: stretch;
  }
  .personal-runs .run-toolbar > .credit-controls {
    width: 100%;
    flex: 1 1 100%;
  }
  .personal-runs .credit-date-presets {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    width: 100%;
  }
  .anomaly-filters {
    width: 100%;
  }
  .admin-users .credit-users-toolbar {
    flex-wrap: wrap;
    gap: 8px;
  }
  .admin-users .credit-user-search > .credit-field {
    width: auto;
    flex: 1 1 auto;
  }
  .admin-runs .credit-filter-form > .credit-field,
  .admin-logs .credit-filter-form > .credit-field {
    width: auto;
  }
}
