/* Herramientas interactivas de cortabot (medir jardín, calendario del césped). Tema oscuro.
   Usa los colores y tipografías de styles.css; aquí solo lo propio de cada herramienta. */
:root {
  --ap-dia: #e8eef9;
  --ap-noche: #8f9fc6;
  --ap-fill: linear-gradient(90deg, #17c964, #39ff8a);
  --accent-ink: var(--accent);
}

/* ---------- Portada con imagen ---------- */
.ap-hero { position: relative; min-height: 420px; display: flex; align-items: flex-end; overflow: hidden; background: #0b1220; color: #fff; }
.ap-hero picture, .ap-hero picture img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ap-hero picture img { object-position: 60% 50%; }
.ap-hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(8,13,26,.15) 0%, rgba(8,13,26,.55) 45%, rgba(8,13,26,.92) 100%); }
.ap-hero-text { position: relative; z-index: 1; padding-top: 7rem; padding-bottom: 2.75rem; max-width: 760px; margin-left: auto; margin-right: auto; }
@media (min-width: 960px) { .ap-hero { min-height: 520px; } .ap-hero-text { margin-left: max(1.25rem, calc((100vw - var(--container)) / 2)); } }
.ap-hero h1 { font-size: clamp(1.9rem, 4.4vw, 3.1rem); line-height: 1.08; color: #fff; margin: .2rem 0 .8rem; }
.ap-hero p { color: rgba(255,255,255,.86); font-size: 1.08rem; max-width: 600px; margin-bottom: 1.4rem; }
.ap-eyebrow { color: var(--accent); }
.ap-crumbs { font-size: .82rem; color: rgba(255,255,255,.7); margin-bottom: 1rem; }
.ap-crumbs a { color: rgba(255,255,255,.85); }

/* ---------- Simulador ---------- */
.ap-section { padding-top: 2.5rem; }
.ap-grid { display: grid; gap: 1.5rem; }
@media (min-width: 960px) { .ap-grid { grid-template-columns: 1.08fr .92fr; align-items: start; } .ap-result { position: sticky; top: 84px; } }
.ap-config, .ap-result { padding: 1.5rem; }
@media (min-width: 720px) { .ap-config, .ap-result { padding: 1.9rem; } }
.ap-step { display: flex; align-items: center; gap: .6rem; font-size: 1.18rem; margin: 0 0 .4rem; }
.ap-step span { display: inline-grid; place-items: center; width: 1.8rem; height: 1.8rem; border-radius: 50%; background: var(--accent); color: #0a0a0a; font-size: .9rem; flex-shrink: 0; }
.ap-config .ap-step:not(:first-child) { margin-top: 2rem; }
.ap-help { color: var(--ink-soft); font-size: .93rem; margin-bottom: 1rem; }

.ap-chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.ap-chip { font: inherit; font-size: .88rem; padding: .5rem .9rem; border-radius: 999px; border: 1px solid var(--line-2); background: var(--bg-2); color: var(--ink); cursor: pointer; transition: background .2s, border-color .2s, transform .15s; }
.ap-chip:hover { border-color: var(--accent); }
.ap-chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #0a0a0a; font-weight: 600; }
.ap-chip:active { transform: scale(.97); }

.ap-group { border: 0; padding: 0; margin: 1.3rem 0 0; }
.ap-group legend { font-size: .78rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-mute); margin-bottom: .6rem; }
.ap-tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: .6rem; }
@media (min-width: 560px) { .ap-tiles { grid-template-columns: repeat(3, 1fr); } }
.ap-tile { position: relative; border-radius: 14px; border: 1.5px solid var(--line-2); background: #fff; transition: border-color .2s, box-shadow .2s, background .2s; }
.ap-tile.is-on { border-color: var(--accent-2); background: #fffaf0; box-shadow: 0 6px 18px -10px rgba(255,176,32,.7); }
.ap-toggle { all: unset; box-sizing: border-box; display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: .55rem; width: 100%; padding: .7rem .75rem; cursor: pointer; border-radius: 14px; }
.ap-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ap-ico { grid-row: 1 / 3; width: 44px; height: 44px; align-self: center; mix-blend-mode: multiply; filter: grayscale(.9) opacity(.55); transition: filter .2s, transform .2s; }
.ap-toggle:hover .ap-ico { filter: grayscale(.3) opacity(.85); }
.ap-tile.is-on .ap-ico { filter: none; transform: scale(1.08); }
.ap-name { font-size: .86rem; font-weight: 600; line-height: 1.25; color: var(--ink); }
.ap-w { font-size: .75rem; color: var(--ink-mute); }
.ap-qty { display: none; align-items: center; justify-content: center; gap: .2rem; padding: 0 .5rem .55rem; }
.ap-tile.is-on .ap-qty { display: flex; }
.ap-qty button { font: inherit; width: 1.9rem; height: 1.9rem; border-radius: 50%; border: 1px solid var(--line-2); background: #fff; cursor: pointer; font-size: 1rem; line-height: 1; color: var(--ink); }
.ap-qty button:hover { border-color: var(--accent); color: var(--accent-ink); }
.ap-qty output { min-width: 1.6rem; text-align: center; font-weight: 700; font-size: .92rem; }

.ap-opts { display: grid; gap: 1.2rem; margin-top: .8rem; }
.ap-opt { display: grid; gap: .5rem; font-size: .93rem; font-weight: 600; }
.ap-opt input[type="time"] { font: inherit; font-weight: 600; font-size: 1.05rem; padding: .5rem .7rem; border-radius: var(--radius-sm); border: 1px solid var(--line-2); background: #fff; width: max-content; color: var(--ink); }
.ap-season { margin-top: .2rem; }

/* ---------- Resultado ---------- */
.ap-meters { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; margin: 1rem 0; }
.ap-meters div { background: var(--bg-2); border-radius: var(--radius-sm); padding: .75rem .4rem; text-align: center; }
.ap-meters strong { display: block; font-family: var(--display); font-size: 1.35rem; line-height: 1.1; }
.ap-meters span { font-size: .72rem; color: var(--ink-mute); line-height: 1.2; display: block; margin-top: .2rem; }

.ap-reco { border-radius: 16px; padding: 1rem; background: linear-gradient(135deg, #0d2418, #12361f); border: 1px solid rgba(57,255,138,.35); color: #fff; display: grid; gap: .8rem; }
.ap-reco-label { font-size: .78rem; font-weight: 700; letter-spacing: .03em; color: var(--accent); }
.ap-reco-body { display: flex; gap: .9rem; align-items: center; }
.ap-reco-body img { width: 84px; height: 84px; border-radius: 12px; object-fit: contain; background: #fff; flex-shrink: 0; }
.ap-reco-name { display: block; color: #fff; font-weight: 700; text-decoration: none; }
.ap-reco-name:hover { text-decoration: underline; }
.ap-reco-h { display: block; font-family: var(--display); font-size: 1.7rem; line-height: 1.15; color: var(--accent); }
.ap-reco-sub { display: block; font-size: .82rem; color: rgba(255,255,255,.78); }
.ap-reco-none { background: rgba(255,92,92,.08); color: var(--ink); border: 1px solid rgba(255,92,92,.4); }
.ap-reco-none span { font-size: .88rem; color: var(--ink-soft); }

.ap-list-title { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .5rem; font-size: 1rem; margin: 1.4rem 0 .6rem; }
.ap-legend { font-size: .75rem; font-weight: 500; color: var(--ink-mute); display: inline-flex; align-items: center; gap: .35rem; }
.ap-legend i { display: inline-block; width: .8rem; height: .8rem; border-radius: 3px; }
.ap-legend i.d { background: var(--ap-dia); border: 1px solid var(--line-2); } .ap-legend i.n { background: var(--ap-noche); margin-left: .4rem; } .ap-legend i.g { width: 2px; background: var(--ink); margin-left: .4rem; }
.ap-list { list-style: none; padding: 0; margin: 0; display: grid; gap: .55rem; }
.ap-row { display: grid; grid-template-columns: 48px 1fr auto; gap: .7rem; align-items: center; padding: .6rem; border-radius: 12px; background: var(--bg-2); border: 1px solid var(--line); }
.ap-row img { width: 48px; height: 48px; border-radius: 9px; object-fit: contain; background: #fff; }
.ap-row-main { min-width: 0; }
.ap-row-top { display: flex; justify-content: space-between; gap: .5rem; align-items: baseline; }
.ap-row-name { font-size: .86rem; font-weight: 600; color: var(--ink); text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ap-row-name:hover { text-decoration: underline; }
.ap-row-h { font-family: var(--display); font-weight: 700; font-size: .95rem; white-space: nowrap; }
.ap-bar { position: relative; height: 12px; border-radius: 999px; margin: .35rem 0 .3rem; overflow: hidden; }
.ap-goal { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: var(--ink); opacity: .75; }
.ap-bar span { display: block; height: 100%; border-radius: 999px; background: var(--ap-fill); box-shadow: 0 0 10px rgba(57,255,138,.45); transition: width 1s var(--ease-out); }
.ap-row-sub { font-size: .74rem; color: var(--ink-mute); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ap-row .btn { padding: .45rem .75rem; font-size: .78rem; }
.ap-row.is-short .ap-bar span { background: linear-gradient(90deg, #f0a43a, #f6c06d); box-shadow: none; }
.ap-row.is-short .ap-row-h { color: #a35c00; }
.ap-row.is-no { opacity: .62; }
.ap-row.is-no .ap-row-sub { color: var(--bad); white-space: normal; }
@media (max-width: 560px) {
  .ap-row { grid-template-columns: 40px 1fr; align-items: start; }
  .ap-row img { width: 40px; height: 40px; }
  .ap-row-top { flex-wrap: wrap; column-gap: .6rem; row-gap: 0; }
  .ap-row-name, .ap-row-sub { white-space: normal; }
  .ap-row .btn { grid-column: 2; justify-self: start; padding: .35rem .8rem; }
}

.ap-axis { position: relative; height: 2.4rem; margin: .5rem 0 0 calc(48px + 1.3rem); margin-right: 5.5rem; font-size: .7rem; color: var(--ink-mute); }
.ap-axis span { position: absolute; top: 0; transform: translateX(-50%); text-align: center; white-space: nowrap; line-height: 1.2; }
.ap-axis span:first-child { transform: none; }
.ap-axis small { display: block; font-size: .66rem; opacity: .8; }
@media (max-width: 560px) { .ap-axis { margin-left: calc(40px + 1.3rem); margin-right: .9rem; } }
.ap-empty { padding: 2rem 1rem; text-align: center; color: var(--ink-soft); background: var(--bg-2); border-radius: 12px; margin-top: 1rem; }

.ap-share { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-top: 1.3rem; padding-top: 1.1rem; border-top: 1px solid var(--line); }
.ap-share span { font-size: .85rem; color: var(--ink-soft); width: 100%; }
.ap-share .btn { padding: .5rem .95rem; font-size: .85rem; }
.ap-note { font-size: .76rem; color: var(--ink-mute); margin-top: .9rem; }

.ap-mini { position: fixed; left: 50%; bottom: 14px; transform: translateX(-50%); z-index: 40; max-width: calc(100vw - 32px); padding: .7rem 1.1rem; border-radius: 999px; background: var(--accent); color: #0a0a0a; font-size: .85rem; font-weight: 700; text-decoration: none; box-shadow: 0 10px 30px -8px rgba(0,0,0,.7); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ap-mini[hidden] { display: none; }
@media (min-width: 960px) { .ap-mini { display: none !important; } }

/* ---------- Contenido ---------- */
.ap-article { padding: 1.6rem; }
@media (min-width: 720px) { .ap-article { padding: 2.4rem; } }
.ap-article h2 { margin-top: 2rem; }
.ap-article h2:first-child { margin-top: 0; }
.ap-table-wrap { overflow-x: auto; margin: 1rem 0 1.5rem; }
.ap-table { width: 100%; border-collapse: collapse; font-size: .9rem; min-width: 520px; }
.ap-table th, .ap-table td { text-align: left; padding: .55rem .7rem; border-bottom: 1px solid var(--line); }
.ap-table th { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-mute); }
.ap-table tbody tr:nth-child(odd) { background: var(--bg-2); }
.ap-figure { display: grid; gap: 1.5rem; align-items: center; margin: 2rem 0; }
@media (min-width: 960px) { .ap-figure { grid-template-columns: 1fr 1fr; } }
.ap-figure img { width: 100%; height: auto; border-radius: 16px; display: block; }
.ap-figure h2 { margin-top: 0; }
.ap-figure ol { padding-left: 1.2rem; display: grid; gap: .5rem; }
.ap-faq { border-bottom: 1px solid var(--line); padding: .9rem 0; }
.ap-faq summary { font-weight: 600; cursor: pointer; }
.ap-faq p { margin-top: .6rem; color: var(--ink-soft); }
.ap-related-title { font-size: 1.4rem; margin-bottom: 1rem; }
.ap-related { display: grid; gap: .8rem; }
@media (min-width: 720px) { .ap-related { grid-template-columns: repeat(4, 1fr); } }
.ap-related a { padding: 1.1rem 1.2rem; text-decoration: none; color: var(--ink); display: grid; gap: .25rem; transition: transform .2s var(--ease-out); }
.ap-related a:hover { transform: translateY(-3px); }
.ap-related strong { font-size: .95rem; }
.ap-related span { font-size: .8rem; color: var(--accent-ink); }

/* Bloque para enlazar las herramientas desde guías, categorías y portada */
.tool-cta { display: grid; grid-template-columns: auto 1fr; gap: 1rem; align-items: center; padding: 1.1rem 1.3rem; margin: 1.5rem 0; border-radius: 16px; background: linear-gradient(135deg, #10182b, #1d2c52); color: #fff; text-decoration: none; }
.tool-cta-ico { font-size: 2rem; }
.tool-cta strong { display: block; color: #fff; }
.tool-cta span { font-size: .88rem; color: rgba(255,255,255,.8); }
.tool-cta:hover strong { text-decoration: underline; }

@media (prefers-reduced-motion: reduce) { .ap-bar span, .ap-tile, .ap-ico, .ap-related a { transition: none; } }


/* ---------- Medidor de jardín ---------- */
.mj-grid { display: grid; gap: 1.5rem; }
.mj-grid > *, .ap-grid > * { min-width: 0; }
@media (min-width: 960px) { .mj-grid { grid-template-columns: 1.35fr .9fr; align-items: start; } .mj-grid .ap-result { position: sticky; top: 84px; } }
.mj-mapbox { padding: 1.3rem; }
@media (min-width: 720px) { .mj-mapbox { padding: 1.7rem; } }
.mj-mapbox .ap-step:not(:first-child) { margin-top: 1.6rem; }
.mj-search { display: flex; gap: .5rem; margin: .8rem 0 .3rem; }
.mj-search input { flex: 1; min-width: 0; font: inherit; padding: .65rem .85rem; border-radius: var(--radius-sm); border: 1px solid var(--line-2); background: var(--bg-2); color: var(--ink); }
.mj-search .btn { padding: .6rem 1rem; flex-shrink: 0; }
@media (max-width: 420px) { .mj-search .btn { padding: .6rem .75rem; } }
.mj-status { min-height: 1.3rem; font-size: .85rem; color: var(--accent); margin-bottom: .4rem; }
.mj-tools { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .7rem; }
.mj-tools .ap-chip { font-size: .8rem; padding: .42rem .75rem; }
.mj-map { height: 520px; border-radius: 12px; overflow: hidden; border: 1px solid var(--line-2); background: #1d2a22; cursor: crosshair; }
@media (max-width: 719px) { .mj-map { height: 62vh; min-height: 380px; } }
.mj-map .leaflet-container, .mj-map.leaflet-container { cursor: crosshair; font: inherit; }
.mj-noscript { padding: 1.5rem; color: var(--ink-soft); }
.mj-help { font-size: .8rem; color: var(--ink-mute); margin-top: .6rem; }
.mj-tip { background: rgba(10,10,10,.85); color: var(--accent); border: 1px solid var(--accent); font-weight: 700; font-family: var(--display); box-shadow: none; }
.mj-tip::before { display: none; }
.mj-cable { font-size: .86rem; color: var(--ink-soft); background: var(--bg-2); border-radius: 10px; padding: .7rem .85rem; margin: 0 0 1rem; }
.mj-ejemplo { font-size: .88rem; color: var(--ink-soft); margin: .4rem 0 0; }

/* ---------- Calendario del césped ---------- */
.cc-hero { background: linear-gradient(115deg, #1f5c35 0%, #2f7d3a 22%, #9a7a12 42%, #8a4a12 62%, #2a3c55 82%, #1b2433 100%); }
.cc-hero-art { position: absolute; inset: 0; display: flex; justify-content: space-around; align-items: center; font-size: clamp(3rem, 9vw, 7rem); opacity: .22; filter: saturate(.8); pointer-events: none; }
.cc-box { padding: 1.3rem; }
@media (min-width: 720px) { .cc-box { padding: 2rem; } }
.cc-top { display: flex; flex-wrap: wrap; gap: 1rem; align-items: end; justify-content: space-between; margin-bottom: 1rem; }
.cc-select { font: inherit; font-weight: 600; font-size: 1.05rem; padding: .65rem .8rem; border-radius: var(--radius-sm); border: 1px solid var(--line-2); background: var(--bg-2); color: var(--ink); min-width: 240px; max-width: 100%; }
.cc-acciones { display: flex; flex-wrap: wrap; gap: .5rem; }
.cc-resumen { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1.2rem; }
.cc-resumen span { font-size: .86rem; background: var(--bg-2); border: 1px solid var(--line); border-radius: 999px; padding: .45rem .85rem; color: var(--ink-soft); }
.cc-resumen strong { color: var(--accent); }
.cc-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; scroll-snap-type: x proximity; padding-bottom: .4rem; }
.cc-meses { display: grid; grid-template-columns: repeat(12, minmax(84px, 1fr)); gap: .45rem; min-width: 1060px; }
.cc-mes { all: unset; box-sizing: border-box; cursor: pointer; scroll-snap-align: center; display: grid; gap: .3rem; justify-items: center; text-align: center; padding: .7rem .35rem; border-radius: 12px; background: var(--bg-2); border: 1px solid var(--line); transition: border-color .2s, transform .2s; }
.cc-mes:hover { transform: translateY(-2px); border-color: var(--line-2); }
.cc-mes:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.cc-mes.is-sel { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.cc-mes.is-hoy .cc-mes-nom::after { content: " · hoy"; color: var(--accent); font-size: .7rem; }
.cc-mes-nom { font-family: var(--display); font-weight: 700; text-transform: capitalize; font-size: .95rem; }
.cc-bar { position: relative; width: 14px; height: 70px; border-radius: 99px; background: rgba(255,255,255,.06); overflow: hidden; }
.cc-bar::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: var(--h); border-radius: 99px; background: linear-gradient(0deg, #17c964, #39ff8a); }
.nivel-0 .cc-bar::after { background: #4a5a66; } .nivel-4 .cc-bar::after { background: linear-gradient(0deg, #e0a200, #ffcf5c); }
.cc-t { font-weight: 600; font-size: .85rem; }
.cc-robot { font-size: .7rem; color: var(--ink-mute); min-height: 2.2em; line-height: 1.15; }
.cc-dato { font-size: .74rem; color: var(--ink-soft); }
.cc-tareas { min-height: 1.3rem; font-size: 1rem; letter-spacing: .1em; }
.cc-leyenda { font-size: .76rem; color: var(--ink-mute); margin: .5rem 0 1.2rem; }
.cc-detalle { background: var(--bg-2); border: 1px solid var(--line); border-radius: 14px; padding: 1.2rem 1.3rem; }
.cc-detalle h3 { font-size: 1.15rem; margin-bottom: .8rem; }
.cc-detalle h3 em { font-style: normal; font-size: .72rem; background: var(--accent); color: #0a0a0a; border-radius: 99px; padding: .15rem .5rem; vertical-align: middle; }
.cc-detalle h3 span { display: block; font-size: .8rem; font-weight: 400; color: var(--ink-mute); margin-top: .2rem; }
.cc-detalle ul { list-style: none; padding: 0; margin: 0; display: grid; gap: .8rem; }
@media (min-width: 900px) { .cc-detalle ul { grid-template-columns: 1fr 1fr; } }
.cc-detalle li { display: flex; gap: .7rem; }
.cc-detalle li > span { font-size: 1.4rem; line-height: 1.2; }
.cc-detalle li p { font-size: .86rem; color: var(--ink-soft); margin: .1rem 0 0; }
