:root {
  --color-primary: #1e3b58;
  --color-bg: #eef3f6;
  --color-accent: #4caacd;
  --color-cta: #f3a83f;
  --color-white: #ffffff;
  --color-text-soft: #c8d8e2;
  --color-shadow: rgba(30, 59, 88, 0.18);
  --auth-hero-image: url("../QHATAI.png");
  --fs-xs: 0.78rem;
  --fs-sm: 0.88rem;
  --fs-md: 0.98rem;
  --fs-lg: 1.1rem;
  --fs-xl: clamp(1.55rem, 6.2vw, 2.05rem);
  --radius-xl: 30px;
  --radius-lg: 24px;
  --radius-md: 18px;
  --shadow-soft: 0 18px 45px -28px var(--color-shadow);
  --bottom-nav-item-height: 52px;
  --bottom-nav-padding-y: 0.5rem;
  --bottom-nav-padding-x: 0.52rem;
  --bottom-nav-total-height: 92px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  font-family: "Teachers", sans-serif;
  background: var(--color-bg);
  color: var(--color-primary);
  min-height: 100%;
  line-height: 1.35;
}

img {
  max-width: 100%;
  display: block;
}

button,
input,
textarea,
select {
  font: inherit;
}

.auth-body {
  min-height: 100dvh;
  background: #ffffff;
}

.auth-layout {
  min-height: 100dvh;
  display: grid;
  grid-template-rows: 55dvh 45dvh;
  overflow: hidden;
}

.auth-hero {
  background-color: #ffffff;
  background-image: var(--auth-hero-image);
  background-size: contain;
  background-position: center top;
  background-repeat: no-repeat;
}

@media (display-mode: standalone), (display-mode: fullscreen) {
  .auth-layout {
    grid-template-rows: minmax(210px, 48dvh) 1fr;
  }

  .auth-hero {
    background-size: contain;
    background-position: center top;
  }
}

@media (max-height: 760px) {
  .auth-layout {
    grid-template-rows: minmax(190px, 44dvh) 1fr;
  }
}

.auth-panel {
  background: linear-gradient(180deg, #ffffff 0%, #f9fbfd 100%);
  padding: 1.1rem 1.1rem 1.2rem;
}

.auth-forms {
  margin-top: 0;
}

.auth-card-wrap {
  max-width: 430px;
  margin: 0 auto;
}

.auth-form {
  display: none;
  animation: fade-in 240ms ease both;
}

.auth-form.is-active {
  display: grid;
  gap: 0.62rem;
}

.auth-form label {
  color: #1e3b58;
  font-size: var(--fs-sm);
  font-weight: 600;
  letter-spacing: 0.01em;
}

.auth-form input {
  border: 0;
  border-bottom: 1.5px solid rgba(30, 59, 88, 0.45);
  padding: 0.52rem 0;
  background: transparent;
  color: #1e3b58;
  font-size: var(--fs-md);
  outline: none;
  transition: border-color 220ms ease;
}

.auth-form input::placeholder {
  color: rgba(30, 59, 88, 0.52);
}

.auth-form input:focus {
  border-color: #1e3b58;
}

.btn {
  border: 0;
  border-radius: 14px;
  padding: 0.72rem 1rem;
  font-size: var(--fs-md);
  line-height: 1.2;
  cursor: pointer;
  transition: transform 220ms ease, filter 220ms ease;
}

.btn:hover {
  filter: brightness(1.03);
}

.btn:active {
  transform: translateY(1px) scale(0.995);
}

.btn-primary {
  background: var(--color-cta);
  color: #243747;
  font-weight: 700;
}

.btn-login {
  margin-top: 0.4rem;
  background: #4caacd;
  color: #ffffff;
  font-weight: 700;
  letter-spacing: 0.045em;
}

.btn-register.link-btn {
  margin-top: 0.25rem;
  width: 100%;
  background: #e9f7fd;
  color: #1e3b58;
  font-weight: 700;
  font-size: var(--fs-sm);
  letter-spacing: 0.015em;
  border: 1px solid rgba(76, 170, 205, 0.38);
  border-radius: 12px;
  padding: 0.64rem 0.75rem;
}

.login-options-row {
  margin: 0.14rem 0 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.7rem;
}

.remember-row {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: var(--fs-sm);
  color: #1e3b58;
}

.remember-row input {
  width: 15px;
  height: 15px;
  margin: 0;
}

.link-btn {
  border: 0;
  background: transparent;
  color: #1e3b58;
  cursor: pointer;
  padding: 0;
  font-size: var(--fs-sm);
}

.inline-link {
  margin-top: 0.3rem;
  justify-self: start;
}

.signup-row {
  margin: 0.55rem 0 0;
  text-align: center;
  color: #1e3b58;
  font-size: var(--fs-sm);
}

.signup-btn {
  background: transparent;
  font-weight: 700;
  color: #1e3b58;
  font-size: var(--fs-sm);
  padding: 0;
  cursor: pointer;
}

.feedback {
  margin: 0.55rem 0 0;
  min-height: 1.2rem;
  color: #2d7ea0;
  font-size: var(--fs-xs);
}

.app-shell {
  min-height: 100dvh;
  padding-bottom: calc(var(--bottom-nav-total-height) + 0.6rem);
  background: #ffffff;
}

.center-alert-toast {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(13, 27, 40, 0.32);
  z-index: 90;
  padding: 1rem;
}

.center-alert-toast[hidden] {
  display: none;
}

.center-alert-card {
  position: relative;
  width: min(420px, 92vw);
  border-radius: 16px;
  padding: 0.95rem 1rem;
  border: 1px solid #d5e3f0;
  background: #ffffff;
  box-shadow: 0 22px 56px -34px rgba(12, 31, 48, 0.55);
  animation: rise-in 240ms ease both;
}

.center-alert-card.is-square {
  width: min(292px, 86vw);
  min-height: 232px;
  display: grid;
  align-content: center;
  text-align: center;
  padding: 1rem;
}

.center-alert-card.level-ok {
  border-color: #bfe2c9;
  background: #effbf3;
}

.center-alert-card.level-mild {
  border-color: #efcf95;
  background: #fff7ea;
}

.center-alert-card.level-high {
  border-color: #efb2b2;
  background: #fff1f1;
}

.center-alert-close {
  position: absolute;
  top: 0.55rem;
  right: 0.55rem;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 0;
  background: rgba(30, 59, 88, 0.08);
  color: #1e3b58;
  cursor: pointer;
  font-weight: 700;
}

.center-alert-level {
  margin: 0;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.16rem 0.5rem;
  font-size: 0.7rem;
  font-weight: 700;
  color: #1e3b58;
  background: rgba(30, 59, 88, 0.1);
}

.center-alert-title {
  margin: 0.38rem 0 0;
  color: #1e3b58;
  font-size: 0.9rem;
  font-weight: 700;
}

.center-alert-message {
  margin: 0.3rem 0 0;
  color: #2e4358;
  font-size: 0.84rem;
}

.center-alert-actions {
  margin: 0.55rem 0 0;
  padding-left: 1rem;
  display: grid;
  gap: 0.25rem;
}

.center-alert-actions li {
  color: #2b4257;
  font-size: 0.8rem;
  line-height: 1.45;
}

.center-alert-footer {
  margin-top: 0.6rem;
  display: flex;
  justify-content: flex-end;
}

.center-alert-primary-btn {
  border: 0;
  border-radius: 10px;
  padding: 0.5rem 0.8rem;
  background: #1e3b58;
  color: #ffffff;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
}

.app-header {
  padding: 1.2rem 1rem 0.7rem;
}

.app-header .brand {
  background: var(--color-primary);
  border-radius: var(--radius-lg);
  color: var(--color-white);
  box-shadow: var(--shadow-soft);
  padding: 1rem;
}

.app-header h1 {
  margin: 0;
  font-size: 1.55rem;
}

.app-header p {
  margin: 0.3rem 0 0;
  color: var(--color-text-soft);
}

.view {
  display: none;
  padding: 0 1rem 1rem;
}

main > .view:not(.is-active) {
  display: none !important;
}

#view-tienda {
  padding: 0 0 1rem;
  overflow-x: hidden;
}

.view.is-active {
  display: block;
  animation: fade-in 260ms ease both;
}

.card {
  background: var(--color-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  padding: 1rem;
  margin-bottom: 1rem;
}

.card h2,
.card h3 {
  margin-top: 0;
}

.form-grid {
  display: grid;
  gap: 0.75rem;
}

.field input {
  width: 100%;
  border: 0;
  border-radius: var(--radius-md);
  padding: 0.72rem 0.85rem;
  background: #f5f8fa;
  color: var(--color-primary);
  box-shadow: inset 0 0 0 1px rgba(30, 59, 88, 0.08);
}

.alert-box {
  border-radius: var(--radius-lg);
  padding: 1rem;
  background: #f4f8fb;
}

.alert-box strong {
  display: block;
  margin-bottom: 0.35rem;
}

.alert-ok {
  border-left: 6px solid #4caacd;
}

.alert-mild {
  border-left: 6px solid #f3a83f;
}

.alert-high {
  border-left: 6px solid #d27b2f;
  background: #fff4e8;
}

.guide-steps {
  display: grid;
  gap: 0.8rem;
}

.guide-step {
  border-radius: var(--radius-md);
  padding: 0.85rem;
  background: #f5f9fc;
}

.guide-media {
  margin-top: 0.5rem;
  border-radius: var(--radius-md);
  width: 100%;
  border: 0;
  aspect-ratio: 16 / 9;
}

.whatsapp-btn {
  display: inline-flex;
  width: 100%;
  justify-content: center;
  text-decoration: none;
  font-weight: 700;
}

.store-banner {
  position: relative;
  z-index: 4;
  background: var(--color-primary);
  color: var(--color-white);
  padding: 0.45rem 0;
  margin-left: -1rem;
  margin-right: -1rem;
  border-radius: 0;
  box-shadow: none;
  margin-bottom: 0;
  overflow: hidden;
}

.store-banner-track {
  display: inline-flex;
  align-items: center;
  gap: 2.25rem;
  width: max-content;
  white-space: nowrap;
  padding-left: 1rem;
  animation: store-banner-move 12s linear infinite;
}

.store-banner-item {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.flag-peru {
  width: 24px;
  height: 15px;
  border-radius: 2px;
  background: linear-gradient(
    90deg,
    #d91023 0% 33.33%,
    #ffffff 33.33% 66.66%,
    #d91023 66.66% 100%
  );
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.4);
  flex: 0 0 auto;
}

@keyframes store-banner-move {
  from {
    transform: translateX(0);
  }

  to {
    transform: translateX(calc(-50% - 1.125rem));
  }
}

.store-video-card {
  margin-left: -1rem;
  margin-right: -1rem;
  padding: 0;
  margin-bottom: 0;
}

.store-video-wrap {
  border-radius: 0;
  overflow: hidden;
  background: #000000;
  aspect-ratio: 21 / 8;
}

.store-video-wrap video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.store-showcase {
  padding: 0.9rem 0.7rem 1rem;
  background:
    radial-gradient(circle at top right, rgba(76, 170, 205, 0.16), transparent 32%),
    radial-gradient(circle at top left, rgba(30, 59, 88, 0.1), transparent 28%),
    linear-gradient(180deg, #edf4fa 0%, #ffffff 100%);
  min-height: 100%;
}

.store-showcase-panel {
  background: transparent;
  border-radius: 0;
  padding: 0;
  box-shadow: none;
}

.store-topbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 0.8rem;
  padding-right: 0.15rem;
}

.store-heading-block {
  display: grid;
  gap: 0.22rem;
}

.store-kicker {
  margin: 0;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #6a84a0;
}

.store-topbar-title {
  margin: 0;
  font-size: clamp(1.7rem, 8vw, 2.3rem);
  line-height: 0.98;
  font-weight: 800;
  color: #1e3b58;
}

.store-topbar-subtitle {
  margin: 0.12rem 0 0;
  color: #60788f;
  font-size: 0.76rem;
  line-height: 1.42;
  max-width: 30ch;
}

.store-cart-icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  background: #1e3b58;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  flex: 0 0 auto;
  transition: transform 0.18s, filter 0.18s;
  position: relative;
  margin-right: 0.1rem;
}

.store-cart-icon-btn:hover {
  filter: brightness(1.04);
  transform: translateY(-1px);
}

.store-cart-icon-btn svg {
  width: 21px;
  height: 21px;
  fill: #ffffff;
}

.cart-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  background: #4caacd;
  color: #ffffff;
  font-size: 0.65rem;
  font-weight: 700;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.store-toolbar {
  margin-top: 0.95rem;
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  gap: 0.55rem;
  align-items: center;
}

.store-tool-btn {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  border: 1px solid #d9e7f2;
  background: #ffffff;
  color: #52708a;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.store-tool-btn svg {
  width: 17px;
  height: 17px;
  fill: currentColor;
}

.store-info-pill {
  min-height: 38px;
  border-radius: 999px;
  background: #f2f7fb;
  color: #58748d;
  padding: 0.45rem 0.75rem;
  display: grid;
  align-content: center;
  border: 1px solid #dbe8f2;
}

.store-info-pill strong,
.store-info-pill span {
  display: block;
}

.store-info-pill strong {
  font-size: 0.7rem;
}

.store-info-pill span {
  font-size: 0.62rem;
  opacity: 0.8;
}

.store-featured-product {
  margin-top: 0.9rem;
  border-radius: 22px;
  background: linear-gradient(145deg, #f2f8fd 0%, #ffffff 100%);
  border: 1px solid #dce8f2;
  padding: 0.95rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 110px;
  gap: 0.7rem;
  align-items: center;
}

.store-featured-copy {
  display: grid;
  gap: 0.28rem;
}

.store-featured-chip {
  justify-self: start;
  border-radius: 999px;
  padding: 0.16rem 0.5rem;
  background: #1e3b58;
  color: #ffffff;
  font-size: 0.62rem;
  font-weight: 700;
}

.store-featured-copy h3,
.store-featured-copy p,
.store-featured-copy strong {
  margin: 0;
}

.store-featured-copy h3 {
  color: #1e3b58;
  font-size: 1rem;
}

.store-featured-copy p {
  color: #667d93;
  font-size: 0.74rem;
  line-height: 1.42;
}

.store-featured-copy strong {
  color: #1e3b58;
  font-size: 1rem;
}

.store-featured-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  margin-top: 0.25rem;
}

.store-featured-btn {
  border: 0;
  border-radius: 999px;
  background: #1e3b58;
  color: #ffffff;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.45rem 0.8rem;
  cursor: pointer;
  touch-action: manipulation;
}

.store-featured-media {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 18px;
  background: radial-gradient(circle at top, rgba(255,255,255,0.7), rgba(207, 226, 241, 0.24));
  display: grid;
  place-items: center;
}

.store-featured-media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Cart view */
#view-carrito {
  padding: 0 0 1rem;
}

.cart-view-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1rem 0.8rem;
  border-bottom: 1px solid #e4ecf4;
}

.cart-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 600;
  color: #4caacd;
  padding: 0;
  flex: 0 0 auto;
}

.cart-back-btn svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: #4caacd;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.cart-view-title {
  flex: 1;
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
  color: #1e3b58;
}

.cart-view-count {
  font-size: 0.76rem;
  color: #5f7389;
  font-weight: 700;
  flex: 0 0 auto;
}

.cart-view-body {
  padding: 0.75rem 1rem;
}

.store-title-block {
  padding: 1rem 1rem 0;
}

.store-title-block h2 {
  margin: 0;
  font-size: 1.12rem;
  color: #1e3b58;
}

.admin-products-panel {
  margin: 0.9rem 0 0;
  background: #f6fafc;
  border: 1px solid #d9e6f2;
  border-radius: 14px;
  padding: 0.85rem;
}

.admin-product-form {
  display: grid;
  gap: 0.45rem;
}

.admin-product-form label {
  font-size: 0.78rem;
  font-weight: 700;
  color: #20415f;
}

.admin-product-form input,
.admin-product-form textarea {
  width: 100%;
  border: 1px solid #cfddeb;
  border-radius: 10px;
  padding: 0.52rem 0.62rem;
  background: #ffffff;
}

.admin-product-form textarea {
  resize: vertical;
}

.admin-image-picker {
  border: 1px dashed #c9d9ea;
  border-radius: 10px;
  background: #f7fbff;
  padding: 0.55rem;
}

.admin-image-preview {
  width: 100%;
  max-height: 160px;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 0.35rem;
}

.admin-image-hint {
  margin: 0;
  font-size: 0.75rem;
  color: #5b6f82;
}

.admin-form-grid {
  display: grid;
  gap: 0.55rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.admin-check-row {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin-top: 0.25rem;
}

.admin-check-row input {
  width: auto;
}

.admin-form-actions {
  display: flex;
  gap: 0.55rem;
  margin-top: 0.25rem;
}

.btn-secondary {
  border: 1px solid #c8d7e8;
  background: #ffffff;
  color: #1e3b58;
}

.admin-products-list {
  display: grid;
  gap: 0.5rem;
  margin-top: 0.8rem;
}

.admin-product-item {
  display: grid;
  gap: 0.35rem;
  border: 1px solid #d6e4f1;
  background: #ffffff;
  border-radius: 12px;
  padding: 0.55rem 0.65rem;
}

.admin-product-top {
  display: flex;
  justify-content: space-between;
  gap: 0.6rem;
  align-items: center;
}

.admin-product-meta {
  margin: 0;
  font-size: 0.8rem;
  color: #2a4660;
}

.admin-product-actions {
  display: flex;
  gap: 0.45rem;
}

.admin-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  font-size: 0.7rem;
  padding: 0.15rem 0.45rem;
  font-weight: 700;
}

.admin-chip-active {
  background: #def3e5;
  color: #1d7b3f;
}

.admin-chip-inactive {
  background: #f8e0dd;
  color: #983128;
}

.products-grid {
  display: grid;
  gap: 0.7rem;
  margin-top: 1rem;
  padding: 0;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.product-card {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.5rem;
  border-radius: 18px;
  background: #ffffff;
  padding: 0.62rem;
  box-shadow: 0 18px 34px -30px rgba(30, 32, 37, 0.45);
  border: 1px solid #dce8f2;
}

.product-thumb-wrap {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  background: linear-gradient(180deg, #eef5fb 0%, #ffffff 100%);
  aspect-ratio: 0.92 / 1;
}

.product-card img {
  width: 100%;
  height: 100%;
  max-height: none;
  object-fit: contain;
  object-position: center;
  padding: 0.55rem;
}

.product-stock-chip {
  position: absolute;
  left: 0.42rem;
  top: 0.42rem;
  border-radius: 999px;
  font-size: 0.62rem;
  font-weight: 700;
  padding: 0.18rem 0.42rem;
  backdrop-filter: blur(2px);
}

.product-stock-chip.is-available {
  background: rgba(227, 248, 234, 0.95);
  color: #1b7a3f;
}

.product-stock-chip.is-out {
  background: rgba(255, 236, 236, 0.96);
  color: #9b2d2d;
}

.product-body {
  display: grid;
  gap: 0.32rem;
}

.product-category {
  margin: 0;
  color: #7088a0;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.product-card h4 {
  margin: 0;
  font-size: 0.86rem;
  line-height: 1.2;
  color: #1e3b58;
}

.product-card p {
  margin: 0;
  color: #688096;
  font-size: 0.68rem;
  line-height: 1.3;
  min-height: 2.45em;
}

.product-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.7rem;
  margin-top: 0.2rem;
}

.product-price {
  color: #1e3b58;
  font-size: 1rem;
}

.product-add-btn {
  width: 34px;
  min-width: 34px;
  height: 34px;
  border-radius: 50%;
  padding: 0;
  font-size: 0;
  font-weight: 700;
  display: grid;
  place-items: center;
  position: relative;
  z-index: 1;
  touch-action: manipulation;
}

.product-add-btn::before {
  content: "+";
  font-size: 1rem;
  line-height: 1;
}

.product-add-btn.is-added::before {
  content: "\2713";
  font-size: 0.92rem;
}

.product-add-btn.is-added {
  background: #1e3b58;
  color: #ffffff;
  transform: scale(1.05);
}

.product-add-btn[disabled] {
  background: #d7e3ef;
  color: #5c7186;
}

.store-cart-card {
  margin-top: 0;
  background: transparent;
  border-radius: 0;
  padding: 0.75rem 1rem;
  border: 0;
}

#cart-count {
  font-size: 0.76rem;
  color: #5f7389;
  font-weight: 700;
}

.cart-items {
  display: grid;
  gap: 0.5rem;
  margin-bottom: 0.7rem;
}

.cart-item {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 0.45rem;
  border-radius: 10px;
  background: #f7fbff;
  border: 1px solid #dce8f4;
  padding: 0.45rem 0.55rem;
}

.cart-item p {
  margin: 0;
  font-size: 0.78rem;
  color: #2e4153;
}

.cart-qty-controls {
  display: inline-flex;
  gap: 0.3rem;
  align-items: center;
}

.cart-qty-btn {
  border: 0;
  width: 24px;
  height: 24px;
  border-radius: 8px;
  background: #1e3b58;
  color: #ffffff;
  font-size: 0.85rem;
  cursor: pointer;
}

.cart-qty-value {
  min-width: 20px;
  text-align: center;
  font-weight: 700;
  color: #1e3b58;
  font-size: 0.8rem;
}

.bottom-nav {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  width: min(460px, calc(100% - 0.9rem));
  bottom: max(0.38rem, env(safe-area-inset-bottom));
  background: var(--color-primary);
  border-radius: 28px;
  box-shadow: 0 18px 34px -24px rgba(13, 31, 49, 0.85);
  border: 1px solid rgba(122, 169, 194, 0.22);
  padding: 0.4rem 0.42rem calc(0.46rem + env(safe-area-inset-bottom));
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.2rem;
  z-index: 30;
  overflow: visible;
}

.bottom-nav::before {
  content: none;
}

.nav-plus-btn {
  border: 0;
  border-radius: 50%;
  background: #f3a83f;
  color: #1e3b58;
  width: 56px;
  height: 56px;
  min-height: 56px;
  margin: -20px auto 0;
  font-size: 1.5rem;
  line-height: 1;
  font-weight: 700;
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 14px 24px -16px rgba(33, 67, 96, 0.65), 0 0 0 5px var(--color-primary);
  position: relative;
  z-index: 2;
}

.nav-btn {
  border: 0;
  border-radius: 16px;
  background: transparent;
  color: #a7c4d6;
  display: grid;
  justify-items: center;
  gap: 0.22rem;
  min-height: var(--bottom-nav-item-height);
  padding: 0.35rem 0.14rem;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.nav-btn svg {
  width: 17px;
  height: 17px;
  fill: currentColor;
}

.nav-btn.is-active {
  background: rgba(255, 255, 255, 0.14);
  color: var(--color-white);
  transform: translateY(-1px);
}

.nav-btn span {
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.profile-info {
  display: grid;
  gap: 0.7rem;
}

.profile-view {
  display: none;
  gap: 0.8rem;
  background: #edf3f8;
  margin: 0;
  padding: 0.7rem 0.65rem 1.1rem;
}

.view.is-active.profile-view {
  display: grid !important;
}

.profile-settings-card {
  background: linear-gradient(165deg, #f7f9fc 0%, #ffffff 100%);
  border: 1px solid #dae5ef;
  border-radius: 24px;
  padding: 0.9rem 0.82rem;
  box-shadow: 0 18px 32px -30px rgba(30, 59, 88, 0.45);
  display: grid;
  gap: 0.55rem;
}

.profile-settings-header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.2rem;
}

.profile-settings-header h2 {
  margin: 0;
  text-align: center;
  font-size: 1rem;
  color: #1e3b58;
  font-weight: 800;
}

.profile-header-back {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 0;
  background: #e6eef6;
  color: #355878;
  display: grid;
  place-items: center;
  padding: 0;
  opacity: 0.95;
}

.profile-header-back svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.profile-hero-top {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.72rem;
}

.profile-identity-row {
  border: 1px solid #e2ebf4;
  border-radius: 16px;
  padding: 0.58rem;
  background: #ffffff;
}

.profile-avatar {
  width: 58px;
  height: 58px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 0.96rem;
  background: linear-gradient(145deg, #4caacd 0%, #7ec2dc 100%);
  color: #ffffff;
  border: 0;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  padding: 0;
}

.profile-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-main-info h3 {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.2;
  color: #1e3b58;
  font-weight: 800;
}

.profile-kicker {
  margin: 0;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.75);
}

.profile-email-line {
  margin: 0.18rem 0 0;
  font-size: 0.73rem;
  color: #6e8295;
}

.profile-row-left {
  display: inline-flex;
  align-items: center;
  gap: 0.52rem;
  min-width: 0;
}

.profile-row-left svg {
  width: 14px;
  height: 14px;
  fill: #70849a;
  flex-shrink: 0;
}

.profile-row-left span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-row-arrow {
  width: 16px;
  height: 16px;
  color: #9aaaba;
  display: inline-grid;
  place-items: center;
}

.profile-row-arrow svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.profile-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.95rem;
}

.profile-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.24rem 0.6rem;
  font-size: 0.72rem;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
}

.profile-chip-primary {
  background: rgba(243, 168, 63, 0.92);
  color: #1f3b58;
}

.profile-settings-label {
  margin: 0.42rem 0 0.16rem;
  font-size: 0.72rem;
  color: #8b9cae;
  font-weight: 700;
}

.profile-section {
  background: #f8fbfe;
  box-shadow: 0 12px 24px -24px rgba(30, 59, 88, 0.45);
  margin: 0;
  padding: 1rem;
  border-top: 0;
  border-radius: 18px;
  border: 1px solid #dde8f2;
}

.profile-section + .profile-section {
  margin-top: 0.1rem;
}

.history-card {
  display: grid;
  gap: 0.65rem;
}

.history-filters {
  display: flex;
  gap: 0.45rem;
}

.history-filter-btn {
  border: 0;
  border-radius: 999px;
  padding: 0.42rem 0.7rem;
  background: #eef3f8;
  color: #1e3b58;
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
}

.history-filter-btn.is-active {
  background: #1e3b58;
  color: #ffffff;
}

.history-list {
  display: grid;
  gap: 0.55rem;
}

.history-item {
  border-radius: 12px;
  background: #f8fbfe;
  border: 1px solid #e1ecf5;
  padding: 0.6rem;
}

.history-item-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

.history-top-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.history-date {
  font-size: 0.72rem;
  color: #6a7a8c;
}

.history-level {
  font-size: 0.72rem;
  font-weight: 700;
  border-radius: 999px;
  padding: 0.18rem 0.5rem;
}

.history-level-ok {
  background: #e7f7fb;
  color: #1b7e9f;
}

.history-level-mild {
  background: #fff4e3;
  color: #b6791f;
}

.history-level-high {
  background: #ffe8dd;
  color: #ad4f25;
}

.history-delete-btn {
  border: 0;
  border-radius: 999px;
  padding: 0.18rem 0.48rem;
  font-size: 0.66rem;
  background: #f5dfe0;
  color: #8f2f37;
  font-weight: 700;
  cursor: pointer;
}

.history-values {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.4rem;
}

.history-values p {
  margin: 0;
  font-size: 0.75rem;
  color: #2b3a48;
}

.history-empty {
  border-radius: 12px;
  background: #f7fafc;
  border: 1px dashed #d8e5f1;
  padding: 0.7rem;
  color: #627487;
  font-size: 0.78rem;
}

.account-settings-card {
  display: grid;
  gap: 0.55rem;
}

.account-settings-list {
  display: grid;
  gap: 0.24rem;
}

.account-setting-item {
  width: 100%;
  border: 0;
  background: #ffffff;
  border-radius: 12px;
  color: #1e3b58;
  padding: 0.66rem 0.16rem;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 0.4rem;
  text-align: left;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  border-bottom: 1px solid #edf2f7;
}

.account-setting-state {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 0.16rem 0.45rem;
  background: #dfeefa;
  color: #1f4e72;
  font-size: 0.66rem;
  font-weight: 700;
}

.profile-aux-list {
  display: grid;
  gap: 0.24rem;
  margin-top: 0.28rem;
}

.profile-link-row {
  width: 100%;
  border: 0;
  border-bottom: 1px solid #edf2f7;
  background: transparent;
  color: #1e3b58;
  padding: 0.64rem 0.16rem;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 0.4rem;
  text-align: left;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
}

.profile-link-row.profile-logout-row {
  margin-top: 0.15rem;
  color: #a64249;
}

.profile-link-row.profile-logout-row .profile-row-left svg {
  fill: #a64249;
}

.premium-footer {
  background: #ffffff;
  border: 1px solid #d6e4f1;
  color: #1e3b58;
  display: grid;
  gap: 0.4rem;
}

.premium-label {
  margin: 0;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #56718a;
}

.premium-version {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 700;
  color: #1e3b58;
}

.contact-card a {
  color: var(--color-accent);
  text-decoration: none;
}

.contact-list {
  display: grid;
  gap: 0.4rem;
}

.contact-list p {
  margin: 0;
  font-size: 0.82rem;
}

.profile-view .tag-new {
  background: #f3a83f;
  color: #1e3b58;
}

.view-home {
  padding: 0 0.8rem 1rem;
}

.home-hero {
  background: #ffffff;
  border-radius: 0;
  padding: 0.2rem 0 0.65rem;
  min-height: auto;
  margin: 0 0 0.8rem;
}

.home-hero::before,
.home-hero::after {
  content: none;
}

.home-hero-meta {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.5rem;
}

.home-hero-main {
  display: grid;
  align-content: center;
  justify-items: start;
  gap: 0.32rem;
  margin-top: 0;
  position: relative;
  z-index: 1;
  text-align: left;
}

.home-hero-card {
  margin-top: 0.72rem;
  display: grid;
  align-content: center;
  gap: 0.2rem;
  background: url("../canva.png") center / cover no-repeat;
  border-radius: 16px;
  padding: 1rem 0.9rem 1.1rem;
  min-height: 182px;
  box-shadow: 0 16px 28px -22px rgba(20, 43, 66, 0.7);
}

.home-brand-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0;
  border-radius: 0;
  background: transparent;
  color: #1e3b58;
  font-size: 0.96rem;
  font-weight: 800;
  min-height: 38px;
}

.home-hero-side {
  display: grid;
  justify-items: end;
  align-content: start;
  gap: 0;
}

.home-hero-logo {
  width: 38px;
  height: 38px;
  object-fit: contain;
  filter: none;
}

.home-meta-tools {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.home-bell-btn {
  border: 0;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #e8f0f6;
  color: #1e3b58;
  display: grid;
  place-items: center;
  cursor: pointer;
  position: relative;
}

.home-bell-btn svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.home-bell-alert-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  min-width: 15px;
  height: 15px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-size: 0.58rem;
  font-weight: 700;
  line-height: 1;
  color: #ffffff;
  background: #ee6c3d;
}

.home-bell-alert-badge.is-mild {
  background: #f3a83f;
}

.home-bell-alert-badge.is-high {
  background: #d64545;
}

.home-profile-chip {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #d9e7f1;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid #d3e0ea;
  box-shadow: none;
}

.home-profile-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.home-profile-initials {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #1e3b58;
}

.home-greeting-kicker {
  margin: 0;
  color: rgba(255, 255, 255, 0.74);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.home-greeting-lg {
  margin: 0;
  color: #ffffff;
  font-size: clamp(1.66rem, 5.4vw, 2rem);
  font-weight: 700;
  line-height: 1.03;
}

#welcome-name {
  color: #8fd4ef;
  font-weight: 700;
}

.home-subgreeting {
  margin: 0;
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.76rem;
  line-height: 1.4;
  max-width: 30ch;
}

.home-quick-actions {
  margin-top: 0.72rem;
  display: grid;
  grid-template-columns: repeat(3, 42px);
  gap: 0.95rem;
  justify-content: start;
  justify-items: start;
  position: relative;
  z-index: 1;
}

.home-quick-btn {
  border: 0;
  border-radius: 0;
  padding: 0;
  background: transparent;
  color: #ffffff;
  display: grid;
  justify-items: center;
  gap: 0;
  cursor: pointer;
}

.home-quick-btn small {
  display: none;
}

.home-quick-icon {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  background: rgba(11, 28, 44, 0.54);
  box-shadow: inset 0 0 0 1px rgba(143, 212, 239, 0.18);
  display: grid;
  place-items: center;
}

.home-quick-icon svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.home-block {
  background: #ffffff;
  border-radius: 16px;
  padding: 0.85rem;
  box-shadow: 0 14px 32px -24px rgba(19, 31, 43, 0.35);
  margin-bottom: 0.8rem;
}

.home-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.6rem;
}

.home-title-row h3 {
  margin: 0;
  font-size: 1rem;
  color: #1b2731;
}

.home-link {
  border: 0;
  background: transparent;
  color: #1e3b58;
  font-weight: 700;
  font-size: 0.8rem;
}

.home-chip-muted {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.14rem 0.45rem;
  background: #edf3f8;
  color: #577188;
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.home-info-carousel {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(210px, 1fr);
  gap: 0.55rem;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 0.2rem;
}

.home-info-slide {
  border-radius: 14px;
  padding: 0.78rem;
  color: #ffffff;
  scroll-snap-align: start;
  min-height: 128px;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 0.3rem;
  text-align: center;
}

.home-info-slide--a {
  background: linear-gradient(135deg, #1e3b58 0%, #24537d 100%);
}

.home-info-slide--b {
  background: linear-gradient(135deg, #2b4d66 0%, #315f7f 100%);
}

.home-info-slide--c {
  background: linear-gradient(135deg, #20566b 0%, #2d7f8f 100%);
}

.home-info-slide h4 {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.2;
}

.home-info-slide p {
  margin: 0;
  font-size: 0.78rem;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.86);
  max-width: 26ch;
}

.home-highlight-grid {
  display: grid;
  gap: 0.52rem;
}

.home-reels-carousel {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(142px, 1fr);
  gap: 0.6rem;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 0.18rem;
}

.home-reel-card {
  position: relative;
  min-height: 228px;
  border-radius: 18px;
  overflow: hidden;
  scroll-snap-align: start;
  background: #0f1f2f;
}

.home-reel-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: #000000;
}

.home-reel-card::after {
  content: none;
}

.home-reel-badge {
  position: relative;
  z-index: 1;
}

.home-reel-badge {
  position: absolute;
  top: 0.65rem;
  left: 0.65rem;
  border-radius: 999px;
  padding: 0.16rem 0.44rem;
  background: rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(4px);
  font-size: 0.64rem;
  font-weight: 700;
  color: #ffffff;
}

.home-highlight-card {
  border-radius: 14px;
  padding: 0.72rem;
  background: #f7fbff;
  border: 1px solid #e2edf6;
  display: grid;
  gap: 0.24rem;
}

.home-highlight-tag {
  justify-self: start;
  border-radius: 999px;
  padding: 0.1rem 0.42rem;
  background: #e1f3fb;
  color: #2f607b;
  font-size: 0.62rem;
  font-weight: 700;
}

.home-highlight-card h4 {
  margin: 0;
  font-size: 0.9rem;
  color: #1e3b58;
}

.home-highlight-card p {
  margin: 0;
  font-size: 0.78rem;
  color: #5f7181;
  line-height: 1.42;
}

.social-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.55rem;
}

.social-card {
  text-decoration: none;
  background: #f2f6fa;
  border-radius: 14px;
  padding: 0.7rem 0.45rem;
  text-align: center;
  color: #1e3b58;
  display: grid;
  gap: 0.18rem;
}

.social-card-icon {
  width: 28px;
  height: 28px;
  margin: 0 auto;
  fill: #1e3b58;
}

.social-card small {
  font-size: 0.72rem;
  font-weight: 600;
  color: #1e3b58;
}

.ideal-grid {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(112px, 1fr);
  gap: 0.55rem;
  overflow-x: auto;
  padding-bottom: 0.2rem;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
}

.ideal-card {
  border: 0;
  background: linear-gradient(145deg, #edf6fc, #f8fbff);
  border-radius: 14px;
  padding: 0.7rem;
  text-align: center;
  color: #1e3b58;
  display: grid;
  gap: 0.28rem;
  justify-items: center;
  align-content: center;
  aspect-ratio: 1 / 1;
  scroll-snap-align: start;
}

.ideal-icon {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  background: #d5e9f7;
}

.ideal-icon svg {
  width: 18px;
  height: 18px;
  fill: #1e3b58;
}

.ideal-card[data-fill="ph"] .ideal-icon {
  background: #d2ecf9;
}

.ideal-card[data-fill="chlorine"] .ideal-icon {
  background: #d8f0f2;
}

.ideal-card[data-fill="volume"] .ideal-icon {
  background: #dce7fb;
}

.ideal-card small {
  color: #6f7f8f;
  font-size: 0.74rem;
  line-height: 1.2;
}

.ideal-value {
  font-size: 1rem;
  font-weight: 700;
  color: #1e3b58;
}

.media-grid {
  display: grid;
  gap: 0.72rem;
}

.media-card {
  text-decoration: none;
  background: #f8fbff;
  border-radius: 14px;
  padding: 0.72rem;
  color: #1e3b58;
  border: 1px solid #e3edf5;
}

.media-card-head {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  margin-bottom: 0.15rem;
}

.media-thumb {
  height: 92px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem;
  position: relative;
  overflow: hidden;
}

.media-thumb-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}

.media-thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.2), rgba(30, 59, 88, 0.22));
  z-index: 1;
}

.media-thumb svg {
  width: 24px;
  height: 24px;
  fill: #1e3b58;
  background: rgba(255, 255, 255, 0.82);
  border-radius: 50%;
  padding: 4px;
  position: relative;
  z-index: 2;
}

.media-thumb-video {
  background: linear-gradient(120deg, #d8ecf8, #edf7ff);
}

.media-thumb-manual {
  background: linear-gradient(120deg, #e6f2fb, #f7fbff);
}

.media-thumb-check {
  background: linear-gradient(120deg, #dff0ff, #f2f8ff);
}

.media-chip {
  font-size: 0.68rem;
  background: #1e3b58;
  color: #ffffff;
  border-radius: 999px;
  padding: 0.18rem 0.5rem;
  font-weight: 700;
  position: relative;
  z-index: 2;
}

.media-card h4 {
  margin: 0.62rem 0 0;
  font-size: 0.96rem;
}

.media-card p {
  margin: 0.28rem 0 0;
  font-size: 0.8rem;
  color: #647487;
}

.home-parameter-form {
  display: grid;
  gap: 0.45rem;
}

.home-parameter-form label {
  font-size: 0.76rem;
  color: #788391;
}

.home-parameter-form input {
  border: 0;
  border-bottom: 1px solid #ccd4db;
  padding: 0.45rem 0;
  background: transparent;
  color: #202c39;
  outline: none;
}

.btn-home-evaluate {
  margin-top: 0.5rem;
  border-radius: 11px;
  background: #1e3b58;
  color: #ffffff;
  font-weight: 700;
}

.btn-home-more {
  margin-top: 0.45rem;
  border-radius: 11px;
  background: #4caacd;
  color: #ffffff;
  font-weight: 700;
}

.home-feedback {
  margin-top: 0.5rem;
  min-height: 1rem;
  color: #44586f;
}

.home-status-text {
  margin: 0;
  color: #4f6072;
  font-size: 0.84rem;
  line-height: 1.5;
}

.home-status-grid {
  margin-top: 0.68rem;
  display: grid;
  gap: 0.5rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.home-status-item {
  border: 1px solid #d9e7f2;
  border-radius: 12px;
  background: #f8fbff;
  padding: 0.56rem;
  display: grid;
  gap: 0.2rem;
}

.home-status-item small {
  color: #66798d;
  font-size: 0.72rem;
}

.home-status-item strong {
  color: #1e3b58;
  font-size: 0.86rem;
}

.home-inline-actions {
  margin-top: 0.62rem;
  display: grid;
  gap: 0.5rem;
  grid-template-columns: 1fr 1fr;
}

.home-level-ok {
  background: #e6f8ee;
  color: #256a3f;
}

.home-level-mild {
  background: #fff3df;
  color: #8a5a14;
}

.home-level-high {
  background: #ffe3e3;
  color: #9a2b2b;
}

.home-task-progress {
  font-size: 0.78rem;
  font-weight: 700;
  color: #1e3b58;
  background: #edf4fa;
  border: 1px solid #d8e5f2;
  border-radius: 999px;
  padding: 0.15rem 0.45rem;
}

.home-task-list {
  display: grid;
  gap: 0.45rem;
}

.home-task-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border: 1px solid #deebf5;
  border-radius: 11px;
  background: #f9fcff;
  padding: 0.48rem 0.56rem;
  color: #284256;
  font-size: 0.82rem;
}

.home-task-item input {
  width: 15px;
  height: 15px;
  accent-color: #4caacd;
}

.home-maintenance-title {
  margin: 0;
  color: #1e3b58;
  font-size: 0.96rem;
  font-weight: 700;
}

.home-maintenance-text {
  margin: 0.36rem 0 0;
  color: #4f6072;
  font-size: 0.84rem;
  line-height: 1.52;
}

@media (max-width: 520px) {
  .home-status-grid {
    grid-template-columns: 1fr;
  }

  .home-inline-actions {
    grid-template-columns: 1fr;
  }
}

.notification-card {
  margin-top: 0.4rem;
  border: 1px solid #d5e3f0;
  border-radius: 14px;
  padding: 0.75rem;
  background: #f7fbff;
}

.notification-level {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #3e5f7b;
}

.notification-card h4 {
  margin: 0.22rem 0 0;
  font-size: 0.98rem;
  color: #1e3b58;
}

.notification-card p {
  margin: 0.28rem 0 0;
  color: #4f6072;
  font-size: 0.84rem;
}

.notification-card.level-high {
  border-color: #f2b5b5;
  background: #fff2f2;
}

.notification-card.level-high .notification-level {
  color: #b62d2d;
}

.notification-card.level-mild {
  border-color: #f4d7a5;
  background: #fff8ed;
}

.notification-card.level-mild .notification-level {
  color: #9a6620;
}

.notification-card.level-ok {
  border-color: #cce7d5;
  background: #eefaf2;
}

.notification-card.level-ok .notification-level {
  color: #2b7a45;
}

.notification-actions {
  margin-top: 0.7rem;
  display: grid;
  gap: 0.5rem;
}

.notification-history {
  margin-top: 0.65rem;
  border: 1px solid #d7e4f0;
  border-radius: 14px;
  background: linear-gradient(170deg, #f6fbff 0%, #f1f7fc 100%);
  padding: 0.72rem;
}

.notification-history-head h4 {
  margin: 0;
  color: #1e3b58;
  font-size: 0.86rem;
}

.notification-history-head p {
  margin: 0.2rem 0 0;
  color: #5f7387;
  font-size: 0.72rem;
}

.notification-history-state {
  margin-top: 0.52rem;
  border-radius: 10px;
  border: 1px dashed #c7d8e8;
  background: #f8fbfe;
  padding: 0.52rem;
  color: #637b91;
  font-size: 0.76rem;
}

.notification-history-chart {
  margin-top: 0.58rem;
  display: grid;
  grid-template-columns: repeat(14, minmax(0, 1fr));
  align-items: end;
  gap: 0.28rem;
  min-height: 106px;
  padding: 0.45rem 0.25rem 0.3rem;
  border-radius: 11px;
  background: #ffffff;
  border: 1px solid #e0ebf5;
}

.notification-bar {
  display: grid;
  align-items: end;
  justify-items: center;
  gap: 0.2rem;
}

.notification-bar-track {
  width: 100%;
  max-width: 12px;
  height: 74px;
  border-radius: 999px;
  background: #eaf1f8;
  position: relative;
  overflow: hidden;
}

.notification-bar-fill {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  border-radius: 999px;
  background: linear-gradient(180deg, #4caacd 0%, #1e4f76 100%);
}

.notification-bar-fill.is-chlorine {
  background: linear-gradient(180deg, #85c7de 0%, #2f6e97 100%);
}

.notification-bar-label {
  color: #64798d;
  font-size: 0.62rem;
  font-weight: 700;
}

.notification-history-list {
  margin-top: 0.55rem;
  display: grid;
  gap: 0.36rem;
}

.notification-history-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.5rem;
  align-items: center;
  border-radius: 10px;
  border: 1px solid #deebf5;
  background: #ffffff;
  padding: 0.45rem 0.52rem;
}

.notification-history-date {
  color: #60778d;
  font-size: 0.68rem;
  min-width: 54px;
}

.notification-history-values {
  color: #35506b;
  font-size: 0.72rem;
}

.notification-history-level {
  border-radius: 999px;
  padding: 0.14rem 0.45rem;
  font-size: 0.62rem;
  font-weight: 700;
}

.notification-history-level.level-ok {
  background: #e8f7ec;
  color: #2c7e49;
}

.notification-history-level.level-mild {
  background: #fff2dd;
  color: #9b6920;
}

.notification-history-level.level-high {
  background: #ffe6e6;
  color: #b73a3a;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 20, 31, 0.45);
  display: grid;
  align-items: end;
  z-index: 45;
}

.modal-overlay[hidden] {
  display: none;
}

.modal-card {
  background: #ffffff;
  border-radius: 20px 20px 0 0;
  padding: 1rem 1rem 1.2rem;
  box-shadow: 0 -14px 40px -26px rgba(10, 20, 31, 0.5);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.65rem;
}

.modal-header h3 {
  margin: 0;
  color: #1e3b58;
}

.modal-close {
  border: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #eef3f6;
  color: #1e3b58;
  cursor: pointer;
}

.pool-base-card h2 {
  margin: 0;
  font-size: 1.08rem;
}

.control-step-banner {
  border: 0;
  background: linear-gradient(135deg, #173b5a 0%, #1e4a70 62%, #275c85 100%);
  border-radius: 0;
  padding: 0.72rem 0.78rem;
  margin: 0 -1rem 0.58rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.65rem;
  align-items: center;
  box-shadow: none;
}

.control-step-copy {
  min-width: 0;
  display: grid;
  align-content: center;
}

.control-step-banner h3 {
  margin: 0;
  color: #ffffff;
  font-size: clamp(1.84rem, 6.2vw, 2.32rem);
  line-height: 1.1;
  max-width: 14ch;
}

.control-step-banner p {
  margin: 0.25rem 0 0;
  color: rgba(225, 237, 247, 0.9);
  font-size: 0.84rem;
  line-height: 1.3;
}

.control-step-image {
  width: 52px;
  height: 52px;
  object-fit: contain;
  opacity: 0.95;
}

.tag-new {
  background: #f3a83f;
  color: #1e3b58;
  border-radius: 999px;
  padding: 0.2rem 0.58rem;
  font-size: 0.68rem;
  font-weight: 700;
}

.pool-base-grid {
  display: grid;
  gap: 0.45rem;
}

.pool-base-grid label {
  font-size: 0.78rem;
  color: #5b6c7d;
}

.pool-base-grid input {
  border: 0;
  border-bottom: 1px solid #cfd9e3;
  padding: 0.52rem 0;
  outline: none;
  color: #1e3b58;
}

.pool-volume-results {
  margin-top: 0.7rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem;
}

.pool-volume-results p {
  margin: 0;
  border-radius: 12px;
  background: #f7fafd;
  padding: 0.55rem;
  font-size: 0.78rem;
}

.control-hub {
  margin-top: 0.8rem;
  display: grid;
  gap: 0.62rem;
}

.control-tabbar {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.42rem;
}

.control-tab-btn {
  border: 0;
  border-radius: 11px;
  background: #dceaf6;
  color: #31506a;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.48rem 0.24rem;
  cursor: pointer;
}

.control-tab-btn.is-active {
  background: #1e3b58;
  color: #ffffff;
}

.control-panel {
  border-radius: 14px;
  border: 1px solid #dde8f2;
  background: #ffffff;
  overflow: hidden;
}

.control-panel-head {
  padding: 0.75rem 0.8rem;
  background: linear-gradient(145deg, #edf5fb 0%, #f8fbfe 100%);
  border-bottom: 1px solid #e5edf5;
}

.control-panel-head h3 {
  margin: 0;
  color: #1e3b58;
  font-size: 0.9rem;
}

.control-panel-head p {
  margin: 0.28rem 0 0;
  color: #5f7387;
  font-size: 0.75rem;
  line-height: 1.35;
}

.control-panel-content {
  padding: 0.8rem;
  display: grid;
  gap: 0.65rem;
}

.control-panel-log-content {
  gap: 0.72rem;
}

.module-card {
  border-radius: 12px;
  border: 1px solid #e3ecf5;
  background: #f9fbfe;
  padding: 0.7rem;
}

.module-expand {
  padding: 0;
  overflow: hidden;
}

.module-summary {
  list-style: none;
  cursor: pointer;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 0.55rem;
  padding: 0.62rem;
}

.module-summary::-webkit-details-marker {
  display: none;
}

.module-summary::after {
  content: "+";
  font-size: 1.05rem;
  color: #1e3b58;
  font-weight: 700;
}

.module-expand[open] .module-summary::after {
  content: "-";
}

.module-summary span {
  font-size: 0.84rem;
  font-weight: 700;
  color: #1e3b58;
}

.module-body {
  border-top: 1px solid #e8eef5;
  padding: 0.7rem;
  position: relative;
  padding-right: 88px;
}

.module-support-image {
  width: 62px;
  height: 62px;
  object-fit: contain;
  position: absolute;
  top: 0.65rem;
  right: 0.7rem;
  opacity: 0.94;
}

.module-body p,
.module-body li {
  font-size: 0.78rem;
  line-height: 1.45;
  margin-right: 0.1rem;
}

.module-body ul {
  margin: 0.35rem 0 0;
  padding-left: 1rem;
}

.module-card h4 {
  margin: 0;
  font-size: 0.88rem;
  color: #1e3b58;
}

.module-card p,
.module-card li {
  font-size: 0.76rem;
  color: #4e6274;
}

.module-card ul {
  margin: 0.35rem 0 0;
  padding-left: 1rem;
}

.module-card .dose-line {
  margin-top: 0.45rem;
  color: #1f5d83;
  font-weight: 700;
}

.parameter-grid,
.problem-grid,
.action-grid,
.secret-grid {
  display: grid;
  gap: 0.55rem;
}

.parameter-input-row {
  display: grid;
  gap: 0.4rem;
  margin-top: 0.45rem;
}

.parameter-input-row input {
  border: 0;
  border-bottom: 1px solid #c8d6e5;
  background: transparent;
  padding: 0.42rem 0;
  outline: none;
}

.parameter-result {
  margin-top: 0.45rem;
  border-radius: 10px;
  background: #eef7ff;
  color: #1e3b58;
  font-size: 0.75rem;
  padding: 0.45rem;
}

.pool-chart {
  width: 100%;
  border-radius: 12px;
  border: 1px solid #e4ecf5;
  background: #fbfdff;
}

.guide-body {
  min-height: 100dvh;
  background: linear-gradient(180deg, #f5f9ff 0%, #e9f2fb 42%, #f7fbff 100%);
}

.guide-page {
  max-width: 760px;
  margin: 0 auto;
  padding: 1rem 0.95rem 1.4rem;
  display: grid;
  gap: 0.9rem;
}

.guide-header {
  background: #ffffff;
  border: 1px solid #d7e5f3;
  border-radius: 16px;
  padding: 0.85rem;
  box-shadow: 0 15px 38px -30px rgba(30, 59, 88, 0.45);
}

.guide-back-btn {
  border: 1px solid #b7cbe0;
  border-radius: 999px;
  background: #f2f8ff;
  color: #1e3b58;
  padding: 0.35rem 0.7rem;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
}

.guide-kicker {
  margin: 0.6rem 0 0;
  color: #3f6c90;
  font-size: 0.76rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.guide-header h1 {
  margin: 0.18rem 0 0;
  font-size: clamp(1.2rem, 4.5vw, 1.65rem);
}

.guide-description {
  margin: 0.32rem 0 0;
  color: #4f6072;
  font-size: 0.86rem;
}

.guide-video-card,
.guide-steps-card {
  background: #ffffff;
  border: 1px solid #d7e5f3;
  border-radius: 16px;
  padding: 0.8rem;
  box-shadow: 0 15px 38px -30px rgba(30, 59, 88, 0.45);
}

.guide-overview-grid {
  display: grid;
  gap: 0.7rem;
}

.guide-overview-card-item {
  border: 1px solid #e0ebf5;
  border-radius: 12px;
  padding: 0.7rem;
  background: linear-gradient(165deg, #f8fbff, #eef5ff);
}

.guide-overview-label {
  margin: 0 0 0.28rem;
  font-size: 0.74rem;
  font-weight: 700;
  color: #3d6f95;
  text-transform: uppercase;
}

.guide-overview-card-item p,
.guide-overview-card-item li {
  margin: 0;
  color: #52657a;
  font-size: 0.84rem;
  line-height: 1.55;
}

.guide-overview-card-item ul {
  margin: 0;
  padding-left: 1rem;
}

.guide-steps-head h2 {
  margin: 0;
  font-size: 1.08rem;
}

.guide-steps-head small {
  display: inline-block;
  margin-top: 0.2rem;
  color: #66798d;
}

.guide-steps-list {
  margin-top: 0.65rem;
  display: grid;
  gap: 0.62rem;
}

.guide-step-card {
  border: 1px solid #e0ebf5;
  border-radius: 12px;
  padding: 0.66rem;
  background: linear-gradient(165deg, #f8fbff, #eef5ff);
}

.guide-step-number {
  margin: 0;
  font-size: 0.74rem;
  font-weight: 700;
  color: #3d6f95;
  text-transform: uppercase;
}

.guide-step-card h3 {
  margin: 0.24rem 0 0;
  font-size: 0.94rem;
}

.guide-step-card p {
  margin: 0.26rem 0 0;
  color: #52657a;
  font-size: 0.84rem;
  line-height: 1.6;
}

.guide-notes-list {
  margin-top: 0.65rem;
  display: grid;
  gap: 0.62rem;
}

.guide-note-card {
  border: 1px solid #e0ebf5;
  border-radius: 12px;
  padding: 0.72rem;
  background: #f8fbff;
}

.guide-note-card p {
  margin: 0;
  color: #52657a;
  font-size: 0.84rem;
  line-height: 1.55;
}

.chart-title-row {
  margin-top: 0.2rem;
}

@keyframes fade-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (min-width: 768px) {
  .auth-layout {
    grid-template-rows: 40dvh 60dvh;
  }

  .auth-panel {
    padding: 1.6rem;
  }

  .view {
    max-width: 920px;
    margin: 0 auto;
  }

  .view-home {
    max-width: 460px;
    margin: 0 auto;
  }

  #view-tienda {
    max-width: 100%;
    margin: 0;
  }

  .products-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.72rem;
    padding: 0 0.85rem;
  }

  .product-card img {
    max-height: 132px;
  }

  .bottom-nav {
    width: min(460px, calc(100% - 0.9rem));
  }
}
