:root {
  --bg: #ffffff;
  --bg-soft: #f7f7f8;
  --panel: #ffffff;
  --panel-hover: #f2f3f5;
  --accent: #ff0000;
  --accent-strong: #ff0000;
  --text: #282828;
  --text-dim: #747474;
  --border: #e6e6e8;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background: #ffffff;
  color: var(--text);
  height: 100vh;
  overflow: hidden;
}

.top-header {
  height: 72px;
  display: block;
  padding: 0;
  background: var(--accent);
  position: sticky;
  top: 0;
  z-index: 10;
}

.top-header-inner {
  position: absolute;
  top: 8px;
  right: 8px;
  bottom: 8px;
  left: 8px;
  background: #ffffff;
  border-radius: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.25rem;
}

.logo-link {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.55rem;
  height: 90%;
  text-decoration: none;
  color: var(--accent);
  white-space: nowrap;
}

.logo-svg {
  display: block;
  width: auto;
  height: 100%;
}

.logo-title {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--accent);
}

.logo-disclaimer {
  font-size: 50%;
}

.logo-text-stack {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 0;
  line-height: 1;
}

.logo-subtitle {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: lowercase;
  color: var(--accent);
  margin-bottom: 0;
}

.portal-btn {
  text-decoration: none;
  border: 1px solid var(--accent);
  color: #ffffff;
  background: var(--accent);
  padding: 0.55rem 0.9rem;
  border-radius: 999px;
  font-weight: 600;
  transition: background-color 0.2s ease, color 0.2s ease;
}

#zulu-time-value {
  margin-left: auto;
  margin-right: 0.75rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: #1f2937;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.portal-btn:hover {
  background: #ffffff;
  color: var(--accent);
}

.app-shell {
  display: grid;
  grid-template-columns: 300px 1fr;
  height: calc(100vh - 72px);
  min-height: 0;
}

.sidebar {
  border-right: 1px solid var(--border);
  background: var(--bg-soft);
  padding: 1rem 0.75rem 1.25rem;
  overflow-y: auto;
  -ms-overflow-style: none;
  scrollbar-width: none;
  min-height: 0;
}

.sidebar::-webkit-scrollbar {
  display: none;
}

.section-nav {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  padding: 0 0.25rem;
}

.sidebar-search {
  position: relative;
  display: flex;
  align-items: center;
  margin: 0 0.25rem 1rem;
}

.search-icon {
  position: absolute;
  left: 12px;
  width: 16px;
  height: 16px;
  color: #969696;
  pointer-events: none;
}

.search-icon svg {
  display: block;
  width: 16px;
  height: 16px;
  fill: currentColor;
}

#nav-search {
  width: 100%;
  border: 1px solid #dadce0;
  border-radius: 14px;
  height: 44px;
  background: #ffffff;
  font-size: 17px;
  color: #333333;
  padding: 0 68px 0 38px;
  outline: none;
}

#nav-search::-webkit-search-cancel-button,
#nav-search::-webkit-search-decoration {
  -webkit-appearance: none;
  appearance: none;
}

#nav-search::-ms-clear,
#nav-search::-ms-reveal {
  display: none;
  width: 0;
  height: 0;
}

#nav-search::placeholder {
  color: #9e9e9e;
}

#nav-search:focus {
  border-color: #c9c9cc;
  box-shadow: 0 0 0 2px rgba(23, 23, 23, 0.03);
}

.search-shortcut {
  position: absolute;
  right: 12px;
  color: #767676;
  font-size: 13px;
  font-weight: 600;
}

.search-clear {
  position: absolute;
  right: 11px;
  width: 26px;
  height: 26px;
  border: 0;
  border-radius: 999px;
  background: #eceef2;
  color: #5e6570;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}

.search-clear[hidden] {
  display: none;
}

.search-clear:hover {
  background: #dde2ea;
  color: #434a55;
}

.search-clear:focus-visible {
  outline: 2px solid #c8d3e6;
  outline-offset: 1px;
}

.nav-group {
  margin: 0;
}

.nav-group-title {
  margin: 0 0 0.5rem;
  display: flex;
  align-items: center;
  gap: 0;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.02em;
}

.nav-group-items {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.section-tab {
  width: calc(100% + 2rem);
  margin-left: -1rem;
  margin-right: -1rem;
  border: 0;
  background: transparent;
  color: #505050;
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-align: left;
  padding: 0.66rem 1.75rem;
  border-radius: 0;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1.2;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.section-tab:hover {
  background: var(--panel-hover);
  color: #303030;
}

.section-tab:active {
  transform: translateY(1px);
}

.section-tab.active {
  background: var(--accent);
  color: #ffffff;
  font-weight: 700;
}

.section-tab-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.section-tab-badge {
  margin-left: 0.65rem;
  background: var(--accent);
  color: #ffffff;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1;
  border-radius: 999px;
  padding: 0.24rem 0.45rem;
  letter-spacing: 0.03em;
}

.section-tab.active .section-tab-badge {
  background: #ffffff;
  color: var(--accent);
}

.section-empty {
  margin: 0;
  color: var(--text-dim);
  padding: 0 0.5rem;
}

.content {
  padding: 1.8rem 2.2rem 3rem;
  background: #ffffff;
  overflow-y: auto;
  min-height: 0;
}

.doc-body {
  margin-top: 0.2rem;
  padding: 0;
  max-width: 860px;
}

.doc-header {
  margin-bottom: 1rem;
}

.doc-header h1 {
  margin: 0;
  color: var(--accent);
  font-size: 2rem;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.doc-subtitle {
  margin: 0.45rem 0 0;
  color: var(--text-dim);
  font-size: 0.97rem;
}

.doc-section + .doc-section {
  margin-top: 0.85rem;
}

.doc-section {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #ffffff;
  overflow: hidden;
}

.doc-section summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 1rem;
  background: #fafafa;
}

.doc-section summary::-webkit-details-marker {
  display: none;
}

.doc-section h3 {
  margin: 0;
  color: var(--text);
  font-size: 1.03rem;
  font-weight: 700;
}

.doc-section-static > h3 {
  padding: 0.95rem 1rem 0;
}

.doc-section-static {
  border: 0;
  border-radius: 0;
  background: transparent;
  overflow: visible;
}

.doc-section-static .doc-section-content {
  border-top: 0;
  padding-top: 0.55rem;
}

.doc-section-alert {
  border: 1px solid #e4c857;
  background: #fff6bf;
  border-radius: 12px;
  overflow: hidden;
}

.doc-body .doc-section-alert > h3 {
  margin: 0;
  padding: 0.9rem 1rem 0;
  color: var(--accent);
}

.doc-section-alert .doc-section-content {
  border-top: 0;
  padding-top: 0.55rem;
}

.doc-section-alert .doc-section-content p {
  color: #5f4700;
}

.doc-section-chevron {
  width: 9px;
  height: 9px;
  border-right: 2px solid #777777;
  border-bottom: 2px solid #777777;
  transform: rotate(45deg);
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.doc-section[open] .doc-section-chevron {
  transform: rotate(-135deg);
}

.doc-section-content {
  padding: 0.95rem 1rem 1rem;
  border-top: 1px solid var(--border);
}

.doc-body h3 {
  margin: 0 0 0.5rem;
  color: var(--text);
}

.doc-body p {
  margin: 0;
  line-height: 1.7;
  color: #2f2f2f;
}

.quicklinks {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 1rem;
}

.quicklink-btn {
  border: 1px solid #d8dde6;
  background: #f3f5f8;
  color: #123f8c;
  border-radius: 16px;
  width: 220px;
  height: 110px;
  padding: 1.1rem 1rem;
  font-size: 1.15rem;
  font-weight: 700;
  cursor: pointer;
  text-align: left;
  display: inline-flex;
  align-items: flex-end;
  justify-content: flex-start;
  overflow: hidden;
  word-break: break-word;
  line-height: 1.2;
  box-shadow: 0 4px 14px rgba(17, 24, 39, 0.08);
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.quicklink-btn:hover {
  border-color: #c8d3e6;
  background: #eef2f7;
  color: #0f3478;
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(17, 24, 39, 0.12);
}

@media (max-width: 860px) {
  .top-header {
    height: 72px;
  }

  .top-header-inner {
    padding: 0 0.75rem;
    gap: 0.75rem;
    flex-wrap: nowrap;
  }

  .app-shell {
    grid-template-columns: 1fr;
    height: calc(100vh - 72px);
    min-height: 0;
  }

  .sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--border);
    max-height: 40vh;
  }

  .section-tab {
    font-size: 1rem;
  }

  .nav-group-title {
    font-size: 1.2rem;
  }
}
