:root {
  --ink: #18201e;
  --ink-soft: #4e5d58;
  --muted: #72807b;
  --line: #dfe5e2;
  --line-strong: #cbd4d0;
  --surface: #ffffff;
  --surface-soft: #f5f7f6;
  --surface-tint: #edf3f0;
  --accent: #147a5b;
  --accent-strong: #0e6047;
  --accent-soft: #e5f3ed;
  --brand: #f4bd35;
  --info: #2866b1;
  --danger: #b83a35;
  --danger-soft: #fff0ef;
  --warning: #8a6116;
  --warning-soft: #fff6dd;
  --shadow: 0 8px 24px rgba(23, 34, 30, .07);
}

html {
  min-width: 320px;
  background: var(--surface-soft);
}

body {
  min-height: 100vh;
  background: var(--surface-soft);
  color: var(--ink);
  font-family: Inter, "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", system-ui, sans-serif;
  letter-spacing: 0;
}

body,
button,
input,
select,
textarea {
  letter-spacing: 0;
}

a {
  color: var(--accent-strong);
}

a:hover {
  color: var(--accent);
}

button,
.link-button,
.primary {
  min-height: 40px;
  border: 1px solid var(--accent);
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  line-height: 1.2;
  transition: border-color .16s ease, background-color .16s ease, color .16s ease, box-shadow .16s ease;
}

button:hover,
.link-button:hover,
.primary:hover {
  border-color: var(--accent-strong);
  background: var(--accent-strong);
  color: #fff;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(20, 122, 91, .2);
  outline-offset: 2px;
}

button:disabled {
  border-color: #cfd7d4;
  background: #e4e9e7;
  color: #7d8985;
  cursor: not-allowed;
}

input,
select,
textarea {
  min-height: 42px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  padding: 9px 11px;
}

input:hover,
select:hover,
textarea:hover {
  border-color: #98aaa3;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(20, 122, 91, .11);
  outline: none;
}

label {
  color: #33413c;
  font-size: 14px;
  font-weight: 700;
}

label small {
  font-weight: 500;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  margin: 0;
  font-size: 28px;
  line-height: 1.2;
}

h2 {
  margin: 0 0 18px;
  font-size: 19px;
  line-height: 1.3;
}

h3 {
  font-size: 16px;
}

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

/* Shared application shell */
.app-header {
  position: sticky;
  top: 0;
  z-index: 80;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, .97);
  box-shadow: 0 1px 0 rgba(25, 35, 31, .02);
}

.app-header__inner {
  display: flex;
  align-items: center;
  width: min(1440px, 100%);
  min-height: 64px;
  margin: 0 auto;
  padding: 0 28px;
}

.app-brand {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 10px;
  color: var(--ink);
}

.app-brand:hover {
  color: var(--ink);
}

.app-brand__mark {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, 7px);
  align-items: end;
  gap: 3px;
  width: 34px;
  height: 34px;
  padding: 6px;
  border: 1px solid #d39c16;
  border-radius: 6px;
  background: var(--brand);
}

.app-brand__mark i {
  display: block;
  height: 9px;
  background: #1f2825;
}

.app-brand__mark i:nth-child(2) { height: 16px; }
.app-brand__mark i:nth-child(3) { height: 12px; }

.app-brand__copy {
  display: grid;
  gap: 1px;
}

.app-brand__copy strong {
  font-size: 15px;
  line-height: 1;
}

.app-brand__copy small {
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  line-height: 1;
}

.app-nav {
  display: flex;
  flex: 1;
  align-items: center;
  min-width: 0;
  margin-left: 38px;
}

.app-nav nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.app-nav nav a,
.nav-register,
.nav-logout {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--ink-soft);
  padding: 0 11px;
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
}

.app-nav nav a:hover,
.app-nav nav a.is-active,
.nav-logout:hover {
  background: var(--surface-tint);
  color: var(--accent-strong);
}

.app-nav nav a.is-active {
  box-shadow: inset 0 -2px var(--accent);
}

.app-nav__admin {
  margin-left: 24px;
  padding-left: 24px;
  border-left: 1px solid var(--line);
}

.admin-label {
  color: var(--warning);
  padding: 0 5px;
  font-size: 11px;
  font-weight: 800;
}

.app-nav__account {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  margin-left: auto;
  padding-left: 20px;
}

.app-nav__account > span {
  max-width: 150px;
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-nav__account form {
  margin: 0;
}

.nav-logout {
  min-height: 34px;
  cursor: pointer;
}

.nav-register {
  margin-left: auto;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
}

.nav-register:hover {
  background: var(--accent-strong);
  color: #fff;
}

.nav-toggle {
  display: none;
  width: 40px;
  min-height: 40px;
  margin-left: auto;
  border: 1px solid var(--line-strong);
  background: #fff;
  padding: 9px;
}

.nav-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  margin: 3px 0;
  background: var(--ink);
}

.admin-context-bar {
  border-top: 1px solid #e9dfc7;
  background: #fff9e9;
}

.admin-context-bar > div {
  display: flex;
  align-items: center;
  gap: 12px;
  width: min(1440px, 100%);
  min-height: 36px;
  margin: 0 auto;
  padding: 0 28px;
  color: #6f5521;
  font-size: 12px;
}

.admin-context-bar span {
  color: #8b7445;
}

.app-main,
main.app-main {
  width: min(1180px, 100%);
  max-width: none;
  min-height: calc(100vh - 142px);
  margin: 0 auto;
  padding: 34px 28px 52px;
}

.app-main.layout-wide,
main.app-main.layout-wide {
  width: min(1440px, 100%);
  max-width: none;
}

.app-footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  width: min(1440px, calc(100% - 56px));
  margin: 0 auto;
  border-top: 1px solid var(--line);
  color: var(--muted);
  padding: 20px 0 30px;
  font-size: 12px;
}

.flash,
.quote-alert {
  position: relative;
  border: 1px solid #a8d8c7;
  border-left: 4px solid var(--accent);
  border-radius: 6px;
  background: #edf9f4;
  color: #235b48;
  padding: 12px 15px;
}

.flash.danger,
.quote-alert.danger {
  border-color: #efbbb8;
  border-left-color: var(--danger);
  background: var(--danger-soft);
  color: #7c2925;
}

/* Page primitives */
.page-heading,
.section-heading,
.manual-quote-head,
.account-head,
.payment-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}

.page-heading {
  margin-bottom: 22px;
}

.page-heading p,
.section-heading p,
.manual-quote-head p,
.payment-head p {
  margin: 6px 0 0;
  color: var(--muted);
}

.page-heading__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.eyebrow {
  display: block;
  margin-bottom: 7px;
  color: var(--accent-strong);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.panel,
.quote-card,
.side-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 1px 2px rgba(24, 32, 30, .03);
}

.panel {
  padding: 24px;
  margin: 0 0 18px;
}

.panel + .panel {
  margin-top: 0;
}

.panel > h1:first-child,
.panel > h2:first-child {
  margin-top: 0;
}

.ghost-link,
button.ghost-link,
.link-button.ghost-link,
.toolbar button,
.inline-form button:not(.primary) {
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--ink-soft);
}

.ghost-link:hover,
button.ghost-link:hover,
.link-button.ghost-link:hover,
.toolbar button:hover,
.inline-form button:not(.primary):hover {
  border-color: #99aaa4;
  background: var(--surface-soft);
  color: var(--ink);
}

.badge {
  border: 1px solid #cbded6;
  border-radius: 999px;
  background: var(--accent-soft);
  color: #215f4a;
  padding: 4px 9px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.table-wrap,
.responsive-table {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

th,
td {
  border-bottom: 1px solid #e9eeec;
  padding: 13px 14px;
  vertical-align: middle;
}

th {
  background: #f6f8f7;
  color: #64736e;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

tbody tr:last-child td {
  border-bottom: 0;
}

tbody tr:hover td {
  background: #fafcfb;
}

.table-primary-link {
  color: var(--ink);
  font-weight: 800;
}

.empty-state {
  display: grid;
  place-items: center;
  min-height: 220px;
  border: 1px dashed var(--line-strong);
  border-radius: 7px;
  background: #fafcfb;
  padding: 28px;
  text-align: center;
}

.empty-state strong {
  display: block;
  margin-bottom: 5px;
  font-size: 17px;
}

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

.inline-form {
  align-items: flex-end;
  gap: 9px;
  margin: 0 0 18px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f8faf9;
}

.inline-form input,
.inline-form select {
  max-width: 260px;
  background: #fff;
}

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

.facts {
  grid-template-columns: 130px minmax(0, 1fr);
  margin: 0;
}

.facts dt {
  color: var(--muted);
  font-size: 13px;
}

.facts dd {
  color: var(--ink);
}

/* Home workspace */
.home-workspace {
  display: grid;
  gap: 22px;
}

.home-intro {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, .65fr);
  min-height: 360px;
  overflow: hidden;
  border: 1px solid #cad6d1;
  border-radius: 8px;
  background: #fff;
}

.home-intro__copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 54px;
}

.home-intro h1 {
  max-width: 700px;
  font-size: 40px;
  line-height: 1.12;
}

.home-intro p {
  max-width: 650px;
  margin: 16px 0 26px;
  color: var(--ink-soft);
  font-size: 17px;
  line-height: 1.7;
}

.home-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.home-visual {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 300px;
  border-left: 1px solid var(--line);
  background: #edf3f0;
}

.home-visual__plate {
  position: relative;
  width: 210px;
  height: 210px;
  border: 1px solid #aebdb7;
  background: #f8fbfa;
  transform: rotate(45deg);
  box-shadow: 18px 18px 0 rgba(34, 58, 49, .09);
}

.home-visual__model {
  position: absolute;
  width: 118px;
  height: 118px;
  border: 18px solid var(--accent);
  border-right-color: #1f9873;
  border-bottom-color: #0f6048;
  transform: rotate(-45deg);
  box-shadow: inset 0 0 0 10px #d9ece5;
}

.home-visual__tag {
  position: absolute;
  right: 22px;
  bottom: 22px;
  border: 1px solid #c4d1cc;
  border-radius: 5px;
  background: #fff;
  color: var(--ink-soft);
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 800;
}

.home-features {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.home-feature {
  padding: 22px;
  border-right: 1px solid var(--line);
}

.home-feature:last-child {
  border-right: 0;
}

.home-feature span {
  display: block;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
}

.home-feature strong {
  display: block;
  margin: 5px 0;
}

.home-feature p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

/* Authentication */
.auth-shell {
  display: grid;
  grid-template-columns: minmax(0, .8fr) minmax(380px, 1fr);
  max-width: 880px;
  min-height: 520px;
  margin: 28px auto;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.auth-aside {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: #1e2a26;
  color: #fff;
  padding: 36px;
}

.auth-aside h2 {
  margin: 12px 0;
  font-size: 25px;
}

.auth-aside p {
  color: #b9c8c2;
  line-height: 1.65;
}

.auth-aside small {
  color: #95a9a1;
}

.auth-panel,
.panel.narrow.auth-panel {
  width: auto;
  max-width: none;
  margin: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  padding: 44px;
}

.auth-panel h1 {
  margin-bottom: 8px;
}

.auth-panel .stack {
  margin-top: 24px;
}

.auth-panel .primary {
  width: 100%;
}

.auth-switch {
  margin: 22px 0 0;
  color: var(--muted);
  font-size: 14px;
  text-align: center;
}

/* Account and payment workflows */
.account-panel {
  padding: 0;
  overflow: hidden;
}

.account-head {
  align-items: center;
  margin: 0;
  padding: 24px 28px;
  border-bottom: 1px solid var(--line);
  background: #fbfcfc;
}

.account-grid {
  gap: 0;
}

.account-grid form {
  padding: 28px;
}

.account-grid form + form {
  border-left: 1px solid var(--line);
}

.account-actions {
  display: flex;
  justify-content: flex-end;
  padding-top: 4px;
}

.payment-panel {
  max-width: 900px;
  margin-right: auto;
  margin-left: auto;
}

.payment-head {
  align-items: center;
}

.payment-amount {
  min-width: 190px;
  border-left: 1px solid var(--line);
  padding-left: 24px;
  text-align: right;
}

.payment-amount span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.payment-amount strong {
  display: block;
  margin-top: 4px;
  color: var(--accent-strong);
  font-size: 26px;
}

.payment-facts {
  border-top: 1px solid var(--line);
  margin-top: 22px;
  padding-top: 18px;
}

.payment-form {
  max-width: 680px;
}

.payment-actions {
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 8px;
}

.gateway-card,
.transfer-account-card {
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  box-shadow: none;
}

.gateway-card:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px var(--accent);
}

.confirm-total-list {
  border-radius: 7px;
  background: #f6f9f7;
}

/* Quote creation and order detail */
.quote-page .app-header {
  position: sticky;
}

.quote-shell {
  width: min(1440px, 100%);
  max-width: none;
  padding: 32px 28px 58px;
}

.quote-page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  margin: 4px 0 24px;
}

.quote-page-heading h1 {
  margin: 0;
  font-size: 30px;
}

.quote-page-heading p {
  margin: 7px 0 0;
  color: var(--muted);
}

.workflow-steps {
  display: flex;
  flex: 0 0 auto;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.workflow-steps li {
  position: relative;
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 130px;
  color: #8a9692;
  font-size: 12px;
  font-weight: 800;
}

.workflow-steps li:not(:last-child)::after {
  content: "";
  width: 34px;
  height: 1px;
  margin: 0 10px;
  background: var(--line-strong);
}

.workflow-steps span {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: #fff;
}

.workflow-steps .is-current {
  color: var(--accent-strong);
}

.workflow-steps .is-current span,
.workflow-steps .is-complete span {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.workflow-steps .is-complete {
  color: var(--ink-soft);
}

.payment-workflow {
  display: flex;
  justify-content: flex-end;
  max-width: 900px;
  margin: 0 auto 18px;
}

.quote-grid,
.order-review {
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 20px;
}

.quote-left {
  min-width: 0;
}

.quote-card,
.side-card {
  overflow: hidden;
  box-shadow: none;
}

.file-toolbar,
.upload-tabs {
  min-height: 62px;
  border-bottom: 1px solid var(--line);
  background: #fbfcfc;
  padding: 0 20px;
}

.file-toolbar h1,
.upload-tabs h2 {
  font-size: 17px;
}

.quote-row.quote-head {
  background: #f5f8f6;
  color: #687771;
  font-size: 11px;
  font-weight: 800;
}

.quote-row.quote-item {
  border-bottom-color: var(--line);
  background: #fff;
}

.quote-row.quote-item:hover {
  background: #fbfdfc;
}

.pick span {
  background: #e7f2ed;
  color: var(--accent-strong);
}

.part-preview {
  border-color: var(--line);
  border-radius: 6px;
  background: #f2f6f4;
}

.process-tags label,
.process-tags > span {
  border-color: var(--line);
  background: #f5f7f6;
  color: var(--ink-soft);
}

.quote-total span,
.pay-total strong {
  color: var(--accent-strong);
}

.upload-card-v2 {
  margin-top: 18px;
}

.drop-zone {
  border: 1px dashed #9aada5;
  border-radius: 7px;
  background: #f8fbf9;
}

.drop-zone:hover,
.drop-zone.is-dragging {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.drop-zone i,
.drop-zone strong span {
  color: var(--accent);
}

.side-card {
  padding: 20px;
}

.quote-side .side-card {
  top: 86px;
}

.speed-list label {
  border-color: var(--line);
  border-radius: 6px;
  background: #fff;
}

.speed-list label:hover,
.speed-list label.active,
.speed-list label:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.place-order {
  border-color: var(--accent);
  background: var(--accent);
}

.place-order:hover {
  background: var(--accent-strong);
}

.order-review {
  width: 100%;
}

.order-summary-list dt,
.price-detail-list dt {
  color: var(--muted);
}

.admin-side-actions h2 {
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.admin-side-actions form {
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.model-preview-dialog,
.price-detail-dialog {
  border-radius: 8px;
  box-shadow: 0 24px 70px rgba(8, 18, 14, .28);
}

/* Admin screens */
.is-admin-area .app-main {
  padding-top: 26px;
}

.admin-orders-panel {
  padding: 0;
  overflow: hidden;
}

.admin-orders-panel > .page-heading,
.admin-orders-panel > h1,
.admin-orders-panel > p,
.admin-orders-panel > .inline-form,
.admin-orders-panel > .table-wrap,
.admin-orders-panel > table,
.admin-orders-panel > nav {
  margin-right: 22px;
  margin-left: 22px;
}

.admin-orders-panel > .table-wrap {
  width: auto;
}

.admin-orders-panel > .page-heading,
.admin-orders-panel > h1 {
  margin-top: 22px;
}

.admin-orders-table {
  min-width: 980px;
}

.admin-order-row-actions {
  flex-wrap: nowrap;
}

.admin-row-action {
  min-height: 32px;
  border-color: var(--line-strong);
  background: #fff;
  color: var(--ink-soft);
  padding: 6px 9px;
  font-size: 12px;
}

.admin-row-action.is-primary {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.admin-row-action.is-danger {
  border-color: #e2b2af;
  background: #fff;
  color: var(--danger);
}

.admin-row-action.is-danger:hover {
  border-color: var(--danger);
  background: var(--danger-soft);
  color: var(--danger);
}

.event-grid {
  border-color: var(--line);
  border-radius: 7px;
  background: #f8faf9;
}

.event-grid .inline-check {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #fff;
  padding: 9px 11px;
}

.manual-item {
  border-color: var(--line);
}

.manual-item-head {
  background: #f5f8f6;
  color: var(--muted);
}

.manual-remove {
  border-color: #e0b6b3;
  background: #fff;
  color: var(--danger);
}

.payment-proof-preview,
.payment-proof-preview img {
  width: 144px !important;
  height: 144px !important;
  min-width: 144px !important;
  max-width: 144px !important;
  min-height: 144px !important;
  max-height: 144px !important;
  border-radius: 6px;
}

/* Pagination */
nav[role="navigation"] {
  margin-top: 18px;
}

nav[role="navigation"] svg {
  width: 18px;
  height: 18px;
}

/* Responsive */
@media (max-width: 1180px) {
  .app-header__inner {
    padding: 0 20px;
  }

  .app-nav {
    margin-left: 20px;
  }

  .app-nav__admin {
    margin-left: 12px;
    padding-left: 12px;
  }

  .app-nav__account > span {
    display: none;
  }

  .quote-grid,
  .order-review {
    grid-template-columns: minmax(0, 1fr) 300px;
  }
}

@media (max-width: 920px) {
  .app-header__inner {
    min-height: 60px;
  }

  .nav-toggle {
    display: block;
  }

  .app-nav {
    position: absolute;
    top: 60px;
    right: 14px;
    left: 14px;
    display: none;
    align-items: stretch;
    max-height: calc(100vh - 78px);
    overflow-y: auto;
    margin: 0;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    box-shadow: var(--shadow);
    padding: 10px;
  }

  .is-nav-open .app-nav {
    display: grid;
  }

  .app-nav nav {
    display: grid;
    align-items: stretch;
  }

  .app-nav nav a,
  .nav-register,
  .nav-logout {
    justify-content: flex-start;
    min-height: 42px;
    width: 100%;
  }

  .app-nav nav a.is-active {
    box-shadow: inset 3px 0 var(--accent);
  }

  .app-nav__admin {
    margin: 8px 0 0;
    border-top: 1px solid var(--line);
    border-left: 0;
    padding: 10px 0 0;
  }

  .admin-label {
    padding: 8px 11px 3px;
  }

  .app-nav__account {
    display: grid;
    margin: 8px 0 0;
    border-top: 1px solid var(--line);
    padding: 10px 0 0;
  }

  .app-nav__account > span {
    display: block;
    max-width: none;
    padding: 7px 11px 2px;
  }

  .nav-register {
    margin-top: 8px;
  }

  .admin-context-bar > div {
    padding: 0 20px;
  }

  .quote-grid,
  .order-review {
    grid-template-columns: 1fr;
  }

  .quote-side .side-card {
    position: static;
  }

  .quote-page-heading {
    align-items: flex-start;
  }

  .workflow-steps li {
    min-width: 0;
  }

  .workflow-steps li:not(:last-child)::after {
    width: 20px;
  }

  .workflow-steps li {
    font-size: 0;
  }

  .workflow-steps li span {
    font-size: 12px;
  }

  .home-intro {
    grid-template-columns: 1fr;
  }

  .home-visual {
    min-height: 260px;
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .manual-items {
    overflow-x: auto;
  }

  .manual-item {
    min-width: 880px;
  }
}

@media (max-width: 720px) {
  .app-main,
  main.app-main,
  .app-main.layout-wide,
  main.app-main.layout-wide,
  .quote-shell {
    width: 100%;
    padding: 22px 14px 40px;
  }

  .app-footer {
    display: grid;
    width: calc(100% - 28px);
    padding-bottom: 22px;
  }

  .admin-context-bar span {
    display: none;
  }

  h1 {
    font-size: 24px;
  }

  .page-heading,
  .section-heading,
  .manual-quote-head,
  .payment-head,
  .quote-page-heading {
    display: grid;
  }

  .page-heading__actions {
    justify-content: flex-start;
  }

  .panel {
    padding: 18px;
  }

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

  .wide {
    grid-column: auto;
  }

  .home-intro__copy {
    padding: 30px 24px;
  }

  .home-intro h1 {
    font-size: 31px;
  }

  .home-intro p {
    font-size: 15px;
  }

  .home-features {
    grid-template-columns: 1fr;
  }

  .home-feature {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .home-feature:last-child {
    border-bottom: 0;
  }

  .auth-shell {
    display: block;
    min-height: 0;
    margin: 0;
  }

  .auth-aside {
    min-height: 180px;
    padding: 25px;
  }

  .auth-aside small {
    display: none;
  }

  .auth-panel,
  .panel.narrow.auth-panel {
    padding: 28px 22px;
  }

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

  .account-grid form {
    padding: 22px;
  }

  .account-grid form + form {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .payment-amount {
    min-width: 0;
    border-top: 1px solid var(--line);
    border-left: 0;
    padding-top: 16px;
    padding-left: 0;
    text-align: left;
  }

  .payment-actions {
    display: grid;
  }

  .payment-actions > * {
    width: 100%;
    text-align: center;
  }

  .workflow-steps {
    width: 100%;
  }

  .workflow-steps li {
    flex: 1;
  }

  .workflow-steps li:not(:last-child)::after {
    flex: 1;
    width: auto;
    margin: 0 6px;
  }

  .inline-form {
    display: grid;
  }

  .inline-form input,
  .inline-form select,
  .inline-form button,
  .inline-form .link-button {
    width: 100%;
    max-width: none;
  }

  .facts {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .facts dd {
    margin-bottom: 10px;
  }
}

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