/* Top bar extras, notification center, control center, search palette, vault, settings. */

/* Fixed Hub identity, independent of server names and caller location. */
.node-hub-badge { margin-top: 4px; background: var(--accent-soft); color: var(--accent); }
.node-chip { min-width: 0; max-width: 100%; }
.node-chip::before { flex-shrink: 0; }
.node-chip-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.node-chip-hub::before { display: none; }

/* top bar */
.tb-btn.icon { width: 30px; padding: 0; justify-content: center; position: relative; }
.tb-btn[aria-expanded=true] { background: var(--surface-3); }
.tb-search { gap: 8px; color: var(--text-2); font-weight: 500; }
.tb-search .kbd { font-size: 10.5px; padding: 0 5px; }
.tb-hint { font-size: 12.5px; }
.tb-badge { position: absolute; top: 1px; right: 0; min-width: 15px; height: 15px; padding: 0 4px; border-radius: 99px;
  background: var(--danger); color: #fff; font-size: 9.5px; font-weight: 700; line-height: 15px; text-align: center;
  box-shadow: 0 0 0 2px var(--surface); animation: pop-in .3s var(--ease-spring); }
#clock { font-variant-numeric: tabular-nums; font-weight: 550; font-size: 12.5px; color: var(--text-2); }
@keyframes pop-in { from { transform: scale(.4); opacity: 0; } }

/* switch */
input.switch { appearance: none; width: 36px; height: 21px; min-height: 0; padding: 0; border-radius: 99px; border: 0; flex: none;
  background: var(--line-strong); position: relative; cursor: pointer; transition: background var(--t) var(--ease); }
input.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 17px; height: 17px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform var(--t) var(--ease-spring); }
input.switch:checked { background: var(--accent); }
input.switch:checked::after { transform: translateX(15px); border: 0; width: 17px; height: 17px; }
input.switch:disabled { opacity: .45; cursor: default; }

/* segmented control */
.cc-seg { display: flex; padding: 3px; gap: 3px; border-radius: 10px; background: var(--surface-3); }
.cc-seg button { flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px; height: 30px; border: 0; border-radius: 8px;
  background: transparent; color: var(--text-2); cursor: pointer; font-weight: 550; font-size: 12.5px; transition: background var(--t-fast), color var(--t-fast), box-shadow var(--t-fast); }
.cc-seg button[aria-checked=true] { background: var(--surface); color: var(--text); box-shadow: var(--sh-1); }

/* glass panel base */
.nc, .cc { background: var(--glass-strong); backdrop-filter: blur(28px) saturate(1.8); -webkit-backdrop-filter: blur(28px) saturate(1.8);
  border: 1px solid var(--glass-line); box-shadow: var(--sh-win); }

/* notification center */
.nc { position: absolute; top: 8px; right: 8px; bottom: 8px; width: 360px; z-index: 1100; border-radius: var(--r-xl);
  display: flex; flex-direction: column; overflow: hidden; transform: translateX(calc(100% + 20px)); opacity: 0; visibility: hidden;
  transition: transform var(--t-slow) var(--ease), opacity var(--t-slow) var(--ease), visibility 0s linear var(--t-slow); }
.nc.open { transform: none; opacity: 1; visibility: visible; transition: transform var(--t-slow) var(--ease), opacity var(--t-slow) var(--ease); }
.nc-head { display: flex; align-items: flex-start; padding: 18px 14px 6px 20px; }
.nc-clock { flex: 1; }
.nc-time { font-size: 34px; font-weight: 300; letter-spacing: -.02em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.nc-date { color: var(--text-2); margin-top: 2px; }
.nc-widgets { display: grid; gap: 10px; padding: 10px 14px; }
.widget { display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; border-radius: var(--r-lg); border: 1px solid var(--line);
  background: var(--surface); text-align: left; cursor: pointer; transition: transform var(--t) var(--ease), box-shadow var(--t); }
.widget:hover { transform: translateY(-1px); box-shadow: var(--sh-2); }
.widget.attn { border-color: color-mix(in srgb, var(--warn) 45%, transparent); background: color-mix(in srgb, var(--warn) 7%, var(--surface)); }
.w-head { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 12.5px; color: var(--text-2); }
.w-head b { color: var(--text); font-size: 15px; font-variant-numeric: tabular-nums; }
.w-sub { font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.w-nodes { display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: 12.5px; }
.w-node { display: inline-flex; align-items: center; gap: 6px; }
.w-node i { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); }
.w-node.off { color: var(--text-3); }
.w-node.off i { background: var(--text-3); box-shadow: none; }
.nc-sec { display: flex; align-items: center; gap: 4px; padding: 10px 14px 4px 20px; }
.nc-sec h3 { margin: 0; font-size: 13px; }
.nc-list { flex: 1; overflow: auto; padding: 0 10px 14px; }
.nc-group { font-size: 11.5px; font-weight: 600; color: var(--text-3); padding: 10px 10px 4px; }
.notice { display: flex; gap: 10px; width: 100%; padding: 10px; margin: 4px 0; border-radius: 13px; border: 1px solid var(--line); background: var(--surface);
  text-align: left; cursor: pointer; animation: rise-in .3s var(--ease) both; transition: background var(--t-fast); position: relative; }
.notice:hover { background: var(--surface-2); }
.notice.unread::after { content: ""; position: absolute; top: 14px; right: 10px; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.n-ic { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; flex: none; background: var(--accent-soft); color: var(--accent); }
.lvl-ok .n-ic { background: var(--ok-soft); color: var(--ok); }
.lvl-warn .n-ic { background: var(--warn-soft); color: var(--warn); }
.lvl-error .n-ic { background: var(--danger-soft); color: var(--danger); }
.n-body { flex: 1; min-width: 0; display: flex; flex-direction: column; padding-right: 14px; }
.n-title { font-weight: 600; font-size: 13px; }
.n-text { font-size: 12.5px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: anywhere; }
.n-time { font-size: 11px; color: var(--text-3); white-space: nowrap; align-self: flex-end; }

/* control center */
.cc { position: absolute; top: 6px; right: 120px; width: 320px; z-index: 1100; border-radius: var(--r-xl); padding: 12px;
  display: flex; flex-direction: column; gap: 10px; transform-origin: top right; animation: menu-in 180ms var(--ease) both; }
.cc.leaving { animation: dlg-out 140ms var(--ease) both; }
.cc-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.cc-tile { display: flex; gap: 10px; align-items: center; padding: 10px; border-radius: var(--r-lg); border: 1px solid var(--line); background: var(--surface);
  cursor: pointer; text-align: left; min-width: 0; transition: background var(--t-fast); }
.cc-ic { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--surface-3); color: var(--text-2);
  transition: background var(--t), color var(--t); }
.cc-tile.on .cc-ic { background: var(--accent); color: #fff; }
.cc-tl { display: flex; flex-direction: column; min-width: 0; }
.cc-tl b { font-size: 12.5px; }
.cc-tl small { font-size: 11px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cc-card { padding: 10px 12px; border-radius: var(--r-lg); border: 1px solid var(--line); background: var(--surface); }
.cc-label { display: flex; align-items: center; font-size: 12px; font-weight: 600; color: var(--text-2); margin-bottom: 8px; min-height: 22px; }
.cc-switch { display: flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 550; }
.cc-swatches { display: flex; gap: 9px; flex-wrap: wrap; }
.cc-swatches button { width: 24px; height: 24px; border-radius: 50%; border: 0; background: var(--sw); cursor: pointer; position: relative;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .1); transition: transform var(--t-fast) var(--ease-spring); }
.cc-swatches button:hover { transform: scale(1.12); }
.cc-swatches button[aria-checked=true]::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid var(--sw); }
.cc-swatches.lg button { width: 30px; height: 30px; }
.cc-walls { display: grid; grid-template-columns: repeat(6, 1fr); gap: 7px; }
.cc-walls button { aspect-ratio: 1; border-radius: 9px; border: 0; cursor: pointer; box-shadow: inset 0 0 0 1px var(--line-strong);
  transition: transform var(--t-fast) var(--ease-spring); }
.cc-walls button:hover { transform: scale(1.06); }
.cc-walls button[aria-checked=true] { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--accent); }
.cc-more { display: flex; align-items: center; justify-content: center; gap: 8px; height: 34px; border: 0; border-radius: 10px; background: transparent;
  color: var(--text-2); cursor: pointer; font-weight: 550; }
.cc-more:hover { background: var(--surface-3); color: var(--text); }

/* search palette */
dialog.palette { width: min(620px, calc(100vw - 24px)); padding: 0; margin-top: 12vh; border-radius: var(--r-xl); overflow: hidden;
  display: flex; flex-direction: column; max-height: 70vh; background: var(--glass-strong);
  backdrop-filter: blur(30px) saturate(1.8); -webkit-backdrop-filter: blur(30px) saturate(1.8); border: 1px solid var(--glass-line); }
dialog.palette::backdrop { background: rgba(15, 23, 42, .18); backdrop-filter: blur(2px); }
.pal-top { display: flex; align-items: center; gap: 12px; padding: 0 18px; border-bottom: 1px solid var(--line); color: var(--text-3); }
.pal-input { flex: 1; height: 58px; border: 0; background: transparent; font-size: 17px; box-shadow: none !important; padding: 0; color: var(--text); }
.pal-input::-webkit-search-cancel-button { display: none; }
.pal-list { list-style: none; margin: 0; padding: 6px 8px; overflow: auto; flex: 1; }
.pal-group { font-size: 11.5px; font-weight: 600; color: var(--text-3); padding: 10px 10px 4px; }
.pal-item { display: flex; align-items: center; gap: 12px; height: 42px; padding: 0 10px; border-radius: 10px; cursor: pointer; }
.pal-item[aria-selected=true] { background: var(--accent); color: #fff; }
.pal-item[aria-selected=true] .pal-s { color: rgba(255, 255, 255, .78); }
.pal-item[aria-selected=true] .pal-ic { background: rgba(255, 255, 255, .2); color: #fff; }
.pal-ic { width: 22px; height: 22px; border-radius: 6px; display: grid; place-items: center; flex: none; color: var(--fc, var(--text-2));
  background: color-mix(in srgb, var(--fc, var(--text-2)) 13%, transparent); }
.pal-ic .i { width: 14px; height: 14px; }
.pal-t { font-weight: 550; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pal-s { margin-left: auto; font-size: 12px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 50%; }
.pal-empty { padding: 30px; text-align: center; color: var(--text-3); }
.pal-foot { display: flex; gap: 16px; padding: 8px 18px; border-top: 1px solid var(--line); font-size: 11.5px; color: var(--text-3); }
/* vault */
.req-banner { display: flex; align-items: center; gap: 10px; width: calc(100% - 16px); margin: 8px 8px 0; padding: 10px 12px; border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--warn) 40%, transparent); background: var(--warn-soft); color: var(--text); cursor: pointer; text-align: left;
  animation: rise-in .3s var(--ease) both; }
.req-banner > .i:first-child { color: var(--warn); }
.rb-t { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.rb-t b { font-size: 12.5px; }
.rb-t span { font-size: 12px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vdetail { max-width: 640px; animation: fade-in .2s; }
.vhead { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.vhead h2 { margin: 0; font-size: 18px; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vhead .sub { font-size: 12.5px; color: var(--text-3); display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vfields { border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; margin-bottom: 22px; background: var(--surface); }
.frow2 { display: flex; align-items: center; gap: 12px; padding: 10px 12px 10px 16px; min-height: 50px; }
.frow2 + .frow2 { border-top: 1px solid var(--line); }
.frow2 .fl { width: 64px; flex: none; font-size: 12.5px; color: var(--text-3); }
.frow2 .fv { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13.5px; }
.frow2 .fv.masked { letter-spacing: .12em; color: var(--text-2); }
.frow2 .totp { font-size: 20px; font-weight: 600; letter-spacing: .08em; color: var(--accent); flex: none; }
.ring { --p: 100; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 10px; font-weight: 700;
  color: var(--text-2); font-variant-numeric: tabular-nums; margin-right: auto;
  background: radial-gradient(closest-side, var(--surface) 76%, transparent 78%), conic-gradient(var(--accent) calc(var(--p) * 1%), var(--surface-3) 0); }
.masked-notes { white-space: pre-wrap; user-select: text; }
.ai-card { padding: 12px 14px; border-radius: var(--r-lg); border: 1px solid var(--line); background: var(--surface-2); }
.ai-card.on { border-color: color-mix(in srgb, var(--accent) 30%, transparent); background: var(--accent-soft); }
.vlog { display: flex; flex-direction: column; gap: 2px; }
.vlog-row { display: flex; align-items: center; gap: 8px; font-size: 12.5px; padding: 5px 2px; }
.vlog-row .i { width: 14px; height: 14px; color: var(--text-3); }
.secret-input { display: flex; align-items: center; gap: 4px; position: relative; }
.secret-input input { flex: 1; min-width: 0; padding-right: 38px; }
.secret-input .btn { position: absolute; right: 3px; }
.label-row { display: flex; align-items: center; gap: 8px; }
.label-row label { font-weight: 550; font-size: 12.5px; color: var(--text-2); }
.label-row input[type=range] { flex: 1; accent-color: var(--accent); padding: 0; min-height: 0; border: 0; box-shadow: none; }
.pw-meter { display: flex; align-items: center; gap: 10px; font-size: 11.5px; color: var(--text-3); }
.pw-meter i { flex: 1; height: 4px; border-radius: 4px; background: var(--surface-3); position: relative; overflow: hidden; }
.pw-meter i::after { content: ""; position: absolute; inset: 0; width: calc(var(--w, 0) * 1%); border-radius: 4px; background: var(--c, var(--text-3));
  transition: width var(--t-slow) var(--ease), background var(--t); }
.pw-meter[data-s="1"] i { --w: 25; --c: var(--danger); } .pw-meter[data-s="2"] i { --w: 50; --c: var(--warn); }
.pw-meter[data-s="3"] i { --w: 75; --c: #22c55e; } .pw-meter[data-s="4"] i { --w: 100; --c: var(--ok); }
.gen-pop { width: 290px; padding: 12px; display: flex; flex-direction: column; gap: 4px; }
.gen-out { padding: 10px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--line); overflow-wrap: anywhere; font-size: 13px; margin-bottom: 6px; user-select: all; }
details.more { margin-top: 10px; }
details.more summary { cursor: pointer; color: var(--text-2); font-size: 12.5px; padding: 4px 0; }

/* settings */
.set { display: flex; height: 100%; }
.set-nav { width: 180px; flex: none; padding: 12px 8px; border-right: 1px solid var(--line); background: var(--surface-2); display: flex; flex-direction: column; gap: 2px; }
.set-nav button { display: flex; align-items: center; gap: 10px; height: 34px; padding: 0 10px; border: 0; border-radius: 8px; background: transparent;
  cursor: pointer; color: var(--text-2); font-weight: 550; text-align: left; }
.set-nav button:hover { background: var(--surface-3); color: var(--text); }
.set-nav button[aria-selected=true] { background: var(--accent-soft); color: var(--accent); }
.set-pane { flex: 1; overflow: auto; padding: 20px 24px; animation: fade-in .2s; }
.wall-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 12px; }
.wall-grid button { display: flex; flex-direction: column; gap: 6px; border: 0; background: transparent; padding: 0; cursor: pointer; font-size: 12px; color: var(--text-2); }
.wall-thumb { aspect-ratio: 16 / 10; border-radius: 10px; box-shadow: inset 0 0 0 1px var(--line-strong); display: grid; place-items: center; color: var(--text-3);
  transition: transform var(--t) var(--ease-spring), box-shadow var(--t); }
.wall-grid button:hover .wall-thumb { transform: translateY(-2px); }
.wall-grid button[aria-checked=true] .wall-thumb { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--accent); }
.wall-grid button[aria-checked=true] { color: var(--text); font-weight: 600; }
.wall-add .wall-thumb { border: 1.5px dashed var(--line-strong); box-shadow: none; }

/* image wallpaper: keep home labels readable */
[data-wall=image] .launcher .nm, [data-wall=image] .home-section h2 { color: #fff; text-shadow: 0 1px 3px rgba(0, 0, 0, .55); }

@media (max-width: 760px), (pointer: coarse) and (max-width: 1024px) {
  .nc { inset: 0; width: auto; border-radius: 0; padding-top: env(safe-area-inset-top); }
  .tb-btn.icon { width: 40px; height: 36px; }
  .tb-badge { top: 3px; right: 4px; }
  dialog.palette { margin: 0 0 auto; width: 100vw; max-width: 100vw; max-height: 85dvh; border-radius: 0 0 22px 22px; padding-top: env(safe-area-inset-top); }
  dialog.palette[open] { animation: pal-in var(--t-slow) var(--ease) both; }
  @keyframes pal-in { from { transform: translateY(-30px); opacity: 0; } }
  .pal-foot { display: none; }
  .set { flex-direction: column; }
  .set-nav { width: auto; flex-direction: row; border-right: 0; border-bottom: 1px solid var(--line); padding: 8px; overflow-x: auto; }
  .set-nav button { flex: 1; justify-content: center; }
  .set-pane { padding: 16px; }
  .frow2 .fl { width: 52px; }
}
