:root {
  --bg: #FAF9F5;
  --bg-elev: #FFFFFF;
  --bg-sunken: #F4F1EB;
  --border: #E8E2D6;
  --border-strong: #D8D1C2;
  --border-subtle: #EFEAE0;
  --text: #2A2724;
  --text-strong: #1A1815;
  --text-muted: #7A7368;
  --text-faint: #A8A095;
  --accent: #D97757;
  --accent-soft: #F5E4DA;
  --shadow-md: 0 2px 8px rgba(40, 30, 20, .06), 0 1px 2px rgba(40, 30, 20, .04);
  --font-ui: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --font-mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --r-md: 8px;
  --r-xl: 16px;
}
* { box-sizing: border-box; }
html, body, #root { width: 100%; height: 100%; margin: 0; }
body {
  background: var(--bg); color: var(--text); font-family: var(--font-ui);
  font-size: 13px; line-height: 1.45; -webkit-font-smoothing: antialiased;
}
button, input { font-family: inherit; color: inherit; }
button { cursor: pointer; border: 0; }
button:focus-visible, input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.mono { font-family: var(--font-mono); font-size: .92em; }
.media-library { width: 100%; height: 100%; display: flex; flex-direction: column; background: var(--bg); }
.loading-screen { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; }
.loading-spinner { width: 32px; height: 32px; border: 2.5px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin .7s linear infinite; }
.loading-text { font-size: 13px; color: var(--text-muted); }
@keyframes spin { to { transform: rotate(360deg); } }
.auth-page { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; background: var(--bg); padding: 24px; }
.auth-card { width: 100%; max-width: 380px; background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--r-xl); padding: 40px 36px 36px; box-shadow: var(--shadow-md); }
.auth-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 28px; }
.auth-brand-name { font-size: 13px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted); }
.auth-title { font-size: 22px; font-weight: 700; color: var(--text-strong); margin: 0 0 8px; letter-spacing: -.02em; }
.auth-sub { font-size: 13px; color: var(--text-muted); line-height: 1.55; margin: 0 0 22px; }
.auth-form { display: flex; flex-direction: column; gap: 10px; }
.auth-field { display: flex; flex-direction: column; gap: 7px; }
.auth-label { font-size: 12px; font-weight: 600; color: var(--text-muted); }
.auth-input { height: 42px; padding: 0 14px; border: 1px solid var(--border-strong); border-radius: var(--r-md); background: var(--bg); font-size: 14px; transition: border-color .15s, box-shadow .15s; }
.auth-input:focus { outline: 0; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.auth-btn { height: 42px; border-radius: var(--r-md); background: var(--text-strong); color: #fff; font-size: 14px; font-weight: 600; transition: opacity .15s; }
.auth-btn:hover:not(:disabled) { opacity: .88; }
.auth-btn:disabled { opacity: .45; cursor: default; }
.auth-error { margin-top: 14px; padding: 10px 12px; border-radius: var(--r-md); background: #FBEAE5; color: #A44A2E; font-size: 12.5px; line-height: 1.5; }
.auth-sent-icon { width: 52px; height: 52px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: flex; align-items: center; justify-content: center; margin-bottom: 18px; }
.auth-link-btn { display: inline-block; margin-top: 6px; font-size: 13px; color: var(--accent); font-weight: 500; text-decoration: none; background: none; cursor: pointer; padding: 0; }
.auth-link-btn:hover { text-decoration: underline; }
.auth-foot { margin-top: 22px; font-size: 11px; color: var(--text-faint); }
.auth-loading-inline { display: flex; justify-content: center; padding: 30px 0; }
.auth-invite-info { border: 1px solid var(--border-subtle); background: var(--bg-sunken); border-radius: var(--r-md); padding: 10px 14px; margin-bottom: 16px; display: flex; flex-direction: column; gap: 4px; }
.auth-invite-line { display: flex; justify-content: space-between; gap: 12px; font-size: 12.5px; }
.auth-invite-line span { color: var(--text-faint); }
.auth-invite-line b { color: var(--text-strong); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.auth-input.is-invalid { border-color: #C96A4A; box-shadow: 0 0 0 3px #FBEAE5; }
.auth-field-hint { font-size: 11.5px; color: #A44A2E; margin-top: -4px; }
.auth-field-hint-muted { color: var(--text-faint); }
@media (max-width: 480px) { .auth-page { padding: 14px; } .auth-card { padding: 32px 24px 28px; } }
