.sound-alerts-page {
  grid-area: dashboard;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border-color: rgba(33, 65, 113, .82);
  background: linear-gradient(145deg, rgba(9, 22, 48, .94), rgba(3, 9, 22, .99) 70%);
}

.sound-alerts-header {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) auto minmax(240px, 340px) auto;
  gap: 13px;
  align-items: center;
  height: auto;
  min-height: 62px;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(31, 55, 94, .72);
  background: linear-gradient(90deg, rgba(7, 19, 43, .96), rgba(4, 11, 27, .9));
}

.sound-alerts-title { display: flex; gap: 11px; align-items: center; min-width: 0; }
.sound-alerts-title > i { display: grid; place-items: center; flex: 0 0 auto; width: 36px; height: 36px; border: 1px solid rgba(0, 220, 255, .46); border-radius: 9px; color: var(--cyan); background: linear-gradient(145deg, rgba(0, 147, 193, .18), rgba(50, 64, 171, .12)); box-shadow: 0 0 16px rgba(0, 220, 255, .09); font-style: normal; font-size: 17px; }
.sound-alerts-title h1 { margin: 0; color: #dbe5f6; font-size: 13px; font-weight: 700; letter-spacing: .02em; text-transform: uppercase; }
.sound-alerts-title p { margin: 3px 0 0; color: #6f809b; font-size: 9px; }

.sound-alert-primary { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 36px; padding: 0 14px; border: 1px solid rgba(0, 220, 255, .55); border-radius: 9px; color: #eaffff; background: linear-gradient(135deg, rgba(0, 133, 174, .9), rgba(45, 81, 176, .9)); box-shadow: inset 0 1px rgba(255,255,255,.08), 0 0 18px rgba(0, 220, 255, .1); font-size: 10px; font-weight: 800; }
.sound-alert-primary:hover { border-color: var(--cyan); background: linear-gradient(135deg, rgba(0, 157, 197, .96), rgba(53, 94, 199, .96)); box-shadow: 0 0 20px rgba(0, 220, 255, .16); }
.sound-alert-primary b { color: var(--cyan); font-size: 16px; font-weight: 400; }

.sound-alert-search { display: flex; align-items: center; height: 36px; border: 1px solid #223754; border-radius: 9px; background: #080e1c; }
.sound-alert-search span { padding-left: 11px; color: #667996; }
.sound-alert-search input { width: 100%; height: 100%; padding: 0 12px; border: 0; color: #eaf2ff; background: transparent; outline: 0; font-size: 10px; }
.sound-alert-search:focus-within { border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(0, 220, 255, .08); }

.sound-alert-summary { display: flex; gap: 8px; align-items: center; }
.sound-alert-summary > span, .sound-alert-summary button { display: inline-flex; align-items: center; min-height: 30px; padding: 0 10px; border: 1px solid #23436f; border-radius: 8px; color: #9fb0c9; background: rgba(6, 22, 48, .78); font-size: 8px; font-weight: 700; white-space: nowrap; }
.sound-alert-summary > span::before { content: ""; width: 6px; height: 6px; margin-right: 6px; border-radius: 50%; background: var(--green); box-shadow: 0 0 8px rgba(41,239,162,.5); }
.sound-alert-summary button { gap: 6px; color: #91a4c0; }
.sound-alert-summary button:hover { border-color: #3474aa; color: #d6e8ff; }
.sound-alert-summary button b { display: grid; place-items: center; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 5px; color: #b7cae5; background: #12203a; }

.sound-alert-columns, .sound-alert-row { display: grid; grid-template-columns: minmax(185px, .9fr) minmax(260px, 1.8fr) minmax(130px, .55fr) 78px 128px; gap: 12px; align-items: center; }
.sound-alert-columns { min-height: 34px; padding: 0 24px; color: #657792; background: rgba(4, 13, 31, .72); font: 700 8px "DM Mono",monospace; letter-spacing: .08em; text-transform: uppercase; }
.sound-alert-columns span:nth-child(3), .sound-alert-columns span:nth-child(4), .sound-alert-columns span:nth-child(5) { text-align: center; }
.sound-alert-list { position: relative; z-index: 1; display: grid; gap: 7px; padding: 9px 10px 12px; }
.sound-alert-row { min-height: 66px; padding: 8px 13px; border: 1px solid rgba(32, 65, 108, .72); border-radius: 10px; background: linear-gradient(135deg, rgba(7, 23, 49, .84), rgba(5, 12, 28, .94)); box-shadow: inset 0 1px rgba(255,255,255,.025); transition: border-color .18s ease, background .18s ease, opacity .18s ease, transform .18s ease; }
.sound-alert-row:hover { border-color: rgba(39, 114, 167, .86); background: linear-gradient(135deg, rgba(8, 30, 60, .92), rgba(5, 15, 34, .98)); transform: translateY(-1px); }
.sound-alert-row.disabled { opacity: .5; }
.sound-alert-trigger, .sound-alert-sound { display: flex; gap: 10px; align-items: center; min-width: 0; }
.sound-alert-icon { display: grid; place-items: center; flex: 0 0 auto; width: 34px; height: 34px; border: 1px solid rgba(64, 93, 190, .6); border-radius: 9px; color: #a889ff; background: linear-gradient(145deg, rgba(38, 46, 127, .3), rgba(63, 24, 100, .2)); box-shadow: 0 0 11px rgba(87,81,220,.08); font-style: normal; }
.sound-alert-trigger > span, .sound-alert-sound > span { display: grid; min-width: 0; gap: 3px; }
.sound-alert-trigger strong, .sound-alert-sound strong { overflow: hidden; color: #dce8f8; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.sound-alert-trigger small, .sound-alert-sound small { overflow: hidden; color: #71819b; font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.sound-alert-sound { min-height: 38px; padding: 0 11px; border: 1px solid #213d66; border-radius: 8px; background: rgba(4, 13, 31, .8); }
.sound-alert-sound > i { color: var(--cyan); font-style: normal; opacity: .85; }
.sound-alert-volume { display: grid; grid-template-columns: 1fr 34px; gap: 7px; align-items: center; }
.sound-alert-volume input { width: 100%; accent-color: var(--cyan); }
.sound-alert-volume output { color: #e8edfa; font-size: 8px; text-align: right; }
.sound-alert-repeat { display: flex; justify-content: center; }
.sound-alert-repeat button { min-height: 29px; padding: 0 9px; border: 1px solid #2a3e5f; border-radius: 7px; color: #71819c; background: #081122; font-size: 8px; font-weight: 800; }
.sound-alert-repeat button.active { border-color: #167d9c; color: #61e8f1; background: rgba(0, 105, 133, .2); box-shadow: inset 0 0 10px rgba(0,220,255,.04); }
.sound-alert-actions { display: flex; gap: 6px; justify-content: flex-end; }
.sound-alert-actions button { display: grid; place-items: center; width: 30px; height: 30px; border: 1px solid #293d5e; border-radius: 7px; color: #7d8eaa; background: #081121; font-size: 12px; }
.sound-alert-actions button:hover { border-color: #1685aa; color: var(--cyan); background: rgba(0,108,143,.14); }
.sound-alert-actions .sound-play-toggle.playing, .myinstants-result-preview.playing { border-color: rgba(255,77,119,.72); color: #ff7796; background: rgba(91,12,42,.74); box-shadow: 0 0 13px rgba(255,45,99,.18); animation: soundStopPulse 1.1s ease-in-out infinite alternate; }
.sound-alert-actions .sound-play-toggle.playing:hover, .myinstants-result-preview.playing:hover { border-color: #ff7796; color: #ffdce5; background: rgba(121,14,51,.84); }
.sound-alert-actions button.delete:hover { border-color: #8f2948; color: #ff6485; }
.sound-alert-empty { position: relative; z-index: 1; display: grid; justify-items: center; margin: 12px; padding: 76px 20px; border: 1px dashed rgba(49,94,151,.68); border-radius: 11px; color: #7186a5; background: rgba(5,19,42,.38); text-align: center; }
.sound-alert-empty > i { display: grid; place-items: center; width: 54px; height: 54px; border: 2px solid transparent; border-radius: 50%; color: var(--cyan); background: linear-gradient(#071329,#071329) padding-box, conic-gradient(var(--cyan),var(--blue),var(--purple),var(--pink),var(--cyan)) border-box; box-shadow: 0 0 17px rgba(0,220,255,.2); font-size: 23px; font-style: normal; }
.sound-alert-empty h2 { margin: 14px 0 4px; color: #b9c9de; font-size: 13px; }
.sound-alert-empty p { margin: 0 0 15px; font-size: 9px; }
.sound-alert-empty button { min-height: 32px; padding: 0 12px; border: 1px solid #176f99; border-radius: 7px; color: var(--cyan); background: rgba(0, 104, 150, .16); font-size: 9px; font-weight: 700; }

.sound-alert-dialog { width: min(650px, calc(100vw - 24px)); max-height: calc(100vh - 30px); padding: 0; overflow: auto; border: 1px solid rgba(33, 77, 126, .9); border-radius: 14px; color: #eaf2ff; background: linear-gradient(145deg, #071630, #030916 72%); box-shadow: 0 30px 100px rgba(0,0,0,.76), 0 0 35px rgba(0,174,220,.1); }
.sound-alert-dialog::backdrop { background: rgba(0, 3, 12, .78); backdrop-filter: blur(6px); }
.sound-alert-dialog form > header { position: sticky; z-index: 3; top: 0; display: flex; justify-content: space-between; align-items: center; height: auto; min-height: 58px; padding: 9px 15px; border-bottom: 1px solid #203a61; background: rgba(5,16,36,.97); }
.sound-alert-dialog form > header p { margin: 0 0 3px; color: #28dce1; font: 500 8px "DM Mono", monospace; letter-spacing: .14em; }
.sound-alert-dialog form > header h2 { margin: 0; color: #dbe7f8; font-size: 15px; }
.sound-alert-dialog form > header button { width: 34px; height: 34px; border: 1px solid #344463; border-radius: 8px; color: #9ba8c0; background: #0a1027; font-size: 20px; }
.sound-alert-form-body { display: grid; gap: 13px; padding: 15px; }
.sound-alert-form-body > label, .sound-alert-form-grid label, .sound-source-fields label { display: grid; gap: 7px; color: #9ba7bf; font-size: 9px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.sound-alert-form-body label small { color: #5f6d88; font-weight: 500; }
.sound-alert-form-body input:not([type="range"]):not([type="radio"]):not([type="checkbox"]), .sound-alert-form-body select { width: 100%; height: 40px; padding: 0 12px; border: 1px solid #274264; border-radius: 8px; color: #eef4ff; background: #050d1e; outline: 0; font-size: 11px; }
.sound-alert-form-body input:focus, .sound-alert-form-body select:focus { border-color: #20dce1; box-shadow: 0 0 0 3px rgba(32,220,225,.08); }
.sound-alert-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.sound-source-picker { display: flex; gap: 8px; margin: 0; padding: 7px; border: 1px solid #233c60; border-radius: 10px; background: rgba(4,13,31,.58); }
.sound-source-picker legend { padding: 0 6px; color: #74829e; font-size: 8px; font-weight: 700; text-transform: uppercase; }
.sound-source-picker label { flex: 1; cursor: pointer; }
.sound-source-picker input { position: absolute; opacity: 0; }
.sound-source-picker span { display: grid; place-items: center; min-height: 34px; border: 1px solid #293f61; border-radius: 7px; color: #7788a3; background: #071020; font-size: 9px; font-weight: 700; }
.sound-source-picker input:checked + span { border-color: #19dbe0; color: #46edf0; background: rgba(0, 129, 145, .18); }
.sound-source-fields { display: grid; gap: 5px; padding: 11px; border: 1px solid #213b5f; border-radius: 10px; background: rgba(4,13,31,.66); }
.sound-source-fields p { margin: 0; color: #687792; font-size: 8px; }
.sound-source-fields p a { color: #35dfe5; text-decoration: none; }
.sound-source-fields p a:hover { text-decoration: underline; }
.myinstants-picker { position: relative; }
#myInstantsPickerButton { display: flex; justify-content: space-between; align-items: center; width: 100%; min-height: 46px; padding: 7px 11px; border: 1px solid #29476c; border-radius: 8px; color: #eaf3ff; background: #050d1e; text-align: left; }
#myInstantsPickerButton > span { display: grid; min-width: 0; gap: 3px; }
#myInstantsPickerButton strong, #myInstantsPickerButton small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#myInstantsPickerButton strong { font-size: 10px; }
#myInstantsPickerButton small { color: #6d7d99; font-size: 8px; }
#myInstantsPickerButton > b { color: #5ee8e9; font-size: 15px; }
#myInstantsPickerButton[aria-expanded="true"] { border-color: #22dde2; box-shadow: 0 0 0 3px rgba(34,221,226,.08); }
.myinstants-picker-panel { position: absolute; z-index: 20; top: calc(100% + 6px); right: 0; left: 0; padding: 9px; border: 1px solid #31567f; border-radius: 10px; background: rgba(4,12,28,.99); box-shadow: 0 20px 55px rgba(0,0,0,.7),0 0 24px rgba(0,174,221,.08); }
.myinstants-search { display: flex !important; grid-template-columns: 25px 1fr !important; gap: 0 !important; align-items: center; height: 40px; border: 1px solid #304669; border-radius: 8px; background: #080f29; }
.myinstants-search span { padding-left: 9px; color: #8090ad; font-size: 13px; }
.myinstants-search input { height: 38px !important; padding: 0 10px 0 2px !important; border: 0 !important; box-shadow: none !important; background: transparent !important; text-transform: none; }
.myinstants-picker-panel > p { margin: 8px 3px 6px; color: #71819e; font-size: 8px; }
.myinstants-results { display: grid; gap: 4px; max-height: 245px; overflow-y: auto; scrollbar-color: #48607d #070d22; }
.myinstants-result { display: grid; grid-template-columns: 32px minmax(0,1fr) 27px; gap: 8px; align-items: center; width: 100%; min-height: 43px; padding: 5px 7px; border: 1px solid #1d3453; border-radius: 8px; color: #dfeaff; background: rgba(7,20,43,.82); text-align: left; }
.myinstants-result:hover, .myinstants-result.selected { border-color: #258fa3; background: rgba(12,77,96,.32); }
.myinstants-result-preview { display: grid; place-items: center; width: 30px; height: 30px; padding: 0; border: 1px solid #285d82; border-radius: 50%; color: #44e8eb; background: #091c39; font-size: 9px; }
.myinstants-result-preview:hover { border-color: #43e7ea; background: #0b3150; }
.myinstants-result-select { display: grid; min-width: 0; gap: 2px; padding: 3px 0; border: 0; color: inherit; background: transparent; text-align: left; }
.myinstants-result strong { overflow: hidden; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.myinstants-result small { color: #667895; font-size: 7px; }
.myinstants-result > b { color: #4ce6e8; font-size: 14px; text-align: center; }
.myinstants-no-results { padding: 18px 8px; color: #71819e; font-size: 8px; text-align: center; }
.myinstants-picker-panel > a { display: block; padding: 8px 3px 1px; color: #36dce2; font-size: 8px; text-align: center; text-decoration: none; }
.myinstants-picker-panel > a:hover { text-decoration: underline; }
.sound-volume-field > span { display: flex; justify-content: space-between; }
.sound-volume-field input { accent-color: #22dfe0; }
.sound-alert-options { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.sound-alert-options > label { display: flex; gap: 9px; align-items: flex-start; padding: 10px; border: 1px solid #223b5f; border-radius: 9px; background: rgba(5,16,36,.72); cursor: pointer; }
.sound-alert-options input { margin-top: 2px; accent-color: #19dfe0; }
.sound-alert-options span { display: grid; gap: 3px; }
.sound-alert-options strong { color: #dce6f7; font-size: 9px; }
.sound-alert-options small { color: #71809b; font-size: 8px; line-height: 1.4; }
.sound-alert-form-status { min-height: 16px; margin: 0; color: #7f8da8; font-size: 9px; }
.sound-alert-form-status.error { color: #ff7794; }
.sound-alert-form-status.success { color: #54e4b0; }
.sound-alert-dialog form > footer { position: sticky; bottom: 0; display: flex; justify-content: flex-end; gap: 8px; height: auto; min-height: 58px; padding: 9px 15px; border-top: 1px solid #203a61; background: rgba(5,16,36,.97); }
.sound-alert-dialog form > footer button:not(.sound-alert-primary) { min-height: 40px; padding: 0 16px; border: 1px solid #354565; border-radius: 9px; color: #a4b0c6; background: #0a1027; font-size: 10px; }

@media (max-width: 1120px) {
  .sound-alerts-header { grid-template-columns: 1fr auto; }
  .sound-alert-search { grid-column: 1; }
  .sound-alert-summary { grid-column: 2; }
  .sound-alert-columns { display: none; }
  .sound-alert-row { grid-template-columns: minmax(175px,.8fr) minmax(230px,1.4fr) minmax(120px,.5fr) 75px 120px; overflow-x: auto; }
}

@media (max-width: 760px) {
  .sound-alerts-page { min-height: 0; margin-top: 12px; }
  .sound-alerts-header { grid-template-columns: 1fr; padding: 12px; }
  .sound-alert-primary, .sound-alert-search, .sound-alert-summary { grid-column: 1; width: 100%; }
  .sound-alert-summary { justify-content: space-between; }
  .sound-alert-row { grid-template-columns: 1fr auto; gap: 9px; padding: 12px; overflow: visible; }
  .sound-alert-trigger { grid-column: 1; }
  .sound-alert-sound { grid-column: 1 / -1; grid-row: 2; }
  .sound-alert-volume { grid-column: 1 / -1; grid-row: 3; }
  .sound-alert-repeat { grid-column: 2; grid-row: 1; }
  .sound-alert-actions { grid-column: 1 / -1; grid-row: 4; justify-content: flex-start; }
  .sound-alert-form-grid, .sound-alert-options { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .sound-alert-row, .sound-alert-primary { transition: none; }
  .sound-alert-actions .sound-play-toggle.playing, .myinstants-result-preview.playing { animation: none; }
}

@keyframes soundStopPulse {
  from { box-shadow: 0 0 7px rgba(255,45,99,.12), 0 0 0 0 rgba(255,45,99,.2); }
  to { box-shadow: 0 0 17px rgba(255,45,99,.3), 0 0 0 3px rgba(255,45,99,.05); }
}
