:root {
  --ink: #142620;
  --muted: #63726c;
  --forest: #12382f;
  --forest-2: #1d5446;
  --mint: #d9efe7;
  --cream: #f5f3ed;
  --paper: #fff;
  --line: #dce2de;
  --danger: #b9382c;
  --warning: #b66d0f;
  --blue: #2b5ea7;
  --shadow: 0 14px 35px rgba(20, 38, 32, 0.12);
  --radius: 18px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--cream);
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: var(--cream); }
button, input, textarea, select { font: inherit; }
button, label[for] { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }

.app-shell { min-height: 100vh; padding-bottom: 90px; }
.topbar {
  position: sticky; top: 0; z-index: 20; height: 72px;
  display: flex; align-items: center; gap: 24px; padding: 0 max(20px, calc((100vw - 1180px) / 2));
  color: #fff; background: var(--forest); box-shadow: 0 4px 16px rgba(0,0,0,.12);
}
.brand { display: flex; align-items: center; gap: 11px; min-width: 210px; }
.brand-mark { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; color: var(--forest); background: #d6f1e5; font-size: 13px; font-weight: 900; letter-spacing: .08em; }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 16px; }
.brand small { margin-top: 1px; color: #b8d0c8; font-size: 11px; text-transform: uppercase; letter-spacing: .12em; }
.desktop-nav { display: flex; align-self: stretch; gap: 4px; }
.nav-link { padding: 0 18px; color: #bcd1ca; background: none; border: 0; border-bottom: 3px solid transparent; font-weight: 700; }
.nav-link.is-active { color: #fff; border-color: #88d1b7; }
.icon-button { margin-left: auto; width: 44px; height: 44px; border: 0; border-radius: 12px; color: #fff; background: rgba(255,255,255,.1); font-weight: 900; letter-spacing: 2px; }
.popover { position: absolute; right: max(20px, calc((100vw - 1180px) / 2)); top: 62px; width: 240px; padding: 8px; background: #fff; border-radius: 14px; box-shadow: var(--shadow); color: var(--ink); }
.popover button, .menu-label { display: block; width: 100%; padding: 12px; border: 0; border-radius: 10px; background: none; text-align: left; font-weight: 650; cursor: pointer; }
.popover button:hover, .menu-label:hover { background: var(--cream); }

main { width: min(1180px, calc(100% - 40px)); margin: 0 auto; padding: 34px 0 110px; }
.page-header { display: flex; justify-content: space-between; align-items: end; gap: 20px; margin-bottom: 24px; }
.eyebrow { display: block; margin-bottom: 8px; color: var(--forest-2); font-size: 11px; font-weight: 850; letter-spacing: .12em; text-transform: uppercase; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 6px; font-size: clamp(28px, 4vw, 42px); letter-spacing: -.035em; line-height: 1.05; }
h2 { margin-bottom: 4px; font-size: 21px; letter-spacing: -.02em; }
h3 { margin-bottom: 0; font-size: 16px; }
.subtle { margin-bottom: 0; color: var(--muted); }
.header-actions { display: flex; gap: 10px; }
.button { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 16px; border-radius: 12px; border: 1px solid transparent; font-weight: 780; text-decoration: none; }
.button.primary { color: #fff; background: var(--forest); }
.button.secondary { color: var(--forest); background: #fff; border-color: #cfd9d4; }
.button.ghost { color: var(--forest); background: transparent; border-color: var(--line); }

.stat-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; margin-bottom: 26px; }
.stat-card { position: relative; overflow: hidden; min-height: 128px; padding: 20px; background: #fff; border: 1px solid #e3e6e3; border-radius: var(--radius); box-shadow: 0 4px 18px rgba(30,58,48,.045); }
.stat-card::after { content: ""; position: absolute; right: -22px; bottom: -32px; width: 85px; height: 85px; border-radius: 50%; background: var(--tint, var(--mint)); opacity: .75; }
.stat-label { display: block; margin-bottom: 13px; color: var(--muted); font-size: 13px; font-weight: 720; }
.stat-value { display: block; font-size: 34px; line-height: 1; font-weight: 850; letter-spacing: -.04em; }
.stat-note { display: block; margin-top: 8px; color: var(--muted); font-size: 12px; }
.stat-card.danger { --tint: #f7c8c3; }
.stat-card.warning { --tint: #f5dfbd; }
.stat-card.blue { --tint: #d9e5fa; }

.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(290px, .75fr); gap: 18px; }
.panel { background: #fff; border: 1px solid #e2e6e3; border-radius: var(--radius); box-shadow: 0 5px 22px rgba(25,52,43,.05); }
.panel-header { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 20px 20px 14px; }
.panel-header p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.link-button { border: 0; color: var(--forest-2); background: none; font-weight: 780; }
.list { padding: 0 12px 12px; }
.point-row { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; align-items: center; gap: 13px; width: 100%; padding: 13px 9px; border: 0; border-top: 1px solid #edf0ee; background: transparent; text-align: left; }
.point-row:hover { background: #fafbf9; border-radius: 12px; }
.category-icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; background: var(--icon-bg, var(--mint)); color: var(--icon-ink, var(--forest)); font-size: 12px; font-weight: 900; }
.category-icon.avvik { --icon-bg: #f9dfdc; --icon-ink: #9d3128; }
.category-icon.teknisk { --icon-bg: #dce8fb; --icon-ink: #28578f; }
.category-icon.status { --icon-bg: #e0efe7; --icon-ink: #2c684e; }
.category-icon.annen { --icon-bg: #efe5f8; --icon-ink: #714c91; }
.point-main { min-width: 0; }
.point-topline { display: flex; align-items: center; gap: 8px; min-width: 0; }
.point-topline strong { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.point-meta { display: flex; gap: 7px; margin-top: 4px; color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.status-badge { display: inline-flex; align-items: center; min-height: 24px; padding: 3px 8px; border-radius: 99px; font-size: 11px; font-weight: 800; white-space: nowrap; }
.status-badge.open { color: #982e25; background: #f9dfdc; }
.status-badge.progress { color: #8e5a13; background: #faeacc; }
.status-badge.closed { color: #2e654c; background: #dff0e7; }
.status-badge.overdue { color: #fff; background: var(--danger); }
.photo-count-mini { color: var(--muted); font-size: 12px; font-weight: 750; }

.meeting-focus { margin: 0 14px 14px; padding: 18px; color: #fff; background: linear-gradient(145deg, #143b31, #25624f); border-radius: 15px; }
.meeting-focus small { color: #b8d6cb; font-weight: 700; text-transform: uppercase; letter-spacing: .09em; }
.meeting-focus h3 { margin-top: 6px; font-size: 20px; }
.meeting-focus p { margin: 9px 0 0; color: #d8e8e2; font-size: 13px; }
.progress-group { padding: 0 20px 20px; }
.progress-row { margin-top: 16px; }
.progress-label { display: flex; justify-content: space-between; margin-bottom: 7px; font-size: 12px; }
.progress-track { height: 8px; background: #edf1ee; border-radius: 99px; overflow: hidden; }
.progress-fill { height: 100%; border-radius: inherit; background: var(--forest-2); }

.filter-bar { display: grid; grid-template-columns: minmax(220px, 1.6fr) repeat(3, minmax(150px, .7fr)) auto; gap: 10px; margin-bottom: 16px; padding: 14px; background: #fff; border: 1px solid var(--line); border-radius: 15px; }
.filter-bar input, .filter-bar select { width: 100%; height: 44px; padding: 0 12px; border: 1px solid #cfd8d3; border-radius: 11px; color: var(--ink); background: #fff; }
.search-wrap { position: relative; }
.search-wrap::before { content: "⌕"; position: absolute; left: 13px; top: 9px; color: var(--muted); font-size: 22px; }
.search-wrap input { padding-left: 40px; }
.filter-summary { display: flex; justify-content: space-between; align-items: center; margin: 2px 2px 12px; color: var(--muted); font-size: 13px; }
.point-card-list { display: grid; gap: 10px; }
.point-card { position: relative; display: grid; grid-template-columns: 5px minmax(0,1fr) auto; overflow: hidden; background: #fff; border: 1px solid #e0e5e1; border-radius: 15px; box-shadow: 0 3px 13px rgba(24,46,39,.035); }
.point-accent { background: var(--accent, var(--forest-2)); }
.point-accent.avvik { --accent: #c44639; }
.point-accent.teknisk { --accent: #396ca7; }
.point-accent.status { --accent: #39805e; }
.point-accent.annen { --accent: #795399; }
.point-card-main { min-width: 0; padding: 16px 18px; }
.point-card-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 7px; }
.point-number { color: var(--muted); font-size: 11px; font-weight: 850; letter-spacing: .06em; }
.priority-high { color: #a33229; font-size: 11px; font-weight: 850; }
.point-card h3 { margin-bottom: 5px; font-size: 17px; }
.point-description { max-width: 720px; margin-bottom: 11px; color: #4e5e58; font-size: 14px; line-height: 1.45; }
.point-card-meta { display: flex; flex-wrap: wrap; gap: 7px 16px; color: var(--muted); font-size: 12px; }
.point-card-actions { display: flex; align-items: center; gap: 8px; padding: 14px 16px; }
.mini-photo { width: 54px; height: 54px; border: 0; border-radius: 10px; background: #e5ece8 center / cover no-repeat; color: var(--forest); font-weight: 850; }
.edit-button { min-width: 44px; min-height: 44px; border: 1px solid var(--line); border-radius: 11px; background: #fff; color: var(--forest); font-weight: 780; }

.meeting-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.meeting-card { padding: 20px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.meeting-card-top { display: flex; justify-content: space-between; align-items: start; gap: 10px; }
.meeting-date { display: grid; place-items: center; width: 54px; height: 54px; border-radius: 14px; background: var(--mint); color: var(--forest); }
.meeting-date strong, .meeting-date span { display: block; text-align: center; }
.meeting-date strong { font-size: 20px; line-height: 1; }
.meeting-date span { margin-top: 3px; font-size: 9px; font-weight: 850; text-transform: uppercase; }
.meeting-card h3 { margin: 14px 0 4px; font-size: 19px; }
.meeting-card p { color: var(--muted); font-size: 13px; }
.meeting-stats { display: flex; gap: 12px; padding-top: 14px; border-top: 1px solid #edf0ee; }
.meeting-stat { flex: 1; }
.meeting-stat strong, .meeting-stat span { display: block; }
.meeting-stat strong { font-size: 21px; }
.meeting-stat span { color: var(--muted); font-size: 11px; }
.meeting-actions { display: flex; gap: 8px; margin-top: 15px; }
.meeting-actions .button { flex: 1; }
.meeting-notes { margin-top: 15px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.meeting-notes summary { padding: 13px 15px; min-height: 46px; cursor: pointer; font-size: 15px; font-weight: 700; background: var(--mint); }
.meeting-notes summary:focus-visible { outline: 2px solid currentColor; outline-offset: -4px; }
.meeting-notes-content { padding: 15px; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 16px; line-height: 1.6; }

.empty-state { padding: 50px 22px; text-align: center; background: #fff; border: 1px dashed #cbd6d0; border-radius: var(--radius); }
.empty-icon { display: grid; place-items: center; width: 58px; height: 58px; margin: 0 auto 15px; border-radius: 18px; background: var(--mint); color: var(--forest); font-size: 28px; }
.empty-state p { max-width: 430px; margin: 7px auto 19px; color: var(--muted); }

.fab { position: fixed; z-index: 25; right: max(24px, calc((100vw - 1180px) / 2)); bottom: 24px; display: flex; align-items: center; gap: 8px; min-height: 52px; padding: 0 20px; border: 0; border-radius: 16px; color: #fff; background: var(--forest); box-shadow: 0 10px 25px rgba(18,56,47,.28); font-weight: 830; }
.fab span:first-child { font-size: 23px; font-weight: 400; }
.bottom-nav { display: none; }

dialog { border: 0; padding: 0; }
dialog::backdrop { background: rgba(9,25,20,.5); backdrop-filter: blur(2px); }
.sheet-dialog { width: min(720px, 100%); max-height: min(92vh, 900px); margin: auto; border-radius: 22px; box-shadow: 0 24px 70px rgba(0,0,0,.26); overflow: hidden; }
.sheet-dialog form { background: var(--cream); }
.sheet-header { position: sticky; top: 0; z-index: 3; min-height: 72px; display: grid; grid-template-columns: 80px 1fr 80px; align-items: center; padding: 9px 16px; color: #fff; background: var(--forest); text-align: center; }
.sheet-header small { display: block; margin-bottom: 1px; color: #a9c8bd; font-size: 9px; font-weight: 800; letter-spacing: .13em; }
.sheet-header h2 { margin: 0; font-size: 18px; }
.text-button { min-height: 42px; border: 0; color: #d6e7e1; background: none; font-size: 14px; text-align: left; }
.text-button.strong { color: #fff; font-weight: 850; text-align: right; }
.form-body { max-height: calc(92vh - 72px); overflow-y: auto; padding: 18px; }
.form-section { margin-bottom: 14px; padding: 18px; background: #fff; border: 1px solid var(--line); border-radius: 16px; }
.form-section.two-column { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.field { display: block; margin-bottom: 15px; }
.field:last-child { margin-bottom: 0; }
.two-column .field { margin-bottom: 0; }
.field > span { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 7px; color: #44534e; font-size: 12px; font-weight: 780; }
.field em { color: var(--muted); font-size: 10px; font-style: normal; font-weight: 600; }
.field input, .field textarea, .field select { width: 100%; min-height: 48px; padding: 11px 12px; border: 1px solid #cbd5d0; border-radius: 11px; color: var(--ink); background: #fff; outline: none; }
.field textarea { resize: vertical; line-height: 1.4; }
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--forest-2); box-shadow: 0 0 0 3px rgba(29,84,70,.12); }
.full-span { grid-column: 1 / -1; }
.section-heading { display: flex; justify-content: space-between; align-items: center; margin-bottom: 13px; }
.section-heading small { display: block; margin-bottom: 2px; color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: .12em; }
.count-pill { padding: 5px 9px; border-radius: 99px; color: var(--forest); background: var(--mint); font-size: 11px; font-weight: 800; }
.photo-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 9px; }
.photo-tile { position: relative; aspect-ratio: 1; overflow: hidden; border-radius: 12px; background: #edf1ef; }
.photo-tile img { width: 100%; height: 100%; object-fit: cover; }
.remove-photo { position: absolute; top: 5px; right: 5px; width: 27px; height: 27px; border: 0; border-radius: 50%; color: #fff; background: rgba(18,31,27,.78); font-size: 18px; line-height: 1; }
.photo-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 10px; }
.field-hint { margin: 10px 0 0; color: var(--muted); font-size: 11px; line-height: 1.4; }
.danger-button { width: 100%; min-height: 46px; border: 1px solid #efc4c0; border-radius: 12px; color: var(--danger); background: #fff; font-weight: 780; }
.photo-dialog { max-width: min(1000px, 95vw); max-height: 92vh; background: #08110e; border-radius: 16px; overflow: hidden; }
.photo-dialog img { display: block; max-width: 92vw; max-height: 88vh; object-fit: contain; }
.photo-close { position: absolute; z-index: 2; top: 10px; right: 10px; width: 42px; height: 42px; border: 0; border-radius: 50%; color: #fff; background: rgba(0,0,0,.55); font-size: 28px; }
.toast { position: fixed; z-index: 50; left: 50%; bottom: 90px; transform: translate(-50%, 20px); max-width: min(90vw, 420px); padding: 12px 18px; border-radius: 12px; color: #fff; background: #142620; box-shadow: var(--shadow); opacity: 0; pointer-events: none; transition: .2s ease; font-size: 14px; font-weight: 700; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 850px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .meeting-total { grid-column: 1 / -1; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .filter-bar { grid-template-columns: 1fr 1fr; }
  .search-wrap { grid-column: 1 / -1; }
  .meeting-list { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .app-shell { padding-bottom: 82px; }
  .topbar { height: 60px; padding: 0 14px; }
  .brand { min-width: 0; }
  .brand-mark { width: 36px; height: 36px; border-radius: 11px; }
  .brand small { display: none; }
  .desktop-nav { display: none; }
  .popover { top: 54px; right: 12px; }
  main { width: calc(100% - 24px); padding: 24px 0 130px; }
  .page-header { align-items: start; margin-bottom: 18px; }
  .page-header .button.primary { display: none; }
  .header-actions .button.secondary { min-width: 44px; padding: 0 12px; }
  h1 { font-size: 29px; }
  .subtle { font-size: 13px; }
  .stat-grid { gap: 9px; margin-bottom: 15px; }
  .stat-card { min-height: 107px; padding: 15px; border-radius: 15px; }
  .stat-label { margin-bottom: 9px; font-size: 11px; }
  .stat-value { font-size: 29px; }
  .stat-note { font-size: 10px; }
  .panel { border-radius: 15px; }
  .panel-header { padding: 17px 15px 11px; }
  .point-row { grid-template-columns: 39px minmax(0,1fr) auto; gap: 10px; padding: 12px 5px; }
  .category-icon { width: 38px; height: 38px; }
  .point-meta span:nth-child(n+3) { display: none; }
  .meeting-focus { margin: 0 10px 10px; }
  .filter-bar { position: sticky; top: 68px; z-index: 10; grid-template-columns: 1fr 1fr; gap: 8px; margin: 0 -2px 13px; padding: 10px; border-radius: 13px; box-shadow: 0 7px 20px rgba(20,38,32,.08); }
  .filter-bar input, .filter-bar select { height: 42px; font-size: 13px; }
  .search-wrap { grid-column: 1 / -1; }
  .filter-bar .filter-reset { display: none; }
  .point-card { grid-template-columns: 5px minmax(0,1fr); }
  .point-card-main { padding: 14px; }
  .point-card-actions { grid-column: 2; justify-content: flex-end; padding: 0 14px 13px; }
  .point-description { display: -webkit-box; overflow: hidden; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  .meeting-card { padding: 16px; }
  .fab { right: 14px; bottom: 78px; min-height: 54px; border-radius: 17px; }
  .bottom-nav { position: fixed; z-index: 24; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: repeat(3, 1fr); height: calc(68px + env(safe-area-inset-bottom)); padding: 5px 20px env(safe-area-inset-bottom); background: #fff; border-top: 1px solid #dce3df; box-shadow: 0 -4px 18px rgba(20,38,32,.07); }
  .bottom-link { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border: 0; color: #74817c; background: transparent; font-size: 10px; font-weight: 750; }
  .bottom-link.is-active { color: var(--forest); }
  .nav-icon { font-size: 20px; line-height: 1; }
  .sheet-dialog { width: 100vw; max-width: none; height: 100dvh; max-height: 100dvh; margin: 0; border-radius: 0; }
  .sheet-dialog form { min-height: 100%; }
  .sheet-header { min-height: 64px; padding-top: max(8px, env(safe-area-inset-top)); }
  .form-body { max-height: calc(100dvh - 64px); padding: 12px 12px 35px; }
  .form-section { padding: 15px; border-radius: 14px; }
  .form-section.two-column { grid-template-columns: 1fr; }
  .full-span { grid-column: auto; }
  .photo-strip { grid-template-columns: repeat(3, 1fr); }
  .photo-actions { grid-template-columns: 1fr 1fr; }
  .photo-actions .button { padding: 0 8px; font-size: 13px; }
  .toast { bottom: 84px; }
}

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

.meeting-date-group { display: flex; align-items: center; gap: 10px; }
.meeting-week { font-size: 14px; font-weight: 700; white-space: nowrap; }

.meeting-actions-dialog { width: min(400px, calc(100vw - 32px)); padding: 24px; border: 1px solid var(--line); border-radius: 18px; color: var(--forest); }
.meeting-actions-dialog::backdrop { background: rgba(0,0,0,.4); }
.meeting-actions-dialog h2 { margin: 0 0 8px; }
.meeting-actions-dialog p { overflow-wrap: anywhere; }
.meeting-choice-buttons { display: grid; gap: 10px; margin-top: 20px; }
#deleteMeetingChoice { color: #a52b25; }

.meeting-notes-actions { padding: 0 15px 15px; }
.meeting-notes-actions .button { width: 100%; white-space: normal; }

[hidden] { display: none !important; }
.project-context { max-width: 1180px; margin: 18px auto 0; padding: 0 20px; display: flex; align-items: center; gap: 16px; }
.project-context strong { overflow-wrap: anywhere; }
.project-tabs { display: flex; gap: 10px; margin-bottom: 20px; flex-wrap: wrap; }
.project-list { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; }
.project-card h2, .project-card p { overflow-wrap: anywhere; }
.project-card .meeting-stat span { font-size: 14px; }
@media(max-width:640px) { .project-list { grid-template-columns: 1fr; } .project-context { flex-wrap: wrap; } }

@media (max-width: 640px) {
  .page-header:has([data-action="new-project"]) { flex-direction: column; align-items: stretch; }
  .page-header .button.primary[data-action="new-project"] { display: inline-flex; justify-content: center; min-height: 48px; }
}
.placement-buttons { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.placement-preview { width: 100%; max-width: 480px; border: 1px solid var(--line); border-radius: 10px; }
#drawingViewer { width: min(1200px, 100vw); max-width: 100vw; height: 94dvh; max-height: 100dvh; padding: 12px; border: 0; border-radius: 14px; color: var(--forest); }
#drawingViewer[open] { display: flex; flex-direction: column; gap: 10px; }
#drawingViewer::backdrop { background: rgba(0,0,0,.5); }
.drawing-viewer-header { display:flex; justify-content:space-between; align-items:center; gap:10px; }
.drawing-viewer-header h2 { font-size: 17px; overflow-wrap:anywhere; margin: 0; }
.drawing-toolbar { display:flex; align-items:end; gap:8px; flex-wrap:wrap; }
.drawing-toolbar label { display:flex; flex-direction:column; font-size:14px; min-width:0; }
.drawing-toolbar label:first-child { flex:1 1 200px; }
.drawing-toolbar select { max-width:100%; min-height:44px; }
#drawingHint { font-size:14px; }
#drawingScroll { flex:1; min-height:100px; overflow:auto; background:#dce3df; padding:12px; overscroll-behavior:contain; }
#drawingStage { position:relative; background:white; }
#drawingCanvas { width:100%; height:100%; display:block; }
#drawingMarkers { position:absolute; inset:0; pointer-events:none; }
/* Transparent 44px touch targets; the pin tip is the saved coordinate. */
.drawing-marker { position:absolute; transform:translate(-50%,-100%); width:44px; height:44px; padding:0; border:0; border-radius:0; background:transparent; color:#bd332a; pointer-events:auto; cursor:pointer; }
.drawing-marker svg { width:44px; height:44px; overflow:visible; fill:none; stroke:currentColor; stroke-width:2; filter:drop-shadow(0 0 1px #fff); transform:translateY(2px); }
.drawing-marker.closed { color:#23734c; }
.drawing-marker.progress { color:#8c5a00; }
.drawing-marker[aria-pressed="true"] svg { stroke-width:3; }
.drawing-marker:focus-visible { outline:2px solid #214bb0; outline-offset:2px; }
.marker-number { position:absolute; left:36px; top:5px; font:700 11px sans-serif; white-space:nowrap; background:#ffffffe6; border-radius:3px; padding:2px 3px; }
.marker-number.number-left { left:auto; right:36px; }
.placement-crosshair { position:absolute; width:32px; height:32px; transform:translate(-50%,-50%); pointer-events:none; z-index:2; }
.placement-crosshair svg { width:100%; height:100%; fill:none; stroke:#214bb0; stroke-width:2; filter:drop-shadow(0 0 1px #fff); }
#toggleDrawingMarkers { align-self:flex-start; min-height:44px; }
#drawingPointInfo { flex-shrink:0; border:1px solid var(--line); border-radius:10px; padding:10px 12px; max-height:30dvh; overflow:auto; background:#f6faf8; }
#drawingPointInfo p { margin:5px 0; font-size:14px; }
#drawingPointInfo .placement-buttons { margin:8px 0 0; }
.drawing-point-text { overflow-wrap:anywhere; }
.drawing-point-description { white-space:pre-wrap; }
#drawingPlaceActions { display:flex; gap:8px; flex-wrap:wrap; }
.drawing-card h2 { overflow-wrap:anywhere; }
@media(max-width:640px) {
 .bottom-nav { grid-template-columns:repeat(4,1fr); padding-left:6px; padding-right:6px; }
 .page-header:has([data-action="upload-drawing"]) { flex-direction:column; align-items:stretch; }
 .page-header .button.primary[data-action="upload-drawing"] { display:inline-flex; justify-content:center; }
 #drawingViewer { height:100dvh; border-radius:0; }
}
#drawingScroll { touch-action:none; user-select:none; cursor:grab; }
#drawingScroll:active { cursor:grabbing; }
.drawing-quick-actions { display:flex; flex-wrap:wrap; gap:8px; }
.marker-number { font-size:12px; }
@media(max-width:640px) {
 #drawingViewer[open] { gap:6px; padding:8px; }
 .drawing-toolbar { gap:5px; }
 .drawing-toolbar label:first-child { flex:1 1 140px; }
 .drawing-toolbar .button { min-width:40px; padding:8px; }
 .drawing-quick-actions .button { font-size:13px; padding:8px 10px; }
 #drawingHint { font-size:12px; }
}

/* Compact project cards with consistent insets and a single primary action. */
.project-list { align-items:start; }
.project-card { padding:16px; }
.project-card-heading { display:flex; justify-content:space-between; align-items:flex-start; gap:12px; }
.project-card-heading > div { min-width:0; }
.project-card-heading h2 { margin:0; font-size:20px; line-height:1.25; }
.project-card-heading .edit-button { flex-shrink:0; min-height:44px; }
.project-card .project-contractor { margin:4px 0 0; font-size:14px; color:var(--muted); }
.project-card .project-description { margin:10px 0 0; font-size:15px; line-height:1.4; }
.project-summary { display:flex; flex-wrap:wrap; align-items:center; gap:6px 16px; margin-top:12px; padding-top:10px; border-top:1px solid var(--line); font-size:14px; }
.project-summary span { white-space:nowrap; }
.project-summary strong { font-size:16px; }
.project-card .project-last-meeting { margin:6px 0 12px; font-size:14px; color:var(--muted); }
.project-open { width:100%; min-height:44px; }
@media(max-width:640px) { .project-card { padding:14px; } .project-card-heading h2 { font-size:18px; } }
