:root {
  --ons-primary: #2E1F7A;
  --ons-primary-dark: #19104A;
  --ons-primary-light: #9b96d4;
  --ons-primary-bg: #eeedf8;
  --ons-success: #3ec972;
  --ons-success-bg: #d2ffe2;
  --ons-warning: #f0bb33;
  --ons-warning-bg: #fff2c9;
  --ons-danger: #ff5656;
  --ons-info: #56b1f3;
  --ons-info-bg: #e3f3ff;
  --ons-gray-50: #f9fafb;
  --ons-gray-100: #f3f4f6;
  --ons-gray-200: #e5e7eb;
  --ons-gray-400: #9ca3af;
  --ons-gray-500: #6b7280;
  --ons-gray-600: #4b5563;
  --ons-gray-700: #374151;
  --ons-gray-800: #1f2937;
  --ons-gray-900: #111827;
  --ons-font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --ons-radius: 0.5rem;
  --ons-radius-lg: 0.75rem;
  --ons-radius-xl: 1rem;
  --ons-shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.10), 0 1px 2px -1px rgb(0 0 0 / 0.10);
  --ons-transition: all 0.15s ease;
  --kh-sidebar-width: 260px;
  --kh-sidebar-bg: #ffffff;
  --kh-sidebar-text: #374151;
  --kh-sidebar-border: #e5e7eb;
  --ons-body-bg: #f3f4f6;
  --ons-card-bg: #ffffff;
  --ons-border: #e5e7eb;
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  font-family: var(--ons-font);
  font-size: 0.875rem;
  line-height: 1.5;
  background: var(--ons-body-bg);
  color: var(--ons-gray-800);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--ons-primary); text-decoration: none; }
a:hover { text-decoration: underline; }

.app {
  display: flex;
  min-height: 100vh;
  min-height: 100dvh;
}

/* ── Sidebar ── */
.sidebar {
  width: var(--kh-sidebar-width);
  flex-shrink: 0;
  background: var(--kh-sidebar-bg);
  border-right: 1px solid var(--kh-sidebar-border);
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 64px;
  padding: 0.85rem 1.1rem;
  border-bottom: 1px solid var(--kh-sidebar-border);
}

.sidebar-brand img {
  width: 36px;
  height: 36px;
  object-fit: contain;
}

.sidebar-brand-text { min-width: 0; }

.sidebar-brand-name {
  display: block;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--ons-gray-900);
  letter-spacing: -0.02em;
}

.sidebar-brand-sub {
  display: block;
  font-size: 0.7rem;
  color: var(--ons-gray-500);
  margin-top: 0.1rem;
}

.sidebar-nav {
  padding: 0.75rem 0.5rem;
  flex: 1;
}

.sidebar-group {
  padding: 0.75rem 0.75rem 0.35rem;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ons-gray-400);
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.55rem 0.75rem;
  margin: 0.1rem 0;
  border-radius: var(--ons-radius);
  color: var(--kh-sidebar-text);
  font-weight: 500;
  font-size: 0.825rem;
  text-decoration: none;
  transition: var(--ons-transition);
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
}

.sidebar-link i {
  width: 1.1rem;
  text-align: center;
  color: var(--ons-gray-400);
  font-size: 0.9rem;
}

.sidebar-link:hover {
  background: var(--ons-gray-100);
  color: var(--ons-gray-900);
  text-decoration: none;
}

.sidebar-link:hover i { color: var(--ons-primary); }

.sidebar-link.active {
  background: var(--ons-primary-bg);
  color: var(--ons-primary);
}

.sidebar-link.active i { color: var(--ons-primary); }

.sidebar-footer {
  padding: 0.85rem 1rem 1.1rem;
  border-top: 1px solid var(--kh-sidebar-border);
  font-size: 0.7rem;
  color: var(--ons-gray-400);
  line-height: 1.4;
}

/* ── Main ── */
.main {
  margin-left: var(--kh-sidebar-width);
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 1rem 1.5rem;
  background: var(--ons-card-bg);
  border-bottom: 1px solid var(--ons-border);
  position: sticky;
  top: 0;
  z-index: 20;
}

.topbar > div {
  width: 100%;
  max-width: 960px;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.topbar-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ons-gray-900);
  letter-spacing: -0.02em;
}

.topbar-sub {
  margin: 0.15rem 0 0;
  font-size: 0.75rem;
  color: var(--ons-gray-500);
}

.hamburger {
  display: none;
  width: 40px;
  height: 40px;
  border: 1px solid var(--ons-border);
  border-radius: var(--ons-radius);
  background: var(--ons-card-bg);
  color: var(--ons-gray-700);
  cursor: pointer;
  align-items: center;
  justify-content: center;
}

.content {
  padding: 1.5rem;
  max-width: 960px;
  width: 100%;
  margin: 0 auto;
  flex: 1;
}

/* ── Footer / Bize ulaşın ── */
.site-footer {
  margin-top: auto;
  background: var(--ons-card-bg);
  border-top: 1px solid var(--ons-border);
  padding: 1rem 1.5rem calc(1rem + env(safe-area-inset-bottom, 0px));
}

.site-footer-inner {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  text-align: center;
}

.site-footer-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
}

.contact-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.75rem;
  border-radius: var(--ons-radius);
  border: 1px solid var(--ons-border);
  background: var(--ons-gray-50);
  color: var(--ons-gray-700);
  font-size: 0.75rem;
  font-weight: 600;
  text-decoration: none;
  transition: var(--ons-transition);
  font-family: inherit;
}

.contact-btn:hover {
  text-decoration: none;
  border-color: var(--ons-primary-light);
  color: var(--ons-primary);
  background: var(--ons-primary-bg);
}

.contact-btn i { font-size: 0.9rem; }

.contact-btn.contact-wa {
  background: #25D366;
  border-color: #25D366;
  color: #fff;
}

.contact-btn.contact-wa:hover {
  background: #1ebe57;
  border-color: #1ebe57;
  color: #fff;
}

.contact-btn.contact-phone:hover { color: #1a7a40; }
.contact-btn.contact-ig:hover { color: #e1306c; }
.contact-btn.contact-fb:hover { color: #1877f2; }
.contact-btn.contact-li:hover { color: #0a66c2; }
.contact-btn.contact-yt:hover { color: #ff0000; }

@media (max-width: 860px) {
  .site-footer-inner {
    align-items: center;
  }

  .contact-btn span { display: none; }

  .contact-btn {
    width: 40px;
    height: 40px;
    padding: 0;
    justify-content: center;
  }
}

/* ── Hero ── */
.hero {
  background: linear-gradient(135deg, #1e2337 0%, #2d3a5c 55%, #2E1F7A 100%);
  color: #fff;
  padding: 1.75rem 1.5rem;
  border-radius: var(--ons-radius-xl);
  margin-bottom: 1.5rem;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -40px;
  right: -30px;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: rgba(155, 150, 212, 0.18);
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(255, 255, 255, 0.12);
  color: #d4d0f0;
  padding: 0.2rem 0.6rem;
  border-radius: 9999px;
  font-size: 0.7rem;
  font-weight: 600;
  margin-bottom: 0.65rem;
}

.hero h1 {
  margin: 0 0 0.4rem;
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  position: relative;
}

.hero p {
  margin: 0;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.85rem;
  max-width: 520px;
  position: relative;
}

/* ── Cards / grid ── */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 0.85rem;
  margin-bottom: 1.5rem;
}

.product-card {
  background: var(--ons-card-bg);
  border: 1px solid var(--ons-border);
  border-radius: var(--ons-radius-lg);
  padding: 1.1rem;
  box-shadow: var(--ons-shadow-sm);
  cursor: pointer;
  transition: var(--ons-transition);
  text-align: left;
  font-family: inherit;
  width: 100%;
}

.product-card:hover {
  border-color: var(--ons-primary-light);
  box-shadow: 0 4px 12px rgb(46 31 122 / 0.1);
}

.product-card-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--ons-radius);
  background: var(--ons-primary-bg);
  color: var(--ons-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.75rem;
  font-size: 1rem;
}

.product-card h3 {
  margin: 0 0 0.25rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--ons-gray-900);
}

.product-card p {
  margin: 0 0 0.75rem;
  font-size: 0.75rem;
  color: var(--ons-gray-500);
  line-height: 1.45;
}

.product-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: var(--ons-gray-600);
}

.product-card-ver {
  font-weight: 700;
  color: var(--ons-primary);
  font-family: ui-monospace, Consolas, monospace;
}

/* ── Section ── */
.panel { display: none; }
.panel.active { display: block; }

.tool-frame {
  width: 100%;
  min-height: calc(100vh - 200px);
  border: 0;
  border-radius: 12px;
  background: #fff;
  display: block;
  padding: 0;
  box-sizing: border-box;
}

.section-head {
  margin-bottom: 1rem;
}

.section-head h2 {
  margin: 0 0 0.25rem;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--ons-gray-900);
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.section-head h2 i { color: var(--ons-primary); }

.section-head p {
  margin: 0;
  color: var(--ons-gray-500);
  font-size: 0.8rem;
}

.latest-box {
  background: var(--ons-card-bg);
  border: 1px solid var(--ons-border);
  border-radius: var(--ons-radius-lg);
  padding: 1.25rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--ons-shadow-sm);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.latest-box-info h3 {
  margin: 0 0 0.35rem;
  font-size: 1rem;
  color: var(--ons-gray-900);
}

.latest-box-info p {
  margin: 0;
  font-size: 0.8rem;
  color: var(--ons-gray-500);
  max-width: 480px;
}

.latest-ver {
  font-family: ui-monospace, Consolas, monospace;
  font-weight: 700;
  color: var(--ons-primary);
}

/* ── Install script ── */
.script-box {
  background: var(--ons-card-bg);
  border: 1px solid var(--ons-border);
  border-radius: var(--ons-radius-lg);
  margin-bottom: 1.25rem;
  box-shadow: var(--ons-shadow-sm);
  overflow: hidden;
}

.script-box-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem 1.1rem;
  border-bottom: 1px solid var(--ons-border);
}

.script-box-head h3 {
  margin: 0 0 0.25rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--ons-gray-900);
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.script-box-head h3 i { color: var(--ons-primary); }

.script-box-head p {
  margin: 0;
  font-size: 0.8rem;
  color: var(--ons-gray-500);
}

.script-box-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.script-code {
  margin: 0;
  padding: 1rem 1.1rem;
  max-height: 320px;
  overflow: auto;
  background: #0f1623;
  color: #e2e8f0;
  font-family: ui-monospace, 'Cascadia Code', Consolas, monospace;
  font-size: 0.72rem;
  line-height: 1.55;
  white-space: pre;
}

.btn.copied {
  background: var(--ons-success);
  border-color: var(--ons-success);
  color: #fff;
}

/* ── History list ── */
.history-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.history-item {
  background: var(--ons-card-bg);
  border: 1px solid var(--ons-border);
  border-radius: var(--ons-radius-lg);
  padding: 1rem 1.1rem;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.75rem 1rem;
  align-items: center;
  box-shadow: var(--ons-shadow-sm);
}

.history-item-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 0.65rem;
}

.history-ver {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--ons-gray-900);
  font-family: ui-monospace, Consolas, monospace;
}

.history-date {
  font-size: 0.75rem;
  color: var(--ons-gray-400);
}

.history-notes {
  grid-column: 1 / -1;
  margin: 0;
  font-size: 0.8rem;
  color: var(--ons-gray-600);
  line-height: 1.5;
}

.history-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

/* ── Badge / button ── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.5rem;
  border-radius: 9999px;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.badge-stable { background: var(--ons-success-bg); color: #1a7a40; }
.badge-delta { background: var(--ons-info-bg); color: #1a6aa8; }
.badge-beta { background: var(--ons-warning-bg); color: #8a6a10; }
.badge-tool { background: var(--ons-primary-bg); color: var(--ons-primary); }
.badge-latest { background: var(--ons-primary); color: #fff; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.5rem 0.9rem;
  border-radius: var(--ons-radius);
  border: 1px solid transparent;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: var(--ons-transition);
  white-space: nowrap;
}

.btn:hover { text-decoration: none; }

.btn-primary {
  background: var(--ons-primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--ons-primary-dark);
  color: #fff;
}

.btn-secondary {
  background: var(--ons-card-bg);
  color: var(--ons-gray-700);
  border-color: var(--ons-border);
}

.btn-secondary:hover {
  background: var(--ons-gray-50);
  color: var(--ons-gray-900);
}

.btn-sm {
  padding: 0.4rem 0.7rem;
  font-size: 0.75rem;
}

.muted { color: var(--ons-gray-400); font-size: 0.75rem; }

.empty {
  padding: 2rem;
  text-align: center;
  color: var(--ons-gray-500);
  background: var(--ons-card-bg);
  border: 1px dashed var(--ons-border);
  border-radius: var(--ons-radius-lg);
}

.overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(17, 24, 39, 0.45);
  z-index: 30;
}

.overlay.show { display: block; }

/* ── Mobile ── */
@media (max-width: 860px) {
  .sidebar {
    transform: translateX(-105%);
    transition: transform 0.2s ease;
  }

  .sidebar.open { transform: translateX(0); }

  .main { margin-left: 0; }

  .hamburger { display: inline-flex; }

  .topbar { padding: 0.85rem 1rem; }

  .content { padding: 1rem; }

  .history-item {
    grid-template-columns: 1fr;
  }

  .history-actions { justify-content: flex-start; }
}
