:root {
  --bg: #EDF0F4;
  --surface: #FFFFFF;
  --surface-2: #E2E7EE;
  --fg: #13203A;
  --muted: #54647E;
  --line: #C9D1DC;
  --accent: #C62F3E;
  --accent-fg: #FFFFFF;
  --blue: #2F5FB3;
  --ok: #1C7F55;
  --bad: #B3262F;
  --pole-white: #FFFFFF;
  --font-display: 'Barlow Condensed', 'Arial Narrow', sans-serif;
  --font-body: 'Barlow', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0E1524; --surface: #16203A; --surface-2: #1F2B49; --fg: #E7ECF5; --muted: #9AA9C4; --line: #2C3A5C;
    --accent: #E0485A; --accent-fg: #FFFFFF; --blue: #7FA6F0; --ok: #4CC38A; --bad: #F27B87; --pole-white: #E7ECF5;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0E1524; --surface: #16203A; --surface-2: #1F2B49; --fg: #E7ECF5; --muted: #9AA9C4; --line: #2C3A5C;
  --accent: #E0485A; --accent-fg: #FFFFFF; --blue: #7FA6F0; --ok: #4CC38A; --bad: #F27B87; --pole-white: #E7ECF5;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.45;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-top: max(14px, env(safe-area-inset-top, 0px));
  padding-bottom: 150px;
}
body.no-dock { padding-bottom: 40px; }
.app { max-width: 520px; margin: 0 auto; display: flex; flex-direction: column; gap: 20px; }
h1, h2, h3, p { margin: 0; }
h2 { font-family: var(--font-display); font-weight: 700; font-size: 32px; line-height: 1.05; letter-spacing: .01em; text-transform: uppercase; text-wrap: balance; }
button { font: inherit; color: inherit; cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.muted { color: var(--muted); }
.num { font-variant-numeric: tabular-nums; }

/* cabeçalho */
.pole { height: 8px; border-radius: 4px; background: repeating-linear-gradient(-45deg, var(--accent) 0 10px, var(--pole-white) 10px 20px, var(--blue) 20px 30px, var(--pole-white) 30px 40px); }
.brand { display: flex; align-items: center; gap: 14px; min-width: 0; }
.logo { flex: none; width: 52px; height: 52px; border-radius: 50%; background: var(--fg); color: var(--bg); display: grid; place-items: center; font-family: var(--font-display); font-weight: 700; font-size: 22px; letter-spacing: .03em; overflow: hidden; }
.logo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.brand .grow { flex: 1; min-width: 0; }
.brand h1 { font-family: var(--font-display); font-weight: 700; font-size: 28px; line-height: 1; text-transform: uppercase; letter-spacing: .02em; overflow-wrap: anywhere; }
.brand p { font-size: 14px; color: var(--muted); margin-top: 4px; }
.hdr-stack { display: flex; flex-direction: column; gap: 16px; }

.seg { display: grid; grid-template-columns: 1fr 1fr; background: var(--surface-2); border-radius: 10px; padding: 4px; gap: 4px; }
.seg button { border: 0; background: transparent; border-radius: 7px; padding: 9px 8px; font-weight: 600; font-size: 15px; color: var(--muted); }
.seg button[aria-selected="true"] { background: var(--surface); color: var(--fg); box-shadow: 0 1px 2px rgba(0,0,0,.15); }

/* passos */
.progress { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-bottom: 10px; }
.progress span { height: 5px; border-radius: 3px; background: var(--line); }
.progress span.on { background: var(--accent); }
.eyebrow { font-size: 13px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.lead { color: var(--muted); margin-top: 6px; }
.stack { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }

.opt { width: 100%; text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; display: flex; align-items: center; gap: 12px; min-width: 0; }
.opt:hover { border-color: var(--muted); }
.opt[aria-pressed="true"] { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.opt .grow { flex: 1; min-width: 0; }
.opt .t { font-weight: 600; }
.opt .s { font-size: 14px; color: var(--muted); }
.opt .price { font-weight: 600; white-space: nowrap; }
.avatar { flex: none; width: 44px; height: 44px; border-radius: 50%; background: var(--surface-2); display: grid; place-items: center; font-family: var(--font-display); font-weight: 700; font-size: 20px; }
.box { flex: none; width: 22px; height: 22px; border-radius: 6px; border: 2px solid var(--line); display: grid; place-items: center; color: transparent; font-size: 14px; line-height: 1; }
.opt[aria-pressed="true"] .box { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 8px 14px; font-size: 15px; font-weight: 500; }
.chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); }
.subhead { font-size: 14px; font-weight: 600; margin: 8px 0 -2px; }
.scroll-chips { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; }
.scroll-chips .chip { flex: none; }

.days { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; margin-top: 16px; }
.day { flex: none; min-width: 64px; border: 1px solid var(--line); background: var(--surface); border-radius: 10px; padding: 8px 6px; text-align: center; line-height: 1.15; }
.day .w { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.day .d { font-family: var(--font-display); font-weight: 700; font-size: 26px; }
.day .m { font-size: 12px; color: var(--muted); }
.day[aria-pressed="true"] { background: var(--fg); border-color: var(--fg); }
.day[aria-pressed="true"] .w, .day[aria-pressed="true"] .m, .day[aria-pressed="true"] .d { color: var(--bg); }
.day:disabled { opacity: .4; cursor: not-allowed; }

.slots { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 14px; }
.slot { min-height: 46px; border: 1px solid var(--line); background: var(--surface); border-radius: 9px; font-weight: 600; font-variant-numeric: tabular-nums; }
.slot[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); }
.slot:disabled { opacity: .35; border-style: dashed; cursor: not-allowed; }
.empty { margin-top: 14px; padding: 16px; border: 1px dashed var(--line); border-radius: 10px; color: var(--muted); text-align: center; }
.error { margin-top: 14px; padding: 12px 14px; border-radius: 10px; color: var(--bad); background: color-mix(in srgb, var(--bad) 12%, transparent); font-weight: 600; font-size: 15px; }

label.field { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: 15px; min-width: 0; }
.field input, .field textarea, .field select { font: inherit; font-weight: 400; color: var(--fg); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; width: 100%; min-width: 0; }
.field textarea { min-height: 72px; resize: vertical; }

dl.review { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; padding: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; }
dl.review dt { color: var(--muted); font-size: 14px; }
dl.review dd { margin: 0; font-weight: 500; min-width: 0; overflow-wrap: anywhere; text-align: right; }

/* barra fixa */
.dock { position: fixed; left: 0; right: 0; bottom: 0; background: var(--surface); border-top: 1px solid var(--line); padding-top: 12px; padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px)); padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); z-index: 5; }
.dock[hidden] { display: none; }
.dock-in { max-width: 520px; margin: 0 auto; display: flex; flex-direction: column; gap: 10px; }
.dock-sum { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; color: var(--muted); }
.dock-sum strong { color: var(--fg); }
.dock-btns { display: flex; gap: 8px; }
.btn { border-radius: 10px; border: 1px solid var(--line); background: var(--surface); padding: 13px 18px; font-weight: 600; min-height: 48px; }
.btn.primary { flex: 1; background: var(--accent); border-color: var(--accent); color: var(--accent-fg); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.sm { padding: 7px 12px; min-height: 0; font-size: 14px; border-radius: 8px; }
.btn.danger { color: var(--bad); }
a.btn { text-decoration: none; display: inline-flex; align-items: center; color: var(--fg); }
.link { border: 0; background: none; padding: 6px 0; color: var(--muted); font-size: 14px; text-decoration: underline; text-align: left; }

/* confirmação */
.ticket { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 18px; display: flex; flex-direction: column; gap: 14px; }
.ticket .ok { display: inline-flex; align-items: center; gap: 8px; color: var(--ok); font-weight: 600; }
.ticket hr { border: 0; border-top: 2px dashed var(--line); margin: 0; }
.code { font-family: var(--font-display); font-weight: 700; font-size: 22px; letter-spacing: .08em; }
.row-btns { display: flex; flex-wrap: wrap; gap: 8px; }

/* painel do dono */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; }
.stats > div { padding: 12px 6px; text-align: center; min-width: 0; }
.stats > div + div { border-left: 1px solid var(--line); }
.stats .v { font-family: var(--font-display); font-weight: 700; font-size: 24px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stats .l { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; font-weight: 600; }
.list { display: flex; flex-direction: column; gap: 10px; }
.appt { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; display: grid; grid-template-columns: 62px minmax(0, 1fr); gap: 6px 12px; }
.appt .time { font-family: var(--font-display); font-weight: 700; font-size: 24px; line-height: 1; font-variant-numeric: tabular-nums; }
.appt .time small { display: block; font-family: var(--font-body); font-weight: 400; font-size: 12px; color: var(--muted); margin-top: 4px; }
.appt .who { font-weight: 600; overflow-wrap: anywhere; }
.appt .what { font-size: 14px; color: var(--muted); overflow-wrap: anywhere; }
.appt .acts { grid-column: 2; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 4px; }
.appt.cancelled .who, .appt.cancelled .what { text-decoration: line-through; opacity: .65; }
.pill { display: inline-block; font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 999px; letter-spacing: .02em; }
.pill.confirmed { color: var(--blue); background: color-mix(in srgb, var(--blue) 16%, transparent); }
.pill.done { color: var(--ok); background: color-mix(in srgb, var(--ok) 16%, transparent); }
.pill.cancelled { color: var(--bad); background: color-mix(in srgb, var(--bad) 14%, transparent); }
.pill.fresh { color: var(--accent-fg); background: var(--accent); }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 14px; display: flex; flex-direction: column; gap: 12px; }
.card h3 { font-family: var(--font-display); font-weight: 700; font-size: 20px; text-transform: uppercase; letter-spacing: .02em; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.checks { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.checks label { display: inline-flex; align-items: center; gap: 6px; font-size: 15px; font-weight: 500; }
.checks input { width: 18px; height: 18px; accent-color: var(--accent); }
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(24px + env(safe-area-inset-bottom, 0px)); background: var(--fg); color: var(--bg); padding: 12px 18px; border-radius: 10px; font-weight: 600; z-index: 20; max-width: calc(100% - 32px); box-shadow: 0 6px 24px rgba(0,0,0,.25); }
.toast[hidden] { display: none; }
.login { max-width: 380px; margin: 40px auto 0; display: flex; flex-direction: column; gap: 14px; }

@media (max-width: 380px) { .slots { grid-template-columns: repeat(3, 1fr); } .row2 { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }

/* ---- várias lojas: link da loja, administração ---- */
.linkcard { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.linkcard .eyebrow { margin: 0; }
.linkcard .url { font-weight: 600; overflow-wrap: anywhere; user-select: all; }
.shopcard { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 14px; display: flex; flex-direction: column; gap: 12px; }
.shopcard.off { opacity: .8; }
.shophead { display: flex; align-items: center; gap: 12px; min-width: 0; }
.shophead .logo { width: 44px; height: 44px; font-size: 18px; }
.shophead .grow { flex: 1; min-width: 0; }
.shophead .nm { font-weight: 700; overflow-wrap: anywhere; }
.shophead .sub { font-size: 14px; color: var(--muted); overflow-wrap: anywhere; }
.colors { display: flex; gap: 12px; flex-wrap: wrap; align-items: end; }
.colors label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: 15px; }
.colors input[type="color"] { width: 64px; height: 44px; padding: 3px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.pill.off { color: var(--bad); background: color-mix(in srgb, var(--bad) 14%, transparent); }
.pill.on { color: var(--ok); background: color-mix(in srgb, var(--ok) 16%, transparent); }
.confirm-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 14px; font-weight: 600; }
