/* Tool Tags: auto-shop garage. Diamond-plate header, hazard stripes, stained concrete floor,
   shop-red buttons, and brushed-aluminum tags. Big targets for greasy fingers. */

:root {
  --concrete: #1d1f22;
  --concrete-2: #26292d;
  --plate: #3a3e43;
  --steel-hi: #e3e6e9;
  --steel: #b9bfc5;
  --steel-lo: #8a9198;
  --ink: #eceae6;
  --ink-dim: #a7a49d;
  --stamp: #23262a;
  --red: #c8202f;
  --red-hi: #e23a48;
  --yellow: #f0b81c;
  --line: #3b3f45;
  --radius: 10px;
  --head: "Oswald", "Arial Narrow", "Helvetica Neue", sans-serif;
  --body: "Barlow", "Helvetica Neue", Arial, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font: 17px/1.5 var(--body);
  background-color: var(--concrete);
  /* concrete floor with a few old oil stains */
  background-image:
    radial-gradient(ellipse 340px 220px at 12% 38%, rgba(0, 0, 0, 0.32), transparent 70%),
    radial-gradient(ellipse 260px 170px at 86% 72%, rgba(0, 0, 0, 0.28), transparent 70%),
    radial-gradient(ellipse 180px 120px at 64% 18%, rgba(30, 20, 10, 0.25), transparent 70%),
    radial-gradient(circle at 50% 0, var(--concrete-2), var(--concrete) 70%);
  background-attachment: fixed;
}

a { color: var(--yellow); }
a:hover { color: #ffd257; }

h1, h2 {
  font-family: var(--head);
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  line-height: 1.15;
  margin: 0 0 0.4em;
}
h1 { font-size: clamp(1.7rem, 5vw, 2.4rem); }
h2 { font-size: 1.35rem; }

.wrap { width: 100%; max-width: 980px; margin: 0 auto; padding: 0 16px; }

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

/* ---------- Header ---------- */

.masthead {
  position: sticky;
  top: 0;
  z-index: 20;
  background-color: var(--plate);
  /* diamond plate */
  background-image:
    linear-gradient(135deg, rgba(255, 255, 255, 0.09) 22%, transparent 22%),
    linear-gradient(225deg, rgba(255, 255, 255, 0.09) 22%, transparent 22%),
    linear-gradient(315deg, rgba(0, 0, 0, 0.28) 22%, transparent 22%),
    linear-gradient(45deg, rgba(0, 0, 0, 0.28) 22%, transparent 22%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(0, 0, 0, 0.25));
  background-size: 14px 14px, 14px 14px, 14px 14px, 14px 14px, 100% 100%;
  background-position: 0 0, 7px 0, 7px 7px, 0 7px, 0 0;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
}

.mast-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 64px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--head);
  font-weight: 700;
  font-size: 1.5rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--steel-hi);
  text-decoration: none;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.6);
  white-space: nowrap;
}
.brand:hover { color: #fff; }

.brand-tag {
  width: 22px;
  height: 28px;
  background: linear-gradient(160deg, var(--steel-hi), var(--steel-lo));
  clip-path: polygon(25% 0, 75% 0, 100% 18%, 100% 100%, 0 100%, 0 18%);
  position: relative;
}
.brand-tag::after {
  content: "";
  position: absolute;
  top: 5px;
  left: 50%;
  width: 6px;
  height: 6px;
  margin-left: -3px;
  border-radius: 50%;
  background: var(--plate);
}

.mast-actions { display: flex; align-items: center; gap: 10px; }

.back { color: var(--steel-hi); font-weight: 600; text-decoration: none; white-space: nowrap; }
.back:hover { color: #fff; text-decoration: underline; }

.hazard {
  height: 8px;
  background: repeating-linear-gradient(-45deg, var(--yellow) 0 14px, #111 14px 28px);
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 18px;
  border: 0;
  border-radius: var(--radius);
  font: 600 1rem/1 var(--head);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}
.btn:disabled { opacity: 0.55; cursor: progress; }
.btn:focus-visible, button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible {
  outline: 3px solid var(--yellow);
  outline-offset: 2px;
}

.btn-red {
  color: #fff;
  background: linear-gradient(180deg, var(--red-hi), var(--red));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 3px 0 #7c0f19, 0 5px 10px rgba(0, 0, 0, 0.35);
}
.btn-red:hover { color: #fff; filter: brightness(1.08); }
.btn-red:active { transform: translateY(2px); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 0 #7c0f19; }

.btn-steel {
  color: var(--stamp);
  background: linear-gradient(180deg, var(--steel-hi), var(--steel));
  box-shadow: inset 0 1px 0 #fff, 0 3px 0 #5d636a, 0 5px 10px rgba(0, 0, 0, 0.3);
}
.btn-steel:hover { color: #000; filter: brightness(1.05); }
.btn-steel:active { transform: translateY(2px); box-shadow: 0 1px 0 #5d636a; }

.btn-ghost { color: var(--ink); background: transparent; border: 2px solid var(--line); }
.danger { color: #ff8d95 !important; }
.btn-ghost.danger:hover { border-color: #ff8d95; }

.icon-btn {
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink-dim);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
}
.icon-btn:hover { color: #ff8d95; background: rgba(255, 255, 255, 0.05); }

/* ---------- Account menu ---------- */

.account { position: relative; }
.account summary { list-style: none; }
.account summary::-webkit-details-marker { display: none; }
.account-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: min(280px, calc(100vw - 32px));
  padding: 8px;
  background: var(--concrete-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.55);
}
.account-email { margin: 6px 10px 10px; color: var(--ink-dim); font-size: 0.9rem; overflow-wrap: anywhere; }
.account-menu button {
  display: block;
  width: 100%;
  min-height: 44px;
  padding: 0 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  font: 600 1rem var(--body);
  text-align: left;
  cursor: pointer;
}
.account-menu button:hover { background: rgba(255, 255, 255, 0.07); }

/* ---------- Main ---------- */

main.wrap { padding-top: 36px; padding-bottom: 120px; min-height: 60vh; }

.status { color: var(--ink-dim); }
.status.error { color: #ff8d95; }

.crumb { display: inline-block; margin-bottom: 14px; font-weight: 600; text-decoration: none; }

.actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 16px 0 22px; }

/* Sign-in landing */
.hero { max-width: 640px; }
.lede { font-size: 1.15rem; color: var(--ink-dim); }
.gsi-slot { min-height: 54px; margin: 26px 0 30px; }
.gsi-slot { width: fit-content; border-radius: 999px; }
.gsi-slot.pulse { animation: pulse 1.4s ease-out 2; }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(240, 184, 28, 0.9); }
  100% { box-shadow: 0 0 0 18px rgba(240, 184, 28, 0); }
}
.nudge { margin: 18px 0 -12px; color: var(--yellow); font-weight: 600; }
.first-tag { margin-top: 22px; }
.gsi-slot iframe { color-scheme: light; } /* keeps Google's button from getting an opaque backdrop on a dark page */
.steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; counter-reset: step; }
.steps li {
  counter-increment: step;
  position: relative;
  padding: 14px 16px 14px 62px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.steps li::before {
  content: counter(step);
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--yellow);
  color: #111;
  font: 700 1.1rem var(--head);
}
.steps strong { font-family: var(--head); letter-spacing: 0.04em; text-transform: uppercase; }

/* Dashboard */
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar h1 { margin: 0; }

.search {
  width: 100%;
  min-height: 52px;
  padding: 0 16px;
  margin-bottom: 20px;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  background: #141618;
  color: var(--ink);
  font: 1.05rem var(--body);
}
.search::placeholder { color: #77746e; }

.results { margin-bottom: 24px; }
.results-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.results-list a {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 16px;
  padding: 12px 16px;
  min-height: 52px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  color: var(--ink);
  text-decoration: none;
}
.results-list a:hover { border-color: var(--yellow); }
.r-tag { color: var(--ink-dim); }
.r-tag strong { color: var(--yellow); }

.tag-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 18px; }

/* Brushed-aluminum tag */
.tag-card, .plate {
  position: relative;
  border-radius: 12px;
  color: var(--stamp);
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.07) 0 1px, transparent 1px 3px),
    linear-gradient(160deg, var(--steel-hi), var(--steel) 55%, var(--steel-lo));
  box-shadow: inset 0 1px 0 #fff, inset 0 -2px 0 rgba(0, 0, 0, 0.2), 0 6px 14px rgba(0, 0, 0, 0.45);
}
.tag-card { display: flex; flex-direction: column; transition: transform 0.12s ease; }
.tag-card:hover { transform: translateY(-2px) rotate(-0.4deg); }

.hole {
  display: block;
  width: 16px;
  height: 16px;
  margin: 0 auto 10px;
  border-radius: 50%;
  background: var(--concrete);
  box-shadow: inset 0 2px 3px rgba(0, 0, 0, 0.8), 0 1px 0 rgba(255, 255, 255, 0.6);
}

.tag-link { display: flex; flex-direction: column; flex: 1; padding: 14px 16px 10px; color: inherit; text-decoration: none; }
.tag-link:hover { color: inherit; }
.tag-name {
  font: 700 1.2rem/1.2 var(--head);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.7);
  overflow-wrap: anywhere;
}
.tag-count { margin-top: 6px; font-weight: 600; color: #4c5157; }

.pick {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 16px 6px;
  font: 600 0.85rem var(--head);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #4c5157;
  cursor: pointer;
}
.pick input { width: 22px; height: 22px; accent-color: var(--red); }

.empty {
  padding: 34px 20px;
  text-align: center;
  border: 2px dashed var(--line);
  border-radius: var(--radius);
  grid-column: 1 / -1;
}

.print-bar {
  position: fixed;
  left: 50%;
  bottom: 16px;
  z-index: 15;
  transform: translateX(-50%);
  width: min(720px, calc(100% - 32px));
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  background: #111315;
  border: 2px solid var(--yellow);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
}
.print-bar[hidden] { display: none; }
.print-count { flex: 1 1 auto; font: 600 1rem var(--head); letter-spacing: 0.05em; text-transform: uppercase; }
.print-bar select {
  min-height: 48px;
  padding: 0 10px;
  border-radius: var(--radius);
  border: 2px solid var(--line);
  background: #1b1d20;
  color: var(--ink);
  font: 1rem var(--body);
}

/* Tool lists */
.tools { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.tools li, .r-tool { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.tools li {
  padding: 12px 16px;
  min-height: 52px;
  background: rgba(255, 255, 255, 0.04);
  border-left: 4px solid var(--red);
  border-radius: 6px;
}
.t-name { font-weight: 600; font-size: 1.05rem; overflow-wrap: anywhere; }
.qty {
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--yellow);
  color: #111;
  font: 700 0.85rem var(--head);
  letter-spacing: 0.04em;
}
.note { flex-basis: 100%; color: var(--ink-dim); font-size: 0.95rem; overflow-wrap: anywhere; }

/* One tag */
.tag-page { display: grid; grid-template-columns: minmax(0, 300px) minmax(0, 1fr); gap: 32px; align-items: start; }
.tag-side h1 { overflow-wrap: anywhere; margin-bottom: 2px; }
.label-preview .label { box-shadow: 0 10px 24px rgba(0, 0, 0, 0.5); border-radius: 8px; }

/* Editor */
.editor { max-width: 760px; }
.field-label { display: block; margin: 0 0 6px; font: 600 1rem var(--head); letter-spacing: 0.06em; text-transform: uppercase; }
.field-label .muted { font: 400 0.9rem var(--body); text-transform: none; letter-spacing: 0; }
.editor input {
  width: 100%;
  min-height: 48px;
  padding: 0 12px;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: #141618;
  color: var(--ink);
  font: 1rem var(--body);
}
.editor .name-input { font: 700 1.2rem var(--head); letter-spacing: 0.04em; margin-bottom: 26px; }
.rows-head { display: flex; justify-content: space-between; align-items: baseline; }
.counter { color: var(--ink-dim); font-size: 0.9rem; }
.row-labels, .tool-row { display: grid; grid-template-columns: minmax(0, 2fr) 76px minmax(0, 2fr) 44px; gap: 8px; }
.row-labels { padding: 0 0 4px; color: var(--ink-dim); font-size: 0.85rem; }
.tool-rows { list-style: none; padding: 0; margin: 0 0 12px; display: grid; gap: 8px; }
.add-row { margin-bottom: 8px; }
.editor-actions { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.editor-actions .danger { margin-left: auto; }

/* Public scan view */
.public { max-width: 680px; }
.plate { padding: 16px 20px 20px; margin-bottom: 18px; text-align: center; }
.plate h1 { margin: 0; overflow-wrap: anywhere; text-shadow: 0 1px 0 rgba(255, 255, 255, 0.7); }
.plate .muted { color: #4c5157; margin: 4px 0 0; font-weight: 600; }
.eyebrow { margin: 0 0 4px; font: 600 0.85rem var(--head); letter-spacing: 0.14em; text-transform: uppercase; color: #4c5157; }
.public > .tools { margin-top: 18px; }
.lookup { margin-top: 36px; padding-top: 22px; border-top: 4px solid; border-image: repeating-linear-gradient(-45deg, var(--yellow) 0 10px, #111 10px 20px) 4; }
.lookup p { color: var(--ink-dim); margin-top: 0; }
.own { margin-top: 40px; color: var(--ink-dim); }

/* ---------- Printed label ---------- */

.label {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: #fff;
  color: #000;
  text-align: center;
  font-family: var(--head);
}
.label .qr { display: block; width: 100%; height: auto; }
.label-name {
  margin: 0;
  width: 100%;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}
.label-foot { margin: 0; color: #444; letter-spacing: 0.08em; text-transform: uppercase; }

.size-preview { padding: 18px 18px 14px; }
.size-preview .label-name { font-size: 1.35rem; }
.size-preview .label-foot { font-size: 0.75rem; }

.print-area { display: none; }

/* ---------- Footer, scanner, toast ---------- */

.footer { padding-top: 24px; padding-bottom: 40px; border-top: 1px solid var(--line); color: var(--ink-dim); font-size: 0.92rem; }

.scanner {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(8, 9, 10, 0.88);
}
.scanner[hidden] { display: none; }
.scanner-box {
  width: min(460px, 100%);
  padding: 18px;
  text-align: center;
  background: var(--concrete-2);
  border: 2px solid var(--yellow);
  border-radius: 16px;
}
.viewfinder { position: relative; aspect-ratio: 1; overflow: hidden; border-radius: 10px; background: #000; }
.viewfinder video { width: 100%; height: 100%; object-fit: cover; }
.reticle {
  position: absolute;
  inset: 16%;
  border: 3px solid rgba(240, 184, 28, 0.9);
  border-radius: 12px;
  box-shadow: 0 0 0 999px rgba(0, 0, 0, 0.35);
}
.scanner-msg { min-height: 3em; color: var(--ink-dim); }

.toast {
  position: fixed;
  left: 50%;
  top: 84px;
  z-index: 60;
  transform: translateX(-50%);
  max-width: calc(100% - 32px);
  padding: 12px 18px;
  border-radius: var(--radius);
  background: #111315;
  border: 2px solid var(--yellow);
  color: var(--ink);
  font-weight: 600;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.5);
  overflow-wrap: anywhere;
}
.toast[hidden] { display: none; }

/* ---------- Small screens ---------- */

@media (max-width: 680px) {
  .tag-page { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .label-preview { max-width: 300px; }
  .row-labels { display: none; }
  .tool-row {
    grid-template-columns: minmax(0, 1fr) 72px 44px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 10px;
  }
  .tool-row .f-note { grid-column: 1 / 3; grid-row: 2; }
  .tool-row .icon-btn { grid-column: 3; grid-row: 1; }
}

@media (max-width: 520px) {
  .brand { font-size: 1.2rem; }
  .brand-tag { display: none; }
  .back .long { display: none; }
  .btn { padding: 0 14px; }
  .mast-actions { gap: 8px; }
}

/* ---------- Print: only the labels ---------- */

@media print {
  @page { margin: 0.4in; }
  body { background: #fff !important; min-height: 0; }
  body > *:not(.print-area) { display: none !important; }
  .print-area { display: flex; flex-wrap: wrap; gap: 0; align-content: flex-start; }
  .label {
    break-inside: avoid;
    page-break-inside: avoid;
    border: 1px dashed #bbb; /* cut line */
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }
  .size-s { width: 1.9in; padding: 0.12in; }
  .size-s .label-name { font-size: 9pt; margin-bottom: 0.03in; }
  .size-s .label-foot { font-size: 5.5pt; }
  .size-m { width: 2.6in; padding: 0.16in; }
  .size-m .label-name { font-size: 12pt; margin-bottom: 0.04in; }
  .size-m .label-foot { font-size: 6.5pt; }
  .size-l { width: 3.6in; padding: 0.2in; }
  .size-l .label-name { font-size: 16pt; margin-bottom: 0.05in; }
  .size-l .label-foot { font-size: 8pt; }
  .size-xl { width: 6in; margin: 0.4in auto 0; padding: 0.35in; border-style: solid; }
  .size-xl .label-name { font-size: 30pt; margin-bottom: 0.08in; }
  .size-xl .label-foot { font-size: 11pt; }
}

/* ---------- Privacy page ---------- */

.legal { max-width: 760px; }
.legal h2 { margin-top: 1.6em; }
.legal li { margin-bottom: 0.6em; }

.tip {
  margin: -6px 0 22px;
  padding: 12px 16px;
  border-left: 4px solid var(--yellow);
  border-radius: 6px;
  background: rgba(240, 184, 28, 0.08);
  color: var(--ink);
}
.tip strong { display: block; color: var(--yellow); font-family: var(--head); letter-spacing: 0.04em; text-transform: uppercase; }
