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

html, body {
  min-height: 100%;
  font-family: 'Nunito', system-ui, sans-serif;
  background: #EFF8FE;
  color: #0C2D48;
  -webkit-tap-highlight-color: transparent;
}

button { font-family: inherit; }

/* ── Views ── */
.view { display: none; }
.view.active { display: block; }

/* ── Header ── */
.ph-header {
  background: linear-gradient(175deg, #0B7AB0 0%, #0966A0 100%);
  padding: 52px 24px 34px;
  position: relative;
}

.ph-header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.ph-header-eyebrow {
  font-size: 13px;
  font-weight: 700;
  color: rgba(255,255,255,0.65);
  margin-bottom: 3px;
}

.ph-header-title {
  font-size: 26px;
  font-weight: 900;
  color: #fff;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.ph-header-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.hub-back {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  margin-right: 12px;
  flex-shrink: 0;
}

.ph-wave {
  background: #0966A0;
  display: block;
}

.ph-wave svg { display: block; width: 100%; height: 30px; }

/* ── Home grid ── */
.hub-grid {
  padding: 10px 16px 32px;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.hub-tile {
  flex: 0 0 calc(50% - 7px);
  background: #fff;
  border: none;
  border-radius: 22px;
  padding: 22px 14px 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  box-shadow: 0 2px 14px rgba(0,100,180,0.09);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.15s ease;
}

.hub-tile:active { transform: scale(0.96); }

.hub-tile-icon {
  width: 56px;
  height: 56px;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}

.hub-tile-title {
  font-size: 15px;
  font-weight: 800;
  color: #0C2D48;
  margin-bottom: 3px;
}

.hub-tile-teaser {
  font-size: 12px;
  font-weight: 600;
  color: #7C93A8;
  line-height: 1.3;
}

@media (min-width: 640px) {
  .hub-grid { padding: 24px 32px 40px; gap: 18px; }
  .hub-tile { flex: 0 0 calc(33.333% - 12px); padding: 28px 18px 22px; }
  .hub-tile-icon { width: 64px; height: 64px; border-radius: 20px; }
  .hub-tile-title { font-size: 16px; }
}

@media (min-width: 960px) {
  .hub-tile { flex: 0 0 calc(25% - 13.5px); }
}

/* ── Info sheet content ── */
.hub-info-heading {
  display: flex;
  align-items: center;
  margin-bottom: 18px;
}

.hub-info-icon {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 12px;
  flex-shrink: 0;
}

.hub-info-list { list-style: none; }

.hub-info-row {
  padding: 12px 0;
  border-bottom: 1.5px solid #F1F5F9;
}

.hub-info-row:last-child { border-bottom: none; }

.hub-info-label {
  font-size: 12px;
  font-weight: 800;
  color: #5B6B7C;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 3px;
}

.hub-info-value {
  font-size: 16px;
  font-weight: 700;
  color: #0C2D48;
}

.hub-checklist-row {
  padding: 12px 0;
  border-bottom: 1.5px solid #F1F5F9;
  display: flex;
  align-items: center;
}

.hub-checklist-row:last-child { border-bottom: none; }

.hub-checklist-icon {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #F1F5F9;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 12px;
  flex-shrink: 0;
}

.hub-checklist-text {
  font-size: 15px;
  font-weight: 700;
  color: #0C2D48;
}

/* ── Locked field / last-name gate ── */
.hub-lock-row .hub-info-label {
  display: flex;
  align-items: center;
  gap: 6px;
}

.hub-lock-prompt {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

.hub-lock-input {
  flex: 1;
  min-width: 0;
  border: 1.5px solid #E2E8F0;
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 15px;
  font-weight: 600;
  color: #0C2D48;
  background: #F8FBFD;
  outline: none;
}

.hub-lock-input:focus { border-color: #0EA5E9; }

.hub-lock-btn {
  border: none;
  border-radius: 12px;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 800;
  color: #fff;
  background: #0EA5E9;
  cursor: pointer;
  appearance: none;
  flex-shrink: 0;
}

.hub-lock-btn:disabled { opacity: 0.6; cursor: default; }

.hub-lock-error {
  font-size: 12px;
  font-weight: 700;
  color: #F43F5E;
  margin-top: 6px;
}

.hub-info-value.copyable { cursor: pointer; }

.hub-copy-hint {
  font-size: 11px;
  font-weight: 600;
  color: #0EA5E9;
  margin-top: 2px;
}

/* ── Cards (pool control) ── */
.ph-body {
  padding: 6px 16px 24px;
  display: flex;
  flex-direction: column;
}

.ph-card {
  background: #fff;
  border-radius: 22px;
  padding: 18px 20px;
  box-shadow: 0 2px 14px rgba(0,100,180,0.09);
  margin-bottom: 12px;
}

.ph-card-header {
  display: flex;
  align-items: center;
  margin-bottom: 14px;
}

.ph-card-icon-wrap {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: #EFF8FE;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 10px;
  flex-shrink: 0;
}

.ph-card-title {
  font-size: 17px;
  font-weight: 800;
  color: #0C2D48;
}

/* ── Rows ── */
.ph-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1.5px solid #F1F5F9;
}

.ph-row-left { display: flex; align-items: center; }

.ph-row-icon { width: 18px; height: 18px; margin-right: 10px; flex-shrink: 0; }

.ph-row-label { font-size: 14px; font-weight: 700; color: #334155; }

.ph-row-sub { font-size: 12px; font-weight: 600; margin-top: 1px; }

/* ── Toggle pill ── */
.ph-pill {
  width: 56px;
  height: 32px;
  border-radius: 16px;
  background: #CBD5E1;
  display: flex;
  align-items: center;
  padding: 0 3px;
  justify-content: flex-start;
  cursor: pointer;
  transition: background 0.25s;
  flex-shrink: 0;
  border: none;
  appearance: none;
  outline: none;
}

.ph-pill.on       { background: #0EA5E9; justify-content: flex-end; }
.ph-pill.on.heat  { background: #F97316; }
.ph-pill.pending  { opacity: 0.5; }

.ph-pill-thumb {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,0.14);
  display: block;
  pointer-events: none;
}

/* ── Temp row ── */
.ph-temp-row {
  margin-top: 12px;
  background: #F8FBFD;
  border-radius: 14px;
  padding: 11px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.ph-temp-label {
  font-size: 11px;
  font-weight: 700;
  color: #64748B;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.ph-temp-value { font-size: 20px; font-weight: 800; color: #0C2D48; }

.ph-temp-empty { font-size: 14px; font-weight: 600; color: #94A3B8; }

/* ── Loading ── */
.ph-loading {
  text-align: center;
  padding: 48px 24px;
  font-size: 15px;
  font-weight: 600;
  color: #94A3B8;
}

/* ── Modal scrim ── */
.ph-scrim {
  position: fixed;
  top: 0; right: 0; bottom: 0; left: 0;
  background: rgba(12,45,72,0.45);
  z-index: 20;
  display: flex;
  align-items: flex-end;
  animation: fade-in 0.2s ease;
}

/* ── Bottom sheet ── */
.ph-sheet {
  background: #fff;
  border-radius: 28px 28px 0 0;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  padding: 0 24px 40px;
  animation: sheet-up 0.28s cubic-bezier(0.32,0.72,0,1);
}

.ph-sheet-handle {
  display: flex;
  justify-content: center;
  padding: 12px 0 18px;
}

.ph-sheet-handle-bar {
  width: 36px;
  height: 4px;
  border-radius: 2px;
  background: #CBD5E1;
}

.ph-sheet-heading {
  display: flex;
  align-items: center;
  margin-bottom: 4px;
}

.ph-sheet-heading svg { margin-right: 10px; flex-shrink: 0; }

.ph-sheet-title { font-size: 18px; font-weight: 900; color: #0C2D48; }

.ph-sheet-sub { font-size: 13px; color: #64748B; font-weight: 600; margin: 0 0 22px; }

.ph-dur-grid { display: flex; flex-wrap: wrap; margin-bottom: 16px; }

.ph-dur-btn {
  flex: 0 0 calc(50% - 5px);
  background: #FFF7ED;
  border: 2px solid #FED7AA;
  border-radius: 16px;
  padding: 18px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  appearance: none;
  margin-bottom: 10px;
  outline: none;
}

.ph-dur-btn:nth-child(odd)  { margin-right: 10px; }
.ph-dur-btn:nth-child(even) { margin-right: 0; }

.ph-dur-num { font-size: 22px; font-weight: 900; color: #EA580C; display: block; }

.ph-dur-tag {
  font-size: 11px;
  font-weight: 700;
  color: #9A3412;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  display: block;
  margin-top: 4px;
}

.ph-sheet-cancel {
  text-align: center;
  padding: 12px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  color: #94A3B8;
  appearance: none;
  background: none;
  border: none;
  width: 100%;
  outline: none;
}

/* ── Desktop two-column pool cards ── */
@media (min-width: 700px) {
  .ph-header { padding-top: 28px; }

  #view-pool .ph-body {
    flex-direction: row;
    padding: 24px 32px 32px;
    align-items: flex-start;
  }

  #view-pool .ph-card { flex: 1; padding: 28px; margin-bottom: 0; }
  #view-pool .ph-card:first-child { margin-right: 24px; }

  .ph-card-icon-wrap { width: 44px; height: 44px; border-radius: 14px; margin-right: 12px; }

  .ph-card-title { font-size: 22px; }

  .ph-row { padding: 14px 0; }
  .ph-row-label { font-size: 15px; }

  .ph-pill { width: 64px; height: 36px; }
  .ph-pill-thumb { width: 30px; height: 30px; }

  .ph-scrim { align-items: center; justify-content: center; }

  .ph-sheet {
    border-radius: 24px;
    width: 400px;
    max-height: 80vh;
    padding: 32px;
    animation: none;
    box-shadow: 0 24px 60px rgba(0,0,0,0.2);
  }

  .ph-sheet-handle { display: none; }
}

@keyframes sheet-up {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}
@keyframes fade-in {
  from { opacity: 0; } to { opacity: 1; }
}

/* ── Loading overlay ── */
.ph-scrim-center { align-items: center; justify-content: center; }

.ph-loading-card {
  background: #fff;
  border-radius: 20px;
  padding: 32px 44px;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-shadow: 0 12px 40px rgba(0,0,0,0.2);
}

.ph-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid #E0F2FE;
  border-top-color: #0B7AB0;
  border-radius: 50%;
  margin-bottom: 14px;
  animation: ph-spin 0.75s linear infinite;
}

.ph-loading-msg { font-size: 15px; font-weight: 700; color: #0C2D48; text-align: center; }

@keyframes ph-spin {
  to { transform: rotate(360deg); }
}
