:root {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --text: #111318;
  --muted: #646c78;
  --line: #e2e6ec;
  --line-strong: #ccd3dd;
  --ink: #0f1115;
  --danger: #b33535;
  --radius: 14px;
  --shadow: 0 14px 34px rgba(12, 16, 22, 0.08);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: "Manrope", sans-serif;
  background: var(--bg);
  color: var(--text);
}

body.no-scroll {
  overflow: hidden;
}

.hidden {
  display: none !important;
}

.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 40;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(6px);
}

.header-inner {
  width: min(1100px, 94vw);
  min-height: 66px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: inherit;
  min-width: 0;
}

.brand-logo {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid var(--line);
  object-fit: cover;
  flex-shrink: 0;
}

.brand-name {
  margin: 0;
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.brand-sub {
  margin: 0;
  font-size: 0.72rem;
  color: var(--muted);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.user-label {
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  padding: 0.33rem 0.62rem;
  font-size: 0.75rem;
  font-weight: 700;
}

.btn,
.menu-toggle,
.close-btn {
  appearance: none;
  border: 1px solid var(--ink);
  border-radius: 10px;
  background: var(--ink);
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 120ms ease, transform 120ms ease;
}

.btn:hover,
.menu-toggle:hover,
.close-btn:hover {
  opacity: 0.92;
  transform: translateY(-1px);
}

.btn {
  padding: 0.58rem 0.9rem;
}

.btn-ghost {
  background: #fff;
  color: var(--ink);
  border-color: var(--line-strong);
}

.menu-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.68rem;
  background: #fff;
  color: var(--ink);
  border-color: var(--line-strong);
}

.menu-icon {
  font-size: 0.95rem;
  line-height: 1;
}

.menu-text {
  font-size: 0.84rem;
}

.close-btn {
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  font-size: 1.2rem;
  line-height: 1;
  padding: 0;
  background: #fff;
  color: var(--ink);
  border-color: var(--line-strong);
}

.menu-backdrop,
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(8, 11, 16, 0.45);
  z-index: 50;
}

.menu-drawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 60;
  width: min(310px, 88vw);
  height: 100dvh;
  background: #fff;
  border-left: 1px solid var(--line);
  box-shadow: -22px 0 36px rgba(0, 0, 0, 0.14);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.drawer-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.drawer-top h2 {
  margin: 0;
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 1rem;
}

.drawer-nav {
  display: grid;
  gap: 0.4rem;
}

.drawer-nav a {
  text-decoration: none;
  color: #1b2027;
  font-weight: 700;
  border: 1px solid transparent;
  border-radius: 9px;
  padding: 0.56rem 0.62rem;
}

.drawer-nav a:hover {
  border-color: var(--line);
  background: #f8f9fb;
}

.drawer-actions {
  display: grid;
  gap: 0.5rem;
  margin-top: auto;
}

.page {
  width: min(1100px, 94vw);
  margin: 1.1rem auto 2rem;
}

.auth-banner {
  margin: 0 0 0.8rem;
  min-height: 1.2rem;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
}

.auth-banner.error {
  color: var(--danger);
}

.hero {
  padding: 1.15rem;
}

.eyebrow {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.7rem;
  color: #4a5260;
  font-weight: 800;
}

.hero h1 {
  margin: 0.45rem 0 0;
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: clamp(1.5rem, 2.8vw, 2.25rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.hero-copy {
  margin: 0.65rem 0 0;
  color: var(--muted);
  line-height: 1.44;
  max-width: 65ch;
}

.hero-cta {
  margin-top: 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.feature-grid {
  margin-top: 0.9rem;
  display: grid;
  gap: 0.7rem;
}

.feature-card {
  padding: 0.9rem;
}

.feature-card h3 {
  margin: 0;
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 0.98rem;
}

.feature-card p {
  margin: 0.36rem 0 0;
  color: var(--muted);
  line-height: 1.4;
}

.security {
  margin-top: 0.9rem;
  padding: 0.86rem;
  border-style: dashed;
  font-weight: 600;
  color: #444e5c;
}

.app-grid {
  display: grid;
  gap: 0.8rem;
}

.panel {
  padding: 0.95rem;
}

.panel h2,
.panel h3 {
  margin: 0;
  font-family: "Plus Jakarta Sans", sans-serif;
}

.panel h2 {
  font-size: 1rem;
}

.panel h3 {
  margin-top: 0.75rem;
  font-size: 0.88rem;
  color: #3f4855;
}

form {
  display: grid;
  gap: 0.5rem;
  margin-top: 0.7rem;
}

input,
textarea {
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: #fff;
  color: #171b22;
  font: inherit;
  padding: 0.62rem 0.72rem;
}

textarea {
  min-height: 94px;
  resize: vertical;
}

input:focus,
textarea:focus,
.btn:focus,
.menu-toggle:focus,
.close-btn:focus {
  outline: 2px solid #d6dbe3;
  outline-offset: 1px;
}

ul {
  margin: 0.6rem 0 0;
  padding-left: 1.1rem;
}

li + li {
  margin-top: 0.3rem;
}

pre {
  margin: 0.68rem 0 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f8f9fb;
  padding: 0.72rem;
  white-space: pre-wrap;
}

.site-footer {
  margin-top: 1.2rem;
  border-top: 1px solid var(--line);
  background: #fff;
}

.footer-inner {
  width: min(1100px, 94vw);
  margin: 0 auto;
  padding: 0.9rem 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  color: #5f6875;
  font-size: 0.86rem;
}

.footer-inner p {
  margin: 0;
}

.build-stamp {
  margin-left: auto;
  color: #8b93a0;
  font-size: 0.78rem;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: center;
  padding: 1rem;
}

.modal-card {
  width: min(430px, 92vw);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.22);
  padding: 0.9rem;
}

.modal-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.modal-top h2 {
  margin: 0;
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 1rem;
}

@media (min-width: 860px) {
  .feature-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .app-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .wide {
    grid-column: 1 / -1;
  }
}

@media (max-width: 760px) {
  .brand-sub,
  .user-label {
    display: none;
  }

  #header-logout-btn {
    padding: 0.5rem 0.62rem;
    font-size: 0.82rem;
  }

  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .build-stamp {
    margin-left: 0;
  }
}

@media (max-width: 540px) {
  .header-inner {
    min-height: 62px;
  }

  .brand-logo {
    width: 28px;
    height: 28px;
  }

  .brand-name {
    font-size: 0.9rem;
  }

  .menu-toggle {
    padding: 0.45rem 0.58rem;
  }

  .menu-text {
    display: none;
  }

  .hero {
    padding: 1rem;
  }

  .hero-cta .btn {
    flex: 1;
    min-width: 120px;
  }
}
