:root {
  color-scheme: dark;
  --bg: #000;
  --sidebar: #202124;
  --sidebar-soft: #282a2d;
  --panel: #1f2023;
  --panel-hover: #2a2b2f;
  --line: #34363a;
  --text: #e8eaed;
  --muted: #a8abb2;
  --faint: #777b84;
  --accent: #8ab4f8;
  --accent-2: #a78bfa;
  --danger: #ff8a80;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI",
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei UI", "Noto Sans CJK SC",
    Arial, sans-serif;
  font-size: 13px;
  line-height: 1.48;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
textarea,
input {
  font: inherit;
}

button {
  color: inherit;
}

.app-shell {
  display: grid;
  grid-template-columns: 292px minmax(0, 1fr);
  min-height: 100vh;
  background: var(--bg);
}

.top-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #141518;
  background: rgba(0, 0, 0, 0.88);
  padding: 11px 22px;
}

.top-nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 12px;
}

.top-nav a:hover {
  color: var(--text);
}

.top-nav div {
  display: flex;
  gap: 16px;
}

.top-nav .nav-brand {
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-weight: 700;
}

.chat-nav {
  display: none;
}

.home-page,
.benchmark-page {
  min-height: 100vh;
  background: #050506;
}

.home-main,
.benchmark-main {
  width: min(1160px, calc(100vw - 40px));
  margin: 0 auto;
}

.home-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 420px;
  align-items: center;
  gap: 48px;
  min-height: calc(100vh - 55px);
  padding: 7vh 0 8vh;
}

.home-hero-copy {
  min-width: 0;
}

.home-hero h1,
.benchmark-header h1 {
  max-width: 820px;
  margin: 8px 0 14px;
  font-size: clamp(32px, 5vw, 64px);
  line-height: 1.05;
  font-weight: 650;
  letter-spacing: 0;
}

.home-hero p:not(.eyebrow),
.benchmark-header p:not(.eyebrow) {
  max-width: 680px;
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.7;
}

.hero-visual {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0)),
    #0f1012;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.34);
  overflow: hidden;
  aspect-ratio: 16 / 9;
}

.hero-visual img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.visual-chip {
  position: absolute;
  border: 1px solid rgba(232, 234, 237, 0.22);
  border-radius: 999px;
  background: rgba(5, 6, 7, 0.72);
  color: var(--text);
  backdrop-filter: blur(12px);
  padding: 7px 10px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  font-weight: 700;
}

.visual-label {
  position: absolute;
  border-radius: 6px;
  background: rgba(5, 6, 7, 0.58);
  color: rgba(232, 234, 237, 0.9);
  backdrop-filter: blur(10px);
  padding: 5px 7px;
  font-size: 11px;
  font-weight: 650;
}

.chip-role {
  left: 50%;
  top: 14px;
  transform: translateX(-50%);
}

.chip-tool {
  right: 14px;
  top: 18px;
}

.chip-score {
  left: 18px;
  bottom: 14px;
}

.label-design {
  left: 9%;
  top: 39%;
}

.label-nutrition {
  left: 17%;
  bottom: 21%;
}

.label-language {
  right: 8%;
  top: 44%;
}

.label-game {
  right: 20%;
  bottom: 14%;
}

.home-actions {
  display: flex;
  gap: 10px;
  margin-top: 28px;
}

.primary-link,
.secondary-link {
  border-radius: 999px;
  padding: 10px 14px;
  text-decoration: none;
  font-size: 13px;
  font-weight: 650;
}

.primary-link {
  background: var(--text);
  color: #050506;
}

.secondary-link {
  border: 1px solid var(--line);
  color: var(--text);
}

.hero-feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 24px;
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin: 0 0 16px;
}

.section-heading h2 {
  max-width: 680px;
  margin: 0;
  font-size: clamp(22px, 3vw, 34px);
  line-height: 1.12;
  font-weight: 650;
  letter-spacing: 0;
}

.role-section-heading {
  margin-top: 56px;
}

.tool-skill-section {
  margin: 56px 0 0;
}

.compact-link {
  flex: 0 0 auto;
  padding: 8px 12px;
  font-size: 12px;
}

.tool-skill-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
  gap: 12px;
}

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

.tool-list article,
.skill-composer {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #101113;
}

.tool-list article {
  min-height: 134px;
  padding: 14px;
}

.tool-list span,
.composer-path span {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  border: 1px solid #2b2d31;
  border-radius: 999px;
  background: #090a0b;
  color: var(--accent);
  padding: 3px 8px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 10px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.tool-list strong {
  display: block;
  margin-top: 16px;
  font-size: 14px;
}

.tool-list p,
.composer-examples p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.62;
}

.skill-composer {
  padding: 16px;
}

.composer-node {
  border: 1px solid rgba(138, 180, 248, 0.36);
  border-radius: 8px;
  background: rgba(138, 180, 248, 0.08);
  color: var(--text);
  padding: 14px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}

.composer-path {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 14px 0;
}

.composer-path span {
  justify-content: center;
  color: #c7d2fe;
}

.composer-examples {
  display: grid;
  gap: 8px;
}

.composer-examples article {
  border: 1px solid #25272b;
  border-radius: 8px;
  background: #0b0c0e;
  padding: 12px;
}

.composer-examples strong {
  display: block;
  font-size: 13px;
}

.framework-flow {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  align-items: stretch;
  gap: 10px;
  margin-bottom: 26px;
}

.framework-flow article {
  position: relative;
  min-height: 168px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #101113;
  padding: 14px;
}

.framework-flow article span,
.career-entry span {
  display: inline-flex;
  align-items: center;
  height: 22px;
  border: 1px solid #2b2d31;
  border-radius: 999px;
  color: var(--accent);
  background: #0a0b0d;
  padding: 0 8px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 10px;
  font-weight: 700;
}

.framework-flow article strong {
  display: block;
  margin-top: 18px;
  font-size: 14px;
}

.framework-flow article p {
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.62;
}

.flow-arrow {
  display: none;
}

.career-entry-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.career-entry {
  display: block;
  min-height: 174px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #111214;
  padding: 16px;
  color: var(--text);
  text-decoration: none;
  transition: border-color 0.16s ease, background 0.16s ease, transform 0.16s ease;
}

.career-entry:hover {
  border-color: #5f6368;
  background: #17191c;
  transform: translateY(-1px);
}

.career-entry strong {
  display: block;
  margin-top: 28px;
  font-size: 18px;
  font-weight: 650;
}

.career-entry p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.65;
}

.hero-feature-grid article {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #101113;
  padding: 12px;
}

.hero-feature-grid strong,
.hero-feature-grid span {
  display: block;
}

.hero-feature-grid strong {
  font-size: 12px;
  margin-bottom: 7px;
}

.hero-feature-grid span {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
}

.benchmark-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  padding: 52px 0 24px;
}

.benchmark-status {
  margin-bottom: 12px;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
}

.benchmark-review {
  margin-bottom: 14px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0f1012;
}

.benchmark-review strong {
  display: block;
  margin-bottom: 5px;
  font-size: 13px;
}

.benchmark-review span {
  display: block;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
}

.benchmark-review p {
  max-width: 920px;
  margin: 10px 0 0;
  color: var(--text);
  font-size: 13px;
  line-height: 1.7;
}

.benchmark-table-wrap {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow-x: auto;
  background: #0f1012;
}

.benchmark-table-wrap table {
  width: 100%;
  border-collapse: collapse;
}

.benchmark-table-wrap th,
.benchmark-table-wrap td {
  border-bottom: 1px solid var(--line);
  padding: 13px 14px;
  text-align: left;
}

.benchmark-table-wrap th {
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
}

.benchmark-table-wrap td span {
  display: block;
  margin-top: 2px;
  color: var(--faint);
  font-size: 11px;
}

.sidebar {
  background: var(--sidebar);
  padding: 10px 10px 14px;
  overflow-y: auto;
}

.sidebar-actions {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
}

.icon-button {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 18px;
}

.icon-button:hover {
  background: var(--sidebar-soft);
  color: var(--text);
}

.brand {
  padding: 0 4px 10px;
}

.brand h1,
.brand-home {
  display: inline-block;
  margin: 0;
  color: var(--text);
  font-size: 18px;
  font-weight: 650;
  letter-spacing: 0;
  text-decoration: none;
}

.brand-home:hover {
  color: #f5f8ff;
}

.brand p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.sidebar-links {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin: 0 0 10px;
}

.sidebar-links a {
  display: grid;
  place-items: center;
  min-height: 30px;
  border: 1px solid #303238;
  border-radius: 8px;
  background: #17181a;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  text-decoration: none;
}

.sidebar-links a:hover {
  border-color: #3d414a;
  background: #24262a;
  color: var(--text);
}

.sidebar-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin: 8px 0 12px;
  border-radius: 12px;
  background: #17181a;
  padding: 3px;
}

.tab-button {
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  padding: 7px 8px;
  font-size: 12px;
  font-weight: 600;
}

.tab-button.active {
  background: var(--sidebar-soft);
  color: var(--text);
}

.sidebar-panel {
  display: none;
}

.sidebar-panel.active {
  display: grid;
}

.role-list,
.history-list {
  gap: 10px;
}

.history-button {
  width: 100%;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  padding: 10px 11px;
  text-align: left;
}

.history-button:hover,
.history-button.active {
  background: var(--sidebar-soft);
}

.history-button strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 600;
}

.history-button span,
.history-empty {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.history-empty {
  border: 1px dashed var(--line);
  border-radius: 10px;
  padding: 12px;
  text-align: center;
}

.role-section {
  display: grid;
  gap: 5px;
}

.role-section + .role-section {
  margin-top: 2px;
}

.role-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 6px 3px;
  color: var(--faint);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 10px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.role-section-title em {
  font-style: normal;
  color: #60646d;
}

.role-nav-item {
  position: relative;
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  width: 100%;
  min-height: 52px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  padding: 7px 8px;
  text-align: left;
}

.role-nav-item:hover {
  border-color: #3a3d44;
  background: #26282c;
}

.role-nav-item.active {
  border-color: rgba(138, 180, 248, 0.34);
  background: linear-gradient(180deg, rgba(138, 180, 248, 0.16), rgba(138, 180, 248, 0.06));
}

.role-nav-item.active::before {
  content: "";
  position: absolute;
  left: -2px;
  top: 11px;
  bottom: 11px;
  width: 2px;
  border-radius: 999px;
  background: var(--accent);
}

.role-avatar {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid #3a3d44;
  border-radius: 8px;
  background: #161719;
  color: #dfe6f4;
  font-size: 11px;
  font-weight: 700;
}

.role-nav-item.active .role-avatar {
  border-color: rgba(138, 180, 248, 0.4);
  background: rgba(138, 180, 248, 0.16);
  color: #f5f8ff;
}

.role-copy {
  min-width: 0;
}

.role-copy strong,
.role-copy small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.role-copy strong {
  font-size: 13px;
  font-weight: 650;
}

.role-copy small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.25;
}

.role-meta {
  align-self: start;
  margin-top: 2px;
  color: var(--faint);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 9.5px;
  white-space: nowrap;
}

.chat-panel {
  position: relative;
  display: grid;
  grid-template-rows: auto auto auto 1fr auto;
  min-width: 0;
  min-height: 100vh;
  background: var(--bg);
}

.chat-header {
  grid-row: 1;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 18px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.chat-header.compact h2,
.chat-header.compact p:last-child {
  display: none;
}

.eyebrow {
  margin: 0;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
}

.secondary-button {
  border: 0;
  border-radius: 999px;
  background: #151618;
  color: var(--muted);
  cursor: pointer;
  padding: 7px 11px;
  font-size: 12px;
}

.secondary-button:hover {
  background: var(--panel);
  color: var(--text);
}

.welcome-panel {
  grid-row: 2;
  width: min(860px, calc(100vw - 340px));
  margin: 26vh auto 24px;
}

.welcome-panel p {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 17px;
}

.welcome-panel h2 {
  margin: 0;
  color: var(--text);
  font-size: clamp(30px, 3.6vw, 48px);
  font-weight: 500;
  letter-spacing: 0;
  line-height: 1.12;
}

.has-conversation .welcome-panel {
  display: none;
}

.starter-row {
  grid-row: 3;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  width: min(860px, calc(100vw - 340px));
  margin: 0 auto;
  padding: 0 0 12px;
}

.has-conversation .starter-row {
  border-bottom: 1px solid #111;
  width: 100%;
  margin: 0;
  padding: 8px max(18px, calc((100vw - 292px - 860px) / 2 + 18px));
}

.starter-row button {
  flex: 0 0 auto;
  border: 0;
  border-radius: 999px;
  background: #111214;
  color: var(--muted);
  cursor: pointer;
  padding: 10px 14px;
  font-size: 13px;
}

.starter-row button:hover {
  background: var(--panel);
  color: var(--text);
}

.messages {
  grid-row: 4;
  min-height: 0;
  padding: 20px max(18px, calc((100vw - 292px - 860px) / 2 + 18px)) 132px;
  overflow-y: auto;
}

body:not(.has-conversation) .messages {
  display: none;
}

.message {
  max-width: 860px;
  margin-bottom: 18px;
  line-height: 1.66;
  font-size: 13px;
}

.message.user {
  margin-left: auto;
  width: fit-content;
  max-width: min(720px, 82%);
  background: #1f2023;
  border-radius: 18px;
  padding: 9px 13px;
  white-space: pre-wrap;
}

.message.assistant {
  background: transparent;
  border: 0;
  padding: 0;
}

.message.assistant p {
  margin: 0 0 10px;
}

.message.assistant p:last-child {
  margin-bottom: 0;
}

.message.assistant h3,
.message.assistant h4,
.message.assistant h5 {
  margin: 16px 0 7px;
  font-size: 14px;
  line-height: 1.45;
  font-weight: 650;
}

.message.assistant h3:first-child,
.message.assistant h4:first-child,
.message.assistant h5:first-child {
  margin-top: 0;
}

.message.assistant ul {
  margin: 5px 0 12px;
  padding-left: 20px;
}

.message.assistant li {
  margin: 4px 0;
}

.message.assistant strong {
  font-weight: 700;
}

.message.assistant code {
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #111214;
  padding: 1px 5px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.92em;
}

.message.assistant pre {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #0f1012;
  padding: 12px;
}

.message.assistant pre code {
  border: 0;
  background: transparent;
  padding: 0;
}

.message.assistant .table-scroll {
  max-width: 100%;
  margin: 10px 0 16px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #0f1012;
}

.message.assistant table {
  width: 100%;
  min-width: 520px;
  border-collapse: collapse;
  font-size: 12px;
}

.message.assistant th,
.message.assistant td {
  border-bottom: 1px solid var(--line);
  padding: 9px 11px;
  text-align: left;
  vertical-align: top;
}

.message.assistant th {
  background: #17181a;
  color: var(--text);
  font-weight: 650;
  white-space: nowrap;
}

.message.assistant tr:nth-child(even) td {
  background: #121315;
}

.message.assistant tr:last-child td {
  border-bottom: 0;
}

.message.pending {
  color: var(--muted);
}

.thinking-card {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #0f1012;
  padding: 9px 11px;
}

.thinking-card strong {
  display: block;
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
}

.thinking-card span {
  display: block;
  margin-top: 2px;
  color: var(--faint);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 10px;
}

.thinking-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-2);
  box-shadow: 0 0 12px var(--accent-2);
  animation: pulse 1.2s ease-in-out infinite;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 0.45;
    transform: scale(0.85);
  }
  50% {
    opacity: 1;
    transform: scale(1.15);
  }
}

.message.error {
  color: var(--danger);
}

.composer {
  grid-row: 5;
  align-self: end;
  position: sticky;
  bottom: 0;
  display: block;
  padding: 10px max(18px, calc((100vw - 292px - 860px) / 2 + 18px)) 22px;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0), #000 24%);
}

body:not(.has-conversation) .composer {
  padding-top: 0;
  background: transparent;
}

.composer-box {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto 34px;
  align-items: end;
  gap: 8px;
  max-width: 860px;
  margin: 0 auto;
  border: 1px solid #2a2b2f;
  border-radius: 28px;
  background: var(--panel);
  padding: 10px 12px;
  box-shadow: none;
}

.composer-model-picker {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  max-width: 190px;
  border: 1px solid #34363c;
  border-radius: 999px;
  background: #151619;
  padding: 0 9px;
}

.composer-model-picker span {
  color: var(--faint);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 9.5px;
  letter-spacing: 0.06em;
}

.composer-model-picker select {
  min-width: 112px;
  max-width: 140px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 11.5px;
}

.attach-button input {
  display: none;
}

.attach-button,
.composer button {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  cursor: pointer;
}

.attach-button {
  border: 0;
  color: var(--muted);
  background: transparent;
  font-size: 24px;
  line-height: 1;
}

.attach-button:hover {
  background: var(--panel-hover);
  color: var(--text);
}

textarea {
  width: 100%;
  min-height: 34px;
  max-height: 160px;
  resize: none;
  border: 0;
  outline: 0;
  padding: 7px 2px;
  background: transparent;
  color: var(--text);
  font-size: 13px;
}

textarea::placeholder {
  color: var(--faint);
}

.composer button {
  border: 0;
  background: #2f3033;
  color: var(--text);
  font-size: 18px;
  padding: 0;
}

.composer button:hover {
  background: #3a3b40;
}

.attachment-tray {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  max-width: 860px;
  margin: 0 auto 8px;
}

.tool-tray {
  display: flex;
  justify-content: flex-start;
  max-width: 860px;
  margin: 0 auto 8px;
}

.tool-button {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #121315;
  color: var(--text);
  cursor: pointer;
  padding: 7px 11px;
  font-size: 12px;
}

.tool-button:hover {
  background: var(--panel-hover);
}

.audio-result audio {
  width: min(520px, 100%);
  margin-top: 8px;
}

.attachment-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  max-width: 240px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #121315;
  padding: 6px 8px;
}

.attachment-chip span {
  color: var(--accent);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 10px;
  font-weight: 700;
}

.attachment-chip strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 500;
}

.attachment-chip button {
  width: 20px;
  height: 20px;
  border: 0;
  background: var(--panel-hover);
  color: var(--muted);
  border-radius: 50%;
  cursor: pointer;
}

.composer button:disabled,
.secondary-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

@media (max-width: 820px) {
  .home-hero {
    grid-template-columns: 1fr;
    gap: 24px;
    min-height: 0;
    padding: 64px 0 44px;
  }

  .framework-flow,
  .career-entry-grid,
  .tool-skill-layout,
  .tool-list,
  .hero-feature-grid {
    grid-template-columns: 1fr;
  }

  .framework-flow article {
    min-height: 0;
  }

  .benchmark-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .app-shell {
    grid-template-columns: 1fr;
  }

  .chat-panel {
    overflow: hidden;
  }

  .messages {
    overflow-x: hidden;
    word-break: break-word;
  }

  .message {
    max-width: 100%;
    overflow-wrap: break-word;
  }

  .attachment-tray {
    overflow-x: auto;
    max-width: 100%;
  }

  .sidebar {
    max-height: 42vh;
    border-bottom: 1px solid #111;
  }

  .role-list {
    grid-template-columns: 1fr;
  }

  .role-nav-item {
    grid-template-columns: 30px minmax(0, 1fr) auto;
    min-height: 48px;
  }

  .welcome-panel,
  body:not(.has-conversation) .composer,
  .starter-row {
    width: calc(100vw - 28px);
  }

  .welcome-panel {
    margin-top: 12vh;
  }

  .messages {
    padding: 16px 14px 120px;
  }

  .header-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .composer {
    padding: 10px 14px 16px;
  }

  .composer {
    padding: 10px 14px 16px;
    box-sizing: border-box;
    width: 100vw;
    overflow: hidden;
  }

  #attachmentTray,
  #toolTray {
    width: 100%;
    box-sizing: border-box;
    flex-wrap: wrap;
  }

  .composer-box {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    border-radius: 24px;
    padding: 8px 10px;
    width: 100%;
    box-sizing: border-box;
    background: var(--panel);
  }

  .composer-model-picker {
    order: 1;
    flex: 1 1 auto;
    min-width: 80px;
    max-width: 120px;
  }

  .attach-button {
    order: 2;
    width: 32px;
    height: 32px;
    flex-shrink: 0;
  }

  .composer-box textarea {
    order: 3;
    flex: 1 1 100%;
    min-height: 36px;
    max-height: 120px;
  }

  #sendBtn {
    order: 4;
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    border-radius: 50%;
    background: var(--accent);
    color: #000;
    border: none;
    font-size: 16px;
    cursor: pointer;
    z-index: 10;
    position: relative;
  }

  #sendBtn:disabled {
    background: #444;
    cursor: not-allowed;
  }
}

/* Image preview in chat */
.message-images {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.message-image-thumb {
  width: 120px;
  height: 120px;
  object-fit: cover;
  border-radius: 8px;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: transform 0.15s, box-shadow 0.15s;
}

.message-image-thumb:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.image-viewer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  cursor: pointer;
}

.image-viewer-full {
  max-width: 90vw;
  max-height: 90vh;
  border-radius: 8px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.image-viewer-close {
  position: absolute;
  top: 20px;
  right: 24px;
  font-size: 32px;
  color: #fff;
  cursor: pointer;
  opacity: 0.7;
}

.image-viewer-close:hover {
  opacity: 1;
}
