:root {
  --paper: #f4f1ea;
  --paper-2: #ebe6dc;
  --ink: #171916;
  --muted: #716f66;
  --line: rgba(23, 25, 22, .12);
  --line-strong: rgba(23, 25, 22, .2);
  --accent: #2d6a49;
  --accent-soft: rgba(45, 106, 73, .11);
  --danger: #9d423a;
  --panel: rgba(250, 248, 243, .88);
  --shadow: 0 18px 60px rgba(32, 30, 22, .09);
  --radius: 18px;
  --mono: 'DM Mono', monospace;
  --sans: 'Space Grotesk', system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-height: 100vh; color: var(--ink); background: var(--paper); font-family: var(--sans); }
body.modal-open { overflow: hidden; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .58; }
a { color: inherit; }
[hidden] { display: none !important; }

.noise { position: fixed; inset: 0; pointer-events: none; opacity: .035; z-index: 30; background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 220 220' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.3'/%3E%3C/svg%3E"); }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 245px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 30px 22px 24px; display: flex; flex-direction: column; background: rgba(239, 235, 225, .78); border-right: 1px solid var(--line); backdrop-filter: blur(16px); }
.brand-lockup { display: flex; align-items: center; gap: 12px; }
.brand-mark { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 11px; background: var(--ink); color: var(--paper); font-weight: 700; font-size: 17px; }
.brand-name { margin: 0; font-size: 18px; font-weight: 700; letter-spacing: -.04em; }
.brand-caption { margin: 1px 0 0; color: var(--muted); font: 500 10px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; }
.primary-nav { margin-top: 45px; display: grid; gap: 6px; }
.nav-item { appearance: none; width: 100%; padding: 11px 12px; border: 0; border-radius: 12px; display: flex; align-items: center; gap: 10px; color: var(--muted); background: transparent; text-align: left; transition: .18s ease; }
.nav-item:hover, .nav-item.active { color: var(--ink); background: rgba(255,255,255,.48); }
.nav-icon { width: 18px; text-align: center; font-size: 16px; }
.nav-count { margin-left: auto; padding: 2px 7px; border-radius: 99px; background: var(--paper-2); font: 400 10px var(--mono); }
.sidebar-footer { margin-top: auto; padding-top: 18px; border-top: 1px solid var(--line); }
.storage-status { display: flex; align-items: center; gap: 8px; font: 500 11px var(--mono); text-transform: uppercase; letter-spacing: .06em; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.sidebar-footer p { margin: 10px 0 0; max-width: 180px; color: var(--muted); font-size: 11px; line-height: 1.55; }

.main-content { min-width: 0; padding: 0 52px 80px; }
.topbar { height: 75px; position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; background: rgba(244,241,234,.82); border-bottom: 1px solid var(--line); backdrop-filter: blur(14px); }
.breadcrumbs { display: flex; align-items: center; gap: 10px; color: var(--muted); font: 400 11px var(--mono); }
.breadcrumbs strong { color: var(--ink); font-weight: 500; }
.breadcrumb-slash { opacity: .35; }
.topbar-actions { position: relative; }
.avatar-button { width: 37px; height: 37px; border: 1px solid var(--line); border-radius: 50%; color: var(--paper); background: var(--ink); font: 500 12px var(--mono); }
.profile-menu { position: absolute; right: 0; top: 47px; width: 240px; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: #fbf9f4; box-shadow: var(--shadow); }
.profile-name { margin: 0; font-weight: 600; font-size: 13px; }
.profile-email { margin: 3px 0 12px; color: var(--muted); font: 400 10px var(--mono); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-menu button { width: 100%; padding: 9px 0; border: 0; border-top: 1px solid var(--line); background: transparent; color: var(--muted); display: flex; justify-content: space-between; }
.profile-menu button:hover { color: var(--ink); }

.page-view { max-width: 1250px; margin: 0 auto; padding-top: 52px; }
.page-heading { display: flex; align-items: end; justify-content: space-between; gap: 40px; }
.eyebrow { margin: 0 0 14px; color: var(--muted); font: 500 10px var(--mono); letter-spacing: .13em; text-transform: uppercase; display: flex; align-items: center; gap: 12px; }
.eyebrow-line { width: 46px; height: 1px; display: inline-block; background: var(--line-strong); }
.page-heading h1, .placeholder-view h1 { margin: 0; font-size: clamp(48px, 6vw, 78px); line-height: .91; letter-spacing: -.065em; font-weight: 600; }
.page-heading h1 em, .placeholder-view h1 em { font-style: normal; color: var(--accent); }
.heading-copy { max-width: 540px; margin: 21px 0 0; color: var(--muted); font-size: 15px; line-height: 1.65; }
.button { min-height: 44px; padding: 0 16px; border-radius: 11px; border: 1px solid var(--line); display: inline-flex; align-items: center; justify-content: center; gap: 10px; font-size: 12px; font-weight: 600; transition: transform .18s ease, background .18s ease, border-color .18s ease; }
.button:hover { transform: translateY(-1px); }
.button-primary { border-color: var(--ink); color: var(--paper); background: var(--ink); box-shadow: 0 8px 24px rgba(20,22,18,.1); }
.button-primary:hover { background: #272a24; }
.button-quiet { color: var(--ink); background: rgba(255,255,255,.36); }
.button-danger { color: var(--danger); border-color: rgba(157,66,58,.25); background: transparent; }
.button-plus { font-size: 18px; line-height: 0; }

.stats-grid { margin-top: 38px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.stat-card { min-height: 132px; padding: 19px; border: 1px solid var(--line); border-radius: 15px; background: rgba(255,255,255,.24); display: flex; flex-direction: column; }
.stat-card > span { color: var(--muted); font: 500 10px var(--mono); text-transform: uppercase; letter-spacing: .08em; }
.stat-card strong { margin-top: auto; font-size: 38px; line-height: 1; letter-spacing: -.06em; font-weight: 600; }
.stat-card small { margin-top: 8px; color: var(--muted); font-size: 11px; }

.toolbar { margin-top: 38px; display: flex; justify-content: space-between; gap: 18px; }
.search-box { flex: 1; max-width: 620px; min-height: 45px; padding: 0 12px; border: 1px solid var(--line); border-radius: 11px; background: rgba(255,255,255,.4); display: flex; align-items: center; gap: 9px; }
.search-box > span { color: var(--muted); font-size: 18px; }
.search-box input { width: 100%; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 12px; }
.search-box input::placeholder { color: #96948b; }
.search-box kbd { min-width: 22px; padding: 3px 5px; border: 1px solid var(--line); border-radius: 5px; color: var(--muted); background: rgba(255,255,255,.46); font: 400 10px var(--mono); text-align: center; }
.view-controls { display: flex; gap: 8px; align-items: center; }
.filter-wrap { position: relative; }
.filter-button, .segmented-control { min-height: 45px; border: 1px solid var(--line); border-radius: 11px; background: rgba(255,255,255,.4); }
.filter-button { min-width: 140px; padding: 0 12px; display: flex; align-items: center; justify-content: space-between; color: var(--ink); font-size: 11px; }
.filter-chevron { color: var(--muted); }
.filter-menu { position: absolute; top: 51px; right: 0; z-index: 20; width: 170px; padding: 6px; border: 1px solid var(--line); border-radius: 12px; background: #faf8f3; box-shadow: var(--shadow); }
.filter-menu button { width: 100%; padding: 9px 10px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-size: 11px; text-align: left; }
.filter-menu button:hover { color: var(--ink); background: var(--paper-2); }
.segmented-control { display: flex; padding: 4px; }
.segmented-button { width: 35px; border: 0; border-radius: 7px; color: var(--muted); background: transparent; }
.segmented-button.active { color: var(--ink); background: rgba(255,255,255,.78); box-shadow: 0 1px 7px rgba(0,0,0,.05); }

.results-meta { margin: 22px 0 11px; display: flex; align-items: center; gap: 10px; color: var(--muted); font: 400 10px var(--mono); text-transform: uppercase; letter-spacing: .08em; }
.meta-rule { width: 28px; height: 1px; background: var(--line-strong); }

.project-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.project-grid.list-view { grid-template-columns: 1fr; }
.project-card { position: relative; min-height: 330px; overflow: hidden; padding: 18px; border: 1px solid var(--line); border-radius: 16px; background: rgba(255,255,255,.38); display: flex; flex-direction: column; animation: rise .5s both ease; }
.project-card:hover { border-color: var(--line-strong); background: rgba(255,255,255,.55); transform: translateY(-2px); transition: .2s ease; }
.card-top, .card-footer, .card-title-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.card-index { color: var(--muted); font: 400 10px var(--mono); }
.status-pill { width: fit-content; padding: 5px 8px; border-radius: 99px; display: inline-flex; align-items: center; gap: 6px; color: var(--muted); background: rgba(0,0,0,.045); font: 500 9px var(--mono); text-transform: uppercase; letter-spacing: .06em; }
.status-pill i { width: 5px; height: 5px; border-radius: 50%; background: #8a897f; }
.status-pill.active i { background: var(--accent); }
.status-pill.shipped i { background: #47716d; }
.status-pill.idea i { background: #9a8450; }
.status-pill.archived i { background: #8d8a84; }
.card-title-row { margin-top: 24px; justify-content: flex-start; }
.project-card h3 { margin: 0; font-size: 28px; line-height: 1; letter-spacing: -.055em; font-weight: 600; }
.priority-dot { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; color: #875c3b; background: #e8dfd2; font: 600 10px var(--mono); }
.card-description { min-height: 69px; margin: 13px 0 17px; color: var(--muted); font-size: 12px; line-height: 1.65; }
.card-tags { min-height: 24px; display: flex; flex-wrap: wrap; gap: 5px; }
.card-tags span { padding: 4px 7px; border: 1px solid var(--line); border-radius: 6px; background: rgba(255,255,255,.25); color: #4e4d46; font: 400 9px var(--mono); }
.card-footer { margin-top: auto; padding-top: 18px; border-top: 1px solid var(--line); font-size: 10px; }
.stack-label { color: var(--ink); font: 500 9px var(--mono); text-transform: uppercase; letter-spacing: .07em; }
.card-domain { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-actions { position: absolute; right: 13px; top: 48px; display: flex; gap: 5px; opacity: 0; transform: translateY(4px); transition: .18s ease; z-index: 4; }
.project-card:hover .card-actions { opacity: 1; transform: translateY(0); }
.card-actions button { width: 31px; height: 31px; border: 1px solid var(--line); border-radius: 9px; background: rgba(251,249,244,.9); color: var(--muted); }
.card-actions button:hover { color: var(--ink); border-color: var(--line-strong); }
.card-hit-link { position: absolute; inset: 0; z-index: 1; }
.card-actions, .card-actions button { pointer-events: auto; }
.card-hit-link + * { position: relative; z-index: 2; }
.list-view .project-card { min-height: 138px; display: grid; grid-template-columns: 88px minmax(160px, .75fr) 1.6fr minmax(160px, .75fr); gap: 16px; align-items: center; }
.list-view .card-top { align-self: start; display: flex; flex-direction: column; align-items: flex-start; }
.list-view .card-title-row { margin: 0; }
.list-view .card-description { min-height: 0; margin: 0; }
.list-view .card-tags { align-self: center; }
.list-view .card-footer { margin: 0; padding: 0 0 0 16px; border-top: 0; border-left: 1px solid var(--line); }
.list-view .card-actions { right: 12px; top: 12px; }
.empty-state { grid-column: 1 / -1; min-height: 360px; padding: 40px; border: 1px dashed var(--line-strong); border-radius: 16px; display: grid; place-items: center; align-content: center; text-align: center; }
.empty-mark { width: 48px; height: 48px; display: grid; place-items: center; border: 1px solid var(--line-strong); border-radius: 14px; font-weight: 600; }
.empty-state h3 { margin: 18px 0 7px; font-size: 26px; letter-spacing: -.04em; }
.empty-state p { margin: 0 0 18px; color: var(--muted); font-size: 12px; }

.detail-view { padding-top: 34px; }
.back-link { border: 0; padding: 0; background: transparent; color: var(--muted); font: 500 10px var(--mono); text-transform: uppercase; letter-spacing: .08em; }
.back-link:hover { color: var(--ink); }
.detail-header { margin-top: 38px; padding-bottom: 34px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; gap: 30px; }
.detail-kicker, .detail-meta { color: var(--muted); font: 400 10px var(--mono); text-transform: uppercase; letter-spacing: .07em; display: flex; align-items: center; gap: 8px; }
.detail-title-wrap h1 { margin: 13px 0 12px; font-size: clamp(52px, 7vw, 84px); line-height: .9; letter-spacing: -.07em; }
.detail-title-wrap > p { max-width: 690px; margin: 0; color: var(--muted); font-size: 14px; line-height: 1.65; }
.detail-meta { margin-top: 18px; text-transform: none; letter-spacing: 0; gap: 15px; }
.detail-meta span + span { padding-left: 15px; border-left: 1px solid var(--line); }
.detail-actions { flex: 0 0 auto; display: flex; gap: 7px; align-items: start; }
.detail-grid { margin-top: 34px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.detail-section { min-height: 230px; padding: 20px; border: 1px solid var(--line); border-radius: 16px; background: rgba(255,255,255,.26); }
.detail-section-heading { display: flex; align-items: baseline; gap: 10px; }
.detail-section-heading span { color: var(--muted); font: 400 10px var(--mono); }
.detail-section-heading h3 { margin: 0; font-size: 19px; letter-spacing: -.04em; }
.meta-list { margin-top: 22px; display: grid; gap: 8px; }
.resource-card, .link-card { padding: 13px 14px; border: 1px solid var(--line); border-radius: 11px; background: rgba(255,255,255,.25); }
.resource-card { display: flex; justify-content: space-between; gap: 15px; }
.resource-card strong { font-size: 12px; }
.resource-card p { margin: 4px 0 0; color: var(--muted); font: 400 10px/1.5 var(--mono); }
.resource-card .mono-line { color: #5f5e56; word-break: break-all; }
.resource-meta { color: var(--muted); font: 400 9px var(--mono); text-align: right; display: grid; gap: 5px; align-content: start; white-space: nowrap; }
.resource-meta a { color: var(--accent); text-decoration: none; }
.resource-meta a:hover { text-decoration: underline; }
.link-card { position: relative; display: grid; gap: 3px; text-decoration: none; }
.link-card span { font-size: 12px; font-weight: 600; }
.link-card small { color: var(--muted); font: 400 9px var(--mono); overflow: hidden; text-overflow: ellipsis; }
.link-card b { position: absolute; right: 13px; top: 15px; font-weight: 400; color: var(--muted); }
.link-card:hover { border-color: var(--line-strong); }
.technology-grid { margin-top: 20px; display: flex; flex-wrap: wrap; gap: 8px; }
.technology-chip { padding: 9px 11px; border: 1px solid var(--line); border-radius: 10px; background: rgba(255,255,255,.25); display: inline-flex; align-items: center; gap: 8px; font-size: 11px; }
.technology-chip small { color: var(--muted); font: 400 8px var(--mono); text-transform: uppercase; }
.notes-card { margin-top: 20px; padding: 16px; min-height: 150px; border-left: 2px solid var(--accent); border-radius: 0 10px 10px 0; background: rgba(45,106,73,.05); color: #4f5049; font-size: 12px; line-height: 1.75; white-space: pre-wrap; }
.detail-empty { margin-top: 20px; padding: 18px; border: 1px dashed var(--line); border-radius: 10px; color: var(--muted); font-size: 11px; }
.placeholder-view { max-width: 820px; padding-top: 120px; }
.placeholder-view > p:last-child { max-width: 540px; color: var(--muted); line-height: 1.7; }

.modal-backdrop { position: fixed; inset: 0; z-index: 100; padding: 24px; overflow: auto; background: rgba(20,21,17,.38); backdrop-filter: blur(12px); }
.project-modal { position: relative; width: min(900px, 100%); margin: 30px auto; padding: 30px; border: 1px solid rgba(23,25,22,.14); border-radius: 20px; background: #faf8f3; box-shadow: 0 28px 90px rgba(0,0,0,.18); }
.modal-close { position: absolute; top: 17px; right: 17px; width: 35px; height: 35px; border: 1px solid var(--line); border-radius: 10px; background: transparent; font-size: 20px; color: var(--muted); }
.modal-close:hover { color: var(--ink); background: var(--paper-2); }
.project-modal h2 { margin: 0; font-size: 40px; letter-spacing: -.06em; }
.modal-copy { margin: 10px 0 30px; max-width: 560px; color: var(--muted); font-size: 12px; line-height: 1.6; }
.form-section { padding: 22px 0; border-top: 1px solid var(--line); display: grid; grid-template-columns: 220px 1fr; gap: 24px; }
.form-section:first-of-type { border-top: 0; }
.form-section-title { display: grid; align-content: start; gap: 4px; }
.form-section-title span { color: var(--accent); font: 500 9px var(--mono); }
.form-section-title strong { font-size: 14px; letter-spacing: -.02em; }
.form-section-title small { color: var(--muted); font-size: 10px; line-height: 1.5; }
.form-stack { display: grid; gap: 13px; }
.field-label { display: grid; gap: 7px; color: #373832; font-size: 11px; font-weight: 600; }
.field-label > span:first-child { color: var(--muted); font: 400 9px var(--mono); text-transform: uppercase; letter-spacing: .05em; }
.field-hint { color: #8e8d84 !important; font: 400 8px var(--mono) !important; text-transform: none !important; letter-spacing: 0 !important; }
.field-label input, .field-label select, .field-label textarea, .repeat-row input { width: 100%; min-height: 43px; padding: 10px 11px; border: 1px solid var(--line); border-radius: 9px; outline: none; color: var(--ink); background: rgba(255,255,255,.55); }
.field-label textarea { resize: vertical; min-height: 85px; }
.field-label input:focus, .field-label select:focus, .field-label textarea:focus, .repeat-row input:focus { border-color: rgba(45,106,73,.5); box-shadow: 0 0 0 3px rgba(45,106,73,.08); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-row.three { grid-template-columns: 1fr 1fr 1fr; }
.repeat-list { display: grid; gap: 8px; }
.repeat-row { display: grid; grid-template-columns: 1fr 34px; gap: 8px; }
.repeat-main { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
.domain-main { grid-template-columns: 1.25fr 1fr 1fr 1fr 92px; align-items: center; }
.check-field { min-height: 38px; display: flex; align-items: center; justify-content: center; gap: 6px; color: var(--muted); font: 400 9px var(--mono); white-space: nowrap; }
.check-field input { width: 14px; min-height: 14px; } 
.deployment-row .repeat-main, .database-row .repeat-main { grid-template-columns: repeat(4, 1fr); }
.link-row .repeat-main { grid-template-columns: 1fr 2fr 1fr; }
.repeat-row input { min-height: 38px; padding: 8px 9px; font-size: 10px; }
.remove-row { width: 34px; height: 38px; border: 1px solid var(--line); border-radius: 9px; background: transparent; color: var(--muted); }
.remove-row:hover { color: var(--danger); border-color: rgba(157,66,58,.25); }
.add-row { width: fit-content; margin-top: 8px; padding: 0; border: 0; color: var(--accent); background: transparent; font: 500 10px var(--mono); }
.add-row:hover { text-decoration: underline; }
.form-error { margin: 16px 0 0; padding: 10px 11px; border: 1px solid rgba(157,66,58,.2); border-radius: 8px; color: var(--danger); background: rgba(157,66,58,.06); font-size: 11px; }
.form-actions { margin-top: 26px; padding-top: 17px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; }

.auth-gate { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 22px; background: radial-gradient(circle at top right, rgba(45,106,73,.08), transparent 32%), var(--paper); }
.auth-panel { width: min(520px, 100%); padding: 38px; border: 1px solid var(--line); border-radius: 22px; background: rgba(250,248,243,.85); box-shadow: var(--shadow); }
.auth-brand { margin-bottom: 55px; }
.auth-panel h1 { margin: 0; font-size: 56px; line-height: .92; letter-spacing: -.065em; }
.auth-panel h1 em { color: var(--accent); font-style: normal; }
.auth-copy { max-width: 390px; margin: 18px 0 24px; color: var(--muted); font-size: 13px; line-height: 1.65; }
.auth-tabs { padding: 4px; margin-bottom: 17px; border: 1px solid var(--line); border-radius: 10px; display: grid; grid-template-columns: 1fr 1fr; background: rgba(255,255,255,.35); }
.auth-tab { min-height: 36px; border: 0; border-radius: 7px; color: var(--muted); background: transparent; font-size: 11px; font-weight: 600; }
.auth-tab.active { color: var(--ink); background: #fffdf9; box-shadow: 0 1px 6px rgba(0,0,0,.04); }
.auth-panel form { display: grid; gap: 12px; }
.auth-submit { width: 100%; margin-top: 3px; }
.google-button { width: 100%; background: transparent; }
.google-g { width: 21px; height: 21px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; font-weight: 700; }
.auth-divider { margin: 18px 0; display: flex; align-items: center; gap: 10px; color: var(--muted); font: 400 9px var(--mono); text-transform: uppercase; letter-spacing: .06em; }
.auth-divider::before, .auth-divider::after { content: ''; height: 1px; flex: 1; background: var(--line); }
.auth-footnote { margin: 17px 0 0; color: #8b897f; font: 400 9px var(--mono); text-align: center; }
.auth-error { margin: 0; padding: 10px; border: 1px solid rgba(157,66,58,.2); border-radius: 8px; background: rgba(157,66,58,.06); color: var(--danger); font-size: 10px; line-height: 1.5; }

.toast { position: fixed; right: 23px; bottom: 23px; z-index: 160; max-width: min(380px, calc(100vw - 46px)); padding: 11px 14px; border: 1px solid var(--line); border-radius: 11px; background: #fbf9f4; box-shadow: var(--shadow); color: var(--ink); font-size: 11px; }

@keyframes rise { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: translateY(0); } }

@media (max-width: 1100px) {
  .app-shell { grid-template-columns: 205px minmax(0,1fr); }
  .main-content { padding-inline: 30px; }
  .project-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .list-view .project-card { grid-template-columns: 70px minmax(150px,.75fr) 1fr; }
  .list-view .card-tags { display: none; }
  .stats-grid { grid-template-columns: repeat(2,1fr); }
}

@media (max-width: 800px) {
  .app-shell { display: block; }
  .sidebar { position: static; height: auto; padding: 16px 18px; border-right: 0; border-bottom: 1px solid var(--line); }
  .primary-nav { margin-top: 14px; grid-template-columns: repeat(3, 1fr); }
  .sidebar-footer { display: none; }
  .main-content { padding-inline: 18px; }
  .topbar { height: 64px; }
  .page-view { padding-top: 34px; }
  .page-heading, .detail-header { display: block; }
  .page-heading .button { margin-top: 23px; }
  .toolbar { flex-direction: column; }
  .search-box { max-width: none; }
  .view-controls { justify-content: flex-end; }
  .detail-actions { margin-top: 22px; }
  .detail-grid { grid-template-columns: 1fr; }
  .form-section { grid-template-columns: 1fr; gap: 15px; }
  .form-row.three { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  .page-heading h1 { font-size: 49px; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .project-grid { grid-template-columns: 1fr; }
  .list-view .project-card { display: block; min-height: 280px; }
  .list-view .card-top { flex-direction: row; align-items: center; }
  .list-view .card-title-row { margin-top: 22px; }
  .list-view .card-description { margin: 13px 0 17px; }
  .list-view .card-tags { display: flex; }
  .list-view .card-footer { margin-top: auto; padding-top: 18px; border-top: 1px solid var(--line); border-left: 0; }
  .auth-panel { padding: 25px; }
  .auth-brand { margin-bottom: 36px; }
  .auth-panel h1 { font-size: 47px; }
  .project-modal { padding: 23px; margin: 10px auto; }
  .project-modal h2 { font-size: 34px; }
  .repeat-main, .deployment-row .repeat-main, .database-row .repeat-main, .link-row .repeat-main { grid-template-columns: 1fr; }
  .form-actions { flex-direction: column-reverse; }
  .form-actions .button { width: 100%; }
}

/* V3 — workspace intelligence */
.insight-strip { margin-top: 12px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.insight-card { min-height: 88px; padding: 15px 16px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,.18); display: grid; grid-template-columns: 1fr auto auto; gap: 16px; align-items: center; }
.insight-card > div { display: grid; gap: 3px; }
.insight-kicker { font: 500 10px var(--mono); text-transform: uppercase; letter-spacing: .07em; }
.insight-card small { color: var(--muted); font-size: 10px; }
.insight-card strong { font-size: 27px; line-height: 1; letter-spacing: -.05em; }
.insight-arrow { color: var(--muted); font-size: 14px; }
.card-health { margin: 2px 0 14px; display: grid; gap: 8px; }
.card-health > div:first-child { display: flex; justify-content: space-between; align-items: center; color: var(--muted); font: 400 8px var(--mono); text-transform: uppercase; letter-spacing: .06em; }
.card-health strong { color: var(--ink); font: 500 9px var(--mono); }
.health-track { height: 5px; overflow: hidden; border-radius: 99px; background: rgba(30,32,28,.08); }
.health-track i { display: block; height: 100%; border-radius: inherit; background: var(--accent); }
.health-hero { margin-top: 20px; padding: 15px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.22); display: grid; gap: 13px; }
.health-hero > div:first-child { display: flex; align-items: baseline; justify-content: space-between; }
.health-hero span { color: var(--muted); font: 500 9px var(--mono); text-transform: uppercase; letter-spacing: .08em; }
.health-hero strong { font-size: 33px; letter-spacing: -.06em; }
.health-track.large { height: 8px; }
.health-checks { margin-top: 13px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 7px; }
.health-check { padding: 8px 9px; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); font: 400 9px var(--mono); display: flex; gap: 7px; align-items: center; }
.health-check span { color: #8e8b82; }
.health-check.ok { color: var(--ink); }
.health-check.ok span { color: var(--accent); }
.activity-list { margin-top: 20px; display: grid; gap: 0; }
.activity-item { position: relative; display: grid; grid-template-columns: 12px 1fr auto; gap: 11px; padding: 0 0 18px; }
.activity-item:not(:last-child)::before { content: ''; position: absolute; left: 4px; top: 10px; bottom: 0; width: 1px; background: var(--line); }
.activity-dot { position: relative; z-index: 1; width: 9px; height: 9px; margin-top: 3px; border: 2px solid #faf8f3; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 1px var(--line-strong); }
.activity-item strong { font-size: 11px; text-transform: capitalize; }
.activity-item p { margin: 3px 0 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.activity-item time { color: var(--muted); font: 400 8px var(--mono); white-space: nowrap; }
.resource-page .compact-heading { padding-top: 8px; }
.domains-table { margin-top: 36px; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; background: rgba(255,255,255,.22); }
.table-head, .table-row { display: grid; grid-template-columns: 1.1fr 1fr 1.4fr .9fr; gap: 16px; align-items: center; }
.table-head { padding: 11px 16px; border-bottom: 1px solid var(--line); color: var(--muted); font: 500 8px var(--mono); text-transform: uppercase; letter-spacing: .08em; }
.table-row { width: 100%; padding: 14px 16px; border: 0; border-bottom: 1px solid var(--line); background: transparent; color: var(--ink); font-size: 10px; text-align: left; }
.table-row:last-child { border-bottom: 0; }
.table-row:hover { background: rgba(255,255,255,.42); }
.domain-name { font: 500 11px var(--mono); }
.expiry-cell { color: var(--muted); font: 400 9px var(--mono); }
.expiry-cell.attention { color: var(--danger); }
.empty-state.compact { min-height: 300px; border: 0; border-radius: 0; }
.attention-grid { margin-top: 36px; display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 12px; }
.attention-card { min-height: 280px; padding: 18px; border: 1px solid var(--line); border-radius: 16px; background: rgba(255,255,255,.22); }
.attention-card-head { display: flex; align-items: start; justify-content: space-between; gap: 15px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.attention-kicker { color: var(--muted); font: 500 8px var(--mono); text-transform: uppercase; letter-spacing: .08em; }
.attention-card h3 { margin: 6px 0 0; font-size: 19px; letter-spacing: -.04em; }
.attention-card-head > strong { font-size: 27px; letter-spacing: -.05em; }
.attention-list { margin-top: 10px; }
.attention-row { width: 100%; padding: 11px 0; border: 0; border-bottom: 1px solid var(--line); background: transparent; display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; text-align: left; }
.attention-row:last-child { border-bottom: 0; }
.attention-row span { font-size: 11px; font-weight: 600; }
.attention-row small { color: var(--muted); font: 400 8px var(--mono); }
.attention-row b { grid-column: 2; grid-row: 1 / span 2; align-self: center; color: var(--muted); font-weight: 400; }
.attention-row:hover span, .attention-row:hover b { color: var(--accent); }
.attention-empty { margin: 19px 0 0; color: var(--muted); font-size: 11px; line-height: 1.6; }
.command-backdrop { position: fixed; inset: 0; z-index: 180; padding: 13vh 22px 22px; background: rgba(20,21,17,.28); backdrop-filter: blur(8px); }
.command-palette { width: min(620px, 100%); margin: auto; overflow: hidden; border: 1px solid var(--line); border-radius: 17px; background: #fbf9f4; box-shadow: 0 30px 100px rgba(0,0,0,.18); }
.command-top { padding: 12px 15px 8px; color: var(--muted); font: 500 9px var(--mono); text-transform: uppercase; letter-spacing: .08em; display: flex; justify-content: space-between; }
.command-top kbd, .command-item kbd { padding: 3px 6px; border: 1px solid var(--line); border-radius: 5px; background: rgba(255,255,255,.52); font: 400 8px var(--mono); }
.command-search { margin: 6px 12px 10px; padding: 0 10px; min-height: 47px; border: 1px solid var(--line-strong); border-radius: 10px; display: flex; align-items: center; gap: 8px; background: rgba(255,255,255,.55); }
.command-search span { color: var(--muted); }
.command-search input { width: 100%; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 12px; }
.command-list { max-height: 360px; overflow: auto; padding: 0 8px 8px; }
.command-item { width: 100%; padding: 10px 9px; border: 0; border-radius: 9px; background: transparent; display: grid; grid-template-columns: 32px 1fr auto; align-items: center; gap: 9px; text-align: left; }
.command-item:hover { background: var(--paper-2); }
.command-icon { width: 27px; height: 27px; border: 1px solid var(--line); border-radius: 7px; display: grid; place-items: center; color: var(--muted); font: 500 11px var(--mono); }
.command-item span:nth-child(2) { display: grid; gap: 2px; }
.command-item strong { font-size: 11px; }
.command-item small { color: var(--muted); font-size: 9px; }
.command-empty { padding: 28px 12px 32px; color: var(--muted); font-size: 11px; text-align: center; }
.repeat-row select { width: 100%; min-height: 38px; padding: 8px 9px; border: 1px solid var(--line); border-radius: 9px; outline: none; color: var(--ink); background: rgba(255,255,255,.55); font-size: 10px; }
.repeat-row input:focus, .repeat-row select:focus { border-color: rgba(45,106,73,.5); box-shadow: 0 0 0 3px rgba(45,106,73,.08); }

@media (max-width: 1100px) {
  .insight-strip { grid-template-columns: 1fr; }
  .attention-grid { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  .table-head { display: none; }
  .table-row { grid-template-columns: 1fr auto; gap: 5px 12px; }
  .table-row span:nth-child(2), .table-row span:nth-child(3) { color: var(--muted); font-size: 9px; }
  .table-row span:nth-child(3) { display: none; }
  .table-row .expiry-cell { grid-column: 2; grid-row: 1 / span 2; align-self: center; }
  .health-checks { grid-template-columns: 1fr; }
}

/* V4 GitHub integration */
.integration-shell { max-width: 980px; }
.integration-card { display:flex; align-items:flex-start; gap:22px; padding:28px; border:1px solid var(--line, #d8d4cb); border-radius:18px; background:rgba(255,255,255,.48); box-shadow:0 18px 50px rgba(21,25,22,.05); }
.integration-card.connected { align-items:stretch; }
.integration-icon { width:56px; height:56px; flex:0 0 56px; display:grid; place-items:center; border-radius:16px; background:#171a18; color:#fff; font:500 13px/1 "DM Mono", monospace; letter-spacing:.04em; }
.integration-copy { flex:1; }
.integration-kicker { display:block; font:500 11px/1.2 "DM Mono", monospace; letter-spacing:.14em; text-transform:uppercase; opacity:.58; }
.integration-copy h3 { margin:.45rem 0 .55rem; font-size:28px; line-height:1.08; }
.integration-copy p { margin:0 0 20px; max-width:680px; color:#66665f; line-height:1.6; }
.integration-note { padding:12px 14px; border:1px dashed #c9c5bc; border-radius:12px; color:#74736d; font:12px/1.5 "DM Mono", monospace; }
.integration-heading { display:flex; justify-content:space-between; gap:16px; align-items:flex-start; }
.connected-pill { display:inline-flex; align-items:center; gap:7px; padding:8px 10px; border-radius:999px; background:#e8f2eb; color:#2c6b46; font:500 11px/1 "DM Mono", monospace; }
.connected-pill i { width:7px; height:7px; border-radius:50%; background:#3c8b5f; }
.integration-actions { display:flex; gap:10px; flex-wrap:wrap; }
.github-project-card, .github-unlinked-card { display:flex; justify-content:space-between; gap:18px; align-items:center; padding:18px; border:1px solid #dedbd2; border-radius:16px; background:#fbfaf7; }
.github-project-main { display:flex; gap:14px; align-items:flex-start; min-width:0; }
.github-logo, .github-repo-mark { display:grid; place-items:center; border-radius:11px; background:#171a18; color:#fff; font:500 10px/1 "DM Mono", monospace; }
.github-logo { width:42px; height:42px; flex:0 0 42px; }
.github-project-main strong { display:block; margin-bottom:4px; font-size:15px; }
.github-project-main p, .github-unlinked-card p { margin:4px 0 0; color:#77756e; font-size:12px; }
.github-project-actions { display:flex; gap:8px; flex-wrap:wrap; }
.github-picker-modal { max-width:720px; }
.github-repo-list { display:grid; gap:8px; margin-top:14px; max-height:420px; overflow:auto; }
.github-repo-item { width:100%; display:grid; grid-template-columns:36px minmax(0,1fr) auto; align-items:center; gap:12px; padding:13px; text-align:left; border:1px solid #dedbd2; border-radius:13px; background:#fffdfa; cursor:pointer; }
.github-repo-item:hover:not(:disabled) { border-color:#9c9a91; transform:translateY(-1px); }
.github-repo-item:disabled { cursor:not-allowed; opacity:.58; }
.github-repo-mark { width:36px; height:36px; font-size:9px; background:#eceae4; color:#343530; }
.github-repo-item span { min-width:0; }
.github-repo-item strong { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:13px; }
.github-repo-item small { display:block; margin-top:4px; color:#7c7a73; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.github-repo-item b { font-size:11px; color:#5e5d57; white-space:nowrap; }
@media (max-width: 700px) { .integration-card, .github-project-card, .github-unlinked-card { flex-direction:column; } .integration-heading { flex-direction:column; } }

