/* Coloro 1.0.0 workspaces: the platform indigo on cool neutrals; one large "next step" per page so a first-time user always knows what to do. */
:root {
  --bg: #f4f5f9; --panel: #fff; --ink: #172033; --muted: #5b6478; --line: #dde1ea; --soft: #f7f8fb;
  --accent: #3b4fd9; --accent-soft: #e8ebfd; --good: #15803d; --good-soft: #e3f5e8; --warn: #b45309; --warn-soft: #fdf1dd; --bad: #c0362c; --bad-soft: #fbe6e3;
  --font: 'Noto Sans SC', 'Inter', 'PingFang SC', 'Microsoft YaHei', system-ui, sans-serif; --radius: 10px;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.65 var(--font); }
a { color: var(--accent); text-underline-offset: 3px; }
h1 { font-size: 24px; line-height: 1.3; margin: 0 0 8px; text-wrap: balance; }
h2 { font-size: 18px; margin: 0 0 6px; }
h3 { font-size: 15px; margin: 0 0 12px; }
p { margin: 0 0 8px; }
small { display: block; color: var(--muted); font-size: 12.5px; }
code { background: var(--soft); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; font-size: 14px; word-break: break-all; }
.small { font-size: 13px; color: var(--muted); }
.lead { color: var(--muted); max-width: 70ch; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.booting, .loading { color: var(--muted); padding: 40px 0; text-align: center; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

button, .button { font: inherit; font-size: 14px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); border-radius: 8px; padding: 8px 16px; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; min-height: 40px; }
button:hover, .button:hover { border-color: #b9c0d0; }
button:disabled { opacity: .55; cursor: wait; }
.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.primary:hover { background: #3243c4; border-color: #3243c4; }
.danger { background: var(--bad); border-color: var(--bad); color: #fff; }
.ghost { background: transparent; }
.small { min-height: 32px; padding: 4px 10px; font-size: 13px; }
button.small { font-size: 13px; }
.block { width: 100%; justify-content: center; }
.icon { border: 0; background: none; font-size: 22px; min-height: 32px; padding: 0 8px; color: var(--muted); }

.field { display: grid; gap: 4px; margin: 0 0 14px; }
.field > span, legend { font-size: 13.5px; font-weight: 500; }
input, select, textarea { font: inherit; font-size: 15px; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; background: #fff; color: var(--ink); width: 100%; }
textarea { resize: vertical; }
fieldset { border: 0; padding: 0; margin: 0 0 14px; }
.checks .check { display: flex; gap: 8px; align-items: flex-start; padding: 6px 0; font-size: 14.5px; }
.checks .check input, .choice input[type=radio] { width: auto; margin-top: 5px; }
.radios .check { border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; margin-top: 6px; cursor: pointer; }
.radios .check:has(input:checked) { border-color: var(--accent); background: var(--accent-soft, transparent); }
.radios.inline { display: flex; flex-wrap: wrap; gap: 0 8px; }
.radios.inline legend { width: 100%; }
.radios.inline .check { flex: 1 1 160px; }
.framework-q { padding: 4px 0 8px; }
.plain-ol { margin: 6px 0 0; padding-left: 20px; }
.framework-q + .framework-q { border-top: 1px solid var(--line); }
.form-error { color: var(--bad); background: var(--bad-soft); border-radius: 8px; padding: 8px 12px; font-size: 14px; }
.notice { background: var(--accent-soft); border-radius: 8px; padding: 10px 14px; }
.notice.warn { background: var(--warn-soft); }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 16px; }

/* Sign-in pages */
.auth { max-width: 440px; margin: 0 auto; padding: 48px 16px; }
.auth.wide { max-width: 860px; }
.auth .logo { margin-bottom: 32px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; margin-top: 16px; }
.portals { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-top: 20px; }
.portal { display: grid; gap: 6px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; text-decoration: none; color: var(--ink); }
.portal:hover { border-color: var(--accent); }
.portal strong { font-size: 17px; }
.portal span { color: var(--muted); font-size: 13.5px; }
.logo { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; color: var(--ink); text-decoration: none; }
.mark { width: 24px; height: 24px; border-radius: 6px; background: conic-gradient(#3b4fd9 0 25%, #f5b36b 0 50%, #df787d 0 75%, #75aa9a 0); }
.portal-name { font-weight: 500; color: var(--muted); padding-left: 10px; margin-left: 2px; border-left: 1px solid var(--line); }

/* Workspace */
.top { position: sticky; top: 0; z-index: 5; background: var(--panel); border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 24px; padding: 0 24px; min-height: 60px; flex-wrap: wrap; }
.tabs { display: flex; gap: 4px; flex: 1; overflow-x: auto; }
.tabs a { text-decoration: none; color: var(--muted); padding: 18px 12px; border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs a[aria-current=page] { color: var(--accent); border-color: var(--accent); font-weight: 600; }
.who { display: flex; gap: 8px; align-items: center; font-size: 13px; color: var(--muted); }
.count { display: inline-block; min-width: 20px; padding: 0 6px; border-radius: 10px; background: var(--accent); color: #fff; font-size: 12px; text-align: center; margin-left: 6px; line-height: 20px; }
.work { max-width: 1080px; margin: 0 auto; padding: 28px 24px 80px; display: grid; gap: 18px; align-content: start; }
.work > * { min-width: 0; }
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.page-head h1, .page-head h3 { margin: 0; }
.crumb { font-size: 13.5px; color: var(--muted); margin: 0; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; }
details.panel > summary, details > summary { cursor: pointer; font-weight: 600; padding: 4px 0; }
.empty-state { color: var(--muted); padding: 32px; text-align: center; background: var(--panel); border: 1px dashed var(--line); border-radius: var(--radius); }
.subtabs { display: flex; gap: 8px; }
.subtabs a { text-decoration: none; padding: 6px 12px; border-radius: 8px; color: var(--muted); }
.subtabs a[aria-current=page] { background: var(--accent-soft); color: var(--accent); font-weight: 600; }

/* Next step */
.next { background: var(--panel); border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: var(--radius); padding: 20px 24px; }
.next.done { border-left-color: var(--good); }
.eyebrow { font-size: 12.5px; letter-spacing: .08em; color: var(--accent); font-weight: 600; margin: 0 0 6px; }
.todo { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 10px 0; border-top: 1px solid var(--line); }
.todo:first-of-type { border-top: 0; }
.todo.large { padding: 0; border: 0; }
.todo.large strong { font-size: 19px; }
.todo p { margin: 2px 0 0; color: var(--muted); font-size: 13.5px; }
.todo.waiting strong { font-weight: 500; }
.group-count { font-size: 12.5px; font-weight: 500; color: var(--muted); background: var(--soft); border-radius: 10px; padding: 0 8px; margin: 0 8px; }
.group-count.complete { color: var(--good); background: var(--good-soft); }
details > summary { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; }
details > summary [data-all-yes] { margin-left: auto; }
.check-item.missing { background: var(--warn-soft); box-shadow: -12px 0 0 var(--warn-soft), 12px 0 0 var(--warn-soft); }
.progress { align-self: center; font-size: 13.5px; color: var(--muted); margin-left: auto; }
.empty-state .primary { margin-top: 8px; }
.tag { font-size: 12.5px; color: var(--muted); background: var(--soft); border-radius: 12px; padding: 2px 10px; white-space: nowrap; }

/* Certification card */
.cert { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; display: grid; gap: 12px; }
.cert header { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.cert h3 { margin: 0; font-size: 16px; }
.cert h3 small { display: inline; font-weight: 400; }
.cert header p, .meta { margin: 0; color: var(--muted); font-size: 13.5px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.actions.sticky { position: sticky; bottom: 0; background: linear-gradient(transparent, var(--bg) 30%); padding: 18px 0 8px; }
.stepper { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; list-style: none; margin: 0; padding: 0; counter-reset: step; }
.stepper li { counter-increment: step; font-size: 12.5px; color: var(--muted); padding-top: 8px; border-top: 3px solid var(--line); }
.stepper li::before { content: counter(step) ' '; font-weight: 600; }
.stepper li.done { border-color: var(--good); color: var(--ink); }
.stepper li.now { border-color: var(--accent); color: var(--accent); font-weight: 600; }

.badge { display: inline-block; font-size: 12.5px; padding: 1px 10px; border-radius: 12px; white-space: nowrap; font-weight: 500; }
.badge.good { background: var(--good-soft); color: var(--good); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.bad { background: var(--bad-soft); color: var(--bad); }
.badge.doing { background: var(--accent-soft); color: var(--accent); }
.badge.wait, .badge.muted { background: var(--soft); color: var(--muted); }
.bad-text { color: var(--bad); }
.pill { display: inline-block; font-size: 12.5px; padding: 0 8px; border-radius: 10px; background: var(--soft); color: var(--muted); margin: 1px 0; }
.pill.ok { background: var(--good-soft); color: var(--good); }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-weight: 500; color: var(--muted); font-size: 13px; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
td button { margin: 0 4px 4px 0; }
td.empty { text-align: center; color: var(--muted); padding: 24px; }
tr:last-child td { border-bottom: 0; }

/* Self-check and on-site lists */
.check-item { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 14px; padding: 12px 0; border-top: 1px solid var(--line); }
.check-item p { margin: 2px 0 0; }
.choice { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; }
.choice label { display: inline-flex; gap: 6px; align-items: center; white-space: nowrap; }
.choice input[type=text], .choice select { flex: 1 1 200px; }
details > .check-item:first-of-type { margin-top: 8px; }
fieldset.person { border-top: 1px solid var(--line); padding-top: 12px; }
.steps { list-style: none; padding: 0; margin: 0 0 8px; display: flex; flex-wrap: wrap; gap: 8px; }
.steps li { background: var(--soft); border-radius: 16px; padding: 4px 12px; color: var(--muted); }
.steps li.ok { background: var(--good-soft); color: var(--good); }
.plain { margin: 0; padding-left: 18px; }
.plain li + li { margin-top: 6px; }
.report li { list-style: none; margin-left: -18px; padding: 10px 0; border-top: 1px solid var(--line); }
.report li:first-child { border-top: 0; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.columns { background: var(--soft); border-radius: 8px; padding: 8px 12px; font-size: 13.5px; }
blockquote { margin: 0 0 12px; padding: 8px 12px; border-left: 3px solid var(--line); background: var(--soft); }

dialog { border: 0; border-radius: 12px; padding: 0; width: min(520px, calc(100vw - 32px)); max-height: calc(100vh - 32px); box-shadow: 0 20px 60px rgba(23, 32, 51, .25); color: var(--ink); }
dialog.wide { width: min(820px, calc(100vw - 32px)); }
dialog::backdrop { background: rgba(23, 32, 51, .4); }
dialog form { display: flex; flex-direction: column; max-height: calc(100vh - 32px); }
dialog header { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line); }
dialog header h2 { margin: 0; font-size: 17px; }
.dialog-body { padding: 18px 20px; overflow-y: auto; }
dialog footer { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--line); }
#toast { position: fixed; left: 50%; top: 72px; transform: translate(-50%, -12px); background: var(--ink); color: #fff; padding: 10px 18px; border-radius: 8px; opacity: 0; pointer-events: none; transition: .2s; max-width: calc(100vw - 32px); z-index: 20; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast.error { background: var(--bad); }

@media (max-width: 760px) {
  .top { padding: 0 16px; gap: 8px; }
  .who span { display: none; }
  .tabs { order: 3; flex-basis: 100%; }
  .tabs a { padding: 10px; }
  .work { padding: 20px 16px 80px; }
  .grid2, .grid3, .check-item { grid-template-columns: 1fr; }
  .stepper { grid-template-columns: repeat(5, minmax(56px, 1fr)); overflow-x: auto; }
  .todo { flex-direction: column; align-items: stretch; }
  /* Tables become one card per row on phones; each cell carries its column name. */
  table, tbody, tr, td { display: block; }
  thead { display: none; }
  tr { border: 1px solid var(--line); border-radius: 8px; padding: 6px 12px; margin-bottom: 10px; background: var(--panel); }
  td { border: 0; padding: 6px 0; }
  td::before { content: attr(data-label); display: block; color: var(--muted); font-size: 12.5px; }
  td[data-label=""]::before { content: none; }
}
@media (prefers-reduced-motion: reduce) { #toast { transition: none; } }

/* Self-check photo checklist */
.scene-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.scene-count { font-size: 13px; color: var(--muted); }
.scene.done .scene-count { color: var(--good); font-weight: 600; }
.scene.missing { box-shadow: 0 0 0 2px var(--warn); }
.thumbs { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.thumb { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 88px; height: 88px; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--soft); font-size: 13px; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb button { position: absolute; top: 2px; right: 2px; min-height: 0; padding: 0 6px; background: rgba(255,255,255,.9); }
.upload { display: inline-flex; cursor: pointer; }
.upload.busy { opacity: .6; pointer-events: none; }
/* One row per scene: name (opens the scene), item count, status, photos, upload; the body holds the shot list, photos and items. */
.scene-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
.scene-title { margin: 0; flex: 1 1 240px; font-size: 16px; }
.scene-toggle { all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; font-weight: 600; border-radius: 6px; }
.scene-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.scene-toggle .caret { width: 0; height: 0; border-left: 6px solid currentColor; border-top: 5px solid transparent; border-bottom: 5px solid transparent; transition: transform .15s; }
.scene[data-open=true] .scene-toggle .caret { transform: rotate(90deg); }
.scene-meta { font-size: 13px; color: var(--muted); }
.scene-status { font-size: 13px; color: var(--good); font-weight: 600; } .scene-status.warn { color: var(--warn); }
.scene-row .upload { margin-left: auto; }
.scene-body { display: none; margin-top: 10px; border-top: 1px solid var(--line); padding-top: 8px; }
.scene[data-open=true] .scene-body { display: block; }
.scene-items { list-style: none; margin: 8px 0 0; padding: 0; }
@media (prefers-reduced-motion: reduce) { .scene-toggle .caret { transition: none; } }
.link-upload { font-size: 13px; color: var(--accent); cursor: pointer; white-space: nowrap; }
.item-files { font-size: 13px; color: var(--good); }
.scene-review { margin: 8px 0 12px; }

/* Self-check step 2: batch upload and recognition results */
.shoot-list { margin: 8px 0 12px; font-size: 14px; } .shoot-list > summary { cursor: pointer; color: var(--muted); } .shoot-list ol { margin: 8px 0 0; padding-left: 20px; display: grid; gap: 4px; }
.pool { display: grid; gap: 8px; margin-top: 12px; }
.pool-sum { margin: 0; }
.pool-card { display: flex; gap: 12px; align-items: center; padding: 8px; border: 1px solid var(--line); border-radius: 8px; border-left: 4px solid var(--warn); }
.pool-card.done { border-left-color: var(--good); } .pool-card.busy { opacity: .7; border-left-color: var(--line); }
.pool-thumb { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 64px; height: 64px; border-radius: 6px; overflow: hidden; background: var(--soft); font-size: 13px; }
.pool-thumb img { width: 100%; height: 100%; object-fit: cover; }
.pool-body { display: grid; gap: 4px; min-width: 0; flex: 1; } .pool-body select { max-width: 100%; }
.rec-hint { margin: 4px 0 0; } .warn-text { color: var(--warn); }

/* Template and scheme editor: one box per module; a module's items open below it for fine-tuning. */
.modules-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; }
.module-pick { border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; }
.module-pick > .check { display: flex; gap: 8px; align-items: center; }
.module-pick > .check input { width: auto; }
.module-pick > .check small { margin-left: 6px; color: var(--muted); }
.module-pick details summary { font-size: 13px; color: var(--muted); cursor: pointer; margin-top: 4px; }
.item-list { display: grid; gap: 2px; max-height: 220px; overflow: auto; margin-top: 6px; }
.item-list .check { display: flex; gap: 6px; align-items: flex-start; font-size: 13px; }
.item-list .check input { width: auto; margin-top: 3px; }
.item-list .check small { margin-left: 4px; color: var(--warn); }
.cert.site { margin-bottom: 14px; } .cert.site h4 { margin: 0; font-size: 15px; }
@media (max-width: 640px) { .grid3, .grid2 { grid-template-columns: 1fr; } }
