.auth-pending .app-shell { visibility: hidden; }
.auth-overlay { position: fixed; inset: 0; z-index: 9999; display: grid; place-items: center; padding: 16px; background: radial-gradient(circle at 30% 20%, #1e293b, #0f172a); font-family: system-ui, -apple-system, "Segoe UI", sans-serif; }
.auth-card { width: 100%; max-width: 380px; display: grid; gap: 14px; padding: 28px; border-radius: 16px; background: #fff; color: #0f172a; box-shadow: 0 20px 60px rgba(0, 0, 0, .35); }
.auth-card img { justify-self: start; }
.auth-card h1 { margin: 0; font-size: 1.5rem; }
.auth-card p { margin: 0; color: #64748b; }
.auth-card label { display: grid; gap: 6px; font-size: .85rem; font-weight: 600; }
.auth-card input { padding: 10px 12px; border: 1px solid #cbd5e1; border-radius: 8px; font: inherit; }
.auth-card input:focus { outline: 2px solid #6366f1; outline-offset: 1px; }
.auth-card .auth-error { color: #b91c1c; font-size: .85rem; }
.auth-card button { padding: 11px 14px; border: 0; border-radius: 8px; background: #4f46e5; color: #fff; font: inherit; font-weight: 600; cursor: pointer; }
.auth-card button:disabled { opacity: .6; cursor: progress; }
.auth-team .admin-mode-controls, .auth-team .preview-select { display: none !important; }
.doptor-sync { position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 9000; padding: 8px 14px; border-radius: 999px; background: #0f172a; color: #fff; font: 600 .8rem system-ui, sans-serif; box-shadow: 0 8px 24px rgba(0, 0, 0, .25); }
.doptor-sync-bad { background: #b91c1c; }
.attendance-today { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 6px 0 2px; }
.attendance-today strong { font-size: 1.05rem; }
.attendance-check { display: flex !important; align-items: center; gap: 8px; }
.attendance-check input { width: auto; }
.attendance-week-nav { display: flex; gap: 8px; flex-wrap: wrap; }
.availability-state.leave { background: #ede9fe; color: #5b21b6; }
.leave-state.cancelled { background: #e2e8f0; color: #475569; }
.calendar-exceptions article .text-button { margin-left: auto; }
.attendance-today { padding: 18px 20px; }
#attendance-content > .panel, #attendance-content > .attendance-layout { margin-bottom: 20px; }
.role-manager #super-admin-settings { display: none !important; }
.company-layout { display: grid; grid-template-columns: minmax(240px, 320px) minmax(0, 1fr); gap: 20px; align-items: start; }
.company-list { display: grid; gap: 10px; }
.company-list > .panel { margin-top: 10px; }
.company-detail > .panel { margin-bottom: 20px; }
.company-card { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink); font: inherit; text-align: left; cursor: pointer; }
.company-card.active { border-color: #4f46e5; box-shadow: 0 0 0 2px rgba(79, 70, 229, .18); }
.company-card span { display: grid; gap: 2px; min-width: 0; }
.company-card small { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.company-logo { flex: none; width: 44px; height: 44px; border-radius: 10px; object-fit: contain; background: #fff; border: 1px solid var(--line); }
.company-logo-empty { display: grid; place-items: center; background: #4f46e5; color: #fff; font-weight: 700; border: 0; }
.company-brand-row { display: flex; gap: 16px; align-items: flex-start; }
.company-brand-row > div { flex: 1; display: grid; gap: 12px; min-width: 0; }
.company-brand-row .company-logo { width: 72px; height: 72px; }
.company-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.company-access { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 6px 14px; margin: 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; }
.company-access legend { padding: 0 6px; font-size: .8rem; color: var(--muted); }
.company-access label { display: flex !important; align-items: center; gap: 8px; font-weight: 500; }
.company-access input { width: auto; }
.company-access-edit summary { cursor: pointer; color: #4f46e5; }
.company-access-edit form { display: grid; gap: 8px; margin-top: 8px; min-width: 220px; }
.brand-lockup .brand-mark { object-fit: contain; }
@media (max-width: 900px) { .company-layout { grid-template-columns: 1fr; } }
#theme-toggle svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
#theme-toggle .theme-sun { color: #d97706; }
#theme-toggle .theme-moon { display: none; }
.dark #theme-toggle .theme-sun { display: none; }
.dark #theme-toggle .theme-moon { display: block; color: #c7d2fe; fill: currentColor; stroke: none; }
.profile-mini { cursor: pointer; border-radius: 10px; }
.profile-mini:hover, .profile-mini:focus-visible { background: var(--bg); outline: none; }
.profile-photo { flex: none; width: 88px; height: 88px; border-radius: 50%; object-fit: cover; border: 1px solid var(--line); }
.profile-photo-empty { display: grid; place-items: center; background: #4f46e5; color: #fff; font-size: 1.6rem; font-weight: 700; border: 0; }
.doptor-link { color: #4338ca; background: #eef2ff; border-radius: 4px; padding: 0 3px; text-decoration: underline; text-underline-offset: 2px; word-break: break-word; }
.doptor-link:hover { background: #e0e7ff; }
.dark .doptor-link { color: #c7d2fe; background: rgba(99, 102, 241, .22); }
.wiki-note-current { margin: 0 0 10px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); }
.wiki-note-current small { color: var(--muted); }
.wiki-note-current p { margin: 6px 0 0; white-space: pre-wrap; }
.wiki-note-history p { white-space: pre-wrap; }
.wiki-links { margin-top: 18px; display: grid; gap: 8px; }
.wiki-link-form { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) auto; gap: 8px; }
.wiki-link-form input { padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); font: inherit; min-width: 0; }
@media (max-width: 700px) { .wiki-link-form { grid-template-columns: 1fr; } }
.company-health { margin-top: 20px; }
.health-detail { margin: 6px 0 0; padding: 8px; max-width: 520px; overflow: auto; border-radius: 6px; background: var(--bg); font-size: .72rem; white-space: pre-wrap; }
.project-card.sync-project-card, .project-directory-card { overflow: hidden; }
.project-thumb { position: relative; display: grid; place-items: center; height: 112px; margin: -13px -13px 2px; overflow: hidden; color: #fff; background: linear-gradient(135deg, hsl(var(--thumb-hue) 62% 52%), hsl(calc(var(--thumb-hue) + 38) 68% 40%)); }
.project-directory-card > .project-thumb { margin: -17px -17px 14px; }
.project-thumb::before, .project-thumb::after { content: ""; position: absolute; border-radius: 50%; background: rgba(255, 255, 255, .16); }
.project-thumb::before { width: 150px; height: 150px; right: -40px; top: -60px; }
.project-thumb::after { width: 90px; height: 90px; left: -24px; bottom: -40px; background: rgba(255, 255, 255, .11); }
.project-thumb-1::before { border-radius: 26px; transform: rotate(18deg); }
.project-thumb-2::after { width: 220px; height: 220px; left: auto; right: 30%; bottom: -170px; }
.project-thumb-3::before { width: 100%; height: 34px; right: 0; top: auto; bottom: 18px; border-radius: 0; transform: skewY(-6deg); }
.project-thumb.has-image { background: #fff; }
.project-thumb.has-image::before, .project-thumb.has-image::after { display: none; }
.project-thumb b { position: relative; z-index: 1; font: 800 2rem/1 Inter, system-ui, sans-serif; letter-spacing: .04em; text-shadow: 0 2px 10px rgba(0, 0, 0, .18); }
.project-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.project-thumb-edit { position: absolute; z-index: 3; right: 8px; bottom: 8px; display: inline-flex !important; align-items: center; min-height: 28px; padding: 0 10px; border: 0; border-radius: 999px; background: rgba(15, 23, 42, .72); color: #fff !important; font: 600 11px/1 Inter, system-ui, sans-serif !important; cursor: pointer; }
.project-thumb-edit:hover, .project-thumb-edit:focus-within { background: rgba(15, 23, 42, .9); }
.project-thumb-remove { right: auto; left: 8px; }
.auth-google-box { display: grid; gap: 12px; }
.auth-google-box[hidden] { display: none; }
.auth-or { display: flex; align-items: center; gap: 10px; margin: 0; color: #94a3b8; font-size: .8rem; }
.auth-or::before, .auth-or::after { content: ""; flex: 1; height: 1px; background: #e2e8f0; }
.auth-card .auth-google { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 44px; border: 1px solid #cbd5e1; background: #fff; color: #0f172a; }
.auth-card .auth-google:hover { background: #f8fafc; }
/* The Doptor mark turns slowly on the sign-in page. A company's own logo stays still. */
@keyframes auth-spin { to { transform: rotate(360deg); } }
.auth-spin { animation: auth-spin 14s linear infinite; }
@media (prefers-reduced-motion: reduce) { .auth-spin { animation: none; } }

/* First-time setup */
.auth-overlay-wide { align-items: start; overflow-y: auto; padding-top: 24px; padding-bottom: 24px; }
.onboard-card { max-width: 600px; margin: auto; }
.onboard-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: .85rem; color: #64748b; }
.onboard-top span { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.auth-card .onboard-link { padding: 4px 6px; background: none; color: #4f46e5; font-weight: 600; font-size: .85rem; min-height: 0; }
.onboard-lede { margin-top: -6px !important; }
.onboard-steps { display: flex; gap: 6px; margin: 0; padding: 0; list-style: none; font-size: .78rem; color: #94a3b8; }
.onboard-steps li { flex: 1; display: grid; gap: 6px; padding-top: 8px; border-top: 3px solid #e2e8f0; }
.onboard-steps li span { display: none; }
.onboard-steps li.done { border-color: #a5b4fc; color: #64748b; }
.onboard-steps li.current { border-color: #4f46e5; color: #0f172a; font-weight: 600; }
.onboard-form { display: grid; gap: 14px; }
.onboard-form select { padding: 10px 12px; border: 1px solid #cbd5e1; border-radius: 8px; font: inherit; background: #fff; }
.onboard-address { display: flex; align-items: center; border: 1px solid #cbd5e1; border-radius: 8px; overflow: hidden; }
.onboard-address > span { padding: 10px 0 10px 12px; color: #64748b; font-weight: 500; }
.onboard-address input { flex: 1; min-width: 0; border: 0 !important; padding-left: 2px !important; }
.onboard-logo { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.onboard-logo label { flex: 1 1 200px; }
.onboard-logo-box { display: grid; place-items: center; width: 64px; height: 64px; flex: none; border: 1px dashed #cbd5e1; border-radius: 12px; color: #94a3b8; font-size: .75rem; overflow: hidden; background: #fff; }
.onboard-logo-box img { width: 100%; height: 100%; object-fit: contain; }
.onboard-rows { display: grid; gap: 8px; }
.onboard-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr) auto; gap: 8px; align-items: center; }
.onboard-row:has(select) { grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr) minmax(0, 1fr) auto; }
.onboard-empty { color: #94a3b8 !important; font-size: .9rem; }
.auth-card .onboard-add { justify-self: start; background: #eef2ff; color: #4338ca; }
.onboard-actions { display: flex; justify-content: space-between; gap: 10px; margin-top: 4px; }
.auth-card .onboard-actions .secondary-button { background: #fff; color: #0f172a; border: 1px solid #cbd5e1; }
.onboard-summary { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; border: 1px solid #e2e8f0; border-radius: 10px; }
.onboard-summary li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 14px; border-bottom: 1px solid #e2e8f0; font-size: .92rem; }
.onboard-summary li:last-child { border-bottom: 0; }
.onboard-summary span { color: #64748b; }
.onboard-summary strong { overflow-wrap: anywhere; text-align: right; }
@media (max-width: 560px) {
  .onboard-row, .onboard-row:has(select) { grid-template-columns: minmax(0, 1fr); padding: 10px; border: 1px solid #e2e8f0; border-radius: 10px; }
  .onboard-steps li { font-size: 0; } .onboard-steps li.current { font-size: .78rem; }
  .onboard-actions .primary-button, .onboard-actions .secondary-button { flex: 1; }
}
.request-card { display: grid; gap: 12px; padding: 16px; border: 1px solid var(--line); border-radius: 12px; margin: 0 20px 14px; }
.request-head { display: flex; gap: 12px; align-items: flex-start; }
.request-head > div { display: grid; gap: 2px; min-width: 0; }
.request-head small { color: var(--muted); overflow-wrap: anywhere; }
.request-people { margin: 8px 0 0; padding-left: 18px; color: var(--muted); font-size: .88rem; }
.request-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; }
.request-actions label { display: grid; gap: 4px; font-size: .8rem; font-weight: 600; flex: 1 1 180px; }
.request-actions input { padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); font: inherit; }
.company-health > .panel > .company-access-edit { margin: 0 20px 16px; }
/* Google first: the email and password fields stay hidden until asked for. */
.auth-google-first > label, .auth-google-first > button[type="submit"], .auth-google-first .auth-or { display: none; }
.auth-card .auth-switch { justify-self: center; padding: 4px 8px; min-height: 0; background: none; color: #4f46e5; font-size: .88rem; font-weight: 600; }
.auth-card .auth-switch:hover { text-decoration: underline; }
.auth-card .auth-switch[hidden] { display: none; }
.review-decision-cell { display: grid; gap: 4px; min-width: 0; justify-items: start; }
.review-decision-cell select { width: 100%; }
.review-note { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; color: var(--muted); font-size: 11px; line-height: 1.35; }
.review-note-dialog textarea { width: 100%; min-height: 96px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); font: inherit; resize: vertical; }
.review-note-dialog form { display: grid; gap: 12px; min-width: min(460px, calc(100vw - 60px)); }
.review-note-dialog label { display: grid; gap: 6px; font-weight: 600; }
.s47-chat__message--review { border-left: 3px solid #6366f1; padding-left: 8px; }
.s47-chat__message--review[data-review-decision="Approved"] { border-left-color: #269a80; }
.s47-chat__message--review[data-review-decision="Changes requested"] { border-left-color: #df9b39; }
.s47-chat__message--review p { white-space: pre-wrap; }
