/* Basic Reset and Typography */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Ensure the standard HTML [hidden] attribute always hides elements.
   (Some admin components use display:flex in author CSS, which can otherwise override UA styles.) */
[hidden] { display: none !important; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: #333;
    line-height: 1.6;
    /* Create the subtle background gradient fading from left white to right blue */
    background: linear-gradient(to right, #ffffff 0%, #f0f5fc 40%, #dbeafe 100%);
    overflow-x: hidden; /* Prevent horizontal scrollbar due to background effects */
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.3s ease;
}

/* Layout Container */
.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
}

/* Header / Navigation */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px 0;
    position: relative;
    z-index: 50; /* keep header links clickable even if hero image bleeds upward */
}

.logo {
    display: flex;
    align-items: center;
    font-size: 24px;
    font-weight: 700;
    color: #000;
}

.logo-img {
  width: 35px;
  height: 35px;
  margin-right: 12px;
  display: block;
  object-fit: contain;
}

.nav-links a {
    margin-left: 40px;
    font-weight: 500;
    color: #444;
    font-size: 16px;
}
.nav-links a:hover { color: #0071c5; }
.nav-links a.active {
    color: #0071c5;
}


/* Hero Section Layout */
.hero {
    display: flex;
    /*
      IMPORTANT: Keep the right-side hero visual (earth image + video card)
      in a stable position across pages and languages.

      When the left column becomes taller (e.g., Features/Subscription pages
      or longer translations), `align-items:center` would vertically center
      the right visual within the flex line, causing it to shift.

      We top-align both columns and add a fixed-ish top padding so the
      English Home layout stays visually the same while remaining stable.
    */
    align-items: flex-start;
    justify-content: space-between;
    min-height: 80vh; /* Occupy most of the screen height */
    padding-top: clamp(34px, 6vh, 68px);
    padding-bottom: 60px;
}

.hero-content {
    /*
      Cap the text column width, but let it flex naturally.
      (We lock the RIGHT visual width instead, so visuals stay consistent
       while text can grow/shrink without shifting the hero image/card.)
    */
    flex: 1 1 0;
    max-width: 600px; /* Ensure text doesn't stretch too far */
    min-width: 0; /* allow wrapping/shrinking inside a flex row */
    z-index: 2; /* Keep text above background effects */
}

/*
  Keep home hero controls (tabs/button/steps) aligned across languages.
  The headline is nowrap with explicit <br>, and Japanese glyphs tend to be wider,
  which can make the left column wider and shift centered elements.
  By grouping the controls into an inline-block, their alignment is based on the
  tabs' natural width (stable), not the headline width.
*/
body[data-page="home"] .hero-actions {
    display: inline-block;
    width: fit-content;
    max-width: 100%;
}

/* Optical tweak: Japanese headline tends to sit a bit higher and tighter.
   Nudge it to match English positioning more closely. */
html[lang="ja"] body[data-page="home"] .hero-title {
    margin-top: 10px;
    margin-bottom: 57px;
}

.hero-image-container {
    /*
      Lock the hero visual column width so the earth image + video card
      don't shift when the left column content changes (language/page).
    */
    flex: 0 0 clamp(520px, 46vw, 720px);
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1;
}

/* YouTube overlay card */
.hero-video-card {
    position: absolute;
    right: -23%;
    bottom: calc(10% + 250px); /* move ~200px upward */
    width: min(450px, 88%);
    aspect-ratio: 16 / 9;
    border-radius: 18px;
    overflow: hidden;
    z-index: 3;
    border: 1px solid rgba(255, 255, 255, 0.45);
    box-shadow: 0 22px 60px rgba(0, 0, 0, 0.22);
    background: rgba(255, 255, 255, 0.10);
    backdrop-filter: blur(10px);
    transform: scale(1.5);
    transform-origin: bottom right;
}

.hero-video-inner {
    width: 100%;
    height: 100%;
    position: relative;
}

.hero-video-iframe {
    width: 100%;
    height: 100%;
    display: none; /* shown when youtubeId is set */
}

.hero-video-placeholder {
    position: absolute;
    inset: 0;
    display: flex; /* hidden when youtubeId is set */
    align-items: center;
    justify-content: center;
    flex-direction: column;
    text-align: center;
    gap: 10px;
    padding: 16px;
    color: rgba(0, 0, 0, 0.72);
    background: rgba(255, 255, 255, 0.65);
}

.hero-video-placeholder-title {
    font-weight: 800;
    font-size: 16px;
}

.hero-video-placeholder-body {
    font-size: 13px;
    color: rgba(0, 0, 0, 0.64);
}

.hero-video-placeholder code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 12px;
}

/* Headline */
h1 {
    font-size: 3.5rem; /* Large, bold text */
    line-height: 1.1;
    font-weight: 800;
    color: #000;
    margin-bottom: 40px;
}

/* Home hero headline: break only where <br> is explicitly inserted */
body[data-page="home"] .hero-title {
    white-space: nowrap;
}

/* OS Tabs */
.os-tabs {
    display: inline-flex;
    align-items: stretch;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 14px;
    padding: 6px;
    margin-bottom: 35px;

    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; /* Firefox */
}

.os-tabs::-webkit-scrollbar { width: 0; height: 0; }

.tab {
    border: 1px solid transparent;
    background: transparent;
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    color: #263238;
    cursor: pointer;

    display: inline-flex;
    align-items: center;
    gap: 10px;

    flex-shrink: 0;
    white-space: nowrap;
    transition: background 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease, border-color 0.2s ease;
}

.tab + .tab { margin-left: 6px; }

.tab-icon {
    width: 20px;
    height: 20px;
    display: inline-block;
}

/* Hover and active state */
.tab:hover {
    background: rgba(219, 234, 254, 0.7);
}

.tab.active {
    background: linear-gradient(180deg, #ffffff 0%, #e7f1ff 100%);
    border-color: rgba(0, 113, 197, 0.25);
    color: #000;
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.9) inset,
        0 10px 22px rgba(0, 113, 197, 0.18);
    transform: translateY(-1px);
}

.tab.disabled {
    opacity: 0.45;
    cursor: not-allowed;
}
.tab.disabled:hover {
    background: transparent;
}


/* Download Section */
.download-btn {
    width: 100%;
    max-width: 380px;
    display: block;
    margin: 0 auto;
    padding: 22px;
    background-color: #0071c5; /* Main blue action color */
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 22px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(0, 113, 197, 0.25);
    transition: background-color 0.3s ease, transform 0.2s ease;
    text-align: center;
}

.download-btn:hover {
    background-color: #005ea5;
    transform: translateY(-2px);
}

.version-info {
    text-align: center;
    max-width: 480px;
    margin-top: 20px;
    color: #666;
    font-size: 15px;
}

.download-note {
    margin-top: 10px;
    font-size: 13px;
    color: #777;
}

.checksum {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 13px;
    margin-top: 6px;
    color: #777;
    word-break: break-all;
}

/* 3-Step Guide */
.steps-container {
    display: flex;
    justify-content: space-between;
    max-width: 420px;
    margin: 60px auto 30px;
}

.step {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.step-icon {
    width: 60px;
    height: 60px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 28px;
    color: #222;
    border: 3px solid #222;
    margin-bottom: 15px;
}

.circle-icon { border-radius: 50%; }
.square-icon { border-radius: 12px; } /* Terminal icon style */
.link-icon {
    border: none; font-size: 38px; /* Link icon is larger and no border in the image */
}

.step p {
    font-weight: 600;
    font-size: 16px;
}

.note {
    color: #555;
    font-size: 15px;
    text-align: center;
    margin: 0 auto;
}


/* Hero Image Styling */
.main-hero-img {
    width: 120%; /* Make it slightly larger than its container to bleed out */
    max-width: 900px;
    height: auto;
    /* Shift right and up to match layout */
    transform: translate(10%, -10%);
    z-index: 1;
    pointer-events: none; /* don't block header/footer links */
}


/* --- Generic sub pages (features / subscription / etc.) --- */
.page-main {
    padding: 20px 0 70px;
    min-height: 70vh;
}

.page-card {
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 16px;
    padding: 28px;
    box-shadow: 0 10px 28px rgba(0, 113, 197, 0.08);
}

.page-title {
    font-size: 2.2rem;
    line-height: 1.15;
    font-weight: 800;
    color: #000;
    margin-bottom: 14px;
}

.page-subtitle {
    color: #555;
    font-size: 15px;
    margin-bottom: 18px;
}

.page-section {
    margin-top: 22px;
}

.page-section h2 {
    font-size: 1.2rem;
    font-weight: 800;
    margin-bottom: 10px;
    color: #111;
}

.page-section p {
    color: #444;
    font-size: 15px;
}

/* Legal pages helpers */
.legal-meta {
    color: #666;
    font-size: 13px;
    margin: -4px 0 16px;
}

.page-card ul,
.page-card ol {
    padding-left: 20px;
    color: #444;
    font-size: 15px;
}

.page-card li {
    margin-top: 6px;
}

.page-card .note {
    color: #555;
    font-size: 14px;
    margin-top: 10px;
}

/* Feature icon (used in features page) */
.feature-icon {
    margin-right: 10px;
    color: #0071c5;
}


.pill {
    display: inline-block;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    background: rgba(219, 234, 254, 0.85);
    border: 1px solid rgba(0, 113, 197, 0.25);
    color: #0b3d63;
}

/* --- Subscription page components --- */
.plan-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin: 18px 0 6px;
}

.plan-card {
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 16px;
    padding: 18px;
    box-shadow: 0 10px 28px rgba(0, 113, 197, 0.08);
}

.plan-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.plan-name {
    font-size: 1.15rem;
    font-weight: 900;
    color: #111;
    margin: 0;
}

.plan-price {
    margin-top: 10px;
    font-size: 26px;
    font-weight: 900;
    color: #000;
    line-height: 1.1;
}

.plan-price small {
    font-size: 13px;
    font-weight: 800;
    color: #555;
}

.plan-list {
    margin-top: 10px;
    padding-left: 18px;
    color: #444;
    font-size: 14px;
}

.plan-list li { margin-top: 6px; }

.cta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 18px;
}

.cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 800;
    color: #fff;
    background: #0071c5;
    box-shadow: 0 6px 20px rgba(0, 113, 197, 0.25);
    border: 1px solid rgba(0, 0, 0, 0.06);
    transition: transform 0.2s ease, background-color 0.2s ease;
}

.cta-btn:hover {
    background: #005ea5;
    transform: translateY(-1px);
}

.cta-btn.secondary {
    background: rgba(255, 255, 255, 0.78);
    color: #0071c5;
    border: 1px solid rgba(0, 113, 197, 0.25);
}

.cta-btn.secondary:hover {
    background: rgba(255, 255, 255, 0.92);
}

.page-fineprint {
    margin-top: 8px;
    font-size: 12px;
    color: #666;
}


/* Footer */
.footer {
    padding: 50px 0;
    text-align: center;
    position: relative;
    z-index: 50; /* keep footer links clickable if hero image overlaps */
}

.footer-nav a {
    margin: 0 20px;
    color: #555;
    font-size: 14px;
}
.footer-nav a:hover { color: #0071c5; }


/* --- Responsive Adjustments for smaller screens --- */
@media (max-width: 968px) {
    .h1 { font-size: 3.5rem; }
    .hero {
        flex-direction: column-reverse;
        align-items: center; /* column layout: keep content centered */
        padding-top: 40px;
        text-align: center;
    }
    .hero-content {
        flex: 1 1 auto; /* undo desktop fixed basis */
        padding-right: 0;
        margin-top: 40px;
        max-width: 100%;
    }
    body[data-page="home"] .hero-content { width: 100%; flex: 1 1 auto; }
    .hero-image-container { flex: 0 1 auto; width: 100%; }
    .main-hero-img { width: 80%; transform: translate(0, 0); }
    .hero-video-card {
        width: min(560px, 92%);
        right: 50%;
        bottom: calc(8% + 300px);
        transform: translateX(50%) scale(1.5);
        transform-origin: bottom center;
    }
    .os-tabs { margin-left: auto; margin-right: auto; }
    .download-btn, .version-info { margin-left: auto; margin-right: auto; }
    .nav-links { display: none; /* Hide nav links on small screens for simplicity */ }
}

@media (max-width: 480px) {
    h1 { font-size: 2.8rem; }
    .os-tabs .tab { flex: 0 0 auto; justify-content: center; }
    .hero-video-card { bottom: calc(6% + 300px); }
}

@media (max-width: 680px) {
    .plan-grid { grid-template-columns: 1fr; }
}
/* ===================== Admin console ===================== */
.admin-page .header { padding-bottom: 18px; }
.admin-main { padding: 16px 0 60px; }

.admin-card {
  max-width: 560px;
  margin: 0 auto;
  padding: 22px;
  border-radius: 18px;
  background: rgba(255,255,255,0.72);
  border: 1px solid rgba(0,0,0,0.06);
  box-shadow: 0 18px 45px rgba(0,0,0,0.12);
}

.admin-card-header { margin-bottom: 14px; }
.admin-title {
  font-size: 28px;
  font-weight: 800;
  line-height: 1.2;
  margin: 0 0 6px 0;
}
.admin-subtitle { color: rgba(0,0,0,0.65); font-size: 14px; }

.admin-tabs {
  display: flex;
  gap: 8px;
  padding: 6px;
  background: rgba(255,255,255,0.65);
  border: 1px solid rgba(0,0,0,0.06);
  border-radius: 14px;
  margin: 12px 0 14px;
}
.admin-tab {
  flex: 1;
  border: 1px solid transparent;
  background: transparent;
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 700;
  color: rgba(0,0,0,0.72);
}
.admin-tab.active {
  background: rgba(0,113,197,0.10);
  border-color: rgba(0,113,197,0.25);
  color: #0071c5;
}

.admin-form { display: grid; gap: 10px; }
.admin-label { font-size: 13px; color: rgba(0,0,0,0.70); font-weight: 700; }
.admin-input {
  width: 100%;
  padding: 12px 12px;
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,0.10);
  background: rgba(255,255,255,0.85);
  outline: none;
}
.admin-input:focus {
  border-color: rgba(0,113,197,0.45);
  box-shadow: 0 0 0 4px rgba(0,113,197,0.10);
}

.admin-pass { position: relative; }
.admin-pass .admin-input { padding-right: 44px; }
.admin-pass-toggle {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: none;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(0,0,0,0.62);
}
.admin-pass-toggle:hover { background: rgba(0,0,0,0.06); }
.admin-pass-toggle:focus { outline: none; box-shadow: 0 0 0 4px rgba(0,113,197,0.10); }

.admin-link {
  display: inline-block;
  text-decoration: none;
  font-weight: 700;
  color: #0071c5;
}
.admin-link:hover { text-decoration: underline; }
.admin-link.small {
  font-size: 12px;
  font-weight: 700;
  color: rgba(0,0,0,0.62);
  justify-self: start;
}
.admin-link.small:hover { color: #0071c5; }

.admin-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,0.10);
  background: rgba(255,255,255,0.70);
  cursor: pointer;
  font-weight: 700;
  color: rgba(0,0,0,0.78);
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}
.admin-btn:hover { transform: translateY(-1px); box-shadow: 0 10px 25px rgba(0,0,0,0.10); }
.admin-btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; box-shadow: none; }
.admin-btn.primary {
  background: rgba(0,113,197,0.92);
  color: #fff;
  border-color: rgba(0,113,197,0.92);
}
.admin-btn.ghost {
  background: transparent;
}
.admin-btn.danger {
  background: rgba(220,53,69,0.10);
  border-color: rgba(220,53,69,0.25);
  color: rgba(220,53,69,0.95);
}
.admin-btn.small { padding: 7px 10px; border-radius: 10px; font-size: 12px; }

.admin-hint { margin-top: 10px; font-size: 12px; color: rgba(0,0,0,0.62); }

.admin-code { margin-top: 6px; padding-top: 6px; border-top: 1px solid rgba(0,0,0,0.06); }
.admin-code .admin-row { margin-top: 12px; }
.admin-row { display: flex; gap: 10px; align-items: center; }
.admin-row .admin-btn { flex: 1; }

.admin-msg {
  margin: 10px 0;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,0.08);
  background: rgba(255,255,255,0.70);
  font-size: 13px;
}
.admin-msg.error { border-color: rgba(220,53,69,0.28); background: rgba(220,53,69,0.08); color: rgba(220,53,69,0.95); }
.admin-msg.success { border-color: rgba(25,135,84,0.28); background: rgba(25,135,84,0.08); color: rgba(25,135,84,0.95); }
.admin-msg.info { color: rgba(0,0,0,0.78); }

.admin-app {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 14px;
}

.admin-sidebar {
  position: sticky;
  top: 14px;
  height: fit-content;
  padding: 16px;
  border-radius: 18px;
  background: rgba(255,255,255,0.72);
  border: 1px solid rgba(0,0,0,0.06);
  box-shadow: 0 18px 45px rgba(0,0,0,0.10);
}

.admin-org { margin-bottom: 14px; }
.admin-org-name { font-weight: 900; font-size: 16px; }
.admin-org-meta { font-size: 12px; color: rgba(0,0,0,0.62); }

.admin-nav { display: grid; gap: 6px; margin-top: 10px; }
.admin-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 10px;
  border-radius: 12px;
  border: 1px solid transparent;
  color: rgba(0,0,0,0.78);
}
.admin-nav-item:hover { background: rgba(0,0,0,0.04); }
.admin-nav-item.active {
  background: rgba(0,113,197,0.10);
  border-color: rgba(0,113,197,0.22);
  color: #0071c5;
}
.admin-nav-item i { width: 18px; text-align: center; }

.admin-sidebar-bottom { margin-top: 14px; display: grid; gap: 8px; }

.admin-content {
  padding: 18px;
  border-radius: 18px;
  background: rgba(255,255,255,0.72);
  border: 1px solid rgba(0,0,0,0.06);
  box-shadow: 0 18px 45px rgba(0,0,0,0.10);
}

.admin-h2 { margin: 0 0 12px 0; font-size: 20px; font-weight: 900; }

.admin-route-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.admin-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

.admin-metric {
  padding: 14px;
  border-radius: 16px;
  border: 1px solid rgba(0,0,0,0.08);
  background: rgba(255,255,255,0.70);
}
.admin-metric-label { font-size: 12px; color: rgba(0,0,0,0.62); font-weight: 700; }
.admin-metric-value { margin-top: 6px; font-weight: 900; font-size: 22px; }

.admin-cta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid rgba(0,113,197,0.22);
  background: rgba(0,113,197,0.08);
}
.admin-cta-title { font-weight: 900; }
.admin-cta-body { font-size: 13px; color: rgba(0,0,0,0.66); margin-top: 2px; }
.admin-cta-actions { display: inline-flex; gap: 8px; flex-wrap: wrap; }

.admin-table-wrap {
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 16px;
  overflow: hidden;
  background: rgba(255,255,255,0.70);
}
.admin-table {
  width: 100%;
  border-collapse: collapse;
}
.admin-table th, .admin-table td {
  padding: 12px;
  border-bottom: 1px solid rgba(0,0,0,0.07);
  text-align: left;
  vertical-align: top;
  font-size: 13px;
}
.admin-table th { background: rgba(0,0,0,0.03); font-weight: 900; }
.admin-table td.num, .admin-table th.num { text-align: right; white-space: nowrap; }
.admin-table tr:last-child td { border-bottom: none; }

.muted { color: rgba(0,0,0,0.55); }
.sub { color: rgba(0,0,0,0.56); font-size: 12px; margin-top: 4px; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(0,0,0,0.10);
  background: rgba(255,255,255,0.65);
  margin: 0 6px 6px 0;
}
.pill-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 6px;
  border-radius: 999px;
  background: rgba(0,0,0,0.06);
  font-weight: 900;
  font-size: 12px;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid rgba(0,0,0,0.12);
  font-weight: 900;
  font-size: 12px;
  background: rgba(255,255,255,0.70);
}
.badge.active { border-color: rgba(25,135,84,0.28); color: rgba(25,135,84,0.95); background: rgba(25,135,84,0.08); }
.badge.revoked { border-color: rgba(220,53,69,0.28); color: rgba(220,53,69,0.95); background: rgba(220,53,69,0.08); }
.badge.expired { border-color: rgba(255,193,7,0.35); color: rgba(110,80,0,0.95); background: rgba(255,193,7,0.10); }

.admin-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
  padding: 18px;
}
/* NOTE: We intentionally rely on the HTML [hidden] attribute to toggle visibility.
   Because .admin-modal sets display:flex, we must explicitly hide it when [hidden] is present. */
.admin-modal[hidden] { display: none !important; }
.admin-modal-card {
  width: min(680px, 96vw);
  padding: 18px;
  border-radius: 18px;
  background: rgba(255,255,255,0.92);
  border: 1px solid rgba(0,0,0,0.10);
  box-shadow: 0 22px 60px rgba(0,0,0,0.25);
}
.admin-modal-title { font-weight: 900; font-size: 16px; margin-bottom: 10px; }
.admin-modal-body { margin-bottom: 14px; }
.admin-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.admin-keybox {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid rgba(0,0,0,0.10);
  background: rgba(255,255,255,0.75);
  margin-top: 8px;
}
.admin-keybox code { flex: 1; font-size: 13px; word-break: break-all; }

@media (max-width: 980px) {
  .admin-app { grid-template-columns: 1fr; }
  .admin-sidebar { position: relative; top: 0; }
  .admin-cards { grid-template-columns: 1fr; }
}

/* -------------------- Admin auth gating --------------------
   Prevent showing authenticated UI until /api/me confirms session.
   Even if admin.js fails, appView stays hidden.
*/
body.admin-page #appView { display: none; }
body.admin-page.authed #appView { display: grid; }
body.admin-page.authed #authView { display: none; }


/* Language switcher */
.nav-links .lang-select {
    margin-left: 40px;
    font-size: 14px;
    padding: 6px 8px;
    border-radius: 8px;
    border: 1px solid rgba(0,0,0,0.18);
    background: #fff;
}

@media (max-width: 768px) {
  .nav-links .lang-select { margin-left: 16px; }
}
