/* ==========================================================================
   Tab-screen styles — Home, Care, Profile, Help
   Detail screens live in screens-detail.css.
   ========================================================================== */

/* --- Home: header ---------------------------------------------------------- */

.home-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
}

.pinbox {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: var(--r-md);
  border: 1px solid var(--ink-200);
  color: var(--ink-800);
  flex: none;
}

.home-head__name {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 600;
  color: var(--ink-900);
  line-height: 1.15;
}

.home-head__loc {
  font-size: var(--text-lg);
  color: var(--ink-600);
}

/* --- Home: analyzing card -------------------------------------------------- */

.analyze {
  border: 1px solid var(--blue-300);
  border-radius: var(--r-sm);
  overflow: hidden;
  background: var(--surface);
}

.analyze__bar {
  position: relative;
  height: 17px;
  background: var(--surface);
}

.analyze__fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 80%;
  background: var(--grad-progress);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 9px;
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 600;
  color: #fff;
  transform-origin: left center;
  animation: bar-grow 900ms var(--ease-out-expo) both;
}

.refresh {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--blue-025);
  color: var(--blue-500);
  transition: transform var(--dur-slow) var(--ease-out-expo);
}

.refresh:hover {
  transform: rotate(180deg);
}

/* --- Home: detector -------------------------------------------------------- */

.gauge {
  display: grid;
  place-items: center;
  margin-top: 8px;
}

.gauge__value {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 600;
  fill: var(--ink-900);
}

.gauge__unit {
  font-size: 7px;
  fill: var(--ink-400);
}

.bullets {
  margin: 10px 0 0;
  display: grid;
  gap: 5px;
  font-size: var(--text-sm);
  color: var(--ink-600);
}

.bullets li {
  position: relative;
  padding-left: 12px;
}

.bullets li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 7px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--ink-400);
}

/* --- Home: news ------------------------------------------------------------ */

.news {
  position: relative;
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  aspect-ratio: 16 / 8.4;
}

.news__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.news__body {
  position: absolute;
  inset: auto 0 0;
  padding: 34px 16px 14px;
  background: linear-gradient(180deg, transparent, rgba(10, 24, 60, 0.82));
  color: #fff;
}

.news__kicker {
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--yellow-400);
}

.news__title {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 600;
  line-height: 1.3;
  margin-top: 2px;
}

/* --- Care: calendar -------------------------------------------------------- */

.calendar {
  background: var(--surface);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-card);
  padding: 18px 14px 20px;
}

.cal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 6px 14px;
}

.cal-head__month {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 600;
  color: var(--ink-900);
}

.cal-nav {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: var(--r-xs);
  color: var(--ink-800);
}

.cal-nav:hover {
  background: var(--ink-100);
}

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  row-gap: 2px;
}

.cal-dow {
  text-align: center;
  font-size: var(--text-sm);
  color: var(--ink-400);
  padding-bottom: 10px;
}

.cal-day {
  position: relative;
  height: 38px;
  display: grid;
  place-items: center;
  font-size: var(--text-md);
  color: var(--ink-500);
  z-index: 0;
}

.cal-day.is-empty {
  pointer-events: none;
}

/* Range band sits behind the numerals and rounds off at both ends. */
.cal-day.is-range::before {
  content: "";
  position: absolute;
  inset: 3px -1px;
  background: var(--blue-050);
  z-index: -1;
}

.cal-day.is-range-start::before {
  border-radius: var(--r-pill) 0 0 var(--r-pill);
  left: 1px;
}

.cal-day.is-range-end::before {
  border-radius: 0 var(--r-pill) var(--r-pill) 0;
  right: 1px;
}

.cal-day.is-selected {
  color: #fff;
  font-weight: 600;
}

.cal-day.is-selected::after {
  content: "";
  position: absolute;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--blue-600);
  z-index: -1;
}

.cal-day.is-marked {
  color: #fff;
  font-weight: 600;
}

.cal-day.is-marked::after {
  content: "";
  position: absolute;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--yellow-500);
  box-shadow: 0 6px 14px rgba(245, 205, 61, 0.5);
  z-index: -1;
}

.cal-day:not(.is-empty):hover {
  color: var(--blue-600);
}

/* --- Care: plan timeline --------------------------------------------------- */

.timeline {
  margin-top: 20px;
  display: grid;
  gap: 4px;
}

.plan {
  display: grid;
  grid-template-columns: 44px 1fr;
  align-items: stretch;
  gap: 10px;
}

.plan__hours {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 6px 0;
  font-size: var(--text-sm);
  color: var(--ink-400);
}

.plan__card {
  position: relative;
  background: var(--surface);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-card);
  padding: 14px 14px 14px 18px;
  overflow: hidden;
}

.plan__card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: var(--ink-200);
}

.plan--urgent .plan__card::before {
  background: var(--blue-600);
}

.plan--ongoing .plan__card::before {
  background: var(--yellow-500);
}

.plan__title {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 600;
  margin: 10px 0 8px;
  color: var(--ink-900);
}

.plan--urgent .plan__title {
  color: var(--blue-600);
}

.plan__time {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: var(--text-md);
  color: var(--ink-500);
}

/* --- Profile --------------------------------------------------------------- */

/* Bleeds past the scroll padding so it sits flush under the status bar. */
.profile-head {
  background: var(--surface);
  border-radius: 0 0 var(--r-lg) var(--r-lg);
  padding: 58px 20px 18px;
  margin: -62px -20px 22px;
}

.profile-head__name {
  display: block;
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 600;
  color: var(--ink-900);
  line-height: 1.2;
}

.profile-head__meta {
  display: block;
  font-size: var(--text-md);
  color: var(--ink-400);
}

.profile-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 22px;
}

.profile-stat {
  background: var(--surface);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-card);
  padding: 12px 10px;
  text-align: center;
}

.profile-stat__num {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--ink-900);
}

.profile-stat__label {
  font-size: var(--text-sm);
  color: var(--ink-400);
  margin-top: 2px;
}

.addbtn {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: var(--r-xs);
  color: var(--ink-800);
}

.addbtn:hover {
  background: var(--ink-100);
}

/* --- Help ------------------------------------------------------------------ */

.doccards {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 6px;
  margin-inline: -20px;
  padding-inline: 20px;
  scrollbar-width: none;
}

.doccards::-webkit-scrollbar {
  display: none;
}

.doccard {
  flex: 0 0 158px;
  background: var(--surface);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-card);
  padding: 10px;
}

.doccard__photo {
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 0.86;
  border-radius: var(--r-sm);
  object-fit: cover;
  background: var(--surface-tint);
  margin-bottom: 10px;
}

.doccard__photo--empty {
  display: grid;
  place-items: center;
  color: var(--blue-500);
  background: linear-gradient(150deg, var(--blue-050), #fdeef0);
}

.doccard__name {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--ink-900);
}

.doccard__role {
  font-size: var(--text-md);
  color: var(--ink-500);
  margin-bottom: 8px;
}

.doccard__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.rating {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: var(--text-md);
  color: var(--ink-800);
}

.rating svg {
  color: var(--yellow-500);
}

.btn-soft {
  padding: 6px 16px;
  border-radius: var(--r-xs);
  background: var(--blue-050);
  color: var(--blue-500);
  font-size: var(--text-md);
  font-weight: 500;
  transition: background var(--dur-fast) ease;
}

.btn-soft:hover {
  background: var(--blue-100);
}


/* --- Help: emergency hero --------------------------------------------------- */

.sos {
  position: relative;
  overflow: hidden;
  border-radius: var(--r-lg);
  padding: 20px 20px 18px;
  color: #fff;
  background: linear-gradient(138deg, #ff8d9b 0%, #f04f66 48%, #cd2745 100%);
  box-shadow: var(--shadow-fab);
}

/* Expanding rings read as a live dispatch signal. */
.sos__rings {
  position: absolute;
  top: -58px;
  right: -46px;
  width: 210px;
  height: 210px;
  opacity: 0.5;
  pointer-events: none;
}

.sos__rings circle {
  fill: none;
  stroke: rgba(255, 255, 255, 0.55);
  stroke-width: 1;
}

.sos__eyebrow {
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.82);
}

.sos__title {
  position: relative;
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 600;
  line-height: 1.12;
  margin: 4px 0 6px;
}

.sos__sub {
  position: relative;
  font-size: var(--text-md);
  font-weight: 500;
  color: #fff;
  max-width: 17rem;
}

.sos__btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: 100%;
  margin-top: 18px;
  padding: 14px;
  border-radius: var(--r-md);
  background: #fff;
  color: var(--red-500);
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 600;
  box-shadow: 0 10px 22px rgba(140, 22, 44, 0.24);
  transition: transform var(--dur-fast) var(--ease-out-expo);
}

.sos__btn:active {
  transform: scale(0.975);
}

/* --- Help: quick actions ---------------------------------------------------- */

.quick {
  display: grid;
  justify-items: start;
  gap: 8px;
  padding: 15px 14px;
  text-align: left;
}

.quick__label {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--ink-900);
}

.quick__hint {
  font-size: var(--text-sm);
  color: var(--ink-400);
}
