/* 702Greens Operations · the new look (brand system v4, product mode). People can switch it off: More → account menu → Classic look.
   Loaded after styles.css and batches.css. Calm surfaces, one brand colour, the accent used once per screen.
   Sections: tokens · base · type · controls · surfaces · shell · Today · Grow · Inventory · dialogs · Waste · Guide · motion */

/* ── Tokens (brand names are in components.css) ─────────────────────────── */
:root {
  /* Older names now point at the brand. */
  --forest: var(--brand); --forest-2: var(--brand-hover); --lime: var(--accent); --lime-soft: var(--accent-soft);
  --ink: var(--text); --muted: var(--text-2); --soft: var(--bg-alt); --paper: var(--surface); --line: var(--border);
  --danger: var(--error); --warning: var(--warn); --shadow: var(--shadow-2);
}


/* ── Base ───────────────────────────────────────────────────────────────── */
html, body, .boot { background: var(--bg); }
body { color: var(--text); font-size: 15px; line-height: 1.5; font-feature-settings: "tnum" 0; text-rendering: optimizeLegibility; }
/* The brand's paper: a 2.5% grain over every surface. */
body::after { content: ""; position: fixed; inset: 0; z-index: 400; pointer-events: none; opacity: .025; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }
::selection { background: var(--accent-soft); color: var(--brand-deep); }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.workspace { padding-top: 40px; }

/* ── Type ───────────────────────────────────────────────────────────────── */
.view-heading h1, .access-copy h1 { color: var(--brand); font-size: clamp(30px, 5vw, 42px); font-weight: 600; letter-spacing: -.025em; line-height: 1.08; }
.view-heading > div > p:last-child, .access-copy > p:last-child { color: var(--text-2); font-size: 15px; line-height: 1.55; max-width: 62ch; }
.eyebrow, .ds-eyebrow { color: var(--text-3); font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.section-heading h2, .update-heading h2, .inventory-section-head h2, .batch-panel h2, .grow-today h2, .ds-card-title { color: var(--brand); font-weight: 600; letter-spacing: -.01em; }
.section-heading h2, .update-heading h2, .inventory-section-head h2 { font-size: 20px; }
.section-heading p, .update-heading p, .inventory-section-head p, .empty-help, .inventory-form-note { color: var(--text-2); }
#todayHeading::after { content: "."; color: var(--accent); } /* The Dot: one per screen. */
.activity-disclosure { color: var(--text-3); font-size: 12px; }

/* ── Controls ───────────────────────────────────────────────────────────── */
.button { min-height: 44px; padding: 0 20px; border-radius: var(--r-pill); font-size: 13px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; line-height: 1.2; transition: background-color .2s var(--ease), border-color .2s var(--ease), color .2s var(--ease), box-shadow .2s var(--ease), transform .12s var(--ease); }
.button.primary { color: #fff; border: 1.5px solid var(--brand); background: var(--brand); }
.button.primary:hover { border-color: var(--brand-deep); background: var(--brand-deep); }
.button.lime { color: var(--brand); border: 1.5px solid var(--accent); background: var(--accent); }
.button.lime:hover { border-color: var(--accent-hover); background: var(--accent-hover); }
.button.quiet { color: var(--brand); border: 1.5px solid var(--border); background: var(--surface); }
.button.quiet:hover { border-color: var(--brand); background: var(--surface); }
.button.danger { color: var(--error); border: 1.5px solid rgba(196, 22, 28, .22); background: var(--surface); }
.button.danger:hover { border-color: var(--error); }
.button:active:not(:disabled), .ds-button:active:not(:disabled) { transform: scale(.98); }
.icon-button, .close-button { width: 40px; height: 40px; color: var(--text-2); border: 0; border-radius: 50%; background: var(--bg-alt); font-size: 18px; }
.icon-button:hover, .close-button:hover { color: var(--brand); background: #ECECEF; }

input, select, textarea { color: var(--text); border: 1px solid var(--border); border-radius: var(--r-input); background: var(--surface); font-size: 16px; transition: border-color .15s var(--ease), box-shadow .15s var(--ease); }
input, select { height: 48px; padding: 0 14px; }
textarea { padding: 12px 14px; line-height: 1.5; }
input::placeholder, textarea::placeholder { color: #A1A1A6; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px rgba(20, 68, 68, .1); }
input[readonly] { color: var(--text-2); background: var(--bg-alt); }
input[type="checkbox"], input[type="radio"] { width: 20px; height: 20px; padding: 0; accent-color: var(--brand); box-shadow: none; }
input[type="file"] { height: auto; padding: 10px; }
.form-grid > label > span:first-child, .inventory-field > span:first-child, .crop-field > span:first-child, .access-form label > span, .form-label, fieldset > legend { color: var(--text-2); font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }

/* Segmented controls and filters. */
.completion-filters { gap: 2px; padding: 4px; border-radius: var(--r-pill); background: #EEEEF0; }
.completion-filters button { min-height: 36px; padding: 0 16px; color: var(--text-2); border-radius: var(--r-pill); font-size: 13px; font-weight: 600; transition: background-color .2s var(--ease), color .2s var(--ease), box-shadow .2s var(--ease); }
.completion-filters button[aria-pressed="true"] { color: var(--brand); background: var(--surface); box-shadow: 0 1px 3px rgba(10, 42, 42, .12), 0 1px 1px rgba(10, 42, 42, .04); }
.completion-filters button b { color: inherit; }
.inventory-tabs, #app .inventory-tabs { display: flex; flex-wrap: nowrap; width: auto; max-width: 100%; overflow-x: auto; border: 0; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.inventory-tabs::-webkit-scrollbar { display: none; }
.inventory-tabs button { flex: 0 0 auto; white-space: nowrap; }
.work-filters button { border-color: var(--border); border-radius: var(--r-pill); }
.search input { padding-left: 40px; border-radius: var(--r-pill); background: var(--surface); }

/* Toggles and filters read as choices, not commands: sentence case. */
.button[aria-pressed] { text-transform: none; letter-spacing: 0; font-weight: 600; }
.button[aria-pressed="true"] { color: #fff; border-color: var(--brand); background: var(--brand); }
.completion-filters { flex-wrap: nowrap; max-width: 100%; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.completion-filters::-webkit-scrollbar { display: none; }
.completion-filters button { flex: 0 0 auto; white-space: nowrap; }
#app #growView .completion-filters, #app .project-controls .completion-filters { display: flex; width: auto; max-width: 100%; gap: 2px; }
.harvest-status-filters .button { justify-content: flex-start; gap: 8px; min-height: 48px; padding: 0 16px; border-radius: 14px; font-size: 13px; font-weight: 500; text-align: left; }
.harvest-status-filters .button b { font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums; }

/* Status labels. */
.task-status, .pill, .inventory-status { border-radius: var(--r-pill); font-size: 12px; font-weight: 600; letter-spacing: .01em; }
.task-status { color: var(--text-2); background: var(--bg-alt); }
.task-status.in_progress { color: var(--info); background: var(--info-soft); }
.task-status.done { color: var(--ok); background: var(--ok-soft); }
.task-status.blocked { color: var(--error); background: var(--error-soft); }

/* ── Surfaces ───────────────────────────────────────────────────────────── */
.auto-update, .batch-panel, .grow-today, .ds-card, .more-link, .empty-card, .grow-card, .crop-card, .presence-card, .project-card { border: 1px solid var(--hairline); border-radius: var(--r-card); background: var(--surface); box-shadow: var(--shadow-1); }
.grow-today { background: var(--surface); }
.grow-today.is-empty { background: var(--bg-alt); box-shadow: none; }
.more-link { padding: 20px 22px; transition: transform .2s var(--ease), box-shadow .2s var(--ease); }
.more-link b { color: var(--brand); font-size: 17px; font-weight: 600; letter-spacing: -.01em; }
.more-link span { color: var(--text-2); }

/* Task cards: no edge stripes; colour lives in the small dot and the status. */
.task-card, .task-card[class*="area-"], .task-card.status-open, .task-card.status-in_progress, .task-card.status-done, .task-card.status-blocked, .task-card.status-skipped { border: 1px solid var(--hairline); border-left-width: 1px; border-radius: 18px; background: var(--surface); box-shadow: var(--shadow-1); }
.task-card.status-done .task-main b, .task-card.is-done .task-main b { color: var(--text-2); }
.task-card .category-dot { width: 8px; height: 8px; }
.task-main b { color: var(--text); font-size: 17px; font-weight: 600; letter-spacing: -.01em; }
.task-main small { color: var(--text-2); }
.area-label { font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.recurrence-badge, .task-labels > span:not(.area-label) { color: var(--text-3); }
.sop-flag > span { color: var(--text-2); border-color: var(--border); background: var(--bg-alt); font-weight: 600; }
@media (hover: hover) {
  .task-card:hover, .more-link:hover, .grow-card:hover { transform: translateY(-2px); border-color: var(--hairline); box-shadow: var(--shadow-2); }
}

/* ── Shell: top bar, nav, toast ─────────────────────────────────────────── */
.topbar { border-bottom: 1px solid var(--border); background: rgba(250, 250, 250, .84); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px); }
.topbar::after { display: none; }
.brand-button { color: var(--brand); font-size: 15px; font-weight: 800; letter-spacing: .16em; }
.brand-button span { margin-left: 8px; color: var(--text-3); font-size: 10px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; }
.changelog-button, .app-update-button { border-radius: var(--r-pill); font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.avatar-button #avatar { color: var(--brand); background: var(--accent-soft); }
/* Scoped under #app: the older stylesheet stacks several nav layouts. */
#app .main-nav { overflow: visible; border-bottom: 1px solid var(--border); background: rgba(250, 250, 250, .84); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px); }
#app .main-nav .main-nav-inner { display: flex; width: min(1120px, calc(100% - 40px)); min-width: 0; height: 56px; padding: 0; gap: 32px; align-items: stretch; justify-content: flex-start; overflow: visible; }
#app .main-nav .nav-button { position: relative; display: flex; flex: 0 0 auto; flex-direction: row; align-items: center; justify-content: center; gap: 8px; min-width: 0; min-height: 0; padding: 0 2px; color: var(--text-3); border-radius: 0; background: transparent; font-size: 12px; font-weight: 700; letter-spacing: .12em; line-height: 1; text-transform: uppercase; transition: color .2s var(--ease); }
#app .main-nav .nav-button:hover, #app .main-nav .nav-button.active { color: var(--brand); background: transparent; }
#app .main-nav .nav-button::after { display: block; content: ""; position: absolute; right: 0; bottom: 0; left: 0; height: 2px; border-radius: 2px 2px 0 0; background: transparent; }
#app .main-nav .nav-button.active::after { background: var(--brand); }
.toast { border-radius: 16px; background: var(--brand-deep); box-shadow: var(--shadow-3); font-size: 14px; }
.toast.error { background: var(--error); }

@media (max-width: 767px) {
  /* Phones: tabs at the bottom, where the thumb is. */
  #app .main-nav { position: fixed; top: auto; right: 0; bottom: 0; left: 0; z-index: 90; padding-bottom: env(safe-area-inset-bottom); border-top: 1px solid var(--border); border-bottom: 0; }
  #app .main-nav .main-nav-inner { width: 100%; height: 58px; gap: 0; justify-content: space-around; }
  #app .main-nav .nav-button { flex: 1 1 0; flex-direction: column; gap: 4px; padding: 0; font-size: 9.5px; letter-spacing: .05em; }
  #app .main-nav .nav-button::after { display: none; }
  #app .main-nav .nav-button.active .nav-glyph { stroke-width: 1.9; }
  .nav-glyph { display: block; }
  #app #pilotNav { display: none; }
  .workspace { padding-top: 24px; padding-bottom: calc(110px + env(safe-area-inset-bottom)); }
  .toast { right: 16px; bottom: calc(72px + env(safe-area-inset-bottom)); left: 16px; max-width: none; }
  .view-heading { align-items: flex-start; }
}

/* ── Today ──────────────────────────────────────────────────────────────── */
#todayView .view-heading h1 { font-size: clamp(36px, 9vw, 52px); }
.shift-bar-text b { color: var(--brand); }
.shift-dot { background: #34C759; box-shadow: 0 0 0 4px rgba(52, 199, 89, .16); }
.today-issues-compact > summary span { color: var(--error); }
.before-leave > summary b, .today-issues-compact > summary b { color: var(--brand); font-weight: 600; }
.app-updates-prompt { border: 1px solid var(--hairline); border-radius: var(--r-card); background: var(--surface); box-shadow: none; }
.app-updates-prompt span { color: var(--text-2); }
.simple-day-count.all-clear { border-radius: var(--r-card); color: var(--ok); background: var(--ok-soft); }

/* Work type filter: one pill showing the current choice. */
.filter-panel { border: 1px solid var(--border); border-radius: 22px; background: var(--surface); }
.filter-panel > summary { min-height: 42px; padding: 0 16px; gap: 6px; color: var(--brand); font-size: 0; }
.filter-panel > summary > span { color: var(--brand); font-size: 13px; font-weight: 600; max-width: 160px; }
.filter-panel > summary::after, .filter-panel[open] > summary::after { content: ""; width: 7px; height: 7px; margin-left: 4px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; font-size: 0; transform: translateY(-2px) rotate(45deg); transition: transform .2s var(--ease); }
.filter-panel[open] > summary::after { transform: translateY(2px) rotate(-135deg); }
.filter-panel[open] > summary { border-bottom-color: var(--border); }
.shift-bar-actions .button { padding: 0 10px; font-size: 12px; letter-spacing: .01em; white-space: nowrap; }

/* ── Inventory ──────────────────────────────────────────────────────────── */
.batch-stock-card { border: 1px solid var(--hairline); border-radius: 18px; background: var(--surface); box-shadow: var(--shadow-1); }
.batch-stock-card.pending { border-color: var(--hairline); background: var(--surface); }
.harvest-age-hint { color: var(--warn); }
.fridge-move-actions button { min-height: 36px; padding: 0 14px; color: var(--brand); border: 1px solid var(--border); border-radius: var(--r-pill); background: var(--surface); font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.fridge-move-actions button:hover:not(:disabled) { border-color: var(--brand); }
.amount-pair { gap: 12px; }

/* ── Dialogs ────────────────────────────────────────────────────────────── */
dialog::backdrop { background: rgba(10, 42, 42, .32); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.modal, .editor-modal { border-radius: var(--r-hero); box-shadow: var(--shadow-3); }
.sheet-head, .modal-head { padding: 24px 24px 18px; border-bottom: 1px solid var(--border); }
.sheet-head h2, .modal-head h2 { color: var(--brand); font-size: 22px; font-weight: 600; letter-spacing: -.02em; }
.modal-actions, .sheet-actions { border-top: 1px solid var(--border); background: rgba(255, 255, 255, .94); }
@media (max-width: 767px) {
  /* Phones: the main forms rise from the bottom like a sheet. */
  dialog.inventory-dialog, dialog.grow-dialog, dialog.project-dialog { width: 100%; max-width: 100%; margin: auto auto 0; border-radius: var(--r-hero) var(--r-hero) 0 0; }
  dialog.inventory-dialog form, dialog.grow-dialog form, dialog.project-dialog form { max-height: calc(100dvh - 16px); }
  dialog.inventory-dialog .modal-head::before, dialog.grow-dialog .modal-head::before, dialog.project-dialog .modal-head::before { content: ""; position: absolute; top: 8px; left: 50%; width: 36px; height: 5px; border-radius: 3px; background: #D1D1D6; transform: translateX(-50%); }
  dialog.inventory-dialog .modal-head, dialog.grow-dialog .modal-head, dialog.project-dialog .modal-head { position: relative; padding-top: 26px; }
  .modal-actions .button, .sheet-actions .button { flex: 1 1 auto; }
}

/* ── Motion ─────────────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: no-preference) {
  dialog[open] { animation: ds-rise .32s var(--ease); }
  dialog[open]::backdrop { animation: ds-fade .25s var(--ease); }
  .view:not([hidden]) { animation: ds-fade .22s var(--ease); }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }
