:root {
  --bg: #050505;
  --bg-soft: #0b0b0d;
  --panel: rgba(16,16,18,.96);
  --panel-2: rgba(24,24,27,.96);
  --text: #f5f5f5;
  --muted: #a7a7ad;
  --border: #34343a;
  --silver: #d9d9de;
  --red: #f20d16;
  --red-deep: #9f0008;
  --red-soft: rgba(242,13,22,.16);
  --shadow: 0 18px 45px rgba(0,0,0,.48);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html { background: var(--bg); }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 92% 8%, rgba(242,13,22,.14), transparent 24%),
    linear-gradient(135deg, transparent 0 74%, rgba(242,13,22,.06) 74% 76%, transparent 76% 100%),
    linear-gradient(180deg, #050505 0%, #09090b 44%, #030303 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -2;
  opacity: .9;
  background:
    radial-gradient(circle at 87% 18%, rgba(255,255,255,.9) 0 1.2%, rgba(180,180,185,.45) 1.6%, rgba(40,40,44,.6) 3.2%, rgba(0,0,0,0) 4.8%),
    radial-gradient(circle at 88.3% 16.6%, rgba(255,255,255,.95) 0 .5%, rgba(255,255,255,0) 1.2%),
    linear-gradient(150deg, transparent 0 73%, rgba(255,18,29,.08) 73% 75%, transparent 75% 100%),
    linear-gradient(156deg, transparent 0 76%, rgba(255,18,29,.17) 76% 77.2%, transparent 77.2% 100%),
    linear-gradient(162deg, transparent 0 79%, rgba(163,0,8,.5) 79% 80%, transparent 80% 100%),
    repeating-linear-gradient(135deg, transparent 0 26px, rgba(255,255,255,.016) 26px 27px);
}

body::after {
  content: "";
  position: fixed;
  right: -7vw;
  bottom: 6vh;
  width: 52vw;
  height: 38vh;
  pointer-events: none;
  z-index: -1;
  opacity: .75;
  transform: skewY(-7deg) rotate(-4deg);
  background:
    linear-gradient(165deg, transparent 0 28%, rgba(255,20,30,.08) 28% 35%, transparent 35% 42%, rgba(255,20,30,.18) 42% 46%, transparent 46% 52%, rgba(120,0,8,.55) 52% 55%, transparent 55% 100%),
    repeating-linear-gradient(165deg, transparent 0 18px, rgba(255,15,25,.16) 18px 22px, transparent 22px 40px);
  filter: blur(.2px);
}

.app {
  position: relative;
  z-index: 2;
  max-width: 760px;
  margin: 0 auto;
  padding: 18px 14px 110px;
}

.hero {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  padding: 4px 4px 20px;
}

.hero::after {
  content: "";
  position: absolute;
  z-index: -1;
  right: -90px;
  top: 76px;
  width: 310px;
  height: 160px;
  pointer-events: none;
  opacity: .95;
  transform: rotate(-10deg);
  background:
    radial-gradient(circle at 67% 42%, rgba(255,255,255,.98) 0 5%, rgba(192,192,198,.9) 9%, rgba(65,65,72,.95) 15%, rgba(12,12,14,.98) 20%, transparent 21%),
    radial-gradient(circle at 64% 38%, rgba(255,255,255,.95) 0 2.5%, transparent 5%),
    linear-gradient(160deg, transparent 0 50%, rgba(255,25,35,.08) 50% 56%, rgba(255,25,35,.7) 56% 58%, transparent 58% 64%, rgba(255,25,35,.4) 64% 66%, transparent 66% 100%);
  filter: drop-shadow(0 8px 14px rgba(0,0,0,.55));
}

.brand-logo {
  display: block;
  width: 100%;
  height: auto;
  margin: 0 auto 4px;
  object-fit: contain;
  filter: drop-shadow(0 10px 18px rgba(0,0,0,.7));
}

.hero-copy {
  padding: 0 8px;
}

h1 {
  margin: 0;
  font-size: clamp(2.55rem, 8vw, 4.25rem);
  line-height: .98;
  font-weight: 900;
  font-style: italic;
  letter-spacing: -.045em;
  color: #f6f6f6;
  text-shadow: 0 2px 0 #8a8a8a, 0 8px 24px rgba(0,0,0,.55);
}

.hero-rule {
  width: 138px;
  height: 4px;
  margin: 14px 0 13px;
  border-radius: 999px;
  background: linear-gradient(90deg, #ff1722, #b40009);
  box-shadow: 0 0 16px rgba(242,13,22,.55);
}

.intro {
  margin: 0;
  color: #e2e2e5;
  font-size: .96rem;
  line-height: 1.55;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.card {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  background:
    linear-gradient(180deg, rgba(24,24,27,.97), rgba(11,11,13,.98));
  border: 1px solid #35353b;
  border-radius: 22px;
  padding: 20px;
  margin: 16px 0;
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,.04);
}

.card::before {
  content: "";
  position: absolute;
  z-index: 1;
  top: 0;
  left: 0;
  width: 4px;
  height: 72px;
  background: linear-gradient(180deg, #ff2931, #a00008);
  box-shadow: 0 0 14px rgba(242,13,22,.75);
}

.card::after {
  content: "";
  position: absolute;
  z-index: -1;
  right: -28px;
  top: -14px;
  width: 180px;
  height: 90px;
  pointer-events: none;
  opacity: .32;
  transform: rotate(-10deg);
  background:
    linear-gradient(165deg, transparent 0 38%, rgba(255,19,29,.95) 38% 40%, transparent 40% 48%, rgba(255,19,29,.48) 48% 51%, transparent 51% 59%, rgba(122,0,7,.7) 59% 61%, transparent 61% 100%);
}

.section-head h2,
.report h2 {
  margin: 0 0 5px;
  font-size: 1.18rem;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.section-head p {
  margin: 0 0 16px;
  color: var(--muted);
  line-height: 1.48;
}

label { display: block; margin-bottom: 16px; }

label span,
.field-label {
  display: block;
  margin-bottom: 8px;
  color: #f3f3f5;
  font-weight: 850;
  letter-spacing: .08em;
  text-transform: uppercase;
  font-size: .84rem;
}

input,
textarea {
  width: 100%;
  border: 1px solid #46464d;
  border-radius: 15px;
  padding: 15px 16px;
  font: inherit;
  color: var(--text);
  background: linear-gradient(180deg, #1b1b1e, #141416);
  outline: none;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.035);
  transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}

input::placeholder,
textarea::placeholder { color: #7f7f87; }

input:focus,
textarea:focus {
  border-color: #ff2630;
  box-shadow: 0 0 0 3px rgba(242,13,22,.14), 0 0 20px rgba(242,13,22,.08);
}

textarea {
  resize: vertical;
  min-height: 180px;
  line-height: 1.48;
}

button {
  border: 0;
  border-radius: 15px;
  padding: 14px 18px;
  font: inherit;
  font-weight: 850;
  cursor: pointer;
  transition: transform .12s ease, box-shadow .2s ease, filter .2s ease;
}

button:active { transform: scale(.985); }
button:disabled { opacity: .55; cursor: default; }

.primary {
  width: 100%;
  color: #fff;
  font-size: 1rem;
  letter-spacing: .09em;
  text-transform: uppercase;
  background:
    linear-gradient(135deg, #ff1a24 0%, #ec0913 45%, #a70009 100%);
  border: 1px solid #ff3d45;
  box-shadow:
    0 10px 26px rgba(205,0,11,.34),
    inset 0 1px 0 rgba(255,255,255,.32);
}

.primary:hover { filter: brightness(1.08); }

.secondary {
  color: #f3f3f5;
  background: linear-gradient(180deg, #242428, #171719);
  border: 1px solid #44444b;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04);
}

.secondary:hover { border-color: #66666e; }

.photo-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 14px;
}

.helper,
.status {
  font-size: .92rem;
  color: var(--muted);
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.photo-item {
  position: relative;
  overflow: hidden;
  min-height: 130px;
  border-radius: 15px;
  background: #101012;
  border: 1px solid #35353a;
}

.photo-item img {
  display: block;
  width: 100%;
  height: 130px;
  object-fit: cover;
}

.remove-photo {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 8px 10px;
  border-radius: 999px;
  color: #fff;
  background: rgba(5,5,5,.9);
  border: 1px solid rgba(255,255,255,.12);
  font-size: .82rem;
}

.speech-row {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 14px;
}

.speech-btn.recording {
  color: #fff;
  background: linear-gradient(135deg, #ff1a24, #a70009);
  border-color: #ff3942;
  box-shadow: 0 0 22px rgba(242,13,22,.26);
}

.sticky-action {
  position: sticky;
  bottom: 12px;
  z-index: 10;
  display: grid;
  gap: 8px;
  padding-top: 6px;
}

.sticky-action .new-entry {
  width: 100%;
  min-height: 48px;
}

.sticky-action .primary {
  min-height: 58px;
  font-size: 1.05rem;
  box-shadow:
    0 14px 32px rgba(196,0,10,.46),
    0 0 0 1px rgba(255,255,255,.08) inset;
}

.customer-results,
.machine-results,
.job-results {
  display: grid;
  gap: 8px;
  margin: -6px 0 16px;
}

.customer-result,
.machine-result,
.job-result {
  width: 100%;
  text-align: left;
  color: var(--text);
  background: #151517;
  border: 1px solid #3d3d43;
  padding: 12px 14px;
}

.customer-result:hover,
.machine-result:hover,
.job-result:hover {
  border-color: #6b6b73;
}

.customer-result strong,
.customer-result span,
.machine-result strong,
.machine-result span,
.job-result strong,
.job-result span,
.selected-customer strong,
.selected-customer span,
.selected-machine strong,
.selected-machine span,
.selected-job strong,
.selected-job span {
  display: block;
}

.customer-result span,
.machine-result span,
.job-result span,
.selected-customer span,
.selected-machine span,
.selected-job span {
  margin-top: 4px;
  color: var(--muted);
  font-size: .9rem;
}

.customer-result.new-customer,
.machine-result.new-machine,
.job-result.new-job {
  background: rgba(242,13,22,.07);
  border: 1px dashed #8d2026;
}

.selected-customer,
.selected-machine,
.selected-job,
.review-identity {
  margin: -6px 0 16px;
  padding: 13px 14px;
  border: 1px solid #6d2226;
  border-radius: 15px;
  background: linear-gradient(180deg, rgba(242,13,22,.09), rgba(242,13,22,.035));
}

.link-button {
  margin-top: 8px;
  padding: 0;
  color: #ff454d;
  background: transparent;
  text-decoration: underline;
}

.job-section { margin-top: 8px; }

.field-label { margin: 18px 0 8px; }

.report pre,
.review pre {
  white-space: pre-wrap;
  word-break: break-word;
  overflow: auto;
  padding: 15px;
  border: 1px solid #36363b;
  border-radius: 15px;
  color: #e8e8eb;
  background: #0f0f11;
}

.review-identity {
  display: grid;
  gap: 6px;
  margin: 0 0 18px;
}

.check-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin: 12px 0;
}

.check-row input {
  width: 19px;
  height: 19px;
  margin-top: 2px;
  accent-color: var(--red);
}

.check-row span {
  margin: 0;
  color: var(--text);
  font-weight: 650;
  letter-spacing: 0;
  text-transform: none;
  font-size: .95rem;
}

@media (min-width: 640px) {
  .app { padding-top: 24px; }
  .photo-actions { flex-direction: row; align-items: center; justify-content: space-between; }
  .speech-row { flex-direction: row; align-items: center; }
  .photo-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 430px) {
  .app { padding-left: 10px; padding-right: 10px; }
  .card { padding: 17px; border-radius: 19px; }
  h1 { font-size: 2.8rem; }
  .intro { font-size: .82rem; letter-spacing: .095em; }
}


.machine-result-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
}

.machine-status {
  flex: 0 0 auto;
  border: 1px solid currentColor;
  border-radius: 999px;
  padding: 0.15rem 0.45rem;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  line-height: 1.2;
}

.machine-status-active {
  color: #15803d;
  background: #dcfce7;
  border-color: #16a34a;
  opacity: 1;
}

.machine-status-closed,
.machine-status-unknown {
  opacity: 0.62;
}


.auth-gate {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
}

.auth-card {
  width: min(100%, 420px);
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(24,24,27,.98), rgba(11,11,13,.99));
  box-shadow: var(--shadow);
  text-align: center;
}

.auth-logo {
  width: 100%;
  max-width: 320px;
  margin-bottom: 16px;
}

.auth-card h1 {
  margin-bottom: 14px;
}

.auth-card p {
  color: var(--muted);
  margin: 0 0 20px;
}

.session-bar {
  display: flex;
  justify-content: flex-end;
  min-height: 24px;
}


.auth-gate[hidden],
#appRoot[hidden] {
  display: none !important;
}
