@font-face {
  font-family: "RobotoLocal";
  src: local("Roboto"), local("Roboto Regular"), url("/static/fonts/Roboto-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: optional;
}

@font-face {
  font-family: "RobotoLocal";
  src: local("Roboto Medium"), local("Roboto"), url("/static/fonts/Roboto-Regular.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: optional;
}

@font-face {
  font-family: "RobotoLocal";
  src: local("Roboto Bold"), local("Roboto"), url("/static/fonts/Roboto-Bold.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: optional;
}

@font-face {
  font-family: "RobotoLocal";
  src: local("Roboto Bold"), local("Roboto"), url("/static/fonts/Roboto-Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: optional;
}

@font-face {
  font-family: "RobotoLocal";
  src: local("Roboto Bold"), local("Roboto"), url("/static/fonts/Roboto-Bold.woff2") format("woff2");
  font-weight: 800;
  font-style: normal;
  font-display: optional;
}

@font-face {
  font-family: "RobotoLocal";
  src: local("Roboto Bold"), local("Roboto"), url("/static/fonts/Roboto-Bold.woff2") format("woff2");
  font-weight: 900;
  font-style: normal;
  font-display: optional;
}

html {
  font-synthesis: none;
}

:root {
  --brand: #7b0000;
  --brand-2: #5e0000;
  --bg: #f4f1f1;
  --card: #ffffff;
  --muted-card: #f3eded;
  --border: #e3d9d9;
  --text: #1e1e1e;
  --muted: rgba(0, 0, 0, 0.65);
  --primary: #7b0000;
  --primary-hover: #650000;
  --outline-bg: #ffffff;
  --outline-border: #cfc2c2;
  --success: #1f8a70;
  --danger: #b00020;
  --warning: #f4b400;
  --slot-free: #ffffff;
  --slot-booked: #e2e2e2;
  --slot-blocked: #f1d7d7;
  --shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
  --radius: 10px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  overflow-x: hidden;
}

body {
  font-family: "RobotoLocal", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-kerning: normal;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.35;
}

body.safe-mode {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}

a,
a:visited {
  color: inherit;
}

a {
  -webkit-tap-highlight-color: transparent;
}

button,
input[type="submit"],
input[type="button"],
input[type="reset"] {
  -webkit-appearance: none;
  appearance: none;
  border-radius: var(--radius);
}

button,
input,
select,
textarea {
  font-family: inherit;
}

.btn {
  color: var(--text);
}

.btn-primary,
.btn-cta {
  color: #fff !important;
}

.btn-danger {
  background: var(--danger);
  color: #fff;
  border-color: transparent;
}

.btn-danger:hover {
  filter: brightness(0.95);
}

.btn-outline {
  color: var(--text) !important;
}

.header {
  background: linear-gradient(180deg, var(--brand), var(--brand-2));
  color: #fff;
  padding: 18px 16px;
  text-align: left;
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.08);
}

.header h1 {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.2px;
}

.header .subtitle {
  margin-top: 6px;
  font-size: 13px;
  opacity: 0.85;
}

.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 16px;
  padding-bottom: calc(92px + env(safe-area-inset-bottom));
}

.app-meta {
  margin-top: 4px;
  padding: 4px 2px 10px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 14px;
  box-shadow: var(--shadow);
}

.card h2 {
  font-size: 16px;
  font-weight: 800;
  margin-bottom: 12px;
}

.hero-card {
  background:
    radial-gradient(circle at top right, rgba(123, 0, 0, 0.08), transparent 34%),
    var(--card);
}

.hero-head,
.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.page-head h1,
.page-head h2,
.page-head h3 {
  margin: 0;
}

.page-head .btn {
  margin-top: 2px;
}

.hero-subtitle {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.hero-badge,
.section-meta {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 6px 10px;
  background: rgba(123, 0, 0, 0.08);
  color: var(--brand);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.quick-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.empty-state {
  display: grid;
  gap: 10px;
}

.empty-state-title {
  font-weight: 800;
}

.empty-state-text {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.empty-state-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.empty-state-actions-single {
  grid-template-columns: minmax(0, 1fr);
}

.flash-stack {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
}

.flash {
  position: relative;
  border-radius: var(--radius);
  padding: 12px 40px 12px 14px;
  border: 1px solid var(--border);
  border-left: 4px solid var(--outline-border);
  background: var(--card);
  box-shadow: var(--shadow);
  font-size: 14px;
  line-height: 1.4;
  animation: flash-enter 0.18s ease-out;
}

.flash-success {
  border-left-color: var(--success);
  background: rgba(31, 138, 112, 0.08);
}

.flash-error {
  border-left-color: var(--danger);
  background: rgba(176, 0, 32, 0.08);
}

.flash-warning {
  border-left-color: var(--warning);
  background: rgba(244, 180, 0, 0.12);
}

.flash-info {
  border-left-color: var(--primary);
  background: rgba(123, 0, 0, 0.08);
}

.flash-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 24px;
  height: 24px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
}

.flash-close:hover {
  background: rgba(0, 0, 0, 0.06);
  color: var(--text);
}

.flash.hide {
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.network-hint {
  display: none;
  margin-bottom: 12px;
}

.network-hint.is-visible {
  display: block;
}

@keyframes flash-enter {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

input[type="text"],
input[type="tel"],
input[type="password"],
input[type="number"] {
  width: 100%;
  padding: 12px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 15px;
  background: #fff;
  margin-bottom: 12px;
  outline: none;
}

input:focus {
  border-color: rgba(123, 0, 0, 0.55);
  box-shadow: 0 0 0 3px rgba(123, 0, 0, 0.1);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  user-select: none;
  transition: transform 0.04s ease, background 0.15s ease, filter 0.15s ease;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--primary-hover);
}

.btn-outline {
  background: var(--outline-bg);
  color: var(--text);
  border-color: var(--outline-border);
}

.btn-outline:hover {
  background: #faf7f7;
}

.btn-cta {
  background: var(--primary);
  color: #fff;
}

.btn-cta:hover {
  background: var(--primary-hover);
}

.btn-cta:disabled {
  background: rgba(161, 161, 161, 1);
  color: rgba(255, 255, 255, 0.92);
  opacity: 1;
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.btn-small {
  width: auto;
  padding: 8px 12px;
  font-size: 14px;
}

.date-grid,
.time-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.date-btn,
.time-btn {
  display: block;
  width: 100%;
  padding: 12px 10px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--slot-free);
  text-align: center;
  text-decoration: none;
  color: var(--text);
  cursor: pointer;
  font-size: 14px;
}

button.time-btn {
  appearance: none;
  -webkit-appearance: none;
  outline: none;
}

.date-btn:hover,
.time-btn:hover {
  border-color: rgba(123, 0, 0, 0.35);
  background: #fffafa;
}

.date-btn.selected,
.time-btn.selected {
  background: rgba(123, 0, 0, 0.08);
  border-color: rgba(123, 0, 0, 0.45);
  font-weight: 800;
}

.time-btn.booked {
  background: var(--slot-booked);
  color: #666;
  cursor: not-allowed;
}

.time-btn.blocked {
  background: var(--slot-blocked);
  color: #7a2b2b;
  cursor: not-allowed;
}

.apt-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--muted-card);
  margin-bottom: 10px;
}

.apt-date {
  font-weight: 800;
}

.apt-time {
  font-weight: 800;
  color: var(--brand);
  font-size: 16px;
}

.apt-time,
.phone,
.mono {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1, "lnum" 1;
}

.phone {
  color: var(--muted);
  font-size: 13px;
}

@media (max-width: 420px) {
  .date-grid,
  .time-grid {
    grid-template-columns: 1fr;
  }

  .hero-head,
  .section-head {
    flex-direction: column;
  }

  .quick-actions,
  .empty-state-actions {
    grid-template-columns: 1fr;
  }

  .container {
    padding: 12px;
    padding-bottom: calc(92px + env(safe-area-inset-bottom));
  }
}

@media (max-width: 700px) {
  .page-head {
    align-items: center;
  }

  .page-head .btn {
    margin-top: 0;
  }
}

#app-splash {
  position: fixed;
  inset: 0;
  background: #7b0000;
  z-index: 99999;
  opacity: 1;
  transition: opacity 0.25s ease;
  touch-action: none;
  will-change: opacity;
}

#app-splash.hidden {
  opacity: 0;
  pointer-events: none;
}

html.no-splash #app-splash {
  display: none !important;
}

html.splash-active,
html.splash-active body {
  overflow: hidden;
  overscroll-behavior: none;
}

html.splash-active .drawer,
html.splash-active .drawer-backdrop,
html.splash-active .fab {
  visibility: hidden;
  pointer-events: none;
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(20, 15, 15, 0.46);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.24s ease, visibility 0s linear 0.24s;
  z-index: 9000;
  -webkit-backdrop-filter: blur(1.5px);
  backdrop-filter: blur(1.5px);
}

.drawer {
  position: fixed;
  top: 0;
  left: 0;
  height: 100dvh;
  width: min(86vw, 336px);
  background: #f5f1f1;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.18);
  transform: translate3d(-104%, 0, 0);
  transition: transform 0.28s cubic-bezier(0.22, 0.78, 0.2, 1);
  z-index: 9001;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  will-change: transform;
}

.drawer.open {
  transform: translate3d(0, 0, 0);
}

.drawer-backdrop.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition-delay: 0s;
}

.drawer-header {
  background: linear-gradient(180deg, var(--brand), var(--brand-2));
  color: #fff;
  padding: 18px 16px;
}

.drawer-title {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.2px;
}

.drawer-user {
  margin-top: 6px;
  font-size: 13px;
  opacity: 0.85;
}

.drawer-nav {
  padding: 6px 0 10px;
  flex: 1 1 auto;
}

.drawer-group + .drawer-group {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.drawer-group-label {
  padding: 7px 16px 5px;
  color: rgba(0, 0, 0, 0.5);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.drawer-group .drawer-link:last-child {
  border-bottom: 0;
}

.drawer-link {
  display: flex;
  align-items: center;
  gap: 13px;
  min-height: 50px;
  padding: 12px 16px;
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.2;
  transition: background 0.16s ease, color 0.16s ease;
}

.drawer-link:hover {
  background: rgba(123, 0, 0, 0.04);
}

.drawer-link:active {
  background: rgba(123, 0, 0, 0.08);
}

.drawer-link:focus-visible {
  outline: 2px solid rgba(123, 0, 0, 0.35);
  outline-offset: -2px;
}

.drawer-link.is-active {
  background: rgba(123, 0, 0, 0.09);
  color: #2b1b1b;
  font-weight: 700;
  box-shadow: inset 3px 0 0 var(--brand);
}

.drawer-link .ico {
  width: 24px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.ico-svg {
  width: 17px;
  height: 17px;
  display: block;
  opacity: 0.72;
  transition: opacity 0.16s ease;
}

.drawer-link:hover .ico-svg,
.drawer-link:focus-visible .ico-svg {
  opacity: 0.84;
}

.drawer-link.is-active .ico-svg {
  opacity: 0.96;
}

.drawer-link.is-disabled {
  color: rgba(0, 0, 0, 0.45);
  background: rgba(0, 0, 0, 0.02);
  cursor: not-allowed;
  pointer-events: none;
}

.drawer-link.is-disabled .ico-svg {
  opacity: 0.42;
}

.drawer-footer {
  margin-top: auto;
  padding: 16px;
  padding-bottom: calc(16px + env(safe-area-inset-bottom));
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  background: rgba(245, 241, 241, 0.98);
}

.drawer-footer a {
  display: block;
  text-align: center;
  padding: 12px 14px;
  border-radius: var(--radius);
  text-decoration: none;
  border: 1px solid rgba(0, 0, 0, 0.12);
  color: var(--text);
  background: #fff;
  font-weight: 800;
}

@supports not (height: 100dvh) {
  .drawer {
    height: 100vh;
  }
}

@media (max-width: 420px) {
  .drawer {
    width: min(88vw, 320px);
  }
}

.fab {
  position: fixed;
  right: 18px;
  bottom: 18px;
  bottom: clamp(18px, calc(18px + env(safe-area-inset-bottom)), 52px);
  width: 58px;
  height: 58px;
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
  border: none;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.22);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 9002;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transition: opacity 0.16s ease, transform 0.16s ease, filter 0.16s ease;
}

.fab:active {
  filter: brightness(0.94);
}

.fab.is-hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
}

.fab svg {
  width: 26px;
  height: 26px;
  fill: none;
  stroke: #fff;
  stroke-width: 2.5;
  stroke-linecap: round;
}

.release-modal[hidden] {
  display: none;
}

.release-modal {
  position: fixed;
  inset: 0;
  z-index: 9800;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom));
}

.release-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.56);
}

.release-modal-card {
  position: relative;
  z-index: 1;
  width: min(460px, 100%);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 20px 34px rgba(0, 0, 0, 0.2);
  padding: 18px 16px 14px;
}

.release-modal-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  border: 1px solid rgba(0, 0, 0, 0.16);
  border-radius: 999px;
  background: #fff;
  color: rgba(0, 0, 0, 0.6);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.release-modal-title {
  font-size: 18px;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 8px;
}

.release-modal-text {
  color: rgba(0, 0, 0, 0.78);
  font-size: 14px;
  line-height: 1.44;
}

.release-modal-hint {
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: rgba(0, 0, 0, 0.78);
  font-size: 14px;
  line-height: 1.4;
}

.release-menu-chip {
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: var(--brand);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 2px;
}

.release-menu-chip span {
  width: 10px;
  height: 1.6px;
  background: #fff;
  border-radius: 2px;
  display: block;
}

.release-help-chip {
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  border: 1px solid rgba(123, 0, 0, 0.24);
  background: rgba(123, 0, 0, 0.08);
  color: var(--brand);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 800;
  line-height: 1;
}

.release-modal-actions {
  margin-top: 14px;
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.release-modal-btn {
  width: auto;
}

@media (max-width: 520px) {
  .release-modal-card {
    padding: 16px 12px 12px;
  }

  .release-modal-actions {
    flex-direction: column-reverse;
  }

  .release-modal-btn {
    width: 100%;
  }
}
