* { box-sizing: border-box; }
:root {
  color-scheme: light;
  --paper: #f7f1e8;
  --shell: #fbf7f0;
  --panel: #fffdf8;
  --panel-soft: #f3eadf;
  --ink: #25201b;
  --muted: #756b61;
  --line: #ded0bf;
  --accent: #c96442;
  --accent-dark: #8f432f;
  --green: #537565;
  --blue: #496f88;
  --rose: #a75d60;
  --shadow: 0 20px 55px rgba(66, 48, 32, .14);
}
html { min-height: 100%; scroll-behavior: smooth; }
body { margin: 0; min-height: 100vh; font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; color: var(--ink); background: radial-gradient(circle at top left, rgba(201,100,66,.16), transparent 34%), var(--paper); }
button, textarea { font: inherit; }
button { cursor: pointer; }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 300px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 20px; display: flex; flex-direction: column; gap: 18px; background: rgba(251,247,240,.96); border-right: 1px solid var(--line); backdrop-filter: blur(16px); }
.brand { display: flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; }
.brand-mark { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 10px; background: var(--ink); color: var(--panel); font-weight: 950; }
.brand strong, .brand small { display: block; }
.brand small { margin-top: 2px; color: var(--muted); font-size: 12px; }
.new-chat { min-height: 46px; border: 0; border-radius: 8px; background: var(--accent-dark); color: #fff; font-weight: 900; box-shadow: 0 12px 28px rgba(143,67,47,.22); }
.side-nav { display: grid; gap: 7px; }
.side-nav a { min-height: 42px; display: flex; align-items: center; gap: 10px; padding: 0 10px; border-radius: 8px; color: var(--muted); text-decoration: none; font-weight: 760; }
.side-nav a span { width: 28px; height: 26px; display: grid; place-items: center; border-radius: 7px; background: rgba(37,32,27,.06); color: var(--ink); font-size: 12px; }
.side-nav a.active, .side-nav a:hover { color: var(--ink); background: var(--panel-soft); }
.sidebar-status { margin-top: auto; display: flex; gap: 12px; padding: 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); box-shadow: var(--shadow); }
.status-dot { width: 10px; height: 10px; margin-top: 6px; border-radius: 50%; background: #3f8b61; box-shadow: 0 0 0 5px rgba(63,139,97,.12); flex: 0 0 auto; }
.sidebar-status p { margin: 6px 0 0; color: var(--muted); line-height: 1.45; }
.content { min-width: 0; }
.topbar { min-height: 70px; padding: 0 28px; display: flex; align-items: center; justify-content: space-between; gap: 18px; border-bottom: 1px solid rgba(222,208,191,.78); background: rgba(247,241,232,.82); backdrop-filter: blur(14px); }
.workspace-title strong, .workspace-title span { display: block; }
.workspace-title span { margin-top: 3px; color: var(--muted); font-size: 13px; }
.icon-button, .install-button { min-height: 40px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--ink); font-weight: 850; }
.icon-button { display: none; align-items: center; gap: 5px; padding: 0 12px; }
.icon-button span { width: 14px; height: 2px; border-radius: 2px; background: currentColor; }
.install-button { padding: 0 14px; color: #fff; background: var(--ink); border-color: var(--ink); }
.workspace { width: min(1320px, calc(100% - 44px)); margin: 0 auto; padding: 24px 0 88px; display: grid; gap: 18px; }
.client-workbench { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 18px; align-items: stretch; }
.composer-panel, .context-panel .mini-card, .tool-section, .card { border: 1px solid var(--line); border-radius: 10px; background: rgba(255,253,248,.96); box-shadow: var(--shadow); }
.composer-panel { padding: 24px; display: grid; gap: 18px; }
.panel-head, .section-title, .composer-actions, .selected-route { display: flex; align-items: end; justify-content: space-between; gap: 16px; }
.eyebrow { color: var(--accent-dark); font-size: 12px; font-weight: 950; text-transform: uppercase; letter-spacing: 0; }
h1 { margin: 8px 0 0; font-size: clamp(34px, 4.8vw, 60px); line-height: 1; letter-spacing: 0; max-width: 900px; }
h2 { margin: 6px 0 0; font-size: 27px; line-height: 1.12; }
.live-badge { padding: 7px 10px; border-radius: 999px; background: rgba(83,117,101,.12); color: var(--green); font-size: 13px; font-weight: 900; white-space: nowrap; }
.model-tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.model-tabs button, .template-list button, .ghost-action { min-height: 40px; padding: 0 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink); font-weight: 850; }
.model-tabs button.selected { color: #fff; background: var(--ink); border-color: var(--ink); }
.prompt-box { display: grid; gap: 9px; font-weight: 850; }
.prompt-box textarea { width: 100%; min-height: 210px; resize: vertical; padding: 16px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); line-height: 1.55; box-shadow: inset 0 1px 0 rgba(37,32,27,.04); }
.composer-actions { align-items: center; justify-content: flex-start; flex-wrap: wrap; }
.primary-action { min-height: 44px; margin-left: auto; padding: 0 20px; border: 0; border-radius: 8px; background: var(--accent-dark); color: #fff; font-weight: 950; }
.selected-route { align-items: center; padding: 14px; border-radius: 9px; background: var(--panel-soft); border: 1px solid rgba(222,208,191,.76); }
.selected-route div, .selected-route strong, .selected-route span { display: block; }
.selected-route span { color: var(--muted); margin-top: 3px; }
.context-panel { display: grid; gap: 14px; }
.mini-card { padding: 18px; }
.mini-card > span { display: block; color: var(--muted); font-size: 13px; font-weight: 850; }
.account-card strong { display: block; margin-top: 7px; font-size: 28px; }
.usage { height: 9px; margin: 18px 0 10px; overflow: hidden; border-radius: 99px; background: var(--panel-soft); }
.usage i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent), var(--blue)); }
.mini-card p { margin: 8px 0 0; color: var(--muted); line-height: 1.5; }
.route-card ol { margin: 12px 0 0; padding-left: 20px; color: var(--ink); line-height: 1.75; }
.tool-section { padding: 22px; }
.section-title { margin-bottom: 16px; }
.section-title > span, .section-title.compact span { color: var(--muted); }
.tool-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.tool-card { min-height: 126px; padding: 16px; display: flex; flex-direction: column; align-items: flex-start; justify-content: space-between; gap: 10px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); text-align: left; transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease; }
.tool-card:hover { transform: translateY(-2px); border-color: rgba(143,67,47,.42); box-shadow: 0 14px 30px rgba(66,48,32,.11); }
.tool-card strong { font-size: 17px; }
.tool-card span { color: var(--muted); line-height: 1.4; }
.dashboard-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.card { padding: 20px; }
.card.wide { grid-column: 1 / -1; }
.section-title.compact { align-items: start; margin-bottom: 14px; }
.project-list { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.project-list li, .history-list div { padding: 14px; border: 1px solid var(--line); border-radius: 9px; background: var(--shell); }
.project-list strong, .project-list span, .history-list strong, .history-list span, .history-list em { display: block; }
.project-list span, .history-list span, .history-list em { margin-top: 4px; color: var(--muted); }
.template-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.history-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.history-list em { font-style: normal; font-size: 13px; }
.mobile-tabs { display: none; }
.toast { position: fixed; right: 18px; bottom: 18px; z-index: 50; max-width: min(420px, calc(100vw - 36px)); padding: 14px 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--ink); color: #fff; box-shadow: var(--shadow); opacity: 0; transform: translateY(10px); pointer-events: none; transition: opacity .18s ease, transform .18s ease; }
.toast.show { opacity: 1; transform: translateY(0); }
@media (max-width: 1120px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; z-index: 30; inset: 0 auto 0 0; width: min(320px, calc(100vw - 44px)); transform: translateX(-105%); transition: transform .2s ease; box-shadow: var(--shadow); }
  .sidebar.open { transform: translateX(0); }
  .icon-button { display: inline-flex; }
  .workspace { width: min(100% - 28px, 1320px); padding-bottom: 96px; }
  .client-workbench { grid-template-columns: 1fr; }
  .context-panel { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .tool-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mobile-tabs { position: fixed; z-index: 20; left: 12px; right: 12px; bottom: max(12px, env(safe-area-inset-bottom)); display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; padding: 6px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255,253,248,.94); backdrop-filter: blur(10px); box-shadow: var(--shadow); }
  .mobile-tabs a { min-height: 40px; display: grid; place-items: center; border-radius: 8px; color: var(--ink); text-decoration: none; font-size: 13px; font-weight: 900; }
}
@media (max-width: 760px) {
  .topbar { padding: 0 14px; }
  .workspace-title span { display: none; }
  .install-button { display: none; }
  .workspace { width: calc(100% - 20px); padding-top: 12px; }
  .composer-panel, .tool-section, .card, .mini-card { padding: 16px; }
  h1 { font-size: 34px; }
  h2 { font-size: 23px; }
  .panel-head, .section-title, .composer-actions, .selected-route { align-items: stretch; flex-direction: column; }
  .primary-action { width: 100%; margin-left: 0; }
  .context-panel, .tool-grid, .dashboard-grid, .template-list, .history-list { grid-template-columns: 1fr; }
  .prompt-box textarea { min-height: 180px; }
}
