/* Terrass Calculator – puhas frontend-stiil (scope: #tc-app) */

#tc-app {
  --tc-border: #e3e6ea;
  --tc-bg: #ffffff;
  --tc-muted: #6b7280;
  --tc-accent: #2271b1;
  --tc-accent-hover: #135e96;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: #1f2329;
  max-width: 980px;
  margin: 0 auto;
  background: #fafbfc;
  border: 1px solid var(--tc-border);
  border-radius: 12px;
  padding: 22px;
  line-height: 1.45;
}

#tc-app h3 {
  margin: 0 0 16px;
  font-size: 20px;
  font-weight: 700;
}
#tc-app h4 {
  margin: 26px 0 10px;
  font-size: 15px;
  font-weight: 600;
  color: #374151;
  letter-spacing: .01em;
}

/* ---- sisendid ---- */
#tc-app label {
  font-size: 13px;
  font-weight: 500;
  color: #4b5563;
}
#tc-app input[type="number"],
#tc-app select {
  margin-top: 4px;
  padding: 9px 11px;
  border: 1px solid #cdd2d9;
  border-radius: 8px;
  font-size: 14px;
  background: #fff;
  transition: border-color .15s, box-shadow .15s;
  box-sizing: border-box;
}
#tc-app input[type="number"]:focus,
#tc-app select:focus {
  outline: none;
  border-color: var(--tc-accent);
  box-shadow: 0 0 0 3px rgba(34,113,177,.15);
}
#tc-app input[type="checkbox"] { accent-color: var(--tc-accent); }

/* prussiinfo riba */
#tc_pruss_info {
  font-size: 13px;
}

/* ---- nupud ---- */
#tc-app #tc_run,
#tc-app #tc_add {
  background: var(--tc-accent);
  color: #fff;
  border: none;
  padding: 10px 22px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
}
#tc-app #tc_run:hover,
#tc-app #tc_add:hover { background: var(--tc-accent-hover); }

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

/* ---- 3D tööriistariba ---- */
#tc-app #tc_canvas {
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
}

/* ---- hoiatused ---- */
#tc_warn:not(:empty) {
  background: #fff8e6;
  border-left: 4px solid #f5b50a;
  border-radius: 6px;
  padding: 10px 14px;
  font-size: 13px;
  color: #7a5b00;
}
#tc_warn ul { margin: 0; padding-left: 18px; }

/* ---- KOKKU ribad ---- */
#tc-app .tc-total-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 16px;
  border-top: 2px solid #eef0f2;
  padding-top: 14px;
}
#tc-app .tc-total-bar strong { font-size: 15px; }
#tc-app #tc_total,
#tc-app #tc_total_top { font-weight: 700; color: #111; }

/* =====================================================
   MATERJALIDE NIMEKIRI (puhas kaardistiil)
   ===================================================== */
.tc-mat {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 12px 14px;
  border: 1px solid var(--tc-border);
  border-radius: 10px;
  background: #fff;
  margin-bottom: 10px;
  transition: box-shadow .15s, border-color .15s;
}
.tc-mat:hover {
  border-color: #c9ced6;
  box-shadow: 0 2px 8px rgba(0,0,0,.05);
}
.tc-mat.tc-unmapped { background: #fff6f6; border-color: #f3c9c9; }
.tc-mat.tc-off { opacity: .5; }

.tc-mat__img {
  flex: 0 0 60px;
  width: 60px; height: 60px;
  border-radius: 8px;
  overflow: hidden;
  background: #f1f3f5;
  display: flex; align-items: center; justify-content: center;
}
.tc-mat__img img { width: 100%; height: 100%; object-fit: cover; display: block; }

.tc-mat__info { flex: 1; min-width: 0; }
.tc-mat__name {
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 2px;
}
.tc-mat__name a { color: #1f2329; text-decoration: none; }
.tc-mat__name a:hover { color: var(--tc-accent); text-decoration: underline; }
.tc-mat__name .tc-unmapped-txt { color: #c0392b; font-weight: 500; }
.tc-mat__meta { font-size: 12px; color: var(--tc-muted); }
.tc-mat__price { font-size: 13px; color: #374151; margin-top: 3px; }

.tc-mat__controls {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  min-width: 150px;
}
.tc-mat__inc {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; color: #4b5563;
}
.tc-mat__qty {
  width: 130px;
  text-align: right;
  padding: 7px 9px;
  border: 1px solid #cdd2d9;
  border-radius: 7px;
  font-size: 14px;
}
.tc-mat__total {
  font-weight: 700;
  font-size: 14px;
  color: #111;
  min-height: 18px;
}

/* mobiil */
@media (max-width: 560px) {
  #tc-app { padding: 14px; }
  .tc-mat { flex-wrap: wrap; }
  .tc-mat__controls { min-width: 0; width: 100%; align-items: stretch; }
  .tc-mat__qty { width: 100%; }
  #tc-app #tc_canvas { height: 320px; }
}
