/* Scoped supporting screen styles; the shared shell stays independent. */
@scope (.legacy-content) {
  * {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
  }
  body {
    background: radial-gradient(
      circle at top,
      #0b1220 0,
      #020617 45%,
      #000 100%
    );
    color: var(--ink);
    font-family: var(--font);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
  }
  a {
    color: inherit;
    text-decoration: none;
  }

  header {
    position: sticky;
    top: 0;
    z-index: 900;
    height: var(--header-h);
    background: linear-gradient(
      180deg,
      rgba(15, 23, 42, 0.96),
      rgba(15, 23, 42, 0.78),
      rgba(15, 23, 42, 0)
    );
    backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(148, 163, 184, 0.25);
  }
  .container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 20px;
  }
  .nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--header-h);
  }
  .logo img {
    height: 80px;
    width: auto;
    display: block;
  }
  .nav-menu {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.85rem;
  }
  .nav-menu a {
    color: var(--muted);
    padding: 0.45rem 0.9rem;
    border-radius: 999px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    transition:
      background 0.18s ease,
      color 0.18s ease;
  }
  .nav-menu a:hover {
    background: rgba(148, 163, 184, 0.2);
    color: #e5e7eb;
  }
  .nav-menu a.active {
    color: #e5e7eb;
    background: rgba(126, 166, 255, 0.16);
    box-shadow: 0 0 0 1px rgba(126, 166, 255, 0.4);
  }
  .auth-links {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
  }
  .auth-links a {
    color: var(--muted);
    font-weight: 500;
  }
  .auth-links a:hover {
    color: #e5e7eb;
    text-decoration: underline;
  }

  main {
    flex: 1;
    max-width: 900px;
    margin: 0 auto;
    padding: 16px 20px 24px;
  }

  .card {
    background: var(--card);
    border: 1px solid rgba(148, 163, 184, 0.4);
    padding: 18px 18px 16px;
    border-radius: 10px;
    box-shadow: var(--shadow);
  }
  .title {
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: var(--muted);
    margin-bottom: 10px;
  }
  .mini {
    font-size: 0.87rem;
    color: var(--muted);
  }
  .field-label {
    display: block;
    margin-top: 12px;
    margin-bottom: 4px;
    font-size: 0.8rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.12em;
  }
  .input,
  .textarea {
    width: 100%;
    padding: 0.7rem 0.8rem;
    border-radius: 8px;
    border: 1px solid rgba(148, 163, 184, 0.7);
    background: #020617;
    color: #e5e7eb;
    font-size: 0.9rem;
    font-family: var(--font);
  }
  .textarea {
    resize: vertical;
    min-height: 120px;
  }
  .btn {
    padding: 0.8rem 1.2rem;
    border-radius: 8px;
    background: #1e293b;
    border: 1px solid rgba(148, 163, 184, 0.8);
    font-weight: 600;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: #e5e7eb;
    cursor: pointer;
  }
  .btn[disabled] {
    opacity: 0.5;
    cursor: not-allowed;
  }

  .alert {
    margin-bottom: 10px;
    padding: 8px 10px;
    border-radius: 8px;
    font-size: 0.85rem;
  }
  .alert.bad {
    background: #450a0a;
    color: #fecaca;
    border: 1px solid #b91c1c;
  }
  .alert.good {
    background: #022c22;
    color: #bbf7d0;
    border: 1px solid #16a34a;
  }

  footer {
    text-align: center;
    padding: 1.3rem 20px 2rem;
    color: var(--muted);
    font-size: 0.8rem;
    border-top: 1px solid rgba(148, 163, 184, 0.35);
  }

  /* Unified Header (Chat Style) */
  header {
    background: linear-gradient(
      180deg,
      rgba(17, 24, 39, 0.95),
      rgba(17, 24, 39, 0.83),
      rgba(17, 24, 39, 0.35)
    );
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(157, 176, 197, 0.24);
    position: sticky;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 900;
    padding: 6px 0;
    height: auto;
  }
  header .container.nav {
    max-width: 1320px;
    margin: 0 auto;
    padding: 0 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 76px;
  }
  header .logo img {
    height: 68px;
    width: auto;
    display: block;
  }
  header .nav-menu {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.88rem;
    flex-wrap: wrap;
    justify-content: center;
  }
  header .nav-menu a {
    color: #9db0c5;
    padding: 0.48rem 0.86rem;
    border-radius: 999px;
    font-weight: 600;
    letter-spacing: 0.02em;
    transition:
      background 0.18s ease,
      color 0.18s ease,
      box-shadow 0.18s ease;
    text-decoration: none;
    border: none;
  }
  header .nav-menu a:hover {
    background: rgba(125, 158, 194, 0.16);
    color: #f4f8ff;
  }
  header .nav-menu a.active {
    color: #f4f8ff;
    background: rgba(109, 178, 255, 0.18);
    box-shadow: inset 0 0 0 1px rgba(109, 178, 255, 0.42);
  }
  header .auth-links {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    font-size: 0.84rem;
  }
  header .auth-links a {
    color: #9db0c5;
    font-weight: 600;
    text-decoration: none;
    border: none;
    padding: 0;
  }
  header .auth-links a:hover {
    color: #f4f8ff;
    text-decoration: none;
  }
  header .menu-toggle {
    display: none;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    border: 1px solid rgba(157, 176, 197, 0.36);
    background: transparent;
    color: #e8eff8;
    font-size: 1.18rem;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    line-height: 1;
  }
  @media (max-width: 940px) {
    header {
      background: #111827;
      backdrop-filter: none;
    }
    header .container.nav {
      padding: 0 14px;
      min-height: 72px;
    }
    header .logo img {
      height: 56px;
    }
    header .menu-toggle {
      display: inline-grid;
      place-items: center;
    }
    header .nav-menu {
      position: fixed;
      left: 0;
      right: 0;
      top: 72px;
      display: none;
      flex-direction: column;
      padding: 16px 20px 24px;
      gap: 0.1rem;
      background: #111827;
      border-top: 1px solid rgba(157, 176, 197, 0.36);
      z-index: 90;
    }
    header .nav-menu.open,
    header .nav-menu.active {
      display: flex;
    }
    header .nav-menu a {
      width: 100%;
      text-align: left;
      padding: 0.8rem 0;
      border-radius: 0;
      border-bottom: 1px solid rgba(27, 39, 54, 0.92);
    }
    header .nav-menu a:last-child {
      border-bottom: none;
    }
    header .auth-links {
      display: none;
    }
  }
}
