:root{color-scheme:light;--green:#143d2b;--green-2:#24583b;--mint:#e3eddc;--paper:#f7f6ee;--surface:#fffefa;--ink:#172c20;--muted:#4c6053;--line:#d7ded2;--alert:#78351e;--gold:#f6ead2;--action:#f6d351;--action-hover:#efc639;--radius:10px;font-family:Inter,system-ui,sans-serif}
*{box-sizing:border-box}
body{margin:0;background:var(--paper);color:var(--ink);line-height:1.5;min-height:100dvh}
[hidden]{display:none!important}
a{color:var(--green-2)}
button,input,select,textarea{font:inherit}
a:focus-visible,button:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible,summary:focus-visible{outline:3px solid #357350;outline-offset:3px}
.mast{background:var(--green);color:white;display:flex;justify-content:space-between;align-items:center;min-height:64px;padding:10px clamp(16px,4vw,42px);gap:12px;border-bottom:4px solid #a8b474}
.mast a{color:white}
.brand{font-size:1.32rem;font-weight:800;text-decoration:none;white-space:nowrap;letter-spacing:-.03em}
.brand span{font-weight:650;color:#e7ecd8}
#account{font-size:.91rem;text-align:right}
#layout{max-width:1500px;margin:auto}
main{max-width:1250px;margin:0 auto;padding:24px 16px 104px;min-width:0}
nav{z-index:2;background:var(--surface);display:flex;justify-content:space-around;position:fixed;inset:auto 0 0;border-top:1px solid var(--line);padding:6px 3px calc(6px + env(safe-area-inset-bottom))}
nav a{color:var(--muted);display:grid;align-items:center;justify-items:center;gap:1px;font-size:.74rem;text-align:center;text-decoration:none;padding:6px 5px;border-radius:9px;min-width:58px}
nav a[aria-current]{background:var(--mint);color:var(--green);font-weight:750}
nav .navmark{font-weight:750;font-size:1rem;line-height:1;white-space:nowrap}
nav .desktop{display:none}
h1,h2,h3,p{margin-top:0}
h1{font-size:clamp(1.75rem,4vw,2.6rem);line-height:1.1;letter-spacing:-.045em;margin-bottom:8px}
h2{font-size:1.17rem;letter-spacing:-.015em;margin-bottom:10px}
h3{font-size:1rem;margin-bottom:5px}
p{margin-bottom:12px}
small,.muted{color:var(--muted)}
.wrap{display:flex;flex-wrap:wrap;gap:10px;align-items:center}
.split{display:flex;flex-wrap:wrap;justify-content:space-between;align-items:flex-start;gap:10px}
.section{margin:22px 0}
.surface,.card{background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);padding:16px;margin:0 0 12px}
.cardlink{display:block;color:inherit;text-decoration:none}
.cardlink:hover{border-color:var(--green-2)}
.cardlink h3{font-size:1.06rem}
.card p:last-child,.surface p:last-child{margin-bottom:0}
.grid{display:grid;gap:12px;grid-template-columns:repeat(auto-fit,minmax(min(100%,235px),1fr))}
.stats{display:grid;gap:10px;grid-template-columns:repeat(2,minmax(0,1fr))}
.metric{font-size:1.7rem;display:block;font-weight:800;line-height:1.05;margin:6px 0}
.pill{display:inline-block;border-radius:999px;padding:3px 9px;background:var(--mint);color:var(--green);font-weight:720;font-size:.77rem;white-space:nowrap}
.pill.blocked,.pill.urgent,.warning{background:var(--gold);color:var(--alert)}
.pill.deferred{background:#e8edf5;color:#334d72}
.pill.cancelled{background:#edf0ed;color:var(--muted)}
.actions{display:flex;flex-wrap:wrap;gap:8px;margin:12px 0}
.button,button{display:inline-flex;justify-content:center;align-items:center;min-height:44px;padding:8px 14px;border-radius:7px;background:var(--action);color:var(--ink);border:1px solid transparent;text-decoration:none;font-weight:700;cursor:pointer}
.button:not(.secondary):hover,button:not(.secondary):hover{background:var(--action-hover)}
.button.secondary,button.secondary{background:white;color:var(--green);border-color:var(--line)}
button[aria-pressed=true],.button.active{background:var(--mint);color:var(--green);border-color:#a0ae89}
button:disabled{opacity:.6;cursor:wait}
label{display:grid;gap:4px;font-size:.88rem;font-weight:670;margin:0 0 9px;min-width:0}
input,select,textarea{width:100%;min-height:44px;padding:8px 9px;border:1px solid #aebdb1;border-radius:7px;background:white;color:var(--ink);font-size:1rem;min-width:0}
textarea{min-height:88px;resize:vertical}
fieldset{min-width:0;border:1px solid var(--line);border-radius:10px;margin:12px 0;padding:10px}
legend{font-weight:750;padding:0 6px;color:var(--green)}
.repeat-fields{background:#f7f8ef;padding:12px 14px}
.repeat-fields fieldset{background:var(--surface)}
.repeat-fields #repeat-options{margin-top:12px}
.weekdays{display:flex;flex-wrap:wrap;column-gap:15px;row-gap:3px}
.weekdays .check{margin-bottom:0}
.check{display:flex;align-items:center;gap:9px;min-height:37px}
.check input{width:20px;min-height:20px;height:20px;accent-color:var(--green-2)}
summary{cursor:pointer;font-weight:750;padding:6px 0}
dl{display:grid;gap:7px;grid-template-columns:minmax(82px,auto) 1fr;margin:8px 0}
dt{font-weight:720} dd{margin:0;overflow-wrap:anywhere}
pre,.multiline{white-space:pre-wrap;overflow-wrap:anywhere}
.notice{padding:9px 12px;border-radius:9px;margin:8px 0;background:var(--mint);overflow-wrap:anywhere}
.notice.warning{background:var(--gold)}
#alerts:not(:empty){position:fixed;z-index:3;bottom:82px;left:12px;right:12px;width:fit-content;max-width:calc(100% - 24px);padding:10px 14px;border-radius:10px;background:var(--green);color:white;box-shadow:0 3px 20px #0003}
.narrow{max-width:600px;margin:22px auto}
.tablewrap{overflow:auto}
table{border-collapse:collapse;width:100%;font-size:.92rem}
th,td{text-align:left;padding:9px;border-bottom:1px solid var(--line);vertical-align:top}
code{overflow-wrap:anywhere;user-select:all}
@media(min-width:900px){
  #layout{display:grid;grid-template-columns:205px minmax(0,1fr)}
  #layout:has(nav[hidden]){display:block}
  nav{position:sticky;top:0;align-self:start;display:grid;justify-content:stretch;gap:6px;padding:20px 12px;border:0;background:transparent}
  nav a,nav a.desktop{display:flex;justify-content:start;text-align:left;gap:9px;font-size:.95rem;padding:10px 12px}
  nav .navmark{min-width:18px;text-align:center}
  nav .mobile{display:none}
  main{padding:33px 26px 60px;width:100%}
  .stats{grid-template-columns:repeat(4,minmax(0,1fr))}
  #alerts:not(:empty){left:auto;bottom:18px;right:24px}
}

.my-filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 155px), 1fr));
  gap: 6px 12px;
  max-width: 520px;
}
.ranger-checklist {
  max-height: 18rem;
  overflow-y: auto;
  padding: 0 4px;
}

.annual-filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 11rem), 1fr));
  align-items: end;
  gap: 0.7rem;
}
.annual-filters label { margin-bottom: 0; }
.annual-year-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr));
  gap: 0.75rem;
}
.annual-month {
  display: grid;
  justify-items: start;
  text-align: left;
  gap: 0.3rem;
  padding: 0.8rem 1rem;
}
.calendar-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; margin-bottom: 0.4rem; }
.calendar-toolbar .plan-legend { margin: 0; }
.calendar-expand { min-width: 44px; line-height: 1; font-size: 1.35rem; }
.calendar-alert { display: none; }
#main.calendar-expanded {
  position: fixed;
  inset: 0;
  z-index: 10;
  width: 100%;
  height: 100%;
  max-width: none;
  margin: 0;
  padding: clamp(0.5rem, 1.6vw, 1rem);
  background: var(--paper);
  overflow: hidden;
}
body:has(#main.calendar-expanded) { overflow: hidden; }
body:has(#main.calendar-expanded) :is(.mast, #nav) { visibility: hidden; }
#main.calendar-expanded > :not(.annual-calendar) { display: none; }
.calendar-expanded .annual-calendar { display: flex; flex-direction: column; height: 100%; }
.calendar-expanded .calendar-scroll { display: block; flex: 1; min-height: 0; max-height: none; }
.calendar-expanded .calendar-alert:not(:empty) {
  display: block;
  position: absolute;
  z-index: 4;
  bottom: 1.5rem;
  right: 1.5rem;
  max-width: calc(100% - 3rem);
  padding: 0.55rem 0.8rem;
  border-radius: 0.5rem;
  background: var(--green);
  color: white;
}
.calendar-scroll {
  max-width: 100%;
  min-height: clamp(20rem, 42vh, 32rem);
  max-height: max(20rem, 67vh);
  min-height: clamp(20rem, 42dvh, 32rem);
  max-height: max(20rem, 67dvh);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 0.65rem;
  background: var(--surface);
}
.annual-grid {
  width: max-content;
  min-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
}
.annual-grid .portfolio-col { width: 9.5rem; }
.annual-grid .date-col { width: 4.5rem; }
.annual-grid th, .annual-grid td {
  padding: 0.22rem;
  border-inline-end: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.annual-grid th { background: var(--surface); }
.annual-grid thead { position: sticky; top: 0; z-index: 2; background: var(--mint); }
.annual-grid tbody td { height: clamp(2.4rem, 5vh, 3.15rem); }
.annual-grid thead th { white-space: nowrap; background: var(--mint); }
.annual-grid thead th:first-child:not([data-plan-day]), .annual-grid tbody th {
  position: sticky;
  left: 0;
  z-index: 1;
  width: 9.5rem;
  min-width: 9.5rem;
  max-width: 9.5rem;
  overflow-wrap: anywhere;
  padding: 0.45rem;
}
.annual-grid th[data-plan-day] { min-width: 4.5rem; }
.annual-grid .calendar-quarter, .annual-grid .quarter-start { border-inline-start: 2px solid var(--green-2); }
.annual-grid tbody .calendar-add a {
  display: grid;
  place-items: center;
  min-height: 1.7rem;
  text-decoration: none;
}
.calendar-add a:hover, .calendar-add a:focus-visible { background: var(--mint); }
.plan-bar {
  display: flex;
  align-items: stretch;
  min-width: 0;
  background: var(--mint);
  border: 1px solid var(--line);
  border-radius: 0.35rem;
}
/* Quarter allocation is separate from both the calendar date and work status. */
.plan-legend { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0.75rem 0; }
.plan-status, .plan-bar-label { font-size: 0.8rem; font-weight: 650; }
.plan-status { display: inline-block; border: 1px solid var(--plan-edge); border-radius: 0.35rem; padding: 0.1rem 0.4rem; }
.plan-status.draft, .plan-bar.draft { --plan-fill: #fff0cc; --plan-ink: #5c3700; --plan-edge: #a87322; }
.plan-status.allocated, .plan-bar.allocated { --plan-fill: #dcead5; --plan-ink: #214529; --plan-edge: #5f8058; }
.plan-status.completed, .plan-bar.completed { --plan-fill: #dcebf9; --plan-ink: #183d63; --plan-edge: #567fa7; }
.plan-status, .plan-bar { background: var(--plan-fill); color: var(--plan-ink); border-color: var(--plan-edge); }
.plan-bar a { color: var(--plan-ink); }
.plan-grip { background: var(--plan-edge); }
.document-list { overflow-wrap: anywhere; }
.plan-bar a {
  flex: 1;
  min-width: 0;
  padding: 0.28rem 0.35rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.plan-bar a[draggable="true"] { cursor: grab; }
.plan-grip {
  width: 0.65rem;
  flex: none;
  cursor: ew-resize;
  opacity: 0.55;
}
.plan-grip:hover { opacity: 1; }
.annual-day-list { display: none; }
@media (max-width: 720px), (pointer: coarse) {
  .annual-calendar { display: none; }
  .annual-day-list { display: block; }
}
