:root {
  color-scheme: light;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #182230;
  background: #f4f7fb;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
}

button,
a {
  font: inherit;
}

button {
  border: 1px solid #b8c4d4;
  background: #fff;
  color: #142033;
  border-radius: 6px;
  padding: 8px 12px;
  cursor: pointer;
}

main button,
.nav-tile,
.bottom-links a,
.bottom-links button,
.modal-actions button {
  border-color: #93a4b8;
  background: linear-gradient(#ffffff, #f3f6fb);
  color: #142033;
  font-weight: 760;
  box-shadow: 0 1px 2px rgba(18, 32, 51, 0.08);
  transition: border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

main button:hover,
.nav-tile:hover,
.bottom-links a:hover,
.bottom-links button:hover,
.modal-actions button:hover {
  border-color: #2563eb;
  background: #eff6ff;
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.12);
}

main button:active,
.nav-tile:active,
.bottom-links a:active,
.bottom-links button:active,
.modal-actions button:active {
  transform: translateY(1px);
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.16);
}

button:hover,
.quick-links a:hover,
.quick-links button:hover,
.bottom-links a:hover,
.bottom-links button:hover {
  background: #edf2f7;
}

.quick-links,
.bottom-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.quick-links a,
.quick-links button,
.bottom-links a,
.bottom-links button {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  border: 1px solid #b7c2d0;
  border-radius: 6px;
  padding: 8px 12px;
  background: #fff;
  color: #172b4d;
  text-decoration: none;
}

.quick-links .primary-link,
.bottom-links .primary-link {
  border-color: #2563eb;
  color: #1d4ed8;
}

.setup-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 14px;
  background: rgba(18, 32, 51, 0.58);
  backdrop-filter: blur(3px);
}

.setup-modal.hidden {
  display: none;
}

.setup-dialog {
  width: min(720px, 100%);
  max-height: calc(100vh - 28px);
  overflow: auto;
  padding: 20px;
  background: #fff;
  border: 1px solid #d9e2ec;
  border-radius: 8px;
  box-shadow: 0 22px 52px rgba(18, 32, 51, 0.24);
}

.setup-dialog-head {
  margin-bottom: 14px;
}

.beta-notice-dialog {
  width: min(600px, 100%);
}

.beta-notice-body {
  display: grid;
  gap: 10px;
  color: #334155;
  line-height: 1.65;
}

.beta-notice-body p {
  margin: 0;
}

.setup-progress {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 0 0 14px;
}

.setup-progress-item {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 7px 9px;
  border: 1px solid #d9e2ec;
  border-radius: 8px;
  background: #f8fafc;
  color: #52606d;
  font-size: 13px;
  font-weight: 700;
}

.setup-progress-item::before {
  content: "";
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  border: 1px solid #bcccdc;
  border-radius: 999px;
  background: #fff;
}

.setup-progress-item.is-done {
  border-color: #86efac;
  background: #f0fdf4;
  color: #166534;
}

.setup-progress-item.is-done::before {
  content: "✓";
  border-color: #16a34a;
  background: #16a34a;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}

.setup-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: setup;
}

.setup-list li {
  position: relative;
  min-height: 112px;
  padding: 38px 12px 12px;
  border: 1px solid #d9e2ec;
  border-radius: 8px;
  background: #f8fafc;
  counter-increment: setup;
}

.setup-list li::before {
  content: counter(setup);
  position: absolute;
  top: 10px;
  left: 12px;
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: #2563eb;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
}

.setup-list strong,
.setup-list span {
  display: block;
}

.setup-list span {
  margin-top: 8px;
  color: #52606d;
  line-height: 1.55;
}

.setup-note {
  margin: 14px 0 0;
  padding: 10px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #f8fafc;
  color: #334155;
  line-height: 1.6;
}

.skip-setup {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  color: #334155;
}

.skip-setup input {
  width: 18px;
  height: 18px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 16px;
}

.primary-action {
  border-color: #2563eb;
  background: #2563eb;
  color: #fff;
  box-shadow: 0 2px 4px rgba(37, 99, 235, 0.22);
}

.primary-action:hover {
  background: #1d4ed8;
}

.topbar {
  position: relative;
  min-height: 72px;
  padding: 16px 20px;
  background: linear-gradient(120deg, #111b2c 0%, #17253a 58%, #15352f 100%);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  box-shadow: 0 10px 28px rgba(18, 32, 51, 0.16);
}

.home-top-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex: 0 0 auto;
  max-width: 100%;
  overflow: visible;
  flex-wrap: nowrap;
  gap: 8px;
}

.home-top-actions .app-nav {
  flex: 0 0 auto;
  flex-wrap: nowrap;
}

.home-top-actions .manu-settings {
  flex: 0 0 auto;
}

.topbar > div {
  min-width: 0;
}

.eyebrow {
  margin: 0 0 2px;
  color: #b7c2d0;
  font-size: 13px;
}

.store-name {
  margin: 6px 0 0;
  color: #d9e2ec;
  font-size: 14px;
}

h1,
h2 {
  margin: 0;
}

h1 {
  font-size: 24px;
}

h2 {
  font-size: 18px;
}

.home-main {
  position: relative;
  max-width: 920px;
  margin: 0 auto;
  padding: 28px 18px 22px;
}

.home-main::before,
.home-main::after {
  content: "";
  position: fixed;
  z-index: -1;
  width: 260px;
  height: 420px;
  border-radius: 52% 48% 44% 56%;
  background: rgba(83, 131, 214, 0.12);
  pointer-events: none;
}

.home-main::before {
  left: -120px;
  top: 132px;
  transform: rotate(-22deg);
}

.home-main::after {
  right: -110px;
  top: 170px;
  transform: rotate(18deg);
}

.home-hero {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  margin: 8px auto 24px;
  color: #102a5f;
  text-align: left;
}

.home-mark,
.tile-icon {
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(145deg, #4cc6b8, #159c8c);
  box-shadow: 0 10px 22px rgba(21, 156, 140, 0.22);
}

.home-mark {
  flex: 0 0 auto;
  width: 74px;
  height: 74px;
}

.home-mark svg,
.tile-icon svg {
  width: 62%;
  height: 62%;
  fill: none;
  stroke: currentColor;
  stroke-width: 3.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.home-hero h2 {
  margin: 0;
  color: #0f2a63;
  font-size: 44px;
  line-height: 1.05;
  letter-spacing: 0;
  font-weight: 900;
}

.home-hero p {
  margin: 8px 0 0;
  color: #284a86;
  font-size: 18px;
  font-weight: 760;
  letter-spacing: 0;
}

.home-stage {
  position: relative;
  max-width: 860px;
  margin: 0 auto;
  padding: 24px;
  border: 12px solid #183160;
  border-radius: 30px;
  background: linear-gradient(#ffffff, #f8fbff);
  box-shadow: 0 24px 48px rgba(15, 42, 99, 0.2);
}

.home-stage::before {
  content: "";
  position: absolute;
  top: -8px;
  left: 50%;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  transform: translateX(-50%);
}

.home-frame {
  padding: 16px;
  border-radius: 16px;
  background: #fff;
  box-shadow: inset 0 0 0 1px rgba(215, 222, 233, 0.82);
}

.home-dashboard {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.9fr);
  gap: 14px;
  margin-bottom: 16px;
}

.next-step-panel,
.ordering-panel {
  min-width: 0;
  border: 1px solid #d9e2ec;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(18, 32, 51, 0.08);
}

.next-step-panel {
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 20px;
  border-left: 5px solid #2f6fed;
}

.next-step-panel h2,
.ordering-panel h2 {
  font-size: 22px;
}

.next-step-panel p {
  max-width: 680px;
  margin: 0;
  color: #52606d;
  line-height: 1.65;
}

.next-step-action {
  justify-self: start;
  min-height: 42px;
  border-color: #2f6fed;
  background: #2f6fed;
  color: #fff;
  box-shadow: 0 10px 20px rgba(47, 111, 237, 0.18);
}

.next-step-action:hover {
  background: #245ed0;
}

.ordering-panel {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.ordering-help {
  margin: 8px 0 0;
  color: #52606d;
  line-height: 1.45;
}

.launch-check-panel {
  margin-bottom: 16px;
  padding: 0;
  background: #fff;
  border: 1px solid #d9e2ec;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 8px 20px rgba(18, 32, 51, 0.06);
}

.launch-check-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.launch-check-head::-webkit-details-marker {
  display: none;
}

.launch-check-head strong {
  display: block;
  font-size: 16px;
}

.launch-check-toggle {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border: 1px solid #c8d2e2;
  border-radius: 999px;
  background: #f8fafc;
  color: #142033;
}

.launch-check-toggle::before {
  content: "＋";
  font-weight: 900;
  line-height: 1;
}

.launch-check-panel[open] .launch-check-toggle::before {
  content: "－";
}

.launch-check-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  width: fit-content;
  margin: 0 14px 12px;
  border: 1px solid #2563eb;
  border-radius: 6px;
  padding: 8px 12px;
  background: #fff;
  text-decoration: none;
  white-space: nowrap;
  border-color: #2563eb;
  color: #1d4ed8;
  font-weight: 760;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.12);
}

.launch-check-list {
  margin: 0;
  padding: 0 14px 14px;
}

.launch-check-note {
  margin: 0 14px 12px;
  color: #52606d;
  line-height: 1.55;
  font-size: 14px;
}

.bottom-links {
  justify-content: flex-end;
  margin-top: 22px;
  padding-top: 12px;
  border-top: 1px solid #d9e2ec;
}

.order-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  max-width: 100%;
  padding: 12px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #f8fafc;
}

.order-toggle input {
  width: 20px;
  height: 20px;
}

.order-toggle span {
  display: grid;
  gap: 3px;
}

.order-toggle small {
  color: #52606d;
  line-height: 1.4;
}

.home-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(260px, 1fr));
  gap: 18px;
}

.nav-tile {
  position: relative;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 10px;
  min-height: 238px;
  padding: 26px 18px 22px;
  color: #0f2a63;
  text-decoration: none;
  background: #fff;
  border: 1px solid #e3e9f2;
  border-radius: 14px;
  text-align: center;
  box-shadow: 0 8px 20px rgba(18, 32, 51, 0.08);
  overflow: hidden;
}

.nav-tile:focus-visible,
.next-step-action:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.38);
  outline-offset: 2px;
}

.step-badge {
  position: absolute;
  top: 18px;
  left: 18px;
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: #142033;
  color: #fff;
  font-size: 14px;
  font-weight: 900;
}

.nav-tile:hover,
.nav-button:hover {
  border-color: #9fd5d0;
  background: #ffffff;
  box-shadow: 0 16px 32px rgba(21, 156, 140, 0.14);
  transform: translateY(-1px);
}

.primary-tile {
  border-color: #93a4b8;
  background: linear-gradient(#ffffff, #f3f6fb);
}

.nav-button {
  width: 100%;
  cursor: pointer;
}

.nav-button:disabled {
  cursor: wait;
  opacity: 0.7;
}

.tile-title {
  display: block;
  color: #0f2a63;
  font-size: 24px;
  line-height: 1.2;
  font-weight: 900;
  letter-spacing: 0;
}

.tile-meta {
  display: block;
  max-width: 260px;
  color: #244574;
  font-size: 15px;
  line-height: 1.6;
  font-weight: 720;
}

.tile-no {
  position: absolute;
  top: 22px;
  left: 22px;
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  background: #dff5f2;
  color: #159c8c;
  font-size: 18px;
  font-weight: 900;
}

.tile-icon {
  width: 66px;
  height: 66px;
  margin-bottom: 4px;
}

.tile-practice .tile-no,
.tile-orders .tile-no {
  background: #e4edff;
  color: #2f6fed;
}

.tile-practice .tile-icon,
.tile-orders .tile-icon {
  background: linear-gradient(145deg, #73a6ff, #2f6fed);
  box-shadow: 0 10px 22px rgba(47, 111, 237, 0.22);
}

.tile-cta {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 28px;
  margin-top: 2px;
  border-radius: 999px;
  background: linear-gradient(135deg, #43c6b6, #159c8c);
  color: #fff;
  font-size: 26px;
  line-height: 1;
  font-weight: 900;
  box-shadow: 0 8px 18px rgba(21, 156, 140, 0.18);
}

@media (max-width: 920px) {
  .home-dashboard,
  .launch-check-list,
  .setup-progress,
  .setup-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .setup-modal {
    align-items: start;
    place-items: start center;
    padding: max(12px, env(safe-area-inset-top)) 10px max(12px, env(safe-area-inset-bottom));
    overflow: auto;
  }

  .setup-dialog {
    width: 100%;
    max-height: calc(100vh - 24px);
    padding: 14px;
    border-radius: 12px;
    overscroll-behavior: contain;
  }

  @supports (height: 100dvh) {
    .setup-dialog {
      max-height: calc(100dvh - 24px);
    }
  }

  .setup-dialog-head {
    position: sticky;
    top: -14px;
    z-index: 1;
    margin: -14px -14px 10px;
    padding: 14px 14px 10px;
    border-bottom: 1px solid #e6edf5;
    background: #fff;
  }

  .setup-dialog-head .eyebrow {
    font-size: 12px;
  }

  .setup-dialog h2 {
    margin: 0;
    font-size: 20px;
    line-height: 1.25;
  }

  .setup-progress {
    gap: 6px;
    margin-bottom: 10px;
  }

  .setup-progress-item {
    min-height: 30px;
    padding: 5px 8px;
    font-size: 12px;
  }

  .setup-list {
    gap: 8px;
  }

  .setup-list li {
    min-height: 0;
    padding: 34px 10px 10px;
  }

  .setup-list span,
  .setup-note,
  .skip-setup {
    font-size: 13px;
    line-height: 1.5;
  }

  .topbar {
    align-items: center;
    flex-direction: row;
    padding: 10px 8px;
    gap: 8px;
  }

  .home-top-actions {
    width: auto;
    justify-content: flex-end;
  }

  .top-actions .app-nav a,
  .top-actions > button:not(.logout-button) {
    min-height: 28px !important;
    padding: 4px 7px !important;
    font-size: 12px !important;
  }

  .quick-links a,
  .quick-links button,
  .bottom-links a,
  .bottom-links button,
  .order-toggle {
    width: auto;
    justify-content: center;
  }

  .home-main {
    padding: 16px 12px 12px;
  }

  .home-hero {
    gap: 12px;
    margin: 4px auto 16px;
    justify-content: flex-start;
  }

  .home-mark {
    width: 48px;
    height: 48px;
  }

  .home-hero h2 {
    font-size: 28px;
  }

  .home-hero p {
    margin-top: 4px;
    font-size: 13px;
  }

  .home-stage {
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  .home-stage::before {
    display: none;
  }

  .home-frame {
    padding: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  .home-layout {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .nav-tile {
    justify-items: start;
    min-height: 128px;
    padding: 16px 14px 16px 86px;
    text-align: left;
  }

  .tile-no {
    top: 14px;
    left: 14px;
    width: 36px;
    height: 36px;
    font-size: 15px;
  }

  .tile-icon {
    position: absolute;
    top: 58px;
    left: 18px;
    width: 48px;
    height: 48px;
    margin: 0;
  }

  .tile-title {
    font-size: 20px;
  }

  .tile-meta {
    max-width: none;
    font-size: 14px;
  }

  .tile-cta {
    width: 38px;
    height: 26px;
    font-size: 24px;
  }

  .launch-check-head {
    align-items: center;
    padding: 10px;
  }

  .launch-check-link {
    min-height: 30px;
    margin: 0 10px 10px;
    padding: 5px 8px;
    font-size: 13px;
  }

  .launch-check-list {
    padding: 0 10px 10px;
  }

  .launch-check-note {
    margin: 0 10px 10px;
    font-size: 13px;
  }

  .bottom-links {
    justify-content: center;
    margin-top: 18px;
  }

  .modal-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  h1 {
    font-size: 22px;
  }
}
