/* Musgo — styles.css */

:root {
  /* Brand */
  --green-dark: #345D4C;
  --green-light: #ECFAF2;

  /* Text */
  --text: #191C1C;
  --muted: #878787;

  /* Surfaces */
  --white: #FFFFFF;
  --light-grey: #F3F4F3;
  --border-grey: #D9D9D9;

  /* Feedback */
  --danger: #9F402D;
  --danger-soft: rgba(159, 64, 45, 0.10);

  /* Aliases kept for backward compatibility */
  --accent: var(--green-dark);
  --surface: var(--white);
  --surface-strong: var(--white);
  --bg: var(--light-grey);
  --text-soft: var(--muted);
  --muted-soft: var(--muted);

  /* Shadows */
  --shadow-xs: 0 10px 30px rgba(25, 28, 28, 0.05);
  --shadow-sm: 0 18px 44px rgba(25, 28, 28, 0.08);
  --shadow-md: 0 26px 70px rgba(25, 28, 28, 0.12);

  /* Radius */
  --radius-sm: 16px;
  --radius-md: 22px;
  --radius-lg: 30px;
  --radius-xl: 40px;

  /* Spacing */
  --space-1: 6px;
  --space-2: 10px;
  --space-3: 14px;
  --space-4: 18px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 44px;
}

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

  body {
    font-family: 'DM Sans', sans-serif;
    min-height: 100dvh;
    color: var(--text);
    background: #FAFAF8;
    overflow-x: hidden;
  }

  .app-shell {
    min-height: 100dvh;
    display: flex;
    justify-content: center;
    padding: 0;
    background: #FAFAF8;
  }

  .app-frame {
    width: min(100%, 430px);
    min-height: 100dvh;
    height: auto;
    display: flex;
    flex-direction: column;
    border-radius: 0;
    background: #ffffff;
    border: none;
    box-shadow: none;
    overflow: visible;
    backdrop-filter: none;
  }

  /* `overflow-x: clip` contiene el breakout del tab strip (margins negativos)
     sin crear contexto de scroll. Se aplica SÓLO a la experiencia autenticada
     para no romper los elementos full-bleed de la landing (topbar, fondos
     grises) que también usan márgenes negativos para salir del frame. */
  .app-frame.authenticated-experience {
    overflow-x: clip;
    overflow-y: visible;
  }

  .mobile-topbar {
    min-height: 72px;
    width: 100%;
    margin: 0;
    padding: 16px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: #ffffff;
    position: relative;
    z-index: 5;
    border: none;
    border-bottom: 1px solid rgba(25, 28, 28, 0.12);
    border-radius: 0;
    box-shadow: none;
  }

  .topbar-menu-button {
    width: 42px;
    height: 42px;
    border: none;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: opacity 0.18s ease;
  }

  .topbar-menu-button.public-cta {
    width: auto;
    height: 44px;
    min-height: 44px;
    padding: 0 20px;
    border: 1px solid rgba(52, 93, 76, 0.24);
    border-radius: 999px;
    background: #ffffff;
    color: #345d4c;
    box-shadow: 0 8px 20px rgba(31, 52, 37, 0.04);
    gap: 10px;
    transition: transform 0.22s ease, background 0.22s ease, border-color 0.22s ease, color 0.22s ease, box-shadow 0.22s ease;
  }

  .topbar-menu-button:hover {
    background: transparent;
    transform: none;
    box-shadow: none;
    opacity: 0.72;
  }

  .topbar-menu-button.public-cta:hover {
    transform: translateY(-1px);
    border-color: rgba(79, 168, 109, 0.32);
    box-shadow: 0 12px 24px rgba(31, 52, 37, 0.06);
    opacity: 1;
  }

  .topbar-menu-button.is-open {
    background: transparent;
    box-shadow: none;
  }

  .topbar-menu-lines {
    width: 16px;
    display: flex;
    flex-direction: column;
    gap: 3px;
  }

  .topbar-menu-lines span {
    width: 100%;
    height: 2px;
    border-radius: 999px;
    background: #345d4c;
    display: block;
    transition: background 0.18s ease;
  }

  .topbar-menu-button.is-open .topbar-menu-lines span {
    background: #ffffff;
  }

  .topbar-public-icon {
    width: 18px;
    height: 18px;
    display: block;
    flex-shrink: 0;
  }

  .topbar-public-label {
    font-size: 14px;
    font-weight: 700;
    color: #345d4c;
    line-height: 1;
  }

  .mobile-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
  }

  .mobile-brand-icon {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
  }

  .mobile-brand-icon img {
    width: 100%;
    height: 100%;
    display: block;
  }

  .mobile-brand-name {
    font-family: 'DM Sans', sans-serif;
    font-size: 24px;
    font-weight: 600;
    color: #345d4c;
    letter-spacing: -0.03em;
  }

  .mobile-topbar.splash-mode {
    background: #ffffff;
  }

  .app-main {
    flex: 0 0 auto;
    overflow: visible;
    padding: 24px 28px 40px;
  }

  .app-frame.public-experience {
    background: #ffffff;
  }

  .app-frame.authenticated-experience {
    background: #ffffff;
  }

  .authenticated-app-shell {
    display: flex;
    flex-direction: column;
    min-height: 100%;
    width: 100%;
  }

  .authenticated-app-shell-content {
    display: flex;
    flex-direction: column;
    min-height: 100%;
    width: 100%;
  }

  .screen {
    display: flex;
    flex-direction: column;
    gap: 24px;
    min-height: 100%;
    animation: screen-enter 0.24s ease;
  }

  @keyframes screen-enter {
    from {
      opacity: 0;
      transform: translateY(10px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  .screen-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
  }

  .screen-back {
    border: none;
    background: rgba(255, 255, 255, 0.88);
    color: #345d4c;
    border-radius: 999px;
    min-height: 40px;
    padding: 0 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 0.84rem;
    font-weight: 700;
    box-shadow: 0 10px 24px rgba(31, 52, 37, 0.06);
    border: 1px solid rgba(52, 93, 76, 0.12);
    cursor: pointer;
  }

  .screen-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 12px;
    border-radius: 999px;
    background: rgba(79, 168, 109, 0.1);
    color: #2e7d4f;
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    width: fit-content;
  }

  .screen-intro {
    display: flex;
    flex-direction: column;
    gap: 4px;
  }

  .screen-title {
    font-family: 'DM Sans', sans-serif;
    font-size: 2rem;
    line-height: 1.1;
    font-weight: 800;
    color: #191c1c;
    letter-spacing: -0.05em;
  }

  /* ↓ Estilos de landing movidos a landing.css ↓ */


  @media (min-width: 760px) {
    .app-shell {
      padding: 0 24px 32px;
    }

    .app-frame {
      width: min(100%, 1120px);
    }

    .mobile-topbar {
      padding: 24px 32px 18px;
    }

    .app-main {
      padding: 28px 32px 56px;
    }

    .screen {
      gap: 28px;
    }

    .screen-title {
      font-size: 2.5rem;
    }

    .screen-subtitle {
      max-width: 62ch;
      font-size: 1rem;
    }

    .chip-row {
      flex-wrap: wrap;
      overflow: visible;
      padding-bottom: 0;
    }

    .plants-grid-mobile {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 14px;
    }

    .spaces-list {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(320px, 420px));
      gap: 22px;
      justify-content: start;
    }

    .dashboard-chart-card,
    .dashboard-summary-card,
    .profile-card,
    .space-card,
    .view-empty,
    .space-editor-card {
      border-radius: 10px;
    }

    .scan-panel {
      max-width: 560px;
    }

    .menu-drawer {
      right: 32px;
      width: 280px;
    }
  }

  @media (min-width: 1100px) {
    .app-main > .screen {
      width: 100%;
      max-width: 1120px;
      margin-left: auto;
      margin-right: auto;
      align-items: center;
    }

    .app-main > .screen > * {
      width: 100%;
    }

    .app-main > .screen > .screen-intro {
      width: 100%;
      max-width: 1120px;
      margin-left: auto;
      margin-right: auto;
      text-align: center;
      align-items: center;
    }

    .screen-title,
    .screen-subtitle {
      text-align: center;
      margin-left: auto;
      margin-right: auto;
    }

    .app-shell {
      justify-content: stretch;
      padding: 0;
    }

    .app-frame {
      width: 100%;
      max-width: none;
      min-height: 100dvh;
    }

    .app-frame.desktop-sidebar-layout {
      display: grid;
      grid-template-columns: 248px minmax(0, 1fr);
      grid-template-rows: 82px minmax(0, 1fr);
      column-gap: 0;
      align-items: stretch;
    }

    .mobile-topbar {
      grid-column: 1 / -1;
      grid-row: 1;
      padding: 16px 40px;
    }

    .topbar-menu-button {
      display: none;
    }

    .app-main {
      padding: 28px 40px 72px;
    }

    .app-frame.desktop-sidebar-layout .app-main {
      grid-column: 2;
      grid-row: 2;
      padding: 32px 40px 72px;
    }

    .app-frame.desktop-sidebar-layout .app-main > .screen {
      width: 100%;
      max-width: 1120px;
      margin-left: auto;
      margin-right: auto;
      align-items: center;
    }

    .app-frame.desktop-sidebar-layout .app-main > .screen > * {
      width: 100%;
    }

    .app-frame.desktop-sidebar-layout .app-main > .screen > .screen-intro {
      width: 100%;
      max-width: 1120px;
      margin-left: auto;
      margin-right: auto;
      text-align: center;
      align-items: center;
    }

    .app-frame.desktop-sidebar-layout .screen-title,
    .app-frame.desktop-sidebar-layout .screen-subtitle {
      text-align: center;
      margin-left: auto;
      margin-right: auto;
    }

    .app-frame.desktop-sidebar-layout .app-main > .screen > .chip-row {
      justify-content: center;
    }

    .menu-overlay {
      display: none;
    }

    .app-frame.desktop-sidebar-layout .menu-overlay {
      position: relative;
      top: auto;
      inset: auto;
      grid-column: 1;
      grid-row: 2;
      display: block;
      opacity: 1;
      visibility: visible;
      background: #ffffff;
      backdrop-filter: none;
      z-index: 1;
      align-self: stretch;
      pointer-events: none;
      border-right: 1px solid rgba(25, 28, 28, 0.08);
    }

    .app-frame.desktop-sidebar-layout .menu-overlay:not(.open) {
      display: none;
    }

    .menu-drawer {
      width: min(240px, calc(100% - 36px));
      border-radius: 22px;
      box-shadow: 0 18px 44px rgba(31, 52, 37, 0.12);
    }

    .app-frame.desktop-sidebar-layout .menu-drawer {
      position: sticky;
      top: 0;
      right: 0;
      width: 100%;
      min-height: 100%;
      transform: none;
      border-radius: 0;
      border: none;
      box-shadow: none;
      background: #ffffff;
      pointer-events: auto;
    }

    .plants-grid-mobile {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 14px;
      width: 100%;
    }

    .plant-tile-visual {
      width: 130px;
    }

    .spaces-list {
      display: grid;
      grid-template-columns: 600px;
      gap: 24px;
      width: fit-content;
      max-width: 100%;
      justify-content: center;
      justify-items: center;
      place-content: start center;
    }

    .space-card {
      width: 600px;
      min-width: 600px;
      max-width: 600px;
    }

    .dashboard-layout {
      display: grid;
      grid-template-columns: minmax(0, 360px) minmax(0, 1fr);
      gap: 24px;
      align-items: start;
      justify-content: center;
    }

    .dashboard-chart-card {
      min-height: 100%;
      margin-top: 0;
    }

    .profile-card {
      max-width: 720px;
    }

    .scan-panel {
      max-width: 620px;
    }

    .app-frame.desktop-sidebar-layout .plants-grid-mobile,
    .app-frame.desktop-sidebar-layout .spaces-list,
    .app-frame.desktop-sidebar-layout .dashboard-layout,
    .app-frame.desktop-sidebar-layout .scan-panel,
    .app-frame.desktop-sidebar-layout .profile-card,
    .app-frame.desktop-sidebar-layout .profile-actions,
    .app-frame.desktop-sidebar-layout .legal-links {
      margin-left: auto;
      margin-right: auto;
    }

    .app-frame.desktop-sidebar-layout .app-main > .screen > .plants-grid-mobile {
      width: fit-content;
      max-width: 100%;
    }

    .app-frame.desktop-sidebar-layout .app-main > .screen > .spaces-list {
      display: grid;
      grid-template-columns: 600px;
      width: 600px;
      min-width: 600px;
      max-width: 600px;
      justify-content: center;
    }
  }

  @media (min-width: 1100px) {
    .profile-card,
    .profile-actions {
      width: min(100%, 500px);
      max-width: 500px;
    }

    .plant-detail-layout {
      max-width: 380px;
    }

    .detail-screen .screen-head,
    .detail-screen .screen-intro,
    .detail-screen .space-editor-card,
    .detail-screen > .screen-actions {
      width: min(100%, 500px);
      max-width: 500px;
      margin-left: auto;
      margin-right: auto;
    }

    .plant-create-screen .screen-head,
    .plant-create-screen .screen-intro,
    .plant-create-screen .identified-plant-card,
    .plant-create-screen .identified-plant-form,
    .plant-create-screen .manual-plant-card,
    .plant-create-screen > .form-group,
    .plant-create-screen > .screen-actions {
      max-width: 500px;
    }

    .legal-links {
      max-width: 504px;
    }

    .auth-panel,
    .auth-legal-copy {
      max-width: 640px;
    }

    .auth-screen .screen-intro,
    .auth-screen .auth-panel,
    .auth-screen .auth-legal-copy {
      margin-left: auto;
      margin-right: auto;
    }

    .auth-screen .auth-panel,
    .auth-screen .auth-legal-copy {
      width: 374px;
      max-width: 374px;
    }

    .editor-screen,
    .detail-screen {
      align-items: center;
    }

    .editor-screen .screen-head,
    .detail-screen .screen-head {
      position: relative;
      justify-content: center;
    }

    .editor-screen .screen-head .screen-back,
    .detail-screen .screen-head .screen-back {
      position: absolute;
      left: 0;
      top: 50%;
      transform: translateY(-50%);
    }

    .editor-screen .screen-head,
    .editor-screen .screen-intro,
    .editor-screen .space-editor-card,
    .editor-screen .identified-plant-card,
    .editor-screen .identified-plant-form,
    .editor-screen .manual-plant-card,
    .editor-screen > .form-group,
    .editor-screen > .screen-actions,
    .detail-screen .screen-head,
    .detail-screen .screen-intro,
    .detail-screen .plant-detail-layout {
      width: min(100%, 560px);
      margin-left: auto;
      margin-right: auto;
    }

    .editor-screen .screen-intro,
    .detail-screen .screen-intro {
      text-align: center;
      align-items: center;
    }

    .detail-screen .screen-title,
    .detail-screen .screen-subtitle,
    .editor-screen .screen-title,
    .editor-screen .screen-subtitle {
      text-align: center;
    }
  }

  .screen-subtitle {
    color: #40493d;
    font-size: 0.95rem;
    line-height: 1.45;
  }

  .chip-row {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: none;
  }

  .chip-row::-webkit-scrollbar {
    display: none;
  }

  .filter-chip {
    border: none;
    border-radius: 999px;
    padding: 10px 24px;
    background: #edeeed;
    color: #40493d;
    font-size: 0.9rem;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
  }

  .filter-chip.active {
    background: #345d4c;
    color: #fff;
  }

  .plants-grid-mobile {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  /* ── Horizontal list tile ── */
  .plant-tile {
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 6px 20px rgba(52, 93, 76, 0.07);
    display: flex;
    flex-direction: row;
    align-items: stretch;
    height: 150px;
    border: 1px solid rgba(52, 93, 76, 0.06);
  }

  .plant-tile-visual {
    width: 150px;
    height: 150px;
    aspect-ratio: 1 / 1;
    flex-shrink: 0;
    position: relative;
    background:
      radial-gradient(circle at center, rgba(79, 168, 109, 0.18), transparent 70%),
      linear-gradient(160deg, #f2f5f1 0%, #e4ede1 100%);
    overflow: hidden;
  }

  .plant-tile-visual img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
  }

  .plant-tile-emoji {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.4rem;
  }

  .plant-tile-body {
    flex: 1;
    min-width: 0;
    padding: 14px 14px 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 5px;
  }

  .plant-tile-name {
    font-size: 1rem;
    font-weight: 800;
    color: #191c1c;
    line-height: 1.15;
    letter-spacing: -0.02em;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .plant-tile-last {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #4b564d;
    font-size: 0.85rem;
    line-height: 1.3;
  }

  .plant-tile-status-icon {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    display: block;
  }

  .plant-tile-water-button {
    margin-top: auto;
    min-height: 36px;
    width: 100%;
    border: none;
    border-radius: 999px;
    background: #F3F4F3;
    color: #345D4C;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
  }

  .plant-tile-water-button::before {
    content: '';
    width: 14px;
    height: 14px;
    background-image: url('./resources/green drop.svg');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    flex-shrink: 0;
  }

  .add-plant-card-mobile {
    min-height: 72px;
    border-radius: 10px;
    border: 2px dashed #bfcaba;
    background: rgba(237, 238, 237, 0.5);
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 12px;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(52, 93, 76, 0.04);
  }

  .add-plant-card-mobile .add-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #345d4c;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
  }

  .add-plant-card-mobile .add-label {
    font-size: 0.92rem;
    font-weight: 700;
    color: #40493d;
  }

  .spaces-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
  }

  .space-card {
    background: #fff;
    border-radius: 10px;
    padding: 24px;
    box-shadow: 0 14px 34px rgba(52, 93, 76, 0.07);
    display: flex;
    flex-direction: column;
    gap: 20px;
    border: 1px solid rgba(52, 93, 76, 0.06);
  }

  .space-card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
  }

  .space-card-icon {
    width: 54px;
    height: 54px;
    border-radius: 18px;
    background: linear-gradient(180deg, #edf5ef 0%, #f9fbf8 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.55rem;
  }

  .space-card-name {
    font-size: 1.55rem;
    line-height: 1.05;
    font-weight: 800;
    color: #345d4c;
    letter-spacing: -0.05em;
  }

  .space-card-count {
    color: #40493d;
    font-size: 0.96rem;
    line-height: 1.5;
  }

  .space-card-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .space-card-button {
    border: none;
    border-radius: 999px;
    min-height: 48px;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
  }

  .space-card-button.secondary {
    background: #f3f4f3;
    color: #345d4c;
  }

  .space-card-button.primary {
    background: #345d4c;
    color: #fff;
  }

  .scan-panel {
    display: flex;
    flex-direction: column;
    gap: 20px;
  }

  .scan-box {
    min-height: 326px;
    border-radius: 10px;
    border: 1px solid rgba(52, 93, 76, 0.28);
    background:
      radial-gradient(circle at top right, rgba(52, 93, 76, 0.08), transparent 30%),
      radial-gradient(circle at bottom left, rgba(159, 64, 45, 0.05), transparent 32%),
      #f3f4f3;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px;
    cursor: pointer;
  }

  .scan-box.is-loading {
    pointer-events: none;
  }

  .scan-box-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    text-align: center;
  }

  .scan-box-preview {
    width: 168px;
    height: 168px;
    border-radius: 24px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.7);
    box-shadow: 0 12px 24px rgba(31, 52, 37, 0.06);
  }

  .scan-box-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
  }

  .scan-box-icon {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #345d4c;
  }

  .scan-box-icon img {
    width: 30px;
    height: 30px;
    display: block;
  }

  .scan-box-title {
    font-size: 1.85rem;
    line-height: 1.15;
    font-weight: 800;
    color: #345d4c;
    letter-spacing: -0.04em;
  }

  .scan-box-copy {
    color: #40493d;
    font-size: 0.95rem;
    line-height: 1.45;
    max-width: 24ch;
  }

  .scan-box-copy.is-loading {
    max-width: 28ch;
  }

  .scan-box-copy.is-error {
    color: #b5503a;
    max-width: 30ch;
  }

  .scan-feedback {
    margin-top: -8px;
    padding: 14px 16px;
    border-radius: 18px;
    font-size: 0.92rem;
    line-height: 1.45;
  }

  .scan-feedback.error {
    background: rgba(181, 80, 58, 0.08);
    border: 1px solid rgba(181, 80, 58, 0.18);
    color: #8f3e2c;
  }

  .scan-secondary {
    min-height: 64px;
    border-radius: 24px;
    border: 1px solid #345d4c;
    background: transparent;
    color: #345d4c;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(52, 93, 76, 0.12);
  }

  /* scan-box compact when results are showing */
  .scan-box.has-results {
    min-height: 0;
    padding: 20px 24px;
  }

  .scan-box.has-results .scan-box-preview {
    width: 56px;
    height: 56px;
    border-radius: 14px;
  }

  .scan-box.has-results .scan-box-title {
    font-size: 1.1rem;
  }

  .scan-box.has-results .scan-box-inner {
    flex-direction: row;
    gap: 14px;
    text-align: left;
    align-items: center;
    width: 100%;
  }

  .scan-box.has-results .scan-box-inner > div:last-child {
    display: flex;
    flex-direction: column;
    gap: 4px;
  }

  /* Match cards */
  .scan-matches {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  .scan-matches-title {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
    padding: 0 4px;
  }

  .scan-match-card {
    display: flex;
    flex-direction: column;
    gap: 14px;
    background: var(--surface);
    border: 1px solid var(--border-grey);
    border-radius: 10px;
    padding: 14px 14px 18px;
    cursor: pointer;
    width: 100%;
    text-align: left;
    box-shadow: var(--shadow-xs);
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
  }

  .scan-match-card:hover,
  .scan-match-card:focus-visible {
    border-color: var(--green-dark);
    outline: none;
    transform: translateY(-1px);
  }

  .scan-match-visual {
    width: 100%;
  }

  .scan-match-photo-wrap,
  .scan-match-photo {
    width: 100%;
    aspect-ratio: 4 / 5;
    height: auto;
    border-radius: 14px;
    background: var(--light-grey);
    display: block;
    object-fit: cover;
  }

  .scan-match-photo--empty {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
  }

  .scan-match-chip {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 10px 14px;
    background: var(--green-light);
    color: var(--green-dark);
    border-radius: 999px;
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1;
  }

  .scan-match-chip-icon {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    display: block;
  }

  .scan-match-chip-text {
    white-space: nowrap;
  }

  .scan-match-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 0 4px;
  }

  .scan-match-species {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1.2;
    word-break: break-word;
  }

  .scan-match-common {
    font-size: 1rem;
    font-style: italic;
    color: var(--muted);
    line-height: 1.2;
    word-break: break-word;
  }

  .menu-overlay {
    position: absolute;
    inset: 0;
    background: rgba(22, 35, 27, 0.1);
    backdrop-filter: blur(6px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.22s ease, visibility 0.22s ease;
    z-index: 9;
  }

  .menu-overlay.open {
    opacity: 1;
    visibility: visible;
  }

  .menu-drawer {
    position: absolute;
    top: 78px;
    right: 18px;
    width: min(240px, calc(100% - 36px));
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid rgba(52, 93, 76, 0.06);
    box-shadow: 0 18px 44px rgba(31, 52, 37, 0.12);
    padding: 18px 0;
    transform: translateY(-8px) scale(0.98);
    transform-origin: top right;
    transition: transform 0.22s ease;
  }

  .menu-overlay.open .menu-drawer {
    transform: translateY(0) scale(1);
  }

  .menu-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  .menu-item {
    width: 100%;
    border: none;
    background: transparent;
    border-radius: 0;
    min-height: 52px;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 10px 22px;
    cursor: pointer;
    text-align: left;
    color: #191c1c;
  }

  .menu-item.active {
    background: #345d4c;
  }

  .menu-item-icon {
    width: 42px;
    height: 42px;
    border-radius: 18px;
    background: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: none;
  }

  .menu-item.active .menu-item-icon {
    background: transparent;
  }

  .menu-item-icon img {
    width: 30px;
    height: 30px;
    display: block;
  }

  .menu-item.active .menu-item-icon img {
    filter: brightness(0) invert(1);
  }

  .menu-item-label {
    font-size: 0.96rem;
    font-weight: 700;
    color: #345d4c;
    letter-spacing: -0.02em;
  }

  .menu-item-copy {
    display: flex;
    flex-direction: column;
    gap: 2px;
  }

  .menu-item-copy strong {
    font-size: 1rem;
    font-weight: 700;
    color: #191c1c;
    letter-spacing: -0.02em;
  }

  .menu-item.active .menu-item-copy strong {
    color: #ffffff;
  }

  .view-empty {
    background: #fff;
    border-radius: 10px;
    padding: 28px 24px;
    text-align: center;
    box-shadow: 0 14px 34px rgba(52, 93, 76, 0.07);
    color: #40493d;
    border: 1px solid rgba(52, 93, 76, 0.06);
  }

  .view-empty-icon {
    width: 68px;
    height: 68px;
    margin: 0 auto 16px;
    border-radius: 22px;
    background: linear-gradient(180deg, #edf5ef 0%, #f9fbf8 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.85rem;
    color: #345d4c;
  }

  .view-empty-title {
    font-size: 1.28rem;
    line-height: 1.15;
    font-weight: 800;
    color: #191c1c;
    letter-spacing: -0.04em;
  }

  .view-empty-copy {
    margin-top: 10px;
    color: #5d6c60;
    line-height: 1.6;
    font-size: 0.92rem;
  }

  .dashboard-chart-card {
    background: #fff;
    border-radius: 10px;
    margin-top: 12px;
    padding: 22px 18px 20px;
    box-shadow: 0 14px 34px rgba(52, 93, 76, 0.07);
    border: 1px solid rgba(52, 93, 76, 0.06);
  }

  .dashboard-chart-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    align-items: center;
    margin-bottom: 24px;
  }

  .dashboard-chart-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #191c1c;
    font-size: 0.92rem;
    line-height: 1.2;
  }

  .dashboard-chart-legend-item img {
    width: 18px;
    height: 18px;
    display: block;
    flex-shrink: 0;
  }

  .dashboard-bars {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 14px;
    align-items: end;
  }

  .dashboard-bar-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
  }

  .dashboard-bar-stack {
    width: 20px;
    height: 162px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    overflow: hidden;
    border-radius: 10px;
    background: #f3f4f3;
  }

  .dashboard-bar-segment {
    width: 100%;
  }

  .dashboard-bar-segment.watered {
    background: #345D4C;
  }

  .dashboard-bar-segment.thirsty {
    background: #ECFAF2;
  }

  .dashboard-bar-label {
    color: #191c1c;
    font-size: 0.92rem;
    line-height: 1.1;
    text-align: center;
  }

  .dashboard-summary-card {
    background: #fff;
    border-radius: 10px;
    padding: 28px 20px 20px;
    box-shadow: 0 14px 34px rgba(52, 93, 76, 0.07);
    border: 1px solid rgba(52, 93, 76, 0.06);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
    text-align: center;
  }

  .dashboard-summary-button {
    width: min(100%, 248px);
    min-height: 52px;
    border-radius: 999px;
    border: 1px solid #345D4C;
    background: transparent;
    color: #345D4C;
    font-size: 0.98rem;
    font-weight: 600;
    cursor: pointer;
  }

  .profile-card,
  .space-editor-card,
  .detail-actions-card,
  .detail-calendar-card,
  .detail-form-card {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 14px 34px rgba(52, 93, 76, 0.07);
    overflow: hidden;
    border: 1px solid rgba(52, 93, 76, 0.06);
  }

  .plant-detail-layout {
    display: flex;
    flex-direction: column;
    gap: 24px;
  }

  .profile-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .profile-stat {
    background: #f5f7f4;
    border-radius: 16px;
    padding: 14px;
  }

  .profile-stat-label {
    color: #708172;
    font-size: 0.74rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
  }

  .profile-stat-value {
    margin-top: 6px;
    color: #191c1c;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.35;
  }

  .detail-calendar-card {
    padding: 18px 14px 14px;
  }

  .detail-form-card {
    padding: 0;
    background: transparent;
    border: none;
    box-shadow: none;
    overflow: visible;
  }

  .detail-calendar-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
    padding: 0 4px;
  }

  .detail-calendar-month {
    font-size: 0.9rem;
    font-weight: 800;
    color: #191c1c;
    letter-spacing: 0.04em;
    text-transform: uppercase;
  }

  .detail-calendar-nav {
    display: flex;
    align-items: center;
    gap: 10px;
  }

  .detail-calendar-nav button {
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    color: #191c1c;
    font-size: 1.1rem;
    cursor: pointer;
  }

  .detail-calendar-grid {
    border-radius: 0;
    background: transparent;
    padding: 0;
    box-shadow: none;
  }

  .detail-form-card {
    display: flex;
    flex-direction: column;
    gap: 18px;
  }

  .detail-field {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  .detail-field label {
    color: #889489;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
  }

  .detail-input,
  .detail-select {
    width: 100%;
    min-height: 54px;
    border: 1px solid rgba(52, 93, 76, 0.08);
    border-radius: 18px;
    background: #F3F4F3;
    padding: 14px 16px;
    color: #191c1c;
    font-size: 0.98rem;
    outline: none;
  }

  .detail-input:focus,
  .detail-select:focus {
    border-color: rgba(79, 168, 109, 0.36);
    box-shadow: 0 0 0 4px rgba(79, 168, 109, 0.1);
  }

  .detail-actions-card {
    padding: 0;
    background: transparent;
    border: none;
    box-shadow: none;
    overflow: visible;
    display: flex;
    flex-direction: column;
    gap: 12px;
  }

  .detail-actions-card .btn-primary,
  .detail-actions-card .btn-danger {
    width: 100%;
    display: flex;
    box-sizing: border-box;
  }

  .detail-actions-card .btn-danger {
    min-height: 64px;
    border-radius: 24px;
    background: transparent;
  }

  .detail-actions-card .btn-danger::before {
    width: 17px;
    height: 17px;
  }

  .screen-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }

  .screen-actions .btn-primary,
  .screen-actions .btn-danger,
  .screen-actions .space-delete-action {
    width: 100%;
  }

  .screen-actions .btn-danger {
    min-height: 64px;
    border-radius: 24px;
    background: transparent;
  }

  .screen-actions .btn-danger::before {
    width: 17px;
    height: 17px;
  }

  .profile-actions {
    width: 100%;
  }

  .push-denied-hint {
    font-size: 13px;
    color: var(--color-text-secondary, #888);
    text-align: center;
    padding: 8px 0;
    margin: 0;
  }

  .legal-links {
    width: 100%;
    margin-top: 18px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
  }

  .legal-links a {
    color: #191c1c;
    font-size: 0.92rem;
    line-height: 1.4;
    text-decoration: underline;
    text-underline-offset: 2px;
  }

  .legal-links a:last-child {
    text-align: right;
  }

  .editor-note {
    color: #40493d;
    font-size: 0.88rem;
    line-height: 1.5;
    padding: 12px 14px;
    border-radius: 18px;
    background: rgba(79, 168, 109, 0.08);
  }

  .identified-plant-card {
    border-radius: 10px;
    background: #ffffff;
    padding: 14px;
    box-shadow: 0 16px 36px rgba(52, 93, 76, 0.08);
    border: 1px solid rgba(52, 93, 76, 0.06);
    display: flex;
    flex-direction: column;
    gap: 18px;
  }

  .identified-plant-visual {
    /* Bleed top/left/right hasta el borde de la card cancelando el padding
       interno (14px) con margin negativo, y el border-radius del card en las
       esquinas superiores. El bottom queda con corte recto y el siguiente
       contenido respeta el padding original. */
    width: calc(100% + 28px);
    margin: -14px -14px 0;
    aspect-ratio: 1 / 1.12;
    border-radius: 10px 10px 0 0;
    overflow: hidden;
    background:
      radial-gradient(circle at top right, rgba(52, 93, 76, 0.06), transparent 34%),
      #f7f8f6;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
  }

  .identified-plant-reference-wrap {
    position: absolute;
    bottom: 10px;
    right: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
  }

  .identified-plant-reference {
    width: 62px;
    height: 62px;
    border-radius: 12px;
    object-fit: cover;
    border: 2.5px solid #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
    display: block;
  }

  .identified-plant-reference-label {
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #fff;
    background: rgba(0, 0, 0, 0.38);
    padding: 1px 5px;
    border-radius: 4px;
  }

  /* === Bloque de nombres con label + value (Nombre / Nombre científico) === */
  .identified-plant-names {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  .identified-plant-names-row {
    display: grid;
    grid-template-columns: 140px 1fr;
    align-items: baseline;
    gap: 10px;
    font-size: 0.92rem;
    line-height: 1.3;
  }

  .identified-plant-names-label {
    color: var(--muted);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 600;
  }

  .identified-plant-names-value {
    color: #2a3a31;
    font-weight: 600;
  }

  .identified-plant-visual img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
  }

  .identified-plant-visual-fallback {
    font-size: 4rem;
  }

  .identified-plant-badge {
    align-self: flex-start;
    min-height: 30px;
    padding: 6px 14px;
    border-radius: 999px;
    background: var(--green-light);
    color: var(--green-dark);
    font-size: 0.92rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 8px;
  }

  .identified-plant-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
  }

  .identified-plant-form .form-group {
    margin-bottom: 0;
  }

  /* === Bloque de metadata generada por IA dentro de la card === */
  .identified-plant-metadata {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid rgba(52, 93, 76, 0.08);
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  .identified-plant-metadata-row {
    display: grid;
    grid-template-columns: 24px 64px 1fr;
    align-items: center;
    gap: 10px;
    font-size: 0.92rem;
    line-height: 1.3;
  }

  .identified-plant-metadata-icon {
    width: 24px;
    height: 24px;
    display: block;
    object-fit: contain;
    flex-shrink: 0;
  }

  .identified-plant-metadata-label {
    color: var(--muted);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 600;
  }

  .identified-plant-metadata-value {
    color: #2a3a31;
    font-weight: 600;
  }

  .identified-plant-metadata-skeleton {
    display: block;
    height: 12px;
    border-radius: 6px;
    background: linear-gradient(
      90deg,
      rgba(52, 93, 76, 0.08) 0%,
      rgba(52, 93, 76, 0.16) 50%,
      rgba(52, 93, 76, 0.08) 100%
    );
    background-size: 200% 100%;
    animation: identifiedMetadataShimmer 1.2s linear infinite;
  }

  @keyframes identifiedMetadataShimmer {
    0%   { background-position: 100% 0; }
    100% { background-position: -100% 0; }
  }

  /* === Tarjeta ¿Sabías que? (fun fact generado por Haiku) === */
  .plant-fun-fact {
    margin-top: 14px;
    padding: 14px 16px;
    border-radius: 10px;
    background: rgba(52, 93, 76, 0.06);
    border: 1px solid rgba(52, 93, 76, 0.10);
    display: flex;
    flex-direction: column;
    gap: 6px;
  }

  .plant-fun-fact-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 700;
    color: var(--green-dark, #2a5c44);
    opacity: 0.7;
  }

  .plant-fun-fact-text {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.5;
    color: #2a3a31;
  }

  .plant-fun-fact-skeleton {
    display: block;
    height: 12px;
    border-radius: 6px;
    background: linear-gradient(
      90deg,
      rgba(52, 93, 76, 0.08) 0%,
      rgba(52, 93, 76, 0.16) 50%,
      rgba(52, 93, 76, 0.08) 100%
    );
    background-size: 200% 100%;
    animation: identifiedMetadataShimmer 1.2s linear infinite;
  }

  .plant-fun-fact-skeleton + .plant-fun-fact-skeleton {
    width: 70%;
    margin-top: 6px;
  }

  .manual-plant-card {
    min-height: 280px;
    border-radius: 10px;
    border: 1px solid rgba(52, 93, 76, 0.22);
    background:
      radial-gradient(circle at top right, rgba(52, 93, 76, 0.06), transparent 30%),
      radial-gradient(circle at bottom left, rgba(198, 235, 212, 0.26), transparent 34%),
      #f7f8f6;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    text-align: center;
  }

  .manual-plant-card-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
  }

  .manual-plant-card-icon {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 14px 24px rgba(31, 52, 37, 0.07);
    font-size: 2.8rem;
    color: var(--green-dark);
  }

  .manual-plant-card-title {
    font-size: 1.4rem;
    line-height: 1.15;
    font-weight: 800;
    color: var(--green-dark);
    letter-spacing: -0.04em;
  }

  .manual-plant-card-copy {
    color: #5d6c60;
    font-size: 0.94rem;
    line-height: 1.4;
  }

  .form-group-inline {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .editor-select,
  .editor-input {
    width: 100%;
    min-height: 56px;
    border-radius: 18px;
    border: 1px solid rgba(52, 93, 76, 0.14);
    background: #f9fbf8;
    padding: 14px 16px;
    color: #191c1c;
  }

  .profile-head {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 36px 24px 18px;
    background:
      radial-gradient(circle at top center, rgba(79, 168, 109, 0.16), transparent 36%),
      linear-gradient(180deg, #ffffff 0%, #f4f8f3 100%);
  }

  .profile-avatar-lg {
    width: 128px;
    height: 128px;
    border-radius: 50%;
    overflow: hidden;
    background: #dbe9df;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.4rem;
    color: #345d4c;
  }

  .profile-avatar-lg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .profile-name {
    font-size: 1.5rem;
    font-weight: 800;
    color: #191c1c;
    letter-spacing: -0.04em;
  }

  .profile-email {
    color: #40493d;
    font-size: 0.92rem;
  }

  .profile-copy {
    color: #5d6c60;
    text-align: center;
    font-size: 0.92rem;
    line-height: 1.55;
    max-width: 28ch;
  }

  .profile-panel-body {
    padding: 12px 24px 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
  }

  .auth-panel {
    border-radius: 10px;
    background: #ffffff;
    box-shadow: 0 16px 36px rgba(52, 93, 76, 0.08);
    border: 1px solid rgba(52, 93, 76, 0.06);
    padding: 22px;
    display: flex;
    flex-direction: column;
    gap: 18px;
  }

  .auth-screen .screen-intro {
    text-align: center;
    align-items: center;
  }

  .auth-screen .screen-subtitle {
    display: none;
  }

  .auth-google-button {
    width: 100%;
    justify-content: center;
    gap: 10px;
  }

  .auth-google-button img {
    width: 18px;
    height: 18px;
    display: block;
    flex-shrink: 0;
  }

  .auth-mode-toggle {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    padding: 6px;
    border-radius: 20px;
    background: #f3f4f3;
  }

  .auth-mode-button {
    min-height: 44px;
    border: none;
    border-radius: 16px;
    background: transparent;
    color: #5d6c60;
    font-weight: 700;
    cursor: pointer;
  }

  .auth-mode-button.active {
    background: #ffffff;
    color: #345d4c;
    box-shadow: 0 10px 18px rgba(31, 52, 37, 0.06);
  }

  .auth-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
  }

  .auth-helper {
    color: #5d6c60;
    font-size: 0.9rem;
    line-height: 1.5;
  }

  .auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #94a096;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
  }

  .auth-divider::before,
  .auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(52, 93, 76, 0.12);
  }

  .auth-feedback {
    border-radius: 18px;
    padding: 12px 14px;
    font-size: 0.9rem;
    line-height: 1.45;
  }

  .auth-feedback.error {
    background: rgba(207, 113, 82, 0.1);
    color: #9f402d;
  }

  .auth-feedback.success {
    background: rgba(198, 235, 212, 0.45);
    color: #345d4c;
  }

  .auth-legal-copy {
    width: 100%;
    margin-top: 14px;
    color: #3f4940;
    font-size: 0.9rem;
    line-height: 1.55;
  }

  .auth-legal-copy a {
    color: inherit;
    text-decoration: underline;
    text-underline-offset: 2px;
  }

  .space-editor-card {
    padding: 22px;
    display: flex;
    flex-direction: column;
    gap: 20px;
  }

  .space-emoji-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 10px;
  }

  .space-emoji-button {
    min-height: 50px;
    border: none;
    border-radius: 14px;
    background: #f3f4f3;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    cursor: pointer;
    transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
  }

  .space-emoji-button.active {
    background: #dff0e6;
    box-shadow: inset 0 0 0 1px rgba(52, 93, 76, 0.2);
  }

  .space-editor-hint {
    color: #5d6c60;
    font-size: 0.9rem;
    line-height: 1.55;
  }

  .space-delete-action {
    display: flex;
    justify-content: center;
  }

  .detail-actions-card {
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
  }

  .splash-screen {
    min-height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 16px;
    text-align: center;
    padding: 48px 8px 56px;
    animation: fadeIn 0.32s ease;
  }

  .splash-spinner {
    width: 52px;
    height: 52px;
    border-radius: 999px;
    border: 4px solid rgba(198, 235, 212, 0.72);
    border-top-color: #345D4C;
    animation: splash-spin 0.9s linear infinite;
  }

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

  .splash-note {
    color: #5f6d63;
    font-size: 0.92rem;
    letter-spacing: -0.01em;
  }

  .inline-loading {
    min-height: 280px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 28px 12px 36px;
    text-align: center;
  }

  .inline-loading .splash-note {
    max-width: 30ch;
  }

  button,
  input,
  select,
  textarea {
    font: inherit;
  }

  header {
    width: min(1240px, calc(100% - 24px));
    margin: 18px auto 0;
    padding: 18px 22px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    position: sticky;
    top: 14px;
    z-index: 100;
    border: 1px solid rgba(255, 255, 255, 0.52);
    border-radius: 28px;
    background: rgba(250, 252, 248, 0.88);
    backdrop-filter: blur(18px);
    box-shadow: var(--shadow-xs);
  }

  .btn-primary,
  .btn-secondary,
  .btn-auth,
  .btn-cancel,
  .btn-save,
  .btn-water,
  .btn-icon {
    transition: transform 0.22s ease, background 0.22s ease, border-color 0.22s ease, color 0.22s ease, box-shadow 0.22s ease;
  }

  .btn-primary,
  .btn-secondary,
  .btn-auth,
  .btn-cancel,
  .btn-save,
  .btn-water {
    border-radius: 24px;
    min-height: 64px;
    padding: 16px 24px;
    border: 1px solid transparent;
    cursor: pointer;
    font-weight: 700;
    font-size: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
  }

  .btn-primary,
  .btn-save,
  .btn-water {
    background: linear-gradient(90deg, #345d4c 0%, #4d7663 100%);
    color: #fff;
    box-shadow: 0 8px 20px rgba(52, 93, 76, 0.2);
  }

  .btn-primary:hover,
  .btn-save:hover,
  .btn-water:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 24px rgba(52, 93, 76, 0.24);
  }

  .btn-secondary,
  .btn-auth,
  .btn-cancel {
    background: rgba(255, 255, 255, 0.88);
    color: var(--text);
    border-color: var(--line);
  }

  .btn-secondary:hover,
  .btn-auth:hover,
  .btn-cancel:hover {
    transform: translateY(-1px);
    border-color: rgba(79, 168, 109, 0.32);
    box-shadow: 0 12px 24px rgba(31, 52, 37, 0.06);
  }

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

  .btn-water.watered {
    background: rgba(79, 168, 109, 0.12);
    color: var(--accent-deep);
    box-shadow: none;
  }

  .btn-icon {
    width: 46px;
    height: 46px;
    border-radius: 18px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.88);
    color: var(--text);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1rem;
  }

  .btn-icon.small {
    width: 40px;
    height: 40px;
    border-radius: 14px;
    font-size: 0.9rem;
  }

  .btn-icon:hover {
    transform: translateY(-1px);
    border-color: rgba(79, 168, 109, 0.28);
    background: rgba(245, 249, 244, 0.94);
  }

  .btn-icon.delete:hover {
    background: rgba(255, 244, 239, 0.96);
    border-color: rgba(207, 113, 82, 0.24);
    color: var(--danger);
  }

  .modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(22, 35, 27, 0.28);
    backdrop-filter: blur(16px);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.24s ease, visibility 0.24s ease;
  }

  .modal-overlay.open {
    opacity: 1;
    visibility: visible;
  }

  .modal {
    width: min(100%, 520px);
    max-height: 90vh;
    overflow-y: auto;
    padding: 32px 28px;
    border-radius: 36px;
    background:
      radial-gradient(circle at top right, rgba(79, 168, 109, 0.12), transparent 28%),
      rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.8);
    box-shadow: 0 38px 90px rgba(22, 35, 27, 0.16);
    transform: translateY(18px) scale(0.98);
    transition: transform 0.25s ease;
  }

  .modal-overlay.open .modal {
    transform: translateY(0) scale(1);
  }

  .modal h2 {
    font-family: 'DM Sans', sans-serif;
    font-size: 1.95rem;
    line-height: 1.08;
    font-weight: 800;
    letter-spacing: -0.05em;
    margin-bottom: 8px;
    color: #191c1c;
  }

  .modal-sub {
    color: var(--muted);
    margin-bottom: 24px;
    line-height: 1.6;
    font-size: 0.92rem;
  }

  .form-group {
    margin-bottom: 18px;
  }

  .form-group label {
    display: block;
    margin-bottom: 10px;
    color: var(--muted-soft);
    font-size: 0.76rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
  }

  .form-group input,
  .form-group select,
  .form-group textarea {
    width: 100%;
    min-height: 54px;
    padding: 15px 16px;
    border-radius: 18px;
    border: 1px solid var(--line);
    background: #f9fcf8;
    color: var(--text);
    outline: none;
  }

  .form-group input:focus,
  .form-group select:focus,
  .form-group textarea:focus {
    border-color: rgba(79, 168, 109, 0.38);
    box-shadow: 0 0 0 4px rgba(79, 168, 109, 0.12);
  }

  .modal-actions {
    display: flex;
    gap: 12px;
    margin-top: 18px;
    flex-wrap: wrap;
  }

  .modal-actions > * {
    flex: 1;
  }

  .delete-confirm {
    padding: 15px 16px;
    border-radius: 18px;
    line-height: 1.55;
    font-size: 0.86rem;
  }

  .delete-confirm {
    background: #f8f8f7;
    border: 1px solid rgba(52, 93, 76, 0.06);
    color: #191c1c;
    font-size: 0.98rem;
    font-weight: 700;
    padding: 20px 18px;
  }

  .cal-weekdays,
  .cal-days {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 6px;
  }

  .cal-weekdays {
    margin-bottom: 8px;
  }

  .cal-weekday {
    padding: 8px 0;
    color: var(--muted-soft);
    text-align: center;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
  }

  .cal-day {
    position: relative;
    width: 44px;
    height: 44px;
    margin: 0 auto;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    border: 1px solid transparent;
    background: transparent;
    color: #191c1c;
    font-size: 0.84rem;
    font-weight: 500;
    transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
  }

  .cal-day.empty {
    background: transparent;
    width: auto;
    height: auto;
    border-radius: 0;
  }

  .cal-day.today {
    background: #ffffff;
    border-color: var(--green-dark);
    color: var(--green-dark);
    font-weight: 700;
  }

  .cal-day.watered {
    background: var(--green-dark);
    color: #ffffff;
    font-weight: 700;
  }

  .cal-day.watered::after {
    content: '';
    position: absolute;
    right: -2px;
    bottom: -2px;
    width: 18px;
    height: 20px;
    border-radius: 50%;
    background-image: url('./resources/calendar drop.svg');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
  }

  .cal-day.future-water {
    background: var(--green-light);
    color: var(--green-dark);
    font-weight: 700;
  }

  .cal-day.past-nodata {
    color: var(--muted-soft);
    opacity: 0.52;
  }

  .cal-day.clickable-past {
    cursor: pointer;
  }

  .cal-day.clickable-past:hover {
    transform: translateY(-1px);
    border-color: rgba(52, 93, 76, 0.18);
  }

  .cal-day-icons {
    display: flex;
    gap: 2px;
    font-size: 0.58rem;
    line-height: 1;
  }

  .cal-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-top: 18px;
  }

  .cal-sum-item {
    padding: 16px 14px;
    border-radius: 22px;
    background: rgba(246, 251, 244, 0.9);
    border: 1px solid rgba(79, 168, 109, 0.12);
    text-align: center;
  }

  .cal-sum-item .cs-value {
    font-family: 'DM Sans', sans-serif;
    font-size: 1.7rem;
    letter-spacing: -0.04em;
  }

  .cal-sum-item .cs-label {
    margin-top: 4px;
    color: var(--muted);
    font-size: 0.76rem;
  }

  .cal-sum-item .cs-value.watered {
    color: var(--accent-deep);
  }

  .cal-sum-item .cs-value.rain {
    color: var(--rain);
  }

  .cal-sum-item .cs-value.missed {
    color: var(--danger);
  }

  .toast {
    position: fixed;
    left: 50%;
    bottom: 24px;
    transform: translateX(-50%) translateY(80px);
    padding: 14px 20px;
    border-radius: 999px;
    background: rgba(34, 61, 42, 0.96);
    color: #fff;
    font-size: 0.88rem;
    box-shadow: 0 24px 40px rgba(31, 52, 37, 0.2);
    z-index: 300;
    transition: transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
    white-space: nowrap;
    pointer-events: none;
  }

  .toast.show {
    transform: translateX(-50%) translateY(0);
  }

  .empty-state {
    padding: 54px 28px;
    border-radius: 30px;
    background: rgba(255, 255, 255, 0.78);
    border: 1px solid rgba(255, 255, 255, 0.84);
    text-align: center;
    box-shadow: var(--shadow-sm);
  }

  .empty-state .es-icon {
    width: 74px;
    height: 74px;
    margin: 0 auto 18px;
    border-radius: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(79, 168, 109, 0.12);
    font-size: 2rem;
  }

  .empty-state h3 {
    font-family: 'DM Sans', sans-serif;
    font-size: 1.5rem;
    letter-spacing: -0.04em;
  }

  .empty-state p {
    max-width: 32ch;
    margin: 10px auto 0;
    color: var(--muted);
    line-height: 1.6;
    font-size: 0.9rem;
  }

  .empty-state-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin-top: 20px;
  }

  .grid-full {
    grid-column: 1 / -1;
  }

  .btn-danger {
    min-height: 64px;
    padding: 16px 24px;
    border: 1.5px solid #b24f37;
    border-radius: 999px;
    background: #ffffff;
    color: #b24f37;
    cursor: pointer;
    font-weight: 700;
    font-size: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 8px 20px rgba(31, 52, 37, 0.04);
  }

  .btn-danger::before {
    content: '';
    width: 24px;
    height: 24px;
    background-image: url('./resources/Delete icon.svg');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    flex-shrink: 0;
  }

  .btn-danger:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 24px rgba(31, 52, 37, 0.06);
    color: #9f402d;
    border-color: #9f402d;
  }

  @keyframes fadeIn {
    from {
      opacity: 0;
      transform: translateY(12px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  @media (max-width: 980px) {
    header {
      width: calc(100% - 18px);
      padding: 16px 18px;
      top: 10px;
    }

  }

  @media (max-width: 720px) {
    .form-group-inline {
      grid-template-columns: minmax(0, 1fr);
    }

    .cal-summary {
      grid-template-columns: 1fr 1fr;
    }

    .modal {
      padding: 24px 20px;
      border-radius: 28px;
    }
  }

  @media (max-width: 520px) {
    header {
      margin-top: 10px;
      border-radius: 24px;
    }

    .empty-state {
      padding: 18px;
    }

    .cal-summary {
      grid-template-columns: 1fr;
    }

    .btn-primary,
    .btn-secondary,
    .btn-danger,
    .btn-cancel,
    .btn-save {
      width: 100%;
    }

  }

  @media (min-width: 1100px) {
    .plants-grid-mobile {
      grid-template-columns: repeat(4, minmax(0, 190px)) !important;
      gap: 18px !important;
      width: fit-content;
      max-width: 100%;
      justify-content: center;
      justify-items: stretch;
      place-content: start center;
      margin-left: auto;
      margin-right: auto;
    }

    .plant-tile {
      min-width: 0;
      width: 190px;
      flex-direction: column;
      height: auto;
    }

    .plant-tile-visual {
      width: 100%;
      height: 140px;
      aspect-ratio: unset;
    }

    .plant-tile-body {
      padding: 14px 14px 16px;
      flex: 1;
    }

    .plant-tile-name {
      font-size: 1rem;
    }

    .plant-tile-last {
      font-size: 0.88rem;
    }

    .plant-tile-water-button {
      min-height: 38px;
      font-size: 0.86rem;
    }
  }

  .dashboard-chart-card,
  .dashboard-summary-card,
  .add-plant-card-mobile,
  .space-card,
  .profile-card,
  .space-editor-card,
  .detail-calendar-card,
  .identified-plant-card,
  .manual-plant-card,
  .auth-panel,
  .scan-box {
    border-radius: 10px;
  }

/* ============================================================
   TABS EN PANTALLA "TU PLANTA" (Riegos / Detalles / Evolución)
   ============================================================ */

/* Strip horizontal full-width. Para "romper" el padding horizontal
   de .app-main (28/32/40px según breakpoint) usamos margins
   negativos. Resultado: la línea inferior y los tabs llegan al borde
   visible del shell. */
.plant-detail-tabs {
  display: flex;
  width: auto;
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
  border-bottom: 1px solid rgba(52, 93, 76, 0.12);
  margin-left: -28px;
  margin-right: -28px;
}

@media (min-width: 760px) {
  .plant-detail-tabs {
    margin-left: -32px;
    margin-right: -32px;
  }
}

@media (min-width: 1100px) {
  .plant-detail-tabs {
    margin-left: -40px;
    margin-right: -40px;
  }
}

.plant-detail-tab {
  flex: 1 1 0;
  min-width: 0;
  border: none;
  background: transparent;
  color: #708172;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  padding: 14px 8px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px; /* Solapa el border-bottom del contenedor */
  transition: color 0.18s, border-color 0.18s, background 0.18s;
  text-align: center;
  /* Evita que un texto largo (ej. "Evolución") rompa el reparto en flex */
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

.plant-detail-tab:hover,
.plant-detail-tab:focus-visible {
  color: #1a2420;
}

.plant-detail-tab.active {
  color: #1a2420;
  border-bottom-color: #345d4c;
}

.plant-detail-tab-panel {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* ============================================================
   FOTO PRINCIPAL EDITABLE DENTRO DE LA CARD DE DETALLE
   ============================================================ */

/* La card editable usa la misma estructura que la card de
   identificación, pero el visual se transforma en un <label> que
   abre un file picker para cambiar la foto principal. La feature
   solo está habilitada en la pantalla "Tu planta", no durante la
   identificación. */
.identified-plant-visual--editable {
  cursor: pointer;
  /* Conserva el bleed/border-radius de la card y agrega hint visual */
}

.identified-plant-visual-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: rgba(0, 0, 0, 0);
  transition: background 0.2s;
  pointer-events: none;
}

/* Especificidad más alta que `.identified-plant-visual img` (0,1,1)
   para evitar que el icono de cámara se estire al 100% del card. */
.identified-plant-visual .identified-plant-visual-overlay-icon {
  width: 28px;
  height: 28px;
  object-fit: contain;
  opacity: 0;
  transition: opacity 0.2s;
}

.identified-plant-visual-overlay-label {
  color: #fff;
  font-size: 0.9rem;
  font-weight: 600;
  opacity: 0;
  transition: opacity 0.2s;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

.identified-plant-visual--editable:hover .identified-plant-visual-overlay,
.identified-plant-visual--editable:focus-within .identified-plant-visual-overlay {
  background: rgba(0, 0, 0, 0.38);
}

.identified-plant-visual--editable:hover .identified-plant-visual-overlay-icon,
.identified-plant-visual--editable:hover .identified-plant-visual-overlay-label,
.identified-plant-visual--editable:focus-within .identified-plant-visual-overlay-icon,
.identified-plant-visual--editable:focus-within .identified-plant-visual-overlay-label {
  opacity: 1;
}

/* En mobile (sin :hover real) mostramos siempre un hint sutil para
   que el affordance de "tocá para cambiar" sea descubrible. */
@media (hover: none) {
  .identified-plant-visual--editable .identified-plant-visual-overlay {
    background: linear-gradient(to top, rgba(0, 0, 0, 0.45) 0%, transparent 50%);
    justify-content: flex-end;
    padding-bottom: 14px;
  }
  .identified-plant-visual--editable .identified-plant-visual-overlay-icon,
  .identified-plant-visual--editable .identified-plant-visual-overlay-label {
    opacity: 1;
  }
}

/* ============================================================
   FOTO PRINCIPAL DE PLANTA (en detalle)
   ============================================================ */

.plant-main-photo-card {
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 14px 34px rgba(52, 93, 76, 0.07);
  border: 1px solid rgba(52, 93, 76, 0.06);
}

.plant-main-photo-label {
  display: block;
  position: relative;
  cursor: pointer;
  aspect-ratio: 4 / 3;
  background: #e8ede9;
  overflow: hidden;
}

.plant-main-photo-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: filter 0.2s;
}

.plant-main-photo-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  background: #e8ede9;
}

.plant-main-photo-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: background 0.2s;
}

.plant-main-photo-label:hover .plant-main-photo-overlay,
.plant-main-photo-label:focus-within .plant-main-photo-overlay {
  background: rgba(0, 0, 0, 0.38);
}

.plant-main-photo-overlay-icon {
  font-size: 1.6rem;
  width: 28px;
  height: 28px;
  opacity: 0;
  transition: opacity 0.2s;
}

.plant-main-photo-overlay-label {
  color: #fff;
  font-size: 0.85rem;
  font-weight: 600;
  opacity: 0;
  transition: opacity 0.2s;
}

.plant-main-photo-label:hover .plant-main-photo-overlay-icon,
.plant-main-photo-label:hover .plant-main-photo-overlay-label,
.plant-main-photo-label:focus-within .plant-main-photo-overlay-icon,
.plant-main-photo-label:focus-within .plant-main-photo-overlay-label {
  opacity: 1;
}

/* En mobile siempre mostrar el hint sutil en el borde inferior */
@media (hover: none) {
  .plant-main-photo-overlay {
    background: linear-gradient(to top, rgba(0,0,0,0.45) 0%, transparent 50%);
    justify-content: flex-end;
    padding-bottom: 14px;
  }
  .plant-main-photo-overlay-icon,
  .plant-main-photo-overlay-label {
    opacity: 1;
  }
}

/* ============================================================
   PHOTO TIMELINE — SECCIÓN DE EVOLUCIÓN
   ============================================================ */

/* Card contenedora (misma familia que detail-form-card) */
.photo-section-card {
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 14px 34px rgba(52, 93, 76, 0.07);
  border: 1px solid rgba(52, 93, 76, 0.06);
  overflow: hidden;
  padding: 20px;
}

/* Encabezado de la sección */
.photo-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  gap: 12px;
}

.photo-section-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #1a2420;
  letter-spacing: -0.01em;
}

.photo-add-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #2d6a4f;
  color: #fff;
  border: none;
  border-radius: 20px;
  padding: 7px 16px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s;
  flex-shrink: 0;
}

.photo-add-btn:hover,
.photo-add-btn:focus-visible {
  background: #245c43;
}

/* Grid de fotos */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

/* Tile individual */
.photo-tile {
  position: relative;
  aspect-ratio: 1;
  border-radius: 14px;
  overflow: hidden;
  border: none;
  padding: 0;
  cursor: pointer;
  background: #e8ede9;
  display: flex;
  flex-direction: column;
  transition: opacity 0.15s;
}

.photo-tile:hover,
.photo-tile:focus-visible {
  opacity: 0.85;
}

.photo-tile-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.photo-tile-date {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.55) 0%, transparent 100%);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 500;
  padding: 14px 6px 5px;
  text-align: center;
  line-height: 1.2;
}

.photo-tile-note {
  display: none; /* Solo visible en lightbox */
}

/* Estado vacío / error */
.photo-grid-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 28px 16px;
  color: #708172;
  font-size: 0.88rem;
  text-align: center;
}

.photo-grid-empty-icon {
  font-size: 1.8rem;
  width: 36px;
  height: 36px;
  opacity: 0.7;
}

.photo-grid-error {
  color: #b94c4c;
}

/* ============================================================
   MODAL DE SUBIDA DE FOTO
   ============================================================ */

.photo-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 1100;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
}

@media (min-width: 480px) {
  .photo-modal-overlay {
    align-items: center;
    padding: 24px;
  }
}

.photo-modal {
  background: #fff;
  border-radius: 24px 24px 0 0;
  width: 100%;
  max-width: 480px;
  padding: 24px 20px 36px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: 0 -8px 40px rgba(0,0,0,0.12);
  animation: slideUp 0.22s ease;
}

@media (min-width: 480px) {
  .photo-modal {
    border-radius: 24px;
    padding: 28px 28px 28px;
    box-shadow: 0 24px 60px rgba(0,0,0,0.18);
    animation: fadeIn 0.18s ease;
  }
}

@keyframes slideUp {
  from { transform: translateY(60px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

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

.photo-modal-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #1a2420;
}

.photo-modal-close {
  background: none;
  border: none;
  font-size: 1.1rem;
  color: #708172;
  cursor: pointer;
  padding: 4px 8px;
  line-height: 1;
  font-family: inherit;
}

/* Área de drop / selector */
.photo-modal-drop {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 2px dashed rgba(52, 93, 76, 0.22);
  border-radius: 18px;
  padding: 32px 20px;
  cursor: pointer;
  text-align: center;
  transition: background 0.15s, border-color 0.15s;
}

.photo-modal-drop:hover {
  background: #f2f7f4;
  border-color: #2d6a4f;
}

.photo-modal-drop-icon {
  font-size: 2rem;
  width: 36px;
  height: 36px;
}

.photo-modal-drop-label {
  color: #4a6c5a;
  font-size: 0.9rem;
  font-weight: 500;
}

/* Preview de imagen seleccionada */
.photo-modal-preview {
  border-radius: 16px;
  overflow: hidden;
  max-height: 260px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #e8ede9;
}

.photo-modal-preview img {
  width: 100%;
  height: 260px;
  object-fit: cover;
  display: block;
}

/* Textarea de nota */
.photo-modal-note-wrap {
  display: flex;
}

.photo-modal-note {
  width: 100%;
  border: 1.5px solid rgba(52, 93, 76, 0.18);
  border-radius: 14px;
  padding: 12px 14px;
  font-family: inherit;
  font-size: 16px; /* min 16px to prevent iOS auto-zoom on focus */
  color: #1a2420;
  resize: none;
  outline: none;
  transition: border-color 0.15s;
  background: #f9fbf9;
}

.photo-modal-note:focus {
  border-color: #2d6a4f;
  background: #fff;
}

.photo-modal-error {
  color: #b94c4c;
  font-size: 0.85rem;
}

.photo-modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

/* ============================================================
   LIGHTBOX DE FOTO
   ============================================================ */

.photo-lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.95);
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.photo-lightbox {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  max-width: 520px;
  width: 100%;
}

.photo-lightbox-close {
  position: absolute;
  top: -48px;
  right: -4px;
  background: rgba(255,255,255,0.15);
  border: none;
  color: #fff;
  font-size: 1.1rem;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  z-index: 1;
}

.photo-lightbox-close:hover {
  background: rgba(255,255,255,0.28);
}

.photo-lightbox-img {
  width: 100%;
  max-height: 70vh;
  object-fit: contain;
  border-radius: 10px;
  display: block;
}

.photo-lightbox-meta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 100%;
}

.photo-lightbox-date {
  color: rgba(255,255,255,0.6);
  font-size: 0.82rem;
}

.photo-lightbox-note {
  color: #fff;
  font-size: 0.95rem;
  text-align: center;
  line-height: 1.45;
}

.photo-lightbox-delete {
  background: none;
  border: 1.5px solid rgba(255,255,255,0.25);
  color: rgba(255,255,255,0.65);
  border-radius: 20px;
  padding: 8px 20px;
  font-size: 0.82rem;
  cursor: pointer;
  font-family: inherit;
  transition: border-color 0.15s, color 0.15s;
}

.photo-lightbox-delete:hover {
  border-color: #e57373;
  color: #e57373;
}
