/* r318: one pro look for Indicators, Commands, Alerts and the Replay bar. Theme variables only. */

/* ---------- shared dialog frame ---------- */
.modal-box:is(.ind318, .cmd318, .alert318) { padding: 0; overflow: hidden; display: flex; flex-direction: column; border-radius: 12px; }
:is(.ind318, .cmd318, .alert318) .mh { padding: 14px 16px 10px; flex: none; }
:is(.ind318, .cmd318, .alert318) .mh b { font-size: 16px; font-weight: 600; }
:is(.ind318, .cmd318) .sbox { margin: 0 16px 10px; height: 44px; border-radius: 10px; flex: none; }
:is(.ind318, .cmd318) .sbox input { font-size: 15px; }

/* ---------- Indicators ---------- */
.modal-box.ind318 { width: min(860px, calc(100vw - 32px)); height: min(640px, 86dvh); }
.ind318-body { flex: 1; min-height: 0; display: grid; grid-template-columns: 220px minmax(0, 1fr); border-top: 1px solid var(--hair); }
.ind318-nav { display: flex; flex-direction: column; gap: 1px; padding: 8px; border-right: 1px solid var(--hair); overflow-y: auto; }
.ind318-nav button { display: flex; align-items: center; gap: 10px; min-height: 36px; padding: 0 10px; border: 0; border-radius: 8px; background: transparent; color: var(--t2); font: inherit; font-size: 13px; text-align: left; cursor: pointer; }
.ind318-nav button svg { width: 17px; height: 17px; flex: none; color: var(--t3); }
.ind318-nav button span { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ind318-nav button .n { font-size: 11px; font-weight: 600; color: var(--t3); }
.ind318-nav button:hover { background: var(--fill); color: var(--t1); }
.ind318-nav button.on { background: var(--fill-2); color: var(--t1); font-weight: 600; }
.ind318-nav button.on svg { color: var(--t1); }
.ind318-main { min-width: 0; min-height: 0; overflow-y: auto; padding: 6px 10px 12px; overscroll-behavior: contain; }
.ind318-h { padding: 10px 8px 6px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--t3); }
.ind318-list { display: block; padding: 0; }
.ind318-row { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 38px; padding: 0 10px; border: 0; border-radius: 8px; background: transparent; color: var(--t1); font: inherit; font-size: 13.5px; text-align: left; cursor: pointer; }
.ind318-row:hover { background: var(--fill-2); }
.ind318-row .ind318-name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ind318-row small { font-size: 11px; color: var(--t3); }
.ind318-row svg { width: 16px; height: 16px; flex: none; color: var(--t3); }
.ind318-row.on .ind318-name { font-weight: 600; }
.ind318-row.on svg { color: var(--up); }
.ind318 .indicator-active { display: flex; flex-direction: column; gap: 2px; }
.ind318 .indicator-row { display: flex; align-items: center; gap: 2px; min-height: 40px; padding: 0 4px 0 10px; border-radius: 8px; }
.ind318 .indicator-row:hover { background: var(--fill); }
.ind318 .indicator-row b { flex: 1; min-width: 0; font-size: 13.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ind318 .indicator-row.is-hidden b { color: var(--t3); }
.ind318 .indicator-row .tb { width: 32px; height: 32px; color: var(--t2); }
.ind318-tools { display: flex; flex-wrap: wrap; gap: 6px; padding: 12px 8px 0; }
.ind318-tools .btn { height: 32px; font-size: 12.5px; }
.ind318-tools select { height: 32px; min-width: 0; max-width: 100%; }
.ind318-empty, .ind318-note { margin: 6px 8px 10px; color: var(--t3); font-size: 12.5px; }
@media (max-width: 767px) {
  .modal-box.ind318 { width: 100%; height: 100%; border-radius: 0; }
  .ind318-body { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
  .ind318-nav { flex-direction: row; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--hair); padding: 6px 8px; scrollbar-width: none; }
  .ind318-nav button { flex: none; min-height: 34px; border: 1px solid var(--hair); border-radius: 999px; }
  .ind318-nav button svg { display: none; }
  .ind318-row { min-height: 46px; }
}

/* ---------- Commands ---------- */
.modal-box.cmd318 { width: min(720px, calc(100vw - 32px)); height: min(620px, 86dvh); }
.cmd318 .desk-command-head { display: none; }
.cmd318 .sbox kbd { font: 500 10.5px/1 var(--font); color: var(--t3); padding: 3px 6px; border: 1px solid var(--hair); border-radius: 5px; background: var(--card); }
.cmd318 .desk-tabs { display: flex; gap: 2px; padding: 0 12px; border-bottom: 1px solid var(--hair); overflow-x: auto; scrollbar-width: none; flex: none; }
.cmd318 .desk-tabs button { flex: none; height: 34px; padding: 0 10px; border: 0 !important; border-radius: 0 !important; background: transparent !important; color: var(--t2); font: inherit; font-size: 13px; font-weight: 500; box-shadow: inset 0 -2px 0 transparent; }
.cmd318 .desk-tabs button[aria-pressed="true"] { color: var(--t1) !important; box-shadow: inset 0 -2px 0 var(--t1); }
.cmd318 .desk-results { flex: 1; min-height: 0; overflow-y: auto; padding: 6px; }
.cmd318 .adv-tool-row { display: flex; align-items: center; border-radius: 8px; }
.cmd318 .adv-tool-row:hover, .cmd318 .adv-result.is-active { background: var(--fill-2); }
.cmd318 .adv-result { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; min-height: 40px; padding: 0 10px; border-radius: 8px; background: transparent !important; }
.cmd318 .desk-command-icon { width: 28px; height: 28px; flex: none; display: grid; place-items: center; border-radius: 7px; background: var(--fill); color: var(--t2); }
.cmd318 .desk-command-icon svg { width: 16px; height: 16px; }
.cmd318 .desk-command-text { flex: 1; min-width: 0; display: flex; align-items: baseline; gap: 10px; }
.cmd318 .desk-command-text > span { order: 1; font-size: 13.5px; color: var(--t1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cmd318 .desk-command-text small { order: 2; margin-left: auto; flex: none; font-size: 11px; color: var(--t3); }
.cmd318 .adv-result > svg:last-child { display: none; }
.cmd318 .adv-star { width: 32px; height: 32px; flex: none; border: 0; background: transparent; color: var(--t3); opacity: 0; border-radius: 8px; }
.cmd318 .adv-tool-row:hover .adv-star, .cmd318 .adv-star[aria-pressed="true"], .cmd318 .adv-star:focus-visible { opacity: 1; }
.cmd318 .adv-star[aria-pressed="true"] { color: #f0b400; }
.cmd318 .adv-star[aria-pressed="true"] svg { fill: currentColor; }
.cmd318 .desk-command-foot { display: flex; justify-content: space-between; gap: 10px; padding: 8px 16px; border-top: 1px solid var(--hair); font-size: 11.5px; color: var(--t3); flex: none; }
@media (max-width: 767px) {
  .modal-box.cmd318 { width: 100%; height: 100%; border-radius: 0; }
  .cmd318 .desk-command-text { flex-direction: column; align-items: flex-start; gap: 1px; }
  .cmd318 .desk-command-text small { order: 0; margin-left: 0; }
  .cmd318 .adv-star { opacity: .6; }
}

/* ---------- Create alert ---------- */
.modal-box.alert318 { width: min(520px, calc(100vw - 32px)); max-height: 90dvh; }
.alert318 .mh { border-bottom: 1px solid var(--hair); }
.alert318 .mh .ai-badge { display: grid; place-items: center; width: 28px; height: 28px; margin-right: 8px; border-radius: 8px; background: var(--fill-2); color: var(--t1); }
.alert318 .mh .lg-meta { margin-left: 8px; font-size: 12.5px; font-weight: 600; color: var(--t2); }
.alert318 form.auth { display: flex; flex-direction: column; gap: 10px; padding: 16px; overflow-y: auto; margin: 0; max-width: none; }
.alert318 form.auth > label:not(.ck) { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--t2); margin: 0; }
.alert318 form.auth > label:not(.ck) small { color: var(--t3); }
.alert318 form.auth > label:not(.ck) > :is(input, select) { flex: none; width: 62%; margin-left: auto; height: 36px; padding: 0 10px; border: 1px solid var(--hair); border-radius: 8px; background: var(--fill); color: var(--t1); font: inherit; font-size: 13.5px; }
.alert318 form.auth > label:not(.ck) > :is(input, select):focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
.alert318 form.auth > label.ck { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.alert318 form.auth > p { margin: 4px 0 0; padding: 10px 12px; border-radius: 8px; background: var(--fill); color: var(--t3); font-size: 12px; line-height: 1.45; }
.alert318 form.auth > .st-foot { margin: 6px -16px -16px !important; padding: 12px 16px !important; border-top: 1px solid var(--hair) !important; display: flex; gap: 8px; }
@media (max-width: 520px) {
  .modal-box.alert318 { width: 100%; max-height: 100%; height: 100%; border-radius: 0; }
  .alert318 form.auth > label:not(.ck) { flex-direction: column; align-items: stretch; }
  .alert318 form.auth > label:not(.ck) > :is(input, select) { width: 100%; height: 42px; }
}

/* ---------- Replay bar ---------- */
#repBar:not([hidden]) { display: flex; align-items: center; gap: 4px; padding: 5px 8px; border: 1px solid var(--hair); border-radius: 12px; background: var(--card); box-shadow: var(--shadow-2, 0 6px 20px rgba(0,0,0,.14)); }
#repBar .rep-t { display: inline-flex; align-items: center; gap: 6px; padding: 0 8px 0 4px; margin-right: 4px; border-right: 1px solid var(--hair); font-size: 12.5px; font-weight: 600; color: var(--t1); }
#repBar .rep-t svg { width: 16px; height: 16px; }
#repBar .dtb-b { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; color: var(--t1); }
#repBar .dtb-b:hover { background: var(--fill-2); }
#repBar .dtb-b[data-r="play"] { background: var(--t1); color: var(--card); }
#repBar select { height: 30px; padding: 0 6px; border: 1px solid var(--hair); border-radius: 8px; background: var(--fill); color: var(--t1); font: inherit; font-size: 12px; }
#repBar .rep-seek { flex: 1; min-width: 80px; accent-color: var(--t1); }
#repBar .rep-d { font-size: 11.5px; color: var(--t3); white-space: nowrap; padding: 0 4px; font-variant-numeric: tabular-nums; }
@media (max-width: 767px) { #repBar .rep-d { display: none; } #repBar .rep-t { display: none; } }
