:root {
  --bg: #f5f7f8;
  --ink: #17202a;
  --muted: #64717d;
  --line: #d8e0e5;
  --panel: #ffffff;
  --primary: #146c63;
  --primary-dark: #0f4e49;
  --shadow: 0 18px 46px rgba(19, 34, 45, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
  color: inherit;
  text-decoration: none;
}

.topbar {
  align-items: center;
  background: rgba(245, 247, 248, 0.92);
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 28px;
  justify-content: space-between;
  min-height: 68px;
  padding: 0 36px;
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(16px);
}

.brand {
  align-items: center;
  display: inline-flex;
  font-weight: 760;
  gap: 10px;
}

.brand-mark,
.platform-icon,
.app-icon {
  align-items: center;
  display: inline-flex;
  justify-content: center;
}

.brand-mark {
  background: var(--ink);
  border-radius: 7px;
  color: white;
  height: 34px;
  width: 34px;
}

.nav {
  display: flex;
  gap: 24px;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 650;
}

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

.hero {
  min-height: 620px;
  overflow: hidden;
  position: relative;
}

.hero-image {
  height: 100%;
  inset: 0;
  object-fit: cover;
  position: absolute;
  width: 100%;
}

.hero-overlay {
  background:
    linear-gradient(90deg, rgba(10, 16, 20, 0.92) 0%, rgba(10, 16, 20, 0.72) 35%, rgba(10, 16, 20, 0.18) 72%),
    linear-gradient(0deg, rgba(10, 16, 20, 0.26), rgba(10, 16, 20, 0.02));
  inset: 0;
  position: absolute;
}

.hero-content {
  color: white;
  max-width: 680px;
  padding: 94px 36px 90px;
  position: relative;
  width: min(100%, 1180px);
}

.eyebrow,
.section-kicker {
  color: #2d8d83;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  margin: 0 0 12px;
  text-transform: uppercase;
}

.hero .eyebrow {
  color: #8ce5d9;
}

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

h1 {
  font-size: clamp(3rem, 7vw, 5.9rem);
  line-height: 0.96;
  margin-bottom: 24px;
}

h2 {
  font-size: clamp(2rem, 4vw, 3.2rem);
  line-height: 1;
  margin-bottom: 12px;
}

h3 {
  font-size: 1.15rem;
  margin-bottom: 10px;
}

.hero-copy {
  color: rgba(255, 255, 255, 0.82);
  font-size: 1.18rem;
  line-height: 1.6;
  max-width: 610px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 32px;
}

.button {
  align-items: center;
  border-radius: 7px;
  display: inline-flex;
  font-weight: 760;
  min-height: 46px;
  padding: 0 18px;
}

.button.primary {
  background: #f6fbfa;
  color: #10201e;
}

.button.secondary {
  border: 1px solid rgba(255, 255, 255, 0.34);
  color: white;
}

.store-toolbar,
.license-band,
.platform-section {
  margin: 0 auto;
  max-width: 1180px;
  padding: 58px 36px 24px;
}

.store-toolbar {
  align-items: end;
  display: flex;
  gap: 26px;
  justify-content: space-between;
}

.controls {
  align-items: end;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: flex-end;
}

.search,
.language-picker {
  color: var(--muted);
  display: grid;
  font-size: 0.78rem;
  font-weight: 750;
  gap: 6px;
  text-transform: uppercase;
}

.search input,
.language-picker select {
  background: white;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--ink);
  font: inherit;
  height: 42px;
  min-width: 240px;
  outline: none;
  padding: 0 12px;
  text-transform: none;
}

.language-picker select {
  cursor: pointer;
  min-width: 210px;
}

.search input:focus,
.language-picker select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(20, 108, 99, 0.14);
}

.platform-filters {
  background: #e8eef1;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  padding: 4px;
}

.filter {
  background: transparent;
  border: 0;
  border-radius: 6px;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-weight: 760;
  min-height: 34px;
  padding: 0 12px;
}

.filter.active {
  background: white;
  color: var(--ink);
  box-shadow: 0 6px 16px rgba(19, 34, 45, 0.1);
}

.section-heading,
.projects-section {
  margin: 0 auto;
  max-width: 1180px;
}

.projects-section {
  padding: 18px 36px 56px;
}

.section-heading {
  align-items: end;
  display: flex;
  gap: 28px;
  justify-content: space-between;
  margin-bottom: 18px;
}

.section-heading > p {
  color: #44515d;
  line-height: 1.55;
  max-width: 520px;
}

.project-tabs {
  background: #e8eef1;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: inline-flex;
  margin-bottom: 18px;
  padding: 4px;
}

.project-tab {
  background: transparent;
  border: 0;
  border-radius: 6px;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-weight: 760;
  min-height: 36px;
  padding: 0 12px;
}

.project-tab.active {
  background: white;
  color: var(--ink);
  box-shadow: 0 6px 16px rgba(19, 34, 45, 0.1);
}

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

.project-card {
  background: #17202a;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  color: white;
  display: flex;
  flex-direction: column;
  min-height: 250px;
  padding: 20px;
}

.project-card .category {
  color: #8ce5d9;
}

.project-card p {
  color: rgba(255, 255, 255, 0.72);
  line-height: 1.55;
}

.project-card strong {
  color: #f5d18d;
  margin-top: auto;
}

.app-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0 auto;
  max-width: 1180px;
  padding: 4px 36px 50px;
}

.app-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 24px rgba(19, 34, 45, 0.06);
  display: flex;
  flex-direction: column;
  min-height: 320px;
  padding: 20px;
}

.app-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-2px);
  transition: 160ms ease;
}

.app-card-header {
  align-items: center;
  display: flex;
  gap: 14px;
  margin-bottom: 18px;
}

.app-icon {
  border-radius: 8px;
  color: white;
  flex: 0 0 auto;
  font-size: 1.2rem;
  font-weight: 850;
  height: 54px;
  width: 54px;
}

.app-symbol {
  align-items: center;
  background: #eef3f5;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: inline-flex;
  flex: 0 0 auto;
  height: 54px;
  justify-content: center;
  overflow: hidden;
  width: 54px;
}

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

.app-meta {
  min-width: 0;
}

.app-meta h3 {
  margin-bottom: 4px;
}

.category {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
}

.summary {
  color: #44515d;
  line-height: 1.55;
  min-height: 76px;
}

.badges,
.features {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.badge,
.feature {
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 760;
  padding: 5px 9px;
}

.badge {
  background: #eef3f5;
  color: #394853;
}

.feature {
  background: #f7f1e8;
  color: #684717;
}

.card-bottom {
  align-items: center;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 16px;
}

.price {
  font-weight: 850;
}

.status {
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.35;
  max-width: 170px;
  text-align: right;
}

.license-band {
  align-items: center;
  display: grid;
  gap: 32px;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.72fr);
  padding-bottom: 58px;
}

.license-band p {
  color: #44515d;
  font-size: 1.06rem;
  line-height: 1.65;
  max-width: 710px;
}

.license-steps {
  display: grid;
  gap: 10px;
}

.license-steps article {
  align-items: center;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  gap: 14px;
  padding: 16px;
}

.license-steps strong {
  color: var(--primary);
  font-size: 1.15rem;
}

.platform-section {
  padding-bottom: 82px;
}

.platform-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 22px;
}

.platform-grid article {
  background: #17202a;
  border-radius: 8px;
  color: white;
  min-height: 185px;
  padding: 20px;
}

.platform-grid p {
  color: rgba(255, 255, 255, 0.72);
  line-height: 1.5;
}

.platform-icon {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 7px;
  font-weight: 850;
  height: 42px;
  margin-bottom: 18px;
  width: 42px;
}

.empty {
  background: white;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  grid-column: 1 / -1;
  padding: 32px;
  text-align: center;
}

.admin-body {
  background: #eef3f5;
}

.admin-shell {
  display: grid;
  gap: 22px;
  margin: 0 auto;
  max-width: 1180px;
  padding: 36px;
}

.admin-hero,
.admin-panel,
.login-panel {
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 24px rgba(19, 34, 45, 0.06);
}

.admin-hero {
  align-items: center;
  display: flex;
  gap: 24px;
  justify-content: space-between;
  padding: 24px;
}

.admin-hero p {
  color: #44515d;
  line-height: 1.55;
  margin-bottom: 0;
  max-width: 680px;
}

.admin-layout {
  display: grid;
  gap: 18px;
  grid-template-columns: 280px minmax(0, 1fr);
}

.admin-tabs,
.admin-content {
  display: grid;
  gap: 12px;
}

.admin-tabs {
  align-self: start;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
}

.admin-tab {
  background: transparent;
  border: 0;
  border-radius: 6px;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-weight: 760;
  min-height: 42px;
  padding: 0 12px;
  text-align: left;
}

.admin-tab.active {
  background: #17202a;
  color: white;
}

.admin-panel {
  display: none;
  padding: 22px;
}

.admin-panel.active {
  display: block;
}

.login-panel {
  display: grid;
  gap: 14px;
  margin: 74px auto;
  max-width: 430px;
  padding: 24px;
}

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

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

.field {
  display: grid;
  gap: 6px;
}

.field span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.field input,
.field select,
.field textarea {
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--ink);
  font: inherit;
  min-height: 42px;
  padding: 10px 12px;
  width: 100%;
}

.field textarea {
  min-height: 110px;
  resize: vertical;
}

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.admin-button {
  background: #17202a;
  border: 0;
  border-radius: 7px;
  color: white;
  cursor: pointer;
  font: inherit;
  font-weight: 760;
  min-height: 42px;
  padding: 0 14px;
}

.admin-button.secondary {
  background: #e8eef1;
  color: var(--ink);
}

.admin-list {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.admin-list article,
.template-preview {
  background: #f8fafb;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}

.admin-list article {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.admin-list p {
  color: #44515d;
  margin-bottom: 0;
}

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

.dashboard-metrics article,
.dashboard-preview {
  background: #f8fafb;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
}

.dashboard-metrics span {
  color: var(--muted);
  display: block;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.dashboard-metrics strong {
  display: block;
  font-size: 2rem;
  line-height: 1;
  margin-top: 8px;
}

.dashboard-preview {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.dashboard-preview p {
  color: #44515d;
  line-height: 1.55;
}

.dashboard-preview code {
  background: #17202a;
  border-radius: 6px;
  color: white;
  display: block;
  font-size: 0.86rem;
  overflow-wrap: anywhere;
  padding: 10px;
}

.inline-link {
  display: inline-flex;
  text-decoration: none;
}

.template-preview {
  color: #34414c;
  line-height: 1.55;
  min-height: 230px;
  white-space: pre-wrap;
}

.is-hidden {
  display: none;
}

.assistant-toggle {
  background: var(--primary);
  border: 0;
  border-radius: 999px;
  bottom: 22px;
  box-shadow: var(--shadow);
  color: white;
  cursor: pointer;
  font: inherit;
  font-weight: 850;
  height: 58px;
  position: fixed;
  right: 22px;
  width: 58px;
  z-index: 30;
}

.assistant-panel {
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  bottom: 92px;
  box-shadow: var(--shadow);
  display: none;
  grid-template-rows: auto minmax(220px, 1fr) auto;
  max-height: min(620px, calc(100vh - 120px));
  overflow: hidden;
  position: fixed;
  right: 22px;
  width: min(420px, calc(100vw - 44px));
  z-index: 30;
}

.assistant-widget.open .assistant-panel {
  display: grid;
}

.assistant-panel header {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  padding: 14px;
}

.assistant-panel header span {
  color: var(--muted);
  display: block;
  font-size: 0.82rem;
  margin-top: 3px;
}

.assistant-close {
  background: #e8eef1;
  border: 0;
  border-radius: 7px;
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  font-weight: 760;
  min-height: 34px;
  padding: 0 10px;
}

.assistant-messages {
  display: grid;
  gap: 10px;
  overflow: auto;
  padding: 14px;
}

.assistant-messages.large {
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 420px;
}

.assistant-message {
  border-radius: 8px;
  line-height: 1.5;
  padding: 10px 12px;
  white-space: pre-wrap;
}

.assistant-message.user {
  background: #e8f4f2;
  justify-self: end;
  max-width: 86%;
}

.assistant-message.assistant {
  background: #f3f6f8;
  justify-self: start;
  max-width: 92%;
}

.assistant-form {
  border-top: 1px solid var(--line);
  display: grid;
  gap: 10px;
  padding: 12px;
}

.assistant-form.large {
  border-top: 0;
  padding: 12px 0 0;
}

.assistant-form textarea {
  border: 1px solid var(--line);
  border-radius: 7px;
  font: inherit;
  min-height: 92px;
  padding: 10px;
  resize: vertical;
}

.assistant-form button {
  background: #17202a;
  border: 0;
  border-radius: 7px;
  color: white;
  cursor: pointer;
  font: inherit;
  font-weight: 760;
  min-height: 42px;
}

.chat-page,
.factory-shell {
  display: grid;
  gap: 22px;
  margin: 0 auto;
  max-width: 1180px;
  padding: 36px;
}

.chat-hero,
.chat-workspace,
.factory-layout,
.factory-panel {
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 24px rgba(19, 34, 45, 0.06);
}

.chat-hero {
  padding: 24px;
}

.chat-hero p {
  color: #44515d;
  line-height: 1.6;
  max-width: 740px;
}

.chat-workspace {
  padding: 18px;
}

.factory-layout {
  display: grid;
  gap: 0;
  grid-template-columns: 240px minmax(0, 1fr);
  overflow: hidden;
}

.factory-tabs {
  background: #17202a;
  display: grid;
  gap: 8px;
  padding: 12px;
}

.factory-tab {
  background: transparent;
  border: 0;
  border-radius: 7px;
  color: rgba(255, 255, 255, 0.72);
  cursor: pointer;
  font: inherit;
  font-weight: 760;
  min-height: 42px;
  padding: 0 12px;
  text-align: left;
}

.factory-tab.active {
  background: white;
  color: var(--ink);
}

.factory-content {
  padding: 18px;
}

.factory-panel {
  box-shadow: none;
  display: none;
  padding: 20px;
}

.factory-panel.active {
  display: block;
}

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

.runtime-summary article,
.runtime-grid article,
.runtime-list article {
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 24px rgba(19, 34, 45, 0.06);
  padding: 18px;
}

.runtime-summary p,
.runtime-grid p,
.runtime-list p {
  color: #44515d;
  line-height: 1.55;
}

.runtime-list {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.runtime-list article {
  align-items: start;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.runtime-list pre {
  background: #17202a;
  border-radius: 8px;
  color: white;
  font-size: 0.88rem;
  line-height: 1.45;
  overflow-x: auto;
  padding: 12px;
  white-space: pre-wrap;
}

.tracker-shell {
  display: grid;
  gap: 22px;
  margin: 0 auto;
  max-width: 1320px;
  padding: 36px;
}

.tracker-search {
  min-width: 280px;
}

.tracker-layout {
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 24px rgba(19, 34, 45, 0.06);
  display: grid;
  grid-template-columns: 260px 360px minmax(0, 1fr);
  min-height: 680px;
  overflow: hidden;
}

.tracker-sidebar,
.tracker-browser,
.tracker-detail {
  min-width: 0;
  padding: 18px;
}

.tracker-sidebar,
.tracker-browser {
  border-right: 1px solid var(--line);
}

.tracker-sidebar {
  background: #f3f6f8;
}

.tracker-sidebar h2,
.tracker-browser h2 {
  font-size: 1rem;
  margin: 10px 0;
}

.tracker-list,
.tracker-project-list,
.timeline,
.artifact-grid {
  display: grid;
  gap: 10px;
}

.tracker-row,
.tracker-project {
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  cursor: pointer;
  display: grid;
  font: inherit;
  gap: 4px;
  padding: 12px;
  text-align: left;
  width: 100%;
}

.tracker-row.active,
.tracker-project.active {
  background: #17202a;
  color: white;
}

.tracker-row span,
.tracker-project span,
.tracker-project em,
.programmer-row em {
  color: var(--muted);
  font-size: 0.84rem;
  font-style: normal;
}

.tracker-row.active span,
.tracker-project.active span,
.tracker-project.active em,
.programmer-row.active em {
  color: rgba(255, 255, 255, 0.72);
}

.programmer-row {
  align-items: center;
  grid-template-columns: 34px minmax(0, 1fr);
}

.mini-avatar {
  align-items: center;
  border-radius: 7px;
  color: white;
  display: inline-flex;
  font-size: 0.78rem;
  font-weight: 850;
  height: 34px;
  justify-content: center;
  width: 34px;
}

.tracker-browser header {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
}

.tracker-detail {
  overflow: auto;
}

.tracker-detail header p {
  color: #44515d;
  line-height: 1.55;
}

.timeline article,
.artifact-grid article {
  background: #f8fafb;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 8px;
  padding: 14px;
}

.timeline code,
.artifact-grid code {
  background: #17202a;
  border-radius: 6px;
  color: white;
  font-size: 0.84rem;
  overflow-wrap: anywhere;
  padding: 6px 8px;
}

.timeline small,
.artifact-grid small {
  color: var(--muted);
}

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

@media (max-width: 940px) {
  .topbar,
  .store-toolbar,
  .license-band,
  .section-heading,
  .admin-hero {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar {
    gap: 14px;
    padding: 14px 22px;
  }

  .nav {
    flex-wrap: wrap;
  }

  .hero {
    min-height: 590px;
  }

  .hero-content,
  .store-toolbar,
  .license-band,
  .platform-section,
  .projects-section,
  .admin-shell,
  .chat-page,
  .factory-shell,
  .tracker-shell {
    padding-left: 22px;
    padding-right: 22px;
  }

  .store-toolbar {
    align-items: stretch;
  }

  .controls {
    align-items: stretch;
    justify-content: stretch;
  }

  .search input {
    min-width: 100%;
  }

  .language-picker select {
    min-width: 100%;
  }

  .platform-filters {
    overflow-x: auto;
  }

  .app-grid,
  .project-grid,
  .dashboard-metrics,
  .dashboard-preview,
  .runtime-summary,
  .runtime-grid,
  .tracker-layout,
  .artifact-grid,
  .platform-grid,
  .license-band,
  .admin-layout,
  .form-grid.two,
  .factory-layout {
    grid-template-columns: 1fr;
  }

  .factory-tabs {
    grid-auto-flow: column;
    overflow-x: auto;
  }

  .app-grid,
  .projects-section {
    padding-left: 22px;
    padding-right: 22px;
  }

  .project-tabs {
    display: flex;
    overflow-x: auto;
  }
}

@media (min-width: 941px) and (max-width: 1120px) {
  .app-grid,
  .project-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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