/* GFHQ brand: black, white, cyan, magenta. Grays for body text and lines only. */
:root {
  --black: #000000;
  --white: #ffffff;
  --cyan: #01AEE2;
  --magenta: #EB0D8C;
  --panel: #111214;
  --panel-2: #1a1c1f;
  --line: #2c2f33;
  --text: #f2f3f4;
  --muted: #9aa0a6;
  --radius: 16px;     /* cards */
  --radius-field: 12px;
  --radius-button: 14px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--black); color: var(--text); }
body { font-family: Inter, system-ui, sans-serif; font-size: 16px; line-height: 1.5; min-height: 100vh; display: flex; flex-direction: column; }
a { color: var(--cyan); text-decoration: underline; text-underline-offset: 3px; }
a:hover { color: var(--magenta); }
h1, h2, h3 { line-height: 1.15; margin: 0 0 .5em; font-weight: 800; }
h1 { font-size: clamp(32px, 6vw, 56px); }
h2 { font-size: 28px; }
h3 { font-size: 20px; }
.muted { color: var(--muted); }
.marker, .auth .pitch .marker { font-weight: 800; color: var(--cyan); letter-spacing: -.01em; }

/* header / footer */
.top { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 24px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--white); }
.brand img { height: 40px; display: block; }
.brand a { display: flex; align-items: center; gap: 12px; text-decoration: none; color: inherit; }
.brand span { font-weight: 800; font-size: 20px; letter-spacing: .02em; }
.beta { font-style: normal; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--black); background: var(--cyan); padding: 2px 8px; border-radius: 6px; }
nav { display: flex; align-items: center; gap: 22px; }
nav a, .navlink { color: var(--white); text-decoration: none; font: inherit; font-weight: 600; background: none; border: 0; padding: 0; cursor: pointer; white-space: nowrap; }
nav a:hover, nav a.on, .navlink:hover { color: var(--cyan); }
.navlink { color: var(--muted); }
.foot { margin-top: auto; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 20px 24px; border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; }
.foot a { color: var(--white); text-decoration: none; }
.foot a:hover { color: var(--cyan); }
.banner { background: var(--magenta); color: var(--black); padding: 10px 24px; font-weight: 600; text-align: center; }
.banner a, .banner .linkbtn { color: var(--black); }
main { width: 100%; max-width: 1240px; margin: 0 auto; padding: 32px 24px 48px; }

/* buttons and forms */
.btn { font: inherit; font-weight: 700; border-radius: var(--radius-button); padding: 12px 20px; cursor: pointer; border: 2px solid transparent; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.btn.small { padding: 6px 12px; font-size: 14px; }
/* Primary is cyan for go, magenta on hover. Black text on both (white on magenta is too faint below 18px). */
.btn.primary { background: var(--cyan); color: var(--black); }
.btn.primary:hover:not(:disabled) { background: var(--magenta); color: var(--black); }
.btn.outline { background: transparent; color: var(--white); border-color: var(--white); }
.btn.outline:hover { background: var(--cyan); color: var(--black); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.block { width: 100%; }
label { display: block; font-weight: 600; font-size: 14px; margin: 14px 0 6px; }
input, select, textarea { width: 100%; font: inherit; color: var(--text); background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius-field); padding: 10px 12px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--cyan); outline-offset: 0; border-color: var(--cyan); }
input[type=checkbox] { width: auto; margin: 0 8px 0 0; accent-color: var(--cyan); }
.check { display: flex; align-items: flex-start; font-weight: 500; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.error { color: var(--white); background: #3a0a22; border-left: 4px solid var(--magenta); padding: 10px 12px; border-radius: 6px; margin: 12px 0; }
.ok { background: #062a36; border-left: 4px solid var(--cyan); padding: 10px 12px; border-radius: 6px; margin: 12px 0; }

/* auth pages */
.auth { display: grid; grid-template-columns: 1.1fr 1fr; gap: 48px; align-items: center; min-height: 60vh; }
.auth .pitch p { font-size: 18px; color: var(--muted); max-width: 520px; }
.auth .pitch ul { padding-left: 20px; color: var(--text); }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; }
.card h2 { margin-bottom: 4px; }

/* tools */
.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--line); margin-bottom: 24px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button, .tabs a { font: inherit; font-weight: 700; background: none; border: none; color: var(--muted); padding: 10px 14px; cursor: pointer; border-bottom: 3px solid transparent; white-space: nowrap; text-decoration: none; margin-bottom: -1px; }
.tabs button.on, .tabs a.on { color: var(--white); border-bottom-color: var(--magenta); }
.tabs button:hover, .tabs a:hover { color: var(--cyan); }
.tabs .sep { flex: none; width: 1px; margin: 10px 8px; background: var(--line); }
.toolnav a { padding: 10px 8px; }
.workspace { display: grid; grid-template-columns: 340px 1fr; gap: 24px; align-items: start; }
.controls { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.controls label:first-child { margin-top: 0; }
.stage { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; min-height: 420px; display: flex; flex-direction: column; gap: 16px; }
.preview { flex: 1; min-height: 340px; display: flex; align-items: center; justify-content: center; background: #050505; border-radius: 8px; border: 1px solid var(--line); padding: 16px; }
.preview svg { width: 100%; height: 100%; max-height: 480px; }
.preview .empty { color: var(--muted); text-align: center; }
.legend { display: flex; gap: 18px; font-size: 13px; color: var(--muted); flex-wrap: wrap; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }
.findings { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; font-size: 14px; }
.findings li { padding: 8px 10px; border-radius: 6px; background: var(--panel-2); display: flex; gap: 10px; }
.sev { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; padding: 2px 8px; border-radius: 4px; flex: none; align-self: flex-start; }
.sev.decide { background: var(--magenta); color: var(--black); }
.sev.review { background: var(--cyan); color: var(--black); }
.sev.fixed { background: var(--white); color: var(--black); }
.sev.info { background: var(--line); color: var(--text); }
.stats { font-size: 14px; color: var(--muted); }
.drop { border: 2px dashed var(--line); border-radius: 8px; padding: 18px; text-align: center; color: var(--muted); cursor: pointer; }
.edits { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 14px; }
.edits summary { cursor: pointer; font-weight: 700; color: var(--cyan); }
.edits[open] summary { margin-bottom: 4px; }
.drop.over, .drop:hover { border-color: var(--cyan); color: var(--white); }

/* plans */
.terms { display: inline-flex; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-button); padding: 4px; margin: 8px 0 28px; flex-wrap: wrap; }
.terms button { font: inherit; font-weight: 700; background: none; border: none; color: var(--muted); padding: 8px 16px; border-radius: 10px; cursor: pointer; }
.terms button.on { background: var(--white); color: var(--black); }
.terms small { color: var(--magenta); font-weight: 800; margin-left: 4px; }
.terms button.on small { color: var(--magenta); }
.plans { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.plan { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; display: flex; flex-direction: column; gap: 10px; }
.plan.hot { border-color: var(--magenta); }
.plan .name { font-weight: 800; letter-spacing: .08em; color: var(--cyan); }
.plan .price { font-size: 40px; font-weight: 800; }
.plan .price small { font-size: 15px; color: var(--muted); font-weight: 500; }
.plan .note { font-size: 14px; color: var(--muted); min-height: 21px; }
.plan .btn { margin-top: auto; }
.offer { background: var(--panel); border: 1px solid var(--cyan); border-radius: var(--radius); padding: 16px 20px; margin-bottom: 24px; }
.fine { font-size: 13px; color: var(--muted); }
.summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin: 20px 0; }
.summary .card { padding: 18px; }
.summary .k { font-size: 13px; color: var(--muted); }
.summary .v { font-size: 22px; font-weight: 800; }

/* Design Lab tools frame */
main.full { max-width: none; padding: 12px 0 0; }
/* Same width and height as the tab row on the Library and Check pages, so the row stays put between tools. */
.labbar { display: flex; justify-content: space-between; align-items: flex-end; gap: 4px 16px; flex-wrap: wrap; max-width: 1240px; width: 100%; margin: 0 auto; padding: 0 24px; }
.labbar .tabs { border-bottom: 0; margin: 0; }
.labbar::after { content: ""; flex-basis: 100%; border-bottom: 1px solid var(--line); margin-top: -1px; }
.labbar > .fine { padding-bottom: 10px; }
.ver { color: var(--cyan); letter-spacing: .04em; }
.lab { display: block; width: 100%; height: 900px; border: 0; background: #000; }
/* The tools fill the window under the tab row and scroll inside their frame, so their preview can stay in view. */
body.labmode { height: 100vh; height: 100dvh; min-height: 0; overflow: hidden; }
body.labmode .foot { display: none; }
body.labmode main.full { flex: 1; min-height: 0; display: flex; flex-direction: column; }
body.labmode .lab { flex: 1; height: auto; min-height: 0; }

/* profile and garage */
.narrow { max-width: 760px; margin: 0 auto; }
.opt { font-weight: 500; color: var(--muted); font-size: 13px; }
.grid3 { display: grid; grid-template-columns: 2fr 1.2fr 1fr; gap: 12px; }
.photo { display: flex; gap: 18px; align-items: center; margin-bottom: 8px; }
.avatar { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; background: var(--panel-2); border: 2px solid var(--cyan); display: inline-grid; place-items: center; font-weight: 800; color: var(--cyan); flex: none; }
.avatar.lg { width: 96px; height: 96px; font-size: 30px; }
.who { display: flex; align-items: center; gap: 14px; padding: 16px 18px; margin: 12px 0 4px; flex-wrap: wrap; }
.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pills button { font: inherit; font-weight: 700; background: var(--panel-2); color: var(--text); border: 1px solid var(--line); border-radius: var(--radius-field); padding: 8px 16px; cursor: pointer; }
.pills button:hover { border-color: var(--cyan); }
.pills button.on { background: var(--cyan); color: var(--black); border-color: var(--cyan); }
.garage { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; margin-top: 24px; align-items: start; }
.machine-form { grid-column: 1 / -1; max-width: 760px; border-color: var(--cyan); }
.machine h3 { margin: 8px 0 10px; }
.machine dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 0 0 16px; font-size: 14px; }
.machine dt { color: var(--muted); }
.machine dd { margin: 0; }
.mtype { display: inline-block; font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; padding: 2px 10px; border-radius: 6px; background: var(--magenta); color: var(--black); }

/* Tools sections */
.toolnav { margin: 0 0 24px; }
/* Second row on DXF Library pages: Browse, Monograms, Art */
.subtabs { display: flex; gap: 6px; flex-wrap: wrap; margin: -12px 0 20px; }
.subtabs a { font-weight: 600; font-size: 14px; color: var(--muted); text-decoration: none; padding: 6px 12px; border-radius: var(--radius-field); border: 1px solid transparent; }
.subtabs a:hover { color: var(--cyan); }
.subtabs a.on { color: var(--white); border-color: var(--line); background: var(--panel); }
.labbar.sub { align-items: center; padding-top: 8px; padding-bottom: 4px; }
.labbar.sub::after { display: none; }
.labbar.sub .subtabs { margin: 0; }
.labbar.sub > .fine { padding-bottom: 0; }
main > .toolnav:first-child { margin-top: -20px; }
.labbar .toolnav { margin: 0; }
.pill { font-weight: 700; background: var(--panel-2); color: var(--text); border: 1px solid var(--line); border-radius: var(--radius-field); padding: 8px 16px; text-decoration: none; }
.pill:hover { border-color: var(--cyan); color: var(--text); }
.pill.on { background: var(--cyan); color: var(--black); border-color: var(--cyan); }

/* DXF library */
.badge { display: inline-block; font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; padding: 2px 8px; border-radius: 6px; margin: 0 6px 4px 0; border: 1px solid var(--line); color: var(--muted); }
.badge.tested { background: var(--magenta); border-color: var(--magenta); color: var(--black); }
.badge.ready { border-color: var(--cyan); color: var(--cyan); }
.badge.warn { border-color: var(--magenta); color: var(--magenta); }
.libsearch { display: grid; grid-template-columns: 1fr 220px auto auto; gap: 12px; align-items: center; margin: 20px 0; }
.libsearch .check { margin: 0; white-space: nowrap; }
.libgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 16px; }
.libcard { display: block; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; color: var(--text); text-decoration: none; }
.libcard:hover { border-color: var(--cyan); color: var(--text); }
.thumb { display: flex; align-items: center; justify-content: center; aspect-ratio: 1; background: #050505; border-radius: 8px; margin-bottom: 10px; overflow: hidden; }
.thumb img { max-width: 90%; max-height: 90%; }
.libname { font-weight: 700; font-size: 14px; word-break: break-word; }
.atable { width: 100%; border-collapse: collapse; margin-top: 16px; font-size: 14px; }
.atable th, .atable td { text-align: left; padding: 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.aitems { display: grid; gap: 16px; }
.aitem { display: grid; grid-template-columns: 180px 1fr; gap: 20px; padding: 18px; margin-bottom: 16px; }
.aitem .thumb { width: 180px; }
.aitem .row input { width: auto; }
.photos { display: grid; gap: 8px; }
.photos img { width: 180px; border-radius: 8px; }

/* Admin: customers */
.crmgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; margin-bottom: 20px; }
.crmbars { padding: 16px; }
.crmbars .k { font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.bar { display: grid; grid-template-columns: 110px 1fr 36px; align-items: center; gap: 8px; font-size: 13px; margin: 4px 0; }
.bar span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar i { display: block; height: 10px; border-radius: 5px; background: var(--cyan); }
.bar b { text-align: right; }
.crmfilters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 8px 0; }
.crmfilters input[type=search] { flex: 1 1 260px; width: auto; }
.crmfilters select { width: auto; }
.crmfilters .check { margin: 0; }
.tablewrap { overflow-x: auto; }
.atable.crm td { vertical-align: top; }

dialog { background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; width: min(520px, calc(100vw - 32px)); }
dialog::backdrop { background: rgba(0,0,0,.7); }

/* The preview stays in view while the controls on the left scroll */
@media (min-width: 901px) { .workspace > .stage { position: sticky; top: 16px; } }

@media (max-width: 900px) {
  .auth, .workspace, .plans { grid-template-columns: 1fr; }
  .grid2, .grid3 { grid-template-columns: 1fr; }
  .libsearch { grid-template-columns: 1fr; }
  .aitem { grid-template-columns: 1fr; }
  main { padding: 24px 16px 40px; }
  .top { padding: 10px 16px 0; gap: 8px; }
  .brand img { height: 30px; }
  .brand span { font-size: 18px; }
  nav { width: 100%; gap: 20px; overflow-x: auto; scrollbar-width: none; padding: 4px 0 10px; }
  nav::-webkit-scrollbar { display: none; }
  .labbar { padding: 0 16px; }
  main > .toolnav:first-child { margin-top: -12px; }
  .labbar > .fine { padding: 0 0 8px; font-size: 12px; }
}

/* ---------- Dream Shop ---------- */
.dream { max-width: 1400px; margin: 0 auto; padding: 0 16px 40px; }
.ds-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 12px; }
.ds-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.ds-cols { display: grid; grid-template-columns: minmax(280px, 360px) 1fr; gap: 16px; align-items: start; }
.ds-left, .ds-right { display: grid; gap: 16px; min-width: 0; }
.dream .card { padding: 18px; }
.dream label { display: block; font-size: 14px; color: var(--muted); margin: 8px 0 0; }
.dream select, .dream input[type=number] { width: 100%; margin-top: 4px; }
.ds-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; }
.ds-presets { display: flex; flex-wrap: wrap; gap: 6px; }
.ds-presets .pill { padding: 6px 12px; font-size: 13px; cursor: pointer; font-family: inherit; }
.ds-photo input { margin-top: 6px; }
.ds-thumb { width: 100%; border-radius: 8px; margin-top: 8px; }
.ds-tools { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.ds-tools span:last-child { display: flex; gap: 6px; }
#dsPlan { width: 100%; height: auto; max-height: 70vh; touch-action: none; user-select: none; display: block; }
.ds-floor { fill: #0b0c0e; }
.ds-grid { stroke: #1c1f23; stroke-width: .6; }
.ds-grid.major { stroke: #2a2e33; stroke-width: 1; }
.ds-wall { fill: none; stroke: var(--text); stroke-width: 4; }
.ds-door { stroke: var(--cyan); stroke-width: 7; }
.ds-dim { fill: var(--muted); font-size: 10px; }
.ds-item { cursor: grab; }
.ds-item .ds-body { fill: #1f3440; stroke: var(--cyan); stroke-width: 1.5; }
.ds-item .ds-clear { fill: rgba(1, 174, 226, .06); stroke: rgba(1, 174, 226, .45); stroke-width: 1; stroke-dasharray: 4 3; }
.ds-item text { fill: var(--white); font-weight: 700; pointer-events: none; }
.ds-item.tight .ds-body { fill: #3d3210; stroke: #f5b81b; }
.ds-item.bad .ds-body { fill: #3a0a22; stroke: var(--magenta); }
.ds-item.sel .ds-body { stroke: var(--white); stroke-width: 3; }
.ds-legend { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; }
.ds-legend .k { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 4px; vertical-align: -1px; border: 1px solid var(--cyan); background: #1f3440; }
.ds-legend .k.tight { background: #3d3210; border-color: #f5b81b; }
.ds-legend .k.bad { background: #3a0a22; border-color: var(--magenta); }
.ds-money { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.ds-list { list-style: none; padding: 0; margin: 0 0 8px; font-size: 14px; }
.ds-list li, .ds-sum { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; }
.ds-list li { border-bottom: 1px solid var(--line); }
.ds-list em { color: var(--muted); font-style: normal; font-size: 12px; }
.ds-sum.total { border-top: 1px solid var(--line); margin-top: 4px; padding-top: 8px; font-size: 18px; }
.ds-sum b.neg { color: var(--magenta); }
.ds-cta { text-align: right; margin: 0; }
.ds-print { display: none; }
@media (max-width: 900px) { .ds-cols { grid-template-columns: 1fr; } .ds-cta { text-align: left; } }
@media print {
  body > *:not(main), .dream > *:not(.ds-print) { display: none !important; }
  main { padding: 0 !important; }
  .ds-print { display: block !important; color: #000; background: #fff; font: 12pt/1.4 system-ui, sans-serif; }
  .ds-print h1 { font-size: 22pt; } .ds-print h2 { font-size: 14pt; margin-top: 18pt; }
  .ds-print table { border-collapse: collapse; width: 100%; } .ds-print td, .ds-print th { border: 1px solid #999; padding: 4pt 6pt; text-align: left; }
  .ds-print svg { width: 100%; max-height: 5in; }
  .ds-print .ds-floor { fill: #fff; } .ds-print .ds-grid { stroke: #ddd; } .ds-print .ds-wall { stroke: #000; }
  .ds-print .ds-item .ds-body { fill: #e8f6fb; stroke: #01AEE2; } .ds-print .ds-item text { fill: #000; } .ds-print .ds-dim { fill: #333; }
}
main.wide { max-width: none; }
.linkbtn { font: inherit; font-weight: 700; color: var(--cyan); background: none; border: 0; padding: 0; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.dream input[type=text] { width: 100%; margin-top: 4px; }
@media print { .ds-print img.ds-poster { display: block; width: 100%; max-height: 10in; object-fit: contain; margin: 0 auto; } }
@media print { .ds-print .ds-clear { display: none; } }
