/* Budding Social: site audit desk */
@font-face { font-family: "Roca"; src: url("/fonts/Roca-RegularItalic.otf") format("opentype"); font-display: swap; }
@font-face { font-family: "Montserrat"; src: url("/fonts/Montserrat-VariableFont_wght.ttf") format("truetype"); font-weight: 100 900; font-display: swap; }

:root {
  --green: #1E341A;
  --green-raised: #243D20;
  --deep: #122010;
  --cream: #FFF3E6;
  --paper: #FFFAF4;
  --desk: #E9E4DB;
  --yellow: #FFDA7B;
  --yellow-ink: #8A6512;

  --ink: #1E341A;
  --ink-2: #4D5B49;
  --ink-3: #7B8577;
  --line: rgba(30, 52, 26, 0.10);
  --line-strong: rgba(30, 52, 26, 0.18);

  --on-green: #FFF3E6;
  --on-green-2: rgba(255, 243, 230, 0.70);
  --on-green-3: rgba(255, 243, 230, 0.48);
  --line-green: rgba(255, 243, 230, 0.10);

  --fix: #B4432E;
  --improve: #C38A17;
  --idea: #5F7C59;

  --mark: #F2C24E;
  --mark-fill: rgba(255, 218, 123, 0.20);

  --r-control: 8px;
  --r-card: 12px;
  --r-panel: 16px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --fast: 140ms;
  --enter: 220ms;

  --font: "Montserrat", ui-sans-serif, system-ui, sans-serif;
  --display: "Roca", Georgia, serif;
  --mono: ui-monospace, "SF Mono", Menlo, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--cream);
  -webkit-font-smoothing: antialiased;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
[hidden] { display: none !important; }
.tnum { font-variant-numeric: tabular-nums; }

.icon { width: 16px; height: 16px; flex: none; stroke: currentColor; stroke-width: 1.5; fill: none; stroke-linecap: round; stroke-linejoin: round; }

/* Buttons (brand pills) */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 20px; border-radius: 40px; border: 0;
  font-weight: 600; font-size: 14px; white-space: nowrap; text-decoration: none;
  transition: background-color var(--fast) var(--ease), border-color var(--fast) var(--ease), color var(--fast) var(--ease), transform var(--fast) var(--ease);
}
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--yellow); color: var(--deep); box-shadow: 0 1px 2px rgba(18, 32, 16, 0.12); }
.btn-primary:hover { background: #FFD25F; }
.btn-secondary { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 2px var(--ink); }
.btn-secondary:hover { background: var(--yellow); }
.btn-quiet { background: transparent; color: var(--ink-2); height: 32px; padding: 0 12px; font-weight: 500; }
.btn-quiet:hover { background: rgba(30, 52, 26, 0.06); color: var(--ink); }
.btn-sm { height: 32px; padding: 0 14px; font-size: 13px; }
.btn:disabled { opacity: 0.5; cursor: default; transform: none; }
.btn:focus-visible, .seg button:focus-visible, .rail-row:focus-visible, input:focus-visible, textarea:focus-visible, .note:focus-visible, .tab:focus-visible {
  outline: 2px solid var(--ink); outline-offset: 2px;
}

/* Inputs */
.field { display: grid; gap: 6px; }
.field > span { font-size: 13px; font-weight: 500; color: var(--ink-2); }
.input, .textarea {
  width: 100%; border: 1px solid var(--line-strong); background: #fff; border-radius: var(--r-control);
  padding: 8px 12px; font-size: 14px; line-height: 1.5;
  transition: border-color var(--fast) var(--ease);
}
.input { height: 40px; }
.textarea { resize: vertical; min-height: 96px; }
.input:hover, .textarea:hover { border-color: rgba(30, 52, 26, 0.32); }
.input:focus, .textarea:focus { outline: none; border-color: var(--ink); }
.hint { font-size: 12px; color: var(--ink-3); }

/* Segmented control */
.seg { display: inline-flex; padding: 2px; border-radius: 10px; background: rgba(30, 52, 26, 0.07); }
.seg button {
  display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 12px; border: 0; border-radius: 8px;
  background: transparent; color: var(--ink-2); font-size: 13px; font-weight: 500;
  transition: background-color var(--fast) var(--ease), color var(--fast) var(--ease);
}
.seg button[aria-pressed="true"] { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(30, 52, 26, 0.10); }
.seg button:hover:not([aria-pressed="true"]) { color: var(--ink); }

/* Tabs */
.tab {
  display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px; border: 0; background: transparent;
  color: var(--ink-3); font-weight: 500; font-size: 14px; border-bottom: 2px solid transparent; margin-bottom: -1px;
  transition: color var(--fast) var(--ease), border-color var(--fast) var(--ease);
}
.tab:hover { color: var(--ink); }
.tab[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--ink); }
.tab-count { font-family: var(--mono); font-size: 12px; color: var(--ink-3); }

/* Status tag: same shape as the marker tab */
.tag { display: inline-flex; align-items: center; height: 24px; padding: 0 8px; border-radius: 6px 6px 6px 2px; font-size: 12px; font-weight: 600; white-space: nowrap; background: #EFE8DC; color: var(--ink-2); box-shadow: 0 1px 0 rgba(18, 32, 16, 0.10); }
.tag.attn { background: var(--yellow); color: var(--deep); box-shadow: 0 1px 0 rgba(18, 32, 16, 0.18); }

/* Severity */
.sev { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 500; color: var(--ink-2); }
.sev::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--c, var(--ink-3)); }
.sev-fix { --c: var(--fix); }
.sev-improve { --c: var(--improve); }
.sev-idea { --c: var(--idea); }

/* The marker tab: the numbered label stuck to a box and repeated in the notes list */
.tab-num {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 24px; height: 24px; padding: 0 6px; border-radius: 6px 6px 6px 2px;
  background: var(--yellow); color: var(--deep);
  font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1;
  box-shadow: 0 1px 0 rgba(18, 32, 16, 0.18);
}

/* Boxes drawn on a capture */
.shot-wrap { position: relative; margin: 0 auto; background: #fff; box-shadow: 0 1px 2px rgba(18, 32, 16, 0.08), 0 8px 24px rgba(18, 32, 16, 0.08); border-radius: 4px; }
.shot-wrap img { display: block; width: 100%; height: auto; border-radius: 4px; user-select: none; -webkit-user-drag: none; }
.overlay { position: absolute; inset: 0; }
.box {
  position: absolute; border: 2px solid var(--mark); background: transparent; border-radius: 4px;
  transition: border-color var(--fast) var(--ease), box-shadow var(--fast) var(--ease);
}
.box::before {
  content: ""; position: absolute; inset: 0; border-radius: 2px; background: rgba(255, 218, 123, 0.38);
  mix-blend-mode: multiply; pointer-events: none; transition: background-color var(--fast) var(--ease);
}
.box .tab-num { position: absolute; left: -2px; top: -28px; }
.box.top-edge .tab-num { top: 4px; left: 4px; }
.box:hover::before { background: rgba(255, 218, 123, 0.55); }
.box.is-active { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(255, 218, 123, 0.55); }
.box.is-active::before { background: rgba(255, 218, 123, 0.5); }
.box.is-active .tab-num { background: var(--ink); color: var(--cream); }
.box.flash { animation: flash 900ms var(--ease) 1; }
@keyframes flash { 0%, 100% { box-shadow: 0 0 0 3px rgba(255, 218, 123, 0.55); } 30% { box-shadow: 0 0 0 10px rgba(255, 218, 123, 0.75); } }
.box-ghost { position: absolute; border: 2px dashed var(--ink); background: rgba(30, 52, 26, 0.06); border-radius: 4px; pointer-events: none; }
.box-ghost span { position: absolute; left: -2px; top: -26px; height: 22px; padding: 0 8px; border-radius: 6px; background: var(--ink); color: var(--cream); font-size: 11px; font-weight: 600; display: inline-flex; align-items: center; }

/* Dialog */
dialog {
  border: 0; padding: 0; border-radius: var(--r-panel); width: min(480px, calc(100vw - 32px));
  background: var(--paper); color: var(--ink); box-shadow: 0 24px 64px rgba(18, 32, 16, 0.24);
}
dialog::backdrop { background: rgba(18, 32, 16, 0.40); }
dialog[open] { animation: rise var(--enter) var(--ease); }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.dlg { padding: 24px; display: grid; gap: 16px; }
.dlg h2 { margin: 0; font-size: 18px; font-weight: 600; }
.dlg-actions { display: flex; justify-content: flex-end; gap: 8px; padding-top: 8px; }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 8px); opacity: 0;
  background: var(--deep); color: var(--cream); padding: 10px 16px; border-radius: 10px; font-size: 13px; font-weight: 500;
  transition: opacity var(--enter) var(--ease), transform var(--enter) var(--ease); pointer-events: none; z-index: 50;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
