:root {
  color-scheme: light;
  font-family: Inter, "PingFang SC", "Microsoft YaHei UI", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  background: #f7f7fb;
  color: #211e34;
  --canvas: #f7f7fb;
  --panel: #fff;
  --ink: #211e34;
  --muted: #69667e;
  --subtle: #817d94;
  --line: #e9e7f0;
  --violet: #6845e6;
  --deep-violet: #5734d1;
  --soft-violet: #f1edff;
  --sidebar: #171528;
  --sidebar-width: 228px;
  --mobile-bar: 60px;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 320px; font-size: 14px; }
button, input, textarea, select { color: inherit; font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .55; }
.model-button[aria-disabled="true"] { cursor: wait; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
button:focus-visible, a:focus-visible, textarea:focus-visible, input:focus-visible, select:focus-visible {
  outline: 2px solid #8e72ff;
  outline-offset: 3px;
}
svg { display: block; flex: 0 0 auto; }
h1, h2, h3, p { margin: 0; }
img { max-width: 100%; }
button, a { touch-action: manipulation; }
.skip-link { position: fixed; z-index: 50; inset: 8px auto auto 8px; padding: 10px; background: white; transform: translateY(-150%); }
.skip-link:focus { transform: none; }

.layout { min-height: 100dvh; }
.stage { margin-left: var(--sidebar-width); min-width: 0; }
.sidebar {
  position: fixed;
  z-index: 15;
  inset: 0 auto 0 0;
  width: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  padding: 26px 15px 14px;
  background: linear-gradient(158deg, #1b182f 0%, #151426 62%);
  color: #f6f4ff;
}
.brand { display: flex; align-items: center; gap: 12px; margin: 1px 10px 32px; width: max-content; }
.brand img { border-radius: 11px; box-shadow: 0 5px 16px #8059ff3d; }
.brand strong { display: block; font-size: 20px; letter-spacing: .05em; line-height: 1.1; }
.brand strong span { color: #ae99ff; font-size: 16px; letter-spacing: .01em; }
.brand small { display: block; margin-top: 5px; color: #b3abcf; font-size: 9px; font-weight: 650; letter-spacing: .145em; }
.button, .icon-button, .tool-button, .text-link, .quiet-button, .suggestion {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: none;
  font-weight: 600;
  white-space: nowrap;
}
.button { min-height: 38px; padding: 0 13px; }
.button.primary { color: #fff; background: var(--violet); box-shadow: 0 3px 8px #5b32d229; }
.button.primary:hover { background: var(--deep-violet); }
.button.secondary { color: #4e4965; background: white; border-color: var(--line); }
.button.secondary:hover { color: var(--deep-violet); background: #faf8ff; border-color: #ded5ff; }
.button.new-button {
  justify-content: flex-start;
  min-height: 43px;
  padding: 0 15px;
  border-color: #987dff77;
  color: white;
  background: linear-gradient(100deg, #774ff3, #6341e4);
  box-shadow: 0 3px 14px #6c42dc36;
}
.button.new-button:hover { background: linear-gradient(100deg, #815bfd, #704aee); }
.new-button svg { width: 18px; height: 18px; }
.sidebar-scroll { flex: 1; overflow: auto; margin: 0 -4px; padding: 27px 4px 14px; scrollbar-width: thin; }
.sidebar-group { margin-top: 25px; }
.nav-label { margin: 0 10px 9px; color: #a29ab8; font-size: 11px; font-weight: 650; letter-spacing: .09em; }
.nav-link, .history-link, .side-account {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 42px;
  padding: 0 11px;
  border-radius: 8px;
  color: #c9c3db;
  font-weight: 530;
}
.nav-link + .nav-link { margin-top: 4px; }
.nav-link:hover, .history-link:hover, .side-account:hover { background: #ffffff10; color: white; }
.sidebar .nav-link.active { color: #f1ebff; background: #32264d; box-shadow: inset 0 0 0 1px #a081ff21; }
.sidebar .nav-link.active svg { color: #bca6ff; }
.history-link { min-height: 32px; font-size: 12px; color: #c1bbd1; }
.history-link.active { background: #32264d; color: #fff; }
.history-link span, .side-account span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.history-empty { color: #a19ab4; padding: 4px 10px; font-size: 12px; }
.sidebar-foot { display: grid; gap: 10px; }
.quota-card {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 9px;
  padding: 10px 9px; border-radius: 11px; color: #dbd0fd;
  background: #ffffff08; border: 1px solid #ffffff14;
}
.quota-card:hover { background: #ffffff11; }
.quota-card strong, .quota-card small { display: block; }
.quota-card strong { color: #eee9ff; font-size: 12px; }
.quota-card small { margin-top: 4px; color: #aaa3c1; font-size: 10px; }
.quota-glyph { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; background: #a785fb24; color: #c4aeff; }
.side-account { min-height: 37px; color: #bdb6d0; font-size: 12px; }
.side-account > svg:last-child { margin-left: auto; }

.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  min-height: 65px; padding: 0 clamp(23px, 3.15vw, 49px);
  background: #fff; border-bottom: 1px solid #eeecf3;
}
.top-crumb, .top-actions, .crumb-home, .top-task, .credit-chip { display: flex; align-items: center; }
.top-crumb { gap: 11px; min-width: 0; color: #312d46; font-size: 13px; font-weight: 650; white-space: nowrap; }
.top-crumb > span:last-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.crumb-home { color: #746e89; }
.crumb-separator { color: #bdb9ca; }
.top-actions { flex: 0 0 auto; gap: 16px; }
.top-task { gap: 6px; color: #646078; font-size: 12px; font-weight: 550; }
.top-task:hover, .crumb-home:hover { color: var(--deep-violet); }
.credit-chip { min-height: 30px; gap: 5px; padding: 0 9px; border-radius: 7px; color: #6245c7; background: #f2eeff; font-size: 12px; font-weight: 650; }
.credit-chip:hover { background: #eae3ff; }
.button.top-login { min-height: 33px; padding: 0 11px; border: 1px solid #e6e2f0; color: #39334e; background: #fff; font-size: 12px; }
.top-login:hover { border-color: #c9baff; color: var(--deep-violet); }
.avatar, .profile-avatar { display: grid; place-items: center; border-radius: 50%; background: var(--soft-violet); color: #6743db; font-weight: 720; }
.avatar { width: 34px; height: 34px; }
.mobile-nav, .mobile-menu, .mobile-history-button, .drawer-scrim { display: none; }
main:focus { outline: none; }

.workspace { width: min(100%, 1300px); padding: 29px clamp(24px, 3.55vw, 54px) 32px; margin: 0 auto; }
.hero {
  position: relative; display: flex; align-items: center; isolation: isolate; overflow: hidden;
  min-height: clamp(245px, 22.4vw, 323px); padding: 30px clamp(32px, 3.5vw, 61px);
  border-radius: 17px; background: #151132 url("/media/orbit.webp") center / cover no-repeat;
  color: #fff; box-shadow: 0 13px 25px #231a4420;
}
.hero::before {
  position: absolute; z-index: -1; inset: 0; content: "";
  background: linear-gradient(90deg, #1511327c 0%, #15113242 35%, transparent 60%);
}
.hero-copy { position: relative; max-width: 55%; }
.hero-label {
  display: inline-flex; align-items: center; gap: 6px; color: #e0d6ff; background: #c6b2ff22;
  border: 1px solid #c6b2ff38; border-radius: 99px; padding: 5px 9px;
  font-size: 11px; font-weight: 600; letter-spacing: .06em;
}
.hero h1 { margin: 13px 0 12px; font-size: clamp(34px, 3.4vw, 55px); font-weight: 760; line-height: 1.22; letter-spacing: -.03em; }
.hero p { color: #d4cce9; font-size: clamp(12px, 1.04vw, 15px); line-height: 1.65; }

.home-composer { margin-top: 22px; }
.composer { border: 1px solid #e5e0f2; border-radius: 15px; background: #fff; box-shadow: 0 3px 11px #20164709; }
.composer:focus-within { border-color: #c9b8ff; }
.composer-tabs {
  display: flex; align-items: center; gap: 8px; padding: 10px 15px 8px;
  border-bottom: 1px solid #f0edf6;
}
.mode-tab {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 0;
  color: #6d687e; background: none; font-weight: 650; width: max-content;
  min-height: 34px; padding: 0 12px; border-radius: 8px; font-size: 12px; white-space: nowrap;
}
.mode-tab:hover { background: #f7f4ff; color: var(--deep-violet); }
.mode-tab.selected { color: #6040d9; background: #efeaff; }
.composer textarea {
  display: block; width: calc(100% - 34px); min-height: 63px; max-height: 45dvh; resize: vertical;
  padding: 9px 1px 4px; margin: 7px 17px 0; border: 0; outline: none; background: none;
  font-size: 14px; line-height: 1.55;
}
.composer textarea:focus-visible { outline: 2px solid var(--violet); outline-offset: 1px; border-radius: 5px; }
.composer textarea::placeholder { color: #827e94; }
.composer-tools, .composer-options, .send-area { display: flex; align-items: center; gap: 8px; }
.composer-tools { justify-content: space-between; padding: 7px 15px 12px 16px; }
.composer-options { min-width: 0; }
.tool-button { min-height: 31px; padding: 0 9px; color: #5d5772; background: #f9f8fc; border-color: #ece9f3; font-size: 12px; }
.tool-button:hover { color: var(--deep-violet); border-color: #dcd1ff; background: #f4f0ff; }
.model-button { min-width: 0; max-width: min(44vw, 300px); }
.model-button span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.model-button > svg:first-child { color: #7453e8; }
.icon-button { width: 34px; height: 34px; flex-shrink: 0; padding: 0; color: #5f5877; }
.icon-button:hover { background: #f4efff; color: var(--deep-violet); }
.icon-button.attachment-button { width: 32px; height: 31px; }
.send-area { gap: 10px; flex-shrink: 0; }
.estimate { color: var(--subtle); font-size: 11px; white-space: nowrap; }
.send {
  display: grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: 9px;
  background: #6d48eb; color: #fff; box-shadow: 0 4px 9px #6d48eb45;
}
.send:hover { background: #5634d5; }
.attachment-chip {
  display: inline-flex; align-items: center; gap: 6px; max-width: calc(100% - 34px); margin: 2px 17px 3px; padding: 1px 3px 1px 8px;
  border-radius: 6px; background: #f0ecfc; color: #5b43aa; font-size: 12px;
}
.attachment-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attachment-chip img { width: 22px; height: 22px; object-fit: cover; border-radius: 4px; }
.role-strip { position: relative; display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin: 0 15px 5px; }
.role-pick-button { min-height: 27px; padding-inline: 7px; }
.role-pick-button[aria-expanded="true"] { color: var(--deep-violet); background: #f1ebff; border-color: #d8ccff; }
#role-selected { display: flex; min-width: 0; max-width: 100%; flex-wrap: wrap; align-items: center; gap: 5px; }
#role-selected:empty { display: none; }
.role-chip { display: flex; align-items: center; min-width: 0; gap: 4px; border: 1px solid #e5dbfb; border-radius: 8px; background: #f3edff; padding: 2px 3px 2px 4px; color: #49337b; font-size: 11px; }
.role-chip > span:not(.role-avatar) { min-width: 0; max-width: 217px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.role-chip .role-avatar, .role-history-link .role-avatar { width: 22px; height: 22px; border-radius: 5px; }
.role-chip .role-avatar svg, .role-history-link .role-avatar svg { width: 13px; height: 13px; }
.role-chip .icon-button { width: 20px; height: 20px; }
.role-chip .icon-button svg { width: 12px; height: 12px; }
.role-chip-note { color: var(--muted); font-size: 11px; }
.role-mentions { position: absolute; z-index: 6; inset: calc(100% + 4px) auto auto 0; width: min(410px, 100%); min-width: min(260px, 100%); max-height: 275px; overflow: auto; padding: 8px; border: 1px solid #e2d9f6; border-radius: 11px; background: white; box-shadow: 0 9px 27px #29204b27; }
.role-option-list { display: grid; gap: 3px; }
.role-option { display: flex; align-items: center; gap: 7px; border: 1px solid transparent; border-radius: 7px; padding: 5px; background: transparent; text-align: left; }
.role-option:hover, .role-option.active { color: var(--deep-violet); background: #f5f0ff; border-color: #e9dfff; }
.role-option .role-avatar { width: 33px; height: 33px; border-radius: 7px; }
.role-option > span:last-child { display: grid; min-width: 0; font-size: 12px; }
.role-option small { color: var(--muted); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.role-pop-note { margin: 5px 4px; font-size: 12px; }
.role-mentions .text-link { margin: 4px 6px 0; }
.small-icon { width: 25px; height: 25px; }
.mode-unavailable { display: flex; align-items: center; gap: 14px; min-height: 125px; padding: 15px 22px; }
.mode-unavailable > svg { color: var(--violet); }
.mode-unavailable p { margin-top: 5px; color: var(--muted); line-height: 1.55; }
.mode-unavailable .button { margin-left: auto; }

.starter-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 13px 0 0; }
.starter-label { display: inline-flex; align-items: center; gap: 5px; margin-right: 3px; color: #6f6986; font-size: 12px; font-weight: 570; white-space: nowrap; }
.starter-label svg { color: #7b60df; }
.suggestion {
  min-height: 31px; padding: 0 10px; color: #5d5771; border-color: #e8e5f0; background: #fff; font-size: 12px;
}
.suggestion svg { color: #79708c; width: 14px; height: 14px; }
.suggestion:hover { color: var(--deep-violet); border-color: #d5c8ff; background: #f9f6ff; }
.suggestion:hover svg { color: var(--deep-violet); }

.featured { margin-top: 29px; }
.section-heading, .page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; margin-bottom: 16px; }
.section-heading h2 { font-size: 23px; font-weight: 740; letter-spacing: -.025em; line-height: 1.3; }
.section-heading p, .page-heading p { margin-top: 5px; color: var(--muted); font-size: 13px; line-height: 1.55; }
.text-link { justify-content: flex-start; min-height: 30px; padding: 0; color: var(--deep-violet); font-size: 12px; }
.text-link:hover { color: #4527af; text-decoration: underline; text-underline-offset: 3px; }
.agent-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; }
.agent-card {
  position: relative; min-width: 0; display: flex; flex-direction: column; padding: 14px; border: 1px solid var(--line);
  border-radius: 12px; background: #fff; transition: box-shadow .18s, border-color .18s, transform .18s;
}
.agent-card:hover { border-color: #dcd1ff; transform: translateY(-2px); box-shadow: 0 6px 16px #3a226912; }
.card-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 5px; }
.agent-icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 11px; flex: 0 0 auto; }
.violet { --card-bg: #eee7ff; --card-fg: #6b42d7; }
.peach { --card-bg: #fff0e8; --card-fg: #b95735; }
.mint { --card-bg: #e1f5ee; --card-fg: #207b65; }
.blue { --card-bg: #e9edff; --card-fg: #4d55c8; }
.agent-icon { background: var(--card-bg); color: var(--card-fg); }
.card-tag { margin-top: 1px; padding: 4px 6px; color: #666079; background: #f5f4fa; border-radius: 5px; font-size: 10px; white-space: nowrap; }
.card-link { flex: 1; display: flex; flex-direction: column; }
.card-link::after { position: absolute; inset: 0; content: ""; border-radius: inherit; }
.card-link:focus-visible { outline: none; }
.card-link:focus-visible::after { outline: 2px solid var(--violet); outline-offset: 2px; }
.card-link h3 { margin: 12px 0 4px; font-size: 15px; font-weight: 730; line-height: 1.37; }
.card-link p { color: #6b667e; font-size: 12px; line-height: 1.6; }
.card-action { margin-top: auto; padding-top: 11px; display: flex; align-items: center; gap: 5px; color: var(--deep-violet); font-size: 12px; font-weight: 650; }
.favorite-button { position: relative; z-index: 1; }
.favorite-button.saved { color: #7045df; }
.favorite-button.saved svg { fill: #e8dbff; }
.agent-icon img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.agent-emoji { font-size: 22px; line-height: 1; }
.agent-detail-cover { display: block; width: 100%; max-height: min(46vh, 410px); aspect-ratio: 16 / 9; object-fit: cover; border-radius: 14px; margin-bottom: 12px; }
.agent-greeting { background: #f0ebff; color: #483880; border-radius: 10px; margin: 12px 0; padding: 11px 14px; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; }
.composer-notice { padding: 0 15px 7px; color: var(--muted); font-size: 12px; }

.subpage { padding-top: 35px; }
.page-heading { align-items: center; margin-bottom: 25px; }
.page-heading h1 { font-size: clamp(24px, 3vw, 35px); overflow-wrap: anywhere; font-weight: 740; letter-spacing: -.025em; line-height: 1.25; }
.page-heading p { margin-top: 8px; font-size: 14px; }
.narrow { max-width: 1060px; }
.directory-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 13px; }
.tabs-line { display: flex; gap: 11px; flex-shrink: 0; }
.line-tab, .profile-link { display: flex; align-items: center; gap: 7px; font-weight: 650; color: #5d5771; }
.line-tab { padding: 10px 9px; border-bottom: 2px solid transparent; white-space: nowrap; font-size: 13px; }
.line-tab.active { color: var(--deep-violet); border-color: var(--violet); }
.search-box {
  display: flex; align-items: center; gap: 8px; width: min(290px, 45vw); min-height: 39px; padding: 0 10px;
  color: #7e7891; background: #fff; border: 1px solid var(--line); border-radius: 9px;
}
.search-box:focus-within { border-color: #bbabf8; }
.search-box input { width: 100%; min-width: 0; border: 0; outline: none; background: transparent; font-size: 13px; }
.search-box input:focus-visible { outline: none; }
.filter-row { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 20px; }
.filter-chip { min-height: 33px; padding: 0 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: #615c74; font-size: 12px; font-weight: 610; }
.filter-chip.selected, .filter-chip:hover { color: var(--deep-violet); background: #efeaff; border-color: #dfd4ff; }
.result-count { margin: 0 0 11px; color: var(--muted); font-size: 12px; }
.history-pager.agent-pager { align-items: center; justify-content: center; }
.agent-pager .button { min-height: 44px; }
.empty-state { display: flex; min-height: 280px; padding: 25px; flex-direction: column; align-items: center; justify-content: center; text-align: center; background: #fff; border: 1px solid var(--line); border-radius: 12px; }
.empty-symbol { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 13px; color: var(--violet); background: var(--soft-violet); margin-bottom: 13px; }
.empty-state h2 { font-size: 17px; }
.empty-state p { color: var(--muted); margin: 7px 0 14px; line-height: 1.55; }
.back-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.agent-intro {
  display: flex; align-items: center; gap: 17px; padding: 26px; border-radius: 14px; border: 1px solid var(--line);
  background: linear-gradient(108deg, var(--card-bg), #fff 85%);
}
.agent-intro .agent-icon { width: 57px; height: 57px; border: 1px solid #ffffffb0; }
.agent-summary { flex: 1; }
.agent-summary > span { color: var(--card-fg); font-size: 12px; font-weight: 650; }
.agent-summary h1 { margin: 6px 0; font-size: clamp(21px, 3vw, 31px); }
.agent-summary p { color: var(--muted); line-height: 1.5; }
.agent-prompt { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 22px 0 12px; }

.chat-page { padding-bottom: 25px; }
.chat-page .page-heading { margin-bottom: 20px; }
.chat-page .page-heading h1 { font-size: clamp(21px, 2.55vw, 32px); }
.thread { display: grid; gap: 13px; }
.turn { scroll-margin-top: 83px; min-width: 0; }
.user-turn { margin: 0 0 15px auto; background: var(--soft-violet); max-width: 85%; width: fit-content; padding: 11px 15px; border-radius: 13px 13px 3px 13px; }
.user-turn p, .reply { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.75; }
.run-roles { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; margin-top: 7px; font-size: 11px; color: var(--muted); }
.role-history-link { display: inline-flex; min-width: 0; align-items: center; gap: 5px; background: #fff; border-radius: 7px; border: 1px solid #e5dbfb; padding: 3px 5px; color: var(--deep-violet); }
.role-history-link:hover { border-color: #b2a0eb; }
.role-history-link > span:last-child { overflow-wrap: anywhere; }
.role-history-link small { padding-left: 4px; color: var(--muted); font-size: 10px; }
.assistant-turn { display: flex; align-items: flex-start; gap: 10px; min-width: 0; }
.assistant-avatar { border-radius: 9px; }
.answer { flex: 1; min-width: 0; background: white; border: 1px solid var(--line); border-radius: 3px 13px 13px; padding: 12px 14px; }
.answer-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin-bottom: 7px; }
.run-model { color: var(--muted); font-size: 11px; }
.run-usage { margin-top: 7px; }
.run-recovery { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px;
  margin: 12px 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); }
.run-recovery > div { display: flex; flex-wrap: wrap; gap: 6px; }
.run-recovery p { color: var(--muted); }
.answer > .small-button { margin-top: 9px; }
.assistant-turn .quiet-button { margin-top: 9px; }
.chat-composer { position: sticky; bottom: 12px; margin-top: 20px; }
.chat-work { display: block; max-width: 490px; width: fit-content; overflow: hidden; border-radius: 9px; }
.chat-work img { display: block; max-height: 55vh; object-fit: contain; }
.media-player { display: block; width: 100%; max-width: 430px; }
.video-player { max-width: 520px; max-height: 58vh; border-radius: 9px; background: #211b30; }
.work-player { display: grid; place-items: center; overflow: hidden; aspect-ratio: 1.4; }
.work-player.video-work { background: #211b30; }
.video-work video { height: 100%; max-height: none; border-radius: 0; object-fit: contain; }
.audio-work { padding: 10px; background: linear-gradient(135deg, #f1e9fd, #e3effd); }
.answer > .media-player { margin-top: 8px; }
.result-download { margin-top: 6px; }
.cursor { display: inline-block; width: 6px; height: 13px; vertical-align: -.08em; margin-left: 3px; border-radius: 3px; background: var(--violet); animation: blink 1s step-end infinite; }
@keyframes blink { 50% { opacity: .12; } }

.work-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.work-card { min-width: 0; overflow: hidden; background: #fff; border-radius: 12px; border: 1px solid var(--line); }
.work-visual { display: block; background: #201842; aspect-ratio: 1.4; overflow: hidden; }
.work-visual img { width: 100%; height: 100%; object-fit: cover; transition: transform .23s; display: block; }
.work-visual:hover img { transform: scale(1.035); }
.work-visual.text-work { display: grid; place-items: center; background: linear-gradient(135deg, #f6ecff, #e7e7ff); color: #5a3aa0; }
.text-work span { display: grid; place-items: center; gap: 7px; font-size: 12px; font-weight: 660; }
.text-preview { margin: 0; padding: 13px; max-height: 59vh; overflow: auto; border-radius: 9px; background: #faf8ff; font: inherit; line-height: 1.75; white-space: pre-wrap; overflow-wrap: anywhere; }
.work-meta { display: flex; align-items: center; justify-content: space-between; gap: 9px; padding: 11px; }
.work-meta > div { min-width: 0; }
.work-meta h2 { font-size: 13px; margin-bottom: 4px; }
.work-meta > div:first-child > span { color: var(--muted); font-size: 11px; }
.work-title { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--deep-violet); text-decoration: underline; text-underline-offset: .15em; }
.work-filters { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px 18px; margin-bottom: 15px; }
.work-filters .filter-row { margin: 0; }
.work-source-filter { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.work-source-filter select { min-height: 44px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; background: white; color: var(--ink); }
.work-detail-visual { margin-bottom: 15px; overflow: hidden; border-radius: 12px; }
.work-detail-visual :is(.work-player, .work-visual) { aspect-ratio: auto; }
.work-detail-visual .work-visual img { height: auto; max-height: 60vh; object-fit: contain; transform: none; }
.work-detail-visual video { width: 100%; max-height: 60vh; }
.work-detail-visual .text-work { min-height: 130px; }
.work-details dl { display: grid; gap: 8px; margin: 0; }
.work-details dl div { display: grid; grid-template-columns: 5em minmax(0, 1fr); gap: 12px; }
.work-details dt { color: var(--muted); }
.work-details dd { overflow-wrap: anywhere; }
.work-details .dialog-actions { justify-content: flex-start; flex-wrap: wrap; gap: 8px; }
.work-receipt { display: flex; width: fit-content; margin-top: 4px; font-size: 12px; }
.work-actions { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.work-actions .button { min-height: 36px; padding: 0 8px; font-size: 12px; }
.asset-selection-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; margin: 0 0 14px; padding: 10px; background: #f6f2ff; border: 1px solid #e5dcfa; border-radius: 10px; }
.work-library-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.asset-selection-count { color: #493472; font-size: 13px; font-weight: 680; margin-inline: 3px 4px; }
.asset-choice { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; font-size: 12px; color: #574277; cursor: pointer; }
.asset-choice input { inline-size: 17px; block-size: 17px; margin: 0; accent-color: var(--deep-violet); cursor: pointer; }
.work-card > .asset-choice { display: flex; padding: 0 11px; border-bottom: 1px solid var(--line); }
.work-card:has(.asset-choice input:checked) { border-color: var(--violet); }
.asset-choice:has(input:checked) { color: var(--deep-violet); font-weight: 680; }
.button.secondary.asset-danger { color: #982d51; }
.button.secondary.asset-danger:hover { background: #fff1f5; border-color: #edcbd6; }
.asset-confirm-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; }
@media (pointer: coarse) {
  .asset-choice, .asset-selection-bar .button, .work-actions .button, .work-actions .icon-button,
  .work-library-actions .button, .work-details .button { min-height: 44px; }
  .work-actions .icon-button { min-width: 44px; }
}
.role-tools { display: flex; margin-bottom: 13px; }
.role-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(245px, 1fr)); gap: 12px; }
.role-card { display: grid; min-width: 0; gap: 10px; align-content: start; padding: 13px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.role-card-head { display: flex; align-items: center; gap: 9px; }
.role-card h2 { margin: 0; font-size: 16px; overflow-wrap: anywhere; }
.role-card-head p { font-size: 11px; margin-top: 5px; }
.role-avatar { display: grid; flex: 0 0 auto; place-items: center; overflow: hidden; width: 43px; height: 43px; border-radius: 9px; background: #eae2fc; color: #6443a8; }
.role-avatar img { display: block; width: 100%; height: 100%; object-fit: cover; }
.role-description { color: var(--muted); font-size: 13px; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; }
.role-description.snapshot { display: block; }
.role-layout { display: grid; align-items: start; grid-template-columns: minmax(0, 1.35fr) minmax(215px, 1fr); gap: 13px; }
.role-form-card textarea { display: block; width: 100%; max-width: 100%; min-height: 104px; margin-top: 6px; padding: 8px 10px; resize: vertical; border: 1px solid #e7e2f1; border-radius: 8px; background: #fbfaff; font: inherit; font-weight: 450; line-height: 1.55; }
.role-form-card p { font-size: 12px; }
.role-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.role-reference { display: grid; place-items: center; overflow: hidden; width: 100%; min-height: 145px; border-radius: 9px; aspect-ratio: 4 / 3; background: #f2ebfa; }
.role-reference img { display: block; width: 100%; height: 100%; min-height: 0; object-fit: contain; }
.role-reference.placeholder { align-content: center; gap: 6px; color: var(--muted); font-size: 12px; }
.role-reference.placeholder svg { color: #8c73ba; }
.tool-directory-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin-bottom: 13px; }
.tool-directory-bar .filter-row { margin-bottom: 0; }
.tool-collections, .agent-collections { gap: 12px; margin-bottom: 12px; border-bottom: 1px solid var(--line); }
:is(.tool-collections, .agent-collections) .line-tab { min-height: 44px; padding-inline: 10px; background: transparent; border-width: 0 0 2px; }
.tool-desktop-preview .tool-result-inputs { margin: 0; }
.tool-desktop-preview > .button, .agent-desktop-prompt > .button { justify-self: start; min-height: 44px; }
.agent-desktop-prompt { margin-block: 14px; }
.tool-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
.tool-card { display: grid; gap: 10px; min-width: 0; padding: 15px; border: 1px solid var(--line); border-radius: 13px; background: white; }
.tool-card h2, .tool-panel h2, .tool-attachment h2 { font-size: 16px; }
.tool-card p, .tool-detail-head p { color: var(--muted); line-height: 1.55; overflow-wrap: anywhere; }
.tool-card-head { display: flex; align-items: center; gap: 8px; }
.tool-card-head .card-tag { margin-left: auto; }
.tool-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-top: 8px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); }
.tool-detail-head { display: flex; align-items: center; gap: 12px; padding: 17px; margin-bottom: 14px; background: linear-gradient(105deg, #f0eaff, #fff); border: 1px solid var(--line); border-radius: 13px; }
.tool-detail-head > div { flex: 1; min-width: 0; }
.tool-detail-head .agent-icon { width: 52px; height: 52px; }
.tool-detail-head > div > span { display: block; font-size: 12px; color: #6e559a; }
.tool-detail-head h1 { margin: 4px 0; font-size: clamp(20px, 2.5vw, 29px); }
.tool-layout { display: grid; align-items: start; grid-template-columns: minmax(0, 1.27fr) minmax(238px, 1fr); gap: 13px; }
.tool-panel { display: grid; min-width: 0; gap: 12px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.tool-panel textarea { display: block; margin-top: 6px; padding: 8px 10px; width: 100%; min-height: 97px; resize: vertical; border: 1px solid #e7e2f1; border-radius: 8px; background: #fbfaff; font: inherit; font-weight: 450; line-height: 1.55; }
.tool-attachment { display: grid; gap: 8px; padding-bottom: 11px; border-bottom: 1px solid var(--line); }
.tool-attachment p, .tool-note { font-size: 12px; line-height: 1.55; }
.tool-attachment .role-reference { aspect-ratio: 16 / 10; min-height: 120px; max-height: 240px; }
.tool-run-controls { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.tool-run-controls span { display: block; font-size: 11px; color: var(--muted); margin-bottom: 4px; }
.tool-run-controls strong { color: var(--deep-violet); }
.tool-result-inputs { display: grid; gap: 5px; margin: 7px 0 0; color: #5e5678; font-size: 12px; }
.tool-result-inputs > div { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 9px; }
.tool-result-inputs dd { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.employee-tabs { border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.employee-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 255px), 1fr)); gap: 13px; }
.employee-card { display: grid; grid-template-rows: auto 1fr auto; min-width: 0; gap: 13px; padding: 16px; border: 1px solid var(--line); border-radius: 13px; background: #fff; }
.employee-card-heading, .employee-photo, .employee-profile { display: flex; align-items: center; gap: 12px; min-width: 0; }
.employee-card-heading > div { min-width: 0; }
.employee-card h2, .employee-panel h2 { font-size: 16px; overflow-wrap: anywhere; }
.employee-card p, .employee-panel p { color: var(--muted); line-height: 1.6; overflow-wrap: anywhere; }
.employee-panel .inline-error { color: #a3384b; }
.employee-card-heading p { font-size: 12px; margin-top: 2px; }
.employee-duties { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; white-space: pre-line; }
.employee-avatar { display: grid; place-items: center; width: 45px; height: 45px; flex: 0 0 auto; overflow: hidden; border-radius: 12px;
  background: #eee7ff; color: #5235a6; font-size: 17px; font-weight: 740; text-overflow: ellipsis; text-align: center; line-height: 1.1; overflow-wrap: anywhere; }
.employee-avatar.blue { background: #e4efff; color: #23588f; }
.employee-avatar.teal { background: #e0f4ed; color: #176d58; }
.employee-avatar.rose { background: #fae8f2; color: #8b3561; }
.employee-avatar img { width: 100%; height: 100%; object-fit: cover; }
.employee-tags { display: flex; flex-wrap: wrap; gap: 5px; min-width: 0; }
.employee-card-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 7px; padding-top: 10px; border-top: 1px solid var(--line); }
.employee-profile { padding: 16px; margin-bottom: 14px; border: 1px solid var(--line); border-radius: 13px; background: linear-gradient(108deg, #f1ebff, #fff 78%); }
.employee-profile .page-heading { flex: 1; min-width: 0; margin: 0; align-items: center; overflow-wrap: anywhere; }
.employee-profile .employee-avatar { width: 53px; height: 53px; font-size: 20px; }
.employee-panel { display: grid; min-width: 0; gap: 12px; padding: 15px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.employee-panel label { min-width: 0; }
.employee-panel :is(.author-field input, textarea, select) { display: block; width: 100%; min-width: 0; padding: 9px 10px; margin-top: 6px;
  border: 1px solid #e7e2f1; border-radius: 8px; background: #fbfaff; color: inherit; font: inherit; }
.employee-panel textarea { min-height: 90px; resize: vertical; line-height: 1.55; }
.employee-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.employee-capabilities { display: flex; flex-wrap: wrap; gap: 7px 15px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; }
.employee-capabilities legend { padding: 0 4px; font-weight: 650; }
.employee-capabilities input { accent-color: var(--violet); }
.employee-photo > div { display: flex; flex-wrap: wrap; gap: 7px; }
.employee-submit { display: flex; justify-content: flex-end; }
.employee-notes { gap: 8px; margin-top: 13px; }
.employee-notes p { white-space: pre-wrap; }
.employee-notes h2:not(:first-child) { margin-top: 4px; }
.employee-scoped { margin: 0 0 11px; }
.employee-record .text-link { flex-shrink: 0; font-size: 12px; }
.employee-detail-nav, .employee-detail-nav > span, .team-detail-outline, .team-directory-bar, .team-result-actions {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 12px;
}
.employee-check { display: flex; align-items: flex-start; gap: 8px; color: #553f7c; font-weight: 580; line-height: 1.5; }
.employee-check input { accent-color: var(--violet); flex: 0 0 auto; margin: 3px 0 0; }
.team-directory-bar { margin-bottom: 14px; }
.team-emblem, .team-position { display: grid; place-items: center; flex: 0 0 auto; background: #eee7ff; color: #563698; border-radius: 10px; }
.team-emblem { width: 45px; height: 45px; }
.team-position { width: 31px; height: 31px; font-size: 13px; font-weight: 720; }
.team-member-editor { display: grid; min-width: 0; gap: 8px; padding: 11px; border-radius: 10px; border: 1px solid var(--line); background: #fdfaff; }
.team-member-head { display: flex; align-items: center; gap: 8px; }
.team-member-head > div:nth-child(2) { flex: 1; min-width: 0; }
.team-member-head h3, .team-memory-card h3 { font-size: 15px; overflow-wrap: anywhere; }
.team-member-head p { font-size: 12px; }
.team-moves { display: flex; flex: 0 0 auto; align-items: center; gap: 4px; }
.team-moves .button { min-height: 27px; padding-inline: 6px; font-size: 11px; }
.team-add-member { display: grid; grid-template-columns: minmax(0, 1fr) max-content; align-items: end; gap: 8px; }
.team-member-list { display: grid; gap: 0; margin: 10px 0 15px; padding: 0; list-style: none; border: 1px solid var(--line);
  border-radius: 12px; background: white; }
.team-member-list li { display: grid; grid-template-columns: max-content minmax(0, 1fr) max-content; align-items: start; gap: 10px; padding: 12px; }
.team-member-list li + li { border-top: 1px solid var(--line); }
.team-member-list li > div { overflow-wrap: anywhere; }
.team-member-list small, .team-member-list p { display: block; color: var(--muted); font-size: 12px; line-height: 1.55; margin-top: 4px; white-space: pre-wrap; }
.team-member-list .text-link { align-self: center; font-size: 12px; }
.team-detail-outline h2 { font-size: 16px; }
.team-history-empty { padding: 12px 0; }
.team-results { display: grid; gap: 9px; }
.team-run-status { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; }
.team-brief { margin: 10px 0; padding: 10px 12px; border-radius: 10px; background: #f1ebfa; color: #514367; overflow-wrap: anywhere; }
.team-brief p, .team-memory-card > p, .team-responsibility { white-space: pre-wrap; }
.team-brief p { margin-top: 4px; }
.team-result-actions { justify-content: start; }
.team-result summary { cursor: pointer; font-weight: 650; color: #513884; }
.team-reply { margin: 7px 0 0; padding: 10px; background: #f8f4fd; border-radius: 8px; color: #443660; white-space: pre-wrap;
  overflow-wrap: anywhere; font: inherit; line-height: 1.6; }
.team-attempts { font-size: 12px; }
.team-memory-toggle { grid-template-columns: minmax(0, 1fr) max-content; align-items: center; margin-bottom: 12px; }
.team-memory-toggle p { margin-top: 4px; }
@media (max-width: 450px) {
  .employee-detail-nav > span { justify-content: start; }
  .team-member-list li { gap: 7px; padding-inline: 8px; }
  .team-member-list .text-link svg { display: none; }
}
.credit-lookup { grid-template-columns: minmax(0, 1fr) auto; align-items: end; }
.credit-form { margin-top: 13px; }
.credit-grant-record .amount { flex-shrink: 0; }
@media (max-width: 580px) {
  .employee-profile .page-heading { align-items: flex-start; flex-wrap: wrap; }
  .employee-form-grid { grid-template-columns: minmax(0, 1fr); }
  .employee-panel :is(.author-field input, textarea, select) { font-size: 16px; }
  .employee-record { gap: 6px; padding-inline: 8px; }
  .employee-record .text-link svg { display: none; }
}
.record-list { background: #fff; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.record { display: flex; align-items: center; gap: 11px; padding: 12px 15px; }
.record + .record { border-top: 1px solid var(--line); }
.record-link { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.record-link:hover strong { color: var(--deep-violet); }
.record-icon { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 9px; background: var(--soft-violet); color: var(--deep-violet); flex: 0 0 auto; }
.record-label { display: block; min-width: 0; flex: 1; }
.record-label strong, .record-label small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.record-label strong { font-size: 13px; font-weight: 650; }
.record-label small { margin-top: 4px; color: var(--muted); font-size: 11px; }
.status-pill { display: inline-flex; align-items: center; gap: 4px; padding: 4px 7px; color: #5f5975; background: #f3f1f7; border-radius: 99px; white-space: nowrap; font-size: 10px; font-weight: 650; }
.status-pill i { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.status-pill.running, .status-pill.queued { color: #6844d4; background: #f1ebff; }
.status-pill.reconciling { color: #845319; background: #fff2d9; }
.status-pill.succeeded { color: #216f54; background: #e7f6eb; }
.status-pill.failed { color: #a3384b; background: #fff0f1; }
.quiet-button { min-height: 28px; border: 0; padding: 0 5px; color: #6b6287; background: #f8f6fc; font-size: 12px; }
.quiet-button:hover { color: var(--deep-violet); background: var(--soft-violet); }
.small-button { min-height: 30px; font-size: 12px; }
.balance-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.balance { min-height: 112px; display: grid; align-content: center; gap: 6px; padding: 15px 20px; background: #fff; border: 1px solid var(--line); border-radius: 12px; }
.balance span { color: var(--muted); }
.balance strong { font-size: 31px; color: var(--deep-violet); }
.list-heading { margin: 22px 0 12px; font-size: 17px; }
.review-list { display: grid; gap: 12px; }
.review-record { display: grid; gap: 12px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: white; }
.review-summary { display: flex; align-items: center; gap: 10px; }
.review-record dl { display: grid; gap: 5px; margin: 0; font-size: 12px; }
.review-record dl div { display: flex; gap: 8px; align-items: baseline; }
.review-record dt { flex: 0 0 93px; color: var(--muted); }
.review-record dd { margin: 0; overflow-wrap: anywhere; }
.review-record .button { justify-self: start; }
.author-draft-list { display: grid; gap: 9px; }
.author-draft-card { display: flex; align-items: center; gap: 11px; min-width: 0; padding: 12px; background: white; border: 1px solid var(--line); border-radius: 11px; }
.author-draft-card:hover { border-color: #c8b9ff; color: var(--deep-violet); }
.author-status.pending { color: #845319; background: #fff2d9; }
.author-status.approved { color: #216f54; background: #e7f6eb; }
.author-status.rejected { color: #a3384b; background: #fff0f1; }
.author-layout { display: grid; grid-template-columns: minmax(0, 1.64fr) minmax(235px, 1fr); gap: 16px; align-items: start; }
.author-form { min-width: 0; }
.author-fields { display: grid; gap: 12px; margin: 0; padding: 13px; min-width: 0; background: #fff; border: 1px solid var(--line); border-radius: 12px; }
.author-fields legend { padding: 0 6px; font-size: 14px; font-weight: 700; }
.author-field-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 9px; }
.author-fields textarea, #agent-review-form textarea { display: block; margin-top: 6px; padding: 8px 10px; min-height: 52px; width: 100%; max-width: 100%; resize: vertical; background: #fbfaff; border: 1px solid #e7e2f1; border-radius: 8px; font: inherit; font-weight: 450; line-height: 1.55; }
.author-fields p { font-size: 12px; line-height: 1.5; }
.author-media-field { min-width: 0; }
.author-media-field input[type="file"], .author-import input { padding: 5px; overflow: hidden; min-width: 0; font-size: 11px; color: var(--muted); }
.author-media-field input::file-selector-button, .author-import input::file-selector-button { margin-right: 7px; padding: 5px 8px; border: 1px solid #e2daf8; border-radius: 6px; color: var(--deep-violet); background: #f3edff; cursor: pointer; }
.author-media-field .quiet-button { margin-top: 5px; }
.author-import { padding: 8px; border: 1px dashed #cab9ef; border-radius: 9px; background: #f9f6ff; }
.author-import > span { display: block; font-size: 11px; padding-top: 5px; }
.author-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.author-preview { min-width: 0; position: sticky; top: 82px; scroll-margin-top: 72px; padding: 13px; border: 1px solid var(--line); border-radius: 12px; background: white; }
.author-preview h2, .author-submissions h2 { font-size: 16px; margin: 0 0 12px; }
.author-preview-cover { overflow: hidden; border-radius: 9px; aspect-ratio: 16 / 9; color: var(--card-fg); background: radial-gradient(ellipse at 78% 15%, white 0%, var(--card-bg) 68%); }
.author-preview-cover img { display: block; width: 100%; height: 100%; object-fit: cover; }
.author-preview-cover div { display: grid; width: 100%; height: 100%; place-items: center; }
.author-card-info { display: flex; align-items: center; gap: 9px; margin-top: 12px; }
.author-card-info small { color: var(--muted); font-size: 11px; }
.author-card-info h3 { font-size: 16px; margin-top: 3px; overflow-wrap: anywhere; }
.author-preview-copy { color: var(--muted); margin-top: 10px; line-height: 1.55; overflow-wrap: anywhere; }
.author-preview-facts { display: grid; gap: 6px; margin: 12px 0; padding: 9px; border-radius: 8px; background: #f8f7fb; font-size: 12px; }
.author-preview-facts div { display: flex; align-items: baseline; gap: 9px; min-width: 0; }
.author-preview-facts dt { color: var(--muted); flex: 0 0 31px; }
.author-preview-facts dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.author-welcome { border-left: 2px solid #9d84f0; padding: 2px 0 2px 9px; font-size: 12px; }
.author-welcome p { margin-top: 4px; color: var(--muted); white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.5; }
.author-submissions { margin-top: 20px; padding: 15px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.author-submission { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); }
.author-submission p { font-size: 12px; margin-top: 5px; overflow-wrap: anywhere; }
.author-submission .author-review-note { color: #46405e; white-space: pre-wrap; }
.author-preview-notice { color: #695d84; font-size: 13px; line-height: 1.55; margin-bottom: 12px; }
.author-example { margin-bottom: 10px; }
.author-review-details summary { cursor: pointer; color: var(--deep-violet); font-weight: 650; }
.author-review-content { padding: 12px 0 0; }
.author-review-content .author-preview-cover { max-width: 370px; }
.author-prompt { font-size: 12px; padding: 9px; border-radius: 8px; background: #f8f7fb; }
.author-prompt pre { font: inherit; max-height: 245px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; }
.home-shortcuts, .author-steps, .author-step-footer { display: none; }
.create-shortcuts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px; margin-top: 18px; }
.home-shortcut { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 6px; min-height: 49px;
  padding: 6px; border: 1px solid var(--line); border-radius: 9px; background: #fff; color: var(--deep-violet); font-size: 12px; font-weight: 650; }
.home-shortcut:hover { background: var(--soft-violet); }
.mobile-history { position: fixed; inset: 0 auto 0 0; width: min(87vw, 350px); height: 100%; max-height: none; max-width: none;
  margin: 0; padding: 0; border: 0; background: var(--panel); color: var(--ink); box-shadow: 8px 0 32px #211e3428; }
.mobile-history[open] { display: flex; flex-direction: column; animation: history-enter .2s ease-out; }
.mobile-history::backdrop { background: #19142e78; }
html:has(.mobile-history[open]) { overflow: hidden; }
.mobile-history-head, .mobile-history-footer { padding: 12px 16px; }
.mobile-history-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); }
.mobile-history-head h2 { font-size: 18px; }
.mobile-history-head .icon-button { width: 44px; height: 44px; }
.mobile-history-list { flex: 1; min-height: 0; overflow: auto; padding: 10px 12px; overscroll-behavior: contain; touch-action: pan-y; }
.mobile-history-list p { margin: 8px 4px 13px; color: var(--muted); font-size: 13px; }
.mobile-history-item { display: flex; align-items: center; gap: 9px; min-height: 44px; padding: 9px 10px; border-radius: 8px; color: var(--ink); }
.mobile-history-item svg { flex-shrink: 0; color: var(--violet); }
.mobile-history-item span { overflow-wrap: anywhere; }
.mobile-history-item:hover, .mobile-history-item.active { background: var(--soft-violet); color: var(--deep-violet); }
.mobile-history-footer { padding-bottom: calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }
.mobile-history-footer .button { width: 100%; min-height: 44px; justify-content: center; }
@keyframes history-enter { from { transform: translateX(-100%); } to { transform: translateX(0); } }
.amount { white-space: nowrap; font-variant-numeric: tabular-nums; }
.amount.up { color: #247558; }
.receipt-link { color: var(--deep-violet); text-decoration: underline; text-underline-offset: 2px; }
.profile-card { display: flex; align-items: center; gap: 13px; padding: 18px; background: #fff; border: 1px solid var(--line); border-radius: 12px; }
.profile-card > div { flex: 1; min-width: 0; }
.profile-card h2 { overflow-wrap: anywhere; font-size: 17px; margin-bottom: 5px; }
.profile-card p { color: var(--muted); line-height: 1.5; }
.profile-avatar { width: 51px; height: 51px; font-size: 22px; flex-shrink: 0; }
.profile-links { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 13px; }
.profile-link { min-height: 53px; padding: 0 13px; background: #fff; border-radius: 10px; border: 1px solid var(--line); }
.profile-link:hover { color: var(--deep-violet); }
.profile-link > svg:last-child { margin-left: auto; }
.muted, .loading-text { color: var(--muted); }
.inline-error { color: #a72f50; line-height: 1.55; }

.dialog {
  width: min(430px, calc(100% - 24px)); max-height: calc(100dvh - 24px); overflow: auto;
  color: var(--ink); padding: 19px; background: #fff; border: 1px solid #e5e0f1; border-radius: 15px;
  box-shadow: 0 24px 90px #16112854;
}
.dialog.wide-dialog { width: min(740px, calc(100% - 24px)); }
.dialog::backdrop { background: #19142980; backdrop-filter: blur(3px); }
.dialog-heading { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 12px; }
.dialog-heading h2 { font-size: 20px; }
.dialog-note { color: var(--muted); line-height: 1.55; margin-bottom: 13px; }
.auth-form { display: grid; gap: 13px; }
.auth-form label { display: block; font-weight: 650; font-size: 13px; }
.auth-form label .muted { font-weight: 450; font-size: 11px; }
.auth-form input, .auth-form select { display: block; min-height: 40px; width: 100%; padding: 0 10px; margin-top: 6px; background: #fbfaff; border: 1px solid #e7e2f1; border-radius: 8px; font-weight: 450; }
.full-button { width: 100%; min-height: 42px; }
.auth-switch { display: flex; justify-content: center; align-items: center; gap: 4px; margin-top: 9px; color: var(--muted); font-size: 12px; }
.model-list { display: grid; gap: 8px; }
.model-option { display: flex; align-items: center; text-align: left; gap: 9px; width: 100%; padding: 9px; color: #4b4262; border: 1px solid var(--line); background: #fff; border-radius: 9px; }
.model-option.selected, .model-option:hover { border-color: #d3c5ff; background: #f9f6ff; color: var(--deep-violet); }
.settings-fields { display: grid; gap: 12px; }
.settings-advanced { border: 1px solid var(--line); border-radius: 9px; background: #fbf9ff; }
.settings-advanced summary { padding: 11px; color: var(--deep-violet); font-size: 13px; font-weight: 650; cursor: pointer; }
.settings-advanced .settings-fields { padding: 0 11px 11px; }
.asset-picker-toolbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.asset-picker-actions { display: flex; flex-wrap: wrap; gap: 8px; }
#reference-picker-status { margin: 0 0 10px; }
.asset-picker-toolbar .line-tab { background: transparent; border-width: 0 0 2px; cursor: pointer; font-family: inherit; }
.asset-picker-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 9px; max-height: min(48dvh, 480px); overflow: auto; padding: 3px; }
.asset-option { display: block; min-width: 0; padding: 4px; border-radius: 9px; border: 1px solid var(--line); background: #fff; text-align: left; }
.asset-option.selected, .asset-option:hover { border-color: #ad97fa; background: #f7f3ff; }
.asset-option img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 6px; background: var(--soft-violet); }
.asset-option span { display: block; padding: 5px 2px 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.asset-empty { padding: 19px 10px; text-align: center; background: #f9f7fd; color: var(--muted); border-radius: 9px; }
.preview-image { display: block; width: 100%; max-height: 70dvh; object-fit: contain; background: #1c1735; border-radius: 9px; }
.reference-video-preview { display: block; width: 100%; max-height: 50dvh; border-radius: 9px; background: #1c1735; }
.dialog-actions { display: flex; justify-content: flex-end; margin-top: 10px; }
.dictation-actions { gap: 8px; }
.asset-upload-fields { display: grid; gap: 12px; }
.asset-upload-field { display: grid; gap: 5px; min-width: 0; margin-bottom: 10px; }
.asset-upload-field input { max-width: 100%; }
.asset-upload-field input::file-selector-button { padding: 8px; margin-right: 7px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); color: var(--ink); cursor: pointer; }
#storage-media-preview { display: grid; gap: 10px; }
#storage-media-preview :is(audio, video) { width: 100%; max-height: 52vh; }
.toast {
  position: fixed; z-index: 24; inset: auto 20px 21px auto; padding: 10px 14px;
  max-width: min(400px, calc(100vw - 40px)); border-radius: 9px; color: white;
  background: #272139; box-shadow: 0 6px 22px #21153637; line-height: 1.5;
}

@media (max-width: 1150px) {
  :root { --sidebar-width: 207px; }
  .agent-grid { gap: 10px; }
  .agent-card { padding: 11px; }
  .hero-copy { max-width: 58%; }
}
@media (max-width: 980px) {
  :root { --sidebar-width: 189px; }
  .sidebar { padding-inline: 11px; }
  .agent-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero { background-position: 54% center; }
  .hero-copy { max-width: 62%; }
}
@media (max-width: 720px), (orientation: landscape) and (max-height: 500px) and (pointer: coarse) {
  .stage { margin: 0; padding-bottom: calc(var(--mobile-bar) + env(safe-area-inset-bottom)); }
  .sidebar { width: min(265px, calc(100% - 57px)); transform: translateX(-105%); visibility: hidden; transition: transform .23s, visibility .23s; padding: 23px 14px 15px; }
  .sidebar.is-open { transform: translateX(0); visibility: visible; }
  .drawer-scrim:not([hidden]) { display: block; position: fixed; inset: 0; z-index: 14; width: 100%; border: 0; background: #19142e78; }
  .mobile-menu { display: inline-flex; width: 44px; height: 44px; margin-left: -7px; flex-shrink: 0; }
  .mobile-history-button { display: inline-flex; align-items: center; justify-content: center; gap: 4px; width: auto;
    min-width: 44px; height: 44px; padding: 0 5px; color: var(--deep-violet); font-size: 11px; white-space: nowrap; }
  .crumb-home, .crumb-separator { display: none; }
  .topbar { min-height: 54px; padding: 0 14px; }
  .top-crumb { gap: 5px; }
  .top-actions { gap: 9px; }
  .top-task span { display: none; }
  .top-task { display: grid; place-items: center; width: 28px; height: 32px; }
  .mobile-nav {
    display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
    position: fixed; z-index: 11; bottom: 0; left: 0; right: 0; min-height: var(--mobile-bar);
    padding: 3px 4px env(safe-area-inset-bottom); border-top: 1px solid #eae5f2; background: #fff;
  }
  .mobile-nav .nav-link { color: #69637b; font-size: 11px; min-height: 49px; justify-content: center; flex-direction: column; gap: 3px; margin: 0; padding: 4px 3px; }
  .mobile-nav .nav-link.active { color: var(--deep-violet); background: #f4efff; }
  .workspace { padding: 16px 14px 23px; }
  .hero { min-height: 220px; padding: 19px 22px; border-radius: 12px; background-position: 62% center; }
  .hero-copy { max-width: 66%; }
  .hero::before { background: linear-gradient(90deg, #151132eb, #151132a8 42%, #15113200 84%); }
  .hero h1 { font-size: clamp(27px, 6vw, 40px); }
  .hero p { font-size: 12px; }
  .home-composer { margin-top: 14px; }
  .composer-tabs { padding: 7px 7px 6px; gap: 2px; justify-content: space-between; }
  .mode-tab { gap: 4px; padding: 0 6px; flex: 0 1 auto; font-size: clamp(10px, 3.15vw, 12px); min-height: 34px; }
  .mode-tab svg { width: 14px; height: 14px; }
  .composer textarea { width: calc(100% - 24px); min-height: 61px; margin: 6px 12px 0; font-size: 16px; }
  .composer textarea::placeholder { font-size: 13px; }
  .composer-tools { padding: 5px 10px 10px; }
  .composer-options, .send-area { gap: 5px; }
  .send { width: 44px; height: 44px; }
  .model-button { max-width: 44vw; gap: 4px; }
  .tool-button { padding: 0 6px; font-size: 11px; }
  .estimate { font-size: 10px; }
  .mode-unavailable { flex-wrap: wrap; gap: 8px; min-height: 113px; padding: 10px; }
  .mode-unavailable > div { width: calc(100% - 36px); font-size: 12px; }
  .mode-unavailable .button { min-height: 30px; }
  .starter-row { margin-top: 10px; gap: 5px; }
  .starter-label { font-size: 11px; }
  .suggestion { min-height: 29px; font-size: 11px; padding: 0 7px; }
  .home-shortcuts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; margin-top: 16px; }
  .create-shortcuts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .featured { margin-top: 21px; }
  .section-heading h2 { font-size: 20px; }
  .section-heading p { font-size: 12px; }
  .agent-grid { gap: 8px; }
  #agent-results .agent-grid { grid-template-columns: minmax(0, 1fr); }
  .agent-card { padding: 10px; }
  .card-link h3 { font-size: 14px; }
  .card-link p { font-size: 11px; }
  .card-tag { font-size: 9px; padding: 3px 4px; }
  .agent-icon { width: 38px; height: 38px; border-radius: 9px; }
  .agent-icon svg { width: 20px; height: 20px; }
  .subpage { padding-top: 24px; }
  .page-heading { margin-bottom: 16px; }
  .directory-toolbar { flex-wrap: wrap; gap: 6px; }
  .search-box { width: 100%; }
  .search-box input, .auth-form input, .auth-form select { font-size: 16px; }
  .agent-intro { padding: 13px; gap: 10px; }
  .agent-intro .agent-icon { width: 43px; height: 43px; }
  .agent-intro .button { min-height: 31px; padding: 0 7px; font-size: 11px; }
  .agent-summary p { font-size: 12px; }
  .agent-prompt { flex-wrap: wrap; }
  .work-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .work-meta { flex-direction: column; align-items: stretch; gap: 5px; }
  .work-source-filter select { font-size: 16px; }
  .role-strip { margin-inline: 10px; }
  .role-mentions { position: static; width: 100%; }
  .role-layout { grid-template-columns: minmax(0, 1fr); }
  .role-form-card textarea { font-size: 16px; }
  .tool-grid, .tool-layout { grid-template-columns: minmax(0, 1fr); }
  .toolbox-page .page-heading { flex-direction: column; align-items: stretch; gap: 12px; }
  .toolbox-page .toolbox-directory-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(135px, 1fr)); }
  .toolbox-directory-actions .button { min-height: 44px; justify-content: center; }
  .tool-panel textarea { font-size: 16px; }
  .tool-detail-head { padding: 13px; }
  .author-layout { grid-template-columns: minmax(0, 1fr); }
  .author-steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 5px; margin-bottom: 12px; scroll-margin-top: 62px; }
  .author-steps .button { justify-content: center; min-width: 0; min-height: 43px; padding: 0 4px; }
  .author-steps .button[aria-current="step"] { color: var(--deep-violet); background: var(--soft-violet); border-color: #d8c9fb; }
  .author-step-footer { display: flex; gap: 8px; justify-content: space-between; }
  .author-step-footer .button { min-height: 42px; }
  .author-step-footer [data-id="1"] { margin-left: auto; }
  .author-layout [data-author-panel] { display: none; }
  .author-layout[data-author-step="profile"] [data-author-panel="profile"],
  .author-layout[data-author-step="dialogue"] [data-author-panel="dialogue"],
  .author-layout[data-author-step="capabilities"] [data-author-panel="capabilities"] { display: grid; }
  .author-layout[data-author-step="preview"] .author-preview { display: block; grid-row: 1; position: static; }
  .author-layout[data-author-step="profile"] .author-step-footer [data-id="-1"],
  .author-layout[data-author-step="preview"] .author-step-footer [data-id="1"],
  .author-layout:not([data-author-step="preview"]) .author-actions :is([data-operation="preview"], [data-operation="publish"]) { display: none; }
  .author-fields textarea, #agent-review-form textarea { font-size: 16px; }
  .author-fields { padding: 10px; }
  .author-actions .button { font-size: 12px; }
  .dialog.composer-sheet { position: fixed; inset: auto 0 0; margin: 0; width: 100%; max-width: none; max-height: min(82dvh, 560px);
    padding-bottom: max(19px, calc(12px + env(safe-area-inset-bottom))); border-radius: 16px 16px 0 0; }
  .dialog.composer-sheet .model-option { min-height: 54px; }
  .dialog.composer-sheet summary { min-height: 42px; }
  .chat-composer { bottom: calc(var(--mobile-bar) + env(safe-area-inset-bottom) + 6px); }
  .composer-keyboard .mobile-nav { visibility: hidden; }
  .composer-keyboard .stage { padding-bottom: var(--composer-keyboard-inset); }
  .composer-keyboard .topbar { position: relative; }
  .composer-keyboard .chat-composer { bottom: calc(var(--composer-keyboard-inset) + 6px); }
  .composer-keyboard .composer textarea { max-height: min(45dvh, max(61px, calc(var(--composer-viewport-height) - 116px))); }
  .composer-keyboard .dialog.composer-sheet { bottom: var(--composer-keyboard-inset); max-height: min(var(--composer-viewport-height), 560px); }
  .turn { scroll-margin-top: 64px; }
  .record { padding: 9px 7px; gap: 6px; }
  .profile-card { padding: 12px; gap: 9px; }
  .profile-avatar { width: 40px; height: 40px; }
  .profile-card .button { font-size: 12px; padding: 0 8px; }
  .toast { inset: auto 12px calc(var(--mobile-bar) + env(safe-area-inset-bottom) + 10px) auto; }
}
@media (max-width: 375px) {
  .history-context .top-task { display: none; }
  .composer-tabs { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 3px; }
  .mode-tab { width: 100%; min-width: 0; gap: 2px; padding-inline: 2px; }
  .mode-tab svg { width: 12px; height: 12px; }
  .composer-options { flex-wrap: wrap; }
  .composer-options .model-button { flex: 0 1 100%; max-width: 100%; justify-content: flex-start; }
  .send-area { align-self: flex-end; }
  .hero { min-height: 200px; padding-inline: 16px; }
  .hero-copy { max-width: 72%; }
  .hero h1 { font-size: 26px; }
  .card-tag { display: none; }
}
@media (max-width: 340px) {
  .history-context .top-crumb > span:last-child { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
@media (prefers-contrast: more), (forced-colors: active) {
  :root { --muted: #514b63; --subtle: #5f586f; }
  .composer textarea::placeholder { color: var(--muted); }
  :is(button, a, textarea, input, select, summary):focus-visible,
  .composer textarea:focus-visible, .search-box:focus-within { outline: 2px solid currentColor; outline-offset: 2px; }
  .card-link:focus-visible::after { outline-color: currentColor; }
  :is(.mode-tab, .filter-chip, .model-option)[aria-pressed="true"],
  .nav-link[aria-current="page"], .line-tab.active, .text-link, .work-title {
    text-decoration: underline; text-underline-offset: .24em; text-decoration-thickness: .13em;
  }
}
@media (forced-colors: active) {
  .hero { color: CanvasText; background: Canvas; }
  .hero::before { display: none; }
  .composer, .dialog, .mobile-history { border: 1px solid CanvasText; }
  .composer textarea { border: 1px solid CanvasText; padding-inline: 6px; }
  :is(.button, .icon-button, .tool-button, .send, .mode-tab, .model-option) { border: 1px solid ButtonText; }
  :is(button, a) svg { color: inherit !important; }
  button:disabled { opacity: 1; }
}
