/* Terrassikalkulaator 2 – lisastiilid (põhi: tc-style.css, scope #tc-app.tc2) */

#tc-app.tc2 { max-width: 1080px; }
#tc-app.tc2 *, #tc-app.tc2 *::before, #tc-app.tc2 *::after { box-sizing: border-box; }
#tc-app.tc2 input[type="number"],
#tc-app.tc2 select { width: 100%; }

/* ---- kujundi valik ---- */
.tc2-shapes {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}
#tc-app .tc2-shape {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 14px 10px 12px;
  background: #fff;
  border: 2px solid var(--tc-border);
  border-radius: 12px;
  cursor: pointer;
  font: inherit; color: #1f2329; text-align: center;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
#tc-app .tc2-shape:hover { border-color: #b7c4d3; box-shadow: 0 2px 10px rgba(0,0,0,.06); }
#tc-app .tc2-shape:focus-visible { outline: 3px solid rgba(34,113,177,.35); outline-offset: 2px; }
#tc-app .tc2-shape.is-active { border-color: var(--tc-accent); background: #f2f7fc; box-shadow: 0 0 0 3px rgba(34,113,177,.12); }
.tc2-shape svg { width: 72px; height: 50px; margin-bottom: 4px; }
.tc2-shape svg rect, .tc2-shape svg path { fill: #eef5fc; stroke: #1f6fd0; stroke-width: 2.5; stroke-linejoin: round; }
.tc2-shape svg circle { fill: #fff; stroke: #1f6fd0; stroke-width: 2; }
.tc2-shape__t { font-weight: 700; font-size: 15px; }
.tc2-shape__d { font-size: 12px; color: var(--tc-muted); }

/* ---- mõõdud + plaan ---- */
.tc2-top {
  display: grid;
  grid-template-columns: minmax(0, 360px) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}
.tc2-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  align-items: end;
}
.tc2-fields + .tc2-fields { margin-top: 12px; }
.tc2-span2 { grid-column: 1 / -1; }

/* väljad kujundi järgi */
#tc-app.tc2 .tc2-f-rect, #tc-app.tc2 .tc2-f-L, #tc-app.tc2 .tc2-f-free { display: none; }
#tc-app.tc2[data-shape="rect"] .tc2-f-rect,
#tc-app.tc2[data-shape="L"] .tc2-f-L,
#tc-app.tc2[data-shape="free"] .tc2-f-free { display: block; }

.tc2-freehelp {
  background: #f2f7fc; border-left: 3px solid var(--tc-accent); border-radius: 4px;
  padding: 9px 12px; font-size: 13px; color: #27425c; line-height: 1.45;
}
#tc_pruss_info {
  background: #f0f7ea; border-left: 3px solid #3B6D11; border-radius: 4px;
  padding: 8px 12px; font-size: 13px; color: #27500A;
}

.tc2-plan { min-width: 0; }
.tc2-plan__head {
  display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap;
  font-size: 13px; color: #374151; margin-bottom: 6px; min-height: 30px;
}
.tc2-plan__tools { display: flex; gap: 6px; flex-wrap: wrap; }
#tc-app .tc2-plan__tools button,
#tc-app .tc2-cam button {
  padding: 5px 12px; border: 1px solid #cdd2d9; border-radius: 6px; background: #fff;
  cursor: pointer; font-size: 12px; color: #1f2329; line-height: 1.4;
}
#tc-app .tc2-plan__tools button:hover,
#tc-app .tc2-cam button:hover { background: #f3f4f6; }
#tc-app #tc2_close { background: var(--tc-accent); border-color: var(--tc-accent); color: #fff; font-weight: 600; }

.tc2-plan__wrap {
  position: relative;
  border: 1px solid var(--tc-border); border-radius: 10px; overflow: hidden; background: #fbfcfd;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
#tc_plan { display: block; width: 100%; height: 340px; touch-action: none; user-select: none; -webkit-user-select: none; }
#tc-app.tc2[data-shape="free"] #tc_plan { height: 480px; cursor: crosshair; }
#tc-app.tc2 .tc2-len-edit {
  position: absolute; width: 84px; margin: 0; padding: 5px 8px; text-align: center;
  font-size: 14px; font-weight: 600; border: 2px solid var(--tc-accent); border-radius: 6px; background: #fff;
  box-shadow: 0 4px 14px rgba(0,0,0,.18);
}
.tc2-plan__hint { font-size: 12px; color: var(--tc-muted); margin-top: 6px; line-height: 1.45; }
.tc2-plan__msg { font-size: 13px; color: #c0392b; min-height: 18px; margin-top: 2px; }

/* vaba kujund: plaan üle kogu laiuse, väljad selle all neljas veerus */
#tc-app.tc2[data-shape="free"] .tc2-top { grid-template-columns: minmax(0, 1fr); }
#tc-app.tc2[data-shape="free"] .tc2-plan { order: -1; }
#tc-app.tc2[data-shape="free"] .tc2-form { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 16px; align-items: start; }
#tc-app.tc2[data-shape="free"] .tc2-fields + .tc2-fields { margin-top: 0; }

.tc2-summary { margin: 16px 0 0; font-size: 15px; }

/* ---- 3D ---- */
.tc2-layers { display: flex; gap: 6px 14px; flex-wrap: wrap; align-items: center; margin: 8px 0 10px; }
.tc2-cam { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin: 0 0 8px; }
.tc2-cam span { font-size: 11px; color: #888; }
.tc2-canvas-wrap { position: relative; }
#tc-app.tc2 #tc_canvas {
  width: 100%; height: 480px; display: block;
  border: 1px solid #eee; border-radius: 10px; background: #f0f4f8; touch-action: none;
}
.tc2-canvas-empty {
  position: absolute; inset: 0; display: none; align-items: center; justify-content: center;
  padding: 24px; text-align: center; font-size: 15px; color: var(--tc-muted);
  background: #f0f4f8; border: 1px solid #eee; border-radius: 10px;
}
.tc2-note { font-size: 13px; color: var(--tc-muted); margin: 6px 0; }

#tc-app.tc2 #tc_print {
  background: #fff; border: 1px solid #cdd2d9; border-radius: 8px; padding: 8px 16px; font-size: 13px; cursor: pointer;
}

/* ---- kitsam ekraan ---- */
@media (max-width: 820px) {
  .tc2-top { grid-template-columns: minmax(0, 1fr); }
  #tc-app.tc2[data-shape="free"] .tc2-form { grid-template-columns: minmax(0, 1fr); }
  #tc-app.tc2[data-shape="free"] .tc2-fields + .tc2-fields { margin-top: 12px; }
}
@media (max-width: 560px) {
  .tc2-shapes { gap: 8px; }
  #tc-app .tc2-shape { padding: 10px 4px 8px; }
  .tc2-shape svg { width: 52px; height: 36px; }
  .tc2-shape__t { font-size: 13px; }
  .tc2-shape__d { display: none; }
  #tc_plan { height: 300px; }
  #tc-app.tc2[data-shape="free"] #tc_plan { height: 400px; }
  #tc-app.tc2 #tc_canvas { height: 340px; }
  .tc2-cam span { display: none; }
}
