:root {
  color-scheme: light;
  --paper: oklch(97% 0.016 88);
  --paper-soft: oklch(94.5% 0.018 88);
  --paper-raised: oklch(98.2% 0.012 88);
  --paper-muted: oklch(90% 0.014 88);
  --ink: oklch(22% 0.018 160);
  --ink-strong: oklch(16% 0.018 160);
  --ink-soft: oklch(40% 0.012 160);
  --ink-muted: oklch(58% 0.012 160);
  --cromos-ink: oklch(17% 0.025 165);
  --cromos-ink-2: oklch(22% 0.026 165);
  --lime: oklch(78.6% 0.173 121);
  --lime-dark: oklch(53% 0.13 121);
  --lime-soft: oklch(90% 0.07 121);
  --amber: oklch(70% 0.15 76);
  --amber-soft: oklch(94% 0.045 76);
  --blue: oklch(57% 0.11 248);
  --blue-soft: oklch(92% 0.04 248);
  --green: oklch(53% 0.115 151);
  --green-soft: oklch(91% 0.042 151);
  --red: oklch(57% 0.15 25);
  --red-soft: oklch(92% 0.04 25);
  --line: oklch(82% 0.014 88);
  --line-soft: oklch(88% 0.012 88);
  --focus-ring: 0 0 0 4px oklch(78.6% 0.173 121 / 0.22);
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --duration-fast: 160ms;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-kerning: normal;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--paper);
}

body {
  min-height: 100vh;
  margin: 0;
  display: grid;
  grid-template-columns: 278px minmax(0, 1fr);
  overflow-x: hidden;
  background:
    radial-gradient(circle at 88% 0%, oklch(91% 0.06 121 / 0.26), transparent 27rem),
    linear-gradient(135deg, var(--paper), oklch(94% 0.018 88));
  color: var(--ink);
}

button,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

button:focus,
a:focus,
textarea:focus {
  outline: none;
}

button:focus-visible,
a:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--lime);
  outline-offset: 3px;
  box-shadow: var(--focus-ring);
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 2.25rem;
  line-height: 1.05;
  letter-spacing: -0.04em;
  font-weight: 760;
}

h2 {
  font-size: 1.375rem;
  line-height: 1.18;
  letter-spacing: -0.025em;
  font-weight: 740;
}

.skip-link {
  position: fixed;
  top: var(--space-3);
  left: var(--space-3);
  z-index: 20;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  background: var(--lime);
  color: var(--ink-strong);
  font-weight: 760;
  transform: translateY(-160%);
  transition: transform var(--duration-fast) var(--ease-out);
}

.skip-link:focus {
  transform: translateY(0);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.sidebar {
  min-height: 100vh;
  padding: var(--space-6) var(--space-4) var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
  background:
    radial-gradient(circle at 16% 8%, oklch(32% 0.075 130 / 0.42), transparent 13rem),
    linear-gradient(180deg, var(--cromos-ink), oklch(13% 0.022 165));
  color: oklch(94% 0.012 88);
}

.brand-block {
  position: relative;
  display: grid;
  gap: var(--space-2);
  padding: 0 var(--space-1) var(--space-4);
  border-bottom: 1px solid oklch(100% 0.006 88 / 0.13);
}

.cromos-wordmark {
  width: max-content;
  color: oklch(96% 0.01 88);
  text-decoration: none;
  font-family: Impact, "Arial Narrow", "DIN Condensed", ui-sans-serif, system-ui, sans-serif;
  font-size: clamp(2.65rem, 4vw, 4.2rem);
  line-height: 0.9;
  letter-spacing: 0.035em;
  transform: scaleX(0.78);
  transform-origin: left center;
}

.brand-slash,
.cromos-mark {
  display: block;
  width: 5px;
  height: 34px;
  border-radius: 999px;
  background: var(--lime);
  transform: rotate(19deg);
}

.brand-block .brand-slash {
  position: absolute;
  right: 34px;
  top: 24px;
  height: 30px;
}

.brand-block p {
  color: oklch(75% 0.012 88);
  font-size: 0.875rem;
}

.assistant-id {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-height: 50px;
  padding: 0 var(--space-1);
}

.assistant-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--lime);
  box-shadow: 0 0 0 7px oklch(78.6% 0.173 121 / 0.08);
}

.assistant-id strong,
.assistant-id span {
  display: block;
}

.assistant-id strong {
  font-size: 1.2rem;
  line-height: 1.2;
}

.assistant-id span,
.sidebar-footer small {
  color: oklch(76% 0.012 88);
  font-size: 0.8125rem;
}

.nav-list {
  display: grid;
  gap: var(--space-2);
}

.nav-list a {
  min-height: 46px;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 0 var(--space-3);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: oklch(86% 0.012 88);
  text-decoration: none;
  transition:
    background-color var(--duration-fast) var(--ease-out),
    border-color var(--duration-fast) var(--ease-out),
    color var(--duration-fast) var(--ease-out);
}

.nav-list a span {
  width: 21px;
  color: oklch(90% 0.012 88);
  font-size: 1.1rem;
  text-align: center;
}

.nav-list a:hover {
  background: oklch(100% 0.006 88 / 0.07);
}

.nav-list a.active {
  border-color: oklch(78.6% 0.173 121 / 0.5);
  background: oklch(78.6% 0.173 121 / 0.12);
  color: oklch(96% 0.02 121);
}

.nav-list a.active span {
  color: var(--lime);
}

.sidebar-footer {
  margin-top: auto;
  display: grid;
  gap: var(--space-1);
  padding: var(--space-4) var(--space-1) 0;
  border-top: 1px solid oklch(100% 0.006 88 / 0.13);
}

.sidebar-footer strong {
  color: oklch(92% 0.012 88);
  font-size: 0.9375rem;
}

.app-shell {
  min-width: 0;
  padding: 56px clamp(2.5rem, 5.8vw, 6.5rem) 64px;
}

.topbar {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-5);
  margin-bottom: var(--space-6);
}

.topbar::after {
  content: "";
  position: absolute;
  right: 0;
  top: -10px;
  width: 4px;
  height: 50px;
  border-radius: 999px;
  background: var(--lime);
  transform: rotate(25deg);
  opacity: 0.72;
}

.topbar p {
  margin-top: var(--space-2);
  color: var(--ink-muted);
  font-size: 1.02rem;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding-right: var(--space-7);
}

.plain-action,
.avatar-button,
.text-action {
  min-height: 38px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--ink-soft);
}

.plain-action {
  padding: 0 var(--space-3);
}

.plain-action:hover,
.text-action:hover {
  color: var(--ink-strong);
  background: var(--paper-soft);
}

.avatar-button {
  width: 40px;
  border-radius: 50%;
  background: var(--lime);
  color: var(--ink-strong);
  font-weight: 780;
}

.desk {
  max-width: 1280px;
}

.assistant-workbench,
.attention-feed {
  background: oklch(98% 0.012 88 / 0.62);
  border: 1px solid var(--line-soft);
}

.assistant-workbench {
  min-height: 440px;
  display: grid;
  align-content: start;
  gap: var(--space-6);
  padding: var(--space-6);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.workbench-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-5);
}

.workbench-heading p {
  margin-top: var(--space-2);
  color: var(--ink-soft);
}

.cromos-mark {
  height: 42px;
  opacity: 0.85;
}

.ask-form {
  display: grid;
  gap: var(--space-2);
}

.ask-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: stretch;
  gap: var(--space-2);
  padding: var(--space-1);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--paper-raised);
}

textarea {
  width: 100%;
  min-height: 74px;
  resize: none;
  border: 0;
  padding: 20px var(--space-4);
  background: transparent;
  color: var(--ink-strong);
  line-height: 1.45;
}

textarea::placeholder {
  color: oklch(51% 0.012 160);
  opacity: 1;
}

.send-button {
  min-width: 105px;
  margin: var(--space-1);
  border: 1px solid oklch(67% 0.15 121);
  border-radius: 11px;
  background: var(--lime);
  color: var(--ink-strong);
  font-weight: 780;
  transition:
    transform var(--duration-fast) var(--ease-out),
    background-color var(--duration-fast) var(--ease-out);
}

.send-button:hover {
  transform: translateY(-1px);
  background: oklch(82% 0.17 121);
}

.send-button:active {
  transform: translateY(0);
}

.ask-help,
.form-error {
  padding-left: var(--space-2);
  font-size: 0.875rem;
}

.ask-help {
  color: var(--ink-muted);
}

.form-error {
  color: var(--red);
  font-weight: 700;
}

.suggestion-strip {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
}

.suggestion-strip button {
  min-height: 40px;
  padding: 0 var(--space-4);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--ink-soft);
  transition:
    background-color var(--duration-fast) var(--ease-out),
    border-color var(--duration-fast) var(--ease-out),
    color var(--duration-fast) var(--ease-out);
}

.suggestion-strip button:hover {
  border-color: oklch(75% 0.035 121);
  background: oklch(93% 0.04 121 / 0.28);
  color: var(--ink-strong);
}

.assistant-response {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-5);
  margin-top: auto;
  padding-top: var(--space-4);
  border-top: 1px solid var(--line-soft);
}

.response-label {
  display: block;
  margin-bottom: var(--space-1);
  color: var(--lime-dark);
  font-size: 0.75rem;
  font-weight: 820;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.assistant-response p {
  max-width: 66ch;
  color: var(--ink-soft);
  line-height: 1.55;
}

.source-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: var(--space-2);
}

.source-chips span,
.source-badge {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  justify-content: center;
  padding: 0 var(--space-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: oklch(96% 0.012 88);
  color: var(--ink-soft);
  font-size: 0.8125rem;
  font-weight: 700;
  white-space: nowrap;
}

.source-badge {
  min-width: 76px;
  min-height: 22px;
  justify-self: start;
  font-size: 0.75rem;
}

.attention-feed {
  margin-top: -1px;
  padding: 28px var(--space-6) var(--space-6);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.feed-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-5);
  margin-bottom: var(--space-5);
}

.feed-heading p {
  margin-top: 2px;
  color: var(--ink-muted);
  font-size: 0.8125rem;
}

.text-action {
  padding: 0 var(--space-3);
  color: var(--lime-dark);
  font-weight: 760;
}

.feed-groups {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-7);
  align-items: start;
}

.feed-group {
  border-top: 1px solid var(--line);
}

.feed-group:last-child {
  border-bottom: 1px solid var(--line);
}

.group-title {
  width: 100%;
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  border: 0;
  background: transparent;
  color: var(--ink-strong);
  font-size: 0.9375rem;
  font-weight: 780;
  text-align: left;
}

.group-title em {
  min-width: 24px;
  min-height: 22px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: var(--paper-muted);
  color: var(--ink-soft);
  font-size: 0.75rem;
  font-style: normal;
}

.feed-rows {
  display: grid;
}

.feed-row {
  width: 100%;
  min-height: 76px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: var(--space-2) var(--space-3);
  padding: var(--space-2) 0;
  border: 0;
  border-top: 1px solid var(--line-soft);
  background: transparent;
  color: inherit;
  text-align: left;
  transition:
    background-color var(--duration-fast) var(--ease-out),
    color var(--duration-fast) var(--ease-out);
}

.feed-row:hover,
.feed-more:hover {
  background: oklch(96% 0.025 121 / 0.38);
}

.row-main {
  min-width: 0;
  grid-column: 1 / -1;
  overflow: hidden;
  color: var(--ink);
  font-size: 0.925rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.impact {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--ink-soft);
  font-size: 0.8125rem;
  font-weight: 700;
  white-space: nowrap;
}

.impact i {
  width: 9px;
  height: 9px;
  flex: none;
  border-radius: 50%;
  background: var(--amber);
}

.impact.warning i {
  background: var(--amber);
}

.impact.sync i {
  background: var(--green);
}

.impact.production i {
  background: var(--blue);
}

.feed-row time {
  justify-self: end;
  color: var(--ink-muted);
  font-size: 0.8125rem;
  font-variant-numeric: tabular-nums;
}

.row-action {
  justify-self: end;
  color: var(--lime-dark);
  font-size: 0.875rem;
  font-weight: 760;
}

.feed-more {
  width: 100%;
  min-height: 32px;
  border: 0;
  border-top: 1px solid var(--line-soft);
  background: transparent;
  color: var(--lime-dark);
  font-size: 0.8125rem;
  font-weight: 760;
  text-align: left;
}

.feed-group.collapsed .feed-rows {
  display: none;
}

.feed-group.collapsed .group-title em::after {
  content: " ocultos";
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 1ms !important;
    animation-duration: 1ms !important;
    scroll-behavior: auto !important;
  }
}

@media (max-width: 1120px) {
  body {
    display: block;
  }

  .sidebar {
    width: 100%;
    max-width: 100vw;
    min-height: auto;
    position: sticky;
    top: 0;
    z-index: 10;
    flex-direction: row;
    align-items: center;
    gap: var(--space-4);
    padding: var(--space-3) var(--space-4);
    overflow-x: auto;
  }

  .brand-block {
    min-width: 150px;
    padding: 0 var(--space-4) 0 0;
    border-right: 1px solid oklch(100% 0.006 88 / 0.13);
    border-bottom: 0;
  }

  .cromos-wordmark {
    font-size: 2rem;
  }

  .brand-block .brand-slash,
  .assistant-id,
  .sidebar-footer {
    display: none;
  }

  .nav-list {
    min-width: 0;
    grid-auto-flow: column;
    grid-auto-columns: max-content;
    align-items: center;
    overflow-x: auto;
  }

  .nav-list a {
    min-height: 40px;
  }

  .app-shell {
    padding: var(--space-6) clamp(1rem, 4vw, 2rem) var(--space-6);
  }

  .topbar::after {
    right: 16px;
  }

  .desk {
    max-width: none;
  }
}

@media (max-width: 820px) {
  .topbar,
  .workbench-heading,
  .assistant-response,
  .feed-heading {
    display: grid;
  }

  .topbar-actions {
    padding-right: 0;
  }

  .topbar::after,
  .cromos-mark {
    display: none;
  }

  .ask-line {
    grid-template-columns: 1fr;
  }

  .send-button {
    min-height: 44px;
  }

  .source-chips {
    justify-content: flex-start;
  }

  .feed-groups {
    grid-template-columns: 1fr;
    gap: var(--space-3);
  }

  .feed-row {
    grid-template-columns: 1fr auto;
    gap: var(--space-2) var(--space-3);
    min-height: 72px;
    padding: var(--space-2) 0;
  }

  .source-badge,
  .impact,
  .feed-row time,
  .row-action {
    justify-self: start;
  }
}

@media (max-width: 560px) {
  .app-shell {
    width: 100%;
    max-width: 100vw;
    padding: var(--space-5) var(--space-3) var(--space-5);
    overflow-x: hidden;
  }

  .desk {
    width: min(366px, calc(100vw - 24px));
    max-width: 100%;
    min-width: 0;
  }

  .assistant-workbench,
  .attention-feed,
  .ask-line {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  h1 {
    font-size: 1.9rem;
  }

  .assistant-workbench,
  .attention-feed {
    padding-inline: var(--space-4);
  }

  textarea,
  .send-button {
    min-width: 0;
  }

  .send-button,
  .suggestion-strip button {
    width: 100%;
  }
}
