:root {
  font-family: var(--font-ui);
  color: #1f2933;
  background: #f4f6f8;
  --surface: #ffffff;
  --surface-muted: #f5f7f9;
  --border: rgba(31, 41, 51, .08);
  --border-strong: rgba(31, 41, 51, .13);
  --text-muted: #5f6b75;
  --ink-strong: #18222c;
  --brand: #a41e22;
  --brand-hover: #86181b;
  --brand-soft: #f8eeee;
  --focus: #315f7d;
  --radius: 5px;
  --shadow-soft: 0 10px 30px rgba(23, 35, 45, .07);
  --shadow-hover: 0 16px 38px rgba(23, 35, 45, .11);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  color: #1f2933;
  background: #f4f6f8;
  font-family: var(--font-ui);
  font-size: 16px;
}
button, input, select { font: inherit; font-family: var(--font-ui); }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .48; }
a { color: inherit; }

.site-header { background: rgba(255, 255, 255, .94); box-shadow: 0 1px 0 rgba(31, 41, 51, .05); }
.site-header-inner {
  width: min(1500px, calc(100% - 40px));
  min-height: 68px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.site-header-login { justify-content: flex-start; }
.brand-lockup { min-width: 0; display: flex; align-items: center; gap: 14px; text-decoration: none; }
.cto-logo { display: block; width: 200px; height: 28px; object-fit: contain; object-position: left center; }
.brand-divider { width: 1px; height: 26px; flex: 0 0 auto; background: rgba(31, 41, 51, .11); }
.product-lockup { min-width: 0; display: inline-flex; align-items: center; gap: 9px; color: #26333d; font-size: 15px; line-height: 1.2; white-space: nowrap; }
.product-lockup strong { font-family: var(--font-heading); font-weight: 620; }
.product-badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 2px 8px;
  color: #7f1b1f;
  background: var(--brand-soft);
  border: 0;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.admin-session-actions { flex: 0 0 auto; }

.labs-shell { width: min(1180px, calc(100% - 40px)); margin: 0 auto 72px; }
.labs-hero { padding: 58px 0 36px; }
.eyebrow { margin: 0 0 8px; color: #6d7881; font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
h1, h2 { margin: 0; color: var(--ink-strong); font-family: var(--font-heading); line-height: 1.16; }
h1 { font-size: clamp(34px, 4vw, 46px); font-weight: 680; letter-spacing: -.02em; }
h2 { font-size: clamp(21px, 2vw, 26px); font-weight: 680; letter-spacing: -.015em; }
.lede { margin: 12px 0 0; max-width: 800px; color: var(--text-muted); font-size: 16px; line-height: 1.65; }
.tools-section { padding: 20px 0 32px; }
.tools-heading { margin-bottom: 18px; }
.tools-heading p { margin: 6px 0 0; color: var(--text-muted); font-size: 14px; }
.tool-grid {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 16px;
}
.tool-card {
  display: grid;
  width: 100%;
  max-width: 344px;
  flex: 1 1 290px;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 15px;
  min-height: 164px;
  padding: 21px;
  color: inherit;
  background: var(--surface);
  border: 0;
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  text-decoration: none;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}
a.tool-card:hover { background: #fff; box-shadow: var(--shadow-hover); transform: translateY(-2px); }
a.tool-card:focus-visible { outline: 3px solid rgba(49, 95, 125, .18); outline-offset: 2px; box-shadow: var(--shadow-hover); }
.tool-card__icon { width: 38px; height: 38px; margin-top: 1px; opacity: .86; }
.tool-card__icon-placeholder {
  width: 38px;
  height: 38px;
  margin-top: 1px;
  border-radius: var(--radius);
  background: #eef1f3;
}
.tool-card__content { min-width: 0; }
.tool-card__eyebrow { display: block; margin: 0 0 7px; color: #748089; font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.tool-card__title-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.tool-card h2 { font-size: 21px; }
.demo-badge {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 2px 7px;
  color: #7f1b1f;
  background: var(--brand-soft);
  border-radius: 999px;
  font-size: 9px;
  font-weight: 850;
  letter-spacing: .08em;
  line-height: 1;
  text-transform: uppercase;
  white-space: nowrap;
}
.tool-card__description { display: block; margin: 9px 0 16px; color: var(--text-muted); font-size: 14px; line-height: 1.55; }
.tool-card__action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #7f1b1f;
  font-size: 14px;
  font-weight: 750;
}
.tool-card__action-icon { width: 15px; height: 15px; opacity: .78; }
.tool-card--placeholder {
  background: rgba(255, 255, 255, .52);
  box-shadow: 0 8px 24px rgba(23, 35, 45, .035);
}
.tool-card--placeholder .tool-card__icon-placeholder { background: rgba(31, 41, 51, .05); }
.tool-card__placeholder-title {
  display: block;
  color: #7b858d;
  font-family: var(--font-heading);
  font-size: 19px;
  font-weight: 650;
  line-height: 1.2;
}
.tool-card__placeholder-line {
  display: block;
  width: 82%;
  height: 8px;
  margin-top: 13px;
  border-radius: 999px;
  background: rgba(31, 41, 51, .055);
}
.tool-card__placeholder-line--short { width: 58%; margin-top: 8px; }

.field label { display: block; min-height: 20px; margin-bottom: 7px; color: #35414b; font-size: 13px; font-weight: 720; }
input, select {
  width: 100%;
  min-width: 0;
  height: 44px;
  padding: 0 13px;
  color: #1f2933;
  background: #fff;
  border: 1px solid rgba(31, 41, 51, .13);
  border-radius: var(--radius);
  outline: none;
  box-shadow: 0 1px 2px rgba(23, 35, 45, .03);
}
input:hover:not(:disabled), select:hover:not(:disabled) { border-color: rgba(31, 41, 51, .22); }
input:focus, select:focus { border-color: rgba(49, 95, 125, .48); box-shadow: 0 0 0 3px rgba(49, 95, 125, .10); }
.button { min-height: 44px; padding: 0 17px; border: 0; border-radius: var(--radius); font-weight: 720; white-space: nowrap; transition: background .14s ease, box-shadow .14s ease, transform .14s ease; }
.button-compact { min-height: 36px; padding: 0 13px; font-size: 13px; border-radius: var(--radius); }
.button-with-icon { display: inline-flex; align-items: center; justify-content: center; gap: 7px; }
.button-with-icon .ui-icon { width: 15px; height: 15px; opacity: .78; }
.button-primary { color: #fff; background: var(--brand); box-shadow: 0 5px 12px rgba(164, 30, 34, .14); }
.button-primary:hover:not(:disabled) { background: var(--brand-hover); box-shadow: 0 7px 16px rgba(134, 24, 27, .17); }
.button-success { color: #fff; background: #267c4a; box-shadow: 0 5px 12px rgba(24, 110, 64, .16); }
.button-success:hover:not(:disabled) { background: #20673e; box-shadow: 0 7px 16px rgba(24, 110, 64, .20); }
.button-success:focus-visible { outline: 3px solid rgba(38, 124, 74, .28); outline-offset: 2px; }
.button-secondary { color: #2f3d47; background: #eef1f3; }
.button-secondary:hover:not(:disabled) { color: #1f2d36; background: #e6eaed; }
.notice { margin-top: 12px; padding: 11px 14px; border: 0; border-radius: var(--radius); font-size: 13px; line-height: 1.5; }
.notice-error { color: #792f2f; background: #fff1f1; }

.login-page { background: #f4f6f8; }
.login-shell { width: min(440px, calc(100% - 32px)); margin: 80px auto 52px; }
.login-card { padding: 30px; background: var(--surface); border: 0; border-radius: var(--radius); box-shadow: var(--shadow-soft); }
.login-card h1 { font-size: 28px; }
.login-card .lede { font-size: 15px; }
.login-form { display: grid; gap: 16px; margin-top: 24px; }
.login-form .button { width: 100%; }

@media (max-width: 760px) {
  .site-header-inner { min-height: 62px; }
  .cto-logo { width: 170px; height: auto; }
  .brand-divider { height: 24px; }
}
@media (max-width: 640px) {
  .site-header-inner, .labs-shell { width: min(100% - 20px, 1180px); }
  .cto-logo { width: 150px; }
  .brand-lockup { gap: 9px; }
  .brand-divider { display: none; }
  .button-compact { padding: 0 10px; }
  .labs-hero { padding-top: 40px; }
  .tool-card { max-width: none; flex-basis: 100%; grid-template-columns: 38px minmax(0, 1fr); padding: 20px; border-radius: var(--radius); }
  .tool-card__icon, .tool-card__icon-placeholder { width: 34px; height: 34px; }
  .login-shell { margin-top: 48px; }
  .login-card { padding: 24px; border-radius: var(--radius); }
}

/* Compact calculator action, scoped to CodePunch pricing controls. */
.ctui-root a.labs-pricing-button { text-decoration:none; padding-inline:6px; flex:none; }
.ctui-root .labs-pricing-button img { display:block; width:22px; height:22px; }
.ctui-root a.labs-pricing-button[data-pricing-state="attention"] { background:#fff5db; border-color:#b58026; }
.ctui-root a.labs-pricing-button[data-pricing-state="unknown"] { background:#ffe9e9; border-color:#b64242; }
