:root {
  --bg: #0b1220;
  --panel: #111a2e;
  --panel2: #0f1730;
  --text: #e8eefc;
  --muted: #b7c3e6;
  --accent: #6aa6ff;
  --border: rgba(106, 166, 255, 0.18);
  --shadow: rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: radial-gradient(1200px 600px at 18% 0%, #17254a 0%, var(--bg) 60%);
  color: var(--text);
}

a {
  color: inherit;
}

.container {
  max-width: 1600px;
  margin: 0 auto;
  padding: 18px 32px 28px;
  width: 100%;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(10px);
  background: rgba(11, 18, 32, 0.78);
  border-bottom: 1px solid var(--border);
}

.topbar-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  max-width: 1600px;
  margin: 0 auto;
  padding: 0 32px;
}

.brand {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px 0;
  min-width: 220px;
}

.brand-title {
  font-weight: 800;
  letter-spacing: 0.2px;
}

.brand-subtitle {
  font-size: 12px;
  color: var(--muted);
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tab {
  display: inline-flex;
  align-items: center;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  text-decoration: none;
  color: var(--muted);
  background: rgba(17, 26, 46, 0.28);
}

.tab:hover {
  color: var(--text);
  border-color: rgba(106, 166, 255, 0.35);
}

.tab.active {
  color: #061027;
  background: var(--accent);
  border-color: transparent;
}

.layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 24px;
  align-items: start;
}

.sidebar {
  position: sticky;
  top: 74px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(17, 26, 46, 0.7);
  box-shadow: 0 10px 30px var(--shadow);
  overflow: hidden;
}

.sidebar-toggle {
  display: none;
  width: 100%;
  padding: 12px;
  background: rgba(15, 23, 48, 0.7);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-weight: 700;
  cursor: pointer;
  margin-bottom: 12px;
}

.sidebar-toggle:hover {
  background: rgba(106, 166, 255, 0.12);
}

.sidebar header {
  padding: 14px 14px 10px;
  border-bottom: 1px solid var(--border);
  background: rgba(15, 23, 48, 0.7);
}

.sidebar-title {
  font-weight: 800;
  margin: 0;
}

.sidebar small {
  color: var(--muted);
}

.navlist {
  list-style: none;
  margin: 0;
  padding: 8px;
}

.navlist a {
  display: block;
  padding: 10px 10px;
  border-radius: 10px;
  text-decoration: none;
  color: var(--muted);
}

.navlist a:hover {
  background: rgba(106, 166, 255, 0.08);
  color: var(--text);
}

.navlist a.active {
  background: rgba(106, 166, 255, 0.16);
  color: var(--text);
  border: 1px solid rgba(106, 166, 255, 0.25);
}

.content {
  min-width: 0;
}

.content .card + .card {
  margin-top: 20px;
}

.link-list {
  list-style: none;
  padding-left: 0;
  margin: 0;
}

.link-list li {
  margin-bottom: 12px;
}

.link-list a {
  display: block;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(15, 23, 48, 0.4);
  text-decoration: none;
  color: var(--text);
  transition: all 0.2s;
  font-weight: 500;
}

.link-list a:hover {
  background: rgba(15, 23, 48, 0.7);
  border-color: rgba(106, 166, 255, 0.4);
  color: var(--text);
}

.hero {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  background: linear-gradient(180deg, rgba(17, 26, 46, 0.8), rgba(17, 26, 46, 0.45));
  box-shadow: 0 10px 30px var(--shadow);
}

.hero h1 {
  margin: 0 0 8px;
  letter-spacing: 0.1px;
}

.hero p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.page-context {
  display: inline-block;
  margin-top: 6px;
  font-size: 12px;
  color: rgba(183, 195, 230, 0.6);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 500;
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.card {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px;
  background: rgba(17, 26, 46, 0.65);
}

.card h2,
.card h3 {
  margin: 0 0 10px;
}

.card p,
.card li {
  color: var(--muted);
  line-height: 1.5;
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed rgba(106, 166, 255, 0.25);
}

.pill {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(15, 23, 48, 0.65);
  color: var(--muted);
  font-size: 13px;
}

.actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.btn {
  appearance: none;
  border: 1px solid var(--border);
  background: rgba(106, 166, 255, 0.12);
  color: var(--text);
  padding: 9px 12px;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 700;
}

.btn:hover {
  border-color: rgba(106, 166, 255, 0.35);
  background: rgba(106, 166, 255, 0.16);
}

.btn.primary {
  background: var(--accent);
  color: #061027;
  border-color: transparent;
}

.table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 12px;
  overflow: hidden;
  border-radius: 12px;
}

.table th,
.table td {
  border: 1px solid rgba(106, 166, 255, 0.18);
  padding: 12px 14px;
  text-align: left;
  vertical-align: top;
}

.table th {
  background: rgba(15, 23, 48, 0.75);
  color: var(--text);
}

.table td {
  color: var(--muted);
}

.footer {
  color: var(--muted);
  border-top: 1px solid var(--border);
  margin-top: 22px;
  padding-top: 14px;
  font-size: 12px;
}

.note {
  border-left: 4px solid rgba(106, 166, 255, 0.6);
  background: rgba(106, 166, 255, 0.08);
  padding: 12px 12px;
  border-radius: 10px;
  color: var(--muted);
  line-height: 1.5;
}

.kbd {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  border: 1px solid rgba(106, 166, 255, 0.25);
  background: rgba(15, 23, 48, 0.65);
  padding: 2px 6px;
  border-radius: 6px;
  color: var(--text);
}

.checklist-table th,
.checklist-table td {
  padding: 12px 10px;
}

.checklist-table td:first-child {
  text-align: center;
  font-size: 18px;
}

/* Mobile and tablet responsiveness */
@media (max-width: 980px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
  }

  .grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .container {
    padding: 12px 16px 20px;
  }

  .topbar-inner {
    padding: 0 16px;
    flex-wrap: wrap;
    gap: 12px;
  }

  .brand {
    min-width: auto;
    padding: 8px 0;
  }

  .tabs {
    gap: 6px;
  }

  .tab {
    padding: 10px 14px;
    font-size: 14px;
    min-height: 44px;
  }

  .sidebar-toggle {
    display: block;
  }

  .sidebar {
    position: static;
    margin-bottom: 16px;
  }

  .sidebar.collapsed .navlist {
    display: none;
  }

  .sidebar.collapsed .sidebar header {
    border-bottom: none;
  }

  .btn {
    padding: 12px 16px;
    min-height: 44px;
    font-size: 15px;
  }

  .table {
    font-size: 14px;
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .table thead,
  .table tbody,
  .table tr {
    display: block;
  }

  .table th,
  .table td {
    display: block;
    padding: 8px;
    text-align: left;
    border: none;
    border-bottom: 1px solid var(--border);
  }

  .table thead {
    display: none;
  }

  .table th {
    background: rgba(15, 23, 48, 0.9);
    font-weight: 700;
  }


  .checklist-table {
    display: table;
  }

  .checklist-table thead,
  .checklist-table tbody,
  .checklist-table tr {
    display: table-row;
  }

  .checklist-table th,
  .checklist-table td {
    display: table-cell;
    border: 1px solid var(--border);
  }

  .table td[colspan] {
    padding: 8px;
  }

  ol,
  ul {
    padding-left: 20px;
  }

  li {
    margin-bottom: 6px;
  }

  .card {
    padding: 16px;
  }

  .hero {
    padding: 18px;
  }

  .meta-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 10px 12px 16px;
  }

  .topbar-inner {
    flex-direction: column;
    align-items: flex-start;
    padding: 0 12px;
  }

  .tabs {
    width: 100%;
    flex-direction: column;
  }

  .tab {
    width: 100%;
    justify-content: center;
  }

  .actions {
    width: 100%;
    flex-direction: column;
  }

  .btn {
    width: 100%;
  }

  h1 {
    font-size: 24px;
  }

  h2 {
    font-size: 20px;
  }

  h3 {
    font-size: 18px;
  }
}

@media print {
  :root {
    --bg: #ffffff;
    --panel: #ffffff;
    --text: #000000;
    --muted: #1f2937;
    --border: rgba(0, 0, 0, 0.15);
  }

  body {
    background: #ffffff !important;
    color: #000000 !important;
  }

  .topbar,
  .sidebar,
  .actions,
  .tab {
    display: none !important;
  }

  .container {
    max-width: none;
    padding: 0;
  }

  .hero,
  .card {
    box-shadow: none !important;
    background: #ffffff !important;
  }

  a {
    text-decoration: none;
  }
}

/* Abstract Technical Theme */
.theme-abstract {
  --bg: #050810;
  --panel: #0a0f1a;
  --panel2: #080c14;
  --text: #d4dae8;
  --muted: #6b7a9a;
  --accent: #5a8fd8;
  --border: rgba(90, 143, 216, 0.12);
  --shadow: rgba(0, 0, 0, 0.6);
  --glow: rgba(90, 143, 216, 0.08);
  --grain-opacity: 0.03;
}

.theme-abstract body {
  background: 
    radial-gradient(ellipse 1400px 800px at 20% 0%, rgba(10, 20, 35, 0.4) 0%, transparent 50%),
    linear-gradient(180deg, #050810 0%, #080c14 100%);
  position: relative;
}

.theme-abstract body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: 
    repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(90, 143, 216, var(--grain-opacity)) 2px, rgba(90, 143, 216, var(--grain-opacity)) 4px),
    repeating-linear-gradient(90deg, transparent, transparent 2px, rgba(90, 143, 216, var(--grain-opacity)) 2px, rgba(90, 143, 216, var(--grain-opacity)) 4px);
  pointer-events: none;
  z-index: 0;
  opacity: 0.5;
}

@media (prefers-reduced-motion: reduce) {
  .theme-abstract body::before {
    display: none;
  }
}

.theme-abstract .topbar {
  background: rgba(5, 8, 16, 0.85);
  backdrop-filter: blur(16px) saturate(180%);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 0 rgba(90, 143, 216, 0.06);
}

.theme-abstract .brand-title {
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-size: inherit;
}

.theme-abstract .brand-subtitle {
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: inherit;
  opacity: 0.65;
}

.theme-abstract .tab {
  background: rgba(10, 15, 26, 0.4);
  border-color: var(--border);
  color: var(--muted);
  font-weight: 500;
  letter-spacing: 0.02em;
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.theme-abstract .tab:hover {
  border-color: rgba(90, 143, 216, 0.25);
  background: rgba(10, 15, 26, 0.6);
  box-shadow: 0 0 12px var(--glow);
  color: var(--text);
}

.theme-abstract .tab.active {
  background: var(--accent);
  color: #0a0f1a;
  border-color: transparent;
  box-shadow: 0 0 16px rgba(90, 143, 216, 0.3);
  font-weight: 600;
}

.theme-abstract .sidebar {
  background: rgba(10, 15, 26, 0.5);
  border-color: var(--border);
  box-shadow: 
    0 8px 32px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(90, 143, 216, 0.08);
  backdrop-filter: blur(8px);
}

.theme-abstract .sidebar header {
  background: rgba(8, 12, 20, 0.6);
  border-bottom-color: var(--border);
}

.theme-abstract .sidebar-title {
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-size: inherit;
}

.theme-abstract .navlist a {
  color: var(--muted);
  font-weight: 400;
  letter-spacing: 0.01em;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.theme-abstract .navlist a:hover {
  background: rgba(90, 143, 216, 0.06);
  color: var(--text);
  border-color: rgba(90, 143, 216, 0.15);
}

.theme-abstract .navlist a.active {
  background: rgba(90, 143, 216, 0.12);
  color: var(--text);
  border-color: rgba(90, 143, 216, 0.2);
  font-weight: 500;
}

.theme-abstract .link-list a {
  background: rgba(8, 12, 20, 0.5);
  border-color: var(--border);
  color: var(--text);
  font-weight: 400;
  letter-spacing: 0.01em;
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.theme-abstract .link-list a:hover {
  background: rgba(8, 12, 20, 0.7);
  border-color: rgba(90, 143, 216, 0.3);
  box-shadow: 0 0 8px var(--glow);
}

.theme-abstract .hero {
  background: 
    linear-gradient(180deg, rgba(10, 15, 26, 0.7) 0%, rgba(10, 15, 26, 0.4) 100%);
  border-color: var(--border);
  box-shadow: 
    0 8px 32px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(90, 143, 216, 0.1);
  backdrop-filter: blur(4px);
}

.theme-abstract .hero h1 {
  font-weight: 500;
  letter-spacing: 0.02em;
  font-size: inherit;
}

.theme-abstract .hero p {
  color: var(--muted);
  font-weight: 400;
  letter-spacing: 0.01em;
}

.theme-abstract .page-context {
  color: rgba(107, 122, 154, 0.5);
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-size: inherit;
}

.theme-abstract .card {
  background: rgba(10, 15, 26, 0.5);
  border-color: var(--border);
  box-shadow: 
    0 4px 16px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(90, 143, 216, 0.06);
  backdrop-filter: blur(2px);
}

.theme-abstract .card h2,
.theme-abstract .card h3 {
  font-weight: 500;
  letter-spacing: 0.02em;
  font-size: inherit;
}

.theme-abstract .card p,
.theme-abstract .card li {
  color: var(--muted);
  font-weight: 400;
  letter-spacing: 0.01em;
}

.theme-abstract .meta-row {
  border-top-color: rgba(90, 143, 216, 0.15);
}

.theme-abstract .pill {
  background: rgba(8, 12, 20, 0.6);
  border-color: var(--border);
  color: var(--muted);
  font-weight: 500;
  letter-spacing: 0.02em;
  font-size: inherit;
}

.theme-abstract .btn {
  background: rgba(90, 143, 216, 0.1);
  border-color: var(--border);
  color: var(--text);
  font-weight: 500;
  letter-spacing: 0.02em;
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.theme-abstract .btn:hover {
  border-color: rgba(90, 143, 216, 0.3);
  background: rgba(90, 143, 216, 0.15);
  box-shadow: 0 0 12px var(--glow);
}

.theme-abstract .btn.primary {
  background: var(--accent);
  color: #0a0f1a;
  border-color: transparent;
  box-shadow: 0 0 16px rgba(90, 143, 216, 0.3);
  font-weight: 600;
}

.theme-abstract .table {
  border-radius: inherit;
}

.theme-abstract .table th {
  background: rgba(8, 12, 20, 0.7);
  color: var(--text);
  font-weight: 500;
  letter-spacing: 0.02em;
  border-color: var(--border);
}

.theme-abstract .table td {
  color: var(--muted);
  border-color: var(--border);
  font-weight: 400;
}

.theme-abstract .footer {
  color: var(--muted);
  border-top-color: var(--border);
  opacity: 0.7;
}

.theme-abstract .note {
  border-left-color: rgba(90, 143, 216, 0.4);
  background: rgba(90, 143, 216, 0.06);
  color: var(--muted);
  border-radius: inherit;
}

.theme-abstract .kbd {
  border-color: rgba(90, 143, 216, 0.2);
  background: rgba(8, 12, 20, 0.6);
  color: var(--text);
  font-weight: 500;
  letter-spacing: 0.05em;
}

.theme-abstract .sidebar-toggle {
  background: rgba(8, 12, 20, 0.6);
  border-color: var(--border);
  color: var(--text);
  font-weight: 500;
  letter-spacing: 0.02em;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.theme-abstract .sidebar-toggle:hover {
  background: rgba(90, 143, 216, 0.1);
  border-color: rgba(90, 143, 216, 0.25);
}

