:root { color-scheme: light; --dark:#252522; --primary:#706f66; --accent:#f4c321; --canvas:#f4f3f1; --ink:#252522; --muted:#706f66; --line:#dedbd5; --danger:#800002; }
* { box-sizing: border-box; }
html, body { min-height: 100%; }
body { margin: 0; font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; color: var(--ink); background: var(--canvas); }
button, input, select { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid rgba(244,195,33,.38); outline-offset: 2px; }
.auth-page { display: grid; place-items: center; padding: 28px; background: radial-gradient(circle at 78% 16%, rgba(244,195,33,.2), transparent 30%), var(--dark); }
.auth-shell { width: min(1040px,100%); min-height: 650px; display: grid; grid-template-columns: 1.08fr .92fr; overflow: hidden; border: 1px solid rgba(255,255,255,.08); border-radius: 22px; background: #fff; box-shadow: 0 35px 90px rgba(0,0,0,.3); }
.auth-brand { display: flex; flex-direction: column; justify-content: space-between; gap: 48px; padding: 46px; color: #fff; background: linear-gradient(150deg,#363631,#252522 68%); }
.auth-brand img { width: 170px; height: auto; filter: brightness(0) invert(1); opacity: .5; }
.auth-brand span, .auth-version, .recovery-result span { color: var(--accent); font-size: 10px; font-weight: 850; letter-spacing: .13em; }
.auth-brand h1 { max-width: 480px; margin: 9px 0 12px; font-size: clamp(31px,4vw,48px); line-height: 1.02; letter-spacing: -.045em; }
.auth-brand p { max-width: 440px; margin: 0; color: rgba(255,255,255,.65); line-height: 1.55; }
.auth-card { padding: 42px 46px 28px; }
.auth-header-line { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.auth-language-switch { display: inline-flex; align-items: center; gap: 2px; padding: 2px; border-radius: 7px; background: var(--canvas); }
.auth-language-switch button { min-width: 30px; min-height: 25px; border: 0; border-radius: 5px; color: var(--muted); background: transparent; font-size: 9px; font-weight: 850; }
.auth-language-switch button.active { color: #fff; background: var(--primary); }
.auth-card header h2 { margin: 7px 0 4px; font-size: 28px; letter-spacing: -.035em; }
.auth-card header p { margin: 0; color: var(--muted); font-size: 13px; }
.auth-tabs { display: grid; grid-template-columns: repeat(3,1fr); gap: 4px; margin: 25px 0 20px; padding: 4px; border-radius: 10px; background: var(--canvas); }
.auth-tabs button { min-height: 34px; border: 0; border-radius: 7px; background: transparent; color: var(--muted); font-size: 12px; font-weight: 750; }
.auth-tabs button.active { color: var(--ink); background: #fff; box-shadow: 0 2px 8px rgba(0,0,0,.08); }
.auth-form { display: grid; gap: 13px; }
.auth-form[hidden] { display: none; }
.auth-form label { display: grid; gap: 6px; color: var(--muted); font-size: 11px; font-weight: 750; }
.auth-form label em { font-weight: 500; }
.auth-form input { width: 100%; min-height: 42px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 9px; color: var(--ink); background: #fff; }
.auth-form input:focus { border-color: var(--primary); }
.auth-form small { color: #99958c; font-size: 9px; font-weight: 500; }
.auth-form .auth-legal { display: grid; grid-template-columns: auto 1fr; align-items: start; gap: 8px; font-size: 10px; font-weight: 500; line-height: 1.45; }
.auth-form .auth-legal input { width: 15px; min-height: 15px; height: 15px; margin-top: 1px; padding: 0; accent-color: var(--primary); }
.auth-legal a, .auth-card footer a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 2px; }
.auth-primary { min-height: 42px; border: 0; border-radius: 9px; padding: 9px 14px; color: #fff; background: var(--primary); font-weight: 800; box-shadow: 0 7px 18px rgba(37,37,34,.15); }
.auth-primary:hover { filter: brightness(.9); }
.auth-error { margin: 0; padding: 9px 10px; border-radius: 8px; color: var(--danger); background: #f8e9e8; font-size: 11px; }
.auth-notice { margin: 0; padding: 9px 10px; border-radius: 8px; color: #695b1e; background: #fff5cf; font-size: 11px; line-height: 1.4; }
.auth-card footer { margin-top: 24px; color: #9b978e; font-size: 9px; line-height: 1.45; }
.recovery-result { width: min(480px,calc(100% - 32px)); border: 0; border-radius: 16px; padding: 0; box-shadow: 0 25px 80px rgba(0,0,0,.35); }
.recovery-result::backdrop { background: rgba(24,24,21,.72); }
.recovery-result > div { padding: 28px; }
.recovery-result h2 { margin: 7px 0; }
.recovery-result p { color: var(--muted); font-size: 12px; line-height: 1.5; }
.recovery-result code { display: block; padding: 13px; border: 1px dashed var(--primary); border-radius: 9px; background: var(--canvas); overflow-wrap: anywhere; font-size: 13px; }
.recovery-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.recovery-actions button:not(.auth-primary) { min-height: 42px; border: 1px solid var(--line); border-radius: 9px; padding: 8px 12px; background: #fff; }

.web-settings-session { display: grid; gap: 3px; }
.web-settings-session > hr { width: calc(100% - 14px); }
.web-settings-session-summary { display: grid; grid-template-columns: 9px minmax(0,1fr); align-items: center; gap: 9px; margin: 0 4px; padding: 9px 10px; border-radius: 8px; background: var(--canvas); color: var(--ink); }
.web-settings-session-summary span { display: grid; min-width: 0; gap: 2px; }
.web-settings-session-summary strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.web-settings-session-summary small { color: var(--faint); font-size: 9px; }
.web-sync-state { width: 8px; height: 8px; border-radius: 50%; background: #71c7a5; }
.web-sync-state.syncing { background: var(--accent); animation: web-pulse 1s infinite alternate; }
.web-sync-state.waiting { background: #d49b35; }
.web-sync-state.error, .web-sync-state.conflict { background: #ff7777; }
@keyframes web-pulse { to { opacity: .35; } }
.web-panel { position: fixed; z-index: 91; inset: 0; display: grid; place-items: center; padding: 20px; background: rgba(20,20,18,.65); }
.web-panel[hidden] { display: none; }
.web-panel-card { width: min(650px,100%); max-height: min(720px,calc(100vh - 40px)); overflow: auto; border-radius: 15px; padding: 22px; background: #fff; box-shadow: 0 25px 80px rgba(0,0,0,.35); }
.web-panel-header { display: flex; justify-content: space-between; gap: 15px; align-items: start; }
.web-panel-header h2 { margin: 3px 0 4px; }
.web-panel-header p { margin: 0; color: var(--muted); font-size: 11px; }
.web-panel-close { border: 0; background: transparent; font-size: 22px; }
.web-team-list { display: grid; gap: 7px; margin: 17px 0; }
.web-team-member { display: grid; grid-template-columns: minmax(0,1fr) auto auto; align-items: center; gap: 8px; padding: 9px; border: 1px solid var(--line); border-radius: 9px; }
.web-team-member span { display: grid; min-width: 0; }
.web-team-member strong, .web-team-member small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.web-team-member strong { font-size: 11px; }.web-team-member small { color: var(--muted); font-size: 9px; }
.web-team-member select, .web-team-member button, .web-invite button, .web-conflict button { min-height: 32px; border: 1px solid var(--line); border-radius: 7px; padding: 5px 8px; background: #fff; font-size: 10px; }
.web-team-member button { color: var(--danger); }
.web-invite { display: grid; grid-template-columns: 1fr auto; gap: 8px; padding-top: 15px; border-top: 1px solid var(--line); }
.web-invite select { min-height: 36px; border: 1px solid var(--line); border-radius: 8px; padding: 5px 8px; }
.web-invite-result { grid-column: 1/-1; padding: 10px; border-radius: 8px; background: var(--canvas); overflow-wrap: anywhere; font: 11px ui-monospace,monospace; }
.web-conflict { position: fixed; z-index: 95; left: 50%; top: 18px; width: min(620px,calc(100% - 32px)); transform: translateX(-50%); padding: 13px; border: 1px solid #e3c96a; border-radius: 11px; color: #493f18; background: #fff5cf; box-shadow: 0 14px 40px rgba(0,0,0,.2); }
.web-conflict strong { display: block; margin-bottom: 4px; }.web-conflict p { margin: 0 0 9px; font-size: 11px; }
.web-storage-decision { width: min(560px,calc(100% - 28px)); border: 0; border-radius: 16px; padding: 0; color: var(--ink); background: transparent; box-shadow: 0 24px 80px rgba(0,0,0,.35); }
.web-storage-decision::backdrop, .storage-initial-choice::backdrop { background: rgba(20,20,18,.72); backdrop-filter: blur(5px); }
.web-storage-decision-card { padding: 25px; border-radius: 16px; background: #fff; }
.web-storage-decision-card h2 { margin: 7px 0 8px; font-size: 24px; letter-spacing: -.035em; }
.web-storage-decision-card p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.web-storage-decision-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-top: 22px; }
.web-storage-decision-actions button { min-height: 38px; }
.storage-initial-choice .storage-current { background: color-mix(in srgb,#fff 88%,var(--canvas)); }

@media (max-width: 760px) {
  .auth-page { padding: 0; place-items: stretch; }
  .auth-shell { min-height: 100vh; min-height: 100dvh; grid-template-columns: 1fr; border: 0; border-radius: 0; overflow: visible; }
  .auth-brand { min-height: 230px; padding: 28px; gap: 32px; }
  .auth-brand img { width: 130px; }.auth-brand h1 { font-size: 30px; }
  .auth-card { padding: 28px; }
  .web-team-member { grid-template-columns: minmax(0,1fr) auto; }.web-team-member button { grid-column: 2; }
  .web-storage-decision-actions { display: grid; grid-template-columns: 1fr; }
}
