:root {
  --ink: #17201b;
  --muted: #647067;
  --line: #d9e1dc;
  --paper: #f8faf8;
  --panel: #ffffff;
  --green: #14724f;
  --red: #b33a3a;
  --yellow: #b67b10;
  --blue: #245f9d;
  --shadow: 0 14px 40px rgba(28, 42, 35, 0.1);
}

* {
  box-sizing: border-box;
}

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

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

button {
  min-height: 42px;
  border: 0;
  border-radius: 6px;
  background: var(--green);
  color: #fff;
  padding: 0 16px;
  cursor: pointer;
  font-weight: 700;
  transition: transform 180ms ease, box-shadow 180ms ease, background-color 180ms ease, color 180ms ease;
}

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

button.danger {
  background: var(--red);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

button:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(20, 114, 79, 0.16);
}

button:active:not(:disabled) {
  transform: translateY(0);
}

input,
select,
textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  padding: 10px 12px;
  transition: border-color 180ms ease, box-shadow 180ms ease;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(20, 114, 79, 0.12);
}

textarea {
  min-height: 88px;
  resize: vertical;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px clamp(16px, 4vw, 48px);
  background: rgba(248, 250, 248, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
  box-shadow: 0 8px 30px rgba(28, 42, 35, 0.06);
}

.mobile-menu-toggle {
  display: none;
}

.mobile-menu-panel {
  display: contents;
}

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

h1 {
  margin-bottom: 0;
  font-size: clamp(24px, 3vw, 38px);
  line-height: 1.05;
}

h2 {
  margin-bottom: 8px;
  font-size: 24px;
}

h3 {
  margin-bottom: 8px;
  font-size: 18px;
}

p {
  color: var(--muted);
}

.warning-text {
  color: var(--red);
  font-weight: 800;
}

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

.tabs {
  display: flex;
  gap: 6px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 36px;
  background: transparent;
  color: var(--muted);
}

.nav-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tab.active {
  background: var(--ink);
  color: #fff;
  box-shadow: 0 8px 18px rgba(23, 32, 27, 0.16);
}

main {
  width: min(1380px, 100%);
  margin: 0 auto;
  padding: 28px clamp(16px, 4vw, 48px) 56px;
  overflow-x: clip;
}

.view {
  display: none;
}

.view.active {
  display: block;
  animation: view-in 220ms ease both;
}

@keyframes view-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes menu-in {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    scroll-behavior: auto !important;
    transition-duration: 0.001ms !important;
  }
}

.panel,
.pillar-block,
.question-row,
.report-card,
.list-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease, background-color 180ms ease;
}

.panel {
  padding: 22px;
}

.intro-panel,
.admin-toolbar,
.report-toolbar,
.assessment-status {
  display: grid;
  grid-template-columns: minmax(220px, 0.8fr) minmax(320px, 1.2fr);
  gap: 24px;
  align-items: start;
}

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

.assessment-form button {
  grid-column: span 2;
}

.workspace {
  margin-top: 22px;
}

.hidden {
  display: none !important;
}

.assessment-status {
  position: sticky;
  top: 93px;
  z-index: 5;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.progress-wrap {
  align-self: center;
}

.progress {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #e7eee9;
}

.progress span {
  display: block;
  width: 0%;
  height: 100%;
  background: var(--green);
}

.question-list,
.admin-pillars {
  display: grid;
  gap: 16px;
  margin-top: 18px;
}

.pillar-block {
  padding: 18px;
}

.pillar-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
  min-width: 0;
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
  margin-bottom: 12px;
}

.pillar-head > div {
  min-width: 0;
}

.pillar-head h3,
.pillar-head p {
  overflow-wrap: anywhere;
}

.question-row {
  display: grid;
  grid-template-columns: 1fr minmax(240px, 360px);
  gap: 16px;
  align-items: center;
  padding: 14px;
  box-shadow: none;
}

.question-row.unanswered {
  border-color: var(--red);
  background: #fff5f5;
  box-shadow: 0 0 0 2px rgba(179, 58, 58, 0.12);
}

.question-row.unanswered::before {
  content: "Answer required";
  grid-column: 1 / -1;
  color: var(--red);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.question-section {
  margin: 14px 0 8px;
  padding: 8px 10px;
  border-left: 4px solid var(--green);
  background: #eef6f1;
  color: var(--ink);
  font-weight: 900;
}

.scale {
  display: grid;
  grid-template-columns: repeat(5, minmax(34px, 1fr));
  gap: 6px;
}

.scale label {
  display: grid;
  place-items: center;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  cursor: pointer;
  text-align: center;
}

.scale label small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.15;
}

.scale label span {
  font-weight: 900;
}

.scale input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.scale label:has(input:checked) {
  border-color: var(--green);
  background: #e7f3ed;
  color: var(--green);
  font-weight: 800;
}

.scale label:has(input:checked) small {
  color: var(--green);
}

.report-layout {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 20px;
  margin-top: 20px;
}

.list-panel {
  display: grid;
  align-content: start;
  gap: 10px;
}

.list-item {
  width: 100%;
  padding: 14px;
  text-align: left;
  background: #fff;
  color: var(--ink);
}

.list-item:hover,
.record-list-item:hover,
.plan-card:hover,
.testimonial-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 42px rgba(28, 42, 35, 0.13);
}

.report-output {
  min-height: 420px;
}

.score-hero {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 20px;
  align-items: center;
  margin-bottom: 20px;
}

.score-ring {
  display: grid;
  place-items: center;
  width: 160px;
  height: 160px;
  border: 14px solid #e3eee8;
  border-top-color: var(--green);
  border-radius: 50%;
  font-size: 36px;
  font-weight: 900;
}

.score-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.report-card {
  padding: 16px;
}

.personality-card {
  margin-bottom: 16px;
  border-left: 4px solid var(--green);
}

.badge-card {
  display: grid;
  grid-template-columns: minmax(180px, 240px) 1fr;
  gap: 18px;
  align-items: center;
  margin-bottom: 16px;
  border-color: color-mix(in srgb, var(--badge-color) 45%, var(--line));
  background: linear-gradient(135deg, #fff 0%, color-mix(in srgb, var(--badge-color) 10%, #fff) 100%);
}

.achievement-badge {
  display: grid;
  place-items: center;
  min-height: 190px;
  padding: 18px;
  border: 2px solid color-mix(in srgb, var(--badge-color) 40%, #fff);
  border-radius: 8px;
  background: radial-gradient(circle at top, color-mix(in srgb, var(--badge-color) 18%, #fff), #fff 68%);
  color: var(--badge-color);
  text-align: center;
}

.achievement-badge span {
  display: grid;
  place-items: center;
  width: 76px;
  height: 76px;
  margin-bottom: 8px;
  border-radius: 999px;
  background: var(--badge-color);
  color: #fff;
  font-size: 22px;
  font-weight: 900;
}

.achievement-badge strong {
  font-size: 22px;
  line-height: 1.1;
}

.achievement-badge small {
  margin-top: 6px;
  color: var(--muted);
  font-weight: 900;
  text-transform: uppercase;
}

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

.score-line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.bar {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #e7eee9;
}

.bar span {
  display: block;
  height: 100%;
  background: var(--blue);
}

.action-list {
  display: grid;
  gap: 12px;
  margin-top: 20px;
}

.admin-pillar-form,
.admin-question-form {
  display: grid;
  grid-template-columns: 1fr 1fr 96px 120px;
  gap: 10px;
  align-items: start;
}

.admin-question-form {
  grid-template-columns: minmax(140px, 180px) minmax(220px, 1fr) 96px auto auto;
  margin-top: 10px;
}

.admin-pillar-form textarea,
.admin-question-form textarea {
  min-height: 74px;
}

.admin-pillar-form textarea {
  grid-column: span 2;
}

.pillar-edit-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding-bottom: 16px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.pillar-edit-form h3,
.pillar-edit-form textarea {
  grid-column: 1 / -1;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  max-width: min(420px, calc(100vw - 40px));
  padding: 14px 16px;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  box-shadow: var(--shadow);
}

@media (max-width: 860px) {
  .intro-panel,
  .admin-toolbar,
  .report-toolbar,
  .assessment-status,
  .question-row,
  .report-layout,
  .score-hero {
    grid-template-columns: 1fr;
  }

  .topbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    padding: 12px 14px;
  }

  .brand {
    justify-content: start;
    grid-template-columns: auto minmax(0, 1fr);
    min-width: 0;
    max-width: 100%;
    padding-inline: 10px;
    text-align: left;
    overflow: hidden;
  }

  .brand span,
  .brand small {
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .brand span {
    font-size: 16px;
    line-height: 1.1;
  }

  .brand small {
    display: none;
  }

  .brand-logo {
    width: 34px;
    height: 34px;
  }

  .mobile-menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 38px;
    padding: 0 12px;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--ink);
  }

  .mobile-menu-panel {
    grid-column: 1 / -1;
    display: none;
    min-width: 0;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    box-shadow: var(--shadow);
    animation: menu-in 180ms ease both;
  }

  body.mobile-menu-open .mobile-menu-panel {
    display: grid;
    gap: 10px;
  }

  .tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
    min-width: 0;
    gap: 8px;
    padding: 0;
    border: 0;
    background: transparent;
  }

  .tab {
    justify-content: flex-start;
    width: 100%;
    min-width: 0;
    min-height: 44px;
    border: 1px solid var(--line);
    background: #f8faf8;
    color: var(--ink);
    padding: 0 12px;
    text-align: left;
  }

  .tab.active {
    border-color: var(--green);
    background: #eaf4ef;
    color: var(--green);
  }

  .account-mini {
    justify-content: space-between;
    min-width: 0;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f8faf8;
  }

  #account-label {
    min-width: 0;
    overflow-wrap: anywhere;
  }

  .assessment-form,
  .admin-pillar-form,
  .admin-question-form,
  .pillar-edit-form {
    grid-template-columns: 1fr;
  }

  .assessment-form button,
  .admin-pillar-form textarea,
  .admin-question-form textarea,
  .pillar-edit-form h3,
  .pillar-edit-form textarea {
    grid-column: auto;
  }

  .assessment-status {
    position: static;
  }
}

.button-link {
  display: inline-grid;
  place-items: center;
  min-height: 42px;
  border-radius: 6px;
  background: var(--green);
  color: #fff;
  padding: 0 16px;
  font-weight: 800;
  text-decoration: none;
}

.button-link.secondary {
  background: #eef4f0;
  color: var(--ink);
}

.check-line {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 13px;
  line-height: 1.45;
}

.check-line input {
  width: auto;
  min-height: auto;
  margin-top: 3px;
}

.legal-page {
  width: min(980px, calc(100% - 24px));
  margin: 32px auto;
}

.legal-content {
  line-height: 1.7;
  overflow-wrap: anywhere;
}

.certificate-public {
  text-align: center;
}

.brand {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  justify-items: start;
  align-items: center;
  column-gap: 10px;
  min-height: 42px;
  background: transparent;
  color: var(--ink);
  padding: 0;
}

.brand span {
  font-size: 24px;
  font-weight: 900;
}

.brand small {
  display: none;
}

.brand-logo {
  width: 42px;
  height: 42px;
  border-radius: 6px;
  object-fit: contain;
  background: #fff;
  border: 1px solid var(--line);
}

.account-mini {
  display: flex;
  align-items: center;
  gap: 10px;
}

.account-avatar,
.account-avatar-img {
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  border-radius: 999px;
}

.account-avatar {
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--green);
  font-size: 14px;
  font-weight: 900;
}

.account-avatar .nav-icon {
  width: 19px;
  height: 19px;
}

.account-avatar-img {
  object-fit: cover;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px var(--line);
}

.hero {
  display: grid;
  grid-template-columns: minmax(320px, 1.1fr) minmax(320px, 0.9fr);
  gap: 32px;
  align-items: center;
  min-height: 520px;
  padding: clamp(28px, 5vw, 64px) 0;
}

.hero h1 {
  max-width: 820px;
  font-size: clamp(42px, 8vw, 88px);
}

.hero-subtitle {
  margin: -4px 0 14px;
  font-size: 24px;
  font-weight: 700;
  color: var(--green);
}

.hero p {
  max-width: 720px;
  font-size: 18px;
}

.hero-actions,
.account-mini,
.section-head,
.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.button-row {
  justify-content: flex-end;
}

.section-head {
  justify-content: space-between;
}

.metric-board,
.plan-list,
.home-grid,
.admin-grid,
.stack-form,
.table-list {
  display: grid;
  gap: 16px;
}

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

.metric-board div,
.plan-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 18px;
  box-shadow: var(--shadow);
}

.metric-board div {
  min-height: 150px;
}

.metric-board strong {
  display: block;
  font-size: 48px;
  line-height: 1;
}

.metric-board span {
  color: var(--muted);
  font-weight: 700;
}

.testimonial-section {
  margin: 8px 0 24px;
}

.testimonial-list {
  overflow: hidden;
}

.testimonial-carousel {
  display: grid;
  gap: 14px;
  overflow: hidden;
  outline: none;
}

.testimonial-track {
  display: flex;
  transition: transform 420ms ease;
  will-change: transform;
}

.testimonial-card {
  display: grid;
  grid-template-columns: auto 1fr;
  min-width: 100%;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.testimonial-avatar,
.testimonial-avatar img,
.testimonial-avatar span {
  width: 58px;
  height: 58px;
  border-radius: 999px;
}

.testimonial-avatar img {
  display: block;
  object-fit: cover;
}

.testimonial-avatar span {
  display: inline-grid;
  place-items: center;
  background: #eaf4ef;
  color: var(--green);
  font-size: 22px;
  font-weight: 900;
}

.testimonial-text {
  margin-bottom: 10px;
  color: var(--ink);
  font-weight: 650;
}

.testimonial-card small {
  display: block;
  color: var(--muted);
}

.testimonial-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.testimonial-prev,
.testimonial-next {
  width: 42px;
  min-width: 42px;
  padding: 0;
}

.testimonial-dots {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 7px;
}

.testimonial-dots button {
  width: 10px;
  min-width: 10px;
  height: 10px;
  min-height: 10px;
  padding: 0;
  border-radius: 999px;
  background: #cfd9d3;
}

.testimonial-dots button.active {
  width: 24px;
  background: var(--green);
}

.testimonial-editor,
.admin-collapse {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.testimonial-editor + .testimonial-editor,
.admin-collapse + .admin-collapse {
  margin-top: 10px;
}

.testimonial-editor summary,
.admin-collapse summary {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 14px;
  cursor: pointer;
  list-style: none;
}

.testimonial-editor summary::-webkit-details-marker,
.admin-collapse summary::-webkit-details-marker {
  display: none;
}

.testimonial-editor summary::before,
.admin-collapse summary::before {
  content: "+";
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  flex: 0 0 26px;
  border-radius: 999px;
  background: #eef4f0;
  color: var(--green);
  font-weight: 900;
}

.testimonial-editor[open] summary::before,
.admin-collapse[open] summary::before {
  content: "-";
}

.testimonial-editor summary span:first-child,
.admin-collapse summary span:first-child {
  min-width: 0;
  flex: 1;
}

.testimonial-editor summary strong,
.testimonial-editor summary small,
.admin-collapse summary strong,
.admin-collapse summary small {
  display: block;
  overflow-wrap: anywhere;
}

.testimonial-editor summary small,
.admin-collapse summary small {
  color: var(--muted);
  font-weight: 700;
}

.testimonial-form,
.testimonial-form-fields,
.admin-collapse-body {
  display: grid;
  gap: 10px;
  padding: 0 14px 14px;
}

.home-grid {
  grid-template-columns: minmax(280px, 380px) 1fr;
  align-items: start;
}

body.logged-in .home-grid {
  grid-template-columns: 1fr;
}

.auth-panel details {
  margin-top: 18px;
}

.auth-panel summary {
  cursor: pointer;
  font-weight: 800;
}

.plan-list {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

body.logged-in #home-pricing .plan-list,
.billing-plan-list {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.price {
  font-size: 30px;
  font-weight: 900;
  color: var(--green);
}

.location-picker {
  display: grid;
  gap: 6px;
  margin: 12px 0;
  color: var(--ink);
  font-weight: 800;
}

.location-picker input {
  max-width: 160px;
}

.tier-list {
  display: grid;
  gap: 4px;
  margin: 10px 0;
  color: var(--muted);
}

.tier-list small {
  font-weight: 750;
}

.admin-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  margin-top: 18px;
}

.admin-shell {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 16px;
  margin-top: 18px;
  align-items: start;
}

.admin-tabs {
  position: sticky;
  top: 112px;
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 10px;
  box-shadow: var(--shadow);
}

.admin-tab-btn {
  min-height: 38px;
  background: transparent;
  color: var(--ink);
  text-align: left;
  justify-content: start;
}

.admin-tab-btn.active {
  background: var(--ink);
  color: #fff;
}

.admin-tab-btn:hover:not(.active) {
  background: #eef4f0;
  color: var(--green);
}

.admin-panel {
  display: none;
}

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

.admin-panels {
  min-width: 0;
}

.scroll-panel {
  max-height: min(620px, calc(100vh - 220px));
  overflow: auto;
  padding-right: 6px;
}

.scroll-panel.tall {
  max-height: calc(100vh - 180px);
}

.filter-form {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.checkbox-grid {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
  max-height: 220px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
}

.checkbox-grid label {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 13px;
}

.checkbox-grid input {
  width: auto;
  min-height: auto;
}

.activity-item {
  border-bottom: 1px solid var(--line);
  padding: 12px 0;
}

.activity-item code {
  display: inline-block;
  margin-bottom: 6px;
}

.master-detail {
  display: grid;
  grid-template-columns: minmax(240px, 320px) 1fr;
  gap: 16px;
  min-height: 520px;
}

.record-list {
  display: grid;
  align-content: start;
  gap: 8px;
  max-height: min(680px, calc(100vh - 240px));
  overflow: auto;
  border-right: 1px solid var(--line);
  padding-right: 10px;
}

.record-search {
  margin-bottom: 4px;
}

#consultant-search,
.assignment-consultant-search {
  min-height: 42px;
}

.assignment-form > div:last-child {
  display: grid;
  grid-template-columns: minmax(180px, 240px) minmax(220px, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.muted-empty {
  padding: 12px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: #fff;
}

.record-list-item {
  display: grid;
  gap: 4px;
  min-height: 100px;
  height: auto;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  text-align: left;
  white-space: normal;
  overflow: visible;
  align-content: start;
}

.record-list-item strong,
.record-list-item span,
.record-list-item small {
  display: block;
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: normal;
  line-height: 1.3;
}

.record-list-item span,
.record-list-item small {
  color: var(--muted);
}

.record-list-item.active {
  border-color: var(--green);
  background: #edf7f1;
}

.site-footer {
  width: min(1380px, 100%);
  margin: 0 auto;
  padding: 18px clamp(16px, 4vw, 48px) 32px;
  border-top: 1px solid var(--line);
}

.site-footer p {
  margin: 0;
  font-size: 14px;
  font-weight: 800;
  text-align: center;
}

.detail-panel {
  min-width: 0;
  max-height: min(680px, calc(100vh - 240px));
  overflow: auto;
  padding-right: 6px;
}

.wide {
  grid-column: 1 / -1;
}

.table-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding: 10px 0;
}

.billing-layout {
  display: grid;
  grid-template-columns: minmax(320px, 0.9fr) minmax(360px, 1.1fr);
  gap: 20px;
  margin-top: 20px;
}

.billing-plans-panel {
  grid-column: 1 / -1;
}

.empty-state {
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 16px;
  background: #fbfbf7;
}

.profile-layout {
  display: grid;
  grid-template-columns: minmax(340px, 1fr) minmax(300px, 420px);
  gap: 20px;
  margin-top: 20px;
}

.profile-preview {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px;
  align-items: center;
  margin-bottom: 18px;
}

.profile-avatar,
.profile-avatar-fallback {
  width: 88px;
  height: 88px;
  border-radius: 8px;
}

.profile-avatar {
  object-fit: cover;
  border: 1px solid var(--line);
}

.profile-avatar-fallback {
  display: grid;
  place-items: center;
  background: #e7f3ed;
  color: var(--green);
  font-size: 28px;
  font-weight: 900;
}

.billing-grid {
  display: grid;
  gap: 12px;
}

.billing-card {
  display: grid;
  gap: 10px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.billing-card h4 {
  margin: 0;
  overflow-wrap: anywhere;
}

.billing-card dl {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}

.billing-card dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.billing-card dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.status-pill {
  display: inline-grid;
  place-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: #eef4f0;
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.status-pill.success {
  background: #e2f4ea;
  color: var(--green);
}

.status-pill.failed {
  background: #f8e7e7;
  color: var(--red);
}

.compact-action {
  min-height: 32px;
  margin-top: 6px;
  padding: 0 10px;
  font-size: 12px;
}

.compact-form {
  margin-top: 12px;
}

.gateway-form,
.currency-rate-form,
.user-form,
.plan-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  border-bottom: 1px solid var(--line);
  padding: 12px 0;
}

.gateway-form button,
.currency-rate-form button,
.user-form button,
.plan-form button {
  grid-column: span 2;
}

.admin-collapse .gateway-form,
.admin-collapse .currency-rate-form,
.admin-collapse .plan-form,
.admin-collapse .position-form,
.admin-collapse .assignment-form {
  border-bottom: 0;
  padding: 0 14px 14px;
}

.admin-collapse .assignment-form {
  display: grid;
  gap: 8px;
}

.payment-return {
  display: grid;
  place-items: center;
  min-height: 100vh;
}

@media (max-width: 860px) {
  .hero,
  .home-grid,
  .admin-grid,
  .admin-shell,
  .billing-layout,
  .profile-layout,
  .gateway-form,
  .currency-rate-form,
  .user-form,
  .plan-form {
    grid-template-columns: 1fr;
  }

  .metric-board {
    grid-template-columns: 1fr;
  }

  .billing-card dl {
    grid-template-columns: 1fr;
  }

  .badge-card {
    grid-template-columns: 1fr;
  }

  .admin-tabs {
    position: static;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .assignment-form > div:last-child {
    grid-template-columns: 1fr;
  }

  .master-detail {
    grid-template-columns: 1fr;
  }

  .record-list {
    max-height: 320px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding-right: 0;
    padding-bottom: 10px;
  }

  .gateway-form button,
  .currency-rate-form button,
  .user-form button,
  .plan-form button {
    grid-column: auto;
  }
}
