:root {
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: #f7f2e9;
  color: #2f3a2f;
}

.app {
  --orb-size: clamp(180px, 56vw, 250px);
  min-height: 100vh;
  position: relative;
  padding: max(24px, env(safe-area-inset-top)) 20px max(24px, env(safe-area-inset-bottom));
}

.orb {
  --orb-color: #b8b3aa;
  --orb-shadow-color: rgba(0, 0, 0, 0.25);
  width: var(--orb-size);
  aspect-ratio: 1;
  border-radius: 9999px;
  background: var(--orb-color);
  display: grid;
  place-items: center;
  overflow: hidden;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
  transform: scale(1);
  transition: background 220ms ease, transform 120ms linear, box-shadow 120ms linear;
  position: fixed;
  top: calc(33vh - (var(--orb-size) / 2));
  left: 50%;
  margin-left: calc(var(--orb-size) / -2);
}

.orb.idle {
  --orb-color: #b8b3aa;
}

.orb.connected {
  background: var(--orb-color);
}

.orb-shader {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: none;
  z-index: 1;
  pointer-events: none;
}

.orb.connected .orb-shader {
  display: block;
}

.status-stack {
  position: relative;
  z-index: 2;
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.status-label {
  display: none;
  color: rgb(0 0 0 / 30%);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.dots {
  display: none;
  align-items: center;
  gap: 10px;
}

.orb.connecting .status-stack,
.orb.forwarding .status-stack {
  display: flex;
}

.orb.connecting .dots,
.orb.forwarding .dots {
  display: flex;
}

.orb.forwarding .status-label {
  display: block;
}

.dots span {
  width: 12px;
  height: 12px;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.95);
  animation: dot-bounce 1s infinite ease-in-out;
}

.orb.forwarding .dots span {
  background: rgb(0 0 0 / 30%);
}

.dots span:nth-child(2) {
  animation-delay: 0.15s;
}

.dots span:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes dot-bounce {
  0%,
  80%,
  100% {
    transform: translateY(0);
    opacity: 0.5;
  }
  40% {
    transform: translateY(-8px);
    opacity: 1;
  }
}

.ticket-card {
  position: fixed;
  top: calc(33vh - (var(--orb-size) / 2) - 92px);
  left: 50%;
  width: min(280px, calc(100vw - 40px));
  padding: 12px 14px;
  border: 0;
  border-radius: 18px;
  background: rgb(255 255 255 / 72%);
  box-shadow: 0 12px 36px rgb(0 0 0 / 12%);
  color: #264434;
  font: inherit;
  text-align: left;
  opacity: 0;
  transform: translate(-50%, 16px) scale(0.96);
  z-index: 5;
  cursor: pointer;
}

.ticket-card.show {
  animation: ticket-in 420ms cubic-bezier(0.2, 0.9, 0.2, 1) forwards;
}

.ticket-card strong {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: #66725f;
  font-size: 0.85rem;
}

.ticket-status {
  border-radius: 999px;
  padding: 2px 8px;
  color: #264434;
  font-size: 0.75rem;
  font-weight: 800;
  white-space: nowrap;
}

.ticket-status.green {
  background: #bfe8c7;
}

.ticket-status.red {
  background: #f2b8b5;
}

.ticket-status.yellow {
  background: #f0df9a;
}

#ticketMeta {
  display: block;
  margin-top: 6px;
  color: #264434;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.ticket-modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgb(47 58 47 / 34%);
  z-index: 20;
}

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

.ticket-modal-card {
  position: relative;
  width: min(520px, 100%);
  max-height: min(680px, calc(100vh - 40px));
  overflow: auto;
  padding: 22px;
  border-radius: 24px;
  background: #fffaf0;
  box-shadow: 0 24px 80px rgb(0 0 0 / 24%);
  animation: modal-in 180ms ease-out;
}

.ticket-modal-card h2 {
  margin: 10px 0 8px;
}

.ticket-modal-card pre {
  white-space: pre-wrap;
  word-break: break-word;
  color: #66725f;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.85rem;
}

.ticket-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 999px;
  background: #e7dfd1;
  color: #264434;
  font-size: 1.4rem;
  cursor: pointer;
}

@keyframes ticket-in {
  to {
    opacity: 1;
    transform: translate(-50%, 0) scale(1);
  }
}

@keyframes modal-in {
  from {
    opacity: 0;
    transform: scale(0.96);
  }
}

.call-btn {
  border: 0;
  border-radius: 9999px;
  min-width: 190px;
  padding: 14px 24px;
  font-size: 1.15rem;
  font-weight: 700;
  color: #264434;
  background: #bfe8c7;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  position: fixed;
  left: 50%;
  bottom: 33vh;
  transform: translate(-50%, 50%);
}

.call-btn.hangup {
  background: #f2b8b5;
}

.material-symbols-rounded {
  font-size: 22px;
  line-height: 1;
  color: inherit;
}

.top-icon {
  position: fixed;
  top: max(16px, env(safe-area-inset-top));
  right: max(16px, env(safe-area-inset-right));
  width: 44px;
  height: 44px;
  border-radius: 9999px;
  display: grid;
  place-items: center;
  color: #264434;
  background: rgb(255 255 255 / 60%);
  text-decoration: none;
  box-shadow: 0 8px 24px rgb(0 0 0 / 10%);
  z-index: 10;
}

.calendar-page {
  width: min(900px, 100%);
  margin: 0 auto;
  padding: max(64px, env(safe-area-inset-top)) 20px 32px;
}

.calendar-header p {
  margin: 0 0 6px;
  color: #66725f;
  font-weight: 700;
}

.calendar-header h1 {
  margin: 0 0 24px;
  font-size: clamp(2rem, 7vw, 3.5rem);
}

.calendar-card {
  background: rgb(255 255 255 / 55%);
  border-radius: 28px;
  padding: 22px;
  margin-bottom: 18px;
  box-shadow: 0 12px 36px rgb(0 0 0 / 8%);
}

.calendar-card h2 {
  margin: 0 0 16px;
}

.hours-list {
  display: grid;
  gap: 10px;
}

.hours-list div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  border-top: 1px solid rgb(38 68 52 / 12%);
}

.hours-list div:first-child {
  border-top: 0;
}

.calendar-toolbar h2 {
  text-transform: capitalize;
}

.month-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
}

.calendar-weekday {
  color: #66725f;
  font-size: 0.85rem;
  font-weight: 800;
  text-align: center;
}

.calendar-day {
  min-height: 104px;
  padding: 9px;
  border: 1px solid rgb(38 68 52 / 12%);
  border-radius: 16px;
  background: rgb(255 255 255 / 45%);
}

.calendar-day.empty {
  background: transparent;
  border-color: transparent;
}

.day-number {
  display: block;
  margin-bottom: 6px;
  font-weight: 800;
}

.calendar-event {
  margin-top: 5px;
  padding: 6px;
  border-radius: 10px;
  background: #bfe8c7;
  color: #264434;
  font-size: 0.75rem;
  line-height: 1.25;
}

.calendar-event strong {
  display: block;
}

.utxo-wordmark {
  position: fixed;
  right: max(20px, env(safe-area-inset-right));
  bottom: max(20px, env(safe-area-inset-bottom));
  width: 72px;
  height: auto;
  z-index: 10;
}

@media (max-width: 640px) {
  .month-grid {
    gap: 4px;
  }

  .calendar-card {
    padding: 14px;
  }

  .calendar-day {
    min-height: 78px;
    padding: 5px;
    border-radius: 10px;
  }

  .calendar-event {
    padding: 4px;
    font-size: 0.65rem;
  }
}
