:root {
  color-scheme: light;
  --bg: #f6f7f3;
  --panel: #ffffff;
  --panel-soft: #f0f4f1;
  --ink: #1c2420;
  --muted: #65716a;
  --line: #d7ddd6;
  --accent: #5f5600;
  --accent-ink: #fff9b8;
  --teal-soft: #fff9b8;
  --accent-border: rgba(95, 86, 0, 0.22);
  --accent-border-soft: rgba(95, 86, 0, 0.14);
  --accent-border-strong: rgba(95, 86, 0, 0.42);
  --accent-ring: rgba(254, 246, 91, 0.34);
  --accent-grid: rgba(95, 86, 0, 0.08);
  --accent-hover: #4f4800;
  --brand: #fef65b;
  --brand-soft: #fff9b8;
  --brand-ink: #5f5600;
  --brand-yellow: #fef65b;
  --alipay-blue: #1677ff;
  --alipay-blue-dark: #0958d9;
  --alipay-blue-soft: #e6f4ff;
  --paypal-blue: #002991;
  --paypal-blue-dark: #001f73;
  --paypal-blue-bright: #008cff;
  --paypal-blue-light: #60cdff;
  --paypal-blue-soft: #eef9ff;
  --paypal-button-blue: #0070ba;
  --paypal-button-blue-hover: #0064a8;
  --pi-surface-accent-soft: #fff9b8;
  --pi-surface-accent-strong: #5f5600;
  --amber: #9c6217;
  --error: #a5332d;
  --error-bg: #fff1ef;
  --code-bg: #111815;
  --code-ink: #fff9b8;
  --shadow: 0 14px 34px rgba(34, 48, 42, 0.1);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  width: 100%;
  height: 100%;
  overflow: hidden;
}

[hidden] {
  display: none !important;
}

body {
  width: 100%;
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  overflow: hidden;
  overscroll-behavior: none;
}

body.i18n-pending {
  visibility: hidden;
}

body.i18n-ready {
  visibility: visible;
}

body.auth-gate-open {
  overflow: hidden;
}

body.prompt-edit-approval-open {
  overflow: hidden;
}

body.settings-open {
  overflow: hidden;
}

body.auth-gate-open .support-feedback-widget,
body.prompt-edit-approval-open .support-feedback-widget,
body.alipay-recharge-open .support-feedback-widget {
  display: none;
}

button,
input,
textarea,
select {
  font: inherit;
}

.auth-gate {
  position: fixed;
  inset: 0;
  z-index: 1000;
  min-width: 0;
  min-height: 100vh;
  min-height: 100dvh;
  overflow: auto;
  background: #fffdf8;
  color: var(--ink);
}

.auth-layout {
  display: grid;
  grid-template-columns: minmax(420px, 1fr) minmax(420px, 1fr);
  min-height: 100vh;
  min-height: 100dvh;
}

.auth-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 30px clamp(34px, 5vw, 76px);
  background: #fffefb;
}

.auth-brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 44px;
}

.auth-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  color: #252826;
  font-size: 15px;
  font-weight: 780;
}

.auth-brand-logo {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
}

.auth-form-wrap {
  width: min(100%, 430px);
  margin: auto;
  padding: 54px 0 76px;
}

.auth-step {
  display: none;
}

.auth-step.is-active {
  display: block;
}

.auth-title {
  margin: 0;
  color: #171b18;
  font-size: 34px;
  line-height: 1.14;
  font-weight: 650;
  letter-spacing: 0;
}

.auth-copy {
  margin: 18px 0 0;
  color: #747b75;
  font-size: 16px;
  line-height: 1.62;
  font-weight: 520;
}

.auth-field {
  display: grid;
  gap: 9px;
  margin-top: 48px;
}

.auth-label {
  color: #2f3530;
  font-size: 14px;
  font-weight: 650;
}

.auth-input {
  width: 100%;
  height: 52px;
  padding: 0 15px;
  border: 1px solid #dfe2dc;
  border-radius: 6px;
  background: #fff;
  color: #222722;
  font-size: 17px;
  font-weight: 520;
  outline: none;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.auth-input:focus,
.auth-code-input:focus {
  border-color: #ddd32c;
  box-shadow: 0 0 0 4px rgba(254, 246, 91, 0.32);
}

.auth-field.has-error .auth-input,
.auth-code-input.has-error {
  border-color: #d76b60;
  background: #fffafa;
  box-shadow: 0 0 0 4px rgba(215, 107, 96, 0.12);
}

.auth-error {
  min-height: 20px;
  color: #b23831;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.45;
}

#authGate .auth-actions {
  display: grid;
  gap: 12px;
  margin-top: 30px;
}

#authGate .auth-primary,
#authGate .auth-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 54px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 680;
  letter-spacing: 0;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease, opacity 0.15s ease;
}

#authGate .auth-primary {
  border: 0;
  background: #101411;
  color: #fffdf8;
}

#authGate .auth-primary:hover {
  background: #202720;
}

#authGate .auth-primary:active,
#authGate .auth-secondary:active {
  transform: translateY(1px);
}

#authGate .auth-primary:disabled {
  opacity: 0.42;
  cursor: not-allowed;
  transform: none;
}

#authGate .auth-secondary {
  width: fit-content;
  height: auto;
  min-height: 0;
  margin: 0 auto;
  padding: 4px 10px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #778078;
  font-size: 14px;
  font-weight: 620;
  box-shadow: none;
}

#authGate .auth-secondary:hover {
  background: transparent;
  color: #303530;
}

#authGate .auth-secondary::before {
  content: "<";
  margin-right: 7px;
  color: #a2aaa2;
  font-weight: 620;
}

#authGate .auth-secondary:hover::before {
  color: #697069;
}

#authGate .auth-code-row {
  display: grid;
  grid-template-columns: repeat(3, 52px) 18px repeat(3, 52px);
  align-items: center;
  gap: 8px;
  margin-top: 42px;
}

.auth-code-input {
  width: 52px;
  height: 52px;
  border: 1px solid #dfe2dc;
  border-radius: 8px;
  background: #fff;
  color: #20251f;
  font-size: 21px;
  font-weight: 720;
  text-align: center;
  outline: none;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.auth-code-separator {
  width: 14px;
  height: 2px;
  border-radius: 999px;
  background: #d6dad3;
}

.auth-resend {
  margin-top: 16px;
  color: #858c86;
  font-size: 13px;
  font-weight: 620;
}

.auth-resend button {
  padding: 0;
  border: 0;
  background: transparent;
  color: #5f5600;
  font-weight: 760;
  cursor: pointer;
}

.auth-footer {
  color: #8b918c;
  font-size: 12px;
  line-height: 1.6;
  text-align: center;
}

.auth-footer a {
  color: #2d322e;
  font-weight: 650;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.auth-visual {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
  background: #071018;
  color: #f6f4ec;
  box-shadow: inset 1px 0 0 rgba(255, 255, 255, 0.05);
}

.auth-visual::before {
  content: "";
  position: absolute;
  z-index: 1;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(6, 16, 12, 0.3) 0%, rgba(6, 16, 12, 0) 32%),
    linear-gradient(180deg, rgba(0, 0, 0, 0) 48%, rgba(3, 8, 12, 0.28) 100%);
  pointer-events: none;
}

.auth-visual::after {
  content: "";
  position: absolute;
  z-index: 2;
  top: -18%;
  right: -18%;
  width: 44%;
  height: 68%;
  border-radius: 999px;
  background: rgba(244, 248, 255, 0.14);
  filter: blur(48px);
  pointer-events: none;
}

.auth-hero-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 52% 50%;
}

.auth-status {
  min-height: 22px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
  line-height: 1.45;
}

.auth-status[data-tone="ok"] {
  color: var(--accent);
}

.auth-status[data-tone="error"] {
  color: var(--error);
}

@media (max-width: 900px) {
  .auth-layout {
    grid-template-columns: 1fr;
    min-height: 100dvh;
  }

  .auth-panel {
    min-height: auto;
    padding: 22px 24px 24px;
  }

  .auth-form-wrap {
    width: min(100%, 390px);
    margin: 0 auto;
    padding: 56px 0 38px;
  }

  .auth-title {
    font-size: 30px;
  }

  #authGate .auth-code-row {
    grid-template-columns: repeat(3, minmax(0, 1fr)) 12px repeat(3, minmax(0, 1fr));
    gap: 6px;
  }

  .auth-code-input {
    width: 100%;
    min-width: 0;
  }

  .auth-visual {
    order: -1;
    min-height: 240px;
  }

  .auth-hero-image {
    object-position: 56% 42%;
  }
}

.auth-user-pill {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 8px 10px;
  border: 1px solid var(--accent-border);
  border-radius: 8px;
  background: var(--teal-soft);
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
}

.auth-user-text {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.auth-user-text span,
.auth-user-phone {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.auth-user-phone {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.auth-user-pill button {
  height: 28px;
  padding: 0 10px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
}

.account-metering-card {
  display: grid;
  gap: 8px;
  margin: 0 0 10px;
  padding: 8px;
  border: 1px solid var(--accent-border);
  border-radius: 8px;
  background: var(--teal-soft);
}

.account-metering-card .auth-user-pill,
.account-metering-card .today-metering-bar {
  border-color: var(--accent-border-soft);
  background: rgba(255, 255, 255, 0.58);
}

.account-recharge-button {
  width: 100%;
  min-height: 34px;
  border: 1px solid var(--accent-border-strong);
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
}

.account-recharge-button:hover {
  background: var(--accent-hover);
}

.perf-entry-button {
  width: 100%;
  min-height: 34px;
  border: 1px solid var(--accent-border-soft);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.58);
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.perf-entry-button:hover {
  border-color: #8cbcaf;
  background: rgba(255, 255, 255, 0.8);
}

.bind-phone-backdrop {
  z-index: 72;
}

.bind-phone-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 73;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: min(420px, calc(100vw - 32px));
  max-height: min(520px, calc(100vh - 32px));
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  box-shadow: 0 28px 70px rgba(23, 37, 31, 0.26);
  transform: translate(-50%, -50%);
}

.bind-phone-header,
.bind-phone-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
}

.bind-phone-header {
  border-bottom: 1px solid var(--line);
}

.bind-phone-header h2 {
  margin: 0;
  font-size: 18px;
  letter-spacing: 0;
}

.bind-phone-body {
  min-width: 0;
  overflow: auto;
  padding: 16px;
}

.bind-phone-actions {
  justify-content: flex-end;
  border-top: 1px solid var(--line);
}

.bind-phone-actions .primary-button,
.bind-phone-actions .compact-button {
  min-width: 92px;
}

.environment-notice {
  margin: 0 0 10px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.environment-notice[data-tone="dev"] {
  border-color: var(--accent-border);
  background: var(--teal-soft);
  color: var(--accent);
}

.environment-notice[data-tone="readonly"] {
  border-color: #e7c899;
  background: #fff7e8;
  color: var(--amber);
}

.environment-notice[data-tone="prod"] {
  border-color: #f1b2ad;
  background: var(--error-bg);
  color: var(--error);
}

.section-title-row h2,
.section-title-row h3 {
  margin: 0;
  letter-spacing: 0;
}

.request-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.input-panel > .section-title-row {
  display: flex;
  align-items: center;
}

.input-panel > .section-title-row .request-actions {
  margin-left: auto;
}

.prompt-name-publish-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: start;
  gap: 12px;
  margin-bottom: 13px;
}

.prompt-name-field {
  min-width: 0;
  margin-bottom: 0;
}

.prompt-publish-menu {
  position: relative;
  z-index: 8;
  justify-self: end;
  margin-top: calc(12px * 1.2 + 7px);
}

.prompt-edit-session-button {
  justify-self: end;
  width: 168px;
  min-width: 0;
  height: 38px;
  margin-top: calc(12px * 1.2 + 7px);
  padding: 0 8px;
  font-size: 13px;
  line-height: 1;
  white-space: nowrap;
}

.prompt-edit-session-button:disabled {
  cursor: not-allowed;
}

.publish-menu-button {
  min-width: 86px;
  height: 38px;
  padding: 0 16px;
  border-color: var(--accent-border);
  background: var(--teal-soft);
  color: var(--accent);
  font-weight: 800;
}

.publish-menu-button::after {
  content: "";
  display: inline-block;
  width: 0;
  height: 0;
  margin-left: 7px;
  border-top: 5px solid currentColor;
  border-right: 5px solid transparent;
  border-left: 5px solid transparent;
  vertical-align: middle;
}

.publish-menu-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.publish-menu-panel {
  position: absolute;
  top: 100%;
  right: 0;
  left: auto;
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
  min-width: 168px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 16px 34px rgba(34, 48, 42, 0.16);
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  transform: translateY(0);
  transition: opacity 140ms ease, transform 140ms ease;
}

.publish-menu-panel button {
  white-space: nowrap;
}

.prompt-publish-menu:hover .publish-menu-panel,
.prompt-publish-menu:focus-within .publish-menu-panel {
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
  transform: translateY(0);
}

.prompt-publish-menu.publish-disabled {
  cursor: not-allowed;
}

.prompt-publish-menu.publish-disabled:hover .publish-menu-panel,
.prompt-publish-menu.publish-disabled:focus-within .publish-menu-panel {
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
}

.pi-app-shell {
  --pi-brand: #fef65b;
  --pi-brand-soft: #fff9b8;
  --pi-brand-ink: #5f5600;
  --pi-hover: #f3f3ef;
  --pi-row: #f8f8f4;
  --pi-sidebar-bg: #fff;
  --pi-sidebar-width: 336px;
  --pi-sidebar-min: 260px;
  --pi-editor-width: minmax(520px, 1fr);
  --pi-editor-min: 520px;
  --pi-result-min: 400px;
  --pi-resize-handle-width: 8px;
  display: grid;
  grid-template-columns: var(--pi-sidebar-width) var(--pi-resize-handle-width) minmax(0, 1fr);
  width: 100%;
  height: 100vh;
  height: 100dvh;
  min-width: 0;
  min-height: 0;
  background: var(--bg);
  overflow: hidden;
}

.pi-app-shell.is-sidebar-collapsed {
  grid-template-columns: 74px 0 minmax(0, 1fr);
}

.pi-sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: 100vh;
  height: 100dvh;
  border-right: 0;
  background: var(--pi-sidebar-bg);
  overflow: hidden;
}

.pi-resize-handle {
  position: relative;
  z-index: 9;
  min-width: var(--pi-resize-handle-width);
  background: transparent;
  cursor: col-resize;
  touch-action: none;
  outline: none;
}

.pi-resize-handle::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 1px;
  background: #dcdfda;
  transition: width 0.16s ease, background 0.16s ease, opacity 0.16s ease;
}

.pi-resize-handle:hover::before,
.pi-resize-handle:focus-visible::before,
.pi-resize-handle.is-dragging::before {
  width: 4px;
  background: var(--pi-surface-accent-soft);
  box-shadow: 0 0 0 2px rgba(254, 246, 91, 0.34);
}

.pi-sidebar-resize-handle {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100dvh;
}

.pi-app-shell.is-sidebar-collapsed .pi-sidebar-resize-handle {
  pointer-events: none;
}

.pi-app-shell.is-sidebar-collapsed .pi-sidebar {
  border-right: 1px solid var(--line);
}

.pi-app-shell.is-sidebar-collapsed .pi-sidebar-resize-handle::before {
  opacity: 0;
}

body.is-resizing-layout {
  cursor: col-resize;
  -webkit-user-select: none;
  user-select: none;
}

.pi-sidebar,
.pi-sidebar-scroll,
.pi-sidebar-nav,
.pi-section,
.pi-workspace,
.pi-prompt-row,
.pi-menu,
.pi-account {
  -webkit-user-select: none;
  user-select: none;
}

.pi-sidebar-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 68px;
  padding: 14px 16px 10px;
  color: #6b716d;
}

.pi-sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.pi-sidebar-brand h2 {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  color: #252826;
  font-size: 16px;
  font-weight: 760;
  letter-spacing: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pi-sidebar-logo {
  display: block;
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
}

.pi-sidebar-logo path:nth-child(1),
.pi-sidebar-logo path:nth-child(3),
.pi-sidebar-logo path:nth-child(5) {
  fill: var(--pi-brand);
  stroke: #252826;
}

.pi-sidebar-logo path:nth-child(1) {
  stroke-width: 34;
  stroke-linejoin: round;
}

.pi-sidebar-logo path:nth-child(2),
.pi-sidebar-logo path:nth-child(4) {
  fill: none;
  stroke: #252826;
}

.pi-sidebar-logo path:nth-child(n + 2) {
  stroke-width: 44;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.pi-sidebar-logo path:nth-child(3),
.pi-sidebar-logo path:nth-child(5) {
  stroke-width: 34;
}

.pi-sidebar-icon-button {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: inherit;
}

.pi-sidebar-icon-button:hover {
  background: #f4f4ef;
  color: #303632;
}

.pi-icon,
.pi-sidebar-icon-button svg,
.pi-row-menu-btn svg,
.pi-menu-item svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: 0 0 auto;
}

.pi-sidebar-nav {
  display: grid;
  gap: 0;
  padding: 8px 14px 0;
}

.pi-sidebar-nav-item,
.pi-sidebar-nav-main {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  height: 42px;
  padding: 0 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #3e4440;
  text-align: left;
  font-size: 16px;
  font-weight: 680;
  letter-spacing: 0;
}

.pi-sidebar-nav-item:hover,
.pi-sidebar-nav-item.is-active,
.pi-sidebar-nav-trash.is-active {
  background: var(--pi-hover);
}

.pi-sidebar-nav-item.is-active,
.pi-sidebar-nav-trash.is-active {
  color: var(--pi-brand-ink);
}

.pi-sidebar-nav-trash {
  padding: 0;
  justify-content: space-between;
}

.pi-sidebar-nav-trash .pi-sidebar-nav-main {
  flex: 1 1 auto;
  min-width: 0;
}

.pi-nav-label {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.pi-sidebar-return-button {
  display: none;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  min-width: 64px;
  height: 30px;
  padding: 0 10px;
  border: 0;
  border-radius: 7px;
  background: #fff;
  color: var(--pi-brand-ink);
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  box-shadow: inset 0 0 0 1px rgba(95, 86, 0, 0.14);
}

.pi-sidebar-nav-trash.is-active .pi-sidebar-return-button {
  display: inline-flex;
}

.pi-sidebar-return-button:hover {
  background: var(--pi-brand-soft);
}

.pi-sidebar-status {
  margin: 10px 18px 0;
}

.pi-sidebar-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 8px 0 18px;
}

.pi-sidebar-scroll::-webkit-scrollbar {
  width: 10px;
}

.pi-sidebar-scroll::-webkit-scrollbar-thumb {
  border: 3px solid transparent;
  border-radius: 999px;
  background: rgba(80, 86, 81, 0.25);
  background-clip: padding-box;
}

.pi-section {
  padding: 12px 12px 0;
}

.pi-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 24px;
  padding: 0 8px;
  color: #9a9f9a;
  font-size: 13px;
  font-weight: 700;
}

.pi-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  height: 38px;
  padding: 0 6px 0 8px;
  border-radius: 8px;
  background: transparent;
  color: #4d544e;
  font-size: 16px;
  font-weight: 700;
  text-align: left;
}

.pi-workspace:hover {
  background: var(--pi-hover);
}

.pi-workspace-main {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  height: 100%;
  border-radius: 7px;
  cursor: pointer;
  touch-action: none;
}

.pi-workspace-label {
  display: flex;
  align-items: center;
  min-width: 0;
  width: 100%;
}

.pi-workspace-name,
.pi-workspace-label > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pi-workspace-name-input,
.pi-prompt-name-input {
  -webkit-user-select: text;
  user-select: text;
  min-width: 0;
  width: 100%;
  height: 28px;
  padding: 0 6px;
  border: 1px solid rgba(37, 40, 38, 0.18);
  border-radius: 7px;
  outline: 0;
  background: #fff;
  color: #252826;
  font-size: 16px;
  font-weight: 700;
}

.pi-workspace-name-input:focus,
.pi-prompt-name-input:focus {
  border-color: rgba(95, 86, 0, 0.42);
  box-shadow: 0 0 0 3px rgba(254, 246, 91, 0.34);
}

.pi-workspace-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 0 0 auto;
}

.pi-workspace-action {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #9aa09c;
  transition: background-color 0.12s ease, color 0.12s ease, opacity 0.12s ease, transform 0.12s ease;
}

.pi-workspace-action:hover {
  background: rgba(37, 40, 38, 0.06);
  color: #4d544e;
}

.pi-workspace-leading-toggle {
  flex: 0 0 auto;
  color: #6f7771;
}

.pi-workspace-add-btn {
  color: #4d544e;
  opacity: 0;
  pointer-events: none;
  transform: translateX(2px);
}

.pi-workspace-rename-btn {
  opacity: 0;
  pointer-events: none;
  transform: translateX(2px);
}

.pi-workspace:hover .pi-workspace-add-btn,
.pi-workspace:focus-within .pi-workspace-add-btn,
.pi-workspace:hover .pi-workspace-rename-btn,
.pi-workspace:focus-within .pi-workspace-rename-btn,
.pi-workspace.is-editing .pi-workspace-rename-btn {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0);
}

.pi-workspace-chevron {
  width: 17px;
  height: 17px;
  color: #9aa09c;
  transition: transform 0.16s ease;
}

.pi-workspace.is-collapsed .pi-workspace-chevron {
  transform: rotate(-90deg);
}

.pi-workspace-block.is-drag-source {
  opacity: 0.42;
}

.pi-workspace-drop-zone {
  display: flex;
  align-items: center;
  min-height: 0;
  height: 0;
  margin: 0;
  border-radius: 8px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transition: min-height 0.12s ease, height 0.12s ease, margin 0.12s ease, opacity 0.12s ease, background-color 0.12s ease;
}

body.is-workspace-dragging .pi-workspace-drop-zone {
  min-height: 6px;
  height: 6px;
  margin: 1px 0;
  pointer-events: auto;
  opacity: 1;
}

body.is-workspace-dragging .pi-workspace-drop-zone.is-active {
  min-height: 38px;
  height: 38px;
  margin: 3px 0;
}

.pi-workspace-drop-zone.is-active {
  min-height: 38px;
  height: 38px;
  background: rgba(254, 246, 91, 0.35);
}

.pi-workspace-drop-preview {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  height: 34px;
  padding: 0 12px 0 46px;
  border: 1px dashed rgba(95, 86, 0, 0.36);
  border-radius: 8px;
  color: #5f5600;
  font-size: 15px;
  font-weight: 700;
  opacity: 0;
}

.pi-workspace-drop-zone.is-active .pi-workspace-drop-preview {
  opacity: 1;
}

.pi-workspace-drag-ghost {
  position: fixed;
  z-index: 1000;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: 276px;
  height: 38px;
  padding: 0 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  color: #4d544e;
  font-size: 16px;
  font-weight: 750;
  box-shadow: 0 14px 34px rgba(37, 40, 38, 0.18), inset 0 0 0 1px rgba(37, 40, 38, 0.08);
  opacity: 0.86;
  pointer-events: none;
}

.pi-rows {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.pi-rows[hidden] {
  display: none;
}

.pi-workspace-prompts {
  padding-left: 0;
}

.pi-prompt-row {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 58px;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 6px 0 12px;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
}

.pi-prompt-row:hover {
  background: var(--pi-hover);
}

.pi-prompt-row.is-selected {
  background: var(--pi-brand-soft);
  box-shadow: inset 0 0 0 1px rgba(37, 40, 38, 0.08);
}

.pi-prompt-row.is-selected .pi-prompt-name {
  font-weight: 600;
}

.pi-prompt-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0;
}

.pi-prompt-name-input {
  grid-column: 1;
  grid-row: 1;
  height: 30px;
  font-size: 15px;
  font-weight: 560;
}

.pi-prompt-meta {
  grid-column: 2;
  grid-row: 1;
  justify-self: end;
  color: #8a918b;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  opacity: 1;
  pointer-events: none;
  transition: opacity 0.12s ease;
}

.pi-row-menu-btn {
  grid-column: 2;
  grid-row: 1;
  justify-self: end;
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #9ca29e;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.12s ease, background-color 0.12s ease, color 0.12s ease;
}

.pi-row-menu-btn svg circle {
  fill: currentColor;
  stroke: none;
}

.pi-prompt-row:hover .pi-row-menu-btn,
.pi-prompt-row:focus-within .pi-row-menu-btn,
.pi-prompt-row.is-menu-open .pi-row-menu-btn,
.pi-row-menu-btn.is-open {
  opacity: 1;
  pointer-events: auto;
}

.pi-prompt-row:hover .pi-prompt-meta,
.pi-prompt-row:focus-within .pi-prompt-meta,
.pi-prompt-row.is-menu-open .pi-prompt-meta {
  opacity: 0;
}

.pi-row-menu-btn:hover {
  background: rgba(255, 255, 255, 0.72);
  color: #48504a;
}

.pi-row-menu-btn[data-restore] {
  opacity: 1;
  pointer-events: auto;
}

.pi-prompt-row.pi-trash-row {
  grid-template-columns: minmax(0, 1fr) auto 32px;
}

.pi-prompt-row.pi-trash-row .pi-prompt-meta,
.pi-prompt-row.pi-trash-row .pi-row-menu-btn {
  grid-column: auto;
  grid-row: auto;
}

.pi-prompt-row.pi-trash-row .pi-prompt-meta,
.pi-prompt-row.pi-trash-row:hover .pi-prompt-meta,
.pi-prompt-row.pi-trash-row:focus-within .pi-prompt-meta {
  opacity: 1;
}

.pi-empty-state {
  margin: 14px 18px;
  padding: 18px;
  border: 1px dashed #c7ccc6;
  border-radius: 8px;
  color: #7f8581;
  background: #f8f8f5;
  font-size: 14px;
  line-height: 1.45;
}

.pi-environment {
  margin: 10px 18px 14px;
  padding: 11px 12px;
  border: 1px solid #d2d6d0;
  border-radius: 8px;
  background: #fff;
  color: #666d67;
  font-size: 13px;
  line-height: 1.45;
}

.pi-account-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}

.pi-summary-item {
  min-width: 0;
}

.pi-summary-label {
  color: #8b928c;
  font-size: 11px;
  font-weight: 650;
  line-height: 1.15;
  white-space: nowrap;
}

.pi-summary-value {
  display: block;
  min-width: 0;
  margin-top: 2px;
  overflow: hidden;
  color: #2f3630;
  font-size: 14px;
  font-weight: 760;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pi-summary-value-balance {
  color: var(--pi-brand-ink);
}

.pi-summary-view {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 32px;
  min-width: 52px;
  padding: 0 12px;
  border: 0;
  border-radius: 8px;
  background: #f7f7f2;
  color: #394039;
  font-size: 13px;
  font-weight: 700;
  box-shadow: inset 0 0 0 1px rgba(37, 40, 38, 0.12);
}

.pi-summary-view:hover {
  background: #f0f0ea;
}

.pi-account {
  position: relative;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 34px;
  align-items: center;
  gap: 10px;
  min-height: 70px;
  padding: 10px 18px;
  border-top: 1px solid var(--line);
  background: #fff;
}

.pi-avatar {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--pi-brand);
  color: #252826;
  font-size: 15px;
  font-weight: 800;
  box-shadow: inset 0 0 0 1px rgba(37, 40, 38, 0.16);
}

.auth-user-pill.pi-account-info {
  display: grid;
  align-items: center;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
}

.auth-user-pill.pi-account-info[hidden],
.environment-notice[hidden],
.pi-account-summary[hidden],
.pi-summary-item[hidden],
.pi-summary-view[hidden],
.pi-menu-item[hidden] {
  display: none;
}

.auth-user-text {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.pi-account-name {
  min-width: 0;
  overflow: hidden;
  color: #2f3530;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pi-account-plan {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  border: 0;
  background: transparent;
  color: #858b87;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pi-account-settings-button {
  position: relative;
  color: #6b716d;
}

.pi-app-shell.is-settings {
  grid-template-columns: minmax(280px, 340px) minmax(0, 1fr);
  background: #fbfbf8;
}

.pi-app-shell.is-settings .pi-sidebar > :not(.settings-sidebar),
.pi-app-shell.is-settings .pi-sidebar-resize-handle,
.pi-app-shell.is-settings .pi-main-workspace {
  display: none !important;
}

.pi-app-shell.is-settings .pi-sidebar {
  border-right: 1px solid #dedfda;
  background: rgba(250, 250, 246, 0.88);
  box-shadow: 1px 0 0 rgba(37, 40, 38, 0.04);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
}

.settings-sidebar {
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
  flex-direction: column;
  padding: 26px 12px;
  color: #2f3530;
}

.settings-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: max-content;
  min-height: 34px;
  margin: 0 8px 18px;
  padding: 0 8px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #737a75;
  font-size: 14px;
  font-weight: 700;
}

.settings-back:hover {
  background: #f1f1ec;
  color: #343a36;
}

.settings-back svg,
.settings-nav-item svg,
.settings-action-button svg,
.settings-icon-button svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.settings-nav-group {
  display: grid;
  gap: 8px;
  margin: 0 0 28px;
}

.settings-nav-title {
  margin: 0 10px 4px;
  color: #9ca19d;
  font-size: 14px;
  font-weight: 760;
  line-height: 1.2;
}

.settings-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: #343a36;
  text-align: left;
  font-size: 15px;
  font-weight: 760;
}

.settings-nav-item:hover {
  background: #f3f3ed;
}

.settings-nav-item.is-active {
  border-color: rgba(95, 86, 0, 0.13);
  background: var(--pi-brand-soft);
  color: #252826;
  box-shadow: inset 0 0 0 1px rgba(95, 86, 0, 0.07);
}

.settings-main {
  min-width: 0;
  height: 100vh;
  height: 100dvh;
  overflow: auto;
  background: #fbfbf8;
}

.settings-page {
  width: min(100%, 1040px);
  margin: 0 auto;
  padding: clamp(46px, 7vh, 82px) clamp(34px, 7vw, 92px) 84px;
}

.settings-page-header {
  display: flex;
  gap: 18px;
  align-items: flex-start;
  justify-content: space-between;
  margin: 0 0 34px;
}

.settings-page-title {
  margin: 0;
  color: #202622;
  font-size: clamp(25px, 2.2vw, 32px);
  font-weight: 820;
  line-height: 1.18;
  letter-spacing: 0;
}

.settings-page-copy {
  margin: 14px 0 0;
  color: #747a76;
  font-size: 15px;
  font-weight: 650;
  line-height: 1.5;
}

.dev-access-info {
  min-width: 198px;
  max-width: 260px;
  flex: 0 0 auto;
  padding: 10px 12px;
  border: 1px solid #f1c7c1;
  border-radius: 10px;
  background: linear-gradient(180deg, #fffafa, #fffdf8);
  color: #2c312d;
  box-shadow: 0 1px 0 rgba(37, 40, 38, 0.03);
}

.dev-access-info-label {
  color: #a65145;
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.02em;
}

.dev-access-info-ip {
  overflow: hidden;
  margin-top: 3px;
  color: #252926;
  font-size: 13px;
  font-weight: 850;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dev-access-info-source {
  overflow: hidden;
  margin-top: 4px;
  color: #8a9088;
  font-size: 10.5px;
  font-weight: 750;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dev-access-info-market {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  margin-top: 7px;
  color: #717870;
  font-size: 11.5px;
  font-weight: 700;
}

.dev-access-info-market strong {
  padding: 2px 7px;
  border: 1px solid #d9cf4f;
  border-radius: 999px;
  background: #fffef3;
  color: #4f4b00;
  font-size: 11px;
  font-weight: 850;
}

.dev-access-info-market[data-market="INTL"] strong {
  border-color: #bcd0f4;
  background: #f5f8ff;
  color: #1d4f9a;
}

.settings-section {
  display: grid;
  gap: 12px;
  margin: 0 0 26px;
}

.settings-section-title {
  margin: 0;
  color: #2c322e;
  font-size: 16px;
  font-weight: 820;
  line-height: 1.3;
}

.settings-panel {
  overflow: hidden;
  border: 1px solid #dadcd6;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 1px 0 rgba(37, 40, 38, 0.03);
}

.settings-panel-soft {
  background: #fbfcf8;
}

.settings-account-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 22px;
}

.settings-account-avatar {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  flex: 0 0 auto;
  border: 1px solid rgba(37, 40, 38, 0.16);
  border-radius: 50%;
  background: var(--pi-brand);
  color: #252826;
  font-size: 21px;
  font-weight: 860;
}

.settings-account-info {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.settings-account-name {
  min-width: 0;
  overflow: hidden;
  color: #1f2521;
  font-size: 18px;
  font-weight: 820;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.settings-account-meta,
.settings-muted {
  color: #777e78;
  font-size: 14px;
  font-weight: 650;
  line-height: 1.45;
}

.settings-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  min-height: 80px;
  padding: 18px 22px;
  border-top: 1px solid #e3e4df;
}

.settings-row:first-child {
  border-top: 0;
}

.settings-row-title {
  margin: 0;
  color: #2a302c;
  font-size: 16px;
  font-weight: 820;
  line-height: 1.25;
}

.settings-row-copy {
  margin: 6px 0 0;
  color: #777e78;
  font-size: 14px;
  font-weight: 650;
  line-height: 1.45;
}

.settings-segmented {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 44px;
  padding: 4px;
  border: 1px solid #d7d9d3;
  border-radius: 8px;
  background: #f5f5f1;
}

.settings-segmented button {
  min-width: 76px;
  height: 34px;
  padding: 0 14px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #68706a;
  font-size: 14px;
  font-weight: 780;
}

.settings-segmented button.is-active {
  background: #fff;
  color: #252826;
  box-shadow: 0 1px 3px rgba(37, 40, 38, 0.12);
}

.settings-action-button,
.settings-icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 16px;
  border: 1px solid #d9dbd5;
  border-radius: 8px;
  background: #fff;
  color: #303632;
  font-size: 14px;
  font-weight: 780;
  white-space: nowrap;
}

.settings-action-button:hover,
.settings-icon-button:hover {
  background: #f6f6f1;
}

.settings-action-button.primary {
  border-color: rgba(95, 86, 0, 0.24);
  background: var(--pi-brand);
  color: #252826;
}

.settings-action-button.danger {
  border-color: #f0d7d6;
  color: #b33a33;
}

.settings-action-button:disabled,
.settings-icon-button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.settings-ledger-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.settings-ledger-metric {
  min-width: 0;
  padding: 18px;
  border: 1px solid #dadcd6;
  border-radius: 8px;
  background: #fff;
}

.settings-ledger-metric span {
  display: block;
  color: #7e8580;
  font-size: 12px;
  font-weight: 730;
  line-height: 1.2;
}

.settings-ledger-metric strong {
  display: block;
  min-width: 0;
  margin-top: 8px;
  overflow: hidden;
  color: #2a302c;
  font-size: 20px;
  font-weight: 840;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.settings-ledger-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 20px;
}

.settings-ledger-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.settings-ledger-list .account-ledger-row {
  cursor: pointer;
}

.settings-detail-panel {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  padding: 18px;
  border: 1px solid #dadcd6;
  border-radius: 8px;
  background: #fff;
}

.settings-detail-panel h3 {
  margin: 0;
  color: #252b27;
  font-size: 16px;
  font-weight: 820;
}

.settings-detail-panel dl {
  display: grid;
  grid-template-columns: minmax(110px, auto) minmax(0, 1fr);
  gap: 8px 16px;
  margin: 0;
}

.settings-detail-panel dt {
  color: #858b87;
  font-size: 13px;
  font-weight: 700;
}

.settings-detail-panel dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
  color: #333a35;
  font-size: 13px;
  font-weight: 650;
}

.settings-model-grid {
  display: grid;
  grid-template-columns: minmax(240px, 0.8fr) minmax(420px, 1.25fr);
  gap: 18px;
  align-items: start;
}

.settings-model-list {
  display: grid;
  gap: 10px;
  padding: 14px;
}

.settings-model-empty {
  margin: 0;
  padding: 14px;
  color: #777e78;
  font-size: 14px;
  font-weight: 650;
  line-height: 1.45;
}

.settings-form {
  display: grid;
  gap: 16px;
  padding: 18px;
}

.settings-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.settings-field {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.settings-field-wide {
  grid-column: 1 / -1;
}

.settings-field span,
.settings-field label {
  color: #59615b;
  font-size: 13px;
  font-weight: 760;
  line-height: 1.2;
}

.settings-field input,
.settings-field select {
  width: 100%;
  min-width: 0;
  height: 42px;
  padding: 0 12px;
  border: 1px solid #d9dbd5;
  border-radius: 8px;
  background: #fff;
  color: #252b27;
  font-size: 14px;
  font-weight: 650;
  outline: none;
}

.settings-field input:focus,
.settings-field select:focus {
  border-color: rgba(95, 86, 0, 0.45);
  box-shadow: 0 0 0 3px rgba(254, 246, 91, 0.25);
}

.settings-field-help {
  margin: 0;
  color: #7b827d;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.45;
}

.settings-capabilities {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid #e0e2dc;
  border-radius: 8px;
  background: #fbfcf8;
}

.settings-capability-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
}

.settings-capability-list div {
  min-width: 0;
  padding: 10px;
  border-radius: 7px;
  background: #fff;
}

.settings-capability-list dt {
  color: #878d88;
  font-size: 12px;
  font-weight: 760;
}

.settings-capability-list dd {
  margin: 5px 0 0;
  color: #2f3630;
  font-size: 13px;
  font-weight: 760;
  line-height: 1.35;
}

.settings-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
}

.settings-status {
  min-height: 20px;
  margin: 0;
  color: #737a75;
  font-size: 13px;
  font-weight: 680;
  line-height: 1.4;
}

.settings-status[data-tone="ok"] {
  color: #257045;
}

.settings-status[data-tone="error"] {
  color: #b33a33;
}

.pi-app-shell {
  --selected: var(--brand-soft);
  --danger: var(--error);
}

.pi-app-shell.is-settings {
  grid-template-columns: 336px minmax(0, 1fr);
  min-width: 980px;
  background: #fff;
}

.pi-app-shell.is-settings .pi-sidebar > :not(.settings-sidebar),
.pi-app-shell.is-settings .pi-sidebar-resize-handle,
.pi-app-shell.is-settings .pi-main-workspace {
  display: none !important;
}

.pi-app-shell.is-settings .pi-sidebar {
  width: auto;
  border-right-color: rgba(225, 229, 220, 0.72);
  background:
    linear-gradient(180deg, rgba(255, 254, 250, 0.76), rgba(247, 248, 242, 0.64)),
    rgba(255, 254, 250, 0.68);
  box-shadow:
    inset -1px 0 0 rgba(225, 229, 220, 0.62),
    inset 1px 0 0 rgba(255, 255, 255, 0.78);
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
}

.pi-app-shell.is-settings .settings-main {
  display: block;
}

.settings-main {
  display: none;
  min-width: 0;
  height: 100vh;
  height: 100dvh;
  overflow: auto;
  background: #fff;
}

.settings-sidebar {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 100vh;
  height: 100vh;
  padding: 22px 12px;
  background: transparent;
  color: #313633;
}

.settings-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  height: 32px;
  min-height: 32px;
  margin: 0;
  padding: 0 8px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #767d78;
  font-size: 14px;
  font-weight: 720;
}

.settings-back:hover {
  background: rgba(255, 255, 255, 0.72);
  color: #303632;
}

.settings-nav-section {
  margin-top: 8px;
}

.settings-nav-section + .settings-nav-section {
  margin-top: 18px;
}

.settings-nav-title {
  margin: 0;
  padding: 0 8px 7px;
  color: #9da39e;
  font-size: 13px;
  font-weight: 800;
}

.settings-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  height: 36px;
  min-height: 36px;
  padding: 0 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #3e4440;
  font-size: 14px;
  font-weight: 720;
  text-align: left;
}

.settings-nav-item:hover {
  background: rgba(255, 255, 255, 0.52);
}

.settings-nav-item.is-active {
  background: var(--selected);
  color: #111;
  box-shadow: inset 0 0 0 1px rgba(37, 40, 38, 0.08);
}

.settings-nav-icon {
  width: 17px;
  height: 17px;
  object-fit: contain;
  flex: 0 0 auto;
}

svg.settings-nav-icon,
.settings-back svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.settings-page {
  width: min(100%, 760px);
  margin: 0 auto;
  padding: 48px 30px 50px;
}

.settings-page.account-ledger-settings-page {
  width: min(100%, 760px);
  padding: 48px 30px 50px;
}

.settings-page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin: 0 0 26px;
}

.settings-page-title {
  margin: 0;
  color: #252826;
  font-size: 22px;
  font-weight: 820;
  line-height: 1.18;
  letter-spacing: 0;
}

.settings-page-meta {
  margin: 8px 0 0;
  color: #727973;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.35;
}

.settings-panel {
  margin-top: 20px;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.settings-panel-title {
  margin: 0 0 12px;
  color: #303631;
  font-size: 14px;
  font-weight: 820;
}

.settings-panel-title-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 12px;
}

.settings-panel-title-row .settings-panel-title {
  margin: 0;
}

.settings-model-cost-warning {
  color: #b3261e;
  font-size: 12px;
  font-weight: 820;
  line-height: 1.35;
}

.settings-page-warning {
  margin: 10px 0 0;
  color: #c4211b;
  font-size: 14px;
  font-weight: 880;
  line-height: 1.45;
}

.settings-list {
  display: grid;
  gap: 8px;
}

.model-profile-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  min-height: 64px;
  padding: 10px 13px;
  border: 1px solid #dde1da;
  border-radius: 8px;
  background: #fff;
  color: #303631;
  text-align: left;
}

.model-profile-row:hover {
  background: #fffef9;
}

.model-profile-row.is-active {
  border-color: rgba(95, 86, 0, 0.34);
  background: #fffdf0;
  box-shadow: inset 0 0 0 1px rgba(254, 246, 91, 0.32);
}

.model-profile-row strong {
  display: block;
  overflow: hidden;
  color: #252826;
  font-size: 14px;
  font-weight: 820;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.model-profile-row span {
  display: block;
  margin-top: 4px;
  color: #757c77;
  font-size: 12px;
  font-weight: 650;
}

.model-profile-badges {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
  margin-top: 0 !important;
}

.model-profile-badge {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 9px;
  border-radius: 999px;
  background: #f2f4ed;
  color: #687069;
  font-size: 11px;
  font-weight: 780;
}

.model-profile-badge.is-default {
  background: var(--brand-soft);
  color: var(--brand-ink);
}

.settings-empty {
  min-height: 70px;
  padding: 20px;
  border: 1px dashed #d3d8d0;
  border-radius: 8px;
  background: #fffef9;
  color: #727973;
  font-size: 14px;
  font-weight: 680;
}

.profile-summary {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 14px;
  border: 1px solid #dde1da;
  border-radius: 8px;
  background: #fcfcf8;
}

.membership-identity-line {
  display: flex;
  gap: 8px;
  align-items: center;
  min-width: 0;
  margin-top: 5px;
}

.profile-summary .membership-identity-line span {
  display: inline-block;
  margin: 0;
}

.membership-identity-badge {
  flex: 0 0 auto;
  padding: 2px 6px;
  border: 1px solid #d9cf4f;
  border-radius: 999px;
  background: #fffef3;
  color: #4f4b00 !important;
  font-size: 10.5px !important;
  font-weight: 850 !important;
}

.membership-identity-meta {
  overflow: hidden;
  color: #666e67 !important;
  font-size: 11.5px !important;
  font-weight: 650 !important;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.membership-identity-line[data-state="EXPIRED"] .membership-identity-badge,
.membership-identity-line[data-state="ERROR"] .membership-identity-badge {
  border-color: #d9ddd6;
  background: #fff;
  color: #737a73 !important;
}

.membership-entry {
  height: 34px;
  padding: 0 12px;
  border: 1px solid #d9cf4f;
  border-radius: 8px;
  background: #fffef3;
  color: #4f4b00;
  font-size: 12px;
  font-weight: 850;
}

.membership-entry[data-state="EXPIRED"],
.membership-entry[data-state="ERROR"] {
  border-color: #d9ddd6;
  background: #fff;
}

.membership-entry[data-state="ERROR"] {
  color: var(--danger);
}

.membership-modal-backdrop {
  position: fixed;
  z-index: 1500;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(19, 22, 20, 0.48);
}

.membership-modal {
  width: min(460px, 100%);
  overflow: hidden;
  border: 1px solid #dadfd7;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 24px 80px rgba(20, 24, 21, 0.24);
}

.membership-modal header,
.membership-modal footer {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
}

.membership-modal header {
  border-bottom: 1px solid #ebece8;
}

.membership-modal header h2,
.membership-modal header p {
  margin: 0;
}

.membership-modal header h2 {
  color: #222622;
  font-size: 18px;
}

.membership-modal header p {
  margin-top: 5px;
  color: #737a73;
  font-size: 12.5px;
}

.membership-modal-body {
  padding: 22px 18px;
}

.membership-price {
  display: flex;
  gap: 8px;
  align-items: baseline;
  padding: 18px;
  border: 1px solid #ded75f;
  border-radius: 10px;
  background: #fffef0;
}

.membership-price strong {
  color: #202420;
  font-size: 28px;
  font-weight: 900;
}

.membership-price span,
.membership-modal-body > p {
  color: #737a73;
  font-size: 12.5px;
}

.membership-modal-body dl {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 9px 16px;
  margin: 18px 0;
  font-size: 13px;
}

.membership-modal-body dt {
  color: #7a817a;
}

.membership-modal-body dd {
  margin: 0;
  color: #292e2a;
  font-weight: 750;
  text-align: right;
}

.membership-modal-status {
  min-height: 18px;
  margin: 12px 0 0;
  color: var(--danger) !important;
}

.membership-modal footer {
  justify-content: flex-end;
  border-top: 1px solid #ebece8;
  background: #fbfcf9;
}

body.membership-modal-open {
  overflow: hidden;
}

@media (max-width: 900px) {
  .profile-summary {
    grid-template-columns: 48px minmax(0, 1fr);
  }
}

.profile-avatar {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 1px solid #d9cf4f;
  border-radius: 50%;
  background: var(--brand);
  color: #161916;
  font-weight: 900;
}

.profile-summary strong {
  display: block;
  overflow: hidden;
  color: #252826;
  font-size: 16px;
  font-weight: 820;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-summary span {
  display: block;
  margin-top: 4px;
  color: #727973;
  font-size: 13px;
  font-weight: 650;
}

.xprompt-plus-bar {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  min-height: 116px;
  margin-top: 12px;
  padding: 18px 20px;
  overflow: hidden;
  isolation: isolate;
  border: 1px solid rgba(255, 237, 178, 0.24);
  border-radius: 18px;
  color: #fff8dd;
  background:
    radial-gradient(circle at 10% 12%, rgba(0, 0, 0, 0.72), transparent 38%),
    radial-gradient(circle at 48% 18%, rgba(255, 236, 188, 0.08), transparent 34%),
    radial-gradient(circle at 84% 22%, rgba(235, 185, 92, 0.14), transparent 34%),
    linear-gradient(135deg, #050504 0%, #0b0a08 30%, #17130d 62%, #050504 100%);
  box-shadow: 0 18px 46px rgba(20, 13, 5, 0.3);
}

.xprompt-plus-bar::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(115deg, rgba(0, 0, 0, 0.2) 0 26%, transparent 38%, rgba(255, 246, 220, 0.055) 52%, transparent 62%),
    repeating-linear-gradient(145deg, rgba(238, 226, 194, 0.038) 0 1px, transparent 1px 14px);
  opacity: 0.4;
}

.xprompt-plus-bar::after {
  content: "PLUS";
  position: absolute;
  right: 18px;
  bottom: -20px;
  z-index: -1;
  pointer-events: none;
  color: rgba(255, 255, 255, 0.045);
  font-size: 76px;
  font-weight: 950;
  letter-spacing: -4px;
}

.xprompt-plus-main {
  min-width: 0;
}

.xprompt-plus-heading {
  display: flex;
  align-items: baseline;
  min-width: 0;
}

.xprompt-plus-logo {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 236px;
  height: 44px;
  padding: 0;
  overflow: hidden;
  white-space: nowrap;
  border: 0;
  border-radius: 12px;
  background: transparent;
  box-shadow: 0 0 22px rgba(244, 208, 138, 0.16);
}

.xprompt-plus-logo-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transform: scale(1.24);
  transform-origin: center;
}

.xprompt-plus-copy {
  max-width: 440px;
  margin: 9px 0 0;
  color: rgba(255, 255, 255, 0.66);
  font-size: 13px;
  font-weight: 650;
  line-height: 1.45;
}

.xprompt-plus-side {
  display: grid;
  justify-items: end;
  min-width: 148px;
}

.xprompt-plus-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 122px;
  height: 38px;
  padding: 0 16px;
  border: 0;
  border-radius: 999px;
  color: #251605;
  background: linear-gradient(180deg, #fff1c8, #f4c982);
  box-shadow: 0 10px 26px rgba(244, 201, 130, 0.24);
  font-size: 13px;
  font-weight: 900;
  transition: transform 0.16s ease, box-shadow 0.16s ease, filter 0.16s ease;
}

.xprompt-plus-button:hover:not(:disabled) {
  transform: translateY(-1px);
  filter: brightness(1.04);
  box-shadow: 0 14px 30px rgba(244, 201, 130, 0.3);
}

.xprompt-plus-button:active:not(:disabled) {
  transform: translateY(0);
}

.xprompt-plus-button:disabled {
  cursor: default;
  opacity: 0.68;
}

@media (max-width: 720px) {
  .xprompt-plus-bar {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .xprompt-plus-side {
    justify-items: start;
    min-width: 0;
  }
}

/* Xprompt Plus confirmed UX: compact profile card + benefit timeline purchase modal. */
.xprompt-plus-bar {
  min-height: 104px;
  padding: 17px 19px;
  border-radius: 12px;
  background: linear-gradient(135deg, #080806 0%, #17130d 100%);
  box-shadow: 0 12px 30px rgba(20, 13, 5, 0.22);
}

.xprompt-plus-bar::after {
  content: none;
}

.xprompt-plus-main {
  display: grid;
  gap: 7px;
}

.xprompt-plus-logo {
  justify-content: flex-start;
  gap: 8px;
  width: auto;
  height: 34px;
  overflow: visible;
  border-radius: 0;
  box-shadow: none;
}

.xprompt-plus-logo-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  overflow: visible;
  flex: 0 0 auto;
}

.xprompt-plus-logo-img {
  width: 64px;
  height: 64px;
  object-fit: contain;
  transform: none;
  flex: 0 0 auto;
}

.xprompt-plus-wordmark {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  line-height: 1;
}

.xprompt-plus-wordmark-name {
  color: #fffdf7;
  font-size: 17px;
  font-weight: 790;
  letter-spacing: -0.25px;
}

.xprompt-plus-wordmark-tier {
  color: #e4c27e;
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 1.35px;
  text-transform: uppercase;
}

.xprompt-plus-value {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #fff7dc;
  font-size: 15px;
  font-weight: 880;
  letter-spacing: -0.2px;
}

.xprompt-plus-value svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  fill: none;
  stroke: #f5cf7e;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.9;
}

.xprompt-plus-copy {
  margin-top: 0;
}

.xprompt-plus-side {
  align-content: center;
}

.membership-modal-backdrop {
  z-index: 1600;
  padding: 24px;
  background: rgba(16, 18, 16, 0.58);
  backdrop-filter: blur(5px);
}

.membership-modal.membership-purchase-modal {
  width: min(548px, 100%);
  border: 1px solid #d8dcd4;
  border-radius: 18px;
  box-shadow: 0 30px 90px rgba(13, 17, 13, 0.3);
}

.membership-modal.membership-purchase-modal .membership-purchase-header {
  align-items: flex-start;
  gap: 20px;
  padding: 22px 24px 18px;
  border-bottom: 0;
}

.membership-purchase-header h2 {
  color: #202420;
  font-size: 21px;
  font-weight: 900;
  letter-spacing: -0.35px;
}

.membership-purchase-header p {
  margin-top: 6px;
  color: #737a73;
  font-size: 12px;
  font-weight: 650;
}

.membership-purchase-close {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  padding: 0;
  border: 1px solid #e0e3dd;
  border-radius: 50%;
  color: #697069;
  background: #fff;
  font-size: 20px;
  line-height: 1;
}

.membership-purchase-body {
  display: grid;
  gap: 14px;
  padding: 0 24px 22px;
}

.membership-benefit-card {
  position: relative;
  overflow: hidden;
  padding: 21px 22px 23px;
  border: 1px solid #2b271f;
  border-radius: 14px;
  color: #fff8df;
  background: linear-gradient(135deg, #090807 0%, #18140e 66%, #0a0907 100%);
}

.membership-benefit-eyebrow {
  color: #d7b766;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 1.1px;
  text-transform: uppercase;
}

.membership-benefit-title {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 8px;
  font-size: 20px;
  font-weight: 900;
}

.membership-benefit-title svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: #f3cd79;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.9;
}

.membership-date-flow {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 24px;
  padding: 0;
  border-top: 0;
}

.membership-date-step {
  position: relative;
  display: grid;
  gap: 7px;
  min-width: 0;
  padding-top: 24px;
}

.membership-date-step::before {
  content: "";
  position: absolute;
  top: 1px;
  left: 0;
  z-index: 1;
  width: 10px;
  height: 10px;
  border: 3px solid #11100c;
  border-radius: 50%;
  background: #e1bd6c;
  box-shadow: 0 0 0 1px rgba(242, 207, 126, 0.48);
}

.membership-date-step:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 7px;
  left: 14px;
  right: 7px;
  height: 2px;
  background: linear-gradient(90deg, rgba(225, 189, 108, 0.64), rgba(225, 189, 108, 0.2));
}

.membership-date-step span {
  color: rgba(255, 255, 255, 0.52);
  font-size: 11px;
  font-weight: 760;
  line-height: 1.35;
}

.membership-date-step strong {
  overflow: hidden;
  color: #fff8df;
  font-size: 13px;
  font-weight: 860;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.membership-date-step.is-api strong {
  color: #efcf84;
}

.membership-order-summary {
  overflow: hidden;
  border: 1px solid #e1e4dd;
  border-radius: 12px;
}

.membership-order-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 40px;
  padding: 0 15px;
  border-top: 1px solid #eceee9;
  color: #747b74;
  font-size: 12px;
  font-weight: 680;
}

.membership-order-row:first-child {
  border-top: 0;
}

.membership-order-row strong {
  color: #2b302b;
  font-weight: 850;
  text-align: right;
}

.membership-order-row.is-charge strong {
  color: #a25c15;
}

.membership-order-note {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  color: #767d76;
  font-size: 11px;
  font-weight: 650;
  line-height: 1.45;
}

.membership-order-note::before {
  content: "i";
  display: grid;
  place-items: center;
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  border: 1px solid #d6dad3;
  border-radius: 50%;
  color: #777e77;
  font-size: 10px;
  font-weight: 900;
}

.membership-purchase-body .membership-modal-status {
  min-height: 0;
  margin: 0;
}

.membership-purchase-body .membership-modal-status:empty {
  display: none;
}

.membership-modal.membership-purchase-modal .membership-purchase-footer {
  display: grid;
  grid-template-columns: 1fr 1.45fr;
  gap: 10px;
  padding: 15px 24px 20px;
  border-top: 1px solid #e8ebe5;
  background: #fafbf8;
}

.membership-purchase-footer button {
  min-height: 42px;
  padding: 0 14px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 860;
}

.membership-purchase-cancel {
  border: 1px solid #d8dcd4;
  color: #626962;
  background: #fff;
}

.membership-purchase-confirm {
  border: 0;
  color: #211806;
  background: linear-gradient(180deg, #f8dc96, #e9bd5d);
  box-shadow: 0 8px 22px rgba(218, 167, 63, 0.2);
}

.membership-purchase-confirm:disabled {
  cursor: wait;
  opacity: 0.66;
}

@media (max-width: 720px) {
  .xprompt-plus-bar {
    grid-template-columns: 1fr;
  }

  .xprompt-plus-side {
    grid-template-columns: 1fr auto;
    justify-items: start;
    align-items: center;
  }

  .membership-date-flow {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .membership-date-step {
    padding: 0 0 0 26px;
  }

  .membership-date-step::before {
    top: 4px;
  }

  .membership-date-step:not(:last-child)::after {
    top: 15px;
    bottom: -16px;
    left: 7px;
    width: 2px;
    height: auto;
  }

  .membership-modal-backdrop {
    align-items: end;
    padding: 10px;
  }

  .membership-modal.membership-purchase-modal {
    max-height: calc(100vh - 20px);
    overflow-y: auto;
    border-radius: 18px 18px 10px 10px;
  }
}

.profile-action-panel {
  overflow: hidden;
  border: 1px solid #dde1da;
  border-radius: 8px;
  background: #fff;
}

.profile-action-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  min-height: 68px;
  padding: 14px;
  border-top: 1px solid #ebece7;
}

.profile-action-row:first-child {
  border-top: 0;
}

.profile-action-text strong {
  display: block;
  margin-bottom: 6px;
  color: #252826;
  font-size: 14px;
  font-weight: 820;
}

.profile-action-text span {
  display: block;
  color: #727973;
  font-size: 12.5px;
  font-weight: 650;
  line-height: 1.45;
}

.language-segmented {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  width: min(260px, 100%);
  height: 38px;
  padding: 4px;
  border: 1px solid #d9ded6;
  border-radius: 8px;
  background: #f6f6f2;
}

.language-segmented button {
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #626a64;
  font-size: 12px;
  font-weight: 820;
}

.language-segmented button.is-active {
  background: #fff;
  color: #252826;
  box-shadow: 0 1px 5px rgba(32, 37, 33, 0.12);
}

.connection-editor {
  overflow: hidden;
  border: 1px solid #dde1da;
  border-radius: 8px;
  background: #fff;
}

.settings-model-wizard {
  display: grid;
  overflow: visible;
}

.settings-wizard-steps {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
  margin: 0;
  padding: 12px 14px;
  border-bottom: 1px solid #eceee8;
  list-style: none;
  background: #fcfcf8;
}

.settings-wizard-step {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  color: #8a928c;
  font-size: 11px;
  font-weight: 780;
  line-height: 1.2;
}

.settings-wizard-step span {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  border: 1px solid #dfe3dc;
  border-radius: 999px;
  background: #fff;
  color: #7d867e;
  font-size: 11px;
  font-weight: 860;
}

.settings-wizard-step strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.settings-wizard-step[data-state="current"] {
  color: #252826;
}

.settings-wizard-step[data-state="current"] span,
.settings-wizard-step[data-state="done"] span {
  border-color: #e4d94e;
  background: var(--debug-brand-soft);
  color: #252826;
}

.settings-wizard-panel {
  display: grid;
  gap: 14px;
  padding: 18px 18px 16px;
}

.settings-wizard-copy {
  color: #68716a;
  font-size: 12px;
  font-weight: 680;
  line-height: 1.5;
}

.settings-wizard-provider-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.settings-wizard-provider-card {
  min-height: 96px;
  padding: 14px;
  border: 1px solid #dfe3dc;
  border-radius: 8px;
  background: #fff;
  color: #303631;
  text-align: left;
}

.settings-wizard-provider-card:hover,
.settings-wizard-provider-card:focus-visible {
  background: #fffef4;
}

.settings-wizard-provider-card.is-active {
  border-color: rgba(95, 86, 0, .38);
  background: #fffdef;
  box-shadow: inset 0 0 0 1px rgba(254, 246, 91, .36);
}

.settings-wizard-provider-card strong,
.settings-model-choice strong {
  display: block;
  overflow: hidden;
  color: #252826;
  font-size: 15px;
  font-weight: 840;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.settings-wizard-provider-card span,
.settings-model-choice span {
  display: block;
  margin-top: 6px;
  color: #737c75;
  font-size: 12px;
  font-weight: 680;
  line-height: 1.4;
}

.settings-wizard-field {
  display: grid;
  gap: 7px;
}

.settings-wizard-label {
  color: #303631;
  font-size: 13px;
  font-weight: 820;
}

.settings-wizard-advanced {
  border: 1px solid #e2e6df;
  border-radius: 8px;
  background: #fcfcf8;
}

.settings-wizard-advanced summary {
  min-height: 40px;
  padding: 11px 12px;
  color: #4f584f;
  font-size: 12px;
  font-weight: 820;
  cursor: pointer;
}

.settings-wizard-advanced .settings-wizard-field {
  padding: 0 12px 12px;
}

.settings-model-choice-list {
  display: grid;
  gap: 8px;
  max-height: 360px;
  overflow: auto;
  padding-right: 2px;
}

.settings-model-choice {
  display: grid;
  min-width: 0;
  padding: 12px 13px;
  border: 1px solid #dfe3dc;
  border-radius: 8px;
  background: #fff;
  text-align: left;
}

.settings-model-choice:hover,
.settings-model-choice:focus-visible {
  background: #fffef4;
}

.settings-model-choice.is-active {
  border-color: rgba(95, 86, 0, .38);
  background: #fffdef;
}

.settings-wizard-capabilities.is-loading {
  opacity: .72;
}

.settings-confirm-summary {
  display: grid;
  overflow: hidden;
  border: 1px solid #e1e5de;
  border-radius: 8px;
  background: #fff;
}

.settings-confirm-row {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 11px 12px;
  border-top: 1px solid #eef0eb;
}

.settings-confirm-row:first-child {
  border-top: 0;
}

.settings-confirm-row span {
  color: #727b73;
  font-size: 12px;
  font-weight: 760;
}

.settings-confirm-row strong {
  overflow-wrap: anywhere;
  color: #252826;
  font-size: 13px;
  font-weight: 820;
  line-height: 1.4;
}

.settings-confirm-warning {
  margin: 0;
}

.settings-wizard-action-bar {
  align-items: center;
}

.settings-form-row {
  display: grid;
  grid-template-columns: 176px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  min-height: 64px;
  padding: 14px;
  border-top: 1px solid #eceee8;
}

.settings-form-row:first-child {
  border-top: 0;
}

.settings-form-label strong {
  display: block;
  color: #303631;
  font-size: 13px;
  font-weight: 820;
}

.settings-form-label span {
  display: block;
  margin-top: 4px;
  color: #7a827c;
  font-size: 11.5px;
  font-weight: 640;
  line-height: 1.45;
}

.settings-input,
.settings-select {
  width: 100%;
  height: 38px;
  padding: 0 12px;
  border: 1px solid #d9ded6;
  border-radius: 8px;
  outline: 0;
  background: #fff;
  color: #252826;
  font-size: 13px;
  font-weight: 700;
}

.settings-input:focus,
.settings-select:focus {
  border-color: rgba(95, 86, 0, 0.5);
  box-shadow: 0 0 0 3px rgba(254, 246, 91, 0.24);
}

.provider-segmented {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  height: 38px;
  padding: 4px;
  border: 1px solid #d9ded6;
  border-radius: 8px;
  background: #f6f6f2;
}

.provider-segmented button {
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #626a64;
  font-size: 12px;
  font-weight: 800;
}

.provider-segmented button.is-active {
  background: #fff;
  color: #252826;
  box-shadow: 0 1px 5px rgba(32, 37, 33, 0.12);
}

.inline-action-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.inline-action-row .settings-select,
.inline-action-row .settings-input {
  min-width: 0;
}

.small-action {
  flex: 0 0 auto;
  height: 38px;
  padding: 0 14px;
  border: 1px solid #d8ddd5;
  border-radius: 8px;
  background: #fff;
  color: #303631;
  font-size: 12px;
  font-weight: 820;
}

.small-action:hover {
  background: #f7f8f4;
}

.form-help {
  margin: 8px 0 0;
  color: #768078;
  font-size: 11.5px;
  font-weight: 640;
  line-height: 1.55;
}

.form-help.is-ok {
  color: #3e7f44;
}

.form-help.is-error {
  color: var(--danger);
}

.capability-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.capability-card {
  min-height: 64px;
  padding: 10px;
  border: 1px solid #e0e3dc;
  border-radius: 8px;
  background: #fcfcf8;
}

.capability-card span {
  display: block;
  color: #717970;
  font-size: 11px;
  font-weight: 800;
}

.capability-card strong {
  display: block;
  margin-top: 6px;
  color: #252826;
  font-size: 13px;
  font-weight: 820;
  line-height: 1.3;
}

.settings-action-bar {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 12px 14px;
  border-top: 1px solid #eceee8;
  background: #fff;
}

.settings-button {
  height: 36px;
  padding: 0 14px;
  border: 0;
  border-radius: 8px;
  background: #fff;
  color: #303631;
  box-shadow: inset 0 0 0 1px #d8ddd5;
  font-size: 13px;
  font-weight: 820;
}

.settings-button.primary {
  background: var(--brand);
  color: #111;
  box-shadow: inset 0 0 0 1px rgba(37, 40, 38, 0.08);
}

.settings-button.danger {
  color: var(--danger);
  box-shadow: inset 0 0 0 1px rgba(189, 59, 54, 0.22);
}

.settings-button:disabled,
.small-action:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.account-ledger-settings-host {
  display: grid;
  min-width: 0;
}

.account-ledger-settings-page .account-ledger-settings-card {
  position: static;
  z-index: auto;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: 100%;
  min-height: 0;
  overflow: hidden;
  border: 0;
  border-radius: 8px;
  background: #fff;
  box-shadow: none;
}

.account-ledger-settings-page .account-ledger-header,
.account-ledger-settings-page .account-ledger-body {
  background: #fff;
}

.account-ledger-settings-page .account-ledger-header {
  padding-right: 0;
  padding-left: 0;
}

.account-ledger-settings-page .account-ledger-body {
  padding-right: 0;
  padding-left: 0;
}

.account-ledger-settings-page .account-ledger-title {
  margin: 0;
  font-size: 22px;
  font-weight: 820;
  line-height: 1.18;
}

.account-ledger-settings-page .account-ledger-meta {
  font-size: 13px;
  font-weight: 650;
  line-height: 1.35;
}

.account-ledger-settings-page .account-ledger-metric {
  padding: 10px 12px;
  background: #fcfcf8;
}

.account-ledger-settings-page .account-ledger-metric span {
  color: #111;
  font-size: 10.5px;
}

.account-ledger-settings-page .account-ledger-metric strong {
  color: #111;
  font-size: 15px;
}

.account-ledger-settings-page .account-ledger-recharge {
  grid-template-columns: 38px minmax(0, 1fr) auto;
  gap: 10px;
  padding: 10px;
  background: linear-gradient(180deg, #fbfdff, #f0f7ff);
}

.account-ledger-settings-page .alipay-logo-mark {
  width: 38px;
  height: 38px;
}

.account-ledger-settings-page .account-ledger-recharge-title {
  font-size: 12px;
}

.account-ledger-settings-page .account-ledger-recharge-copy {
  font-size: 11px;
}

.account-ledger-settings-page .account-recharge-button {
  min-width: 86px;
  height: 32px;
  padding: 0 12px;
  font-size: 12px;
}

.account-ledger-settings-page .account-ledger-pricing {
  gap: 8px;
  padding: 10px;
  border-radius: 9px;
}

.account-ledger-settings-page .account-ledger-pricing-title {
  font-size: 13px;
}

.account-ledger-settings-page .account-ledger-pricing-copy {
  font-size: 11px;
}

.account-ledger-settings-page .account-ledger-pricing-link {
  height: 28px;
  padding: 0 9px;
  font-size: 11px;
}

.account-ledger-settings-page .account-ledger-pricing-row {
  grid-template-columns: minmax(118px, 0.9fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px;
  padding: 8px;
}

.account-ledger-settings-page .account-ledger-pricing-model strong,
.account-ledger-settings-page .account-ledger-price-pill em {
  font-size: 11.5px;
}

.account-ledger-settings-page .account-ledger-price-pill,
.account-ledger-settings-page .account-ledger-price-stack b {
  font-size: 10.5px;
}

.account-ledger-settings-page .account-ledger-flow-settings .account-ledger-section-head h3 {
  font-size: 14px;
}

.account-ledger-settings-page .account-ledger-flow-settings .account-ledger-filter {
  height: 34px;
  padding: 3px;
}

.account-ledger-settings-page .account-ledger-flow-settings .account-ledger-filter button,
.account-ledger-settings-page .account-ledger-flow-settings .account-ledger-row-title,
.account-ledger-settings-page .account-ledger-flow-settings .account-ledger-amount {
  font-size: 12px;
}

.account-ledger-settings-page .account-ledger-flow-settings .account-ledger-filter button {
  height: 26px;
  border-radius: 7px;
}

.account-ledger-settings-page .account-ledger-flow-settings .account-ledger-row-top {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.account-ledger-settings-page .account-ledger-flow-settings .account-ledger-row-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-ledger-settings-page .account-ledger-flow-settings .account-ledger-amount {
  flex: 0 0 auto;
  margin-left: auto;
}

.account-ledger-platform-model-badge {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border: 1px solid #d7ddd2;
  border-radius: 999px;
  background: #f5f7f1;
  color: #697269;
  font-size: 11px;
  font-weight: 820;
  line-height: 1;
  white-space: nowrap;
}

.account-ledger-settings-page .account-ledger-flow-settings .account-ledger-row {
  gap: 4px;
  padding: 10px 0 10px 14px;
  cursor: pointer;
}

.account-ledger-settings-page .account-ledger-flow-settings .account-ledger-row::before {
  top: 10px;
  bottom: 10px;
}

.account-ledger-settings-page .account-ledger-flow-settings .account-ledger-row-meta,
.account-ledger-settings-page .account-ledger-flow-settings .account-ledger-preview {
  font-size: 11.5px;
}

.settings-detail-panel {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid #dde1da;
  border-radius: 8px;
  background: #fcfcf8;
}

@media (max-width: 860px) {
  .pi-app-shell.is-settings {
    grid-template-columns: 300px minmax(0, 1fr);
    min-width: 0;
  }

  .settings-page {
    padding: 34px 24px 42px;
  }

  .settings-page-header {
    flex-wrap: wrap;
  }

  .dev-access-info {
    width: 100%;
    max-width: none;
  }

  .settings-form-row {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .settings-wizard-provider-grid {
    grid-template-columns: 1fr;
  }

  .capability-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .settings-action-bar {
    flex-wrap: wrap;
  }
}

@media (max-width: 620px) {
  .pi-app-shell.is-settings {
    grid-template-columns: 1fr;
  }

  .settings-sidebar {
    min-height: auto;
    height: auto;
    padding: 16px 12px 10px;
  }

  .settings-nav-section + .settings-nav-section {
    margin-top: 10px;
  }

  .settings-main {
    height: auto;
    min-height: 100dvh;
    overflow: visible;
  }

  .profile-action-row,
  .account-ledger-settings-page .account-ledger-recharge {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .language-segmented,
  .provider-segmented {
    width: 100%;
  }

  .settings-wizard-steps {
    grid-template-columns: 1fr;
  }

  .settings-wizard-step strong {
    white-space: normal;
  }

  .settings-confirm-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .inline-action-row {
    flex-wrap: wrap;
  }
}

.pi-menu {
  --accent: var(--pi-surface-accent-strong);
  --accent-border: rgba(95, 86, 0, 0.22);
  --accent-border-soft: rgba(95, 86, 0, 0.14);
  --accent-border-strong: rgba(95, 86, 0, 0.42);
  --accent-grid: rgba(95, 86, 0, 0.08);
  --accent-hover: var(--pi-surface-accent-strong);
  --accent-ink: var(--pi-surface-accent-soft);
  --accent-ring: rgba(254, 246, 91, 0.34);
  --code-ink: var(--pi-surface-accent-soft);
  --teal-soft: var(--pi-surface-accent-soft);
  position: fixed;
  z-index: 80;
  width: 176px;
  padding: 8px;
  border: 1px solid #d6d9d4;
  border-radius: 12px;
  background: #fbfbf8;
  box-shadow: 0 18px 50px rgba(33, 37, 34, 0.16);
}

.pi-account-menu {
  width: 256px;
  max-height: calc(100vh - 24px);
  overflow-y: auto;
  transform-origin: right bottom;
}

.pi-menu[hidden] {
  display: none;
}

.pi-menu-env {
  display: grid;
  gap: 3px;
  padding: 8px 10px 10px;
  border-bottom: 1px solid #e5e5df;
  margin-bottom: 6px;
  color: #6f7670;
}

.pi-menu-env-label {
  color: #9aa19c;
  font-size: 11px;
  font-weight: 750;
  line-height: 1.2;
}

.pi-menu-env-text {
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.pi-menu-env-text[data-tone="readonly"] {
  background: transparent;
  color: #95601d;
}

.pi-menu-env-text[data-tone="prod"] {
  background: transparent;
  color: #5a6066;
}

.pi-menu-env-text[data-tone="dev"] {
  background: transparent;
  color: var(--accent);
}

.pi-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  height: 36px;
  padding: 0 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #3f4540;
  text-align: left;
  font-size: 14px;
  font-weight: 650;
}

.pi-menu-item[aria-expanded="true"] {
  background: #ededeb;
}

.pi-version-panel {
  display: grid;
  gap: 8px;
  margin: 4px 0 8px;
  padding: 9px 10px;
  border: 1px solid #e2e3de;
  border-radius: 10px;
  background: #fff;
}

.pi-version-panel[hidden] {
  display: none;
}

.pi-version-list {
  display: grid;
  gap: 7px;
  margin: 0;
}

.pi-version-list > div {
  display: grid;
  gap: 2px;
}

.pi-version-list dt {
  color: #9aa19c;
  font-size: 11px;
  font-weight: 750;
  line-height: 1.2;
}

.pi-version-list dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
  color: #3f4540;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.35;
}

.pi-version-copy-button {
  height: 30px;
  border: 1px solid #d6d9d4;
  border-radius: 8px;
  background: #fbfbf8;
  color: #3f4540;
  font-size: 12px;
  font-weight: 750;
}

.pi-version-copy-button:hover {
  background: #ededeb;
}

.pi-menu-language {
  display: grid;
  gap: 7px;
  margin: 6px 0 8px;
  padding: 9px 10px 10px;
  border: 1px solid #e2e3de;
  border-radius: 10px;
  background: #fff;
}

.pi-menu-section-label {
  color: #9aa19c;
  font-size: 11px;
  font-weight: 750;
  line-height: 1.2;
}

.pi-menu-language-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 3px;
  border: 1px solid #d9dbd5;
  border-radius: 8px;
  background: #eeeee8;
}

.pi-menu-language-option {
  min-width: 0;
  height: 28px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #5f665f;
  font-size: 12px;
  font-weight: 800;
}

.pi-menu-language-option.is-active {
  background: #fff;
  color: #222622;
  box-shadow: 0 1px 2px rgba(34, 38, 34, 0.16);
}

.pi-menu-item:hover {
  background: #ededeb;
}

.pi-menu-item:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.pi-menu-item.danger {
  color: var(--error);
}

.pi-toast {
  position: fixed;
  left: 50%;
  top: 28px;
  top: calc(env(safe-area-inset-top, 0px) + 28px);
  z-index: 1300;
  max-width: min(520px, calc(100vw - 32px));
  padding: 11px 14px;
  border-radius: 999px;
  background: rgba(38, 43, 39, 0.94);
  color: #fff;
  font-size: 14px;
  font-weight: 650;
  line-height: 1.35;
  text-align: center;
  box-shadow: 0 16px 42px rgba(25, 29, 26, 0.22);
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) translateY(-12px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.pi-toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.pi-collapsed-only {
  display: none;
}

.pi-app-shell.is-sidebar-collapsed .pi-sidebar {
  width: 74px;
}

.pi-app-shell.is-sidebar-collapsed .pi-sidebar-nav,
.pi-app-shell.is-sidebar-collapsed .pi-sidebar-scroll,
.pi-app-shell.is-sidebar-collapsed .pi-environment,
.pi-app-shell.is-sidebar-collapsed .pi-account-info,
.pi-app-shell.is-sidebar-collapsed .pi-account .pi-sidebar-icon-button {
  display: none;
}

.pi-app-shell.is-sidebar-collapsed .pi-sidebar-topbar {
  justify-content: center;
  padding: 14px 0;
}

.pi-app-shell.is-sidebar-collapsed .pi-sidebar-brand {
  display: none;
}

.pi-app-shell.is-sidebar-collapsed .pi-collapsed-only {
  display: grid;
  gap: 12px;
  justify-items: center;
  padding-top: 8px;
}

.pi-app-shell.is-sidebar-collapsed .pi-account {
  grid-template-columns: 38px;
  justify-content: center;
  padding: 10px 0;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(520px, 1fr) minmax(360px, 0.9fr);
  gap: 16px;
  padding: 18px clamp(16px, 3vw, 28px) 28px;
  align-items: start;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.case-panel,
.input-panel,
.result-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  min-width: 0;
}

.case-panel,
.input-panel,
.result-panel {
  padding: 16px;
}

.result-panel,
.history-drawer {
  --accent: var(--pi-surface-accent-strong);
  --accent-border: rgba(95, 86, 0, 0.22);
  --accent-border-soft: rgba(95, 86, 0, 0.14);
  --accent-border-strong: rgba(95, 86, 0, 0.42);
  --accent-grid: rgba(95, 86, 0, 0.08);
  --accent-hover: var(--pi-surface-accent-strong);
  --accent-ink: var(--pi-surface-accent-soft);
  --accent-ring: rgba(254, 246, 91, 0.34);
  --code-ink: var(--pi-surface-accent-soft);
  --teal-soft: var(--pi-surface-accent-soft);
}

.pi-main-workspace {
  grid-template-columns: minmax(var(--pi-editor-min), var(--pi-editor-width)) var(--pi-resize-handle-width) minmax(var(--pi-result-min), 1fr);
  gap: 0;
  align-items: stretch;
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  padding: 0;
  overflow: hidden;
}

.pi-main-workspace > .result-panel,
.pi-main-workspace > .utility-pane {
  display: grid;
  align-self: stretch;
  min-height: 0;
  overflow: hidden;
}

.pi-main-workspace > .result-panel {
  grid-template-rows: auto auto minmax(0, 1fr);
  margin: 18px clamp(16px, 3vw, 28px) 28px 12px;
}

.pi-main-workspace > .utility-pane {
  grid-template-rows: minmax(0, 1fr);
  height: 100vh;
  height: 100dvh;
  margin: 0;
  padding: 12px 24px 0;
  background: #fff;
  border-left: 0;
}

.pi-main-workspace.is-debug-collapsed {
  grid-template-columns: minmax(0, 1fr) 0 64px;
}

.pi-main-workspace.is-debug-collapsed .pi-workspace-resize-handle {
  display: none;
}

.pi-workspace-resize-handle {
  min-height: 0;
  height: 100vh;
  height: 100dvh;
}

.pi-workspace-resize-handle::before {
  left: 50%;
  transform: translateX(-50%);
}

.pi-editor-pane {
  --accent: #126d55;
  --accent-ink: #ffffff;
  --teal-soft: #dcefeb;
  --accent-border: #b9d8cf;
  --accent-border-soft: rgba(18, 109, 85, 0.18);
  --accent-border-strong: rgba(18, 109, 85, 0.26);
  --accent-ring: rgba(18, 109, 85, 0.1);
  --accent-grid: rgba(18, 109, 85, 0.08);
  --accent-hover: #0f6a53;
  --code-ink: #d9f4e8;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  position: relative;
  min-width: 0;
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  padding: 30px 34px 0;
  background: rgba(250, 248, 243, 0.44);
  overflow: hidden;
}

.pi-editor-form {
  display: none;
}

.pi-editor-toolbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: nowrap;
  gap: 18px;
  min-width: 0;
  padding-bottom: 20px;
  border-bottom: 1px solid #dcdfda;
  transition: padding-bottom 0.18s ease, gap 0.18s ease;
}

.pi-editor-title-area {
  display: flex;
  align-items: flex-end;
  gap: 18px;
  flex: 1 1 240px;
  min-width: 0;
  transition: align-items 0.18s ease;
}

.pi-editor-title-block {
  flex: 1 1 auto;
  min-width: 0;
}

.pi-editor-eyebrow {
  max-height: 20px;
  overflow: hidden;
  color: #818782;
  font-size: 13px;
  font-weight: 760;
  line-height: 1.4;
  transition: opacity 0.18s ease, max-height 0.18s ease, transform 0.18s ease;
}

.pi-editor-title {
  display: block;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  margin: 5px 0 0;
  padding: 0;
  border: 0;
  outline: 0;
  overflow: hidden;
  background: transparent;
  color: #222724;
  font: inherit;
  font-size: 26px;
  font-weight: 820;
  line-height: 1.15;
  letter-spacing: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: margin 0.18s ease, font-size 0.18s ease, line-height 0.18s ease;
}

.pi-editor-title:focus {
  text-overflow: clip;
}

.pi-editor-pane.is-editor-scrolled .pi-editor-toolbar {
  align-items: center;
  padding-bottom: 10px;
}

.pi-editor-pane.is-editor-scrolled .pi-editor-title-area {
  align-items: center;
}

.pi-editor-pane.is-editor-scrolled .pi-editor-eyebrow {
  max-height: 0;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-4px);
}

.pi-editor-pane.is-editor-scrolled .pi-editor-title {
  margin-top: 0;
  font-size: 20px;
  line-height: 1.12;
}

.pi-editor-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: nowrap;
  gap: 10px;
  flex: 0 0 auto;
  min-width: 0;
  height: 38px;
}

.pi-editor-save-cluster {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 38px;
  min-width: 0;
}

.pi-editor-pane .pi-editor-state-badge {
  height: 38px;
  min-width: 88px;
  padding: 0 14px;
  max-width: 110px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1;
}

.pi-editor-pane .action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 38px;
  padding: 0 14px;
  border: 1px solid #cfd4ce;
  border-radius: 8px;
  background: #fff;
  color: #343a35;
  font-size: 14px;
  font-weight: 720;
  line-height: 1;
  white-space: nowrap;
}

.pi-editor-pane .action-btn:hover:not(:disabled) {
  background: #fffef8;
}

.pi-editor-save-button {
  height: 32px;
  padding: 0 11px;
  color: #5f6761;
  font-size: 12px;
  font-weight: 760;
}

.pi-editor-pane .pi-editor-codex-button {
  height: 34px;
  max-width: none;
  padding: 0 11px;
  gap: 7px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 760;
}

.pi-editor-pane .pi-editor-codex-button .pi-icon {
  width: 18px;
  height: 18px;
}

.pi-editor-pane .pi-editor-codex-button .pi-codex-logo {
  display: block;
  object-fit: contain;
}

.pi-editor-codex-button:disabled,
.pi-editor-pane .action-btn:disabled {
  cursor: not-allowed;
}

.pi-editor-pane .debug-btn {
  background: #fff;
}

.pi-editor-pane .publish-control {
  display: inline-flex;
  align-items: center;
  height: 38px;
  margin-top: 0;
  justify-self: auto;
  position: relative;
}

.pi-editor-pane .publish-menu {
  position: absolute;
  top: calc(100% - 1px);
  right: 0;
  z-index: 24;
  display: grid;
  min-width: 136px;
  gap: 4px;
  padding: 6px;
  border: 1px solid #d7dbd5;
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.96);
  box-shadow: 0 18px 46px rgba(31, 35, 32, 0.14);
  opacity: 0;
  pointer-events: none;
  transform: translateY(4px);
  transition: opacity 0.16s ease, transform 0.16s ease;
  visibility: hidden;
}

.pi-editor-pane .publish-control:hover .publish-menu,
.pi-editor-pane .publish-control:focus-within .publish-menu {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
  visibility: visible;
}

.pi-editor-pane .prompt-publish-menu.publish-disabled:hover .publish-menu,
.pi-editor-pane .prompt-publish-menu.publish-disabled:focus-within .publish-menu {
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
}

.pi-editor-pane .publish-option {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 34px;
  padding: 0 10px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #303631;
  font-size: 13px;
  font-weight: 720;
  text-align: left;
}

.pi-editor-pane .publish-option:hover:not(:disabled) {
  background: #f0eee8;
}

.editor-tabbar-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  min-width: 0;
  gap: 12px;
  padding: 10px 0 12px;
}

.editor-tabbar {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  flex: 0 1 auto;
  min-width: 0;
  height: 38px;
  padding: 4px;
  border: 1px solid #d9ddd7;
  border-radius: 9px;
  background: linear-gradient(180deg, rgba(244, 242, 236, 0.94), rgba(235, 232, 224, 0.94));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.78);
}

.editor-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  min-width: 0;
  height: 28px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: #667069;
  font-size: 12px;
  font-weight: 760;
  line-height: 1;
  white-space: nowrap;
}

.editor-tab:hover {
  background: rgba(255, 255, 255, 0.48);
}

.editor-tab.is-active {
  border-color: #cfd4ce;
  background: #fff;
  color: #222724;
  box-shadow: 0 1px 4px rgba(31, 35, 32, 0.12);
}

.editor-tabbar-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  flex: 0 0 auto;
  gap: 8px;
  margin-left: auto;
}

.markdown-preview-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  position: static;
  width: 118px;
  height: 34px;
  padding: 0 10px 0 12px;
  transform: none;
  border: 1px solid #cfd4ce;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.86);
  color: #424941;
  font-size: 12px;
  font-weight: 760;
  box-shadow: 0 1px 0 rgba(31, 35, 32, 0.04);
  backdrop-filter: blur(12px);
  white-space: nowrap;
}

.markdown-preview-toggle:hover {
  background: #fff;
}

.markdown-preview-toggle.is-active {
  background: rgba(255, 255, 255, 0.9);
  color: #424941;
}

.toggle-switch {
  display: inline-flex;
  align-items: center;
  width: 28px;
  height: 16px;
  padding: 2px;
  border-radius: 999px;
  background: #d6d9d4;
  transition: background 0.16s ease;
}

.toggle-switch::before {
  content: "";
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 1px 3px rgba(31, 35, 32, 0.18);
  transition: transform 0.16s ease;
}

.markdown-preview-toggle.is-active .toggle-switch {
  background: var(--pi-brand-ink);
}

.markdown-preview-toggle.is-active .toggle-switch::before {
  transform: translateX(12px);
}

.detail {
  min-height: 0;
  overflow: hidden;
  padding: 0;
}

.detail-grid {
  display: block;
  height: 100%;
  min-height: 0;
}

.prompt-editor-surface {
  position: relative;
  height: 100%;
  min-height: 0;
  padding: 0;
}

.monaco-editor-host,
.prompt-fallback-editor {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 420px;
  border: 0;
  outline: 0;
  background: transparent;
}

.monaco-editor-host {
  display: none;
  position: relative;
}

.monaco-editor-host.is-ready {
  display: block;
}

.monaco-editor-host .monaco-editor textarea.inputarea:not(.ime-input) {
  color: transparent !important;
  caret-color: transparent !important;
  text-shadow: none !important;
  background: transparent !important;
  -webkit-text-fill-color: transparent !important;
}

.monaco-editor-host .monaco-editor textarea.inputarea:not(.ime-input)::selection {
  color: transparent !important;
  background: transparent !important;
}

.monaco-editor-host .monaco-editor textarea.inputarea.ime-input {
  opacity: 0 !important;
  left: var(--prompt-ime-anchor-left, 0px) !important;
  top: var(--prompt-ime-anchor-top, 0px) !important;
  width: var(--prompt-ime-anchor-width, 2px) !important;
  min-width: 2px !important;
  max-width: var(--prompt-ime-anchor-width, 2px) !important;
  transform: none !important;
  overflow: hidden !important;
  color: transparent !important;
  caret-color: transparent !important;
  text-shadow: none !important;
  background: transparent !important;
  -webkit-text-fill-color: transparent !important;
}

.monaco-editor-host .monaco-editor textarea.inputarea.ime-input::selection {
  color: transparent !important;
  background: transparent !important;
}

.prompt-fallback-editor {
  padding: 18px 0 150px;
  resize: none;
  overflow: auto;
  color: #303631;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 16px;
  line-height: 1.75;
}

.prompt-fallback-editor[hidden] {
  display: none;
}

.pi-editor-pane.is-markdown-preview .monaco-editor-host.is-ready,
.pi-editor-pane.is-markdown-preview .prompt-fallback-editor {
  display: none;
}

.markdown-preview-surface {
  display: block;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: 420px;
  padding: 18px 0 150px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  color: #303631;
  font-size: 16px;
  font-weight: 520;
  line-height: 1.78;
}

.markdown-preview-surface[hidden] {
  display: none;
}

.markdown-preview-surface h1,
.markdown-preview-surface h2,
.markdown-preview-surface h3 {
  margin: 0 0 14px;
  color: #222724;
  font-weight: 820;
  line-height: 1.25;
}

.markdown-preview-surface h1 {
  font-size: 24px;
}

.markdown-preview-surface h2 {
  margin-top: 24px;
  font-size: 19px;
}

.markdown-preview-surface h3 {
  margin-top: 20px;
  font-size: 16px;
}

.markdown-preview-surface p,
.markdown-preview-surface ul,
.markdown-preview-surface ol,
.markdown-preview-surface blockquote,
.markdown-preview-surface pre {
  margin: 0 0 14px;
}

.markdown-preview-surface ul,
.markdown-preview-surface ol {
  padding-left: 24px;
}

.markdown-preview-surface li + li {
  margin-top: 4px;
}

.markdown-preview-surface blockquote {
  padding-left: 14px;
  border-left: 3px solid #d7d2aa;
  color: #59605a;
}

.markdown-preview-surface code {
  padding: 2px 5px;
  border-radius: 5px;
  background: rgba(224, 221, 211, 0.76);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.92em;
}

.markdown-preview-surface pre {
  overflow: auto;
  padding: 12px;
  border-radius: 7px;
  background: #252826;
  color: #f2f4ef;
}

.model-env-bar {
  display: grid;
  grid-template-columns: minmax(170px, 1fr) minmax(180px, 1.05fr) minmax(220px, 1.15fr);
  gap: 12px;
  align-items: center;
  position: absolute;
  right: 34px;
  bottom: 26px;
  z-index: 6;
  width: min(700px, calc(100% - 68px));
  max-width: 700px;
  padding: 10px 18px 10px 12px;
  border: 1px solid rgba(139, 156, 132, .34);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(45, 54, 45, .96), rgba(32, 41, 34, .96));
  box-shadow: 0 18px 44px rgba(20, 27, 22, .24), 0 1px 0 rgba(255, 255, 255, .08), inset 0 0 0 1px rgba(221, 229, 215, .06);
  backdrop-filter: blur(14px);
}

.model-control {
  min-width: 0;
}

.model-label {
  display: block;
  margin-bottom: 5px;
  color: #bcc8b9;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
}

.model-select {
  width: 100%;
  height: 32px;
  padding: 0 30px 0 10px;
  border: 1px solid rgba(181, 195, 174, .24);
  border-radius: 8px;
  outline: 0;
  background-color: #202a22;
  color: #eef4ec;
  font-size: 13px;
  font-weight: 740;
}

.thinking-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  height: 32px;
  padding: 3px;
  border: 1px solid rgba(181, 195, 174, .24);
  border-radius: 8px;
  background: rgba(18, 24, 20, .62);
}

.thinking-options[data-option-count="2"] {
  width: min(220px, 100%);
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.thinking-options[data-option-count="1"] {
  width: min(140px, 100%);
  grid-template-columns: minmax(0, 1fr);
}

.thinking-option {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #b3c0b1;
  font-size: 12px;
  font-weight: 780;
}

.thinking-option.is-active {
  background: rgba(217, 227, 208, .16);
  color: #f3f7ef;
  box-shadow: 0 1px 4px rgba(10, 14, 12, .16), inset 0 0 0 1px rgba(217, 227, 208, .24);
}

.thinking-option:disabled,
.thinking-option.is-disabled {
  cursor: not-allowed;
  opacity: .45;
}

.temperature-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px;
  gap: 10px;
  align-items: center;
  height: 32px;
}

.temperature-slider {
  width: 100%;
  height: 24px;
  padding: 0;
  accent-color: #c1cdb3;
}

.temperature-value {
  display: inline-flex;
  justify-content: center;
  justify-self: end;
  min-width: 44px;
  color: #edf4e8;
  font-size: 12px;
  font-weight: 820;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.section-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 36px;
  margin-bottom: 14px;
}

.section-title-row h2,
.section-title-row h3 {
  font-size: 15px;
  line-height: 1.2;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.request-form {
  display: contents;
}

.field {
  display: grid;
  gap: 7px;
  margin-bottom: 13px;
}

.field-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 20px;
}

.field span,
.field-title-row > label:first-child,
.range-field span,
.number-field span,
.check-row span,
.thinking-field > span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.2;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fbfcfa;
  color: var(--ink);
  outline: none;
}

input,
select {
  height: 38px;
  padding: 0 10px;
}

select {
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position:
    calc(100% - 17px) 16px,
    calc(100% - 12px) 16px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 28px;
}

textarea {
  min-height: 120px;
  resize: vertical;
  padding: 10px;
  line-height: 1.5;
}

.markdown-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  user-select: none;
}

.markdown-toggle input {
  width: 16px;
  height: 16px;
  margin: 0;
  padding: 0;
  accent-color: var(--accent);
}

.markdown-preview {
  min-height: 120px;
  overflow: visible;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fbfcfa;
  color: var(--ink);
  padding: 14px;
  cursor: default;
  font-size: 14px;
  line-height: 1.6;
}

.markdown-preview > :first-child {
  margin-top: 0;
}

.markdown-preview > :last-child {
  margin-bottom: 0;
}

.markdown-preview h1,
.markdown-preview h2,
.markdown-preview h3,
.markdown-preview h4 {
  margin: 1em 0 0.45em;
  color: var(--ink);
  font-weight: 800;
  line-height: 1.25;
}

.markdown-preview h1 {
  font-size: 22px;
}

.markdown-preview h2 {
  font-size: 18px;
}

.markdown-preview h3 {
  font-size: 16px;
}

.markdown-preview h4,
.markdown-preview p,
.markdown-preview li,
.markdown-preview table {
  font-size: 14px;
}

.markdown-preview p {
  margin: 0.65em 0;
}

.markdown-preview ul,
.markdown-preview ol {
  margin: 0.65em 0;
  padding-left: 1.35em;
}

.markdown-preview blockquote {
  margin: 0.8em 0;
  padding: 8px 12px;
  border-left: 3px solid var(--accent);
  background: var(--panel-soft);
  color: var(--muted);
}

.markdown-preview code {
  border-radius: 4px;
  background: #eef3ef;
  padding: 1px 5px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.92em;
}

.markdown-preview pre {
  overflow: auto;
  margin: 0.8em 0;
  border-radius: 7px;
  background: var(--code-bg);
  color: var(--code-ink);
  padding: 12px;
}

.markdown-preview pre code {
  background: transparent;
  color: inherit;
  padding: 0;
}

.markdown-preview table {
  display: block;
  overflow-x: auto;
  width: 100%;
  border-collapse: collapse;
  margin: 0.8em 0;
}

.markdown-preview th,
.markdown-preview td {
  border: 1px solid var(--line);
  padding: 7px 9px;
  text-align: left;
}

.markdown-preview th {
  background: var(--panel-soft);
  font-weight: 800;
}

.markdown-empty {
  color: var(--muted);
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ring);
}

.control-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  align-items: end;
  margin-top: 4px;
}

.check-row,
.thinking-field,
.range-field,
.number-field {
  display: grid;
  gap: 7px;
  min-height: 62px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.check-row {
  grid-template-columns: 18px 1fr;
  align-items: center;
}

.check-row input {
  width: 18px;
  height: 18px;
}

.thinking-field {
  min-width: 0;
}

.segmented-control {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  min-height: 34px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fbfcfa;
}

.segmented-control label {
  min-width: 0;
}

.segmented-control input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  padding: 0;
  border: 0;
  clip-path: inset(50%);
  opacity: 0;
  pointer-events: none;
}

.segmented-control span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0 8px;
  border-radius: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

.segmented-control input:focus-visible + span {
  box-shadow: 0 0 0 3px var(--accent-ring);
}

.segmented-control input:checked + span {
  background: var(--accent);
  color: var(--accent-ink);
}

.range-field {
  grid-template-columns: 1fr 42px;
}

.range-field span,
.range-field input {
  grid-column: 1 / 2;
}

.range-field output {
  grid-row: 1 / 3;
  grid-column: 2 / 3;
  align-self: center;
  justify-self: end;
  color: var(--accent);
  font-weight: 700;
}

.range-field input {
  padding: 0;
  height: 24px;
  accent-color: var(--accent);
}

.number-field input {
  height: 32px;
}

button {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #ffffff;
  color: var(--ink);
  cursor: pointer;
}

button:disabled {
  cursor: wait;
  opacity: 0.7;
}

.prompt-publish-menu.publish-disabled button:disabled {
  cursor: not-allowed;
}

.primary-button,
.compact-button,
.icon-button,
.case-item button,
.wide-button,
.library-tab,
.prompt-action-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 36px;
  padding: 0 12px;
}

.primary-button {
  min-width: 92px;
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
  font-weight: 700;
}

.compact-button {
  min-width: 82px;
}

.wide-button {
  width: 100%;
  margin-bottom: 10px;
}

.icon-button {
  width: 38px;
  padding: 0;
}

button svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: 0 0 auto;
}

.primary-button svg path {
  fill: currentColor;
  stroke: none;
}

.case-list {
  display: grid;
  gap: 8px;
  max-height: calc(100vh - 230px);
  overflow: auto;
  padding-right: 2px;
}

.library-toolbar {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  margin-bottom: 10px;
}

.library-tab {
  min-width: 0;
  font-size: 13px;
}

.library-tab.active {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--teal-soft);
  font-weight: 700;
}

.library-status {
  min-height: 34px;
  margin: 0 0 10px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: #fbfcfa;
  font-size: 12px;
  line-height: 1.4;
}

.library-status[data-tone="ok"] {
  color: var(--accent);
  border-color: var(--accent-border);
  background: var(--teal-soft);
}

.library-status[data-tone="error"] {
  color: var(--error);
  border-color: #f0b2ad;
  background: var(--error-bg);
}

.today-metering-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 8px 10px;
  border: 1px solid var(--accent-border);
  border-radius: 8px;
  background: var(--teal-soft);
  color: var(--accent);
  font-size: 12px;
}

.today-metering-bar[data-tone="error"] {
  color: var(--error);
  border-color: #f0b2ad;
  background: var(--error-bg);
}

.today-metering-bar div {
  min-width: 0;
}

.today-metering-bar span {
  display: block;
  margin-bottom: 2px;
  color: var(--muted);
  font-weight: 600;
}

.today-metering-bar strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.today-metering-bar button {
  height: 28px;
  padding: 0 10px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
}

.account-metering-card .today-metering-bar {
  border-color: var(--accent-border-soft);
  background: rgba(255, 255, 255, 0.58);
}

.account-metering-card .today-metering-bar[data-tone="error"] {
  border-color: #f0b2ad;
  background: var(--error-bg);
}

.case-item {
  display: grid;
  grid-template-columns: 1fr 36px;
  gap: 7px;
}

.case-item button {
  min-width: 0;
  height: 36px;
}

.case-load {
  justify-content: flex-start;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.case-delete {
  padding: 0;
}

.prompt-item {
  display: grid;
  gap: 9px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
}

.prompt-item.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ring);
}

.prompt-meta {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.prompt-meta strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.prompt-meta span {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.prompt-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.prompt-action-button {
  min-width: 0;
  height: 30px;
  padding: 0 8px;
  font-size: 12px;
}

.prompt-action-button.danger {
  color: var(--error);
}

.empty-cases {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
  padding: 10px;
  border: 1px dashed var(--line);
  border-radius: 8px;
}

.badge {
  min-width: 74px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 9px;
  border-radius: 999px;
  background: var(--teal-soft);
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
}

.badge.dirty {
  background: #fff8ea;
  color: var(--amber);
}

.badge.saving {
  background: #eef6ff;
  color: #2563a8;
}

.badge.error {
  background: var(--error-bg);
  color: var(--error);
}

.badge.readonly {
  background: #f2f3f0;
  color: #6c746d;
}

.badge.archived {
  background: var(--error-bg);
  color: var(--error);
}

.error-box {
  margin-bottom: 12px;
  padding: 10px;
  border: 1px solid #f0b2ad;
  border-radius: 8px;
  background: var(--error-bg);
  color: var(--error);
  line-height: 1.45;
  font-size: 13px;
}

.current-run-anchor {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
  margin-bottom: 12px;
}

.current-run-anchor > div {
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--accent-border);
  border-radius: 8px;
  background: var(--teal-soft);
}

.current-run-anchor span {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.2;
}

.current-run-anchor strong {
  overflow: hidden;
  color: var(--accent);
  font-size: 13px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.right-panel-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  margin-bottom: 12px;
}

.right-panel-tab {
  height: 36px;
  font-size: 13px;
  padding: 0 10px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.right-panel-tab.active {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--teal-soft);
  font-weight: 800;
}

.right-workspace-panel {
  display: none;
  min-height: 0;
  overflow: hidden;
}

.right-workspace-panel.active {
  display: grid;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

#responseWorkspacePanel.active {
  --debug-output-row: minmax(380px, 1.45fr);
  --debug-history-row: minmax(160px, .55fr);
  grid-template-rows: auto var(--debug-output-row) 12px var(--debug-history-row);
  grid-auto-rows: 0;
  align-content: stretch;
  overflow: hidden;
}

#responseWorkspacePanel > .debug-response-toolbar {
  grid-row: 1;
}

#responseWorkspacePanel > .debug-output-shell {
  grid-row: 2;
}

#responseWorkspacePanel > .response-history-resizer {
  grid-row: 3;
}

#responseWorkspacePanel > .run-history {
  grid-row: 4;
}

#useCasesWorkspacePanel.active,
#agentAccessWorkspacePanel.active {
  grid-template-rows: minmax(0, 1fr);
}

.tab-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
  margin-bottom: 10px;
}

.tab-button {
  height: 34px;
  font-size: 13px;
}

.tab-button.active {
  border-color: #b99459;
  color: var(--amber);
  background: #fff8ea;
  font-weight: 700;
}

.output-block {
  display: none;
  min-height: 0;
  max-height: none;
  margin: 0;
  padding: 14px;
  border-radius: 8px;
  background: var(--code-bg);
  color: var(--code-ink);
  overflow: auto;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 12px;
}

.output-block.active {
  display: block;
  height: 100%;
}

.follow-up-panel {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
}

.compact-row {
  min-height: 24px;
  margin-bottom: 0;
}

.follow-up-panel textarea {
  min-height: 92px;
  margin: 0;
}

.follow-up-actions {
  display: flex;
  justify-content: flex-end;
}

.run-history-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 0;
  margin-top: 0;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  overflow: hidden;
}

.history-status {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
  text-align: right;
}

.history-status[data-tone="ok"] {
  color: var(--accent);
}

.history-status[data-tone="error"] {
  color: var(--error);
}

.run-history-list {
  display: grid;
  gap: 10px;
  min-height: 0;
  max-height: none;
  overflow: auto;
  padding-right: 2px;
}

.history-group {
  display: grid;
  gap: 7px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7faf7;
}

.history-group-title {
  overflow: hidden;
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-empty {
  padding: 12px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: #fbfcfa;
  font-size: 13px;
  line-height: 1.45;
}

.run-history-item {
  display: grid;
  gap: 6px;
  width: 100%;
  min-height: 86px;
  padding: 10px;
  text-align: left;
  background: #fbfcfa;
  border-radius: 8px;
}

.run-history-item:hover,
.run-history-item:focus-visible {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ring);
  outline: none;
}

.run-history-item[data-tone="error"] {
  border-color: #f0b2ad;
}

.history-item-top,
.history-item-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.history-item-top strong {
  overflow: hidden;
  font-size: 13px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-item-title {
  flex: 1 1 auto;
  min-width: 0;
}

.estimated-cost-badge {
  flex: 0 0 auto;
  padding: 4px 9px;
  border: 1px solid var(--accent-border);
  border-radius: 999px;
  background: var(--teal-soft);
  color: var(--accent);
  font-size: 13px;
  font-weight: 900;
  line-height: 1.1;
  white-space: nowrap;
}

.history-pill {
  flex: 0 0 auto;
  min-width: 48px;
  padding: 3px 7px;
  border-radius: 999px;
  background: var(--teal-soft);
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  text-align: center;
}

.run-history-item[data-tone="error"] .history-pill {
  background: var(--error-bg);
  color: var(--error);
}

.history-item-meta,
.history-item-preview {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.history-item-preview {
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.history-item-title {
  overflow: hidden;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(28, 36, 32, 0.36);
}

.history-drawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 41;
  display: grid;
  grid-template-rows: auto 1fr;
  width: min(640px, 44vw);
  min-width: 360px;
  height: 100vh;
  background: var(--panel);
  border-left: 1px solid var(--line);
  box-shadow: -18px 0 34px rgba(34, 48, 42, 0.16);
}

.model-profile-drawer {
  width: min(560px, 46vw);
}

.model-profile-section {
  margin-bottom: 18px;
}

.model-profile-list {
  display: grid;
  gap: 8px;
}

.model-profile-empty {
  margin: 0;
  padding: 12px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: #fbfcfa;
  font-size: 13px;
}

.model-profile-row {
  display: grid;
  gap: 4px;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
  color: var(--ink);
  text-align: left;
}

.model-profile-row:hover,
.model-profile-row.is-active {
  border-color: rgba(87, 112, 92, .52);
  background: #f5f8f2;
}

.model-profile-row strong {
  min-width: 0;
  overflow: hidden;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.model-profile-row span {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.model-profile-badges {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.model-profile-badge {
  width: fit-content;
  padding: 2px 6px;
  border-radius: 999px;
  background: #edf3e7;
  color: #4e6c51;
  font-size: 11px;
  font-weight: 800;
}

.settings-list .model-profile-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px;
  gap: 14px;
  align-items: center;
  min-height: 64px;
  padding: 10px 13px;
  border: 1px solid #dde1da;
  border-radius: 8px;
  background: #fff;
  color: #303631;
  text-align: left;
}

.settings-list .model-profile-row:hover {
  background: #fffef9;
}

.settings-list .model-profile-row-content {
  display: block;
  min-width: 0;
}

.settings-list .model-profile-row-content strong {
  display: block;
  overflow: hidden;
  color: #252826;
  font-size: 14px;
  font-weight: 820;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.settings-list .model-profile-row-content span {
  display: block;
  overflow: hidden;
  margin-top: 4px;
  color: #757c77;
  font-size: 12px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.settings-list .model-profile-delete-button {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: #8b302b;
  cursor: pointer;
}

.settings-list .model-profile-delete-button:hover:not(:disabled) {
  border-color: #f1cbc8;
  background: #fff5f4;
  color: #b3261e;
}

.settings-list .model-profile-delete-button:disabled {
  cursor: not-allowed;
  opacity: .45;
}

.settings-list .model-profile-delete-button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.1;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.model-profile-form {
  display: grid;
  gap: 12px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.model-profile-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.model-profile-field {
  display: grid;
  gap: 6px;
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}

.model-profile-field-wide {
  grid-column: 1 / -1;
}

.model-profile-field-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.model-profile-field input,
.model-profile-field select {
  width: 100%;
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-size: 13px;
}

.model-profile-advanced-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  width: fit-content;
  min-height: 30px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--accent);
  font-size: 12px;
  font-weight: 820;
  cursor: pointer;
}

.model-profile-advanced-toggle::after {
  content: "";
  width: 7px;
  height: 7px;
  margin-left: 8px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg) translateY(-1px);
}

.model-profile-advanced-toggle[aria-expanded="true"]::after {
  transform: rotate(225deg) translateY(-1px);
}

.model-profile-advanced {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
}

.model-profile-help {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.model-profile-capabilities {
  display: grid;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
}

.model-profile-capabilities[hidden] {
  display: none;
}

.model-profile-capabilities-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 820;
}

.model-profile-capability-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}

.model-profile-capability-list div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.model-profile-capability-list dt {
  color: var(--muted);
  font-size: 11px;
  font-weight: 760;
}

.model-profile-capability-list dd {
  margin: 0;
  color: var(--ink);
  font-size: 12px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.model-profile-status {
  min-height: 18px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.model-profile-status[data-tone="ok"] {
  color: #3f7a43;
}

.model-profile-status[data-tone="error"] {
  color: #b84a3a;
}

.model-profile-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.model-profile-actions .compact-button.danger {
  border-color: rgba(184, 74, 58, .28);
  color: #b84a3a;
}

.metering-drawer {
  width: min(560px, 100vw);
}

.perf-drawer {
  width: min(760px, 54vw);
}

.metering-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.metering-summary-grid div {
  min-height: 76px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
}

.metering-summary-grid span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
}

.metering-summary-grid strong {
  color: var(--accent);
  font-size: 18px;
  line-height: 1.25;
}

.wallet-recharge-panel {
  margin-bottom: 18px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
}

.wallet-recharge-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) auto;
  gap: 10px;
  align-items: end;
}

.wallet-recharge-form label {
  display: grid;
  gap: 6px;
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.wallet-recharge-form input {
  width: 100%;
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}

.wallet-recharge-status {
  min-height: 18px;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.wallet-recharge-status[data-tone="ok"] {
  color: var(--accent);
}

.wallet-recharge-status[data-tone="error"] {
  color: var(--error);
}

.dev-wallet-migration-panel,
.dev-wallet-reset-panel {
  margin-bottom: 18px;
  padding: 14px;
  border: 1px solid rgba(184, 74, 58, 0.28);
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(255, 248, 244, 0.96), rgba(255, 252, 248, 0.96));
}

.dev-wallet-migration-head,
.dev-wallet-reset-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.dev-wallet-migration-badge,
.dev-wallet-reset-badge {
  display: inline-flex;
  align-items: center;
  height: 20px;
  margin-bottom: 6px;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(184, 74, 58, 0.12);
  color: #a44738;
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.04em;
}

.dev-wallet-migration-panel h3,
.dev-wallet-reset-panel h3 {
  margin: 0;
  color: var(--ink);
  font-size: 15px;
  font-weight: 850;
}

.dev-wallet-migration-panel p,
.dev-wallet-reset-panel p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.dev-wallet-migration-details,
.dev-wallet-reset-details {
  display: grid;
  gap: 8px;
  margin: 0 0 12px;
}

.dev-wallet-migration-details div,
.dev-wallet-reset-details div {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 10px;
  align-items: baseline;
}

.dev-wallet-migration-details dt,
.dev-wallet-reset-details dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.dev-wallet-migration-details dd,
.dev-wallet-reset-details dd {
  min-width: 0;
  margin: 0;
  color: var(--ink);
  font-size: 12px;
  font-weight: 720;
  overflow-wrap: anywhere;
}

.dev-wallet-migration-actions,
.dev-wallet-reset-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.dev-wallet-migration-actions label,
.dev-wallet-reset-actions label {
  display: grid;
  gap: 6px;
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.dev-wallet-migration-actions input,
.dev-wallet-reset-actions input {
  width: 100%;
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid rgba(184, 74, 58, 0.24);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}

.primary-button.danger {
  border-color: #b84a3a;
  background: #b84a3a;
  color: #fff;
}

.primary-button.danger:hover:not(:disabled) {
  background: #a33f31;
}

.alipay-recharge-entry {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  margin-bottom: 18px;
  padding: 12px;
  border: 1px solid rgba(22, 119, 255, 0.22);
  border-radius: 8px;
  background: linear-gradient(180deg, #f9fcff, #edf6ff);
  color: #1d3f6f;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.62);
}

.alipay-logo-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 0;
  border-radius: 9px;
  background: transparent;
  box-shadow: 0 10px 22px rgba(22, 119, 255, 0.16);
}

.alipay-logo-mark img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.payment-logo-mark[data-provider="paypal"] {
  border-radius: 9px;
  background: transparent;
  color: #fff;
  box-shadow: 0 10px 22px rgba(0, 41, 145, 0.18);
}

.payment-logo-mark[data-provider="paypal"] img {
  width: 90%;
  height: 90%;
  object-fit: contain;
}

.alipay-recharge-entry[data-provider="paypal"],
.payment-recharge-entry[data-provider="paypal"] {
  border-color: rgba(0, 41, 145, 0.22);
  background: linear-gradient(180deg, #f8fcff, var(--paypal-blue-soft));
  color: var(--paypal-blue);
}

.alipay-recharge-entry[data-provider="paypal"] h3,
.payment-recharge-entry[data-provider="paypal"] .account-ledger-recharge-title {
  color: var(--paypal-blue);
}

.alipay-recharge-entry[data-provider="paypal"] p,
.payment-recharge-entry[data-provider="paypal"] .account-ledger-recharge-copy {
  color: rgba(0, 41, 145, 0.64);
}

.alipay-recharge-entry[data-provider="paypal"] .account-recharge-button,
.payment-recharge-entry[data-provider="paypal"] .account-recharge-button {
  border-color: transparent;
  background: var(--paypal-button-blue);
  color: #fff;
  box-shadow: 0 8px 18px rgba(0, 112, 186, 0.24);
}

.alipay-recharge-entry[data-provider="paypal"] .account-recharge-button:hover:not(:disabled),
.payment-recharge-entry[data-provider="paypal"] .account-recharge-button:hover:not(:disabled) {
  background: var(--paypal-button-blue-hover);
}

.alipay-recharge-entry h3 {
  margin: 0 0 4px;
  color: #183a66;
  font-size: 13px;
  font-weight: 860;
  line-height: 1.25;
}

.alipay-recharge-entry p {
  margin: 0;
  color: rgba(29, 63, 111, 0.68);
  font-size: 12px;
  font-weight: 650;
  line-height: 1.4;
}

.alipay-recharge-entry .primary-button {
  min-width: 120px;
  height: 38px;
  border-color: transparent;
  background: var(--alipay-blue);
  color: #fff;
  box-shadow: 0 8px 18px rgba(22, 119, 255, 0.22);
}

.alipay-recharge-entry .primary-button:hover:not(:disabled) {
  background: var(--alipay-blue-dark);
}

.alipay-recharge-backdrop {
  z-index: 70;
}

.alipay-recharge-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 71;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: min(560px, calc(100vw - 32px));
  max-height: min(820px, calc(100vh - 24px));
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 28px 70px rgba(23, 37, 31, 0.26);
  transform: translate(-50%, -50%);
}

.alipay-recharge-header,
.alipay-recharge-actions {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.alipay-recharge-header h2 {
  margin: 0;
  font-size: 22px;
  line-height: 1.2;
}

.alipay-recharge-header p {
  margin: 8px 0 0;
  color: var(--muted);
}

.alipay-recharge-body {
  display: grid;
  gap: 16px;
  min-height: 0;
  padding: 18px;
  overflow: auto;
}

.alipay-custom-amount span {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.alipay-recharge-amounts {
  display: grid;
  gap: 12px;
}

.alipay-recharge-presets {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.alipay-amount-button {
  min-width: 0;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.alipay-amount-button.active {
  border-color: rgba(22, 119, 255, 0.34);
  background: var(--alipay-blue-soft);
  color: #0b5bd3;
  box-shadow: inset 0 0 0 1px rgba(22, 119, 255, 0.08);
}

.alipay-custom-amount input {
  width: 100%;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}

.alipay-qr-section {
  display: grid;
  justify-items: center;
  gap: 12px;
  padding: 16px;
  border: 1px solid #e8ebe4;
  border-radius: 8px;
  background: #fbfcf8;
}

.alipay-qr-section p {
  margin: 0;
  color: #303631;
  font-weight: 800;
}

.alipay-qr-frame {
  display: grid;
  place-items: center;
  width: min(240px, 70vw);
  aspect-ratio: 1;
  border: 1px solid #d8dacd;
  border-radius: 8px;
  background: #fffefa;
  overflow: hidden;
  box-shadow: 0 10px 24px rgba(37, 42, 37, 0.08);
}

.alipay-qr-frame img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.alipay-qr-placeholder {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  color: var(--alipay-blue);
  font-weight: 900;
  background:
    linear-gradient(90deg, #eef0e9 1px, transparent 1px),
    linear-gradient(#eef0e9 1px, transparent 1px),
    #fffefa;
  background-size: 16px 16px;
}

.alipay-debug-button {
  width: min(240px, 70vw);
  min-height: 36px;
  border: 1px dashed rgba(176, 85, 24, 0.45);
  border-radius: 8px;
  background: #fff8ed;
  color: #9a4a16;
  font-weight: 800;
}

.alipay-debug-button:hover:not(:disabled) {
  border-color: rgba(176, 85, 24, 0.72);
  background: #fff2dc;
}

.alipay-debug-button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.alipay-recharge-actions {
  align-items: center;
  justify-content: flex-end;
  border-top: 1px solid var(--line);
  border-bottom: 0;
}

.alipay-recharge-actions button {
  min-width: 120px;
  height: 40px;
}

.alipay-recharge-actions .primary-button {
  border-color: transparent;
  background: var(--alipay-blue);
  color: #fff;
  box-shadow: 0 8px 18px rgba(22, 119, 255, 0.22);
}

.alipay-recharge-actions .primary-button:hover:not(:disabled) {
  background: var(--alipay-blue-dark);
}

.recharge-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 70;
  background: rgba(28, 36, 32, 0.36);
}

.recharge-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 71;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: min(450px, calc(100vw - 48px));
  max-height: min(720px, calc(100vh - 32px));
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 28px 70px rgba(23, 37, 31, 0.26);
  transform: translate(-50%, -50%);
}

.recharge-header,
.recharge-footer {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.recharge-title {
  margin: 0;
  font-size: 22px;
  line-height: 1.2;
}

.recharge-copy {
  margin: 8px 0 0;
  color: var(--muted);
}

.recharge-body {
  display: grid;
  gap: 16px;
  min-height: 0;
  padding: 18px;
  background: #fff;
  overflow: auto;
}

.membership-recharge-context {
  display: grid;
  gap: 8px;
  padding: 14px 16px;
  border: 1px solid rgba(196, 154, 39, 0.3);
  border-radius: 10px;
  background: linear-gradient(135deg, #fffdf5, #fff9e7);
  color: #433817;
}

.membership-recharge-context[hidden] {
  display: none;
}

.membership-recharge-context__label {
  color: #8b6d12;
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.membership-recharge-context__amount {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}

.membership-recharge-context__amount span {
  color: #63572e;
  font-size: 14px;
  font-weight: 760;
}

.membership-recharge-context__amount strong {
  color: #201c10;
  font-size: 24px;
  line-height: 1;
}

.membership-recharge-context p {
  margin: 0;
  color: #74683f;
  font-size: 13px;
  line-height: 1.5;
}

.recharge-modal.is-membership-recharge .recharge-title {
  font-size: 21px;
}

.recharge-modal.is-membership-recharge .recharge-copy {
  max-width: 34em;
}

.recharge-amounts {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.recharge-amount {
  min-width: 0;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.recharge-amount.active,
.recharge-amount.is-active {
  border-color: rgba(22, 119, 255, 0.34);
  background: var(--alipay-blue-soft);
  color: #0b5bd3;
  box-shadow: inset 0 0 0 1px rgba(22, 119, 255, 0.08);
}

.recharge-qr-panel {
  display: grid;
  justify-items: center;
  gap: 12px;
  box-sizing: border-box;
  width: 100%;
  padding: 16px;
  border: 1px solid #edf0f2;
  border-radius: 8px;
  background: #fff;
}

.recharge-qr-title {
  margin: 0;
  color: #303631;
  font-weight: 800;
}

.recharge-qr {
  display: grid;
  place-items: center;
  width: min(280px, 76vw);
  aspect-ratio: 1;
  border: 1px solid #edf0f2;
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
  box-shadow: 0 10px 24px rgba(37, 42, 37, 0.08);
}

.recharge-qr-panel[data-state="waiting"] {
  gap: 10px;
  padding: 14px;
}

.recharge-qr-panel[data-state="waiting"] .recharge-qr {
  --cashier-crop-size: min(380px, calc(100vw - 96px));
  --cashier-qr-target-size: 320px;
  --cashier-crop-offset: max(8px, calc((var(--cashier-crop-size) - var(--cashier-qr-target-size)) / 2));
  position: relative;
  width: var(--cashier-crop-size);
  max-width: none;
  height: var(--cashier-crop-size);
  min-height: 0;
  aspect-ratio: auto;
  border-color: #edf0f2;
  background: #fff;
  box-shadow: 0 8px 20px rgba(30, 36, 32, 0.06);
}

.recharge-cashier-frame {
  width: 100%;
  height: 100%;
  border: 0;
  background: #fff;
}

.recharge-qr-panel[data-state="waiting"] .recharge-cashier-frame {
  position: absolute;
  left: var(--cashier-crop-offset);
  top: var(--cashier-crop-offset);
  width: 520px;
  max-width: none;
  height: 520px;
}

.recharge-qr > div {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  color: var(--alipay-blue);
  font-weight: 900;
  background:
    linear-gradient(90deg, #eef0e9 1px, transparent 1px),
    linear-gradient(#eef0e9 1px, transparent 1px),
    #fff;
  background-size: 16px 16px;
}

.recharge-fallback-link {
  color: var(--alipay-blue);
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}

.recharge-fallback-link:hover {
  text-decoration: underline;
}

@media (max-width: 560px) {
  .recharge-modal {
    width: calc(100vw - 16px);
  }

  .membership-recharge-context__amount strong {
    font-size: 22px;
  }

  .recharge-qr-panel[data-state="waiting"] .recharge-qr {
    --cashier-crop-size: min(360px, calc(100vw - 72px));
  }
}

@media (max-height: 760px) {
  .recharge-qr-panel[data-state="waiting"] .recharge-qr {
    --cashier-crop-size: min(350px, calc(100vw - 96px));
  }
}

.paypal-recharge-panel {
  display: grid;
  align-content: start;
  gap: 12px;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: #fffefa;
  color: #303631;
}

.paypal-recharge-panel[hidden] {
  display: none;
}

.paypal-buttons {
  width: 100%;
  min-height: 48px;
}

.paypal-setup-notice {
  margin: 0;
  color: var(--paypal-blue-dark);
  font-size: 13px;
  font-weight: 760;
  line-height: 1.45;
}

.recharge-modal[data-provider="paypal"] .recharge-footer {
  display: none;
}

.recharge-modal[data-provider="paypal"] .recharge-custom-input-shell:focus-within {
  border-color: rgba(0, 140, 255, 0.64);
  box-shadow:
    0 0 0 3px rgba(96, 205, 255, 0.24),
    inset 0 0 0 1px rgba(0, 41, 145, 0.08);
}

.recharge-footer {
  align-items: center;
  justify-content: flex-end;
  border-top: 1px solid var(--line);
  border-bottom: 0;
}

.recharge-footer button {
  min-width: 120px;
  height: 40px;
}

.recharge-primary {
  border: 1px solid transparent;
  border-radius: 8px;
  background: var(--alipay-blue);
  color: #fff;
  font: inherit;
  font-weight: 850;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(22, 119, 255, 0.22);
}

.recharge-primary:hover:not(:disabled) {
  background: var(--alipay-blue-dark);
}

.recharge-secondary {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.wallet-ledger-tabs {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 38px;
  margin-bottom: 10px;
  padding: 4px;
  border: 1px solid #d9ddd7;
  border-radius: 9px;
  background: linear-gradient(180deg, rgba(244, 242, 236, 0.94), rgba(235, 232, 224, 0.94));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.78);
}

.wallet-ledger-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 1 1 0;
  min-width: 0;
  height: 28px;
  padding: 0 9px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: #667069;
  font: inherit;
  font-size: 12px;
  font-weight: 760;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
}

.wallet-ledger-tab:hover {
  background: rgba(255, 255, 255, 0.48);
  color: #303631;
}

.wallet-ledger-tab.active {
  border-color: #cfd4ce;
  background: #fff;
  color: #222724;
  box-shadow: 0 1px 4px rgba(31, 35, 32, 0.12);
}

.prompt-edit-approval-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1200;
  background: rgba(28, 36, 32, 0.28);
}

.prompt-edit-approval-modal {
  position: fixed;
  inset: 0;
  z-index: 1201;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  min-width: 0;
  background: #f7f8f6;
  color: var(--ink);
}

.prompt-edit-approval-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 58px;
  padding: 10px 18px;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(14px);
}

.prompt-edit-review-head h3 {
  margin: 0;
  font-size: 20px;
  line-height: 1.25;
  font-weight: 800;
}

.prompt-edit-review-head p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.prompt-edit-approval-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 390px);
  gap: 0;
  min-height: 0;
  padding: 0;
  overflow: hidden;
}

.prompt-edit-editor-pane {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-width: 0;
  min-height: 0;
  background: var(--panel);
}

.prompt-edit-editor-meta {
  min-height: 42px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 42%) minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 0 14px;
  border-bottom: 1px solid var(--line);
  background: #fbfcfb;
  color: var(--muted);
  font-size: 13px;
}

.prompt-edit-editor-title {
  min-width: 0;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.prompt-edit-version-labels {
  align-self: stretch;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 1px minmax(0, 1fr);
  min-width: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.prompt-edit-version-label {
  display: flex;
  align-items: center;
  min-width: 0;
  white-space: nowrap;
}

.prompt-edit-version-label-original {
  justify-content: flex-end;
  padding-right: 18px;
}

.prompt-edit-version-label-modified {
  justify-content: flex-start;
  padding-left: 18px;
}

.prompt-edit-version-divider {
  width: 1px;
  background: var(--line);
}

.prompt-edit-editor-actions {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  white-space: nowrap;
}

.prompt-edit-editor-wrap {
  position: relative;
  min-width: 0;
  min-height: 0;
}

.prompt-edit-monaco-editor {
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
}

.prompt-edit-diff-loading {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: var(--panel);
  color: var(--muted);
  font-size: 13px;
  z-index: 4;
}

.prompt-edit-focus-line {
  background: rgba(255, 244, 215, 0.86);
}

.prompt-edit-focus-gutter {
  width: 4px !important;
  margin-left: 2px;
  background: var(--amber);
}

.prompt-edit-review-side {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  border-left: 1px solid var(--line);
  background: #fbfcfb;
  overflow: hidden;
}

.prompt-edit-review-head {
  padding: 16px 16px 12px;
  border-bottom: 1px solid var(--line);
}

.prompt-edit-change-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}

.prompt-edit-change-stats div {
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.prompt-edit-change-stats b {
  display: block;
  font-size: 18px;
  line-height: 1.1;
}

.prompt-edit-change-stats span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.prompt-edit-paragraph-change-list {
  min-height: 0;
  overflow: auto;
  padding: 14px 14px 24px;
}

.prompt-edit-paragraph-change-card {
  display: block;
  width: 100%;
  margin: 0 0 10px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  text-align: left;
  box-shadow: 0 1px 3px rgba(23, 33, 27, 0.04);
  cursor: pointer;
}

.prompt-edit-paragraph-change-card:hover,
.prompt-edit-paragraph-change-card.active {
  border-color: #9db5a6;
  box-shadow: 0 18px 48px rgba(23, 33, 27, 0.12);
}

.prompt-edit-paragraph-change-top {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 8px;
  min-width: 0;
}

.prompt-edit-paragraph-change-top strong {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 14px;
  line-height: 1.35;
}

.prompt-edit-paragraph-badge {
  flex: 0 0 auto;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.prompt-edit-paragraph-badge.add {
  color: var(--accent);
  background: var(--teal-soft);
}

.prompt-edit-paragraph-badge.delete {
  color: #c2413d;
  background: #fde8e7;
}

.prompt-edit-paragraph-badge.modify {
  color: #2563eb;
  background: #e8efff;
}

.prompt-edit-paragraph-change-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.prompt-edit-paragraph-change-card.meaning p {
  font-size: 13.5px;
  font-weight: 700;
}

.prompt-edit-paragraph-change-card pre {
  max-height: 116px;
  margin: 10px 0 0;
  padding: 9px 10px;
  overflow: hidden;
  border-radius: 7px;
  background: #f6f8f6;
  color: #2c3931;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
  font-family: "SF Mono", Menlo, Monaco, Consolas, "PingFang SC", monospace;
  font-size: 12px;
  line-height: 1.55;
}

.prompt-edit-codex-info {
  max-height: 34vh;
  overflow: auto;
  padding: 0 14px;
  border-top: 1px solid var(--line);
  background: #fbfcfb;
}

.prompt-edit-codex-info details[open] {
  padding-bottom: 14px;
}

.prompt-edit-codex-info summary {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 12px 0 8px;
  background: #fbfcfb;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.prompt-edit-info-section {
  display: grid;
  gap: 8px;
  min-width: 0;
  margin-top: 10px;
}

.prompt-edit-info-section h4 {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
}

.prompt-edit-info-block {
  max-height: 120px;
  margin: 0;
  padding: 10px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 12px;
  line-height: 1.5;
}

.prompt-edit-empty-state {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.prompt-edit-approval-actions {
  border-top: 1px solid var(--line);
  border-bottom: 0;
  background: rgba(255, 255, 255, 0.96);
}

.prompt-edit-approval-actions > div {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.prompt-edit-approval-status {
  min-width: 0;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.prompt-edit-approval-status[data-tone="error"] {
  color: var(--error);
}

.prompt-edit-reject-button {
  border-color: #efb5ad;
  color: var(--error);
}

.perf-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.perf-summary-grid div {
  min-height: 76px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
  overflow: hidden;
}

.perf-summary-grid span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
}

.perf-summary-grid strong {
  display: block;
  overflow: hidden;
  color: var(--accent);
  font-size: 17px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.perf-record-list {
  display: grid;
  gap: 10px;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

.perf-record-card {
  display: grid;
  gap: 6px;
  min-width: 0;
  width: 100%;
  max-width: 100%;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
  overflow: hidden;
}

.perf-record-card[data-tone="error"] {
  border-color: #efb5ad;
  background: #fff7f5;
}

.perf-record-top {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
}

.perf-record-path {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.perf-status-pill {
  flex: 0 0 auto;
  min-width: 44px;
  padding: 3px 7px;
  border-radius: 999px;
  background: var(--teal-soft);
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  text-align: center;
}

.perf-record-card[data-tone="error"] .perf-status-pill {
  background: var(--error-bg);
  color: var(--error);
}

.perf-record-meta,
.perf-record-subtle,
.perf-record-error {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  font-size: 12px;
  line-height: 1.45;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.perf-record-meta,
.perf-record-subtle {
  color: var(--muted);
}

.perf-record-error {
  color: var(--error);
}

.metering-debug-panel {
  margin-bottom: 18px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
}

.metering-debug-status {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.metering-debug-status[data-tone="ok"] {
  color: var(--accent);
}

.metering-debug-status[data-tone="error"] {
  color: var(--error);
}

.metering-debug-details {
  display: grid;
  grid-template-columns: minmax(96px, 140px) minmax(0, 1fr);
  gap: 8px 12px;
  margin: 0;
  font-size: 12px;
  line-height: 1.45;
}

.metering-debug-details dt {
  color: var(--muted);
  font-weight: 700;
}

.metering-debug-details dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
  color: var(--ink);
}

.account-ledger-pricing {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid #e2e6dd;
  border-radius: 10px;
  background: #fff;
  box-shadow: none;
}

.account-ledger-pricing-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  min-width: 0;
}

.account-ledger-pricing-title {
  margin: 0;
  color: var(--ink);
  font-size: 14px;
  font-weight: 880;
  line-height: 1.2;
}

.account-ledger-pricing-copy {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 640;
  line-height: 1.45;
}

.account-ledger-pricing-copy[data-tone="error"] {
  color: var(--error);
}

.account-ledger-pricing-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  height: 30px;
  padding: 0 10px;
  border: 1px solid #dfe4da;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-size: 12px;
  font-weight: 780;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
}

.account-ledger-pricing-link:hover {
  border-color: #cfd5c9;
  background: #fbfbf5;
}

.account-ledger-pricing-table {
  display: grid;
  gap: 7px;
}

.account-ledger-pricing-row {
  display: grid;
  grid-template-columns: minmax(126px, 0.9fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
  align-items: stretch;
  padding: 10px;
  border: 1px solid #ecefe8;
  border-radius: 9px;
  background: #fff;
}

.account-ledger-pricing-model {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  padding-right: 2px;
}

.account-ledger-pricing-model strong {
  overflow: hidden;
  color: #232823;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 12px;
  font-weight: 880;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-ledger-price-stack {
  display: grid;
  align-content: start;
  gap: 5px;
  min-width: 0;
  padding: 8px;
  border: 1px solid #ecefe8;
  border-radius: 8px;
  background: #fff;
}

.account-ledger-price-stack.is-platform {
  background: #fff;
  box-shadow: none;
}

.account-ledger-price-stack b {
  color: var(--ink);
  font-size: 11.5px;
  font-weight: 860;
  line-height: 1.2;
}

.account-ledger-price-pill {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
  color: #596158;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
}

.account-ledger-price-pill em {
  color: #222724;
  font-style: normal;
  font-size: 12px;
  font-weight: 880;
}

.metering-event-list {
  display: grid;
  gap: 10px;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

.metering-event-card {
  display: grid;
  gap: 6px;
  min-width: 0;
  width: 100%;
  max-width: 100%;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
  color: inherit;
  font: inherit;
  overflow: hidden;
  text-align: left;
}

.metering-event-card strong {
  min-width: 0;
  color: var(--ink);
  font-size: 13px;
}

.metering-event-top {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
}

.metering-event-top strong {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.metering-event-card p,
.metering-event-card span {
  display: block;
  min-width: 0;
  margin: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.metering-event-card .estimated-cost-badge {
  flex: 0 0 auto;
  max-width: 128px;
  color: var(--accent);
  font-size: 13px;
  line-height: 1.1;
}

.metering-event-card .ledger-amount-badge {
  flex: 0 0 auto;
  max-width: 128px;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--teal-soft);
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.1;
}

.metering-event-card .ledger-amount-badge[data-direction="debit"] {
  background: #fff3f0;
  color: var(--error);
}

.metering-event-detail h4 {
  margin: 14px 0 8px;
  color: var(--ink);
  font-size: 13px;
}

.metering-note {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.drawer-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.drawer-header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
  flex: 0 0 auto;
}

.agent-version-guide-button {
  min-width: 196px;
  border-color: var(--accent-border);
  background: var(--teal-soft);
  color: var(--accent);
  font-weight: 800;
}

.drawer-header h2 {
  margin: 0;
  font-size: 16px;
  line-height: 1.2;
}

.drawer-header p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.drawer-content {
  display: grid;
  gap: 12px;
  align-content: start;
  min-height: 0;
  overflow: auto;
  padding: 16px;
}

.history-detail-section {
  display: grid;
  gap: 8px;
}

.history-share-card {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--accent-border);
  border-radius: 8px;
  background: var(--teal-soft);
}

.history-share-card h3 {
  margin: 0;
  font-size: 13px;
  line-height: 1.2;
}

.history-share-card p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.history-share-card p[data-tone="ok"] {
  color: var(--accent);
}

.history-share-card p[data-tone="error"] {
  color: var(--error);
}

.history-share-card > a {
  overflow-wrap: anywhere;
  color: var(--accent);
  font-size: 12px;
  line-height: 1.4;
}

.history-share-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.detail-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.detail-section-title h3 {
  margin: 0;
  font-size: 13px;
  line-height: 1.2;
}

.copy-button {
  height: 30px;
  padding: 0 10px;
  color: var(--accent);
  font-size: 12px;
}

.history-detail-block {
  min-height: 96px;
  max-height: 260px;
  margin: 0;
  padding: 12px;
  border-radius: 8px;
  background: var(--code-bg);
  color: var(--code-ink);
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 12px;
  line-height: 1.5;
}

.version-prompt-details-toggle {
  width: 100%;
  height: 36px;
  margin-bottom: 14px;
  border-color: var(--line);
  background: #fbfcfa;
  color: var(--muted);
  font-weight: 700;
  text-align: center;
}

.version-prompt-details {
  display: grid;
  gap: 14px;
  margin-bottom: 18px;
}

.version-prompt-details[hidden] {
  display: none;
}

.use-cases-panel {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 10px;
  min-height: 0;
  overflow: hidden;
}

.use-cases-list {
  display: grid;
  gap: 10px;
  min-height: 0;
  max-height: none;
  overflow: auto;
  padding-right: 2px;
}

.use-case-item {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
}

.use-case-item:hover {
  border-color: var(--accent-border);
}

.use-case-item-header,
.use-case-item-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.use-case-item-title {
  overflow: hidden;
  color: var(--ink);
  font-size: 14px;
  font-weight: 800;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.use-case-type-pill {
  flex: 0 0 auto;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--teal-soft);
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.1;
}

.use-case-item-meta {
  justify-content: flex-start;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.use-case-preview {
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  min-height: 52px;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.45;
}

.use-case-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
}

.use-case-actions .danger {
  color: var(--error);
}

.agent-access-panel {
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr);
  gap: 10px;
  min-height: 0;
  overflow: hidden;
}

.agent-publish-actions,
.agent-version-filters,
.agent-version-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.agent-publish-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.agent-version-filters {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

.agent-versions-list {
  display: grid;
  gap: 10px;
  min-height: 0;
  max-height: none;
  overflow: auto;
  padding-right: 2px;
}

.agent-version-card {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
  cursor: pointer;
}

.agent-version-card:hover,
.agent-version-card:focus-visible {
  border-color: var(--accent-border);
  outline: none;
  box-shadow: 0 0 0 3px var(--accent-ring);
}

.agent-version-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.agent-version-card-badges {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex: 0 0 auto;
}

.agent-version-run-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.25;
  white-space: nowrap;
}

.agent-version-title,
.agent-version-prompt-name {
  overflow: hidden;
  display: block;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.agent-version-title {
  color: var(--ink);
  font-size: 14px;
  font-weight: 800;
  line-height: 1.25;
}

.agent-version-prompt-name,
.agent-version-meta {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.agent-version-actions {
  display: grid;
  grid-template-columns: minmax(64px, 0.65fr) minmax(150px, 1.45fr) minmax(104px, 1fr) minmax(64px, 0.65fr);
  gap: 7px;
}

.agent-version-actions .danger {
  color: var(--error);
}

.agent-version-guide-button,
.agent-version-copy-guide-button {
  min-height: 36px;
  height: auto;
  padding-top: 7px;
  padding-bottom: 7px;
  line-height: 1.25;
  white-space: normal;
}

.agent-version-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.agent-version-summary > div {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
}

.agent-version-summary span {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.2;
}

.agent-version-summary strong {
  overflow: hidden;
  color: var(--accent);
  font-size: 13px;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.agent-version-drawer {
  right: 0;
  bottom: 0;
  width: min(620px, 100vw);
  min-width: 0;
  height: 100vh;
  height: 100dvh;
  border-radius: 0;
}

.agent-version-drawer .drawer-content {
  display: flex;
  flex-direction: column;
  align-content: stretch;
  height: 100%;
  overflow: hidden;
  overscroll-behavior: contain;
}

.agent-version-drawer.is-prompt-expanded .drawer-content {
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.agent-version-drawer .agent-version-summary,
.agent-version-drawer .version-prompt-details-toggle,
.agent-version-drawer .version-prompt-details {
  flex: 0 0 auto;
}

.agent-version-drawer .run-history-panel {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
  padding-top: 12px;
  border-top: 1px solid #edf0e9;
}

.agent-version-drawer.is-prompt-expanded .run-history-panel {
  flex: 0 0 auto;
}

.agent-version-drawer .run-history-list {
  align-content: start;
  align-items: stretch;
  flex: 1 1 auto;
  max-height: none;
  min-height: 280px;
  overflow: auto;
  gap: 0;
  border-top: 1px solid #edf0e9;
}

.agent-version-drawer.is-prompt-expanded .run-history-list {
  flex: 0 0 auto;
  min-height: 0;
  overflow: visible;
}

.agent-version-drawer .agent-version-run-row {
  position: relative;
  align-self: stretch;
  display: grid;
  gap: 5px;
  width: 100%;
  min-height: 0;
  height: auto;
  max-height: none;
  padding: 11px 6px 11px 18px;
  border-top: 1px solid #edf0e9;
  border-radius: 0;
  background: transparent;
  color: #303631;
  overflow: hidden;
  text-align: left;
  transition: background-color 0.12s ease;
}

.agent-version-drawer .agent-version-run-row:first-child {
  border-top: 0;
}

.agent-version-drawer .agent-version-run-row::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 10px;
  bottom: 10px;
  width: 3px;
  border-radius: 999px;
  background: #d3d6d1;
}

.agent-version-drawer .agent-version-run-row[data-status="failed"]::before {
  background: #d66a62;
}

.agent-version-drawer .agent-version-run-row.is-active {
  background: #fbfbf4;
}

.agent-version-drawer .agent-version-run-row.is-active::before,
.agent-version-drawer .agent-version-run-row[data-status="success"].is-active::before,
.agent-version-drawer .agent-version-run-row[data-status="failed"].is-active::before {
  background: var(--brand-yellow);
  box-shadow: 0 0 0 1px rgba(95, 86, 0, 0.12);
}

.agent-version-drawer .agent-version-run-row:hover,
.agent-version-drawer .agent-version-run-row:focus-visible {
  background: #f7f8f2;
  border-color: #edf0e9;
  box-shadow: none;
  outline: none;
}

.agent-version-drawer .agent-version-run-row .history-pill {
  min-width: 0;
  padding: 0;
  border-radius: 0;
  background: transparent;
  color: #66703b;
  font-size: 11px;
  font-weight: 760;
  line-height: 1.25;
}

.agent-version-drawer .agent-version-run-row[data-status="failed"] .history-pill {
  background: transparent;
  color: #a33c31;
}

.agent-version-drawer .history-item-meta,
.agent-version-drawer .history-item-preview {
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
}

.agent-version-drawer .history-item-meta {
  -webkit-line-clamp: 2;
}

.agent-version-drawer .history-item-preview {
  -webkit-line-clamp: 2;
}

.agent-run-drawer {
  right: min(620px, 100vw);
  bottom: 0;
  z-index: 42;
  width: min(540px, calc(100vw - 620px));
  min-width: 0;
  height: 100vh;
  height: 100dvh;
  border-radius: 0;
  box-shadow: -18px 0 34px rgba(34, 48, 42, 0.2);
}

.use-case-form {
  grid-template-rows: auto auto minmax(0, 1fr) auto;
}

.use-case-content-field {
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 0;
  margin-bottom: 0;
}

.use-case-content-field textarea {
  height: 100%;
  min-height: 360px;
}

.use-case-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 4px;
}

@media (max-width: 1280px) {
  .model-env-bar {
    position: static;
    grid-template-columns: 1fr;
    margin-top: 16px;
  }

  .pi-editor-pane {
    grid-template-rows: auto auto minmax(420px, 1fr) auto;
    padding-bottom: 24px;
  }

  .prompt-fallback-editor,
  .markdown-preview-surface {
    padding-bottom: 24px;
  }
}

@media (max-width: 1180px) {
  .pi-app-shell {
    --pi-sidebar-width: 300px;
    grid-template-columns: var(--pi-sidebar-width) var(--pi-resize-handle-width) minmax(0, 1fr);
  }

  .pi-app-shell.is-settings {
    grid-template-columns: minmax(260px, 300px) minmax(0, 1fr);
  }

  .pi-app-shell.is-sidebar-collapsed {
    grid-template-columns: 74px 0 minmax(0, 1fr);
  }

  .workspace {
    grid-template-columns: 1fr;
  }

  .pi-main-workspace {
    grid-template-columns: 1fr;
    height: 100vh;
    height: 100dvh;
    min-height: 0;
    align-content: start;
    overflow: auto;
  }

  .pi-workspace-resize-handle {
    display: none;
  }

  .pi-main-workspace > .result-panel {
    height: min(720px, calc(100vh - 36px));
    height: min(720px, calc(100dvh - 36px));
    min-height: 520px;
    margin: 0 18px 24px;
  }

  .pi-editor-pane {
    height: auto;
    min-height: min(720px, 100vh);
    min-height: min(720px, 100dvh);
    border-right: 0;
  }

  .result-panel {
    grid-column: auto;
  }

  .output-block {
    min-height: 0;
  }

  .history-drawer {
    width: min(680px, 72vw);
  }

  .agent-version-drawer {
    width: min(620px, 56vw);
  }

  .agent-run-drawer {
    right: min(620px, 56vw);
    width: calc(100vw - min(620px, 56vw));
  }

  .prompt-edit-approval-body {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(360px, 1fr) minmax(260px, 0.74fr);
  }

  .prompt-edit-review-side {
    grid-template-rows: auto auto minmax(0, 1fr) auto;
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .prompt-edit-review-head {
    border-bottom: 1px solid var(--line);
    border-right: 0;
  }

  .prompt-edit-change-stats {
    grid-template-columns: repeat(3, 1fr);
    border-bottom: 1px solid var(--line);
    border-right: 0;
  }

  .prompt-edit-codex-info {
    max-height: none;
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .settings-page {
    padding-inline: 40px;
  }

  .settings-ledger-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .settings-model-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 820px) {
  .pi-app-shell,
  .workspace,
  .field-grid,
  .control-strip {
    grid-template-columns: 1fr;
  }

  .pi-app-shell {
    overflow: auto;
  }

  .pi-app-shell.is-settings {
    grid-template-columns: 1fr;
  }

  .pi-main-workspace {
    padding: 0;
  }

  .pi-resize-handle {
    display: none;
  }

  .pi-sidebar {
    position: relative;
    height: auto;
    max-height: 42vh;
  }

  .pi-app-shell.is-settings .pi-sidebar {
    height: auto;
    max-height: none;
  }

  .settings-sidebar {
    padding: 16px 12px 10px;
  }

  .settings-nav-group {
    margin-bottom: 14px;
  }

  .settings-main {
    height: auto;
    overflow: visible;
  }

  .settings-page {
    padding: 24px 16px 48px;
  }

  .settings-row,
  .settings-account-card,
  .settings-ledger-toolbar {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .settings-row,
  .settings-ledger-toolbar {
    display: grid;
  }

  .settings-action-button,
  .settings-icon-button,
  .settings-segmented {
    width: 100%;
  }

  .settings-segmented button {
    flex: 1 1 0;
    min-width: 0;
  }

  .settings-ledger-metrics,
  .settings-form-grid,
  .settings-capability-list {
    grid-template-columns: 1fr;
  }

  .settings-detail-panel dl {
    grid-template-columns: 1fr;
  }

  .pi-sidebar-scroll {
    max-height: 210px;
  }

  .pi-account {
    padding-bottom: 10px;
  }

  .pi-app-shell.is-sidebar-collapsed {
    grid-template-columns: 1fr;
  }

  .pi-app-shell.is-sidebar-collapsed .pi-sidebar-scroll,
  .pi-app-shell.is-sidebar-collapsed .pi-environment {
    display: none;
  }

  .input-panel,
  .pi-editor-pane,
  .result-panel {
    padding: 14px;
  }

  .pi-editor-pane {
    min-height: auto;
    overflow: visible;
  }

  .pi-editor-toolbar {
    align-items: stretch;
    flex-direction: column;
    justify-content: flex-start;
    gap: 14px;
  }

  .pi-editor-title {
    max-width: 100%;
  }

  .pi-editor-title-area,
  .pi-editor-actions {
    flex: 0 0 auto;
  }

  .pi-editor-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .pi-editor-save-cluster {
    flex: 1 1 100%;
    flex-wrap: wrap;
  }

  .editor-tabbar-wrap {
    gap: 10px;
    flex-wrap: wrap;
    padding-right: 0;
  }

  .editor-tabbar {
    overflow-x: auto;
    max-width: 100%;
  }

  .editor-tabbar-actions {
    width: 100%;
    justify-content: flex-start;
    margin-left: 0;
  }

  .markdown-preview-toggle {
    position: static;
    transform: none;
  }

  .detail {
    min-height: 420px;
  }

  .model-env-bar {
    position: static;
    grid-template-columns: 1fr;
    margin-top: 16px;
  }

  .prompt-fallback-editor,
  .markdown-preview-surface {
    padding-bottom: 24px;
  }

  .pi-main-workspace > .result-panel {
    margin: 0 14px 18px;
  }

  .input-panel > .section-title-row {
    align-items: stretch;
  }

  .prompt-name-publish-row {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .prompt-publish-menu {
    justify-self: stretch;
    margin-top: 0;
  }

  .prompt-edit-session-button {
    justify-self: stretch;
    width: 100%;
    margin-top: 0;
  }

  .publish-menu-button {
    width: 100%;
  }

  .publish-menu-panel {
    left: 0;
    right: 0;
    min-width: 0;
    transform: translateY(0);
  }

  .request-actions {
    justify-content: stretch;
  }

  .request-actions > * {
    flex: 1 1 110px;
  }

  .case-list {
    max-height: 240px;
  }

  .output-block {
    min-height: 0;
    max-height: none;
  }

  .history-item-top,
  .history-item-meta {
    align-items: flex-start;
    flex-direction: column;
  }

  .history-status {
    text-align: left;
  }

  .current-run-anchor {
    grid-template-columns: 1fr;
  }

  .current-run-anchor strong,
  .history-group-title,
  .history-item-title {
    white-space: normal;
  }

  .history-drawer {
    width: 100vw;
    min-width: 0;
  }

  .metering-drawer {
    width: 100vw;
  }

  .metering-summary-grid {
    grid-template-columns: 1fr;
  }

  .wallet-recharge-form,
  .dev-wallet-migration-actions,
  .dev-wallet-reset-actions,
  .wallet-ledger-tabs {
    grid-template-columns: 1fr;
  }

  .dev-wallet-migration-head,
  .dev-wallet-reset-head {
    flex-direction: column;
  }

  .dev-wallet-migration-head .copy-button,
  .dev-wallet-migration-actions .primary-button,
  .dev-wallet-reset-actions .primary-button {
    width: 100%;
  }

  .wallet-ledger-tabs {
    flex-wrap: wrap;
    height: auto;
  }

  .alipay-recharge-entry,
  .payment-recharge-entry {
    grid-template-columns: 42px minmax(0, 1fr);
  }

  .account-ledger-pricing-head {
    flex-direction: column;
  }

  .account-ledger-pricing-link {
    width: 100%;
  }

  .account-ledger-pricing-row,
  .account-ledger-settings-page .account-ledger-pricing-row {
    grid-template-columns: 1fr;
  }

  .alipay-recharge-entry .primary-button,
  .payment-recharge-entry .account-recharge-button,
  .alipay-recharge-actions button,
  .recharge-footer button {
    width: 100%;
  }

  .alipay-recharge-entry .primary-button,
  .payment-recharge-entry .account-recharge-button {
    grid-column: 1 / -1;
  }

  .recharge-amounts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .prompt-edit-approval-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .prompt-edit-editor-meta {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "title actions"
      "labels labels";
    min-height: 76px;
    padding: 8px 12px;
    row-gap: 8px;
  }

  .prompt-edit-editor-title {
    grid-area: title;
  }

  .prompt-edit-version-labels {
    grid-area: labels;
    min-height: 28px;
  }

  .prompt-edit-editor-actions {
    grid-area: actions;
  }

  .prompt-edit-review-side {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto minmax(0, 1fr) auto;
  }

  .prompt-edit-review-head,
  .prompt-edit-change-stats,
  .prompt-edit-codex-info {
    border-right: 0;
    border-left: 0;
    border-bottom: 1px solid var(--line);
  }

  .prompt-edit-change-stats {
    grid-template-columns: repeat(3, 1fr);
  }

  .prompt-edit-approval-body {
    grid-template-rows: minmax(420px, 1fr) minmax(260px, 0.7fr);
  }

  .prompt-edit-approval-actions > div,
  .prompt-edit-approval-actions button {
    width: 100%;
  }

  .alipay-recharge-actions {
    align-items: stretch;
    flex-direction: column-reverse;
  }

  .agent-version-drawer,
  .agent-run-drawer {
    right: 0;
    width: 100vw;
    min-width: 0;
  }

  .agent-run-drawer {
    z-index: 43;
  }

  .drawer-content {
    padding: 14px;
  }

  .history-detail-block {
    max-height: 220px;
  }

  .use-cases-list {
    max-height: none;
  }

  .use-case-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .agent-publish-actions,
  .agent-version-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .agent-version-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .use-case-item-header,
  .use-case-item-meta {
    align-items: flex-start;
    flex-direction: column;
  }

  .use-case-item-title {
    white-space: normal;
  }

  .drawer-header-actions {
    flex-direction: column-reverse;
    align-items: flex-end;
  }
}

/* New Prompt Interface debug workspace */
.utility-pane {
  --debug-brand: #fff45b;
  --debug-brand-soft: #fff9b8;
  --debug-brand-ink: #5d5800;
  --debug-line: #e4e6e0;
  --debug-muted: #717970;
  --debug-ink: #202520;
  --debug-danger: #a7352b;
  --codex-main: #3941ff;
  position: relative;
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  min-width: 0;
  min-height: 0;
  background: #fff;
  color: var(--debug-ink);
}

.debug-console {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 8px;
  min-width: 0;
  min-height: 0;
  height: 100%;
  padding: 0;
}

.debug-collapsed-rail {
  display: none;
}

.pi-main-workspace.is-debug-collapsed .debug-console {
  display: none;
}

.pi-main-workspace.is-debug-collapsed > .utility-pane {
  display: block;
  width: 64px;
  min-width: 64px;
  max-width: 64px;
  height: 100vh;
  height: 100dvh;
  padding: 0;
  border-left: 1px solid #e8e9e4;
  justify-self: stretch;
  overflow: hidden;
}

.pi-main-workspace.is-debug-collapsed .debug-collapsed-rail {
  display: grid;
  place-items: center;
  position: relative;
  width: 100%;
  height: 100%;
  background: #fff;
}

.debug-rail-actions {
  display: grid;
  gap: 14px;
  justify-items: center;
}

.debug-rail-expand-btn {
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
}

.debug-rail-btn,
.debug-collapse-btn,
.case-copy-btn,
.trace-copy-btn {
  display: inline-grid;
  place-items: center;
  border: 0;
  background: transparent;
  color: #68716a;
}

.debug-rail-btn {
  width: 38px;
  height: 38px;
  border-radius: 8px;
}

.debug-rail-btn:hover,
.debug-collapse-btn:hover,
.case-copy-btn:hover,
.trace-copy-btn:hover {
  background: #f5f4ef;
  color: #202520;
}

.debug-rail-btn .icon,
.debug-workspace-tab .icon,
.debug-collapse-btn .icon,
.continue-run-btn .icon,
.cases-new-btn .icon,
.case-copy-btn .icon,
.trace-copy-btn .icon {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.debug-rail-btn .icon {
  width: 20px;
  height: 20px;
}

.debug-workspace-head {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  min-height: 42px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--debug-line);
}

.debug-workspace-tabs {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  overflow: hidden;
}

.debug-workspace-tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 0;
  height: 34px;
  padding: 0 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #777d78;
  font-size: 13px;
  font-weight: 780;
  letter-spacing: 0;
  white-space: nowrap;
}

.debug-workspace-tab:hover {
  background: #f5f4ef;
  color: #343a35;
}

.debug-workspace-tab.is-active,
.debug-workspace-tab.active {
  background: var(--debug-brand-soft);
  color: #222724;
  font-weight: 840;
  box-shadow: inset 0 0 0 1px rgba(95, 86, 0, .08);
}

.debug-workspace-tab .icon {
  width: 16px;
  height: 16px;
  stroke-width: 2.15;
}

.debug-collapse-btn {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  color: #757c77;
}

.debug-collapse-btn:hover {
  background: #f4f4ef;
  color: #343a35;
}

.debug-collapse-btn .icon {
  width: 22px;
  height: 22px;
}

.debug-workspace-panel {
  display: none;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.debug-workspace-panel.is-active,
.debug-workspace-panel.active {
  display: grid;
  gap: 10px;
  min-height: 0;
}

.debug-workspace-panel[data-debug-panel="response"].is-active,
.debug-workspace-panel[data-debug-panel="response"].active {
  --debug-output-row: minmax(380px, 1.45fr);
  --debug-history-row: minmax(160px, .55fr);
  grid-template-rows: auto var(--debug-output-row) 12px var(--debug-history-row);
  grid-auto-rows: 0;
  align-content: stretch;
  overflow: visible;
}

.debug-workspace-panel[data-debug-panel="response"] > [hidden],
.debug-workspace-panel[data-debug-panel="response"] > .current-run-anchor {
  position: absolute !important;
  display: none !important;
}

.debug-response-toolbar {
  grid-row: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}

.response-switches {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}

.response-switch,
.trace-filter {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  height: 34px;
  padding: 3px;
  border: 1px solid #d9ddd7;
  border-radius: 9px;
  background: linear-gradient(180deg, rgba(244, 242, 236, .94), rgba(235, 232, 224, .94));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .78);
}

.response-switch button,
.trace-filter button {
  height: 26px;
  padding: 0 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #667069;
  font-size: 12px;
  font-weight: 760;
  line-height: 1;
  white-space: nowrap;
  box-shadow: none;
}

.response-switch button:hover,
.trace-filter button:hover {
  background: rgba(255, 255, 255, .48);
}

.response-switch button.is-active,
.response-switch button.active,
.trace-filter button.is-active,
.trace-filter button.active {
  background: #fff;
  color: #222724;
  box-shadow: 0 1px 4px rgba(31, 35, 32, .12);
}

.run-runtime-stack {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  min-width: 0;
  margin-left: auto;
}

.copy-output-btn {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: 1px solid #d5dbd2;
  border-radius: 8px;
  background: rgba(255, 255, 255, .84);
  color: #616b64;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .72);
}

.copy-output-btn .icon {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.copy-output-btn:hover,
.copy-output-btn:focus-visible {
  background: #fff;
  color: #252b27;
  outline: none;
  box-shadow: 0 1px 4px rgba(31, 35, 32, .12), inset 0 1px 0 rgba(255, 255, 255, .82);
}

.round-badge,
.latency-badge {
  flex: 0 0 auto;
  min-width: 56px;
  padding: 5px 9px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 820;
  line-height: 1.2;
  text-align: center;
  white-space: nowrap;
}

.round-badge {
  background: #fff;
  color: #303631;
  box-shadow: inset 0 0 0 1px rgba(37, 40, 38, .08);
}

.latency-badge {
  background: var(--debug-brand-soft);
  color: var(--debug-brand-ink);
  box-shadow: inset 0 0 0 1px rgba(95, 86, 0, .08);
}

.debug-output-shell {
  grid-row: 2;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  min-width: 0;
  min-height: 260px;
  border: 1px solid #d8dfd5;
  border-radius: 8px;
  background: linear-gradient(180deg, #fbfbf5 0%, #f3f6ef 100%);
  overflow: hidden;
  box-shadow: 0 10px 26px rgba(53, 62, 52, .08), inset 0 1px 0 rgba(255, 255, 255, .72);
}

.debug-output {
  display: none;
  min-width: 0;
  min-height: 0;
  margin: 0;
  padding: 18px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #303a33;
  overflow: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}

.debug-output.is-active,
.debug-output.active {
  display: block;
  height: 100%;
}

.response-history-resizer {
  grid-row: 3;
  position: relative;
  min-width: 0;
  height: 12px;
  margin: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  cursor: row-resize;
  touch-action: none;
}

.response-history-resizer::before {
  content: "";
  position: absolute;
  top: 50%;
  right: 0;
  left: 0;
  height: 1px;
  background: #e2e5df;
  transform: translateY(-50%);
}

.response-history-resizer::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 42px;
  height: 4px;
  border-radius: 999px;
  background: #c7cdc4;
  opacity: .68;
  transform: translate(-50%, -50%);
}

.response-history-resizer:hover::after,
.response-history-resizer:focus-visible::after,
body.is-response-resizing .response-history-resizer::after {
  background: #9aa49b;
  opacity: .86;
}

.response-history-resizer:focus-visible {
  outline: 2px solid rgba(91, 96, 72, .24);
  outline-offset: 2px;
}

body.is-response-resizing {
  cursor: row-resize;
  user-select: none;
}

body.is-response-resizing * {
  cursor: row-resize !important;
}

.follow-up-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-width: 0;
  margin: 0;
  padding: 8px 10px;
  border: 0;
  border-top: 1px solid #dce3d8;
  border-radius: 0;
  background: rgba(237, 242, 233, .82);
  backdrop-filter: blur(10px);
  transition: padding .16s ease, background-color .16s ease;
}

.follow-up-panel[hidden] {
  display: none;
}

.follow-up-panel.is-expanded {
  gap: 9px;
  padding: 10px;
  background: rgba(232, 239, 226, .9);
}

.follow-up-panel textarea {
  width: 100%;
  min-height: 34px;
  max-height: 34px;
  resize: vertical;
  padding: 8px 10px;
  border: 1px solid #ccd6ca;
  border-radius: 8px;
  background: rgba(255, 254, 249, .94);
  color: #2f3932;
  font-size: 13px;
  line-height: 1.35;
  outline: none;
  overflow: hidden;
  transition: min-height .16s ease, max-height .16s ease, padding .16s ease, border-color .16s ease, background-color .16s ease, box-shadow .16s ease;
}

.follow-up-panel.is-expanded textarea {
  min-height: 72px;
  max-height: 126px;
  padding: 10px 11px;
  line-height: 1.45;
  overflow: auto;
}

.follow-up-panel textarea::placeholder {
  color: rgba(95, 106, 96, .56);
}

.follow-up-panel textarea:focus {
  border-color: rgba(126, 146, 123, .58);
  background: #fffef9;
  box-shadow: 0 0 0 3px rgba(126, 146, 123, .13);
}

.continue-run-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 36px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: #edf3e9;
  color: #4d5b50;
  font-size: 12px;
  font-weight: 760;
  line-height: 1;
  box-shadow: inset 0 0 0 1px rgba(126, 146, 123, .18);
  transition: width .16s ease, padding .16s ease, background-color .16s ease, color .16s ease, box-shadow .16s ease;
}

.follow-up-panel.is-expanded .continue-run-btn {
  width: auto;
  min-width: 82px;
  padding: 0 10px;
  background: #e4ecdf;
  color: #35443a;
  box-shadow: inset 0 0 0 1px rgba(126, 146, 123, .24);
}

.continue-run-btn:hover {
  background: #dce8d6;
  color: #263029;
  box-shadow: inset 0 0 0 1px rgba(126, 146, 123, .32);
}

.continue-run-btn .icon {
  width: 15px;
  height: 15px;
  stroke-width: 2.4;
}

.continue-run-btn span {
  display: none;
}

.follow-up-panel.is-expanded .continue-run-btn span {
  display: inline;
}

.run-history {
  grid-row: 4;
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  gap: 10px;
  min-width: 0;
  min-height: 160px;
  padding-top: 2px;
}

.cases-list-head,
.trace-filter-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.trace-list-status {
  color: var(--debug-muted);
  font-size: 12px;
  font-weight: 720;
  line-height: 1.35;
  white-space: nowrap;
}

.trace-list-status[data-tone="error"] {
  color: var(--debug-danger);
}

.history-timeline,
.cases-list,
.trace-list {
  display: grid;
  align-content: start;
  min-width: 0;
  min-height: 0;
  overflow: auto;
}

.history-timeline {
  padding: 0 2px 2px 0;
}

.history-group {
  display: grid;
  gap: 0;
  min-width: 0;
  padding: 0;
  border: 0;
  border-top: 1px solid var(--debug-line);
  border-radius: 0;
  background: #fff;
}

.history-group:first-child {
  border-top: 0;
}

.history-group-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  min-width: 0;
  padding: 8px 2px 5px;
  color: #252826;
  font-size: 13px;
  font-weight: 840;
  line-height: 1.25;
}

.history-group-title-button {
  flex: 1 1 auto;
  min-width: 0;
  padding: 0;
  overflow: hidden;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: inherit;
  letter-spacing: 0;
  text-align: left;
  text-overflow: ellipsis;
  white-space: pre;
  cursor: pointer;
}

.history-group-title-button:hover:not(:disabled),
.history-group-title-button:focus-visible {
  color: var(--codex-main);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.history-group-title-button:focus-visible {
  outline: none;
}

.history-group-title-button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.history-codex-analysis-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  gap: 5px;
  height: 28px;
  min-width: 0;
  padding: 0 8px;
  border: 1px solid #cfd4ce;
  border-radius: 8px;
  background: #fff;
  color: #343a35;
  font-size: 11px;
  font-weight: 760;
  line-height: 1;
  letter-spacing: 0;
  white-space: nowrap;
  cursor: pointer;
}

.history-codex-analysis-button:hover:not(:disabled),
.history-codex-analysis-button:focus-visible {
  border-color: rgba(95, 86, 0, 0.3);
  background: #fffef8;
  color: #252826;
}

.history-codex-analysis-button:focus-visible {
  outline: 2px solid var(--accent-ring);
  outline-offset: 2px;
}

.history-codex-analysis-button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.history-codex-analysis-button[aria-busy="true"] {
  cursor: wait;
}

.history-codex-logo {
  display: block;
  width: 14px;
  height: 14px;
  object-fit: contain;
  flex: 0 0 auto;
}

.history-empty {
  padding: 12px 2px;
  color: var(--debug-muted);
  font-size: 13px;
  line-height: 1.45;
}

.history-card {
  position: relative;
  display: grid;
  gap: 6px;
  width: 100%;
  min-width: 0;
  padding: 10px 48px 11px 14px;
  border: 0;
  border-top: 1px solid var(--debug-line);
  border-radius: 0;
  background: #fff;
  text-align: left;
  transition: background-color .15s ease;
}

.history-card:first-of-type {
  border-top: 0;
}

.history-card::before {
  content: "";
  position: absolute;
  top: 12px;
  bottom: 12px;
  left: 2px;
  width: 3px;
  border-radius: 999px;
  background: #d7dbd5;
  transition: background-color .15s ease, box-shadow .15s ease;
}

.history-card.is-active::before {
  background: var(--debug-brand);
  box-shadow: 0 0 0 2px rgba(255, 244, 91, .22);
}

.history-card[data-tone="error"]::before {
  background: #e35f55;
}

.history-card.is-active[data-tone="error"]::before {
  background: linear-gradient(180deg, var(--debug-brand) 0 36%, #e35f55 36% 100%);
  box-shadow: 0 0 0 2px rgba(255, 244, 91, .2), 0 0 0 4px rgba(227, 95, 85, .08);
}

.history-card:hover,
.history-card:focus-visible,
.history-card.is-flashing {
  background: #f4f4ef;
  outline: none;
}

.history-card-title {
  overflow: hidden;
  color: #6f7770;
  font-size: 13px;
  font-weight: 760;
  line-height: 1.32;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-card-meta,
.history-card-preview {
  overflow: hidden;
  color: #68716a;
  font-size: 12px;
  line-height: 1.42;
}

.history-card-preview {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.history-pill {
  position: absolute;
  top: 11px;
  right: 12px;
  min-width: 42px;
  padding: 3px 7px;
  border-radius: 999px;
  background: var(--debug-brand-soft);
  color: var(--debug-brand-ink);
  font-size: 11px;
  font-weight: 820;
  text-align: center;
}

.history-card[data-tone="error"] .history-pill {
  background: #ffe4e1;
  color: var(--debug-danger);
}

.cases-workbench,
.trace-workbench {
  display: grid;
  min-width: 0;
  min-height: 0;
}

.cases-workbench {
  grid-template-rows: minmax(0, 1fr);
}

.trace-workbench {
  grid-template-rows: auto minmax(0, 1fr);
  gap: 10px;
}

.cases-list-shell,
.trace-list-shell {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 10px;
  min-width: 0;
  min-height: 0;
}

.case-list-kicker {
  color: #252826;
  font-size: 13px;
  font-weight: 840;
  line-height: 1.2;
}

.cases-new-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 30px;
  padding: 0 10px;
  border: 0;
  border-radius: 8px;
  background: #202520;
  color: #fffef5;
  font-size: 12px;
  font-weight: 820;
  white-space: nowrap;
}

.cases-new-btn .icon {
  width: 14px;
  height: 14px;
  stroke-width: 2.4;
}

.cases-new-btn:disabled {
  opacity: .42;
  cursor: not-allowed;
}

.cases-list,
.trace-list {
  border-top: 1px solid var(--debug-line);
}

.case-row,
.trace-row {
  position: relative;
  display: grid;
  min-width: 0;
  padding: 12px 36px 11px 0;
  border-bottom: 1px solid var(--debug-line);
  background: #fff;
  color: #303631;
}

.trace-row {
  padding-right: 0;
}

.case-row:hover,
.case-row:focus-within,
.trace-row:hover,
.trace-row:focus-within {
  background: #fbfbf7;
}

.trace-row[data-expired="true"] {
  background: #f0f1ed;
}

.trace-row[data-expired="true"]:hover,
.trace-row[data-expired="true"]:focus-within {
  background: #eaede8;
}

.case-row-main,
.trace-row-main {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.case-row-top,
.trace-row-top,
.case-title-wrap,
.trace-title-line,
.case-row-meta,
.case-actions,
.trace-actions,
.trace-row-bottom {
  display: flex;
  align-items: center;
  min-width: 0;
}

.case-row-top,
.trace-row-top {
  justify-content: space-between;
  gap: 8px;
}

.case-title-wrap,
.trace-title-line {
  gap: 6px;
  flex: 1 1 auto;
}

.case-title-edit,
.trace-title-edit {
  max-width: 100%;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: #252826;
  font-size: 13px;
  font-weight: 840;
  line-height: 1.25;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: text;
}

.case-title-edit:focus-visible,
.trace-title-edit:focus-visible {
  outline: 2px solid rgba(254, 246, 91, .55);
  outline-offset: 2px;
  border-radius: 5px;
}

.case-title-input,
.trace-title-input,
.case-edit-field,
.case-type-select {
  width: 100%;
  min-width: 0;
  border: 1px solid #daddd5;
  border-radius: 7px;
  background: #fff;
  color: #252826;
  outline: none;
}

.case-title-input,
.trace-title-input {
  height: 26px;
  padding: 0 7px;
  font-size: 13px;
  font-weight: 820;
}

.case-pill,
.trace-pill {
  flex: 0 0 auto;
  padding: 3px 7px;
  border-radius: 999px;
  background: #eff3eb;
  color: #516255;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.2;
  white-space: nowrap;
}

.trace-pill[data-stage="production"] {
  background: var(--debug-brand-soft);
  color: var(--debug-brand-ink);
}

.trace-pill[data-stage="test"] {
  background: #eff3eb;
  color: #516255;
}

.case-row-meta,
.trace-row-meta,
.case-row-preview,
.trace-row-foot {
  color: #68716a;
  font-size: 12px;
  line-height: 1.42;
}

.case-row-meta,
.trace-row-meta {
  gap: 7px;
  overflow: hidden;
  white-space: nowrap;
}

.trace-row-meta {
  display: -webkit-box;
  overflow-wrap: anywhere;
  white-space: normal;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.case-row-preview,
.trace-row-foot {
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.case-copy-btn {
  position: absolute;
  top: 9px;
  right: 6px;
}

.case-copy-btn {
  width: 28px;
  height: 28px;
  border-radius: 7px;
}

.trace-copy-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: auto;
  min-width: 120px;
  height: 28px;
  padding: 0 8px;
  border: 1px solid #cfd4ce;
  border-radius: 8px;
  background: #fff;
  box-shadow: none;
  color: #252826;
  font-size: 11px;
  font-weight: 780;
  line-height: 1;
  letter-spacing: 0;
  white-space: nowrap;
  transition: background-color .16s ease, color .16s ease, box-shadow .16s ease;
}

.trace-copy-btn:hover,
.trace-copy-btn:focus-visible {
  box-shadow: none;
}

.trace-copy-btn:focus-visible {
  outline: 2px solid rgba(57, 65, 255, .18);
  outline-offset: 2px;
}

.case-copy-btn .icon,
.trace-copy-btn .icon {
  width: 15px;
  height: 15px;
  stroke-width: 2.1;
}

.trace-codex-logo {
  display: block;
  width: 14px;
  height: 14px;
  object-fit: contain;
  flex: 0 0 auto;
}

.case-actions,
.trace-actions {
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 2px;
}

.trace-row-bottom {
  justify-content: space-between;
  align-items: flex-end;
  gap: 12px;
  margin-top: 2px;
}

.trace-row-bottom .trace-actions {
  flex: 0 0 auto;
  flex-wrap: nowrap;
  margin-top: 0;
}

.trace-row-bottom .trace-action-btn,
.trace-row-bottom .trace-row-expiry {
  flex: 0 0 auto;
}

.trace-actions .trace-row-expiry {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  margin-left: 2px;
  text-align: left;
}

.trace-row-bottom-meta {
  display: flex;
  flex: 1 1 0;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  min-width: 120px;
  margin-left: auto;
}

.trace-row-model-name {
  max-width: 100%;
  overflow: hidden;
  padding: 4px 8px;
  border: 1px solid #e4e8e0;
  border-radius: 7px;
  background: #fbfcf7;
  color: #566157;
  font-size: 12px;
  font-weight: 820;
  line-height: 1.25;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.trace-row-expiry {
  flex: 0 0 auto;
  color: #566157;
  font-size: 12px;
  font-weight: 820;
  line-height: 1.3;
  text-align: right;
  white-space: nowrap;
}

.trace-row-expiry[data-expired="true"] {
  color: var(--debug-danger);
}

.trace-row[data-expired="true"] .trace-row-model-name {
  border-color: #d4d8cf;
  background: #f5f6f2;
  color: #68716a;
}

.case-action-btn,
.trace-action-btn {
  height: 25px;
  padding: 0 8px;
  border: 1px solid #e2e5df;
  border-radius: 7px;
  background: #f7f7f2;
  color: #4f584f;
  font-size: 12px;
  font-weight: 760;
}

.case-action-btn.is-danger,
.trace-action-btn.is-danger {
  color: var(--debug-danger);
  background: #fff7f5;
}

.case-editor {
  display: grid;
  gap: 8px;
  margin-top: 2px;
}

.case-edit-field {
  min-height: 112px;
  padding: 9px 10px;
  resize: vertical;
  font-size: 13px;
  line-height: 1.45;
}

.case-editor-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 7px;
  align-items: center;
}

.case-type-select {
  height: 30px;
  padding: 0 8px;
  font-size: 12px;
}

.trace-list {
  border: 1px solid var(--debug-line);
  border-radius: 8px;
  background: #fff;
}

.trace-row {
  padding-left: 14px;
  padding-right: 14px;
}

.trace-row[data-clickable="true"] {
  cursor: pointer;
}

.trace-row[data-clickable="true"]:focus-visible {
  outline: 2px solid rgba(20, 124, 95, .22);
  outline-offset: -2px;
}

.trace-row::before {
  content: "";
  position: absolute;
  top: 12px;
  bottom: 12px;
  left: 5px;
  width: 3px;
  border-radius: 999px;
  background: #d3d6d1;
}

.trace-row[data-stage="production"]::before {
  background: var(--debug-brand);
}

.trace-row[data-stage="test"]::before {
  background: #d3d6d1;
}

.trace-row[data-expired="true"]::before {
  content: none;
}

.trace-filter-row {
  align-items: center;
}

.error-box {
  padding: 8px 10px;
  border: 1px solid #ffd0ca;
  border-radius: 8px;
  background: #fff4f2;
  color: var(--debug-danger);
  font-size: 12px;
  line-height: 1.4;
}

.current-run-anchor {
  display: none;
}

.support-feedback-widget {
  position: fixed;
  top: var(--support-feedback-top, 220px);
  left: 0;
  right: auto;
  z-index: 1100;
  width: 128px;
  color: #1d261f;
  transform: translateX(-94px);
  transition: transform 160ms ease, opacity 160ms ease;
  will-change: transform, top, left;
}

.support-feedback-widget.is-left {
  left: 0;
  right: auto;
  transform: translateX(-94px);
}

.support-feedback-widget.is-right {
  left: auto;
  right: 0;
  transform: translateX(94px);
}

.support-feedback-widget:hover,
.support-feedback-widget:focus-within,
.support-feedback-widget.is-expanded,
.support-feedback-widget.is-open,
.support-feedback-widget.is-dragging {
  transform: translateX(0);
}

.support-feedback-widget.is-dragging {
  transition: none;
}

.support-feedback-button {
  display: grid;
  grid-template-columns: 10px 22px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  width: 128px;
  min-height: 44px;
  padding: 8px 12px 8px 8px;
  border: 1px solid rgba(31, 41, 35, 0.12);
  border-right: 0;
  border-radius: 8px 0 0 8px;
  background: #ffffff;
  box-shadow: 0 12px 30px rgba(30, 42, 36, 0.18);
  color: inherit;
  cursor: pointer;
  user-select: none;
  touch-action: none;
}

.support-feedback-widget.is-left .support-feedback-button {
  grid-template-columns: minmax(0, 1fr) 22px 10px;
  padding: 8px 8px 8px 12px;
  border-right: 1px solid rgba(31, 41, 35, 0.12);
  border-left: 0;
  border-radius: 0 8px 8px 0;
}

.support-feedback-widget.is-left .support-feedback-text {
  order: 1;
  text-align: right;
}

.support-feedback-widget.is-left .support-feedback-icon {
  order: 2;
}

.support-feedback-widget.is-left .support-feedback-grip {
  order: 3;
}

.support-feedback-button:focus-visible,
.support-feedback-close:focus-visible {
  outline: 2px solid rgba(254, 246, 91, 0.68);
  outline-offset: 2px;
}

.support-feedback-grip {
  width: 3px;
  height: 24px;
  border-radius: 999px;
  background: repeating-linear-gradient(
    to bottom,
    rgba(101, 113, 106, 0.7) 0,
    rgba(101, 113, 106, 0.7) 2px,
    transparent 2px,
    transparent 5px
  );
}

.support-feedback-icon {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  color: var(--brand-ink);
}

.support-feedback-icon svg,
.support-feedback-close svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.support-feedback-text {
  overflow: hidden;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.support-feedback-panel {
  position: absolute;
  top: 52px;
  left: 12px;
  right: auto;
  width: 320px;
  padding: 16px;
  border: 1px solid rgba(31, 41, 35, 0.12);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 18px 48px rgba(30, 42, 36, 0.22);
}

.support-feedback-widget.is-right .support-feedback-panel {
  left: auto;
  right: 12px;
}

.support-feedback-panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.support-feedback-panel h2 {
  margin: 0 0 4px;
  font-size: 16px;
  line-height: 1.25;
}

.support-feedback-panel p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.support-feedback-close {
  display: grid;
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  cursor: pointer;
}

.support-feedback-qr {
  display: grid;
  width: 176px;
  height: 176px;
  margin: 0 auto 12px;
  place-items: center;
  border: 1px solid rgba(31, 41, 35, 0.14);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(31, 41, 35, 0.06) 1px, transparent 1px),
    linear-gradient(rgba(31, 41, 35, 0.06) 1px, transparent 1px),
    #f9faf7;
  background-size: 16px 16px;
}

.support-feedback-qr img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.support-feedback-qr-placeholder {
  display: grid;
  gap: 5px;
  place-items: center;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.support-feedback-qr-placeholder span {
  color: #5865f2;
  font-size: 15px;
  font-weight: 800;
}

.support-feedback-qr-placeholder strong {
  color: var(--ink);
  font-size: 13px;
}

.support-feedback-note {
  text-align: center;
}

@media (max-width: 900px) {
  .support-feedback-widget {
    display: none;
  }
}

@media (max-width: 1180px) {
  .pi-main-workspace > .utility-pane {
    display: block;
    grid-template-rows: none;
    height: auto;
    min-height: 0;
    margin: 0 18px 0;
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: visible;
  }

  .debug-console {
    height: auto;
    min-height: 680px;
  }

  #responseWorkspacePanel.active,
  .debug-workspace-panel[data-debug-panel="response"].is-active,
  .debug-workspace-panel[data-debug-panel="response"].active {
    --debug-output-row: minmax(340px, 420px);
    --debug-history-row: minmax(160px, 1fr);
  }

  .pi-main-workspace.is-debug-collapsed {
    grid-template-columns: 1fr;
  }

  .pi-main-workspace.is-debug-collapsed > .utility-pane {
    position: fixed;
    top: 0;
    right: 0;
    z-index: 20;
    width: 64px;
    height: 100dvh;
    margin: 0;
    border-radius: 0;
  }
}

@media (max-width: 860px) {
  .pi-app-shell.is-settings {
    grid-template-columns: 300px minmax(0, 1fr);
    min-width: 0;
  }

  .pi-app-shell.is-settings .pi-sidebar {
    position: relative;
    height: auto;
    max-height: none;
  }

  .pi-app-shell.is-settings .settings-main {
    height: 100dvh;
    overflow: auto;
  }

  .settings-page {
    width: min(100%, 760px);
    padding: 34px 24px 42px;
  }

  .settings-form-row {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .settings-wizard-provider-grid {
    grid-template-columns: 1fr;
  }

  .capability-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .settings-action-bar {
    flex-wrap: wrap;
  }
}

@media (max-width: 820px) {
  .pi-app-shell:not(.is-settings) {
    grid-template-rows: auto minmax(0, 1fr);
    align-content: start;
  }

  .pi-app-shell:not(.is-settings) .pi-sidebar {
    grid-column: 1;
    grid-row: 1;
    min-height: max-content;
    overflow: visible;
    z-index: 2;
  }

  .pi-app-shell:not(.is-settings) .pi-main-workspace {
    grid-column: 1;
    grid-row: 2;
  }
}

@media (max-width: 620px) {
  .trace-row-bottom {
    align-items: stretch;
    flex-direction: column;
  }

  .trace-row-bottom .trace-actions {
    flex-wrap: wrap;
  }

  .trace-row-bottom-meta {
    flex-basis: auto;
    align-items: flex-start;
    width: 100%;
    margin-left: 0;
  }

  .trace-row-model-name {
    max-width: 100%;
    text-align: left;
  }

  .pi-app-shell.is-settings {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
  }

  .pi-app-shell.is-settings .pi-sidebar {
    grid-column: 1;
    grid-row: 1;
    min-height: max-content;
    overflow: visible;
  }

  .pi-app-shell.is-settings .settings-sidebar {
    min-height: auto;
    height: auto;
    padding: 16px 12px 10px;
  }

  .pi-app-shell.is-settings .settings-main {
    grid-column: 1;
    grid-row: 2;
    height: auto;
    min-height: 100dvh;
    overflow: visible;
  }

  .profile-action-row,
  .account-ledger-settings-page .account-ledger-recharge {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .language-segmented,
  .provider-segmented {
    width: 100%;
  }

  .settings-wizard-steps {
    grid-template-columns: 1fr;
  }

  .settings-wizard-step strong {
    white-space: normal;
  }

  .settings-confirm-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .inline-action-row {
    flex-wrap: wrap;
  }
}
