:root {
  color-scheme: light;
  --canvas: #f4f7f5;
  --surface: #fff;
  --ink: #1e3430;
  --muted: #536e65;
  --line: #dfe7e1;
  --soft: #f1f5ef;
  --sidebar: #153c33;
  --sidebar-text: #cbe0d7;
  --active: #d7edbf;
  --accent: #205a4b;
  --accent-hover: #174b3e;
  --sidebar-width: 230px;
  --radius: 9px;
  --shadow: 0 1px 2px #20392d0a;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --canvas: #16241f;
  --surface: #20322b;
  --ink: #eef5ef;
  --muted: #bad0c3;
  --line: #395247;
  --soft: #2b4237;
  --accent: #26705a;
  --accent-hover: #1d5d4a;
  --shadow: none;
}

* {
  box-sizing: border-box;
}
[hidden] {
  display: none !important;
}
html {
  min-height: 100%;
}
body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font:
    14px/1.55 "Segoe UI",
    system-ui,
    sans-serif;
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1 {
  font-size: clamp(28px, 3.2vw, 38px);
  line-height: 1.12;
  font-weight: 750;
  letter-spacing: -0.045em;
}
h2 {
  font-size: 16px;
  line-height: 1.3;
  letter-spacing: -0.015em;
}
h3 {
  font-size: 15px;
}
small {
  color: var(--muted);
  font-size: 12px;
}
button,
input,
select,
textarea {
  font: inherit;
}
button {
  min-height: 36px;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  color: var(--ink);
  font-weight: 550;
  cursor: pointer;
}
button:hover {
  background: var(--soft);
}
button:disabled {
  cursor: default;
  opacity: 0.55;
}
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
.table-scroll:focus-visible {
  outline: 2px solid #4c8c75;
  outline-offset: 2px;
}
button.primary,
button[type="submit"] {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}
button.primary:hover,
button[type="submit"]:hover {
  background: var(--accent-hover);
}

.sidebar {
  display: none;
  background: var(--sidebar);
  color: white;
}
.signed-in .sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 3;
  display: flex;
  width: var(--sidebar-width);
  flex-direction: column;
  gap: 18px;
  padding: 28px 16px 16px;
  overflow: auto;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  color: white;
}
.sidebar .brand {
  padding: 2px 10px 13px;
}
.brand-mark {
  position: relative;
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  display: grid;
  place-content: center;
  border-radius: 11px;
  background: var(--active);
  color: var(--sidebar);
}
.brand-mark::before {
  content: "✓";
  display: grid;
  width: 17px;
  height: 13px;
  place-items: center;
  margin-top: -3px;
  border: 1.6px solid currentColor;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
}
.brand-mark::after {
  position: absolute;
  bottom: 9px;
  left: 15px;
  width: 8px;
  height: 1.5px;
  background: currentColor;
  content: "";
}
.brand-name {
  font-size: 25px;
  line-height: 1.1;
  letter-spacing: -0.035em;
  font-weight: 760;
  overflow-wrap: anywhere;
}
.brand-name small {
  display: block;
  margin-top: 5px;
  color: #bfd7ca;
  font-size: 9px;
  font-weight: 680;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
#nav {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 5px;
}
.nav-label {
  margin: 10px 14px 5px;
  color: #a4c0b5;
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}
#nav button {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  text-align: left;
  padding: 8px 13px;
  color: var(--sidebar-text);
  background: transparent;
  border-color: transparent;
}
#nav button[data-do="nav:settings"] {
  margin-top: auto;
}
#nav button:hover {
  background: #285144;
}
#nav button[aria-current="page"] {
  background: var(--active);
  color: var(--sidebar);
  font-weight: 730;
}
.nav-symbol {
  width: 19px;
  flex: 0 0 19px;
  text-align: center;
  font-size: 18px;
  line-height: 1;
}
.sidebar-account {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  border-top: 1px solid #3b6256;
  padding: 15px 3px 0;
}
.account-profile,
.staff-person {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}
.account-profile strong {
  display: block;
  font-size: 12px;
  line-height: 1.2;
  overflow-wrap: anywhere;
}
.account-role,
.account-profile small {
  display: block;
  color: var(--sidebar-text);
  margin-top: 3px;
}
.account-initials,
.person-initials {
  display: grid;
  place-items: center;
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #e2ebe0;
  color: #294d40;
  font-size: 11px;
  font-weight: 700;
}
#logout {
  padding: 5px;
  min-height: 32px;
  flex: 0 0 auto;
  border: 0;
  background: transparent;
  color: var(--sidebar-text);
  font-size: 11px;
}
#logout:hover {
  background: #285144;
}
.menu-toggle {
  display: none;
}

.workspace {
  min-width: 0;
}
.signed-in .workspace {
  margin-left: var(--sidebar-width);
}
.top-bar {
  min-height: 65px;
  padding: 12px clamp(20px, 3vw, 40px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  color: var(--muted);
  gap: 14px;
}
.breadcrumbs,
.shop-label {
  display: flex;
  align-items: center;
  gap: 12px;
}
.breadcrumbs strong {
  color: var(--ink);
}
.shop-label .person-initials {
  width: 30px;
  height: 30px;
  flex-basis: 30px;
}
.signed-in main {
  width: min(100%, 1530px);
  margin: auto;
  padding: clamp(28px, 3.5vw, 43px) clamp(24px, 6vw, 104px);
}
.page-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 26px;
}
.page-heading p {
  margin-top: 11px;
  color: var(--muted);
}
.page-heading > button,
.overview-actions > button {
  min-height: 40px;
  white-space: nowrap;
}
.overview-kicker {
  margin-bottom: 9px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.overview-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 12px;
}

.card,
dialog {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.card {
  margin-bottom: 18px;
  padding: 19px 20px;
}
.card > :last-child {
  margin-bottom: 0;
}
.card-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.card-heading button {
  font-size: 12px;
}
.panel-note {
  margin: 3px 0 15px;
  font-size: 12px;
  color: var(--muted);
}
.metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 145px), 1fr));
  gap: 14px;
  margin-bottom: 18px;
}
.metric-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  row-gap: 8px;
  text-align: left;
  padding: 15px 17px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.metric-card:hover {
  border-color: #99b4a5;
}
.metric-label {
  align-self: center;
  font-size: 13px;
  color: var(--muted);
}
.metric-icon {
  display: grid;
  place-items: center;
  width: 31px;
  height: 31px;
  border-radius: 8px;
  color: var(--symbol);
  background: var(--pale);
}
.metric-card strong {
  grid-column: 1 / -1;
  font-size: clamp(24px, 3vw, 31px);
  letter-spacing: -0.04em;
  line-height: 1.05;
  overflow-wrap: anywhere;
}
.metric-card small {
  grid-column: 1 / -1;
  font-weight: 400;
  margin-top: 4px;
}
.tone--blue {
  --pale: #e8f1f8;
  --symbol: #3b6682;
  --tone: #90adbc;
}
.tone--violet {
  --pale: #f0eaf6;
  --symbol: #684d85;
  --tone: #a598be;
}
.tone--green {
  --pale: #e8f0e2;
  --symbol: #416e4b;
  --tone: #78a591;
}
.tone--amber {
  --pale: #faf1e1;
  --symbol: #875e23;
  --tone: #cdaf66;
}
.tone--rose {
  --pale: #f6e8e1;
  --symbol: #8b4c3a;
  --tone: #d3997e;
}
.tone--lime {
  --pale: #edf3dc;
  --symbol: #537035;
  --tone: #acc781;
}
.overview-middle,
.overview-bottom,
.work-layout {
  display: grid;
  gap: 18px;
}
.overview-middle {
  grid-template-columns: minmax(0, 1.23fr) minmax(0, 1fr);
}
.overview-middle:has(> :only-child) {
  grid-template-columns: minmax(0, 1fr);
}
.overview-bottom {
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
}
.work-layout {
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  align-items: start;
}
.pipeline-bar {
  display: flex;
  border-radius: 10px;
  height: 9px;
  overflow: hidden;
  background: var(--soft);
  margin: 25px 0 18px;
}
.pipeline-bar span {
  flex: 1;
  background: var(--tone);
}
.pipeline {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 22px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.pipeline li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}
.pipeline i {
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  border-radius: 2px;
  background: var(--tone);
}
.pipeline strong {
  margin-left: auto;
}
.collection-total {
  display: block;
  font-size: 25px;
  letter-spacing: -0.04em;
  margin-bottom: 8px;
}
.collections {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 10px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.collections li {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
  align-items: center;
  font-size: 10px;
  color: var(--muted);
}
.collections meter {
  width: min(42px, 100%);
  min-width: 0;
  height: 45px;
  writing-mode: vertical-lr;
  direction: rtl;
}
.collections meter::-webkit-meter-bar {
  border: 0;
  background: linear-gradient(to top, var(--line) 2px, transparent 2px);
  border-radius: 3px;
}
.collections meter::-webkit-meter-optimum-value {
  background: #608f77;
}
.stock-empty {
  min-height: 131px;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 8px;
  text-align: center;
}
.stock-empty > span {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border: 2px solid #8aaa8b;
  color: #4b7457;
  border-radius: 50%;
}

.table-scroll {
  width: 100%;
  overflow-x: auto;
}
.card > .table-scroll {
  width: calc(100% + 40px);
  margin-inline: -20px;
}
table {
  border-collapse: collapse;
  width: 100%;
  text-align: left;
}
th,
td {
  padding: 12px 17px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
th {
  color: var(--muted);
  background: var(--soft);
  font-size: 12px;
  font-weight: 650;
  white-space: nowrap;
}
td {
  font-size: 13px;
}
td strong,
td small,
.row small,
.staff-person small {
  display: block;
}
td small {
  margin-top: 3px;
}
td .cell-device {
  color: var(--ink);
}
td button[data-do^="open:"] {
  padding: 0;
  min-height: 22px;
  border: 0;
  border-radius: 3px;
  background: transparent;
  color: var(--ink);
  font-weight: 700;
  white-space: nowrap;
}
td button[data-do^="open:"]:hover {
  text-decoration: underline;
}
td .actions {
  min-width: 138px;
}
.status {
  display: inline-flex;
  align-items: center;
  border-radius: 5px;
  padding: 4px 7px;
  font-weight: 600;
  font-size: 11px;
  line-height: 1.3;
  white-space: nowrap;
}
.status--queued {
  background: #e7eff6;
  color: #385c76;
}
.status--working {
  background: #ecebf8;
  color: #554b83;
}
.status--waiting {
  background: #f9efdf;
  color: #78551c;
}
.status--ready {
  background: #e4f0e7;
  color: #31634b;
}
.status--neutral {
  background: var(--soft);
  color: var(--muted);
}
.list-toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.list-toolbar > .search-form:only-child {
  margin-left: auto;
}
.search-form,
.actions,
.tabs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
}
.search-form {
  align-items: end;
}
.search-form input {
  min-width: 148px;
}
.search-form button {
  color: var(--ink);
  background: var(--surface);
  border-color: var(--line);
}
.search-form button:hover {
  background: var(--soft);
}
.tabs {
  gap: 3px;
}
.tabs button {
  border-color: transparent;
  padding: 5px 8px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
}
.tabs button:hover {
  background: var(--soft);
}
.tabs button[aria-pressed="true"],
.tabs button[aria-current="page"] {
  box-shadow: inset 0 -2px #70a07c;
  color: var(--ink);
  font-weight: 700;
}
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 15px;
  color: var(--muted);
  font-size: 12px;
}
.pagination button {
  min-height: 32px;
  font-size: 12px;
}
.customer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 238px), 1fr));
  gap: 12px;
}
.customer-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 15px;
  min-width: 0;
}
.customer-card h3 {
  margin: 9px 0 6px;
}
.customer-card p {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 4px;
  overflow-wrap: anywhere;
}
.customer-card .actions {
  margin-top: 12px;
}
.customer-card button {
  font-size: 12px;
}
.summary-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 30px;
  padding: 15px 22px;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 18px;
}
.summary-strip strong,
.summary-strip small {
  display: block;
}
.summary-strip strong {
  font-size: 19px;
}
.summary-strip .billing-total {
  font-size: 29px;
}
.settings-list {
  margin: 0;
}
.settings-list div,
.row {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.settings-list div:last-child,
.row:last-child {
  border-bottom: 0;
}
.settings-list dt {
  color: var(--muted);
}
.settings-list dd {
  margin: 0;
  text-align: right;
}
.theme-actions {
  margin-top: 14px;
}
.doc {
  max-width: 65%;
  white-space: pre-line;
  overflow-wrap: anywhere;
  text-align: right;
}
.empty-state {
  color: var(--muted);
  padding: 19px 0;
  text-align: center;
}
#view > .actions {
  margin-bottom: 16px;
}

.auth-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  min-height: 100vh;
}
.auth-intro {
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 28px;
  padding: clamp(30px, 5.1vh, 64px) clamp(28px, 2.82vw, 64px)
    clamp(24px, 4vh, 52px);
  background: var(--sidebar);
  color: #e1f0db;
}
.auth-intro .brand-name {
  font-size: clamp(22px, 1.45vw, 30px);
}
.auth-intro .brand-mark {
  width: 38px;
  height: 40px;
}
.auth-message {
  align-self: center;
}
.auth-eyebrow {
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.auth-message .auth-eyebrow {
  color: #bbd79b;
  margin-bottom: 24px;
}
.auth-message h2 {
  font-size: clamp(42px, 4.65vw, 66px);
  font-weight: 710;
  line-height: 1.07;
  letter-spacing: -0.052em;
}
.auth-description {
  color: #b8d2c4;
  margin-top: 24px;
  font-size: 15px;
  line-height: 1.8;
}
.auth-intro-footer {
  color: #a1c0b2;
  font-size: 11px;
}
.auth-art {
  position: relative;
  width: 165px;
  height: 130px;
  margin: clamp(28px, 6.2vh, 56px) 0 0 21px;
  color: #a4c398;
  background: radial-gradient(ellipse at 46% 51%, #63876554, transparent 69%);
}
.auth-monitor {
  position: absolute;
  top: 15px;
  left: 30px;
  width: 104px;
  height: 74px;
  border: 5px solid currentColor;
  border-radius: 13px;
}
.auth-monitor::before {
  position: absolute;
  top: 24px;
  left: 31px;
  width: 31px;
  height: 16px;
  border: solid currentColor;
  border-width: 0 0 5px 5px;
  border-radius: 2px;
  transform: rotate(-45deg);
  content: "";
}
.auth-monitor::after {
  position: absolute;
  left: calc(50% - 22px);
  bottom: -25px;
  width: 44px;
  height: 22px;
  background: linear-gradient(currentColor, currentColor) center top / 5px 18px
    no-repeat;
  border-bottom: 5px solid currentColor;
  border-radius: 0 0 3px 3px;
  content: "";
}
.auth-art-badge {
  position: absolute;
  right: 7px;
  bottom: 2px;
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: 13px;
  background: #d2e9b9;
  color: #285340;
  box-shadow: 0 10px 20px #112e26a0;
  transform: rotate(8deg);
}
.auth-shield {
  position: relative;
  display: inline-block;
  flex: 0 0 auto;
  width: 1em;
  height: 1.12em;
  background: currentColor;
  clip-path: polygon(
    50% 0,
    100% 16%,
    96% 62%,
    81% 82%,
    50% 100%,
    19% 82%,
    4% 62%,
    0 16%
  );
}
.auth-shield::before {
  position: absolute;
  inset: 0.11em;
  background: var(--shield-fill, var(--surface));
  clip-path: inherit;
  content: "";
}
.auth-shield::after {
  position: absolute;
  top: 36%;
  left: 31%;
  width: 37%;
  height: 25%;
  border: solid currentColor;
  border-width: 0 0 0.095em 0.095em;
  transform: rotate(-45deg);
  content: "";
}
.auth-art-badge .auth-shield {
  --shield-fill: #d2e9b9;
  font-size: 23px;
}
.auth-entry {
  display: grid;
  place-items: center;
  padding: 44px 28px;
  background: var(--surface);
}
.auth-form {
  width: min(100%, 320px);
}
.auth-heading {
  margin-bottom: 32px;
}
.auth-heading .auth-eyebrow {
  margin-bottom: 12px;
  color: var(--muted);
}
.auth-heading h1 {
  font-size: clamp(30px, 2.15vw, 36px);
  letter-spacing: -0.045em;
}
.auth-form-intro {
  margin-top: 14px;
  color: var(--muted);
}
.auth-form .form-grid {
  grid-template-columns: 1fr;
  gap: 18px;
}
.auth-form label {
  gap: 5px;
  color: var(--ink);
  font-weight: 550;
}
.auth-form input {
  min-height: 46px;
  padding: 9px 12px;
}
.auth-form button[type="submit"] {
  margin-top: 14px;
  width: 100%;
  min-height: 40px;
  font-size: 13px;
  font-weight: 700;
}
.auth-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin-top: 24px;
  color: var(--muted);
  font-size: 11px;
}

dialog {
  width: min(620px, calc(100vw - 28px));
  max-height: 88vh;
  padding: 22px;
  color: var(--ink);
}
dialog::backdrop {
  background: #122d25a0;
}
dialog h2 {
  font-size: 21px;
  margin-bottom: 14px;
}
dialog #close {
  margin-top: 12px;
}
dialog .row {
  align-items: center;
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 11px;
  margin: 0 0 12px;
}
.form-grid label:has(textarea) {
  grid-column: 1 / -1;
}
label {
  display: grid;
  font-size: 12px;
  font-weight: 650;
  gap: 4px;
}
input,
textarea,
select {
  width: 100%;
  min-width: 0;
  min-height: 36px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 6px 9px;
  border-radius: 6px;
  font-weight: 450;
}
textarea {
  min-height: 78px;
  resize: vertical;
}
.err,
#error:not(:empty) {
  padding: 9px;
  margin: 0 0 11px;
  background: #fbece8;
  color: #842f25;
  border-radius: 6px;
}
.err:empty,
#error:empty {
  display: none;
}
body:not(.signed-in) #error:not(:empty) {
  position: fixed;
  top: 12px;
  right: 12px;
  z-index: 3;
  max-width: min(400px, 90vw);
}

@media (max-width: 1100px) {
  .signed-in main {
    padding-inline: 26px;
  }
  .overview-bottom {
    grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  }
}

@media (max-width: 880px) {
  .signed-in .sidebar {
    position: relative;
    width: auto;
    gap: 10px;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    padding: 11px 15px;
    overflow: visible;
  }
  .sidebar .brand {
    padding: 0;
  }
  .sidebar .brand-mark {
    width: 32px;
    height: 32px;
    flex-basis: 32px;
  }
  .sidebar .brand-mark::after {
    left: 12px;
    bottom: 6px;
  }
  .sidebar .brand-name {
    font-size: 20px;
  }
  .sidebar .brand-name small {
    margin-top: 2px;
  }
  .menu-toggle {
    display: block;
    margin-left: auto;
    color: white;
    background: #285144;
    border-color: #507668;
  }
  .menu-toggle:hover {
    background: #326254;
  }
  #nav,
  .sidebar-account {
    display: none;
    flex: 1 0 100%;
  }
  .menu-open #nav,
  .menu-open .sidebar-account {
    display: flex;
  }
  .signed-in .workspace {
    margin-left: 0;
  }
  .top-bar {
    min-height: 49px;
    padding-block: 7px;
  }
  .overview-bottom,
  .work-layout {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 610px) {
  .signed-in main {
    padding-inline: 14px;
  }
  .top-bar {
    padding-inline: 14px;
  }
  .page-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 18px;
  }
  .overview-middle {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }
  .metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
  .metric-card {
    padding: 11px;
  }
  .metric-label {
    font-size: 12px;
  }
  .metric-icon {
    width: 24px;
    height: 24px;
  }
  .metric-card small {
    font-size: 10px;
  }
  .auth-layout {
    grid-template-columns: 1fr;
    min-height: auto;
  }
  .auth-intro {
    padding: 18px 22px;
  }
  .auth-message,
  .auth-intro-footer {
    display: none;
  }
  .auth-entry {
    min-height: calc(100dvh - 76px);
    padding: 48px 24px;
    place-items: start center;
  }
  .doc {
    max-width: 62%;
  }
}

@media (max-width: 370px) {
  .form-grid {
    grid-template-columns: 1fr;
  }
  .shop-label > #shop {
    display: none;
  }
}

#print-document {
  display: none;
}

@media print {
  body {
    color: #000;
    background: white;
  }
  .sidebar,
  .top-bar,
  dialog,
  .screen,
  #error,
  button {
    display: none !important;
  }
  .signed-in .workspace {
    margin: 0;
  }
  .signed-in main,
  .card {
    width: auto;
    padding: 0;
    border: 0;
    box-shadow: none;
    background: white;
  }
  body.printing-document .workspace {
    display: none;
  }
  body.printing-document #print-document {
    display: block;
    padding: 0.3in;
    font-size: 11pt;
  }
  #print-document .row {
    break-inside: avoid;
  }
  .print-heading {
    margin-bottom: 24px;
  }
  .print-heading h2 {
    margin-top: 7px;
  }
}

dialog.structured-modal {
  width: min(495px, calc(100vw - 30px));
  max-height: calc(100dvh - 32px);
  padding: 0;
  overflow: hidden;
  border-radius: 12px;
  box-shadow: 0 25px 60px #142d2650;
}

dialog.structured-modal--intake {
  width: min(684px, calc(100vw - 30px));
}

.structured-modal::backdrop {
  background: #1e3f3580;
  backdrop-filter: blur(2px);
}

.structured-modal #close {
  display: none;
}

.shop-form {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  max-height: min(812px, calc(100dvh - 34px));
}

.shop-form-header,
.shop-form-footer {
  padding: 17px 24px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.shop-form-header {
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.shop-form-header h2 {
  margin: 4px 0 0;
  line-height: 1.3;
  font-size: 19px;
}

.shop-form-header p {
  margin-top: 5px;
  font-size: 12px;
  color: var(--muted);
}

.shop-form-header .shop-form-dismiss {
  border-color: transparent;
  background: transparent;
  color: var(--muted);
  font-size: 20px;
  line-height: 1;
  padding: 5px 8px;
  min-height: 30px;
}

.shop-form-header .shop-form-dismiss:hover {
  background: var(--soft);
}

.shop-form-body {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 21px 24px;
}

.shop-form-footer {
  justify-content: flex-end;
  border-top: 1px solid var(--line);
  background: var(--soft);
}

.shop-form-footer button {
  min-height: 38px;
}
.shop-form-body .err:not(:empty) {
  margin: 15px 0 0;
}

.form-section + .form-section {
  margin-top: 19px;
}

.form-section-heading {
  min-height: 31px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 7px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 14px;
}

.form-section-heading h3 {
  font-size: 13px;
  color: var(--muted);
}
.form-section-heading h3 span {
  margin-right: 5px;
  font-size: 10px;
}

.form-section-heading .form-text-button {
  min-height: 24px;
  padding: 2px 4px;
  border: 0;
  color: var(--muted);
  font-size: 12px;
}

.form-fields {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 15px 17px;
}

.form-fields .form-wide {
  grid-column: 1 / -1;
}
.form-fields label {
  color: var(--muted);
}
.form-fields input,
.form-fields select,
.form-fields textarea {
  min-height: 40px;
  padding: 8px 10px;
}
.form-fields textarea {
  min-height: 62px;
}
.form-fields textarea[name="symptom"] {
  min-height: 87px;
}
.form-lookup {
  display: grid;
  gap: 5px;
}
.form-lookup small:empty {
  display: none;
}
.form-fields .form-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
}
.form-fields .form-checkbox input {
  width: 16px;
  height: 16px;
  min-height: 0;
  accent-color: var(--accent);
}
.form-fields .preservation-help {
  margin-top: -8px;
}
.device-lookup {
  margin-bottom: 14px;
}
.reported-fields {
  margin-top: 14px;
}
.priority-label {
  margin-left: 8px;
}

@media (max-width: 510px) {
  .shop-form-header,
  .shop-form-body,
  .shop-form-footer {
    padding: 13px 15px;
  }
  .form-fields {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }
  .shop-form-footer button {
    min-height: 42px;
  }
}

.tracking-card,
.tracking-print-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.tracking-card {
  align-items: center;
  justify-content: flex-start;
  flex-wrap: wrap;
}
.tracking-card a {
  color: var(--ink);
}
.tracking-qr {
  display: block;
  max-width: 100%;
  image-rendering: pixelated;
}
.tracking-print-heading figure {
  flex: 0 0 158px;
  margin: 0;
}
.tracking-print-heading figcaption {
  font-size: 10pt;
  line-height: 1.33;
  margin-top: 4px;
}
.print-brand {
  color: inherit;
}
.print-brand .brand-mark {
  border: 1px solid #80968a;
}
.print-brand h1 {
  font-size: 20pt;
}
.print-job-number {
  font-weight: 700;
  margin: 6px 0;
}
.tracking-print-heading address {
  font-style: normal;
  font-size: 10pt;
}
@media print {
  .tracking-print-heading {
    break-inside: avoid;
  }
}
#new-job-action {
  margin-left: auto;
  white-space: nowrap;
}
@media (max-width: 530px) {
  .top-bar:has(#new-job-action:not([hidden])) .shop-label {
    display: none;
  }
}

.print-shop-logo {
  width: auto;
  max-width: 100px;
  max-height: 55px;
  object-fit: contain;
}
.auth-note a {
  color: var(--accent);
}

/* Repair workflow indicators use a consistent palette with the pipeline. */
.status--queued, .tone--queued {
  --status-bg: #e3effb; --status-ink: #234f78; --tone: #6095bb;
}
.status--diagnosing, .tone--diagnosing {
  --status-bg: #ffebde; --status-ink: #833e18; --tone: #c47a49;
}
.status--waiting, .tone--waiting {
  --status-bg: #fff2cb; --status-ink: #644700; --tone: #bc9b50;
}
.status--parts, .tone--parts {
  --status-bg: #efe6f8; --status-ink: #614082; --tone: #9a78b5;
}
.status--repairing, .tone--repairing {
  --status-bg: #ddf2ed; --status-ink: #205b52; --tone: #6ba293;
}
.status--working, .tone--working {
  --status-bg: #e8eaf8; --status-ink: #444a7d; --tone: #848cbd;
}
.status--ready, .tone--ready {
  --status-bg: #e6f3db; --status-ink: #345b2b; --tone: #85ad61;
}
.status--released {
  --status-bg: #235b43; --status-ink: #fff;
}
.status--cancelled {
  --status-bg: #fbe6e5; --status-ink: #892e2a;
}
.repair-status {
  background: var(--status-bg, var(--soft));
  color: var(--status-ink, var(--muted));
  gap: 5px;
}
.repair-status::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex: none;
}

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 10;
  transform: translateY(calc(-100% - 12px));
  padding: 10px 14px;
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
}
.skip-link:focus { transform: none; }
a:focus-visible, .pagination:focus-visible, #main:focus-visible {
  outline: 2px solid #4c8c75;
  outline-offset: 2px;
}
.loading-state {
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--muted);
}
.skeleton { display: grid; gap: 10px; margin-block-start: 16px; }
.skeleton i { display: block; height: 14px; border-radius: 4px; background: var(--soft); }
.skeleton i:first-child { width: 45%; }
.skeleton i:last-child { width: 72%; }
.field-error {
  display: block;
  margin-block-start: 4px;
  color: #842f25;
}
[data-theme="dark"] .field-error { color: #ffc2b8; }
input[aria-invalid="true"], select[aria-invalid="true"], textarea[aria-invalid="true"] {
  border-color: #bb503f;
}
@media (max-width: 610px) {
  .work-order-table td, .work-order-table th { padding-inline: 10px; }
  .work-order-table td:first-child { max-width: 142px; overflow-wrap: anywhere; }
}
@media print {
  .skip-link { display: none; }
}

.mailing-address { white-space: pre-line; overflow-wrap: anywhere; }
.row .doc { white-space: pre-line; }

.appointment-grid { display: grid; gap: .75rem; margin-top: 1rem; }
.appointment-grid--week { grid-template-columns: repeat(auto-fit,minmax(154px,1fr)); }
.appointment-grid--month { grid-template-columns: repeat(auto-fit,minmax(165px,1fr)); }
.appointment-day { border: 1px solid var(--line); border-radius: .6rem; padding: .75rem; min-width: 0; }
.appointment-day .panel-note { overflow-wrap: anywhere; }
.appointment-day h3 { font-size: 1rem; margin: 0 0 .4rem; }
.appointment-paging { margin-top: .8rem; }
.appointment-items, .appointment-utilization, .appointment-audit, .appointment-config-list { list-style: none; margin: .75rem 0 0; padding: 0; }
.appointment-items li, .appointment-audit li, .appointment-config-list li { display: grid; gap: .25rem; padding: .55rem 0; border-bottom: 1px solid var(--line); }
.appointment-config-list li { display: flex; align-items: center; flex-wrap: wrap; gap: .6rem; }
.appointment-items li[draggable=true] { cursor: grab; }
.appointment-items li button { width: fit-content; }
.appointment-metrics { display: flex; gap: 1.2rem; flex-wrap: wrap; margin: 0; }
.appointment-metrics dt { font-size: .85rem; }
.appointment-metrics dd { margin: .25rem 0 0; font-size: 1.2rem; font-weight: 700; }
.service-color { border: 5px solid currentColor; border-radius: 50%; }
.appointment-items li[data-service-color] { border-inline-start: 3px solid var(--line); padding-inline-start: .45rem; }

.ai-panel form { margin-block: .8rem; }
.ai-panel form > button { margin-block-start: .65rem; }
.ai-panel textarea { width: 100%; }
#technician-ai-preview, .ai-result { margin-block: .8rem; padding: .8rem; border: 1px solid var(--line); border-radius: .6rem; }
#technician-ai-preview dl { margin-block: .8rem; }
#technician-ai-preview > button { margin-block-start: .55rem; }
.ai-result h3 { margin-block: 0 .55rem; }
.ai-result .actions { margin-block-start: .55rem; }

.ai-launcher {
  position: fixed;
  inset-inline-end: max(1rem, env(safe-area-inset-right));
  inset-block-end: max(1rem, env(safe-area-inset-bottom));
  z-index: 4;
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  min-height: 44px;
  padding: .55rem .95rem;
  border-radius: 999px;
  box-shadow: 0 6px 20px #142d2638;
}
.ai-sparkle {
  color: var(--active);
  font-size: 1.1rem;
}
#technician-ai-dialog {
  position: fixed;
  inset: auto max(1rem, env(safe-area-inset-right)) max(4.75rem, calc(env(safe-area-inset-bottom) + 3.75rem)) auto;
  width: min(580px, calc(100vw - 2rem));
  max-height: min(780px, calc(100dvh - 6rem));
  margin: 0;
  padding: 0;
  overflow: auto;
  overscroll-behavior: contain;
  box-shadow: 0 18px 60px #142d2648;
}
#technician-ai-dialog::backdrop {
  background: #142d2659;
}
.ai-dialog-header {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 1rem;
  padding: .95rem 1rem;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.ai-dialog-header h2 { margin: 0 0 .2rem; }
.ai-dialog-header [data-ai-close] {
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  font-size: 1.35rem;
}
#technician-ai { padding: .9rem 1rem 1rem; }
.ai-panel .form-checkbox,
#technician-ai-preview .form-checkbox {
  display: flex;
  flex-direction: row;
  align-items: baseline;
  gap: .5rem;
}
.ai-panel .form-checkbox input[type="checkbox"] {
  width: auto;
  min-height: 0;
  margin: .2rem 0 0;
}
.ai-panel .ai-brief { grid-column: 1 / -1; }
@media (max-width: 480px) {
  #technician-ai-dialog { width: calc(100vw - 1.25rem); inset-inline-end: .625rem; }
  .ai-panel .form-grid { grid-template-columns: 1fr; }
}

.appointment-page .page-heading { margin-bottom: 1rem; }
.appointment-today {
  display: grid;
  grid-template-columns: repeat(5,minmax(0,1fr));
  gap: .75rem;
  margin-bottom: 1rem;
}
.appointment-today article {
  min-width: 0;
  padding: .8rem 1rem;
  border: 1px solid var(--line);
  border-top: 3px solid var(--accent);
  border-radius: .65rem;
  background: var(--surface);
  box-shadow: 0 2px 7px #132f2310;
}
.appointment-today strong { display: block; color: var(--ink); font-size: 1.45rem; line-height: 1.1; }
.appointment-today span { display: block; margin-top: .3rem; color: var(--muted); font-size: .85rem; }
.appointment-calendar { padding: 1rem; }
.appointment-toolbar {
  display: grid;
  grid-template-columns: minmax(143px,auto) auto minmax(128px,auto) minmax(170px,1fr) auto auto;
  align-items: center;
  gap: .55rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--line);
}
.appointment-toolbar input,.appointment-toolbar select,.appointment-toolbar button { min-width: 0; min-height: 40px; }
.appointment-toolbar > input,.appointment-toolbar > select { width: 100%; }
.appointment-toolbar > button { white-space: nowrap; }
.appointment-toolbar > button[type="submit"] { background: var(--surface); color: var(--ink); }
.calendar-views { display: inline-flex; flex-wrap: wrap; gap: .25rem; padding: .2rem; border-radius: .65rem; background: var(--soft); }
.calendar-views button { min-height: 34px; padding: .4rem .55rem; border: 1px solid transparent; white-space: nowrap; background: transparent; }
.calendar-views button[aria-pressed="true"] { background: var(--accent); color: white; }
.calendar-search { display: flex; min-width: 0; gap: .3rem; }
.calendar-search input { width: 100%; }
.calendar-search button { min-width: 39px; background: var(--surface); color: var(--ink); font-size: 1.15rem; padding-inline: .35rem; }
.calendar-period { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .55rem; padding-top: .95rem; }
.calendar-period h2 { margin: 0; }
.calendar-search-summary { margin: .65rem 0 0; color: var(--muted); }
.appointment-calendar .appointment-grid--month { grid-template-columns: repeat(7,minmax(0,1fr)); }
.appointment-calendar .appointment-grid--week { grid-template-columns: repeat(7,minmax(0,1fr)); }
.appointment-calendar .appointment-day {
  position: relative;
  min-height: 0;
  padding: .75rem .6rem;
  border-radius: .68rem;
  border-top: 3px solid var(--day-tone,#afbaaf);
  background: var(--surface);
  box-shadow: 0 2px 7px #132f2310;
}
.appointment-day--light { --day-tone: #459279; }
.appointment-day--medium { --day-tone: #be7428; }
.appointment-day--full { --day-tone: #bd514d; }
.appointment-day--today { outline: 1px solid var(--accent); }
.appointment-day[data-do] { cursor: pointer; }
.appointment-day[data-do]:hover { border-color: var(--day-tone,#afbaaf); }
.appointment-calendar .day-open-target {
  min-height: 26px;
  border: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
}
.appointment-calendar .day-open-target:hover { text-decoration: underline; }
.day-heading { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .18rem; }
.appointment-calendar .day-heading h3 { font-size: .92rem; margin: 0; }
.day-heading > span { padding: .08rem .27rem; border-radius: .25rem; background: var(--soft); color: var(--ink); font-size: .7rem; }
.day-hours,.day-load,.day-empty { margin: .4rem 0; color: var(--muted); font-size: .78rem; overflow-wrap: anywhere; }
.day-load i { display: inline-block; width: .48rem; height: .48rem; margin-right: .35rem; border-radius: 50%; background: var(--day-tone); }
.day-stats { display: grid; gap: .18rem; margin: .4rem 0; }
.day-stats div { display: flex; justify-content: space-between; align-items: baseline; gap: .2rem; font-size: .75rem; }
.day-stats dt { color: var(--muted); overflow-wrap: anywhere; }
.day-stats dd { margin: 0; color: var(--ink); font-weight: 700; }
.appointment-calendar .appointment-items { position: relative; z-index: 2; display: grid; gap: .45rem; margin-top: .6rem; }
.appointment-calendar .appointment-items li {
  min-width: 0;
  padding: .5rem;
  border-radius: .45rem;
  background: var(--soft);
  overflow-wrap: anywhere;
}
.appointment-calendar .appointment-items li button { max-width: 100%; padding: .28rem .32rem; min-height: 34px; text-align: left; overflow-wrap: anywhere; }
.appointment-calendar .appointment-items strong { font-size: .82rem; }
.appointment-calendar .appointment-items .panel-note { font-size: .72rem; margin: 0; }
.appointment-status {
  width: fit-content;
  font-size: .7rem;
  font-weight: 700;
  border-radius: 999px;
  padding: .15rem .36rem;
  max-width: 100%;
  overflow-wrap: anywhere;
}
.appointment-status--requested { background: #dcecfb; color: #173e65; }
.appointment-status--confirmed { background: #e0efcd; color: #25542c; }
.appointment-status--checked-in { background: #d1f0e8; color: #11594e; }
.appointment-status--completed { background: #e6e9ed; color: #354555; }
.appointment-status--cancelled { background: #f8dedd; color: #842d2f; }
.appointment-status--no-show { background: #fae6cc; color: #763e10; }
.appointment-grid--day .day-stats { max-width: 420px; grid-template-columns: repeat(3,minmax(0,1fr)); }
.appointment-grid--day .appointment-items { grid-template-columns: repeat(auto-fit,minmax(210px,1fr)); }

dialog.structured-modal--appointment { width: min(1010px,calc(100vw - 2rem)); }
.structured-modal--appointment .shop-form { max-height: calc(100dvh - 2rem); }
.structured-modal--appointment .shop-form-body { padding: 1rem 1.4rem; }
.structured-modal--appointment .shop-form-header,.structured-modal--appointment .shop-form-footer { padding: .8rem 1.4rem; }
.appointment-editor { display: grid; grid-template-columns: 1fr 1fr; gap: .9rem 1.3rem; }
.appointment-mode-bar,.appointment-availability,.appointment-address,
.appointment-form-section[data-booking-extra],.appointment-form-section:has(textarea) { grid-column: 1 / -1; }
.appointment-mode-bar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .5rem; }
.appointment-form-section { min-width: 0; }
.appointment-form-section:has(textarea) .form-fields { grid-template-columns: 1fr; }
.appointment-form-section h3,.appointment-availability h3 { font-size: .95rem; margin: 0 0 .5rem; }
.appointment-editor .form-fields { gap: .55rem .7rem; }
.appointment-editor .form-fields textarea { min-height: 68px; }
.appointment-availability { border: 1px solid var(--line); border-radius: .65rem; background: var(--soft); padding: .65rem .8rem; min-width: 0; }
.availability-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .35rem; }
.appointment-availability h3 { margin: 0; }
.availability-heading p { margin: 0; }
.availability-heading > button { font-size: .78rem; }
.availability-slots { display: grid; grid-template-columns: repeat(6,minmax(0,1fr)); gap: .45rem; }
.availability-slots:not(:empty) { margin-top: .55rem; }
.availability-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .12rem;
  padding: .35rem .2rem;
  min-width: 0;
  min-height: 43px;
  border-radius: .4rem;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font-size: .74rem;
  overflow-wrap: anywhere;
}
.availability-slot span { color: var(--muted); }
button.availability-slot[aria-pressed="true"] { border-color: var(--accent); outline: 1px solid var(--accent); }
.availability-slot--blocked { background: var(--soft); }
.availability-slot--blocked[data-selected] { border-color: #bc6055; }
.appointment-address { border: 1px solid var(--line); border-radius: .65rem; padding: .65rem .8rem; }
.appointment-address summary { cursor: pointer; color: var(--ink); font-weight: 700; }
.appointment-address summary span { margin-inline-start: .25rem; color: var(--muted); font-weight: 400; }
.appointment-address fieldset { margin-top: .7rem; }
.appointment-address legend { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@media (min-width: 1221px) {
  .appointment-grid[data-month-start="2"] > :first-child { grid-column-start: 2; }
  .appointment-grid[data-month-start="3"] > :first-child { grid-column-start: 3; }
  .appointment-grid[data-month-start="4"] > :first-child { grid-column-start: 4; }
  .appointment-grid[data-month-start="5"] > :first-child { grid-column-start: 5; }
  .appointment-grid[data-month-start="6"] > :first-child { grid-column-start: 6; }
  .appointment-grid[data-month-start="7"] > :first-child { grid-column-start: 7; }
}

@media (max-width: 1220px) {
  .appointment-toolbar { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .appointment-calendar :is(.appointment-grid--month,.appointment-grid--week) { grid-template-columns: repeat(4,minmax(0,1fr)); }
}
@media (max-width: 790px) {
  .appointment-today { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .appointment-calendar :is(.appointment-grid--month,.appointment-grid--week) { grid-template-columns: repeat(3,minmax(0,1fr)); }
  dialog.structured-modal--appointment { width: 90vw; }
  .availability-slots { grid-template-columns: repeat(3,minmax(0,1fr)); }
}
@media (max-width: 540px) {
  .appointment-calendar { padding: .72rem; }
  .appointment-toolbar { grid-template-columns: 1fr 1fr; }
  .appointment-toolbar .calendar-search { grid-column: 1 / -1; }
  .appointment-toolbar :is(.calendar-views,#calendar-tech) { grid-column: 1 / -1; }
  .appointment-today { grid-template-columns: repeat(2,minmax(0,1fr)); gap: .42rem; }
  .appointment-today article { padding: .55rem .6rem; }
  .appointment-calendar :is(.appointment-grid--month,.appointment-grid--week) { grid-template-columns: repeat(2,minmax(0,1fr)); }
  dialog.structured-modal--appointment { width: calc(100vw - 12px); max-height: calc(100dvh - 12px); }
  .structured-modal--appointment .shop-form { max-height: calc(100dvh - 12px); }
  .structured-modal--appointment :is(.shop-form-header,.shop-form-body,.shop-form-footer) { padding: .75rem; }
  .appointment-editor { grid-template-columns: 1fr; }
  .appointment-editor .form-fields { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .appointment-form-section:has(textarea) .form-fields { grid-template-columns: 1fr; }
}
@media (max-width: 355px) {
  .appointment-calendar :is(.appointment-grid--month,.appointment-grid--week) { grid-template-columns: 1fr; }
  .appointment-editor .form-fields { grid-template-columns: 1fr; }
}

.tax-rule {
  margin: 0 0 .75rem;
  padding: .7rem;
  border: 1px solid var(--line);
  border-radius: .55rem;
  min-width: 0;
}
.tax-rule legend { font-weight: 650; }
.tax-rule > button { margin-top: .55rem; }
.tax-document-preview { display: grid; justify-items: start; gap: .55rem; }
.tax-document-preview > div { width: 100%; }

.notice-history-item {
  display: flex; justify-content: space-between; gap: .65rem;
  border-bottom: 1px solid var(--line); padding: .7rem 0; overflow-wrap: anywhere;
}
.notice-history-item p { margin: .25rem 0 0; }
.notice-history-actions { display: grid; align-content: flex-start; gap: .35rem; }
.notice-filter { display: flex; align-items: center; gap: .5rem; max-width: 22rem; margin-bottom: .5rem; }
@media (max-width: 590px) { .notice-history-item { flex-wrap: wrap; } }

.settings-tabs {
  width: fit-content;
  max-width: 100%;
  padding: .25rem;
  margin-bottom: 1.25rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.settings-tabs button { min-height: 40px; padding-inline: .8rem; font-size: .875rem; }
.settings-tabs button[aria-current="page"] { background: var(--soft); box-shadow: inset 0 -2px #65966f; }
.email-settings-layout {
  display: grid;
  grid-template-columns: minmax(150px, 208px) minmax(0, 1fr);
  align-items: start;
  gap: 1rem;
}
.email-center-nav { display: grid; gap: .3rem; margin: 0; padding: .5rem; }
.email-center-nav button { text-align: left; padding: .6rem .8rem; border: 1px solid transparent; color: var(--muted); }
.email-center-nav button[aria-current="page"] {
  background: var(--soft);
  color: var(--ink);
  border-color: var(--line);
  box-shadow: inset 3px 0 #65966f;
  font-weight: 700;
}
.email-delivery-overview {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: var(--soft);
  overflow-wrap: anywhere;
}
.email-delivery-overview h2 { font-size: 1.35rem; margin-top: .35rem; }
.email-delivery-overview p { color: var(--muted); }
.email-status {
  display: inline-block;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 1rem;
  padding: .12rem .52rem;
  font-size: .78rem;
  font-weight: 650;
  color: var(--muted);
}
.email-status[data-enabled="true"], .email-status[data-status="sent"] { color: var(--ink); border-color: #82aa8e; }
.email-status[data-status="failed"], .email-status[data-status="uncertain"] { border-color: #bc8877; }
.email-metrics { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: .75rem; margin: 0 0 1rem; }
.email-metrics .card { margin: 0; padding: 1rem; }
.email-metrics dt { color: var(--muted); font-size: .82rem; }
.email-metrics dd { margin: .15rem 0 0; font-size: 1.55rem; font-weight: 700; }
.email-activity { list-style: none; padding: 0; margin: .55rem 0 0; }
.email-activity li { display: flex; justify-content: space-between; align-items: center; gap: .75rem; padding: .65rem 0; border-top: 1px solid var(--line); }
.email-activity small { display: block; }
.email-activity-meta { color: var(--muted); }
.email-activity-meta strong { margin-left: .35rem; color: var(--ink); }
.email-log-search { display: flex; flex-wrap: wrap; gap: .5rem; margin: 0 0 1rem; align-items: end; }
.email-log-search input { min-width: min(12rem, 100%); }
@media (max-width: 900px) {
  .email-settings-layout { grid-template-columns: minmax(0,1fr); }
  .email-center-nav { grid-template-columns: repeat(auto-fit,minmax(130px,1fr)); }
}
@media (max-width: 560px) {
  .settings-tabs button { padding-inline: .5rem; font-size: .8rem; }
  .email-metrics { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .email-delivery-overview > *, .email-log-search > label { min-width: 0; }
  .email-log-search > label { width: 100%; }
}
.email-template-preview { display:block; width:100%; height:270px; border:1px solid var(--line); border-radius:.5rem; background:white }
.email-template-preview--mobile { max-width:360px }
.email-brand-logo { max-width:100px; max-height:72px; object-fit:contain }
.email-editor-tools [aria-pressed="true"], button[data-email-mode][aria-pressed="true"] { border-color:var(--accent) }

