:root {
  color-scheme: light;
  --violet: #b23fe0;
  --indigo: #3b4ce0;
  --cyan: #22d3ee;
  --ink: #17152b;
  --ink-soft: #57536c;
  --surface: #ffffff;
  --canvas: #f4f5fb;
  --line: #e5e6f0;
  --success: #0f9f78;
  --success-dark: #08795b;
  --warning: #c87519;
  --danger: #c43b64;
  /* Cor solida (12/08, pedido do Fernando: "nao quero degrade", achou
     cara de template generico). Mantem o nome da variavel "--gradient"
     pra nao precisar tocar cada um dos 11+ lugares que a usam - o
     valor agora e' solido, so' isso muda. Indigo profundo, um tom so',
     sem efeito arco-iris. */
  --gradient: #352c86;
  --shadow-sm: 0 6px 18px rgba(40, 34, 88, 0.08);
  --shadow-md: 0 16px 44px rgba(48, 37, 108, 0.14);
  --radius-sm: 12px;
  --radius-md: 20px;
  --radius-lg: 28px;
  --font-ui: "Fira Sans", "Inter", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", "Cascadia Code", "SFMono-Regular", Consolas, monospace;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--canvas);
  -webkit-text-size-adjust: 100%;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  background: var(--canvas);
  font-family: var(--font-ui);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
input,
textarea {
  font: inherit;
}

button {
  color: inherit;
}

button,
a,
input,
textarea {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(34, 211, 238, 0.65);
  outline-offset: 3px;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

.skip-link {
  position: fixed;
  z-index: 999;
  top: 10px;
  left: 10px;
  padding: 10px 14px;
  transform: translateY(-150%);
  border-radius: 10px;
  color: #fff;
  background: var(--ink);
}

.skip-link:focus {
  transform: translateY(0);
}

.icon {
  width: 1.2em;
  height: 1.2em;
  flex: 0 0 auto;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.brand-mark {
  display: inline-grid;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 14px;
  color: #fff;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.24), rgba(255, 255, 255, 0.06));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28), 0 10px 26px rgba(20, 15, 66, 0.18);
}

.brand-mark .icon {
  width: 25px;
  height: 25px;
}

.brand-mark__img {
  width: 30px;
  height: 30px;
  object-fit: contain;
}

.eyebrow {
  display: block;
  margin-bottom: 7px;
  color: var(--indigo);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.eyebrow--light {
  color: rgba(255, 255, 255, 0.74);
}

.button {
  min-height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 13px 18px;
  border: 0;
  border-radius: 16px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, opacity 160ms ease;
}

.button:active:not(:disabled) {
  transform: scale(0.98);
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

.button--wide {
  width: 100%;
}

.button--primary {
  color: #fff;
  background: var(--gradient);
  box-shadow: 0 12px 26px rgba(59, 76, 224, 0.25);
}

.button--secondary {
  color: var(--indigo);
  background: #eef0ff;
  border: 1px solid #daddff;
}

.button--ghost {
  color: var(--ink-soft);
  background: #f1f2f8;
}

.icon-button {
  width: 46px;
  height: 46px;
  display: inline-grid;
  flex: 0 0 auto;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 15px;
  background: transparent;
  cursor: pointer;
}

.icon-button .icon {
  width: 23px;
  height: 23px;
}

.icon-button--on-dark {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.is-spinning .icon,
.sync-chip--syncing .icon {
  animation: spin 1.1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.splash-screen,
.fatal-error {
  min-height: 100vh;
  display: grid;
  place-content: center;
  justify-items: center;
  padding: 28px;
  text-align: center;
}

.splash-screen {
  color: #fff;
  background: #18142d;
}

.splash-screen p {
  margin: 26px 0 0;
  color: rgba(255, 255, 255, 0.74);
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.splash-orbit {
  position: relative;
  width: 150px;
  height: 150px;
  display: grid;
  place-items: center;
}

.brand-mark-full {
  display: block;
  width: auto;
  height: 108px;
  object-fit: contain;
}

.splash-orbit .brand-mark-full {
  height: 76px;
}

.splash-orbit > span {
  position: absolute;
  inset: 0;
  border: 2px solid rgba(255, 255, 255, 0.12);
  border-top-color: var(--cyan);
  border-radius: 50%;
  animation: spin 1.5s linear infinite;
}

.login-screen {
  position: relative;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: max(28px, env(safe-area-inset-top)) 22px max(22px, env(safe-area-inset-bottom));
  color: #fff;
  background: #18142d;
}

.login-screen::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.2;
  background-image: linear-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.06) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: linear-gradient(to bottom, #000, transparent 70%);
}

.login-screen__glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(6px);
  pointer-events: none;
}

.login-screen__glow--one {
  width: 300px;
  height: 300px;
  top: -150px;
  right: -110px;
  background: rgba(178, 63, 224, 0.34);
}

.login-screen__glow--two {
  width: 250px;
  height: 250px;
  left: -140px;
  bottom: 80px;
  background: rgba(34, 211, 238, 0.2);
}

.login-brand,
.login-card,
.login-footer {
  position: relative;
  z-index: 1;
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.login-brand b {
  color: var(--cyan);
}

.login-card {
  width: 100%;
  max-width: 460px;
  margin: auto;
  padding: 38px 0 12px;
}

.login-card h1 {
  margin-bottom: 18px;
  font-size: clamp(2.15rem, 10vw, 3.3rem);
  line-height: 1.02;
  letter-spacing: -0.045em;
}

.login-card h1 em {
  color: transparent;
  background: var(--gradient);
  background-clip: text;
  font-style: normal;
}

.login-card > p {
  max-width: 38ch;
  margin-bottom: 30px;
  color: rgba(255, 255, 255, 0.65);
  font-size: 1rem;
  line-height: 1.55;
}

.login-form label {
  display: block;
  margin-bottom: 8px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.code-input-wrap {
  height: 60px;
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 13px;
  padding: 0 17px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07);
}

.code-input-wrap:focus-within {
  border-color: rgba(34, 211, 238, 0.65);
  box-shadow: 0 0 0 4px rgba(34, 211, 238, 0.11);
}

.code-input-wrap span {
  color: var(--cyan);
  font-family: var(--font-mono);
  font-size: 1.1rem;
  font-weight: 800;
}

.code-input-wrap input {
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  outline: 0;
  color: #fff;
  background: transparent;
  font-family: var(--font-mono);
  font-size: 1rem;
  letter-spacing: 0.08em;
}

.code-input-wrap input::placeholder {
  color: rgba(255, 255, 255, 0.36);
  letter-spacing: 0;
}

.trust-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 20px;
  color: rgba(255, 255, 255, 0.48);
  font-size: 0.76rem;
  font-weight: 700;
}

.trust-note .icon {
  color: var(--cyan);
}

.login-footer {
  margin: 20px 0 0;
  color: rgba(255, 255, 255, 0.26);
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  text-align: center;
}

.app-shell {
  min-height: 100svh;
  /* Marca d'agua da logo oficial (12/08) - fica aqui, nao no body, porque
     esta div e' quem realmente cobre a tela inteira com fundo opaco
     (achado real testando: o fundo do body nunca aparecia por causa
     dela). */
  background-color: var(--canvas);
  background-image: url('/assets/watermark.png');
  background-repeat: no-repeat;
  background-position: center bottom 100px;
  background-size: 300px auto;
}

.topbar {
  position: sticky;
  z-index: 40;
  top: 0;
  min-height: calc(72px + env(safe-area-inset-top));
  display: flex;
  align-items: center;
  gap: 12px;
  padding: max(12px, env(safe-area-inset-top)) 16px 12px;
  color: #fff;
  background: var(--gradient);
  box-shadow: 0 8px 28px rgba(49, 42, 130, 0.22);
}

.topbar::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.5), transparent);
}

.topbar__brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 900;
}

.topbar__brand .brand-mark {
  width: 43px;
  height: 43px;
}

.topbar__brand b {
  color: #79f1ff;
}

.topbar__title {
  min-width: 0;
  flex: 1;
}

.topbar__title small,
.topbar__title strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar__title small {
  margin-bottom: 2px;
  color: rgba(255, 255, 255, 0.65);
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.topbar__title strong {
  font-size: 0.98rem;
}

.page {
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: 14px 16px 110px;
}

.network-bar {
  min-height: 61px;
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 24px;
  padding: 10px 12px;
  border-radius: 18px;
  color: #fff;
  box-shadow: var(--shadow-sm);
}

.network-bar--online {
  background: linear-gradient(110deg, #08795b, #10a57d);
}

.network-bar--offline {
  background: linear-gradient(110deg, #2c2946, #45405f);
}

.network-bar__icon {
  width: 39px;
  height: 39px;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.14);
}

.network-bar__copy {
  min-width: 0;
  flex: 1;
}

.network-bar__copy strong,
.network-bar__copy small {
  display: block;
}

.network-bar__copy strong {
  margin-bottom: 2px;
  font-size: 0.84rem;
}

.network-bar__copy small {
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.72rem;
}

.welcome-block {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 15px;
  margin: 4px 3px 22px;
}

.welcome-block h1,
.form-intro h1 {
  margin-bottom: 7px;
  font-size: clamp(1.85rem, 8vw, 2.45rem);
  line-height: 1.06;
  letter-spacing: -0.045em;
}

.welcome-block h1 em {
  color: var(--indigo);
  font-style: normal;
}

.welcome-block p,
.form-intro p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.87rem;
  line-height: 1.45;
}

.install-button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 11px;
  border: 1px solid #d8daf0;
  border-radius: 13px;
  color: var(--indigo);
  background: #fff;
  font-size: 0.72rem;
  font-weight: 800;
}

.stats-row {
  display: grid;
  grid-template-columns: 1fr 1px 1fr;
  gap: 16px;
  align-items: center;
  margin-bottom: 28px;
  padding: 17px 18px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.stats-row > div {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.stats-row strong {
  color: var(--indigo);
  font-family: var(--font-mono);
  font-size: 1.35rem;
}

.stats-row span {
  color: var(--ink-soft);
  font-size: 0.72rem;
  line-height: 1.2;
}

.stats-row__divider {
  width: 1px;
  height: 32px;
  background: var(--line);
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin: 0 3px 13px;
}

.section-heading h2 {
  margin: 0;
  font-size: 1.22rem;
  letter-spacing: -0.025em;
}

.section-heading .eyebrow {
  margin-bottom: 4px;
}

.section-heading--finished {
  margin-top: 34px;
}

.count-badge {
  min-width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  padding: 0 8px;
  border-radius: 11px;
  color: #fff;
  background: var(--gradient);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 800;
}

.count-badge--muted {
  color: var(--ink-soft);
  background: #e7e8f0;
}

.order-list {
  display: grid;
  gap: 13px;
}

.order-card {
  width: 100%;
  display: block;
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 22px;
  color: inherit;
  background: #fff;
  box-shadow: var(--shadow-sm);
  text-align: left;
  cursor: pointer;
  transition: transform 170ms ease, border-color 170ms ease, box-shadow 170ms ease;
}

.order-card:active {
  transform: scale(0.985);
}

.order-card--finished {
  opacity: 0.78;
  background: #fafafd;
}

.order-card__head,
.order-card__meta,
.order-card__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.order-number {
  color: var(--indigo);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.04em;
}

.order-card__client {
  display: block;
  margin: 13px 0 7px;
  font-size: 1.08rem;
  line-height: 1.25;
}

.order-card__location {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 15px;
  color: var(--ink-soft);
  font-size: 0.77rem;
}

.order-card__location .icon {
  color: var(--violet);
}

.order-card__meta {
  padding: 12px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 0.75rem;
}

.order-card__meta strong {
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 0.88rem;
}

.order-card__foot {
  padding-top: 11px;
  color: #8a879b;
}

.order-card__foot small {
  font-size: 0.68rem;
}

.order-card__foot .icon {
  color: var(--indigo);
}

.sync-chip,
.finished-chip {
  min-height: 25px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 0.62rem;
  font-weight: 800;
  white-space: nowrap;
}

.sync-chip .icon,
.finished-chip .icon {
  width: 13px;
  height: 13px;
}

.sync-chip--local {
  color: #9a5c0e;
  background: #fff2d9;
}

.sync-chip--syncing {
  color: var(--indigo);
  background: #e9ebff;
}

.sync-chip--synced,
.finished-chip {
  color: var(--success-dark);
  background: #ddf7ee;
}

.empty-state {
  padding: 36px 24px;
  border: 1px dashed #ccd0e1;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.62);
  text-align: center;
}

.empty-state__icon {
  width: 58px;
  height: 58px;
  display: grid;
  margin: 0 auto 16px;
  place-items: center;
  border-radius: 19px;
  color: var(--indigo);
  background: #e9ebff;
}

.empty-state__icon .icon {
  width: 29px;
  height: 29px;
}

.empty-state h3 {
  margin-bottom: 7px;
}

.empty-state p {
  max-width: 32ch;
  margin: 0 auto 18px;
  color: var(--ink-soft);
  font-size: 0.84rem;
  line-height: 1.45;
}

.fab {
  position: fixed;
  z-index: 30;
  right: max(18px, calc((100vw - 760px) / 2 + 18px));
  bottom: max(18px, env(safe-area-inset-bottom));
  min-height: 58px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 21px;
  border: 0;
  border-radius: 19px;
  color: #fff;
  background: var(--gradient);
  box-shadow: 0 15px 34px rgba(59, 76, 224, 0.36);
  font-weight: 900;
  cursor: pointer;
}

.fab .icon {
  width: 24px;
  height: 24px;
}

.page--form,
.page--detail {
  padding-bottom: 130px;
}

.form-intro {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 15px;
  align-items: start;
  margin: 8px 3px 22px;
}

.form-intro__number {
  color: transparent;
  background: var(--gradient);
  background-clip: text;
  font-family: var(--font-mono);
  font-size: 2rem;
  font-weight: 900;
}

.form-card,
.inline-form,
.content-section {
  border: 1px solid var(--line);
  border-radius: 24px;
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.form-card {
  padding: 20px;
}

.field {
  margin-bottom: 18px;
}

.field label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 0 2px 8px;
  color: var(--ink);
  font-size: 0.77rem;
  font-weight: 800;
}

.field label span {
  color: #9794a5;
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.field input,
.field textarea {
  width: 100%;
  min-height: 54px;
  padding: 14px 15px;
  border: 1px solid #dfe0e9;
  border-radius: 14px;
  outline: 0;
  color: var(--ink);
  background: #f9f9fc;
  transition: border-color 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

.field textarea {
  min-height: 110px;
  resize: vertical;
  line-height: 1.5;
}

.field input:focus,
.field textarea:focus {
  border-color: rgba(59, 76, 224, 0.62);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(59, 76, 224, 0.1);
}

.field input::placeholder,
.field textarea::placeholder {
  color: #aaa8b5;
}

.field--error input,
.field--error textarea {
  border-color: var(--danger);
  background: #fff8fa;
}

.field-error {
  display: block;
  margin: 6px 2px 10px;
  color: #ff9dbb;
  font-size: 0.72rem;
  font-weight: 700;
}

.form-card .field-error,
.inline-form .field-error {
  color: var(--danger);
}

.offline-promise {
  display: flex;
  align-items: center;
  gap: 11px;
  margin: 4px 0 18px;
  padding: 13px;
  border-radius: 14px;
  color: var(--success-dark);
  background: #e9f9f4;
}

.offline-promise > .icon {
  width: 23px;
  height: 23px;
}

.offline-promise strong,
.offline-promise small {
  display: block;
}

.offline-promise strong {
  font-size: 0.75rem;
}

.offline-promise small {
  margin-top: 2px;
  color: #3e7c69;
  font-size: 0.67rem;
}

.order-hero {
  position: relative;
  overflow: hidden;
  margin-bottom: 18px;
  padding: 23px 20px 0;
  border-radius: 24px;
  color: #fff;
  background: var(--gradient);
  box-shadow: var(--shadow-md);
}

.order-hero::before {
  content: "";
  position: absolute;
  width: 190px;
  height: 190px;
  right: -70px;
  top: -80px;
  border-radius: 50%;
  background: rgba(34, 211, 238, 0.17);
}

.order-hero .eyebrow {
  color: #9ceffc;
}

.order-hero h1 {
  position: relative;
  max-width: 85%;
  margin-bottom: 8px;
  font-size: 1.75rem;
  line-height: 1.08;
  letter-spacing: -0.035em;
}

.order-hero > p {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 13px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.78rem;
}

.order-hero blockquote {
  margin: 15px 0 18px;
  padding: 10px 12px;
  border-left: 3px solid var(--cyan);
  color: rgba(255, 255, 255, 0.78);
  background: rgba(255, 255, 255, 0.06);
  font-size: 0.79rem;
  line-height: 1.45;
}

.order-hero__status {
  position: relative;
  display: flex;
  justify-content: flex-end;
  margin-bottom: 20px;
}

.order-hero__total {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 15px;
  margin: 20px -20px 0;
  padding: 15px 20px 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.11);
  background: rgba(12, 10, 42, 0.18);
}

.order-hero__total span {
  color: rgba(255, 255, 255, 0.62);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.order-hero__total strong {
  font-family: var(--font-mono);
  font-size: 1.25rem;
}

.content-section {
  margin-bottom: 18px;
  padding: 19px;
}

.content-section > .section-heading {
  margin-left: 0;
  margin-right: 0;
}

.inline-form {
  margin: 17px 0;
  padding: 15px;
  background: #f7f7fb;
  box-shadow: none;
}

.inline-form .field {
  margin-bottom: 13px;
}

.inline-form .field:nth-child(2) input {
  font-family: var(--font-mono);
}

.item-list {
  display: grid;
  gap: 9px;
}

.line-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 11px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.line-item:last-child {
  border-bottom: 0;
}

.line-item__icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: var(--indigo);
  background: #eef0ff;
}

.line-item__copy {
  min-width: 0;
}

.line-item__copy > strong {
  display: block;
  overflow: hidden;
  margin-bottom: 5px;
  font-size: 0.82rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.line-item__value {
  font-family: var(--font-mono);
  font-size: 0.82rem;
}

.mini-empty,
.gallery-empty {
  padding: 21px;
  border: 1px dashed #d7d8e2;
  border-radius: 16px;
  color: var(--ink-soft);
  background: #fafafd;
  text-align: center;
}

.mini-empty span,
.mini-empty small {
  display: block;
}

.mini-empty span {
  margin-bottom: 4px;
  font-size: 0.8rem;
  font-weight: 800;
}

.mini-empty small {
  font-size: 0.68rem;
}

.section-help {
  margin-bottom: 13px;
  color: var(--ink-soft);
  font-size: 0.76rem;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 13px;
}

.category-button {
  min-height: 45px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  border: 1px solid #dfe0e9;
  border-radius: 13px;
  color: var(--ink-soft);
  background: #fafafd;
  font-size: 0.72rem;
  font-weight: 800;
  text-align: left;
  cursor: pointer;
}

.category-button > span {
  width: 9px;
  height: 9px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #c9c9d4;
}

.category-button .icon {
  width: 15px;
  height: 15px;
  margin-left: auto;
}

.category-button.is-selected {
  border-color: rgba(59, 76, 224, 0.5);
  color: var(--indigo);
  background: #eef0ff;
  box-shadow: inset 0 0 0 1px rgba(59, 76, 224, 0.08);
}

.category-button.is-selected > span {
  background: var(--gradient);
}

.camera-button {
  width: 100%;
  min-height: 68px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 13px;
  border: 0;
  border-radius: 17px;
  color: #fff;
  background: var(--gradient);
  box-shadow: 0 10px 24px rgba(59, 76, 224, 0.2);
  text-align: left;
  cursor: pointer;
}

.camera-button:disabled {
  cursor: not-allowed;
  color: #7f7c8d;
  background: #e9e9ef;
  box-shadow: none;
}

.camera-button > span:first-child {
  width: 44px;
  height: 44px;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.16);
}

.camera-button > span:first-child .icon {
  width: 25px;
  height: 25px;
}

.camera-button strong,
.camera-button small {
  display: block;
}

.camera-button strong {
  margin-bottom: 3px;
  font-size: 0.8rem;
}

.camera-button small {
  color: rgba(255, 255, 255, 0.68);
  font-size: 0.64rem;
}

.camera-button:disabled small {
  color: #9a97a7;
}

.photo-gallery {
  margin-top: 19px;
}

.gallery-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  font-size: 0.72rem;
}

.photo-group {
  margin-top: 18px;
}

.photo-group h3 {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 9px;
  font-size: 0.78rem;
}

.photo-group h3 span {
  min-width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  color: var(--indigo);
  background: #eceeff;
  font-family: var(--font-mono);
  font-size: 0.6rem;
}

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

.photo-card {
  position: relative;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  margin: 0;
  border-radius: 15px;
  background: #e8e9f1;
}

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

.photo-card__placeholder {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  color: #8e8aa2;
  background: linear-gradient(145deg, #e9eaff, #dceef1);
}

.photo-card__placeholder .icon {
  width: 30px;
  height: 30px;
}

.photo-card figcaption {
  position: absolute;
  right: 7px;
  bottom: 7px;
}

.sticky-total {
  position: fixed;
  z-index: 35;
  right: 0;
  bottom: 0;
  left: 0;
  display: grid;
  grid-template-columns: auto minmax(190px, 1fr);
  gap: 12px;
  align-items: center;
  padding: 11px 14px max(11px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 -12px 36px rgba(35, 30, 75, 0.12);
  backdrop-filter: blur(14px);
}

.sticky-total > span small,
.sticky-total > span strong {
  display: block;
}

.sticky-total > span small {
  margin-bottom: 3px;
  color: var(--ink-soft);
  font-size: 0.61rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.sticky-total > span strong {
  font-family: var(--font-mono);
  font-size: 0.93rem;
}

.button--finish {
  min-height: 57px;
  justify-content: flex-start;
  color: #fff;
  background: var(--gradient);
  box-shadow: 0 10px 24px rgba(59, 76, 224, 0.24);
  text-align: left;
}

.button--finish > span strong,
.button--finish > span small {
  display: block;
}

.button--finish > span strong {
  font-size: 0.75rem;
}

.button--finish > span small {
  margin-top: 2px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.59rem;
  font-weight: 600;
}

.dialog-backdrop {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  place-items: end center;
  padding: 18px;
  background: rgba(18, 15, 42, 0.7);
  backdrop-filter: blur(5px);
  animation: fade-in 160ms ease-out;
}

.confirm-dialog {
  width: min(100%, 460px);
  padding: 26px 21px 21px;
  border-radius: 26px;
  background: #fff;
  box-shadow: 0 30px 80px rgba(16, 12, 50, 0.34);
  animation: slide-up 220ms ease-out;
}

.confirm-dialog__icon {
  width: 52px;
  height: 52px;
  display: grid;
  margin-bottom: 18px;
  place-items: center;
  border-radius: 17px;
  color: #fff;
  background: var(--gradient);
}

.confirm-dialog__icon .icon {
  width: 27px;
  height: 27px;
}

.confirm-dialog h2 {
  margin-bottom: 8px;
  font-size: 1.45rem;
}

.confirm-dialog > p {
  margin-bottom: 18px;
  color: var(--ink-soft);
  font-size: 0.82rem;
  line-height: 1.45;
}

.confirm-summary {
  margin: 0 0 18px;
  padding: 8px 15px;
  border-radius: 16px;
  background: #f6f6fa;
}

.confirm-summary > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid #e3e3eb;
}

.confirm-summary > div:last-child {
  border-bottom: 0;
}

.confirm-summary dt {
  color: var(--ink-soft);
  font-size: 0.72rem;
}

.confirm-summary dd {
  margin: 0;
  font-size: 0.76rem;
  font-weight: 800;
  text-align: right;
}

.confirm-summary__total dd {
  color: var(--indigo);
  font-family: var(--font-mono);
  font-size: 1rem;
}

.dialog-actions {
  display: grid;
  gap: 9px;
}

@keyframes fade-in {
  from { opacity: 0; }
}

@keyframes slide-up {
  from { transform: translateY(30px); opacity: 0; }
}

.toast-region {
  position: fixed;
  z-index: 200;
  top: max(15px, env(safe-area-inset-top));
  right: 14px;
  left: 14px;
  display: grid;
  justify-items: center;
  gap: 8px;
  pointer-events: none;
}

.toast {
  width: min(100%, 440px);
  min-height: 52px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  transform: translateY(-14px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 16px;
  color: #fff;
  background: #242039;
  box-shadow: 0 15px 36px rgba(14, 12, 40, 0.28);
  font-size: 0.78rem;
  font-weight: 700;
  opacity: 0;
  transition: transform 200ms ease, opacity 200ms ease;
}

.toast--visible {
  transform: translateY(0);
  opacity: 1;
}

.toast--success .icon {
  color: #5be0ba;
}

.toast--warning .icon {
  color: #ffc266;
}

.fatal-error {
  color: var(--ink);
}

.fatal-error > .icon {
  width: 52px;
  height: 52px;
  margin-bottom: 16px;
  color: var(--danger);
}

.fatal-error h1 {
  max-width: 22ch;
  margin-bottom: 10px;
}

.fatal-error p {
  max-width: 45ch;
  color: var(--ink-soft);
}

@media (min-width: 620px) {
  .page {
    padding-right: 24px;
    padding-left: 24px;
  }

  .topbar {
    padding-right: max(24px, calc((100vw - 760px) / 2 + 24px));
    padding-left: max(24px, calc((100vw - 760px) / 2 + 24px));
  }

  .order-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .order-list--finished .order-card {
    grid-column: auto;
  }

  .category-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .photo-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .sticky-total {
    right: max(0px, calc((100vw - 760px) / 2));
    left: max(0px, calc((100vw - 760px) / 2));
    border-right: 1px solid var(--line);
    border-left: 1px solid var(--line);
    border-radius: 22px 22px 0 0;
  }

  .dialog-backdrop {
    place-items: center;
  }

  .dialog-actions {
    grid-template-columns: 1fr 1fr;
  }
}

@media (min-width: 900px) {
  body {
    background: #e8e9f1;
  }

  .app-shell {
    width: 760px;
    margin: 0 auto;
    box-shadow: 0 0 70px rgba(42, 36, 88, 0.12);
  }

  .topbar {
    padding-right: 24px;
    padding-left: 24px;
  }

  .login-card {
    padding-top: 20px;
  }
}

@media (max-width: 370px) {
  .sticky-total {
    grid-template-columns: 1fr;
  }

  .sticky-total > span {
    display: none;
  }

  .stats-row {
    gap: 10px;
    padding-right: 13px;
    padding-left: 13px;
  }

  .stats-row > div {
    gap: 5px;
  }
}

/* V2: client-linked work-order flow. */
.list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 8px 3px 28px;
}

.list-header h1 {
  margin: 0 0 5px;
  color: var(--ink);
  font-size: clamp(1.8rem, 8vw, 2.3rem);
  font-weight: 750;
  line-height: 1.08;
  letter-spacing: -0.045em;
}

.list-header p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.78rem;
}

.form-intro {
  display: block;
  margin-bottom: 22px;
}

.client-section {
  margin-bottom: 16px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.client-section .section-heading,
.new-client-fields .section-heading,
.order-fields .section-heading {
  align-items: center;
  margin: 0 0 16px;
}

.client-section .section-heading > div,
.new-client-fields .section-heading > div,
.order-fields .section-heading > div {
  display: flex;
  align-items: center;
  gap: 10px;
}

.step-label {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  color: var(--indigo);
  background: rgba(59, 76, 224, 0.09);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 800;
}

.client-search > label {
  display: block;
  margin: 0 2px 8px;
  color: var(--ink-soft);
  font-size: 0.72rem;
  font-weight: 700;
}

.search-control {
  min-height: 52px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 9px;
  align-items: center;
  padding: 5px 5px 5px 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  background: #f7f7f9;
  transition: border-color 180ms ease-out, box-shadow 180ms ease-out, background-color 180ms ease-out;
}

.search-control:focus-within {
  border-color: rgba(59, 76, 224, 0.42);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(59, 76, 224, 0.08);
}

.search-control > .icon {
  color: var(--ink-soft);
}

.search-control input {
  min-width: 0;
  height: 40px;
  padding: 0;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
}

.search-control button {
  min-height: 40px;
  padding: 0 13px;
  border: 0;
  border-radius: 9px;
  color: #fff;
  background: var(--indigo);
  font-size: 0.72rem;
  font-weight: 800;
  cursor: pointer;
}

.client-results {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.client-result {
  width: 100%;
  min-height: 66px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  color: var(--ink);
  background: var(--surface-raised);
  text-align: left;
  cursor: pointer;
  transition: transform 180ms ease-out, border-color 180ms ease-out, background-color 180ms ease-out;
}

.client-result:active {
  transform: scale(0.985);
}

.client-result:hover {
  border-color: rgba(59, 76, 224, 0.18);
  background: #fff;
}

.client-result__icon,
.selected-client__icon {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-control);
  color: var(--indigo);
  background: rgba(59, 76, 224, 0.08);
}

.client-result strong,
.client-result small {
  display: block;
}

.client-result strong {
  margin-bottom: 3px;
  font-size: 0.78rem;
}

.client-result small {
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 0.66rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.client-result > .icon:last-child {
  color: #aeaeb2;
}

.client-search-status {
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px;
  border: 1px dashed var(--line);
  border-radius: var(--radius-control);
  color: var(--ink-soft);
  background: #fafafa;
  font-size: 0.72rem;
}

.new-client-button {
  width: 100%;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 12px;
  border: 1px solid rgba(59, 76, 224, 0.16);
  border-radius: var(--radius-control);
  color: var(--indigo);
  background: rgba(59, 76, 224, 0.06);
  font-size: 0.76rem;
  font-weight: 800;
  cursor: pointer;
}

.new-client-button.is-active {
  color: #fff;
  background: var(--indigo);
}

.new-client-mode-header {
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 9px 8px 13px;
  border: 1px solid rgba(59, 76, 224, 0.14);
  border-radius: var(--radius-control);
  color: var(--indigo);
  background: rgba(59, 76, 224, 0.06);
}

.new-client-mode-header > span {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.76rem;
  font-weight: 800;
}

.new-client-mode-header button {
  min-height: 34px;
  padding: 0 10px;
  border: 0;
  border-radius: 9px;
  color: var(--indigo);
  background: #fff;
  font-size: 0.67rem;
  font-weight: 800;
  cursor: pointer;
}

.selected-client {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 11px;
  align-items: center;
  padding: 13px;
  border: 1px solid rgba(15, 159, 120, 0.15);
  border-radius: var(--radius-control);
  background: #f0faf7;
}

.selected-client__icon {
  color: var(--success-dark);
  background: rgba(15, 159, 120, 0.1);
}

.selected-client small,
.selected-client strong,
.selected-client span > span {
  display: block;
}

.selected-client small {
  margin-bottom: 2px;
  color: var(--success-dark);
  font-size: 0.61rem;
  font-weight: 800;
  text-transform: uppercase;
}

.selected-client strong {
  font-size: 0.83rem;
}

.selected-client span > span {
  overflow: hidden;
  margin-top: 3px;
  color: var(--ink-soft);
  font-size: 0.65rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.selected-client > button {
  min-height: 36px;
  padding: 0 9px;
  border: 0;
  border-radius: 9px;
  color: var(--indigo);
  background: #fff;
  font-size: 0.67rem;
  font-weight: 800;
  cursor: pointer;
}

.new-client-fields,
.order-fields {
  padding-bottom: 4px;
}

.new-client-fields {
  margin-bottom: 20px;
  padding-bottom: 3px;
  border-bottom: 1px solid var(--line);
}

.client-required-error {
  margin: -4px 0 13px;
}

.order-hero__company {
  display: block;
  margin: -2px 0 10px;
  color: var(--ink-soft);
  font-size: 0.74rem;
}

@media (max-width: 370px) {
  .client-result {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }

  .client-result .sync-chip {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Design refinement: neutral Apple-like surfaces with brand color as an accent. */
:root {
  --canvas: #f5f5f7;
  --surface: #ffffff;
  --surface-raised: #fbfbfd;
  --ink: #1d1d1f;
  --ink-soft: #6e6e73;
  --line: rgba(29, 29, 31, 0.09);
  --radius-control: 12px;
  --radius-card: 20px;
  --radius-sheet: 28px;
  --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.045);
  --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.09);
}

body {
  background: var(--canvas);
}

.page {
  animation: refined-page-in 200ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes refined-page-in {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

.button,
.icon-button,
.install-button,
.code-input-wrap,
.field input,
.field textarea,
.category-button {
  border-radius: var(--radius-control);
}

.form-card,
.inline-form,
.content-section,
.order-card,
.stats-row,
.empty-state,
.network-bar,
.order-hero {
  border-radius: var(--radius-card);
}

.confirm-dialog,
.dialog-backdrop .confirm-dialog {
  border-radius: var(--radius-sheet);
}

.brand-mark {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: var(--radius-control);
  background: var(--gradient);
  box-shadow: none;
}

.brand-mark .icon {
  width: 21px;
  height: 21px;
}

.login-screen {
  color: var(--ink);
  background: var(--canvas);
}

.login-screen::before {
  display: none;
}

.login-screen__glow {
  filter: blur(42px);
  opacity: 0.55;
}

.login-screen__glow--one {
  width: 220px;
  height: 220px;
  top: -130px;
  right: -110px;
  background: rgba(178, 63, 224, 0.2);
}

.login-screen__glow--two {
  width: 210px;
  height: 210px;
  left: -130px;
  bottom: -80px;
  background: rgba(34, 211, 238, 0.16);
}

.login-brand {
  color: var(--ink);
  font-size: 0.74rem;
  letter-spacing: 0.09em;
}

.login-brand b {
  color: var(--indigo);
}

.login-card {
  max-width: 430px;
  margin: auto;
  padding: 30px 24px 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sheet);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(20px);
}

.login-card h1 {
  margin-bottom: 14px;
  color: var(--ink);
  font-size: clamp(2rem, 9vw, 2.8rem);
  font-weight: 750;
  line-height: 1.04;
  letter-spacing: -0.05em;
}

.login-card h1 em {
  color: var(--ink);
  background: none;
  font-style: normal;
}

.login-card > p {
  margin-bottom: 26px;
  color: var(--ink-soft);
  font-size: 0.9rem;
  line-height: 1.5;
}

.eyebrow,
.eyebrow--light {
  color: var(--indigo);
  font-size: 0.66rem;
  letter-spacing: 0.12em;
}

.login-form label {
  color: var(--ink);
  font-size: 0.76rem;
}

.code-input-wrap {
  border: 1px solid var(--line);
  background: #f2f2f7;
  box-shadow: none;
}

.code-input-wrap:focus-within {
  border-color: rgba(59, 76, 224, 0.45);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(59, 76, 224, 0.08);
}

.code-input-wrap input {
  color: var(--ink);
}

.code-input-wrap input::placeholder {
  color: #98989d;
}

.trust-note {
  color: var(--ink-soft);
}

.trust-note .icon {
  color: var(--success);
}

.login-footer {
  color: #aeaeb2;
}

.button {
  min-height: 50px;
  transition: transform 180ms ease-out, box-shadow 180ms ease-out, background-color 180ms ease-out, opacity 180ms ease-out;
}

.button--primary {
  box-shadow: 0 5px 16px rgba(59, 76, 224, 0.18);
}

.button--secondary {
  border: 1px solid rgba(59, 76, 224, 0.12);
  color: var(--indigo);
  background: rgba(59, 76, 224, 0.07);
}

.topbar {
  min-height: calc(66px + env(safe-area-inset-top));
  padding-top: max(10px, env(safe-area-inset-top));
  color: var(--ink);
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--line);
  box-shadow: none;
  backdrop-filter: blur(22px) saturate(180%);
}

.topbar::after {
  display: none;
}

.topbar__brand b {
  color: var(--indigo);
}

.topbar__title small {
  color: var(--ink-soft);
}

.icon-button--on-dark {
  color: var(--ink);
  background: #f2f2f7;
  border: 1px solid var(--line);
}

.topbar .brand-mark {
  width: 40px;
  height: 40px;
}

.network-bar {
  min-height: 56px;
  padding: 9px 10px;
  color: var(--ink);
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.network-bar--online,
.network-bar--offline {
  color: var(--ink);
  background: var(--surface);
}

.network-bar__icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-control);
  color: var(--success-dark);
  background: #e7f7f1;
}

.network-bar--offline .network-bar__icon {
  color: var(--warning);
  background: #fff3df;
}

.network-bar__copy strong {
  font-size: 0.78rem;
}

.network-bar__copy small {
  color: var(--ink-soft);
}

.network-bar .icon-button {
  color: var(--indigo);
  background: rgba(59, 76, 224, 0.07);
  border: 0;
}

.welcome-block h1,
.form-intro h1 {
  color: var(--ink);
  font-size: clamp(1.75rem, 7vw, 2.25rem);
  font-weight: 750;
}

.welcome-block h1 em {
  color: var(--ink);
}

.stats-row,
.order-card,
.form-card,
.content-section {
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.stats-row {
  padding: 16px 18px;
}

.stats-row strong {
  color: var(--ink);
}

.count-badge {
  color: var(--indigo);
  background: rgba(59, 76, 224, 0.09);
}

.order-card {
  padding: 18px;
  transition: transform 180ms ease-out, border-color 180ms ease-out, box-shadow 180ms ease-out;
}

.order-card:hover {
  border-color: rgba(59, 76, 224, 0.17);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06);
}

.order-card--finished {
  opacity: 0.72;
  background: #fafafa;
}

.order-card__meta,
.order-card__foot {
  border-color: var(--line);
}

.sync-chip,
.finished-chip {
  border-radius: 999px;
}

.fab {
  min-height: 56px;
  border-radius: var(--radius-control);
  box-shadow: 0 6px 18px rgba(59, 76, 224, 0.22);
}

.form-intro__number {
  color: var(--indigo);
  background: none;
}

.form-card,
.content-section {
  padding: 20px;
}

.field input,
.field textarea {
  border-color: var(--line);
  background: #f7f7f9;
}

.field input:focus,
.field textarea:focus {
  border-color: rgba(59, 76, 224, 0.42);
  box-shadow: 0 0 0 4px rgba(59, 76, 224, 0.08);
}

.inline-form {
  border: 0;
  background: #f5f5f7;
  box-shadow: none;
}

.order-hero {
  overflow: visible;
  padding: 22px 20px 0;
  color: var(--ink);
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.order-hero::before {
  width: 112px;
  height: 4px;
  top: 0;
  right: auto;
  left: 20px;
  border-radius: 0 0 999px 999px;
  background: var(--gradient);
}

.order-hero .eyebrow {
  color: var(--indigo);
}

.order-hero h1 {
  color: var(--ink);
  font-size: 1.65rem;
  font-weight: 750;
}

.order-hero > p {
  color: var(--ink-soft);
}

.order-hero blockquote {
  border-left-color: var(--indigo);
  color: var(--ink-soft);
  background: #f7f7f9;
}

.order-hero__total {
  border-top-color: var(--line);
  color: var(--ink);
  background: #fafafa;
}

.order-hero__total span {
  color: var(--ink-soft);
}

.order-hero__status .sync-chip {
  box-shadow: none;
}

.line-item__icon {
  border-radius: var(--radius-control);
}

.photo-primary-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 16px 0 20px;
}

.photo-action {
  position: relative;
  min-height: 92px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  color: var(--ink);
  background: #f8f8fa;
  text-align: left;
  cursor: pointer;
  transition: transform 180ms ease-out, border-color 180ms ease-out, background-color 180ms ease-out;
}

.photo-action:active {
  transform: scale(0.975);
}

.photo-action--after {
  border-color: rgba(59, 76, 224, 0.15);
  background: #f2f4ff;
}

.photo-action__icon {
  width: 42px;
  height: 42px;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  border-radius: var(--radius-control);
  color: var(--ink);
  background: #fff;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.06);
}

.photo-action--after .photo-action__icon {
  color: #fff;
  background: var(--indigo);
}

.photo-action small,
.photo-action strong {
  display: block;
}

.photo-action small {
  margin-bottom: 2px;
  color: var(--ink-soft);
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
}

.photo-action strong {
  font-size: 0.94rem;
}

.photo-action__plus {
  position: absolute;
  right: 10px;
  top: 10px;
  width: 14px;
  height: 14px;
  color: var(--ink-soft);
}

.secondary-photo-block {
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.secondary-photo-block__label {
  display: block;
  margin-bottom: 10px;
  color: var(--ink-soft);
  font-size: 0.68rem;
  font-weight: 700;
}

.category-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.category-button {
  min-height: 36px;
  flex: 0 0 auto;
  gap: 5px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  color: var(--ink-soft);
  background: #f7f7f9;
  font-size: 0.68rem;
}

.category-button.is-selected {
  color: var(--indigo);
  border-color: rgba(59, 76, 224, 0.2);
  background: rgba(59, 76, 224, 0.07);
  box-shadow: none;
}

.camera-button--secondary {
  min-height: 58px;
  margin-top: 10px;
  color: var(--ink);
  border: 1px solid var(--line);
  background: #fff;
  box-shadow: none;
}

.camera-button--secondary > span:first-child {
  color: var(--indigo);
  background: rgba(59, 76, 224, 0.08);
}

.camera-button--secondary small {
  color: var(--ink-soft);
}

.photo-card,
.photo-card__placeholder {
  border-radius: var(--radius-control);
}

.content-section--actions {
  margin-bottom: 8px;
}

.order-actions {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.order-action {
  width: 100%;
  min-height: 72px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  color: var(--ink);
  background: var(--surface-raised);
  text-align: left;
  cursor: pointer;
  transition: transform 180ms ease-out, border-color 180ms ease-out, background-color 180ms ease-out, opacity 180ms ease-out;
}

.order-action:active:not(:disabled) {
  transform: scale(0.985);
}

.order-action:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.order-action__icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-control);
}

.order-action__icon .icon {
  width: 22px;
  height: 22px;
}

.order-action > span:nth-child(2) {
  min-width: 0;
}

.order-action strong,
.order-action small {
  display: block;
}

.order-action strong {
  margin-bottom: 3px;
  font-size: 0.8rem;
}

.order-action small {
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 0.66rem;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.order-action > .icon:last-child {
  color: #aeaeb2;
}

.order-action--signature .order-action__icon {
  color: #7552a8;
  background: #f1ebf8;
}

.order-action--finish {
  color: #fff;
  border-color: transparent;
  background: #252330;
}

.order-action--finish .order-action__icon {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
}

.order-action--finish small,
.order-action--finish > .icon:last-child {
  color: rgba(255, 255, 255, 0.63);
}

.order-action--finish:disabled {
  color: var(--success-dark);
  border-color: rgba(15, 159, 120, 0.12);
  background: #e8f7f2;
  opacity: 1;
}

.order-action--finish:disabled .order-action__icon {
  color: var(--success-dark);
  background: rgba(15, 159, 120, 0.1);
}

.order-action--finish:disabled small,
.order-action--finish:disabled > .icon:last-child {
  color: #4a7f6f;
}

.order-action--email .order-action__icon {
  color: #136ea7;
  background: #e7f3fa;
}

.sticky-total {
  grid-template-columns: 1fr auto;
  min-height: 68px;
  padding: 10px 16px max(10px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 -4px 18px rgba(0, 0, 0, 0.055);
}

.sticky-total__trust {
  display: flex !important;
  align-items: center;
  gap: 6px;
  color: var(--success-dark);
  font-size: 0.64rem;
  font-weight: 700;
}

.sticky-total__trust .icon {
  width: 16px;
  height: 16px;
}

.confirm-dialog {
  border: 1px solid var(--line);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}

.confirm-dialog__icon {
  border-radius: var(--radius-control);
  background: #252330;
}

.confirm-summary {
  border-radius: var(--radius-control);
}

@media (max-width: 370px) {
  .photo-primary-actions {
    grid-template-columns: 1fr;
  }

  .sticky-total {
    grid-template-columns: 1fr auto;
  }

  .sticky-total > span {
    display: block;
  }
}
