/* =========================
   SLS KNOWLEDGE APP — B/W
========================= */

:root {
  --app-black: #111111;
  --app-white: #ffffff;
  --app-gray-50: #fafafa;
  --app-gray-100: #f5f5f5;
  --app-gray-200: #eeeeee;
  --app-gray-300: #e0e0e0;
  --app-gray-500: #777777;
  --app-gray-600: #555555;
  --app-gray-700: #333333;
  --app-radius: 14px;
  --app-nav-h: 56px;
  --app-tab-h: 60px;
  --font-sans: "Inter", "Noto Sans Myanmar", sans-serif;
}

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

html, body {
  background: var(--app-white);
  color: var(--app-black);
  font-family: var(--font-sans);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; }

.app-body {
  min-height: 100vh;
  padding-bottom: calc(var(--app-tab-h) + env(safe-area-inset-bottom));
}

/* Top bar */
.app-top {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--app-nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  background: rgba(255,255,255,0.96);
  border-bottom: 1px solid var(--app-gray-200);
  backdrop-filter: blur(10px);
}

.app-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.02em;
}

.app-brand img {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.app-top-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.app-top-actions a,
.app-top-actions button {
  border: none;
  background: none;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--app-gray-600);
  padding: 8px 10px;
}

.app-top-actions .btn-solid {
  background: var(--app-black);
  color: #fff !important;
  border-radius: 999px;
  padding: 8px 14px;
}

/* Main */
.app-main {
  max-width: 720px;
  margin: 0 auto;
  padding: 24px 16px 32px;
}

.app-kicker {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--app-gray-500);
  margin-bottom: 8px;
}

.app-h1 {
  font-size: clamp(26px, 6vw, 34px);
  font-weight: 700;
  line-height: 1.25;
  margin-bottom: 10px;
}

.app-lead {
  font-size: 15px;
  color: var(--app-gray-600);
  line-height: 1.7;
  margin-bottom: 22px;
}

.app-section { margin-top: 36px; }

.app-section-title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--app-gray-500);
  margin-bottom: 14px;
}

/* Cards */
.app-card {
  border: 1px solid var(--app-gray-200);
  border-radius: var(--app-radius);
  padding: 16px;
  background: var(--app-white);
}

.app-card + .app-card { margin-top: 10px; }

.app-card-soft {
  background: var(--app-gray-100);
  border-color: transparent;
}

.app-card .meta {
  font-size: 12px;
  font-weight: 600;
  color: var(--app-gray-500);
  margin-bottom: 6px;
}

.app-card h3 {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 6px;
}

.app-card p {
  font-size: 14px;
  color: var(--app-gray-600);
  line-height: 1.6;
}

.app-card-link {
  display: block;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.app-card-link:hover {
  border-color: #bbb;
  background: var(--app-gray-50);
}

/* Buttons */
.app-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid var(--app-black);
  background: var(--app-black);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.app-btn:hover { background: #000; }

.app-btn-outline {
  background: transparent;
  color: var(--app-black);
}

.app-btn-outline:hover { background: var(--app-gray-100); }

.app-btn-block { width: 100%; }
.app-btn-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }

.app-home-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 360px;
  margin-top: 8px;
}

/* Forms */
.app-form { display: flex; flex-direction: column; gap: 14px; max-width: 420px; }

.app-field span {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
}

.app-field input,
.app-field select,
.app-search input {
  width: 100%;
  height: 46px;
  border: 1px solid var(--app-gray-300);
  border-radius: 12px;
  padding: 0 14px;
  background: #fff;
  color: var(--app-black);
}

.app-field input:focus,
.app-field select:focus,
.app-search input:focus {
  outline: none;
  border-color: var(--app-black);
}

.app-check {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 14px;
  color: var(--app-gray-700);
}

.app-check input { margin-top: 3px; }

.app-hint {
  font-size: 13px;
  color: var(--app-gray-500);
}

.app-hint a { text-decoration: underline; text-underline-offset: 3px; }

.app-msg {
  display: none;
  font-size: 14px;
  padding: 12px 14px;
  border-radius: 12px;
  margin-bottom: 14px;
  line-height: 1.5;
}

.app-msg.show-error {
  display: block;
  border: 1px solid var(--app-gray-300);
  background: var(--app-gray-100);
}

.app-msg.show-ok {
  display: block;
  border: 1px solid var(--app-black);
  background: var(--app-white);
}

/* Empty */
.app-toolbar {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 18px;
}

.app-chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
  -webkit-overflow-scrolling: touch;
}

.app-chip {
  flex: 0 0 auto;
  border: 1px solid var(--app-gray-300);
  background: #fff;
  color: var(--app-gray-600);
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.app-chip.is-active {
  background: var(--app-black);
  border-color: var(--app-black);
  color: #fff;
}

/* Bottom tabs */
.app-tabs {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 60;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  height: calc(var(--app-tab-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: #fff;
  border-top: 1px solid var(--app-gray-200);
}

.app-tabs a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  font-size: 10px;
  font-weight: 600;
  color: var(--app-gray-500);
  letter-spacing: 0.02em;
}

.app-tabs a span.icon {
  font-size: 16px;
  line-height: 1;
  font-weight: 700;
}

.app-tabs a.is-active,
.app-tabs a:hover {
  color: var(--app-black);
}

/* Reader */
.app-back {
  display: inline-block;
  font-size: 13px;
  font-weight: 600;
  color: var(--app-gray-600);
  margin-bottom: 16px;
}

.app-reader-title {
  font-size: clamp(24px, 5vw, 32px);
  font-weight: 700;
  line-height: 1.35;
  margin-bottom: 8px;
}

.app-reader-meta {
  font-size: 13px;
  color: var(--app-gray-500);
  margin-bottom: 24px;
}

.app-reader-body {
  font-size: 16.5px;
  line-height: 1.9;
  color: var(--app-gray-700);
}

.app-reader-body p { margin-bottom: 1.05em; }

.app-reader-body h2 {
  font-size: 19px;
  font-weight: 700;
  color: var(--app-black);
  margin: 1.5em 0 0.7em;
}

.app-reader-body ul {
  list-style: none;
  margin: 0 0 1.1em;
}

.app-reader-body li {
  position: relative;
  padding-left: 1em;
  margin-bottom: 0.5em;
}

.app-reader-body li::before {
  content: "–";
  position: absolute;
  left: 0;
  color: var(--app-gray-500);
}

.app-reader-body strong { color: var(--app-black); }

.app-reader-body a {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Install banner */
.app-install {
  display: none;
  border: 1px solid var(--app-gray-200);
  border-radius: var(--app-radius);
  padding: 14px;
  margin-bottom: 18px;
  background: var(--app-gray-100);
}

.app-install.show { display: block; }

.app-install h3 {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 4px;
}

.app-install p {
  font-size: 13px;
  color: var(--app-gray-600);
  margin-bottom: 10px;
}

/* Empty */
.app-empty {
  text-align: center;
  padding: 40px 16px;
  color: var(--app-gray-600);
  font-size: 14px;
  line-height: 1.7;
}

.app-auth-page,
.app-admin-page {
  padding-bottom: 32px;
}

.app-auth-page .app-tabs,
.app-admin-page .app-tabs {
  display: none;
}

.app-admin-page .app-main {
  max-width: 900px;
}

.app-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid var(--app-gray-300);
  color: var(--app-gray-600);
}

.app-badge-paid,
.app-badge-enrolled {
  border-color: var(--app-black);
  background: var(--app-black);
  color: #fff;
}

.app-kv {
  font-size: 13px;
  color: var(--app-gray-600);
  margin-top: 4px;
}

.app-stat-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 18px;
}

.app-stat {
  border: 1px solid var(--app-gray-200);
  border-radius: 12px;
  padding: 12px 14px;
  min-width: 120px;
}

.app-stat strong {
  display: block;
  font-size: 22px;
  line-height: 1.2;
}

.app-stat span {
  font-size: 12px;
  color: var(--app-gray-500);
  font-weight: 600;
}

.app-admin-toolbar {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}

.app-btn[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
}
