*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --cyan: #00ffff;
  --bg: #000;
  --surface: #0a0a0a;
  --border: #1a1a1a;
  --text: #fff;
  --muted: #fff;
  --nav-h: 54px;
  --sidebar-w: 180px;
  --footer-h: 200px;
}

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: "Avenir Next", "Avenir", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* ── Brand header ── */
#brand {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 36px 24px 28px;
  border-bottom: 1px solid var(--border);
}

#brand a {
  text-decoration: none;
}

#brand h1 {
  font-style: italic;
  font-weight: 300;
  font-size: 32px;
  letter-spacing: 1px;
  color: #fff;
  line-height: 1;
}

.brand-noesis {
  display: inline-block;
  position: relative;
  padding-bottom: 5px;
}

.brand-noesis::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 2px;
  background: var(--cyan);
}

/* ── Top nav ── */
#topnav {
  display: flex;
  align-items: center;
  height: var(--nav-h);
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  padding: 0 32px;
  gap: 4px;
}

.tab-with-plus {
  display: flex;
  align-items: center;
  height: 100%;
}

.tab {
  position: relative;
  padding: 0 18px;
  height: 100%;
  display: flex;
  align-items: center;
  font-size: 14px;
  font-weight: 400;
  color: #fff;
  cursor: pointer;
  letter-spacing: 0.3px;
  text-decoration: none;
  transition: color 0.15s;
  user-select: none;
}

.tab:hover { color: #fff; }

.tab.active {
  color: #fff;
}

.tab-plus {
  background: none;
  border: none;
  color: #fff;
  font-size: 26px;
  font-weight: 300;
  line-height: 1;
  padding: 0 10px 2px 0;
  cursor: pointer;
  height: 100%;
}

.tab.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 18px;
  right: 18px;
  height: 2px;
  background: var(--cyan);
}

/* ── Main layout ── */
#main {
  display: flex;
  height: calc(100vh - var(--nav-h) - 97px - var(--footer-h));
  overflow: hidden;
}

/* ── App Store footer ── */
#store-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--footer-h);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  border-top: 1px solid var(--border);
  z-index: 20;
}

#store-footer a {
  display: flex;
  align-items: center;
  line-height: 0;
}

#store-footer img {
  height: 120px;
  width: auto;
  display: block;
}

/* ── Sidebar ── */
#sidebar {
  width: var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  padding-top: 12px;
}

.sidebar-item {
  padding: 12px 20px;
  font-size: 13px;
  font-weight: 400;
  color: #fff;
  cursor: pointer;
  letter-spacing: 0.3px;
  text-decoration: none;
  display: block;
  transition: color 0.15s, background 0.15s;
  border-left: 2px solid transparent;
  user-select: none;
}

.sidebar-item:hover { color: #fff; background: #0f0f0f; }

.sidebar-item.active {
  color: #fff;
  border-left-color: var(--cyan);
  background: rgba(0, 255, 255, 0.04);
}

/* ── Content area ── */
#content {
  flex: 1;
  overflow-y: auto;
  padding: 48px 56px 80px;
}

#content::-webkit-scrollbar { width: 6px; }
#content::-webkit-scrollbar-track { background: transparent; }
#content::-webkit-scrollbar-thumb { background: #222; border-radius: 3px; }

/* ── About page ── */
.about-wrap {
  max-width: 640px;
  margin: 0 auto;
}

.about-wrap h2 {
  font-size: 26px;
  font-weight: 300;
  color: #fff;
  letter-spacing: 0.5px;
  margin-bottom: 20px;
}

.about-wrap p {
  font-size: 15px;
  color: #fff;
  line-height: 1.75;
  margin-bottom: 16px;
  font-weight: 300;
}

.about-wrap a { color: #fff; }

/* ── Legal content ── */
.legal-wrap { max-width: 680px; }

.legal-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  margin-bottom: 40px;
}

.legal-tab {
  padding: 10px 22px;
  font-size: 13px;
  font-weight: 400;
  color: #fff;
  text-decoration: none;
  display: block;
  letter-spacing: 0.3px;
  position: relative;
  user-select: none;
  transition: color 0.15s;
}

.legal-tab:hover { color: #fff; }

.legal-tab.active { color: #fff; }

.legal-tab.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--cyan);
}

.legal-doc h1 {
  font-size: 24px;
  font-weight: 300;
  color: #fff;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.legal-doc .updated {
  font-size: 12px;
  color: #fff;
  margin-bottom: 36px;
}

.legal-doc h2 {
  font-size: 15px;
  font-weight: 500;
  color: #fff;
  margin-top: 32px;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid #161616;
}

.legal-doc p {
  font-size: 14px;
  color: #fff;
  line-height: 1.75;
  margin-bottom: 12px;
  font-weight: 300;
}

.legal-doc ul {
  padding-left: 20px;
  margin-bottom: 12px;
}

.legal-doc li {
  font-size: 14px;
  color: #fff;
  line-height: 1.75;
  font-weight: 300;
  margin-bottom: 4px;
}

.legal-doc a { color: #fff; text-decoration: underline; }
.legal-doc a:hover { text-decoration: underline; }

/* ── About editor ── */
.editor-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 40;
}

.editor-overlay[hidden] { display: none; }

.editor-sheet {
  width: 100%;
  max-width: 640px;
  max-height: 85%;
  background: #0e0e0e;
  padding: 0 20px 28px;
  overflow-y: auto;
}

.editor-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
  border-bottom: 1px solid #222;
}

.editor-header h3 {
  font-size: 15px;
  font-weight: 300;
  color: #fff;
}

.editor-close {
  background: none;
  border: none;
  color: #fff;
  font-size: 16px;
  cursor: pointer;
}

.editor-label {
  display: block;
  color: #fff;
  font-size: 11px;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  margin: 16px 0 6px;
}

.editor-input,
.editor-textarea {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1px solid #333;
  color: #fff;
  font-size: 15px;
  font-weight: 300;
  font-family: inherit;
  padding: 8px 0;
}

.editor-textarea {
  border: 1px solid #333;
  min-height: 180px;
  padding: 10px;
  resize: vertical;
}

.editor-save {
  margin-top: 24px;
  width: 100%;
  background: #fff;
  color: #000;
  border: none;
  padding: 14px;
  font-size: 15px;
  cursor: pointer;
}
