/* WordPress adapter, scoped to counter elements. The surrounding theme stays intact. */
.umitapp-counter-embed {
  container: umit-counter / inline-size;
  width: 100%;
  max-width: 100%;
  margin: 24px 0;
  text-align: left;
}
.ct-app.ct-embedded {
  width: 100%;
  max-width: 100%;
  margin: 0;
  text-align: left;
  letter-spacing: normal;
}
.ct-app.ct-embedded :is(button, input) {
  font-family: inherit;
  text-transform: none;
  text-decoration: none;
  box-shadow: none;
}
.ct-app.ct-embedded button:not(.ct-value) { margin: 0; letter-spacing: normal; }
.ct-app.ct-embedded button { background-image: none; }
.ct-app.ct-embedded .ct-card { margin: 0; }
.ct-app.ct-embedded .ct-dialog form { margin: 0; padding: 0; }
.ct-app.ct-embedded .ct-dialog h2 {
  margin: 0 0 20px;
  padding: 0;
  border: 0;
  color: #1c2c43;
  font: 700 22px/1.3 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: normal;
  text-transform: none;
}
.ct-app.ct-embedded .ct-dialog p { margin: 15px 0; }
.ct-app.ct-embedded .ct-field input { max-width: 100%; }
.ct-app.ct-embedded .ct-colors { background: transparent; }
.ct-app.ct-embedded .ct-swatch { margin: 0; }
.ct-app.ct-embedded .ct-swatch input { appearance: auto; padding: 0; border: 0; }
.umitapp-counter-embed .ct-hint {
  padding: 0 4px;
  margin: 12px 0;
  font: 13px/1.55 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #5a697d;
}

/* Adapt to article width as well as viewport width. */
@container umit-counter (max-width: 850px) {
  .ct-app.ct-embedded .ct-grid:not([data-count="1"]) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@container umit-counter (max-width: 620px) {
  .ct-app.ct-embedded { padding: 12px; border-radius: 12px; }
  .ct-app.ct-embedded .ct-toolbar { flex-direction: column; align-items: flex-start; gap: 10px; margin-bottom: 14px; }
  .ct-app.ct-embedded .ct-toolbar-actions { display: grid; grid-template-columns: 1fr 1fr 1.4fr; gap: 5px; width: 100%; }
  .ct-app.ct-embedded .ct-toolbar button { font-size: 12px; gap: 4px; padding: 8px 5px; white-space: nowrap; }
  .ct-app.ct-embedded .ct-grid { gap: 10px; }
  .ct-app.ct-embedded .ct-card { padding: 13px 10px 5px; border-radius: 9px; }
  .ct-app.ct-embedded .ct-name { font-size: 16px; gap: 6px; padding-bottom: 9px; }
  .ct-app.ct-embedded .ct-name svg { width: 13px; height: 13px; }
  .ct-app.ct-embedded .ct-value { min-height: 100px; font-size: 66px; letter-spacing: -2px; margin: 4px 0 8px; }
  .ct-app.ct-embedded .ct-value[data-digits="4"] { font-size: 42px; letter-spacing: -1px; }
  .ct-app.ct-embedded .ct-value[data-digits="5"] { font-size: 34px; letter-spacing: -1px; }
  .ct-app.ct-embedded .ct-value[data-digits="6"],
  .ct-app.ct-embedded .ct-value[data-digits="7"] { font-size: 27px; letter-spacing: -1px; }
  .ct-app.ct-embedded .ct-grid[data-count="1"] .ct-value { font-size: 120px; min-height: 150px; }
  .ct-app.ct-embedded .ct-grid[data-count="1"] .ct-value[data-digits="4"] { font-size: 85px; }
  .ct-app.ct-embedded .ct-grid[data-count="1"] .ct-value[data-digits="5"] { font-size: 68px; }
  .ct-app.ct-embedded .ct-grid[data-count="1"] .ct-value[data-digits="6"],
  .ct-app.ct-embedded .ct-grid[data-count="1"] .ct-value[data-digits="7"] { font-size: 54px; }
  .ct-app.ct-embedded .ct-count-controls { grid-template-columns: 1fr 1.25fr; gap: 6px; }
  .ct-app.ct-embedded .ct-count-controls button { min-height: 52px; font-size: 31px; padding: 5px; }
  .ct-app.ct-embedded .ct-card-actions { gap: 0; }
  .ct-app.ct-embedded .ct-card-actions button { font-size: 10px; padding: 8px 2px; }
  .ct-app.ct-embedded .ct-footer { gap: 8px; margin-top: 12px; }
  .ct-app.ct-embedded .ct-save-status { font-size: 10px; }
  .ct-app.ct-embedded .ct-total { gap: 6px; font-size: 11px; }
  .ct-app.ct-embedded .ct-total output { font-size: 19px; }
  .ct-app.ct-embedded .ct-dialog { padding: 22px; }
  .ct-app.ct-embedded .ct-presets { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@container umit-counter (max-width: 350px) {
  .ct-app.ct-embedded { padding: 9px; }
  .ct-app.ct-embedded .ct-toolbar button { font-size: 11px; }
  .ct-app.ct-embedded .ct-card { padding-left: 8px; padding-right: 8px; }
  .ct-app.ct-embedded .ct-value[data-digits="7"] { font-size: 24px; }
  .ct-app.ct-embedded .ct-grid[data-count="1"] .ct-value[data-digits="7"] { font-size: 44px; }
}
