@import url('https://fonts.googleapis.com/css2?family=Work+Sans:wght@400;500;600;700&display=swap');

:root {
  --forest: #154444;
  --forest-2: #1d5656;
  --lime: #a4cd3a;
  --lime-soft: #eef5d9;
  --ink: #1b211f;
  --muted: #717976;
  --soft: #f5f7f5;
  --paper: #fff;
  --line: rgba(21, 68, 68, .13);
  --danger: #a74332;
  --warning: #9a651e;
  --shadow: 0 14px 42px rgba(21, 68, 68, .09);
}

* { box-sizing: border-box; }
html { background: #f8faf8; }
body { margin: 0; color: var(--ink); background: #f8faf8; font-family: "Work Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .48; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid rgba(164, 205, 58, .5); outline-offset: 2px; }

.boot { position: fixed; inset: 0; z-index: 200; display: grid; place-content: center; justify-items: center; gap: 14px; color: var(--forest); background: #f8faf8; font-size: 13px; font-weight: 600; }
.spinner { width: 24px; height: 24px; border: 2px solid rgba(21, 68, 68, .15); border-top-color: var(--forest); border-radius: 50%; animation: spin .75s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.access { min-height: 100svh; display: grid; place-items: center; padding: 28px 18px; background: linear-gradient(145deg, #f7faf7 0%, #f0f4ec 100%); }
.access-card { width: min(100%, 448px); padding: 36px; border: 1px solid var(--line); border-radius: 22px; background: rgba(255, 255, 255, .96); box-shadow: 0 28px 80px rgba(21, 68, 68, .12); }
.wordmark { padding-bottom: 22px; color: var(--forest); border-bottom: 2px solid; border-image: linear-gradient(90deg, var(--forest), var(--lime)) 1; font-size: 18px; font-weight: 700; letter-spacing: -.03em; }
.access-copy { padding: 38px 0 24px; }
.eyebrow { margin: 0 0 8px; color: #8a928f; font-size: 11px; font-weight: 650; letter-spacing: .1em; text-transform: uppercase; }
.access-copy h1, .view-heading h1 { margin: 0; color: var(--forest); font-size: 40px; line-height: 1.08; letter-spacing: -.045em; }
.access-copy > p:last-child, .view-heading > div > p:last-child { margin: 12px 0 0; color: var(--muted); font-size: 14px; line-height: 1.55; }
.access-form { display: grid; gap: 15px; }
.access-form label > span, .form-grid label > span, fieldset legend, .form-label { display: block; margin: 0 0 7px; color: #5e6763; font-size: 11px; font-weight: 650; }
input, select, textarea { width: 100%; color: var(--ink); border: 1px solid var(--line); border-radius: 10px; background: #fff; }
input, select { height: 44px; padding: 0 12px; }
textarea { min-height: 96px; padding: 11px 12px; resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus { outline: 3px solid rgba(164, 205, 58, .25); border-color: rgba(21, 68, 68, .45); }
.access-help { margin: 22px 0 0; color: #98a09d; font-size: 11px; text-align: center; }
.form-error { min-height: 16px; margin: -3px 0 0; color: var(--danger); font-size: 11px; line-height: 1.45; }

.button, .icon-button, .close-button { display: inline-flex; align-items: center; justify-content: center; border: 0; transition: .15s ease; }
.button { min-height: 40px; padding: 0 15px; border-radius: 9px; font-size: 12px; font-weight: 650; }
.button.primary { color: #fff; background: var(--forest); }
.button.primary:hover { background: var(--forest-2); }
.button.lime { color: var(--forest); background: var(--lime); }
.button.lime:hover { background: #b4d951; }
.button.quiet { color: var(--forest); border: 1px solid var(--line); background: #fff; }
.button.quiet:hover { border-color: rgba(21, 68, 68, .35); }
.button.danger { color: var(--danger); border: 1px solid rgba(167, 67, 50, .2); background: #fff; }
.wide { width: 100%; }
.icon-button, .close-button { width: 40px; height: 40px; color: var(--forest); border: 1px solid var(--line); border-radius: 50%; background: #fff; font-size: 18px; }
.icon-button:hover, .close-button:hover { border-color: rgba(21, 68, 68, .35); background: var(--soft); }

.topbar { position: sticky; top: 0; z-index: 80; border-bottom: 1px solid var(--line); background: rgba(248, 250, 248, .92); backdrop-filter: blur(18px) saturate(180%); }
.topbar::after { content: ""; position: absolute; right: 0; bottom: -1px; left: 0; height: 2px; background: linear-gradient(90deg, var(--forest), var(--lime)); }
.topbar-inner { width: min(1120px, calc(100% - 40px)); height: 62px; margin: auto; display: flex; align-items: center; justify-content: space-between; }
.brand-button { padding: 0; color: var(--forest); border: 0; background: transparent; font-size: 18px; font-weight: 700; letter-spacing: -.03em; }
.brand-button span { margin-left: 5px; color: #858e8a; font-size: 11px; font-weight: 500; letter-spacing: 0; }
.account { position: relative; display: flex; align-items: center; gap: 12px; }
.sync { display: flex; align-items: center; gap: 7px; color: #818a87; font-size: 10px; font-weight: 600; }
.sync i { width: 7px; height: 7px; border-radius: 50%; background: #7ca12d; box-shadow: 0 0 0 3px rgba(164, 205, 58, .18); }
.sync.saving i { background: #d1983e; animation: pulse 1s ease infinite; }
.sync.error i { background: var(--danger); box-shadow: 0 0 0 3px rgba(167, 67, 50, .12); }
@keyframes pulse { 50% { opacity: .35; } }
.avatar-button { display: flex; align-items: center; gap: 9px; padding: 4px 7px 4px 4px; color: inherit; border: 0; border-radius: 24px; background: transparent; text-align: left; }
.avatar-button:hover { background: rgba(21, 68, 68, .05); }
.avatar-button > span:first-child { display: grid; width: 32px; height: 32px; place-items: center; color: var(--forest); border-radius: 50%; background: var(--lime-soft); font-size: 12px; font-weight: 700; }
.account-copy { display: grid; }
.account-copy b { max-width: 130px; overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.account-copy small { margin-top: 1px; color: #8a928f; font-size: 9px; text-transform: capitalize; }
.account-menu { position: absolute; top: 48px; right: 0; width: 220px; padding: 9px; border: 1px solid var(--line); border-radius: 12px; background: #fff; box-shadow: var(--shadow); }
.account-menu p { margin: 4px 7px 10px; overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; }
.account-menu button { width: 100%; padding: 9px 8px; color: var(--danger); border: 0; border-radius: 7px; background: transparent; font-size: 11px; font-weight: 650; text-align: left; }
.account-menu button:hover { background: #fff5f2; }

.main-nav { position: sticky; top: 62px; z-index: 60; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.94); backdrop-filter: blur(16px); }
.main-nav-inner { width: min(1120px, calc(100% - 40px)); height: 54px; margin: auto; display: flex; align-items: stretch; gap: 26px; }
.nav-button { position: relative; display: flex; align-items: center; gap: 7px; padding: 0 1px; color: #7a8380; border: 0; background: transparent; font-size: 12px; font-weight: 600; }
.nav-button::after { content: ""; position: absolute; right: 0; bottom: 0; left: 0; height: 2px; border-radius: 2px 2px 0 0; background: transparent; }
.nav-button:hover { color: var(--forest); }
.nav-button.active { color: var(--forest); }
.nav-button.active::after { background: var(--lime); }
.nav-icon { width: 16px; color: inherit; font-size: 14px; text-align: center; }

.workspace { width: min(1120px, calc(100% - 40px)); margin: auto; padding: 48px 0 80px; }
.view-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.view-heading h1 { font-size: 38px; }
.date-controls { display: flex; align-items: center; gap: 7px; }
.week-actions { display: flex; align-items: center; gap: 12px; }
.section-heading { display: flex; align-items: flex-end; justify-content: space-between; margin: 36px 0 14px; }
.section-heading h2 { margin: 0; color: var(--forest); font-size: 20px; letter-spacing: -.025em; }
.section-heading p { margin: 4px 0 0; color: #8b9490; font-size: 11px; }

.day-status { display: grid; grid-template-columns: minmax(0, 1.5fr) repeat(3, minmax(100px, .55fr)); overflow: hidden; border: 1px solid var(--line); border-radius: 15px; background: #fff; box-shadow: 0 8px 28px rgba(21, 68, 68, .05); }
.progress-card, .mini-stat { padding: 20px; }
.progress-card { border-right: 1px solid var(--line); }
.progress-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.progress-top b { color: var(--forest); font-size: 15px; }
.progress-top span { color: var(--forest); font-size: 20px; font-weight: 700; letter-spacing: -.03em; }
.progress-track { height: 7px; margin-top: 15px; overflow: hidden; border-radius: 8px; background: #edf0ed; }
.progress-track i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--forest), var(--lime)); transition: width .25s ease; }
.mini-stat { border-right: 1px solid var(--line); }
.mini-stat:last-child { border-right: 0; }
.mini-stat b { display: block; color: var(--forest); font-size: 21px; letter-spacing: -.04em; }
.mini-stat span { display: block; margin-top: 5px; color: #8a928f; font-size: 10px; }
.attention { margin-top: 16px; padding: 14px 16px; color: #704a17; border: 1px solid rgba(172, 116, 39, .17); border-radius: 11px; background: #fff9ed; font-size: 12px; line-height: 1.5; }

.task-list { display: grid; gap: 9px; }
.task-card { display: grid; grid-template-columns: 86px 12px minmax(0, 1fr) auto; align-items: center; gap: 14px; width: 100%; padding: 17px 18px; color: inherit; border: 1px solid var(--line); border-radius: 13px; background: #fff; box-shadow: 0 3px 12px rgba(21, 68, 68, .035); text-align: left; transition: .15s ease; }
.task-card:hover { transform: translateY(-1px); border-color: rgba(21, 68, 68, .35); box-shadow: 0 8px 22px rgba(21, 68, 68, .07); }
.task-time b { display: block; color: #343b39; font-size: 12px; }
.task-time small { display: block; margin-top: 3px; color: #9aa19f; font-size: 9px; }
.category-dot { width: 8px; height: 8px; border-radius: 50%; background: #91a09b; }
.category-dot.harvest { background: #6f9f79; }
.category-dot.delivery { background: #6699aa; }
.category-dot.plant { background: #8a76a7; }
.category-dot.clean { background: #bc9848; }
.category-dot.market { background: #d18158; }
.task-main { min-width: 0; }
.task-main b { display: block; overflow: hidden; color: #222825; font-size: 14px; font-weight: 600; line-height: 1.38; text-overflow: ellipsis; white-space: nowrap; }
.task-main small { display: block; margin-top: 4px; color: #8b9490; font-size: 10px; }
.task-status, .pill { display: inline-flex; align-items: center; width: max-content; border-radius: 999px; font-size: 9px; font-weight: 650; white-space: nowrap; }
.task-status { padding: 5px 8px; color: #6d7773; background: #f0f2f1; }
.task-status.done { color: #466317; background: #edf5d9; }
.task-status.in_progress { color: #355b67; background: #e8f2f5; }
.task-status.blocked { color: #9a4c32; background: #fff0ea; }
.task-status.skipped { color: #777; background: #eee; }
.task-card.is-done .task-main b { color: #929a97; text-decoration: line-through; }
.empty-card { padding: 48px 20px; color: #8a928f; border: 1px dashed rgba(21, 68, 68, .2); border-radius: 13px; background: rgba(255,255,255,.55); font-size: 12px; text-align: center; }

.week-progress { margin-bottom: 18px; padding: 18px 20px; border: 1px solid var(--line); border-radius: 13px; background: #fff; }
.week-progress .progress-top span { font-size: 15px; }
.week-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 9px; align-items: start; }
.week-day { min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 13px; background: #fff; }
.week-day.is-today { border-color: var(--forest); box-shadow: 0 0 0 1px var(--forest); }
.week-day-head { padding: 13px; border-bottom: 1px solid var(--line); background: #f5f7f5; }
.week-day.is-today .week-day-head { color: #fff; background: var(--forest); }
.week-day-head b { display: block; font-size: 11px; }
.week-day-head span { display: block; margin-top: 4px; color: #929a97; font-size: 9px; }
.week-day.is-today .week-day-head span { color: rgba(255,255,255,.66); }
.week-day-progress { height: 3px; background: #e8ece8; }
.week-day-progress i { display: block; height: 100%; background: var(--lime); }
.week-tasks { display: grid; gap: 0; }
.week-task { display: grid; grid-template-columns: 7px minmax(0,1fr); gap: 8px; width: 100%; padding: 11px 10px; color: #323936; border: 0; border-bottom: 1px solid var(--line); background: transparent; text-align: left; }
.week-task:last-child { border-bottom: 0; }
.week-task:hover { background: #f8faf8; }
.week-task i { width: 7px; height: 7px; margin-top: 3px; border: 1.5px solid #9aa39f; border-radius: 50%; }
.week-task.done i { border-color: #78942d; background: var(--lime); }
.week-task.blocked i { border-color: var(--danger); background: var(--danger); }
.week-task b { display: block; overflow: hidden; font-size: 10px; font-weight: 600; line-height: 1.35; text-overflow: ellipsis; }
.week-task small { display: block; margin-top: 3px; color: #9aa19e; font-size: 8px; }

.sop-overview { display: grid; grid-template-columns: repeat(4, 1fr); overflow: hidden; margin-bottom: 18px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.sop-stat { padding: 18px 20px; border-right: 1px solid var(--line); }
.sop-stat:last-child { border-right: 0; }
.sop-stat b { display: block; color: var(--forest); font-size: 21px; letter-spacing: -.04em; }
.sop-stat span { display: block; margin-top: 4px; color: #8d9592; font-size: 10px; }
.toolbar { display: grid; grid-template-columns: minmax(220px, 1fr) 180px 180px; gap: 9px; padding: 12px; border: 1px solid var(--line); border-radius: 13px; background: #fff; }
.search { position: relative; }
.search span { position: absolute; top: 9px; left: 12px; color: #7f8985; font-size: 19px; }
.search input { padding-left: 37px; }
.toolbar input, .toolbar select { height: 38px; border-radius: 8px; font-size: 11px; }
.result-count { margin: 14px 2px 9px; color: #8c9491; font-size: 10px; }
.sop-list { overflow: hidden; border: 1px solid var(--line); border-radius: 13px; background: #fff; }
.sop-row { display: grid; grid-template-columns: 44px minmax(0,1fr) 120px 54px 22px; gap: 14px; align-items: center; width: 100%; padding: 15px 17px; color: inherit; border: 0; border-bottom: 1px solid var(--line); background: #fff; text-align: left; }
.sop-row:last-child { border-bottom: 0; }
.sop-row:hover { background: #fafcf9; }
.sop-number { color: #9aa29f; font-size: 10px; font-weight: 650; }
.sop-name { min-width: 0; }
.sop-name b { display: block; overflow: hidden; color: #2a302e; font-size: 13px; font-weight: 600; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
.sop-name small { display: block; margin-top: 3px; color: #959d9a; font-size: 9px; }
.pill { padding: 4px 7px; color: #707976; background: #f0f2f1; }
.pill.approved, .pill.field-test { color: #526e18; background: #eef5db; }
.pill.needs-shaan-approval { color: #9b531e; background: #fff0e4; }
.pill.field-capture, .pill.pending { color: #655278; background: #f1edf6; }
.pill.source-audit { color: #42616b; background: #e8f1f3; }
.priority { color: #818986; font-size: 9px; font-weight: 700; text-align: center; }
.priority.p0 { color: var(--forest); }
.chevron { color: #a0a7a4; font-size: 18px; }

.role-guide { display: grid; grid-template-columns: repeat(4, 1fr); margin-bottom: 18px; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.role-guide span { padding: 14px 16px; color: #858e8a; border-right: 1px solid var(--line); font-size: 10px; }
.role-guide span:last-child { border-right: 0; }
.role-guide b { display: block; margin-bottom: 3px; color: var(--forest); }
.team-list { display: grid; gap: 9px; }
.team-card { display: grid; grid-template-columns: 38px minmax(0,1fr) auto auto; align-items: center; gap: 13px; padding: 15px 16px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.team-avatar { display: grid; width: 38px; height: 38px; place-items: center; color: var(--forest); border-radius: 50%; background: var(--lime-soft); font-size: 12px; font-weight: 700; }
.team-copy b { display: block; font-size: 12px; }
.team-copy small { display: block; margin-top: 3px; color: #919996; font-size: 9px; }
.team-groups { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px; }
.team-groups span { padding: 4px 6px; color: #65706c; border-radius: 999px; background: #f0f3f1; font-size: 8px; }
.team-role, .team-role-select { color: var(--forest); font-size: 10px; font-weight: 650; text-transform: capitalize; }
.team-role-select { width: 104px; height: 34px; padding: 0 8px; border-radius: 8px; }

dialog { padding: 0; border: 0; background: transparent; }
dialog::backdrop { background: rgba(12, 36, 28, .48); backdrop-filter: blur(5px); }
.sheet { width: min(620px, 100%); height: 100%; max-height: none; margin: 0 0 0 auto; }
.sheet-frame { display: grid; grid-template-rows: auto minmax(0,1fr) auto; height: 100%; background: #fff; box-shadow: -24px 0 80px rgba(14, 49, 37, .18); }
.sheet-head, .modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding: 25px 28px; border-bottom: 1px solid var(--line); }
.sheet-head h2, .modal-head h2 { margin: 0; color: var(--forest); font-size: 25px; line-height: 1.2; letter-spacing: -.035em; }
.sheet-body { overflow-y: auto; padding: 26px 28px 42px; }
.sheet-actions, .modal-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 16px 28px max(16px, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: rgba(248,250,248,.95); }
.meta-strip { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 22px; }
.meta-strip span { padding: 5px 8px; color: #65706c; border-radius: 999px; background: #f0f3f1; font-size: 9px; font-weight: 600; }
.detail-section { padding: 20px 0; border-top: 1px solid var(--line); }
.detail-section:first-child { padding-top: 0; border-top: 0; }
.detail-section h3 { margin: 0 0 10px; color: var(--forest); font-size: 12px; }
.detail-section > p { margin: 0; color: #59635f; font-size: 12px; line-height: 1.65; }
.status-controls { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.status-control { min-height: 36px; padding: 0 6px; color: #6c7571; border: 1px solid var(--line); border-radius: 8px; background: #fff; font-size: 9px; font-weight: 650; }
.status-control:hover, .status-control.active { color: var(--forest); border-color: var(--forest); background: #f3f8ed; }
.checklist { display: grid; gap: 7px; }
.check-row { display: grid; grid-template-columns: 24px minmax(0,1fr) auto; gap: 10px; align-items: center; width: 100%; padding: 11px 12px; color: #333a37; border: 1px solid var(--line); border-radius: 9px; background: #fff; text-align: left; }
.check-row:hover { border-color: rgba(21,68,68,.35); }
.check-box { display: grid; width: 22px; height: 22px; place-items: center; color: #fff; border: 1.5px solid #a5ada9; border-radius: 6px; font-size: 12px; }
.check-row.complete .check-box { border-color: var(--forest); background: var(--forest); }
.check-row.complete .check-label { color: #909895; text-decoration: line-through; }
.check-label { font-size: 11px; line-height: 1.4; }
.check-proof { color: #9aa19e; font-size: 8px; text-transform: uppercase; }
.no-checklist { padding: 17px; color: #8b9490; border: 1px dashed rgba(21,68,68,.2); border-radius: 9px; background: #fafcfa; font-size: 11px; line-height: 1.5; }
.inline-edit { margin-top: 12px; }
.inline-edit summary { color: var(--forest); cursor: pointer; font-size: 10px; font-weight: 650; }
.inline-edit textarea { margin-top: 10px; min-height: 130px; font-size: 11px; }
.inline-edit .button { margin-top: 7px; }
.proof-form { display: grid; gap: 9px; }
.proof-form textarea { min-height: 74px; font-size: 11px; }
.file-input { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 11px 12px; color: #66706c; border: 1px dashed rgba(21,68,68,.25); border-radius: 9px; background: #fafcfa; font-size: 10px; }
.file-input input { width: auto; height: auto; padding: 0; border: 0; font-size: 9px; }
.proof-list, .activity-list, .source-list { display: grid; gap: 7px; }
.proof-item, .activity-item, .source-link-card { padding: 10px 11px; border: 1px solid var(--line); border-radius: 8px; background: #fafbfa; }
.proof-item b, .activity-item b, .source-link-card b { display: block; color: #3d4642; font-size: 10px; }
.proof-item span, .activity-item span, .source-link-card span { display: block; margin-top: 3px; color: #929a97; font-size: 9px; line-height: 1.45; }
.source-link-card { color: inherit; text-decoration: none; }
.source-link-card:hover { border-color: rgba(21,68,68,.34); }
.step-list { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; counter-reset: step; }
.step-list li { display: grid; grid-template-columns: 28px minmax(0,1fr); gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--line); color: #3e4743; font-size: 12px; line-height: 1.5; counter-increment: step; }
.step-list li:last-child { border-bottom: 0; }
.step-list li::before { content: counter(step); display: grid; width: 25px; height: 25px; place-items: center; color: var(--forest); border-radius: 50%; background: var(--lime-soft); font-size: 9px; font-weight: 700; }
.definition-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.definition { padding: 13px; border: 1px solid var(--line); border-radius: 9px; background: #fafbfa; }
.definition b { display: block; margin-bottom: 5px; color: #87908c; font-size: 8px; letter-spacing: .07em; text-transform: uppercase; }
.definition p { margin: 0; color: #444e4a; font-size: 10px; line-height: 1.55; }
.definition.wide { grid-column: 1 / -1; }
.edit-form { display: grid; gap: 12px; }
.edit-form textarea { font-size: 11px; }
.field-help { margin: 5px 0 0; color: #98a09d; font-size: 9px; }

.modal { width: min(520px, calc(100% - 28px)); border-radius: 16px; background: #fff; box-shadow: 0 26px 90px rgba(10, 36, 27, .28); }
.modal-body { padding: 22px 24px; }
.modal-actions { padding: 15px 24px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.span-2 { grid-column: 1 / -1; }
fieldset { margin: 0; padding: 0; border: 0; }
.check-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.check-option { display: flex; align-items: center; gap: 8px; padding: 10px; border: 1px solid var(--line); border-radius: 8px; color: #4e5854; font-size: 10px; }
.check-option input { width: 15px; height: 15px; }

.editor-modal { width: min(1040px, calc(100% - 32px)); height: min(92svh, 920px); max-height: none; border-radius: 18px; background: #fff; box-shadow: 0 28px 100px rgba(10,36,27,.3); }
.editor-frame { display: grid; grid-template-rows: auto minmax(0,1fr) auto; height: 100%; }
.editor-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; padding: 24px 30px 20px; border-bottom: 1px solid var(--line); }
.editor-head h2 { margin: 0; color: var(--forest); font-size: 27px; line-height: 1.16; letter-spacing: -.04em; }
.editor-head > div > p:last-child, .modal-head > div > p:last-child { margin: 7px 0 0; color: var(--muted); font-size: 10px; line-height: 1.45; }
.editor-body { overflow-y: auto; padding: 30px; background: #fafbfa; }
.editor-actions { display: flex; align-items: center; gap: 8px; padding: 15px 30px max(15px, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: #fff; }
.editor-save-note { margin-right: auto; color: #89918e; font-size: 9px; }
.sop-document { width: min(760px, 100%); margin: auto; padding: 46px 56px 64px; border: 1px solid var(--line); border-radius: 14px; background: #fff; box-shadow: 0 12px 38px rgba(21,68,68,.055); }
.document-title { width: 100%; height: auto; padding: 0; color: var(--forest); border: 0; border-radius: 0; font-size: 31px; font-weight: 700; line-height: 1.15; letter-spacing: -.045em; }
.document-title:focus { outline: 0; box-shadow: inset 0 -2px var(--lime); }
.document-meta { display: grid; grid-template-columns: 1fr 130px; gap: 10px; margin: 22px 0 30px; }
.document-block { padding: 22px 0; border-top: 1px solid var(--line); }
.document-block:first-of-type { border-top: 0; }
.document-block label > b { display: block; margin-bottom: 5px; color: var(--forest); font-size: 13px; }
.document-block label > span { display: block; margin-bottom: 10px; color: #949b98; font-size: 9px; line-height: 1.4; }
.document-block textarea { min-height: 86px; padding: 8px 0; border: 0; border-radius: 0; background: transparent; font-size: 12px; line-height: 1.65; }
.document-block textarea:focus { outline: 0; box-shadow: inset 0 -1px rgba(21,68,68,.28); }
.document-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
.document-columns .document-block { border-top: 1px solid var(--line); }
.step-editor { display: grid; gap: 7px; }
.step-edit-row { display: grid; grid-template-columns: 28px minmax(0,1fr) auto; align-items: start; gap: 8px; padding: 8px 8px 8px 0; border-radius: 9px; }
.step-edit-row:focus-within { background: #f7f9f6; }
.step-index { display: grid; width: 25px; height: 25px; margin-top: 6px; place-items: center; color: var(--forest); border-radius: 50%; background: var(--lime-soft); font-size: 9px; font-weight: 700; }
.step-edit-row textarea { min-height: 40px; padding: 8px 4px; }
.step-tools { display: flex; gap: 2px; padding-top: 4px; opacity: .25; transition: opacity .15s ease; }
.step-edit-row:hover .step-tools, .step-edit-row:focus-within .step-tools { opacity: 1; }
.step-tool { width: 25px; height: 25px; color: #737d79; border: 0; border-radius: 6px; background: transparent; font-size: 12px; }
.step-tool:hover { color: var(--forest); background: #eaf0e8; }
.add-step { margin-top: 9px; }
.version-list { display: grid; gap: 6px; }
.version-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 11px; color: #5e6864; border: 1px solid var(--line); border-radius: 8px; background: #fafbfa; font-size: 9px; }
.version-item b { color: var(--forest); font-size: 10px; }

.schedule-modal { width: min(680px, calc(100% - 28px)); }
.schedule-modal form { max-height: min(92svh, 880px); display: grid; grid-template-rows: auto minmax(0,1fr) auto; }
.schedule-modal .modal-body { overflow-y: auto; }
.schedule-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.schedule-grid label > span, .schedule-section > span { display: block; margin: 0 0 7px; color: #5e6763; font-size: 10px; font-weight: 650; }
.schedule-grid .full { grid-column: 1 / -1; }
.schedule-help { margin: 0; padding: 11px 13px; color: #60706a; border-radius: 9px; background: var(--lime-soft); font-size: 9px; line-height: 1.5; }
.schedule-section { grid-column: 1 / -1; }
.schedule-section textarea { min-height: 110px; font-size: 11px; }
.sop-picker { display: grid; max-height: 210px; overflow-y: auto; border: 1px solid var(--line); border-radius: 10px; }
.sop-pick { display: grid; grid-template-columns: 17px minmax(0,1fr) auto; align-items: center; gap: 9px; padding: 10px 11px; color: #4d5753; border-bottom: 1px solid var(--line); font-size: 10px; }
.sop-pick:last-child { border-bottom: 0; }
.sop-pick input { width: 15px; height: 15px; }
.sop-pick small { color: #969d9a; font-size: 8px; }
.action-spacer { flex: 1; }

.toast { position: fixed; right: 20px; bottom: 20px; z-index: 300; max-width: min(360px, calc(100% - 40px)); padding: 12px 15px; color: #fff; border-radius: 10px; background: var(--forest); box-shadow: 0 15px 45px rgba(8,35,25,.25); font-size: 11px; font-weight: 600; transform: translateY(18px); opacity: 0; pointer-events: none; transition: .2s ease; }
.toast.show { transform: translateY(0); opacity: 1; }
.toast.error { background: var(--danger); }

@media (max-width: 900px) {
  .week-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .week-day:last-child { grid-column: span 2; }
}

@media (max-width: 700px) {
  .topbar-inner, .main-nav-inner, .workspace { width: min(100% - 28px, 1120px); }
  .sync, .account-copy, .brand-button span { display: none; }
  .main-nav { top: 62px; }
  .main-nav-inner { justify-content: space-between; gap: 0; }
  .nav-button { min-width: 62px; justify-content: center; }
  .workspace { padding-top: 32px; padding-bottom: calc(86px + env(safe-area-inset-bottom)); }
  .view-heading { align-items: flex-start; margin-bottom: 22px; }
  .week-actions { align-items: flex-end; flex-direction: column; }
  .view-heading h1 { font-size: 32px; }
  .day-status { grid-template-columns: repeat(3, 1fr); }
  .progress-card { grid-column: 1 / -1; border-right: 0; border-bottom: 1px solid var(--line); }
  .mini-stat { padding: 15px; }
  .task-card { grid-template-columns: 66px 9px minmax(0,1fr) auto; gap: 10px; padding: 15px 13px; }
  .task-main b { white-space: normal; }
  .week-grid { grid-template-columns: 1fr; }
  .week-day:last-child { grid-column: auto; }
  .toolbar { grid-template-columns: 1fr 1fr; }
  .search { grid-column: 1 / -1; }
  .sop-overview { grid-template-columns: repeat(2, 1fr); }
  .sop-stat:nth-child(2) { border-right: 0; }
  .sop-stat:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .sop-row { grid-template-columns: 34px minmax(0,1fr) 20px; gap: 10px; padding: 14px 12px; }
  .sop-row .pill, .sop-row .priority { grid-column: 2; }
  .sop-row .chevron { grid-column: 3; grid-row: 1 / 4; }
  .role-guide { grid-template-columns: repeat(2, 1fr); }
  .role-guide span:nth-child(2) { border-right: 0; }
  .role-guide span:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .team-card { grid-template-columns: 38px minmax(0,1fr) auto; }
  .team-groups { grid-column: 2 / -1; justify-content: flex-start; }
  .sheet { width: 100%; height: min(92svh, 900px); margin-top: auto; }
  .sheet-frame { border-radius: 18px 18px 0 0; box-shadow: 0 -20px 60px rgba(14,49,37,.18); }
  .sheet-head, .sheet-body { padding-right: 20px; padding-left: 20px; }
  .sheet-actions { padding-right: 20px; padding-left: 20px; }
  .definition-grid { grid-template-columns: 1fr; }
  .definition.wide { grid-column: auto; }
  .editor-modal { width: 100%; height: 100svh; border-radius: 0; }
  .editor-head, .editor-body, .editor-actions { padding-right: 18px; padding-left: 18px; }
  .editor-save-note { display: none; }
  .sop-document { padding: 30px 22px 46px; }
  .document-title { font-size: 27px; }
  .document-columns { grid-template-columns: 1fr; gap: 0; }
  .schedule-grid { grid-template-columns: 1fr; }
  .schedule-grid .full, .schedule-section { grid-column: auto; }
}

@media (max-width: 460px) {
  .access-card { padding: 28px 22px; }
  .access-copy h1 { font-size: 34px; }
  .nav-icon { display: none; }
  .day-status { grid-template-columns: 1fr 1fr; }
  .mini-stat:nth-of-type(3) { border-right: 0; }
  .mini-stat:last-child { grid-column: 1 / -1; border-top: 1px solid var(--line); }
  .task-card { grid-template-columns: 56px 7px minmax(0, 1fr); }
  .task-status { grid-column: 3; }
  .toolbar { grid-template-columns: 1fr; }
  .search { grid-column: auto; }
  .view-heading .button.primary { padding: 0 11px; }
  .view-heading { gap: 12px; }
  .week-actions { gap: 7px; }
  .editor-actions { flex-wrap: wrap; }
  .editor-actions .button { flex: 1; }
  .form-grid { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
}

.definition p { white-space: pre-line; }

:root { color-scheme: light; }
.google-login { display: grid; gap: 10px; margin: 24px 0 18px; }
.google-login[hidden] { display: none; }
.google-login a { text-align: center; text-decoration: none; }
.google-login p { margin: 0; font-size: 13px; }
#passwordLogin summary, .shortcut-help summary { cursor: pointer; font-size: 14px; }
#passwordLogin .access-form { margin-top: 16px; }
.shortcut-help { margin-top: 24px; }
.shortcut-help p { font-size: 13px; line-height: 1.5; }

/* Plain SOP pages */
.sop-row { grid-template-columns: minmax(0, 1fr) auto 16px; padding: 20px 22px; }
.sop-row .sop-name b { font-size: 16px; }
#sopSheet { width: min(1080px, 96vw); height: min(940px, 94svh); max-width: none; margin: auto; border-radius: 16px; }
#sopSheet .sheet-head h2 { font-size: 30px; }
#sopSheet .sheet-body { padding: 28px; }
.simple-sop { display: grid; gap: 32px; }
.simple-sop.has-video { grid-template-columns: minmax(0, 1.15fr) minmax(280px, 1fr); }
.sop-instructions p { font-size: 17px; line-height: 1.65; white-space: pre-wrap; margin: 0 0 20px; color: var(--ink, #20322b); }
.sop-videos { position: sticky; top: 0; align-self: start; }
.sop-video iframe { border: 0; border-radius: 10px; width: 100%; aspect-ratio: 9 / 12; background: #e9eee8; }
.sop-video video { display: block; width: 100%; max-height: 70svh; border-radius: 10px; background: #153e30; }
.sop-video a { display: inline-block; margin: 10px 0 22px; font-size: 14px; }
.simple-editor { max-width: 780px; margin: auto; }
.simple-editor > label { display: block; font-size: 15px; font-weight: 600; margin: 22px 0 8px; }
.simple-editor label span { font-weight: 400; opacity: .65; }
.simple-editor input, .simple-editor textarea { width: 100%; font-family: inherit; font-size: 17px; padding: 14px; line-height: 1.6; }
#editSopDocument { min-height: 380px; resize: vertical; }
#editSopVideos { min-height: 86px; resize: vertical; font-size: 14px; }
.video-help { font-size: 13px; line-height: 1.5; color: #53645a; }
.sop-uploaded-video { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; }
.sop-uploaded-video span { overflow-wrap: anywhere; }
.sop-video-links { margin-top: 18px; }
.sop-video-links summary { cursor: pointer; font-size: 14px; }
.sop-video-links label { display: block; margin: 12px 0 6px; }
#editSopVideoFile { font-size: 14px; padding: 10px 0; }
.sop-history { margin-top: 24px; font-size: 13px; }
.sop-history summary { cursor: pointer; }
.sop-history p { margin: 12px 0; }
@media (max-width: 700px) {
  #sopSheet { width: 100vw; height: 100svh; border-radius: 0; }
  #sopSheet .sheet-body { padding: 22px; }
  .simple-sop.has-video { grid-template-columns: 1fr; gap: 20px; }
  .sop-videos { position: static; grid-row: 1; }
  .sop-video iframe { max-height: 300px; }
  .sop-row { padding: 18px 14px; gap: 10px; }
  .sop-row .sop-name b { font-size: 15px; }
  #sopEditorDialog .editor-actions { flex-wrap: wrap; }
}

.sop-start { margin: 0 0 24px; font-size: 15px; line-height: 1.65; max-width: 700px; }
.sop-start summary { cursor: pointer; font-weight: 600; }
.sop-start li { margin-bottom: 8px; }

/* Clear daily work, shared ownership, and automatic updates. */
.button { min-height: 44px; font-size: 14px; }
.nav-button { font-size: 15px; }
.start-here { max-width: 780px; margin: -8px 0 24px; font-size: 17px; line-height: 1.65; color: #40564b; }
.day-status { display: block; box-shadow: none; }
.simple-day-count { padding: 20px; font-size: 18px; color: var(--forest); }
.simple-day-count b { font-size: 24px; }
.simple-day-count span { margin: 0 14px; color: #89988f; }
.task-card { grid-template-columns: 10px minmax(0, 1fr) auto; min-height: 82px; }
.task-main b { white-space: normal; font-size: 17px; line-height: 1.5; }
.task-main small { font-size: 14px; color: #59695f; }
.task-status, .pill { font-size: 13px; }
.section-heading p, .attention, .empty-card { font-size: 15px; }
.task-group-label { font-weight: 600; font-size: 15px; margin: 18px 0 5px; }
.finished-work { margin-top: 20px; }
.finished-work summary, .blank-guides > summary { font-size: 15px; cursor: pointer; padding: 12px 0; color: var(--forest); }
.finished-work .task-list { margin-top: 10px; }
.week-task { padding: 16px 10px; }
.week-task b, .week-day-head b { font-size: 14px; line-height: 1.5; }
.week-task small, .week-day-head span { font-size: 12px; color: #586b60; }
.week-day.is-today .week-day-head span { color: #fff; }
.task-owner-line { display: flex; gap: 12px; align-items: center; font-size: 16px; }
.task-owner-line .task-status { font-size: 14px; }
.detail-section h3 { font-size: 18px; }
.source-link-card b, .proof-item b, .activity-item b { font-size: 16px; line-height: 1.5; }
.source-link-card span, .proof-item span, .activity-item span { font-size: 13px; line-height: 1.5; color: #59695f; }
.proof-item b { font-weight: 500; white-space: pre-wrap; }
.check-label { font-size: 16px; line-height: 1.5; }
.check-row { min-height: 48px; }
.empty-help, .required-note { font-size: 15px; line-height: 1.6; color: #53645a; }
.required-note, .problem-note { padding: 14px 16px; background: #fff4df; border-radius: 10px; }
.problem-note { font-size: 16px; line-height: 1.5; white-space: pre-wrap; }
.problem-note p { margin-bottom: 0; }
.proof-form label, .need-help-form label, .inline-edit label { display: block; margin: 12px 0 8px; font-size: 15px; }
.proof-form textarea, .need-help-form textarea { font-size: 16px; }
.proof-form .file-input span { font-size: 14px; }
.task-history, .need-help-form { margin: 22px 0; }
.task-history summary, .need-help-form summary, .inline-edit summary { cursor: pointer; font-size: 15px; color: var(--forest); }
.need-help-form .button { margin: 10px 8px 0 0; }
.activity-item p { font-size: 14px; line-height: 1.5; }
.auto-update { margin-top: 38px; padding: 24px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.update-heading { display: flex; align-items: start; justify-content: space-between; gap: 20px; }
.update-heading h2 { margin: 0; color: var(--forest); font-size: 22px; }
.update-heading p { max-width: 660px; margin: 8px 0 0; font-size: 15px; line-height: 1.6; color: #53645a; }
.update-counts { font-size: 16px; line-height: 1.6; }
.update-section { border-top: 1px solid var(--line); padding: 14px 0; }
.update-section summary { font-size: 16px; font-weight: 600; cursor: pointer; }
.update-task { display: block; text-align: left; width: 100%; padding: 12px 0; background: none; border: 0; color: var(--ink); }
.update-task b { display: block; font-size: 16px; font-weight: 500; line-height: 1.5; white-space: pre-wrap; }
.update-task span { display: block; font-size: 14px; line-height: 1.6; color: #53645a; }
.simple-task-editor label > span, .simple-task-editor summary { font-size: 15px; }
.simple-task-editor input, .simple-task-editor select, .simple-task-editor textarea { font-size: 16px; }
.simple-task-editor summary { cursor: pointer; color: var(--forest); margin-bottom: 12px; }
.simple-task-editor .sop-picker { max-height: 230px; }
.sop-pick span { font-size: 15px; }
.task-extra > label { display: block; margin-top: 18px; }
.task-extra > label > span { display: block; margin-bottom: 7px; }
.task-extra .check-option { display: flex; align-items: center; }
.form-error { font-size: 14px; line-height: 1.5; }
.blank-guides { margin-top: 22px; }
.role-guide, .team-copy b { font-size: 15px; }
.team-copy small, .team-groups span, .team-role-select { font-size: 13px; }
@media (max-width: 900px) { .week-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) {
  .main-nav-inner { gap: 16px; }
  .nav-icon { display: none; }
  .nav-button { font-size: 14px; }
  .workspace { padding-top: 28px; }
  .view-heading { gap: 12px; align-items: start; flex-wrap: wrap; }
  .week-actions { gap: 8px; flex-wrap: wrap; }
  .week-grid { grid-template-columns: 1fr; }
  .week-task b { font-size: 16px; }
  .task-card { grid-template-columns: 8px minmax(0,1fr) auto; padding: 16px 12px; gap: 10px; }
  .task-main b { font-size: 16px; }
  .task-status { grid-column: 3; font-size: 12px; white-space: normal; text-align: center; max-width: 70px; }
  .auto-update { padding: 18px; }
  .update-heading { display: block; }
  .update-heading .button { margin-top: 14px; }
  .simple-day-count { font-size: 16px; }
  .simple-day-count span { margin: 0 8px; }
  .sop-row { grid-template-columns: minmax(0,1fr) auto; }
  .sop-row .chevron { display: none; }
  .sop-row .pill { max-width: 100px; white-space: normal; }
  .sheet-actions { flex-wrap: wrap; }
}
#todayView #todayEyebrow { display: none; }
#todayView .view-heading { margin-bottom: 18px; }
#todayView .view-heading h1 { font-size: 32px; }
#todayView .view-heading > div > p:last-child { margin-top: 8px; }
#todayView .start-here { margin-bottom: 18px; font-size: 16px; }
#todayView .section-heading { margin-top: 24px; }
#todayView .simple-day-count { padding: 16px 20px; }
.workspace { padding-top: 28px; }

.saved-guide-text { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; line-height: 1.6; }
