/* Look and feel taken from the IG Studio Image Intake app and the IG CRM, so the tools feel like one family. */
:root {
  --bg: #f7f8fa;
  --panel: #ffffff;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --brand: #1e40af;
  --ok: #15803d;
  --ok-bg: #f0fdf4;
  --attn: #9a3412;
  --attn-bg: #fff7ed;
  --radius: 10px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  font-size: 14px;
  line-height: 1.45;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
/* Links in running text are underlined and a little heavier, so they stand out from the words around them.
   Buttons, the trail at the top of a page and links that wrap a picture are left as they are. */
main p:not(.crumb) a:not(.button), main li > a.small, main dd a, main label a {
  font-weight: 600; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2px;
}
main p:not(.crumb) a:not(.button):hover, main li > a.small:hover, main dd a:hover, main label a:hover { text-decoration-thickness: 2px; }
h1 { font-size: 22px; margin: 0; }
h2 { font-size: 15px; margin: 22px 0 8px; }
p { margin: 8px 0; }

.muted { color: var(--muted); }
.small { font-size: 12px; }
.centre { max-width: 460px; margin: 60px auto; text-align: center; }
.centre.signin {
  max-width: none;
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 24px;
}
.centre.signin p { margin: 0; max-width: 420px; }
.signin-logo { width: 112px; height: auto; border-radius: 10px; margin-bottom: 4px; }

/* Buttons and inputs */
button, .button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  font: inherit;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}
button:hover, .button:hover { border-color: #cbd5e1; text-decoration: none; }
.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.primary:hover { border-color: var(--brand); }
.ghost { background: transparent; }

input[type='text'] {
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  font: inherit;
  color: var(--ink);
}
input:focus, button:focus-visible, .button:focus-visible, a:focus-visible {
  outline: 2px solid #bfdbfe;
  border-color: var(--brand);
}

/* Page frame */
.app { max-width: 1280px; margin: 0 auto; padding: 16px; }
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.brand-area { display: flex; align-items: center; gap: 10px; color: inherit; }
.brand-area:hover { text-decoration: none; }
.brand-logo { height: 30px; width: auto; display: block; border-radius: 5px; }
.brand-tag { font-weight: 700; color: var(--brand); font-size: 14px; }
.user { display: flex; align-items: center; gap: 12px; margin: 0; }
main { padding-top: 16px; }

.page {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  background: var(--panel);
  max-width: 1100px;
  margin: 0 auto;
}
.page.wide { max-width: none; }
.crumb { font-size: 12px; color: var(--muted); margin: 0 0 6px; }
.lede { color: var(--muted); margin: 6px 0 14px; }
.foot { max-width: 1280px; margin: 0 auto; padding: 0 16px 24px; font-size: 12px; color: var(--muted); }

/* Open a folder */
.open label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); margin-top: 14px; }
.open .row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.open input { flex: 1 1 18rem; min-width: 0; }

/* Photographs */
.photos { list-style: none; margin: 16px 0 8px; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(210px, 100%), 1fr)); gap: 12px; align-items: start; }
.photos li { display: flex; flex-direction: column; gap: 4px; min-width: 0; padding: 8px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.photos img { display: block; width: 100%; height: auto; background: var(--line); border-radius: 6px; }
.photos .name { font-size: 13px; overflow-wrap: anywhere; }
.photos .tick { display: flex; align-items: center; gap: 6px; margin-top: 2px; cursor: pointer; }
.photos .tick input { margin: 0; }

/* Marks drawn over a photograph */
.marked { position: relative; max-width: 760px; margin: 12px 0; line-height: 0; }
.marked img { display: block; width: 100%; height: auto; border-radius: 6px; background: var(--line); }
.marked svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.marked rect { fill: none; stroke-width: 3; vector-effect: non-scaling-stroke; }
.marked line { stroke-width: 3; vector-effect: non-scaling-stroke; }
rect.k-subject { stroke: #1e40af; } rect.k-face { stroke: #15803d; } rect.k-person { stroke: #f59e0b; stroke-dasharray: 6 4; } line.k-focal { stroke: #dc2626; }
.key { list-style: none; padding: 0; margin: 10px 0; display: flex; flex-wrap: wrap; gap: 6px 18px; }
.key li { display: flex; align-items: center; gap: 6px; }
.swatch { width: 14px; height: 14px; border: 3px solid; border-radius: 3px; display: inline-block; }
.swatch.k-subject { border-color: #1e40af; } .swatch.k-face { border-color: #15803d; } .swatch.k-person { border-color: #f59e0b; border-style: dashed; } .swatch.k-focal { border-color: #dc2626; border-radius: 50%; }

/* Subfolders */
.folders { list-style: none; padding: 0; margin: 8px 0 16px; display: flex; flex-wrap: wrap; gap: 8px; }

/* Correcting marks by hand */
.marked svg[hidden] { display: none; }
.editor { position: absolute; inset: 0; line-height: 0; touch-action: none; user-select: none; }
.editor[hidden] { display: none; }
.editor .box { position: absolute; border: 3px solid; cursor: move; touch-action: none; }
.editor .box:focus-visible, .editor .box.on { outline: 2px solid #fff; outline-offset: 1px; z-index: 2; }
.editor .box.k-subject { border-color: #1e40af; } .editor .box.k-face { border-color: #15803d; } .editor .box.k-person { border-color: #f59e0b; border-style: dashed; }
.editor .handle { position: absolute; width: 14px; height: 14px; background: #fff; border: 2px solid #0f172a; border-radius: 3px; }
.editor .handle.nw { left: -8px; top: -8px; cursor: nwse-resize; } .editor .handle.se { right: -8px; bottom: -8px; cursor: nwse-resize; }
.editor .handle.ne { right: -8px; top: -8px; cursor: nesw-resize; } .editor .handle.sw { left: -8px; bottom: -8px; cursor: nesw-resize; }
.editor .focal { position: absolute; width: 22px; height: 22px; margin: -11px 0 0 -11px; border-radius: 50%; background: #dc2626; border: 3px solid #fff; cursor: grab; z-index: 3; touch-action: none; }
.editor .focal:focus-visible { outline: 2px solid #0f172a; outline-offset: 2px; }
.toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 8px 0; }
.toolbar[hidden] { display: none; }
.spacer { flex: 1; }
button:disabled { opacity: 0.55; cursor: not-allowed; }

/* The wording sheet */
.notice { padding: 8px 12px; border-radius: 8px; margin: 10px 0; }
.notice.ok { background: var(--ok-bg); color: var(--ok); }
.notice.attn { background: var(--attn-bg); color: var(--attn); }
.notice ul { margin: 4px 0 0; padding-left: 18px; }
.start.drafting { margin: 12px 0 18px; max-width: 760px; }
.drafting ul { margin: 6px 0 0; padding-left: 18px; }
.adjust .words { margin-top: 14px; }
.adjust .words h2 { margin: 0 0 4px; }
.adjust .words .field input { width: 100%; }
.sheet input.drafted { border-color: var(--brand); }
.sheet input.too-wide { border-color: #dc2626; }
.fit-mark { display: block; }
.draft-mark { display: block; }
.read-facts { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; margin: 10px 0; max-width: 760px; }
.read-facts dt { font-size: 12px; color: var(--muted); padding-top: 2px; }
.read-facts dd { margin: 0; overflow-wrap: anywhere; }
.read-text { white-space: pre-wrap; overflow-wrap: anywhere; max-width: 760px; padding: 12px 14px; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); font-size: 13px; line-height: 1.5; }
.sheet fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px 14px; margin: 14px 0; min-width: 0; }
.sheet legend { font-weight: 600; padding: 0 6px; }
.sheet .hint { margin: 0 0 4px; }
.sheet .field { display: flex; flex-direction: column; gap: 4px; margin-top: 10px; max-width: 640px; }
.sheet .field > label, .sheet .field > .label { font-size: 12px; color: var(--muted); }
.sheet input[type='text'] { width: 100%; min-width: 0; }
.slides { list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 10px; }
.slides li { display: grid; grid-template-columns: 132px minmax(0, 1fr); gap: 4px 14px; align-items: start; padding: 8px; border: 1px solid var(--line); border-radius: var(--radius); }
.slides img { display: block; width: 100%; height: auto; background: var(--line); border-radius: 6px; }
.slides .name { font-size: 13px; overflow-wrap: anywhere; }
.slides .field { margin-top: 6px; max-width: none; }
.sheet .actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 14px; }
@media (max-width: 560px) { .slides li { grid-template-columns: minmax(0, 1fr); } .slides img { max-width: 200px; } }

/* Making and showing the assets */
.steps { display: flex; gap: 8px; flex-wrap: wrap; }
.run { border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px; margin: 12px 0 4px; }
.run progress { width: 100%; max-width: 640px; height: 10px; accent-color: var(--brand); }
.run [hidden] { display: none; }
.log { list-style: none; padding: 0; margin: 6px 0; display: grid; gap: 2px; }
.photo-head { margin-top: 26px; overflow-wrap: anywhere; }
.drafts { list-style: none; margin: 8px 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(190px, 100%), 1fr)); gap: 12px; align-items: start; }
.drafts li { display: flex; flex-direction: column; gap: 4px; min-width: 0; padding: 8px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.drafts li.amber { border-color: #f59e0b; }
.drafts li.red { border-color: #dc2626; }
.drafts img { display: block; width: 100%; height: auto; background: var(--line); border-radius: 6px; }
.drafts .name { font-size: 13px; }
.flag.red { color: #dc2626; }
.flag.amber { color: var(--attn); }

/* Reviewing the drafts */
.reviewbar { position: sticky; top: 0; z-index: 4; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 6px 14px; margin: 12px 0 4px; }
.reviewbar p { margin: 2px 0 4px; }
.filter[aria-pressed='true'], .decide[aria-pressed='true'] { background: var(--ink); border-color: var(--ink); color: #fff; }
.platform { font-size: 18px; margin-top: 30px; padding-top: 14px; border-top: 1px solid var(--line); }
.kind { font-size: 14px; margin: 18px 0 6px; }
.kind .muted { font-weight: 400; margin-left: 6px; }
.cards .card[hidden] { display: none; }
.cards .card.picked { border-color: var(--ok); background: var(--ok-bg); }
.cards .card.rejected { opacity: 0.5; }
.choose { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.choose button { padding: 5px 10px; }
.flag.ok { color: var(--ok); }

/* Adjusting one asset */
.adjust { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(340px, 100%), 1fr)); gap: 24px; align-items: start; }
.adjust .pane { min-width: 0; }
.adjust .field { display: flex; flex-direction: column; gap: 4px; margin-top: 10px; max-width: 520px; }
.adjust .field label { font-size: 12px; color: var(--muted); }
.adjust input[type='range'] { width: 100%; accent-color: var(--brand); }
.stage { position: relative; max-width: 640px; line-height: 0; touch-action: none; user-select: none; }
.stage img { display: block; width: 100%; height: auto; border-radius: 6px; background: var(--line); }
.frame { position: absolute; border: 3px solid #fff; box-shadow: 0 0 0 9999px rgba(15, 23, 42, 0.55); cursor: move; touch-action: none; }
.frame[hidden] { display: none; }
.frame:focus-visible { outline: 2px solid #bfdbfe; outline-offset: 2px; }
.stage { overflow: hidden; border-radius: 6px; }
.mock { background: var(--panel); border: 1px solid var(--line); overflow: hidden; }
.mock .result { width: 100%; max-height: none; border: 0; border-radius: 0; }
.mock-mail { max-width: 420px; }
.mock-head { display: block; width: 100%; height: auto; }
.mock > a, .mock-shot > a { display: block; }
.mock-items { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 12px; }
.mock-items span { display: block; aspect-ratio: 3 / 2; background: var(--bg); }
.mock-items i, .mock-caption span { display: block; height: 6px; margin-top: 7px; width: 70%; background: var(--line); }
.mock-phone { max-width: 340px; border-radius: 24px; }
.mock-account { display: flex; align-items: center; gap: 8px; padding: 10px 12px; font-size: 13px; font-weight: 600; }
.mock-avatar { width: 26px; height: 26px; border-radius: 50%; background: var(--bg); border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; font-size: 10px; color: var(--muted); }
.mock-shot { position: relative; }
.mock-count { position: absolute; top: 8px; right: 10px; padding: 1px 8px; border-radius: 10px; background: var(--ink); color: #fff; font-size: 11px; }
.mock-dots { display: flex; justify-content: center; gap: 4px; padding: 8px 0 2px; }
.mock-dots span { width: 5px; height: 5px; border-radius: 50%; background: var(--line); }
.mock-dots span.on { background: var(--brand); }
.mock-actions { display: flex; gap: 12px; padding: 8px 12px 2px; color: var(--ink); }
.mock-actions .mock-last { margin-left: auto; }
.mock-caption { padding: 0 12px 14px; }
.mock-caption span + span { width: 45%; }
.mock-steps { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 10px 0 4px; }
.result { display: block; max-width: 100%; width: auto; max-height: 70vh; height: auto; border-radius: 6px; background: var(--line); border: 1px solid var(--line); }

/* A button whose action is under way */
.busy { opacity: 0.55; cursor: progress; }

/* Live or test, beside the logo. The same badge as the Image Intake app. */
.env-badge { font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 10px; letter-spacing: 0.04em; vertical-align: middle; }
.env-test { background: var(--attn-bg); color: var(--attn); border: 1px solid #fed7aa; }
.env-live { background: var(--ok-bg); color: var(--ok); border: 1px solid #bbf7d0; }

/* The start page: one card per project */
.projects { list-style: none; margin: 14px 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(340px, 100%), 1fr)); gap: 12px; align-items: start; }
.project { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 12px; padding: 10px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.project .cover { display: block; width: 112px; height: 112px; border-radius: 6px; background: var(--line); overflow: hidden; }
.project .cover img { display: block; width: 100%; height: 100%; object-fit: cover; }
.project .cover img[hidden] { display: none; }
.project h2 { margin: 0 0 2px; font-size: 15px; overflow-wrap: anywhere; }
.project p { margin: 2px 0; }
.steps-list { list-style: none; margin: 6px 0; padding: 0; display: grid; gap: 2px; }
.steps-list[hidden], .project .next[hidden] { display: none; }
.step { padding-left: 14px; position: relative; }
.step::before { content: ''; position: absolute; left: 0; top: 0.55em; width: 7px; height: 7px; border-radius: 50%; background: var(--line); }
.step.done::before { background: var(--ok); }
.step.attn::before { background: #f59e0b; }
.step a { font-weight: 600; }
.project .next { margin-top: 6px; }

/* Someone else is working in this project */
.inuse { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 12px 0 0; }
.inuse[hidden] { display: none; }
.inuse button { padding: 5px 10px; }
.project .inuse-line { color: var(--attn); font-weight: 600; }

/* The start page: adding a project and opening another folder, side by side under the projects */
.starts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); gap: 12px; margin: 22px 0 10px; }
.start { margin: 0; padding: 14px 16px; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.start h2 { margin: 0; font-size: 15px; }
.start h2 label { font: inherit; color: inherit; }
.start p { margin: 0; }
.start .button, .start .row { margin-top: 6px; }
.start .row { display: flex; gap: 8px; flex-wrap: wrap; }
.start .row input { flex: 1 1 14rem; min-width: 0; }
.signed { margin-top: 12px; }
