/* frn_adn 2.1 – header with centred tabs, link menu and update panel, in the style of HBlink4-FreeRadioID.
   Loaded after app.css, so these rules win. */
:root { --accent-rgb: 90, 200, 250; }

/* ---------- header: brand left, tabs centred, status and login right ---------- */
header { flex-wrap: nowrap; justify-content: flex-start; gap: 14px; padding: 8px 14px; border-radius: 20px; }
header .brand { flex: 0 1 auto; min-width: 0; }
header .brand > div { min-width: 0; }
header .brand h1 { white-space: nowrap; font-size: 19px; }
header .brand .sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
header .tabs { margin: 0 auto; flex: 0 0 auto; padding: 3px; gap: 3px; background: rgba(255, 255, 255, 0.04); }
#userArea .btn, .links-trigger { white-space: nowrap; }
header .tabs button { padding: 6px 12px; font-size: 12.5px; }
header .chips { flex: 0 1 auto; justify-content: flex-end; flex-wrap: nowrap; }
.tabs button.active { background: rgba(var(--accent-rgb), 0.18); box-shadow: inset 0 0 0 1px rgba(var(--accent-rgb), 0.38); }
.tabs button:focus-visible, .links-trigger:focus-visible, .links-pop a:focus-visible, .links-bar a:focus-visible { outline: 2px solid rgba(var(--accent-rgb), .8); outline-offset: 2px; }

@media (max-width: 1480px) {
    header .tabs button { padding: 6px 9px; }
    header .chips { margin-left: 6px; }
}
@media (max-width: 1180px) {
    header { flex-wrap: wrap; }
    header .brand { flex: 1 1 auto; }
    header .brand .sub { white-space: normal; }
    header .chips { flex-wrap: wrap; }
    header .tabs { order: 3; flex: 1 1 100%; width: 100%; margin: 2px 0 0; }
    header .tabs button { flex: 1 1 0; justify-content: center; }
}
@media (max-width: 600px) {
    header .tabs button { padding: 7px 2px; font-size: 12px; gap: 3px; }
    header .tabs .t-long { display: none; }
    header .tabs .t-short { display: inline; }
}

/* ---------- link menu (button + pop-over) and link bar ---------- */
.links-menu[hidden], .links-bar[hidden] { display: none !important; }
.links-trigger { border-radius: 999px; font-weight: 650; color: var(--text);
                 background: rgba(var(--accent-rgb), 0.14); border: 1px solid rgba(var(--accent-rgb), 0.4); }
.links-trigger:hover { background: rgba(var(--accent-rgb), 0.24); }
.links-menu.open .links-trigger { background: rgba(var(--accent-rgb), 0.26); }
.links-pop { min-width: 230px; padding: 6px; background: var(--theme-popover, rgba(16, 22, 40, 0.97)); }
.links-pop a { min-height: 38px; padding: 9px 11px; font-size: 13.5px; }
.links-pop a:hover, .links-pop a:focus-visible { background: rgba(var(--accent-rgb), 0.16); }
.li-ic { width: 22px; height: 22px; display: inline-grid; place-items: center; position: relative; flex: 0 0 22px; }
.li-ic img { width: 20px; height: 20px; object-fit: contain; border-radius: 4px; grid-area: 1 / 1; }
.li-ic .site-icon-fallback { grid-area: 1 / 1; }
.li-tx { min-width: 0; }
.links-bar { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 2px 0; }
.links-bar a { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 650; color: var(--text); text-decoration: none;
               padding: 6px 12px; border-radius: 999px; background: var(--glass-bg); border: 1px solid var(--glass-border); }
.links-bar a:hover { border-color: rgba(var(--accent-rgb), 0.55); background: rgba(var(--accent-rgb), 0.12); }

/* ---------- admin: link editor ---------- */
.links-editor { max-width: 1020px; }
.links-editor .ed-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.links-editor .dirty-tag { display: none; font-size: 11px; font-weight: 700; color: #ffe36a; background: rgba(255, 214, 10, 0.16);
                           border: 1px solid rgba(255, 214, 10, 0.4); border-radius: 999px; padding: 2px 9px; white-space: nowrap; }
.links-editor.is-dirty .dirty-tag { display: inline-block; }
.links-editor .ed-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 6px 12px; align-items: center;
                        padding: 9px 0; border-top: 1px solid rgba(255, 255, 255, 0.07); }
.links-editor .ed-row > label:first-child { font-weight: 650; font-size: 13.5px; margin: 0; }
.links-editor .ed-row.wide { grid-template-columns: minmax(0, 1fr); }
.links-editor .switch { justify-self: end; }
.links-editor input[type=text], .links-editor select, .ln-row input:not([type=checkbox]) {
    width: 100%; min-width: 0; padding: 8px 11px; border-radius: 11px; color: var(--text);
    background: var(--theme-input-bg, rgba(8, 12, 24, 0.55)); border: 1px solid var(--theme-input-border, var(--glass-border)); }
.links-editor select option { background: var(--theme-option-bg, #101628); color: var(--text); }
.links-editor input:focus-visible, .links-editor select:focus-visible { outline: 2px solid rgba(var(--accent-rgb), .7); outline-offset: 1px; }
.ln-list { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.ln-row { display: grid; grid-template-columns: 52px minmax(0, 1fr) minmax(0, 1.4fr) auto auto auto; gap: 6px; align-items: center;
          background: rgba(255, 255, 255, 0.035); border: 1px solid rgba(255, 255, 255, 0.08); border-radius: 12px; padding: 6px; }
.ln-row .ln-icon { text-align: center; padding-inline: 4px; }
.links-editor .ln-newtab { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 650; white-space: nowrap; margin: 0 4px; line-height: 1; }
.links-editor .ln-site-icon { display:inline-flex; align-items:center; gap:5px; font-size:12px; font-weight:650; white-space:nowrap; margin:0 4px; line-height:1; }
.ln-site-preview { width:20px; height:20px; display:inline-grid; place-items:center; position:relative; }
.ln-site-preview img { width:18px; height:18px; object-fit:contain; border-radius:3px; grid-area:1 / 1; }
.ln-site-preview .site-icon-fallback { grid-area:1 / 1; }
.links-editor label.switch { display: block; margin: 0; }
.ln-newtab .switch { display: inline-block; flex: 0 0 46px; justify-self: auto; }
.ln-move { display: inline-flex; gap: 4px; }
.ln-move .btn[disabled] { opacity: .35; cursor: default; }
.ln-empty { padding: 14px; text-align: center; color: var(--text-dim); border: 1px dashed var(--glass-border); border-radius: 12px; }
.ln-add { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 10px; }
.ed-note { font-size: 12px; margin: 10px 0 0; }
.ed-note code { background: rgba(0, 0, 0, .3); padding: 1px 6px; border-radius: 6px; }
.links-editor .actions { align-items: center; }
@media (max-width: 720px) {
    .links-editor .ed-row { grid-template-columns: minmax(0, 1fr); }
    .links-editor .switch { justify-self: start; }
    .ln-row { grid-template-columns: 48px minmax(0, 1fr) auto; }
    .ln-row .ln-url { grid-column: 1 / -1; }
    .links-editor .ln-row .ln-site-icon { grid-column: 1; grid-row: 3; margin: 0; }
    .links-editor .ln-row .ln-newtab { grid-column: 2; grid-row: 3; margin: 0; }
    .ln-row .ln-move { grid-column: 3; grid-row: 3; justify-self: end; }
}

/* ---------- admin: software updates ---------- */
#updInfo { font-size: 13px; margin-top: 10px; }
.upd-row { padding: 10px 12px; margin-bottom: 8px; border-radius: 12px; background: rgba(255, 255, 255, 0.035); border: 1px solid rgba(255, 255, 255, 0.08); }
.upd-top { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; }
.upd-top .upd-badge { margin-left: auto; }
.upd-ver { margin-top: 4px; color: var(--text-dim); }
.upd-new { margin-top: 6px; }
.upd-commits { margin: 6px 0 0; padding-left: 18px; color: var(--text-dim); font-size: 12.5px; }
.upd-commits li { margin: 2px 0; overflow-wrap: anywhere; }
.upd-hint { margin-top: 6px; font-size: 12.5px; color: #ffe36a; overflow-wrap: anywhere; }
.upd-when { color: var(--text-faint); font-size: 12px; margin-top: 4px; }
.upd-badge { font-size: 11.5px; font-weight: 700; border-radius: 999px; padding: 2px 10px; border: 1px solid var(--glass-border); white-space: nowrap; }
.upd-badge.ok { background: rgba(48, 209, 88, 0.2); color: #7ef0a0; border-color: rgba(48, 209, 88, 0.45); }
.upd-badge.new { background: rgba(10, 132, 255, 0.24); color: #9bd0ff; border-color: rgba(10, 132, 255, 0.5); }
.upd-badge.warn { background: rgba(255, 214, 10, 0.18); color: #ffe36a; border-color: rgba(255, 214, 10, 0.4); }
.upd-badge.bad { background: rgba(255, 69, 58, 0.22); color: #ff8a80; border-color: rgba(255, 69, 58, 0.45); }

.restart-overlay { position: fixed; inset: 0; z-index: 5000; display: grid; place-items: center; background: rgba(5, 8, 18, 0.82);
                   -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.restart-box { display: flex; align-items: center; gap: 14px; padding: 18px 24px; border-radius: 18px; max-width: min(520px, 90vw);
               background: rgba(20, 26, 45, 0.95); border: 1px solid var(--glass-border); box-shadow: var(--glass-shadow); font-weight: 650; }
.restart-spin { width: 22px; height: 22px; flex: 0 0 22px; border-radius: 50%; border: 3px solid rgba(255, 255, 255, 0.18); border-top-color: rgb(var(--accent-rgb));
                animation: restart-spin 0.9s linear infinite; }
@keyframes restart-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .restart-spin { animation-duration: 3s; } }

/* status strip (n8-header.css): "on air" lives there now */
.n8-strip #chipAir { display: inline-flex !important; }
