:root {
  color-scheme: light;
  --ink: #1c2430;
  --muted: #657080;
  --line: #d7dee7;
  --surface: #ffffff;
  --surface-2: #f5f7fa;
  --nav: #111827;
  --nav-2: #202938;
  --teal: #16817a;
  --red: #cf4d4d;
  --gold: #b7862c;
  --blue: #3478b9;
  --green: #3f8c5c;
  --shadow: 0 14px 35px rgba(29, 36, 48, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--surface-2);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

.login-body {
  min-height: 100vh;
  background:
    linear-gradient(120deg, rgba(22, 129, 122, 0.12), rgba(52, 120, 185, 0.1)),
    var(--surface-2);
}

.manual-body {
  background: var(--surface-2);
}

button,
select,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: 100vh;
  transition: grid-template-columns 180ms ease;
}

body.sidebar-collapsed .app-shell {
  grid-template-columns: 78px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding: 18px;
  background: var(--nav);
  color: #f8fafc;
}

.brand-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px;
  gap: 8px;
  align-items: center;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  min-width: 0;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: #f8fafc;
  color: var(--nav);
  font-weight: 800;
}

.brand strong,
.brand span {
  display: block;
}

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

.brand strong {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.brand span {
  margin-top: 3px;
  color: #aeb8c7;
  font-size: 12px;
  white-space: nowrap;
}

.sidebar-toggle {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: #f8fafc;
  font-size: 20px;
  line-height: 1;
}

.sidebar-toggle:hover {
  background: var(--nav-2);
}

.login-brand {
  padding-bottom: 0;
  border-bottom: 0;
  color: var(--ink);
}

.login-brand .brand-mark {
  background: var(--ink);
  color: #ffffff;
}

.login-brand span {
  color: var(--muted);
}

.nav-list {
  display: grid;
  gap: 6px;
  margin-top: 22px;
}

.guide-nav {
  display: grid;
  gap: 6px;
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.guide-nav strong {
  padding: 0 12px;
  color: #aeb8c7;
  font-size: 12px;
}

.nav-item {
  position: relative;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #c8d1df;
  text-align: left;
}

.nav-icon {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.08);
  font-size: 12px;
  font-weight: 800;
}

.nav-label {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.nav-item.active,
.nav-item:hover {
  background: var(--nav-2);
  color: #ffffff;
}

.sidebar-footer {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 14px;
  color: #aeb8c7;
  font-size: 13px;
}

body.sidebar-collapsed .sidebar {
  padding: 14px 12px;
}

body.sidebar-collapsed .brand-row {
  grid-template-columns: 1fr;
  justify-items: center;
}

body.sidebar-collapsed .brand {
  justify-content: center;
}

body.sidebar-collapsed .brand-copy,
body.sidebar-collapsed .nav-label,
body.sidebar-collapsed .guide-nav strong,
body.sidebar-collapsed .sidebar-footer .nav-label {
  display: none;
}

body.sidebar-collapsed .sidebar-toggle {
  width: 42px;
  transform: rotate(180deg);
}

body.sidebar-collapsed .nav-item {
  grid-template-columns: 1fr;
  justify-items: center;
  padding: 0;
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #48c774;
}

.workspace {
  min-width: 0;
  padding: 24px;
}

.topbar {
  display: flex;
  gap: 18px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--teal);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 30px;
  line-height: 1.1;
}

h2 {
  margin-bottom: 0;
  font-size: 21px;
}

h3 {
  margin-bottom: 0;
  font-size: 15px;
}

.topbar-actions {
  display: flex;
  gap: 8px;
}

.icon-button,
.primary-action,
.segment {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
}

.icon-button {
  width: 40px;
  font-size: 18px;
}

.icon-button:hover,
.primary-action:hover {
  border-color: var(--teal);
}

.icon-button.danger:hover {
  border-color: var(--red);
  color: var(--red);
}

.primary-action {
  padding: 0 14px;
  background: var(--ink);
  color: #ffffff;
}

.ghost-action {
  background: var(--surface);
  color: var(--ink);
}

[data-tip] {
  position: relative;
}

[data-tip]::after {
  position: absolute;
  z-index: 50;
  left: 50%;
  bottom: calc(100% + 9px);
  width: max-content;
  max-width: 280px;
  padding: 9px 10px;
  border-radius: 8px;
  background: #111827;
  color: #ffffff;
  content: attr(data-tip);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.45;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 4px);
  transition: opacity 140ms ease, transform 140ms ease;
  white-space: normal;
  box-shadow: var(--shadow);
}

[data-tip]::before {
  position: absolute;
  z-index: 51;
  left: 50%;
  bottom: calc(100% + 3px);
  border: 6px solid transparent;
  border-top-color: #111827;
  content: "";
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%);
  transition: opacity 140ms ease;
}

[data-tip]:hover::after,
[data-tip]:focus-visible::after,
[data-tip]:hover::before,
[data-tip]:focus-visible::before {
  opacity: 1;
  transform: translate(-50%, 0);
}

.topbar-actions [data-tip]::after {
  top: calc(100% + 9px);
  right: 0;
  bottom: auto;
  left: auto;
  transform: translate(0, -4px);
}

.topbar-actions [data-tip]::before {
  top: calc(100% + 3px);
  bottom: auto;
  border: 6px solid transparent;
  border-bottom-color: #111827;
}

.topbar-actions [data-tip]:hover::after,
.topbar-actions [data-tip]:focus-visible::after {
  transform: translate(0, 0);
}

.topbar-actions [data-tip]:hover::before,
.topbar-actions [data-tip]:focus-visible::before {
  opacity: 1;
  transform: translateX(-50%);
}

.sidebar-toggle[data-tip]::after {
  top: calc(100% + 9px);
  bottom: auto;
  transform: translate(-50%, -4px);
}

.sidebar-toggle[data-tip]::before {
  top: calc(100% + 3px);
  bottom: auto;
  border: 6px solid transparent;
  border-bottom-color: #111827;
}

.sidebar-toggle[data-tip]:hover::after,
.sidebar-toggle[data-tip]:focus-visible::after {
  transform: translate(-50%, 0);
}

.sidebar-toggle[data-tip]:hover::before,
.sidebar-toggle[data-tip]:focus-visible::before {
  opacity: 1;
  transform: translateX(-50%);
}

.nav-item[data-tip]::after {
  top: 50%;
  bottom: auto;
  left: calc(100% + 12px);
  transform: translate(0, -46%);
}

.nav-item[data-tip]::before {
  top: 50%;
  bottom: auto;
  left: calc(100% + 1px);
  border: 6px solid transparent;
  border-right-color: #111827;
  transform: translateY(-50%);
}

.nav-item[data-tip]:hover::after,
.nav-item[data-tip]:focus-visible::after {
  transform: translate(0, -50%);
}

.nav-item[data-tip]:hover::before,
.nav-item[data-tip]:focus-visible::before {
  opacity: 1;
  transform: translateY(-50%);
}

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

.login-panel {
  display: grid;
  gap: 22px;
  width: min(100%, 420px);
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.login-copy {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.login-error {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid rgba(207, 77, 77, 0.35);
  border-radius: 8px;
  background: rgba(207, 77, 77, 0.08);
  color: var(--red);
}

.login-form {
  display: grid;
  gap: 14px;
}

.login-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.login-form input {
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
}

.login-form input:focus {
  border-color: var(--teal);
  outline: 3px solid rgba(22, 129, 122, 0.16);
}

.login-submit {
  width: 100%;
  min-height: 44px;
}

.manual-shell {
  display: grid;
  grid-template-columns: 220px minmax(0, 860px);
  gap: 22px;
  align-items: start;
  width: min(100%, 1160px);
  margin: 0 auto;
  padding: 24px;
}

.manual-nav {
  position: sticky;
  top: 24px;
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 6px 18px rgba(29, 36, 48, 0.06);
}

.manual-nav a {
  min-height: 34px;
  padding: 8px 10px;
  border-radius: 8px;
  color: var(--ink);
  text-decoration: none;
}

.manual-nav a:hover {
  background: var(--surface-2);
}

.manual-page {
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.manual-page header {
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.manual-page section {
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
}

.manual-page section:last-child {
  border-bottom: 0;
}

.manual-page p,
.manual-page li {
  color: var(--muted);
  line-height: 1.65;
}

.manual-page li + li {
  margin-top: 6px;
}

.manual-page pre {
  overflow-x: auto;
  padding: 12px;
  border-radius: 8px;
  background: #111827;
  color: #f8fafc;
}

.manual-page code {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 13px;
}

.hero-strip {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  min-height: 132px;
  padding: 18px;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.hero-visual {
  display: block;
  width: 190px;
  height: 106px;
  border: 1px solid var(--line);
  border-radius: 8px;
  object-fit: cover;
}

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

.hero-copy strong {
  margin-bottom: 8px;
  font-size: 24px;
}

.hero-copy span {
  color: var(--muted);
  line-height: 1.5;
}

.hero-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(78px, 1fr));
  gap: 8px;
}

.hero-metrics span {
  display: grid;
  gap: 4px;
  min-height: 68px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
}

.hero-metrics b {
  color: var(--ink);
  font-size: 22px;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.section-head,
.panel-head,
.control-row {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.segmented {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.segment {
  min-height: 31px;
  padding: 0 12px;
  border: 0;
  background: transparent;
  color: var(--muted);
}

.segment.active {
  background: var(--ink);
  color: #ffffff;
}

.overview-grid,
.blog-layout,
.finance-grid,
.strategy-grid,
.topic-pack-grid,
.agent-grid,
.integration-grid,
.settings-grid,
.performance-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.span-2 {
  grid-column: span 2;
}

.span-3 {
  grid-column: span 3;
}

.panel,
.idea-card,
.topic-item,
.timeline-step,
.record-item,
.note-item,
.approval-item,
.topic-pack,
.agent-card,
.category-row,
.roadmap-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 6px 18px rgba(29, 36, 48, 0.06);
}

.integration-card {
  min-height: 112px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.integration-card.ready {
  border-color: rgba(35, 127, 111, 0.32);
  background: #f5fbfa;
}

.integration-card p {
  margin: 8px 0;
  color: var(--muted);
  line-height: 1.55;
}

.integration-card small {
  color: var(--ink);
  font-weight: 700;
}

.settings-grid label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

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

.credentials-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.settings-grid input,
.settings-grid select,
.credentials-form input {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 10px;
  background: #ffffff;
  color: var(--ink);
}

.toggle-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  color: var(--ink);
  font-weight: 800;
}

.toggle-row input {
  width: 16px;
  height: 16px;
  accent-color: var(--teal);
}

.warning-text {
  color: #b36b00;
  font-weight: 800;
}

.panel {
  padding: 16px;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: #eef6f5;
  color: var(--teal);
  font-size: 12px;
  font-weight: 700;
}

.week-board {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
}

.day-card {
  min-height: 138px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

.day-card strong,
.day-card span {
  display: block;
}

.day-card span {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.model-stack,
.quality-list,
.locale-list,
.topic-list,
.records,
.approval-list,
.category-list,
.roadmap-list,
.ops-list,
.job-list,
.artifact-list,
.log-list {
  display: grid;
  gap: 10px;
}

.model-row,
.quality-row,
.locale-row {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  min-height: 44px;
  padding: 10px;
  border-radius: 8px;
  background: var(--surface-2);
}

.model-row small,
.quality-row small,
.locale-row small {
  color: var(--muted);
}

.strategy-grid {
  margin-bottom: 14px;
}

.note-item,
.topic-pack,
.agent-card,
.roadmap-item {
  padding: 14px;
}

.note-item p,
.approval-item p,
.topic-pack p,
.topic-pack small,
.agent-card p,
.category-row p,
.roadmap-item p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.45;
}

.approval-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 54px 84px;
  gap: 12px;
  align-items: center;
  min-height: 76px;
  padding: 12px;
}

.ops-row,
.job-row,
.artifact-row,
.log-row {
  display: grid;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 6px 18px rgba(29, 36, 48, 0.06);
}

.ops-row {
  grid-template-columns: minmax(0, 1fr) auto minmax(220px, 0.8fr);
}

.job-row {
  grid-template-columns: 126px minmax(0, 1fr) 96px 54px 72px;
}

.artifact-row {
  grid-template-columns: 96px minmax(0, 1fr) 140px;
}

.log-row {
  grid-template-columns: 72px 150px minmax(0, 1fr);
}

.ops-row p,
.job-row p,
.artifact-row p,
.log-row p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.45;
}

.file-manager {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr) minmax(280px, 0.75fr);
  gap: 14px;
}

.file-sidebar,
.file-main,
.file-preview {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 6px 18px rgba(29, 36, 48, 0.06);
}

.folder-list {
  display: grid;
  gap: 8px;
}

.folder-item,
.file-row {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  text-align: left;
}

.folder-item {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  min-height: 38px;
  padding: 0 10px;
}

.folder-item.active,
.file-row.active {
  border-color: var(--teal);
  background: #eef6f5;
}

.folder-item small {
  color: var(--muted);
  font-weight: 800;
}

.file-toolbar {
  display: flex;
  gap: 12px;
  align-items: end;
  justify-content: space-between;
  margin-bottom: 12px;
}

.file-toolbar label {
  display: grid;
  gap: 6px;
  width: min(100%, 420px);
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.file-toolbar input {
  width: 100%;
  min-height: 40px;
}

.file-preview {
  display: grid;
  align-content: start;
  gap: 12px;
}

.file-preview-box {
  aspect-ratio: 16 / 9;
}

.file-meta {
  display: grid;
  gap: 8px;
  margin: 0;
}

.file-meta div {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr);
  gap: 8px;
  padding: 8px;
  border-radius: 8px;
  background: var(--surface-2);
}

.file-meta dt {
  color: var(--muted);
  font-weight: 800;
}

.file-meta dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
}

.ops-row code {
  display: block;
  overflow-x: auto;
  padding: 8px;
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--ink);
  font-size: 12px;
}

.status-chip {
  display: inline-grid;
  place-items: center;
  min-height: 30px;
  padding: 0 9px;
  border-radius: 8px;
  background: #f7f0df;
  color: #7a5514;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.approval-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.mini-action {
  min-height: 34px;
  padding: 0 10px;
}

.score-badge {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 8px;
  background: var(--ink);
  color: #ffffff;
  font-weight: 800;
}

.topic-pack-grid,
.agent-grid {
  margin-top: 0;
}

.topic-pack {
  min-height: 154px;
}

.topic-pack small {
  display: block;
  margin-top: 10px;
}

.category-row {
  display: grid;
  grid-template-columns: 150px 56px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  min-height: 54px;
  padding: 12px;
}

.category-row span {
  display: grid;
  place-items: center;
  min-height: 30px;
  border-radius: 8px;
  background: #eef6f5;
  color: var(--teal);
  font-weight: 800;
}

.roadmap-item {
  display: grid;
  grid-template-columns: 88px 150px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.roadmap-item strong {
  color: var(--teal);
}

.sub-head {
  margin-top: 18px;
}

.page-help {
  margin: -4px 0 14px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
  color: var(--muted);
  line-height: 1.55;
}

.process-board {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.process-step {
  display: grid;
  gap: 8px;
  min-height: 132px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 6px 18px rgba(29, 36, 48, 0.06);
}

.process-step strong {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--ink);
  color: #ffffff;
}

.process-step p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.cost-review {
  margin-bottom: 14px;
}

.cost-panel {
  display: grid;
  gap: 10px;
}

.cost-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.cost-metric {
  display: grid;
  gap: 4px;
  min-height: 78px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.cost-metric span,
.cost-metric small {
  color: var(--muted);
}

.cost-metric strong {
  font-size: 20px;
  line-height: 1;
}

.cost-metric.warning {
  border-color: #f5c86a;
  background: #fff8e8;
}

.cost-metric.danger {
  border-color: #f3a9a1;
  background: #fff1ef;
}

.cost-breakdown {
  display: grid;
  gap: 6px;
}

.cost-breakdown div {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr);
  gap: 10px;
  min-height: 32px;
  align-items: center;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.cost-breakdown span {
  color: var(--muted);
  line-height: 1.35;
}

.dashboard-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.metric-card {
  display: grid;
  gap: 6px;
  min-height: 112px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 6px 18px rgba(29, 36, 48, 0.06);
}

.metric-card span,
.metric-card small {
  color: var(--muted);
}

.metric-card strong {
  font-size: 28px;
  line-height: 1;
}

.dashboard-blog-row {
  grid-template-columns: minmax(0, 1fr) auto;
}

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

.task-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.task-form input,
.task-form select {
  min-height: 38px;
}

.span-form {
  grid-column: 1 / -1;
}

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

.form-help {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.45;
}

.workflow-list {
  display: grid;
  gap: 12px;
}

.workflow-item,
.empty-state {
  display: grid;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 6px 18px rgba(29, 36, 48, 0.06);
}

.workflow-head {
  display: flex;
  gap: 12px;
  align-items: start;
  justify-content: space-between;
}

.workflow-head p,
.empty-state p {
  margin: 4px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.workflow-item details {
  color: var(--muted);
}

.workflow-item summary {
  cursor: pointer;
  font-weight: 800;
}

.workflow-item pre,
.workflow-output {
  overflow-x: auto;
  max-height: 420px;
  margin: 0;
  padding: 10px;
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--ink);
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.5;
}

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

.media-card {
  display: grid;
  gap: 10px;
  min-height: 220px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 6px 18px rgba(29, 36, 48, 0.06);
}

.media-preview {
  display: grid;
  place-items: center;
  aspect-ratio: 9 / 12;
  border-radius: 8px;
  background: linear-gradient(135deg, #eef6f5, #eef2f7);
  color: var(--teal);
  font-weight: 800;
}

.media-preview video {
  width: 100%;
  height: 100%;
  border-radius: 8px;
  object-fit: cover;
}

.media-preview img {
  width: 100%;
  height: 100%;
  border-radius: 8px;
  object-fit: cover;
}

.media-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.compact-media-grid .media-card {
  min-height: 196px;
}

.compact-media-grid .media-preview {
  aspect-ratio: 16 / 9;
}

.review-guide {
  display: grid;
  gap: 10px;
}

.review-guide article {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.review-guide p {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.control-row {
  flex-wrap: wrap;
  justify-content: flex-start;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.control-row label {
  display: flex;
  gap: 8px;
  align-items: center;
  min-height: 40px;
  color: var(--muted);
}

select,
input[type="range"] {
  min-height: 34px;
}

select,
input,
textarea {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  background: #ffffff;
  color: var(--ink);
}

textarea {
  min-height: 140px;
  padding: 10px;
  resize: vertical;
}

.check-row input {
  width: 18px;
  height: 18px;
}

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

.idea-card {
  display: grid;
  gap: 10px;
  min-height: 198px;
  padding: 14px;
}

.idea-card .swatch {
  width: 100%;
  height: 64px;
  border-radius: 7px;
  background: linear-gradient(135deg, var(--blue), var(--green));
}

.idea-card:nth-child(2n) .swatch {
  background: linear-gradient(135deg, var(--gold), var(--red));
}

.idea-card p,
.topic-item p,
.record-item p,
.panel p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.45;
}

.topic-item,
.record-item {
  display: grid;
  gap: 6px;
  padding: 12px;
}

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

.timeline-step {
  min-height: 160px;
  padding: 14px;
}

.step-index {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  margin-bottom: 12px;
  border-radius: 8px;
  background: var(--ink);
  color: #ffffff;
  font-weight: 800;
}

.big-number {
  margin: 10px 0;
  font-size: 42px;
  font-weight: 800;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  max-width: min(360px, calc(100vw - 36px));
  padding: 12px 14px;
  border-radius: 8px;
  background: var(--ink);
  color: #ffffff;
  box-shadow: var(--shadow);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(17, 24, 39, 0.48);
}

.modal-backdrop[hidden] {
  display: none;
}

.modal-panel {
  display: grid;
  gap: 16px;
  width: min(100%, 460px);
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.password-form {
  display: grid;
  gap: 12px;
}

.password-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.password-form input {
  width: 100%;
  min-height: 42px;
}

/* Compact operating-console density */
body {
  font-size: 13px;
}

.app-shell {
  grid-template-columns: 236px minmax(0, 1fr);
}

body.sidebar-collapsed .app-shell {
  grid-template-columns: 64px minmax(0, 1fr);
}

.sidebar {
  padding: 12px;
}

.brand-row {
  grid-template-columns: minmax(0, 1fr) 30px;
  gap: 7px;
  padding-bottom: 12px;
}

.brand {
  gap: 8px;
}

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 7px;
  font-size: 12px;
}

.brand strong {
  font-size: 13px;
}

.brand span,
.guide-nav strong {
  font-size: 11px;
}

.sidebar-toggle {
  width: 30px;
  height: 30px;
  font-size: 17px;
}

.nav-list {
  gap: 4px;
  margin-top: 14px;
}

.guide-nav {
  gap: 4px;
  padding-top: 12px;
}

.nav-item {
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 8px;
  min-height: 34px;
  padding: 0 9px;
  border-radius: 7px;
  font-size: 12px;
}

.nav-icon {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  font-size: 11px;
}

.sidebar-footer {
  margin-top: 10px;
  font-size: 11px;
}

body.sidebar-collapsed .sidebar {
  padding: 10px;
}

body.sidebar-collapsed .sidebar-toggle {
  width: 36px;
}

.workspace {
  padding: 16px;
}

.topbar {
  gap: 12px;
  margin-bottom: 12px;
}

.topbar-actions {
  gap: 6px;
}

.eyebrow {
  margin-bottom: 3px;
  font-size: 10px;
}

h1 {
  font-size: 22px;
}

h2 {
  font-size: 16px;
}

h3 {
  font-size: 13px;
}

.icon-button,
.primary-action,
.segment {
  min-height: 32px;
  border-radius: 7px;
}

.icon-button {
  width: 34px;
  font-size: 14px;
}

.primary-action {
  padding: 0 10px;
}

.mini-action {
  min-height: 30px;
  padding: 0 8px;
}

.pill,
.status-chip {
  min-height: 22px;
  padding: 0 7px;
  font-size: 11px;
}

.hero-strip {
  grid-template-columns: 132px minmax(0, 1fr) auto;
  gap: 12px;
  min-height: 96px;
  padding: 12px;
  margin-bottom: 12px;
}

.hero-visual {
  width: 132px;
  height: 74px;
}

.hero-copy strong {
  margin-bottom: 5px;
  font-size: 17px;
}

.hero-copy span {
  font-size: 12px;
}

.hero-metrics {
  gap: 6px;
}

.hero-metrics span {
  min-height: 54px;
  padding: 8px;
  font-size: 11px;
}

.hero-metrics b {
  font-size: 17px;
}

.section-head,
.panel-head,
.control-row {
  gap: 9px;
  margin-bottom: 10px;
}

.overview-grid,
.blog-layout,
.finance-grid,
.strategy-grid,
.topic-pack-grid,
.agent-grid,
.dashboard-metrics,
.process-board,
.media-grid,
.timeline,
.idea-grid {
  gap: 10px;
}

.panel {
  padding: 12px;
}

.note-item,
.topic-pack,
.agent-card,
.roadmap-item,
.media-card,
.metric-card,
.process-step,
.idea-card,
.topic-item,
.record-item,
.workflow-item,
.empty-state,
.ops-row,
.job-row,
.artifact-row,
.log-row,
.file-sidebar,
.file-main,
.file-preview {
  padding: 10px;
}

.model-stack,
.quality-list,
.locale-list,
.topic-list,
.records,
.approval-list,
.category-list,
.roadmap-list,
.ops-list,
.job-list,
.artifact-list,
.log-list,
.workflow-list,
.folder-list {
  gap: 7px;
}

.model-row,
.quality-row,
.locale-row {
  min-height: 36px;
  padding: 8px;
}

.dashboard-metrics {
  margin-bottom: 10px;
}

.metric-card {
  min-height: 84px;
  gap: 4px;
}

.metric-card strong {
  font-size: 21px;
}

.process-step {
  min-height: 106px;
  gap: 6px;
}

.process-step strong,
.step-index {
  width: 26px;
  height: 26px;
  border-radius: 7px;
}

.page-help {
  margin: -2px 0 10px;
  padding: 9px 10px;
  line-height: 1.45;
}

.day-card {
  min-height: 104px;
  padding: 8px;
}

.day-card span {
  margin-top: 6px;
  font-size: 11px;
}

.topic-pack {
  min-height: 118px;
}

.timeline-step {
  min-height: 124px;
  padding: 10px;
}

.score-badge {
  width: 38px;
  height: 38px;
  border-radius: 7px;
}

.job-row {
  grid-template-columns: 112px minmax(0, 1fr) 86px 44px 60px;
}

.ops-row {
  grid-template-columns: minmax(0, 1fr) auto minmax(180px, 0.72fr);
}

.artifact-row {
  grid-template-columns: 82px minmax(0, 1fr) 112px;
}

.log-row {
  grid-template-columns: 58px 126px minmax(0, 1fr);
}

.file-manager {
  grid-template-columns: 196px minmax(0, 1fr) minmax(236px, 0.72fr);
  gap: 10px;
}

.folder-item {
  min-height: 32px;
  padding: 0 8px;
}

.file-toolbar {
  gap: 9px;
  margin-bottom: 9px;
}

.file-toolbar label,
.task-form label,
.login-form label,
.password-form label {
  font-size: 12px;
}

.file-toolbar input,
.login-form input,
.password-form input {
  min-height: 36px;
}

.media-card {
  min-height: 176px;
  gap: 8px;
}

.compact-media-grid .media-card {
  min-height: 158px;
}

.control-row {
  padding: 9px;
}

.control-row label {
  min-height: 32px;
}

.cost-review {
  margin-bottom: 10px;
}

.cost-metric {
  min-height: 68px;
  padding: 9px;
}

.cost-metric strong {
  font-size: 18px;
}

.cost-breakdown div {
  grid-template-columns: 150px minmax(0, 1fr);
  min-height: 30px;
  padding: 7px 9px;
}

.manual-shell {
  grid-template-columns: 190px minmax(0, 780px);
  gap: 16px;
  padding: 16px;
}

.manual-page {
  padding: 20px;
}

.manual-page section {
  padding: 16px 0;
}

.login-panel,
.modal-panel {
  gap: 16px;
  padding: 20px;
}

@media (max-width: 1100px) {
  .overview-grid,
  .blog-layout,
  .finance-grid,
  .strategy-grid,
  .integration-grid,
  .settings-grid,
  .performance-grid,
  .credentials-form,
  .idea-grid,
  .topic-pack-grid,
  .agent-grid,
  .process-board,
  .media-grid,
  .dashboard-metrics,
  .cost-metrics,
  .timeline {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .span-2,
  .span-3 {
    grid-column: span 2;
  }

  .hero-strip {
    grid-template-columns: 150px minmax(0, 1fr);
  }

  .hero-metrics {
    grid-column: 1 / -1;
  }

  .week-board {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .ops-row,
  .job-row,
  .artifact-row,
  .log-row,
  .cost-breakdown div,
  .credentials-form,
  .file-manager {
    grid-template-columns: 1fr;
  }

}

@media (max-width: 760px) {
  .manual-shell {
    grid-template-columns: 1fr;
    padding: 14px;
  }

  .manual-nav {
    position: static;
  }

  .manual-page {
    padding: 18px;
  }

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

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

  .sidebar {
    position: static;
    height: auto;
  }

  .brand-row {
    grid-template-columns: minmax(0, 1fr) 34px;
  }

  body.sidebar-collapsed .brand-copy,
  body.sidebar-collapsed .nav-label,
  body.sidebar-collapsed .guide-nav strong,
  body.sidebar-collapsed .sidebar-footer .nav-label {
    display: block;
  }

  body.sidebar-collapsed .nav-item {
    grid-template-columns: 1fr;
    padding: 8px;
  }

  .nav-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .nav-item {
    grid-template-columns: 1fr;
    justify-items: center;
    padding: 8px;
    text-align: center;
  }

  .nav-item span:last-child {
    font-size: 11px;
  }

  .workspace {
    padding: 16px;
  }

  .topbar,
  .section-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .hero-strip,
  .overview-grid,
  .blog-layout,
  .finance-grid,
  .strategy-grid,
  .idea-grid,
  .topic-pack-grid,
  .agent-grid,
  .process-board,
  .media-grid,
  .dashboard-metrics,
  .cost-metrics,
  .timeline {
    grid-template-columns: 1fr;
  }

  .span-2,
  .span-3 {
    grid-column: span 1;
  }

  .approval-item,
  .category-row,
  .roadmap-item,
  .ops-row,
  .job-row,
  .artifact-row,
  .log-row,
  .cost-breakdown div,
  .file-manager {
    grid-template-columns: 1fr;
  }

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

  .hero-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .task-form {
    grid-template-columns: 1fr;
  }
}
