:root {
  --bg: #f4f1e9;
  --surface: #fffdf9;
  --surface-2: #ebe7dc;
  --surface-3: #dfd9cb;
  --ink: #171a18;
  --muted: #6f746f;
  --line: #dcd6c9;
  --accent: #d46b45;
  --accent-2: #ad4e31;
  --green: #267557;
  --yellow: #a87316;
  --red: #b44242;
  --blue: #3e6fa0;
  --shadow: 0 16px 40px rgba(37, 35, 30, .08);
  --radius: 16px;
  --sidebar: 248px;
}
[data-theme="dark"] {
  --bg: #111412;
  --surface: #191d1a;
  --surface-2: #222824;
  --surface-3: #2d342f;
  --ink: #f4f1e9;
  --muted: #a9b0aa;
  --line: #313832;
  --accent: #e27a52;
  --accent-2: #f08b63;
  --green: #58a984;
  --yellow: #d2a14c;
  --red: #e27474;
  --blue: #77a3d1;
  --shadow: 0 18px 50px rgba(0, 0, 0, .28);
}
* { box-sizing: border-box; }
html { font-size: 16px; -webkit-font-smoothing: antialiased; }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--ink); font-family: "DM Sans", system-ui, sans-serif; }
button, input, textarea, select { font: inherit; }
button { color: inherit; }
a { color: inherit; text-decoration: none; }
img, video { max-width: 100%; }
.hidden { display: none !important; }
.app-loading { min-height: 100vh; display: grid; place-items: center; }
.loading-stack { display: flex; align-items: center; gap: 12px; color: var(--muted); }
.spinner { width: 24px; height: 24px; border: 3px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin .75s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.shell { min-height: 100vh; display: grid; grid-template-columns: var(--sidebar) minmax(0,1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 24px 18px; border-right: 1px solid var(--line); background: var(--surface); display: flex; flex-direction: column; z-index: 30; }
.brand { display: flex; align-items: center; gap: 11px; padding: 0 8px 24px; font-family: "Instrument Serif", serif; font-size: 1.65rem; }
.brand-mark { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: var(--ink); color: var(--surface); font-size: 1rem; }
.nav { display: grid; gap: 5px; }
.nav-link { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 11px; color: var(--muted); font-weight: 600; font-size: .93rem; }
.nav-link:hover { background: var(--surface-2); color: var(--ink); }
.nav-link.active { background: var(--ink); color: var(--surface); }
.nav-icon { width: 20px; text-align: center; }
.sidebar-bottom { margin-top: auto; display: grid; gap: 10px; }
.storage-note { padding: 12px; background: var(--surface-2); border-radius: 12px; font-size: .78rem; color: var(--muted); line-height: 1.45; }
.main { min-width: 0; }
.topbar { height: 74px; display: flex; align-items: center; gap: 12px; justify-content: space-between; padding: 0 32px; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(16px); position: sticky; top: 0; z-index: 20; }
.topbar-title { font-family: "Instrument Serif", serif; font-size: 1.45rem; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.view { padding: 30px 32px 80px; max-width: 1500px; margin: 0 auto; }
.mobile-menu { display: none; }

h1,h2,h3,h4,p { margin-top: 0; }
h1,h2,h3 { font-family: "Instrument Serif", serif; font-weight: 400; }
h1 { font-size: clamp(2.1rem,4vw,3.6rem); line-height: 1.02; letter-spacing: -.025em; }
h2 { font-size: 1.65rem; }
h3 { font-size: 1.25rem; }
.eyebrow { text-transform: uppercase; letter-spacing: .11em; font-size: .72rem; color: var(--accent); font-weight: 700; }
.muted { color: var(--muted); }
.small { font-size: .84rem; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

.page-head { display: flex; justify-content: space-between; gap: 20px; align-items: flex-end; margin-bottom: 24px; }
.page-head p { color: var(--muted); margin-bottom: 0; max-width: 700px; }
.head-actions, .toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.btn { border: 1px solid transparent; background: var(--surface-2); color: var(--ink); min-height: 40px; padding: 9px 14px; border-radius: 10px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-weight: 650; font-size: .88rem; transition: .16s ease; }
.btn:hover { transform: translateY(-1px); background: var(--surface-3); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--ink); color: var(--surface); }
.btn-primary:hover { background: var(--accent); color: white; }
.btn-accent { background: var(--accent); color: white; }
.btn-accent:hover { background: var(--accent-2); }
.btn-danger { color: var(--red); border-color: color-mix(in srgb, var(--red) 35%, var(--line)); background: transparent; }
.btn-ghost { background: transparent; border-color: var(--line); }
.btn-sm { min-height: 32px; padding: 6px 10px; font-size: .8rem; }
.btn-icon { width: 40px; padding: 0; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 1px 0 rgba(0,0,0,.02); }
.card-pad { padding: 20px; }
.metric-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 14px; margin-bottom: 24px; }
.metric { padding: 18px; position: relative; overflow: hidden; }
.metric-label { font-size: .78rem; color: var(--muted); text-transform: uppercase; letter-spacing: .07em; font-weight: 700; }
.metric-value { font-family: "Instrument Serif", serif; font-size: 2rem; margin-top: 8px; line-height: 1; }
.metric-sub { margin-top: 8px; color: var(--muted); font-size: .8rem; }
.metric-icon { position: absolute; right: 16px; top: 16px; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; background: var(--surface-2); }
.dashboard-grid { display: grid; grid-template-columns: minmax(0,1.55fr) minmax(300px,.75fr); gap: 18px; }
.section-card { padding: 20px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.section-head h2,.section-head h3 { margin: 0; }

.property-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(280px,1fr)); gap: 16px; }
.property-card { overflow: hidden; transition: .18s ease; position: relative; }
.property-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.property-cover { height: 174px; background: linear-gradient(135deg,var(--surface-2),var(--surface-3)); overflow: hidden; display: grid; place-items: center; color: var(--muted); font-size: 2.2rem; }
.property-cover img { width: 100%; height: 100%; object-fit: cover; }
.property-body { padding: 16px; }
.property-title-row { display: flex; justify-content: space-between; gap: 12px; }
.property-title { font-family: "Instrument Serif", serif; font-size: 1.34rem; line-height: 1.12; }
.property-address { color: var(--muted); font-size: .84rem; margin: 7px 0 14px; min-height: 2.5em; }
.property-stats { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; padding-top: 13px; border-top: 1px solid var(--line); }
.property-stat strong { display: block; font-size: .9rem; }
.property-stat span { color: var(--muted); font-size: .72rem; }
.select-property { position: absolute; z-index: 3; left: 12px; top: 12px; width: 24px; height: 24px; accent-color: var(--accent); }

.badge { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 5px 9px; font-size: .72rem; font-weight: 700; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-active,.badge-resolved,.badge-closed,.badge-low { color: var(--green); background: color-mix(in srgb,var(--green) 12%,var(--surface)); }
.badge-pending,.badge-in-progress,.badge-in_progress,.badge-medium,.badge-under-contract,.badge-under_contract { color: var(--yellow); background: color-mix(in srgb,var(--yellow) 13%,var(--surface)); }
.badge-high,.badge-open,.badge-reopened { color: var(--accent); background: color-mix(in srgb,var(--accent) 13%,var(--surface)); }
.badge-critical { color: var(--red); background: color-mix(in srgb,var(--red) 12%,var(--surface)); }
.badge-sold,.badge-inactive { color: var(--muted); }
.badge-leased { color: var(--blue); background: color-mix(in srgb,var(--blue) 12%,var(--surface)); }

.filter-panel { padding: 14px; display: grid; grid-template-columns: minmax(220px,1fr) 180px 180px auto; gap: 10px; margin-bottom: 18px; }
.input,.select,.textarea { width: 100%; border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 10px; padding: 10px 12px; outline: none; }
.input:focus,.select:focus,.textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb,var(--accent) 18%,transparent); }
.textarea { min-height: 105px; resize: vertical; line-height: 1.5; }
.form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; }
.form-field { display: grid; gap: 6px; }
.form-field.full { grid-column: 1 / -1; }
.form-label { font-size: .8rem; font-weight: 700; color: var(--muted); }
.form-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 18px; }
.help { font-size: .74rem; color: var(--muted); }

.profile-hero { min-height: 280px; border-radius: 22px; overflow: hidden; position: relative; display: flex; align-items: flex-end; margin-bottom: 18px; background: linear-gradient(135deg,#5f665d,#252b27); }
.profile-hero img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.profile-hero::after { content: ''; position: absolute; inset: 0; background: linear-gradient(0deg,rgba(0,0,0,.78),rgba(0,0,0,.08) 70%); }
.profile-hero-content { position: relative; z-index: 2; padding: 26px; color: white; width: 100%; display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; }
.profile-hero h1 { margin: 5px 0 7px; font-size: clamp(2rem,5vw,4rem); }
.profile-hero p { margin: 0; color: rgba(255,255,255,.74); }
.profile-tabs { display: flex; gap: 4px; padding: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 13px; overflow-x: auto; margin-bottom: 18px; position: sticky; top: 84px; z-index: 10; }
.profile-tab { border: 0; background: transparent; color: var(--muted); border-radius: 9px; padding: 9px 13px; cursor: pointer; white-space: nowrap; font-weight: 650; font-size: .84rem; }
.profile-tab.active { background: var(--ink); color: var(--surface); }
.info-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 14px; }
.info-card { padding: 17px; }
.info-label { color: var(--muted); font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; }
.info-value { margin-top: 8px; font-size: 1.08rem; font-weight: 650; overflow-wrap: anywhere; }
.two-col { display: grid; grid-template-columns: minmax(0,1.35fr) minmax(280px,.65fr); gap: 18px; }
.markdown { line-height: 1.72; }
.markdown h1,.markdown h2,.markdown h3 { margin-top: 1.4em; }
.markdown p:last-child { margin-bottom: 0; }
.custom-list { display: grid; gap: 9px; }
.custom-row { display: flex; justify-content: space-between; gap: 16px; padding-bottom: 9px; border-bottom: 1px solid var(--line); }
.custom-row:last-child { border-bottom: 0; }
.health-ring { width: 98px; aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--green) calc(var(--score)*1%),var(--surface-3) 0); position: relative; }
.health-ring::after { content:''; position:absolute; inset:9px; border-radius:50%; background:var(--surface); }
.health-ring strong { position:relative; z-index:1; font-family:"Instrument Serif",serif; font-size:1.8rem; }

.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; }
th,td { padding: 12px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
th { color: var(--muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; }
td { font-size: .87rem; }
.row-actions { display: flex; justify-content: flex-end; gap: 6px; }
.file-name { font-weight: 650; }
.file-meta { color: var(--muted); font-size: .75rem; margin-top: 3px; }

.dropzone { border: 1.5px dashed var(--line); border-radius: 14px; padding: 28px; text-align: center; background: var(--surface); transition: .15s; cursor: pointer; }
.dropzone:hover,.dropzone.dragover { border-color: var(--accent); background: color-mix(in srgb,var(--accent) 5%,var(--surface)); }
.dropzone input { display: none; }
.upload-list { display: grid; gap: 8px; margin-top: 12px; }
.upload-row { padding: 10px 12px; border-radius: 10px; background: var(--surface-2); display: grid; gap: 7px; }
.progress { height: 6px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--accent); transition: width .2s; }
.gallery { columns: 4 240px; column-gap: 13px; }
.gallery-item { break-inside: avoid; margin-bottom: 13px; overflow: hidden; position: relative; }
.gallery-media { width: 100%; min-height: 140px; display: block; object-fit: cover; background: var(--surface-2); }
.gallery-overlay { position: absolute; inset: auto 0 0; padding: 38px 12px 11px; color: white; background: linear-gradient(transparent,rgba(0,0,0,.75)); display: flex; justify-content: space-between; gap: 8px; align-items: flex-end; }
.gallery-overlay p { margin: 0; font-size: .8rem; }
.primary-star { position: absolute; top: 9px; right: 9px; background: rgba(0,0,0,.72); color: white; border: 0; border-radius: 8px; padding: 7px 9px; cursor: pointer; }

.incident-list { display: grid; gap: 10px; }
.incident-card { padding: 16px; display: grid; grid-template-columns: 8px minmax(0,1fr) auto; gap: 14px; align-items: center; cursor: pointer; }
.incident-strip { align-self: stretch; border-radius: 99px; background: var(--yellow); }
.incident-strip.high { background: var(--accent); }
.incident-strip.critical { background: var(--red); }
.incident-strip.low { background: var(--green); }
.incident-card h3 { margin-bottom: 5px; font-family: "DM Sans",sans-serif; font-weight: 700; font-size: 1rem; }
.incident-meta { display: flex; flex-wrap: wrap; gap: 8px 14px; color: var(--muted); font-size: .78rem; }
.task-list { display: grid; gap: 7px; }
.task-row { display: flex; gap: 9px; align-items: center; padding: 9px; border-radius: 9px; background: var(--surface-2); }
.task-row input { width: 18px; height: 18px; accent-color: var(--green); }
.task-row.done span { text-decoration: line-through; color: var(--muted); }

.timeline { display: grid; gap: 0; }
.timeline-item { display: grid; grid-template-columns: 22px minmax(0,1fr); gap: 13px; }
.timeline-rail { position: relative; display: flex; justify-content: center; }
.timeline-rail::before { content:''; position:absolute; top:18px; bottom:-10px; width:1px; background:var(--line); }
.timeline-item:last-child .timeline-rail::before { display:none; }
.timeline-dot { width:10px; height:10px; border-radius:50%; background:var(--accent); margin-top:7px; z-index:1; box-shadow:0 0 0 5px var(--surface); }
.timeline-content { padding-bottom: 18px; }
.timeline-content strong { display:block; font-size:.9rem; }
.timeline-content p { color:var(--muted); font-size:.79rem; margin:4px 0 0; }

.calendar-list { display: grid; gap: 10px; }
.calendar-event { padding: 14px; display: grid; grid-template-columns: 80px minmax(0,1fr) auto; gap: 14px; align-items: center; }
.calendar-date { text-align: center; padding: 8px; background: var(--surface-2); border-radius: 10px; }
.calendar-date strong { display: block; font-family: "Instrument Serif",serif; font-size: 1.45rem; line-height: 1; }
.calendar-date span { color: var(--muted); font-size: .68rem; text-transform: uppercase; }

.compare-table th:first-child,.compare-table td:first-child { position: sticky; left: 0; background: var(--surface); z-index: 2; }
.compare-cover { width: 180px; height: 110px; border-radius: 12px; object-fit: cover; background: var(--surface-2); }
.map { height: 520px; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); }
.empty { padding: 56px 22px; text-align: center; color: var(--muted); }
.empty-icon { font-size: 2.5rem; margin-bottom: 12px; }

.modal-backdrop { position: fixed; inset: 0; z-index: 100; background: rgba(8,10,9,.68); backdrop-filter: blur(5px); display: grid; place-items: center; padding: 20px; }
.modal { width: min(720px,100%); max-height: calc(100vh - 40px); overflow: auto; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
.modal.wide { width: min(1040px,100%); }
.modal-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 18px 20px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--surface); z-index: 4; }
.modal-head h2 { margin: 0; }
.modal-body { padding: 20px; }
.modal-close { border: 0; background: var(--surface-2); border-radius: 9px; width: 36px; height: 36px; cursor: pointer; }

.toast-root { position: fixed; right: 18px; bottom: 18px; z-index: 200; display: grid; gap: 9px; }
.toast { padding: 12px 15px; min-width: 240px; max-width: 390px; border-radius: 11px; background: var(--ink); color: var(--surface); box-shadow: var(--shadow); animation: toastIn .2s ease; font-size: .86rem; }
.toast.error { background: var(--red); color: white; }
.toast.success { background: var(--green); color: white; }
@keyframes toastIn { from { opacity:0; transform:translateY(8px); } }

.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: radial-gradient(circle at 30% 20%, color-mix(in srgb,var(--accent) 22%,transparent),transparent 35%),var(--bg); }
.login-card { width: min(430px,100%); padding: 28px; }
.login-logo { width: 54px; height: 54px; display:grid; place-items:center; border-radius:15px; background:var(--ink); color:var(--surface); margin-bottom:20px; }

@media (max-width: 1050px) {
  .metric-grid { grid-template-columns: repeat(2,1fr); }
  .dashboard-grid,.two-col { grid-template-columns: 1fr; }
  .info-grid { grid-template-columns: repeat(2,1fr); }
}
@media (max-width: 780px) {
  :root { --sidebar: 0px; }
  .shell { display:block; }
  .sidebar { position:fixed; left:0; top:0; width:260px; transform:translateX(-105%); transition:.2s; box-shadow:var(--shadow); }
  .shell.menu-open .sidebar { transform:translateX(0); }
  .mobile-menu { display:inline-flex; }
  .topbar { height:64px; padding:0 15px; }
  .view { padding:20px 15px 80px; }
  .page-head { align-items:flex-start; flex-direction:column; }
  .filter-panel { grid-template-columns:1fr 1fr; }
  .filter-panel .search-field { grid-column:1 / -1; }
  .form-grid { grid-template-columns:1fr; }
  .form-field.full { grid-column:auto; }
  .profile-hero-content { flex-direction:column; align-items:flex-start; }
  .profile-tabs { top:74px; }
  .info-grid { grid-template-columns:1fr; }
  .calendar-event { grid-template-columns:64px minmax(0,1fr); }
  .calendar-event > :last-child { grid-column:2; }
}
@media (max-width: 520px) {
  .metric-grid { grid-template-columns:1fr; }
  .filter-panel { grid-template-columns:1fr; }
  .filter-panel .search-field { grid-column:auto; }
  .property-grid { grid-template-columns:1fr; }
  .topbar-title { max-width:160px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
  .profile-hero { min-height:340px; }
  .modal-backdrop { padding:0; align-items:end; }
  .modal { width:100%; max-height:92vh; border-radius:18px 18px 0 0; }
}

/* Property Vault Links / Speed Dial — property-vault-links-v1 */
.links-page-head h1 { margin-bottom: 10px; }
.links-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 14px; margin-bottom: 20px; }
.links-breadcrumbs { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: .85rem; }
.links-breadcrumbs a { color: var(--accent); font-weight: 700; }
.links-breadcrumbs strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.links-search-wrap { width: min(360px, 44vw); position: relative; display: block; }
.links-search-wrap > span { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; z-index: 1; }
.links-search-wrap .input { padding-left: 34px; background: var(--bg); }
.links-no-results { margin: 8px 0 16px; font-size: .88rem; }
.speed-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(142px, 1fr)); gap: 18px; align-items: start; }
.speed-item { position: relative; min-width: 0; }
.speed-card { width: 100%; aspect-ratio: 1 / 1; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); color: var(--ink); cursor: pointer; padding: 18px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; overflow: hidden; box-shadow: 0 1px 0 rgba(0,0,0,.02); transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease, background .16s ease; }
.speed-card:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--accent) 48%, var(--line)); box-shadow: var(--shadow); }
.speed-card-title { display: block; width: 100%; margin-top: 14px; font-weight: 750; line-height: 1.15; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.speed-card-subtitle { display: block; width: 100%; margin-top: 5px; color: var(--muted); font-size: .72rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.speed-favicon-wrap { width: 64px; height: 64px; border-radius: 18px; background: linear-gradient(145deg, var(--surface-2), var(--surface-3)); display: grid; place-items: center; position: relative; overflow: hidden; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--line) 72%, transparent); }
.speed-favicon { grid-area: 1 / 1; width: 38px; height: 38px; object-fit: contain; opacity: 0; transition: opacity .15s ease; position: relative; z-index: 2; }
.speed-favicon.loaded { opacity: 1; }
.speed-favicon-fallback { grid-area: 1 / 1; font-family: "Instrument Serif", serif; font-size: 2rem; color: var(--muted); }
.speed-folder-card { background: linear-gradient(145deg, color-mix(in srgb, var(--accent) 10%, var(--surface)), var(--surface)); }
.speed-folder-icon { width: 70px; height: 52px; border-radius: 9px 12px 12px 12px; background: color-mix(in srgb, var(--accent) 78%, var(--surface)); position: relative; box-shadow: inset 0 -10px 18px rgba(0,0,0,.08); }
.speed-folder-icon::before { content: ''; position: absolute; left: 7px; top: -9px; width: 30px; height: 16px; border-radius: 8px 8px 0 0; background: color-mix(in srgb, var(--accent) 72%, var(--surface)); }
.speed-folder-icon span { position: absolute; inset: 11px 10px 9px; border: 1px solid rgba(255,255,255,.38); border-radius: 6px; }
.speed-actions { position: absolute; top: 8px; right: 8px; z-index: 4; display: flex; gap: 4px; opacity: 0; transform: translateY(-3px); transition: .15s ease; }
.speed-item:hover .speed-actions, .speed-item:focus-within .speed-actions { opacity: 1; transform: none; }
.speed-actions button { width: 30px; height: 30px; border: 1px solid var(--line); border-radius: 9px; background: color-mix(in srgb, var(--surface) 90%, transparent); color: var(--muted); cursor: pointer; display: grid; place-items: center; padding: 0; box-shadow: 0 5px 18px rgba(0,0,0,.12); backdrop-filter: blur(8px); }
.speed-actions button:hover { color: var(--ink); border-color: var(--accent); }
.speed-actions button:last-child:hover { color: var(--red); border-color: var(--red); }
.speed-add-card { border-style: dashed; background: transparent; color: var(--muted); }
.speed-add-card:hover { background: color-mix(in srgb, var(--accent) 5%, var(--surface)); color: var(--ink); }
.speed-add-symbol { width: 58px; height: 58px; display: grid; place-items: center; border-radius: 50%; background: var(--surface-2); font-size: 2rem; line-height: 1; }
@media (max-width: 780px) {
  .links-toolbar { align-items: stretch; flex-direction: column; }
  .links-search-wrap { width: 100%; }
  .speed-grid { grid-template-columns: repeat(auto-fill, minmax(126px, 1fr)); gap: 13px; }
  .speed-actions { opacity: 1; transform: none; }
}
@media (max-width: 420px) {
  .speed-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .speed-card { padding: 13px; border-radius: 15px; }
  .speed-favicon-wrap { width: 56px; height: 56px; border-radius: 15px; }
}

/* Property Vault Links / Flat Tags — property-vault-links-flat-tags-v2 */
.link-library-toolbar { padding: 15px; margin-bottom: 16px; display: grid; gap: 14px; }
.link-filter-primary { display: grid; grid-template-columns: minmax(260px, 1fr) minmax(190px, 240px); gap: 12px; align-items: end; }
.links-search-wrap { position: relative; display: block; min-width: 0; }
.links-search-wrap > span { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; z-index: 1; }
.links-search-wrap .input { padding-left: 34px; background: var(--bg); }
.link-sort-wrap, .link-filter-control { display: grid; gap: 6px; min-width: 0; }
.link-filter-row { display: grid; grid-template-columns: repeat(3, minmax(150px, 1fr)) auto auto; gap: 10px; align-items: end; }
.link-filter-control.is-disabled { opacity: .55; }
.link-filter-toggles { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; min-height: 42px; }
.link-filter-toggle { border: 1px solid var(--line); background: var(--surface-2); color: var(--muted); border-radius: 999px; padding: 9px 12px; font: inherit; font-size: .78rem; font-weight: 700; cursor: pointer; white-space: nowrap; }
.link-filter-toggle:hover, .link-filter-toggle.active { color: var(--ink); border-color: color-mix(in srgb, var(--accent) 60%, var(--line)); background: color-mix(in srgb, var(--accent) 12%, var(--surface)); }
.link-clear-filters { min-height: 42px; white-space: nowrap; }
.link-tag-filter { border-top: 1px solid var(--line); padding-top: 12px; display: grid; gap: 9px; }
.link-tag-filter-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.link-tag-cloud { display: flex; flex-wrap: wrap; gap: 7px; max-height: 128px; overflow: auto; padding: 1px; }
.link-tag-filter-chip { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line); background: var(--surface-2); color: var(--muted); border-radius: 999px; padding: 7px 10px; font: inherit; cursor: pointer; }
.link-tag-filter-chip small { min-width: 20px; height: 20px; display: grid; place-items: center; border-radius: 999px; background: var(--surface); color: var(--muted); }
.link-tag-filter-chip:hover, .link-tag-filter-chip.active { color: var(--ink); border-color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, var(--surface)); }
.link-tag-filter-chip.active small { background: var(--accent); color: white; }
.link-results-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 0 2px 14px; font-size: .84rem; }
.link-flat-grid { grid-template-columns: repeat(auto-fill, minmax(158px, 1fr)); }
.link-flat-item.is-archived { opacity: .68; }
.link-flat-card { justify-content: flex-start; padding-top: 24px; min-height: 0; }
.link-card-flags { position: absolute; top: 11px; left: 11px; right: 11px; display: flex; align-items: center; gap: 5px; justify-content: flex-start; pointer-events: none; }
.link-card-flag { border: 1px solid var(--line); border-radius: 999px; padding: 3px 6px; background: color-mix(in srgb, var(--surface) 88%, transparent); color: var(--muted); font-size: .62rem; font-weight: 800; line-height: 1; backdrop-filter: blur(7px); }
.link-card-flag.favorite { color: #b8860b; font-size: .82rem; border-color: color-mix(in srgb, #b8860b 35%, var(--line)); }
.link-card-category { max-width: 100%; margin-top: 9px; padding: 4px 8px; border-radius: 999px; background: var(--surface-2); color: var(--muted); font-size: .64rem; font-weight: 750; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.link-card-category.is-empty { opacity: .46; }
.link-card-tags { width: 100%; margin-top: auto; padding-top: 10px; display: flex; justify-content: center; gap: 5px; min-height: 25px; overflow: hidden; }
.link-card-tags span { min-width: 0; max-width: 45%; padding: 3px 6px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: .59rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.link-card-actions { gap: 3px; }
.link-card-actions button:first-child { color: #b8860b; }
.link-empty-results { margin-top: 16px; }
.link-tag-suggestions { margin-top: -3px; }
.link-tag-suggestions > div { display: flex; flex-wrap: wrap; gap: 6px; }
.link-tag-suggestion { border: 1px solid var(--line); background: var(--surface-2); color: var(--muted); border-radius: 999px; padding: 5px 9px; font: inherit; font-size: .72rem; cursor: pointer; }
.link-tag-suggestion:hover { color: var(--ink); border-color: var(--accent); }
.link-metadata-input { min-height: 108px; }
.link-form-flags { display: flex; gap: 18px; padding: 11px 13px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.link-form-flags label { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; font-weight: 700; }
@media (max-width: 1100px) {
  .link-filter-row { grid-template-columns: repeat(3, minmax(140px, 1fr)); }
  .link-filter-toggles { grid-column: 1 / -2; }
}
@media (max-width: 780px) {
  .link-filter-primary { grid-template-columns: 1fr; }
  .link-filter-row { grid-template-columns: 1fr 1fr; }
  .link-filter-control:nth-child(3), .link-filter-toggles { grid-column: 1 / -1; }
  .link-results-head { align-items: flex-start; flex-direction: column; }
  .link-flat-grid { grid-template-columns: repeat(auto-fill, minmax(136px, 1fr)); }
}
@media (max-width: 440px) {
  .link-filter-row { grid-template-columns: 1fr; }
  .link-filter-control:nth-child(3), .link-filter-toggles { grid-column: auto; }
  .link-clear-filters { width: 100%; }
  .link-flat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}


/* Projects & incident media — property-vault-projects-v1 */
.project-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.project-card { padding: 18px; display: grid; gap: 10px; align-content: start; transition: .18s ease; }
.project-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.project-card-head { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.project-card-head strong { font-family: "Instrument Serif", serif; font-weight: 400; font-size: 1.32rem; line-height: 1.12; }
.project-progress { height: 6px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.project-progress > span { display: block; height: 100%; background: var(--green); transition: width .5s var(--glide, ease); }
.project-card-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; color: var(--muted); font-size: .76rem; }
.project-card-due { font-size: .78rem; color: var(--muted); }
.project-card-due.soon { color: var(--yellow); font-weight: 700; }
.project-card-due.overdue { color: var(--red); font-weight: 700; }

.kanban { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(240px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 10px; align-items: start; }
.kanban-col { background: var(--surface-2); border: 1px solid var(--line); border-radius: 14px; padding: 12px; display: grid; gap: 10px; }
.kanban-col-head { display: flex; justify-content: space-between; align-items: center; font-size: .74rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.kanban-count { background: var(--surface); border-radius: 999px; padding: 2px 8px; font-size: .72rem; }
.kanban-cards { display: grid; gap: 8px; min-height: 46px; border-radius: 10px; }
.kanban-cards.drop-target { outline: 2px dashed var(--accent); outline-offset: 3px; }
.kanban-empty { color: var(--muted); font-size: .76rem; padding: 12px; text-align: center; }
.kanban-card { background: var(--surface); border: 1px solid var(--line); border-radius: 11px; padding: 11px; display: grid; gap: 7px; cursor: grab; }
.kanban-card:active { cursor: grabbing; }
.kanban-card.dragging { opacity: .45; }
.kanban-card-title { font-weight: 650; font-size: .9rem; line-height: 1.35; }
.kanban-card-detail { color: var(--muted); font-size: .78rem; line-height: 1.45; }
.kanban-card-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.kanban-card-meta:empty { display: none; }
.kanban-due { font-size: .68rem; font-weight: 700; border-radius: 999px; padding: 3px 7px; background: var(--surface-2); color: var(--muted); }
.kanban-due.soon { color: var(--yellow); }
.kanban-due.overdue { color: var(--red); }
.kanban-card-actions { display: flex; gap: 4px; justify-content: flex-end; }
.kanban-card-actions button { min-width: 28px; height: 28px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); color: var(--muted); cursor: pointer; font-size: .8rem; line-height: 1; padding: 0; }
.kanban-card-actions button:hover { color: var(--ink); border-color: var(--accent); }
.kanban-add { justify-self: start; }

.project-notes, .project-links-list { display: grid; gap: 12px; }
.project-note { padding: 16px; display: grid; gap: 9px; }
.project-note-head { display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.project-note .markdown { font-size: .9rem; }

.sketch-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.sketch-tile { padding: 12px; display: grid; gap: 10px; }
.sketch-thumb { width: 100%; height: 150px; border: 1px solid var(--line); border-radius: 10px; background: #fffdf9; }
.sketch-toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 12px; }
.sketch-colors { display: flex; gap: 6px; }
.sketch-color { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--line); cursor: pointer; padding: 0; transition: .15s ease; }
.sketch-color.active { border-color: var(--ink); transform: scale(1.14); }
.sketch-stage { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #fffdf9; }
.sketch-stage canvas { width: 100%; display: block; touch-action: none; cursor: crosshair; }

.incident-media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; }
.incident-media { margin: 0; position: relative; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--surface-2); }
.incident-media img, .incident-media video { width: 100%; height: 112px; object-fit: cover; display: block; }
.incident-media figcaption { padding: 5px 7px; font-size: .69rem; color: var(--muted); }
.incident-media-remove { position: absolute; top: 5px; right: 5px; width: 24px; height: 24px; border: 0; border-radius: 7px; background: rgba(0,0,0,.66); color: #fff; cursor: pointer; line-height: 1; padding: 0; }

@media (max-width: 780px) {
  .kanban { grid-auto-columns: minmax(212px, 82%); }
  .sketch-grid { grid-template-columns: 1fr; }
}

/* Project media — property-vault-project-media-v1 */
.project-media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.project-media { margin: 0; position: relative; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--surface); }
.project-media img, .project-media video { width: 100%; height: 150px; object-fit: cover; display: block; background: var(--surface-2); }
.project-media figcaption { padding: 8px 10px; font-size: .74rem; color: var(--muted); display: flex; justify-content: space-between; gap: 8px; }
.project-media figcaption span { flex: 0 0 auto; opacity: .75; }
.project-media-actions { position: absolute; top: 6px; right: 6px; display: flex; gap: 4px; opacity: 0; transition: .15s ease; }
.project-media:hover .project-media-actions, .project-media:focus-within .project-media-actions { opacity: 1; }
.project-media-actions button { width: 26px; height: 26px; border: 0; border-radius: 7px; background: rgba(0,0,0,.66); color: #fff; cursor: pointer; line-height: 1; padding: 0; font-size: .78rem; }
.project-media-actions button:last-child:hover { background: var(--red); }
.project-file-list { display: grid; gap: 8px; }
.project-file { display: flex; justify-content: space-between; gap: 14px; align-items: center; }
@media (hover: none) { .project-media-actions { opacity: 1; } }
@media (max-width: 520px) { .project-media-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Paste-anywhere dropzone — property-vault-paste-v1 */
.dropzone-hint { margin-top: 10px; font-size: .76rem; color: var(--muted); line-height: 1.6; }
.dropzone-hint kbd { display: inline-block; margin: 0 1px; padding: 1px 6px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; background: var(--surface-2); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .72rem; color: var(--ink); }
.paste-tray { margin-top: 10px; display: grid; gap: 10px; }
.paste-tray:empty { display: none; }
.paste-button { justify-self: start; }
.paste-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.paste-chips:empty { display: none; }
.paste-chip { margin: 0; position: relative; width: 96px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--surface-2); }
.paste-chip img { width: 100%; height: 62px; object-fit: cover; display: block; }
.paste-chip-icon { display: grid; place-items: center; height: 62px; font-size: 1.3rem; color: var(--muted); }
.paste-chip figcaption { padding: 5px 6px; font-size: .64rem; color: var(--muted); display: grid; gap: 1px; overflow-wrap: anywhere; }
.paste-chip figcaption span { opacity: .7; }
.paste-chip-remove { position: absolute; top: 4px; right: 4px; width: 20px; height: 20px; border: 0; border-radius: 6px; background: rgba(0,0,0,.66); color: #fff; cursor: pointer; line-height: 1; padding: 0; font-size: .74rem; }
.paste-chip-remove:hover { background: var(--red); }

/* Portfolio maintenance — property-vault-maintenance-hub-v1 */
.maintenance-toolbar {
  padding: 14px;
  display: grid;
  grid-template-columns: minmax(190px, .8fr) minmax(260px, 1.4fr) minmax(170px, .7fr) auto;
  gap: 10px;
  align-items: end;
  margin-bottom: 18px;
}
.maintenance-toolbar .form-field { margin: 0; }
.maintenance-clear { min-height: 42px; }
.maintenance-results-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin: 0 2px 12px; }
.maintenance-page .k-maint-row { grid-template-columns: 6px minmax(0, 1.5fr) minmax(150px, .7fr) auto auto; cursor: pointer; }
.maintenance-page .k-maint-row:hover,
.maintenance-page .k-maint-row:focus-visible { border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); outline: none; }
.maintenance-title { font-size: .92rem; }
.maintenance-detail { margin-top: 3px; }
.maintenance-property { min-width: 0; display: grid; gap: 2px; font-size: .78rem; }
.maintenance-property strong,
.maintenance-property span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.maintenance-property span { color: var(--muted); font-size: .72rem; }
.maintenance-form-property { padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); font-weight: 650; }
@media (max-width: 1050px) {
  .maintenance-page .k-maint-row { grid-template-columns: 6px minmax(0, 1fr) auto auto; }
  .maintenance-page .maintenance-property { grid-column: 2; }
  .maintenance-page .k-maint-due { grid-column: 3; grid-row: 1 / span 2; }
  .maintenance-page .row-actions { grid-column: 4; grid-row: 1 / span 2; }
}
@media (max-width: 780px) {
  .maintenance-toolbar { grid-template-columns: 1fr 1fr; }
  .maintenance-search { grid-column: 1 / -1; grid-row: 1; }
  .maintenance-page .k-maint-row { grid-template-columns: 5px minmax(0, 1fr) auto; }
  .maintenance-page .maintenance-property { grid-column: 2 / -1; }
  .maintenance-page .k-maint-due { grid-column: 3; grid-row: 1; }
  .maintenance-page .row-actions { grid-column: 2 / -1; grid-row: auto; }
}
@media (max-width: 520px) {
  .maintenance-toolbar { grid-template-columns: 1fr; }
  .maintenance-search { grid-column: auto; grid-row: auto; }
  .maintenance-results-head { align-items: flex-start; flex-direction: column; }
  .maintenance-page .k-maint-due { grid-column: 2; grid-row: auto; }
}

