@font-face {
  font-family: Manrope;
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/cyrillic-400-normal.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
  font-family: Manrope;
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/fonts/cyrillic-600-normal.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
  font-family: Manrope;
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/fonts/cyrillic-700-normal.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
  font-family: Manrope;
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/latin-400-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: Manrope;
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/fonts/latin-600-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: Manrope;
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/fonts/latin-700-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  color-scheme: light;
  --bg: #ffffff;
  --text: #18181b;
  --muted: #71717a;
  --soft: #f4f4f5;
  --line: #e4e4e7;
  --primary: #9f9689;
  --primary-soft: #f1f0ee;
  --ink: #3e3932;
  --ink-text: #ffffff;
  --notice-bg: #fffbeb;
  --notice-text: #78350f;
  --mark: #71717a;
  --chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%2371717a' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3.5 6.5 8 11l4.5-4.5'/%3E%3C/svg%3E");
  --calendar: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%2371717a' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='2.5' y='3.5' width='11' height='10' rx='1'/%3E%3Cpath d='M2.5 7.5h11M6 2.5v2.5M10 2.5v2.5'/%3E%3C/svg%3E");
  font-family: Manrope, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #18181b;
    --text: #fafafa;
    --muted: #a1a1aa;
    --soft: #27272a;
    --line: #3f3f46;
    --primary: #c6c0b9;
    --primary-soft: #3e3932;
    --ink: #f1f0ee;
    --ink-text: #18181b;
    --notice-bg: #451a03;
    --notice-text: #fef3c7;
    --mark: #a1a1aa;
    --chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%23a1a1aa' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3.5 6.5 8 11l4.5-4.5'/%3E%3C/svg%3E");
    --calendar: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%23a1a1aa' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='2.5' y='3.5' width='11' height='10' rx='1'/%3E%3Cpath d='M2.5 7.5h11M6 2.5v2.5M10 2.5v2.5'/%3E%3C/svg%3E");
  }
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html, body {
  max-width: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  line-height: 1.5;
}

main {
  max-width: 720px;
  min-width: 0;
  margin: 0 auto;
  padding: 24px 16px calc(28px + env(safe-area-inset-bottom));
}

#sheet {
  min-height: 100vh;
  min-height: 100dvh;
}

header {
  display: block;
  min-width: 0;
}

.actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

h1, h2, h3, p, .summary, .caption, .notice {
  overflow-wrap: anywhere;
}

h1 {
  margin: 0;
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.05;
}

#updated {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 14px;
}

button, .chip {
  border: 0;
  background: var(--soft);
  color: var(--text);
  border-radius: 0;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

#reset, #refresh {
  min-height: 28px;
  padding: 2px 10px;
  font-size: 13px;
}

.book-go, .time {
  min-height: 40px;
  padding: 8px 16px;
}

.chip {
  min-height: 35px;
  padding: 8px 10px;
}

#refresh, .book-go.accent, .cart-link {
  background: var(--ink);
  color: var(--ink-text);
}

#refresh:disabled, .book-go:disabled, #reset:disabled {
  opacity: 0.4;
  cursor: default;
}

#scope {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 10px;
}

.hint {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 10px;
  font-weight: 400;
  line-height: 1.35;
}

.switch {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
  padding: 20px 0 4px;
}

#lens.switch { padding-top: 8px; }

.picks {
  display: grid;
  min-width: 0;
}

.chip.active, .time.active {
  background: var(--ink);
  color: var(--ink-text);
}

.notice, .alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 16px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
}

.notice {
  background: var(--notice-bg);
  color: var(--notice-text);
  border-color: color-mix(in srgb, var(--notice-text) 28%, transparent);
}

.alert {
  background: var(--primary-soft);
  color: var(--ink);
  border-color: color-mix(in srgb, var(--primary) 55%, var(--line));
}

.notice::before, .alert::before {
  content: "";
  flex: none;
  width: 18px;
  height: 18px;
  margin-top: 1px;
  background: currentColor;
  -webkit-mask: var(--glyph) center / contain no-repeat;
  mask: var(--glyph) center / contain no-repeat;
}

.notice {
  --glyph: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M12 8v4M12 16h.01'/%3E%3C/svg%3E");
}

.alert {
  --glyph: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M12 16v-4M12 8h.01'/%3E%3C/svg%3E");
}

section { margin-top: 28px; }

h2, h3 {
  margin: 0;
  font-weight: 700;
  letter-spacing: -0.03em;
}

h2 { font-size: 20px; }

h3 {
  margin-top: 16px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0;
}

h3.yc-service {
  margin-top: 22px;
  color: var(--text);
  font-size: 16px;
  font-weight: 700;
}

h3.yc-cabinet { margin-top: 10px; }

h3.day {
  display: flex;
  align-items: center;
  gap: 6px;
}

h3.day::before {
  content: "";
  width: 14px;
  height: 14px;
  flex: none;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='2.5' y='3.5' width='11' height='10' rx='1'/%3E%3Cpath d='M2.5 7.5h11M6 2.5v2.5M10 2.5v2.5'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='2.5' y='3.5' width='11' height='10' rx='1'/%3E%3Cpath d='M2.5 7.5h11M6 2.5v2.5M10 2.5v2.5'/%3E%3C/svg%3E") center / contain no-repeat;
}

.times {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.time {
  max-width: 100%;
  background: var(--soft);
  font-variant-numeric: tabular-nums;
}

#book {
  position: fixed;
  z-index: 20;
  left: max(16px, calc((100vw - 720px) / 2 + 16px));
  right: max(16px, calc((100vw - 720px) / 2 + 16px));
  bottom: calc(12px + env(safe-area-inset-bottom));
  margin: 0;
  max-height: 33vh;
  overflow: auto;
  padding: 16px;
  border-radius: 0;
  background: var(--bg);
  border: 1px solid var(--line);
  box-shadow: 0 8px 28px rgb(0 0 0 / 16%);
  display: grid;
  gap: 12px;
}

body.has-book main {
  padding-bottom: calc(33vh + 24px + env(safe-area-inset-bottom));
}

.book-lines {
  display: grid;
  gap: 4px;
}

.book-lines p {
  margin: 0;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.book-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.summary {
  margin: 0;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.field {
  display: grid;
  gap: 6px;
  min-width: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
}

label.field { margin-top: 16px; }
#book .field, #book label.field { margin-top: 0; }

.field.day { cursor: pointer; }

#day, .field select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 36px;
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
}

#day {
  position: relative;
  cursor: pointer;
  background-image: var(--calendar);
}

.field select {
  background-image: var(--chevron);
}

#day::-webkit-calendar-picker-indicator {
  position: absolute;
  inset: 0;
  width: auto;
  height: auto;
  margin: 0;
  padding: 0;
  background: transparent;
  color: transparent;
  cursor: pointer;
}

.field input, .field select {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  min-height: 44px;
  border: 0;
  border-radius: 0;
  padding: 10px 12px;
  font: inherit;
  font-weight: 600;
  color: var(--text);
  background: var(--soft);
}

.field select, #day {
  padding-right: 36px;
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
}

.field select { background-image: var(--chevron); }

#day { background-image: var(--calendar); }

.field input:focus, .field select:focus, button:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.book-go, .cart-link { justify-self: start; }

.cart-link {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 8px 16px;
  font-weight: 600;
  text-decoration: none;
}

.book-note {
  margin: 0;
  min-height: 1.25em;
  color: var(--notice-text);
  font-size: 14px;
}

.empty {
  margin-top: 32px;
  color: var(--muted);
}

.caption {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 400;
}

.booking {
  margin: 8px 0 0;
  padding: 10px 12px;
  background: var(--soft);
}

.booking span {
  color: var(--muted);
  font-size: 14px;
  font-weight: 400;
}

.ids {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
  overflow-wrap: anywhere;
}

#debug {
  display: block;
  margin: 16px 0 0;
  padding: 0;
  min-height: 0;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
  opacity: 0.35;
}

#debug.active { opacity: 0.8; }
