:root {
  color-scheme: dark;
  --bg: #0c0e12;
  --surface: #161920;
  --surface-2: #1d2129;
  --surface-3: #242a35;
  --text: #f8f4ee;
  --muted: #cdc7be;
  --muted-2: #9a9489;
  --line: #2c313c;
  --line-strong: #3a4150;
  --amber: #e9b44c;
  --amber-bg: #1f1a10;
  --amber-line: #5b4619;
  --blue: #6bb6ff;
  --green: #7ccf91;
  --red: #ff7777;
  --violet: #a99cff;
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.32);
  --radius: 14px;
  --pad: 24px;
  --gap: 18px;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body,
#app {
  min-height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-size: 15px;
  line-height: 1.6;
}

button,
input {
  font: inherit;
}

button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--text);
  padding: 0 14px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  transition: background 120ms ease-out, border-color 120ms ease-out, color 120ms ease-out, transform 120ms ease-out;
}

button:hover:not(:disabled) {
  border-color: var(--amber);
  background: var(--surface-3);
}

button:focus-visible,
input:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

button:disabled,
input:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

input {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #0c0e12;
  color: var(--text);
  padding: 0 14px;
  font-size: 14px;
}

input::placeholder {
  color: var(--muted-2);
}

.primary-button {
  border-color: #c79334;
  background: var(--amber);
  color: #16120b;
  font-weight: 800;
}

.primary-button:hover:not(:disabled) {
  background: #f0c66a;
  color: #16120b;
}

.micro {
  margin: 0;
  color: var(--muted-2);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.login-view {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-shell {
  width: min(980px, 100%);
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.login-copy,
.login-panel {
  padding: 36px;
}

.login-copy {
  min-height: 420px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: #131722;
}

.login-copy h1 {
  max-width: 620px;
  margin: 12px 0;
  font-size: 40px;
  line-height: 1.08;
}

.login-copy p:not(.micro) {
  max-width: 620px;
  color: var(--muted);
  line-height: 1.6;
}

.brand-mark {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border: 1px solid var(--amber);
  border-radius: 12px;
  margin-bottom: 18px;
  background: var(--amber-bg);
  color: var(--amber);
  font-weight: 900;
  font-size: 22px;
}

.login-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 14px;
}

.login-panel h2 {
  margin: 0;
  font-size: 24px;
}

.login-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.error,
.inline-note {
  min-height: 22px;
  margin: 0;
  color: var(--red);
  font-size: 13px;
}

.dashboard-view {
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: 28px 28px 72px;
  display: grid;
  gap: var(--gap);
}

.topbar,
.section-title,
.topbar-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.topbar h1 {
  margin: 4px 0 0;
  font-size: 26px;
  letter-spacing: -0.01em;
  font-weight: 700;
}

.topbar-time {
  color: var(--muted-2);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

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

.hero,
.action-card,
.chat-panel,
.work-queue,
.panel,
.preview-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.02);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 1px;
  overflow: hidden;
  background: var(--line);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}

.hero-main,
.hero-cta {
  background: var(--surface);
  padding: 26px 28px;
}

.hero-main h2 {
  max-width: 980px;
  margin: 8px 0 14px;
  font-size: 32px;
  line-height: 1.24;
  letter-spacing: -0.012em;
  font-weight: 700;
  color: var(--text);
}

.hero-cta {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 10px;
  background: linear-gradient(180deg, var(--surface) 0%, var(--surface-2) 100%);
}

.cta-button {
  min-height: 52px;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.005em;
  border-radius: 12px;
  padding: 0 18px;
  box-shadow: 0 4px 14px rgba(201, 147, 52, 0.18);
}

.cta-subtext {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.focus-list {
  display: grid;
  gap: 8px;
  margin: 8px 0 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.hermes-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--amber-line);
  border-left: 3px solid var(--amber);
  background: var(--amber-bg);
  color: var(--text);
  border-radius: 12px;
  padding: 12px 16px;
  font-size: 13px;
}

.hermes-banner-text {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 10px;
}

.hermes-banner-text strong {
  color: var(--amber);
  font-weight: 700;
}

.hermes-banner-text span {
  color: var(--muted);
}

.action-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--gap);
}

.action-card {
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 116px;
}

.action-body {
  margin: 0;
  font-size: 16px;
  line-height: 1.5;
  color: var(--text);
  font-weight: 600;
  letter-spacing: -0.005em;
}

.chat-panel {
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.section-title {
  align-items: flex-start;
  margin-bottom: 4px;
}

.section-title h2 {
  margin: 4px 0 0;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.005em;
}

.chat-log {
  min-height: 200px;
  max-height: 320px;
  display: grid;
  align-content: start;
  gap: 10px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #0e1117;
  padding: 14px;
}

.chat-message {
  width: fit-content;
  max-width: 92%;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-2);
  padding: 10px 14px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 13.5px;
  line-height: 1.55;
}

.chat-message.user {
  justify-self: end;
  border-color: #9c7b35;
  background: #24200f;
}

.chat-message.assistant {
  justify-self: start;
  border-color: #315f46;
  background: #132019;
  color: var(--muted);
}

.chat-message.chat-offline {
  display: grid;
  gap: 4px;
  max-width: 100%;
  width: 100%;
  border-style: dashed;
  border-color: var(--amber-line);
  background: var(--amber-bg);
  color: var(--text);
  padding: 14px 16px;
}

.chat-message.chat-offline strong {
  color: var(--amber);
  font-weight: 700;
  font-size: 14px;
}

.chat-message.chat-offline span {
  color: var(--muted);
  font-size: 13px;
}

.chat-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.blockers-row {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 18px 22px;
}

.blocker-list {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 12px 0 0;
  padding: 0;
}

.blocker-list li {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-2);
  padding: 14px 16px;
  font-size: 14px;
  line-height: 1.55;
}

.blocker-list li.empty {
  color: var(--muted-2);
  border-style: dashed;
  background: transparent;
}

.preview-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: var(--gap);
}

.preview-card {
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.preview-line strong {
  font-size: 19px;
  line-height: 1.4;
  font-weight: 700;
  letter-spacing: -0.005em;
}

.preview-sub {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

#risk-meta {
  font-size: 13px;
  color: var(--muted-2);
  border-top: 1px solid var(--line);
  padding-top: 10px;
  margin-top: 2px;
}

.preview-cta {
  align-self: flex-start;
  min-height: 38px;
  padding: 0 16px;
  font-size: 13px;
  font-weight: 700;
  border-radius: 10px;
}

.hard-rule-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 22px;
}

.hard-rule-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  font-weight: 600;
}

.hard-rule-list li::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--amber);
  flex: 0 0 8px;
}

.preview-details {
  border-top: 1px solid var(--line);
  padding-top: 10px;
  margin-top: 4px;
}

.preview-details > summary {
  list-style: none;
  cursor: pointer;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  user-select: none;
}

.preview-details > summary::-webkit-details-marker {
  display: none;
}

.preview-details > summary::after {
  content: "▾";
  font-size: 10px;
  transition: transform 120ms ease-out;
  color: var(--muted-2);
}

.preview-details[open] > summary::after {
  transform: rotate(180deg);
}

.preview-details > summary:hover {
  color: var(--text);
}

.more-section {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 18px 22px;
}

.more-section > summary {
  list-style: none;
  cursor: pointer;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  user-select: none;
  display: flex;
  align-items: center;
  gap: 8px;
}

.more-section > summary::-webkit-details-marker {
  display: none;
}

.more-section > summary::after {
  content: "▾";
  font-size: 10px;
  transition: transform 120ms ease-out;
  color: var(--muted-2);
}

.more-section[open] > summary::after {
  transform: rotate(180deg);
}

.more-section[open] {
  display: grid;
  gap: var(--gap);
}

.work-queue,
.domain-layout,
.bottom-layout,
.panel {
  padding: 20px 22px;
}

.work-queue {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.lane-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.lane {
  min-height: 160px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #13161c;
  overflow: hidden;
}

.lane h3 {
  min-height: 40px;
  margin: 0;
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding: 0 14px;
  color: var(--blue);
  font-size: 13px;
  letter-spacing: 0.02em;
  font-weight: 700;
}

.lane-blocked h3 {
  color: var(--red);
}

.lane-done h3 {
  color: var(--green);
}

.lane ul {
  list-style: none;
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 10px 12px;
}

.lane li {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2);
  padding: 10px 12px;
}

.lane li.empty {
  border-style: dashed;
  color: var(--muted-2);
  background: transparent;
  font-size: 13px;
}

.lane li strong {
  display: block;
  font-size: 13.5px;
  overflow-wrap: anywhere;
  font-weight: 600;
}

.lane li span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.add-task {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr) auto;
  gap: 10px;
}

.domain-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--gap);
}

.bottom-layout {
  display: grid;
  grid-template-columns: minmax(360px, 0.85fr) minmax(0, 1.15fr);
  gap: var(--gap);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  padding: 0 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.status-pill.good {
  color: var(--green);
  border-color: #3f7a54;
}

.status-pill.warn {
  color: var(--amber);
  border-color: var(--amber-line);
}

.status-pill.danger {
  color: var(--red);
  border-color: #804545;
}

.info-list,
.notification-grid,
.health-grid,
.conflict-list,
.chip-row {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.health-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.notification-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.info-list .info-row,
.notification-card,
.worker-card,
.rule-card,
.conflict-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-2);
  padding: 12px 14px;
}

.info-row span,
.rule-card span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted-2);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 700;
}

.info-row strong,
.rule-card strong {
  display: block;
  line-height: 1.45;
  font-size: 13.5px;
  overflow-wrap: anywhere;
  font-weight: 600;
}

.info-row p,
.notification-card p,
.worker-card p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.5;
}

.notification-card strong,
.worker-card strong,
.conflict-card strong {
  display: block;
  margin-bottom: 4px;
  font-size: 13.5px;
  font-weight: 600;
}

.notification-card span,
.worker-card span,
.conflict-card span {
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.5;
}

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

.rule-card {
  border-left: 3px solid var(--amber);
}

.chip-row {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-2);
  padding: 10px 14px;
  font-size: 12.5px;
}

.chip strong {
  font-weight: 600;
  color: var(--text);
}

.chip .chip-state {
  color: var(--muted-2);
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-weight: 700;
}

.chip.good .chip-state {
  color: var(--green);
}

.chip.warn .chip-state {
  color: var(--amber);
}

.conflict-list {
  margin-top: 10px;
}

.conflict-card {
  border-color: var(--amber-line);
}

@media (max-width: 1200px) {
  .hero,
  .preview-grid,
  .domain-layout,
  .bottom-layout {
    grid-template-columns: 1fr;
  }
  .lane-grid,
  .notification-grid,
  .blocker-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .action-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 860px) {
  .dashboard-view {
    padding: 16px;
  }
  .topbar,
  .topbar-actions,
  .section-title,
  .login-row,
  .chat-form,
  .add-task {
    display: grid;
    grid-template-columns: 1fr;
  }
  .login-shell,
  .action-row,
  .lane-grid,
  .domain-layout,
  .health-grid,
  .notification-grid,
  .rule-grid,
  .blocker-list,
  .hard-rule-list {
    grid-template-columns: 1fr;
  }
  .login-copy,
  .login-panel,
  .hero-main,
  .hero-cta,
  .chat-panel,
  .work-queue,
  .panel,
  .preview-card {
    padding: 16px;
  }
  .login-copy h1 {
    font-size: 32px;
  }
  .hero-main h2 {
    font-size: 22px;
  }
  .cta-button {
    min-height: 48px;
  }
}
