:root {
  --bg-primary: #f5f5f7;
  --bg-card: #ffffff;
  --bg-input: #ffffff;
  --text-primary: #1a1a1a;
  --text-secondary: #666666;
  --text-muted: #5f6368;
  --accent: #0066ff;
  --border: #d0d0d0;
  --border-focus: #0066ff;
  --shadow-card: 0 8px 30px rgba(0, 0, 0, .06);
  --radius: 12px;
  --radius-sm: 8px;
  --transition: .2s ease;
  --success: #16a34a;
  --success-soft: rgba(22, 163, 74, .10);
  --danger: #dc2626;
  --danger-soft: rgba(220, 38, 38, .10);
  --warn: #b45309;
  --warn-soft: rgba(245, 158, 11, .14);
  --bg-embed: #ffffff;
  --calc-card-width: 840px;
  --input-suffix-padding: 44px;
}

html[data-theme="dark"] {
  --bg-primary: #0a0a0a;
  --bg-card: rgb(34, 37, 49);
  --bg-input: #111118;
  --text-primary: #e0e0e0;
  --text-secondary: #aeb7c7;
  --text-muted: #aeb7c7;
  --accent: #0066ff;
  --border: #2a2a3a;
  --border-focus: #0066ff;
  --shadow-card: 0 8px 30px rgba(0, 0, 0, .35);
  --success: #4ade80;
  --success-soft: rgba(74, 222, 128, .12);
  --danger: #f87171;
  --danger-soft: rgba(248, 113, 113, .12);
  --warn: #fcd34d;
  --warn-soft: rgba(245, 158, 11, .16);
  --bg-embed: rgb(34, 37, 49);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  transition: background .3s ease;
}
body.embedded { background: var(--bg-embed); }
body.embedded .card { width: 100%; max-width: none; box-shadow: none; }
body.embedded .wrapper { min-height: 0; padding: 0; }
body.embedded .topControls { display: none; }
.wrapper { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 20px 16px; }
.column { display: flex; flex-direction: column; align-items: center; gap: 12px; width: 100%; }
.topControls { display: flex; gap: 8px; align-self: flex-end; }
.controlBtn {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 34px;
  padding: 0 12px;
  gap: 6px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
  font: inherit;
  font-size: 13px;
}
.controlBtn:hover { background: var(--accent); color: #fff; border-color: var(--accent); }
.card {
  width: min(100%, var(--calc-card-width));
  background: var(--bg-card);
  border: none;
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 22px 26px;
}
.miniCard { display: none; }
.card.collapsed { cursor: pointer; transition: transform .2s ease, box-shadow .2s ease; }
.card.collapsed:hover { transform: translateY(-3px); box-shadow: var(--shadow-card), 0 0 22px rgba(0, 102, 255, .14); }
.card.collapsed .miniCard {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 22px 24px;
  min-height: 128px;
  user-select: none;
}
.card.collapsed .body { display: none; }
.mcIcon { display: flex; align-items: center; justify-content: center; width: 48px; height: 48px; color: #4da6ff; opacity: .8; flex: none; }
.mcIcon svg { width: 48px; height: 48px; }
.mcTitle {
  white-space: pre-line;
  text-align: left;
  font-size: 28px;
  font-weight: 900;
  line-height: 1.2;
  letter-spacing: .05em;
  background: linear-gradient(to bottom, #ffffff, #888888);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
html[data-theme="light"] .mcTitle { background: none; -webkit-text-fill-color: #2a2a2a; color: #2a2a2a; }
.body { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; align-items: stretch; }
.col { min-width: 0; display: flex; flex-direction: column; }
.col-results { border-left: 1px solid var(--border); padding-left: 26px; }
.fieldGroup { display: flex; flex-direction: column; gap: 6px; margin-bottom: 13px; }
.label { font-size: 11.5px; font-weight: 500; color: var(--text-secondary); text-transform: uppercase; letter-spacing: .05em; }
.input, .select {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  color: var(--text-primary);
  font-size: 15px;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
  font-family: inherit;
}
.input:focus, .select:focus { border-color: var(--border-focus); box-shadow: 0 0 0 3px rgba(0, 102, 255, .1); }
input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
input[type=number] { -moz-appearance: textfield; appearance: textfield; }
.select { cursor: pointer; }
.row { display: flex; gap: 8px; }
.row > * { flex: 1; }
.inputWithSuffix { position: relative; }
.inputWithSuffix .input { padding-right: var(--input-suffix-padding); }
.suffix { position: absolute; right: 13px; top: 50%; transform: translateY(-50%); font-size: 12px; color: var(--text-muted); pointer-events: none; }
.result { margin-top: 0; }
.kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.kpi { background: var(--bg-input); border: 1px solid transparent; border-radius: var(--radius-sm); padding: 10px 12px; }
.lines { font-size: 13px; }
.line { display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px dashed var(--border); }
.line:last-child { border-bottom: none; }
.line .lk { color: var(--text-secondary); }
.line .lv { font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; }
.disc { background: var(--warn-soft); color: var(--warn); border-radius: var(--radius-sm); padding: 10px 12px; font-size: 12px; line-height: 1.5; }

@media (max-width: 720px) {
  .body { grid-template-columns: 1fr; gap: 4px; }
  .col-results { border-left: none; padding-left: 0; border-top: 1px solid var(--border); padding-top: 16px; margin-top: 8px; }
}

@media (max-width: 520px) {
  body.embedded .wrapper { padding: 8px; }
  .card { padding: 16px 15px; }
  .card.collapsed .miniCard { min-height: 128px; gap: 12px; }
  .mcIcon, .mcIcon svg { width: 40px; height: 40px; }
  .mcTitle { font-size: 16px; }
}

body.card-collapsed .mcIcon,
body.card-collapsed .mcIcon svg { width: 48px; height: 48px; }
body.embedded.card-collapsed .wrapper { padding: 0; min-height: 0; }
body.embedded.card-collapsed .card.collapsed {
  position: fixed;
  inset: 0;
  width: auto;
  max-width: none;
  border: none;
  border-radius: 0;
  box-shadow: none;
  padding: 0;
}
body.embedded.card-collapsed .card.collapsed .miniCard { height: 100%; min-height: 0; padding: 24px; gap: 8px; }
.mcTitle {
  font-family: var(--strapi-label-font-family, 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif);
  font-size: var(--strapi-label-font-size, 28px);
  font-weight: var(--strapi-label-font-weight, 700);
}
.mcTitle[data-custom-color="1"] {
  background: none;
  -webkit-text-fill-color: var(--strapi-label-color);
  color: var(--strapi-label-color);
}
