/* Boulder Media Portal */
:root {
  --ink: #0d0d0d;
  --ink-2: #1e1e1e;
  --bg: #f5f5f3;
  --card: #ffffff;
  --line: #e4e4e0;
  --muted: #5f5f5b;
  --accent: #f16f50;
  --accent-soft: #fde9e3;
  --accent-ink: #b23e24;
  --ok: #1d7f49;
  --ok-soft: #e4f4ea;
  --warn: #b5530a;
  --warn-soft: #fff1df;
  --r: 16px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body { margin: 0; font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--ink); font-size: 15px; line-height: 1.5; }
a { color: var(--accent-ink); }
h1, h2, h3 { margin: 0; }
h1 { font-family: "Space Grotesk", Inter, sans-serif; font-size: 34px; line-height: 1.1; letter-spacing: -0.02em; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.inline { display: inline; }

/* Top bar */
.topbar { position: sticky; top: 0; z-index: 10; background: var(--ink); color: #fff; display: flex; align-items: center; gap: 16px; padding: 12px 28px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 18px; color: #fff; text-decoration: none; }
.brand-logo { height: 38px; width: auto; display: block; }
.brand-name { font-family: "Archivo", "Inter", sans-serif; font-style: italic; font-stretch: 125%; font-weight: 800; font-size: 20px; letter-spacing: .01em; text-transform: uppercase; line-height: 1; white-space: nowrap; }
.nav { margin-left: auto; display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.nav a { color: #e6e6e6; text-decoration: none; font-weight: 600; font-size: 14px; }
.nav a:hover { color: #fff; }
.who { display: flex; align-items: center; gap: 8px; color: #cfcfcf; font-size: 14px; }
.link-btn { background: none; border: 0; color: #b8b8b8; cursor: pointer; padding: 0; font-size: 14px; }
.link-btn:hover { color: #fff; text-decoration: underline; }

.wrap { max-width: 1240px; margin: 0 auto; padding: 32px 28px 80px; }

/* Avatars, pills, tags */
.avatar { width: 28px; height: 28px; border-radius: 50%; background: #444; color: #fff; font-size: 11px; font-weight: 700; display: inline-grid; place-items: center; flex: none; }
.avatar.team { background: var(--accent); color: var(--ink); }
.pill { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 700; white-space: nowrap; }
.pill.todo { background: #ececea; color: #45453f; }
.pill.progress { background: #e8eefc; color: #2949a3; }
.pill.review { background: var(--accent-soft); color: var(--accent-ink); }
.pill.changes { background: var(--warn-soft); color: var(--warn); }
.pill.done { background: var(--ok-soft); color: var(--ok); }
.tag { display: inline-block; font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: #ececea; color: #33332f; }
.badge { font-size: 11px; font-weight: 700; color: var(--accent-ink); background: var(--accent-soft); border-radius: 999px; padding: 1px 8px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid transparent; border-radius: 999px; padding: 10px 18px; font-weight: 700; font-size: 14px; cursor: pointer; text-decoration: none; background: #ececea; color: var(--ink); transition: filter .15s, background .15s; min-height: 40px; }
.btn:hover { filter: brightness(.95); }
.btn.primary { background: var(--accent); color: var(--ink); }
.btn.dark { background: var(--ink); color: #fff; }
.btn.ghost { background: #fff; border-color: var(--ink); color: var(--ink); }
.btn.small { padding: 6px 14px; font-size: 13px; min-height: 34px; }
.btn.block { width: 100%; }
.icon-btn { width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--line); background: #fff; cursor: pointer; font-size: 16px; line-height: 1; }
.icon-btn:hover { border-color: var(--ink); }
.icon-btn.danger:hover { border-color: #c0392b; color: #c0392b; }
.icon-btn:disabled { opacity: .35; cursor: default; }

/* Forms */
.form { display: flex; flex-direction: column; gap: 14px; }
.form label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: 14px; }
input[type=text], input[type=email], input[type=password], input[type=url], input[type=date], input:not([type]), select, textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: #fff; font-weight: 400; outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(241, 111, 80, .25); }
textarea { resize: vertical; }
fieldset { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; margin: 0; display: flex; flex-direction: column; gap: 10px; }
legend { font-weight: 700; padding: 0 6px; }
.form label.check, label.check { flex-direction: row; align-items: center; gap: 10px; font-weight: 500; }
input[type=checkbox] { accent-color: var(--accent); width: 18px; height: 18px; flex: none; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row > input:not([type=date]) { flex: 1; min-width: 140px; }
.row > label { flex: 1; }
.row.nowrap { flex-wrap: nowrap; }
.inline-label { flex-direction: row !important; display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; flex: 0 0 auto !important; }
.inline-label select { width: auto; }

/* Flash & callouts */
.flash { padding: 12px 16px; border-radius: 12px; margin-bottom: 16px; font-weight: 600; }
.flash-ok { background: var(--ok-soft); color: var(--ok); }
.flash-error { background: #fde4e1; color: #a12a1c; }
.callout { background: var(--accent-soft); border: 1px solid #f6c1b2; color: var(--ink); padding: 14px 18px; border-radius: 14px; margin-bottom: 20px; }

/* Auth */
.auth-card { max-width: 420px; margin: 48px auto; background: #fff; border: 1px solid var(--line); border-radius: 22px; padding: 32px; display: flex; flex-direction: column; gap: 16px; }
.auth-card.wide { max-width: 620px; }
.auth-link { align-self: center; color: var(--accent-ink); font-weight: 700; text-decoration: none; }
.auth-link:hover { text-decoration: underline; }

/* Page head */
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head p { margin: 4px 0 0; }
.head-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.back { display: inline-block; font-size: 13px; font-weight: 600; color: var(--muted); text-decoration: none; margin-bottom: 8px; }
.back:hover { color: var(--ink); }
.lead { font-size: 16px; color: #33332f; max-width: 760px; margin: -6px 0 22px; }
.empty { background: #fff; border: 1px dashed var(--line); border-radius: var(--r); padding: 40px; text-align: center; color: var(--muted); }

/* Panels */
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 22px; margin-bottom: 18px; }
.section-title { font-family: "Space Grotesk", Inter, sans-serif; font-size: 20px; margin-bottom: 14px; }
.sub { font-size: 13px; font-weight: 800; text-transform: uppercase; color: var(--muted); margin: 14px 0 6px; }

/* Project cards */
.grid-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.project-card { display: flex; flex-direction: column; gap: 10px; background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 22px; color: inherit; text-decoration: none; transition: border-color .15s, transform .15s, box-shadow .15s; }
.project-card:hover { border-color: var(--ink); transform: translateY(-2px); box-shadow: 0 10px 24px rgba(0,0,0,.06); }
.project-card h2 { font-family: "Space Grotesk", Inter, sans-serif; font-size: 22px; }
.pc-top, .pc-meta { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.bar { height: 8px; background: #eeeeeb; border-radius: 9px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--accent); border-radius: 9px; }

/* Overview */
.overview { padding: 26px; }
.ov-top { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; flex-wrap: wrap; margin-bottom: 24px; }
.kicker { font-size: 13px; font-weight: 800; text-transform: uppercase; color: var(--accent-ink); }
.big { font-family: "Space Grotesk", Inter, sans-serif; font-weight: 700; font-size: 56px; line-height: 1; }
.ov-stats { display: flex; gap: 12px; flex-wrap: wrap; }
.ov-stats div { background: var(--bg); border-radius: 12px; padding: 10px 16px; display: flex; flex-direction: column; min-width: 150px; }
.ov-stats div.hl { background: var(--accent-soft); }
.ov-stats strong { font-size: 22px; }
.ov-stats span { font-size: 13px; color: var(--muted); }

.stepper { list-style: none; margin: 0; padding: 0; display: flex; overflow-x: auto; padding-bottom: 4px; }
.stepper li { flex: 1; min-width: 110px; position: relative; text-align: center; }
.stepper li::before { content: ""; position: absolute; z-index: 0; top: 15px; left: -50%; width: 100%; height: 3px; background: #e2e2de; }
.stepper li:first-child::before { display: none; }
.stepper li.done::before, .stepper li.current::before { background: var(--ink); }
.stepper a { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; text-decoration: none; color: var(--muted); font-size: 13px; padding: 0 4px; }
.stepper .dot { box-sizing: border-box; width: 32px; height: 32px; border-radius: 50%; background: #fff; border: 2px solid #d9d9d5; color: var(--muted); font-weight: 800; display: grid; place-items: center; font-size: 13px; line-height: 1; }
.stepper li.done .dot, .stepper li.current .dot { border: 0; }
.stepper li.done .dot { background: var(--ink); color: #fff; }
.stepper li.current a { color: var(--ink); font-weight: 700; }
.stepper li.current .dot { background: var(--accent); color: var(--ink); box-shadow: 0 0 0 6px var(--accent-soft); }
.stepper li.review .dot { animation: pulse 1.8s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 10px rgba(241, 111, 80, .15); } }

/* Layout */
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 22px; align-items: start; }

/* Steps */
.step { padding: 0; overflow: hidden; }
.step summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 14px; padding: 18px 22px; }
.step summary::-webkit-details-marker { display: none; }
.step summary:hover { background: #fafaf8; }
.step[open] summary { border-bottom: 1px solid var(--line); }
.step-num { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 14px; background: #ececea; color: #45453f; flex: none; }
.step-num.done { background: var(--ink); color: #fff; }
.step-num.progress { background: var(--accent); color: var(--ink); }
.step-num.review { background: var(--accent); color: var(--ink); box-shadow: 0 0 0 4px var(--accent-soft); }
.step-num.changes { background: var(--warn-soft); color: var(--warn); }
.step-title { font-weight: 700; font-size: 16px; flex: 1; }
.step-meta { display: flex; align-items: center; gap: 10px; }
.step-body { padding: 18px 22px 22px; display: flex; flex-direction: column; gap: 16px; }
.step-info p { margin: 0 0 4px; }
.review-box { background: var(--accent-soft); border-radius: 14px; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.review-box p { margin: 0; }
.changes-form { background: #fff; border-radius: 12px; padding: 14px; }
.admin-row { background: var(--bg); border-radius: 12px; padding: 10px 12px; }
.edit-link { background: none; border: 0; padding: 0; margin-top: 2px; font: inherit; font-size: 13px; font-weight: 700; color: var(--accent-ink); cursor: pointer; }
.edit-link:hover { text-decoration: underline; }

/* Threads */
.thread { display: flex; flex-direction: column; gap: 10px; }
.thread.chat { max-height: 420px; overflow-y: auto; padding-right: 4px; margin-bottom: 12px; }
.thread.step-thread { max-height: 320px; margin-bottom: 0; overscroll-behavior: contain; }
.msg-wrap { align-self: flex-start; max-width: 78%; display: flex; flex-direction: column; align-items: flex-start; gap: 3px; }
.msg-wrap.mine { align-self: flex-end; align-items: flex-end; }
.msg-time { font-size: 12px; color: var(--muted); }
.msg-meta { display: flex; align-items: center; gap: 8px; padding: 0 8px; font-size: 12px; color: var(--muted); }
.msg-edited { font-style: italic; }
.msg-edit-btn { border: 0; background: none; padding: 0; font: inherit; font-weight: 700; color: var(--muted); cursor: pointer; }
.msg-edit-btn:hover { color: var(--ink); text-decoration: underline; }
.msg-edit-btn.danger:hover { color: #b42318; }
.msg-del-form { display: inline; margin: 0; }
.msg.event .msg-del-form { margin-left: 4px; font-size: 12px; }
.msg-edit-form { display: flex; flex-direction: column; gap: 8px; width: 100%; min-width: min(320px, 100%); margin-top: 4px; }
.msg-time[data-tip] { position: relative; cursor: default; outline: none; }
.msg-time[data-tip]::after {
  content: attr(data-tip); position: absolute; bottom: calc(100% + 6px); left: 0;
  background: var(--ink); color: #fff; font-size: 12px; line-height: 1.3; white-space: nowrap;
  padding: 6px 10px; border-radius: 8px; box-shadow: 0 4px 14px rgba(0,0,0,.18);
  opacity: 0; transform: translateY(4px); pointer-events: none; transition: opacity .15s, transform .15s; z-index: 5;
}
.msg-wrap.mine .msg-time[data-tip]::after { left: auto; right: 0; background: var(--accent-ink); }
.msg-time[data-tip]:hover::after, .msg-time[data-tip]:focus::after { opacity: 1; transform: translateY(0); }
.msg { background: var(--bg); border-radius: 18px 18px 18px 4px; padding: 10px 14px; }
.msg.mine { background: var(--ink); color: #fff; border-radius: 18px 18px 4px 18px; }
.msg.mine .msg-body a { color: #fff; text-decoration: underline; }
/* Files inside a bubble */
.msg-atts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.msg.only-files .msg-atts { margin-top: 0; }
.msg.only-files .msg-head + .msg-atts { margin-top: 6px; }
.msg.only-files { padding: 6px; }
.msg.only-files .msg-head { padding: 4px 8px 0; }
.att { position: relative; display: grid; place-items: center; width: 220px; height: 160px; max-width: 100%; border-radius: 12px; overflow: hidden; background: #fff; border: 1px solid var(--line); color: var(--muted); font-size: 12px; font-weight: 800; text-decoration: none; cursor: zoom-in; }
.msg-atts.many .att { width: 120px; height: 120px; }
.att img, .att canvas, .att video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; background: #fff; }
.att canvas { object-position: top; }
.att canvas[hidden], .att video[hidden], .att .play[hidden] { display: none; }
.att .play { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(0,0,0,.18); pointer-events: none; }
.att .play::before { content: ""; border-left: 18px solid #fff; border-top: 11px solid transparent; border-bottom: 11px solid transparent; margin-left: 4px; filter: drop-shadow(0 1px 3px rgba(0,0,0,.5)); }
.att-name { position: absolute; left: 0; right: 0; bottom: 0; padding: 14px 8px 6px; background: linear-gradient(transparent, rgba(0,0,0,.65)); color: #fff; font-size: 12px; font-weight: 600; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.att:hover { border-color: var(--ink); }
.msg.mine .att { border-color: #333; }
.att-file { display: inline-flex; align-items: center; gap: 8px; max-width: 100%; padding: 6px 12px 6px 6px; border-radius: 10px; background: #fff; border: 1px solid var(--line); color: var(--ink); font-size: 13px; font-weight: 600; text-decoration: none; }
.att-file .ficon-ext { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 7px; background: var(--bg); color: var(--muted); font-size: 10px; font-weight: 800; }
.att-file span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg-head { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; flex-wrap: wrap; }
.msg-head strong { font-size: 14px; }
.msg-head time { margin-left: auto; font-size: 12px; color: var(--muted); }
.msg-body { font-size: 14.5px; overflow-wrap: anywhere; }
.msg.event { background: none; padding: 2px 4px; align-self: center; max-width: 100%; border-radius: 0; display: flex; gap: 10px; font-size: 13px; color: var(--muted); align-items: baseline; }
.msg.event > span:first-child::before { content: "● "; color: var(--accent); }
.msg.event time { margin-left: auto; font-size: 12px; white-space: nowrap; }
.composer { display: flex; flex-direction: column; gap: 8px; }
.composer-actions { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.composer-box { position: relative; }
.composer-box textarea { display: block; }
.drop-hint { position: absolute; inset: 0; border: 2px dashed var(--accent); border-radius: 10px; background: rgba(253, 233, 227, .94); color: var(--accent-ink); font-weight: 700; font-size: 14px; display: none; align-items: center; justify-content: center; pointer-events: none; }
.composer.drag .drop-hint { display: flex; }

/* Custom file picker */
.file-input { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; clip: rect(0 0 0 0); }
.attach { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-width: 0; }
.attach-btn { position: relative; display: inline-flex; align-items: center; gap: 7px; padding: 7px 14px; min-height: 36px; border: 1px solid var(--line); border-radius: 999px; background: #fff; font-size: 13px; font-weight: 700; color: var(--ink); cursor: pointer; transition: border-color .15s, background .15s; }
.attach-btn:hover { border-color: var(--ink); }
.attach-btn:focus-within { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(241, 111, 80, .25); }
.attach-btn svg { color: var(--accent-ink); flex: none; }
.attach-chip { display: inline-flex; align-items: center; gap: 4px; max-width: 260px; padding: 4px 4px 4px 12px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-ink); font-size: 13px; font-weight: 700; }
.attach-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attach-clear { width: 26px; height: 26px; flex: none; border: 0; border-radius: 50%; background: transparent; color: var(--accent-ink); font-size: 17px; line-height: 1; cursor: pointer; }
.attach-clear:hover { background: rgba(178, 62, 36, .12); }
.attach.has-file .attach-tip { display: none; }

/* Custom date picker */
.datefield { position: relative; display: block; min-width: 150px; }
.row > .datefield { flex: 0 0 170px; }
.date-btn { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: #fff; font-weight: 400; text-align: left; cursor: pointer; min-height: 44px; }
.date-btn:hover { border-color: #bdbdb8; }
.date-btn:focus-visible, .datefield.open .date-btn { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(241, 111, 80, .25); }
.date-btn .placeholder { color: #8a8a85; }
.date-btn svg { color: var(--accent-ink); flex: none; }
.cal { position: absolute; z-index: 30; top: calc(100% + 6px); left: 0; width: 288px; background: #fff; border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 18px 44px rgba(0, 0, 0, .16); padding: 14px; font-weight: 400; }
.cal.align-right { left: auto; right: 0; }
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.cal-title { font-family: "Space Grotesk", Inter, sans-serif; font-weight: 700; font-size: 16px; }
.cal-nav { width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--line); background: #fff; cursor: pointer; font-size: 15px; line-height: 1; }
.cal-nav:hover { border-color: var(--ink); }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 2px; }
.cal-dow { font-size: 11.5px; font-weight: 800; color: var(--muted); text-align: center; padding: 4px 0; }
.cal-day { height: 36px; border: 0; border-radius: 10px; background: none; cursor: pointer; font-size: 14px; color: var(--ink); }
.cal-day:hover { background: var(--bg); }
.cal-day.out { color: #b5b5b0; }
.cal-day.today { box-shadow: inset 0 0 0 1.5px var(--ink); font-weight: 700; }
.cal-day.sel { background: var(--accent); color: var(--ink); font-weight: 800; box-shadow: none; }
.cal-day:focus-visible { outline: 2px solid var(--ink); outline-offset: 1px; }
.cal-foot { display: flex; justify-content: space-between; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.cal-link { border: 0; background: none; font-weight: 700; font-size: 13px; color: var(--accent-ink); cursor: pointer; padding: 6px 4px; }
.cal-link:hover { text-decoration: underline; }

/* Files */
.files { list-style: none; margin: 0; padding: 0; }
.file { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; column-gap: 10px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--line); }
.file:last-child { border-bottom: 0; }
.file a { font-weight: 600; text-decoration: none; color: var(--ink); overflow-wrap: anywhere; }
.file a:hover { text-decoration: underline; }
.file .muted { grid-column: 2; }
.file-del { grid-column: 3; grid-row: 1 / span 2; margin: 0; }
.ficon { grid-row: span 2; width: 44px; height: 44px; border-radius: 9px; background: var(--bg); display: grid; place-items: center; font-size: 10px; font-weight: 800; color: var(--muted); }
.ficon.thumb { position: relative; overflow: hidden; border: 1px solid var(--line); text-decoration: none; cursor: zoom-in; }
.ficon.thumb img, .ficon.thumb canvas, .ficon.thumb video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; background: #fff; }
.ficon.thumb canvas { object-position: top; }
.ficon.thumb[hidden], .ficon.thumb canvas[hidden], .ficon.thumb video[hidden] { display: none; }
.ficon.thumb .play { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(0,0,0,.18); pointer-events: none; }
.ficon.thumb .play::before { content: ""; border-left: 11px solid #fff; border-top: 7px solid transparent; border-bottom: 7px solid transparent; margin-left: 3px; filter: drop-shadow(0 1px 2px rgba(0,0,0,.5)); }
.ficon.thumb:hover { border-color: var(--ink); }

/* Large view (lightbox) */
.lightbox { width: min(1100px, calc(100vw - 32px)); height: min(860px, calc(100vh - 32px)); max-width: none; max-height: none; padding: 0; border: 0; border-radius: 16px; background: #111; color: #fff; overflow: hidden; }
.lightbox[open] { display: flex; flex-direction: column; }
.lightbox::backdrop { background: rgba(10,10,10,.78); }
.lb-head { display: flex; align-items: center; gap: 12px; padding: 10px 12px 10px 18px; border-bottom: 1px solid #2a2a2a; }
.lb-name { flex: 1; min-width: 0; font-weight: 700; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-btn { display: inline-flex; align-items: center; justify-content: center; min-height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid #3a3a3a; background: transparent; color: #fff; font: 700 13px/1 Inter, sans-serif; text-decoration: none; cursor: pointer; }
.lb-btn:hover { border-color: #fff; }
.lb-close { width: 36px; padding: 0; font-size: 20px; }
.lb-body { flex: 1; min-height: 0; display: grid; place-items: center; padding: 12px; }
.lb-body img, .lb-body video { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }
.lb-body iframe { width: 100%; height: 100%; border: 0; border-radius: 8px; background: #fff; }
.lb-body.pdf { padding: 0; }
.lb-body.pdf iframe { border-radius: 0; }
.lb-msg { color: #bbb; font-size: 14px; text-align: center; }
.upload { margin-top: 14px; display: flex; flex-direction: column; gap: 8px; }
.dropzone { position: relative; border: 2px dashed var(--line); border-radius: 12px; padding: 16px; display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; cursor: pointer; font-weight: 600; font-size: 14px; transition: border-color .15s, background .15s; }
.dropzone:hover, .dropzone.drag { border-color: var(--accent); background: var(--accent-soft); }
.dropzone input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.dropzone.has-file span { color: var(--ink); }
.info-tip { position: relative; display: inline-grid; place-items: center; flex: none; width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid currentColor; color: var(--muted); font: 800 11px/1 Inter, sans-serif; cursor: help; outline: none; }
.info-tip:hover, .info-tip:focus-visible { color: var(--ink); }
.info-tip::after {
  content: attr(data-tip); position: absolute; bottom: calc(100% + 8px); left: 50%; width: max-content; max-width: 240px;
  background: var(--ink); color: #fff; font-size: 12px; font-weight: 500; line-height: 1.4; text-align: left; white-space: normal;
  padding: 7px 10px; border-radius: 8px; box-shadow: 0 4px 14px rgba(0,0,0,.18);
  opacity: 0; transform: translate(-50%, 4px); pointer-events: none; transition: opacity .15s, transform .15s; z-index: 20;
}
.info-tip.left::after { left: -8px; transform: translateY(4px); }
.info-tip:hover::after, .info-tip:focus::after { opacity: 1; transform: translate(-50%, 0); }
.info-tip.left:hover::after, .info-tip.left:focus::after { transform: translateY(0); }

/* Layout switch (project page) */
.view-switch { display: inline-flex; padding: 3px; border-radius: 999px; background: #fff; border: 1px solid var(--line); }
.view-switch a { padding: 7px 14px; border-radius: 999px; font-size: 13px; font-weight: 700; color: var(--muted); text-decoration: none; }
.view-switch a:hover { color: var(--ink); }
.view-switch a.active { background: var(--ink); color: #fff; }

/* Simple layout */
.simple { max-width: 780px; margin: 0 auto; }
.sp-top { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
.sp-title { margin: 4px 0 0; font-family: "Space Grotesk", Inter, sans-serif; font-size: 24px; }
.sp-pct { font-family: "Space Grotesk", Inter, sans-serif; font-weight: 700; font-size: 36px; line-height: 1; }
.simple-progress .muted { margin: 10px 0 0; }
.simple-review + .simple-review, .simple-review + .tasks { margin-top: 18px; }
.simple-review .sub { margin-top: 0; }
.simple-step-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.simple-step-head .section-title { margin: 0; }
.simple section[id^="step-"] { display: flex; flex-direction: column; gap: 14px; }
.simple-more > summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.simple-more > summary::-webkit-details-marker { display: none; }
.simple-more > summary .section-title { margin: 0; }
.simple-more > summary::after { content: "+"; font-size: 20px; font-weight: 700; color: var(--muted); }
.simple-more[open] > summary::after { content: "−"; }
.simple-more[open] > summary { margin-bottom: 14px; }
.simple-more .muted.small { margin-left: auto; }
.simple-steps { list-style: none; margin: 0; padding: 0; }
.simple-steps li { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.simple-steps li:last-child { border-bottom: 0; }
.simple-steps a { flex: 1; min-width: 0; color: var(--ink); font-weight: 600; text-decoration: none; }
.simple-steps a:hover { text-decoration: underline; }

/* Tasks */
.panel.has-todo { border: 2px solid var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.todo-count { display: inline-block; vertical-align: middle; margin-left: 6px; padding: 3px 9px; border-radius: 999px; background: var(--accent); color: var(--ink); font: 800 12px/1.2 Inter, sans-serif; }
.tasks { list-style: none; margin: 0; padding: 0; }
.tasks li { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 6px 0; }
.tasks label { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; font-size: 14.5px; }
.tasks input { margin-top: 2px; }
.tasks li.done span { color: var(--muted); text-decoration: line-through; }
.add-task { margin-top: 12px; }
.add-task select { width: auto; }

/* Admin */
.admin-step { border-bottom: 1px solid var(--line); padding: 14px 0; display: flex; gap: 12px; align-items: flex-start; }
.admin-step:first-of-type { padding-top: 0; }
.step-edit { flex: 1; gap: 8px; }
.step-tools { flex: none; gap: 6px; }
.add-step { margin-top: 18px; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12px; text-transform: uppercase; color: var(--muted); font-weight: 800; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.table td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table input { min-width: 120px; }
.col-main .panel:has(.table) { overflow-x: auto; }
.admin-forms { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); gap: 0 22px; align-items: start; }
.admin-forms.single { grid-template-columns: minmax(0, 620px); }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: -6px 0 22px; overflow-x: auto; }
.tab { display: inline-flex; align-items: center; gap: 8px; padding: 12px 16px; margin-bottom: -1px; border-bottom: 3px solid transparent; color: var(--muted); font-weight: 700; text-decoration: none; white-space: nowrap; }
.tab:hover { color: var(--ink); }
.tab.active { color: var(--ink); border-bottom-color: var(--accent); }
.tab-count { min-width: 22px; padding: 2px 7px; border-radius: 999px; background: var(--bg); color: var(--muted); font-size: 12px; text-align: center; }
.tab.active .tab-count { background: var(--accent-soft); color: var(--accent-ink); }

/* Responsive */
@media (max-width: 980px) {
  .layout { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .msg-wrap { max-width: 88%; }
  .brand-logo { height: 32px; }
  .brand-name { font-size: 16px; }
  .wrap { padding: 20px 16px 60px; }
  .topbar { padding: 12px 16px; }
  .nav { margin-left: 0; width: 100%; gap: 14px; }
  h1 { font-size: 28px; }
  .big { font-size: 44px; }
  .ov-stats div { min-width: 0; flex: 1 1 140px; }
  .step summary { padding: 16px; flex-wrap: wrap; }
  .step-meta { width: 100%; padding-left: 48px; }
  .step-body { padding: 16px; }
  .stepper .st-label { font-size: 12px; }
  .admin-step { flex-direction: column; }
}

/* ---------- Notifications ---------- */
:root { --red: #e0342a; }
.notif { position: relative; }
.bell { position: relative; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; color: #e6e6e6; }
.nav a.bell:hover, .bell[aria-expanded="true"] { background: #262626; color: #fff; }
.count { position: absolute; top: 2px; right: 0; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 999px; background: var(--red); color: #fff; font-size: 11px; font-weight: 800; line-height: 19px; text-align: center; box-shadow: 0 0 0 2px var(--ink); }
.count.bump { animation: bump .5s ease; }
@keyframes bump { 40% { transform: scale(1.35); } }
.notif-panel { position: absolute; right: -8px; top: calc(100% + 10px); z-index: 40; width: min(380px, calc(100vw - 32px)); background: #fff; color: var(--ink); border-radius: 16px; box-shadow: 0 18px 50px rgba(0, 0, 0, .22); overflow: hidden; }
.notif-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.notif-empty { margin: 0; padding: 22px 16px; color: var(--muted); text-align: center; }
.notif-list { list-style: none; margin: 0; padding: 0; max-height: 380px; overflow-y: auto; }
.notif-list.page { max-height: none; }
.notif-list li + li { border-top: 1px solid var(--line); }
.notif-list a { display: flex; gap: 12px; padding: 12px 16px; text-decoration: none; color: var(--ink); }
.nav .notif-list a { color: var(--ink); font-weight: 400; font-size: 14px; }
.notif-list a:hover { background: var(--bg); }
.dot-new { width: 9px; height: 9px; border-radius: 50%; background: var(--red); flex: none; margin-top: 6px; }
.nl-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.nl-text { font-weight: 600; }
.nl-quote { color: #45453f; font-size: 13.5px; overflow-wrap: anywhere; }
.nl-meta { color: var(--muted); font-size: 12.5px; }
.nav a.notif-all, .notif-all { display: block; text-align: center; padding: 12px; border-top: 1px solid var(--line); font-weight: 700; font-size: 13px; color: var(--accent-ink); }
.red-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 22px; padding: 0 8px; border-radius: 999px; background: var(--red); color: #fff; font-family: Inter, sans-serif; font-size: 12px; font-weight: 800; vertical-align: middle; white-space: nowrap; }
.section-title .red-badge { margin-left: 6px; position: relative; top: -2px; }
.new-tag { font-size: 10.5px; font-weight: 800; text-transform: uppercase; color: #fff; background: var(--red); border-radius: 999px; padding: 1px 7px; }
.msg.is-new { box-shadow: inset 3px 0 0 var(--red); background: #fff4f1; }
.msg.event.is-new { background: none; box-shadow: none; }
.msg.event.is-new span:first-child { color: var(--ink); font-weight: 600; }
.callout.news { display: flex; align-items: center; gap: 12px; background: #fff; border-color: #f3b4ad; }
.project-card { position: relative; }
.card-count { position: absolute; top: -9px; right: -9px; min-width: 28px; height: 28px; padding: 0 8px; border-radius: 999px; background: var(--red); color: #fff; font-weight: 800; font-size: 13px; display: grid; place-items: center; box-shadow: 0 0 0 3px var(--bg); }

/* ---------- Custom select ---------- */
.selectfield { position: relative; display: inline-block; min-width: 130px; }
.form .selectfield { display: block; }
.selectfield select { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.select-btn { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px; border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; background: #fff; font-weight: 500; text-align: left; cursor: pointer; min-height: 40px; }
.form .select-btn { min-height: 44px; padding: 10px 12px; }
.select-btn:hover { border-color: #bdbdb8; }
.select-btn:focus-visible, .selectfield.open .select-btn { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(241, 111, 80, .25); }
.select-btn svg { flex: none; transition: transform .15s; color: var(--muted); }
.selectfield.open .select-btn svg { transform: rotate(180deg); }
.select-list { position: absolute; z-index: 30; top: calc(100% + 6px); left: 0; min-width: 100%; margin: 0; padding: 6px; list-style: none; background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 18px 44px rgba(0, 0, 0, .16); max-height: 280px; overflow-y: auto; }
.select-list.align-right { left: auto; right: 0; }
.select-opt { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 9px 10px; border-radius: 9px; cursor: pointer; white-space: nowrap; font-weight: 500; font-size: 14px; }
.select-opt:hover, .select-opt:focus { background: var(--bg); outline: none; }
.select-opt[aria-selected="true"] { font-weight: 700; }
.select-opt[aria-selected="true"]::after { content: "✓"; color: var(--accent-ink); font-weight: 800; }
.select-opt .opt-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; margin-right: 8px; }
.select-opt .opt-label { display: inline-flex; align-items: center; }
