/* ==========================================================================
   Wano PM — static mockup
   Design language: Werkstatt (usehallmark.com/themes/werkstatt) — re-written
   from scratch. No Hallmark CSS is copied.
   Brand: Wano — #101C29 / #D73036 / #FEDB67 / #f2efe6
   ========================================================================== */

@font-face {
  font-family: "Jost";
  src: url("assets/fonts/jost.ttf") format("truetype");
  font-weight: 100 900;
  font-style: normal;
  font-display: block;
}
@font-face {
  font-family: "Karla";
  src: url("assets/fonts/karla.ttf") format("truetype");
  font-weight: 200 800;
  font-style: normal;
  font-display: block;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("assets/fonts/jetbrains-mono.ttf") format("truetype");
  font-weight: 100 800;
  font-style: normal;
  font-display: block;
}

:root {
  --ink: #101c29;
  --ink-70: rgba(16, 28, 41, 0.7);
  --ink-55: rgba(16, 28, 41, 0.55);
  --ink-35: rgba(16, 28, 41, 0.35);
  --ink-15: rgba(16, 28, 41, 0.15);
  --ink-08: rgba(16, 28, 41, 0.08);
  --red: #d73036;
  --yellow: #fedb67;
  --paper: #f2efe6;
  --paper-2: #eae6d9;
  --card: #f7f4ec;

  --b: 3px;
  --line: var(--b) solid var(--ink);
  --hair: 1px solid var(--ink-15);

  --f-display: "Jost", "PingFang HK", "PingFang SC", "Hiragino Sans GB", sans-serif;
  --f-body: "Karla", "PingFang HK", "PingFang SC", "Hiragino Sans GB", sans-serif;
  --f-mono: "JetBrains Mono", "SF Mono", Menlo, monospace;

  --wrap: 1440px;
  --gut: 64px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--f-body);
  font-size: 16px;
  line-height: 1.5;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { margin: 0; font-family: var(--f-display); font-weight: 600; letter-spacing: -0.02em; line-height: 0.98; }
p { margin: 0; }
ol, ul, dl, dd, dt { margin: 0; padding: 0; list-style: none; }
figure { margin: 0; }
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
select { font: inherit; color: inherit; }

.mono { font-family: var(--f-mono); font-variant-numeric: tabular-nums; letter-spacing: 0; }
.eyebrow {
  font-family: var(--f-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.16em;
  color: var(--ink-55);
}
.muted { color: var(--ink-55); }
.nw { white-space: nowrap; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 var(--gut);
}

/* ------------------------------------------------------------------ topbar */

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--paper);
  border-bottom: var(--line);
}
.topbar__inner {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 var(--gut);
  height: 76px;
  display: flex;
  align-items: center;
  gap: 28px;
}
.brand { display: flex; align-items: center; gap: 14px; min-width: 0; }
.brand__mark { height: 46px; width: auto; }
.brand__text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.brand__name {
  font-family: var(--f-display);
  font-size: 19px;
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.brand__sub {
  font-family: var(--f-mono);
  font-size: 9px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-55);
  white-space: nowrap;
}

.wsmeta {
  font-family: var(--f-mono);
  font-size: 9px;
  letter-spacing: 0.2em;
  color: var(--ink-55);
  margin-left: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.topnav { display: flex; align-items: stretch; gap: 0; margin-left: 24px; height: 100%; }
.topnav a {
  display: flex;
  align-items: center;
  padding: 0 18px;
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-55);
  border-left: var(--hair);
}
.topnav a:last-child { border-right: var(--hair); }
.topnav a.is-on { color: var(--ink); background: var(--ink-08); box-shadow: inset 0 -3px 0 var(--red); }
.topnav a:hover { color: var(--ink); }

.topbar__right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.agentchip {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 2px solid var(--ink);
  padding: 5px 10px;
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: var(--card);
}
.dot { width: 8px; height: 8px; display: inline-block; background: var(--ink); flex: none; }
.dot--live { background: var(--red); }
.dot--yellow { background: var(--yellow); box-shadow: inset 0 0 0 2px var(--ink); }
.dot--hollow { background: transparent; box-shadow: inset 0 0 0 2px var(--ink); }
.dot--done { background: var(--yellow); }

.avatar {
  width: 34px;
  height: 34px;
  border: 2px solid var(--ink);
  display: grid;
  place-items: center;
  font-family: var(--f-mono);
  font-size: 11px;
  font-weight: 600;
  background: var(--yellow);
  flex: none;
}
.avatar--sm { width: 26px; height: 26px; font-size: 9px; border-width: 2px; }

.menubtn {
  display: none;
  border: 2px solid var(--ink);
  background: var(--card);
  padding: 7px 10px;
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.mobilenav { display: none; border-bottom: var(--line); background: var(--card); }
.mobilenav a {
  display: block;
  padding: 14px 16px;
  border-top: var(--hair);
  font-family: var(--f-mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.mobilenav a.is-on { background: var(--ink); color: var(--paper); }
body.nav-open .mobilenav { display: block; }

/* --------------------------------------------------------------- breadcrumb */

.crumbs { border-bottom: var(--hair); background: var(--paper); }
.crumbs__inner {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 10px var(--gut);
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--f-mono);
  font-size: 10.5px;
  letter-spacing: 0.1em;
  color: var(--ink-55);
  white-space: nowrap;
  overflow: hidden;
}
.citem { display: inline-flex; align-items: center; }
.citem:not(:last-child)::after { content: "/"; margin: 0 10px; color: var(--ink-35); }
.citem.is-here { color: var(--ink); }
.crumbs a:hover { color: var(--ink); }

/* -------------------------------------------------------------- page shells */

main { display: block; padding: 40px 0 72px; }

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
  padding-bottom: 22px;
  border-bottom: var(--line);
}
.page-head h1 { font-size: clamp(34px, 5.4vw, 66px); margin-top: 8px; }
.page-head__aside {
  display: flex;
  align-items: flex-end;
  gap: 24px;
  padding-bottom: 6px;
  flex: none;
}
.headstat { display: flex; flex-direction: column; gap: 2px; }
.headstat b { font-family: var(--f-mono); font-size: 24px; font-weight: 600; line-height: 1; }
.headstat span { font-family: var(--f-mono); font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-55); }

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 18px 0 0;
}

/* --------------------------------------------------------------- button chips */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: var(--b) solid var(--ink);
  background: var(--card);
  padding: 11px 18px;
  font-family: var(--f-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  line-height: 1;
  white-space: nowrap;
  transition: background 120ms linear, color 120ms linear;
}
.btn:hover { background: var(--ink); color: var(--paper); }
.btn--primary { background: var(--red); border-color: var(--red); color: #fff; }
.btn--primary:hover { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.btn--sm { padding: 8px 12px; font-size: 10px; border-width: 2px; }
.btn--ghost { background: transparent; border-color: var(--ink); }

.chips { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.chip {
  border: 2px solid var(--ink);
  background: transparent;
  padding: 7px 12px;
  font-family: var(--f-mono);
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  line-height: 1;
  white-space: nowrap;
}
.chip b { font-weight: 600; }
.chip:hover { background: var(--ink-08); }
.chip.is-on { background: var(--ink); color: var(--paper); }
.chip.is-on b { color: var(--yellow); }

/* -------------------------------------------------------------------- stamps */

.stamp {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 2px solid var(--ink);
  background: var(--card);
  padding: 4px 8px;
  font-family: var(--f-mono);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  line-height: 1;
  white-space: nowrap;
}
.stamp--draft { background: transparent; }
.stamp--candidate { background: var(--red); border-color: var(--red); color: #fff; }
.stamp--approved { background: var(--yellow); }
.stamp--archived { background: transparent; border-color: var(--red); color: var(--red); text-decoration: line-through; }
.stamp--active { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.stamp--blocked { background: transparent; border-color: var(--red); color: var(--red); }
.stamp--done { background: var(--yellow); }
.stamp--archived-plain { background: transparent; border-color: var(--ink-35); color: var(--ink-55); }

/* ------------------------------------------------------------ projects grid */

.grid { display: grid; gap: 24px; }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.projects { margin-top: 24px; }

.pcard {
  position: relative;
  display: flex;
  flex-direction: column;
  border: var(--line);
  background: var(--card);
  padding: 22px 22px 0;
  min-height: 292px;
  transition: background 120ms linear;
}
.pcard:hover { background: #fffdf5; }
.pcard__top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.pcard__updated {
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--ink-55);
  white-space: nowrap;
}
.pcard__updated b { color: var(--red); font-weight: 600; }
.pcard__name {
  font-size: clamp(24px, 2.5vw, 34px);
  margin-top: 26px;
  word-break: keep-all;
  overflow-wrap: anywhere;
  text-wrap: balance;
}
.pcard__sub {
  margin-top: 10px;
  font-size: 13.5px;
  color: var(--ink-70);
}
.pcard__stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  border-top: var(--hair);
  border-bottom: var(--hair);
  margin: 20px -22px 0;
}
.pcard__stat { padding: 12px 14px; border-right: var(--hair); min-width: 0; }
.pcard__stat:last-child { border-right: 0; }
.pcard__stat b {
  display: block;
  font-family: var(--f-mono);
  font-size: 20px;
  font-weight: 600;
  line-height: 1.1;
  white-space: nowrap;
}
.pcard__stat span {
  display: block;
  margin-top: 3px;
  font-family: var(--f-mono);
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-55);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pcard__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0 16px;
  margin-top: auto;
}
.pcard__ms { min-width: 0; }
.pcard__ms span {
  display: block;
  font-family: var(--f-mono);
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-55);
}
.pcard__ms b { font-weight: 500; font-size: 13.5px; }
.pcard__ms i { font-family: var(--f-mono); font-style: normal; font-size: 11.5px; margin-left: 6px; }
.pcard__go {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 2px solid var(--ink);
  font-size: 16px;
  flex: none;
}
.pcard:hover .pcard__go { background: var(--red); border-color: var(--red); color: #fff; }

.pcard--archived { background: var(--paper-2); }
.pcard--archived .pcard__name { color: var(--ink-55); }

/* --------------------------------------------------------------- project head */

.projhead {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 32px;
  padding-bottom: 24px;
  border-bottom: var(--line);
}
.projhead h1 { font-size: clamp(32px, 5vw, 60px); margin-top: 6px; }
.projhead__sub { margin-top: 14px; font-size: 14px; color: var(--ink-70); display: flex; flex-wrap: wrap; gap: 8px 0; }
.projhead__sub span { display: inline-flex; align-items: center; }
.projhead__sub span + span::before { content: "/"; margin: 0 10px; color: var(--ink-35); }

.countdown {
  border: var(--line);
  background: var(--yellow);
  padding: 12px 20px 14px;
  text-align: center;
  flex: none;
  min-width: 132px;
}
.countdown b { display: block; font-family: var(--f-mono); font-size: 46px; font-weight: 600; line-height: 0.9; }
.countdown span {
  display: block;
  margin-top: 6px;
  font-family: var(--f-mono);
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.tabs {
  display: flex;
  align-items: stretch;
  border-bottom: var(--line);
  margin-bottom: 28px;
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tabs a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 15px 20px;
  border-right: var(--hair);
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-55);
  white-space: nowrap;
}
.tabs a:first-child { border-left: var(--hair); }
.tabs a b { font-weight: 600; color: var(--ink-35); }
.tabs a:hover { color: var(--ink); background: var(--ink-08); }
.tabs a.is-on { background: var(--ink); color: var(--paper); }
.tabs a.is-on b { color: var(--yellow); }

/* ------------------------------------------------------------------ KPI grid */

.kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: var(--line);
  background: var(--card);
}
.kpi { padding: 18px 20px 20px; border-right: var(--hair); min-width: 0; }
.kpi:last-child { border-right: 0; }
.kpi__label {
  font-family: var(--f-mono);
  font-size: 9.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-55);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.kpi__value {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-top: 10px;
  font-family: var(--f-mono);
  font-size: 34px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
}
.kpi__value small { font-size: 13px; font-weight: 400; color: var(--ink-55); }
.kpi__sub { margin-top: 8px; font-size: 12px; color: var(--ink-70); }
.kpi__bar { margin-top: 12px; height: 6px; background: var(--ink-15); }
.kpi__bar i { display: block; height: 100%; background: var(--ink); }

.callout {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  border: var(--line);
  border-left-width: 12px;
  border-left-color: var(--yellow);
  background: #fdf9ec;
  padding: 16px 20px;
  margin-top: 24px;
}
.callout__tag {
  font-family: var(--f-mono);
  font-size: 9.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  background: var(--yellow);
  padding: 3px 7px;
  flex: none;
  margin-top: 2px;
}
.callout p { font-size: 14.5px; line-height: 1.55; }
.callout b { font-weight: 600; }
.callout em { font-style: normal; background: var(--yellow); padding: 1px 4px; }
.callout a { border-bottom: 2px solid var(--ink); }

/* ------------------------------------------------------------------ timeline */

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 12px;
  border-bottom: var(--line);
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.section-head h2 { font-size: clamp(22px, 2.6vw, 32px); }
.section-head .mono { font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-55); }

.tl-layout {
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr);
  gap: 40px;
  margin-top: 40px;
  align-items: start;
}
.tl-side { position: sticky; top: 108px; display: flex; flex-direction: column; gap: 22px; }
.legend { display: flex; flex-direction: column; gap: 9px; }
.legend__item { display: flex; align-items: center; gap: 10px; font-size: 12.5px; }
.legend__swatch { width: 22px; height: 3px; flex: none; }
.legend__swatch--task { background: var(--ink); }
.legend__swatch--material { background: var(--red); }
.legend__swatch--milestone { background: var(--yellow); box-shadow: 0 0 0 1px var(--ink); }

.tl { display: flex; flex-direction: column; gap: 0; }
.tl__group + .tl__group { margin-top: 26px; }
.tl__date {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--f-mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-55);
  margin-bottom: 12px;
}
.tl__date::after { content: ""; flex: 1; height: 1px; background: var(--ink-15); }
.tl__list { display: flex; flex-direction: column; }
.tl__row {
  display: grid;
  grid-template-columns: 52px 3px minmax(0, 1fr) auto;
  gap: 16px;
  align-items: start;
  padding: 13px 0;
  border-bottom: var(--hair);
}
.tl__time { font-family: var(--f-mono); font-size: 11.5px; color: var(--ink-55); padding-top: 1px; }
.tl__bar { align-self: stretch; background: var(--ink); min-height: 34px; position: relative; }
.tl__row--material .tl__bar { background: var(--red); }
.tl__row--milestone .tl__bar { background: var(--yellow); box-shadow: inset 0 0 0 1px var(--ink); }
.tl__body { min-width: 0; }
.tl__title { font-size: 15px; font-weight: 500; line-height: 1.35; overflow-wrap: anywhere; }
.tl__title b { font-family: var(--f-mono); font-weight: 600; }
.tl__note { margin-top: 4px; font-size: 13px; color: var(--ink-70); overflow-wrap: anywhere; }
.tl__meta { margin-top: 7px; font-family: var(--f-mono); font-size: 10px; letter-spacing: 0.06em; color: var(--ink-55); }
.tl__badge {
  font-family: var(--f-mono);
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border: 2px solid var(--ink);
  padding: 3px 7px;
  white-space: nowrap;
  margin-top: 1px;
}
.tl__row--material .tl__badge { border-color: var(--red); color: var(--red); }
.tl__row--milestone .tl__badge { background: var(--yellow); border-color: var(--ink); }

.empty {
  border: 2px dashed var(--ink-35);
  padding: 32px;
  text-align: center;
  color: var(--ink-55);
  font-size: 14px;
}

/* ------------------------------------------------------------------- kanban */

.kanban {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-top: 24px;
  align-items: start;
}
.kcol { border: var(--line); background: var(--card); min-width: 0; }
.kcol__head {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 12px 14px;
  border-bottom: 2px solid var(--ink);
  background: var(--paper);
}
.kcol__head h2 {
  font-family: var(--f-mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.kcol__head .count { margin-left: auto; font-family: var(--f-mono); font-size: 11px; color: var(--ink-55); }
.kcol__body { padding: 10px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }

.tcard {
  border: 2px solid var(--ink);
  background: var(--paper);
  padding: 11px 12px 12px;
  min-width: 0;
}
.tcard:hover { background: #fffdf5; }
.tcard__top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tcard__area {
  font-family: var(--f-mono);
  font-size: 8.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-55);
  border: 1px solid var(--ink-35);
  padding: 2px 5px;
  white-space: nowrap;
}
.tcard__due {
  font-family: var(--f-mono);
  font-size: 10.5px;
  white-space: nowrap;
  color: var(--ink-70);
}
.tcard__due.is-near { color: var(--red); font-weight: 600; }
.tcard h3 { margin-top: 9px; font-size: 15px; font-weight: 500; line-height: 1.3; overflow-wrap: anywhere; }
.tcard__foot {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding-top: 9px;
  border-top: var(--hair);
}
.tcard__times {
  font-family: var(--f-mono);
  font-size: 9.5px;
  color: var(--ink-55);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tcard__foot .avatar { margin-left: auto; }

/* ----------------------------------------------------------------- materials */

.mgrid { margin-top: 24px; }
.mcard {
  display: flex;
  flex-direction: column;
  border: var(--line);
  background: var(--card);
  min-width: 0;
  transition: background 120ms linear;
}
.mcard:hover { background: #fffdf5; }
.mcard__thumb { position: relative; border-bottom: 2px solid var(--ink); background: var(--paper-2); }
.mcard__thumb img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.mcard__stamp { position: absolute; top: 10px; left: 10px; }
.mcard__count {
  position: absolute;
  right: 10px;
  bottom: 10px;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--f-mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.06em;
  padding: 4px 7px;
}
.mcard__body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 8px; }
.mcard__name { font-size: 21px; font-weight: 600; letter-spacing: -0.01em; }
.mcard__meta {
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 0.04em;
  color: var(--ink-55);
  display: flex;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.vstrip { display: flex; gap: 2px; margin-top: 2px; }
.vstrip i { flex: 1; height: 7px; background: var(--ink-15); }
.vstrip i.is-approved { background: var(--yellow); box-shadow: inset 0 0 0 1px var(--ink); }
.vstrip i.is-current { background: var(--red); }
.vstrip i.is-archived { background: repeating-linear-gradient(45deg, var(--ink-35) 0 2px, transparent 2px 5px); }

/* ----------------------------------------------------------- material detail */

.detail {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  gap: 32px;
  margin-top: 26px;
  align-items: start;
}
.preview { border: var(--line); background: var(--card); }
.preview img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.preview__cap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  border-top: 2px solid var(--ink);
  padding: 10px 14px;
  font-family: var(--f-mono);
  font-size: 10.5px;
  color: var(--ink-70);
}
.preview__cap b { color: var(--ink); }

.infopanel { display: flex; flex-direction: column; gap: 0; border: var(--line); background: var(--card); }
.infopanel__head { padding: 18px 18px 16px; border-bottom: var(--line); }
.infopanel__version {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
}
.infopanel__version b { font-family: var(--f-mono); font-size: 44px; font-weight: 600; line-height: 0.9; }
.infopanel__version span { font-family: var(--f-mono); font-size: 10px; letter-spacing: 0.1em; color: var(--ink-55); text-align: right; }

.dl { display: flex; flex-direction: column; }
.dl__row {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 12px;
  padding: 10px 18px;
  border-bottom: var(--hair);
  font-size: 13px;
}
.dl__row:last-child { border-bottom: 0; }
.dl__row dt {
  font-family: var(--f-mono);
  font-size: 9.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-55);
  padding-top: 3px;
}
.dl__row dd { min-width: 0; overflow-wrap: anywhere; }
.dl__row dd b { font-weight: 600; }
.infopanel__note {
  border-top: var(--line);
  background: #fdf9ec;
  padding: 13px 18px;
  font-size: 12.5px;
  line-height: 1.5;
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.infopanel__note .dot { margin-top: 5px; background: var(--yellow); box-shadow: inset 0 0 0 2px var(--ink); }

/* version band */
.vband-wrap { margin-top: 40px; }
.vband {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
  scroll-snap-type: x mandatory;
}
.vcell {
  display: flex;
  flex-direction: column;
  gap: 0;
  border: 2px solid var(--ink);
  background: var(--card);
  padding: 0;
  text-align: left;
  min-width: 0;
  scroll-snap-align: start;
}
.vcell img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-bottom: 2px solid var(--ink); }
.vcell__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 7px 7px 5px;
}
.vcell__n { font-family: var(--f-mono); font-size: 13px; font-weight: 600; }
.vcell__date { padding: 0 7px 8px; font-family: var(--f-mono); font-size: 9.5px; color: var(--ink-55); }
.vcell__flag {
  font-family: var(--f-mono);
  font-size: 8px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 2px 4px;
  border: 1px solid currentColor;
  white-space: nowrap;
}
.vcell__flag--approved { background: var(--yellow); border-color: var(--ink); }
.vcell__flag--archived { color: var(--red); border-color: var(--red); }
.vcell__flag--current { background: var(--red); border-color: var(--red); color: #fff; }
.vcell:hover { background: #fffdf5; }
.vcell.is-current { background: var(--ink); border-color: var(--ink); color: var(--paper); outline: 3px solid var(--red); outline-offset: -9px; }
.vcell.is-current .vcell__date { color: rgba(242, 239, 230, 0.65); }
.vcell.is-current img { border-bottom-color: var(--ink); }

/* material timeline */
.mtl-wrap { margin-top: 40px; }
.mtl {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  gap: 0;
  border-top: 3px solid var(--ink);
  margin-top: 26px;
  overflow-x: auto;
  padding-bottom: 4px;
}
.mtl__node {
  position: relative;
  padding: 20px 10px 0 0;
  min-width: 0;
  border-right: var(--hair);
}
.mtl__node:last-child { border-right: 0; }
.mtl__tick {
  position: absolute;
  top: -12px;
  left: 0;
  width: 3px;
  height: 21px;
  background: var(--ink);
}
.mtl__node--approved .mtl__tick { background: var(--yellow); box-shadow: inset 0 0 0 1px var(--ink); width: 11px; height: 11px; top: -7px; }
.mtl__node--archived .mtl__tick { background: var(--red); width: 11px; height: 11px; top: -7px; }
.mtl__node b { display: block; font-family: var(--f-mono); font-size: 13px; font-weight: 600; }
.mtl__date { display: block; font-family: var(--f-mono); font-size: 9.5px; color: var(--ink-55); margin-top: 3px; }
.mtl__note { display: block; font-size: 11.5px; color: var(--ink-70); margin-top: 6px; line-height: 1.35; }
.mtl__flag {
  display: inline-block;
  margin-top: 7px;
  font-family: var(--f-mono);
  font-size: 8.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 2px 5px;
  border: 1px solid var(--ink);
}
.mtl__flag--approved { background: var(--yellow); }
.mtl__flag--archived { color: var(--red); border-color: var(--red); }
.mtl__node.is-current b { color: var(--red); }

/* ------------------------------------------------------------------- compare */

.cmp-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  border: var(--line);
  background: var(--card);
  padding: 14px 18px;
  margin-top: 24px;
}
.cmp-bar label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-55);
}
.cmp-bar select {
  border: 2px solid var(--ink);
  background: var(--paper);
  padding: 8px 30px 8px 10px;
  font-family: var(--f-mono);
  font-size: 13px;
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink) 50%), linear-gradient(135deg, var(--ink) 50%, transparent 50%);
  background-position: calc(100% - 15px) 52%, calc(100% - 10px) 52%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}
.cmp-vs { font-family: var(--f-mono); font-size: 11px; letter-spacing: 0.14em; color: var(--ink-55); }

.cmp-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; margin-top: 24px; }
.cmp-col { border: var(--line); background: var(--card); min-width: 0; }
.cmp-col__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 14px;
  border-bottom: 2px solid var(--ink);
}
.cmp-col__head b { font-family: var(--f-mono); font-size: 18px; font-weight: 600; }
.cmp-col__head span { font-family: var(--f-mono); font-size: 9.5px; color: var(--ink-55); white-space: nowrap; }
.cmp-col img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.cmp-col__foot { padding: 12px 14px; border-top: 2px solid var(--ink); font-size: 12.5px; color: var(--ink-70); }

.diff { margin-top: 40px; }
.diff__table { border: var(--line); background: var(--card); }
.diff__row {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr) minmax(0, 1fr);
  gap: 0;
  border-bottom: var(--hair);
  font-size: 13.5px;
}
.diff__row:last-child { border-bottom: 0; }
.diff__row > * { padding: 11px 14px; min-width: 0; overflow-wrap: anywhere; }
.diff__row > * + * { border-left: var(--hair); }
.diff__row--head {
  font-family: var(--f-mono);
  font-size: 9.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-55);
  background: var(--paper);
}
.diff__label { font-family: var(--f-mono); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-55); }
.diff__row--head .diff__label { color: var(--ink-55); }
.diff__changed { font-weight: 600; }
.diff__base { color: var(--ink-70); }

.notes { margin-top: 40px; }
.notelist { border: var(--line); background: var(--card); }
.notelist li {
  display: grid;
  grid-template-columns: 64px 96px minmax(0, 1fr);
  gap: 14px;
  padding: 12px 16px;
  border-bottom: var(--hair);
  font-size: 13.5px;
  align-items: baseline;
}
.notelist li:last-child { border-bottom: 0; }
.notelist b { font-family: var(--f-mono); font-size: 13px; font-weight: 600; }
.notelist span { font-family: var(--f-mono); font-size: 10px; color: var(--ink-55); }
.notelist p { min-width: 0; overflow-wrap: anywhere; }

/* -------------------------------------------------------------------- footer */

.footer { border-top: var(--line); background: var(--ink); color: var(--paper); }
.footer__inner {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 26px var(--gut);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}
.footer__mark { background: var(--paper); padding: 7px 9px; display: inline-flex; }
.footer__mark img { height: 26px; width: auto; }
.footer p { font-family: var(--f-mono); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: rgba(242, 239, 230, 0.6); }
.footer p b { color: var(--yellow); font-weight: 500; }

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

@media (max-width: 1180px) {
  :root { --gut: 40px; }
  .grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tl-layout { grid-template-columns: 1fr; gap: 24px; }
  .tl-side { position: static; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 16px 28px; }
  .legend { flex-direction: row; flex-wrap: wrap; gap: 8px 18px; }
  .detail { grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); }
}

@media (max-width: 900px) {
  .grid--2, .grid--3 { grid-template-columns: minmax(0, 1fr); }
  .kanban { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi:nth-child(2) { border-right: 0; }
  .kpi:nth-child(1), .kpi:nth-child(2) { border-bottom: var(--hair); }
  .detail { grid-template-columns: minmax(0, 1fr); }
  .topnav, .wsmeta { display: none; }
  .menubtn { display: inline-flex; }
  .page-head__aside .btn { display: none; }
}

@media (max-width: 640px) {
  :root { --gut: 16px; }
  body { font-size: 15px; }
  .topbar__inner { height: 60px; gap: 12px; padding: 0 var(--gut); }
  .brand__mark { height: 34px; }
  .brand__name { font-size: 16px; }
  .brand__sub { display: none; }
  .agentchip { display: none; }
  .topbar__right { gap: 8px; }
  main { padding: 24px 0 48px; }
  .page-head { flex-direction: column; align-items: flex-start; gap: 16px; padding-bottom: 16px; }
  .page-head h1 { font-size: 38px; }
  .page-head__aside { padding-bottom: 0; width: 100%; justify-content: flex-start; gap: 28px; }
  .projhead { flex-direction: column; align-items: stretch; gap: 18px; }
  .countdown { align-self: flex-start; min-width: 0; padding: 10px 16px 12px; }
  .countdown b { font-size: 38px; }
  .tabs a { padding: 12px 14px; font-size: 10px; }
  .crumbs__inner .citem:nth-last-child(n + 3) { display: none; }
  .kanban { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .kpis { grid-template-columns: minmax(0, 1fr); }
  .kpi { border-right: 0; border-bottom: var(--hair); }
  .kpi:last-child { border-bottom: 0; }
  .kpi__value { font-size: 30px; }
  .callout { flex-direction: column; gap: 10px; padding: 14px; }
  .tl__row { grid-template-columns: 44px 3px minmax(0, 1fr); gap: 12px; }
  .tl__badge { grid-column: 3; justify-self: start; margin-top: 6px; }
  .pcard { min-height: 0; padding: 16px 16px 0; }
  .pcard__name { margin-top: 18px; }
  .pcard__stats { margin-left: -16px; margin-right: -16px; }
  .pcard__stat { padding: 10px 12px; }
  .pcard__stat b { font-size: 17px; }
  .pcard__foot { padding: 12px 0 14px; }
  .vband { grid-auto-columns: 42%; }
  .mtl { grid-auto-columns: 46%; }
  .cmp-grid { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .cmp-bar { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px 12px; padding: 12px 14px; }
  .cmp-bar label { flex-direction: column; align-items: flex-start; gap: 5px; min-width: 0; }
  .cmp-bar select { width: 100%; }
  .cmp-vs, .cmp-bar .eyebrow { display: none; }
  .diff__row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .diff__row--head { display: none; }
  .diff__label { grid-column: 1 / -1; border-left: 0 !important; background: var(--paper-2); padding-bottom: 7px; padding-top: 12px; }
  .notelist li { grid-template-columns: 52px minmax(0, 1fr); gap: 8px 10px; }
  .notelist li p { grid-column: 1 / -1; }
  .section-head { gap: 10px; }
  .footer__inner { padding: 20px var(--gut); }
  .footer p { font-size: 9px; }
  .mcard__name { font-size: 19px; }
}

/* ======================= M1 additions: forms, flash, activity =============== */

.tabs__soon {
  display: flex; align-items: center; gap: 8px;
  padding: 15px 20px; border-right: var(--hair);
  font-family: var(--f-mono); font-size: 11px; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--ink-35); white-space: nowrap;
}
.tabs__soon b { font-weight: 600; color: var(--ink-35); }

.newpanel { margin: 20px 0 0; }
.newpanel > summary { display: inline-flex; list-style: none; cursor: pointer; }
.newpanel > summary::-webkit-details-marker { display: none; }
.newpanel[open] > summary { background: var(--ink); color: var(--paper); border-color: var(--ink); }

.formgrid {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px 18px; border: var(--line); background: var(--card);
  padding: 18px; margin-top: 14px;
}
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > span { font-family: var(--f-mono); font-size: 9.5px; letter-spacing: 0.13em; text-transform: uppercase; color: var(--ink-55); }
.field input, .field select {
  border: 2px solid var(--ink); background: var(--paper); padding: 9px 10px;
  font-family: var(--f-mono); font-size: 13px; width: 100%; min-width: 0;
  border-radius: 0; appearance: none;
}
.field select { background-image: linear-gradient(45deg, transparent 50%, var(--ink) 50%), linear-gradient(135deg, var(--ink) 50%, transparent 50%);
  background-position: calc(100% - 15px) 55%, calc(100% - 10px) 55%; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-right: 26px; }
.field input:focus, .field select:focus { outline: 3px solid var(--yellow); outline-offset: 0; }
.field--wide { grid-column: span 2; }
.field--action { justify-content: flex-end; }
.field--action .btn { align-self: flex-start; }

.flash {
  border: var(--line); border-left-width: 12px; border-left-color: var(--yellow);
  background: #fdf9ec; padding: 12px 16px; margin-bottom: 20px;
  font-family: var(--f-mono); font-size: 12px; letter-spacing: 0.02em;
}
.flash--err { border-left-color: var(--red); color: var(--red); background: #fdf2f2; }

.tcard__times { margin-top: 7px; font-family: var(--f-mono); font-size: 9.5px; color: var(--ink-55); }
.tcard__actions { display: flex; flex-wrap: wrap; gap: 6px; margin-left: auto; justify-content: flex-end; }
.inline { display: inline-flex; align-items: center; gap: 4px; }
.mini {
  border: 2px solid var(--ink); background: var(--paper); padding: 4px 8px;
  font-family: var(--f-mono); font-size: 9px; letter-spacing: 0.08em; text-transform: uppercase; line-height: 1;
}
.mini:hover { background: var(--ink); color: var(--paper); }
.mini-input {
  border: 2px solid var(--ink); background: var(--paper); padding: 3px 6px; width: 86px;
  font-family: var(--f-mono); font-size: 9px; border-radius: 0;
}
.tcard__due.is-overdue { color: var(--red); font-weight: 600; }
.avatar--none { background: var(--paper-2); color: var(--ink-35); border-style: dashed; }
.kcol__empty { padding: 10px 2px; font-family: var(--f-mono); font-size: 11px; color: var(--ink-35); }

.activity-wrap { margin-top: 36px; }
.activity { border: var(--line); background: var(--card); }
.activity__row {
  display: grid; grid-template-columns: 74px 3px minmax(0, 1fr) auto;
  gap: 14px; align-items: center; padding: 11px 14px; border-bottom: var(--hair);
}
.activity__row:last-child { border-bottom: 0; }
.activity__time { font-size: 10.5px; color: var(--ink-55); white-space: nowrap; }
.activity__bar { width: 3px; height: 22px; background: var(--ink); }
.activity__bar--material { background: var(--red); }
.activity__bar--milestone { background: var(--yellow); box-shadow: inset 0 0 0 1px var(--ink); }
.activity__text { font-size: 13.5px; min-width: 0; overflow-wrap: anywhere; }
.activity__who { font-size: 10px; color: var(--ink-55); white-space: nowrap; }

.loginwrap { display: flex; justify-content: center; padding: 64px 0; }
.login { width: 100%; max-width: 430px; border: var(--line); background: var(--card); padding: 30px; }
.login h1 { font-size: 44px; margin: 6px 0 20px; }
.loginform { display: flex; flex-direction: column; gap: 14px; }
.loginform .btn { align-self: flex-start; }

@media (max-width: 900px) {
  .formgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .field--wide { grid-column: span 2; }
}
@media (max-width: 640px) {
  .formgrid { grid-template-columns: minmax(0, 1fr); padding: 14px; }
  .field--wide { grid-column: auto; }
  .tabs__soon { padding: 12px 14px; font-size: 10px; }
  .activity__row { grid-template-columns: 62px 3px minmax(0, 1fr); gap: 10px; }
  .activity__who { grid-column: 3; }
  .login { padding: 22px; }
  .login h1 { font-size: 34px; }
  .tcard__actions { margin-left: 0; }
}

/* M1 polish: task card actions get their own row; logout visible on desktop */
.topbar .menubtn { display: inline-flex; }
.tcard__foot { flex-wrap: wrap; gap: 8px; }
.tcard__actions { width: 100%; margin-left: 0; justify-content: flex-start; }
.tcard__actions .inline { flex: 0 1 auto; }
.mini-input { flex: 1 1 74px; min-width: 74px; width: auto; }

/* M1.1: edit / delete controls */
.editpanel { margin-top: 18px; }
.editpanel[open] { margin-bottom: 22px; }
.dangergrid { margin-top: 0; border-top: 2px solid var(--red); }
.btn--danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn--danger:hover { background: var(--ink); border-color: var(--ink); }
.field--check { flex-direction: row; align-items: center; gap: 8px; }
.field--check > span { white-space: nowrap; }
.field--check input { width: 18px; height: 18px; accent-color: var(--red); }
.taskedit { margin-top: 10px; border-top: 1px dashed var(--ink-15); padding-top: 8px; }
.taskedit > summary { display: inline-block; list-style: none; cursor: pointer; }
.taskedit > summary::-webkit-details-marker { display: none; }
.taskedit[open] { background: var(--paper-2); padding: 8px; margin: 10px -4px 0; }
.editform { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.editform input, .editform select {
  border: 2px solid var(--ink); background: var(--paper); padding: 5px 6px;
  font-family: var(--f-mono); font-size: 10.5px; width: 100%; min-width: 0; border-radius: 0;
}
.editform__row { display: grid; grid-template-columns: minmax(0,1.2fr) minmax(0,1fr) minmax(0,1fr); gap: 6px; }
.mini--danger { border-color: var(--red); color: var(--red); }
.mini--danger:hover { background: var(--red); color: #fff; }

/* ============================ P0: drawer, drag, dialogs, undo ============ */

.kcol__add {
  margin-left: 8px; border: 2px solid var(--ink); background: var(--paper);
  width: 26px; height: 26px; display: grid; place-items: center;
  font-size: 14px; line-height: 1; padding: 0; flex: none;
}
.kcol__add:hover { background: var(--red); border-color: var(--red); color: #fff; }
.kcol.is-over { outline: 3px solid var(--red); outline-offset: -3px; }
.tcard { cursor: grab; }
.tcard.is-dragging { opacity: 0.35; }
.tcard.is-dropbefore { box-shadow: inset 0 3px 0 var(--red); }
.tcard:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; }

.drawer { position: fixed; inset: 0; z-index: 90; }
.drawer__scrim { position: absolute; inset: 0; background: rgba(16, 28, 41, 0.5); }
.drawer__panel {
  position: absolute; top: 0; right: 0; bottom: 0; width: min(560px, 92vw);
  background: var(--paper); border-left: var(--line); display: flex; flex-direction: column;
  overflow-y: auto; overscroll-behavior: contain;
}
.drawer__head { padding: 20px 22px 16px; border-bottom: var(--line); }
.drawer__topline { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.drawer__close { border: 2px solid var(--ink); background: var(--card); width: 32px; height: 32px; line-height: 1; font-size: 14px; }
.drawer__close:hover { background: var(--red); border-color: var(--red); color: #fff; }
.dr-title {
  width: 100%; border: 0; border-bottom: 3px solid transparent; background: transparent;
  font-family: var(--f-display); font-size: 28px; font-weight: 600; letter-spacing: -0.02em;
  padding: 10px 0 6px; margin-top: 6px; border-radius: 0;
}
.dr-title:focus { outline: none; border-bottom-color: var(--red); }
.dr-meta { font-size: 10px; color: var(--ink-55); margin-top: 4px; }
.drawer__form { padding: 18px 22px; border-bottom: var(--line); display: flex; flex-direction: column; gap: 14px; }
.drawer__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 14px; }
.drawer__grid input, .drawer__form textarea {
  border: 2px solid var(--ink); background: var(--card); padding: 9px 10px;
  font-family: var(--f-mono); font-size: 12.5px; width: 100%; min-width: 0; border-radius: 0;
}
.drawer__form textarea { resize: vertical; font-family: var(--f-body); font-size: 14px; }
.drawer__form input[readonly] { background: var(--paper-2); color: var(--ink-55); }
.drawer__actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.drawer__hint { font-size: 10.5px; color: var(--ink-55); }
.drawer__hint.is-bad { color: var(--red); }
.kbd { font-family: var(--f-mono); font-size: 9px; opacity: 0.7; }
.drawer__events { padding: 18px 22px 40px; }
.drawer__events .activity { background: var(--card); }
.drawer-open { overflow: hidden; }

.dialog {
  border: var(--line); background: var(--card); padding: 22px; max-width: 440px; width: 92vw;
  border-radius: 0; color: var(--ink); font-family: var(--f-body);
}
.dialog::backdrop { background: rgba(16, 28, 41, 0.55); }
.dialog h2 { font-size: 24px; margin: 6px 0 12px; }
.dialog input {
  width: 100%; border: 2px solid var(--ink); background: var(--paper); padding: 10px;
  font-family: var(--f-mono); font-size: 13px; border-radius: 0; margin-bottom: 14px;
}
.dialog menu { display: flex; gap: 10px; justify-content: flex-end; padding: 0; margin: 0; }

.undobar {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 22px; z-index: 95;
  background: var(--ink); color: var(--paper); border: 3px solid var(--ink);
  padding: 10px 14px; display: flex; align-items: center; gap: 14px;
  font-family: var(--f-mono); font-size: 11.5px; letter-spacing: 0.02em;
  max-width: min(92vw, 560px); box-sizing: border-box;
}
.undobar .btn { border-color: var(--paper); background: var(--paper); color: var(--ink); }

@media (max-width: 640px) {
  .drawer__panel { width: 100vw; border-left: 0; }
  .drawer__grid { grid-template-columns: minmax(0, 1fr); }
  .dr-title { font-size: 22px; }
}

/* hidden attribute must win over component display rules */
[hidden] { display: none !important; }

/* a11y: visible focus everywhere, bigger tap targets on phones */
:focus-visible { outline: 3px solid var(--red); outline-offset: 2px; }
.kcol__add:focus-visible, .mini:focus-visible, .drawer__close:focus-visible { outline-offset: 2px; }
@media (max-width: 640px) {
  .mini { padding: 11px 12px; font-size: 10px; min-height: 44px; }
  .kcol__add { width: 44px; height: 44px; font-size: 18px; }
  .drawer__close { width: 44px; height: 44px; }
  .chip, .btn { min-height: 44px; }
  .tcard__actions { gap: 8px; }
}

/* inline error toast (replaces blocking alert) */
.toast {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 78px; z-index: 96;
  background: var(--red); color: #fff; border: 3px solid var(--ink);
  padding: 12px 16px; font-family: var(--f-mono); font-size: 12px;
  max-width: min(92vw, 560px); box-sizing: border-box;
}
@media (max-width: 640px) { .menubtn { min-height: 44px; min-width: 44px; } }

/* ======================================================== M1.7 — 全站導航 */
.mainnav { display: flex; border: 2px solid var(--ink); margin-left: 4px; }
.mainnav__item {
  padding: 7px 12px;
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-70);
  border-right: 2px solid var(--ink);
  white-space: nowrap;
}
.mainnav__item:last-child { border-right: 0; }
.mainnav__item:hover { background: var(--ink-08); color: var(--ink); }
.mainnav__item.is-on { background: var(--ink); color: var(--paper); }
@media (max-width: 1180px) {
  .mainnav { order: 9; width: 100%; margin: 0; overflow-x: auto; }
  .topbar__inner { height: auto; flex-wrap: wrap; padding-top: 10px; padding-bottom: 10px; }
}
@media (max-width: 640px) {
  .mainnav { border-left: 0; border-right: 0; }
  .mainnav__item { flex: 1; text-align: center; }
}

/* ================================================ M1.7 — 任務詳情彈窗 */
body.modal-open { overflow: hidden; }
.modal { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 24px; }
.modal[hidden] { display: none; }
.modal__scrim { position: absolute; inset: 0; background: rgba(16, 28, 41, 0.6); }
.modal__panel {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(920px, 100%);
  max-height: 90vh;
  background: var(--card);
  border: var(--line);
}
.modal__head { padding: 16px 22px 12px; border-bottom: 2px solid var(--ink); background: var(--paper); }
.modal__topline { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.modal__close {
  border: 2px solid var(--ink);
  background: var(--paper);
  width: 32px;
  height: 32px;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
}
.modal__close:hover { background: var(--red); border-color: var(--red); color: #fff; }
.modal__titlerow { display: flex; gap: 12px; align-items: center; margin-top: 4px; min-width: 0; }
.dr-title {
  flex: 1;
  min-width: 0;
  font-family: var(--f-display);
  font-size: 26px;
  font-weight: 600;
  line-height: 1.2;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  padding: 2px 0;
}
.dr-title:focus { outline: 0; border-bottom-color: var(--ink); background: #fffdf5; }
.tchip {
  font-family: var(--f-mono);
  font-size: 9.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border: 2px solid var(--ink);
  padding: 4px 8px;
  white-space: nowrap;
}
.tchip--doing { background: var(--ink); color: var(--paper); }
.tchip--blocked { border-color: var(--red); color: var(--red); }
.tchip--done { background: var(--yellow); }
.modal__meta { margin-top: 8px; font-size: 10.5px; color: var(--ink-55); }
.modal__form { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.modal__scroll { overflow-y: auto; padding: 0 22px 16px; min-height: 0; }
.modal__foot {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 22px;
  border-top: 2px solid var(--ink);
  background: var(--paper);
}
.modal__hint { margin-right: auto; font-size: 10.5px; color: var(--ink-55); min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.modal__hint.is-bad { color: var(--red); }

.mgroup { padding: 18px 0; border-bottom: var(--hair); }
.mgroup:last-child { border-bottom: 0; }
.mgroup__head {
  font-family: var(--f-mono);
  font-size: 9.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-55);
  margin-bottom: 12px;
}
.mgroup__head b { color: var(--ink); font-weight: 600; }
.mgrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 16px; }
.mgrid--span2 { grid-column: span 2; }

/* ---- 任務卡：首屏 6 樣 + accordion（2026-11-07 Astra 規格） ---- */
.dr-first { display: flex; align-items: flex-end; gap: 14px; margin-top: 12px; flex-wrap: wrap; }
.drf { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.drf > span {
  font-family: var(--f-mono); font-size: 8.5px; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--ink-55);
}
.drf select, .drf input { border: 2px solid var(--ink); background: var(--paper); padding: 5px 7px; font-size: 12px; }
.drf--due input { width: 150px; }
.dr-tail { display: flex; align-items: flex-end; gap: 14px; flex-wrap: wrap; flex: 1; min-width: 0; }
.dr-nextbtn { margin-left: auto; }
.dr-morebtn { display: none; }
@media (min-width: 641px) { #dr-statuschip { display: none; } }

.acc-list { padding-top: 4px; }
.acc { border-bottom: var(--hair); }
.acc:last-child { border-bottom: 0; }
.acc > summary {
  list-style: none; cursor: pointer; display: flex; align-items: center;
  gap: 10px; padding: 13px 2px;
}
.acc > summary::-webkit-details-marker { display: none; }
.acc > summary::before { content: "▸"; font-size: 10px; color: var(--ink-55); width: 10px; flex: 0 0 10px; }
.acc[open] > summary::before { content: "▾"; }
.acc__sum .mgroup__head { margin-bottom: 0; flex: 1; }
.acc__n {
  font-family: var(--f-mono); font-size: 9px; letter-spacing: 0.06em;
  color: var(--ink-55); border: 1px solid rgba(16, 28, 41, 0.25);
  padding: 2px 6px; white-space: nowrap;
}
.acc[open] .acc__n { color: var(--ink); border-color: var(--ink); }
.acc > *:not(summary) { padding-left: 20px; }
.acc .mgrid { margin: 4px 0 16px; }
.field textarea {
  border: 2px solid var(--ink);
  background: var(--paper);
  padding: 9px 10px;
  font-family: var(--f-body);
  font-size: 13.5px;
  width: 100%;
  resize: vertical;
  border-radius: 0;
}
.field textarea:focus { outline: 3px solid var(--yellow); outline-offset: 0; }
.field input[type="checkbox"] { width: 20px; height: 20px; padding: 0; accent-color: var(--ink); }
.field select[multiple] { padding: 4px; min-height: 76px; }
.field select[multiple] option { padding: 3px 4px; }

.sublist, .atlist, .comments { border: var(--hair); background: var(--paper); }
.subitem { display: flex; align-items: center; gap: 8px; padding: 7px 9px; border-bottom: var(--hair); font-size: 13px; }
.subitem:last-child { border-bottom: 0; }
.subitem label { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; }
.subitem label input { width: 16px; height: 16px; accent-color: var(--ink); }
.subitem span { overflow-wrap: anywhere; }
.subitem.is-done span { text-decoration: line-through; color: var(--ink-55); }
.subempty { padding: 8px 9px; font-family: var(--f-mono); font-size: 10.5px; color: var(--ink-35); }
.addrow { display: flex; gap: 8px; margin-top: 8px; align-items: stretch; }
.addrow input, .addrow textarea {
  flex: 1;
  min-width: 0;
  border: 2px solid var(--ink);
  background: var(--paper);
  padding: 7px 9px;
  font-family: var(--f-mono);
  font-size: 12px;
  resize: vertical;
}
.addrow--att input { flex: 1 1 0; }
.addrow--att input#dr-att-path { flex: 2 1 0; }
.mini--x { border-color: var(--ink-35); color: var(--ink-55); }
.mini--x:hover { border-color: var(--red); color: var(--red); }
.atitem { display: flex; align-items: center; gap: 10px; padding: 6px 9px; border-bottom: var(--hair); font-size: 12px; }
.atitem:last-child { border-bottom: 0; }
.atitem__name { font-weight: 600; overflow-wrap: anywhere; }
.atitem__path { color: var(--ink-55); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 42%; }
.comments { max-height: 220px; overflow-y: auto; }
.comment { padding: 8px 10px; border-bottom: var(--hair); }
.comment:last-child { border-bottom: 0; }
.comment p { font-size: 13px; overflow-wrap: anywhere; }
.comment span { display: block; margin-top: 4px; font-size: 9.5px; color: var(--ink-55); }
.sysgrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 16px; }
.sysgrid dt { font-family: var(--f-mono); font-size: 8.5px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-55); }
.sysgrid dd { font-size: 13px; overflow-wrap: anywhere; }

@media (max-width: 900px) {
  .mgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sysgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .modal { padding: 0; }
  .modal__panel { width: 100%; height: 100vh; max-height: 100vh; border-left: 0; border-right: 0; }
  .modal__head { padding: 12px 14px 10px; }
  .modal__scroll { padding: 0 14px 14px; }
  .modal__foot { padding: 10px 14px; flex-wrap: wrap; }
  .modal__hint { flex-basis: 100%; }
  .dr-title { font-size: 20px; }
  .dr-first { gap: 10px; }
  .drf--due input { width: 100%; }
  .dr-morebtn { display: inline-flex; }
  .dr-tail { display: none; }
  #drawer.is-more .dr-tail { display: flex; flex-basis: 100%; gap: 10px; }
  .dr-nextbtn { margin-left: 0; }
  #drawer:not(.is-more) #dr-accs { display: none; }
  .mgrid { grid-template-columns: 1fr; }
  .mgrid--span2 { grid-column: span 1; }
  .sysgrid { grid-template-columns: 1fr; }
}

/* ==================================================== M1.7 — 列表頁元件 */
.filterbar {
  display: flex;
  gap: 14px;
  align-items: flex-end;
  flex-wrap: wrap;
  border: var(--line);
  background: var(--card);
  padding: 14px 16px;
  margin-top: 18px;
}
.filterbar .field { min-width: 150px; }
.filterbar--inline { border: 0; padding: 0; margin: 0; background: transparent; }
.filterbar__actions { flex-direction: row; gap: 8px; align-items: center; }
.viewrow__count { font-size: 10.5px; color: var(--ink-55); margin-top: 14px; }

.tlist-wrap { border: var(--line); background: var(--card); margin-top: 16px; overflow-x: auto; }
.tlist { width: 100%; border-collapse: collapse; }
.tlist th {
  text-align: left;
  font-family: var(--f-mono);
  font-size: 9px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--ink-55);
  padding: 10px 12px;
  border-bottom: 2px solid var(--ink);
  background: var(--paper);
  white-space: nowrap;
}
.tlist td { padding: 10px 12px; border-bottom: var(--hair); font-size: 13px; vertical-align: middle; }
.tlist tbody tr:last-child td { border-bottom: 0; }
.tlist tbody tr:hover { background: #fffdf5; }
.tlist__title a { font-weight: 500; border-bottom: 2px solid transparent; }
.tlist__title a:hover { border-bottom-color: var(--red); }
.tlist__id { margin-left: 8px; font-size: 9.5px; color: var(--ink-35); }
.is-overdue { color: var(--red); font-weight: 600; }

.prio {
  font-family: var(--f-mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border: 2px solid var(--ink-35);
  padding: 2px 6px;
  white-space: nowrap;
}
.prio--high { border-color: var(--red); color: var(--red); }
.prio--urgent { background: var(--red); border-color: var(--red); color: #fff; }
.prio--low { color: var(--ink-55); }
.tstatus {
  font-family: var(--f-mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 3px 7px;
  border: 2px solid var(--ink-35);
  white-space: nowrap;
}
.tstatus--doing { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.tstatus--blocked { border-color: var(--red); color: var(--red); }
.tstatus--done { background: var(--yellow); border-color: var(--ink); }
.rolechip {
  font-family: var(--f-mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border: 2px solid var(--ink-35);
  padding: 2px 6px;
}
.rolechip--client { border-color: var(--red); color: var(--red); }
.rolechip--designer { border-color: var(--ink); }

.panel { margin-top: 26px; border: var(--line); background: var(--card); padding: 16px; }
.checkgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.checkitem { display: flex; align-items: center; gap: 8px; border: var(--hair); padding: 7px 9px; font-size: 13px; min-width: 0; }
.checkitem input { width: 16px; height: 16px; accent-color: var(--ink); flex: 0 0 auto; }
.checkitem span { overflow-wrap: anywhere; }
.checkitem span:last-child { margin-left: auto; font-size: 9.5px; color: var(--ink-55); white-space: nowrap; }
@media (max-width: 640px) { .checkgrid { grid-template-columns: 1fr; } }

/* ================================================== M1.7 — 時間軸（全站） */
.tlx { border: var(--line); background: var(--card); margin-top: 16px; }
.tlx__row {
  display: grid;
  grid-template-columns: 120px 62px minmax(0, 1fr) 110px;
  gap: 12px;
  align-items: start;
  padding: 11px 14px;
  border-bottom: var(--hair);
}
.tlx__row:last-child { border-bottom: 0; }
.tlx__time { font-size: 10.5px; color: var(--ink-55); white-space: nowrap; }
.tlx__badge {
  font-family: var(--f-mono);
  font-size: 8.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border: 2px solid var(--ink);
  padding: 2px 6px;
  text-align: center;
  white-space: nowrap;
}
.tlx__row--material .tlx__badge { border-color: var(--red); color: var(--red); }
.tlx__row--milestone .tlx__badge { background: var(--yellow); }
.tlx__body b { font-size: 13.5px; font-weight: 500; overflow-wrap: anywhere; }
.tlx__body span { display: block; margin-top: 3px; font-size: 9.5px; color: var(--ink-55); }
.tlx__body:hover b { border-bottom: 2px solid var(--red); }
.tlx__who { font-size: 9.5px; color: var(--ink-55); text-align: right; }
@media (max-width: 640px) {
  .tlx__row { grid-template-columns: 76px 46px minmax(0, 1fr); gap: 8px; padding: 9px 10px; }
  .tlx__who { display: none; }
}

/* ================================================ P0-4 — 上載 / 版本 / 批核 */
.flash--ok { border-left-color: var(--ink); background: #f4f7f2; }
.uploadpanel .uploadform {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) auto;
  gap: 14px;
  align-items: end;
}
.dropzone {
  display: flex;
  flex-direction: column;
  gap: 6px;
  border: 2px dashed var(--ink-35);
  padding: 18px;
  background: var(--paper);
  cursor: pointer;
  transition: background 120ms linear, border-color 120ms linear;
}
.dropzone.is-over { border-color: var(--red); background: #fdf2f2; }
.dropzone input[type="file"] { font-family: var(--f-mono); font-size: 11px; }
.dropzone__hint { font-family: var(--f-mono); font-size: 10.5px; color: var(--ink-55); }
.dropzone__file { font-size: 11px; color: var(--ink); overflow-wrap: anywhere; }
.vstrip { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.vcell {
  display: flex;
  flex-direction: column;
  gap: 5px;
  border: var(--hair);
  background: var(--paper);
  padding: 9px 10px;
  min-width: 0;
}
.vcell.is-current { border: 2px solid var(--ink); background: #fffdf5; }
.vcell__no { font-size: 14px; font-weight: 600; }
.vcell__file { font-size: 10.5px; overflow-wrap: anywhere; border-bottom: 1px solid transparent; }
.vcell__file:hover { border-bottom-color: var(--red); }
.vcell__meta { font-size: 9px; color: var(--ink-55); }
.vcell__hash { font-size: 8.5px; color: var(--ink-35); }
.vcell__note { font-size: 11.5px; overflow-wrap: anywhere; }
.vcell__note--empty { color: var(--ink-35); }
.vcell__cur { font-size: 9px; color: var(--red); letter-spacing: 0.1em; text-transform: uppercase; }
.inlineform { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.tlist__actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.approvepage { max-width: 860px; padding: 20px 0 40px; }
.approvepreview { border: var(--line); background: var(--paper-2); margin-top: 16px; }
.approvepreview img { width: 100%; display: block; }
.approvepreview iframe { width: 100%; height: 70vh; border: 0; display: block; }
.approvenote { margin-top: 12px; font-size: 13.5px; }
.approveform { margin-top: 20px; border-top: var(--hair); padding-top: 18px; }
.approveform__actions { display: flex; gap: 12px; margin-top: 12px; }
.approveform__actions .btn { flex: 1; justify-content: center; }
@media (max-width: 640px) {
  .uploadpanel .uploadform { grid-template-columns: 1fr; }
  .approveform__actions { flex-direction: column; }
}

/* fixes: material version stamp width + toast over modal footer */
.vcell .stamp { align-self: flex-start; }
body.modal-open .toast { top: 16px; bottom: auto; }

/* ====================================================== M1.6 — P1 四項 */
.viewrow { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-top: 14px; }
.viewtoggle { display: flex; border: 2px solid var(--ink); }
.viewtoggle a {
  padding: 7px 14px;
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border-right: 2px solid var(--ink);
  color: var(--ink-70);
}
.viewtoggle a:last-child { border-right: 0; }
.viewtoggle a:hover { background: var(--ink-08); color: var(--ink); }
.viewtoggle a.is-on { background: var(--ink); color: var(--paper); }
.kcol__head .count i { font-style: normal; color: var(--ink-35); }
.kcol__head.is-over { background: #fdf2f2; border-bottom-color: var(--red); }
.kcol__head.is-over .count { color: var(--red); font-weight: 600; }
.kcol__head.is-over h2::after { content: " · 超 WIP"; color: var(--red); font-size: 9px; }
.tcard__pick, .trow__pick { width: 16px; height: 16px; accent-color: var(--ink); flex: 0 0 auto; }
.tcard__top { align-items: center; }
.tcard__due { margin-left: auto; }
.linkish { border: 0; background: none; font: inherit; text-align: left; cursor: pointer; padding: 0; border-bottom: 2px solid transparent; }
.linkish:hover { border-bottom-color: var(--red); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.bulkbar {
  position: sticky;
  bottom: 12px;
  z-index: 30;
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 18px;
  padding: 12px 14px;
  border: var(--line);
  background: var(--yellow);
}
.bulkbar[hidden] { display: none; }
.bulkbar .field { min-width: 120px; }
.bulkbar .field > span { color: var(--ink-70); }
.bulkbar__n { font-size: 11px; }
.bulkbar__n b { font-size: 16px; }
.bulkbar__hint { font-size: 10px; color: var(--ink-70); }
.tlist-wrap--tasks .tlist td { padding: 9px 12px; }
.tlist__pick { width: 34px; text-align: center; }

/* ==================================================== M2 — 版本對比 / P1 */
.comparegrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 18px; }
.comparepanel { border: var(--line); background: var(--card); min-width: 0; }
.comparepanel__head { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-bottom: 2px solid var(--ink); background: var(--paper); }
.comparepanel__head .mini { margin-left: auto; }
.comparepanel__body { min-height: 240px; background: var(--paper-2); }
.comparepanel__body img { width: 100%; display: block; }
.comparepanel__body iframe { width: 100%; height: 480px; border: 0; display: block; }
.is-diff { background: #fdf2f2; font-weight: 600; }
.vcell__acts { display: flex; flex-wrap: wrap; gap: 4px; }
.mini--off { border-color: var(--ink-35); color: var(--ink-35); }
@media (max-width: 900px) { .comparegrid { grid-template-columns: 1fr; } }

/* ---- 版本史 + 文字 diff（2026-11-07） ---- */
.vhist { list-style: none; }
.vhist__row {
  display: grid; grid-template-columns: 56px minmax(0, 1fr) auto auto;
  gap: 10px 14px; align-items: start; padding: 12px 0; border-bottom: var(--hair);
}
.vhist__row:last-child { border-bottom: 0; }
.vhist__row.is-current { background: #fdf8e6; }
.vhist__no { font-size: 13px; font-weight: 600; }
.vhist__main { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.vhist__file { font-size: 13px; overflow-wrap: anywhere; }
.vhist__meta { font-size: 9.5px; color: var(--ink-55); }
.vhist__note { font-size: 11.5px; color: var(--ink-70, #46525f); }
.vhist__acts { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.vhist__acts form { display: inline; }
.diff {
  margin: 0; overflow: auto; max-height: 460px; background: var(--paper);
  border: var(--hair); padding: 10px 12px;
  font-family: var(--f-mono); font-size: 10.5px; line-height: 1.5; white-space: pre;
}
.diff__l { display: block; }
.diff__l--add { background: #e6f4e6; }
.diff__l--del { background: #fbe9e9; }
.diff__l--ctx { color: var(--ink-55); }
@media (max-width: 640px) {
  .vhist__row { grid-template-columns: 44px minmax(0, 1fr); }
  .vhist__acts { grid-column: span 2; justify-content: flex-start; }
}

/* ---- 弱網：看板「睇多」、/tasks 分頁、材料縮圖（2026-11-07） ---- */
.kcol__more { margin: 10px 0 4px; width: 100%; }
.pager { display: flex; gap: 10px; align-items: center; justify-content: center; padding: 18px 0 8px; }
.pager .mono { font-size: 10px; color: var(--ink-55); }
.thumbgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; margin-top: 12px; }
.thumbcard {
  display: flex; flex-direction: column; gap: 6px; border: var(--line);
  background: var(--paper); padding: 8px; text-decoration: none; color: inherit;
}
.thumbcard:hover { border-color: var(--ink); }
.thumbcard__img { display: block; aspect-ratio: 16 / 9; overflow: hidden; background: #f2efe6; border: var(--hair); }
.thumbcard__img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumbcard__t { font-size: 12px; overflow-wrap: anywhere; }
.thumbcard__m { font-size: 9px; color: var(--ink-55); }

/* ---- 目錄瀏覽 / 分享掣（2026-11-07） ---- */
.dirlist { list-style: none; margin-top: 10px; }
.dirrow {
  display: flex; align-items: center; gap: 10px; padding: 12px 6px;
  border-bottom: var(--hair); text-decoration: none; color: inherit;
}
.dirrow:last-child { border-bottom: 0; }
.dirrow:hover, .dirrow:focus-visible { background: #fdf8e6; outline: 2px solid var(--ink); outline-offset: -2px; }
.dirrow__icon { font-size: 14px; }
.dirrow__name { font-size: 13px; flex: 1; min-width: 0; overflow-wrap: anywhere; }
.dirrow__meta { font-size: 9.5px; color: var(--ink-55); white-space: nowrap; }
.pathlink { border-bottom: 1px solid var(--ink); text-decoration: none; color: inherit; }
.pathlink:hover, .pathlink:focus-visible { background: var(--yellow); }
.sharepanel { border: var(--line); background: var(--card); margin-top: 18px; }
.sharepanel__sum { display: flex; gap: 12px; align-items: center; padding: 12px 14px; cursor: pointer; list-style: none; }
.sharepanel__sum::-webkit-details-marker { display: none; }
.sharepanel__sum::after { content: "▾"; margin-left: auto; font-size: 11px; color: var(--ink-55); }
.sharepanel[open] .sharepanel__sum::after { content: "▴"; }
.sharepanel__hint { font-size: 9.5px; color: var(--ink-55); }
.sharepanel__body { padding: 0 14px 14px; border-top: var(--hair); }
.sharepanel__body .panel { border: 0; padding: 14px 0 0; margin: 0; }

/* ---- 修：390 彈窗橫向溢出（panel 被內容 min-width 撐到 1020px） ---- */
.modal { max-width: 100vw; overflow-x: hidden; }
.modal__panel { max-width: 100vw; min-width: 0; overflow: hidden; }
.modal__form, .modal__scroll, .acc-list, .acc, .mgrid, .field { min-width: 0; }
.modal__scroll { overflow-x: hidden; }
.drf, .drf select, .drf input { min-width: 0; max-width: 100%; }
.dr-tail { min-width: 0; }
.acc__sum { min-width: 0; }
.acc__sum .mgroup__head { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acc__n { flex: 0 0 auto; }
.pcard__code { font-size: 9.5px; letter-spacing: 0.08em; color: var(--ink-55); margin-left: 8px; }

/* ------------------------------------------------ 今日 / 查詢收件匣（INBOX） */
.todayhead { margin-bottom: 10px; }
.todaygroup { border-top: var(--line); padding: 10px 0 4px; }
.todaygroup__head { display: flex; align-items: baseline; gap: 10px; padding: 4px 0 4px; }
.todaygroup__head h2 { margin: 0; font-size: 15px; }
.todaygroup__head .count { color: var(--ink-55); font-family: var(--f-mono); font-size: 12px; }
.todayrow { display: flex; align-items: baseline; gap: 10px; padding: 9px 2px; min-height: 40px;
  border-bottom: 1px dashed var(--ink-15); color: inherit; text-decoration: none; }
.todayrow:hover { background: #faf9f6; }
.todayrow__t { font-weight: 600; font-size: 14px; }
.todayrow__m { color: var(--ink-55); font-size: 12px; }
.todayrow__d { margin-left: auto; color: var(--ink-55); font-family: var(--f-mono); font-size: 12px; white-space: nowrap; }
.todayrow__d.red { color: var(--red); font-weight: 700; }
.todayempty { color: var(--ink-55); font-size: 13px; padding: 10px 2px; margin: 0; }
.morelink { display: inline-block; margin: 6px 0 2px; color: var(--ink-55); font-size: 12px; text-decoration: underline dotted; }
.inbox-tabs { margin: 6px 0 14px; }
.inqgrid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
.inqdl { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 16px; margin: 0; }
.inqdl dt { font-size: 11px; color: var(--ink-55); }
.inqdl dd { margin: 2px 0 0; font-size: 14px; word-break: break-all; }
.inqmsg { white-space: pre-wrap; margin: 0; font-size: 14px; line-height: 1.55; }
.inqnotes { list-style: none; margin: 12px 0 0; padding: 0; }
.inqnote { display: flex; gap: 10px; padding: 8px 0; border-top: 1px dashed var(--ink-15); font-size: 13px; align-items: baseline; }
.inqnote .mono { color: var(--ink-55); font-size: 11px; white-space: nowrap; }
.inqnote__kind { color: var(--ink-55); font-size: 11px; }
.inqnote__body { flex: 1; }
.inqactions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
@media (max-width: 900px) {
  .inqgrid { grid-template-columns: minmax(0, 1fr); }
  .todayrow { flex-wrap: wrap; }
  .todayrow__d { margin-left: 0; }
}

/* T1：項目卡 4 點 */
.pcard--lean { display: grid; grid-template-columns: minmax(0,1fr) auto; grid-template-areas: "name arrow" "event arrow" "status arrow"; gap: 2px 12px; align-items: start; }
.pcard--lean .pcard__name { grid-area: name; margin: 0; }
.pcard--lean .pcard__event { grid-area: event; margin: 4px 0 0; color: var(--ink-55); font-size: 12px; }
.pcard--lean .pcard__status { grid-area: status; margin: 8px 0 0; font-size: 13px; }
.pcard--lean .pcard__go { grid-area: arrow; align-self: center; }

/* T1：材料詳情第一格＝現行版本 */
.currentver { border: 2px solid var(--ink); }
.currentver .section-head { margin-bottom: 10px; }
.currentver__body { display: flex; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.currentver__body > div:first-child { flex: 1; min-width: 0; }
.currentver__file { margin: 0; font-size: 18px; font-weight: 700; letter-spacing: -.01em; overflow-wrap: anywhere; }
.currentver__meta { margin: 6px 0 0; color: var(--ink-55); font-size: 12px; }
.currentver__acts { display: flex; gap: 8px; align-items: center; }

/* T1：項目頁一句狀態＋篩選抽屜 */
.projline { margin: 8px 0 0; font-size: 14px; font-weight: 600; }
.filterdrawer { margin: 6px 0 10px; }
.filterdrawer > summary { list-style: none; width: max-content; cursor: pointer; }
.filterdrawer > summary::-webkit-details-marker { display: none; }
.filterdrawer[open] .filterbar { margin-top: 10px; }
