/* Local preview and isolated counter styles; no external fonts or assets. */
.ct-preview { margin: 0; background: #f5f7fa; color: #182438; font: 16px/1.55 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
.ct-page { max-width: 1060px; margin: 0 auto; padding: 36px 24px 48px; }
.ct-site-name { font-size: 18px; font-weight: 800; text-decoration: none; color: #233852; letter-spacing: -.7px; }
.ct-site-name span { font-weight: 400; color: #64748b; }
.ct-page-heading h1 { font-size: clamp(30px, 4vw, 42px); line-height: 1.15; letter-spacing: -1.2px; margin: 26px 0 12px; }
.ct-page-heading > p { color: #596779; max-width: 680px; margin: 0 0 26px; }
.ct-app, .ct-app * { box-sizing: border-box; }
.ct-app { background: #111d30; color: #edf2f9; border-radius: 18px; padding: 20px; box-shadow: 0 12px 38px #15283e13; font: 16px/1.4 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; isolation: isolate; overflow-wrap: anywhere; }
.ct-app [hidden] { display: none !important; }
.ct-app button, .ct-app input { font: inherit; }
.ct-app button { cursor: pointer; touch-action: manipulation; min-height: 44px; border: 1px solid #42526a; border-radius: 8px; padding: 9px 14px; background: #26364d; color: #edf2f9; font-weight: 600; line-height: 1.2; }
.ct-app button:hover { background: #354861; }
.ct-app button:disabled { cursor: default; opacity: .42; }
.ct-app :focus-visible { outline: 3px solid #8bc4ff; outline-offset: 3px; }
.ct-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 20px; }
.ct-counter-count { color: #b4c1d3; font-size: 13px; white-space: nowrap; }
.ct-toolbar-actions { display: flex; gap: 7px; }
.ct-toolbar button { display: flex; align-items: center; justify-content: center; gap: 7px; font-size: 13px; background: transparent; }
.ct-toolbar button span { font-size: 22px; line-height: 1; }
.ct-app .ct-add { background: #edf3fb; color: #172b46; border-color: transparent; }
.ct-app .ct-add:hover { background: #d4e5f8; }
.ct-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.ct-grid[data-count="1"] { grid-template-columns: minmax(0, 440px); justify-content: center; }
.ct-grid[data-count="2"], .ct-grid[data-count="4"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ct-card { display: flex; flex-direction: column; min-width: 0; background: var(--counter-color, #2563eb); color: white; padding: 20px 18px 8px; border: 1px solid #ffffff25; border-radius: 12px; }
.ct-card button { color: inherit; }
.ct-card :focus-visible { outline-color: white; }
.ct-app .ct-name { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; padding: 7px 0 12px; background: transparent; border: 0; border-bottom: 1px solid #ffffff55; border-radius: 0; font-size: 21px; }
.ct-name [data-name] { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ct-name svg { flex: none; opacity: .8; }
.ct-app .ct-name:hover { background: #ffffff0c; }
.ct-app .ct-value { display: grid; place-content: center; width: 100%; min-height: 135px; margin: 6px 0 10px; border: 0; padding: 0; background: transparent; font-size: 100px; font-weight: 750; line-height: 1.15; letter-spacing: -4px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ct-app .ct-value:hover { background: #ffffff0c; }
.ct-app .ct-value[data-digits="4"] { font-size: 66px; letter-spacing: -2px; }
.ct-app .ct-value[data-digits="5"] { font-size: 54px; letter-spacing: -2px; }
.ct-app .ct-value[data-digits="6"], .ct-app .ct-value[data-digits="7"] { font-size: 43px; letter-spacing: -1px; }
.ct-grid[data-count="1"] .ct-value { font-size: 134px; min-height: 172px; }
.ct-grid[data-count="1"] .ct-value[data-digits="4"] { font-size: 92px; }
.ct-grid[data-count="1"] .ct-value[data-digits="5"] { font-size: 74px; }
.ct-grid[data-count="1"] .ct-value[data-digits="6"], .ct-grid[data-count="1"] .ct-value[data-digits="7"] { font-size: 65px; }
.ct-count-controls { display: grid; grid-template-columns: 1fr 1.65fr; gap: 10px; margin-top: auto; }
.ct-count-controls button { min-height: 62px; font-size: 35px; padding: 6px; }
.ct-app .ct-minus { background: #00000024; border-color: #ffffff55; }
.ct-app .ct-minus:hover { background: #00000040; }
.ct-app .ct-plus { background: #fff; color: #15263e; border-color: transparent; }
.ct-app .ct-plus:hover { background: #edf3fb; }
.ct-card-actions { display: flex; justify-content: space-between; gap: 8px; padding-top: 3px; }
.ct-card-actions button { background: transparent; border: 0; font-size: 12px; padding: 8px 4px; }
.ct-card-actions button:hover { background: #ffffff12; }
.ct-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 18px; }
.ct-save-status { font-size: 12px; color: #aab8cc; }
.ct-total { display: flex; align-items: baseline; gap: 10px; font-size: 12px; color: #aab8cc; }
.ct-total output { font-size: 23px; font-weight: 700; font-variant-numeric: tabular-nums; color: #edf2f9; }
.ct-dialog { width: calc(100% - 32px); max-width: 430px; padding: 26px; border: 0; border-radius: 14px; background: #f8fafc; color: #1c2c43; box-shadow: 0 15px 80px #0006; }
.ct-dialog::backdrop { background: #06101abf; }
.ct-dialog form { margin: 0; }
.ct-dialog h2 { font-size: 22px; line-height: 1.3; margin: 0 0 20px; }
.ct-dialog p { font-size: 15px; color: #4d6079; }
.ct-field { display: block; font-size: 14px; font-weight: 600; margin: 18px 0; }
.ct-field input { display: block; width: 100%; min-width: 0; min-height: 46px; margin-top: 8px; padding: 10px 12px; border: 1px solid #8392a6; border-radius: 6px; background: white; color: #182a44; font-size: 18px; }
.ct-field input[type=number] { font-size: 26px; }
.ct-colors { border: 0; padding: 0; margin: 20px 0 0; min-width: 0; }
.ct-colors legend { font-size: 14px; font-weight: 600; padding: 0; margin-bottom: 12px; }
.ct-presets { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 9px; }
.ct-swatch { display: block; position: relative; min-width: 0; cursor: pointer; }
.ct-swatch input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; z-index: 1; }
.ct-swatch span { display: grid; place-items: center; background: var(--swatch-color); color: #fff; height: 44px; border-radius: 7px; border: 1px solid #00000020; }
.ct-swatch input:checked + span { box-shadow: 0 0 0 2px #f8fafc, 0 0 0 4px #273c56; }
.ct-swatch input:checked + span::after { content: '✓'; font-size: 24px; font-weight: 750; line-height: 1; }
.ct-swatch input:focus-visible + span { outline: 3px solid #172b46; outline-offset: 4px; }
.ct-dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 25px; }
.ct-dialog button { background: white; color: #263c58; border: 1px solid #8b9aaf; font-size: 14px; }
.ct-dialog button:hover { background: #e7edf4; }
.ct-app .ct-primary { background: #365e8a; color: white; border-color: #365e8a; }
.ct-app .ct-primary:hover { background: #284b72; }
.ct-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.ct-hint { padding: 0 4px; margin-top: 12px; color: #5a697d; font-size: 13px; }
.ct-promo { display: flex; align-items: center; justify-content: space-between; gap: 28px; border-top: 1px solid #d7e0eb; margin-top: 30px; padding-top: 28px; }
.ct-promo-label { font-size: 10px; letter-spacing: 1.6px; font-weight: 750; color: #61748d; }
.ct-promo h2 { font-size: 20px; line-height: 1.3; margin: 7px 0 8px; }
.ct-promo p { font-size: 14px; color: #59697e; margin: 0; max-width: 540px; }
.ct-store-links { display: flex; flex-wrap: wrap; gap: 8px; flex: none; }
.ct-store-links a { display: inline-flex; gap: 10px; padding: 11px 16px; border: 1px solid #b2c3d7; border-radius: 8px; color: #294d76; background: #edf3f9; font-weight: 650; font-size: 14px; text-decoration: none; }
.ct-store-links a:hover { background: #e1ebf6; }
.ct-local-note { font-size: 11px; color: #718096; margin-top: 30px; }
.ct-no-script { padding: 12px; background: white; color: #182a44; }
@media (max-width: 850px) {
  .ct-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ct-promo { align-items: flex-start; flex-direction: column; gap: 18px; }
}
@media (max-width: 620px) {
  .ct-page { padding: 24px 14px 32px; }
  .ct-page-heading h1 { margin-top: 22px; }
  .ct-page-heading > p { font-size: 15px; }
  .ct-app { padding: 12px; border-radius: 12px; }
  .ct-toolbar { flex-direction: column; align-items: flex-start; gap: 10px; margin-bottom: 14px; }
  .ct-toolbar-actions { display: grid; grid-template-columns: 1fr 1fr 1.4fr; gap: 5px; width: 100%; }
  .ct-toolbar button { font-size: 12px; gap: 4px; padding: 8px 5px; white-space: nowrap; }
  .ct-grid { gap: 10px; }
  .ct-card { padding: 13px 10px 5px; border-radius: 9px; }
  .ct-app .ct-name { font-size: 16px; gap: 6px; padding-bottom: 9px; }
  .ct-name svg { width: 13px; height: 13px; }
  .ct-app .ct-value { min-height: 100px; font-size: 66px; letter-spacing: -2px; margin: 4px 0 8px; }
  .ct-app .ct-value[data-digits="4"] { font-size: 42px; letter-spacing: -1px; }
  .ct-app .ct-value[data-digits="5"] { font-size: 34px; letter-spacing: -1px; }
  .ct-app .ct-value[data-digits="6"], .ct-app .ct-value[data-digits="7"] { font-size: 27px; letter-spacing: -1px; }
  .ct-grid[data-count="1"] .ct-value { font-size: 120px; min-height: 150px; }
  .ct-grid[data-count="1"] .ct-value[data-digits="4"] { font-size: 85px; }
  .ct-grid[data-count="1"] .ct-value[data-digits="5"] { font-size: 68px; }
  .ct-grid[data-count="1"] .ct-value[data-digits="6"], .ct-grid[data-count="1"] .ct-value[data-digits="7"] { font-size: 54px; }
  .ct-count-controls { grid-template-columns: 1fr 1.25fr; gap: 6px; }
  .ct-count-controls button { min-height: 52px; font-size: 31px; padding: 5px; }
  .ct-card-actions { gap: 0; }
  .ct-card-actions button { font-size: 10px; padding: 8px 2px; }
  .ct-footer { gap: 8px; margin-top: 12px; }
  .ct-save-status { font-size: 10px; }
  .ct-total { gap: 6px; font-size: 11px; }
  .ct-total output { font-size: 19px; }
  .ct-dialog { padding: 22px; }
  .ct-presets { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 350px) {
  .ct-page { padding-left: 9px; padding-right: 9px; }
  .ct-app { padding: 9px; }
  .ct-toolbar button { font-size: 11px; }
  .ct-card { padding-left: 8px; padding-right: 8px; }
  .ct-app .ct-value[data-digits="7"] { font-size: 24px; }
  .ct-grid[data-count="1"] .ct-value[data-digits="7"] { font-size: 44px; }
}
