/* ========================================================================
   Lawn Buddy — Editorial field-almanac styling.
   Type: Fraunces (display) + Bricolage Grotesque (body) + JetBrains Mono.
   ======================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght,SOFT@0,9..144,300..900,0..100;1,9..144,300..900,0..100&family=Bricolage+Grotesque:opsz,wdth,wght@12..96,75..125,300..700&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  /* parchment + moss + clay */
  --paper:        #ece4cf;
  --paper-soft:   #f1ead7;
  --surface:      #faf3df;
  --surface-warm: #f6efd9;
  --ink:          #1a2310;
  --ink-soft:     #3a4530;
  --faded:        #807558;
  --rule:         #cdc1a3;
  --rule-soft:    #ddd3b6;
  --moss:         #3a4f2a;
  --moss-deep:    #2a3a1c;
  --sage:         #7d8a6e;
  --clay:         #b35a26;
  --clay-deep:    #8e4318;
  --ember:        #a93612;

  --display: 'Fraunces', 'Times New Roman', serif;
  --sans:    'Bricolage Grotesque', system-ui, sans-serif;
  --mono:    'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
}

/* -------------------------------- reset --------------------------------- */

*, *::before, *::after { box-sizing: border-box; }

[hidden] { display: none !important; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--sans);
  font-variation-settings: 'wdth' 100, 'opsz' 14, 'wght' 400;
  font-size: 16px;
  color: var(--ink);
  background: var(--paper);
  background-image:
    radial-gradient(ellipse 80% 60% at 18% 8%, rgba(255, 240, 200, 0.55), transparent 65%),
    radial-gradient(ellipse 60% 50% at 88% 92%, rgba(180, 90, 38, 0.06), transparent 70%);
  line-height: 1.55;
  letter-spacing: 0.005em;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  min-height: 100%;
}

/* paper grain — fixed overlay, multiplied for warmth */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0.55;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.1  0 0 0 0 0.09  0 0 0 0 0.06  0 0 0 0.06 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

main, .app-header, .app-footer { position: relative; z-index: 2; }

/* ------------------------------- header --------------------------------- */

.app-header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  padding: 22px 36px 20px;
  gap: 28px;
  border-bottom: 1px solid var(--rule);
  position: relative;
}
.app-header::after {
  content: '';
  position: absolute;
  left: 36px; right: 36px; bottom: -3px;
  height: 1px;
  background: var(--rule-soft);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  font-family: var(--display);
  font-variation-settings: 'opsz' 144, 'wght' 500, 'SOFT' 30;
  font-size: 22px;
  letter-spacing: -0.012em;
  line-height: 1;
  color: var(--ink);
}

.brand-mark {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--ink);
  border-radius: 50%;
  color: var(--clay);
  background: var(--surface);
  flex-shrink: 0;
}
.brand-mark svg { display: block; }

.brand-name { font-family: var(--display); }
.brand-name em {
  font-style: italic;
  color: var(--clay);
  font-variation-settings: 'opsz' 144, 'wght' 400, 'SOFT' 100;
}

.brand-tag {
  margin-left: 4px;
  padding-left: 14px;
  border-left: 1px solid var(--rule);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--faded);
  align-self: stretch;
  display: flex;
  align-items: center;
}

.user-info {
  display: flex;
  gap: 18px;
  align-items: baseline;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--faded);
}
#user-email {
  color: var(--ink-soft);
}
#user-email::before { content: '['; opacity: 0.45; margin-right: 3px; }
#user-email::after  { content: ']'; opacity: 0.45; margin-left: 3px; }

/* -------------------------------- main ---------------------------------- */

main {
  max-width: 980px;
  margin: 0 auto;
  padding: 56px 36px 32px;
}

.app-footer {
  max-width: 980px;
  margin: 56px auto 32px;
  padding: 24px 36px 0;
  border-top: 1px solid var(--rule-soft);
  font-family: var(--mono);
  font-size: 10.5px;
  line-height: 1.65;
  color: var(--faded);
  letter-spacing: 0.05em;
}
.app-footer small { font-size: inherit; }

/* ------------------------------ headings -------------------------------- */

h1, h2, h3 {
  font-family: var(--display);
  font-weight: 500;
  letter-spacing: -0.012em;
  color: var(--ink);
  font-variation-settings: 'opsz' 144, 'wght' 500;
}

h1 {
  font-size: clamp(36px, 5.4vw, 60px);
  margin: 0 0 18px;
  line-height: 1.02;
  font-variation-settings: 'opsz' 144, 'wght' 420, 'SOFT' 50;
}
h1 em {
  font-style: italic;
  color: var(--clay);
  font-variation-settings: 'opsz' 144, 'wght' 380, 'SOFT' 100;
}

h2 { font-size: 26px; margin: 28px 0 12px; line-height: 1.2; }
h3 { font-size: 18px; margin: 0 0 6px; }

/* ------------------------------ utilities ------------------------------- */

.kicker {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--clay);
  margin: 0 0 18px;
  font-weight: 500;
}
.kicker::before {
  content: '◇';
  display: inline-block;
  margin-right: 8px;
  font-size: 9px;
  vertical-align: 1.5px;
  color: var(--clay);
}

.lede {
  font-family: var(--display);
  font-variation-settings: 'opsz' 144, 'wght' 380;
  font-size: 18px;
  line-height: 1.5;
  color: var(--ink-soft);
  margin: 0 0 32px;
  max-width: 50ch;
}

.muted {
  color: var(--faded);
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.06em;
}

/* ----------------------------- screen layout ---------------------------- */

.screen { position: relative; }
.screen:not([hidden]) {
  animation: enter 0.55s cubic-bezier(0.2, 0.8, 0.2, 1);
}
@keyframes enter {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.screen-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: end;
  margin-bottom: 32px;
  gap: 20px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--rule);
}
.screen-header h1 { margin: 0; flex: 1; min-width: 0; }

/* ------------------------------- card ---------------------------------- */

.card {
  background: var(--surface);
  border: 1px solid var(--rule);
  padding: 56px 52px 48px;
  max-width: 620px;
  position: relative;
  box-shadow:
    0 1px 0 rgba(28, 36, 21, 0.04),
    14px 16px 0 -4px var(--rule-soft);
}

#screen-signin .card,
#screen-onboarding .card {
  margin: 24px auto 0;
}

#screen-signin .card { max-width: 540px; }
#screen-onboarding .card { max-width: 720px; }

/* roman-numeral folio mark in upper-left corner */
.card::before {
  content: 'I';
  position: absolute;
  top: 18px;
  left: 22px;
  font-family: var(--display);
  font-style: italic;
  font-size: 16px;
  color: var(--clay);
  font-variation-settings: 'opsz' 144, 'wght' 400;
  letter-spacing: 0;
}
#screen-onboarding .card::before { content: 'II'; }

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

label {
  display: block;
  margin: 18px 0 6px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-soft);
  font-weight: 500;
}

input[type=text],
input[type=email],
input[type=number],
select,
textarea {
  width: 100%;
  padding: 13px 14px;
  font-family: var(--sans);
  font-size: 15.5px;
  color: var(--ink);
  border: 1px solid var(--rule);
  border-radius: 0;
  background: rgba(255, 252, 240, 0.55);
  transition: border-color 0.18s ease, background-color 0.18s ease, box-shadow 0.18s ease;
  font-variation-settings: 'wdth' 100, 'wght' 400;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--ink);
  background: rgba(255, 252, 240, 1);
  box-shadow: 0 0 0 3px var(--rule-soft);
}

textarea { resize: vertical; min-height: 72px; line-height: 1.5; }

select {
  appearance: none;
  background-image:
    linear-gradient(45deg,  transparent 50%, var(--ink) 50%),
    linear-gradient(135deg, var(--ink) 50%, transparent 50%);
  background-position: calc(100% - 18px) calc(50% - 1px),
                       calc(100% - 13px) calc(50% - 1px);
  background-size: 5px 5px;
  background-repeat: no-repeat;
  padding-right: 36px;
  background-color: rgba(255, 252, 240, 0.55);
}

/* hand-drawn checkbox */
input[type=checkbox] {
  appearance: none;
  -webkit-appearance: none;
  width: 17px; height: 17px;
  border: 1px solid var(--ink-soft);
  background: var(--surface);
  position: relative;
  cursor: pointer;
  flex-shrink: 0;
  vertical-align: -3px;
  transition: background 0.15s ease, border-color 0.15s ease;
}
input[type=checkbox]:hover { border-color: var(--ink); }
input[type=checkbox]:checked {
  background: var(--moss);
  border-color: var(--moss-deep);
}
input[type=checkbox]:checked::after {
  content: '';
  position: absolute;
  left: 4px; top: 1px;
  width: 5px; height: 9px;
  border-right: 1.6px solid var(--surface);
  border-bottom: 1.6px solid var(--surface);
  transform: rotate(40deg);
}

/* fieldset → numbered editorial section */
form { counter-reset: section; }

fieldset {
  border: none;
  border-top: 1px solid var(--rule);
  padding: 28px 0 4px;
  margin: 36px 0 0;
}

fieldset legend {
  padding: 0 16px 0 0;
  display: inline-flex;
  align-items: baseline;
  gap: 14px;
  font-family: var(--display);
  font-variation-settings: 'opsz' 144, 'wght' 480;
  font-size: 22px;
  letter-spacing: -0.005em;
  text-transform: none;
  color: var(--ink);
  font-weight: 500;
  background: var(--surface);
  margin-left: -2px;
}
fieldset legend::before {
  counter-increment: section;
  content: counter(section, upper-roman);
  font-family: var(--mono);
  font-size: 10px;
  font-style: normal;
  font-weight: 600;
  letter-spacing: 0.18em;
  color: var(--clay);
  text-transform: uppercase;
  padding: 3px 8px;
  border: 1px solid var(--clay);
  background: var(--surface);
  align-self: center;
}

.checkbox-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 28px;
  margin: 10px 0 18px;
}
.checkbox-group label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--sans);
  font-size: 14.5px;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
  color: var(--ink);
  margin: 0;
  cursor: pointer;
}

.size-row {
  display: flex;
  gap: 14px;
  align-items: center;
}
.size-row input { flex: 1; }

#size-hint {
  font-family: var(--display);
  font-style: italic;
  font-size: 14.5px;
  color: var(--ink-soft);
  margin-top: 8px;
  padding-left: 14px;
  border-left: 2px solid var(--clay);
}

.soil-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 14px;
  margin-top: 14px;
}
.soil-grid label {
  font-size: 9.5px;
  letter-spacing: 0.22em;
  margin: 0 0 4px;
}

details {
  margin-top: 24px;
  border-top: 1px dashed var(--rule);
  padding-top: 16px;
}
details > summary {
  cursor: pointer;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-soft);
  list-style: none;
  padding: 4px 0;
  user-select: none;
}
details > summary::-webkit-details-marker { display: none; }
details > summary::before {
  content: '+';
  display: inline-block;
  width: 22px;
  font-family: var(--display);
  font-style: italic;
  color: var(--clay);
  font-size: 17px;
  margin-right: 2px;
  vertical-align: -1px;
}
details[open] > summary::before { content: '−'; }

/* file input — restyle the native button */
input[type=file] {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
  padding: 6px 0;
  border: none;
  background: transparent;
  width: auto;
}
input[type=file]::file-selector-button {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-weight: 500;
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--ink);
  padding: 7px 14px;
  margin-right: 14px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
input[type=file]::file-selector-button:hover {
  background: var(--ink);
  color: var(--surface);
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 18px;
  margin-top: 40px;
  padding-top: 28px;
  border-top: 1px solid var(--rule);
  align-items: center;
}

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

button {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-weight: 500;
  background: var(--moss);
  color: var(--surface);
  border: 1px solid var(--moss-deep);
  border-radius: 0;
  padding: 13px 26px;
  cursor: pointer;
  transition: background 0.16s ease, color 0.16s ease, transform 0.12s ease, border-color 0.16s ease;
  position: relative;
}
button:hover { background: var(--moss-deep); }
button:active { transform: translateY(1px); }
button:disabled { opacity: 0.45; cursor: not-allowed; }
button:focus-visible {
  outline: 2px solid var(--clay);
  outline-offset: 3px;
}

button.link {
  background: transparent;
  color: var(--ink);
  border: none;
  border-bottom: 1px solid var(--ink);
  padding: 0 1px 3px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-weight: 500;
}
button.link:hover {
  color: var(--clay);
  border-bottom-color: var(--clay);
  background: transparent;
  transform: none;
}

button.danger {
  color: var(--ember);
  border-color: var(--ember);
  border-bottom-color: var(--ember);
}
button.danger:hover {
  color: var(--surface);
  background: var(--ember);
  border-color: var(--ember);
}
button.danger.link { background: transparent; }
button.danger.link:hover { background: transparent; color: var(--ember); border-bottom-color: var(--ember); }

/* primary CTA in sign-in form gets centered emphasis */
#signin-form button[type=submit],
#onboarding-submit,
#chat-send {
  background: var(--moss);
  color: var(--paper-soft);
}

/* ---------------------------- lawn list -------------------------------- */

#screen-lawns h1 {
  font-size: clamp(40px, 5.8vw, 64px);
}
#screen-lawns h1::after {
  content: '⁘';
  display: inline-block;
  margin-left: 14px;
  color: var(--clay);
  font-size: 0.45em;
  vertical-align: 0.4em;
}

.lawn-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 22px;
}

.lawn-card {
  background: var(--surface);
  border: 1px solid var(--rule);
  padding: 28px 26px 32px;
  cursor: pointer;
  position: relative;
  transition: border-color 0.18s ease, transform 0.22s ease, box-shadow 0.22s ease;
  overflow: hidden;
}
.lawn-card::before {
  content: '';
  position: absolute;
  top: 14px; right: 14px;
  width: 7px; height: 7px;
  background: var(--clay);
  border-radius: 50%;
  transition: transform 0.25s ease, background 0.25s ease;
}
.lawn-card::after {
  content: '';
  position: absolute;
  inset: auto 0 0 0;
  height: 3px;
  background: var(--moss);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.lawn-card:hover {
  border-color: var(--ink);
  transform: translateY(-3px);
  box-shadow: 0 1px 0 rgba(28, 36, 21, 0.04), 8px 10px 0 -2px var(--rule-soft);
}
.lawn-card:hover::after { transform: scaleX(1); }
.lawn-card:hover::before { transform: scale(1.4); }

.lawn-card h3 {
  font-family: var(--display);
  font-variation-settings: 'opsz' 144, 'wght' 460, 'SOFT' 30;
  font-size: 24px;
  margin: 0 0 8px;
  letter-spacing: -0.012em;
  line-height: 1.1;
}
.lawn-card p {
  margin: 0;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.18em;
  color: var(--faded);
  text-transform: uppercase;
}

#lawn-empty {
  font-family: var(--display);
  font-style: italic;
  font-size: 19px;
  color: var(--faded);
  font-variation-settings: 'opsz' 144, 'wght' 380, 'SOFT' 100;
  margin-top: 32px;
  padding-left: 18px;
  border-left: 2px solid var(--rule);
}

/* ------------------------------- tabs ----------------------------------- */

.tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--rule);
  margin: 0 0 36px;
  padding: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }

.tab {
  background: transparent;
  color: var(--faded);
  border: none;
  border-radius: 0;
  padding: 14px 24px 18px;
  margin-bottom: -1px;
  font-family: var(--display);
  font-variation-settings: 'opsz' 14, 'wght' 400, 'SOFT' 50;
  font-style: italic;
  font-size: 19px;
  letter-spacing: 0;
  text-transform: none;
  cursor: pointer;
  transition: color 0.18s ease;
  position: relative;
  flex-shrink: 0;
}
.tab:hover { color: var(--ink); background: transparent; transform: none; }
.tab.active { color: var(--ink); background: transparent; }
.tab.active::after {
  content: '◆';
  position: absolute;
  left: 50%;
  bottom: -6px;
  transform: translateX(-50%);
  color: var(--clay);
  font-size: 8px;
  font-style: normal;
}
.tab:focus-visible { outline: none; }
.tab:focus-visible::after {
  content: '◆';
  position: absolute;
  left: 50%;
  bottom: -6px;
  transform: translateX(-50%);
  color: var(--clay);
  font-size: 8px;
  font-style: normal;
}

/* unread badge */
.badge {
  display: inline-block;
  background: var(--ember);
  color: var(--surface);
  border-radius: 0;
  padding: 1px 6px 2px;
  font-family: var(--mono);
  font-size: 9.5px;
  font-style: normal;
  margin-left: 8px;
  vertical-align: 2px;
  letter-spacing: 0.06em;
}

/* lawn dashboard heading */
#screen-lawn .screen-header h1 {
  font-size: clamp(34px, 4.6vw, 50px);
  font-variation-settings: 'opsz' 144, 'wght' 420, 'SOFT' 50;
}

#back-to-lawns {
  margin-bottom: 8px;
  align-self: center;
}

/* ------------------------------ chat ----------------------------------- */

.chat-thread {
  display: flex;
  flex-direction: column;
  gap: 22px;
  min-height: 240px;
  margin: 8px 0 24px;
  padding: 4px 0;
}

.chat-bubble {
  position: relative;
  max-width: 80%;
  padding: 18px 22px 20px;
  white-space: pre-wrap;
  word-wrap: break-word;
  line-height: 1.55;
  animation: arrive 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}
@keyframes arrive {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.chat-bubble .message-body { white-space: normal; }
.chat-bubble .message-body > *:first-child { margin-top: 0; }
.chat-bubble .message-body > *:last-child { margin-bottom: 0; }

.chat-bubble p { margin: 0 0 12px; }
.chat-bubble ul,
.chat-bubble ol {
  margin: 8px 0 12px;
  padding-left: 24px;
}
.chat-bubble li { margin: 4px 0; }
.chat-bubble li::marker {
  color: var(--clay);
  font-family: var(--mono);
  font-size: 0.85em;
}
.chat-bubble strong {
  font-variation-settings: 'opsz' 14, 'wght' 600, 'SOFT' 30;
  color: var(--ink);
}
.chat-bubble em {
  font-style: italic;
  font-variation-settings: 'opsz' 14, 'wght' 380, 'SOFT' 100;
}
.chat-bubble code {
  font-family: var(--mono);
  font-size: 0.88em;
  background: var(--rule-soft);
  color: var(--ink);
  padding: 1px 6px;
  letter-spacing: 0;
}
.chat-bubble h3,
.chat-bubble h4,
.chat-bubble h5,
.chat-bubble h6 {
  font-family: var(--display);
  font-variation-settings: 'opsz' 144, 'wght' 480, 'SOFT' 30;
  font-size: 1.08em;
  margin: 18px 0 6px;
  letter-spacing: -0.005em;
  color: var(--ink);
  line-height: 1.25;
}
.chat-bubble hr {
  border: none;
  border-top: 1px solid var(--rule);
  margin: 16px 0;
}

.chat-bubble.user {
  align-self: flex-end;
  background: var(--moss);
  color: var(--paper-soft);
  border: 1px solid var(--moss-deep);
  font-size: 15px;
  font-family: var(--sans);
  letter-spacing: 0.005em;
}
.chat-bubble.user strong { color: var(--surface); }
.chat-bubble.user em { color: var(--paper-soft); }
.chat-bubble.user code {
  background: rgba(255, 255, 255, 0.16);
  color: var(--surface);
}
.chat-bubble.user h3,
.chat-bubble.user h4 { color: var(--surface); }
.chat-bubble.user hr { border-top-color: rgba(255, 255, 255, 0.22); }
.chat-bubble.user li::marker { color: rgba(255, 255, 255, 0.55); }
.chat-bubble.user::before {
  content: 'You';
  display: block;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: rgba(250, 243, 223, 0.6);
  margin-bottom: 8px;
}

.chat-bubble.assistant {
  align-self: flex-start;
  background: var(--surface);
  border: 1px solid var(--rule);
  font-family: var(--display);
  font-variation-settings: 'opsz' 14, 'wght' 380, 'SOFT' 30;
  font-size: 17px;
  line-height: 1.6;
  max-width: 86%;
  color: var(--ink);
}
.chat-bubble.assistant::before {
  content: '— from the almanac';
  display: block;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--clay);
  margin-bottom: 12px;
  font-style: normal;
  font-variation-settings: normal;
}

.chat-bubble .photos {
  display: flex; gap: 10px; flex-wrap: wrap;
  margin-top: 12px;
}
.chat-bubble img {
  max-width: 160px;
  max-height: 160px;
  border: 1px solid var(--rule);
  filter: contrast(1.02) saturate(0.95);
}

.chat-input {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 14px;
  align-items: end;
  border-top: 1px solid var(--rule);
  padding-top: 22px;
  margin-top: 16px;
}
.chat-input textarea { min-height: 60px; }

#chat-thinking {
  font-family: var(--display);
  font-style: italic;
  font-size: 16px;
  color: var(--faded);
  margin: 14px 0 0;
  font-variation-settings: 'opsz' 144, 'wght' 380, 'SOFT' 100;
}
#chat-thinking::before {
  content: '✻ ';
  color: var(--clay);
  font-style: normal;
  margin-right: 4px;
  display: inline-block;
  animation: spin 3s linear infinite;
}
@keyframes spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* ------------------------------ photos --------------------------------- */

.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 18px;
}
.photo-grid img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border: 1px solid var(--rule);
  filter: contrast(1.02) saturate(0.95);
  transition: filter 0.2s ease, border-color 0.2s ease;
}
.photo-grid img:hover {
  filter: contrast(1.05) saturate(1.05);
  border-color: var(--ink);
}

#photo-empty,
#notification-empty {
  font-family: var(--display);
  font-style: italic;
  color: var(--faded);
  font-size: 18px;
  text-align: center;
  padding: 48px 0;
  font-variation-settings: 'opsz' 144, 'wght' 380, 'SOFT' 100;
}
#photo-empty::before,
#notification-empty::before {
  content: '✻';
  display: block;
  font-style: normal;
  font-size: 14px;
  color: var(--clay);
  margin-bottom: 14px;
}

/* --------------------------- notifications ----------------------------- */

.notif-section { margin-bottom: 36px; }
.notif-section:last-child { margin-bottom: 0; }

.notif-section-title {
  font-family: var(--display);
  font-variation-settings: 'opsz' 144, 'wght' 440, 'SOFT' 30;
  font-size: 26px;
  margin: 0 0 6px;
  letter-spacing: -0.012em;
}
.notif-section-title::before {
  content: '';
  display: inline-block;
  width: 22px;
  height: 1px;
  background: var(--clay);
  vertical-align: middle;
  margin-right: 12px;
}

.notif-section-lede {
  font-family: var(--display);
  font-style: italic;
  font-variation-settings: 'opsz' 144, 'wght' 380, 'SOFT' 100;
  font-size: 16px;
  color: var(--ink-soft);
  margin: 0 0 22px;
  max-width: 60ch;
}

#notif-planning {
  font-family: var(--display);
  font-style: italic;
  color: var(--faded);
  font-size: 17px;
  text-align: center;
  padding: 24px 0;
  font-variation-settings: 'opsz' 144, 'wght' 380, 'SOFT' 100;
}
#notif-planning::before {
  content: '✻ ';
  color: var(--clay);
  font-style: normal;
  display: inline-block;
  animation: spin 3s linear infinite;
}

#notification-list,
#notif-upcoming-list {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

#notification-list .notification {
  background: var(--surface);
  border: 1px solid var(--rule);
  padding: 22px 26px 22px;
  position: relative;
  transition: border-color 0.18s ease, transform 0.18s ease;
}
#notification-list .notification:hover {
  border-color: var(--ink-soft);
}
#notification-list .notification.unread {
  border-left: 3px solid var(--clay);
  padding-left: 30px;
  cursor: pointer;
}
#notification-list .notification.unread::before {
  content: 'New';
  position: absolute;
  top: 18px; right: 22px;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--clay);
  border: 1px solid var(--clay);
  padding: 2px 6px;
}
#notification-list .notification.unread:hover {
  transform: translateX(2px);
}

#notif-upcoming-list .notification {
  background: var(--surface-warm);
  border: 1px dashed var(--rule);
  padding: 20px 24px 22px;
  position: relative;
  border-left: 3px solid var(--sage);
  padding-left: 26px;
}
#notif-upcoming-list .notification .when {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--moss);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}
#notif-upcoming-list .notification .when::before {
  content: '◆';
  color: var(--clay);
  font-size: 8px;
}
#notif-upcoming-list .notification h3 {
  font-family: var(--display);
  font-variation-settings: 'opsz' 144, 'wght' 460, 'SOFT' 30;
  font-size: 21px;
  margin: 0 0 6px;
  letter-spacing: -0.008em;
  color: var(--ink);
}
#notif-upcoming-list .notification .body {
  font-size: 15px;
  color: var(--ink-soft);
  margin: 0;
  line-height: 1.55;
}
#notif-upcoming-list .notification .meta {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--faded);
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed var(--rule);
}

#notification-list .notification h3 {
  font-family: var(--display);
  font-size: 22px;
  margin: 0 0 6px;
  font-variation-settings: 'opsz' 144, 'wght' 460, 'SOFT' 30;
  letter-spacing: -0.008em;
  padding-right: 60px;
}
#notification-list .notification .body {
  font-size: 15px;
  color: var(--ink-soft);
  margin: 0;
  line-height: 1.55;
}
#notification-list .notification .meta {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--faded);
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed var(--rule);
}

/* --------------------------- responsive -------------------------------- */

@media (max-width: 720px) {
  main { padding: 36px 22px 24px; }
  .app-header { padding: 16px 22px 14px; grid-template-columns: auto auto; gap: 14px; }
  .app-header::after { left: 22px; right: 22px; }
  .brand-tag { display: none; }
  .brand { font-size: 19px; }
  .brand-mark { width: 36px; height: 36px; }
  .card { padding: 44px 28px 32px; }
  #screen-signin .card, #screen-onboarding .card { margin-top: 12px; }
  .checkbox-group, .soil-grid { grid-template-columns: 1fr; }
  .chat-input { grid-template-columns: 1fr; }
  .form-actions { flex-direction: column-reverse; align-items: stretch; }
  .form-actions button { width: 100%; }
  .lawn-grid { grid-template-columns: 1fr; }
  .screen-header { flex-direction: column; align-items: flex-start; }
  fieldset legend { font-size: 19px; }
  .chat-bubble.user, .chat-bubble.assistant { max-width: 92%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
