:root{--bg:#fff;--surface:#fff;--surface-2:#f7f7f8;--surface-3:#e9e9eb;--ink:#222326;--ink-2:#5e6065;--ink-3:#828389;--ink-nav:#424449;--line:#dedfe1;--line-soft:#eeeeef;--accent:#9b6546;--accent-ink:#784b33;--accent-soft:#f4ebe5;--danger:#a63e3e;--danger-soft:#fcecec;--ok:#16775d;--ok-soft:#e3f4ed;--shadow-1:0 3px 12px #00000005;--shadow-2:0 8px 24px #0000000d;--r-sm:6px;--r-md:8px;--r-lg:10px;--r-xl:12px;--font:Inter,"Microsoft YaHei",system-ui,sans-serif}
*{box-sizing:border-box}[hidden]{display:none!important}html,body{height:100%;margin:0}body{font:14px/1.55 var(--font);color:var(--ink);background:var(--bg);overflow:hidden}button,input,textarea,select{font:inherit}a{color:inherit}.sr-only{position:absolute;width:1px;height:1px;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap}.icon{display:block;width:18px;height:18px;flex:none}.icon--lg{width:20px;height:20px}.icon--inline{display:inline-block;width:14px;height:14px;vertical-align:-2px}
.shell{height:100dvh;min-height:0;display:grid;grid-template-rows:auto minmax(0,1fr)}.view{min-height:0;overflow:auto}.topbar{min-height:68px;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:10px 32px;background:#fff;border-bottom:1px solid var(--line)}.brand{display:flex;align-items:center;gap:10px;text-decoration:none;min-width:0}.brand__mark{display:grid;place-items:center;width:38px;height:38px;border-radius:9px;background:var(--accent-soft);color:var(--accent)}.brand__text{display:grid;line-height:1.3}.brand__name{font-size:14px}.brand__status{font-size:12px;color:var(--ink-3)}.brand__status.is-online{color:var(--ok)}.topbar__actions{display:flex;align-items:center;gap:5px}
.btn,.icon-btn{display:inline-flex;align-items:center;justify-content:center;gap:7px;min-height:42px;padding:9px 15px;border:1px solid var(--line);border-radius:8px;background:#fff;color:var(--ink-nav);font-weight:600;line-height:1.2;text-decoration:none;cursor:pointer}.icon-btn{width:44px;height:44px;padding:0;border-color:transparent;background:transparent}.btn:hover,.icon-btn:hover{background:var(--surface-2)}.btn:active,.icon-btn:active{filter:brightness(.95)}.btn--primary{border-color:var(--accent);background:var(--accent);color:#fff}.btn--primary:hover{background:var(--accent-ink)}.btn--danger{background:var(--danger);color:#fff;border-color:var(--danger)}.btn--delete{color:var(--danger)}.btn--sm{font-size:13px}.btn:disabled{opacity:.5;cursor:not-allowed}:focus-visible{outline:3px solid var(--accent);outline-offset:2px}.linkbtn{border:0;background:none;color:var(--accent);text-decoration:underline;cursor:pointer}
.field{display:block;margin:0 0 16px}.field__label{display:block;margin:0 0 6px;font-size:13px;font-weight:650;color:var(--ink-nav)}input[type=text],input[type=password],textarea{display:block;width:100%;padding:10px 12px;border:1px solid var(--line);border-radius:8px;background:#fff;color:var(--ink);line-height:1.5}textarea{min-height:44px;resize:vertical}input:focus,textarea:focus{outline:2px solid var(--accent);outline-offset:1px}.hint,.empty{padding:16px;border-radius:10px;background:#fff;color:var(--ink-2)}.hint{display:flex;align-items:center;gap:10px;margin-top:24px;background:var(--accent-soft);color:var(--accent-ink)}
.view--auth{display:grid;place-items:center;padding:32px}.auth-layout{display:grid;grid-template-columns:1fr 1fr;width:min(960px,100%);min-height:580px;background:#fff;border-radius:12px;overflow:hidden;box-shadow:var(--shadow-2)}.auth-intro{display:flex;flex-direction:column;justify-content:space-between;padding:44px;background:#f5f2f0;color:#222326}.auth-intro__eyebrow,.auth-intro__footer{font-size:12px;letter-spacing:.08em;color:#78716c}.auth-intro__mark{display:grid;place-items:center;width:68px;height:68px;border:1px solid var(--accent);border-radius:20px;color:var(--accent);font-size:27px;font-weight:700}.auth-intro h2{color:#222326;font-size:38px;line-height:1.3;margin:28px 0 14px}.auth-intro p{color:#706b67;max-width:290px}.auth{align-self:center;padding:54px 64px}.auth__eyebrow{font-size:12px;font-weight:700;color:var(--accent)}.auth__title{font-size:28px;margin:0 0 8px}.auth__sub{color:var(--ink-2);margin:0 0 28px}.auth__form .btn{width:100%;min-height:48px}.auth__note{color:var(--ink-3);font-size:12px}.auth__err{padding:10px;background:var(--danger-soft);color:var(--danger)}
.view--list{padding:40px clamp(24px,4vw,64px) 64px}.list__head,.list__section-head,.cards,.empty,.hint,.list__resources{max-width:1280px;margin-left:auto;margin-right:auto}.list__head{display:flex;justify-content:space-between;align-items:end;gap:24px;flex-wrap:wrap;margin-bottom:38px}.list__eyebrow{margin:0 0 12px;color:var(--accent);font-size:12px;font-weight:700}.list__title{font-size:30px;line-height:1.2;margin:0 0 8px;letter-spacing:-.03em}.list__sub{margin:0;color:var(--ink-2)}.list__acts{display:flex;gap:8px;flex-wrap:wrap}.list__section-head{display:flex;align-items:end;justify-content:space-between;padding-bottom:14px;border-bottom:1px solid var(--line);margin-bottom:16px}.list__section-head h2,.list__resources h2{font-size:17px;margin:0}.list__section-head>span{font-size:12px;color:var(--ink-3)}.cards{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,300px),1fr));gap:16px;padding:0;list-style:none}.card{min-width:0;display:flex;flex-direction:column;gap:12px;padding:22px;background:#fff;border:1px solid var(--line);border-radius:10px;box-shadow:var(--shadow-1)}.card__top{display:flex;align-items:center;gap:10px}.card__avatar{width:48px;height:48px;object-fit:cover;border-radius:10px}.card__name{margin:0;font-size:17px;overflow-wrap:anywhere}.card__desc,.card__runtime,.card__runtime-error{margin:0;color:var(--ink-2);overflow-wrap:anywhere}.card__runtime-error{color:var(--danger)}.card__foot,.card__runtime-links{display:flex;gap:8px;flex-wrap:wrap}.card__foot{padding-top:14px;border-top:1px solid var(--line-soft);margin-top:auto}.card__foot .btn{flex:1}.tag{display:inline-flex;align-items:center;gap:5px;padding:4px 8px;border-radius:6px;font-size:12px;background:var(--surface-2);color:var(--ink-2)}.tag--hermes{background:var(--accent-soft);color:var(--accent-ink)}.tag--scene{background:var(--ok-soft);color:var(--ok)}
@media(min-width:761px){.cards:has(>.card:only-child){grid-template-columns:1fr}.card:only-child{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:24px;padding:28px}.card:only-child .card__actions{max-width:520px;justify-content:flex-end}}
.card__identity{display:flex;align-items:center;gap:18px;min-width:0}.card__info{display:grid;gap:6px;min-width:0}.card__avatar{width:72px;height:72px;border-radius:12px}.card__avatar--fallback{display:grid;place-items:center;flex:none;background:var(--accent);color:var(--accent-on,#fff);font-size:30px;font-weight:700}.card__top{flex-wrap:wrap}.card__actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.card__foot{display:flex;align-items:center;flex-wrap:wrap;gap:8px;padding:0;margin:0;border:0}.card__foot .btn{flex:0 0 auto}.card__foot .btn:last-child{order:-1}.card__runtime{font-size:12px;font-weight:600}.card__runtime-links{display:contents}.card__runtime-error{font-size:12px}
@media(max-width:760px){.card__actions{padding-top:16px;border-top:1px solid var(--line-soft)}.card__avatar{width:56px;height:56px;font-size:23px}.card__foot .btn{flex:1}.card__foot{width:100%}.card__runtime-links{display:flex}}

.list__resources{display:block;margin-top:38px}.list__resources h2{margin-bottom:16px}.list__resources p{color:var(--ink-2)}.list__resource-links{display:grid;grid-template-columns:repeat(2,1fr);gap:12px}.resource-link{display:flex;align-items:center;gap:16px;min-height:92px;padding:20px;background:#fff;border:1px solid var(--line);border-radius:10px;text-decoration:none}.resource-link:hover{border-color:var(--accent)}.resource-link strong,.resource-link small{display:block}.resource-link>span:nth-child(2){flex:1}.resource-link__icon{width:28px;height:28px;color:var(--accent)}.resource-link small{margin-top:4px;color:var(--ink-3)}.resource-link>span:last-child{color:var(--accent);font-size:20px}
.view--editor{display:grid;grid-template-rows:auto auto minmax(0,1fr)}.editor__head{grid-row:1;display:flex;align-items:center;gap:10px;padding:12px 30px;background:#fff;border-bottom:1px solid var(--line)}.editor__title{display:flex;align-items:center;gap:10px;flex:1;min-width:0}.editor__name{max-width:340px;font-size:17px;font-weight:700}.editor__acts{display:flex;gap:8px}.editor__tabs{grid-row:2;display:flex;gap:22px;padding:0 30px;background:#fff;border-bottom:1px solid var(--line)}.editor__tabs button{min-height:48px;padding:0 2px;border:0;background:transparent;color:var(--ink-2);cursor:pointer}.editor__tabs button[aria-pressed=true]{color:var(--accent);font-weight:700;box-shadow:inset 0 -3px var(--accent)}#editor-persona-panel,#editor-customization{grid-row:3;min-height:0;overflow:auto}.editor__body{display:grid;grid-template-columns:minmax(0,1fr) 300px;gap:20px;padding:24px 30px 60px}.editor__col{min-width:0;display:flex;flex-direction:column;gap:14px}.editor__col--side{position:sticky;top:0}.block{padding:20px;background:#fff;border:1px solid var(--line);border-radius:10px}.block__title{font-size:15px;margin:0 0 4px}.block__note{color:var(--ink-2);font-size:12px;margin:0 0 16px}.block__note code{background:var(--surface-2);padding:2px 4px}.block .field:last-child{margin-bottom:0}.grid2{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,210px),1fr));gap:12px}.rules,.blocks{list-style:none;padding:0;margin:0}.rule,.block-item{padding:12px 0;border-top:1px solid var(--line-soft)}.rule:first-child,.block-item:first-child{border:0;padding-top:0}.rule{display:flex;gap:10px}.rule__main{flex:1}.rule__title,.block-item__head{display:flex;align-items:center;gap:8px}.rule__body{margin:3px 0;color:var(--ink-2);font-size:12px}.block-item__name{flex:1}.block-item__text{margin-top:8px}.switch{position:relative;display:inline-flex;width:38px;height:22px;flex:none}.switch input{position:absolute;inset:0;width:100%;height:100%;opacity:0;cursor:pointer}.switch__track{width:38px;height:22px;background:#d2d3d5;border-radius:20px}.switch__thumb{position:absolute;top:3px;left:3px;width:16px;height:16px;border-radius:50%;background:#fff;pointer-events:none}.switch input:checked~.switch__track{background:var(--accent)}.switch input:checked~.switch__thumb{transform:translateX(16px)}.switch input:focus-visible~.switch__track{outline:3px solid var(--accent);outline-offset:2px}.scenes{display:grid;grid-template-columns:repeat(auto-fit,minmax(90px,1fr));gap:8px}.scene{min-height:42px;border:1px solid var(--line);border-radius:8px;background:#fff;color:var(--ink);cursor:pointer}.scene.is-on{background:var(--accent-soft);border-color:var(--accent);color:var(--accent)}.try{display:grid;gap:8px}.try .btn{justify-self:end}.try__out{margin-top:12px;padding:12px;background:var(--surface-2);white-space:pre-wrap}.try__out.is-error{color:var(--danger);background:var(--danger-soft)}#editor-customization{padding:0 30px 30px;scroll-padding-bottom:110px}
.sheet{position:fixed;inset:0;z-index:150;display:grid;place-items:center;padding:20px}.sheet__scrim{position:absolute;inset:0;background:#22232680}.sheet__panel{position:relative;display:grid;grid-template-rows:auto auto minmax(0,1fr);width:min(760px,100%);max-height:80dvh;background:#fff;border-radius:10px;overflow:hidden}.sheet__head,.sheet__meta{display:flex;align-items:center;justify-content:space-between;padding:12px 18px;border-bottom:1px solid var(--line)}.sheet__title{font-size:16px;margin:0}.sheet__meta{justify-content:start;gap:12px;color:var(--ink-2)}.sheet__text{overflow:auto;padding:18px;margin:0;white-space:pre-wrap;overflow-wrap:anywhere}.delete-dialog{width:min(420px,calc(100% - 32px));border:0;border-radius:10px;padding:24px;color:var(--ink);box-shadow:var(--shadow-2)}.delete-dialog::backdrop{background:#22232680}.delete-dialog__actions{display:flex;justify-content:flex-end;gap:8px}.delete-dialog__error{color:var(--danger)}.toast{position:fixed;right:20px;bottom:20px;z-index:200;padding:12px 18px;border-radius:8px;background:#222326;color:#fff;pointer-events:none}.toast.is-error{background:var(--danger)}
body[data-workspace=home]:has(#view-auth:not([hidden]))>:is(.workspace-rail,.workspace-mobilebar,.workspace-scrim){display:none}body[data-workspace=home]:has(#view-auth:not([hidden]))>.shell{margin-left:0;width:100%;padding-top:0;grid-template-rows:minmax(0,1fr)}body[data-workspace=home]:has(#view-auth:not([hidden])) .topbar{display:none}
@media(max-width:900px){.editor__body{grid-template-columns:1fr}.editor__col--side{position:static}.list__resources{grid-template-columns:1fr}.auth{padding:36px}}
@media(max-width:600px){.topbar{padding:8px 12px}.view--list{padding:26px 16px 48px}.list__head{align-items:start}.list__acts{width:100%}.list__acts .btn{flex:1}.list__section-head>span{display:none}.list__resource-links{grid-template-columns:1fr}.view--auth{padding:16px}.auth-layout{grid-template-columns:1fr;min-height:0}.auth-intro{padding:24px;min-height:220px}.auth-intro h2{font-size:26px;margin:16px 0 8px}.auth-intro__mark{width:44px;height:44px;border-radius:12px;font-size:20px}.auth-intro__footer{display:none}.auth{padding:28px 24px}.editor__head{padding:10px 12px}.editor__name{max-width:42vw}.editor__acts .btn span{display:none}.editor__tabs{padding:0 16px}.editor__body{padding:16px 14px 40px}.block{padding:16px}#editor-customization{padding:0 14px 20px}}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important;scroll-behavior:auto!important}}
.switch{height:44px;align-items:center}.switch__thumb{top:14px}
/* Keep text legible when the account chooses a light accent. */
body[data-workspace="home"] .btn--primary{color:var(--accent-on,#fff)}
body[data-workspace="home"] :focus-visible{outline:2px solid var(--ink);outline-offset:3px}
body[data-workspace="home"] .icon-btn,body[data-workspace="home"] .btn,body[data-workspace="home"] .scene{min-height:44px}
.auth-intro h2{color:#222326}
/* Companion actions keep their hierarchy at both desktop and mobile widths. */
.card__actions{display:grid;grid-template-columns:minmax(0,1.25fr) minmax(0,1fr);gap:8px;align-content:center;min-width:0}
.card__actions .card__foot,.card__actions .card__runtime-links{display:contents}
.card__actions .btn{width:100%;min-width:0;white-space:normal;text-align:center}
.card__actions .card__foot .btn--primary{grid-column:1;grid-row:1}
.card__actions [data-edit-persona]{grid-column:2;grid-row:1}
.card__actions .card__settings:first-child{grid-column:1;grid-row:2}
.card__actions .card__settings:last-child{grid-column:2;grid-row:2}
.card__actions [data-runtime-action]{grid-column:1;grid-row:3}
.card__actions [data-delete-persona]{grid-column:2;grid-row:3}
.card__actions:not(:has(.card__runtime-links)) [data-delete-persona]{grid-row:2}
.card__name{font-size:20px}.card__desc{font-size:14px}
@media(min-width:761px){.card:only-child{grid-template-columns:minmax(0,1fr) 330px;min-height:210px}.card:only-child .card__actions{width:330px;max-width:100%}}
@media(max-width:760px){.card__actions{width:100%;max-width:none}}
