/* Hub pages. Every colour comes from theme.css, the site-wide token sheet
 * linked before this file: it sets the font, the ink and the page background
 * too. Do not write a colour literal here — change --brand in theme.css to
 * recolour the hub and every app at once. */

* { box-sizing: border-box; }
body { min-width: 320px; min-height: 100vh; margin: 0; background: radial-gradient(ellipse at 14% 18%, var(--canvas-glow) 0, transparent 36%), var(--canvas); }
button, input { font: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

.topbar { height: 64px; padding: 0 7.2%; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line-soft); }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font: 800 16px 'Manrope', sans-serif; }
.brand-mark { width: 29px; height: 29px; display: grid; place-items: center; border-radius: 8px 8px 8px 2px; background: var(--green); color: var(--text-on-brand); font-size: 15px; }
.account-controls { display: flex; align-items: center; gap: 12px; }
.account-name { max-width: 160px; overflow: hidden; color: var(--text-secondary); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.logout-button { min-height: 30px; padding: 0 11px; border: 1px solid var(--line); border-radius: 4px; background: var(--surface); color: var(--text-secondary); font-size: 11px; }
.logout-button:hover { border-color: var(--brand-300); background: var(--surface-hover); }

.eyebrow { margin: 0 0 10px; color: var(--green); font-size: 10px; font-weight: 700; letter-spacing: 1.4px; }

.auth-screen { min-height: calc(100vh - 64px); display: grid; place-items: center; padding: 44px 20px; }
.auth-panel { width: min(420px, 100%); padding: 32px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); box-shadow: var(--shadow-lg); animation: arrive .4s ease both; }
.auth-panel h1 { margin: 0 0 24px; color: var(--brand-700); font: 700 25px/1.25 'Manrope', sans-serif; }
.auth-form label { display: block; margin: 14px 0 6px; color: var(--text-secondary); font-size: 11px; font-weight: 700; }
.auth-form input { width: 100%; min-height: 40px; padding: 0 11px; border: 1px solid var(--line); border-radius: 4px; outline: none; background: var(--surface); color: var(--brand-700); font-size: 13px; }
.auth-form input:focus { border-color: var(--brand-400); box-shadow: 0 0 0 3px var(--brand-50); }
.auth-error, .page-error { margin: 10px 0 0; color: var(--danger-500); font-size: 12px; line-height: 1.5; }
.auth-notice { margin-top: 18px; padding: 14px; border: 1px solid var(--brand-200); border-radius: 6px; background: var(--brand-50); color: var(--brand-600); font-size: 12px; line-height: 1.55; }
.auth-notice p { margin: 0; }
.auth-notice strong { overflow-wrap: anywhere; }
.link-button { margin-top: 8px; padding: 0; border: 0; background: none; color: var(--green); font-size: 12px; font-weight: 700; text-decoration: underline; }
.link-button:disabled { opacity: .6; cursor: wait; }
.auth-form .link-button { display: block; margin: 14px auto 0; }
.auth-hint { margin: 0 0 4px; color: var(--muted); font-size: 12px; line-height: 1.55; }
.auth-hint.field-hint { margin: 6px 0 0; font-size: 11px; }
.auth-legal { margin: 20px 0 0; padding-top: 14px; border-top: 1px solid var(--line-soft); color: var(--text-muted); font-size: 11px; line-height: 1.5; }
.auth-legal a, .launcher-legal a { color: var(--text-link); }
.submit-button { width: 100%; min-height: 40px; display: flex; justify-content: space-between; align-items: center; margin-top: 17px; padding: 0 13px; border: 0; border-radius: 6px; background: var(--green); color: var(--surface); font-size: 13px; font-weight: 700; }
.submit-button:hover { background: var(--accent-hover); }
.submit-button:disabled { opacity: .65; cursor: wait; }

.launcher { width: min(960px, 100%); margin: 0 auto; padding: 64px 20px; animation: arrive .4s ease both; }
.launcher h1 { margin: 0 0 12px; font: 700 36px/1.15 'Manrope', sans-serif; }
.launcher-copy { margin: 0 0 32px; color: var(--muted); font-size: 14px; }
.app-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.app-card { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 14px; align-items: start; padding: 18px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: inherit; text-decoration: none; box-shadow: var(--shadow-sm); transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease; }
.app-card:hover { transform: translateY(-2px); border-color: var(--brand-300); box-shadow: var(--shadow-md); }
.app-card:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; }
.app-icon { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 12px 12px 12px 3px; background: var(--accent-soft); color: var(--brand-600); font: 800 18px 'Manrope', sans-serif; }
.app-name { display: block; margin: 2px 0 5px; font: 700 15px 'Manrope', sans-serif; }
.app-description { display: block; color: var(--muted); font-size: 12px; line-height: 1.5; }
.empty-state { color: var(--muted); font-size: 13px; }
.launcher-legal { margin: 40px 0 0; color: var(--text-muted); font-size: 12px; }

/* Privacy notice (privacy.html): a long text page, so a narrower measure
   and plain document styles. */
.legal { width: min(760px, 100%); margin: 0 auto; padding: 56px 20px 80px; color: var(--text); font-size: 14px; line-height: 1.65; animation: arrive .4s ease both; }
.legal h1 { margin: 0 0 8px; font: 700 32px/1.2 'Manrope', sans-serif; }
.legal h2 { margin: 36px 0 10px; color: var(--brand-700); font: 700 18px/1.3 'Manrope', sans-serif; }
.legal .legal-meta { margin: 0 0 28px; color: var(--text-muted); font-size: 12px; }
.legal a { color: var(--text-link); }
.legal ul { padding-left: 20px; }
.legal li { margin: 4px 0; }
.legal .table-scroll { overflow-x: auto; }
.legal table { width: 100%; border-collapse: collapse; margin: 12px 0; font-size: 13px; }
.legal th, .legal td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.legal th { color: var(--text-secondary); font-size: 11px; font-weight: 700; letter-spacing: .4px; text-transform: uppercase; }
.legal .to-fill { padding: 1px 4px; border-radius: 3px; background: var(--warn-50); color: var(--warn-700); }

@keyframes arrive { from { opacity: 0; transform: translateY(9px); } to { opacity: 1; transform: translateY(0); } }

@media (max-width: 600px) {
  .topbar { padding: 0 16px; }
  .account-name { max-width: 90px; }
  .auth-panel { padding: 25px 22px; }
  .launcher { padding: 36px 16px; }
  .launcher h1 { font-size: 28px; }
  .legal { padding: 36px 16px 56px; }
  .legal h1 { font-size: 26px; }
}

/* Password field with its show/hide button sitting inside the input's right
   edge; the input keeps the .auth-form look and leaves room for the button.
   The slash across the eye shows while the password is visible. */
.password-container { position: relative; }
.auth-form .password-container input { padding-right: 42px; }
.password-toggle { position: absolute; top: 50%; right: 4px; width: 34px; height: 32px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 4px; background: transparent; color: var(--text-muted); transform: translateY(-50%); }
.password-toggle:hover { color: var(--brand-600); }
.password-toggle:focus-visible { outline: 2px solid var(--green); outline-offset: 1px; }
.password-toggle .eye-slash { display: none; }
.password-toggle[aria-pressed="true"] .eye-slash { display: inline; }
/* Settings (topbar button + dialog). The select takes the .auth-form input
   look; the dialog is the auth panel's card, centred by <dialog> itself. */
.topbar-actions { display: flex; align-items: center; gap: 12px; }
button, input, select { font: inherit; }
.settings-dialog { width: min(380px, calc(100% - 32px)); padding: 26px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--text); box-shadow: var(--shadow-dialog); }
.settings-dialog::backdrop { background: var(--scrim); }
.settings-dialog h2 { margin: 0 0 6px; color: var(--brand-700); font: 700 20px/1.25 'Manrope', sans-serif; }
.settings-dialog select { width: 100%; min-height: 40px; padding: 0 8px; border: 1px solid var(--line); border-radius: 4px; background: var(--surface); color: var(--brand-700); font-size: 13px; }
.settings-actions { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 18px; }
.settings-actions .link-button { margin: 0; }
.settings-actions .settings-save { width: auto; margin: 0; padding: 0 18px; }
