.hy-panel, .hy-panel *, .hy-control, .hy-button { box-sizing: border-box; }
.hy-panel {
  width: min(100%, 360px); padding: 18px; color: var(--hy-text);
  background: var(--hy-panel); border: 1px solid var(--hy-border);
  border-radius: var(--hy-radius-md); font: var(--hy-weight-normal) var(--hy-font-md)/1.45 var(--hy-font-ui);
}
.hy-panel__header, .hy-label-row, .hy-section__head, .hy-inline-row, .hy-choice-row, .hy-panel .panel-actions, .hy-status { display: flex; align-items: center; }
.hy-panel__header, .hy-label-row, .hy-section__head { justify-content: space-between; }
.hy-panel__header { gap: var(--hy-space-3); }
.hy-panel__title { margin: 0; font-size: var(--hy-font-lg); font-weight: var(--hy-weight-medium); }
.hy-section { display: grid; gap: 10px; }
.hy-section__head { margin-bottom: 2px; }
.hy-section__title { margin: 0; color: var(--hy-text); font-size: var(--hy-font-md); font-weight: var(--hy-weight-medium); }
.hy-label { display: block; margin-bottom: 6px; color: var(--hy-text-muted); font-size: var(--hy-font-sm); }
.hy-label-row { gap: var(--hy-space-3); margin-bottom: 4px; }
.hy-label-row .hy-label { margin: 0; }
.hy-value { color: var(--hy-text); font: var(--hy-font-xs)/1 var(--hy-font-mono); font-variant-numeric: tabular-nums; }
.hy-help { margin: 0; color: var(--hy-text-muted); font-size: var(--hy-font-sm); line-height: 1.5; }
.hy-control { color: var(--hy-text); font: var(--hy-weight-normal) var(--hy-font-sm)/1.2 var(--hy-font-ui); }
.hy-input, .hy-number, .hy-select { width: 100%; height: var(--hy-control-height); padding: 0 14px; background: var(--hy-control-bg); border: 1px solid var(--hy-border-strong); border-radius: var(--hy-radius-sm); }
.hy-number { width: 84px; font-variant-numeric: tabular-nums; }
.hy-select { padding-right: 42px; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 14 14'%3E%3Cpath d='m3 5 4 4 4-4' fill='none' stroke='%23aaabb1' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; }
.hy-select:open { border-color: var(--hy-accent); }
.hy-select option { color: var(--hy-text); background: var(--hy-panel); }
.hy-select option:checked { color: var(--hy-accent-contrast); background: var(--hy-accent); }
.hy-custom-select { position: relative; }
.hy-select-native { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.hy-select-button { display: flex; width: 100%; height: var(--hy-control-height); align-items: center; justify-content: space-between; gap: 12px; padding: 0 14px; text-align: left; background: var(--hy-control-bg); border: 1px solid var(--hy-border-strong); border-radius: var(--hy-radius-sm); cursor: pointer; }
.hy-select-button__arrow { width: 8px; height: 8px; flex: 0 0 8px; margin: -4px 3px 0 0; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg); }
.hy-select-button[aria-expanded="true"] .hy-select-button__arrow { margin-top: 4px; transform: rotate(225deg); }
.hy-select__options { position: absolute; z-index: 3; top: calc(100% + 6px); right: 0; left: 0; max-height: 220px; padding: 5px; overflow: auto; color: var(--hy-text); background: var(--hy-panel-raised); border: 1px solid var(--hy-border-strong); border-radius: var(--hy-radius-md); box-shadow: 0 8px 18px rgba(0,0,0,.2); }
.hy-select__options[hidden] { display: none; }
.hy-select__option { position: relative; min-height: 38px; padding: 9px 34px 9px 10px; border-radius: var(--hy-radius-sm); cursor: pointer; }
.hy-select__option[aria-selected="true"]::after { position: absolute; top: 8px; right: 10px; color: var(--hy-accent); content: "✓"; }
.hy-select__option[data-active] { background: var(--hy-control-bg); }
.hy-select__option[aria-disabled="true"] { color: var(--hy-disabled); cursor: not-allowed; }
.hy-select-button:disabled { color: var(--hy-disabled); cursor: not-allowed; opacity: .62; }
.hy-slider { --hy-range-progress: 0%; display: block; width: 100%; height: 32px; margin: 0; padding: 0; appearance: none; background: transparent; border: 0; cursor: pointer; }
.hy-slider::-webkit-slider-runnable-track { height: 6px; background: linear-gradient(to right, var(--hy-accent) 0%, var(--hy-accent) var(--hy-range-progress), var(--hy-border-strong) var(--hy-range-progress), var(--hy-border-strong) 100%); border-radius: 99px; }
.hy-slider::-webkit-slider-thumb { width: 20px; height: 20px; margin-top: -7px; appearance: none; background: var(--hy-accent); border: 0; border-radius: 50%; }
.hy-slider::-moz-range-track { height: 6px; background: var(--hy-border-strong); border: 0; border-radius: 99px; }
.hy-slider::-moz-range-progress { height: 6px; background: var(--hy-accent); border: 0; border-radius: 99px; }
.hy-slider::-moz-range-thumb { width: 20px; height: 20px; appearance: none; background: var(--hy-accent); border: 0; border-radius: 50%; }
.hy-checkbox, .hy-radio { position: relative; display: inline-grid; width: 18px; height: 18px; flex: 0 0 18px; place-content: center; margin: 0; appearance: none; background: var(--hy-control-bg); border: 1px solid var(--hy-border-strong); cursor: pointer; }
.hy-checkbox { border-radius: 5px; }
.hy-radio { border-radius: 50%; }
.hy-checkbox:checked, .hy-radio:checked { background: var(--hy-accent); border-color: var(--hy-accent); }
.hy-checkbox:checked::after { width: 8px; height: 5px; content: ""; border-bottom: 2px solid var(--hy-accent-contrast); border-left: 2px solid var(--hy-accent-contrast); transform: translateY(-1px) rotate(-45deg); }
.hy-radio:checked::after { width: 6px; height: 6px; content: ""; background: var(--hy-accent-contrast); border-radius: 50%; }
.hy-radio { border-radius: 50%; }
.hy-check-label { display: inline-flex; align-items: center; gap: 7px; color: var(--hy-text-muted); font-size: var(--hy-font-sm); cursor: pointer; }
.hy-inline-row { gap: var(--hy-space-3); flex-wrap: wrap; }
.hy-choice-row { gap: var(--hy-space-4); min-height: var(--hy-control-height-sm); }
.hy-divider { height: 1px; margin: var(--hy-space-4) 0; background: var(--hy-border); border: 0; }
.hy-status { gap: 7px; color: var(--hy-text-muted); font: var(--hy-weight-medium) var(--hy-font-sm)/1 var(--hy-font-ui); }
.hy-status > span { color: var(--hy-accent); font-size: 10px; }
.hy-button { display: inline-flex; min-height: var(--hy-control-height); align-items: center; justify-content: center; gap: 9px; padding: 0 15px; color: var(--hy-accent-contrast); background: var(--hy-accent); border: 1px solid transparent; border-radius: var(--hy-radius-sm); font: var(--hy-weight-medium) var(--hy-font-sm)/1 var(--hy-font-ui); cursor: pointer; transition: background-color 100ms ease, border-color 100ms ease, color 100ms ease; }
.hy-button:hover { background: var(--hy-accent-hover); border-color: var(--hy-accent-hover); }
.hy-button:active { background: var(--hy-accent-active); border-color: var(--hy-accent-active); }
.hy-button--secondary { color: var(--hy-text); background: var(--hy-panel-raised); border-color: transparent; }
.hy-button--secondary:hover { background: #2b2d33; }
.hy-button--secondary:active { background: #303238; }
.hy-button--danger { color: var(--hy-danger); background: transparent; border-color: var(--hy-border); }
.hy-button--danger:hover { background: rgba(255,119,109,.1); border-color: rgba(255,119,109,.25); }
.hy-button--danger:active { background: #f26057; }
.hy-control:focus-visible, .hy-button:focus-visible { outline: 0; box-shadow: var(--hy-focus-ring); }
.hy-control:disabled, .hy-button:disabled { color: var(--hy-disabled); background-color: #1b1c20; border-color: var(--hy-border); cursor: not-allowed; opacity: .62; }
.hy-slider:disabled { cursor: not-allowed; opacity: .45; }
.hy-checkbox:disabled, .hy-radio:disabled { cursor: not-allowed; }
.hy-tabs { display: grid; justify-items: start; gap: var(--hy-space-2); }
.hy-tabs__list { display: inline-flex; max-width: 100%; gap: 3px; padding: 3px; background: var(--hy-panel-raised); border-radius: var(--hy-radius-md); }
.hy-tabs__tab { min-height: var(--hy-control-height-sm); padding: 0 14px; color: var(--hy-text-muted); background: transparent; border: 0; border-radius: var(--hy-radius-sm); font: var(--hy-weight-medium) var(--hy-font-sm)/1 var(--hy-font-ui); cursor: pointer; }
.hy-tabs__tab:hover:not([aria-selected="true"]):not(:disabled) { color: var(--hy-text); background: var(--hy-panel); }
.hy-tabs__tab[aria-selected="true"] { color: var(--hy-accent-contrast); background: var(--hy-accent); }
.hy-tabs__tab:focus-visible { outline: 0; box-shadow: var(--hy-focus-ring); }
.hy-tabs__tab:disabled { color: var(--hy-disabled); cursor: not-allowed; }
.hy-tabs__panel { width: 100%; padding: 18px; color: var(--hy-text); background: var(--hy-panel); border: 1px solid var(--hy-border); border-radius: var(--hy-radius-md); }
.hy-tabs__panel p { margin: 6px 0 0; color: var(--hy-text-muted); }
.hy-icon-toolbar { display: flex; align-items: center; gap: var(--hy-space-2); }
.hy-icon-menu { position: relative; }
.hy-icon-menu > summary { list-style: none; }
.hy-icon-menu > summary::-webkit-details-marker { display: none; }
.hy-icon-button { position: relative; display: inline-grid; width: 40px; height: 40px; place-items: center; padding: 0; color: var(--hy-text-muted); background: var(--hy-panel-raised); border: 1px solid var(--hy-border); border-radius: 50%; cursor: pointer; }
.hy-icon-button:hover { color: var(--hy-text); background: #2b2d33; }
.hy-icon-button:active { background: #303238; }
.hy-icon-button:focus-visible { outline: 0; box-shadow: var(--hy-focus-ring); }
.hy-icon-button > svg, .hy-drawer-trigger > svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.hy-icon-button > span[aria-hidden="true"] { font-size: 17px; font-weight: var(--hy-weight-medium); line-height: 1; }
.hy-icon-button::after { position: absolute; z-index: 5; top: calc(100% + 7px); left: 50%; padding: 5px 8px; color: var(--hy-text); background: var(--hy-panel-raised); border: 1px solid var(--hy-border); border-radius: var(--hy-radius-sm); content: attr(data-tooltip); font: var(--hy-weight-normal) var(--hy-font-xs)/1.2 var(--hy-font-ui); opacity: 0; pointer-events: none; transform: translate(-50%, -2px); transition: opacity 100ms ease, transform 100ms ease; visibility: hidden; white-space: nowrap; }
.hy-icon-button:hover::after, .hy-icon-button:focus-visible::after { opacity: 1; transform: translate(-50%, 0); visibility: visible; }
.hy-icon-menu[open] > .hy-icon-button::after { display: none; }
.hy-icon-menu__panel { position: absolute; z-index: 4; top: calc(100% + 8px); left: 0; width: min(240px, calc(100vw - 32px)); padding: 16px; color: var(--hy-text); background: var(--hy-panel); border: 1px solid var(--hy-border-strong); border-radius: var(--hy-radius-md); box-shadow: 0 12px 28px rgba(0, 0, 0, .28); }
.hy-icon-menu:last-child .hy-icon-menu__panel { right: 0; left: auto; }
.hy-icon-menu__panel h3 { margin: 0; font-size: var(--hy-font-md); font-weight: var(--hy-weight-medium); }
.hy-icon-menu__panel p { margin: 7px 0 0; color: var(--hy-text-muted); font-size: var(--hy-font-sm); }
.hy-icon-menu__panel a, .hy-icon-menu__panel .hy-button { margin-top: 12px; }
.hy-icon-menu__panel a { display: block; color: var(--hy-accent); font-size: var(--hy-font-sm); text-decoration: none; }
.hy-icon-menu__panel a:hover { text-decoration: underline; text-underline-offset: 3px; }
.hy-icon-menu__panel .hy-check-label { margin-top: 12px; }
.hy-drawer { position: fixed; inset: 0 auto 0 0; width: min(340px, calc(100vw - 24px)); max-width: none; height: 100vh; height: 100dvh; max-height: none; margin: 0; padding: 22px; color: var(--hy-text); background: var(--hy-panel); border: 1px solid var(--hy-border-strong); border-radius: 0 var(--hy-radius-md) var(--hy-radius-md) 0; }
.hy-drawer[data-side="right"] { right: 0; left: auto; border-radius: var(--hy-radius-md) 0 0 var(--hy-radius-md); }
.hy-drawer::backdrop { background: rgba(0, 0, 0, .56); }
.hy-drawer__header { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.hy-drawer__title { margin: 0; font-size: var(--hy-font-lg); font-weight: var(--hy-weight-medium); }
.hy-drawer__nav { display: grid; gap: 6px; margin-top: 26px; }
.hy-drawer__nav a { padding: 10px 12px; color: var(--hy-text-muted); border-radius: var(--hy-radius-sm); text-decoration: none; }
.hy-drawer__nav a:hover, .hy-drawer__nav a:focus-visible { color: var(--hy-text); background: var(--hy-panel-raised); outline: 0; }
@media (prefers-reduced-motion: reduce) { .hy-button, .hy-icon-button::after { transition: none; } }
