/* Щоденник саду — доповнення до спільних стилів кабінету (../css/app.css) */
.diary .top .who { background: none; border: 0; color: inherit; padding: 0; }
.diary .up-btn { white-space: nowrap; }
.nav a.up { color: var(--nut); font-weight: 700; }
.nav a.up.on { color: #fff; }
.add-side { width: 100%; margin-top: 14px; }
.side-foot a { display: block; margin-top: 8px; color: var(--pine); font-weight: 600; }

/* швидкі кнопки запису */
.quick { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; }
.qbtn { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 14px 8px; border: 1px solid var(--line); border-radius: 14px;
  background: #fff; box-shadow: var(--shadow); font-weight: 700; font-size: 13.5px; color: var(--ink); }
.qbtn span { font-size: 26px; line-height: 1; }
.qbtn:hover { border-color: var(--leaf); background: #fbfdf6; }

/* стрічка записів */
.fitem { display: flex; gap: 12px; align-items: flex-start; text-align: left; width: 100%; cursor: pointer; font: inherit; color: inherit; }
.fitem:hover { border-color: var(--leaf); }
.fitem .fic { width: 34px; height: 34px; flex: none; border-radius: 10px; background: var(--soft); display: grid; place-items: center; font-size: 17px; }
.fitem .grow, .pitem .grow { flex: 1; min-width: 0; display: block; }
.fitem .t, .pitem .t, .fitem .meta, .pitem .meta { display: block; }
.clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.clamp3 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.mgroup { margin-bottom: 18px; }
.mgroup h4 { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--pine); margin: 0 0 8px; }
.mgroup.now h4 { color: var(--ink); }

/* заходи програми */
.pitem { display: flex; gap: 10px; align-items: flex-start; border-left: 4px solid var(--c, var(--line)); }
.pitem.done { opacity: .6; }
.pitem.done .t { text-decoration: line-through; }
.pitem.late { background: #fffaf0; }
.bad-t { color: var(--bad); }
.pcheck { width: 26px; height: 26px; flex: none; border-radius: 8px; border: 2px solid var(--line); background: #fff; color: var(--ok); font-weight: 800; margin-top: 2px; }
.pcheck:hover { border-color: var(--ok); }
.pitem.done .pcheck { background: var(--ok-bg); border-color: var(--ok); }

/* форма запису */
.typepick { display: flex; gap: 6px; flex-wrap: wrap; }
.typepick label { display: flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 99px; padding: 6px 12px; cursor: pointer; font-weight: 600; font-size: 13.5px; background: #fff; }
.typepick label.on { background: var(--pine); color: #fff; border-color: var(--pine); }
.typepick input { position: absolute; opacity: 0; pointer-events: none; }
.f .flabel { display: block; margin-bottom: 6px; }

/* погода */
.wxnow { display: flex; gap: 12px; align-items: center; }
.wxnow .big { font-size: 40px; line-height: 1; }
.wxnow .t { font: 400 34px/1 var(--serif); color: var(--pine); }
.wxd4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin-top: 12px; }
.wxd4 > div { background: var(--soft); border-radius: 10px; padding: 7px 4px; text-align: center; font-size: 12.5px; display: grid; gap: 1px; }
.wxd4 b { font-size: 11.5px; } .wxd4 span { font-size: 18px; } .wxd4 i { font-style: normal; color: var(--info); font-size: 11px; }

/* сади */
.gcard { text-decoration: none; color: inherit; display: block; }
.gcard:hover { border-color: var(--leaf); }
.gcard h2 { margin-top: 4px; }

/* календар */
.dcal .d { text-decoration: none; color: inherit; display: block; }
.dcal .ev { background: var(--soft); color: var(--ink); }
.dcal .ev.todo { background: #fff; border: 1px dashed var(--c, var(--leaf)); padding: 0 3px; }
.dcal .ev.done { background: var(--ok-bg); color: var(--ok); text-decoration: line-through; }
.dcal .ev.fact { background: #eef5e4; }
.lg { display: inline-block; width: 12px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.lg.fact { background: #d4e3c3; } .lg.todo { border: 1px dashed var(--leaf); } .lg.done { background: var(--ok-bg); border: 1px solid var(--ok); }

/* бібліотека */
.libgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.libcard { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.libcard img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; display: block; cursor: pointer; background: var(--soft); }
.libcard .lb { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.libcard h3 a { color: inherit; text-decoration: none; }
.libcard h3 a:hover { text-decoration: underline; }
.libmini { display: grid; gap: 8px; }
.libm { display: flex; gap: 10px; align-items: center; text-align: left; background: none; border: 0; padding: 0; color: inherit; }
.libm img, .libm .ph { width: 64px; height: 48px; object-fit: cover; border-radius: 8px; flex: none; background: var(--soft); display: grid; place-items: center; }
.libm b { display: block; font-size: 13.5px; line-height: 1.3; }
.libm:hover b { text-decoration: underline; }
.reader { max-width: 720px; }
.reader h2 { font-size: 26px; margin: 4px 0 10px; }
.reader .lead { font-size: 17px; color: var(--ink); }
.reader p { line-height: 1.65; }
.reader figure { margin: 12px 0; }
.reader figure img { width: 100%; border-radius: 10px; display: block; }
.reader figcaption { font-size: 12px; color: var(--muted); margin-top: 4px; }

/* розширений кабінет */
.upsell { background: linear-gradient(160deg, #204534, #2d5a45); color: #eaf1e8; border: 0; }
.upsell .eyebrow { color: var(--lime); }
.upsell h3 { color: #fff; margin-top: 4px; }
.up-plans .plan .eyebrow { min-height: 30px; }
ul.ticks { list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 6px; font-size: 13.5px; }
ul.ticks li { padding-left: 22px; position: relative; }
ul.ticks li::before { content: "✓"; position: absolute; left: 0; color: var(--ok); font-weight: 800; }

.printonly { display: none; }

/* нижня панель на телефоні */
.tabbar { display: none; }
@media (max-width: 860px) {
  .diary .up-btn { padding: 4px 8px; font-size: 12px; }
  .quick { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .quick .qbtn { font-size: 12px; padding: 12px 4px 10px; }
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 55; background: #fff;
    border-top: 1px solid var(--line); padding: 4px 4px calc(4px + env(safe-area-inset-bottom)); }
  .tabbar a, .tabbar button { display: flex; flex-direction: column; align-items: center; gap: 1px; font-size: 11px; font-weight: 600; color: var(--muted);
    text-decoration: none; background: none; border: 0; padding: 4px 0; }
  .tabbar span { font-size: 19px; line-height: 1.1; }
  .tabbar .on { color: var(--pine); }
  .tabbar .plus span { width: 40px; height: 40px; border-radius: 50%; background: var(--pine); color: #fff; display: grid; place-items: center; margin-top: -16px; box-shadow: 0 3px 10px rgba(32,69,52,.35); }
  .main { padding-bottom: 96px; }
  .add-side { display: none; }
}
@media (max-width: 560px) {
  .diary .up-btn { display: none; }
  .wxd4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media print {
  .tabbar, .add-side { display: none !important; }
  .printonly { display: block; }
}

/* поле, яке треба заповнити */
.f.need .flabel { color: var(--bad); }
.f.need .tagchips { outline: 2px dashed #e9c2bc; outline-offset: 4px; border-radius: 10px; }
#tfields .f[hidden] { display: none; }

/* стан збереження на сервері */
.syncb { display: inline-flex; align-items: center; gap: 6px; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.25); color: #eaf1e8;
  border-radius: 99px; padding: 5px 11px; font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.syncb.ok { color: #d5e889; }
.syncb.warn { background: #fbf0d6; color: #6d4700; border-color: #e8cf94; }
.modal .syncb { background: var(--soft); color: var(--ink); border-color: var(--line); }
.nav .count.soon { background: var(--soft); color: var(--muted); font-weight: 700; }
.install-btn { width: 100%; margin-top: 8px; }
.install-card { border-color: #cfdcc4; background: #f6faef; }
.welcome-tabs { margin: 6px 0 4px; }
.steps-ol { padding-left: 20px; display: grid; gap: 8px; }

/* календар: запланувати на день */
.planbtns { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.planbtns .btn { border-left: 4px solid var(--c); }
.daycard { position: sticky; top: 76px; }
@media (max-width: 1100px) { .daycard { position: static; } }
@media (max-width: 860px) {
  .syncb .lbl { display: none; }
  .syncb.warn .lbl { display: inline; max-width: 120px; overflow: hidden; text-overflow: ellipsis; }
}
.modal .syncb .lbl { display: inline !important; max-width: none; }

/* підтримка й кабінет адміністратора */
.tkitem { text-decoration: none; color: inherit; }
.tkitem.unread { border-color: var(--nut); box-shadow: inset 3px 0 0 var(--nut); }
.public-support { max-width: 820px; margin: 0 auto; }
.admin-login { max-width: 420px; margin: 10vh auto; }
.admin-login h2 { margin: 6px 0 14px; }
.clickrow { cursor: pointer; }
.clickrow:hover td { background: #f6faef; }
.arow { display: flex; gap: 10px; align-items: flex-start; }
.arow .grow { flex: 1; min-width: 0; display: block; }
.arow .t, .arow .meta { display: block; }
body.admin .top .btn { color: #fff; border-color: rgba(255,255,255,.35); background: transparent; }
.tempb { font-size: 12px; background: #fbf0d6; color: #6d4700; border-radius: 99px; padding: 4px 10px; white-space: nowrap; }
.signout-top { color: #fff !important; border-color: rgba(255,255,255,.35) !important; background: transparent !important; white-space: nowrap; }
@media (max-width: 560px) { .tempb { display: none; } .signout-top { padding: 4px 8px; } }

/* бібліотека: довідник хвороб і шкідників */
.libtabs { margin-bottom: 14px; }
.libh { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--pine); margin: 18px 0 8px; }
.pestgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; }
.pestcard { display: flex; gap: 12px; align-items: flex-start; text-align: left; padding: 14px; cursor: pointer; font: inherit; color: inherit; width: 100%; }
.pestcard:hover { border-color: var(--leaf); }
.pestcard .pk { font-size: 26px; line-height: 1; flex: none; }
.pestcard .pb { display: grid; gap: 4px; min-width: 0; }
.pestcard b { font-size: 15px; line-height: 1.3; }
.pestread h3 { font: 700 13px var(--sans); text-transform: uppercase; letter-spacing: .06em; color: var(--pine); margin: 18px 0 6px; }
.pestread ul { padding-left: 20px; margin: 0; display: grid; gap: 6px; }
.pestread li, .pestread p { line-height: 1.6; }
.pestread .banner { margin: 14px 0 0; }

/* іконки хвороб і шкідників */
.pk { display: grid; place-items: center; flex: none; width: 48px; height: 48px; border-radius: 12px; }
.pk.disease { background: #f8e1dd; color: #a8382c; }
.pk.pest { background: #f1e7d4; color: #7a4f1e; }
.pk .picon { width: 36px; height: 36px; }
.pk.sm { display: inline-grid; width: 26px; height: 26px; border-radius: 7px; vertical-align: -8px; margin-right: 8px; }
.pk.sm .picon { width: 20px; height: 20px; }
.pk.lg { width: 72px; height: 72px; border-radius: 16px; }
.pk.lg .picon { width: 56px; height: 56px; }
.pesthead { display: flex; gap: 14px; align-items: flex-start; }
.pesthead h2 { margin: 6px 0 4px; }
.pestcard .pk { font-size: 0; }

/* довідник: джерела й фото */
.srcs { padding-left: 20px; margin: 0; display: grid; gap: 4px; font-size: 13px; }
.srcs a { word-break: break-word; }
.pestphotos { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 8px; margin: 14px 0 4px; }
.pestphotos figure { margin: 0; }
.pestphotos img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 10px; cursor: zoom-in; display: block; }
.pestphotos figcaption { font-size: 12px; color: var(--muted); margin-top: 3px; }

/* демо й тур */
.demob { background: #d5e889; color: #204534; font: 800 11px var(--sans); letter-spacing: .1em; border-radius: 99px; padding: 4px 9px; }
body.demo .demo-strip { position: sticky; top: 60px; z-index: 40; }
.tour-root { position: fixed; inset: 0; z-index: 1000; pointer-events: none; }
.tour-root[hidden] { display: none; }
.tour-spot { position: fixed; border-radius: 14px; box-shadow: 0 0 0 9999px rgba(15, 32, 24, .58), 0 0 0 3px #d5e889; transition: all .35s ease; }
.tour-card { position: fixed; pointer-events: auto; width: min(380px, calc(100vw - 16px)); background: #fff; border-radius: 16px; padding: 16px 18px 14px; box-shadow: 0 12px 40px rgba(0,0,0,.3); transition: left .35s ease, top .35s ease; }
.tour-card.center { left: 50% !important; top: 50% !important; transform: translate(-50%, -50%); width: min(460px, calc(100vw - 32px)); }
.tour-card.dock { left: 8px !important; right: 8px; top: auto !important; bottom: calc(8px + env(safe-area-inset-bottom)); width: auto; }
.tour-card h3 { margin: 4px 0 6px; font-size: 19px; }
.tour-card p { font-size: 14px; line-height: 1.5; margin: 0 0 12px; }
.tour-btns { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.tour-btns .tour-x { margin-left: auto; }
.tour-n { font-size: 11.5px; color: var(--muted); font-weight: 700; }
.tour-prog { height: 3px; background: var(--soft); border-radius: 2px; overflow: hidden; margin-bottom: 8px; }
.tour-prog i { display: block; height: 100%; width: 0; background: var(--leaf); }
body.touring #modal-root .overlay { z-index: 900; }
@media (max-width: 720px) { .tour-spot { border-radius: 10px; } }
body.touring #modal-root .overlay { background: transparent; }
.demo-btn { margin-top: 14px; width: 100%; border-style: dashed; }
@media (max-width: 600px) { body.demo .top .signout-top, body.demo .top .demob { display: none; } body.demo .demo-strip { font-size: 12px; } }

/* фенологія */
.phwhy summary { cursor: pointer; }
.phwhy ul { margin: 10px 0 0; padding-left: 20px; display: grid; gap: 6px; font-size: 14px; line-height: 1.5; }
.phwhy { margin-bottom: 16px; }
.phgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.phcard { display: flex; flex-direction: column; gap: 8px; padding: 14px; }
.phcard.has { border-color: #b9cf6a; }
.phcard > .btn { align-self: flex-start; margin-top: auto; }
.phhead { display: flex; gap: 10px; align-items: flex-start; }
.phn { flex: none; width: 26px; height: 26px; border-radius: 50%; background: var(--soft); color: var(--pine); display: grid; place-items: center; font-weight: 800; font-size: 13px; }
.phcard.has .phn { background: var(--lime); }
.phrecs { display: grid; gap: 6px; }
.phrec { display: flex; gap: 10px; align-items: center; text-align: left; background: #fafbf7; border: 1px solid var(--line); border-radius: 10px; padding: 6px; font: inherit; color: inherit; cursor: pointer; }
.phrec:hover { border-color: var(--leaf); }
.phrec img, .phrec .phph { width: 52px; height: 42px; object-fit: cover; border-radius: 7px; flex: none; background: var(--soft); display: grid; place-items: center; font-size: 20px; }
td .early { color: var(--ok); } td .late { color: var(--warn); }

/* налаштування фенофаз */
.phrows { display: grid; gap: 8px; }
.phrow { display: grid; grid-template-columns: 28px 1fr auto; gap: 8px; align-items: center; border: 1px solid var(--line); border-radius: 10px; padding: 8px; background: #fafbf7; }
.phin { display: grid; grid-template-columns: 1.4fr 1fr; gap: 6px; }
.phbtns { display: flex; gap: 2px; }
.phused { grid-column: 2 / 4; }
.phcard.orphan { opacity: .75; border-style: dashed; }
@media (max-width: 560px) { .phin { grid-template-columns: 1fr; } .phrow { grid-template-columns: 24px 1fr; } .phbtns { grid-column: 2; } .phused { grid-column: 2; } }
#phstd[hidden] { display: none; }
