:root {
  color-scheme: light;
  --ink: #193f35;
  --muted: #566b62;
  --line: #c7d4cc;
  --surface: #fff;
  --canvas: #f1f5f2;
  font-family: system-ui, sans-serif;
  color: var(--ink);
  background: var(--canvas);
  font-size: 16px;
  line-height: 1.45;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
h1, h2, h3, p { margin: 0; }
h1 { font: 400 clamp(2rem, 5vw, 3rem)/1.1 Georgia, serif; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.125rem; line-height: 1.3; overflow-wrap: anywhere; }
a { color: inherit; }
button, .button, input, textarea, select { font: inherit; }
button, .button, input, textarea, select {
  border: 1px solid var(--line);
  border-radius: .4rem;
  background: var(--surface);
  color: var(--ink);
}
input:not([type=checkbox]), textarea, select { min-height: 46px; padding: .55rem .7rem; width: 100%; }
input[type=checkbox] { width: 1.25rem; height: 1.25rem; flex: 0 0 auto; }
select { appearance: none; padding-right: 2rem; background: linear-gradient(45deg, transparent 50%, currentColor 50%) right 16px center / 5px 5px no-repeat, linear-gradient(135deg, currentColor 50%, transparent 50%) right 11px center / 5px 5px no-repeat var(--surface); }
button, .button {
  min-height: 44px;
  padding: .44rem .8rem;
  cursor: pointer;
  font-size: .9rem;
  font-weight: 650;
}
button:hover, .button:hover { background: #e6efe9; }
button:disabled { cursor: wait; opacity: .7; }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 3px solid #95623b;
  outline-offset: 2px;
}
.button { display: inline-flex; align-items: center; text-decoration: none; }
.primary { color: #fff; background: var(--ink); border-color: var(--ink); }
.primary:hover { background: #2a594b; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); }
.muted { color: var(--muted); }
.error { color: #8e2422; }
.saved { padding: .55rem .75rem; border-radius: .4rem; background: #deeee2; }
.wrap { width: min(100% - 2rem, 68rem); margin-inline: auto; }
.tech-header { background: var(--surface); border-bottom: 1px solid var(--line); }
.header-row, .page-heading, .header-actions, .sheet-header, .part-heading, .part-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .65rem;
}
.header-row { min-height: 70px; }
.tech-brand { display: inline-flex; align-items: center; gap: .5rem; text-decoration: none; font-weight: 700; }
.tech-brand img { object-fit: contain; flex: 0 0 auto; }
#account-name { font-size: .875rem; }
main.wrap { padding-block: 1.8rem 3rem; display: grid; gap: .9rem; }
#views { display: flex; flex-wrap: wrap; gap: .4rem; }
#views [aria-pressed=true] { background: #dfede4; border-color: #769b86; }
.search-row { display: flex; gap: .5rem; }
.search-label { flex: 1; min-width: 0; }
#search { min-height: 48px; }
#result-summary { font-size: .9rem; }
.parts { list-style: none; padding: 0; margin: 0; display: grid; gap: .7rem; }
.part {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr) minmax(0, .8fr);
  align-items: start;
  gap: .75rem 1.2rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: .65rem;
  padding: 1rem 1.15rem .8rem;
}
.part-heading { align-items: flex-start; }
.part-id, .models, .order-detail { color: var(--muted); overflow-wrap: anywhere; }
.part-id { margin-top: .2rem; font-size: .9rem; }
.models { margin-top: .35rem; }
.part strong { font-weight: 700; }
.status {
  display: inline-block;
  width: fit-content;
  padding: .2rem .55rem;
  border-radius: .35rem;
  font-size: .875rem;
  font-weight: 700;
  white-space: nowrap;
}
.status.in-stock { color: #164d36; background: #e2f0e7; }
.status.low-stock { color: #664100; background: #fff0c8; }
.status.out-of-stock { color: #8e2422; background: #fbe4e2; }
.available-line { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem .6rem; }
.locations { margin: .35rem 0 0; padding: 0; list-style: none; }
.locations li { margin-top: .2rem; overflow-wrap: anywhere; }
.order-detail { margin-top: .23rem; }
.part-actions { grid-column: 1 / -1; justify-content: flex-start; flex-wrap: wrap; border-top: 1px solid #e1e8e3; padding-top: .55rem; gap: .4rem; }
dialog { padding: 0; width: min(37rem, calc(100% - 2rem)); max-height: min(90dvh, 60rem); border: 1px solid var(--line); border-radius: .7rem; color: var(--ink); background: var(--surface); }
dialog::backdrop { background: #0b201caf; }
.sheet { display: grid; gap: .85rem; padding: 1rem; }
.sheet-header h2 { min-width: 0; overflow-wrap: anywhere; }
.sheet form, .login form { display: grid; gap: .75rem; }
form label { display: grid; gap: .3rem; font-size: .95rem; font-weight: 650; }
.check { display: flex; align-items: center; min-height: 44px; gap: .5rem; }
.check span { font-size: 1rem; }
.field-pair { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
.stock-preview { background: var(--canvas); border-radius: .4rem; padding: .6rem .7rem; }
.action-row { display: flex; gap: .4rem; flex-wrap: wrap; }
.action-row [aria-pressed=true] { border-color: #769b86; background: #dfede4; }
.history { list-style: none; margin: 0 0 .6rem; padding: 0; }
.history li { padding: .7rem 0; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.history .muted { font-size: .875rem; }
#editor-content:empty, #editor-form:empty { display: none; }
#editor-content p, #editor-content label { margin-bottom: .65rem; }
.login { min-height: 100dvh; display: grid; place-items: start center; padding: clamp(2rem, 12vh, 8rem) 1rem 2rem; }
.login-card { width: min(100%, 27rem); display: grid; gap: 1rem; border: 1px solid var(--line); border-radius: .7rem; background: var(--surface); padding: 1.4rem; }
.login-card > .button { justify-self: start; }
.account-link { width: fit-content; min-height: 44px; display: flex; align-items: center; }

@media (max-width: 720px) {
  .part { grid-template-columns: 1fr; padding: .85rem; gap: .7rem; }
  .part-order { display: flex; flex-wrap: wrap; align-items: baseline; gap: .25rem .55rem; }
  .part-order p { margin: 0; }
  .part-actions .primary { flex: 1 1 auto; }
  main.wrap { padding-top: 1.2rem; }
}
@media (max-width: 440px) {
  #account-name { display: none; }
  dialog { width: 100%; max-width: 100%; margin: auto 0 0; border-radius: .7rem .7rem 0 0; }
  .sheet { padding-bottom: max(1rem, env(safe-area-inset-bottom)); }
  .field-pair { grid-template-columns: 1fr; }
}

.catalog-tabs {display:flex;flex-wrap:wrap;gap:.4rem}
.catalog-tabs [aria-pressed=true] {background:var(--ink);color:white}
.catalog-group {list-style:none}
.catalog-group summary {font-weight:700;padding:.8rem .25rem;cursor:pointer}
.stock-switch {display:inline-flex;align-items:center;gap:.5rem;min-height:44px;font-size:.9rem}
.stock-switch input {appearance:none;width:2.4rem;height:1.4rem;border-radius:1rem;background:#ddd;display:grid;align-items:center;padding:.1rem;cursor:pointer}
.stock-switch input::before {content:'';width:.95rem;height:.95rem;border-radius:50%;background:white;border:1px solid #78897e}
.stock-switch input:checked {background:var(--ink)}
.stock-switch input:checked::before {justify-self:end}
#editor-content label {display:grid;gap:.3rem}
.qty-control {display:flex;gap:.4rem;align-items:center}
.qty-control input {width:5rem;text-align:center}
#order-bar {margin:1rem 0}
.order-email {white-space:pre-wrap;overflow-wrap:anywhere;font:inherit}
