/* Company entry point: warm paper, charcoal type, one orange action role. */
:root {
  color-scheme: light;
  --paper: #f7f5f0;
  --surface: #fffefa;
  --subtle: #efede7;
  --ink: #242421;
  --muted: #706e65;
  --line: #dedbd2;
  --action: #cb4e18;
  --action-hover: #ab3d10;
  --on-action: #ffffff;
  --accent-soft: #fff0e6;
  --success: #346b47;
  --danger: #b82c2c;
  --danger-soft: #fff0ee;
  --focus: #ad430f;
  --radius: 14px;
  --shadow: 0 20px 60px rgba(38, 31, 16, .06);
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  font-synthesis: none;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --paper: #191a18; --surface: #222320; --subtle: #2b2c28; --ink: #f1eee5;
    --muted: #b1afa5; --line: #41413a; --action: #ef854f; --action-hover: #ffa270;
    --on-action: #24160e; --accent-soft: #3b2b22; --success: #99c8a7;
    --danger: #ffaaa1; --danger-soft: #3d2624; --focus: #ffa270;
    --shadow: 0 20px 60px rgba(0, 0, 0, .12);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #191a18; --surface: #222320; --subtle: #2b2c28; --ink: #f1eee5;
  --muted: #b1afa5; --line: #41413a; --action: #ef854f; --action-hover: #ffa270;
  --on-action: #24160e; --accent-soft: #3b2b22; --success: #99c8a7;
  --danger: #ffaaa1; --danger-soft: #3d2624; --focus: #ffa270;
  --shadow: 0 20px 60px rgba(0, 0, 0, .12);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 300px; background: var(--paper); color: var(--ink); font-size: 14px; line-height: 1.7; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 4px; }
button, input, select, textarea { font: inherit; }
button, a, input, textarea, select, summary { -webkit-tap-highlight-color: transparent; }
button, summary { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .48; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 4px; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(28px, 3.2vw, 42px); font-weight: 650; letter-spacing: -.055em; line-height: 1.35; }
h2 { font-size: 21px; font-weight: 650; line-height: 1.5; letter-spacing: -.035em; }
h3 { font-size: 15px; font-weight: 650; }
.muted, .field-help { color: var(--muted); }
.small-label, .eyebrow { color: var(--muted); font-size: 10px; font-weight: 650; letter-spacing: .15em; }
.eyebrow { margin-bottom: 18px; }
.small-label { display: block; margin-bottom: 6px; }
.topbar { min-height: 88px; padding: 20px max(5vw, 24px); display: flex; align-items: center; justify-content: space-between; gap: 24px; border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: 12px; font-size: 21px; font-weight: 750; letter-spacing: -.04em; text-decoration: none; flex-shrink: 0; }
.brand-mark { display: grid; place-items: center; background: var(--ink); color: var(--paper); width: 39px; height: 39px; border-radius: 10px; font-size: 26px; font-family: Georgia, serif; font-style: italic; }
.brand-caption { margin-left: 12px; padding-left: 14px; border-left: 1px solid var(--line); color: var(--muted); font-size: 12px; font-weight: 450; letter-spacing: 0; }
.header-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 18px; font-size: 12px; }
.account-email { max-width: 230px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.theme-button, .text-button { border: 0; padding: 4px 0; color: var(--muted); background: transparent; font-size: 12px; }
.theme-button:hover, .text-button:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 4px; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 18px; min-height: 46px; padding: 10px 20px; border-radius: 9px; border: 1px solid transparent; font-size: 13px; font-weight: 600; text-decoration: none; transition: background-color .15s ease; white-space: nowrap; }
.button span[aria-hidden] { font-size: 19px; font-weight: 400; }
.button.primary { background: var(--action); color: var(--on-action); }
.button.primary:hover:not(:disabled) { background: var(--action-hover); }
.button.secondary { color: var(--ink); border-color: var(--line); background: var(--surface); }
.button.secondary:hover:not(:disabled) { background: var(--subtle); }
.button.compact { min-height: 36px; padding: 6px 13px; font-size: 12px; }
.button.full { width: 100%; justify-content: space-between; }
.login-layout { width: min(1070px, 90vw); margin: 0 auto; padding: 76px 0 70px; display: grid; grid-template-columns: 1fr 430px; align-items: center; gap: 100px; min-height: calc(100vh - 160px); }
.login-story { position: relative; padding: 10px 0; }
.login-story h1 { font-size: clamp(44px, 4.8vw, 65px); line-height: 1.25; }
.lead { margin-top: 24px; color: var(--muted); font-size: 16px; line-height: 1.9; }
.scene-stack { position: relative; height: 187px; width: 330px; margin: 42px 0 0 10px; }
.scene { position: absolute; width: 230px; height: 145px; padding: 17px 21px; border: 1px solid var(--line); border-radius: 6px; font-size: 9px; letter-spacing: .1em; background: var(--subtle); }
.scene-back { top: 3px; left: 74px; transform: rotate(9deg); }
.scene-middle { top: 12px; left: 37px; transform: rotate(2deg); background: var(--surface); }
.scene-front { display: flex; flex-direction: column; justify-content: space-between; top: 21px; left: 0; transform: rotate(-5deg); background: var(--accent-soft); border-color: var(--action); }
.scene-number { font-family: Georgia, serif; font-style: italic; font-size: 51px; line-height: 1; color: var(--action); }
.scene-rule { width: 31px; height: 2px; background: var(--action); }
.story-footnote { margin-top: 15px; color: var(--muted); font-size: 11px; letter-spacing: .12em; }
.login-card { padding: 38px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.login-card h2 { margin: 10px 0 8px; font-size: 25px; }
.login-card > .muted { font-size: 13px; }
.form-stack { display: flex; flex-direction: column; gap: 10px; margin-top: 26px; }
.form-stack label { font-size: 12px; font-weight: 600; }
input, select, textarea { width: 100%; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 11px 13px; min-height: 44px; }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: .8; }
input:hover, textarea:hover, select:hover { border-color: var(--muted); }
textarea { resize: vertical; min-height: 130px; }
.form-stack > .button { margin-top: 10px; }
.form-actions { display: flex; justify-content: space-between; margin-top: 6px; }
.password-confirm { margin-top: 0; }
input[readonly] { background: var(--subtle); }
.login-help { margin-top: 27px; padding-top: 23px; border-top: 1px solid var(--line); font-size: 11px; color: var(--muted); line-height: 1.9; }
.notice { background: var(--accent-soft); padding: 12px 15px; border-radius: 8px; font-size: 12px; line-height: 1.8; margin-bottom: 16px; overflow-wrap: anywhere; }
.login-card .notice { margin-top: 18px; margin-bottom: 0; }
.notice.error { background: var(--danger-soft); color: var(--danger); }
#invitation-account-warning > .button { margin-top: 10px; white-space: normal; }
.page-footer { margin: 0 max(5vw, 24px); min-height: 62px; padding: 18px 0; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 20px; color: var(--muted); font-size: 10px; letter-spacing: .07em; }
.workspace-layout { width: min(1160px, 90vw); margin: 0 auto; padding: 42px 0 64px; min-height: calc(100vh - 160px); }
.welcome-band { display: flex; align-items: center; justify-content: space-between; gap: 28px; padding: 0 0 36px; }
.welcome-band .muted { margin-top: 14px; }
.workspace-grid { display: grid; grid-template-columns: 1.08fr 1fr; gap: 22px; align-items: start; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 27px; }
.panel-heading { display: flex; justify-content: space-between; align-items: center; gap: 18px; }
.panel-description { margin-top: 18px; font-size: 12px; line-height: 1.9; }
.badge { padding: 4px 9px; background: var(--subtle); border-radius: 5px; color: var(--muted); font-size: 10px; font-weight: 600; white-space: nowrap; }
.danger-button { color: var(--danger); }
.empty-state { padding: 30px 12px; text-align: center; color: var(--muted); font-size: 12px; border: 1px dashed var(--line); border-radius: 9px; }
code, pre { font-family: "Cascadia Code", "SFMono-Regular", Consolas, monospace; }
code { font-size: 11px; background: var(--subtle); border-radius: 3px; padding: 2px 4px; }
.field-help { font-size: 11px; line-height: 1.8; }
.mcp-grid { grid-template-columns: 1fr 1fr; }
.mcp-steps { padding-left: 21px; margin: 24px 0 0; }
.mcp-steps li { padding-left: 5px; margin-bottom: 23px; }
.mcp-steps strong { display: block; margin-bottom: 6px; font-size: 13px; font-weight: 600; }
.mcp-steps p { color: var(--muted); font-size: 12px; line-height: 1.9; }
.mcp-billing { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); }
.mcp-credentials { margin-top: 24px; border-color: var(--action); }
.mcp-credentials > .muted { margin-top: 16px; font-size: 13px; overflow-wrap: anywhere; }
.mcp-credentials > .field-help { margin: 12px 0; }
.mcp-credentials > label, .mcp-config-heading > label { display: block; font-size: 12px; font-weight: 600; }
.mcp-credentials > input { margin-top: 9px; font-family: "Cascadia Code", Consolas, monospace; font-size: 12px; }
.mcp-config-heading { margin: 22px 0 10px; }
.mcp-config { max-height: 480px; overflow: auto; padding: 20px; border-radius: 9px; background: var(--subtle); color: var(--ink); font-size: 12px; line-height: 1.9; white-space: pre-wrap; overflow-wrap: anywhere; }
.mcp-clients-panel { margin-top: 24px; }
.mcp-clients-panel > .field-help { margin-top: 12px; }
.mcp-clients-list { margin-top: 20px; }
.mcp-client-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 20px; border-top: 1px solid var(--line); padding: 18px 0; }
.mcp-client-info h3 { overflow-wrap: anywhere; }
.mcp-client-meta { color: var(--muted); font-size: 10px; overflow-wrap: anywhere; }
.invite-panel { display: flex; align-items: center; justify-content: space-between; gap: 30px; margin-bottom: 24px; }
.invite-panel .muted { font-size: 12px; margin-top: 6px; }
.invite-form { display: flex; gap: 12px; width: 53%; }
.invite-form input { min-width: 0; }
.invitation-handoff { margin-bottom: 24px; border-color: var(--action); }
.invitation-handoff > .muted { margin: 14px 0; font-size: 12px; overflow-wrap: anywhere; }
.invitation-handoff > label { display: block; margin-bottom: 8px; font-size: 12px; }
.invitation-copy-row { display: flex; gap: 12px; margin-bottom: 10px; }
.invitation-copy-row input { min-width: 0; font-family: "Cascadia Code", Consolas, monospace; font-size: 12px; }
.member-actions { display: flex; justify-content: flex-end; gap: 18px; flex-wrap: wrap; }
.members-list { margin-top: 23px; }
.member-row { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 22px; padding: 18px 0; border-top: 1px solid var(--line); }
.member-info { min-width: 0; }
.member-email { font-size: 13px; overflow-wrap: anywhere; }
.member-role { font-size: 10px; color: var(--muted); }
.member-state { font-size: 11px; color: var(--success); }
.member-state.disabled { color: var(--muted); }
.admin-layout > #authenticated > .panel > .field-help { margin-top: 14px; }
.loading-block { padding: 80px 20px; color: var(--muted); text-align: center; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; z-index: 10; top: 8px; left: 12px; padding: 8px 16px; color: var(--on-action); background: var(--action); transform: translateY(-200%); }
.skip-link:focus { transform: translateY(0); }
@media (max-width: 1000px) {
  .login-layout { gap: 50px; grid-template-columns: 1fr 390px; }
  .brand-caption { display: none; }
  .header-actions { gap: 13px; }
  .account-email { max-width: 150px; }
  .panel { padding: 22px; }
  .workspace-grid { grid-template-columns: 1fr 1fr; gap: 16px; }
  .invite-panel { align-items: flex-start; flex-direction: column; gap: 20px; }
  .invite-form { width: 100%; }
}
@media (max-width: 760px) {
  .topbar { padding: 17px 5vw; min-height: 74px; align-items: flex-start; }
  .header-actions { max-width: 65%; row-gap: 8px; }
  .account-email { max-width: 200px; }
  .brand { font-size: 18px; gap: 8px; }
  .brand-mark { width: 32px; height: 32px; font-size: 22px; }
  .login-layout { grid-template-columns: 1fr; width: min(430px, 90vw); padding: 35px 0 45px; gap: 30px; }
  .login-story h1 { font-size: 39px; }
  .login-story h1 br { display: none; }
  .login-story .lead { font-size: 13px; margin-top: 14px; }
  .login-story .lead br { display: none; }
  .scene-stack, .story-footnote { display: none; }
  .login-card { padding: 28px; }
  .workspace-layout { padding-top: 28px; }
  .welcome-band { align-items: flex-start; flex-direction: column; padding-bottom: 26px; gap: 22px; }
  .welcome-band h1 { font-size: 30px; }
  .workspace-grid { grid-template-columns: 1fr; }
  .mcp-client-row { grid-template-columns: minmax(0, 1fr) auto; gap: 10px; }
  .mcp-client-row > .badge { grid-column: 1; grid-row: 2; justify-self: start; }
  .mcp-client-row > button { grid-column: 2; grid-row: 1 / 3; }
  .welcome-band .muted { font-size: 12px; }
  .page-footer { font-size: 9px; flex-wrap: wrap; gap: 4px; }
  .member-row { grid-template-columns: 1fr auto; gap: 10px; }
  .member-state { grid-column: 1; grid-row: 2; }
  .member-actions { grid-column: 2; grid-row: 1 / 3; flex-direction: column; align-items: flex-end; gap: 8px; }
  .invitation-copy-row { flex-direction: column; }
  .panel-heading { gap: 12px; }
  h2 { font-size: 19px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
