.object-counter { padding-bottom: 32px; overflow-wrap: anywhere; font-size: max(16px,1rem); }
body[data-page="object-counter"] .header-actions { margin-inline-start: auto; flex-wrap: wrap; min-width: 0; max-width: 100%; }
.object-counter .card { margin-bottom: 20px; border-radius: 18px; min-width: 0; }
.object-counter .card-head { background: var(--soft); border-radius: 18px 18px 0 0; align-items: center; gap: 12px; }
.object-counter .card-head h2 { margin: 0; min-width: 0; }
.object-counter :is(.card-body,.field,.counter-editor,.counter-settings) { min-width: 0; }
.object-counter :is(.card,[tabindex],.field) { scroll-margin-block: 100px 24px; }
.counter-symbols { position: absolute; width: 0; height: 0; overflow: hidden; }
.counter-icon { width: 22px; height: 22px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.counter-steps { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,14rem),1fr)); gap: 12px; margin-block: 24px; }
.counter-steps a { display: grid; grid-template-columns: auto minmax(0,1fr); gap: 4px 12px; padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--text); text-decoration: none; }
.counter-steps a > span { grid-row: span 2; align-self: center; font-weight: 800; color: var(--muted); }
.counter-steps small { color: var(--muted); line-height: 1.5; }
.counter-steps a:hover { border-color: var(--green); background: var(--green-soft); }
.counter-support { padding: 16px; border-inline-start: 4px solid var(--green); border-radius: 12px; background: var(--soft); line-height: 1.7; }
.object-counter .helper { color: var(--muted); font-size: max(16px,1rem); line-height: 1.7; }
.object-counter .field > label { font-size: max(16px,1rem); line-height: 1.6; }
.object-counter [hidden] { display: none !important; }
.object-counter :is(input,select,button) { font: inherit; min-height: 48px; }
.object-counter input[type="number"], .object-counter select { width: 100%; min-width: 0; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px; }
.object-counter :focus-visible { outline: 3px solid var(--green); outline-offset: 3px; }
.counter-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-block: 16px; }
.object-counter .button { display: inline-flex; justify-content: center; align-items: center; gap: 8px; max-width: 100%; min-width: 0; min-height: 48px; height: auto; line-height: 1.5; white-space: normal; text-align: center; }
.object-counter .button > span { min-width: 0; }
.counter-consent { display: flex; align-items: flex-start; gap: 12px; font-weight: 700; line-height: 1.7; }
.counter-consent input { flex: 0 0 26px; width: 26px; min-height: 26px; height: 26px; margin-top: 3px; accent-color: var(--green); }
.counter-file { position: relative; overflow: hidden; }
.counter-file input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.counter-file:has(input:disabled) { opacity: .55; cursor: not-allowed; }
.counter-file:focus-within { outline: 3px solid var(--green); outline-offset: 3px; }
.counter-workspace { display: grid; grid-template-columns: minmax(0,1fr) minmax(16rem,.62fr); gap: 24px; align-items: start; }
.counter-settings { padding: 20px; border: 1px solid var(--line); border-radius: 14px; background: var(--soft); }
.counter-settings h3 { display: flex; align-items: center; gap: 10px; margin-top: 0; }
.counter-settings > .button { width: 100%; }
.counter-help { margin-block: 16px; border-block-start: 1px solid var(--line); }
.counter-help summary { padding-block: 14px; min-height: 48px; cursor: pointer; font-weight: 700; line-height: 1.6; }
.counter-region { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; margin-block: 16px; }
.counter-region .field { min-width: 0; }
.counter-warning { padding: 14px; color: #72490e; background: #fff3d9; border: 1px solid #dcb576; border-radius: 12px; }
.counter-metrics { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,5.5rem),1fr)); gap: 10px; }
.counter-metrics > div { display: flex; flex-direction: column; justify-content: space-between; gap: 8px; padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--soft); }
.counter-metrics .counter-tally { border-color: var(--green); background: var(--green-soft); }
.counter-metrics span { line-height: 1.5; color: var(--muted); }
.counter-metrics strong { font-size: 2.2rem; line-height: 1.2; }
.counter-edit-actions { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,8rem),1fr)); }
.counter-stage { display: flex; justify-content: center; align-items: center; padding: 12px; min-height: 240px; border: 1px solid var(--line); border-radius: 16px; background: #18251f; }
#counter-canvas { display: block; width: auto; height: auto; max-width: 100%; max-height: 65vh; max-height: min(65svh,42rem); cursor: crosshair; }
#counter-empty { padding: 20px; text-align: center; color: #f0f7f3; line-height: 1.7; }
#counter-empty > .counter-icon { width: 48px; height: 48px; }
#counter-empty a { display: inline-block; padding-block: 12px; color: #b6f1ce; }
.counter-legend { display: flex; flex-wrap: wrap; gap: 10px 18px; margin-top: 14px; color: var(--muted); line-height: 1.6; }
.counter-legend span { display: inline-flex; gap: 8px; align-items: center; }
.counter-legend i { width: 16px; height: 16px; flex-shrink: 0; border: 2px solid; background: #18251f; }
.counter-key-ai { border-color: #62f0a2 !important; }
.counter-key-manual { border-color: #ffb53d !important; border-radius: 50%; }
.counter-key-region { border-color: #ffda80 !important; border-style: dashed !important; }
#counter-video { display: block; max-width: 100%; max-height: 60vh; border-radius: 14px; }
.object-counter [aria-pressed] { border: 2px solid var(--line); }
.object-counter [aria-pressed="true"] { border-color: var(--green); background: var(--green-soft); color: var(--text); box-shadow: inset 0 -3px var(--green); }
#counter-status { padding: 16px; border: 1px solid var(--line); background: var(--soft); border-radius: 12px; line-height: 1.7; }
#counter-status:empty { display: none; }
#counter-status[data-error="true"] { color: #a5311b; border-color: currentColor; font-weight: 700; }
[data-theme="dark"] .counter-warning { color: #ffda9d; background: #3b2e19; border-color: #9f7e45; }
[data-theme="dark"] #counter-status[data-error="true"] { color: #ffb79b; }
@media (max-width: 980px) {
  .counter-workspace { grid-template-columns: minmax(0,1fr); }
}
@media (max-width: 600px) {
  body[data-page="object-counter"] .header-inner > .header-pill { display: none; }
  .counter-actions > .button { flex: 1 1 140px; }
  .object-counter .page-intro { grid-template-columns: minmax(0,1fr); }
  .object-counter .page-intro > img { display: none; }
  .counter-settings { padding: 16px; }
}
@media (forced-colors: active) {
  .object-counter [aria-pressed="true"] { outline: 3px solid Highlight; }
}
