/*
 * Carrot Academic reference UI layer.
 *
 * This file is intentionally loaded after the legacy style sheets. It changes
 * presentation only: routes, controls, billing rules and task data remain
 * owned by app.js and the server.
 */

/* ---------- Direct login ---------- */

body.carrot-auth-active {
  min-width: 320px;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  overflow-x: hidden;
  background: #1f604f;
  color: #15211d;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

body.carrot-auth-active #agent-app {
  min-height: 100vh;
  min-height: 100dvh;
}

.carrot-login-page,
.carrot-login-page * {
  box-sizing: border-box;
  letter-spacing: 0;
}

.carrot-login-page {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 42px 32px;
  display: grid;
  place-items: center;
  overflow: hidden;
  background:
    linear-gradient(128deg, rgba(15, 63, 58, .97) 0%, rgba(38, 112, 83, .94) 46%, rgba(49, 96, 143, .9) 76%, rgba(226, 105, 47, .92) 128%),
    #1f604f;
  color: #fff;
}

.carrot-login-shell {
  position: relative;
  z-index: 1;
  width: min(1120px, 100%);
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(400px, 448px);
  align-items: center;
  gap: clamp(56px, 7vw, 104px);
}

.carrot-login-story {
  min-width: 0;
  min-height: 570px;
  display: flex;
  flex-direction: column;
}

.carrot-login-brand {
  width: fit-content;
  max-width: 100%;
  display: inline-flex;
  align-items: center;
  gap: 15px;
  color: #fff;
  text-decoration: none;
}

.carrot-login-logo {
  width: 68px;
  height: 68px;
  flex: 0 0 68px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .34);
  border-radius: 18px;
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 14px 34px rgba(7, 32, 28, .18);
}

.carrot-login-logo img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.carrot-login-brand > span:last-child {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.carrot-login-brand strong {
  display: block;
  overflow-wrap: anywhere;
  font-size: 31px;
  font-weight: 800;
  line-height: 1.15;
}

.carrot-login-brand small {
  color: rgba(255, 255, 255, .76);
  font-size: 14px;
}

.carrot-login-message {
  width: min(100%, 540px);
  margin: auto 0;
  padding: 44px 0 36px;
}

.carrot-login-eyebrow {
  width: fit-content;
  margin: 0 0 16px;
  padding: 6px 10px;
  border: 1px solid rgba(255, 255, 255, .24);
  border-radius: 6px;
  background: rgba(255, 255, 255, .1);
  color: #fff1b8;
  font-size: 12px;
  font-weight: 800;
}

.carrot-login-message h1 {
  margin: 0;
  color: #fff;
  font-size: 38px;
  font-weight: 800;
  line-height: 1.34;
}

.carrot-login-message h1 em {
  color: #ffe59a;
  font-style: normal;
}

.carrot-login-lead {
  max-width: 510px;
  margin: 18px 0 25px;
  color: rgba(255, 255, 255, .8);
  font-size: 16px;
  line-height: 1.75;
}

.carrot-login-benefits {
  display: grid;
  gap: 12px;
}

.carrot-login-benefits > div {
  min-width: 0;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 13px;
}

.carrot-login-benefits > div > span {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, .2);
  border-radius: 10px;
  background: rgba(255, 255, 255, .12);
  color: #fff;
}

.carrot-login-benefits svg {
  width: 20px;
  height: 20px;
}

.carrot-login-benefits p {
  min-width: 0;
  margin: 0;
  display: grid;
  gap: 2px;
}

.carrot-login-benefits strong,
.carrot-login-benefits small {
  overflow-wrap: anywhere;
}

.carrot-login-benefits strong {
  color: #fff;
  font-size: 14px;
}

.carrot-login-benefits small {
  color: rgba(255, 255, 255, .7);
  font-size: 12px;
  line-height: 1.5;
}

.carrot-login-story-foot {
  margin: 0;
  color: rgba(255, 255, 255, .58);
  font-size: 12px;
  line-height: 1.5;
}

.carrot-login-card {
  width: 100%;
  min-width: 0;
  padding: 31px 32px 27px;
  border: 1px solid rgba(255, 255, 255, .7);
  border-radius: 22px;
  background: rgba(255, 255, 255, .975);
  color: #17211e;
  box-shadow: 0 24px 70px rgba(8, 34, 30, .24);
}

.carrot-login-mobile-brand {
  display: none;
}

.carrot-login-card-head {
  margin-bottom: 24px;
  text-align: center;
}

.carrot-login-card-mark {
  display: inline-block;
  margin-bottom: 8px;
  color: #d75d20;
  font-size: 12px;
  font-weight: 800;
}

.carrot-login-card-head h2 {
  margin: 0;
  color: #17211e;
  font-size: 26px;
  font-weight: 800;
  line-height: 1.25;
}

.carrot-login-card-head p {
  margin: 8px 0 0;
  color: #66736e;
  font-size: 14px;
  line-height: 1.55;
}

.carrot-login-form {
  display: grid;
  gap: 9px;
}

.carrot-auth-label {
  margin-top: 3px;
  color: #34413c;
  font-size: 13px;
  font-weight: 700;
}

.carrot-auth-control {
  position: relative;
  width: 100%;
  min-height: 50px;
  display: flex;
  align-items: center;
  border: 1px solid #d9e0dd;
  border-radius: 10px;
  background: #fff;
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}

.carrot-auth-control:hover {
  border-color: #b9c5c0;
}

.carrot-auth-control:focus-within {
  border-color: #e36c2f;
  box-shadow: 0 0 0 3px rgba(227, 108, 47, .14);
}

.carrot-auth-control > .nav-icon,
.carrot-auth-control > svg:first-child {
  position: absolute;
  left: 15px;
  width: 19px;
  height: 19px;
  color: #83908b;
  pointer-events: none;
}

.carrot-auth-control input {
  width: 100%;
  min-width: 0;
  height: 48px;
  padding: 0 45px;
  border: 0;
  outline: 0;
  background: transparent;
  color: #17211e;
  font: inherit;
  font-size: 14px;
}

.carrot-auth-control input::placeholder {
  color: #9ca8a3;
  opacity: 1;
}

.carrot-password-toggle {
  position: absolute;
  right: 3px;
  width: 44px;
  height: 44px;
  padding: 0;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #718079;
  cursor: pointer;
}

.carrot-password-toggle:hover {
  background: #f3f6f4;
  color: #24332d;
}

.carrot-password-toggle svg {
  width: 19px;
  height: 19px;
}

.carrot-password-toggle:focus-visible,
.carrot-login-submit:focus-visible,
.carrot-wechat-login:focus-visible,
.carrot-login-register button:focus-visible,
.carrot-login-card a:focus-visible {
  outline: 3px solid rgba(227, 108, 47, .24);
  outline-offset: 2px;
}

.carrot-login-form.has-auth-error .carrot-auth-control {
  border-color: #dc4c4c;
}

.carrot-auth-feedback {
  margin: 2px 0 0;
  padding: 8px 10px;
  border-radius: 7px;
  background: #fff3f3;
  color: #bd2e2e;
  font-size: 12px;
  line-height: 1.5;
}

.carrot-auth-feedback[data-tone="info"] {
  background: #eef7f3;
  color: #176c4f;
}

.carrot-auth-feedback[hidden] {
  display: none;
}

.carrot-login-help {
  min-height: 20px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.carrot-login-help a,
.carrot-login-register button,
.carrot-login-contact a {
  color: #c95318;
  text-decoration: none;
}

.carrot-login-help a:hover,
.carrot-login-contact a:hover {
  text-decoration: underline;
}

.carrot-login-help a {
  font-size: 12px;
}

.carrot-login-submit,
.carrot-wechat-login {
  width: 100%;
  min-height: 50px;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-radius: 10px;
  font: inherit;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  transition: transform .14s ease, border-color .14s ease, background .14s ease, box-shadow .14s ease;
}

.carrot-login-submit {
  border: 1px solid #d95e21;
  background: #e76f32;
  color: #fff;
  box-shadow: 0 10px 24px rgba(218, 91, 29, .2);
}

.carrot-login-submit:hover:not(:disabled) {
  border-color: #c94f13;
  background: #d85d20;
  transform: translateY(-1px);
}

.carrot-login-submit:active:not(:disabled),
.carrot-wechat-login:active:not(:disabled) {
  transform: translateY(0);
}

.carrot-login-submit:disabled,
.carrot-wechat-login:disabled {
  cursor: wait;
  opacity: .62;
  box-shadow: none;
}

.carrot-login-form[aria-busy="true"] .carrot-auth-control {
  background: #f7f9f8;
}

.carrot-login-divider {
  position: relative;
  margin: 20px 0 14px;
  color: #909b96;
  font-size: 11px;
  text-align: center;
}

.carrot-login-divider::before {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  content: "";
  background: #e7ebe9;
}

.carrot-login-divider span {
  position: relative;
  padding: 0 12px;
  background: #fff;
}

.carrot-wechat-login {
  border: 1px solid #dbe3df;
  background: #fff;
  color: #293731;
  box-shadow: none;
}

.carrot-wechat-login:hover:not(:disabled) {
  border-color: #99c8b7;
  background: #f3faf7;
  transform: translateY(-1px);
}

.carrot-wechat-icon {
  width: 28px;
  height: 28px;
  display: inline-grid;
  place-items: center;
  border-radius: 7px;
  background: #1fa66a;
  color: #fff;
  font-size: 9px;
  font-weight: 800;
}

.carrot-wechat-note {
  min-height: 18px;
  margin: 7px 0 0;
  color: #84918b;
  font-size: 11px;
  line-height: 1.5;
  text-align: center;
}

.carrot-login-register,
.carrot-login-contact {
  overflow-wrap: anywhere;
  text-align: center;
}

.carrot-login-register {
  margin: 14px 0 0;
  color: #65716c;
  font-size: 13px;
}

.carrot-login-register button {
  min-height: 32px;
  padding: 0 4px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.carrot-login-contact {
  margin: 5px 0 0;
  color: #8b9691;
  font-size: 11px;
  line-height: 1.5;
}

/* Keep registration and login recovery surfaces in the same brand system. */
body.carrot-auth-active .bunny-auth-mask {
  background: rgba(10, 38, 34, .72);
  backdrop-filter: blur(8px);
}

body.carrot-auth-active .bunny-auth-mask .modal {
  border: 1px solid rgba(255, 255, 255, .74);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(5, 27, 24, .3);
}

body.carrot-auth-active .bunny-auth-mask .modal-head,
body.carrot-auth-active .bunny-auth-mask .modal-foot {
  border-color: #e6ebe8;
}

body.carrot-auth-active .bunny-auth-mask .bunny-kicker,
body.carrot-auth-active .bunny-auth-mask .bunny-auth-switch {
  color: #c95318;
}

body.carrot-auth-active .bunny-auth-mask .bunny-auth-form .input {
  border-color: #d9e0dd;
  border-radius: 8px;
  background: #fff;
}

body.carrot-auth-active .bunny-auth-mask .bunny-auth-form .input:hover {
  border-color: #b9c5c0;
}

body.carrot-auth-active .bunny-auth-mask .bunny-auth-form .input:focus {
  border-color: #e36c2f;
  box-shadow: 0 0 0 3px rgba(227, 108, 47, .14);
}

body.carrot-auth-active .bunny-auth-mask .bunny-auth-form .btn.primary {
  border: 1px solid #d95e21;
  border-radius: 8px;
  background: #e76f32;
  color: #fff;
  box-shadow: 0 8px 20px rgba(218, 91, 29, .18);
}

body.carrot-auth-active .bunny-auth-mask .bunny-auth-form .btn.primary:hover:not(:disabled) {
  border-color: #c94f13;
  background: #d85d20;
}

body.carrot-auth-active .bunny-auth-mask .invite-preview {
  border-color: #dfe7e3;
  background: #f2f7f4;
  color: #5f6d67;
}

body.carrot-auth-active .bunny-auth-mask button:focus-visible,
body.carrot-auth-active .bunny-auth-mask input:focus-visible {
  outline: 3px solid rgba(227, 108, 47, .2);
  outline-offset: 2px;
}

/* ---------- Workspace shell ---------- */

.workspace-console {
  --ref-page: #f7f9fc;
  --ref-surface: #ffffff;
  --ref-surface-soft: #f7f9fb;
  --ref-surface-hover: #f1f4f7;
  --ref-border: #e4e8ee;
  --ref-border-strong: #cfd7e1;
  --ref-text: #172033;
  --ref-muted: #667085;
  --ref-primary: #df672b;
  --ref-primary-hover: #c85018;
  --ref-primary-soft: #fff1e8;
  --ref-green: #148260;
  --ref-green-soft: #e8f7f1;
  --ref-blue: #326bd4;
  --ref-blue-soft: #eaf1ff;
  --ref-violet: #7256c8;
  --ref-violet-soft: #f0ecff;
  --ref-amber: #c77c0a;
  --ref-amber-soft: #fff5d9;
  --ref-red: #d34949;
  --ref-red-soft: #fff0f0;
  --ref-shadow: 0 2px 8px rgba(30, 47, 60, .045), 0 12px 28px rgba(30, 47, 60, .035);
  --wc-bg: var(--ref-page);
  --wc-sidebar: var(--ref-surface);
  --wc-topbar: var(--ref-surface);
  --wc-panel: var(--ref-surface);
  --wc-panel-soft: var(--ref-surface-soft);
  --wc-input: var(--ref-surface);
  --wc-hover: var(--ref-surface-hover);
  --wc-border: var(--ref-border);
  --wc-border-strong: var(--ref-border-strong);
  --wc-text: var(--ref-text);
  --wc-muted: var(--ref-muted);
  --wc-accent: var(--ref-primary);
  --wc-accent-soft: var(--ref-primary-soft);
  --wc-green: var(--ref-green);
  --wc-green-soft: var(--ref-green-soft);
  width: 100%;
  min-width: 0;
  height: 100vh;
  height: 100dvh;
  grid-template-columns: 256px minmax(0, 1fr);
  background: var(--ref-page);
  color: var(--ref-text);
  color-scheme: light;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

.workspace-console:not(.light-mode) {
  --ref-page: #11161a;
  --ref-surface: #181e23;
  --ref-surface-soft: #20272d;
  --ref-surface-hover: #252e35;
  --ref-border: #303941;
  --ref-border-strong: #43505b;
  --ref-text: #edf2f5;
  --ref-muted: #9aa7b0;
  --ref-primary: #f08a51;
  --ref-primary-hover: #ff9a62;
  --ref-primary-soft: rgba(240, 138, 81, .14);
  --ref-green: #5bc9a2;
  --ref-green-soft: rgba(91, 201, 162, .13);
  --ref-blue: #79a5fa;
  --ref-blue-soft: rgba(82, 128, 220, .14);
  --ref-violet: #ae96ee;
  --ref-violet-soft: rgba(117, 86, 200, .16);
  --ref-amber: #e5ad4a;
  --ref-amber-soft: rgba(199, 124, 10, .15);
  --ref-red: #ed7a7a;
  --ref-red-soft: rgba(211, 73, 73, .14);
  --ref-shadow: none;
  color-scheme: dark;
}

.workspace-console.light-mode {
  --wc-bg: var(--ref-page);
  --wc-sidebar: var(--ref-surface);
  --wc-topbar: var(--ref-surface);
  --wc-panel: var(--ref-surface);
  --wc-panel-soft: var(--ref-surface-soft);
  --wc-input: var(--ref-surface);
  --wc-hover: var(--ref-surface-hover);
  --wc-border: var(--ref-border);
  --wc-border-strong: var(--ref-border-strong);
  --wc-text: var(--ref-text);
  --wc-muted: var(--ref-muted);
  --wc-accent: var(--ref-primary);
  --wc-accent-soft: var(--ref-primary-soft);
  --wc-green: var(--ref-green);
  --wc-green-soft: var(--ref-green-soft);
  grid-template-columns: 256px minmax(0, 1fr);
  background: var(--ref-page);
}

.workspace-console,
.workspace-console * {
  letter-spacing: 0;
}

body.workspace-active,
body.workspace-active.workspace-light,
html.workspace-theme-light,
html.workspace-theme-light body {
  background: #f7f9fc;
}

html.workspace-theme-dark,
html.workspace-theme-dark body {
  background: #11161a;
}

.workspace-console .sidebar {
  width: auto;
  height: 100vh;
  height: 100dvh;
  padding: 16px 13px 12px;
  border: 0;
  border-right: 1px solid var(--ref-border);
  border-radius: 0;
  background: var(--ref-surface);
  box-shadow: none;
}

.workspace-console .brand {
  min-height: 76px;
  margin: 0 5px 8px;
  padding: 7px 6px 15px;
  gap: 12px;
  border-bottom: 1px solid var(--ref-border);
}

.workspace-console .brand img {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  border: 1px solid var(--ref-border);
  border-radius: 10px;
  background: #fff;
  object-fit: cover;
  box-shadow: 0 3px 10px rgba(39, 65, 53, .08);
}

.workspace-console .brand > div {
  min-width: 0;
}

.workspace-console .brand strong,
.workspace-console .brand span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace-console .brand strong {
  color: var(--ref-text);
  font-size: 17px;
  font-weight: 800;
}

.workspace-console .brand span {
  margin-top: 3px;
  color: var(--ref-muted);
  font-size: 10px;
}

.workspace-console .nav {
  padding: 0 3px 14px;
  scrollbar-color: var(--ref-border-strong) transparent;
}

.workspace-console .nav-section-label {
  padding: 14px 10px 6px;
  color: #9099a7;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
}

.workspace-console .nav button,
.workspace-console .nav-sub .nav-link {
  min-height: 42px;
  margin: 2px 0;
  padding: 0 11px;
  gap: 11px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: #687481;
  font-size: 13px;
  font-weight: 600;
  transition: color .14s ease, background .14s ease, border-color .14s ease;
}

.workspace-console .nav button:hover,
.workspace-console .nav-sub .nav-link:hover {
  transform: none;
  border-color: transparent;
  background: var(--ref-surface-hover);
  color: var(--ref-text);
}

.workspace-console .nav button.active,
.workspace-console .nav .nav-link.active,
.workspace-console .nav-parent-active,
.workspace-console .nav-group.open .nav-group-toggle {
  border-color: rgba(223, 103, 43, .13);
  background: var(--ref-primary-soft);
  box-shadow: none;
  color: var(--ref-primary);
  font-weight: 750;
}

.workspace-console .nav-icon {
  width: 19px;
  height: 19px;
  flex: 0 0 19px;
  color: #87919e;
}

.workspace-console .nav button.active .nav-icon,
.workspace-console .nav .nav-link.active .nav-icon,
.workspace-console .nav-parent-active .nav-icon,
.workspace-console .nav button:hover .nav-icon {
  color: currentColor;
}

.workspace-console .nav-sub {
  margin: 3px 0 5px 19px;
  padding-left: 8px;
  border-left: 1px solid var(--ref-border);
}

.workspace-console .nav-sub .nav-link {
  min-height: 35px;
  padding-left: 9px;
  font-size: 12px;
}

.workspace-sidebar-foot {
  padding: 10px 3px 0;
  border-top: 1px solid var(--ref-border);
}

.workspace-account {
  min-height: 52px;
  padding: 6px 7px;
  gap: 9px;
  border-radius: 8px;
}

.workspace-account:hover {
  border-color: transparent;
  background: var(--ref-surface-hover);
}

.workspace-avatar {
  position: relative;
  display: inline-grid;
  width: 34px;
  min-width: 34px;
  max-width: 34px;
  height: 34px;
  min-height: 34px;
  max-height: 34px;
  flex: 0 0 34px;
  place-items: center;
  overflow: hidden;
  border-color: rgba(20, 130, 96, .25);
  border-radius: 50%;
  background: var(--ref-green-soft);
  color: var(--ref-green);
}

.workspace-avatar > img[data-avatar-image] {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  object-fit: cover;
}

.workspace-avatar > img[data-avatar-image][hidden],
.workspace-console .profile-avatar > img[data-avatar-image][hidden] {
  display: none;
}

.workspace-avatar > .avatar-fallback,
.workspace-console .profile-avatar > .avatar-fallback {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  line-height: 1;
}

.workspace-avatar > .avatar-fallback[hidden],
.workspace-console .profile-avatar > .avatar-fallback[hidden] {
  display: none;
}

.workspace-account-copy strong,
.workspace-user-button strong {
  color: var(--ref-text);
  font-size: 12px;
}

.workspace-account-copy small,
.workspace-user-button small {
  color: var(--ref-muted);
}

.workspace-sidebar-tools {
  gap: 5px;
  margin-top: 4px;
}

.workspace-sidebar-tools button {
  min-height: 36px;
  border-radius: 8px;
  color: var(--ref-muted);
}

.workspace-sidebar-tools button:hover {
  border-color: transparent;
  background: var(--ref-surface-hover);
  color: var(--ref-text);
}

.workspace-console .main {
  height: 100vh;
  height: 100dvh;
  grid-template-rows: 68px minmax(0, 1fr);
  background: var(--ref-page);
}

.workspace-console .topbar {
  width: auto;
  height: 68px;
  min-height: 68px;
  margin: 0;
  padding: 0 24px;
  gap: 14px;
  border: 0;
  border-bottom: 1px solid var(--ref-border);
  border-radius: 0;
  background: rgba(255, 255, 255, .96);
  box-shadow: none;
}

.workspace-console:not(.light-mode) .topbar {
  background: rgba(24, 30, 35, .97);
}

.workspace-console .topbar .workspace-page-heading strong {
  color: var(--ref-text);
  font-size: 18px;
  font-weight: 800;
}

.workspace-page-heading small {
  margin-top: 3px;
  color: var(--ref-muted);
  font-size: 11px;
}

.workspace-console .workspace-topbar-actions {
  gap: 7px;
}

.workspace-console .workspace-icon-button,
.workspace-console .workspace-balance,
.workspace-console .workspace-user-button,
.workspace-console .workspace-topbar-actions > .btn {
  min-height: 38px;
  border-radius: 8px;
}

.workspace-console .workspace-icon-button {
  width: 38px;
  height: 38px;
  flex-basis: 38px;
  border-color: var(--ref-border);
  background: var(--ref-surface);
  color: var(--ref-muted);
}

.workspace-console .workspace-icon-button:hover {
  border-color: var(--ref-border-strong);
  background: var(--ref-surface-hover);
  color: var(--ref-text);
  transform: none;
}

.workspace-console .workspace-balance {
  padding: 3px 11px;
  border-color: rgba(223, 103, 43, .2);
  background: var(--ref-primary-soft);
  color: var(--ref-primary);
}

.workspace-console .workspace-balance:hover {
  border-color: rgba(223, 103, 43, .38);
  background: var(--ref-primary-soft);
  transform: none;
}

.workspace-console .workspace-user-button {
  border-radius: 8px;
}

.workspace-console .workspace-user-button:hover {
  border-color: transparent;
  background: var(--ref-surface-hover);
  transform: none;
}

.workspace-console .btn {
  min-height: 38px;
  padding-inline: 14px;
  border-radius: 8px;
}

.workspace-console .btn.primary {
  border-color: var(--ref-primary);
  background: var(--ref-primary);
  color: #fff;
}

.workspace-console .btn.primary:hover:not(:disabled) {
  border-color: var(--ref-primary-hover);
  background: var(--ref-primary-hover);
}

.workspace-console .btn.ghost {
  border-color: var(--ref-border);
  background: var(--ref-surface);
  color: var(--ref-text);
}

.workspace-console .btn:hover,
.workspace-console .workspace-icon-button:hover,
.workspace-console .workspace-balance:hover,
.workspace-console .workspace-user-button:hover {
  transform: none;
}

.workspace-main-scroll {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  overflow: hidden;
}

.workspace-console .content {
  min-width: 0;
  min-height: 0;
  padding: 24px 26px 32px;
  overflow-x: hidden;
  overflow-y: auto;
  background: var(--ref-page);
  scrollbar-gutter: stable;
}

.workspace-console .content > * {
  max-width: 1540px;
  margin-right: auto;
  margin-left: auto;
}

.workspace-console .panel,
.workspace-console .stat,
.workspace-console .chat-relay,
.workspace-console .skill-center-head > div {
  border-color: var(--ref-border);
  border-radius: 8px;
  background: var(--ref-surface);
  box-shadow: var(--ref-shadow);
}

.workspace-console .panel {
  padding: 20px;
}

.workspace-console .input,
.workspace-console .select,
.workspace-console .textarea,
.workspace-console .chat-composer textarea,
.workspace-console .dev-api-field textarea {
  min-height: 43px;
  border-color: var(--ref-border-strong);
  border-radius: 8px;
  background: var(--ref-surface);
  color: var(--ref-text);
}

.workspace-console .textarea,
.workspace-console textarea {
  line-height: 1.65;
}

.workspace-console .input:focus,
.workspace-console .select:focus,
.workspace-console .textarea:focus,
.workspace-console textarea:focus {
  border-color: var(--ref-primary);
  box-shadow: 0 0 0 3px rgba(223, 103, 43, .13);
  outline: 0;
}

.workspace-console button:focus-visible,
.workspace-console a:focus-visible,
.workspace-console summary:focus-visible {
  outline: 3px solid rgba(223, 103, 43, .2);
  outline-offset: 2px;
}

.workspace-console .table-wrap {
  border-color: var(--ref-border);
  border-radius: 8px;
}

.workspace-console th {
  background: var(--ref-surface-soft);
}

.workspace-console .site-footer {
  min-height: 42px;
  margin: 0;
  padding: 8px 24px;
  border: 0;
  border-top: 1px solid var(--ref-border);
  border-radius: 0;
  background: var(--ref-surface);
  box-shadow: none;
}

.workspace-console.workspace-collapsed {
  grid-template-columns: 72px minmax(0, 1fr);
}

.workspace-console.light-mode.workspace-collapsed {
  grid-template-columns: 72px minmax(0, 1fr);
}

.workspace-console.workspace-collapsed .sidebar {
  padding-right: 8px;
  padding-left: 8px;
}

.workspace-console.workspace-collapsed .brand {
  min-height: 64px;
  margin-right: 0;
  margin-left: 0;
  padding-right: 0;
  padding-left: 0;
}

.workspace-console.workspace-collapsed .brand img {
  width: 40px;
  height: 40px;
  flex-basis: 40px;
}

/*
 * The previous theme intentionally used highly specific light-mode rules.
 * Mirror that specificity here so the reference layer replaces, rather than
 * merely supplements, the former floating-shell treatment.
 */
.workspace-console.light-mode .sidebar {
  width: auto;
  height: 100vh;
  height: 100dvh;
  margin: 0;
  padding: 16px 13px 12px;
  border: 0;
  border-right: 1px solid var(--ref-border);
  border-radius: 0;
  background: var(--ref-surface);
  box-shadow: none;
  backdrop-filter: none;
}

.workspace-console.light-mode.workspace-collapsed .sidebar {
  padding-right: 8px;
  padding-left: 8px;
}

.workspace-console.light-mode .brand {
  min-height: 76px;
  margin: 0 5px 8px;
  padding: 7px 6px 15px;
  border-bottom-color: var(--ref-border);
}

.workspace-console.light-mode.workspace-collapsed .brand {
  min-height: 64px;
  margin-right: 0;
  margin-left: 0;
  padding-right: 0;
  padding-left: 0;
}

.workspace-console.light-mode .brand img {
  border-color: var(--ref-border);
  box-shadow: 0 3px 10px rgba(39, 65, 53, .08);
}

.workspace-console.light-mode .brand strong {
  color: var(--ref-text);
}

.workspace-console.light-mode .brand span,
.workspace-console.light-mode .nav-section-label {
  color: #9099a7;
}

.workspace-console.light-mode .nav button,
.workspace-console.light-mode .nav-sub .nav-link {
  color: #687481;
}

.workspace-console.light-mode .nav button:hover,
.workspace-console.light-mode .nav-sub .nav-link:hover {
  border-color: transparent;
  background: var(--ref-surface-hover);
  color: var(--ref-text);
}

.workspace-console.light-mode .nav button:hover .nav-icon {
  color: currentColor;
}

.workspace-console.light-mode .nav button.active,
.workspace-console.light-mode .nav .nav-link.active,
.workspace-console.light-mode .nav-parent-active,
.workspace-console.light-mode .nav-group.open .nav-group-toggle {
  border-color: rgba(223, 103, 43, .13);
  background: var(--ref-primary-soft);
  color: var(--ref-primary);
  box-shadow: none;
}

.workspace-console.light-mode .nav button.active .nav-icon,
.workspace-console.light-mode .nav .nav-link.active .nav-icon,
.workspace-console.light-mode .nav-parent-active .nav-icon {
  color: currentColor;
}

.workspace-console.light-mode .workspace-sidebar-foot {
  border-top-color: var(--ref-border);
}

.workspace-console.light-mode .workspace-avatar {
  border-color: rgba(20, 130, 96, .25);
  background: var(--ref-green-soft);
  color: var(--ref-green);
}

.workspace-console.light-mode .main {
  grid-template-rows: 68px minmax(0, 1fr);
  background: var(--ref-page);
}

.workspace-console.light-mode .topbar {
  position: relative;
  top: 0;
  width: auto;
  height: 68px;
  min-height: 68px;
  margin: 0;
  padding: 0 24px;
  border: 0;
  border-bottom: 1px solid var(--ref-border);
  border-radius: 0;
  background: rgba(255, 255, 255, .96);
  box-shadow: none;
  backdrop-filter: none;
}

.workspace-console.light-mode .topbar .workspace-page-heading strong {
  color: var(--ref-text);
}

.workspace-console.light-mode .content {
  padding: 24px 26px 32px;
  background: var(--ref-page);
}

.workspace-console.light-mode .site-footer {
  min-height: 42px;
  margin: 0;
  padding: 8px 24px;
  border: 0;
  border-top: 1px solid var(--ref-border);
  border-radius: 0;
  background: var(--ref-surface);
  box-shadow: none;
}

.workspace-console.light-mode .workspace-icon-button,
.workspace-console.light-mode .workspace-user-button,
.workspace-console.light-mode .btn.ghost {
  border-color: var(--ref-border);
  background: var(--ref-surface);
  color: var(--ref-text);
}

.workspace-console.light-mode .workspace-balance {
  border-color: rgba(223, 103, 43, .2);
  background: var(--ref-primary-soft);
  color: var(--ref-primary);
}

.workspace-console.light-mode .btn.primary {
  border-color: var(--ref-primary);
  background: var(--ref-primary);
  color: #fff;
  box-shadow: 0 6px 16px rgba(210, 82, 20, .15);
}

.workspace-console.light-mode .btn.primary:hover:not(:disabled) {
  border-color: var(--ref-primary-hover);
  background: var(--ref-primary-hover);
  color: #fff;
  box-shadow: 0 8px 20px rgba(210, 82, 20, .2);
}

.workspace-console.light-mode .stat,
.workspace-console.light-mode .panel,
.workspace-console.light-mode .chat-relay,
.workspace-console.light-mode .skill-center-head > div,
.workspace-console.light-mode .workspace-commandbar {
  border-color: var(--ref-border);
  background: var(--ref-surface);
  box-shadow: var(--ref-shadow);
  backdrop-filter: none;
}

.workspace-console.light-mode .input:focus,
.workspace-console.light-mode .select:focus,
.workspace-console.light-mode .textarea:focus,
.workspace-console.light-mode .chat-composer textarea:focus {
  border-color: var(--ref-primary);
  box-shadow: 0 0 0 3px rgba(223, 103, 43, .13);
}

.workspace-console.light-mode button:focus-visible,
.workspace-console.light-mode a:focus-visible,
.workspace-console.light-mode input:focus-visible,
.workspace-console.light-mode select:focus-visible,
.workspace-console.light-mode textarea:focus-visible {
  outline-color: rgba(223, 103, 43, .45);
}

/* ---------- User dashboard ---------- */

.workspace-console .dashboard-redesign {
  max-width: 1540px;
  min-height: 0;
  margin: -16px -18px -28px;
  padding: 20px 20px 34px;
  gap: 16px;
  background: var(--ref-page);
}

.workspace-console .dashboard-stat-grid {
  gap: 13px;
}

.workspace-console .dashboard-stat {
  min-width: 0;
  min-height: 108px;
  padding: 17px;
  gap: 13px;
  overflow: hidden;
  border-color: var(--ref-border);
  border-radius: 8px;
  background: var(--ref-surface);
  box-shadow: var(--ref-shadow);
}

.workspace-console .dashboard-stat::before {
  height: 3px;
  background: var(--ref-green);
}

.workspace-console .dashboard-stat-blue::before { background: var(--ref-blue); }
.workspace-console .dashboard-stat-purple::before { background: var(--ref-violet); }
.workspace-console .dashboard-stat-amber::before { background: var(--ref-amber); }

.workspace-console .dashboard-stat:hover {
  transform: none;
  border-color: var(--ref-border-strong);
  box-shadow: 0 8px 24px rgba(30, 47, 60, .08);
}

.workspace-console .dashboard-stat-icon {
  width: 40px;
  height: 40px;
  flex-basis: 40px;
  border-radius: 8px;
}

.workspace-console .dashboard-stat-green .dashboard-stat-icon {
  background: var(--ref-green-soft);
  color: var(--ref-green);
}

.workspace-console .dashboard-stat-blue .dashboard-stat-icon {
  background: var(--ref-blue-soft);
  color: var(--ref-blue);
}

.workspace-console .dashboard-stat-purple .dashboard-stat-icon {
  background: var(--ref-violet-soft);
  color: var(--ref-violet);
}

.workspace-console .dashboard-stat-amber .dashboard-stat-icon {
  background: var(--ref-amber-soft);
  color: var(--ref-amber);
}

.workspace-console .dashboard-stat span,
.workspace-console .dashboard-stat small {
  color: var(--ref-muted);
}

.workspace-console .dashboard-stat strong {
  color: var(--ref-text);
  font-size: 22px;
  line-height: 1.2;
}

.workspace-console .dashboard-surface {
  min-width: 0;
  padding: 19px;
  border-color: var(--ref-border);
  border-radius: 8px;
  background: var(--ref-surface);
  box-shadow: var(--ref-shadow);
}

.workspace-console .dashboard-section-title {
  min-width: 0;
  margin-bottom: 14px;
}

.workspace-console .dashboard-section-title strong {
  color: var(--ref-text);
  font-size: 14px;
}

.workspace-console .dashboard-section-title small,
.workspace-console .dashboard-section-title > span,
.workspace-console .dashboard-range-summary {
  color: var(--ref-muted);
}

.workspace-console .dashboard-feature-list > div:not(.empty-state) {
  min-height: 44px;
  border-color: var(--ref-border);
}

.workspace-console .dashboard-feature-list strong {
  color: var(--ref-text);
}

.workspace-console .dashboard-feature-list > div > span:nth-child(3),
.workspace-console .dashboard-feature-list small {
  color: var(--ref-muted);
}

.workspace-console .dashboard-feature-track {
  height: 7px;
  background: var(--ref-surface-hover);
}

.workspace-console .dashboard-feature-track i {
  background: var(--ref-green);
}

.workspace-console .dashboard-filter-surface {
  padding: 11px 14px;
  box-shadow: none;
}

.workspace-console .dashboard-filter-surface > div {
  color: var(--ref-text);
}

.workspace-console .dashboard-select {
  border-color: var(--ref-border);
  background: var(--ref-surface);
}

.workspace-console .dashboard-select select {
  background: var(--ref-surface);
  color: var(--ref-text);
}

.workspace-console .dashboard-chart-grid,
.workspace-console .dashboard-account-grid {
  gap: 16px;
}

.workspace-console .dashboard-model-layout {
  grid-template-columns: 178px minmax(0, 1fr);
  gap: 17px;
}

.workspace-console .dashboard-donut {
  width: 164px;
  height: 164px;
}

.workspace-console .dashboard-donut > div {
  width: 98px;
  height: 98px;
  background: var(--ref-surface);
}

.workspace-console .dashboard-donut strong {
  max-width: 82px;
  overflow-wrap: anywhere;
  color: var(--ref-text);
  font-size: 18px;
}

.workspace-console .dashboard-donut span,
.workspace-console .dashboard-model-head,
.workspace-console .dashboard-trend-total,
.workspace-console .dashboard-legend {
  color: var(--ref-muted);
}

.workspace-console .dashboard-model-head,
.workspace-console .dashboard-model-row {
  min-width: 0;
  padding: 8px 0;
  border-color: var(--ref-border);
}

.workspace-console .dashboard-trend-svg {
  width: 100%;
  height: 232px;
  min-height: 232px;
  display: block;
}

.workspace-console .dashboard-trend-svg line {
  stroke: var(--ref-border);
}

.workspace-console .dashboard-trend-svg text {
  fill: var(--ref-muted);
}

.workspace-console .dashboard-trend-total {
  margin-top: -18px;
}

.workspace-console .dashboard-quick-surface {
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.workspace-console .dashboard-quick-surface .dashboard-section-title {
  margin: 0 0 12px;
  padding-left: 11px;
  border-left: 3px solid var(--ref-primary);
}

.workspace-console .dashboard-quick-actions {
  gap: 11px;
}

.workspace-console .dashboard-quick-actions button {
  min-width: 0;
  min-height: 86px;
  padding: 12px 9px;
  flex-direction: column;
  gap: 8px;
  border-color: var(--ref-border);
  border-radius: 8px;
  background: var(--ref-surface);
  color: var(--ref-text);
  box-shadow: var(--ref-shadow);
}

.workspace-console .dashboard-quick-actions button:hover {
  transform: none;
  border-color: var(--ref-border-strong);
  background: var(--ref-surface);
}

.workspace-console .dashboard-quick-actions svg {
  width: 20px;
  height: 20px;
  padding: 8px;
  box-sizing: content-box;
  border-radius: 8px;
  background: var(--ref-blue-soft);
  color: var(--ref-blue);
}

.workspace-console .dashboard-quick-actions button:nth-child(2) svg {
  background: var(--ref-violet-soft);
  color: var(--ref-violet);
}

.workspace-console .dashboard-quick-actions button:nth-child(3) svg {
  background: var(--ref-green-soft);
  color: var(--ref-green);
}

.workspace-console .dashboard-quick-actions button:nth-child(4) svg {
  background: var(--ref-amber-soft);
  color: var(--ref-amber);
}

.workspace-console .dashboard-quick-actions button:nth-child(5) svg {
  background: #e8f8fb;
  color: #167b8c;
}

.workspace-console .dashboard-quick-actions button:nth-child(6) svg {
  background: var(--ref-red-soft);
  color: var(--ref-red);
}

.workspace-console:not(.light-mode) .dashboard-quick-actions button:nth-child(5) svg {
  background: rgba(22, 123, 140, .16);
  color: #72c8d5;
}

.workspace-console .dashboard-account-list > div,
.workspace-console .dashboard-recent-list > div:not(.empty-state) {
  border-color: var(--ref-border);
}

.workspace-console .dashboard-account-list dt,
.workspace-console .dashboard-recent-list small {
  color: var(--ref-muted);
}

.workspace-console .dashboard-account-list dd,
.workspace-console .dashboard-recent-list strong {
  color: var(--ref-text);
}

/* ---------- Paper agent ---------- */

.workspace-console .paper-agent {
  width: 100%;
  max-width: 1180px;
  margin-right: auto;
  margin-left: auto;
  gap: 15px;
}

.workspace-console .paper-agent > .paper-agent-hero,
.workspace-console .paper-agent > .paper-agent-workbench {
  width: min(100%, 880px);
  margin-right: auto;
  margin-left: auto;
}

.workspace-console .paper-agent-hero {
  position: relative;
  min-width: 0;
  padding: 21px 22px;
  overflow: hidden;
  border-color: var(--ref-border);
  border-radius: 8px;
  background: var(--ref-surface);
  box-shadow: var(--ref-shadow);
}

.workspace-console .paper-agent-hero::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  content: "";
  background: var(--ref-primary);
}

.workspace-console .paper-agent-hero > div:first-child {
  min-width: 0;
}

.workspace-console .paper-agent-eyebrow {
  margin-bottom: 6px;
  color: var(--ref-primary);
}

.workspace-console .paper-agent-hero h2 {
  color: var(--ref-text);
  font-size: 21px;
  line-height: 1.35;
}

.workspace-console .paper-agent-hero p {
  max-width: 650px;
  margin-top: 6px;
  color: var(--ref-muted);
  line-height: 1.62;
}

.workspace-console .paper-agent-price {
  min-width: 178px;
  padding: 4px 0 4px 18px;
  border: 0;
  border-left: 1px solid var(--ref-border);
  border-radius: 0;
  background: transparent;
}

.workspace-console .paper-agent-price span,
.workspace-console .paper-agent-price small {
  color: var(--ref-muted);
}

.workspace-console .paper-agent-price strong {
  margin: 5px 0;
  color: var(--ref-primary);
  font-size: 16px;
}

.workspace-console .paper-agent-workbench {
  padding: 22px;
  border-radius: 8px;
}

.workspace-console .paper-billing-switch {
  gap: 8px;
  margin-bottom: 11px;
  padding: 4px;
  border: 1px solid var(--ref-border);
  border-radius: 8px;
  background: var(--ref-surface-soft);
}

.workspace-console .paper-billing-switch label > span {
  min-height: 66px;
  padding: 10px 12px;
  border-color: transparent;
  border-radius: 6px;
  background: transparent;
}

.workspace-console .paper-billing-switch label.active > span {
  border-color: rgba(223, 103, 43, .18);
  background: var(--ref-surface);
  box-shadow: 0 2px 8px rgba(30, 47, 60, .06);
}

.workspace-console .paper-billing-switch label.active strong {
  color: var(--ref-primary);
}

.workspace-console .paper-billing-switch small,
.workspace-console .paper-billing-note small,
.workspace-console .paper-billing-note span {
  color: var(--ref-muted);
}

.workspace-console .paper-billing-note {
  margin-bottom: 14px;
  padding: 11px 13px;
  border: 0;
  border-left: 3px solid var(--ref-green);
  border-radius: 0 7px 7px 0;
  background: var(--ref-green-soft);
}

.workspace-console .paper-billing-note.is-draft {
  border-left-color: var(--ref-amber);
  background: var(--ref-amber-soft);
}

.workspace-console .paper-agent-models {
  gap: 9px;
  margin-bottom: 14px;
}

.workspace-console .paper-agent-models label {
  min-height: 74px;
  padding: 12px;
  border-color: var(--ref-border);
  border-radius: 8px;
  background: var(--ref-surface);
}

.workspace-console .paper-agent-models label:hover {
  border-color: var(--ref-border-strong);
}

.workspace-console .paper-agent-models label.active {
  border-color: rgba(223, 103, 43, .5);
  background: var(--ref-primary-soft);
  box-shadow: inset 0 0 0 1px rgba(223, 103, 43, .12);
}

.workspace-console .paper-agent-models span {
  color: var(--ref-muted);
}

.workspace-console .paper-agent-models b {
  color: var(--ref-primary);
}

.workspace-console .paper-agent-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 13px 14px;
}

.workspace-console .paper-agent-grid .field {
  min-width: 0;
  gap: 7px;
  color: var(--ref-text);
  font-size: 13px;
  font-weight: 700;
}

.workspace-console .paper-agent-grid .field > small {
  color: var(--ref-muted);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.55;
}

.workspace-console .paper-agent-grid .input,
.workspace-console .paper-agent-grid .select {
  min-height: 44px;
}

.workspace-console .paper-agent-grid .textarea {
  min-height: 116px;
}

.workspace-console .software-source-panel,
.workspace-console .software-mechanical-panel {
  padding: 14px;
  border: 0;
  border-left: 3px solid var(--ref-green);
  border-radius: 0 7px 7px 0;
  background: var(--ref-surface-soft);
}

.workspace-console .paper-upload-zone {
  min-height: 126px;
  padding: 18px;
  gap: 7px;
  border: 1px dashed #b9c7c1;
  border-radius: 8px;
  background: var(--ref-surface-soft);
  color: var(--ref-muted);
  box-shadow: none;
}

.workspace-console .paper-upload-zone:hover,
.workspace-console .paper-upload-zone.dragging {
  border-color: var(--ref-primary);
  background: var(--ref-primary-soft);
  box-shadow: inset 0 0 0 1px rgba(223, 103, 43, .08);
}

.workspace-console .paper-upload-zone strong {
  color: var(--ref-text);
  font-size: 14px;
}

.workspace-console .paper-upload-zone small {
  max-width: 680px;
  color: var(--ref-muted);
}

.workspace-console .paper-upload-zone-compact {
  min-height: 104px;
  padding: 14px;
}

.workspace-console .paper-upload-mark {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: var(--ref-primary-soft);
  color: var(--ref-primary);
  box-shadow: none;
}

.workspace-console .paper-upload-mark svg {
  width: 22px;
  height: 22px;
}

.workspace-console .paper-upload-file-card {
  border-color: var(--ref-border);
  border-radius: 7px;
  background: var(--ref-surface);
}

.workspace-console .paper-agent-note {
  border: 0;
  border-left: 3px solid var(--ref-blue);
  border-radius: 0 7px 7px 0;
  background: var(--ref-blue-soft);
  color: var(--ref-blue);
}

.workspace-console .paper-agent-advanced {
  border-color: var(--ref-border);
  border-radius: 8px;
  background: var(--ref-surface);
}

.workspace-console .paper-agent-advanced summary {
  min-height: 46px;
  color: var(--ref-text);
}

.workspace-console .paper-agent-advanced-body {
  border-color: var(--ref-border);
  border-radius: 0 0 8px 8px;
  background: var(--ref-surface-soft);
}

.workspace-console .paper-agent-actions {
  position: sticky;
  bottom: 0;
  z-index: 5;
  min-width: 0;
  margin: 20px -22px -22px;
  padding: 13px 22px;
  border-top: 1px solid var(--ref-border);
  border-radius: 0 0 8px 8px;
  background: rgba(255, 255, 255, .97);
  color: var(--ref-muted);
}

.workspace-console:not(.light-mode) .paper-agent-actions {
  background: rgba(24, 30, 35, .97);
}

.workspace-console .paper-agent-actions > span {
  min-width: 0;
  line-height: 1.5;
}

.workspace-console .paper-agent-actions .btn {
  min-height: 46px;
  flex: 0 0 auto;
}

/* ---------- Responsive workspace ---------- */

@media (max-width: 1180px) {
  .workspace-console .content {
    padding: 21px 20px 30px;
  }

  .workspace-console.light-mode .content {
    padding: 21px 20px 30px;
  }

  .workspace-console .dashboard-redesign {
    margin-right: -14px;
    margin-left: -14px;
  }

  .workspace-console .dashboard-model-layout {
    grid-template-columns: 150px minmax(0, 1fr);
  }

  .workspace-console .dashboard-donut {
    width: 144px;
    height: 144px;
  }

  .workspace-console .dashboard-donut > div {
    width: 86px;
    height: 86px;
  }
}

@media (max-width: 900px) {
  body.workspace-active {
    overflow: auto;
  }

  .workspace-console,
  .workspace-console.workspace-collapsed {
    display: block;
    height: auto;
    min-height: 100vh;
    min-height: 100dvh;
    overflow: visible;
  }

  .workspace-console .sidebar,
  .workspace-console.workspace-collapsed .sidebar {
    width: min(288px, calc(100vw - 44px));
    height: 100vh;
    height: 100dvh;
    padding: 14px 11px 11px;
    border-right: 1px solid var(--ref-border);
    box-shadow: 18px 0 46px rgba(15, 29, 35, .18);
  }

  .workspace-console.light-mode .sidebar,
  .workspace-console.light-mode.workspace-collapsed .sidebar {
    width: min(288px, calc(100vw - 44px));
    height: 100vh;
    height: 100dvh;
    margin: 0;
    padding: 14px 11px 11px;
    border: 0;
    border-right: 1px solid var(--ref-border);
    border-radius: 0;
    box-shadow: 18px 0 46px rgba(15, 29, 35, .18);
  }

  .workspace-console.workspace-collapsed .brand {
    min-height: 76px;
    margin: 0 5px 8px;
    padding: 7px 6px 15px;
  }

  .workspace-console.light-mode.workspace-collapsed .brand {
    min-height: 76px;
    margin: 0 5px 8px;
    padding: 7px 6px 15px;
  }

  .workspace-console.workspace-collapsed .brand img {
    width: 44px;
    height: 44px;
    flex-basis: 44px;
  }

  .workspace-console.light-mode.workspace-collapsed .brand img {
    width: 44px;
    height: 44px;
    flex-basis: 44px;
  }

  .workspace-console .nav-backdrop {
    background: rgba(14, 24, 29, .54);
  }

  .workspace-console .main {
    width: 100%;
    height: auto;
    min-height: 100vh;
    min-height: 100dvh;
    grid-template-rows: 64px auto;
    overflow: visible;
  }

  .workspace-console.light-mode .main {
    grid-template-rows: 64px auto;
  }

  .workspace-console .topbar {
    position: sticky;
    height: 64px;
    min-height: 64px;
    padding: 0 14px;
  }

  .workspace-console.light-mode .topbar {
    position: sticky;
    top: 0;
    height: 64px;
    min-height: 64px;
    margin: 0;
    padding: 0 14px;
    border-radius: 0;
  }

  .workspace-main-scroll {
    display: block;
    overflow: visible;
  }

  .workspace-console .content {
    min-height: calc(100vh - 106px);
    min-height: calc(100dvh - 106px);
    padding: 17px 14px 26px;
    overflow: visible;
  }

  .workspace-console.light-mode .content {
    min-height: calc(100vh - 106px);
    min-height: calc(100dvh - 106px);
    padding: 17px 14px 26px;
  }

  .workspace-console .dashboard-redesign {
    margin: -12px -10px -22px;
    padding: 16px 12px 28px;
  }

  .workspace-console .dashboard-chart-grid,
  .workspace-console .dashboard-account-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .workspace-console .dashboard-model-layout {
    grid-template-columns: 178px minmax(0, 1fr);
  }

  .workspace-console .site-footer {
    padding: 9px 14px;
  }

  .workspace-console.light-mode .site-footer {
    margin: 0;
    padding: 9px 14px;
  }
}

@media (max-width: 760px) {
  .workspace-console .dashboard-stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
  }

  .workspace-console .dashboard-stat {
    min-height: 94px;
    padding: 13px 11px;
    gap: 9px;
  }

  .workspace-console .dashboard-stat-icon {
    width: 34px;
    height: 34px;
    flex-basis: 34px;
  }

  .workspace-console .dashboard-stat strong {
    font-size: 18px;
  }

  .workspace-console .dashboard-surface {
    padding: 16px;
  }

  .workspace-console .dashboard-model-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .workspace-console .dashboard-donut {
    margin-right: auto;
    margin-left: auto;
  }

  .workspace-console .dashboard-quick-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .workspace-console .paper-agent > .paper-agent-hero,
  .workspace-console .paper-agent > .paper-agent-workbench {
    width: 100%;
  }

  .workspace-console .paper-agent-hero {
    align-items: flex-start;
    flex-direction: column;
  }

  .workspace-console .paper-agent-price {
    width: 100%;
    min-width: 0;
    padding: 10px 0 0;
    border-top: 1px solid var(--ref-border);
    border-left: 0;
  }

  .workspace-console .paper-agent-grid,
  .workspace-console .paper-agent-heading-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .workspace-console .paper-agent-grid .wide,
  .workspace-console .paper-agent-heading-row > * {
    grid-column: auto;
  }

  .workspace-console .paper-billing-note {
    align-items: flex-start;
    flex-direction: column;
    gap: 7px;
  }

  .workspace-console .paper-agent-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .workspace-console .paper-agent-actions .btn {
    width: 100%;
  }
}

@media (max-width: 560px) {
  .workspace-console .topbar {
    gap: 7px;
    padding: 0 9px;
  }

  .workspace-console.light-mode .topbar {
    gap: 7px;
    padding: 0 9px;
  }

  .workspace-console .topbar .workspace-page-heading strong {
    max-width: 32vw;
    font-size: 15px;
  }

  .workspace-console .topbar .workspace-page-heading small,
  .workspace-console #quick-recharge {
    display: none;
  }

  .workspace-console .workspace-topbar-actions {
    gap: 5px;
  }

  .workspace-console .workspace-icon-button {
    width: 36px;
    height: 36px;
    flex-basis: 36px;
  }

  .workspace-console .workspace-balance {
    min-height: 36px;
    padding-right: 8px;
    padding-left: 8px;
  }

  .workspace-console .content {
    padding: 13px 9px 23px;
  }

  .workspace-console.light-mode .content {
    padding: 13px 9px 23px;
  }

  .workspace-console .panel,
  .workspace-console .paper-agent-workbench {
    padding: 16px;
  }

  .workspace-console.light-mode .paper-agent-workbench {
    padding: 16px;
  }

  .workspace-console .dashboard-redesign {
    margin: -9px -7px -20px;
    padding: 13px 9px 25px;
    gap: 12px;
  }

  .workspace-console .dashboard-surface {
    padding: 14px;
  }

  .workspace-console .dashboard-feature-list > div:not(.empty-state) {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "name amount"
      "track share";
    gap: 6px 9px;
    min-height: 58px;
    padding: 8px 0;
  }

  .workspace-console .dashboard-feature-list > div > strong {
    grid-area: name;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .workspace-console .dashboard-feature-list > div > span.dashboard-feature-track {
    grid-area: track;
    width: 100%;
  }

  .workspace-console .dashboard-feature-list > div > span:nth-child(3) {
    grid-area: amount;
    font-size: 11px;
  }

  .workspace-console .dashboard-feature-list > div > small {
    display: block;
    grid-area: share;
  }

  .workspace-console .dashboard-model-head,
  .workspace-console .dashboard-model-row {
    min-width: 0;
    grid-template-columns: minmax(0, 1fr) minmax(72px, auto);
  }

  .workspace-console .dashboard-model-head > span:nth-child(2),
  .workspace-console .dashboard-model-row > span:nth-child(2),
  .workspace-console .dashboard-model-head > span:nth-child(4),
  .workspace-console .dashboard-model-row > span:nth-child(4) {
    display: none;
  }

  .workspace-console .dashboard-trend-svg {
    height: 210px;
    min-height: 210px;
  }

  .workspace-console .paper-agent-hero {
    padding: 17px 16px;
  }

  .workspace-console .paper-agent-hero h2 {
    font-size: 19px;
  }

  .workspace-console .paper-billing-switch {
    grid-template-columns: minmax(0, 1fr);
  }

  .workspace-console .paper-agent-actions {
    margin: 18px -16px -16px;
    padding: 12px 16px;
  }
}

@media (max-width: 360px) {
  .workspace-console .dashboard-stat-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .workspace-console .dashboard-quick-actions {
    grid-template-columns: minmax(0, 1fr);
  }

  .workspace-console #quick-profile {
    display: none;
  }
}

/* ---------- Responsive login ---------- */

@media (max-width: 920px) {
  .carrot-login-page {
    padding: 34px 24px;
    overflow-y: auto;
  }

  .carrot-login-shell {
    width: min(500px, 100%);
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }

  .carrot-login-story {
    display: none;
  }

  .carrot-login-mobile-brand {
    margin-bottom: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: #17211e;
  }

  .carrot-login-mobile-brand img {
    width: 42px;
    height: 42px;
    border: 1px solid #e1e7e4;
    border-radius: 10px;
    background: #fff;
    object-fit: cover;
  }

  .carrot-login-mobile-brand strong {
    font-size: 20px;
  }
}

@media (max-width: 480px) {
  .carrot-login-page {
    padding: 16px;
    place-items: center;
  }

  .carrot-login-card {
    padding: 23px 20px 21px;
    border-radius: 16px;
  }

  .carrot-login-mobile-brand {
    margin-bottom: 17px;
  }

  .carrot-login-card-head {
    margin-bottom: 19px;
  }

  .carrot-login-card-head h2 {
    font-size: 23px;
  }

  .carrot-login-card-head p {
    font-size: 13px;
  }

  .carrot-auth-control,
  .carrot-login-submit,
  .carrot-wechat-login {
    min-height: 48px;
  }

  .carrot-auth-control input {
    height: 46px;
  }

  .carrot-login-divider {
    margin-top: 17px;
  }
}

/* ---------- Carrot paper controls v3: reference input and upload language ---------- */

.workspace-console .paper-agent {
  --paper-control-bg: #ffffff;
  --paper-control-border: #dce2e9;
  --paper-control-border-hover: #c7d0da;
  --paper-control-placeholder: #667085;
  --paper-control-action: #a84715;
  --paper-upload-border: #cbd3dd;
}

.workspace-console:not(.light-mode) .paper-agent {
  --paper-control-bg: var(--ref-surface);
  --paper-control-border: var(--ref-border-strong);
  --paper-control-border-hover: #5c6974;
  --paper-control-placeholder: #7f8c96;
  --paper-control-action: #f2a16f;
  --paper-upload-border: #596670;
}

.workspace-console .paper-agent .paper-agent-grid .field {
  gap: 9px;
  color: var(--ref-text);
  font-size: 14px;
  font-weight: 650;
  line-height: 1.45;
}

.workspace-console .paper-agent .paper-agent-grid .field > small,
.workspace-console .paper-agent .software-source-note {
  color: var(--ref-muted);
  font-size: 12px;
  font-weight: 450;
  line-height: 1.6;
}

.workspace-console .paper-agent .input:not([type="file"]),
.workspace-console .paper-agent .select,
.workspace-console .paper-agent .textarea {
  width: 100%;
  max-width: 100%;
  border: 2px solid var(--paper-control-border);
  border-radius: 8px;
  background: var(--paper-control-bg);
  color: var(--ref-text);
  box-shadow: none;
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}

.workspace-console .paper-agent .input:not([type="file"]),
.workspace-console .paper-agent .select {
  height: 48px;
  min-height: 48px;
  padding: 0 15px;
}

.workspace-console .paper-agent select.input,
.workspace-console .paper-agent select.select {
  padding-right: 42px;
  cursor: pointer;
}

.workspace-console .paper-agent .textarea {
  min-height: 136px;
  padding: 13px 15px;
  line-height: 1.65;
  resize: vertical;
  scrollbar-color: var(--paper-control-border-hover) transparent;
  scrollbar-width: thin;
}

.workspace-console .paper-agent .input:not([type="file"])::placeholder,
.workspace-console .paper-agent .textarea::placeholder {
  color: var(--paper-control-placeholder);
  opacity: 1;
}

.workspace-console .paper-agent .input:not([type="file"]):hover,
.workspace-console .paper-agent .select:hover,
.workspace-console .paper-agent .textarea:hover {
  border-color: var(--paper-control-border-hover);
}

.workspace-console .paper-agent .input:not([type="file"]):focus,
.workspace-console .paper-agent .select:focus,
.workspace-console .paper-agent .textarea:focus {
  border-color: var(--ref-primary);
  outline: 0;
  box-shadow: 0 0 0 3px rgba(223, 103, 43, .12);
}

.workspace-console .paper-agent .input:not([type="file"])[aria-invalid="true"],
.workspace-console .paper-agent .select[aria-invalid="true"],
.workspace-console .paper-agent .textarea[aria-invalid="true"],
.workspace-console .paper-agent .input:not([type="file"]).invalid,
.workspace-console .paper-agent .select.invalid,
.workspace-console .paper-agent .textarea.invalid,
.workspace-console .paper-agent .field.has-error .input,
.workspace-console .paper-agent .field.has-error .textarea {
  border-color: var(--ref-red);
  box-shadow: 0 0 0 3px rgba(211, 73, 73, .1);
}

.workspace-console .paper-agent .input:not([type="file"]):disabled,
.workspace-console .paper-agent .select:disabled,
.workspace-console .paper-agent .textarea:disabled,
.workspace-console .paper-agent .input:not([type="file"])[readonly] {
  border-color: var(--ref-border);
  background: var(--ref-surface-soft);
  color: var(--ref-muted);
  cursor: not-allowed;
}

.workspace-console .paper-agent input.input[type="file"] {
  min-height: 48px;
  padding: 6px;
  border: 2px solid var(--paper-control-border);
  border-radius: 8px;
  background: var(--paper-control-bg);
  color: var(--ref-muted);
}

.workspace-console .paper-agent input.input[type="file"]::file-selector-button {
  min-height: 32px;
  margin-right: 10px;
  padding: 0 12px;
  border: 1px solid var(--ref-border);
  border-radius: 7px;
  background: var(--ref-surface-soft);
  color: var(--ref-text);
  font: inherit;
  cursor: pointer;
}

.workspace-console .paper-agent .paper-upload-zone,
.workspace-console .paper-agent .paper-upload-zone-compact {
  min-width: 0;
  min-height: 92px;
  padding: 15px 17px;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  grid-template-areas:
    "upload-icon upload-title"
    "upload-icon upload-detail";
  place-items: initial;
  align-items: center;
  column-gap: 13px;
  row-gap: 3px;
  border: 2px dashed var(--paper-upload-border);
  border-radius: 8px;
  background: var(--paper-control-bg);
  color: var(--ref-muted);
  box-shadow: none;
  text-align: left;
}

.workspace-console .paper-agent .paper-upload-zone:hover,
.workspace-console .paper-agent .paper-upload-zone.dragging,
.workspace-console .paper-agent .paper-upload-zone:focus-within {
  border-color: var(--ref-primary);
  background: var(--ref-primary-soft);
  box-shadow: 0 0 0 3px rgba(223, 103, 43, .08);
}

.workspace-console .paper-agent .paper-upload-zone.has-files {
  border-color: rgba(20, 130, 96, .55);
  background: var(--ref-green-soft);
  box-shadow: none;
}

.workspace-console .paper-agent .paper-upload-mark {
  grid-area: upload-icon;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--ref-primary-soft);
  color: var(--ref-primary);
}

.workspace-console .paper-agent .paper-upload-zone.has-files .paper-upload-mark {
  background: var(--ref-green);
  color: #fff;
}

.workspace-console .paper-agent .paper-upload-mark svg {
  width: 21px;
  height: 21px;
}

.workspace-console .paper-agent .paper-upload-zone > strong {
  grid-area: upload-title;
  align-self: end;
  color: var(--ref-text);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
}

.workspace-console .paper-agent .paper-upload-zone > small {
  grid-area: upload-detail;
  align-self: start;
  max-width: none;
  color: var(--ref-muted);
  font-size: 11px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.workspace-console .paper-agent .paper-upload-file-list {
  margin-top: 9px;
  gap: 7px;
}

.workspace-console .paper-agent .paper-upload-file-card {
  min-width: 0;
  min-height: 52px;
  padding: 8px 9px 8px 12px;
  border: 1px solid rgba(20, 130, 96, .24);
  border-radius: 8px;
  background: var(--ref-green-soft);
  box-shadow: none;
}

.workspace-console .paper-agent .paper-upload-file-card > div {
  min-width: 0;
}

.workspace-console .paper-agent .paper-upload-file-card strong {
  max-width: 100%;
  overflow: hidden;
  color: var(--ref-text);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace-console .paper-agent .paper-upload-file-card small {
  color: var(--ref-muted);
  font-size: 10px;
}

.workspace-console .paper-agent .paper-upload-file-card .btn {
  min-height: 34px;
  padding: 0 10px;
  border-color: rgba(211, 73, 73, .2);
  background: var(--ref-surface);
  color: var(--ref-red);
  font-size: 11px;
}

.workspace-console .paper-agent .software-source-panel {
  padding: 2px 0 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.workspace-console .paper-agent .software-source-heading {
  min-width: 0;
  margin-bottom: 11px;
  padding: 0;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
}

.workspace-console .paper-agent .software-source-heading > span {
  color: var(--ref-text);
  font-size: 14px;
  font-weight: 700;
}

.workspace-console .paper-agent .software-source-heading > small {
  color: var(--ref-muted);
  font-size: 11px;
  font-weight: 450;
  text-align: right;
}

.workspace-console .paper-agent .software-source-grid {
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
}

.workspace-console .paper-agent .software-source-upload {
  min-width: 0;
  min-height: 82px;
  padding: 13px 14px;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) minmax(72px, auto);
  align-items: center;
  gap: 12px;
  border: 2px dashed var(--paper-upload-border);
  border-radius: 8px;
  background: var(--paper-control-bg);
  color: var(--ref-text);
  box-shadow: none;
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}

.workspace-console .paper-agent .software-source-upload:hover,
.workspace-console .paper-agent .software-source-upload:focus-within {
  border-color: var(--ref-primary);
  background: var(--ref-primary-soft);
  box-shadow: 0 0 0 3px rgba(223, 103, 43, .08);
}

.workspace-console .paper-agent .software-source-upload.has-file {
  border-color: rgba(20, 130, 96, .55);
  background: var(--ref-green-soft);
  box-shadow: none;
}

.workspace-console .paper-agent .paper-upload-zone.has-files:focus-within,
.workspace-console .paper-agent .software-source-upload.has-file:focus-within {
  box-shadow: 0 0 0 3px rgba(223, 103, 43, .18);
}

.workspace-console .paper-agent .software-source-upload-icon {
  width: 42px;
  height: 42px;
  min-height: 42px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--ref-primary-soft);
  color: var(--ref-primary);
}

.workspace-console .paper-agent .software-source-upload.has-file .software-source-upload-icon {
  background: var(--ref-green);
  color: #fff;
}

.workspace-console .paper-agent .software-source-upload-icon svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.workspace-console .paper-agent .software-source-upload-copy {
  min-width: 0;
  min-height: 0;
  display: grid;
  gap: 4px;
  color: var(--ref-text);
}

.workspace-console .paper-agent .software-source-upload-copy strong {
  color: var(--ref-text);
  font-size: 13px;
  line-height: 1.35;
}

.workspace-console .paper-agent .software-source-upload-copy small {
  color: var(--ref-muted);
  font-size: 11px;
  font-weight: 450;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.workspace-console .paper-agent .software-source-upload em {
  min-width: 72px;
  max-width: 150px;
  padding: 8px 10px;
  overflow: hidden;
  border: 1px solid var(--ref-border);
  border-radius: 7px;
  background: var(--ref-surface-soft);
  color: var(--paper-control-action);
  font-size: 11px;
  font-style: normal;
  font-weight: 700;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace-console .paper-agent .software-source-upload.has-file em {
  border-color: rgba(20, 130, 96, .22);
  background: var(--ref-surface);
  color: var(--ref-green);
}

.workspace-console .paper-agent .paper-companion-options {
  margin-top: 10px;
  padding: 11px 12px;
  border: 1px solid var(--ref-border);
  border-radius: 8px;
  background: var(--ref-surface-soft);
}

@media (max-width: 560px) {
  .workspace-console .paper-agent .input:not([type="file"]),
  .workspace-console .paper-agent .select {
    height: 46px;
    min-height: 46px;
    padding-right: 13px;
    padding-left: 13px;
  }

  .workspace-console .paper-agent .textarea {
    min-height: 124px;
    padding: 12px 13px;
  }

  .workspace-console .paper-agent .paper-upload-zone,
  .workspace-console .paper-agent .paper-upload-zone-compact {
    min-height: 96px;
    padding: 14px;
    grid-template-columns: 38px minmax(0, 1fr);
    column-gap: 11px;
  }

  .workspace-console .paper-agent .paper-upload-mark {
    width: 38px;
    height: 38px;
  }

  .workspace-console .paper-agent .software-source-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .workspace-console .paper-agent .software-source-heading > small {
    text-align: left;
  }

  .workspace-console .paper-agent .software-source-upload {
    min-height: 108px;
    grid-template-columns: 38px minmax(0, 1fr);
    grid-template-areas:
      "source-icon source-copy"
      "source-action source-action";
    gap: 9px 11px;
  }

  .workspace-console .paper-agent .software-source-upload-icon {
    grid-area: source-icon;
    width: 38px;
    height: 38px;
    min-height: 38px;
  }

  .workspace-console .paper-agent .software-source-upload-copy {
    grid-area: source-copy;
  }

  .workspace-console .paper-agent .software-source-upload em {
    grid-area: source-action;
    width: 100%;
    max-width: none;
  }
}

@media (max-height: 690px) and (min-width: 921px) {
  .carrot-login-page {
    padding-top: 24px;
    padding-bottom: 24px;
    overflow-y: auto;
  }

  .carrot-login-story {
    min-height: 520px;
  }

  .carrot-login-message {
    padding-top: 25px;
    padding-bottom: 20px;
  }

  .carrot-login-message h1 {
    font-size: 33px;
  }

  .carrot-login-lead {
    margin-top: 12px;
    margin-bottom: 16px;
  }

  .carrot-login-benefits {
    gap: 8px;
  }

  .carrot-login-card {
    padding-top: 25px;
    padding-bottom: 22px;
  }

  .carrot-login-card-head {
    margin-bottom: 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .carrot-login-page *,
  .workspace-console *,
  .workspace-console *::before,
  .workspace-console *::after {
    scroll-behavior: auto;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

/* ---------- Carrot workspace v2: reference-aligned signed-in experience ---------- */

@media (min-width: 901px) {
  .workspace-console .main,
  .workspace-console.light-mode .main {
    grid-template-rows: minmax(0, 1fr);
  }

  .workspace-console .topbar,
  .workspace-console.light-mode .topbar {
    display: none;
  }

  .workspace-console .workspace-main-scroll {
    height: 100vh;
    height: 100dvh;
  }
}

.workspace-console .brand {
  min-height: 88px;
  padding: 8px 8px 18px;
}

.workspace-console .brand img {
  width: 52px;
  height: 52px;
  flex-basis: 52px;
  border-radius: 8px;
}

.workspace-console .brand strong {
  font-size: 19px;
}

.workspace-console .brand span {
  font-size: 11px;
}

.workspace-console .nav-section-label {
  height: 8px;
  padding: 0;
  overflow: hidden;
  color: transparent;
  font-size: 0;
}

.workspace-console .nav button,
.workspace-console .nav-sub .nav-link {
  min-height: 46px;
  font-size: 14px;
}

.workspace-console .nav-sub .nav-link {
  min-height: 38px;
  font-size: 13px;
}

.workspace-console .sidebar {
  padding-bottom: 10px;
}

.workspace-sidebar-foot {
  display: grid;
  gap: 8px;
  padding: 10px 3px 0;
}

.workspace-account-card {
  min-width: 0;
  padding: 8px;
  border: 1px solid rgba(50, 107, 212, .16);
  border-radius: 8px;
  background: linear-gradient(145deg, var(--ref-blue-soft), var(--ref-violet-soft));
}

.workspace-console:not(.light-mode) .workspace-account-card {
  background: var(--ref-surface-soft);
}

.workspace-account-card .workspace-account {
  width: 100%;
  min-height: 48px;
  padding: 4px;
  border: 0;
  background: transparent;
}

.workspace-account-card .workspace-account:hover {
  background: rgba(255, 255, 255, .5);
}

.workspace-sidebar-balance {
  width: 100%;
  min-height: 38px;
  margin-top: 4px;
  padding: 6px 9px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border: 1px solid rgba(255, 255, 255, .72);
  border-radius: 7px;
  background: rgba(255, 255, 255, .7);
  color: var(--ref-muted);
  font: inherit;
  cursor: pointer;
}

.workspace-console:not(.light-mode) .workspace-sidebar-balance {
  border-color: var(--ref-border);
  background: var(--ref-surface);
}

.workspace-sidebar-balance:hover {
  border-color: rgba(50, 107, 212, .26);
  background: var(--ref-surface);
}

.workspace-sidebar-balance span {
  font-size: 11px;
}

.workspace-sidebar-balance strong {
  min-width: 0;
  color: var(--ref-primary);
  font-size: 12px;
  white-space: nowrap;
}

.workspace-sidebar-balance b {
  font-size: 15px;
}

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

.workspace-sidebar-actions > button {
  position: relative;
  min-width: 0;
  min-height: 38px;
  padding: 7px 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid var(--ref-border);
  border-radius: 8px;
  background: var(--ref-surface);
  color: var(--ref-muted);
  font: inherit;
  font-size: 11px;
  cursor: pointer;
}

.workspace-sidebar-actions > button:hover {
  border-color: var(--ref-border-strong);
  background: var(--ref-surface-hover);
  color: var(--ref-text);
}

.workspace-sidebar-actions .nav-icon {
  width: 16px;
  height: 16px;
  flex-basis: 16px;
  color: currentColor;
}

.workspace-sidebar-actions .notice-unread-count {
  position: absolute;
  top: -6px;
  right: -5px;
}

.workspace-sidebar-actions .notice-unread-dot {
  position: absolute;
  top: 5px;
  right: 5px;
}

.workspace-sidebar-tools {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 0;
}

.workspace-sidebar-tools button {
  min-width: 0;
  padding: 5px;
  gap: 5px;
  font-size: 10px;
}

.workspace-sidebar-tools button svg {
  width: 15px;
  height: 15px;
}

.workspace-console.workspace-collapsed .workspace-account-card {
  padding: 4px;
  border-color: transparent;
  background: transparent;
}

.workspace-console.workspace-collapsed .workspace-account-card .workspace-account {
  justify-content: center;
}

.workspace-console.workspace-collapsed .workspace-sidebar-balance,
.workspace-console.workspace-collapsed .workspace-sidebar-actions span,
.workspace-console.workspace-collapsed .workspace-sidebar-tools span {
  display: none;
}

.workspace-console.workspace-collapsed .workspace-sidebar-actions {
  grid-template-columns: minmax(0, 1fr);
}

.workspace-console.workspace-collapsed .workspace-sidebar-actions > button,
.workspace-console.workspace-collapsed .workspace-sidebar-tools button {
  min-height: 38px;
}

.workspace-console.workspace-collapsed .workspace-sidebar-tools {
  grid-template-columns: minmax(0, 1fr);
}

.workspace-console .dashboard-redesign {
  max-width: 1540px;
  margin: 0;
  padding: 0 0 34px;
  display: grid;
  gap: 22px;
  background: transparent;
}

.workspace-console .dashboard-welcome {
  min-width: 0;
  min-height: 84px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.workspace-console .dashboard-welcome h1 {
  margin: 0;
  color: var(--ref-text);
  font-size: 25px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.workspace-console .dashboard-welcome p {
  margin: 7px 0 0;
  color: var(--ref-muted);
  font-size: 14px;
}

.workspace-console .dashboard-welcome-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.workspace-console .dashboard-welcome-actions .btn {
  gap: 7px;
}

.workspace-console .dashboard-welcome-actions .nav-icon {
  width: 17px;
  height: 17px;
}

.workspace-console .dashboard-primary-grid {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1.75fr) minmax(310px, .9fr);
  align-items: stretch;
  gap: 18px;
}

.workspace-console .dashboard-primary-grid > * {
  min-width: 0;
  min-height: 380px;
}

.workspace-console .dashboard-consumption-card,
.workspace-console .dashboard-announcement-card {
  padding: 22px;
  border-radius: 8px;
}

.workspace-console .dashboard-consumption-card {
  display: flex;
  flex-direction: column;
}

.workspace-console .dashboard-overview-head,
.workspace-console .dashboard-overview-title,
.workspace-console .dashboard-overview-title > span,
.workspace-console .dashboard-overview-controls,
.workspace-console .dashboard-announcement-head,
.workspace-console .dashboard-announcement-head > div {
  display: flex;
  align-items: center;
}

.workspace-console .dashboard-overview-head,
.workspace-console .dashboard-announcement-head {
  min-width: 0;
  justify-content: space-between;
  gap: 14px;
}

.workspace-console .dashboard-overview-title,
.workspace-console .dashboard-announcement-head > div {
  min-width: 0;
  gap: 10px;
}

.workspace-console .dashboard-overview-title > span,
.workspace-console .dashboard-announcement-head > div > span {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  justify-content: center;
  border-radius: 8px;
  background: var(--ref-green-soft);
  color: var(--ref-green);
}

.workspace-console .dashboard-announcement-head > div > span {
  background: var(--ref-blue-soft);
  color: var(--ref-blue);
}

.workspace-console .dashboard-overview-title .nav-icon,
.workspace-console .dashboard-announcement-head .nav-icon {
  width: 20px;
  height: 20px;
  color: currentColor;
}

.workspace-console .dashboard-overview-title > div {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.workspace-console .dashboard-overview-title strong,
.workspace-console .dashboard-announcement-head strong {
  color: var(--ref-text);
  font-size: 17px;
}

.workspace-console .dashboard-overview-title small {
  color: var(--ref-muted);
  font-size: 11px;
}

.workspace-console .dashboard-overview-controls {
  gap: 7px;
}

.workspace-console .dashboard-overview-controls .workspace-icon-button {
  width: 38px;
  height: 38px;
  flex-basis: 38px;
}

.workspace-console .dashboard-overview-metrics {
  min-width: 0;
  margin: 17px 0 14px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.workspace-console .dashboard-mini-metric {
  min-width: 0;
  min-height: 70px;
  padding: 11px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-radius: 8px;
  background: var(--ref-blue-soft);
}

.workspace-console .dashboard-mini-metric.is-amber { background: var(--ref-amber-soft); }
.workspace-console .dashboard-mini-metric.is-green { background: var(--ref-green-soft); }

.workspace-console .dashboard-mini-metric > span {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--ref-blue);
  color: #fff;
}

.workspace-console .dashboard-mini-metric.is-amber > span { background: var(--ref-amber); }
.workspace-console .dashboard-mini-metric.is-green > span { background: var(--ref-green); }

.workspace-console .dashboard-mini-metric .nav-icon {
  width: 18px;
  height: 18px;
  color: currentColor;
}

.workspace-console .dashboard-mini-metric > div {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.workspace-console .dashboard-mini-metric small {
  color: var(--ref-muted);
  font-size: 11px;
}

.workspace-console .dashboard-mini-metric strong {
  min-width: 0;
  overflow: hidden;
  color: var(--ref-text);
  font-size: 17px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace-console .dashboard-overview-body {
  min-width: 0;
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(190px, .72fr);
  gap: 18px;
}

.workspace-console .dashboard-overview-chart {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.workspace-console .dashboard-chart-caption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--ref-muted);
  font-size: 11px;
}

.workspace-console .dashboard-chart-caption span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.workspace-console .dashboard-chart-caption i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ref-green);
}

.workspace-console .dashboard-chart-caption strong {
  color: var(--ref-text);
  font-weight: 650;
}

.workspace-console .dashboard-trend-chart {
  position: relative;
  min-width: 0;
  flex: 1;
  display: grid;
  place-items: center;
}

.workspace-console .dashboard-trend-svg {
  width: 100%;
  height: 214px;
  min-height: 214px;
}

.workspace-console .dashboard-trend-area {
  fill: url(#carrot-dashboard-area);
  stroke: none;
}

.workspace-console .dashboard-trend-input {
  fill: none;
  stroke: var(--ref-green);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.workspace-console .dashboard-trend-svg circle {
  fill: var(--ref-surface);
  stroke: var(--ref-green);
  stroke-width: 2;
}

.workspace-console .dashboard-chart-empty {
  position: absolute;
  inset: 50% auto auto 50%;
  padding: 5px 9px;
  transform: translate(-50%, -50%);
  border-radius: 6px;
  background: var(--ref-surface);
  color: var(--ref-muted);
  font-size: 11px;
  white-space: nowrap;
}

.workspace-console .dashboard-ranking-panel {
  min-width: 0;
  padding-left: 17px;
  border-left: 1px solid var(--ref-border);
}

.workspace-console .dashboard-ranking-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.workspace-console .dashboard-ranking-title strong {
  color: var(--ref-text);
  font-size: 13px;
}

.workspace-console .dashboard-ranking-title strong span {
  color: var(--ref-amber);
}

.workspace-console .dashboard-ranking-title small {
  color: var(--ref-muted);
  font-size: 10px;
}

.workspace-console .dashboard-ranking-list {
  margin-top: 10px;
  display: grid;
}

.workspace-console .dashboard-ranking-list > div:not(.empty-state) {
  min-width: 0;
  min-height: 36px;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
}

.workspace-console .dashboard-ranking-list b {
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  border-radius: 5px;
  background: var(--ref-surface-soft);
  color: var(--ref-muted);
  font-size: 9px;
}

.workspace-console .dashboard-ranking-list > div:nth-child(-n+3) b {
  background: var(--ref-amber-soft);
  color: var(--ref-amber);
}

.workspace-console .dashboard-ranking-list > div > span {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.workspace-console .dashboard-ranking-list strong {
  overflow: hidden;
  color: var(--ref-text);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace-console .dashboard-ranking-list i {
  height: 4px;
  overflow: hidden;
  border-radius: 2px;
  background: var(--ref-surface-hover);
}

.workspace-console .dashboard-ranking-list em {
  width: var(--feature-share);
  height: 100%;
  display: block;
  border-radius: inherit;
  background: var(--ref-green);
}

.workspace-console .dashboard-ranking-list small {
  color: var(--ref-muted);
  font-size: 10px;
  white-space: nowrap;
}

.workspace-console .dashboard-announcement-card {
  display: flex;
  flex-direction: column;
  border-color: rgba(50, 107, 212, .22);
}

.workspace-console .dashboard-announcement-head button,
.workspace-console .dashboard-announcement-foot {
  min-height: 34px;
  padding: 5px 7px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 0;
  background: transparent;
  color: var(--ref-muted);
  font: inherit;
  font-size: 11px;
  cursor: pointer;
}

.workspace-console .dashboard-announcement-head button:hover,
.workspace-console .dashboard-announcement-foot:hover {
  color: var(--ref-primary);
}

.workspace-console .dashboard-announcement-head button .nav-chevron,
.workspace-console .dashboard-announcement-foot .nav-chevron {
  width: 14px;
  height: 14px;
}

.workspace-console .dashboard-announcement-content {
  min-width: 0;
  flex: 1;
  padding: 18px 2px 14px;
  overflow: hidden;
}

.workspace-console .dashboard-announcement-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ref-muted);
  font-size: 10px;
}

.workspace-console .dashboard-announcement-meta b {
  padding: 2px 5px;
  border-radius: 5px;
  background: var(--ref-red-soft);
  color: var(--ref-red);
  font-size: 9px;
}

.workspace-console .dashboard-announcement-content h2 {
  margin: 10px 0 8px;
  color: var(--ref-text);
  font-size: 16px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.workspace-console .dashboard-announcement-content p {
  margin: 0;
  display: -webkit-box;
  overflow: hidden;
  color: var(--ref-muted);
  font-size: 12px;
  line-height: 1.8;
  white-space: pre-line;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 7;
}

.workspace-console .dashboard-announcement-content img {
  width: 100%;
  max-height: 96px;
  margin: 3px 0 9px;
  border-radius: 7px;
  object-fit: cover;
}

.workspace-console .dashboard-announcement-empty {
  flex: 1;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 6px;
  color: var(--ref-muted);
  text-align: center;
}

.workspace-console .dashboard-announcement-empty > span {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--ref-blue-soft);
  color: var(--ref-blue);
}

.workspace-console .dashboard-announcement-empty strong {
  color: var(--ref-text);
  font-size: 13px;
}

.workspace-console .dashboard-announcement-empty small {
  font-size: 10px;
}

.workspace-console .dashboard-announcement-foot {
  width: 100%;
  margin-top: auto;
  justify-content: flex-start;
  border-top: 1px solid var(--ref-border);
}

.workspace-console .dashboard-announcement-foot .nav-chevron {
  margin-left: auto;
}

.workspace-console .dashboard-announcement-foot .nav-icon {
  width: 16px;
  height: 16px;
}

.workspace-console .dashboard-start-section {
  min-width: 0;
}

.workspace-console .dashboard-start-heading {
  min-height: 36px;
  margin-bottom: 13px;
  padding-left: 12px;
  display: flex;
  align-items: center;
  border-left: 4px solid var(--ref-primary);
}

.workspace-console .dashboard-start-heading > div {
  display: flex;
  align-items: baseline;
  gap: 9px;
}

.workspace-console .dashboard-start-heading strong {
  color: var(--ref-text);
  font-size: 20px;
}

.workspace-console .dashboard-start-heading small {
  color: var(--ref-muted);
  font-size: 11px;
}

.workspace-console .dashboard-service-grid {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.workspace-console .dashboard-service-card {
  position: relative;
  min-width: 0;
  min-height: 158px;
  padding: 21px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 15px;
  overflow: hidden;
  border: 1px solid var(--ref-border);
  border-radius: 8px;
  background: var(--ref-surface);
  box-shadow: var(--ref-shadow);
  color: var(--ref-text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}

.workspace-console .dashboard-service-card::before {
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  content: "";
  background: var(--ref-blue);
}

.workspace-console .dashboard-service-card.is-violet::before { background: var(--ref-violet); }
.workspace-console .dashboard-service-card.is-green::before { background: var(--ref-green); }
.workspace-console .dashboard-service-card.is-amber::before { background: var(--ref-amber); }

.workspace-console .dashboard-service-card:hover {
  transform: translateY(-2px);
  border-color: var(--ref-border-strong);
  box-shadow: 0 10px 24px rgba(30, 47, 60, .08);
}

.workspace-console .dashboard-service-icon {
  width: 50px;
  height: 50px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--ref-blue-soft);
  color: var(--ref-blue);
}

.workspace-console .dashboard-service-card.is-violet .dashboard-service-icon { background: var(--ref-violet-soft); color: var(--ref-violet); }
.workspace-console .dashboard-service-card.is-green .dashboard-service-icon { background: var(--ref-green-soft); color: var(--ref-green); }
.workspace-console .dashboard-service-card.is-amber .dashboard-service-icon { background: var(--ref-amber-soft); color: var(--ref-amber); }

.workspace-console .dashboard-service-icon .nav-icon {
  width: 25px;
  height: 25px;
  color: currentColor;
}

.workspace-console .dashboard-service-copy {
  min-width: 0;
  display: grid;
  gap: 6px;
}

.workspace-console .dashboard-service-copy strong {
  color: var(--ref-text);
  font-size: 17px;
}

.workspace-console .dashboard-service-copy small {
  color: var(--ref-muted);
  font-size: 11px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.workspace-console .dashboard-service-card > .nav-chevron {
  position: absolute;
  right: 18px;
  bottom: 18px;
  width: 17px;
  height: 17px;
  color: var(--ref-border-strong);
}

.workspace-console .dashboard-detail-grid {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(480px, 1.35fr) minmax(230px, .72fr) minmax(280px, .93fr);
  gap: 16px;
}

.workspace-console .dashboard-detail-grid > * {
  min-width: 0;
}

.workspace-console .dashboard-account-surface,
.workspace-console .dashboard-recent-surface {
  min-height: 260px;
}

/* The paper workflow remains complete, but its primary path follows the reference single-column form. */
.workspace-console .paper-agent {
  max-width: 1220px;
  margin-right: auto;
  margin-left: 0;
}

.workspace-console .paper-agent > .paper-agent-hero,
.workspace-console .paper-agent > .paper-agent-workbench,
.workspace-console .paper-agent > .software-mode-content {
  width: min(100%, 720px);
  margin-right: auto;
  margin-left: 0;
}

.workspace-console .paper-agent > .software-mode-content .paper-agent-workbench {
  width: 100%;
}

.workspace-console .paper-agent > .panel:last-child {
  width: 100%;
  margin-top: 2px;
}

.workspace-console .paper-agent-grid {
  grid-template-columns: minmax(0, 1fr);
  gap: 17px;
}

.workspace-console .paper-agent-grid .wide {
  grid-column: auto;
}

.workspace-console .paper-agent-grid .field {
  min-width: 0;
}

.workspace-console .paper-agent-grid .input,
.workspace-console .paper-agent-grid .select {
  min-height: 46px;
}

.workspace-console .paper-agent-grid .textarea {
  min-height: 126px;
}

.workspace-console .paper-agent-actions .btn.primary {
  border-color: var(--ref-green);
  background: var(--ref-green);
}

.workspace-console .paper-agent-actions .btn.primary:hover:not(:disabled) {
  border-color: #0d6f50;
  background: #0d6f50;
}

.workspace-console .paper-agent-actions {
  position: static;
}

@media (max-width: 1320px) {
  .workspace-console .dashboard-primary-grid {
    grid-template-columns: minmax(0, 1.55fr) minmax(290px, .85fr);
  }

  .workspace-console .dashboard-overview-body {
    grid-template-columns: minmax(0, 1.25fr) minmax(180px, .68fr);
  }

  .workspace-console .dashboard-detail-grid {
    grid-template-columns: minmax(440px, 1.3fr) minmax(240px, .7fr);
  }

  .workspace-console .dashboard-recent-surface {
    grid-column: 1 / -1;
  }
}

@media (max-width: 1100px) and (min-width: 901px) {
  .workspace-console .content {
    padding-right: 18px;
    padding-left: 18px;
  }

  .workspace-console .dashboard-primary-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .workspace-console .dashboard-primary-grid > * {
    min-height: 0;
  }

  .workspace-console .dashboard-announcement-card {
    min-height: 290px;
  }

  .workspace-console .dashboard-service-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .workspace-console .dashboard-detail-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .workspace-console .dashboard-recent-surface {
    grid-column: auto;
  }
}

@media (max-width: 900px) {
  .workspace-console .brand,
  .workspace-console.light-mode .brand,
  .workspace-console.workspace-collapsed .brand,
  .workspace-console.light-mode.workspace-collapsed .brand {
    min-height: 88px;
    padding: 8px 8px 18px;
  }

  .workspace-console .brand img,
  .workspace-console.workspace-collapsed .brand img,
  .workspace-console.light-mode.workspace-collapsed .brand img {
    width: 52px;
    height: 52px;
    flex-basis: 52px;
  }

  .workspace-console .topbar,
  .workspace-console.light-mode .topbar {
    display: flex;
  }

  .workspace-console .workspace-page-heading small {
    display: none;
  }

  .workspace-console .workspace-sidebar-balance,
  .workspace-console .workspace-sidebar-actions span,
  .workspace-console .workspace-sidebar-tools span,
  .workspace-console.workspace-collapsed .workspace-sidebar-balance,
  .workspace-console.workspace-collapsed .workspace-sidebar-actions span,
  .workspace-console.workspace-collapsed .workspace-sidebar-tools span {
    display: initial;
  }

  .workspace-console .workspace-sidebar-actions,
  .workspace-console.workspace-collapsed .workspace-sidebar-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .workspace-console .workspace-sidebar-tools,
  .workspace-console.workspace-collapsed .workspace-sidebar-tools {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .workspace-console .dashboard-redesign {
    margin: 0;
    padding: 0 0 28px;
    gap: 19px;
  }

  .workspace-console .dashboard-primary-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .workspace-console .dashboard-primary-grid > * {
    min-height: 0;
  }

  .workspace-console .dashboard-consumption-card,
  .workspace-console .dashboard-announcement-card {
    padding: 18px;
  }

  .workspace-console .dashboard-announcement-card {
    min-height: 290px;
  }

  .workspace-console .dashboard-service-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .workspace-console .dashboard-detail-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .workspace-console .dashboard-recent-surface {
    grid-column: auto;
  }
}

@media (max-width: 680px) {
  .workspace-console .dashboard-welcome {
    align-items: flex-start;
  }

  .workspace-console .dashboard-welcome h1 {
    font-size: 21px;
  }

  .workspace-console .dashboard-welcome-actions .btn:first-child {
    display: none;
  }

  .workspace-console .dashboard-overview-head {
    align-items: flex-start;
  }

  .workspace-console .dashboard-overview-metrics {
    grid-template-columns: minmax(0, 1fr);
  }

  .workspace-console .dashboard-mini-metric {
    min-height: 60px;
  }

  .workspace-console .dashboard-overview-body {
    grid-template-columns: minmax(0, 1fr);
  }

  .workspace-console .dashboard-ranking-panel {
    padding: 15px 0 0;
    border-top: 1px solid var(--ref-border);
    border-left: 0;
  }

  .workspace-console .dashboard-ranking-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 12px;
  }

  .workspace-console .dashboard-service-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .workspace-console .dashboard-service-card {
    min-height: 120px;
    padding: 18px;
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr) 18px;
    align-items: center;
    gap: 13px;
  }

  .workspace-console .dashboard-service-icon {
    width: 46px;
    height: 46px;
  }

  .workspace-console .dashboard-service-card > .nav-chevron {
    position: static;
  }

  .workspace-console .dashboard-model-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .workspace-console .dashboard-donut {
    margin-right: auto;
    margin-left: auto;
  }

  .workspace-console .paper-agent > .paper-agent-hero,
  .workspace-console .paper-agent > .paper-agent-workbench,
  .workspace-console .paper-agent > .software-mode-content {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .workspace-console .dashboard-welcome-actions .btn {
    min-width: 44px;
    padding: 0 11px;
  }

  .workspace-console .dashboard-welcome-actions .btn span {
    display: none;
  }

  .workspace-console .dashboard-consumption-card,
  .workspace-console .dashboard-announcement-card {
    padding: 15px;
  }

  .workspace-console .dashboard-overview-controls {
    align-items: stretch;
  }

  .workspace-console .dashboard-select {
    padding-right: 5px;
    padding-left: 5px;
  }

  .workspace-console .dashboard-select .nav-icon {
    display: none;
  }

  .workspace-console .dashboard-ranking-list {
    grid-template-columns: minmax(0, 1fr);
  }

  .workspace-console .dashboard-trend-svg {
    height: 190px;
    min-height: 190px;
  }

  .workspace-console .dashboard-start-heading strong {
    font-size: 18px;
  }

  .workspace-console .dashboard-start-heading small {
    display: none;
  }

  .workspace-console .dashboard-service-card {
    min-height: 104px;
  }

  .workspace-console .workspace-sidebar-actions #quick-recharge,
  .workspace-console .workspace-sidebar-foot #quick-profile {
    display: flex;
  }
}

/* Long paper forms should scroll beneath a normal document header, not under a sticky overlay. */
@media (max-width: 900px) {
  .workspace-console:has(.paper-agent) .topbar {
    position: relative;
    top: 0;
  }
}

/* The six-column paper history becomes readable cards on narrow screens. */
@media (max-width: 560px) {
  .workspace-console .paper-agent > .panel:last-child .table-wrap {
    overflow: visible;
    border: 0;
    background: transparent;
  }

  .workspace-console .paper-agent > .panel:last-child .table-wrap table {
    display: block;
    width: 100%;
    min-width: 0;
  }

  .workspace-console .paper-agent > .panel:last-child .table-wrap thead {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }

  .workspace-console .paper-agent > .panel:last-child .table-wrap tbody {
    display: grid;
    gap: 10px;
  }

  .workspace-console .paper-agent > .panel:last-child .table-wrap tbody tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px 12px;
    width: 100%;
    padding: 13px;
    border: 1px solid var(--ref-border);
    border-radius: 9px;
    background: var(--ref-surface);
    box-shadow: 0 4px 14px rgba(16, 24, 40, .05);
  }

  .workspace-console .paper-agent > .panel:last-child .table-wrap tbody tr:not(:has(.empty)) td {
    display: block;
    min-width: 0;
    padding: 0;
    border: 0;
    overflow-wrap: anywhere;
  }

  .workspace-console .paper-agent > .panel:last-child .table-wrap tbody tr:not(:has(.empty)) td:nth-child(1),
  .workspace-console .paper-agent > .panel:last-child .table-wrap tbody tr:not(:has(.empty)) td:nth-child(2),
  .workspace-console .paper-agent > .panel:last-child .table-wrap tbody tr:not(:has(.empty)) td:nth-child(5),
  .workspace-console .paper-agent > .panel:last-child .table-wrap tbody tr:not(:has(.empty)) td:nth-child(6) {
    grid-column: 1 / -1;
  }

  .workspace-console .paper-agent > .panel:last-child .table-wrap tbody tr:not(:has(.empty)) td:nth-child(2) {
    color: var(--ref-text);
    font-weight: 650;
    line-height: 1.45;
  }

  .workspace-console .paper-agent > .panel:last-child .table-wrap tbody tr:not(:has(.empty)) td:nth-child(3),
  .workspace-console .paper-agent > .panel:last-child .table-wrap tbody tr:not(:has(.empty)) td:nth-child(4) {
    align-self: center;
  }

  .workspace-console .paper-agent > .panel:last-child .table-wrap tbody tr:not(:has(.empty)) td:nth-child(4) {
    text-align: right;
  }

  .workspace-console .paper-agent > .panel:last-child .table-wrap tbody tr:not(:has(.empty)) td:nth-child(5) {
    padding-top: 8px;
    border-top: 1px solid var(--ref-border) !important;
  }

  .workspace-console .paper-agent > .panel:last-child .table-wrap tbody tr:not(:has(.empty)) td:nth-child(5)::before,
  .workspace-console .paper-agent > .panel:last-child .table-wrap tbody tr:not(:has(.empty)) td:nth-child(6)::before {
    display: block;
    margin-bottom: 5px;
    color: var(--ref-muted);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .02em;
  }

  .workspace-console .paper-agent > .panel:last-child .table-wrap tbody tr:not(:has(.empty)) td:nth-child(5)::before {
    content: '下载与改稿';
  }

  .workspace-console .paper-agent > .panel:last-child .table-wrap tbody tr:not(:has(.empty)) td:nth-child(6)::before {
    content: '时间';
  }

  .workspace-console .paper-agent > .panel:last-child .table-wrap tbody tr:not(:has(.empty)) td:nth-child(5) .software-result-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
  }

  .workspace-console .paper-agent > .panel:last-child .table-wrap tbody tr:not(:has(.empty)) td:nth-child(5) .btn {
    min-height: 40px;
  }

  .workspace-console .paper-agent > .panel:last-child .table-wrap tbody tr:has(.empty) {
    display: block;
  }

  .workspace-console .paper-agent > .panel:last-child .table-wrap tbody tr:has(.empty) td {
    display: block;
    width: 100%;
    padding: 18px 12px;
  }
}

/* Avoid a large empty announcement surface on tablet and phone widths. */
@media (max-width: 1100px) {
  .workspace-console .dashboard-announcement-card {
    min-height: 0;
  }
}
