/* Container & overflow fixes */
.am-details{margin:12px 0 16px 0;width:100%;box-sizing:border-box;position:relative}
.am-view{box-sizing:border-box;max-width:100%}
.am-table-wrap{width:100%;overflow-x:auto}
.am-table{width:100%;table-layout:fixed;border-collapse:collapse}
.am-table th,.am-table td{white-space:nowrap}
/* Slider */
.am-slider{position:relative;width:100%;overflow:hidden;min-height:40px;transition:height .25s ease}
.am-track{display:flex;transition:transform .25s ease;touch-action:pan-y;will-change:transform;}
.am-view{flex:0 0 auto;width:100%;padding-right:0;}
/* Dots */
.am-dots{position:absolute;left:50%;bottom:8px;transform:translateX(-50%);display:flex;gap:8px;z-index:1001;}
.am-dot{width:8px;height:8px;border-radius:50%;border:2px solid rgba(230,57,70,.9);background:rgba(230,57,70,.2);padding:0;display:inline-block;opacity:.85;cursor:pointer;}
.am-dot.is-active{background:rgba(230,57,70,.95);}
/* Arrows */
.am-arrow{position:absolute;top:50%;transform:translateY(-50%) scale(.9);background:transparent;border:none;color:#e63946;font-size:50px;line-height:1;padding:12px;cursor:pointer;text-shadow:0 2px 12px rgba(0,0,0,.55);opacity:0;transition:opacity .25s,transform .25s;z-index:1000;pointer-events:none;}
.am-left{left:6px;} .am-right{right:6px;}
.am-arrow.am-show{opacity:1;pointer-events:auto;transform:translateY(-50%) scale(1);}
/* Header + KPIs */
.am-title{margin:0;font-size:16px;font-weight:700;}
.am-title-row{display:flex;align-items:center;justify-content:space-between;margin:0 0 8px 0;}
.am-row{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;}
.am-row.am-grid{grid-template-columns:repeat(5,minmax(0,1fr));}
@media(max-width:900px){.am-row.am-grid{grid-template-columns:repeat(3,minmax(0,1fr));}}
@media(max-width:640px){.am-row,.am-row.am-grid{grid-template-columns:repeat(2,minmax(0,1fr));}}
.am-row .am-kv{display:flex;flex-direction:column;justify-content:center;align-items:center;text-align:center;padding:10px;border:1px solid #e5e7eb;border-radius:10px;background:#fff;min-height:60px;}
.am-row .am-kv-key{font-size:14px;margin-bottom:2px;}
.am-row .am-kv-val{font-size:16px;font-weight:700;}
.am-sub{font-size:10px;color:#6b7280;margin-top:2px}
.am-wind-arrow{display:inline-block;transition:transform .2s;font-weight:900;margin-right:4px;}
.am-rh-icon{display:inline-block;font-size:10px;font-weight:800;padding:2px 4px;border:1px solid #d1d5db;border-radius:6px;line-height:1;}
/* Sections */
.am-sec{margin-top:10px;}
.am-sec-h{display:block;width:100%;text-align:left;padding:8px 10px;border:none;border-radius:8px;cursor:pointer;font-weight:600;color:#333;}
.am-sec-h[data-sec="hourly"]{background:#ddbf8d;}
.am-sec-h[data-sec="daily"]{background:#b4d6a7;}
.am-sec-b{padding:8px 0;}
/* Radar */
.am-radar-wrap{width:100%;}
.am-radar-tools{display:flex;flex-wrap:wrap;gap:8px;margin-bottom:6px;align-items:center}
.am-chip{background:#fff;border:1px solid #e5e7eb;border-radius:999px;padding:4px 10px;font-weight:600}
.am-op{display:flex;align-items:center;gap:6px;font-size:12px}
.am-radar-header{display:flex;align-items:center;justify-content:flex-end;margin-bottom:6px;}
.am-radar-clock{font-weight:700;background:rgba(17,24,39,.75);color:#fff;padding:4px 8px;border-radius:8px;font-size:12px;}
.am-radar-map{width:100% !important;height:320px;border:1px solid #e5e7eb;border-radius:10px;background:#f9fafb;}
@media(max-width:720px){.am-radar-map{height:240px;}}
/* UM badge */
.um-profile-nav{display:flex;align-items:center;flex-wrap:nowrap;overflow-x:auto;}
.am-temp-slot{display:inline-flex;align-items:center;margin-right:355px;white-space:nowrap;transform: translateY(8px);}
/* Mobile/≤720px: ne prikazuj */
.am-temp-badge{ display:none; }

/* >720px: primijeni tvoj stil i prikaži */
@media (min-width: 721px){
  .am-temp-badge{
    display:inline-flex;
    align-items:center;
    gap:4px;
    background:#fff;
    border:1px solid #d1d5db;
    border-radius:9px;
    padding:2px 2px;
    cursor:pointer;
    font-weight:700;
    font-size:15px;
    line-height:1.5;
  }
}

/* Recs + Accordions */
.am-card{border:1px solid #e5e7eb;border-radius:12px;margin-bottom:10px;background:#fff;overflow:hidden}
.am-card-hd{font-weight:700;padding:8px 10px;background:#f8fafc;border-bottom:1px solid #eef2f7}
.am-reco-row{display:flex;gap:10px;align-items:flex-start;padding:8px 10px;border-top:1px dashed #eef2f7}
.am-reco-row .am-reco-act{min-width:160px;font-weight:700}
.am-reco-row.ok .am-reco-act{color:#166534}
.am-reco-row.warn .am-reco-act{color:#92400e}
.am-reco-row.no .am-reco-act{color:#991b1b}
.am-note{padding:8px 10px;color:#6b7280}
.am-acc{margin:8px 0;border:1px solid #e5e7eb;border-radius:10px;background:#fff;padding:0}
.am-acc>summary{cursor:pointer;font-weight:700;outline:none;padding:8px 10px;border-bottom:1px solid #e5e7eb;border-top-left-radius:10px;border-top-right-radius:10px}


/* === v0.6.8 patches === */
/* Container safety */
.am-slider,.am-track,.am-view,.am-details,.am-card,.am-table-wrap{max-width:100%;box-sizing:border-box}
.am-view{padding:8px 12px 14px 12px;overflow-wrap:anywhere;word-break:break-word}
.am-view .am-kpis,.am-view .am-head,.am-view .am-topline{text-align:right}
.am-view .am-topline{display:flex;justify-content:flex-end;gap:10px;flex-wrap:wrap;margin-bottom:6px}
.am-track{overflow:visible}.am-view{flex:0 0 100%}
/* Hide RH last column if present */
.am-table thead th:last-child,.am-table tbody td:last-child{display:none}
/* Accordion natural expansion */
details.am-acc{overflow:visible}
details.am-acc[open]>.am-acc-content{max-height:none!important;height:auto!important;overflow:visible!important}
.am-acc-content{transition:max-height .25s ease;will-change:max-height}
#agro-meteo-details,#agro-meteo-details *{max-width:100%}

/* KPI badges row on slide 1 */
.am-kpi-badge{display:inline-flex;align-items:center;gap:6px;padding:10px 14px;border:1px solid #e5e7eb;border-radius:16px;background:#fff;font-weight:700}
.am-kpi-ico{font-size:16px;line-height:1}.am-kpi-val{font-size:15px}

/* Alert chip */
.am-alert{display:inline-flex;align-items:center;gap:8px;padding:8px 12px;border-radius:12px;border:1px solid #e5e7eb;font-weight:700}
.am-alert.ok{background:#ecfdf5;color:#065f46;border-color:#a7f3d0}
.am-alert.warn{background:#fffbeb;color:#92400e;border-color:#fde68a}
.am-alert.no{background:#fef2f2;color:#991b1b;border-color:#fecaca}
.am-alert .am-alert-tag{font-size:11px;font-weight:800;padding:2px 6px;border-radius:999px;background:rgba(0,0,0,.06)}

/* Charts */
.am-reco-body .am-svg{width:100%;height:auto;display:block;color:#2563eb}


/* v0.7.2: Map slide height cap so it doesn't stretch page */
.am-view-radar, .am-view-radar .leaflet-container { min-height: 360px; height: 60vh; max-height: 540px; }
.am-slider { transition: height .25s ease; }


/* v0.7.4: ensure old KPI strip hidden if template still prints it */
.am-topline, .am-kpi-badge, .am-topline * { display: none !important; }


/* v0.7.5: ensure slides don't impose tallest height at init */
.am-slider { overflow: hidden; }
.am-track { display: flex; align-items: stretch; }
.am-track > .am-view { flex: 0 0 100%; }


/* v0.7.6: Non-active views shouldn't impose height */
.am-track > .am-view { height: auto !important; min-height: 0 !important; }
.am-track > .am-view:not(.is-active) { height: auto !important; min-height: 0 !important; }
.am-slider { overflow: hidden; transition: height .25s ease; }


/* v0.7.7: neutral baseline so tallest slide doesn't dominate */
.am-slider { overflow: hidden; transition: height .25s ease; height: auto; }
.am-track { display: flex; align-items: stretch; }
.am-track > .am-view { flex: 0 0 100%; height: auto; }


/* v0.7.8: Alarm card and safe slider baseline */
.am-alertbar{ margin: 4px 0 12px 0; }
.am-alarm{ display:flex; align-items:center; gap:.6rem; padding:.8rem 1rem; border-radius:12px; background:#e9f7ef; color:#22543d; box-shadow:0 1px 2px rgba(0,0,0,.06) }
.am-alarm.ok{ background:#e9f7ef; color:#22543d; }
.am-alarm.warn{ background:#fff8e6; color:#7a4e00; }
.am-alarm.no{ background:#fdecea; color:#7a1e1e; }
.am-alarm-badge{ font-weight:700; font-size:.8rem; background:rgba(0,0,0,.06); border-radius:999px; padding:.2rem .6rem; }
.am-alarm-text{ font-weight:600; }
.am-slider{ overflow:hidden; transition:height .25s ease; height:auto; }
.am-track{ display:flex; align-items:stretch; }
.am-track>.am-view{ flex:0 0 100%; height:auto; }


/* v0.7.21 — mobile ALARM KPI, slider baseline, climate styles */

/* Slider baseline */
.am-slider{ position:relative; width:100%; overflow:hidden; min-height:40px; transition:height .25s ease; }
.am-track{ display:flex; align-items:stretch; transition:transform .25s ease; }
.am-track>.am-view{ flex:0 0 100%; height:auto !important; min-height:0 !important; }

/* Alarm KPI (<=832px) */
.am-kpi--alarm{ display:none; }
@media (max-width:832px){
  .am-kpi--alarm{ display:flex; flex-direction:column; justify-content:center; padding:.8rem 1rem; border-radius:12px; border:1px solid #e5e7eb; background:#fff; box-shadow:0 1px 2px rgba(0,0,0,.06); font-weight:700; min-height:72px; }
  .am-kpi--alarm .am-kpi-badge{ font-size:.75rem; font-weight:800; padding:.15rem .55rem; border-radius:999px; background:rgba(0,0,0,.08); display:inline-block; margin-bottom:.35rem; }
  .am-kpi--alarm .am-kpi-value{ font-size:1rem; line-height:1.1; }
  .am-kpi--alarm.level-ok{ background:#e9f7ef; color:#22543d; border-color:#cfe9da; }
  .am-kpi--alarm.level-warn{ background:#fff8e6; color:#7a4e00; border-color:#ffe4b3; }
  .am-kpi--alarm.level-crit{ background:#fdecea; color:#7a1e1e; border-color:#f5c2c0; }
}
@media (min-width:833px){ .am-kpi--alarm{ display:none !important; } }

/* Hide top alert bar on mobile (<=832px) if exists */
@media (max-width:832px){ .am-alert{ display:none !important; } }

/* Climate accordions + graphs */
.am-card-bd .am-svg{ width:100%; height:auto; display:block; }
.am-subacc{ margin:6px 0; border:1px solid #e5e7eb; border-radius:10px; overflow:hidden; background:#fff; }
.am-subacc>summary{ cursor:pointer; font-weight:700; padding:8px 10px; list-style:none; outline:none; border-bottom:1px solid #eef2f7; }
.tone-red{ background:#f7caca !important; } .color-red{ color:#dc2626 !important; }
.tone-blue{ background:#cfdcf6 !important; } .color-blue{ color:#2563eb !important; }
.tone-brown{ background:#ddbf8d !important; } .color-brown{ color:#8b5e34 !important; }
.tone-yellow{ background:#ffe9a8 !important; } .color-yellow{ color:#f59e0b !important; }

.am-climate-wrap{ min-height:40px; }






