/* Global dark navigation bar */
.topnav {
  height: var(--nav-h);
  background: var(--nav-bg);
  color: var(--t-on-dark);
  display: flex;
  align-items: center;
  padding: 0 8px 0 10px;
  gap: 2px;
  position: relative;
  z-index: 1200;
  user-select: none;
}
.topnav .tn-item {
  display: inline-flex; align-items: center; gap: 6px;
  height: 32px; padding: 0 9px; margin: 0 1px;
  border-radius: 4px; border: 1px solid transparent;
  color: var(--t-on-dark); font-size: 14px; cursor: pointer;
  background: transparent; white-space: nowrap;
}
.topnav .tn-item:hover { background: var(--nav-bg-hover); }
.topnav .tn-item:focus-visible { outline: 2px solid #fff; outline-offset: 1px; }
.topnav .tn-item.tn-active { background: var(--nav-bg-active); }
.topnav .tn-logo { padding: 0 10px 0 4px; display: flex; align-items: center; gap: 8px; cursor: pointer; }
.topnav .tn-logo svg { width: 62px; height: 22px; }
.topnav .tn-divider { width: 1px; height: 22px; background: rgba(255,255,255,0.22); margin: 0 6px; }
.topnav .tn-search-wrap {
  flex: 0 1 660px; min-width: 220px; margin: 0 8px 0 10px;
  position: relative;
}
.topnav .tn-search {
  width: 100%; height: 30px;
  background: #fff; border-radius: 4px; border: none;
  padding: 0 10px 0 32px;
  font-size: 13.5px; color: var(--t-body);
  font-family: inherit;
}
.topnav .tn-search::placeholder { color: var(--t-muted); }
.topnav .tn-search:focus { outline: 2px solid #00a1c9; outline-offset: -1px; }
.topnav .tn-search-icon {
  position: absolute; left: 9px; top: 7px; color: var(--t-secondary); pointer-events: none;
}
.topnav .tn-search-kbd {
  position: absolute; right: 9px; top: 6px; display: flex; gap: 4px; align-items: center; pointer-events: none;
}
.topnav .tn-search-kbd kbd {
  font-family: inherit; font-size: 11px; color: var(--t-muted);
  border: 1px solid var(--b-divider); border-radius: 4px; padding: 1px 5px; background: #fafafa;
}
.topnav .tn-right { margin-left: auto; display: flex; align-items: center; gap: 2px; }
.topnav .tn-item .tn-caret { opacity: 0.85; }
.topnav .tn-region-label { display: flex; flex-direction: column; line-height: 13px; align-items: flex-start; }
.topnav .tn-region-label .r-name { font-size: 12.5px; }
.topnav .tn-region-label .r-code { font-size: 10.5px; color: var(--t-on-dark-dim); }
.topnav .tn-region-label.single .r-name { font-size: 13.5px; }
.topnav .tn-badge-dot {
  position: absolute; top: 3px; right: 2px;
  min-width: 14px; height: 14px; padding: 0 3px;
  background: var(--s-error); color: #fff; font-size: 9.5px; line-height: 14px;
  border-radius: 8px; text-align: center; font-weight: 600;
}
.topnav .tn-icon-btn { position: relative; }

/* ---------- dropdown panels (services / region / account / support) ---------- */
.tn-panel {
  position: absolute; top: calc(var(--nav-h) - 2px);
  background: #fff; color: var(--t-body);
  border-radius: 0 0 6px 6px;
  box-shadow: var(--shadow-dropdown);
  z-index: 1250; display: none;
}
.tn-panel.open { display: block; animation: fadein 0.12s ease-out; }

/* services mega menu */
.tn-services-panel { left: 0; width: min(1060px, calc(100vw - 16px)); }
.svc-panel-head {
  padding: 12px 16px 8px; display: flex; align-items: center; gap: 12px;
}
.svc-search-wrap { position: relative; flex: 1; }
.svc-search-wrap .svc-search-icon { position: absolute; left: 10px; top: 9px; color: var(--t-secondary); }
.svc-panel-head input {
  width: 100%; height: 34px; border: 1px solid var(--b-input); border-radius: 8px;
  padding: 0 10px 0 32px; font-size: 14px; font-family: inherit;
}
.svc-panel-head input:focus { border-color: var(--b-focus); outline: 3px solid rgba(9,114,211,0.18); }
.svc-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 0 22px;
  padding: 6px 16px 16px; max-height: calc(100vh - 140px); overflow-y: auto;
}
.svc-col h4 {
  font-size: 13px; color: var(--t-body); margin: 12px 0 4px; padding-left: 10px;
  display: flex; align-items: center; gap: 6px;
}
.svc-col ul { margin-bottom: 6px; }
.svc-col a, .svc-item {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 10px; border-radius: 6px; color: var(--t-body); font-size: 13.5px;
  cursor: pointer;
}
.svc-col a:hover, .svc-col a.hl, .svc-item:hover, .svc-item.hl { background: var(--bg-selected); text-decoration: none; }
.svc-col a .svc-ico { width: 18px; height: 18px; flex: none; display: grid; place-items: center; }
.svc-col a.dim { display: none; }
.svc-fav-head { color: var(--t-secondary); font-weight: 400; font-size: 12px; padding-left: 10px; }

/* search results dropdown */
.tn-search-results {
  position: absolute; top: calc(var(--nav-h) - 4px); left: 50%; transform: translateX(-50%);
  width: min(680px, calc(100vw - 24px));
  background: #fff; color: var(--t-body); border-radius: 0 0 8px 8px;
  box-shadow: var(--shadow-dropdown); z-index: 1260; display: none;
  max-height: 70vh; overflow-y: auto; padding: 6px 0 10px;
}
.tn-search-results.open { display: block; }
.sr-head {
  font-size: 12.5px; font-weight: 700; color: var(--t-body);
  padding: 10px 18px 4px; text-transform: none;
}
.sr-item {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 18px; cursor: pointer; font-size: 14px;
}
.sr-item .sr-sub { color: var(--t-secondary); font-size: 12.5px; margin-left: auto; text-align: right; }
.sr-item.selected, .sr-item:hover { background: var(--bg-selected); }
.sr-item .svc-ico { width: 20px; height: 20px; flex: none; display: grid; place-items: center; border-radius: 4px; }
.sr-empty { padding: 18px; color: var(--t-secondary); text-align: center; }
.sr-kbd-hint { padding: 8px 18px 2px; color: var(--t-muted); font-size: 12px; display: flex; gap: 14px; }

/* region menu */
.tn-region-panel { right: 8px; width: 380px; }
.region-search { padding: 12px 14px 6px; position: relative; }
.region-search input {
  width: 100%; height: 32px; border: 1px solid var(--b-input); border-radius: 8px;
  padding: 0 10px; font-family: inherit; font-size: 14px;
}
.region-search input:focus { border-color: var(--b-focus); outline: 3px solid rgba(9,114,211,0.18); }
.region-list { max-height: 420px; overflow-y: auto; padding: 4px 8px 10px; }
.region-group-label {
  font-size: 12px; font-weight: 700; color: var(--t-secondary);
  padding: 10px 8px 4px; text-transform: uppercase; letter-spacing: 0.3px;
}
.region-item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 7px 10px; border-radius: 6px; cursor: pointer; border: none;
  background: none; font-size: 14px; font-family: inherit; color: var(--t-body); text-align: left;
}
.region-item:hover { background: var(--bg-hover); }
.region-item .ri-check { width: 16px; flex: none; color: var(--s-ok); visibility: hidden; }
.region-item.current .ri-check { visibility: visible; }
.region-item .ri-name { flex: 1; }
.region-item .ri-code { color: var(--t-secondary); font-size: 12.5px; }
.region-optout { padding: 10px 16px; border-top: 1px solid var(--b-divider); color: var(--t-secondary); font-size: 12px; }

/* account menu */
.tn-account-panel { right: 8px; width: 320px; padding: 6px; }
.acc-head { padding: 10px 12px; display: flex; align-items: center; gap: 10px; }
.acc-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg, #4c6ef5, #0f4b74); color: #fff;
  display: grid; place-items: center; font-weight: 700; font-size: 13px;
}
.acc-name { font-weight: 600; }
.acc-mail { color: var(--t-secondary); font-size: 12.5px; }
.acc-divider { height: 1px; background: var(--b-divider); margin: 6px 8px; }
.acc-item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 8px 12px; border-radius: 6px; border: none; background: none;
  font-size: 14px; font-family: inherit; color: var(--t-body); cursor: pointer; text-align: left;
}
.acc-item:hover { background: var(--bg-hover); }

/* support menu */
.tn-support-panel { right: 8px; width: 260px; padding: 6px; }

/* notifications sliding panel */
.notif-panel {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(440px, 100vw);
  background: #fff; z-index: 1400; box-shadow: -4px 0 18px rgba(0,0,0,0.25);
  display: flex; flex-direction: column;
  transform: translateX(100%); transition: transform 0.22s ease-out;
}
.notif-panel.open { transform: translateX(0); }
.notif-mask { position: fixed; inset: 0; background: rgba(22, 25, 31, 0.7); z-index: 1390; opacity: 0; pointer-events: none; transition: opacity 0.2s; }
.notif-mask.open { opacity: 1; pointer-events: auto; }
.notif-head {
  display: flex; align-items: center; gap: 10px; padding: 14px 18px;
  border-bottom: 1px solid var(--b-divider);
}
.notif-head h3 { flex: 1; font-size: 16px; font-weight: 700; }
.notif-sub { padding: 8px 18px; border-bottom: 1px solid var(--b-divider); display: flex; gap: 8px; align-items: center; color: var(--t-secondary); font-size: 13px; }
.notif-list { flex: 1; overflow-y: auto; }
.notif-item { display: flex; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--b-divider); }
.notif-item.unread { background: #f7fbff; }
.notif-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--b-focus); margin-top: 6px; flex: none; }
.notif-item.read .notif-dot { background: transparent; border: 1px solid var(--b-divider); }
.notif-item .n-title { font-weight: 600; margin-bottom: 2px; }
.notif-item .n-body { color: var(--t-secondary); font-size: 13px; }
.notif-item .n-time { color: var(--t-muted); font-size: 12px; margin-top: 6px; }
.notif-empty { padding: 48px 24px; text-align: center; color: var(--t-secondary); }

/* CloudShell terminal overlay */
.cloudshell {
  position: fixed; left: 0; right: 0; bottom: 0; height: 46vh; min-height: 320px;
  background: #0d1420; z-index: 1350; box-shadow: 0 -6px 22px rgba(0,0,0,0.4);
  border-top: 2px solid var(--aws-orange);
  transform: translateY(100%); transition: transform 0.25s ease-out;
  display: flex; flex-direction: column; color: #d5dbdd;
  font-family: "SF Mono", Menlo, Consolas, monospace; font-size: 13px;
}
.cloudshell.open { transform: translateY(0); }
.cloudshell .cs-bar {
  display: flex; align-items: center; gap: 12px; padding: 6px 14px;
  background: #131c2b; border-bottom: 1px solid #223046;
}
.cloudshell .cs-bar .cs-title { color: #f2f3f3; font-family: inherit; font-weight: 600; }
.cloudshell .cs-bar button.cs-close {
  margin-left: auto; background: none; border: none; color: #c3cbd5; cursor: pointer;
  font-size: 16px; padding: 2px 8px; border-radius: 4px;
}
.cloudshell .cs-bar button.cs-close:hover { background: #223046; color: #fff; }
.cloudshell .cs-body { flex: 1; overflow-y: auto; padding: 10px 16px; line-height: 1.5; }
.cloudshell .cs-line .p { color: #4cc38a; }
.cloudshell .cs-line .c { color: #8d9aa7; }
.cloudshell .cs-input-row { display: flex; }
.cloudshell #cs-input {
  flex: 1; background: transparent; border: none; color: #d5dbdd;
  font-family: inherit; font-size: 13px; caret-color: #4cc38a;
}
.cloudshell #cs-input:focus { outline: none; }
