:root {
  color: #18212f;
  background: #f5f7f9;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  --accent: #17705d;
  --accent-strong: #125e50;
  --accent-soft: #e5f0ed;
  --surface: #ffffff;
  --background: #f5f7f9;
  --border: #dce3ea;
  --border-soft: #edf1f4;
  --text: #18212f;
  --text-secondary: #526174;
  --text-muted: #6b798a;
  --warning: #936200;
  --warning-soft: #fff2d8;
  --radius: 8px;
  --shadow: 0 18px 48px rgba(28, 45, 66, 0.08);
}

* { box-sizing: border-box; }
html { min-width: 320px; }
body { margin: 0; min-height: 100dvh; background: var(--background); }
button, input { font: inherit; }
button { cursor: pointer; }
a { color: inherit; }
img { display: block; max-width: 100%; }
.hidden { display: none !important; }

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 100;
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid var(--accent);
  border-radius: 7px;
  color: #ffffff;
  background: var(--accent);
  transform: translateY(-150%);
}
.skip-link:focus { transform: translateY(0); }

.shell { min-height: 100dvh; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 0 24px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.brand { min-width: 0; display: inline-flex; align-items: center; gap: 10px; }
.brand-logo {
  flex: 0 0 auto;
  width: 42px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid #cfdad6;
  border-radius: 7px;
  background: #ffffff;
  overflow: hidden;
}
.brand-logo img { width: 36px; height: 30px; object-fit: contain; }
.brand-fallback { width: 100%; height: 100%; display: grid; place-items: center; color: #fff; background: var(--accent); font-weight: 780; }
.brand-copy { min-width: 0; display: grid; gap: 2px; }
.brand-copy strong { overflow: hidden; color: var(--text); font-size: 15px; line-height: 1.2; text-overflow: ellipsis; white-space: nowrap; }
.brand-copy small { overflow: hidden; color: var(--text-muted); font-size: 11px; line-height: 1.2; text-overflow: ellipsis; white-space: nowrap; }
.top-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; color: var(--text-secondary); font-size: 12px; white-space: nowrap; }
.directory-link { display: inline-flex; align-items: center; min-height: 32px; padding: 6px 9px; border: 1px solid #cbd5df; border-radius: 7px; color: #334155; background: #fff; font-weight: 650; text-decoration: none; }
.directory-pending { color: var(--text-muted); }
.icon-button { min-height: 34px; padding: 6px 10px; border: 1px solid #ccd6e0; border-radius: 7px; color: #334155; background: #fff; font-weight: 650; }
.menu-button, .close-menu-button { display: none; }

.app-layout {
  width: min(1440px, 100%);
  height: calc(100dvh - 62px);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  overflow: hidden;
}
.side-nav {
  min-width: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 15px;
  padding: 20px 14px 28px;
  overflow-y: auto;
  border-right: 1px solid var(--border);
  background: #fff;
}
.nav-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 6px; }
.nav-heading > div { display: grid; gap: 3px; }
.nav-heading strong { font-size: 15px; }
.nav-heading span { color: var(--text-muted); font-size: 11px; }
.search-control { display: grid; gap: 6px; color: var(--text-secondary); font-size: 12px; font-weight: 650; }
.search-control input { width: 100%; min-height: 39px; padding: 8px 10px; border: 1px solid #cbd5df; border-radius: 7px; outline: none; color: var(--text); background: #fff; }
.search-control input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(23, 112, 93, 0.12); }
.project-groups { display: grid; gap: 17px; }
.project-group { display: grid; gap: 5px; }
.group-title { margin: 0; padding: 0 8px 3px; color: #7a8796; font-size: 11px; font-weight: 760; letter-spacing: 0.04em; }
.group-items { display: grid; gap: 4px; }
.nav-item { width: 100%; min-height: 42px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 8px 9px; border: 0; border-radius: 7px; color: var(--text-secondary); background: transparent; text-align: left; }
.nav-item:hover { background: #f1f4f6; }
.nav-item.active { color: var(--accent-strong); background: var(--accent-soft); }
.nav-item-copy { min-width: 0; display: grid; gap: 2px; }
.nav-item-copy strong, .nav-item-copy span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-item-copy strong { font-size: 13px; font-weight: 700; }
.nav-item-copy span { color: var(--text-muted); font-size: 10px; }
.nav-item.active .nav-item-copy span { color: #46796d; }
.nav-marker { width: 7px; height: 7px; border-radius: 50%; background: #9eabb8; }
.nav-item.active .nav-marker { background: var(--accent); }
.nav-empty { margin: 0; padding: 18px 8px; color: var(--text-muted); font-size: 13px; text-align: center; }

.content { min-width: 0; height: 100%; padding: 30px 34px 64px; overflow-y: auto; }
.load-state { padding: 48px 10px; color: var(--text-muted); text-align: center; }
.load-state.error { color: #a32920; }
.project-detail { width: min(1080px, 100%); margin: 0 auto; outline: none; }
.detail-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 22px; }
.project-identity { min-width: 0; display: flex; align-items: flex-start; gap: 14px; }
.project-logo, .project-monogram { flex: 0 0 auto; width: 56px; height: 56px; display: grid; place-items: center; border: 1px solid var(--border); border-radius: var(--radius); background: #fff; overflow: hidden; }
.project-logo img { width: 48px; height: 42px; object-fit: contain; }
.project-monogram { color: var(--accent-strong); background: var(--accent-soft); font-size: 16px; font-weight: 780; }
.project-copy { min-width: 0; }
.project-copy h1 { margin: 0; color: var(--text); font-size: clamp(28px, 4vw, 42px); line-height: 1.08; letter-spacing: -0.035em; }
.project-copy > p { max-width: 760px; margin: 10px 0 0; color: var(--text-secondary); font-size: 15px; line-height: 1.65; }
.project-meta { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 13px; }
.project-meta span, .entry-kind { display: inline-flex; width: fit-content; padding: 4px 7px; border-radius: 6px; background: #edf2f5; color: #42546a; font-size: 11px; }
.status-chip { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 7px; padding: 6px 9px; border: 1px solid var(--border); border-radius: 999px; color: #42546a; background: #fff; font-size: 12px; white-space: nowrap; }
.status-chip::before { width: 7px; height: 7px; border-radius: 50%; background: #8b98a8; content: ""; }
.status-chip.ready::before, .status-chip.active::before { background: var(--accent); }
.status-chip.warning { color: var(--warning); background: var(--warning-soft); border-color: #ead8a8; }
.status-chip.warning::before { background: #c28710; }

.entry-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.entry-panel, .notes-panel { min-width: 0; overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow); }
.assets-panel { grid-column: 1 / -1; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--border-soft); }
.panel-heading h2 { margin: 0; font-size: 16px; }
.panel-heading span { color: var(--text-muted); font-size: 11px; }
.entry-list { display: grid; }
.entry-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 14px; align-items: center; padding: 14px 16px; border-top: 1px solid var(--border-soft); }
.entry-row:first-child { border-top: 0; }
.entry-row-title { min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 7px; }
.entry-row-title strong { overflow-wrap: anywhere; font-size: 13px; }
.entry-row > p { grid-column: 1; margin: 0; color: var(--text-muted); font-size: 12px; line-height: 1.45; }
.entry-link, .asset-link { display: inline-flex; align-items: center; justify-content: center; min-height: 34px; padding: 7px 10px; border: 1px solid #cbd5df; border-radius: 7px; color: #334155; background: #fff; font-size: 12px; font-weight: 700; text-decoration: none; white-space: nowrap; }
.entry-link.primary { color: #fff; background: var(--accent); border-color: var(--accent); }
.entry-empty { padding: 24px 16px; color: var(--text-muted); font-size: 13px; text-align: center; }
.asset-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; padding: 14px; }
.asset-card { min-width: 0; overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius); background: #fff; }
.asset-preview { height: 210px; display: grid; place-items: center; padding: 10px; border-bottom: 1px solid var(--border-soft); background: #f8fafb; }
.asset-preview img { width: 100%; height: 100%; object-fit: contain; }
.asset-card > p { min-height: 38px; margin: 0; padding: 12px 12px 6px; color: var(--text-secondary); font-size: 12px; font-weight: 650; }
.asset-card .asset-link { margin: 0 12px 12px; }
.notes-panel { margin-top: 14px; }
.notes-list { margin: 0; padding: 14px 20px 18px 34px; color: var(--text-secondary); font-size: 13px; line-height: 1.7; }
.notes-list li + li { margin-top: 5px; }
.notes-list .logo-note { color: var(--accent-strong); font-weight: 650; }
.noscript { margin: 24px; padding: 18px; border: 1px solid #e5cf91; border-radius: var(--radius); background: #fff4d6; }

.nav-item:focus-visible, .icon-button:focus-visible, .entry-link:focus-visible, .asset-link:focus-visible, .directory-link:focus-visible, .skip-link:focus-visible {
  outline: 3px solid rgba(23, 112, 93, 0.28);
  outline-offset: 2px;
}

@media (max-width: 980px) {
  .asset-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 820px) {
  .topbar { padding: 0 14px; }
  .verified-date, .directory-origin, .brand-copy small { display: none; }
  .menu-button, .close-menu-button { display: inline-flex; }
  .app-layout { display: block; height: auto; min-height: calc(100dvh - 62px); overflow: visible; }
  .side-nav { position: fixed; inset: 62px auto 0 0; z-index: 40; width: min(88vw, 340px); height: auto; transform: translateX(-102%); box-shadow: 18px 0 48px rgba(28, 45, 66, 0.2); }
  body.nav-open { overflow: hidden; }
  body.nav-open .side-nav { transform: translateX(0); }
  .nav-scrim { position: fixed; inset: 62px 0 0; z-index: 35; border: 0; background: rgba(26, 36, 48, 0.42); }
  .content { height: auto; min-height: calc(100dvh - 62px); padding: 22px 12px 44px; overflow: visible; }
  .detail-heading { flex-direction: column; gap: 14px; }
  .project-identity { width: 100%; }
  .project-copy h1 { font-size: clamp(27px, 9vw, 38px); }
  .entry-grid { grid-template-columns: 1fr; }
  .assets-panel { grid-column: auto; }
  .asset-grid { grid-template-columns: 1fr; }
  .asset-preview { height: min(58vw, 280px); }
  .entry-row { grid-template-columns: 1fr; }
  .entry-row > p { grid-column: 1; }
  .entry-link { width: 100%; }
}

@media (max-width: 520px) {
  .brand-logo { width: 38px; height: 34px; }
  .brand-logo img { width: 33px; height: 28px; }
  .brand-copy strong { font-size: 14px; }
  .project-logo, .project-monogram { width: 48px; height: 48px; }
  .project-logo img { width: 42px; height: 36px; }
}

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