/* CSG portal. Its own look: a light labelled sidebar, one "start here" card, a week you can see at a glance,
   and a colour per project (--c strong, --cb pale) carried through every list, calendar and roadmap. No gradients. */
:root {
  --ink: #2b0a10; --crimson: #c51d39; --crimson-d: #a5132c; --deep: #2a0508; --side-w: 252px; --max: 1160px;
  --paper: #faf6f3; --card: #ffffff; --line: #ece2dd; --line-2: #f3ebe7; --muted: #654a4f; --dim: #8d7479; --soft: #fbf8f6;
  --ok: #2f7a45; --ok-b: #e0efe3; --warn: #96590c; --warn-b: #f8ebd2; --blue: #2f5d8a; --blue-b: #e4edf5; --red-b: #f8e6e8;
  --c: #8f1023; --cb: #f8e6e8;
  --shadow: 0 1px 2px rgba(43, 10, 16, .04), 0 10px 28px -18px rgba(43, 10, 16, .22);
}
*, *::before, *::after { box-sizing: border-box; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 14.5px/1.5 'Inter', system-ui, sans-serif; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, h4, p { margin: 0; }
a { color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--crimson); outline-offset: 2px; }
.ws { font-family: 'MuseoModerno', 'Inter', sans-serif; font-weight: 200; letter-spacing: .01em; }

/* ---------- shell ---------- */
.app { display: flex; min-height: 100vh; padding-left: var(--side-w); }
.side { position: fixed; z-index: 40; inset: 0 auto 0 0; width: var(--side-w); display: flex; flex-direction: column; gap: 4px; padding: 22px 14px 14px; background: #fff; border-right: 1px solid var(--line); overflow-y: auto; }
.logo { display: flex; align-items: flex-end; gap: 9px; margin: 0 8px 22px; text-decoration: none; }
.logo .mark { width: 58px; height: 32px; background: var(--crimson); -webkit-mask: url(/csg-mark-white.png) left center / contain no-repeat; mask: url(/csg-mark-white.png) left center / contain no-repeat; }
.logo .ws { font-size: 24px; line-height: 1.02; color: var(--crimson); }
.nav, .plist { display: flex; flex-direction: column; gap: 2px; }
.nav-a, .p-a { display: flex; align-items: center; gap: 11px; min-height: 40px; padding: 8px 10px; border-radius: 11px; color: var(--muted); font-weight: 600; text-decoration: none; transition: background-color .15s, color .15s; }
.nav-a svg { width: 19px; height: 19px; flex: none; }
.nav-a:hover, .p-a:hover { background: #f6efec; color: var(--ink); }
.nav-a[aria-current="page"] { background: var(--ink); color: #fff; }
.nav-a .count { margin-left: auto; min-width: 22px; padding: 1px 7px; border-radius: 999px; background: var(--crimson); color: #fff; font: 700 11.5px/1.6 'Inter', sans-serif; text-align: center; }
.nav-a[aria-current="page"] .count { background: #fff; color: var(--ink); }
.side-h { margin: 22px 10px 6px; font: 700 12px 'Inter', sans-serif; color: var(--dim); }
.p-a { min-height: 36px; padding: 6px 10px; font-weight: 500; font-size: 14px; }
.p-a span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.p-a[aria-current="page"] { background: var(--cb); color: var(--ink); font-weight: 700; }
.pdot { width: 10px; height: 10px; flex: none; margin: 0 4px; border-radius: 3px; background: var(--c); }
.p-a em { flex: none; padding: 1px 7px; border-radius: 999px; font: 700 10.5px/1.6 'Inter', sans-serif; font-style: normal; }
.p-a em.h-risk { background: var(--warn-b); color: var(--warn); } .p-a em.h-blocked { background: var(--red-b); color: var(--crimson); }
.p-a.soon { color: var(--dim); }
.me { display: flex; align-items: center; gap: 10px; margin-top: auto; padding: 10px; border: 1px solid var(--line); border-radius: 13px; background: #fff; text-align: left; transition: border-color .15s; }
.me:hover { border-color: var(--ink); }
.me b { display: block; font-size: 13.5px; line-height: 1.25; } .me small { display: block; font-size: 12px; color: var(--dim); }
.me > span:last-child { min-width: 0; overflow: hidden; }
.tabs { display: none; }
.main { --gut: max(32px, calc((100% - var(--max)) / 2)); flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 10px; padding: 12px var(--gut); background: rgba(250, 246, 243, .94); }
.q-wrap { position: relative; flex: 1; max-width: 460px; }
.q-wrap > svg { position: absolute; left: 13px; top: 50%; width: 16px; height: 16px; margin-top: -8px; color: var(--dim); pointer-events: none; }
.q-wrap input[type="search"] { margin: 0; padding: 10px 12px 10px 38px; border-radius: 999px; border-color: var(--line); background: #fff; }
.q-res, .menu { position: absolute; z-index: 60; top: calc(100% + 8px); left: 0; right: 0; padding: 6px; border: 1px solid var(--line); border-radius: 14px; background: #fff; box-shadow: 0 24px 50px -22px rgba(43, 10, 16, .4); }
.menu { left: auto; right: 0; width: 260px; }
.q-item, .menu button { display: flex; align-items: center; gap: 11px; width: 100%; padding: 9px 10px; border: 0; border-radius: 9px; background: none; text-align: left; text-decoration: none; }
.q-item:hover, .menu button:hover { background: #f6efec; }
.q-item svg, .menu svg { width: 17px; height: 17px; flex: none; color: var(--dim); }
.q-item b, .menu b { display: block; font-weight: 600; font-size: 14px; } .q-item small, .menu small { display: block; font-size: 12px; color: var(--dim); }
.q-item span, .menu button span { min-width: 0; }
.q-none { padding: 12px; color: var(--dim); font-size: 13.5px; }
.bar-r { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.new-wrap { position: relative; }
.who { display: none; place-items: center; width: 38px; height: 38px; flex: none; padding: 0; border: 0; border-radius: 50%; background: var(--ink); color: #fff; font: 700 12px 'Inter', sans-serif; }
.head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 24px; padding: 14px var(--gut) 8px; }
.head h1 { font: 700 clamp(1.75rem, 2.6vw, 2.2rem)/1.1 'MuseoModerno', 'Inter', sans-serif; letter-spacing: -.01em; }
.head h1 .hdot { display: inline-block; width: 14px; height: 14px; margin-right: 10px; border-radius: 4px; background: var(--c); }
.head p { margin-top: 7px; max-width: 46rem; color: var(--muted); }
.head .back { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 8px; color: var(--crimson); font-weight: 600; font-size: 13px; text-decoration: none; }
.head .back svg { width: 14px; height: 14px; }
.head .back:hover { text-decoration: underline; }
.tool-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; }
.content { display: flex; flex-direction: column; gap: 20px; padding: 14px var(--gut) 48px; outline: none; }
.foot { margin-top: auto; padding: 18px var(--gut) 26px; font-size: 12.5px; color: var(--dim); }

/* ---------- parts ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 18px; border: 1px solid var(--crimson); border-radius: 999px; background: var(--crimson); color: #fff; font: 700 13px 'Inter', sans-serif; text-decoration: none; white-space: nowrap; transition: background-color .15s, color .15s, border-color .15s, transform .1s; }
.btn:hover { background: var(--crimson-d); border-color: var(--crimson-d); }
.btn:active { transform: scale(.98); }
.btn[disabled] { opacity: .55; cursor: default; }
.btn.ghost { background: #fff; color: var(--ink); border-color: #dccfca; }
.btn.ghost:hover { border-color: var(--ink); background: #fff; }
.btn.sm { padding: 7px 13px; font-size: 12.5px; }
.btn.lg { padding: 13px 24px; font-size: 14.5px; }
.btn.quiet { padding: 6px 10px; border-color: transparent; background: none; color: var(--crimson); }
.btn.quiet:hover { background: rgba(143, 16, 35, .08); }
.btn svg { width: 15px; height: 15px; flex: none; }
.icon-btn { display: inline-grid; place-items: center; width: 30px; height: 30px; flex: none; padding: 0; border: 0; border-radius: 8px; background: none; color: var(--dim); text-decoration: none; }
.icon-btn:hover { background: #f4ece9; color: var(--ink); }
.icon-btn svg { width: 16px; height: 16px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { padding: 6px 12px; border: 1px solid #e3d8d3; border-radius: 999px; background: #fff; color: var(--muted); font: 600 12.5px 'Inter', sans-serif; transition: background-color .15s, color .15s, border-color .15s; }
.chip:hover { border-color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.seg { display: inline-flex; padding: 3px; border-radius: 999px; background: #f1e9e5; }
.seg button { padding: 5px 12px; border: 0; border-radius: 999px; background: none; color: var(--muted); font: 600 12.5px 'Inter', sans-serif; }
.seg button[aria-pressed="true"] { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(43, 10, 16, .14); }
.seg button.h-on[aria-pressed="true"] { color: #1f5c33; } .seg button.h-risk[aria-pressed="true"] { color: var(--warn); } .seg button.h-blocked[aria-pressed="true"] { color: var(--crimson); }
.panel { min-width: 0; padding: 18px 20px 20px; border-radius: 18px; background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); }
.ph { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 16px; margin-bottom: 10px; }
.ph h2 { font: 700 16px/1.2 'Inter', sans-serif; letter-spacing: -.01em; }
.ph .sub { font: 400 12.5px 'Inter', sans-serif; color: var(--dim); }
.ph .ph-tools { display: flex; align-items: center; gap: 4px; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.stack { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.empty { padding: 12px 2px 4px; color: var(--dim); font-size: 13.5px; }
.group-h { margin: 16px 0 4px; font: 700 12.5px 'Inter', sans-serif; color: var(--dim); }
.group-h:first-child { margin-top: 0; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; background: #f1e9e6; color: var(--muted); font: 600 11.5px/1.5 'Inter', sans-serif; white-space: nowrap; }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill.s-doing { background: var(--blue-b); color: var(--blue); }
.pill.s-review, .pill.h-risk { background: var(--warn-b); color: var(--warn); }
.pill.s-changes, .pill.late, .pill.h-blocked { background: var(--red-b); color: var(--crimson); }
.pill.s-done, .pill.h-on { background: var(--ok-b); color: #1f5c33; }
.tag { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 2px 9px; border-radius: 7px; background: var(--cb); color: var(--ink); font: 600 11.5px/1.6 'Inter', sans-serif; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; vertical-align: middle; }
.tag::before { content: ""; width: 7px; height: 7px; flex: none; border-radius: 2px; background: var(--c); }
.tag.flat { background: #f4ece9; color: var(--muted); } .tag.flat::before { display: none; }

/* ---------- rows ---------- */
.rows { display: flex; flex-direction: column; }
.row { display: flex; align-items: center; gap: 12px; min-width: 0; padding: 10px 2px; border-top: 1px solid var(--line-2); }
.rows > .row:first-child, .group-h + .row { border-top: 0; }
.row.click { width: 100%; padding: 10px 8px; border-left: 0; border-right: 0; border-bottom: 0; background: none; text-align: left; border-radius: 10px; }
.row.click:hover { background: var(--soft); }
.rmain { flex: 1; min-width: 0; }
.rt { font-weight: 600; overflow-wrap: anywhere; }
.rs { margin-top: 1px; font-size: 12.5px; color: var(--dim); overflow-wrap: anywhere; }
.rs .late-t { color: var(--crimson); font-weight: 600; }
.row.is-done .rt { color: var(--dim); text-decoration: line-through; }
.tick { display: grid; place-items: center; width: 24px; height: 24px; flex: none; padding: 0; border: 2px solid #cfbdb8; border-radius: 50%; background: #fff; color: #fff; transition: border-color .15s, background-color .15s; }
.tick:not([disabled]):hover { border-color: var(--ink); }
.tick[disabled] { cursor: default; opacity: .7; }
.tick svg { width: 13px; height: 13px; }
.tick.t-doing { border-color: var(--blue); }
.tick.t-doing::after { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--blue); }
.tick.t-done { border-color: var(--ok); background: var(--ok); }
.tick.sm { width: 18px; height: 18px; border-width: 1.5px; } .tick.sm svg { width: 10px; height: 10px; } .tick.sm.t-doing::after { width: 8px; height: 8px; }
.dt { display: grid; place-items: center; width: 46px; flex: none; padding: 5px 0 6px; border-radius: 11px; background: var(--cb); line-height: 1.1; text-align: center; }
.dt b { font: 700 17px 'Inter', sans-serif; }
.dt span { font: 600 10.5px 'Inter', sans-serif; color: var(--c); }
.av { display: inline-grid; place-items: center; width: 28px; height: 28px; flex: none; border-radius: 50%; background: #efe5e1; color: var(--ink); font: 700 10.5px 'Inter', sans-serif; }
.av.lg { width: 36px; height: 36px; font-size: 12.5px; background: var(--ink); color: #fff; }
.avs { display: flex; }
.avs .av { margin-left: -6px; border: 2px solid #fff; width: 30px; height: 30px; }
.avs .av:first-child { margin-left: 0; }

/* ---------- home: start here ---------- */
.hero { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); border-radius: 22px; background: var(--cb); overflow: hidden; }
.hero-main { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; padding: 26px 28px 28px; }
.hero-main h2 { font: 700 clamp(1.45rem, 2.3vw, 1.9rem)/1.15 'MuseoModerno', 'Inter', sans-serif; letter-spacing: -.01em; overflow-wrap: anywhere; }
.hero-main p { max-width: 38rem; color: var(--muted); overflow-wrap: anywhere; }
.hero-main .pill { background: #fff; color: var(--c); }
.hero-acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.hero-acts .btn:not(.ghost) { background: var(--c); border-color: var(--c); }
.hero-acts .btn.ghost { background: transparent; border-color: rgba(43, 10, 16, .25); }
.hero-then { margin: 10px; padding: 16px 16px 12px; border-radius: 15px; background: #fff; }
.hero-then h3 { margin-bottom: 4px; font: 700 13.5px 'Inter', sans-serif; }
.then { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 6px; border: 0; border-top: 1px solid var(--line-2); border-radius: 0; background: none; text-align: left; }
.hero-then h3 + .then { border-top: 0; }
.then:hover { background: var(--soft); }
.then i { width: 8px; height: 8px; flex: none; border-radius: 2px; background: var(--c); }
.then span { min-width: 0; }
.then b { display: block; font-weight: 600; font-size: 13.5px; overflow-wrap: anywhere; } .then small { display: block; font-size: 12px; color: var(--dim); }
.hero.clear { display: block; padding: 28px; background: var(--ok-b); }
.hero.clear h2 { font: 700 1.6rem/1.15 'MuseoModerno', 'Inter', sans-serif; }
.hero.clear p { margin-top: 8px; color: #2d4a35; max-width: 40rem; }

/* ---------- home: the week ---------- */
.week-h { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-bottom: 14px; }
.week-h h2 { font: 700 16px 'Inter', sans-serif; }
.week-h .sub { font-size: 13px; color: var(--dim); }
.week-h .sp { flex: 1; }
.days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.day { display: flex; flex-direction: column; gap: 6px; min-height: 148px; padding: 8px; border-radius: 14px; background: var(--soft); border: 1px solid var(--line-2); }
.day.today { background: #fff; border-color: var(--crimson); box-shadow: 0 0 0 1px var(--crimson); }
.day.past { opacity: .62; }
.dh { display: flex; align-items: center; justify-content: space-between; padding: 0 2px 2px; }
.dh span { font: 700 12px 'Inter', sans-serif; color: var(--dim); }
.dh b { display: inline-grid; place-items: center; min-width: 26px; height: 26px; border-radius: 13px; font: 700 13.5px 'Inter', sans-serif; }
.day.today .dh b { background: var(--crimson); color: #fff; }
.day.today .dh span { color: var(--crimson); }
.it { display: flex; align-items: flex-start; gap: 7px; min-width: 0; padding: 7px 8px; border: 0; border-left: 3px solid var(--c); border-radius: 8px; background: var(--cb); font: 600 12.5px/1.35 'Inter', sans-serif; text-align: left; color: var(--ink); }
.it > span { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.it.is-done > span { color: var(--dim); text-decoration: line-through; }
.it.none { --c: #b9a7a2; --cb: #f1eae7; }
.it.dv { width: 100%; border-left: 0; background: var(--c); color: #fff; }
.it.dv:hover { filter: brightness(.92); }
.it.dv svg { width: 13px; height: 13px; flex: none; margin-top: 2px; }
.it.dv.s-done { background: var(--ok); }
.it .av { width: 18px; height: 18px; font-size: 8.5px; background: #fff; }
.it .ed { flex: none; width: 18px; height: 18px; padding: 0; border: 0; border-radius: 5px; background: none; color: var(--c); opacity: 0; }
.it:hover .ed, .it .ed:focus-visible { opacity: 1; }
.it .ed svg { width: 12px; height: 12px; }
.day-add { margin-top: auto; padding: 4px; border: 1px dashed #d9cbc6; border-radius: 8px; background: none; color: var(--dim); font: 600 12px 'Inter', sans-serif; opacity: 0; transition: opacity .15s; }
.day:hover .day-add, .day-add:focus-visible { opacity: 1; }
.day-add:hover { border-color: var(--ink); color: var(--ink); }
.anytime { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line-2); }
.anytime > b { font: 700 12.5px 'Inter', sans-serif; color: var(--dim); }
.anytime .it { max-width: 320px; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 12px; font-size: 12px; color: var(--dim); }
.legend i { display: inline-block; width: 10px; height: 10px; margin-right: 6px; border-radius: 3px; background: var(--c); vertical-align: -1px; }

/* ---------- projects ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(310px, 100%), 1fr)); gap: 16px; }
.pcard { position: relative; display: flex; flex-direction: column; gap: 11px; padding: 24px 20px 18px; border: 1px solid var(--line); border-radius: 18px; background: #fff; box-shadow: var(--shadow); text-align: left; text-decoration: none; overflow: hidden; transition: transform .15s, box-shadow .15s; }
.pcard::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 6px; background: var(--c); }
.pcard:hover { transform: translateY(-2px); box-shadow: 0 2px 4px rgba(43, 10, 16, .05), 0 22px 40px -22px rgba(43, 10, 16, .35); }
.pcard h3 { font: 700 19px/1.2 'MuseoModerno', 'Inter', sans-serif; }
.pcard .meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; font-size: 12.5px; color: var(--dim); }
.pcard .next { font-size: 13.5px; color: var(--muted); }
.pcard .foot-r { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: auto; padding-top: 4px; }
.mini { display: flex; gap: 3px; }
.mini i { flex: 1; height: 7px; border-radius: 4px; background: #eadfdb; }
.mini i.s-doing { background: var(--blue); } .mini i.s-review { background: #d39a3a; } .mini i.s-done { background: var(--ok); } .mini i.s-changes, .mini i.late { background: var(--crimson); }
.section-h { margin: 8px 0 -6px; font: 700 14px 'Inter', sans-serif; color: var(--muted); }
.summary { color: var(--muted); white-space: pre-wrap; overflow-wrap: anywhere; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 7px 14px; margin-top: 14px; font-size: 13px; align-items: center; }
.facts dt { color: var(--dim); }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.road { position: relative; height: 74px; margin: 6px 12px 0; }
.road-line { position: absolute; left: 0; right: 0; top: 20px; height: 6px; border-radius: 3px; background: #efe6e2; overflow: hidden; }
.road-line i { display: block; height: 100%; background: var(--c); opacity: .35; }
.road-m { position: absolute; top: 40px; padding-left: 6px; border-left: 1px solid #dccfca; font: 600 11.5px/1.5 'Inter', sans-serif; color: var(--dim); white-space: nowrap; }
.road-today { position: absolute; top: 6px; width: 2px; height: 34px; margin-left: -1px; background: var(--ink); }
.road-today em { position: absolute; top: -18px; left: 50%; transform: translateX(-50%); padding: 0 7px; border-radius: 999px; background: var(--ink); color: #fff; font: 700 10.5px/1.6 'Inter', sans-serif; font-style: normal; white-space: nowrap; }
.road-dot { position: absolute; top: 13px; width: 20px; height: 20px; margin-left: -10px; padding: 0; border: 3px solid var(--c); border-radius: 50%; background: #fff; transition: transform .12s; }
.road-dot:hover, .road-dot:focus-visible { transform: scale(1.3); z-index: 2; }
.road-dot.s-doing { background: var(--cb); } .road-dot.s-review { border-color: #d39a3a; background: var(--warn-b); } .road-dot.s-done { border-color: var(--ok); background: var(--ok); } .road-dot.s-changes, .road-dot.late { border-color: var(--crimson); background: var(--red-b); }
.upd { padding: 12px 0; border-top: 1px solid var(--line-2); }
.upd:first-child { border-top: 0; padding-top: 2px; }
.upd .uh { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 12.5px; color: var(--dim); }
.upd .uh b { color: var(--ink); font-size: 13.5px; }
.upd p { margin-top: 5px; white-space: pre-wrap; overflow-wrap: anywhere; }
.composer textarea { width: 100%; min-height: 78px; }
.composer .cf { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin: 8px 0 14px; }

/* ---------- links ---------- */
.lrow { display: flex; align-items: center; gap: 12px; min-width: 0; padding: 9px 2px; border-top: 1px solid var(--line-2); }
.lrow:first-child { border-top: 0; }
.lrow a.lmain { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; text-decoration: none; }
.lrow a.lmain:hover .rt { color: var(--crimson); text-decoration: underline; }
.lk { display: grid; place-items: center; width: 36px; height: 36px; flex: none; border-radius: 10px; background: #f4ece9; color: var(--muted); }
.lk svg { width: 17px; height: 17px; }
.lk.k-doc, .lk.k-outlook { background: var(--blue-b); color: var(--blue); } .lk.k-sheet { background: var(--ok-b); color: #1f5c33; } .lk.k-slides { background: var(--warn-b); color: var(--warn); } .lk.k-drive { background: #efe5e1; color: var(--ink); }
.search { width: 100%; max-width: 380px; }

/* ---------- calendar ---------- */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-top: 1px solid var(--line); border-left: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.cal .dow { padding: 6px 8px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--soft); font: 700 11px 'Inter', sans-serif; color: var(--dim); }
.cal .cday { min-height: 96px; padding: 5px 6px 7px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: #fff; }
.cal .cday.out { background: var(--soft); }
.cal .cday .n { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 4px; border-radius: 11px; font: 600 12px 'Inter', sans-serif; color: var(--muted); }
.cal .cday.today .n { background: var(--crimson); color: #fff; }
.cal .ev { display: block; width: 100%; margin-top: 3px; padding: 3px 6px; border: 0; border-radius: 6px; background: var(--c); color: #fff; font: 600 11.5px/1.3 'Inter', sans-serif; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal .ev.s-done { background: var(--ok); }
.cal .ev.task { border-left: 3px solid var(--c); background: var(--cb); color: var(--ink); cursor: default; }
.cal-nav { display: flex; align-items: center; gap: 6px; }
.cal-nav b { min-width: 9.5em; text-align: center; font-size: 14px; }

/* ---------- tables ---------- */
.tbl { width: 100%; border-collapse: collapse; }
.tbl th { padding: 6px 10px 8px 2px; border-bottom: 1px solid var(--line); font: 700 11.5px 'Inter', sans-serif; color: var(--dim); text-align: left; white-space: nowrap; }
.tbl td { padding: 10px 10px 10px 2px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl .acts { text-align: right; white-space: nowrap; }
.tbl th:first-child { width: 34%; }
.tbl th:nth-child(2) { width: 30%; }
.tbl tr.off td { color: var(--dim); }
.pname { display: flex; align-items: center; gap: 10px; min-width: 0; }
.scroll-x { overflow-x: auto; }

/* ---------- forms ---------- */
label.f { display: block; margin-top: 12px; font: 600 12.5px 'Inter', sans-serif; color: var(--muted); }
.f .hint { display: block; margin-top: 4px; font-weight: 400; color: var(--dim); }
input[type="text"], input[type="email"], input[type="password"], input[type="url"], input[type="date"], input[type="search"], select, textarea { display: block; width: 100%; margin-top: 5px; padding: 9px 11px; border: 1px solid #dccfca; border-radius: 10px; background: #fff; font: 400 14.5px/1.4 'Inter', sans-serif; color: var(--ink); }
textarea { min-height: 92px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--crimson); outline-offset: 0; border-color: var(--crimson); }
.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 4px 12px; margin-top: 6px; max-height: 190px; overflow: auto; padding: 8px 10px; border: 1px solid #dccfca; border-radius: 10px; }
.checks label, .radio label { display: flex; align-items: center; gap: 7px; font: 400 13.5px 'Inter', sans-serif; color: var(--ink); }
.radio { display: flex; flex-wrap: wrap; gap: 6px 14px; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--crimson); }
.err { margin-top: 12px; padding: 9px 12px; border-radius: 10px; background: var(--red-b); color: var(--crimson); font-weight: 600; font-size: 13px; }
.copy { display: flex; gap: 8px; margin-top: 6px; }
.copy input { margin: 0; font-size: 12.5px; }
.note { margin-top: 12px; padding: 10px 12px; border-radius: 10px; background: var(--soft); border: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.note.red { background: var(--red-b); border-color: rgba(143, 16, 35, .2); color: var(--ink); }

/* ---------- modal and drawer ---------- */
.modal-wrap, .drawer-wrap { position: fixed; inset: 0; z-index: 80; background: rgba(42, 5, 8, .42); }
.modal-wrap { display: grid; place-items: center; padding: 20px; overflow: auto; }
.modal { display: flex; flex-direction: column; width: min(540px, 100%); max-height: calc(100vh - 40px); max-height: calc(100dvh - 40px); padding: 22px 0 0; border-radius: 20px; background: #fff; box-shadow: 0 30px 70px -25px rgba(42, 5, 8, .5); }
.modal .mh, .modal .mb, .modal .mf { padding-left: 24px; padding-right: 24px; }
.modal .mb { flex: 1; min-height: 0; overflow: auto; padding-bottom: 4px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 14px; align-content: start; }
.modal .mb > * { grid-column: 1 / -1; }
.modal .mb > .half { grid-column: auto; }
.modal .mb > label.f:first-child { margin-top: 0; }
.modal h2, .drawer h2 { font: 700 22px/1.2 'MuseoModerno', 'Inter', sans-serif; }
.modal .mh, .drawer .mh { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.modal .mf { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-top: 14px; padding-top: 14px; padding-bottom: 18px; border-top: 1px solid var(--line); }
.modal .mf .left { margin-right: auto; }
.drawer { position: absolute; inset: 0 0 0 auto; width: min(540px, 100%); padding: 0 26px 30px; background: #fff; overflow: auto; box-shadow: -20px 0 60px -30px rgba(42, 5, 8, .5); animation: slide .18s ease-out; }
.drawer .dtop { margin: 0 -26px 16px; padding: 22px 26px 18px; background: var(--cb); }
.drawer .dtop .mh { margin-bottom: 10px; }
@keyframes slide { from { transform: translateX(24px); } }
.drawer h3 { margin: 22px 0 8px; font: 700 14px 'Inter', sans-serif; }
.drawer .dmeta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.drawer .dtop .pill { background: #fff; }
.steps { display: flex; gap: 4px; margin-top: 16px; }
.steps span { flex: 1; padding-top: 7px; border-top: 4px solid rgba(43, 10, 16, .14); font: 600 11.5px 'Inter', sans-serif; color: var(--dim); }
.steps span.on { border-top-color: var(--c); color: var(--ink); }
.steps span.now { font-weight: 700; }
.subitem { padding: 10px 12px; margin-top: 8px; border: 1px solid var(--line); border-radius: 12px; font-size: 13px; }
.subitem a { color: var(--crimson); font-weight: 600; overflow-wrap: anywhere; }
.subitem p { margin-top: 4px; white-space: pre-wrap; overflow-wrap: anywhere; }
.toast { position: fixed; z-index: 99; left: 50%; bottom: 28px; transform: translateX(-50%); max-width: calc(100vw - 32px); padding: 11px 18px; border-radius: 999px; background: var(--ink); color: #fff; font-weight: 600; font-size: 13.5px; box-shadow: 0 14px 34px -14px rgba(42, 5, 8, .6); }
.toast.bad { background: var(--crimson); }

/* ---------- sign-in ---------- */
.gate { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); min-height: 100vh; background: #fff; }
.gate-art { display: flex; flex-direction: column; justify-content: space-between; gap: 32px; padding: 44px 48px; background: var(--crimson); color: #fff; overflow: hidden; }
.gate-art img { display: block; height: 40px; width: auto; }
.gate-art h2 { max-width: 12ch; font: 700 clamp(2.2rem, 4.4vw, 3.6rem)/1.04 'MuseoModerno', 'Inter', sans-serif; letter-spacing: -.02em; }
.gate-art p { margin-top: 16px; max-width: 30rem; font-size: 16px; line-height: 1.55; color: rgba(255, 255, 255, .88); }
.gate-art .wk { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; max-width: 30rem; }
.gate-art .wk div { height: 78px; padding: 9px; border-radius: 12px; background: rgba(255, 255, 255, .12); }
.gate-art .wk i { display: block; height: 9px; margin-bottom: 5px; border-radius: 5px; background: rgba(255, 255, 255, .45); }
.gate-art .wk i.w { background: #fff; } .gate-art .wk i.s { width: 60%; }
.gate-side { display: grid; place-items: center; padding: 32px 24px; }
.gate-card { width: min(390px, 100%); }
.gate-card .ws { font-size: 24px; color: var(--crimson); line-height: 1; }
.gate-card h1 { margin-top: 14px; font: 700 30px/1.12 'MuseoModerno', 'Inter', sans-serif; }
.gate-card > p { margin: 8px 0 20px; color: var(--muted); }
.gate-card .btn { width: 100%; margin-top: 20px; padding: 13px; font-size: 14.5px; }
.gate-card .keep { display: flex; align-items: center; gap: 8px; margin-top: 14px; font-size: 13px; color: var(--muted); }
.gate-card .small { margin-top: 18px; font-size: 12.5px; color: var(--dim); }

@media (min-width: 901px) { .day .its { display: contents; } }
@media (max-width: 1180px) and (min-width: 901px) { .days { grid-template-columns: repeat(7, minmax(128px, 1fr)); overflow-x: auto; padding-bottom: 6px; } }
@media (max-width: 900px) {
  .app { padding-left: 0; padding-bottom: 76px; }
  .side { display: none; }
  .tabs { position: fixed; z-index: 50; inset: auto 0 0 0; display: grid; grid-template-columns: repeat(6, 1fr); padding: 6px 6px max(6px, env(safe-area-inset-bottom)); background: #fff; border-top: 1px solid var(--line); }
  .tabs a { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 2px; border-radius: 10px; color: var(--dim); font: 600 10.5px 'Inter', sans-serif; text-decoration: none; }
  .tabs a svg { width: 21px; height: 21px; }
  .tabs a[aria-current="page"] { color: var(--crimson); background: var(--red-b); }
  .tabs a .count { position: absolute; top: 2px; left: 50%; margin-left: 6px; min-width: 16px; padding: 0 4px; border-radius: 8px; background: var(--crimson); color: #fff; font: 700 10px/1.6 'Inter', sans-serif; text-align: center; }
  .main { --gut: 16px; }
  .who { display: grid; }
  .bar-r .btn span { display: none; }
  .bar-r .btn { padding: 10px 12px; }
  .grid-2, .hero { grid-template-columns: minmax(0, 1fr); }
  .hero-main { padding: 22px 20px; }
  .days { display: flex; flex-direction: column; }
  .day { flex-direction: row; align-items: flex-start; gap: 10px; min-height: 0; }
  .day .dh { flex-direction: column; width: 40px; gap: 2px; flex: none; }
  .day .its { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; padding-top: 2px; }
  .day .its:empty::after { content: "Nothing due"; font-size: 12.5px; color: var(--dim); padding-top: 4px; }
  .day-add { display: none; }
  .gate { grid-template-columns: minmax(0, 1fr); }
  .gate-art { display: none; }
  .cal .cday { min-height: 64px; padding: 3px; }
  .cal .ev { padding: 2px 4px; font-size: 10.5px; }
  .hide-s { display: none; }
}
@media print { .side, .tabs, .topbar, .tool-row, .foot { display: none; } .app { padding: 0; } }

/* Brighter CSG accents balanced with white working surfaces. */
.nav-a[aria-current="page"] { background: var(--crimson); }
.hero { background: #c51d39; }
.hero-main { color: #fff; }
.hero-main p { color: #fff; }
.hero-main .pill { color: #a5132c; }
.hero-acts .btn:not(.ghost) { background: #fff; border-color: #fff; color: #a5132c; }
.hero-acts .btn.ghost { color: #fff; border-color: #ffffff88; }
.hero-acts .btn.ghost:hover { background: #ffffff18; }
.hero.clear { background: #ffe5ea; }
.hero.clear p { color: var(--muted); }
.day.today { background: #fff0f3; }
.gate-art img { align-self: flex-start; object-fit: contain; }
.facts { margin-top: 16px; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px 12px; }
.facts dt { color: var(--dim); font-size: 12px; }
.facts dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.facts .seg { flex-wrap: wrap; border-radius: 12px; }
.summary { overflow-wrap: anywhere; white-space: pre-wrap; }
@media (max-width: 600px) {
 .panel { padding: 16px 12px; }
 .row { flex-wrap: wrap; gap: 8px; }
 .row .rmain { flex-basis: 60%; }
 .q-res { position: fixed; top: 65px; left: 12px; right: 12px; }
 .cal { overflow: auto; grid-template-columns: repeat(7, minmax(90px, 1fr)); }
 .modal .mb > .half { grid-column: 1 / -1; }
}

.road-scroll { overflow-x: auto; padding-top: 10px; }
@media (max-width: 900px) { .toast { bottom: 84px; } }
@media (max-width: 600px) { .road { min-width: 720px; margin-right: 20px; } .road-scroll { padding-bottom: 8px; } }
