:root {
  color-scheme: light;
  --ink: #14202c;
  --muted: #697581;
  --line: #dfe4e8;
  --canvas: #f7f8f9;
  --surface: #ffffff;
  --navy: #063c59;
  --navy-deep: #04334d;
  --icon-surface: #eef2f5;
  --accent: #ed4b20;
  --accent-dark: #db431d;
  --green: #13a464;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100dvh;
  background: var(--canvas);
  color: var(--ink);
  font-family: "Geist", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

button { font: inherit; }
button,
select { cursor: pointer; }
button:disabled { cursor: wait; opacity: .58; }
button:focus-visible,
a:focus-visible { outline: 3px solid rgba(237, 75, 32, .28); outline-offset: 2px; }

svg {
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.skip-link {
  position: fixed;
  top: -4rem;
  left: 1rem;
  z-index: 20;
  padding: .65rem .85rem;
  background: white;
  color: var(--navy);
}

.skip-link:focus { top: 1rem; }

.topbar {
  background: white;
  color: var(--ink);
  border-bottom: 3px solid #1260e8;
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  width: min(100% - 3rem, 1440px);
  min-height: 4.75rem;
  margin: 0 auto;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: .8rem;
  color: var(--ink);
  text-decoration: none;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: .45rem;
  height: 3.25rem;
  padding: .12rem 0;
  overflow: hidden;
  background: transparent;
}
.levner-logo { width: 7.2rem; height: 2.7rem; object-fit: cover; object-position: center; }
.pam-logo { width: 2.72rem; height: 2.72rem; object-fit: contain; }
.brand-collaboration { color: #8a949c; font-family: "Geist Mono", ui-monospace, monospace; font-size: .85rem; font-weight: 500; }
.brand strong { color: var(--navy); font-size: .8rem; font-weight: 600; }
.topbar-actions { display: flex; align-items: center; gap: .55rem; }
.current-date { display: flex; align-items: center; gap: .55rem; flex: 0 0 auto; min-width: 11.5rem; padding: .5rem .6rem; border-left: 1px solid var(--line); color: var(--ink); }
.current-date > svg { flex: 0 0 auto; width: 1rem; height: 1rem; color: var(--navy); stroke-width: 1.8; }
.current-date strong { display: block; }
.current-date strong { font-size: .65rem; font-weight: 650; white-space: nowrap; }
.role-badge { padding: .34rem .52rem; border: 1px solid var(--line); background: var(--canvas); color: var(--muted); font-size: .58rem; font-weight: 700; text-transform: uppercase; }
.role-badge[data-role="admin"] { border-color: #cce7dc; background: #eaf7f1; color: #087a52; }
.topbar-button,
.icon-button { display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--line); background: white; color: var(--navy); }
.topbar-button { text-decoration: none; }
.topbar-button { gap: .42rem; min-height: 2.25rem; padding: .45rem .62rem; font-size: .65rem; font-weight: 650; }
.topbar-button svg,
.icon-button svg { width: 1rem; height: 1rem; stroke-width: 1.8; }
.icon-button { width: 2.25rem; height: 2.25rem; padding: 0; }
.topbar-button:hover,
.icon-button:hover { background: var(--canvas); }

.auth-screen {
  display: grid;
  align-items: center;
  justify-items: center;
  width: 100%;
  min-height: 100dvh;
  padding: clamp(1rem, 5vw, 5rem);
  background-color: #dff5fb;
  background-image: url("./assets/backgrounds/login-water.png");
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
}
.auth-panel {
  width: min(100%, 27rem);
  padding: 2rem;
  border: 1px solid rgba(255, 255, 255, .72);
  border-top: 4px solid #1260e8;
  background: rgba(255, 255, 255, .94);
  box-shadow: 0 24px 64px rgba(4, 51, 77, .2), inset 0 1px 0 rgba(255, 255, 255, .8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.auth-brand { display: flex; align-items: center; gap: .55rem; height: 3.5rem; margin-bottom: 2rem; overflow: hidden; }
.auth-brand .levner-logo { width: 7.2rem; height: 2.8rem; }
.auth-brand .pam-logo { width: 3rem; height: 3rem; }
.auth-brand span { color: #8a949c; font-family: "Geist Mono", ui-monospace, monospace; }
.auth-panel header > span { display: block; margin-bottom: .45rem; color: var(--navy); font-size: .68rem; font-weight: 700; text-transform: uppercase; }
.auth-panel h1 { font-size: 1.65rem; }
.auth-role-switch { display: grid; grid-template-columns: repeat(2, 1fr); gap: .25rem; margin: 1.65rem 0 1.25rem; padding: .25rem; background: var(--canvas); border: 1px solid var(--line); }
.auth-role-switch button { min-height: 2.45rem; border: 0; background: transparent; color: var(--muted); font-size: .72rem; font-weight: 650; }
.auth-role-switch button.active { background: white; color: var(--navy); box-shadow: 0 1px 5px rgba(6, 60, 89, .1); }
.auth-panel form,
.admin-panel form { display: grid; gap: 1rem; }
.auth-panel label,
.admin-panel label { display: grid; gap: .38rem; color: #52616d; font-size: .64rem; font-weight: 650; }
.auth-panel input,
.admin-panel input,
.admin-panel select,
.admin-panel textarea { width: 100%; min-width: 0; border: 1px solid #cfd8de; border-radius: .3rem; background: white; color: var(--ink); font: inherit; font-size: .72rem; }
.auth-panel input,
.admin-panel input,
.admin-panel select { height: 2.65rem; padding: 0 .7rem; }
.admin-panel textarea { resize: vertical; padding: .65rem .7rem; line-height: 1.5; }
.auth-panel input:focus,
.admin-panel input:focus,
.admin-panel select:focus,
.admin-panel textarea:focus { outline: 3px solid rgba(18, 96, 232, .12); border-color: #1260e8; }
.primary-button { min-height: 2.65rem; border: 1px solid var(--navy); border-radius: .3rem; background: var(--navy); color: white; font-size: .72rem; font-weight: 700; }
.primary-button:hover { background: var(--navy-deep); }
.form-message { margin: 0; padding: .65rem .7rem; border-left: 3px solid #c6382b; background: #fff2f0; color: #9a2d23; font-size: .65rem; line-height: 1.45; }
.form-message[data-type="success"] { border-color: var(--green); background: #eef9f4; color: #087a52; }
.form-message[data-type="info"] { border-color: #1260e8; background: #eff5ff; color: var(--navy); }

main {
  width: min(100% - 1.5rem, 1512px);
  margin: 0 auto;
  padding: .9rem 0 1.2rem;
}

.credit-summary,
.credit-ledger {
  background: var(--surface);
  border: 1px solid var(--line);
}

.credit-summary { padding: 1.65rem 2.25rem 1.8rem; }

.summary-title {
  display: flex;
  align-items: center;
  gap: .9rem;
}

.title-icon {
  display: grid;
  place-items: center;
  width: 2.3rem;
  height: 2.3rem;
  color: var(--ink);
}

.title-icon svg { width: 2.15rem; height: 2.15rem; stroke-width: 1.65; }

h1 {
  margin: 0;
  font-size: clamp(1.55rem, 2.25vw, 2rem);
  line-height: 1.1;
  font-weight: 650;
  letter-spacing: 0;
}

.summary-grid {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: clamp(1rem, 2.5vw, 2rem);
  align-items: end;
  margin-top: 1.05rem;
}

.overall-metric strong,
.overall-metric span { display: block; }

.overall-metric strong {
  color: var(--accent);
  font-family: "Geist", ui-sans-serif, system-ui, sans-serif;
  font-size: clamp(3.75rem, 6vw, 5.2rem);
  line-height: .9;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
  white-space: nowrap;
}

.overall-metric span {
  margin-top: 1.1rem;
  color: #4f5d69;
  font-size: .92rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .045em;
}

.overall-progress { align-self: stretch; padding-top: .15rem; }

.overall-progress > strong {
  display: block;
  margin-bottom: .45rem;
  color: var(--accent);
  font-family: "Geist", ui-sans-serif, system-ui, sans-serif;
  font-size: 1rem;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
}

.progress-track {
  position: relative;
  width: 100%;
  height: .5rem;
  overflow: hidden;
  background: #e9ecee;
  border: 1px solid #dce1e4;
  border-radius: .2rem;
}

.progress-track.large { height: 1rem; }

.progress-track span {
  position: absolute;
  inset: -1px auto -1px -1px;
  min-width: 0;
  background: var(--accent);
  border-radius: .18rem;
  transition: width 360ms ease;
}

.progress-track span:not([style*="width:0%"]):hover { background: var(--accent-dark); }

.progress-caption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  margin-top: 2.65rem;
  color: #374654;
  font-size: .91rem;
}

.progress-caption b { font-weight: 500; }
.active-lines { display: inline-flex; align-items: center; gap: .42rem; }
.active-lines span { min-width: 0; }
.active-lines i { width: .62rem; height: .62rem; border-radius: 50%; background: var(--green); }

.credit-ledger { margin-top: .9rem; }
.ledger-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 3.7rem;
  padding: .6rem 1rem .6rem 2.25rem;
  border-bottom: 1px solid var(--line);
}

.ledger-toolbar h2,
.ledger-toolbar span { margin: 0; }
.ledger-toolbar h2 { font-size: .9rem; line-height: 1.2; font-weight: 650; }
.ledger-toolbar > div:first-child > span { display: block; margin-top: .15rem; color: var(--muted); font-size: .66rem; }

.view-switch {
  display: inline-grid;
  grid-template-columns: repeat(2, 1fr);
  padding: .2rem;
  background: var(--canvas);
  border: 1px solid var(--line);
  border-radius: .38rem;
}

.view-switch button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .42rem;
  min-width: 4.8rem;
  min-height: 2rem;
  padding: 0 .62rem;
  border: 0;
  border-radius: .24rem;
  background: transparent;
  color: var(--muted);
  font-size: .68rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.view-switch button:hover { color: var(--ink); }
.view-switch button:active { transform: translateY(1px); }
.view-switch button.active { background: white; color: var(--navy); box-shadow: 0 1px 5px rgba(6, 60, 89, .12); }
.view-switch svg { width: .9rem; height: .9rem; stroke-width: 1.8; }
.table-scroll { overflow-x: auto; }

table {
  width: 100%;
  min-width: 820px;
  border-collapse: collapse;
  table-layout: fixed;
}

th,
td {
  text-align: left;
  vertical-align: middle;
  border-bottom: 1px solid var(--line);
}

th {
  height: 3.7rem;
  padding: 0 2.25rem;
  color: var(--ink);
  background: #fff;
  font-size: .79rem;
  font-weight: 600;
}

td {
  height: 4.45rem;
  padding: .45rem 2.25rem;
  font-size: .87rem;
}

th:nth-child(1), td:nth-child(1) { width: 35%; }
th:nth-child(2), td:nth-child(2) { width: 16%; }
th:nth-child(3), td:nth-child(3) { width: 38%; }
th:nth-child(4), td:nth-child(4) { width: 11%; text-align: right; padding-right: 3.8rem; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr { transition: background-color 160ms ease; }
tbody tr:hover { background: #fafbfc; }

.deliverable {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-width: 0;
}

.deliverable-button {
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.deliverable-button:hover strong { color: var(--navy); }
.deliverable-button:active { transform: translateY(1px); }
.detail-arrow { margin-left: auto; color: var(--muted); font-size: .9rem; opacity: 0; transform: translateX(-.25rem); transition: opacity 160ms ease, transform 160ms ease; }
.deliverable-button:hover .detail-arrow,
.deliverable-button:focus-visible .detail-arrow { opacity: 1; transform: translateX(0); }

.deliverable-icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 3rem;
  height: 3rem;
  background: var(--icon-surface);
  color: #102339;
  border-radius: .62rem;
}

.deliverable-icon svg { width: 1.7rem; height: 1.7rem; stroke-width: 1.75; }
.deliverable strong { overflow: hidden; font-size: .9rem; font-weight: 500; white-space: nowrap; text-overflow: ellipsis; }

.credit-value {
  color: var(--ink);
  font-family: "Geist Mono", ui-monospace, monospace;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.credit-value i { margin: 0 .75rem; color: #75808a; font-style: normal; }
.row-percentage { font-family: "Geist Mono", ui-monospace, monospace; font-variant-numeric: tabular-nums; }

.credit-ledger.bento-mode { background: var(--canvas); }
.bento-mode .table-scroll { overflow: visible; }
.bento-mode table,
.bento-mode tbody { display: block; width: 100%; min-width: 0; }
.bento-mode thead { display: none; }
.bento-mode tbody {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .75rem;
  padding: .75rem;
}
.bento-mode tbody tr {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1rem;
  min-width: 0;
  padding: 1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 3px solid var(--line);
  border-radius: .55rem;
  transition: border-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}
.bento-mode tbody tr.has-usage { border-top-color: var(--accent); }
.bento-mode tbody tr:hover { transform: translateY(-1px); box-shadow: 0 8px 18px rgba(6, 60, 89, .07); }
.bento-mode td,
.bento-mode td:nth-child(n) {
  display: block;
  width: auto;
  height: auto;
  padding: 0;
  border: 0;
}
.bento-mode .deliverable-cell { grid-column: 1; grid-row: 1; min-width: 0; }
.bento-mode .deliverable { align-items: flex-start; }
.bento-mode .deliverable-icon { width: 2.55rem; height: 2.55rem; border-radius: .5rem; }
.bento-mode .deliverable-icon svg { width: 1.45rem; height: 1.45rem; }
.bento-mode .deliverable strong { padding-top: .16rem; white-space: normal; text-overflow: clip; }
.bento-mode .row-percentage {
  grid-column: 2;
  grid-row: 1;
  align-self: start;
  padding-top: .15rem;
  font-size: 1rem;
  font-weight: 600;
  text-align: right;
}
.bento-mode td.credit-value {
  grid-column: 1 / -1;
  grid-row: 2;
  display: flex;
  align-items: center;
  gap: .35rem;
  font-size: .74rem;
}
.bento-mode .credit-value::before {
  content: attr(data-label);
  margin-right: .35rem;
  color: var(--muted);
  font-family: "Geist", ui-sans-serif, sans-serif;
  font-size: .67rem;
}
.bento-mode .credit-value i { margin: 0 .25rem; }
.bento-mode .progress-cell { grid-column: 1 / -1; grid-row: 3; }
.bento-mode .progress-cell .progress-track { height: .58rem; }

body.drawer-open { overflow: hidden; }

.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 29;
  border: 0;
  background: rgba(4, 25, 38, .28);
  opacity: 0;
  cursor: default;
  transition: opacity 220ms ease;
}

.evidence-drawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 30;
  width: min(31rem, 100vw);
  height: 100dvh;
  overflow-y: auto;
  background: var(--surface);
  border-left: 1px solid var(--line);
  box-shadow: -18px 0 42px rgba(4, 51, 77, .13);
  transform: translateX(100%);
  transition: transform 220ms ease;
}

body.drawer-open .drawer-backdrop { opacity: 1; }
body.drawer-open .evidence-drawer { transform: translateX(0); }

.drawer-header {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 4.6rem;
  padding: .85rem 1.15rem .85rem 1.4rem;
  background: rgba(255,255,255,.96);
  border-bottom: 1px solid var(--line);
}

.drawer-header span { display: block; margin-bottom: .18rem; color: var(--muted); font-size: .65rem; }
.drawer-header h2 { margin: 0; font-size: 1.08rem; line-height: 1.2; font-weight: 650; }
.drawer-close {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 2.35rem;
  height: 2.35rem;
  border: 1px solid var(--line);
  border-radius: .35rem;
  background: white;
  color: var(--ink);
  cursor: pointer;
  transition: background-color 160ms ease, transform 160ms ease;
}
.drawer-close:hover { background: var(--canvas); }
.drawer-close:active { transform: translateY(1px); }
.drawer-close svg { width: 1rem; height: 1rem; stroke-width: 1.9; }
.drawer-content { padding: 1.15rem 1.4rem 2rem; }

.drawer-credit-summary { margin-bottom: 1rem; padding: 1rem; border: 1px solid var(--line); background: white; }
.drawer-credit-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; }
.drawer-credit-heading span { display: block; color: var(--muted); font-size: .62rem; }
.drawer-credit-heading > div:first-child > strong { display: flex; align-items: baseline; gap: .35rem; margin-top: .32rem; font-family: "Geist Mono", ui-monospace, monospace; font-size: 1.05rem; }
.drawer-credit-heading b { font-weight: 600; }
.drawer-credit-heading i { color: var(--muted); font-style: normal; font-weight: 400; }
.drawer-credit-percentage { text-align: right; }
.drawer-credit-percentage strong { display: block; color: var(--accent); font-family: "Geist Mono", ui-monospace, monospace; font-size: 1.45rem; line-height: 1; }
.drawer-credit-percentage span { margin-top: .3rem; }
.drawer-credit-track { height: .48rem; margin-top: .9rem; overflow: hidden; background: #e7ecef; border: 1px solid #d5dde2; }
.drawer-credit-track span { display: block; width: 0; height: 100%; background: var(--accent); transition: width 220ms ease; }
.drawer-credit-summary > p { margin: .5rem 0 0; color: var(--muted); font-size: .62rem; text-align: right; }
.drawer-description { margin: 0; color: var(--muted); font-size: .76rem; line-height: 1.5; }
.evidence-section { margin-top: 1.15rem; }
.evidence-section > header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: .65rem; }
.evidence-section > header span { display: block; margin-bottom: .16rem; color: var(--accent); font-size: .62rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.evidence-section h3 { margin: 0; font-size: .9rem; }
.evidence-section > header > strong { color: var(--muted); font-family: "Geist Mono", ui-monospace, monospace; font-size: .65rem; font-weight: 500; }
.evidence-list { display: grid; gap: .55rem; }
.evidence-item {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: .7rem;
  align-items: start;
  padding: .9rem;
  border: 1px solid var(--line);
  border-radius: .45rem;
  background: white;
  color: var(--ink);
  text-decoration: none;
  transition: border-color 160ms ease, background-color 160ms ease, transform 160ms ease;
}
.evidence-item[href]:hover { border-color: #b8c6ce; background: #fafcfc; transform: translateY(-1px); }
.evidence-item.has-image { grid-template-columns: 7.2rem minmax(0, 1fr) auto; padding: 0; overflow: hidden; }
.evidence-copy { display: block; padding: 1rem; }
.copy-status { display: inline-flex; margin-bottom: .65rem; padding: .28rem .42rem; background: var(--icon-surface); color: var(--navy); font-size: .52rem; font-weight: 650; text-transform: uppercase; }
.evidence-copy .evidence-body > strong { font-size: .84rem; line-height: 1.4; }
.article-preview-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; margin-bottom: .7rem; }
.article-work-date { color: var(--muted); font-size: .55rem; font-weight: 650; text-transform: uppercase; }
.article-keyword-tag { margin-left: auto; padding: .27rem .42rem; border: 1px solid #cbdce7; border-radius: .25rem; background: #edf5fa; color: var(--navy); font-size: .52rem; font-weight: 650; }
.article-preview-meta .draft-chip { margin-left: 0; }
.article-preview-title { display: block; }
.article-preview-copy {
  display: -webkit-box;
  margin: .65rem 0 0;
  overflow: hidden;
  color: #455966;
  font-size: .68rem;
  line-height: 1.65;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}
.evidence-copy:has(.article-more[open]) .article-preview-copy { display: none; }
.evidence-copy blockquote { margin: .75rem 0 0; padding: .75rem 0 .75rem .85rem; border-left: 3px solid var(--accent); color: #354957; font-size: .7rem; font-weight: 550; line-height: 1.55; }
.copy-summary { margin-top: .75rem; padding-top: .75rem; border-top: 1px solid var(--line); }
.copy-summary > span,
.copy-keyword > span { display: block; margin-bottom: .3rem; color: var(--muted); font-size: .55rem; font-weight: 650; text-transform: uppercase; }
.copy-summary p { margin: 0; color: #354957; font-size: .68rem; line-height: 1.6; }
.article-more { margin-top: .75rem; border-top: 1px solid var(--line); }
.article-more summary { display: flex; align-items: center; gap: .5rem; padding-top: .7rem; color: var(--navy); font-size: .64rem; font-weight: 650; cursor: pointer; list-style: none; }
.article-more summary::-webkit-details-marker { display: none; }
.article-more summary b { display: grid; place-items: center; width: 1.25rem; height: 1.25rem; margin-left: auto; border: 1px solid var(--line); font-family: "Geist Mono", ui-monospace, monospace; font-size: .78rem; font-weight: 500; transition: transform 160ms ease; }
.article-more[open] summary b { transform: rotate(45deg); }
.read-less-label { display: none; }
.article-more[open] .read-more-label { display: none; }
.article-more[open] .read-less-label { display: inline; }
.article-more-content { padding-top: .15rem; }
.article-detail-label { display: block; color: var(--muted); font-size: .55rem; font-weight: 650; text-transform: uppercase; }
.full-article-body { margin-top: .65rem; }
.full-article-body h4 { margin: 1.05rem 0 .55rem; color: var(--navy); font-size: .76rem; line-height: 1.4; }
.full-article-body p { margin: 0 0 .75rem; color: #354957; font-size: .68rem; line-height: 1.68; }
.full-article-body ul { margin: -.1rem 0 .8rem; padding-left: 1.1rem; color: #354957; font-size: .68rem; line-height: 1.65; }
.full-article-body li + li { margin-top: .22rem; }
.copy-topics { display: grid; gap: .35rem; margin: .75rem 0 0; padding-left: 1rem; color: #354957; font-size: .65rem; line-height: 1.45; }
.copy-topics li::marker { color: var(--accent); }
.copy-keyword { margin-top: .85rem; padding: .65rem .7rem; background: var(--canvas); }
.copy-keyword strong { color: var(--navy); font-size: .7rem; }
.copy-note { margin: .65rem 0 0; color: var(--muted); font-size: .58rem; line-height: 1.45; }
.keyword-evidence { display: block; padding: 1rem; }
.keyword-title-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-top: .8rem; padding-top: .8rem; border-top: 1px solid var(--line); }
.keyword-title-row > div > span { display: block; margin-bottom: .28rem; color: var(--muted); font-size: .55rem; font-weight: 650; text-transform: uppercase; }
.keyword-title-row > div > strong { display: block; color: var(--navy); font-size: 1rem; line-height: 1.25; }
.keyword-status { display: inline-flex; align-items: center; gap: .35rem; flex: 0 0 auto; padding: .3rem .45rem; background: #e9f7f1; color: #087a52; font-size: .55rem; font-weight: 650; text-transform: uppercase; }
.keyword-status i { width: .35rem; height: .35rem; background: #0ba36c; border-radius: 50%; }
.keyword-details { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .55rem; margin: .85rem 0 0; }
.keyword-details > div { padding: .7rem; background: var(--canvas); }
.keyword-details dt { margin-bottom: .3rem; color: var(--muted); font-size: .53rem; font-weight: 650; text-transform: uppercase; }
.keyword-details dd { margin: 0; color: #354957; font-size: .65rem; font-weight: 550; line-height: 1.4; }
.ads-evidence { display: block; padding: 1rem; }
.ads-dashboard-shot { width: min(100%, 20rem); margin: .85rem auto 0; }
.ads-dashboard-shot > div { position: relative; aspect-ratio: 4 / 3; overflow: hidden; border: 1px solid var(--line); background: #e5f4f2; }
.ads-dashboard-shot img { display: block; width: 100%; height: 100%; object-fit: contain; background: white; }
.ads-dashboard-shot.seed-shot > div { aspect-ratio: 400 / 410; }
.ads-dashboard-shot.seed-shot img { position: absolute; top: 0; left: 0; width: 400%; max-width: none; height: auto; object-fit: initial; transform: translate(-10.3%, -36.5%); }
.ads-dashboard-shot figcaption { margin-top: .38rem; color: var(--muted); font-size: .52rem; text-align: center; }
.ads-title-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-top: .8rem; padding-top: .8rem; border-top: 1px solid var(--line); }
.ads-title-row > div:first-child > span { display: block; margin-bottom: .28rem; color: var(--muted); font-size: .55rem; font-weight: 650; text-transform: uppercase; }
.ads-title-row > div:first-child > strong { display: block; color: var(--navy); font-size: 1rem; line-height: 1.25; }
.ads-statuses { display: flex; gap: .35rem; flex-wrap: wrap; justify-content: flex-end; }
.ads-statuses span { display: inline-flex; align-items: center; gap: .3rem; padding: .3rem .42rem; background: var(--canvas); color: var(--muted); font-size: .52rem; font-weight: 650; text-transform: uppercase; }
.ads-statuses span:first-child { background: #e9f7f1; color: #087a52; }
.ads-statuses i { width: .35rem; height: .35rem; background: #0ba36c; border-radius: 50%; }
.ads-meta { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .55rem; margin: .8rem 0 0; }
.ads-meta > div { padding: .65rem .7rem; background: var(--canvas); }
.ads-meta dt { margin-bottom: .25rem; color: var(--muted); font-size: .52rem; font-weight: 650; text-transform: uppercase; }
.ads-meta dd { margin: 0; color: var(--navy); font-size: .66rem; font-weight: 650; }
.ads-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: .85rem; border: 1px solid var(--line); }
.ads-metrics > div { padding: .8rem .7rem; text-align: center; }
.ads-metrics > div + div { border-left: 1px solid var(--line); }
.ads-metrics strong,
.ads-metrics span { display: block; }
.ads-metrics strong { color: var(--navy); font-family: "Geist Mono", ui-monospace, monospace; font-size: 1rem; }
.ads-metrics span { margin-top: .25rem; color: var(--muted); font-size: .52rem; font-weight: 600; text-transform: uppercase; }
.ads-destination { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: .7rem; padding: .75rem; background: var(--canvas); color: var(--ink); text-decoration: none; transition: background-color 160ms ease, border-color 160ms ease; }
.ads-destination:hover { background: #edf3f5; }
.ads-destination span,
.ads-destination small { display: block; color: var(--muted); font-size: .52rem; }
.ads-destination span { margin-bottom: .28rem; font-weight: 650; text-transform: uppercase; }
.ads-destination strong { display: block; color: #354957; font-size: .66rem; line-height: 1.4; }
.ads-destination small { margin-top: .22rem; }
.ads-destination > b { flex: 0 0 auto; color: var(--navy); font-size: .82rem; }
.evidence-media { position: relative; align-self: stretch; min-height: 7.3rem; background: var(--icon-surface); overflow: hidden; }
.evidence-media img { display: block; width: 100%; height: 100%; object-fit: cover; }
.evidence-media span { position: absolute; left: .5rem; bottom: .5rem; padding: .28rem .38rem; background: rgba(4, 51, 77, .9); color: white; font-size: .5rem; font-weight: 650; }
.evidence-body { min-width: 0; }
.has-image .evidence-body { padding: .8rem 0 .8rem .15rem; }
.evidence-body > strong { display: block; font-size: .72rem; line-height: 1.35; }
.evidence-meta { display: flex; align-items: center; gap: .4rem; margin-bottom: .42rem; color: var(--muted); font-size: .55rem; font-weight: 600; text-transform: uppercase; }
.evidence-meta i { width: .2rem; height: .2rem; background: var(--accent); border-radius: 50%; }
.draft-chip { margin-left: auto; padding: .22rem .36rem; background: #fff3d8; color: #8b5b00; font-size: .5rem; font-weight: 700; }
.evidence-item p { margin: .3rem 0 0; color: var(--muted); font-size: .65rem; line-height: 1.42; }
.evidence-open { margin-right: .1rem; color: var(--navy); font-size: .82rem; }
.has-image .evidence-open { margin: .8rem .75rem 0 0; }
.evidence-empty { padding: 2rem 1rem; border: 1px dashed var(--line); text-align: center; }
.evidence-empty strong,
.evidence-empty span { display: block; }
.evidence-empty strong { font-size: .78rem; }
.evidence-empty span { margin-top: .3rem; color: var(--muted); font-size: .67rem; }

body.admin-open { overflow: hidden; }
.admin-backdrop { position: fixed; inset: 0; z-index: 29; border: 0; background: rgba(4, 28, 42, .42); opacity: 0; transition: opacity 220ms ease; }
.admin-panel { position: fixed; top: 0; right: 0; z-index: 30; display: grid; grid-template-rows: auto auto minmax(0, 1fr); width: min(100%, 48rem); height: 100dvh; background: var(--canvas); box-shadow: -18px 0 45px rgba(4, 28, 42, .16); transform: translateX(100%); transition: transform 220ms ease; }
body.admin-open .admin-backdrop { opacity: 1; }
body.admin-open .admin-panel { transform: translateX(0); }
.admin-panel-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 5rem; padding: 1rem 1.5rem; border-bottom: 1px solid var(--line); background: white; }
.admin-panel-header span { display: block; margin-bottom: .18rem; color: var(--muted); font-size: .62rem; }
.admin-panel-header h2 { margin: 0; font-size: 1.08rem; }
.admin-tabs { display: flex; gap: .2rem; padding: .55rem 1.5rem 0; border-bottom: 1px solid var(--line); background: white; }
.admin-tabs button { min-height: 2.5rem; padding: .55rem .75rem; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--muted); font-size: .68rem; font-weight: 650; }
.admin-tabs button.active { border-bottom-color: var(--accent); color: var(--ink); }
.admin-panel-body { min-height: 0; overflow: auto; padding: 1.1rem 1.5rem 2rem; }
.admin-form-section { display: grid; gap: .8rem; padding: 1rem; border: 1px solid var(--line); background: white; }
.admin-form-section h3 { margin: 0 0 .15rem; color: var(--navy); font-size: .78rem; }
.form-grid { display: grid; gap: .8rem; }
.form-grid.two-columns { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.quota-editor { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: .65rem; padding-top: .8rem; border-top: 1px solid var(--line); }
.quota-editor > span { align-self: center; color: var(--muted); font-size: .64rem; font-weight: 650; }
.quota-editor > strong { min-width: 4.5rem; padding: .62rem .75rem; border: 1px solid var(--line); background: var(--canvas); color: var(--ink); font-family: "Geist Mono", ui-monospace, monospace; font-size: .72rem; text-align: right; }
.quota-editor > small { color: var(--muted); font-size: .56rem; font-weight: 650; text-transform: uppercase; }
.quota-editor button,
.admin-form-actions > button,
.admin-history-item button { min-height: 2.35rem; padding: .45rem .65rem; border: 1px solid var(--line); border-radius: .28rem; background: white; color: var(--navy); font-size: .64rem; font-weight: 650; }
.quota-editor button:hover,
.admin-form-actions > button:hover,
.admin-history-item button:hover { background: var(--canvas); }
.admin-form-actions { display: flex; justify-content: flex-end; gap: .55rem; }
.admin-form-actions .primary-button { min-width: 9rem; border-color: var(--navy); background: var(--navy); color: white; }
.admin-history > header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: .7rem; }
.admin-history h3 { margin: 0; font-size: .82rem; }
.admin-history > header span { color: var(--muted); font-size: .62rem; }
#admin-history-list { display: grid; gap: .55rem; }
.admin-history-item { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .85rem; border: 1px solid var(--line); background: white; }
.admin-history-item > div:first-child { min-width: 0; }
.admin-history-item > div:last-child { display: flex; flex: 0 0 auto; gap: .4rem; }
.admin-history-item span,
.admin-history-item strong,
.admin-history-item small { display: block; }
.admin-history-item span { margin-bottom: .25rem; color: var(--muted); font-size: .55rem; text-transform: uppercase; }
.admin-history-item strong { overflow-wrap: anywhere; font-size: .72rem; line-height: 1.35; }
.admin-history-item small { margin-top: .32rem; color: var(--muted); font-size: .56rem; }
.admin-history-item small b { font-weight: 700; text-transform: uppercase; }
.status-published { color: #087a52; }
.status-draft { color: #8b5b00; }
.admin-history-item .danger-button { color: #a93227; }
.admin-history-empty { padding: 2rem 1rem; border: 1px dashed var(--line); text-align: center; }
.admin-history-empty strong,
.admin-history-empty span { display: block; }
.admin-history-empty strong { font-size: .76rem; }
.admin-history-empty span { margin-top: .32rem; color: var(--muted); font-size: .64rem; }

@media (max-width: 900px) {
  .summary-grid { gap: 1rem; }
  .progress-caption { margin-top: 2rem; }
  th, td { padding-inline: 1.25rem; }
  th:nth-child(4), td:nth-child(4) { padding-right: 1.5rem; }
  .bento-mode tbody { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-height: 850px) and (min-width: 761px) {
  .topbar-inner { min-height: 4.2rem; }
  .brand-lockup { height: 2.8rem; }
  .levner-logo { width: 6.3rem; height: 2.3rem; }
  .pam-logo { width: 2.28rem; height: 2.28rem; }
  main { padding-block: .55rem .8rem; }
  .credit-summary { padding: 1rem 1.5rem 1.1rem; }
  .summary-title { gap: .7rem; }
  .title-icon { width: 1.8rem; height: 1.8rem; }
  .title-icon svg { width: 1.7rem; height: 1.7rem; }
  h1 { font-size: 1.35rem; }
  .summary-grid { margin-top: .65rem; }
  .overall-metric strong { font-size: 3.25rem; }
  .overall-metric span { margin-top: .55rem; font-size: .76rem; }
  .progress-track.large { height: .75rem; }
  .progress-caption { margin-top: 1.25rem; font-size: .78rem; }
  .credit-ledger { margin-top: .55rem; }
  .ledger-toolbar { min-height: 3.1rem; padding-block: .35rem; }
  th { height: 3rem; }
  td { height: 3.45rem; padding-block: .3rem; }
  .deliverable-icon { width: 2.35rem; height: 2.35rem; border-radius: .48rem; }
  .deliverable-icon svg { width: 1.35rem; height: 1.35rem; }
  .deliverable strong { font-size: .82rem; }
}

@media (max-width: 760px) {
  .topbar-inner { width: min(100% - 1rem, 1440px); min-height: 4.15rem; gap: .75rem; }
  .brand { gap: .5rem; }
  .brand-lockup { height: 2.85rem; padding-inline: .28rem .38rem; }
  .levner-logo { width: 5.8rem; height: 2.35rem; }
  .pam-logo { width: 2.32rem; height: 2.32rem; }
  .brand strong { display: none; }
  .topbar-actions { gap: .35rem; }
  .current-date { min-width: 9.5rem; padding-inline: .45rem; }
  .current-date strong { font-size: .6rem; }
  .topbar-button span { display: none; }
  .topbar-button { width: 2.25rem; padding: 0; }
  main { width: min(100% - .75rem, 1512px); padding-top: .5rem; }
  .credit-summary { padding: 1.25rem 1.1rem 1.35rem; }
  .title-icon { width: 1.9rem; height: 1.9rem; }
  .title-icon svg { width: 1.8rem; height: 1.8rem; }
  .summary-grid { grid-template-columns: 1fr; gap: 1.3rem; }
  .overall-metric strong { font-size: 4rem; }
  .overall-metric span { margin-top: .7rem; font-size: .76rem; }
  .overall-progress > strong { margin-bottom: .35rem; }
  .progress-track.large { height: .8rem; }
  .progress-caption { margin-top: 1rem; font-size: .74rem; }

  .credit-ledger { border: 0; background: transparent; }
  .ledger-toolbar {
    min-height: 3.45rem;
    padding: .45rem .4rem .45rem .7rem;
    background: var(--surface);
    border: 1px solid var(--line);
  }
  .view-switch button { min-width: 2.4rem; padding-inline: .55rem; }
  .view-switch button span { display: none; }
  .table-scroll { overflow: visible; }
  table,
  tbody { display: block; width: 100%; min-width: 0; }
  thead { display: none; }
  tbody { display: grid; gap: .6rem; }
  tbody tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: .75rem 1rem;
    padding: .9rem;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: .55rem;
  }
  td,
  th:nth-child(n),
  td:nth-child(n) {
    display: block;
    width: auto;
    height: auto;
    padding: 0;
    border: 0;
  }
  .deliverable-cell { grid-column: 1; grid-row: 1; min-width: 0; }
  .row-percentage {
    grid-column: 2;
    grid-row: 1;
    align-self: center;
    padding-left: .5rem;
    font-size: .96rem;
    font-weight: 600;
    text-align: right;
  }
  td.credit-value {
    grid-column: 1 / -1;
    grid-row: 2;
    display: flex;
    align-items: center;
    gap: .35rem;
    color: var(--ink);
    font-size: .72rem;
  }
  .credit-value::before {
    content: attr(data-label);
    margin-right: .35rem;
    color: var(--muted);
    font-family: "Geist", ui-sans-serif, sans-serif;
    font-size: .68rem;
  }
  .credit-value i { margin: 0 .25rem; }
  .progress-cell { grid-column: 1 / -1; grid-row: 3; }
  .progress-cell .progress-track { height: .58rem; }
  .deliverable-icon { width: 2.55rem; height: 2.55rem; border-radius: .5rem; }
  .deliverable-icon svg { width: 1.45rem; height: 1.45rem; }
  .deliverable { gap: .75rem; }
  .deliverable strong { white-space: normal; text-overflow: clip; }

  .bento-mode tbody { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bento-mode tbody tr { padding: .85rem; }
  .bento-mode .deliverable { display: grid; gap: .55rem; }

  .admin-panel-body { padding-inline: 1rem; }
  .admin-panel-header,
  .admin-tabs { padding-inline: 1rem; }
  .form-grid.two-columns { grid-template-columns: 1fr; }
  .quota-editor { grid-template-columns: minmax(0, 1fr) auto auto; }
}

@media (max-width: 430px) {
  .topbar-inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto auto;
    grid-template-areas:
      "brand knowledge manage logout"
      "date date date date";
    gap: .45rem .4rem;
    min-height: 0;
    padding: .5rem 0 .55rem;
  }
  .brand { grid-area: brand; min-width: 0; }
  .brand-lockup { gap: .28rem; height: 2.45rem; }
  .levner-logo { width: 5rem; height: 2rem; }
  .pam-logo { width: 2rem; height: 2rem; }
  .brand-collaboration { font-size: .68rem; }
  .topbar-actions { display: contents; }
  .current-date {
    grid-area: date;
    justify-content: flex-start;
    width: 100%;
    min-width: 0;
    padding: .48rem .1rem 0;
    border-top: 1px solid var(--line);
    border-left: 0;
  }
  .current-date > svg { width: .95rem; height: .95rem; }
  .current-date strong { font-size: .6rem; }
  .role-badge { display: none; }
  .topbar-button { grid-area: manage; }
  .knowledge-link { grid-area: knowledge; }
  .topbar .icon-button { grid-area: logout; }
  .topbar-button,
  .icon-button { width: 2.5rem; height: 2.5rem; min-height: 2.5rem; }
  .auth-screen {
    align-items: center;
    justify-items: center;
    padding: 1rem;
    background-position: 62% center;
  }
  .auth-panel {
    width: 100%;
    max-width: 27rem;
    padding: 1.35rem;
    background: rgba(255, 255, 255, .96);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
  }
  .auth-brand { margin-bottom: 1.5rem; }
  .article-keyword-tag { margin-left: 0; }
  .progress-caption { align-items: flex-start; }
  .progress-caption > span:last-child { text-align: right; }
  .bento-mode tbody { grid-template-columns: 1fr; }
  .drawer-content { padding-inline: 1rem; }
  .evidence-item.has-image { grid-template-columns: 1fr auto; }
  .evidence-media { grid-column: 1 / -1; min-height: 10rem; aspect-ratio: 3 / 2; }
  .has-image .evidence-body { padding: .1rem 0 1rem 1rem; }
  .has-image .evidence-open { margin-top: .1rem; }
  .keyword-title-row { align-items: flex-start; }
  .keyword-details { grid-template-columns: 1fr; }
  .ads-title-row { align-items: flex-start; }
  .ads-statuses { max-width: 8rem; }
  .ads-dashboard-shot { width: min(100%, 17rem); }
  .admin-history-item { align-items: flex-start; }
  .admin-history-item > div:last-child { display: grid; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
