/* croqi app, the tech pack (js/techpack.js): an A4 landscape sheet on the desk, printed alone as a PDF.
   The sheet is paper in both themes, like every drawing in croqi: white, ink lines, nothing in accent. */

.techpack { display: grid; grid-template-rows: auto minmax(0, 1fr); min-height: 100%; }

.tp-bar {
  display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 0 12px;
  border-bottom: 1px solid var(--line); background: var(--surface);
}
.tp-bar h1 { margin: 0; font-size: 15px; font-weight: 600; }
.tp-part { overflow: hidden; color: var(--ink-muted); font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.tp-version { display: flex; align-items: center; gap: 8px; color: var(--ink-muted); font-size: 12px; }
.tp-version select {
  height: 30px; padding: 0 8px; border: 1px solid var(--line-strong); border-radius: 6px; background: var(--raise);
}
.tp-kept { margin: 0 0 0 auto; color: var(--ink-muted); font-size: 12px; }

.tp-desk { overflow: auto; padding: 24px; background: var(--void); }

/* the sheet: 297 x 210 mm at 96 dpi, the size it prints at */
.tp-sheet {
  --tp-ink: #1a1c1e; --tp-muted: #5d646b; --tp-rule: #1a1c1e;
  display: grid; grid-template-rows: auto auto minmax(0, 1fr);
  width: 1123px; height: 794px; margin: 0 auto; padding: 28px;
  background: #fff; color: var(--tp-ink); box-shadow: 0 2px 18px #0006;
}

.tp-head { display: grid; grid-template-columns: 150px minmax(0, 1fr); border: 1.5px solid var(--tp-rule); }
.tp-logo { position: relative; display: grid; place-items: center; min-height: 92px; padding: 10px; border-right: 1.5px solid var(--tp-rule); }
.tp-logo img { max-width: 100%; max-height: 72px; object-fit: contain; }
.tp-logo .btn { border-style: dashed; border-color: #1a1c1e40; background: transparent; color: var(--tp-muted); }
.tp-logo-x {
  position: absolute; top: 4px; right: 4px; display: grid; place-items: center; width: 22px; height: 22px;
  border: 0; border-radius: 4px; background: #1a1c1e14; color: var(--tp-muted); opacity: 0;
}
.tp-logo:hover .tp-logo-x, .tp-logo-x:focus-visible { opacity: 1; }

.tp-fields { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); margin: 0; }
.tp-field { display: grid; align-content: start; gap: 2px; padding: 7px 10px 6px; border-left: 1px solid #1a1c1e33; }
.tp-field:nth-child(6n + 1) { border-left: 0; }
.tp-field:nth-child(-n + 6) { border-bottom: 1px solid #1a1c1e33; }
.tp-label {
  width: 100%; min-width: 0; padding: 1px 4px; margin: 0 -4px; border: 1px solid transparent; border-radius: 3px; background: transparent;
  color: var(--tp-muted); font: 500 11px/1.3 var(--font-mono); letter-spacing: .08em; text-transform: uppercase;
}
.tp-strip-title { flex: 1; max-width: 60%; }
.tp-strip-title .tp-label { color: var(--tp-ink); font-weight: 600; letter-spacing: .1em; }
.tp-label:hover { border-color: #1a1c1e26; }
.tp-label:focus { outline: none; border-color: #2d6aa0; background: #2d6aa00d; }
.tp-label::placeholder { color: #1a1c1e59; }
.tp-input { display: block; resize: none; overflow: hidden; line-height: 1.35; }
.tp-input, .tp-side textarea {
  width: 100%; min-width: 0; padding: 2px 4px; margin: 0 -4px; border: 1px solid transparent; border-radius: 3px;
  background: transparent; color: var(--tp-ink); font-size: 13px; font-weight: 500;
}
.tp-input:hover, .tp-side textarea:hover { border-color: #1a1c1e26; }
.tp-input:focus, .tp-side textarea:focus { outline: none; border-color: #2d6aa0; background: #2d6aa00d; }

.tp-strip {
  display: flex; justify-content: space-between; margin-top: 10px; padding: 6px 10px;
  border: 1.5px solid var(--tp-rule); font: 600 11px/1.2 var(--font-mono); letter-spacing: .1em; text-transform: uppercase;
}

.tp-body { display: grid; grid-template-columns: minmax(0, 1fr) 220px; min-height: 0; border: 1.5px solid var(--tp-rule); border-top: 0; }
.tp-views { display: grid; grid-auto-columns: minmax(0, 1fr); grid-auto-flow: column; gap: 16px; min-height: 0; padding: 16px; }
.tp-view { display: grid; grid-template-rows: minmax(0, 1fr) auto; min-height: 0; margin: 0; }
.tp-drawing { display: grid; place-items: center; min-height: 0; }
.tp-drawing svg { display: block; width: 100%; height: 100%; }
.tp-caption { padding-top: 8px; color: var(--tp-muted); font: 500 11px/1 var(--font-mono); letter-spacing: .08em; text-align: center; text-transform: uppercase; }
.tp-empty { align-self: center; margin: 0; color: var(--tp-muted); font-size: 13px; text-align: center; }

.tp-side { display: grid; grid-template-rows: auto minmax(0, 1fr); gap: 6px; padding: 12px 14px; border-left: 1px solid #1a1c1e33; }
.tp-side-head { display: flex; }
.tp-side textarea { height: 100%; resize: none; font-weight: 400; line-height: 1.5; }

/* the PDF: the sheet alone, edge to edge on A4 landscape */
@media print {
  @page { size: A4 landscape; margin: 0; }
  body:has(#techpack:not([hidden])) .shell > :not(.main),
  body:has(#techpack:not([hidden])) .main > :not(#techpack),
  body:has(#techpack:not([hidden])) .toast,
  .tp-bar, .tp-logo .btn, .tp-logo-x { display: none !important; }
  body:has(#techpack:not([hidden])) .shell,
  body:has(#techpack:not([hidden])) .main { display: block; height: auto; overflow: visible; background: #fff; }
  .techpack { display: block; }
  .tp-desk { padding: 0; overflow: visible; background: #fff; }
  .tp-sheet { width: 297mm; height: 210mm; padding: 9mm; box-shadow: none; break-after: page; }
  .tp-sheet + .tp-sheet { margin-top: 0; }
  .tp-sheet:last-of-type { break-after: auto; }
  .tp-hint, .tp-note-x { display: none !important; }
  .tp-note-text { border-color: transparent; }
  .tp-note-text::placeholder { color: transparent; }
  .tp-canvas { cursor: default; }
  .tp-input, .tp-label, .tp-side textarea { border-color: transparent; }
  .tp-input::placeholder, .tp-label::placeholder, .tp-side textarea::placeholder { color: transparent; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* the picker (/app/tech-pack): the parts that have a flat, as cards */
.tp-picker { padding: 24px 28px; }
.tp-picker h1 { margin: 0 0 4px; font-size: 20px; font-weight: 600; letter-spacing: -.01em; }
.tp-picker-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; margin-top: 18px; }
.tp-picker-grid > .tp-empty { grid-column: 1 / -1; color: var(--ink-muted); text-align: left; }
.tp-pick {
  display: grid; gap: 8px; padding: 8px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--surface); color: var(--ink); text-decoration: none;
  transition: border-color 120ms ease;
}
.tp-pick:hover { border-color: var(--accent); }
.tp-pick-thumb { position: relative; display: block; aspect-ratio: 4 / 3; border-radius: 6px; background: #fff; overflow: hidden; }
.tp-pick-thumb img { position: absolute; inset: 6%; width: 88%; height: 88%; object-fit: contain; }
.tp-pick-name { overflow: hidden; padding: 0 4px 2px; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }

/* the view pages (js/techpack-pages.js): a thin band, the strip, one view filling the page, red callouts */
@media screen { .tp-sheet + .tp-sheet { margin-top: 24px; } }
.tp-thin {
  display: grid; grid-template-columns: 110px minmax(0, 1fr) minmax(0, 2fr) 120px; min-height: 46px;
  border: 1.5px solid var(--tp-rule);
}
.tp-thin > * { display: grid; align-content: center; gap: 1px; padding: 4px 10px; border-left: 1px solid #1a1c1e33; min-width: 0; }
.tp-thin > :first-child { border-left: 0; place-items: center; }
.tp-thin-logo img { max-width: 100%; max-height: 30px; object-fit: contain; }
.tp-thin-label { color: var(--tp-muted); font: 500 11px/1.3 var(--font-mono); letter-spacing: .08em; text-transform: uppercase; }
.tp-thin-value { overflow: hidden; font-size: 13px; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.tp-thin-page { justify-items: end; font: 600 11px/1.2 var(--font-mono); letter-spacing: .1em; text-transform: uppercase; }
.tp-hint { color: var(--tp-muted); font-weight: 500; letter-spacing: .04em; text-transform: none; font-family: var(--font-ui); }

.tp-canvas { position: relative; min-height: 0; border: 1.5px solid var(--tp-rule); border-top: 0; cursor: crosshair; }
.tp-canvas-drawing { position: absolute; inset: 18px 140px; display: grid; place-items: center; pointer-events: none; }
.tp-canvas-drawing svg { display: block; width: 100%; height: 100%; }
.tp-lines { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.tp-lines line { stroke: #d43d22; stroke-width: 1.2; }
.tp-notes { position: absolute; inset: 0; }
.tp-dot {
  position: absolute; width: 6px; height: 6px; margin: -3px 0 0 -3px; border-radius: 50%; background: #d43d22; cursor: move;
}
.tp-dot::before { content: ""; position: absolute; inset: -7px; }
.tp-note { position: absolute; display: flex; align-items: center; gap: 2px; cursor: move; }
.tp-note-text {
  padding: 2px 5px; border: 1px dashed transparent; border-radius: 3px; background: #ffffffd9;
  color: var(--tp-ink); font: 500 12px/1.3 var(--font-ui); cursor: text;
}
.tp-note:hover .tp-note-text { border-color: #d43d2266; }
.tp-note-text:focus { outline: none; border-style: solid; border-color: #2d6aa0; background: #fff; }
.tp-note-text::placeholder { color: #1a1c1e59; }
.tp-note-x {
  display: grid; place-items: center; width: 18px; height: 18px; padding: 0; border: 0; border-radius: 3px;
  background: #1a1c1e14; color: var(--tp-muted); font-size: 13px; line-height: 1; opacity: 0;
}
.tp-note:hover .tp-note-x, .tp-note-x:focus-visible { opacity: 1; }

/* the detail pages (js/techpack-details.js): one region drawn large, its measurements beside it */
.tp-detail-body { display: grid; grid-template-columns: minmax(0, 1fr) 300px; min-height: 0; border: 1.5px solid var(--tp-rule); border-top: 0; }
.tp-detail-drawing { position: relative; display: grid; place-items: center; min-height: 0; padding: 24px; overflow: hidden; }
.tp-detail-drawing svg { display: block; width: 100%; height: 100%; }
.tp-detail-drawing:not(.is-choosing) svg * { vector-effect: non-scaling-stroke; }   /* enlarged, the lines keep their weight */
.tp-detail-drawing.is-choosing { cursor: crosshair; }
.tp-detail-drawing.is-choosing svg { opacity: .75; pointer-events: none; }
.tp-detail-hint { position: absolute; top: 12px; left: 0; right: 0; margin: 0; text-align: center; font-size: 12px; }
.tp-marquee { position: absolute; display: none; border: 1.5px dashed #d43d22; background: #d43d2212; pointer-events: none; }
.tp-detail-tools { display: flex; gap: 6px; font-family: var(--font-ui); letter-spacing: 0; text-transform: none; }
.tp-chip {
  height: 22px; padding: 0 9px; border: 1px solid #1a1c1e33; border-radius: 99px; background: #fff;
  color: var(--tp-muted); font: 500 12px/1 var(--font-ui);
}
.tp-chip:hover { border-color: #1a1c1e66; color: var(--tp-ink); }
.tp-chip[aria-pressed="true"] { border-color: var(--tp-ink); background: var(--tp-ink); color: #fff; }
.tp-chip-danger:hover { border-color: #d43d22; color: #d43d22; }

.tp-measures { display: grid; grid-template-rows: auto auto 1fr; align-content: start; gap: 8px; padding: 14px; border-left: 1px solid #1a1c1e33; }
.tp-measures-head { color: var(--tp-muted); font: 500 11px/1.3 var(--font-mono); letter-spacing: .08em; text-transform: uppercase; }
.tp-measure-list { display: grid; gap: 2px; }
.tp-measure { display: grid; grid-template-columns: minmax(0, 1fr) 76px 18px; align-items: center; gap: 6px; border-bottom: 1px solid #1a1c1e1a; }
.tp-measure-name, .tp-measure-value {
  width: 100%; min-width: 0; padding: 4px; border: 1px solid transparent; border-radius: 3px; background: transparent;
  color: var(--tp-ink); font-size: 13px;
}
.tp-measure-value { font-weight: 600; text-align: right; }
.tp-measure-name:hover, .tp-measure-value:hover { border-color: #1a1c1e26; }
.tp-measure-name:focus, .tp-measure-value:focus { outline: none; border-color: #2d6aa0; background: #2d6aa00d; }
.tp-measure-name::placeholder, .tp-measure-value::placeholder { color: #1a1c1e4d; font-weight: 400; }
.tp-measure:hover .tp-note-x { opacity: 1; }
.tp-add-row { justify-self: start; align-self: start; }

.tp-add-page { display: grid; grid-template-columns: 1fr 1fr; grid-auto-flow: column; grid-template-rows: auto auto; justify-items: center; gap: 6px 24px; width: 1123px; margin: 24px auto 8px; padding: 22px; border: 1.5px dashed var(--line-strong); border-radius: 10px; }
.tp-add-page .quiet { margin: 0; }

@media print {
  .tp-add-page, .tp-detail-tools, .tp-add-row, .tp-detail-hint, .tp-measure .tp-note-x { display: none !important; }
  .tp-measure-name::placeholder, .tp-measure-value::placeholder { color: transparent; }
  .tp-detail-drawing.is-choosing svg { opacity: 1; }
  .tp-measure:has(.tp-measure-name:placeholder-shown):has(.tp-measure-value:placeholder-shown) { display: none; }
}

/* the thread page (js/techpack-threads.js): Mavi's "İplik şeması", one row per thread */
.tp-thread-body { display: grid; align-content: start; gap: 10px; min-height: 0; padding-top: 14px; }
.tp-threads { border: 1.5px solid var(--tp-rule); }
.tp-thread-top { padding: 6px 10px; border-bottom: 1.5px solid var(--tp-rule); }
.tp-thread-note { display: block; width: calc(100% + 8px); font-size: 13px; text-align: right; }
.tp-thread-row { position: relative; display: grid; grid-template-columns: 26% 1fr 16% 22%; }
.tp-thread-row + .tp-thread-row { border-top: 1px solid var(--tp-rule); }
.tp-thread-cell { display: grid; align-content: center; gap: 2px; min-height: 46px; padding: 6px 10px; border-left: 1px solid var(--tp-rule); }
.tp-thread-cell:first-child { border-left: 0; }
.tp-thread-head .tp-thread-cell { min-height: 0; justify-items: center; }
.tp-thread-head .tp-label { text-align: center; }
.tp-thread-name, .tp-thread-use, .tp-thread-value, .tp-thread-note {
  min-width: 0; margin: 0 -4px; padding: 1px 4px; border: 1px solid transparent; border-radius: 3px; background: transparent; color: var(--tp-ink);
}
.tp-thread-name { font-size: 13px; font-weight: 600; }
.tp-thread-use { display: block; resize: none; overflow: hidden; color: #d43d22; font-size: 12px; line-height: 1.35; }
.tp-thread-value { font-size: 13px; font-weight: 500; text-align: center; }
.tp-thread-row :is(input, textarea):hover, .tp-thread-note:hover { border-color: #1a1c1e26; }
.tp-thread-row :is(input, textarea):focus, .tp-thread-note:focus { outline: none; border-color: #2d6aa0; background: #2d6aa00d; }
.tp-thread-row ::placeholder, .tp-thread-note::placeholder { color: #1a1c1e4d; font-weight: 400; }
.tp-thread-use::placeholder { color: #d43d2266; }
.tp-thread-row > .tp-note-x { position: absolute; top: 50%; right: -26px; translate: 0 -50%; }
.tp-thread-row:hover > .tp-note-x { opacity: 1; }

@media print {
  .tp-thread-row ::placeholder, .tp-thread-note::placeholder { color: transparent; }
  .tp-thread-top:has(.tp-thread-note:placeholder-shown) { display: none; }
  .tp-thread-row > .tp-note-x { display: none; }
}
