html[lang="en"] .zh { display: none; }
html:not([lang="en"]) .en { display: none; }

.skip {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.skip:focus,
.skip:focus-visible {
  left: 12px;
  top: 12px;
  width: auto;
  height: auto;
  margin: 0;
  padding: 8px 12px;
  overflow: visible;
  clip: auto;
  z-index: 40;
  background: #39f58a;
  color: #04140c;
  text-decoration: none;
}

.shell-top {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 58px;
  padding: 8px 12px;
  background: rgba(7, 10, 9, 0.94);
  border-bottom: 2px solid #1c3a2a;
}
.shell-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: #e9ffe8;
  flex: 0 0 auto;
}
.shell-brand .shell-logo { display: block; width: 110px; height: 40px; object-fit: contain; }
.shell-labs {
  display: flex;
  align-items: center;
  align-self: flex-end;
  height: 16px;
  margin-bottom: 4px;
  font-family: ui-monospace, monospace;
  font-size: 8px;
  line-height: 1;
  letter-spacing: 0.16em;
  color: #04140c;
  background: #39f58a;
  padding: 0 4px;
}
.shared { display: flex; align-items: center; gap: 6px; flex: 1 1 280px; min-width: 0; }
.shared label { font-family: ui-monospace, monospace; font-size: 11px; letter-spacing: 0.08em; color: #9bb5a4; }
.shared input, .shared select {
  height: 40px;
  border: 2px solid #39f58a;
  background: #050806;
  color: #e9ffe8;
  padding: 0 8px;
  font: inherit;
}
.shared input { flex: 1; min-width: 0; font-family: ui-monospace, monospace; font-size: 13px; }
.shared select { font-family: ui-monospace, monospace; font-size: 12px; }
.shared button, .panel-go {
  height: 40px;
  border: 2px solid #39f58a;
  background: #39f58a;
  color: #04140c;
  padding: 0 12px;
  font-family: ui-monospace, monospace;
  font-size: 12px;
  letter-spacing: 0.06em;
  cursor: pointer;
}
.shell-github {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 36px;
  height: 36px;
  margin-left: auto;
  border: 2px solid #1c3a2a;
}
.shell-github img { display: block; }
.shell-github:hover { background: #10291b; border-color: #39f58a; }
.shell-lang { display: flex; border: 2px solid #1c3a2a; flex: 0 0 auto; }
.shell-top a:focus-visible,
.rail a:focus-visible,
.shared button:focus-visible,
.shared input:focus-visible,
.shared select:focus-visible {
  outline: 2px solid #39f58a;
  outline-offset: 2px;
}
#shell-main .wrap,
#shell-main .frame {
  width: min(1120px, calc(100% - 32px));
  max-width: 100%;
  margin-inline: auto;
  box-sizing: border-box;
}
.shell-lang a {
  text-decoration: none;
  color: #9bb5a4;
  font-family: ui-monospace, monospace;
  font-size: 12px;
  padding: 8px 10px;
}
.shell-lang a[aria-current="page"] { background: #39f58a; color: #04140c; }

.app-shell { display: block; min-width: 0; }
#shell-main { min-width: 0; container-type: inline-size; container-name: shell; }
#shell-main img,
#shell-main video,
#shell-main svg {
  max-width: 100%;
  height: auto;
}
#shell-main pre,
#shell-main .table-wrap {
  max-width: 100%;
  overflow-x: auto;
}
.rail {
  display: flex;
  gap: 0;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  position: sticky;
  top: 58px;
  z-index: 25;
  background: #08110d;
  border-bottom: 2px solid #1c3a2a;
  -webkit-overflow-scrolling: touch;
}
.rail a, .rail .rail-soon {
  flex: 0 0 auto;
  white-space: nowrap;
  text-decoration: none;
  font-family: ui-monospace, monospace;
  font-size: 12px;
  letter-spacing: 0.04em;
  color: #9bb5a4;
  padding: 12px 14px;
  border-right: 1px solid #1c3a2a;
}
.rail a[aria-current="page"] { background: #39f58a; color: #04140c; }
.rail a:hover { color: #e9ffe8; }
.rail .rail-soon { color: #6d8578; opacity: 0.55; cursor: not-allowed; }

@media (min-width: 960px) {
  .app-shell { display: grid; grid-template-columns: 220px minmax(0, 1fr); align-items: start; }
  .rail {
    position: sticky;
    top: 58px;
    max-height: calc(100vh - 58px);
    overflow: auto;
    flex-direction: column;
    border-bottom: 0;
    border-right: 2px solid #1c3a2a;
  }
  .rail a, .rail .rail-soon { border-right: 0; border-bottom: 1px solid #1c3a2a; }
}

@media (max-width: 1100px) {
  .shell-top { flex-wrap: wrap; height: auto; row-gap: 8px; }
  .shared { order: 3; flex: 1 1 100%; }
  .rail { top: 112px; }
}
@media (max-width: 720px) {
  .shell-top { padding: 8px; }
  .shared { flex-wrap: wrap; }
  .shared input { flex: 1 1 100%; }
  .rail { top: auto; position: static; }
  #shell-main .wrap, #shell-main .frame { width: min(1120px, calc(100% - 16px)); }
}

body[data-tool="key"] #shell-main .toolnav { display: none; }
body[data-tool="key"] #shell-main .top { position: static; background: transparent; border-bottom: 0; }
body[data-tool="key"] #shell-main .brand { display: none; }
body[data-tool="key"] #shell-main .controls .seg { display: none; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.intel-strip,
.intel-board { display: none; }
.intel-strip[hidden] { display: none !important; }

.intel-strip {
  align-items: center;
  gap: 10px;
  min-width: 0;
  overflow: hidden;
  padding: 8px 12px;
  background: #08110d;
  border-bottom: 2px solid #1c3a2a;
  color: #e9ffe8;
  font-size: 13px;
}
.intel-strip-link {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1 1 auto;
  color: inherit;
  text-decoration: none;
}
.intel-strip-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.intel-strip time,
.intel-board time {
  flex: 0 0 auto;
  font-family: ui-monospace, monospace;
  font-size: 12px;
  color: #9bb5a4;
}
.intel-strip-all,
.intel-board-all {
  flex: 0 0 auto;
  color: #39f58a;
  font-family: ui-monospace, monospace;
  font-size: 12px;
  letter-spacing: 0.04em;
  text-decoration: none;
}
.intel-strip-dismiss {
  flex: 0 0 auto;
  height: 32px;
  border: 2px solid #1c3a2a;
  background: transparent;
  color: #9bb5a4;
  padding: 0 8px;
  font-family: ui-monospace, monospace;
  font-size: 12px;
  cursor: pointer;
}
.intel-strip .dot,
.intel-board .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #7af0ff;
  display: inline-block;
  flex: 0 0 auto;
}
.intel-strip .dot.high,
.intel-board .dot.high { background: #ff4d8d; }
.intel-strip .dot.medium,
.intel-board .dot.medium { background: #e6b325; }
.intel-strip .chain-tag,
.intel-board .chain-tag {
  flex: 0 0 auto;
  font-family: ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.04em;
  color: #04140c;
  background: #39f58a;
  padding: 0 6px;
}

.intel-board {
  position: sticky;
  top: 58px;
  align-self: start;
  box-sizing: border-box;
  width: 100%;
  max-height: calc(100vh - 74px);
  overflow: auto;
  padding: 16px 14px 24px;
  border-left: 2px solid #1c3a2a;
  background: #08110d;
  color: #e9ffe8;
}
.intel-board-title {
  margin: 0 0 12px;
  font-family: ui-monospace, monospace;
  font-size: 12px;
  letter-spacing: 0.08em;
  color: #39f58a;
}
.intel-board-empty { margin: 0 0 12px; color: #9bb5a4; font-size: 14px; }
.intel-board-list {
  list-style: none;
  margin: 0 0 12px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.intel-board-list a {
  display: grid;
  grid-template-columns: 8px auto minmax(0, 1fr);
  column-gap: 8px;
  row-gap: 4px;
  align-items: center;
  padding: 8px;
  border: 1px solid #1c3a2a;
  color: inherit;
  text-decoration: none;
}
.intel-board-list .dot { grid-row: 1 / span 2; }
.intel-board-name { min-width: 0; overflow-wrap: anywhere; }
.intel-board-list .chain-tag { grid-column: 2 / span 2; justify-self: start; }
.intel-board a:hover .intel-board-name,
.intel-strip-link:hover .intel-strip-title { color: #39f58a; }
.intel-board a:focus-visible,
.intel-strip a:focus-visible,
.intel-strip-dismiss:focus-visible {
  outline: 2px solid #39f58a;
  outline-offset: 2px;
}

@media (min-width: 1280px) {
  body:not([data-tool="intel"]) .app-shell {
    grid-template-columns: 220px minmax(0, 1fr) 300px;
  }
  body:not([data-tool="intel"]) .intel-board { display: block; }
}

@media (max-width: 1279px) {
  body:not([data-tool="intel"]) .intel-strip:not([hidden]) { display: flex; }
}
