/* App chrome — shell, sidebar, search, filters, tracker.
   Page content styling lives in pages.css. Both use the same Ecosa tokens. */

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

.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 1rem;
  padding: 0.7rem 1.5rem;
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
}
.brand { font-weight: 700; font-size: 0.95rem; letter-spacing: 0.01em; text-decoration: none; color: inherit; white-space: nowrap; }
.topbar form { flex: 1; max-width: 26rem; margin: 0; }
.topbar input[type="search"] {
  width: 100%; font: inherit; font-size: 0.92rem; font-weight: 400;
  padding: 0.4rem 0.7rem; color: var(--ink);
  background: var(--paper); border: 1px solid var(--rule); border-radius: 6px;
}
.topbar input[type="search"]:focus { outline: none; border-color: var(--ink); }
.toplinks { display: flex; gap: 0.3rem; margin-left: auto; }
.toplinks a {
  font-size: 0.9rem; font-weight: 500; text-decoration: none; color: inherit;
  padding: 0.35rem 0.7rem; border-radius: 6px; white-space: nowrap;
}
.toplinks a:hover { background: var(--card); }
.toplinks a.on { background: var(--ink); color: var(--paper); }

.pager a[aria-disabled="true"] { opacity: 0.3; pointer-events: none; }

/* filters ------------------------------------------------------------- */
.filters { display: flex; flex-direction: column; gap: 0.45rem; align-items: flex-start; margin: 0 0 1.4rem; }
.filters .fgroup { display: flex; flex-wrap: wrap; gap: 0.3rem; align-items: center; }
.filters .flabel { font-size: 0.66rem; font-weight: 700; letter-spacing: 0.09em; text-transform: uppercase; color: var(--slate); margin-right: 0.15rem; }
.chip {
  font: inherit; font-size: 0.86rem; font-weight: 500;
  padding: 0.26rem 0.65rem; border-radius: 999px; cursor: pointer;
  background: var(--paper); color: var(--ink);
  border: 1px solid var(--rule);
}
.chip:hover { border-color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }

/* angle cards --------------------------------------------------------- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: 0.8rem; }
.card {
  display: block; text-decoration: none; color: inherit;
  background: var(--card); border-radius: 10px; padding: 0.9rem 1rem;
}
.card:hover { outline: 2px solid var(--ink); }
.card h3 { font-size: 1rem; font-weight: 700; margin: 0.35rem 0 0.3rem; }
.card .meta { display: block; font-size: 0.8rem; font-weight: 400; color: var(--slate); }
.card .tags { display: flex; flex-wrap: wrap; gap: 0.25rem; margin-top: 0.5rem; }
.tag {
  font-size: 0.68rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  padding: 0.12rem 0.45rem; border-radius: 3px; background: var(--sky); color: #0F3192;
}
.tag.t1 { background: var(--yellow); }
.tag.t0 { background: #FA8171; color: #4A1B0C; }
.tag.plain { background: transparent; color: var(--slate); border: 1px solid var(--rule); }
.empty { color: var(--slate); font-weight: 400; }

/* allocation ---------------------------------------------------------- */
.alloc { background: var(--card); border-radius: 10px; padding: 0.9rem 1.1rem; margin: 0 0 1.6rem; }
.alloc-row { display: flex; flex-wrap: wrap; gap: 0.7rem; align-items: end; }
.field { display: flex; flex-direction: column; gap: 0.25rem; min-width: 0; }
.field label {
  font-size: 0.66rem; font-weight: 700; letter-spacing: 0.09em;
  text-transform: uppercase; color: var(--slate); line-height: 1.1;
}
/* every control the same height, so the row lines up on one baseline */
.field select, .field input {
  font: inherit; font-size: 0.9rem; font-weight: 400; line-height: 1.2;
  height: 2.2rem; padding: 0 0.55rem; margin: 0;
  color: var(--ink); background: var(--paper);
  border: 1px solid var(--rule); border-radius: 6px;
  -webkit-appearance: none; appearance: none;
}
.field select {
  padding-right: 1.7rem;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%),
                    linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 0.95rem) 50%, calc(100% - 0.62rem) 50%;
  background-size: 0.34rem 0.34rem, 0.34rem 0.34rem;
  background-repeat: no-repeat;
}
.field input[type="date"] { padding-right: 0.35rem; }
.field input[type="date"]::-webkit-calendar-picker-indicator { margin: 0; opacity: 0.55; }
.field.grow { flex: 1 1 14rem; }
.field.grow input { width: 100%; }
.saved { font-size: 0.82rem; font-weight: 400; color: var(--slate); margin: 0.55rem 0 0; }

/* tracker board ------------------------------------------------------- */
.board { display: grid; grid-template-columns: repeat(6, minmax(9.5rem, 1fr)); gap: 0.7rem; align-items: start; }
@media (max-width: 68rem) { .board { grid-template-columns: repeat(3, minmax(9rem, 1fr)); } }
@media (max-width: 40rem) { .board { grid-template-columns: 1fr; } }
.col { background: var(--card); border-radius: 10px; padding: 0.6rem; min-height: 5rem; }
.col > h3 { font-size: 0.68rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--slate); margin: 0.1rem 0 0.55rem; }
.col .count { color: var(--ink); opacity: 0.55; }
.tcard { display: block; background: var(--paper); border-radius: 7px; padding: 0.5rem 0.6rem; margin-bottom: 0.45rem; text-decoration: none; color: inherit; }
.tcard:hover { outline: 2px solid var(--ink); }
.tcard .n { display: block; font-size: 0.88rem; font-weight: 700; line-height: 1.3; }
.tcard .o { display: block; font-size: 0.76rem; font-weight: 400; color: var(--slate); margin-top: 0.2rem; }

/* search -------------------------------------------------------------- */
.result { margin: 0 0 1.5rem; }
.result h3 { font-size: 1rem; font-weight: 700; margin: 0 0 0.15rem; }
.result h3 a { text-decoration: none; }
.result .where { font-size: 0.78rem; font-weight: 400; color: var(--slate); }
.snip { font-size: 0.9rem; font-weight: 400; margin: 0.45rem 0 0; padding-left: 0.8rem; border-left: 3px solid var(--sky); }
.snip mark { background: var(--yellow); color: #0F3192; }

/* ---- app v2: auth, nav at scale, editing, flags ---------------------- */
.pip { display: inline-block; min-width: 1.15rem; padding: 0 0.25rem; border-radius: 999px;
  background: var(--yellow); color: #0F3192; font-size: 0.72rem; font-weight: 700; text-align: center; }
.toplinks a.on .pip { background: var(--paper); }
.who { font-size: 0.82rem; font-weight: 400; color: var(--slate); padding: 0.35rem 0.5rem; white-space: nowrap; }

.flash { background: var(--card); border-left: 3px solid var(--yellow); border-radius: 0;
  padding: 0.6rem 0.9rem; font-weight: 400; margin: 0 0 1.2rem; }
.err { background: var(--card); border-left: 3px solid #FA8171; border-radius: 0;
  padding: 0.6rem 0.9rem; font-weight: 400; margin: 0 0 1rem; }
.small { font-size: 0.85rem; font-weight: 400; }
.hint { font-size: 0.82rem; font-weight: 400; color: var(--slate); }

/* nav at scale */
#navfilter { width: 100%; font: inherit; font-size: 0.86rem; font-weight: 400; margin-bottom: 0.6rem;
  padding: 0.32rem 0.5rem; color: var(--ink); background: var(--paper);
  border: 1px solid var(--rule); border-radius: 6px; }
.navhead { display: flex; align-items: baseline; justify-content: space-between; }
.navadd { font-size: 1rem; font-weight: 700; text-decoration: none; padding: 0 0.35rem; border-radius: 5px; }
nav details.prod > summary { list-style: none; cursor: pointer; display: flex; align-items: baseline;
  justify-content: space-between; gap: 0.4rem; padding: 0.3rem 0.5rem; border-radius: 5px; }
nav details.prod > summary::-webkit-details-marker { display: none; }
nav details.prod > summary:hover { background: rgba(15,49,146,0.08); }
@media (prefers-color-scheme: dark) { nav details.prod > summary:hover { background: rgba(255,255,255,0.1); } }
.pname { font-size: 0.85rem; font-weight: 700; }
.pmk { font-size: 0.62rem; font-weight: 700; letter-spacing: 0.07em; color: var(--slate);
  margin-left: 0.4rem; padding: 0.03rem 0.3rem; border: 1px solid var(--rule); border-radius: 3px; }
nav a.active .pmk { color: inherit; border-color: currentColor; opacity: 0.8; }
nav a.active { background: var(--ink); color: var(--paper); font-weight: 700; }
.navempty { font-size: 0.85rem; font-weight: 400; color: var(--slate); padding: 0.3rem 0.5rem; }

/* login */
.loginwrap { max-width: 22rem; margin: 12vh auto; padding: 0 1.5rem; }
.loginform { display: flex; flex-direction: column; gap: 0.7rem; margin: 1.2rem 0 0.8rem; }
.loginform .field { width: 100%; }
.loginform input { width: 100%; }
.primary { font: inherit; font-size: 0.95rem; font-weight: 700; cursor: pointer;
  padding: 0.5rem 1.1rem; border-radius: 6px; border: none;
  background: var(--ink); color: var(--paper); }
.stack { display: flex; flex-direction: column; gap: 0.8rem; align-items: flex-start; max-width: 34rem; }
.stack .field.grow { width: 100%; }
.mkrow { display: flex; gap: 0.6rem; }
.mkbox { font-size: 0.85rem; font-weight: 400; white-space: nowrap; }

/* editing */
.actionbar { display: flex; flex-wrap: wrap; gap: 0.35rem; align-items: center; margin: 0 0 1.2rem;
  padding-bottom: 0.7rem; border-bottom: 1px solid var(--rule); }
.actionbar .sep { width: 1px; height: 1.2rem; background: var(--rule); margin: 0 0.3rem; }
#body.editing { outline: 2px solid var(--yellow); outline-offset: 0.6rem; border-radius: 4px; }

/* flags */
.flaglist { list-style: none; padding: 0; margin: 0.5rem 0 1.5rem; }
.flaglist li { padding: 0.6rem 0.9rem; margin-bottom: 0.45rem; border-radius: 8px; background: var(--card); }
.flaglist li.resolved { opacity: 0.6; }
.flaglist .q { display: block; font-weight: 400; }
.flaglist .fnote { display: block; font-weight: 700; margin-top: 0.2rem; }
.flaglist .fmeta { display: block; font-size: 0.78rem; font-weight: 400; color: var(--slate); margin-top: 0.25rem; }
.factions { display: flex; flex-wrap: wrap; gap: 0.3rem; margin-top: 0.5rem; }
.flaglist.muted li { background: transparent; border: 1px solid var(--rule); }

/* angle rows + cards */
tr.rejected td { opacity: 0.45; text-decoration: line-through; }
.card.rejected { opacity: 0.5; }
.card.add { background: transparent; border: 1px dashed var(--rule); }
td .mkbox { margin-right: 0.4rem; }
td select { font: inherit; font-size: 0.85rem; font-weight: 400; padding: 0.2rem 0.35rem;
  color: var(--ink); background: var(--paper); border: 1px solid var(--rule); border-radius: 5px; }
.chip[disabled] { opacity: 0.4; cursor: default; }

/* password show/hide ---------------------------------------------------- */
.pwwrap { position: relative; display: block; width: 100%; }
.pwwrap input { width: 100%; padding-right: 3.4rem; }
.pwtoggle {
  position: absolute; right: 0.3rem; top: 50%; transform: translateY(-50%);
  font: inherit; font-size: 0.76rem; font-weight: 700; letter-spacing: 0.04em;
  text-transform: uppercase; cursor: pointer;
  padding: 0.2rem 0.45rem; border-radius: 4px;
  border: none; background: transparent; color: var(--slate);
}
.pwtoggle:hover { background: var(--card); color: var(--ink); }
.pwtoggle:focus-visible { outline: 2px solid var(--ink); outline-offset: 1px; }

/* the ask / flag box ---------------------------------------------------- */
.hint.warn { color: #C0392B; }
@media (prefers-color-scheme: dark) { .hint.warn { color: #FA8171; } }

.askbox {
  background: var(--card); border-radius: 10px;
  padding: 1rem 1.2rem; margin: 0 0 1.4rem;
}
.asklabel {
  display: block; font-size: 0.66rem; font-weight: 700; letter-spacing: 0.09em;
  text-transform: uppercase; color: var(--slate); margin: 0 0 0.4rem;
}
.askquote {
  margin: 0 0 0.9rem; padding: 0.5rem 0.8rem; font-weight: 400;
  background: var(--paper); border-left: 3px solid var(--yellow); border-radius: 0;
  max-height: 6.5rem; overflow-y: auto;
}
.askkinds { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0 0 1rem; }
.askkind {
  flex: 1 1 15rem; display: grid; grid-template-columns: auto 1fr; gap: 0.1rem 0.5rem;
  align-items: start; cursor: pointer;
  background: var(--paper); border: 1px solid var(--rule); border-radius: 8px;
  padding: 0.6rem 0.8rem;
}
.askkind:hover { border-color: var(--ink); }
.askkind:has(input:checked) { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.askkind input { margin: 0.2rem 0 0; accent-color: var(--ink); }
.kname { font-size: 0.93rem; font-weight: 700; }
.khelp { grid-column: 2; font-size: 0.82rem; font-weight: 400; color: var(--slate); }
.askbox textarea {
  width: 100%; font: inherit; font-size: 0.95rem; font-weight: 400; line-height: 1.5;
  padding: 0.5rem 0.65rem; margin: 0 0 0.8rem; resize: vertical;
  color: var(--ink); background: var(--paper);
  border: 1px solid var(--rule); border-radius: 6px;
}
.askbox textarea:focus { outline: none; border-color: var(--ink); }
.askactions { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.askkinds { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 0.8rem; margin: 0 0 1rem; }
.askgroup { display: flex; flex-direction: column; gap: 0.4rem; }
.askgroup .asklabel { margin: 0; }
.askkind { flex: none; }

/* collapsible Contents block -------------------------------------------- */
.tocbtn {
  display: flex; align-items: baseline; justify-content: space-between; gap: 1rem;
  width: 100%; font: inherit; text-align: left; cursor: pointer;
  padding: 0; border: none; background: transparent; color: inherit;
}
.toccount {
  font-size: 0.7rem; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--slate); white-space: nowrap;
}
.tocbtn:hover .toccount { color: var(--ink); }

/* collapsible left navigation ------------------------------------------- */
/* nav is position:sticky in pages.css, which already contains the toggle */
.navtoggle {
  position: absolute; top: 0.5rem; right: 0.5rem;
  font: inherit; font-size: 1rem; line-height: 1; cursor: pointer;
  width: 1.5rem; height: 1.5rem; padding: 0; border-radius: 4px;
  border: none; background: transparent; color: var(--slate);
}
.navtoggle:hover { background: rgba(15,49,146,0.1); color: var(--ink); }
@media (prefers-color-scheme: dark) { .navtoggle:hover { background: rgba(255,255,255,0.14); } }
.navshow {
  position: sticky; top: 4.2rem; float: left;
  font: inherit; font-size: 1rem; line-height: 1; cursor: pointer;
  width: 1.6rem; height: 1.9rem; margin: 0 0.6rem 0 -0.6rem; padding: 0;
  border: 1px solid var(--rule); border-left: none; border-radius: 0 6px 6px 0;
  background: var(--panel); color: var(--ink);
}
.navshow:hover { border-color: var(--ink); }
.shell.navhidden { grid-template-columns: minmax(0, 1fr); }
.shell.navhidden #nav { display: none; }

/* the live tier tables need room */
.angletable { min-width: 72rem; }
.angletable td.small { font-size: 0.82rem; line-height: 1.45; }
.angletable td.acell { min-width: 9rem; }
.angletable .mk { white-space: nowrap; }
.angletable .mkbox { display: block; font-size: 0.78rem; margin: 0 0 0.1rem; }
.angletable td select { min-width: 0; }

/* sign in with Google ---------------------------------------------------- */
.googlebtn {
  display: flex; align-items: center; gap: 0.7rem; width: 100%;
  margin: 1.2rem 0 0.7rem; padding: 0.6rem 0.9rem;
  font-size: 0.95rem; font-weight: 700; text-decoration: none;
  color: var(--ink); background: var(--paper);
  border: 1px solid var(--rule); border-radius: 8px;
}
.googlebtn:hover { border-color: var(--ink); background: var(--card); }
.gmark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 1.5rem; height: 1.5rem; flex: none; border-radius: 50%;
  background: var(--ink); color: var(--paper); font-weight: 700; font-size: 0.85rem;
}

/* accordion marker in the sidebar ---------------------------------------- */
.caret { font-size: 0.7rem; color: var(--slate); transition: transform 0.12s ease;
  display: inline-block; width: 0.8rem; flex: none; }
nav details.prod[open] > summary .caret { transform: rotate(90deg); }
nav details.prod > summary { gap: 0.15rem; }
nav details.prod > summary .pname { flex: 1; }

/* dashboard sort and filter bar ------------------------------------------ */
.toolbar { display: flex; flex-wrap: wrap; gap: 0.5rem 1.2rem; align-items: center;
  margin: 0 0 1rem; }
.toolbar .fgroup { display: flex; flex-wrap: wrap; gap: 0.3rem; align-items: center; }

/* the three controls stack, so the reading columns get the width */
.angletable td.stackcell { min-width: 10.5rem; }
.stack3 { display: flex; flex-direction: column; gap: 0.3rem; }
.stack3 label { font-size: 0.6rem; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--slate); }
.stack3 select { width: 100%; padding-right: 1.5rem; }
.ministate {
  display: block; width: 100%; box-sizing: border-box;
  font: inherit; font-size: 0.85rem; font-weight: 700; line-height: 1.2;
  text-align: center; text-decoration: none; cursor: pointer;
  padding: 0.24rem 0.4rem; border-radius: 5px;
  border: 1px solid #E8D7FF; background: #E8D7FF; color: #0F3192;
}
.ministate:hover { border-color: var(--ink); }
.ministate[disabled] {
  cursor: default; background: transparent; color: var(--slate);
  border-style: dashed; border-color: var(--rule);
}
.ministate.off { border: none; background: transparent; color: var(--slate); cursor: default; }
.angletable td.small { min-width: 8rem; }

/* learning capture in the rework box -------------------------------------- */
.learnbox { margin: 0 0 1rem; padding: 0.75rem 0.9rem; border-radius: 8px;
  background: var(--paper); border: 1px solid var(--rule); }
.learnbox > label { display: flex; align-items: center; gap: 0.5rem; font-weight: 700; }
.learnscopes { display: flex; flex-wrap: wrap; gap: 0.8rem; margin: 0.6rem 0 0 1.6rem; }
.learnscopes label { display: flex; align-items: center; gap: 0.35rem; font-weight: 400; font-size: 0.9rem; }
.learnbox input[type="checkbox"], .learnscopes input { accent-color: var(--ink); }

/* a picked angle is the one we are running with */
tr.angle-row.picked td { background: rgba(255,198,44,0.18); }
tr.angle-row.picked td:first-child { box-shadow: inset 3px 0 0 var(--yellow); }
@media (prefers-color-scheme: dark) { tr.angle-row.picked td { background: rgba(255,198,44,0.13); } }

/* search results ---------------------------------------------------------- */
.results { display: grid; grid-template-columns: repeat(auto-fill, minmax(21rem, 1fr)); gap: 0.8rem; }
.result-card .snip { margin: 0.5rem 0 0; padding-left: 0.7rem; font-size: 0.85rem; }
.result-card .tags { margin-top: 0.45rem; }
.card.picked { box-shadow: inset 3px 0 0 var(--yellow); }
.addlink { font-weight: 700; text-decoration: none; }

/* learning dimensions ----------------------------------------------------- */
.learnscopes { flex-direction: column; align-items: stretch; gap: 0.4rem; margin-left: 1.6rem; }
.learnscopes > .asklabel { margin: 0.2rem 0 0.1rem; }
.learnscope {
  display: grid; grid-template-columns: auto 1fr; gap: 0.05rem 0.5rem; align-items: start;
  padding: 0.4rem 0.6rem; border: 1px solid var(--rule); border-radius: 7px; cursor: pointer;
}
.learnscope:hover { border-color: var(--ink); }
.learnscope:has(input:checked) { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.learnscope input { margin: 0.25rem 0 0; }
.learnscope .kname { font-size: 0.9rem; font-weight: 700; }
.learnscope .khelp { grid-column: 2; font-size: 0.8rem; font-weight: 400; color: var(--slate); }

/* the library sits with the products, and collapses like them */
nav details.lib { margin-top: 0.9rem; }

/* the sidebar keeps its own scrollbar quiet */
nav::-webkit-scrollbar { width: 8px; }
nav::-webkit-scrollbar-thumb { background: rgba(15,49,146,0.18); border-radius: 4px; }
nav::-webkit-scrollbar-track { background: transparent; }
@media (prefers-color-scheme: dark) { nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.22); } }
