/* CamOS shared controls and info tooltips (camos-controls.js). Switch, checkbox and radio group: OpenAI Apps SDK UI's,
   in cui-switch.css, cui-checkbox.css and cui-radio-group.css (cui-choice.js). */
@layer theme,camos;
@layer camos{
.cam-info{display:inline-grid;place-items:center;flex:none;width:24px;height:24px;min-width:24px;min-height:24px;margin:0;padding:0;border:0;border-radius:var(--radius-full);background:none;color:var(--color-text-tertiary);cursor:pointer;transition:background-color .15s,color .15s}
.cam-info svg{width:16px;height:16px;display:block}
.cam-info:hover,.cam-info[data-state$=open]{background:var(--color-background-secondary-soft);color:var(--color-text)}
.cam-info:focus-visible{outline:3px solid var(--color-ring);outline-offset:1px}
@media(prefers-reduced-motion:reduce){.cam-info{transition:none}}

/* Field (the plain-JS twin of components/ui/field.tsx): <div class="cui-field"><label class="cui-label">Name</label>
   <div class="cui-input" …><input class="cui-input-field" …></div><p class="cui-field-hint">…</p><p class="cui-field-error" hidden></p></div>
   (camos-controls.js links the label, hint and error to the control). The text field itself is OpenAI Apps SDK UI's Input:
   public/cui-input.css and cui-input.js. */
/* Number input steppers (cui-number.js): the kit Input with − and + kit Buttons as adornments. data-cui-number="compact"
   is the fixed-width box for a settings-row control. */
html .cui-input[data-cui-number=compact]{flex:none;width:136px}

/* Password: the Caps Lock note and the new-password strength meter (camos-controls.js). */
html .cui-pw-caps{margin:0}
html .cui-pw-strength{display:flex;align-items:center;gap:8px}
html .cui-pw-strength[hidden],html .cui-pw-caps[hidden]{display:none}
html .cui-pw-bars{display:flex;flex:1;gap:4px}
html .cui-pw-bars>i{flex:1;height:4px;border-radius:var(--radius-full);background:var(--color-background-primary-ghost-hover);transition:background-color .15s}
html .cui-pw-strength[data-level="1"] .cui-pw-bars>i:nth-child(-n+1){background:var(--color-background-danger-solid)}
html .cui-pw-strength[data-level="2"] .cui-pw-bars>i:nth-child(-n+2){background:var(--color-background-warning-solid)}
html .cui-pw-strength:is([data-level="3"],[data-level="4"]) .cui-pw-bars>i:nth-child(-n+4){background:var(--color-background-success-solid)}
html .cui-pw-strength[data-level="3"] .cui-pw-bars>i:nth-child(4){background:var(--color-background-primary-ghost-hover)}
html .cui-pw-level{width:64px;color:var(--color-text-secondary);font-size:var(--font-text-xs-size);line-height:var(--font-text-xs-line-height);text-align:end;font-variant-numeric:tabular-nums}

html .cui-field-group{display:flex;flex-direction:column;gap:20px;width:100%}
html .cui-field{display:flex;flex-direction:column;gap:8px;width:100%;min-width:0;margin:0;border:0;padding:0}
html .cui-field[data-orientation=horizontal]{flex-direction:row;align-items:center}
html :is(.cui-label,.cui-field-label){display:flex;align-items:center;gap:8px;width:fit-content;margin:0;color:var(--color-text);font-size:var(--font-text-sm-size);font-weight:var(--font-weight-medium);line-height:var(--font-text-sm-line-height);user-select:none}
html .cui-field-hint{margin:0;color:var(--color-text-tertiary);font-size:var(--font-text-sm-size);font-weight:var(--font-weight-normal);line-height:var(--font-text-sm-line-height);text-align:start}
html .cui-field>.cui-field-hint:nth-last-child(2){margin-top:-4px}
html .cui-field-error{margin:0;color:var(--color-text-danger);font-size:var(--font-text-sm-size);font-weight:var(--font-weight-normal);line-height:var(--font-text-sm-line-height)}
html .cui-field-error:empty{display:none}
html .cui-field[data-invalid=true] :is(.cui-label,.cui-field-label,.cui-field-hint){color:var(--color-text-danger)}
html .cui-field:has(:disabled) :is(.cui-label,.cui-field-label),html .cui-label:has(:disabled){opacity:.5}

/* Code box (cui-otp.js): the same box as React's components/ui/input-otp.tsx (shadcn Input OTP); change both together.
   Joined slots per group, 40px (48px on touch) with 16px digits; .cui-otp-lg 48x56 with 28px digits for a code screen. */
html .cui-otp{display:flex;align-items:center;gap:8px;width:fit-content;max-width:100%;direction:ltr}
html .cui-otp[data-disabled]{opacity:.5}
html .cui-otp-group{display:flex;align-items:center;border-radius:var(--radius-md)}
html .cui-otp .cui-otp-slot{position:relative;box-sizing:border-box;width:40px;height:40px;min-width:0;margin:0;padding:0;border:1px solid var(--input-outline-border-color);border-left-width:0;border-radius:0;background:transparent;color:var(--color-text);box-shadow:none;outline:none;font:inherit;font-size:var(--font-text-md-size);font-weight:var(--font-weight-semibold);font-variant-numeric:tabular-nums;line-height:1;text-align:center;caret-color:var(--color-ring);-webkit-appearance:none;appearance:none;transition:color .15s,background-color .15s,border-color .15s,box-shadow .15s}
html .cui-otp .cui-otp-slot:first-child{border-left-width:1px;border-radius:var(--radius-md) 0 0 var(--radius-md)}
html .cui-otp .cui-otp-slot:last-child{border-radius:0 var(--radius-md) var(--radius-md) 0}
html .cui-otp .cui-otp-slot:focus{z-index:1;border-color:var(--color-ring);box-shadow:0 0 0 3px var(--color-ring)}
html .cui-otp .cui-otp-slot:disabled{cursor:not-allowed}
html .cui-otp[aria-invalid=true] .cui-otp-group{box-shadow:0 0 0 3px var(--color-border-danger-surface)}
html .cui-otp[aria-invalid=true] .cui-otp-slot{border-color:var(--color-border-danger-outline)}
html .cui-otp[aria-invalid=true]{animation:cuiOtpShake .35s var(--transition-ease-basic)}
@keyframes cuiOtpShake{20%,60%{transform:translateX(-5px)}40%,80%{transform:translateX(5px)}}
html .cui-otp-sep{display:flex;align-items:center;color:var(--color-text-secondary)}
html .cui-otp-sep svg{width:16px;height:16px}
@media (pointer:coarse){html .cui-otp .cui-otp-slot{width:44px;height:48px}}
html .cui-otp-lg .cui-otp-group{border-radius:var(--radius-xl)}
html .cui-otp-lg .cui-otp-slot{width:48px;height:56px;font-size:var(--font-heading-lg-size);line-height:var(--font-heading-lg-line-height)}
html .cui-otp-lg .cui-otp-slot:first-child{border-radius:var(--radius-xl) 0 0 var(--radius-xl)}
html .cui-otp-lg .cui-otp-slot:last-child{border-radius:0 var(--radius-xl) var(--radius-xl) 0}
@media (max-width: 379px){html .cui-otp-lg .cui-otp-slot{width:40px;height:48px;font-size:var(--font-heading-md-size);line-height:var(--font-heading-md-line-height)}}
@media (prefers-reduced-motion:reduce){html .cui-otp[aria-invalid=true]{animation:none}html .cui-otp .cui-otp-slot{transition:none}}

/* Buttons on plain pages: OpenAI Apps SDK UI's Button, public/cui-button.css + cui-button.js (and cui-text-link.css). */

/* Listbox look for the plain-JS Autocomplete (public/camos-autocomplete.js; twin of components/ui/listbox.tsx and
   autocomplete.tsx, same values). The kit's menu surface, 32px rows (44px on touch), 12px corners, an instant hover wash.
   Dropdowns are OpenAI Apps SDK UI's Select (public/camos-select.js), not this. */
html .cui-listbox{box-sizing:border-box;display:flex;flex-direction:column;min-width:0;max-height:min(24rem,70vh);margin:0;padding:4px;border:0;border-radius:var(--radius-2xl);background:var(--color-surface-elevated);box-shadow:var(--shadow),var(--shadow-hairline);color:var(--color-text);font-size:var(--font-text-sm-size);line-height:var(--font-text-sm-line-height);text-align:start}
html .cui-listbox-item{position:relative;box-sizing:border-box;display:flex;align-items:center;gap:8px;width:100%;min-height:32px;margin:0;padding:6px 10px;border:0;border-radius:var(--radius-xl);background:transparent;color:var(--color-text);font:inherit;text-align:start;cursor:default;user-select:none}
html .cui-listbox-item:is([data-highlighted],[aria-selected=true]:not([data-checkable])){background:var(--color-background-primary-ghost-hover)}
@media(hover:hover){html .cui-listbox-item:hover:not([aria-disabled=true]){background:var(--color-background-primary-ghost-hover)}}
html .cui-listbox-item[aria-disabled=true]{opacity:.5;pointer-events:none}
html .cui-listbox-item[data-checkable]{padding-inline-end:32px}
html .cui-listbox-item>.cui-listbox-label{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
html :is(.cui-listbox)[hidden]{display:none}
html .cui-autocomplete-popup{position:fixed;z-index:10000;animation:cuiListboxIn .12s var(--cubic-enter) both}
@keyframes cuiListboxIn{from{opacity:0;transform:scale(.97)}}
@media(prefers-reduced-motion:reduce){html .cui-autocomplete-popup{animation:none}}
@media(pointer:coarse){html .cui-listbox-item{min-height:44px;font-size:var(--font-text-sm-size);line-height:var(--font-text-sm-line-height)}}
/* Clipboard (shadcn Clipboard; plain JS: cam-copy.js, React: components/ui/clipboard.tsx). The copy icon turns into
   a check for 2s on the button that copied; the button keeps its own look. */
/* The icon of OpenAI Apps SDK UI's CopyButton (components/Button/CopyButton.js) on plain pages: their Animate box
   (w/h var(--button-icon-size)) swapping Copy for Check: in at scale .6→1 (150ms delay, 300ms), out to .6 (150ms). */
html .cui-copy-icon{position:relative;display:inline-grid;flex:none;place-items:center;width:var(--button-icon-size);height:var(--button-icon-size)}
html .cui-copy-icon>span{grid-area:1/1;display:grid;place-items:center;width:100%;height:100%;transition:opacity .3s var(--cubic-enter) .15s,transform .3s var(--cubic-enter) .15s}
html .cui-copy-icon svg{display:block;width:100%;height:100%}
html .cui-copy-icon>.cui-copy-done,html [data-copied] .cui-copy-icon>.cui-copy-rest{opacity:0;transform:scale(.6);transition-duration:.15s;transition-delay:0s}
html [data-copied] .cui-copy-icon>.cui-copy-done{opacity:1;transform:none}
/* Copy tooltip on plain pages: the tooltip is OpenAI Apps SDK UI's CopyTooltip from the dashboard bundle (cam-copy.js,
   components/camos/plain-copy-tooltip.tsx). Their .TriggerDecorator rules (openai/tooltip/Tooltip.module.css) for the
   trigger, here because page elements cannot see the module's class in the shadow root; the trigger's data-state comes
   from their Tooltip. display:inline-flex only on copyTip()'s own markup, so other [data-copy-tip] elements keep theirs. */
html [data-copy-tip]{cursor:pointer;text-decoration:underline dotted;text-decoration-color:transparent}
html [data-copy-tip]:focus{outline:0}
html [data-copy-tip][data-state*=open]{text-decoration-color:var(--color-text-tertiary)}
/* copyTip(value): one line, an ellipsis when it does not fit. */
html .cui-copy-tip-trigger{display:inline-flex;max-width:100%;min-width:0;vertical-align:bottom}
html .cui-copy-tip-trigger>span{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
/* Action Bar (shadcn.io Action Bar's plain-JS twin of components/ui/action-bar.tsx; change both together): a floating
   pill on the kit's elevated surface at the bottom while items are selected. Count, actions, ×. Safe-area aware; fades
   only with reduced motion. Markup: .cui-action-bar[data-placement] > .cui-action-bar-content > .cui-action-bar-value,
   .cui-action-bar-separator, button.cui-action-bar-action, button.cui-action-bar-close. */
html .cui-action-bar{position:fixed;inset:auto 0 0 0;z-index:60;display:flex;justify-content:center;padding:0 16px calc(16px + env(safe-area-inset-bottom,0px));pointer-events:none;animation:cui-action-bar-in .28s var(--cubic-enter) both}
html .cui-action-bar[data-placement=bottom-start]{justify-content:flex-start}
html .cui-action-bar[data-placement=bottom-end]{justify-content:flex-end}
html .cui-action-bar.is-leaving{animation:cui-action-bar-out .15s var(--cubic-exit) both}
html .cui-action-bar-content{position:relative;display:flex;align-items:center;gap:2px;max-width:100%;padding:6px;border-radius:var(--radius-full);background:var(--color-surface-elevated);box-shadow:var(--shadow-hairline),var(--shadow-300);color:var(--color-text);pointer-events:auto;user-select:none;-webkit-user-select:none}
html .cui-action-bar-value{display:inline-flex;align-items:center;height:32px;padding:0 12px;border-radius:var(--radius-full);background:var(--color-background-primary-ghost-hover);font-size:var(--font-text-sm-size);line-height:var(--font-text-sm-line-height);font-weight:var(--font-weight-medium);font-variant-numeric:tabular-nums;white-space:nowrap}
html .cui-action-bar-separator{width:1px;height:20px;margin:0 4px;background:var(--color-border-strong);flex:none}
html .cui-action-bar-action,html .cui-action-bar-close{display:inline-flex;align-items:center;justify-content:center;gap:6px;height:32px;min-width:32px;padding:0 12px;border:0;border-radius:var(--radius-full);background:transparent;color:inherit;font:inherit;font-size:var(--font-text-sm-size);line-height:var(--font-text-sm-line-height);font-weight:var(--font-weight-medium);white-space:nowrap;cursor:pointer;-webkit-tap-highlight-color:transparent;transition:background-color .15s var(--cubic-enter),scale .15s var(--cubic-enter),opacity .15s var(--cubic-enter)}
html .cui-action-bar-close{padding:0;width:32px;color:var(--color-text-secondary)}
html .cui-action-bar-action:hover:not(:disabled),html .cui-action-bar-close:hover,html .cui-action-bar-action[aria-expanded=true]{background:var(--color-background-primary-ghost-hover);color:var(--color-text)}
html .cui-action-bar-action:active:not(:disabled),html .cui-action-bar-close:active{scale:.97}
html .cui-action-bar-action:disabled{opacity:.45;cursor:default}
html .cui-action-bar-action:focus-visible,html .cui-action-bar-close:focus-visible{outline:none;box-shadow:0 0 0 3px var(--color-border-info-outline)}
html .cui-action-bar-action svg,html .cui-action-bar-close svg{width:16px;height:16px;flex:none}
html .cui-action-bar-action svg.cui-action-bar-chevron{width:14px;height:14px;margin-inline-start:-2px;opacity:.6}
@media (max-width: 575px){html .cui-action-bar-action>span{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}html .cui-action-bar-action{padding:0;width:32px}}
@media (pointer:coarse){html .cui-action-bar-value,html .cui-action-bar-action,html .cui-action-bar-close{height:40px;min-width:40px}html .cui-action-bar-close{width:40px}}
@keyframes cui-action-bar-in{from{opacity:0;transform:translateY(16px) scale(.95)}}
@keyframes cui-action-bar-out{to{opacity:0;transform:translateY(16px) scale(.95)}}
@media (prefers-reduced-motion:reduce){@keyframes cui-action-bar-in{from{opacity:0}}@keyframes cui-action-bar-out{to{opacity:0}}html .cui-action-bar-action,html .cui-action-bar-close{transition:none}}
}
