:root {
  color-scheme: light;
  --ink: #111827;
  --muted: #5b6472;
  --line: #d8dee8;
  --panel: #ffffff;
  --page: #f5f7fb;
  --accent: #2563eb;
  --accent-dark: #1d4ed8;
  --ok: #047857;
  --warn: #b45309;
  --danger: #b91c1c;
  --locked: #475569;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.5;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.topbar {
  align-items: center;
  background: #ffffff;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 24px;
  justify-content: space-between;
  min-height: 64px;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand {
  color: var(--ink);
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0;
  white-space: nowrap;
}

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

.nav a,
.link-button {
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.inline-form {
  display: inline;
  margin: 0;
}

.link-button {
  background: transparent;
  border: 0;
  cursor: pointer;
  padding: 0;
}

.page {
  margin: 0 auto;
  max-width: 1280px;
  padding: 28px;
}

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

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

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

h1 {
  font-size: 34px;
  line-height: 1.15;
  margin-bottom: 0;
}

h2 {
  font-size: 20px;
  line-height: 1.2;
}

h3 {
  font-size: 17px;
  line-height: 1.25;
  margin-bottom: 6px;
}

.lede {
  color: var(--muted);
  max-width: 560px;
}

.auth-layout {
  align-items: center;
  display: grid;
  gap: 40px;
  grid-template-columns: 1fr minmax(280px, 390px);
  min-height: calc(100vh - 140px);
}

.panel,
.section-band {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px;
}

.auth-panel {
  box-shadow: 0 16px 40px rgba(17, 24, 39, 0.08);
}

.content-grid {
  align-items: start;
  display: grid;
  gap: 22px;
  grid-template-columns: minmax(0, 1fr) 330px;
}

.access-control-layout {
  align-items: start;
  display: grid;
  gap: 22px;
  grid-template-columns: 300px minmax(0, 1fr);
}

.access-matrix-panel {
  min-width: 0;
}

.main-column,
.side-column {
  display: grid;
  gap: 22px;
  min-width: 0;
}

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

.metric {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
}

.metric span {
  color: var(--muted);
  display: block;
  font-size: 13px;
  font-weight: 700;
}

.metric strong {
  display: block;
  font-size: 30px;
  margin-top: 4px;
}

.my-apps-hero {
  align-items: end;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  gap: 18px;
  justify-content: space-between;
  margin-bottom: 22px;
  padding: 24px;
}

.my-apps-hero h1 {
  font-size: 48px;
}

.business-starters-hero {
  background:
    linear-gradient(180deg, color-mix(in srgb, #167346 11%, #ffffff), #ffffff 58%);
}

.my-apps-summary {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 22px;
}

.my-apps-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  margin-bottom: 22px;
}

.dashboard-app-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.dashboard-app-grid .my-app-tile {
  min-width: 0;
}

.my-apps-tools-section {
  margin-bottom: 30px;
}

.my-apps-tools-heading {
  align-items: end;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  margin-bottom: 14px;
}

.my-apps-tools-heading h2 {
  margin-bottom: 4px;
}

.my-apps-tools-heading p {
  color: var(--muted);
  margin: 0;
}

.explore-periodic-grid {
  align-items: stretch;
}

.my-app-tile {
  aspect-ratio: 1 / 1;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--tile-color, var(--accent)) 14%, #ffffff), #ffffff 48%);
  border: 1px solid color-mix(in srgb, var(--tile-color, var(--accent)) 34%, var(--line));
  border-radius: 8px;
  color: var(--ink);
  display: flex;
  flex-direction: column;
  gap: 16px;
  justify-content: space-between;
  min-height: 255px;
  overflow: hidden;
  padding: 16px;
  position: relative;
}

.my-app-tile::before {
  background: var(--tile-color, var(--accent));
  content: "";
  height: 5px;
  left: 0;
  position: absolute;
  right: 0;
  top: 0;
}

.my-app-tile:hover {
  box-shadow: 0 16px 34px rgba(17, 24, 39, 0.12);
  text-decoration: none;
  transform: translateY(-2px);
}

.my-app-tile.locked {
  filter: grayscale(0.55);
  opacity: 0.58;
}

.my-app-tile.locked:hover {
  opacity: 0.82;
}

.my-app-tile.unavailable {
  cursor: default;
}

.my-app-tile.unavailable:hover {
  box-shadow: none;
  opacity: 0.58;
  transform: none;
}

.my-app-tile[href$="/business-starters/"] .tile-icon {
  font-size: 24px;
}

.business-starters-periodic-grid {
  align-items: stretch;
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.business-starters-periodic-tile {
  gap: 10px;
  min-height: 245px;
  min-width: 0;
  overflow: hidden;
  padding: 14px;
}

.periodic-logo-row {
  align-items: center;
  display: flex;
  gap: 8px;
  min-width: 0;
}

.periodic-symbol {
  align-items: center;
  background: var(--tile-color, var(--accent));
  border-radius: 8px;
  color: #ffffff;
  display: inline-flex;
  flex: 0 0 auto;
  font-size: 34px;
  font-weight: 900;
  height: 64px;
  justify-content: center;
  letter-spacing: 0;
  line-height: 1;
  text-transform: uppercase;
  width: 64px;
}

.subscription-only-badge {
  background: #111827;
  border-radius: 999px;
  color: #ffffff;
  display: inline-flex;
  flex: 0 1 auto;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1.1;
  max-width: 112px;
  padding: 5px 8px;
  text-transform: uppercase;
}

.business-starters-periodic-tile .tile-copy {
  gap: 6px;
}

.business-starters-periodic-tile .tile-copy strong {
  font-size: 15px;
  line-height: 1.22;
  min-height: 2.44em;
}

.business-starters-periodic-tile .tile-copy span {
  -webkit-line-clamp: 3;
}

.business-starters-periodic-tile .tile-footer {
  min-width: 0;
}

.business-starters-periodic-tile .tile-footer span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tile-status {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: #334155;
  font-size: 12px;
  font-weight: 800;
  padding: 4px 9px;
}

.tile-icon {
  align-items: center;
  background: var(--tile-color, var(--accent));
  border-radius: 8px;
  color: #ffffff;
  display: inline-flex;
  flex: 0 0 auto;
  font-size: 28px;
  font-weight: 800;
  height: 54px;
  justify-content: center;
  width: 54px;
}

.tile-icon-image-wrap {
  background: #ffffff;
  border: 1px solid color-mix(in srgb, var(--tile-color, var(--accent)) 32%, #ffffff);
  box-shadow: 0 8px 18px rgba(17, 24, 39, 0.08);
  height: 58px;
  padding: 4px 7px;
  width: 128px;
}

.tile-icon-image {
  display: block;
  height: 100%;
  object-fit: contain;
  width: 100%;
}

.tile-icon-schedule-door {
  color: transparent;
  position: relative;
}

.tile-icon-schedule-door::before {
  background:
    linear-gradient(var(--tile-color), var(--tile-color)) 8px 12px / 4px 4px no-repeat,
    linear-gradient(var(--tile-color), var(--tile-color)) 16px 12px / 4px 4px no-repeat,
    linear-gradient(var(--tile-color), var(--tile-color)) 24px 12px / 4px 4px no-repeat,
    linear-gradient(var(--tile-color), var(--tile-color)) 8px 21px / 4px 4px no-repeat,
    linear-gradient(var(--tile-color), var(--tile-color)) 16px 21px / 4px 4px no-repeat,
    linear-gradient(var(--tile-color), var(--tile-color)) 24px 21px / 4px 4px no-repeat,
    #ffffff;
  border: 2px solid var(--tile-color);
  border-radius: 7px;
  box-shadow: inset 0 9px 0 color-mix(in srgb, var(--tile-color) 22%, #ffffff);
  content: "";
  height: 32px;
  width: 34px;
}

.tile-icon-schedule-door::after {
  background: var(--tile-color);
  border-radius: 999px;
  box-shadow: 16px 0 0 var(--tile-color);
  content: "";
  height: 8px;
  left: 13px;
  position: absolute;
  top: 7px;
  width: 4px;
}

.tile-icon.large {
  font-size: 40px;
  height: 84px;
  width: 84px;
}

.tile-copy {
  display: grid;
  gap: 8px;
  grid-template-rows: auto auto minmax(0, 1fr);
  min-height: 0;
}

.tile-copy strong {
  color: var(--ink);
  display: -webkit-box;
  font-size: 18px;
  line-height: 1.28;
  min-height: 2.56em;
  overflow: hidden;
  padding-bottom: 2px;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.tile-copy small,
.tile-copy span,
.tile-footer {
  color: var(--muted);
  font-size: 12px;
}

.tile-copy span {
  display: -webkit-box;
  line-height: 1.35;
  overflow: hidden;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.tile-footer {
  align-items: center;
  display: flex;
  gap: 8px;
  justify-content: space-between;
}

.business-starters-app-card.locked-app-card {
  opacity: 0.76;
}

.app-info-layout {
  align-items: start;
  display: grid;
  gap: 22px;
  grid-template-columns: minmax(0, 1fr) 360px;
}

.subscription-card {
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--tile-color, var(--accent)) 12%, #ffffff), #ffffff 40%);
  border: 1px solid color-mix(in srgb, var(--tile-color, var(--accent)) 34%, var(--line));
  border-radius: 8px;
  display: grid;
  gap: 18px;
  padding: 24px;
}

.section-title {
  align-items: center;
  display: flex;
  gap: 14px;
  justify-content: space-between;
  margin-bottom: 16px;
}

.count-pill,
.status {
  align-items: center;
  background: #eef2f7;
  border-radius: 999px;
  color: #334155;
  display: inline-flex;
  font-size: 12px;
  font-weight: 800;
  min-height: 24px;
  padding: 3px 9px;
  white-space: nowrap;
}

.status.active,
.status.trial {
  background: #dcfce7;
  color: var(--ok);
}

.status.locked,
.status.revoked,
.status.suspended {
  background: #e2e8f0;
  color: var(--locked);
}

.status.coming_soon,
.status.warning,
.status.expired {
  background: #fef3c7;
  color: var(--warn);
}

.status.disabled,
.status.denied,
.status.danger {
  background: #fee2e2;
  color: var(--danger);
}

.status-list {
  display: grid;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.status-list li {
  display: grid;
  gap: 4px;
}

.status-list small {
  color: var(--muted);
  display: block;
  overflow-wrap: anywhere;
}

.preview-banner {
  border-color: #93c5fd;
  margin-bottom: 22px;
}

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

.app-card {
  align-items: center;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 16px;
  grid-template-columns: 10px minmax(0, 1fr) auto;
  min-height: 110px;
  padding: 16px;
}

.app-swatch {
  border-radius: 999px;
  height: 64px;
  width: 10px;
}

.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.usage-meter {
  background: #e2e8f0;
  border-radius: 999px;
  height: 10px;
  overflow: hidden;
  width: 100%;
}

.usage-meter span {
  background: var(--accent);
  display: block;
  height: 100%;
}

.primary-button,
.secondary-button,
.danger-button {
  align-items: center;
  border-radius: 6px;
  border: 1px solid transparent;
  cursor: pointer;
  display: inline-flex;
  font-size: 14px;
  font-weight: 800;
  justify-content: center;
  min-height: 38px;
  padding: 8px 12px;
  white-space: nowrap;
}

.primary-button {
  background: var(--accent);
  color: #ffffff;
}

.primary-button:hover {
  background: var(--accent-dark);
  color: #ffffff;
  text-decoration: none;
}

.secondary-button {
  background: #ffffff;
  border-color: var(--line);
  color: var(--ink);
}

.secondary-button:hover {
  border-color: var(--accent);
  text-decoration: none;
}

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

.danger-panel {
  border-color: #fecdd3;
}

.danger-copy {
  color: var(--danger);
  font-weight: 700;
}

.small-note {
  color: var(--muted);
  font-size: 13px;
}

.warning-list {
  color: var(--muted);
  font-size: 13px;
  margin: 0 0 14px;
  padding-left: 18px;
}

.table-wrap {
  max-width: 100%;
  overflow-x: auto;
}

table {
  border-collapse: collapse;
  min-width: 720px;
  width: 100%;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 12px 10px;
  text-align: left;
  vertical-align: middle;
}

th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

td span {
  color: var(--muted);
  display: block;
  font-size: 13px;
}

.actions-cell {
  text-align: right;
}

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

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

.subscriber-table {
  min-width: 900px;
}

.subscriber-table th,
.subscriber-table td {
  white-space: nowrap;
}

.subscriber-table td:nth-child(2) {
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.subscriber-actions-header,
.subscriber-actions {
  background: var(--panel);
  box-shadow: -12px 0 18px rgba(245, 247, 251, 0.92);
  min-width: 300px;
  position: sticky;
  right: 0;
  z-index: 2;
}

.subscriber-actions-header {
  z-index: 3;
}

.detail-list {
  display: grid;
  gap: 10px;
  margin: 0 0 16px;
}

.detail-list div {
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 12px;
  grid-template-columns: 130px 1fr;
  padding-bottom: 10px;
}

.detail-list.wide div {
  grid-template-columns: 220px 1fr;
}

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

dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.compact-list {
  display: grid;
  gap: 10px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.compact-list li {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 10px;
  justify-content: space-between;
  padding-bottom: 10px;
}

.compact-list small {
  color: var(--muted);
}

.subscriber-picker {
  position: sticky;
  top: 86px;
}

.subscriber-choice-list {
  display: grid;
  gap: 8px;
  max-height: calc(100vh - 180px);
  overflow-y: auto;
  padding-right: 4px;
}

.subscriber-choice {
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  display: grid;
  gap: 2px;
  padding: 10px 12px;
}

.subscriber-choice:hover,
.subscriber-choice.selected {
  background: #eff6ff;
  border-color: #93c5fd;
  text-decoration: none;
}

.subscriber-choice span,
.app-access-copy small {
  color: var(--muted);
  font-size: 12px;
}

.access-matrix-form,
.access-matrix {
  display: grid;
  gap: 18px;
}

.access-category {
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.access-category:first-child {
  border-top: 0;
  padding-top: 0;
}

.access-checkbox-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.access-checkbox-card {
  align-items: flex-start;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  cursor: pointer;
  display: grid;
  gap: 10px;
  grid-template-columns: 18px minmax(0, 1fr);
  margin: 0;
  min-height: 72px;
  padding: 12px;
}

.access-checkbox-card:has(input:checked) {
  background: #f0fdf4;
  border-color: #86efac;
}

.app-access-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.access-level-select {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  font: inherit;
  grid-column: 1 / -1;
  min-height: 38px;
  padding: 8px 10px;
  width: 100%;
}

.publish-authority-note {
  margin-bottom: 18px;
}

.compact-guidance {
  display: grid;
  gap: 10px;
}

.sticky-save-bar {
  align-items: center;
  background: rgba(255, 255, 255, 0.96);
  border-top: 1px solid var(--line);
  bottom: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
  padding-top: 14px;
  position: sticky;
}

.empty-panel {
  min-height: 220px;
}

.stacked-form,
.search-form,
.inline-actions {
  display: grid;
  gap: 10px;
}

.search-form,
.inline-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
}

label {
  color: var(--muted);
  display: block;
  font-size: 13px;
  font-weight: 800;
  margin-bottom: 5px;
}

input,
select,
textarea {
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  font: inherit;
  min-height: 38px;
  padding: 8px 10px;
  width: 100%;
}

input[type="checkbox"] {
  min-height: auto;
  width: auto;
}

.stacked-form p {
  margin: 0;
}

.helptext {
  color: var(--muted);
  display: block;
  font-size: 12px;
  margin-top: 4px;
}

.messages {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
}

.message {
  background: #e0f2fe;
  border: 1px solid #bae6fd;
  border-radius: 8px;
  color: #075985;
  padding: 10px 12px;
}

.message.error {
  background: #fee2e2;
  border-color: #fecaca;
  color: var(--danger);
}

.message.success {
  background: #dcfce7;
  border-color: #bbf7d0;
  color: var(--ok);
}

.form-error {
  color: var(--danger);
  font-weight: 700;
}

.empty-state {
  color: var(--muted);
  margin: 0;
}

.prose {
  max-width: 820px;
}

.pagination {
  align-items: center;
  display: flex;
  gap: 14px;
  margin-top: 16px;
}

code {
  background: #f1f5f9;
  border-radius: 4px;
  padding: 2px 4px;
}

@media (max-width: 1120px) {
  .business-starters-periodic-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .dashboard-app-grid .my-app-tile {
    gap: 8px;
    min-height: 0;
    padding: 12px;
  }
}

@media (max-width: 1023px) {
  .dashboard-app-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

}

@media (max-width: 900px) {
  .topbar,
  .page-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .auth-layout,
  .app-info-layout,
  .content-grid,
  .access-control-layout,
  .metric-grid,
  .my-apps-summary {
    grid-template-columns: 1fr;
  }

  .access-control-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .my-apps-hero {
    align-items: flex-start;
    flex-direction: column;
  }

  .my-apps-hero h1 {
    font-size: 34px;
  }

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

  .subscriber-picker {
    position: static;
  }

  .subscriber-choice-list {
    max-height: 320px;
  }

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

  .app-card > .secondary-button,
  .app-card > .actions-cell {
    grid-column: 2;
    justify-self: start;
  }

  .page {
    padding: 20px;
  }

  h1 {
    font-size: 28px;
  }
}

@media (max-width: 1100px) {
  .subscriber-admin-layout {
    grid-template-columns: 1fr;
  }

  .subscriber-table {
    min-width: 760px;
  }

  .subscriber-actions-header,
  .subscriber-actions {
    min-width: 230px;
  }
}

@media (max-width: 700px) {
  .section-title {
    align-items: flex-start;
    flex-direction: column;
  }

  .search-form {
    width: 100%;
  }

  .search-form input {
    flex: 1 1 220px;
  }

  .sticky-save-bar {
    position: static;
  }

  .company-member-table {
    min-width: 0;
  }

  .company-member-table thead {
    display: none;
  }

  .company-member-table,
  .company-member-table tbody,
  .company-member-table tr,
  .company-member-table td {
    display: block;
    width: 100%;
  }

  .company-member-table tr {
    border-bottom: 1px solid var(--line);
    padding: 12px 0;
  }

  .company-member-table td {
    border: 0;
    padding: 6px 0;
  }

  .company-member-table td::before {
    color: var(--muted);
    content: attr(data-label);
    display: block;
    font-size: 11px;
    font-weight: 800;
    margin-bottom: 2px;
    text-transform: uppercase;
  }
}

@media (max-width: 560px) {
  .dashboard-app-grid {
    grid-template-columns: 1fr;
  }

  .business-starters-periodic-grid {
    grid-template-columns: 1fr;
  }
}
.company-verification-shell {
  width: min(100%, 620px);
  margin: 40px auto;
}

.company-verification-panel {
  display: grid;
  gap: 18px;
}

.company-verification-panel h1,
.company-verification-panel .lede {
  margin: 0;
}

.verification-code-input {
  width: 100%;
  min-height: 56px;
  font-size: 1.5rem;
  letter-spacing: 0;
  text-align: center;
}

.company-verification-resend {
  padding-top: 4px;
}

.password-visibility-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  font-size: 0.9rem;
}

.password-visibility-toggle input {
  width: 18px;
  height: 18px;
}
