/* CNS app visual reference, local diary-layout-refresh snapshot. */
/* Additions for the real desk shell. desk.css is the mockup's stylesheet; anything the
   mockup didn't need goes here so the two stay easy to compare. */

/* Menu items are real links, so they open in a new tab and show their address. */
.nav a,.rail a{text-decoration:none}

/* The business card in the menu. In the mockup it was a switcher button; staff belong to one business. */
div.ws-btn:hover{border-color:rgba(255,255,255,.07)}

/* Who is signed in. The mockup had a "view as" dropdown here. */
.me .me-label{font:700 .55rem var(--mono);letter-spacing:.12em;color:var(--side-muted)}
.me .me-name{color:var(--side-ink);font-size:.84rem;max-width:150px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}

/* The "signed in" row opens Settings: your profile, and signing out. */
a.me{border:1px solid transparent;border-radius:12px;color:inherit;text-decoration:none;transition:background .15s,border-color .15s}
a.me:hover,a.me[aria-current="page"]{background:var(--side-2);border-color:rgba(255,255,255,.07)}
a.me:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
.me .me-who{display:grid;flex:1 1 auto;min-width:0}
.me .me-name{max-width:none}
.me .chev{flex:none;margin-left:auto;color:var(--side-muted);font-size:1rem}

/* CNS operators switch business with a real <select> laid over the business card,
   so it works with the keyboard, screen readers and a phone's own picker. */
.ws-switch{position:relative;cursor:pointer}
.ws-switch:focus-within{border-color:var(--accent)}
.ws-switch select{position:absolute;inset:0;width:100%;height:100%;opacity:0;cursor:pointer}

/* Sign-in and set-password pages. A plain stand-in until the designed version lands. */
.auth-page{min-height:100vh;min-height:100dvh;display:grid;place-items:center;padding:24px 16px;background:var(--bg);color:var(--ink)}
.auth-card{width:100%;max-width:400px;display:grid;gap:18px;padding:32px 28px;background:var(--surface);border:1px solid var(--rule);border-radius:18px;box-shadow:var(--shadow)}
.auth-brand b{font:700 1.4rem var(--display)}
.auth-brand .dot{color:var(--accent)}
.auth-brand small{display:block;font:700 .58rem var(--mono);letter-spacing:.14em;color:var(--faint)}
.auth-card h1{font:600 1.35rem var(--display);margin:0}
.auth-form{display:grid;gap:14px}
.auth-form .field input{height:42px;font-size:1rem}
.auth-card .btn.lg{justify-content:center;text-decoration:none}
.auth-card .link{justify-self:start;background:none;border:0;padding:0;color:var(--accent-ink);text-decoration:underline;cursor:pointer;font:inherit;font-size:.88rem}
.auth-msg{margin:0;padding:10px 12px;border-radius:10px;background:var(--accent-wash);font-size:.9rem;line-height:1.45}
.auth-msg.bad{background:color-mix(in srgb,var(--danger) 12%,transparent);color:var(--ink);border:1px solid color-mix(in srgb,var(--danger) 40%,transparent)}

/* Shown when signing out couldn't reach the server: the person is still signed in. */
.sign-out-error{margin:0 8px;padding:8px 10px;border-radius:9px;font-size:.78rem;line-height:1.4;color:var(--side-ink);background:color-mix(in srgb,var(--danger) 22%,transparent)}

/* Clients and Team pages. Not in the mockup; built from its card, table and field styles. */
.add-form{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}
.add-form .field input,.add-form .field select{height:40px}
.add-form .optional{text-transform:none;letter-spacing:0;font-family:inherit;font-weight:400}
.add-actions,.add-form .form-error{grid-column:1/-1}
.field.bad input{border-color:var(--danger)}
.field-error{display:block;margin-top:5px;font-size:.76rem;color:var(--danger)}
.form-error{margin:0;padding:9px 12px;border-radius:9px;font-size:.84rem;background:color-mix(in srgb,var(--danger) 10%,transparent);border:1px solid color-mix(in srgb,var(--danger) 35%,transparent)}
.sign-up-link{display:grid;gap:12px;justify-items:start}
.sign-up-link p{margin:0;line-height:1.5}
.link-row{display:flex;gap:8px;width:100%}
.link-row .inp{flex:1;min-width:0;font:400 .8rem var(--mono)}
.clients .tbl td b{font-weight:600}
@media (max-width:640px){
  .add-form{grid-template-columns:1fr}
  .link-row{flex-direction:column}
}
.auth-form .welcome{margin:0;line-height:1.5}
.clients .tbl .place{display:block;margin-top:2px}

/* Read by screen readers, not shown. */
.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0}

/* Team rows: role picker, and remove with a step to confirm in the row itself. */
.tbl .role-pick{height:32px;width:auto;min-width:110px;padding:0 8px}
.row-actions{white-space:nowrap;text-align:right}
.row-actions .btn+.btn{margin-left:6px}
.row-actions .confirm{display:inline-flex;align-items:center;gap:8px;white-space:normal;text-align:left}
.btn.danger{background:var(--danger);border-color:var(--danger);color:#fff}
.btn.danger:hover{filter:brightness(1.08)}
.done-note{display:block;margin:0 0 10px}

/* Dev machines only: "Sign in as…" the seeded people */
.dev-sign-in{display:grid;gap:10px;padding-top:16px;border-top:1px dashed var(--rule)}
.dev-sign-in h2{font:700 .6rem var(--mono);letter-spacing:.12em;text-transform:uppercase;color:var(--faint);margin:0}
.dev-people{display:grid;gap:6px;max-height:280px;overflow:auto}
.dev-people .btn{height:auto;justify-content:space-between;gap:12px;padding:8px 12px;text-align:left}
.dev-people .btn span{font-size:.75rem;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}

/* The sign-in pages' notes are sentences, not the desk's icon-and-text row: let them wrap. */
.auth-card .note{display:block;font-size:.88rem;line-height:1.5}
.auth-card .note b{color:var(--ink);word-break:break-word}


/* Settings: your profile, then signing out. Built from the Team page's sections and cards. */
.settings{max-width:760px}
.settings .card + .section-t{margin-top:28px}
.profile{display:flex;gap:18px;align-items:center;margin-bottom:28px}
.profile-av{width:64px;height:64px;font-size:1.2rem;background:var(--accent);color:#101827;border-radius:50%}
.profile-facts{display:grid;grid-template-columns:auto minmax(0,1fr);gap:4px 16px;margin:0;font-size:.88rem;min-width:0}
.profile-facts dt{color:var(--muted)}
.profile-facts dd{margin:0;overflow-wrap:anywhere}

/* Profile pictures fill their circle; without one the circle keeps the initials. */
.av.has-picture{padding:0;overflow:hidden;background:var(--surface-2)}
.av.has-picture img{width:100%;height:100%;object-fit:cover;border-radius:inherit;display:block}
.person{display:flex;align-items:center;gap:10px}
.profile-picture{position:relative;flex:none;width:64px;height:64px}
.profile-picture-edit{display:block;position:relative;padding:0;border:0;border-radius:50%;background:none;cursor:pointer}
.profile-picture-overlay{position:absolute;inset:0;display:grid;place-items:center;background:rgba(0,0,0,.4);border-radius:50%;color:white;opacity:0;transition:opacity .16s ease;pointer-events:none}
.profile-picture-edit:hover .profile-picture-overlay,.profile-picture-edit:focus-visible .profile-picture-overlay{opacity:1}
.profile-picture-edit:disabled{cursor:wait}
.profile-picture-remove{position:absolute;top:-9px;right:-9px;width:24px;height:24px;display:grid;place-items:center;padding:0;border:0;border-radius:50%;background:var(--surface);color:var(--ink);font:20px/1 sans-serif;cursor:pointer}
.profile-picture-remove:hover{background:var(--surface-2)}
.profile-picture-input{display:none}
@media(hover:none){.profile-picture-overlay{opacity:1}}
.av.av-sm{width:22px;height:22px;font-size:9px;flex:none}
.tbl .person{gap:8px}
