:root {
  color-scheme: light;
  --green-900: #173c2b;
  --green-700: #276044;
  --green-100: #e8f1eb;
  --ink: #17211b;
  --muted: #68736c;
  --line: #dfe5e1;
  --surface: #ffffff;
  --canvas: #f4f6f4;
  --yellow: #f1c453;
  --yellow-soft: #fff5d8;
  --red: #b5413b;
  --red-soft: #fbe9e7;
  --blue-soft: #e9f1f7;
  --shadow: 0 8px 26px rgba(23, 33, 27, 0.1);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  min-height: 100%;
  background: var(--canvas);
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  background: var(--canvas);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
  letter-spacing: 0;
}

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

button:focus-visible {
  outline: 3px solid rgba(241, 196, 83, 0.62);
  outline-offset: 2px;
}

.app-shell {
  width: min(100%, 860px);
  min-height: 100vh;
  margin: 0 auto;
  padding-bottom: calc(84px + var(--safe-bottom));
  background: var(--canvas);
}

.club-header {
  position: relative;
  min-height: 176px;
  overflow: hidden;
  color: #fff;
  background: var(--green-900) url("assets/padel-court-header.webp") center 54% / cover no-repeat;
}

.club-header__shade {
  position: absolute;
  inset: 0;
  background: rgba(8, 24, 16, 0.5);
}

.club-header__content {
  position: relative;
  z-index: 1;
  display: flex;
  min-height: 176px;
  flex-direction: column;
  justify-content: space-between;
  padding: calc(22px + var(--safe-top)) 20px 20px;
}

.brand-row,
.section-heading,
.sheet__heading,
.booking-row__top,
.booking-row__meta,
.profile-row,
.sheet__actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand-kicker,
.eyebrow {
  margin: 0 0 4px;
  color: inherit;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: 0;
  text-transform: uppercase;
}

.brand-kicker {
  color: #d9e7dc;
}

h1,
h2,
p {
  overflow-wrap: break-word;
}

h1 {
  margin: 0;
  font-size: 28px;
  font-weight: 760;
  line-height: 1.08;
}

h2 {
  margin: 0;
  font-size: 21px;
  font-weight: 730;
  line-height: 1.2;
}

.member-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  min-height: 27px;
  font-size: 14px;
  font-weight: 650;
}

.member-chip {
  display: inline-flex;
  min-height: 27px;
  align-items: center;
  gap: 6px;
  padding: 4px 9px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 6px;
  background: rgba(12, 30, 20, 0.52);
}

.member-chip svg {
  width: 14px;
  height: 14px;
}

.main-content {
  padding: 20px 16px 26px;
}

.view {
  animation: view-in 180ms ease-out;
}

.view[hidden] {
  display: none;
}

@keyframes view-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.section-heading {
  min-height: 48px;
  margin-bottom: 16px;
}

.section-heading .eyebrow,
.sheet__heading .eyebrow {
  color: var(--green-700);
}

.quota {
  min-width: 66px;
  padding: 7px 9px;
  border: 1px solid #cddbd1;
  border-radius: 6px;
  color: var(--green-900);
  background: var(--green-100);
  font-size: 12px;
  font-weight: 750;
  text-align: center;
  white-space: nowrap;
}

.quota.is-low {
  border-color: #ead286;
  background: var(--yellow-soft);
}

.date-strip {
  display: grid;
  grid-auto-columns: minmax(62px, 1fr);
  grid-auto-flow: column;
  gap: 8px;
  margin: 0 -16px 16px;
  padding: 0 16px 4px;
  overflow-x: auto;
  scrollbar-width: none;
}

.date-strip::-webkit-scrollbar {
  display: none;
}

.date-button {
  display: grid;
  min-width: 62px;
  height: 64px;
  place-items: center;
  align-content: center;
  gap: 1px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  background: var(--surface);
  cursor: pointer;
}

.date-button span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
  text-transform: uppercase;
}

.date-button strong {
  font-size: 20px;
  line-height: 1;
}

.date-button small {
  color: var(--muted);
  font-size: 10px;
}

.date-button.is-active {
  border-color: var(--green-900);
  color: #fff;
  background: var(--green-900);
}

.date-button.is-active span,
.date-button.is-active small {
  color: #d6e6dc;
}

.court-tabs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #e9eeea;
}

.court-tab {
  min-height: 42px;
  padding: 8px 12px;
  border: 0;
  border-radius: 5px;
  color: #526057;
  background: transparent;
  font-size: 14px;
  font-weight: 720;
  cursor: pointer;
}

.court-tab.is-active {
  color: var(--ink);
  background: var(--surface);
  box-shadow: 0 1px 4px rgba(23, 33, 27, 0.12);
}

.schedule-status {
  display: flex;
  min-height: 42px;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  margin: 11px 0 9px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.legend-dot {
  width: 9px;
  height: 9px;
  border: 1px solid transparent;
  border-radius: 50%;
  background: var(--surface);
}

.legend-dot--free { border-color: #8ca296; }
.legend-dot--busy { background: #cbd2cd; }
.legend-dot--mine { background: var(--yellow); }

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

.slot-button {
  position: relative;
  display: flex;
  min-width: 0;
  height: 57px;
  align-items: center;
  justify-content: center;
  border: 1px solid #cad5ce;
  border-radius: 6px;
  color: var(--ink);
  background: var(--surface);
  font-size: 15px;
  font-weight: 750;
  cursor: pointer;
}

.slot-button small {
  position: absolute;
  right: 4px;
  bottom: 3px;
  left: 4px;
  overflow: hidden;
  color: var(--muted);
  font-size: 8px;
  font-weight: 650;
  line-height: 1.1;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.slot-button:disabled {
  cursor: default;
}

.slot-button.is-selected {
  border-color: var(--green-900);
  color: #fff;
  background: var(--green-900);
  box-shadow: inset 0 0 0 1px var(--green-900);
}

.slot-button.is-past {
  border-color: transparent;
  color: #a1aaa4;
  background: #edf0ee;
}

.slot-button.is-busy,
.slot-button.is-blocked {
  border-color: transparent;
  color: #717b75;
  background: #dfe4e1;
}

.slot-button.is-mine,
.slot-button.is-section {
  border-color: #e1bc54;
  color: #4d3b08;
  background: var(--yellow-soft);
}

.slot-button.is-mine::before,
.slot-button.is-section::before {
  position: absolute;
  top: 5px;
  right: 6px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--yellow);
  content: "";
}

.empty-state {
  display: grid;
  min-height: 230px;
  place-items: center;
  align-content: center;
  gap: 8px;
  color: var(--muted);
  text-align: center;
}

.empty-state svg {
  width: 30px;
  height: 30px;
  color: #829088;
}

.empty-state strong {
  color: var(--ink);
  font-size: 16px;
}

.booking-list {
  display: grid;
  gap: 8px;
}

.booking-row {
  padding: 14px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--green-700);
  border-radius: 6px;
  background: var(--surface);
}

.booking-row:not(.is-own) {
  border-left-color: #aeb8b2;
}

.booking-row__top strong {
  min-width: 0;
  font-size: 15px;
}

.booking-row__time {
  margin: 4px 0 11px;
  color: var(--ink);
  font-size: 19px;
  font-weight: 770;
}

.booking-row__meta {
  color: var(--muted);
  font-size: 12px;
}

.owner-badge {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  padding: 3px 7px;
  border-radius: 5px;
  color: #4f5c54;
  background: #edf1ee;
  font-size: 11px;
  font-weight: 700;
}

.owner-badge.is-own {
  color: var(--green-900);
  background: var(--green-100);
}

.cancel-icon-button {
  display: inline-grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid #ebc6c2;
  border-radius: 6px;
  color: var(--red);
  background: var(--red-soft);
  cursor: pointer;
}

.cancel-icon-button svg {
  width: 17px;
  height: 17px;
}

.profile-panel {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.profile-identity {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 17px;
  border-bottom: 1px solid var(--line);
}

.profile-avatar {
  display: grid;
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--green-900);
  font-size: 16px;
  font-weight: 800;
}

.profile-identity strong {
  display: block;
  font-size: 17px;
}

.profile-identity span {
  color: var(--muted);
  font-size: 13px;
}

.profile-row {
  min-height: 58px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}

.profile-row:last-child {
  border-bottom: 0;
}

.profile-row__label {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-size: 13px;
}

.profile-row__label svg {
  width: 17px;
  height: 17px;
  color: var(--green-700);
}

.profile-row strong {
  max-width: 55%;
  font-size: 14px;
  text-align: right;
}

.platforms {
  display: inline-flex;
  gap: 5px;
}

.platform-mark {
  display: inline-grid;
  min-width: 28px;
  height: 24px;
  place-items: center;
  border-radius: 5px;
  color: #fff;
  background: #718078;
  font-size: 10px;
  font-weight: 800;
}

.platform-mark.is-linked {
  background: var(--green-700);
}

.icon-button {
  display: inline-grid;
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  background: var(--surface);
  cursor: pointer;
}

.icon-button svg {
  width: 18px;
  height: 18px;
}

.icon-button--glass {
  border-color: rgba(255, 255, 255, 0.36);
  color: #fff;
  background: rgba(8, 24, 16, 0.46);
}

.bottom-nav {
  position: fixed;
  z-index: 20;
  right: 0;
  bottom: 0;
  left: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  height: calc(68px + var(--safe-bottom));
  padding: 5px max(10px, calc((100vw - 860px) / 2 + 10px)) var(--safe-bottom);
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 -5px 18px rgba(23, 33, 27, 0.06);
}

.nav-button {
  display: grid;
  min-width: 0;
  place-items: center;
  align-content: center;
  gap: 3px;
  border: 0;
  color: #7a857e;
  background: transparent;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
}

.nav-button svg {
  width: 21px;
  height: 21px;
}

.nav-button.is-active {
  color: var(--green-700);
}

.selection-bar {
  position: fixed;
  z-index: 19;
  right: max(10px, calc((100vw - 840px) / 2));
  bottom: calc(76px + var(--safe-bottom));
  left: max(10px, calc((100vw - 840px) / 2));
  display: flex;
  min-height: 66px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 11px 10px 15px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  color: #fff;
  background: var(--ink);
  box-shadow: var(--shadow);
}

.selection-bar[hidden] {
  display: none;
}

.selection-bar span,
.selection-bar strong {
  display: block;
}

.selection-bar span {
  color: #bac5be;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.selection-bar strong {
  max-width: 48vw;
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.primary-button,
.secondary-button,
.danger-button {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 6px;
  font-weight: 760;
  cursor: pointer;
}

.primary-button {
  border: 1px solid var(--green-900);
  color: #fff;
  background: var(--green-900);
}

.primary-button--compact {
  min-height: 43px;
  border-color: var(--yellow);
  color: #342a0c;
  background: var(--yellow);
  font-size: 13px;
}

.secondary-button {
  border: 1px solid var(--line);
  color: var(--ink);
  background: var(--surface);
}

.danger-button {
  border: 1px solid var(--red);
  color: #fff;
  background: var(--red);
}

.primary-button svg,
.danger-button svg {
  width: 18px;
  height: 18px;
}

.primary-button:disabled,
.danger-button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.sheet {
  width: min(100%, 620px);
  max-width: 100%;
  margin: auto auto 0;
  padding: 0;
  border: 0;
  border-radius: 8px 8px 0 0;
  color: var(--ink);
  background: transparent;
}

.sheet::backdrop {
  background: rgba(11, 20, 15, 0.58);
}

.sheet__panel {
  padding: 8px 18px calc(20px + var(--safe-bottom));
  border-radius: 8px 8px 0 0;
  background: var(--surface);
}

.sheet__handle {
  width: 38px;
  height: 4px;
  margin: 0 auto 14px;
  border-radius: 2px;
  background: #d3d9d5;
}

.sheet__heading {
  margin-bottom: 18px;
}

.confirm-details {
  display: grid;
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--line);
}

.confirm-row {
  display: flex;
  min-height: 48px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  background: var(--surface);
}

.confirm-row span {
  color: var(--muted);
  font-size: 12px;
}

.confirm-row strong {
  max-width: 64%;
  font-size: 14px;
  text-align: right;
}

.sheet__actions {
  margin-top: 16px;
}

.sheet__actions > button {
  flex: 1 1 0;
}

.toast {
  position: fixed;
  z-index: 50;
  right: 16px;
  bottom: calc(84px + var(--safe-bottom));
  left: 16px;
  width: min(calc(100% - 32px), 520px);
  min-height: 46px;
  margin: 0 auto;
  padding: 12px 14px;
  border-radius: 6px;
  color: #fff;
  background: #202b24;
  box-shadow: var(--shadow);
  font-size: 13px;
  font-weight: 650;
  text-align: center;
}

.toast.is-error {
  background: #7e302c;
}

.state-view {
  display: grid;
  min-height: 360px;
  place-items: center;
  align-content: center;
  gap: 11px;
  text-align: center;
}

.state-view p {
  max-width: 340px;
  margin: 0 0 8px;
  color: var(--muted);
  line-height: 1.5;
}

.state-icon {
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  border-radius: 50%;
  color: var(--red);
  background: var(--red-soft);
}

.state-icon svg {
  width: 25px;
  height: 25px;
}

.skeleton {
  display: inline-block;
  border-radius: 5px;
  background: #e2e7e3;
  animation: pulse 1.1s ease-in-out infinite alternate;
}

.skeleton--text {
  width: 180px;
  height: 22px;
  background: rgba(255, 255, 255, 0.3);
}

.skeleton--block {
  width: 82px;
  height: 24px;
}

@keyframes pulse {
  to { opacity: 0.48; }
}

@media (max-width: 420px) {
  .slot-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .slot-button {
    height: 55px;
    font-size: 14px;
  }

  .selection-bar strong {
    max-width: 40vw;
  }
}

@media (min-width: 700px) {
  .main-content {
    padding: 24px 24px 34px;
  }

  .date-strip {
    margin-right: 0;
    margin-left: 0;
    padding-right: 0;
    padding-left: 0;
  }

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

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

@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;
  }
}

