/* 3dKitchen: a site-plan sheet. Legend colours from Indian layout plans
   (plot yellow, park green, commercial rose, road charcoal) on drafting film. */
:root {
  --film: #e6ebe6;
  --sheet: #f4f6f2;
  --ink: #1c2421;
  --ink-2: #545e59;
  --rule: #b6c0b9;
  --rule-strong: #1c2421;
  --plot: #f2c14e;
  --plot-deep: #9a6d00;
  --park: #3e7b3a;
  --rose: #e58fa6;
  --road: #2e3431;
  --marker: #c8372d;
  --focus: #2a63c9;
  --radius: 3px;
  --wide: 125;
  --font: "Archivo", system-ui, sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { font-size: 16px; }
body {
  margin: 0; background: var(--film); color: var(--ink);
  font-family: var(--font); font-variation-settings: "wdth" 100; line-height: 1.5;
  font-feature-settings: "tnum" 1;
}
a { color: inherit; text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

h1, h2, h3 { font-variation-settings: "wdth" var(--wide); line-height: 1.15; margin: 0 0 .5rem; letter-spacing: -.01em; }
h1 { font-size: 2rem; font-weight: 750; }
h2 { font-size: 1.25rem; font-weight: 700; }
h3 { font-size: 1rem; font-weight: 700; }
p { margin: 0 0 .75rem; max-width: 70ch; }
.lead { font-size: 1.05rem; color: var(--ink-2); }
.hint { color: var(--ink-2); font-size: .875rem; }
.sub { color: var(--ink-2); margin: .25rem 0 0; }

.wordmark { font-variation-settings: "wdth" 125; font-weight: 800; font-size: 1.5rem; letter-spacing: -.02em; }

/* ---------- sheet + title block */
.sheet { display: grid; grid-template-columns: 17rem 1fr; min-height: 100vh; }
.titleblock {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  background: var(--sheet); border-right: 3px solid var(--rule-strong);
  display: flex; flex-direction: column;
}
.tb-brand { display: block; padding: 1.25rem 1.25rem 1rem; text-decoration: none; border-bottom: 3px solid var(--rule-strong); }
.tb-sub { display: block; color: var(--ink-2); font-size: .8rem; margin-top: .15rem; }
.tb-nav { display: flex; flex-direction: column; }
.tb-cell {
  display: block; padding: .7rem 1.25rem; text-decoration: none; border-bottom: 1px solid var(--rule);
  font-weight: 560;
}
.tb-cell:hover { background: #e9ede8; }
.tb-cell.on { background: var(--ink); color: var(--sheet); }
.tb-new { font-weight: 700; background: var(--plot); }
.tb-new:hover { background: #f6cf6f; }
.tb-new.on { background: var(--ink); }
.tb-proj { padding-left: 2rem; font-weight: 450; font-size: .92rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb-grid { margin: auto 0 0; display: grid; grid-template-columns: 1fr 1fr; border-top: 3px solid var(--rule-strong); }
.tb-field { padding: .6rem .9rem; border-bottom: 1px solid var(--rule); }
.tb-field:nth-child(odd) { border-right: 1px solid var(--rule); }
.tb-field dt { font-size: .72rem; color: var(--ink-2); }
.tb-field dd { margin: .1rem 0 0; font-weight: 600; font-size: .88rem; display: flex; align-items: center; gap: .4rem; }
.tb-out { padding: .8rem 1.25rem; font-size: .85rem; color: var(--ink-2); }
.dot { width: .55rem; height: .55rem; border-radius: 50%; display: inline-block; flex: none; }
.dot-on { background: var(--park); box-shadow: 0 0 0 3px #3e7b3a33; }
.dot-off { background: var(--marker); }

.drawing { padding: 2rem clamp(1rem, 3vw, 3rem) 4rem; min-width: 0; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap;
  border-bottom: 3px solid var(--rule-strong); padding-bottom: 1rem; margin-bottom: 1.5rem; }
.page-head h1 { margin: 0; }

/* ---------- controls */
.btn {
  font: inherit; font-weight: 650; cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
  padding: .6rem 1.1rem; border: 2px solid var(--ink); border-radius: var(--radius);
  background: transparent; color: var(--ink); text-decoration: none; min-height: 2.75rem;
}
.btn:hover { background: #dfe5df; }
.btn-primary { background: var(--plot); }
.btn-primary:hover { background: #f6cf6f; }
.btn-quiet { border-color: var(--rule); font-weight: 500; }
.btn[disabled] { opacity: .5; cursor: wait; }

label { display: flex; flex-direction: column; gap: .3rem; font-weight: 600; font-size: .9rem; }
label.check, .opts label { flex-direction: row; align-items: center; gap: .5rem; font-weight: 500; }
input, select, textarea {
  font: inherit; font-weight: 400; color: var(--ink); background: #fbfcfa;
  border: 1px solid var(--rule); border-bottom: 2px solid var(--ink); border-radius: var(--radius) var(--radius) 0 0;
  padding: .6rem .7rem; min-height: 2.75rem; width: 100%;
}
input[type=checkbox] { width: 1.1rem; height: 1.1rem; min-height: 0; accent-color: var(--ink); }
textarea { resize: vertical; }
.fields-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 1rem; align-items: end; margin-bottom: 1rem; }
.actions { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; }
.alert { background: #f8dcd8; border-left: 4px solid var(--marker); padding: .7rem .9rem; }

/* ---------- auth */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 1rem; }
.auth-card { width: min(26rem, 100%); background: var(--sheet); border: 3px solid var(--ink); padding: 2rem; display: grid; gap: 1rem; }
.auth-card .wordmark { font-size: 2rem; margin: 0; }

/* ---------- ledgers (tables) */
.ledger { width: 100%; border-collapse: collapse; background: var(--sheet); border: 1px solid var(--rule); margin-bottom: 1.25rem; }
.ledger th { text-align: left; font-size: .8rem; font-weight: 650; color: var(--ink-2); padding: .55rem .8rem; border-bottom: 2px solid var(--ink); }
.ledger td { padding: .6rem .8rem; border-bottom: 1px solid var(--rule); vertical-align: top; }
.ledger .num { text-align: right; }
.ledger tr.mismatch td { background: #fbeee0; }
.status { font-weight: 650; font-size: .85rem; padding: .15rem .55rem; border-radius: 2px; background: #dfe5df; white-space: nowrap; }
.status-done { background: var(--park); color: #fff; }
.status-plan_check { background: var(--plot); }
.status-failed { background: var(--marker); color: #fff; }
.status-running, .status-queued, .status-approved { background: var(--road); color: var(--sheet); }

.callout, .empty, .panel { background: var(--sheet); border: 1px solid var(--rule); border-left: 6px solid var(--plot); padding: 1.25rem 1.5rem; margin-bottom: 1.5rem; }
.empty { border-left-color: var(--rule); }
.panel { border-left-color: var(--ink); }

/* ---------- new project */
.newjob { max-width: 58rem; }
.dropzone {
  border: 2px dashed var(--ink-2); background: repeating-linear-gradient(0deg, transparent 0 23px, #d6ddd7 23px 24px),
    repeating-linear-gradient(90deg, transparent 0 23px, #d6ddd7 23px 24px), var(--sheet);
  padding: 2.5rem 1.5rem; text-align: center; margin-bottom: 1rem; transition: border-color .15s, background-color .15s;
}
.dropzone.over { border-color: var(--ink); border-style: solid; background-color: #fff6dc; }
.drop-title { font-variation-settings: "wdth" 125; font-weight: 750; font-size: 1.3rem; margin: 0 auto .4rem; }
.dropzone .hint { margin: 0 auto 1rem; }
.filelist { list-style: none; padding: 0; margin: 0 0 1.25rem; display: grid; gap: .4rem; }
.filelist li { display: flex; align-items: center; gap: .75rem; background: var(--sheet); border: 1px solid var(--rule); padding: .5rem .75rem; }
.filelist .size { margin-left: auto; color: var(--ink-2); font-size: .85rem; }
.filelist .bar { flex: 0 0 8rem; height: .4rem; background: #dfe5df; }
.filelist .bar i { display: block; height: 100%; background: var(--ink); width: 0; transition: width .2s; }
.filelist button { border: 0; background: none; font: inherit; color: var(--marker); cursor: pointer; padding: .25rem; }
.kind { font-size: .75rem; font-weight: 700; padding: .1rem .45rem; border-radius: 2px; background: #dfe5df; }
.kind-plan { background: var(--plot); }
.kind-scene { background: var(--road); color: var(--sheet); }
.kind-reference { background: var(--rose); }
.kind-model { background: var(--park); color: #fff; }
.brief { margin-bottom: 1rem; }
.brief textarea { font-size: 1.05rem; }
.more { margin-bottom: 1.25rem; }
.more summary { cursor: pointer; font-weight: 600; margin-bottom: .75rem; }

/* ---------- job */
.versions { display: flex; gap: .3rem; flex-wrap: wrap; }
.ver { text-decoration: none; padding: .35rem .7rem; border: 2px solid var(--ink); font-weight: 700; font-variation-settings: "wdth" 115; }
.ver.on { background: var(--ink); color: var(--sheet); }
.jobbar { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.jobbar .status { font-size: 1rem; padding: .35rem .8rem; }
.jobbar-stage { color: var(--ink-2); }
.jobbar .btn { margin-left: auto; }

.detective { background: var(--sheet); border: 3px solid var(--ink); margin-bottom: 1.75rem; }
.det-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; flex-wrap: wrap; padding: 1rem 1.25rem; border-bottom: 1px solid var(--rule); }
.det-head h2 { margin: 0; }
.det-verdict { margin: 0; font-weight: 650; }
.det-body { display: grid; grid-template-columns: minmax(0, 3fr) minmax(18rem, 2fr); }
.plan { position: relative; margin: 0; background: #fff; border-right: 1px solid var(--rule); align-self: start; }
.plan img { display: block; width: 100%; height: auto; }
.plan svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.pin circle { fill: var(--marker); stroke: #fff; stroke-width: 2; }
.pin.warning circle { fill: var(--plot-deep); }
.pin.info circle { fill: var(--road); }
.pin text { fill: #fff; font: 700 11px var(--font); text-anchor: middle; dominant-baseline: central; }
.pin .ring { fill: none; stroke: var(--marker); stroke-width: 3; opacity: 0; }
.pin.active .ring { opacity: 1; animation: ping 1.2s ease-out 1; }
.pin.warning .ring { stroke: var(--plot-deep); }
.objhl { fill: #c8372d33; stroke: var(--marker); stroke-width: 1.5; }
@keyframes ping { from { r: 10; opacity: 1; } to { r: 26; opacity: 0; } }

.issues { list-style: none; margin: 0; padding: 0; max-height: 46rem; overflow-y: auto; counter-reset: none; }
.issue { padding: .9rem 1.1rem; border-bottom: 1px solid var(--rule); cursor: pointer; display: grid; grid-template-columns: 1.6rem 1fr; gap: .2rem .6rem; }
.issue:hover, .issue.active { background: #fff6dc; }
.issue .n { grid-row: span 4; width: 1.5rem; height: 1.5rem; border-radius: 50%; color: #fff; font-weight: 700; font-size: .75rem;
  display: grid; place-items: center; background: var(--road); }
.issue.error .n { background: var(--marker); }
.issue.warning .n { background: var(--plot-deep); }
.issue h3 { font-variation-settings: "wdth" 100; font-size: .98rem; margin: 0; }
.issue p { margin: 0; font-size: .9rem; }
.issue .why { color: var(--ink-2); font-size: .82rem; }
.issue .tags { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; margin-top: .35rem; font-size: .8rem; color: var(--ink-2); }
.issue .accept { flex-direction: row; align-items: center; gap: .4rem; font-weight: 600; font-size: .85rem; margin-left: auto; color: var(--ink); }
.no-issues { padding: 1.25rem; }

.det-tables { padding: 1rem 1.25rem; border-top: 1px solid var(--rule); }
.det-tables summary { cursor: pointer; font-weight: 650; margin-bottom: .75rem; }
.det-grid { align-items: start; display: grid; grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr)); gap: 1rem; }
.approve { padding: 1.1rem 1.25rem 1.4rem; border-top: 3px solid var(--ink); background: #fff6dc; display: grid; gap: .8rem; justify-items: start; }
.opts { border: 0; padding: 0; margin: 0; display: flex; gap: 1.25rem; flex-wrap: wrap; }
.opts legend { font-weight: 700; margin-bottom: .4rem; }

.results { margin-bottom: 1.75rem; }
.gallery { align-items: start; display: grid; grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr)); gap: .75rem; margin-bottom: 1rem; }
.gallery figure { margin: 0; background: var(--sheet); border: 1px solid var(--rule); }
.gallery img { display: block; width: 100%; height: auto; }
.gallery figcaption { padding: .4rem .6rem; font-size: .85rem; color: var(--ink-2); }
.viewer-wrap { margin-bottom: 1.25rem; }
.viewer { height: min(70vh, 34rem); background: #cfd9e2; border: 3px solid var(--ink); touch-action: none; }
.downloads { list-style: none; padding: 0; margin: 0; display: grid; gap: .4rem; }
.downloads a { display: flex; gap: .75rem; align-items: center; background: var(--sheet); border: 1px solid var(--rule); padding: .65rem .8rem; text-decoration: none; font-weight: 600; }
.downloads a:hover { border-color: var(--ink); }
.downloads .size { margin-left: auto; font-weight: 400; color: var(--ink-2); }

.log summary { cursor: pointer; font-weight: 650; }
.log-list { list-style: none; padding: 0; margin: .75rem 0 0; font-size: .85rem; max-height: 18rem; overflow-y: auto; background: var(--sheet); border: 1px solid var(--rule); }
.log-list li { padding: .35rem .7rem; border-bottom: 1px solid #dfe5df; display: grid; grid-template-columns: 4.5rem 1fr; gap: .5rem; }
.log-list time { color: var(--ink-2); }
.log-list .error { color: var(--marker); font-weight: 600; }
.log-list .warn { color: var(--plot-deep); }

.revise, .inputs { border-top: 3px solid var(--ink); padding-top: 1.25rem; margin-top: 2rem; max-width: 58rem; }
.thread { list-style: none; padding: 0; margin: 0 0 1rem; display: grid; gap: .6rem; }
.msg { padding: .7rem .9rem; max-width: 46rem; border: 1px solid var(--rule); background: var(--sheet); }
.msg p { margin: 0; }
.msg-user { justify-self: end; background: #fff6dc; border-color: var(--plot); }
.revise-form { display: grid; grid-template-columns: 1fr auto; gap: .75rem; align-items: end; }

/* ---------- integrations */
.providers { display: grid; grid-template-columns: repeat(auto-fill, minmax(20rem, 1fr)); gap: 1rem; margin-bottom: 2rem; }
.provider { background: var(--sheet); border: 1px solid var(--rule); border-top: 6px solid var(--ink); padding: 1.1rem 1.25rem; }
.provider.state-planned { border-top-color: var(--rule); color: var(--ink-2); }
.provider header { display: flex; justify-content: space-between; gap: .75rem; align-items: baseline; }
.provider h2 { font-size: 1.1rem; margin: 0; }
.badge { font-size: .75rem; font-weight: 700; padding: .1rem .5rem; border: 1.5px solid currentColor; border-radius: 2px; white-space: nowrap; }
.state-implemented .badge { background: var(--park); color: #fff; border-color: var(--park); }
.cat { color: var(--ink-2); font-size: .85rem; }
.facts { display: grid; gap: .35rem; font-size: .85rem; margin: 0 0 1rem; }
.facts dt { font-weight: 650; }
.facts dd { margin: 0; }
.int-form { display: grid; gap: .8rem; border-top: 1px solid var(--rule); padding-top: 1rem; }
.int-msg { font-size: .88rem; margin: 0; min-height: 1.2em; }
.discover { max-width: 58rem; }
.inline-form { display: grid; grid-template-columns: 1fr auto; gap: .75rem; margin-bottom: 1rem; }
.research { background: var(--sheet); border: 1px solid var(--rule); padding: 1rem 1.25rem; margin-bottom: .75rem; }
.paircode { font-variation-settings: "wdth" 125; font-size: 2rem; font-weight: 800; letter-spacing: .12em; margin-top: 1rem; }

/* ---------- small screens: the title block becomes a top band */
@media (max-width: 900px) {
  .sheet { grid-template-columns: 1fr; }
  .titleblock { position: static; height: auto; border-right: 0; border-bottom: 3px solid var(--rule-strong); }
  .tb-nav { flex-direction: row; overflow-x: auto; }
  .tb-cell { border-bottom: 0; border-right: 1px solid var(--rule); white-space: nowrap; }
  .tb-proj { display: none; }
  .tb-grid { grid-template-columns: repeat(4, 1fr); margin: 0; }
  .tb-field:nth-child(odd) { border-right: 0; }
  .tb-field { border-right: 1px solid var(--rule); }
  .tb-out { display: none; }
  .det-body { grid-template-columns: 1fr; }
  .plan { border-right: 0; border-bottom: 1px solid var(--rule); }
  .issues { max-height: none; }
  .revise-form { grid-template-columns: 1fr; }
  h1 { font-size: 1.6rem; }
}
@media (max-width: 520px) { .tb-grid { grid-template-columns: 1fr 1fr; } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ---------- integrations catalogue */
.btn-small { min-height: 2.25rem; padding: .35rem .8rem; font-size: .88rem; }
.chains { background: var(--sheet); border: 3px solid var(--ink); padding: 1rem 1.25rem; margin-bottom: 1.5rem; }
.chains h2 { font-size: 1.05rem; }
.chain { display: grid; grid-template-columns: 14rem 1fr; gap: .75rem; padding: .5rem 0; border-top: 1px solid var(--rule); }
.chain-cat { font-weight: 650; }
.chain-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .4rem .9rem; }
.chain-role { font-size: .75rem; color: var(--ink-2); margin-right: .35rem; }
.filters { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-bottom: 1.5rem; position: sticky; top: 0; z-index: 2;
  background: var(--film); padding: .6rem 0; }
.chip { font: inherit; font-size: .88rem; font-weight: 600; cursor: pointer; padding: .4rem .8rem; border: 1.5px solid var(--ink); border-radius: 999px; background: var(--sheet); min-height: 2.25rem; }
.chip.on { background: var(--ink); color: var(--sheet); }
.filter-search { margin-left: auto; min-width: 14rem; }
.filter-search input { min-height: 2.25rem; padding: .35rem .7rem; }
.int-cat { margin-bottom: 2rem; }
.int-cat-head { border-bottom: 3px solid var(--ink); margin-bottom: 1rem; padding-bottom: .5rem; }
.int-cat-head h2 { margin-bottom: .2rem; }
.int-cat-head p { color: var(--ink-2); margin: 0; font-size: .92rem; }
.provider h3 { font-size: 1.05rem; margin: 0; }
.provider.is-built { border-top-color: var(--ink); }
.provider.is-planned { border-top-color: var(--rule); }
.provider.is-on { border-top-color: var(--park); box-shadow: inset 0 0 0 2px var(--park); }
.provider .state { font-size: .82rem; color: var(--ink-2); margin: .35rem 0 .5rem; display: flex; align-items: center; gap: .4rem; }
.provider .does { font-size: .92rem; }
.provider .links { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .75rem; }
.tier { font-size: .72rem; font-weight: 700; padding: .12rem .5rem; border-radius: 2px; white-space: nowrap; }
.tier-free { background: var(--park); color: #fff; }
.tier-free_tier { background: var(--plot); color: var(--ink); }
.tier-paid { background: var(--rose); color: var(--ink); }
.tier-local { background: var(--road); color: var(--sheet); }
.tier-none { background: #dfe5df; color: var(--ink); }
.chip[class*="chip-"]::before { content: ""; display: inline-block; width: .6rem; height: .6rem; border-radius: 50%; margin-right: .4rem; vertical-align: -.05rem; }
.chip-free::before { background: var(--park); }
.chip-free_tier::before { background: var(--plot); }
.chip-paid::before { background: var(--rose); }
.chip-local::before { background: var(--road); }
.chip.on[class*="chip-"]::before { box-shadow: 0 0 0 2px var(--sheet); }
.setup { border-top: 1px solid var(--rule); padding-top: .6rem; }
.setup > summary { cursor: pointer; font-weight: 650; font-size: .9rem; }
.setup .int-form { border-top: 0; padding-top: .75rem; }
.adv > summary { cursor: pointer; font-size: .85rem; font-weight: 600; margin-bottom: .5rem; }
.order { max-width: 7rem; }
@media (max-width: 900px) { .chain { grid-template-columns: 1fr; gap: .25rem; } .filter-search { margin-left: 0; width: 100%; } }
