/* Friend Garden: a garden by day, the same garden at dusk. */

:root {
  --maxw: 1200px;
  --sky-h: 300px;
  --sky-1: #b9d7e4;
  --sky-2: #dcebe2;
  --sky-3: #f4eed8;
  --hill-1: #c3d6ad;
  --hill-2: #a9c58f;
  --lawn: #e8ead2;
  --cloud: rgba(255, 255, 255, .88);
  --glow: rgba(255, 238, 186, .55);

  --paper: #fffaf0;
  --paper-2: #f7f0df;
  --field: #fffdf8;
  --glass: rgba(255, 252, 242, .66);
  --ink: #2b3525;
  --ink-2: #545f4a;
  --ink-3: #6b7360;
  --line: #ddd5bf;
  --line-strong: #cbc1a6;
  --link: #2f6a26;
  --focus: #2a67a6;
  --danger: #a23b2a;

  --accent: #4e8a3e;
  --accent-strong: #3f7432;
  --accent-deep: #2c5a22;
  --accent-soft: #e0edd3;
  --leaf-2: #7db35b;
  --water: #5a9cc8;

  --soil: #7b583e;
  --soil-2: #654532;
  --soil-hi: #946d4f;
  --wood: #c29464;
  --wood-2: #9b6d43;
  --wood-ink: #3d2816;
  --tag: #fff8e6;
  --tag-ink: #3a301f;
  --tag-ink-2: #7a6a4c;

  --fresh-bg: #e1eed5;
  --fresh-ink: #2e5c23;
  --thirsty-bg: #f6e8c2;
  --thirsty-ink: #684f10;
  --droopy-bg: #f0dcc4;
  --droopy-ink: #6b4521;

  --shadow: 0 1px 2px rgba(70, 55, 25, .08), 0 8px 24px rgba(70, 55, 25, .09);
  --fall: 96px;
  color-scheme: light;
}

/* Dusk: the same garden, an hour after sunset. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="day"]) {
    --sky-1: #1d214a;
    --sky-2: #46386a;
    --sky-3: #b9725e;
    --hill-1: #3b3a5c;
    --hill-2: #283246;
    --lawn: #19242a;
    --cloud: rgba(160, 140, 200, .26);
    --glow: rgba(255, 222, 160, .09);
    --paper: #222e31;
    --paper-2: #29373a;
    --field: #1b2528;
    --glass: rgba(24, 34, 38, .6);
    --ink: #efe9d8;
    --ink-2: #c4c4b0;
    --ink-3: #a3a692;
    --line: #34454a;
    --line-strong: #4b5d61;
    --link: #a7d98f;
    --focus: #9fd0ff;
    --danger: #ff9f88;
    --accent: #8cc777;
    --accent-strong: #4e8a3e;
    --accent-deep: #2f5a25;
    --accent-soft: #2b4529;
    --leaf-2: #a6d58a;
    --water: #8fc3e8;
    --soil: #4a382b;
    --soil-2: #3a2c22;
    --soil-hi: #5a4535;
    --wood: #7a5d42;
    --wood-2: #5c4430;
    --wood-ink: #f3e3c6;
    --tag: #e8dabd;
    --tag-ink: #2b2416;
    --tag-ink-2: #6f6147;
    --fresh-bg: #2b4628;
    --fresh-ink: #c4e6b3;
    --thirsty-bg: #4b4224;
    --thirsty-ink: #f3e2a8;
    --droopy-bg: #4a3628;
    --droopy-ink: #efcda8;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 28px rgba(0, 0, 0, .28);
    color-scheme: dark;
  }
}
:root[data-theme="dusk"] {
  --sky-1: #1d214a;
  --sky-2: #46386a;
  --sky-3: #b9725e;
  --hill-1: #3b3a5c;
  --hill-2: #283246;
  --lawn: #19242a;
  --cloud: rgba(160, 140, 200, .26);
  --glow: rgba(255, 222, 160, .09);
  --paper: #222e31;
  --paper-2: #29373a;
  --field: #1b2528;
  --glass: rgba(24, 34, 38, .6);
  --ink: #efe9d8;
  --ink-2: #c4c4b0;
  --ink-3: #a3a692;
  --line: #34454a;
  --line-strong: #4b5d61;
  --link: #a7d98f;
  --focus: #9fd0ff;
  --danger: #ff9f88;
  --accent: #8cc777;
  --accent-strong: #4e8a3e;
  --accent-deep: #2f5a25;
  --accent-soft: #2b4529;
  --leaf-2: #a6d58a;
  --water: #8fc3e8;
  --soil: #4a382b;
  --soil-2: #3a2c22;
  --soil-hi: #5a4535;
  --wood: #7a5d42;
  --wood-2: #5c4430;
  --wood-ink: #f3e3c6;
  --tag: #e8dabd;
  --tag-ink: #2b2416;
  --tag-ink-2: #6f6147;
  --fresh-bg: #2b4628;
  --fresh-ink: #c4e6b3;
  --thirsty-bg: #4b4224;
  --thirsty-ink: #f3e2a8;
  --droopy-bg: #4a3628;
  --droopy-ink: #efcda8;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 28px rgba(0, 0, 0, .28);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 20px; }
body {
  margin: 0;
  min-height: 100vh;
  font: 16px/1.5 Nunito, ui-rounded, system-ui, sans-serif;
  color: var(--ink);
  background: var(--lawn);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-family: Fraunces, Georgia, serif; font-weight: 600; letter-spacing: -.01em; }
a { color: var(--link); text-underline-offset: 3px; }
button { font: inherit; color: inherit; }
[tabindex="-1"]:focus { outline: none; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.muted { color: var(--ink-2); }
.small { font-size: 14px; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 30; background: var(--paper); padding: 10px 14px; border-radius: 10px; }
.skip:focus { top: 12px; }
.noscript { position: relative; z-index: 2; text-align: center; padding: 40px 16px; }

.ico { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------------------------------------------------------------- sky */

.sky {
  position: absolute; inset: 0 0 auto 0; height: var(--sky-h); z-index: 0; overflow: hidden;
  background: linear-gradient(180deg, var(--sky-1) 0%, var(--sky-2) 58%, var(--sky-3) 100%);
}
.sun {
  position: absolute; right: 9%; top: 78px; width: 110px; height: 110px; border-radius: 50%;
  background: radial-gradient(circle, #fff4d2 0 26%, #ffe4a2 27% 31%, rgba(255, 220, 150, .42) 32%, rgba(255, 220, 150, 0) 70%);
}
.moon { display: none; position: absolute; right: 10%; top: 86px; width: 52px; fill: #f6ecca; filter: drop-shadow(0 0 16px rgba(255, 238, 190, .55)); }
.stars { display: none; position: absolute; inset: 0 0 35% 0; }
.stars i { position: absolute; border-radius: 50%; background: #fff6da; opacity: .75; animation: twinkle 5s ease-in-out infinite; }
.clouds .cloud { position: absolute; left: 0; fill: var(--cloud); animation: drift linear infinite; }
.cloud.c1 { top: 44px; width: 150px; animation-duration: 160s; animation-delay: -40s; }
.cloud.c2 { top: 100px; width: 104px; animation-duration: 210s; animation-delay: -150s; opacity: .8; }
.cloud.c3 { top: 18px; width: 120px; animation-duration: 190s; animation-delay: -95s; opacity: .7; }
.hills { position: absolute; left: 0; bottom: -1px; width: 100%; height: 132px; }
.hills .h1 { fill: var(--hill-1); }
.hills .h2 { fill: var(--hill-2); }
.hills .h3 { fill: var(--lawn); }
@keyframes drift { from { transform: translateX(-200px); } to { transform: translateX(110vw); } }
@keyframes twinkle { 50% { opacity: .25; } }

:root[data-theme="dusk"] .sun { display: none; }
:root[data-theme="dusk"] .moon, :root[data-theme="dusk"] .stars { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="day"]) .sun { display: none; }
  :root:not([data-theme="day"]) .moon, :root:not([data-theme="day"]) .stars { display: block; }
}

/* Fireflies over the garden at dusk. */
.fireflies { display: none; position: fixed; inset: 0; z-index: 3; pointer-events: none; }
.fireflies i {
  position: absolute; width: 5px; height: 5px; border-radius: 50%; background: #f6f9a8;
  box-shadow: 0 0 6px 2px rgba(236, 244, 130, .8), 0 0 18px 7px rgba(220, 236, 110, .28);
  animation: ff-move var(--fd) ease-in-out infinite alternate, ff-blink var(--fb) ease-in-out infinite;
}
@keyframes ff-move { to { transform: translate(var(--fx), var(--fy)); } }
@keyframes ff-blink { 0%, 100% { opacity: .1; } 45%, 60% { opacity: 1; } }
:root[data-theme="dusk"] #view[data-screen="garden"] ~ .fireflies { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="day"]) #view[data-screen="garden"] ~ .fireflies { display: block; }
}

/* ---------------------------------------------------------------- header and tabs */

.top {
  position: relative; z-index: 2; max-width: var(--maxw); margin: 0 auto; padding: 16px 24px 4px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font: 600 25px/1 Fraunces, Georgia, serif; min-height: 44px; border-radius: 12px; }
.brand .mark { width: 40px; height: 40px; }
.tabs { display: flex; gap: 4px; padding: 5px; border-radius: 999px; background: var(--glass); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .25), var(--shadow); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.tabs a {
  display: flex; align-items: center; gap: 7px; min-height: 42px; padding: 0 16px; border-radius: 999px;
  color: var(--ink); text-decoration: none; font-weight: 700; white-space: nowrap;
}
.tabs a:hover { background: var(--paper-2); }
.tabs a[aria-current="page"] { background: var(--paper); box-shadow: 0 1px 3px rgba(40, 30, 10, .14); }
.tabs a.tab-add { background: var(--accent-strong); color: #fff; }
.tabs a.tab-add:hover { background: var(--accent-deep); }
.tabs a.tab-add[aria-current="page"] { box-shadow: 0 0 0 2px var(--paper), 0 0 0 4px var(--accent-strong); }

/* ---------------------------------------------------------------- page */

#view { position: relative; z-index: 1; max-width: var(--maxw); margin: 0 auto; padding: 4px 24px 80px; }
.page-head h1 { font-size: clamp(36px, 5.2vw, 54px); line-height: 1.04; margin: 22px 0 6px; }
.lede { font-size: 18px; color: var(--ink-2); margin: 0 0 18px; max-width: 46em; }
.back { display: inline-flex; align-items: center; gap: 4px; min-height: 42px; margin-top: 10px; padding-right: 10px; color: var(--ink); font-weight: 700; text-decoration: none; border-radius: 10px; }
.back:hover { text-decoration: underline; }
.card { background: var(--paper); border-radius: 22px; padding: 22px 24px; box-shadow: var(--shadow); }
.card h2 { font-size: 25px; line-height: 1.2; margin: 0 0 12px; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.note-bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin: 0 0 14px; padding: 10px 16px;
  border-radius: 16px; background: var(--paper); box-shadow: var(--shadow); color: var(--ink-2); font-weight: 600;
}
.note-bar p { margin: 0; }
.note-bar .ico { color: var(--water); }

/* ---------------------------------------------------------------- buttons */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px;
  border-radius: 999px; border: 1.5px solid var(--line-strong); background: var(--paper); color: var(--ink);
  font: 700 16px/1.1 Nunito, system-ui, sans-serif; text-decoration: none; cursor: pointer; text-align: center;
  transition: background .15s, transform .15s;
}
.btn:hover { background: var(--paper-2); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--accent-strong); border-color: transparent; color: #fff; box-shadow: 0 2px 0 var(--accent-deep); }
.btn.primary:hover { background: var(--accent-deep); }
.btn.quiet { background: transparent; border-color: transparent; }
.btn.quiet:hover { background: var(--paper-2); }
.btn.small { min-height: 40px; padding: 0 14px; font-size: 15px; }
.btn.big { min-height: 52px; padding: 0 26px; font-size: 18px; }
.btn.danger { color: var(--danger); }
.btn.danger-fill { background: var(--danger); border-color: transparent; color: #fff; }
:root[data-theme="dusk"] .btn.danger-fill { color: #2a1410; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="day"]) .btn.danger-fill { color: #2a1410; } }
.btn:disabled { opacity: .5; cursor: default; }
.btn .ico { width: 19px; height: 19px; }
.link { background: none; border: 0; padding: 0 2px; min-height: 40px; color: var(--link); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.icon-btn { width: 42px; height: 42px; border-radius: 50%; border: 0; background: transparent; color: var(--ink-2); display: grid; place-items: center; cursor: pointer; }
.icon-btn:hover { background: var(--paper-2); color: var(--ink); }
.icon-btn:disabled { opacity: .35; cursor: default; background: transparent; }

.seg { display: inline-flex; gap: 2px; padding: 4px; border-radius: 999px; background: var(--glass); box-shadow: inset 0 0 0 1px var(--line); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.seg button {
  display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px; border: 0; border-radius: 999px;
  background: transparent; color: var(--ink-2); font-weight: 700; font-size: 15px; cursor: pointer; white-space: nowrap;
}
.seg button[aria-pressed="true"] { background: var(--paper); color: var(--ink); box-shadow: 0 1px 3px rgba(40, 30, 10, .16); }
.seg .ico { width: 18px; height: 18px; }

/* ---------------------------------------------------------------- the garden */

.garden-head h1 { margin-top: 26px; }
.garden-head .lede a { font-weight: 700; }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 6px; }
.sample-bar { justify-content: space-between; }

.beds { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 34px 40px; margin: 30px 0 30px; }
.bed { flex: 0 0 auto; width: calc(var(--c) * var(--cell) + 20px); max-width: 100%; }
.bed-sign { position: relative; margin: 0 0 -2px 18px; font: 700 27px/1 Caveat, cursive; color: var(--wood-ink); }
.bed-sign span {
  position: relative; z-index: 1; display: inline-block; padding: 6px 18px 9px; border-radius: 7px; transform: rotate(-2deg);
  background: repeating-linear-gradient(177deg, transparent 0 7px, rgba(70, 40, 15, .08) 7px 9px), var(--wood);
  box-shadow: inset 0 -3px 0 var(--wood-2), 0 4px 10px rgba(40, 25, 10, .25);
}
.bed-rows { display: flex; flex-direction: column; gap: 22px; }
.planter {
  --plank: 42px;
  position: relative; display: grid; grid-template-columns: repeat(var(--c), minmax(0, var(--cell))); padding: 0 10px; isolation: isolate;
}
/* The soil, then the wooden front of the planter. */
.planter::before {
  content: ""; position: absolute; z-index: -1; left: 4px; right: 4px; bottom: calc(var(--plank) - 6px); height: 30px; border-radius: 16px 16px 0 0;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='60'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .14 0 0 0 0 .09 0 0 0 0 .04 0 0 0 -1.6 1.05'/%3E%3C/filter%3E%3Crect width='160' height='60' filter='url(%23n)'/%3E%3C/svg%3E"),
    linear-gradient(180deg, var(--soil-hi), var(--soil) 40%, var(--soil-2));
}
.planter::after {
  content: ""; position: absolute; z-index: -1; left: 0; right: 0; bottom: 0; height: var(--plank); border-radius: 5px 5px 10px 10px;
  background:
    repeating-linear-gradient(179deg, transparent 0 9px, rgba(70, 40, 15, .09) 9px 11px),
    linear-gradient(180deg, rgba(255, 255, 255, .16), transparent 30%),
    var(--wood);
  box-shadow: inset 0 -5px 0 var(--wood-2), 0 12px 18px -8px rgba(40, 25, 10, .4);
}
.cell { display: flex; align-items: flex-end; justify-content: center; min-width: 0; }
.plant {
  position: relative; display: flex; flex-direction: column; align-items: center; width: 100%;
  padding: 0 0 7px; border-radius: 16px; color: var(--tag-ink); text-decoration: none;
}
.plant-art { position: relative; display: block; width: 100%; transition: transform .25s ease; transform-origin: 50% 92%; }
.plant-art svg { display: block; width: 100%; height: auto; overflow: visible; transform-origin: 50% 88%; animation: sway var(--sway, 7s) ease-in-out var(--sway-delay, 0s) infinite alternate; }
@keyframes sway { from { transform: rotate(-1.1deg); } to { transform: rotate(1.1deg); } }
.plant:hover .plant-art, .plant:focus-visible .plant-art { transform: translateY(-4px); }
.plant:focus-visible { outline-offset: -1px; }
.tag {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 3px; max-width: calc(100% - 6px);
  min-height: 29px; margin-top: -4px; padding: 2px 8px 3px;
  border-radius: 4px; background: var(--tag); color: var(--tag-ink); font: 700 20px/1 Caveat, cursive;
  transform: rotate(var(--tilt, 0deg)); box-shadow: 0 1px 0 rgba(0, 0, 0, .18), 0 2px 5px rgba(30, 20, 5, .22);
}
.tag > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding-bottom: 2px; }
.tag .thirst { width: 14px; height: 14px; stroke: #3f7fae; stroke-width: 2.3; }
.plant:hover .tag > span { text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 3px; }

.seed-spot .spot { display: flex; align-items: flex-end; justify-content: center; width: 100%; height: 84px; padding-bottom: 12px; }
.seed-spot .spot .ico { width: 54px; height: 54px; padding: 14px; border-radius: 50%; border: 2px dashed var(--line-strong); color: var(--ink-2); background: var(--glass); stroke-width: 2.4; transition: background .2s; }
.seed-spot:hover .spot .ico { background: var(--paper); color: var(--ink); }
.seed-spot .tag { background: transparent; box-shadow: none; transform: none; color: var(--wood-ink); }

/* The watering list, pinned beside the garden on wide screens. */
.garden-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 30px; align-items: start; }
.notebook {
  position: sticky; top: 18px; margin-top: 44px; padding: 26px 20px 20px 50px; border-radius: 4px 4px 10px 4px;
  color: var(--tag-ink); transform: rotate(1.2deg); box-shadow: 0 2px 0 rgba(0, 0, 0, .06), 0 14px 28px rgba(40, 30, 10, .2);
  background:
    linear-gradient(90deg, transparent 36px, rgba(214, 96, 84, .45) 36px 38px, transparent 38px),
    repeating-linear-gradient(180deg, transparent 0 33px, rgba(90, 140, 190, .28) 33px 34px),
    var(--tag);
  background-position: 0 0, 0 14px, 0 0;
}
.notebook::before { content: ""; position: absolute; top: -12px; left: 50%; width: 92px; height: 26px; margin-left: -46px; background: rgba(150, 190, 120, .55); transform: rotate(-3deg); }
.notebook h2 { margin: 0 0 6px; font: 700 30px/1.1 Caveat, cursive; letter-spacing: 0; }
.notebook h3 { margin: 18px 0 4px; font: 700 24px/1.1 Caveat, cursive; letter-spacing: 0; }
.notebook ul { list-style: none; margin: 0; padding: 0; }
.notebook li { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 34px; }
.notebook li a { display: inline-flex; align-items: center; gap: 6px; min-width: 0; min-height: 34px; color: var(--tag-ink); font: 700 22px/1 Caveat, cursive; text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.notebook li a .ico { flex: none; }
.notebook li a:hover { text-decoration: underline; }
.notebook li a .ico { width: 15px; height: 15px; stroke: #3f7fae; stroke-width: 2.2; }
.notebook small { color: var(--tag-ink-2); font-size: 13px; white-space: nowrap; }
.notebook p { margin: 4px 0 0; font: 700 22px/1.4 Caveat, cursive; }
.notebook .link { min-height: 34px; color: var(--tag-ink); font: 700 21px/1 Caveat, cursive; }
@media (max-width: 1199px) {
  .garden-wrap { display: block; }
  .notebook { display: none; }
}

/* The list view, for screen readers and quick scanning. */
.friend-list { list-style: none; margin: 20px 0 0; padding: 8px; }
.friend-list li + li { border-top: 1px solid var(--line); }
.friend-list .row {
  display: grid; grid-template-columns: 60px minmax(0, 320px) minmax(0, 1fr) 150px; gap: 16px; align-items: center;
  min-height: 76px; padding: 4px 12px; border-radius: 14px; color: inherit; text-decoration: none;
}
.friend-list .row:hover { background: var(--paper-2); }
.thumb svg { display: block; width: 60px; height: 75px; }
.who strong { display: block; font-size: 17px; }
.who small, .when { color: var(--ink-2); font-size: 15px; }

.friend-list .mood-chip { justify-self: end; }
.mood-chip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 11px 3px 8px; border-radius: 999px; font-weight: 800; font-size: 14px; white-space: nowrap; }
.mood-chip .ico { width: 15px; height: 15px; stroke-width: 2.2; }
.mood-chip.mood-fresh { background: var(--fresh-bg); color: var(--fresh-ink); }
.mood-chip.mood-thirsty { background: var(--thirsty-bg); color: var(--thirsty-ink); }
.mood-chip.mood-droopy { background: var(--droopy-bg); color: var(--droopy-ink); }

/* The empty garden. */
.empty { text-align: center; max-width: 620px; margin: 0 auto; padding-top: 34px; }
.empty .note-bar { text-align: left; }
.empty-art .packet { width: 128px; height: 156px; filter: drop-shadow(0 8px 14px rgba(40, 30, 10, .18)); transform: rotate(-4deg); }
.empty h1 { font-size: clamp(34px, 5vw, 48px); margin: 18px 0 10px; }
.empty .lede { margin: 0 auto 22px; }
.empty .actions { justify-content: center; }
.empty .small { margin-top: 18px; }
.empty-planter { display: flex; justify-content: center; margin-top: 34px; }
.empty-planter .planter { --c: 3; --cell: 132px; --plank: 34px; padding-bottom: 40px; }
.empty-planter .cell { height: 92px; }
.empty-planter svg { width: 100%; height: auto; overflow: visible; }

/* ---------------------------------------------------------------- today */

.today-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); grid-template-areas: "hello bdays" "hello week"; gap: 20px; align-items: start; margin-top: 30px; }
.today-grid .hello { grid-area: hello; }
.today-grid .bdays { grid-area: bdays; }
.today-grid .week { grid-area: week; }
.today-empty { margin-top: 30px; max-width: 640px; }
.calm { color: var(--ink-2); margin: 0 0 10px; font-size: 17px; }
.suggest-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.suggest { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 18px; align-items: center; padding: 14px 18px 16px 10px; border-radius: 18px; background: var(--paper-2); }
.s-plant { display: flex; align-items: flex-end; position: relative; min-height: 150px; --fall: 90px; }
.s-plant .plant-art svg { overflow: visible; }
.s-body h3 { margin: 4px 0 2px; font-size: 24px; line-height: 1.15; }
.s-body h3 a { color: var(--ink); text-decoration: none; }
.s-body h3 a:hover { text-decoration: underline; }
.s-meta { margin: 0 0 8px; color: var(--ink-2); font-size: 15px; }
.ask-note {
  display: inline-block; max-width: 100%; margin: 4px 0 14px; padding: 7px 13px 9px; border-radius: 6px;
  background: var(--tag); color: var(--tag-ink); font: 700 23px/1.15 Caveat, cursive; overflow-wrap: anywhere;
  transform: rotate(-.6deg); box-shadow: 0 1px 0 rgba(0, 0, 0, .12), 0 4px 10px rgba(40, 30, 10, .12);
}
.ask-label { display: block; font: 800 11px/1.4 Nunito, sans-serif; letter-spacing: .09em; text-transform: uppercase; color: var(--tag-ink-2); }
.more { margin: 16px 0 0; color: var(--ink-2); }
.bday-list { list-style: none; margin: 0 0 8px; padding: 0; }
.bday-list li { display: grid; grid-template-columns: 96px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.bday-when strong { display: block; }
.bday-when small, .bday-who small { display: block; color: var(--ink-2); font-size: 14px; }
.bday-who a { font-weight: 800; }
.bday-ico { width: 26px; height: 26px; color: var(--accent); }
.mini-garden { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.mini-garden a { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; width: 118px; height: 100%; text-decoration: none; }
.mini-garden .plant-art svg { overflow: visible; }
.mini-garden .tag { font-size: 18px; margin-top: -6px; }
.mini-garden li { display: flex; }

/* ---------------------------------------------------------------- one friend */

.friend { display: grid; grid-template-columns: minmax(260px, 400px) minmax(0, 1fr); gap: 40px; align-items: start; margin-top: 6px; }
.friend-stage { position: relative; border-radius: 50% 50% 24px 24px / 38% 38% 24px 24px; background: radial-gradient(60% 55% at 50% 45%, var(--glow), transparent 70%); }
.friend-plant { position: relative; --fall: 200px; }
.friend-info .kicker { margin: 18px 0 0; text-transform: uppercase; letter-spacing: .09em; font-size: 13px; font-weight: 800; color: var(--ink-2); }
.friend-info h1 { font-size: clamp(36px, 5vw, 54px); line-height: 1.05; margin: 4px 0 12px; overflow-wrap: anywhere; }
.sample-chip { background: var(--paper-2); padding: 1px 8px; border-radius: 999px; letter-spacing: .04em; }
.mood-line { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 0; font-size: 17px; color: var(--ink-2); }
.ask-box { margin: 20px 0; padding: 16px 18px 12px; border-radius: 18px; background: var(--paper); box-shadow: var(--shadow); }
.ask-box h2 { margin: 0 0 4px; font: 800 12px/1.4 Nunito, sans-serif; letter-spacing: .09em; text-transform: uppercase; color: var(--ink-2); }
.ask-box .ask-note { margin: 6px 0 8px; font-size: 26px; }
.ask-box .muted { margin: 4px 0 6px; }
.ask-box .btn { margin-left: -10px; }
.facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 22px 0 0; }
.facts div { padding: 10px 14px; border-radius: 14px; background: var(--glass); box-shadow: inset 0 0 0 1px var(--line); }
.facts dt { font-size: 12px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; color: var(--ink-2); }
.facts dd { margin: 2px 0 0; font-weight: 700; }
.history { margin-top: 34px; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: grid; grid-template-columns: 42px minmax(0, 1fr) 42px; gap: 14px; align-items: start; padding: 12px 0; border-top: 1px dashed var(--line); }
.t-icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; background: var(--fresh-bg); color: var(--fresh-ink); }
.t-head { margin: 8px 0 0; }
.t-head time { margin-left: 4px; }
.t-head .muted { margin-left: 4px; font-size: 15px; }
.t-note { margin: 2px 0 0; color: var(--ink-2); overflow-wrap: anywhere; }

/* ---------------------------------------------------------------- forms */

.form { display: grid; gap: 24px; max-width: 900px; margin-top: 20px; padding: 26px 28px; }
.field { border: 0; margin: 0; padding: 0; min-width: 0; }
.field > label, .field > legend, .sheet-form legend, .sheet-form > label { display: block; padding: 0; margin: 0 0 8px; font-weight: 800; font-size: 16px; }
.opt { font-weight: 600; color: var(--ink-2); }
input:not([type="radio"]):not([type="file"]), select, textarea {
  width: 100%; min-height: 46px; padding: 10px 14px; border-radius: 12px; border: 1.5px solid var(--line-strong);
  background: var(--field); color: var(--ink); font: inherit;
}
textarea { resize: vertical; line-height: 1.4; }
input[aria-invalid="true"] { border-color: var(--danger); }
.err { margin: 6px 0 0; color: var(--danger); font-weight: 700; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip input, .pp input, .how input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
.chip span {
  display: inline-flex; align-items: center; min-height: 42px; padding: 0 16px; border-radius: 999px; cursor: pointer;
  border: 1.5px solid var(--line-strong); background: var(--field); font-weight: 700;
}
.chip input:checked + span, .how input:checked + span { background: var(--accent-strong); border-color: transparent; color: #fff; }
.chip input:focus-visible + span, .pp input:focus-visible + .pp-card, .how input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }
.plant-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; }
.pp-card {
  display: flex; flex-direction: column; align-items: center; height: 100%; padding: 4px 4px 10px; border-radius: 16px; cursor: pointer;
  border: 2px solid var(--line); background: var(--field); font-weight: 700; font-size: 15px; text-align: center;
}
.pp-card:hover { border-color: var(--line-strong); }
.pp-art { display: flex; align-items: flex-end; justify-content: center; width: 84px; height: 108px; }
.pp-art svg { width: 84px; height: auto; display: block; }
.pick-for-me svg { width: 66px; height: 86px; margin-bottom: 10px; transform: rotate(-4deg); }
.pp input:checked + .pp-card { border-color: var(--accent); background: var(--accent-soft); }
.bday { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) minmax(0, 1fr); gap: 8px; max-width: 480px; }
.form-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.form-actions .danger { margin-left: auto; }
#f-newgroup { margin-top: 8px; }
#f-group { max-width: 480px; }

/* ---------------------------------------------------------------- settings */

.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: start; margin-top: 26px; }
.settings-grid .card p { margin: 0 0 14px; }
.settings-grid .card .actions + p { margin: 12px 0 0; }
.group-list { list-style: none; margin: 0 0 10px; padding: 0; }
.group-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto 42px 42px 42px; gap: 4px; align-items: center; padding: 4px 0; }
.g-count { width: 76px; color: var(--ink-2); font-size: 14px; padding: 0 4px; text-align: right; white-space: nowrap; }
.group-add { display: flex; gap: 8px; }
.group-add input { flex: 1; }
.links a { font-weight: 700; }
.danger-zone h2 { color: var(--danger); }

/* ---------------------------------------------------------------- dialogs */

dialog.sheet {
  width: min(540px, calc(100vw - 32px)); max-height: calc(100vh - 40px); padding: 0; border: 0; border-radius: 24px;
  background: var(--paper); color: var(--ink); box-shadow: 0 24px 70px rgba(0, 0, 0, .38); overflow: auto;
}
dialog.small-sheet { width: min(440px, calc(100vw - 32px)); }
dialog::backdrop { background: rgba(28, 33, 22, .5); }
.sheet-form { display: grid; gap: 16px; padding: 22px 24px 22px; }
.sheet-form fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.sheet-form h2 { margin: 0; font-size: 27px; line-height: 1.15; }
.sheet-form p { margin: 0; color: var(--ink-2); }
.sheet-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.sheet-head .icon-btn { flex: none; margin: -6px -10px 0 0; }
.how-pick { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.how span {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 68px; padding: 8px 2px;
  border-radius: 14px; border: 1.5px solid var(--line-strong); background: var(--field); font-size: 13px; font-weight: 800;
  text-align: center; line-height: 1.1; cursor: pointer;
}
.how .ico { width: 24px; height: 24px; }
.sheet-form input[type="date"] { margin-top: 10px; max-width: 240px; }
.sheet-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 2px; }

/* ---------------------------------------------------------------- toast */

.toast {
  position: fixed; left: 50%; bottom: 28px; z-index: 60; width: max-content; max-width: min(560px, calc(100vw - 32px)); padding: 12px 18px;
  border-radius: 14px; background: var(--ink); color: var(--paper); font-weight: 700; box-shadow: 0 10px 30px rgba(0, 0, 0, .25);
  opacity: 0; transform: translate(-50%, 16px); transition: opacity .25s, transform .25s; pointer-events: none;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------------------------------------------------------------- watering and growing */

.watering { position: absolute; left: 0; right: 0; bottom: 0; aspect-ratio: 1; z-index: 5; pointer-events: none; }
.watering .can { position: absolute; right: -6%; top: -4%; width: 62%; transform-origin: 58% 68%; animation: can 2s ease-in-out both; filter: drop-shadow(0 4px 6px rgba(20, 30, 40, .25)); }
.watering .drops { position: absolute; left: 40%; top: 29%; width: 24px; height: 10px; }
.watering .drops i {
  position: absolute; top: 0; left: calc(50% + var(--dx)); width: 5px; height: 8px; border-radius: 50% 50% 50% 50% / 62% 62% 38% 38%;
  background: var(--water); opacity: 0; animation: drop .62s ease-in calc(.62s + var(--dd)) 2;
}
@keyframes can {
  0% { opacity: 0; transform: translate(26%, -26%) rotate(8deg); }
  18% { opacity: 1; transform: none; }
  32%, 74% { opacity: 1; transform: rotate(-40deg); }
  90% { opacity: 1; transform: none; }
  100% { opacity: 0; transform: translate(18%, -18%); }
}
@keyframes drop { 0% { opacity: 0; transform: translateY(0); } 15% { opacity: .95; } 100% { opacity: 0; transform: translateY(var(--fall)); } }
.perk .plant-art { animation: perk .9s cubic-bezier(.3, 1.5, .5, 1); }
@keyframes perk { 0% { transform: scale(.95, .9); } 55% { transform: scale(1.03, 1.06); } 100% { transform: none; } }
.grew .plant-art::after, .planted .plant-art::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(circle at 28% 30%, #fff6c4 0 2.5px, transparent 3.5px),
    radial-gradient(circle at 72% 22%, #fff6c4 0 3px, transparent 4px),
    radial-gradient(circle at 60% 48%, #fff6c4 0 2px, transparent 3px),
    radial-gradient(circle at 38% 56%, #fff6c4 0 2.5px, transparent 3.5px);
  animation: sparkle 1.6s ease-out forwards;
}
@keyframes sparkle { 0% { opacity: 0; transform: scale(.7); } 30% { opacity: 1; } 100% { opacity: 0; transform: scale(1.15) translateY(-10px); } }
.planted .plant-art { animation: sprout 1.1s cubic-bezier(.3, 1.4, .5, 1); }
@keyframes sprout { 0% { opacity: 0; transform: scale(.3) translateY(18%); } 100% { opacity: 1; transform: none; } }

/* ---------------------------------------------------------------- phones */

@media (max-width: 760px) {
  :root { --sky-h: 240px; }
  .sun { top: 50px; right: 3%; width: 84px; height: 84px; }
  .moon { top: 58px; right: 6%; width: 38px; }
  .top { padding: 12px 16px 0; }
  .brand { font-size: 22px; }
  .brand .mark { width: 36px; height: 36px; }
  .tabs {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; justify-content: space-around; gap: 2px;
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); border-radius: 0; background: var(--paper);
    box-shadow: 0 -1px 0 var(--line), 0 -8px 24px rgba(0, 0, 0, .07); -webkit-backdrop-filter: none; backdrop-filter: none;
  }
  .tabs a { flex: 1; flex-direction: column; justify-content: center; gap: 2px; min-height: 54px; padding: 4px 2px; border-radius: 14px; font-size: 12px; }
  .tabs a .ico { width: 22px; height: 22px; }
  .tabs a[aria-current="page"] { background: var(--paper-2); box-shadow: none; color: var(--ink); }
  .tabs a.tab-add { background: transparent; color: var(--ink); }
  .tabs a.tab-add .ico { width: 30px; height: 30px; padding: 5px; margin-top: -3px; border-radius: 50%; background: var(--accent-strong); color: #fff; stroke-width: 2.4; }
  .tabs a.tab-add[aria-current="page"] { box-shadow: none; background: var(--paper-2); }
  #view { padding: 0 16px 120px; }
  .toast { bottom: calc(86px + env(safe-area-inset-bottom)); }
  .page-head h1 { margin-top: 18px; }
  .lede { font-size: 17px; }
  .card { padding: 18px 18px; border-radius: 20px; }
  .seg button { padding: 0 12px; font-size: 14px; }
  .beds { gap: 28px; margin: 24px 0 20px; }
  .bed-sign { margin-left: 10px; font-size: 24px; }
  .planter { --plank: 36px; padding: 0 4px; }
  .planter::before { height: 24px; }
  .tag { font-size: 17px; min-height: 25px; padding: 2px 6px 3px; }
  .tag .thirst { display: none; }
  .seed-spot .spot .ico { width: 46px; height: 46px; padding: 11px; }
  .friend-list { padding: 4px; }
  .friend-list .row { grid-template-columns: 52px minmax(0, 1fr); gap: 2px 12px; padding: 8px 6px; }
  .friend-list .thumb { grid-row: span 3; }
  .thumb svg { width: 52px; height: 65px; }
  .friend-list .when { font-size: 14px; }
  .t-head .muted { display: block; margin-left: 0; }
  .t-head time { margin-left: 2px; }
  .friend-list .mood-chip { justify-self: start; }
  .empty-planter .planter { --cell: 100px; }
  .today-grid { grid-template-columns: minmax(0, 1fr); grid-template-areas: "hello" "bdays" "week"; margin-top: 20px; gap: 16px; }
  .suggest-grid { grid-template-columns: minmax(0, 1fr); }
  .suggest { grid-template-columns: 104px minmax(0, 1fr); gap: 8px; padding: 12px 12px 14px 4px; }
  .s-plant { min-height: 120px; }
  .s-body h3 { font-size: 22px; }
  .ask-note { font-size: 21px; }
  .friend { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .friend-stage { max-width: 270px; width: 78%; margin: 0 auto; }
  .friend-plant { --fall: 150px; }
  .friend-info .kicker { margin-top: 4px; text-align: center; }
  .friend-info h1 { text-align: center; }
  .mood-line { justify-content: center; text-align: center; }
  .friend-info .actions { justify-content: center; }
  .facts { grid-template-columns: minmax(0, 1fr); }
  .form { padding: 20px 16px; gap: 22px; }
  .plant-pick { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .pp-art { width: 76px; height: 98px; }
  .pp-art svg { width: 76px; }
  .pick-for-me svg { width: 58px; height: 76px; }
  .form-actions .danger { margin-left: 0; }
  .settings-grid { grid-template-columns: minmax(0, 1fr); gap: 16px; margin-top: 18px; }
  .group-list li { grid-template-columns: minmax(0, 1fr) 42px 42px 42px; }
  .g-count { display: none; }
  dialog.sheet { width: 100vw; max-width: 100vw; margin: auto 0 0; border-radius: 24px 24px 0 0; max-height: 92vh; }
  .sheet-form { padding: 20px 18px calc(22px + env(safe-area-inset-bottom)); }
  .how-pick { gap: 6px; }
  .how span { font-size: 12px; min-height: 64px; }
}

@media (max-width: 380px) {
  .seg button span { display: none; }
  .seg button { padding: 0 12px; }
}

@media (min-width: 761px) and (max-width: 1000px) {
  .tabs a { padding: 0 12px; }
  .today-grid { grid-template-columns: minmax(0, 1fr); grid-template-areas: "hello" "bdays" "week"; }
  .friend { grid-template-columns: minmax(220px, 320px) minmax(0, 1fr); gap: 28px; }
  .facts { grid-template-columns: minmax(0, 1fr); }
}

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