:root {
  color-scheme: light;
  --ink: #14201d;
  --muted: #60706b;
  --line: #d8e0dc;
  --paper: #f7f8f5;
  --panel: #ffffff;
  --accent: #197278;
  --accent-2: #c44536;
  --danger: #b42318;
  --danger-soft: #fff0ed;
  --soft: #e8f1ef;
}

* {
  box-sizing: border-box;
}

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

[hidden] {
  display: none !important;
}

button,
input,
select {
  font: inherit;
}

button {
  border: 1px solid var(--accent);
  background: var(--accent);
  color: white;
  min-height: 42px;
  padding: 0 16px;
  border-radius: 6px;
  cursor: pointer;
}

button:disabled {
  border-color: #b7c3bf;
  background: #dce4e1;
  color: #6a7773;
  cursor: not-allowed;
}

button.secondary,
.agent-card .usage-add {
  background: white;
  color: var(--accent);
}

button.danger {
  border-color: var(--danger);
  background: var(--danger);
  color: #fff;
}

.shell {
  min-height: 100vh;
}

.hero {
  min-height: 72vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  position: relative;
  align-items: end;
  overflow: hidden;
  padding: clamp(24px, 5vw, 64px);
}

.hero-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(1.05);
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(247, 248, 245, 0.94), rgba(247, 248, 245, 0.72) 42%, rgba(247, 248, 245, 0.12));
}

.hero-copy {
  position: relative;
  z-index: 1;
  max-width: 650px;
}

.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-bottom: clamp(28px, 6vw, 72px);
  color: var(--ink);
  font-size: 1.08rem;
  font-weight: 900;
}

.brand-mark {
  display: block;
  width: 50px;
  height: 50px;
  object-fit: contain;
}

.signed-in .hero {
  min-height: 260px;
  align-items: center;
}

.signed-in .signin,
.signed-in .provider-signin,
.signed-in .email-signin,
.signed-in .auth-message,
.signed-in .use-cases,
.signed-in .enterprise-cta {
  display: none;
}

.signed-in .hero-copy h1 {
  max-width: 840px;
  font-size: clamp(2.8rem, 7vw, 5.4rem);
}

.signed-in .hero-copy > p:not(.eyebrow) {
  display: block;
  max-width: 540px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0;
}

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

h1 {
  margin-bottom: 14px;
  font-size: clamp(3rem, 9vw, 6rem);
  line-height: 0.96;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: 1.7rem;
}

h3 {
  margin-bottom: 4px;
  font-size: 1.1rem;
}

.hero-copy > p:not(.eyebrow) {
  max-width: 520px;
  color: #2e3f3b;
  font-size: 1.1rem;
  line-height: 1.5;
}

.signin {
  display: flex;
  gap: 10px;
  align-items: center;
  max-width: 660px;
}

.provider-signin {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 22px 0 10px;
}

.provider-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--ink);
  font-weight: 800;
  text-decoration: none;
}

.provider-button.dark {
  background: #111816;
  border-color: #111816;
  color: #fff;
}

.email-signin {
  display: grid;
  gap: 8px;
  width: min(100%, 520px);
  margin: 8px 0 0;
}

.email-signin label {
  color: #2e3f3b;
  font-size: 0.92rem;
  font-weight: 800;
}

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

.email-signin input {
  min-height: 46px;
  min-width: 0;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
  border-radius: 6px;
  padding: 0 14px;
}

.email-signin-message {
  min-height: 20px;
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.email-signin-message.error {
  color: var(--accent-2);
}

.dev-signin {
  opacity: 0.74;
}

.auth-message {
  min-height: 22px;
  color: var(--accent-2);
  font-weight: 700;
}

.signin input {
  flex: 1;
  min-height: 46px;
  min-width: 0;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
  border-radius: 6px;
  padding: 0 14px;
}

.use-cases {
  padding: 46px clamp(18px, 5vw, 56px) 22px;
}

.section-head {
  max-width: 760px;
  margin-bottom: 20px;
}

.section-head h2 {
  margin-bottom: 10px;
}

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

.case-grid article {
  min-height: 220px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px;
}

.case-grid span {
  display: block;
  margin-bottom: 26px;
  color: var(--accent);
  font-weight: 800;
}

.case-grid p {
  color: var(--muted);
  line-height: 1.55;
}

.enterprise-cta {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: clamp(22px, 4vw, 54px);
  align-items: center;
  margin: 24px clamp(18px, 5vw, 56px) 18px;
  padding: clamp(28px, 4vw, 44px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 28px;
  background: linear-gradient(135deg, #234846, #2f745b);
  color: white;
  box-shadow: 0 22px 56px rgba(20, 32, 29, 0.13);
}

.enterprise-copy {
  max-width: 950px;
}

.enterprise-eyebrow {
  margin: 0 0 14px;
  color: rgba(255, 255, 255, 0.76);
  font-size: 0.86rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.enterprise-cta h2 {
  margin: 0 0 14px;
  font-size: clamp(2.2rem, 4.8vw, 4.8rem);
  line-height: 0.98;
  letter-spacing: 0;
}

.enterprise-cta p:last-child {
  max-width: 890px;
  margin: 0;
  color: rgba(255, 255, 255, 0.78);
  font-size: clamp(1.02rem, 1.5vw, 1.28rem);
  font-weight: 650;
  line-height: 1.55;
}

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

.enterprise-actions a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 58px;
  padding: 0 28px;
  border-radius: 18px;
  font-size: 1.05rem;
  font-weight: 900;
  text-decoration: none;
  white-space: nowrap;
}

.enterprise-primary {
  border: 1px solid white;
  background: white;
  color: #234846;
}

.enterprise-secondary {
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.12);
  color: white;
}

.workspace {
  padding: 30px clamp(18px, 5vw, 56px) 56px;
}

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

.agents {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 360px));
  gap: 16px;
  align-items: stretch;
}

.agent-card,
.add-card,
.business-card,
.business-access-card {
  width: 100%;
  min-height: 250px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
}

.agent-card,
.business-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.agent-card.business-agent {
  border-color: rgba(23, 92, 67, 0.32);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(236, 249, 241, 0.94)),
    var(--panel);
  box-shadow: 0 18px 40px rgba(20, 32, 29, 0.08);
}

.agent-card.deleted {
  border-color: #e7b8b2;
  background: linear-gradient(180deg, #fff, var(--danger-soft));
}

.card-top {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.flavor,
.status,
dt {
  color: var(--muted);
}

.status {
  white-space: nowrap;
  font-size: 0.85rem;
}

dl {
  display: grid;
  gap: 8px;
  margin: 0;
}

dl div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 8px;
}

dt,
dd {
  margin: 0;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
}

.actions button {
  flex: 0 0 auto;
  min-width: 10rem;
}

.actions .open,
.actions .business-buy {
  flex: 0 0 min(100%, 12rem);
  width: min(100%, 12rem);
}

.opening-note {
  flex: 0 0 100%;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 650;
  line-height: 1.35;
  display: block;
}

.actions .delete {
  order: 20;
  flex: 0 0 100%;
  width: min(100%, 12rem);
  min-height: 42px;
  justify-content: center;
  padding: 0 14px;
  border: 1px solid rgba(183, 45, 35, 0.35);
  border-radius: 8px;
  background: #fff;
  color: var(--danger);
  font-size: 0.88rem;
  font-weight: 800;
  text-align: center;
}

.actions .delete:hover,
.actions .delete:focus-visible {
  border-color: rgba(183, 45, 35, 0.68);
  background: #fff7f5;
}

.actions .codex {
  border-color: rgba(23, 92, 67, 0.28);
  background: #eef7f1;
  color: #175c43;
}

.payment-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border-radius: 8px;
  background: #175c43;
  color: #fff;
  font-weight: 800;
  text-decoration: none;
}

.deleted-panel {
  display: grid;
  gap: 8px;
  margin-top: auto;
  padding: 12px;
  border: 1px solid #e7b8b2;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
}

.deleted-panel p,
.deleted-panel small {
  margin: 0;
  color: #6f3b35;
}

.deleted-panel a {
  color: var(--danger);
  font-weight: 800;
  text-decoration: none;
}

.add-card {
  border-style: dashed;
  display: grid;
  place-items: center;
  padding: 24px;
}

.business-card {
  position: relative;
  overflow: hidden;
  color: #10211d;
  border-color: rgba(23, 92, 67, 0.3);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(232, 247, 238, 0.92)),
    radial-gradient(circle at top right, rgba(47, 116, 91, 0.18), transparent 42%);
  box-shadow: 0 18px 48px rgba(20, 32, 29, 0.1);
}

.business-access-card {
  border-color: rgba(25, 114, 120, 0.26);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(232, 241, 239, 0.9));
}

.business-access-card form {
  display: grid;
  gap: 12px;
}

.business-access-card h3 {
  margin: 0;
  font-size: 1.35rem;
}

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

.business-access-card label {
  display: grid;
  gap: 6px;
  color: var(--ink);
  font-weight: 850;
}

.business-access-card input,
.business-access-card textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  padding: 10px 12px;
}

.business-access-card textarea {
  resize: vertical;
  line-height: 1.45;
}

.access-defaults {
  color: var(--muted);
  line-height: 1.35;
}

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

.business-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: linear-gradient(90deg, #175c43, #d9b35f);
}

.business-card h3 {
  margin: 0;
  font-size: 1.45rem;
  line-height: 1.1;
}

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

.business-eyebrow {
  margin: 0 0 8px !important;
  color: #175c43 !important;
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.business-card ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
  color: #465b54;
}

.business-card li::before {
  content: "+";
  margin-right: 8px;
  color: #175c43;
  font-weight: 900;
}

.business-price {
  margin-top: auto;
  color: #10211d;
  font-size: 1.6rem;
  font-weight: 950;
}

.business-card .codex.preview {
  border: 1px solid rgba(23, 92, 67, 0.25);
  background: rgba(255, 255, 255, 0.62);
  color: rgba(23, 92, 67, 0.58);
}

.business-buy {
  background: #175c43;
  color: white;
  border-color: #175c43;
}

.managed-users {
  margin-top: 28px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
}

.managed-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
  margin-bottom: 14px;
}

.managed-head h3 {
  margin: 0;
  font-size: 1.35rem;
}

.managed-head p {
  margin: 6px 0 0;
  color: var(--muted);
}

.managed-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 10px;
}

.managed-user {
  display: grid;
  gap: 4px;
  min-height: 64px;
  padding: 10px 12px;
  border-color: var(--line);
  background: #fff;
  color: var(--ink);
  text-align: left;
}

.managed-user span {
  font-weight: 850;
}

.managed-user small {
  color: var(--muted);
  line-height: 1.35;
}

.add-card form {
  width: min(100%, 300px);
  display: grid;
  gap: 10px;
  margin: 0 auto;
}

.add-symbol {
  width: 58px;
  height: 58px;
  border: 2px solid var(--accent);
  color: var(--accent);
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 2.2rem;
  line-height: 1;
  margin: 0 auto 8px;
}

.add-note,
.form-message {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
  text-align: center;
}

.form-message {
  min-height: 22px;
  color: var(--accent-2);
  font-size: 0.9rem;
}

.add-card input,
.add-card select {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 10px;
  background: white;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 30px clamp(18px, 5vw, 56px);
  border-top: 1px solid var(--line);
  color: var(--muted);
}

.site-footer p {
  max-width: 520px;
  margin: 6px 0 0;
}

.footer-brand-lockup {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--ink);
}

.footer-brand-mark {
  display: block;
  width: 30px;
  height: 30px;
}

.site-footer nav {
  display: flex;
  gap: 16px;
  align-items: start;
  flex-wrap: wrap;
}

.footer-links {
  display: grid;
  justify-items: end;
  gap: 14px;
}

.footer-assets {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: end;
}

.footer-label {
  color: var(--ink);
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.site-footer a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 700;
}

.confirm-dialog {
  width: min(420px, calc(100% - 32px));
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0;
  color: var(--ink);
  box-shadow: 0 24px 80px rgba(20, 32, 29, 0.24);
}

.confirm-dialog::backdrop {
  background: rgba(20, 32, 29, 0.42);
}

.confirm-dialog form {
  display: grid;
  gap: 14px;
  padding: 22px;
}

.confirm-dialog h2 {
  margin: 0;
}

.confirm-dialog p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.dialog-actions {
  display: flex;
  justify-content: end;
  gap: 10px;
}

.legal-page {
  width: min(760px, calc(100% - 36px));
  margin: 0 auto;
  padding: 56px 0;
  line-height: 1.65;
}

.legal-page a {
  color: var(--accent);
  font-weight: 800;
  text-decoration: none;
}

.legal-page .legal-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-size: 1.08rem;
  font-weight: 900;
}

.legal-brand img {
  display: block;
}

.legal-page h1 {
  margin-top: 28px;
  font-size: 3rem;
}

.legal-page h2 {
  margin-top: 30px;
}

.language-note {
  color: var(--muted);
  font-weight: 650;
}

.notice {
  margin: 22px 0;
  padding: 16px 18px;
  border: 1px solid rgba(25, 114, 120, 0.24);
  border-radius: 8px;
  background: var(--soft);
}

@media (max-width: 680px) {
  .hero {
    min-height: 68vh;
    padding: 24px 18px;
  }

  .hero::after {
    background: rgba(247, 248, 245, 0.82);
  }

  .signin,
  .provider-signin,
  .toolbar,
  .actions,
  .enterprise-actions,
  .dialog-actions,
  .site-footer {
    flex-direction: column;
    align-items: stretch;
  }

  .provider-button {
    width: 100%;
  }

  .email-row,
  .code-row {
    grid-template-columns: 1fr;
  }

  .case-grid {
    grid-template-columns: 1fr;
  }

  .enterprise-cta {
    grid-template-columns: 1fr;
    margin-top: 10px;
    padding: 24px 20px;
    border-radius: 20px;
  }

  .enterprise-actions a {
    min-height: 52px;
    width: 100%;
  }

  .managed-head {
    flex-direction: column;
  }

  .footer-links,
  .footer-assets {
    justify-items: start;
    justify-content: start;
  }

  .agents {
    grid-template-columns: 1fr;
  }
}
