/* Reuse the site's palette and type. All viewer rules are scoped to this page. */
main { width: min(100%, 1120px); }
[hidden] { display: none !important; }
.grow-section { padding: clamp(20px, 4vw, 38px); }
.grow-heading { margin-bottom: 24px; display: flex; align-items: end; justify-content: space-between; gap: 20px; }
.grow-eyebrow { font: 11px ui-monospace, monospace; color: var(--accent); letter-spacing: .14em; margin-bottom: 10px; }
.grow-heading h2 { font-size: 27px; letter-spacing: -.035em; margin: 0; }
.grow-layout { display: grid; grid-template-columns: minmax(0, 1.95fr) minmax(255px, 1fr); gap: 20px; align-items: start; }
.photo-card { border: 1px solid var(--line); border-radius: 17px; overflow: hidden; background: #0d151f; }
.photo-heading { padding: 18px 19px; display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.photo-heading h3 { display: flex; gap: 9px; align-items: center; margin: 0; font-size: 15px; font-weight: 600; }
.photo-position { color: var(--muted); font: 10px ui-monospace, monospace; white-space: nowrap; }
.photo-stage { aspect-ratio: 16 / 9; position: relative; background: #090f15; overflow: hidden; }
.photo-stage img { display: block; width: 100%; height: 100%; object-fit: contain; }
.photo-overlay { position: absolute; inset: auto 0 0; display: flex; flex-direction: column; gap: 5px; padding: 38px 20px 17px; background: linear-gradient(transparent, rgba(4,9,12,.86)); color: #fff; pointer-events: none; }
.photo-overlay strong { font-size: 17px; font-weight: 600; letter-spacing: -.02em; }
.photo-overlay span { font: 11px ui-monospace, monospace; color: #e0e8e3; }
.image-sample-label { position: absolute; top: 12px; left: 12px; font: 9px ui-monospace, monospace; letter-spacing: .08em; padding: 6px 8px; color: #fff; background: rgba(7,16,17,.72); border-radius: 5px; }
.photo-empty { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 24px; text-align: center; background: radial-gradient(ellipse at center,rgba(110,231,183,.05),transparent 70%); }
.empty-leaf { color: var(--accent); font-size: 36px; font-weight: 300; }
.photo-empty strong { font-size: 15px; font-weight: 500; }
.photo-empty > span:last-child { color: var(--muted); font-size: 12px; line-height: 1.5; }
.viewer-controls { padding: 20px; }
.date-navigation { display: grid; grid-template-columns: 42px minmax(0,240px) 42px; gap: 10px; justify-content: center; }
.viewer-button, .date-control, .slot-button, .play-button { border: 1px solid var(--line); font: inherit; }
.viewer-button, .date-control { min-height: 42px; border-radius: 9px; background: rgba(255,255,255,.025); color: var(--text); }
.viewer-button { cursor: pointer; display: grid; place-items: center; padding: 0; }
.viewer-button svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.date-control { position: relative; display: flex; align-items: center; padding: 0 11px; min-width: 0; cursor: pointer; }
.date-control input { width: 100%; min-width: 0; border: 0; background: transparent; color: var(--text); font: 12px ui-monospace, monospace; padding: 5px 0; cursor: pointer; }
.date-control button { position: absolute; inset: 0; border: 0; border-radius: inherit; background: transparent; cursor: pointer; }
.date-control input::-webkit-calendar-picker-indicator { cursor: pointer; opacity: .6; }
.slot-row { position: relative; display: flex; justify-content: center; margin: 17px 0 24px; min-height: 38px; }
.capture-slots { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--line); padding: 3px; border-radius: 999px; background: rgba(0,0,0,.2); width: 208px; }
.slot-button { border: 0; border-radius: 999px; padding: 7px 20px; background: transparent; color: var(--muted); font-size: 12px; cursor: pointer; }
.slot-button[aria-pressed="true"] { color: #08281c; background: var(--accent); font-weight: 650; box-shadow: 0 2px 10px rgba(110,231,183,.09); }
.latest-button { position: absolute; right: 0; top: 9px; border: 0; background: none; color: var(--accent); font-size: 11px; cursor: pointer; padding: 3px; }
.timeline-heading, .timeline-endpoints { display: flex; justify-content: space-between; gap: 10px; color: var(--muted); font: 10px ui-monospace, monospace; }
.timeline-heading { margin-bottom: 8px; letter-spacing: .06em; }
.timeline-heading output { color: var(--text); letter-spacing: 0; text-align: right; }
.timeline-control input { width: 100%; height: 24px; margin: 0; appearance: none; background: transparent; cursor: pointer; display: block; }
.timeline-control input::-webkit-slider-runnable-track { height: 4px; border-radius: 999px; background: linear-gradient(to right,var(--accent) var(--progress,100%),#2b3843 var(--progress,100%)); }
.timeline-control input::-webkit-slider-thumb { appearance: none; width: 14px; height: 14px; margin-top: -5px; border-radius: 50%; border: 3px solid #0f241e; background: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.timeline-control input::-moz-range-track { height: 4px; border-radius: 999px; background: #2b3843; }
.timeline-control input::-moz-range-progress { height: 4px; background: var(--accent); }
.timeline-control input::-moz-range-thumb { border: 3px solid #0f241e; border-radius: 50%; width: 10px; height: 10px; background: var(--accent); }
.timeline-endpoints { margin-top: 4px; }
.play-button { min-height: 43px; width: min(100%,240px); margin: 22px auto 0; display: flex; gap: 9px; justify-content: center; align-items: center; border-color: rgba(110,231,183,.35); border-radius: 9px; background: rgba(110,231,183,.1); color: var(--accent); font-size: 12px; font-weight: 600; cursor: pointer; }
.play-button svg { width: 15px; height: 15px; fill: currentColor; }
.grow-layout button:hover:not(:disabled) { filter: brightness(1.15); }
.grow-layout button:disabled, .grow-layout input:disabled { opacity: .36; cursor: not-allowed; }
.grow-layout :focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.update-panel { display: grid; gap: 11px; }
.update-context { display: flex; gap: 7px; align-items: center; min-height: 23px; color: var(--muted); font: 9px ui-monospace, monospace; letter-spacing: .08em; }
.context-dot { width: 5px; height: 5px; flex: 0 0 5px; background: var(--accent); border-radius: 50%; }
.update-card { border: 1px solid var(--line); border-radius: 13px; background: rgba(255,255,255,.018); padding: 16px; }
.update-card .metric-title-row { gap: 9px; }
.update-card .icon-badge { width: 28px; height: 28px; flex-basis: 28px; }
.update-card .icon-badge svg { width: 15px; height: 15px; }
.update-card h3 { font-size: 12px; font-weight: 500; margin: 0; }
.grow-metric { font: 35px/1.2 ui-monospace, monospace; margin: 12px 0 11px; letter-spacing: -.055em; }
.grow-metric span { color: var(--muted); font-size: 18px; margin-left: 4px; }
.moisture-track { width: 100%; height: 4px; border-radius: 9px; background: #243545; overflow: hidden; margin-bottom: 10px; }
.moisture-track span { display: block; height: 100%; border-radius: inherit; background: #38bdf8; width: 0; }
.section .metric-note { color: var(--muted); font-size: 10px; line-height: 1.6; }
.watering-value { font-size: 13px; font-weight: 500; line-height: 1.5; margin: 10px 0 5px; }
.age-value { font: 24px ui-monospace, monospace; letter-spacing: -.045em; margin: 11px 0 3px; }
.summary-card { background: linear-gradient(135deg,rgba(129,140,248,.06),rgba(255,255,255,.015)); }
.summary-card #ai-state { margin-left: auto; color: #a2aaf6; font: 8px ui-monospace, monospace; }
.summary-card #update-summary { color: var(--text); font-size: 12px; line-height: 1.75; margin-top: 12px; min-height: 63px; overflow-wrap: anywhere; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
@media (max-width: 860px) {
  .grow-layout { grid-template-columns: minmax(0,1fr); }
  .update-panel { grid-template-columns: 1fr 1fr; }
  .update-context { grid-column: 1 / -1; }
  .summary-card { min-height: 150px; }
}
@media (max-width: 520px) {
  body { padding-inline: 12px; }
  .grow-heading { align-items: start; flex-direction: column; gap: 10px; }
  .grow-heading h2 { font-size: 24px; }
  .grow-section { padding-inline: 16px; }
  .photo-heading { padding: 14px 12px; }
  .photo-heading h3 { font-size: 13px; }
  .photo-position { font-size: 9px; }
  .viewer-controls { padding: 16px 12px; }
  .date-navigation { gap: 7px; grid-template-columns: 36px minmax(0,1fr) 36px; }
  .date-control { padding-inline: 8px; }
  .capture-slots { width: 176px; }
  .slot-button { padding-inline: 10px; }
  .slot-row { justify-content: flex-start; }
  .photo-overlay { padding: 28px 12px 10px; gap: 3px; }
  .photo-overlay strong { font-size: 14px; }
  .photo-overlay span { font-size: 9px; }
  .image-sample-label { font-size: 7px; top: 8px; left: 8px; }
  .photo-empty { gap: 7px; padding: 12px; }
  .empty-leaf { font-size: 24px; }
  .photo-empty strong { font-size: 12px; }
  .photo-empty > span:last-child { font-size: 10px; }
  .update-panel { grid-template-columns: minmax(0,1fr); }
}

/* Large photo lightbox. Kept separate from the grow journal layout so opening it cannot reflow the page. */
.photo-open-button {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: inherit;
  cursor: pointer;
}
.photo-open-button:disabled { cursor: default; opacity: 1; }
.photo-open-button:focus-visible { outline: 2px solid var(--accent); outline-offset: 5px; border-radius: 4px; }
.photo-stage[data-expandable="true"] { cursor: pointer; }

body.photo-lightbox-open { overflow: hidden; }
.photo-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: clamp(12px, 2.2vw, 28px);
}
.photo-lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3, 8, 12, .88);
  backdrop-filter: blur(5px);
}
.photo-lightbox-panel {
  position: relative;
  z-index: 1;
  width: min(94vw, 1500px);
  height: min(92vh, 960px);
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 18px;
  background: #0b141e;
  box-shadow: 0 32px 100px rgba(0,0,0,.62);
}
.photo-lightbox-header {
  min-height: 66px;
  padding: 12px 18px 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid rgba(255,255,255,.09);
}
.photo-lightbox-title-wrap,
.photo-lightbox-actions {
  min-width: 0;
  display: flex;
  align-items: center;
}
.photo-lightbox-title-wrap { gap: 14px; }
.photo-lightbox-actions { gap: 18px; }
.photo-lightbox-camera {
  width: 23px;
  height: 23px;
  flex: 0 0 23px;
  color: var(--accent);
}
.photo-lightbox-camera svg,
.photo-lightbox-close svg,
.photo-lightbox-arrow svg,
.photo-lightbox-helper svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.photo-lightbox-title-wrap strong { font-size: 17px; font-weight: 650; white-space: nowrap; }
.photo-lightbox-divider { width: 1px; height: 27px; background: rgba(255,255,255,.14); }
.photo-lightbox-capture,
.photo-lightbox-position {
  color: var(--muted);
  font: 11px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  white-space: nowrap;
}
.photo-lightbox-position { color: #cbd5df; }
.photo-lightbox-close {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  display: grid;
  place-items: center;
  padding: 12px;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 12px;
  background: rgba(255,255,255,.025);
  color: var(--text);
  cursor: pointer;
}
.photo-lightbox-image-wrap {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #050a0f;
  touch-action: none;
}
.photo-lightbox-image {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  object-fit: contain;
  object-position: center center;
  transform: scale(1.26);
  transform-origin: 48% 57%;
}
.photo-lightbox-landscape-play {
  display: none;
  position: absolute;
  z-index: 3;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 8px 13px;
  border: 1px solid rgba(110,231,183,.42);
  border-radius: 10px;
  background: rgba(8,18,27,.76);
  color: var(--accent);
  font: 600 11px ui-sans-serif, system-ui, sans-serif;
  backdrop-filter: blur(5px);
  cursor: pointer;
}
.photo-lightbox-landscape-play svg {
  width: 15px;
  height: 15px;
  fill: currentColor;
  stroke: none;
}
.photo-lightbox-landscape-play:disabled {
  opacity: .35;
  cursor: not-allowed;
}
.photo-lightbox-landscape-play:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.photo-lightbox-arrow {
  position: absolute;
  top: 50%;
  width: 50px;
  height: 50px;
  display: grid;
  place-items: center;
  padding: 15px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 50%;
  background: rgba(8,18,27,.72);
  color: #fff;
  cursor: pointer;
  transform: translateY(-50%);
  backdrop-filter: blur(4px);
}
.photo-lightbox-prev { left: 16px; }
.photo-lightbox-next { right: 16px; }
.photo-lightbox-arrow:disabled { opacity: .22; cursor: default; }
.photo-lightbox-close:hover,
.photo-lightbox-arrow:hover:not(:disabled),
.photo-lightbox-thumb:hover { filter: brightness(1.14); }
.photo-lightbox-close:focus-visible,
.photo-lightbox-arrow:focus-visible,
.photo-lightbox-thumb:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
.photo-lightbox-footer {
  padding: 12px 22px 14px;
  display: grid;
  justify-items: center;
  gap: 8px;
  border-top: 1px solid rgba(255,255,255,.08);
  background: linear-gradient(180deg,#0d1722,#0a131d);
}
.photo-lightbox-thumbs {
  width: min(100%, 560px);
  min-height: 65px;
  display: flex;
  align-items: start;
  justify-content: center;
  gap: 10px;
}
.photo-lightbox-thumb {
  width: 94px;
  min-width: 0;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.photo-lightbox-thumb[aria-current="true"] {
  color: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(110,231,183,.18);
}
.photo-lightbox-thumb img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 6px 6px 4px 4px;
  background: #071018;
}
.photo-lightbox-thumb span {
  display: block;
  padding: 5px 3px 3px;
  font: 9px/1.25 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.photo-lightbox-footer-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  flex-wrap: wrap;
}
.photo-lightbox-play {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 7px 13px;
  border: 1px solid rgba(110,231,183,.35);
  border-radius: 8px;
  background: rgba(110,231,183,.09);
  color: var(--accent);
  font: 600 10px ui-sans-serif, system-ui, sans-serif;
  cursor: pointer;
}
.photo-lightbox-play svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
  stroke: none;
}
.photo-lightbox-play:disabled { opacity: .35; cursor: not-allowed; }
.photo-lightbox-play:hover:not(:disabled) { filter: brightness(1.14); }
.photo-lightbox-play:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
.photo-lightbox-helper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--accent);
  font-size: 10px;
}
.photo-lightbox-helper svg { width: 16px; height: 16px; }

@media (max-width: 720px) {
  .photo-lightbox { padding: 8px; }
  .photo-lightbox-panel {
    width: 100%;
    height: 96dvh;
    grid-template-columns: minmax(0, 1fr);
    border-radius: 14px;
  }
  .photo-lightbox-header {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    min-height: 54px;
    padding: 8px 14px;
    gap: 10px;
  }
  .photo-lightbox-title-wrap { flex: 1 1 auto; min-width: 0; overflow: hidden; gap: 9px; }
  .photo-lightbox-title-wrap strong { flex: 0 0 auto; font-size: 14px; }
  .photo-lightbox-divider { flex: 0 0 1px; height: 20px; }
  .photo-lightbox-capture { flex: 1 1 auto; min-width: 0; max-width: none; overflow: hidden; text-overflow: ellipsis; }
  .photo-lightbox-actions { flex: 0 0 auto; margin-left: auto; gap: 8px; }
  .photo-lightbox-position { font-size: 9px; }
  .photo-lightbox-close { width: 38px; height: 38px; flex: 0 0 38px; padding: 10px; }
  .photo-lightbox-arrow { width: 44px; height: 44px; padding: 13px; }
  .photo-lightbox-prev { left: 8px; }
  .photo-lightbox-next { right: 8px; }
  .photo-lightbox-footer { padding: 9px 8px 10px; gap: 6px; }
  .photo-lightbox-thumbs { gap: 6px; min-height: 55px; }
  .photo-lightbox-thumb { width: min(17vw, 72px); }
  .photo-lightbox-thumb span { font-size: 8px; padding-top: 4px; }
  .photo-lightbox-footer-actions { gap: 9px; }
  .photo-lightbox-play { min-height: 34px; padding: 6px 10px; font-size: 9px; }
  .photo-lightbox-helper { font-size: 9px; }
}
@media (max-width: 430px) {
  .photo-lightbox-camera,
  .photo-lightbox-divider { display: none; }
  .photo-lightbox-capture { max-width: 47vw; }
  .photo-lightbox-thumbs { justify-content: space-between; }
  .photo-lightbox-thumb { width: 18vw; }
}


@media (orientation: landscape) and (max-height: 600px) and (pointer: coarse) {
  .photo-lightbox { padding: 0; }
  .photo-lightbox-panel {
    width: 100vw;
    height: 100dvh;
    max-width: none;
    max-height: none;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr);
    border: 0;
    border-radius: 0;
    background: #000;
    box-shadow: none;
  }
  .photo-lightbox-header,
  .photo-lightbox-footer {
    display: none;
  }
  .photo-lightbox-image-wrap {
    grid-row: 1;
    width: 100%;
    height: 100%;
    min-height: 0;
    background: #000;
  }
  .photo-lightbox-image {
    object-fit: cover;
    object-position: 48% 57%;
    transform: none;
    transform-origin: center center;
  }
  .photo-lightbox-arrow {
    width: 46px;
    height: 46px;
    padding: 13px;
    background: rgba(8,18,27,.68);
  }
  .photo-lightbox-prev { left: 12px; }
  .photo-lightbox-next { right: 12px; }
  .photo-lightbox-landscape-play {
    display: inline-flex;
    left: max(14px, env(safe-area-inset-left));
    bottom: max(14px, env(safe-area-inset-bottom));
  }
}

@media (prefers-reduced-motion: reduce) {
  .grow-layout *, .grow-layout *::before, .grow-layout *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
