/* Expressions workspace. Shared palette and typography with Studio and Estimator. */
:root { color-scheme:light; --bg:#f4f2ee; --surface:#fff; --ink:#1c1c1c; --muted:#68635e; --line:#e5e1db; --rose:#b0675f; --rose-dark:#95544d; --rose-soft:#f6ebe9; }
*, *::before, *::after { box-sizing:border-box; }
[hidden] { display:none !important; }
body { margin:0; min-height:100vh; min-height:100dvh; display:flex; flex-direction:column; background:var(--bg); color:var(--ink); font-family:'Jost',system-ui,sans-serif; font-size:16px; line-height:1.5; -webkit-font-smoothing:antialiased; }
button, input { font:inherit; }
button, a { -webkit-tap-highlight-color:transparent; touch-action:manipulation; }
button { cursor:pointer; }
a { color:inherit; }
svg { display:block; }
button, input, a { outline-offset:4px; }
:focus-visible { outline:3px solid var(--rose); }
.skip-link { position:fixed; left:16px; top:12px; z-index:110; padding:10px 16px; border-radius:10px; background:var(--ink); color:#fff; transform:translateY(-150%); }
.skip-link:focus { transform:translateY(0); }
.page-art { position:fixed; inset:0; overflow:hidden; pointer-events:none; z-index:-1; }
.page-art i { position:absolute; display:block; width:420px; height:660px; border:1px solid rgba(176,103,95,.09); border-radius:220px; transform:rotate(-32deg); right:-245px; top:-160px; }
.page-art i:nth-child(2) { right:-175px; top:-155px; }
.page-art i:nth-child(3) { right:-105px; top:-150px; }
/* Pending access stays visually quiet, including before the account script loads.
   CSS owns the delay so repeated Firebase state events cannot restart it. */
.workspace-shell[data-view="loading"] .workspace-brand { display:none; }
.workspace-shell[data-view="loading"] #home-loading { opacity:0; visibility:hidden; animation:workspace-checking-in 180ms ease-out 1500ms forwards; }
.workspace-shell[data-view="loading"] ~ .workspace-footer { visibility:hidden; }
.workspace-shell:not([data-view="loading"]), .workspace-top:not([hidden]), .workspace-shell:not([data-view="loading"]) ~ .workspace-footer { animation:workspace-ready-in 180ms ease-out; }
@keyframes workspace-checking-in { from { visibility:visible; opacity:0; } to { visibility:visible; opacity:1; } }
@keyframes workspace-ready-in { from { opacity:0; } to { opacity:1; } }
/* Keep the brand and account menu above the home content. */
.workspace-top { flex:none; position:sticky; top:0; z-index:100; background:rgba(244,242,238,.94); -webkit-backdrop-filter:blur(16px); backdrop-filter:blur(16px); border-bottom:1px solid var(--line); }
.workspace-top-inner { display:flex; align-items:center; gap:32px; width:calc(100% - 80px); max-width:1440px; min-height:72px; margin:auto; }
.workspace-logo { flex:none; color:var(--ink); text-decoration:none; font-size:15px; font-weight:600; letter-spacing:.02em; white-space:nowrap; }
.workspace-logo em { color:var(--rose); font-style:normal; }
.workspace-account { display:flex; align-items:center; justify-content:flex-end; min-width:0; margin-left:auto; }
@media (max-width:800px) {
  .workspace-top-inner { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:0 12px; width:calc(100% - 40px); padding:10px 0; }
  .workspace-logo { line-height:1.2; }
  .workspace-logo em { display:block; }
  .workspace-account { grid-column:2; grid-row:1; }
}
.workspace-shell { flex:1; display:grid; align-content:center; width:min(960px,calc(100% - 80px)); margin:0 auto; padding:64px 0; }
.workspace-brand { text-align:center; margin-bottom:38px; }
.brand-mark { display:flex; align-items:center; justify-content:center; gap:4px; height:34px; margin:0 auto 20px; }
.brand-mark span { width:10px; height:28px; border-radius:6px 6px 2px 2px; background:var(--rose); transform:skewY(-16deg); }
.brand-mark span:nth-child(2) { height:34px; background:#c78b7e; }
.brand-mark span:nth-child(3) { height:23px; background:#d9b3a4; }
h1 { margin:0; font-size:clamp(36px,5.8vw,58px); font-weight:500; line-height:1.12; letter-spacing:-.045em; }
h1 span { color:var(--rose); }
.signin-card { width:min(400px,100%); margin:auto; padding:0; animation:enter .25s ease-out; }
.signin-card h2 { margin:0 0 24px; font-size:25px; font-weight:500; letter-spacing:-.025em; line-height:1.25; }
.primary-button, .secondary-button { display:flex; align-items:center; justify-content:center; gap:10px; width:100%; min-height:49px; padding:12px 16px; border:1px solid #d3cdc4; border-radius:12px; background:#fff; color:var(--ink); font-weight:500; font-size:14px; transition:background .18s,border-color .18s,transform .18s; }
.primary-button { margin-top:14px; border-color:var(--ink); background:var(--ink); color:#fff; }
label { display:block; margin-bottom:7px; font-size:13px; font-weight:500; }
input { width:100%; min-width:0; min-height:49px; padding:11px 14px; border:1px solid #d3cdc4; border-radius:12px; background:#faf9f7; color:var(--ink); font-size:16px; }
input::placeholder { color:#88827b; }
input:focus { background:#fff; border-color:var(--rose); }
button:disabled { opacity:.55; cursor:wait; }
.password-choice { margin:16px 0 24px; text-align:center; font-size:13px; }
.password-choice a { display:inline-block; padding:4px 0; color:var(--rose-dark); text-underline-offset:4px; }
.account-message { width:min(440px,100%); padding:12px 14px; margin:14px auto 0; border:1px solid var(--line); border-radius:10px; background:#fff; color:var(--muted); font-size:14px; overflow-wrap:anywhere; }
.account-message:empty, .workspace-status:empty { display:none; }
.account-message.err { background:#fbefed; color:#8d3f38; }
.manager-note { display:flex; align-items:flex-start; gap:10px; margin:24px 0 0; padding:20px 0 0; border-top:1px solid #ded8d0; }
.manager-note svg { flex:0 0 18px; width:18px; height:18px; margin-top:3px; fill:none; stroke:#8a7e73; stroke-width:1.5; stroke-linecap:round; }
.manager-note p { margin:0; color:var(--muted); font-size:13px; line-height:1.55; }
.manager-note strong { display:block; font-weight:500; color:var(--ink); }
.loading-panel { display:flex; justify-content:center; align-items:center; gap:10px; min-height:250px; color:var(--muted); font-size:14px; }
.loading-dot { width:8px; height:8px; border-radius:50%; background:var(--rose); animation:pulse 1.2s ease-in-out infinite alternate; }
.workspace-panel { animation:enter .25s ease-out; }
.tool-grid { display:grid; grid-template-columns:1fr 1fr; gap:20px; }
.tool-card { display:flex; flex-direction:column; min-width:0; min-height:302px; padding:30px; border:1px solid var(--line); border-radius:22px; background:var(--surface); text-decoration:none; box-shadow:0 3px 4px rgba(51,41,31,.02),0 12px 32px rgba(51,41,31,.035); transition:transform .2s,border-color .2s,box-shadow .2s; }
.tool-icon { display:grid; place-items:center; width:54px; height:54px; margin-bottom:28px; border:1px solid #ead9d5; border-radius:15px; color:var(--rose-dark); background:var(--rose-soft); }
.tool-icon svg { width:30px; height:30px; fill:none; stroke:currentColor; stroke-width:1.4; stroke-linecap:round; stroke-linejoin:round; }
.estimator-card .tool-icon { color:#676a57; background:#f0f1e9; border-color:#dfe1d3; }
.tool-card h2 { margin:0 0 8px; font-size:25px; font-weight:500; line-height:1.2; letter-spacing:-.025em; }
.tool-card p { max-width:31ch; margin:0 0 26px; color:var(--muted); font-size:14px; line-height:1.6; }
.tool-action { display:flex; align-items:center; justify-content:space-between; gap:10px; margin-top:auto; padding-top:17px; border-top:1px solid var(--line); font-size:14px; font-weight:500; }
.tool-action svg { width:20px; height:20px; fill:none; stroke:currentColor; stroke-width:1.6; stroke-linecap:round; stroke-linejoin:round; }
.tool-card[aria-disabled="true"] { background:#eeece8; color:#77736e; box-shadow:none; cursor:not-allowed; }
.tool-card[aria-disabled="true"] .tool-icon { color:#89847e; background:#e5e2dc; border-color:#dcd7d0; }
.tool-card[aria-disabled="true"] .tool-action { color:#77736e; }
.tool-card[aria-disabled="true"] .tool-action svg { opacity:0; }
.workspace-status { margin:18px 0 0; text-align:center; font-size:14px; color:var(--muted); }
.retry-panel { width:min(440px,100%); margin:18px auto 0; }
.secondary-button { width:auto; min-width:170px; margin:auto; }
.workspace-footer { flex:none; display:flex; justify-content:space-between; align-items:center; gap:20px; width:100%; margin:0; padding:20px clamp(24px,5vw,80px) max(20px,env(safe-area-inset-bottom)); border-top:1px solid var(--line); font-size:12px; color:#77716b; }
.workspace-footer nav { display:flex; gap:24px; }
.workspace-footer a { display:inline-block; padding:6px 0; text-decoration:none; }
.noscript-note { text-align:center; color:var(--muted); }
@media (hover:hover) { .secondary-button:not(:disabled):hover { border-color:var(--ink); background:#faf9f7; } .primary-button:not(:disabled):hover { background:#37332e; } .tool-card[href]:hover { transform:translateY(-3px); border-color:#c8b8aa; box-shadow:0 12px 34px rgba(51,41,31,.075); } .workspace-footer a:hover { color:var(--ink); text-decoration:underline; } }
@media (min-width:1000px) {
  .workspace-shell[data-view="signin"] { width:min(1080px,calc(100% - 112px)); grid-template-columns:minmax(0,1fr) 380px; column-gap:100px; }
  [data-view="signin"] .workspace-brand { grid-column:1; grid-row:1 / span 3; align-self:center; margin:0; text-align:left; }
  [data-view="signin"] .brand-mark { justify-content:flex-start; margin-left:0; margin-bottom:28px; }
  [data-view="signin"] h1 { font-size:clamp(58px,5.8vw,78px); }
  [data-view="signin"] h1 span { display:block; }
  [data-view="signin"] .signin-card { grid-column:2; grid-row:1; }
  [data-view="signin"] .account-message, [data-view="signin"] .retry-panel { grid-column:2; }
}
@media (max-width:600px) { .workspace-shell { width:calc(100% - 40px); padding:36px 0; } .workspace-brand { margin-bottom:34px; } .brand-mark { margin-bottom:16px; } h1 { font-size:40px; } h1 span { display:block; } .signin-card { width:100%; padding:0 4px; } .manager-note { margin-top:22px; padding-top:18px; } .tool-grid { grid-template-columns:1fr; gap:14px; } .tool-card { min-height:245px; padding:24px; } .tool-icon { width:46px; height:46px; margin-bottom:20px; } .tool-icon svg { width:26px; height:26px; } .tool-card h2 { font-size:24px; } .tool-card p { max-width:none; margin-bottom:20px; } .workspace-footer { padding-right:24px; padding-left:24px; font-size:11px; } .workspace-footer nav { gap:16px; } }
/* A mobile workspace is a short list of tools, not two tall panels. */
@media (max-width:600px) {
  .workspace-shell[data-view="workspace"] { padding:24px 0; }
  [data-view="workspace"] .workspace-brand { margin-bottom:24px; }
  [data-view="workspace"] .brand-mark { display:none; }
  [data-view="workspace"] h1 { font-size:32px; }
  .tool-grid { gap:12px; }
  .tool-card { display:grid; grid-template-columns:38px minmax(0,1fr) 18px; grid-template-rows:auto auto; gap:5px 12px; align-content:center; min-height:112px; padding:18px 16px; border-radius:18px; }
  .tool-icon { grid-column:1; grid-row:1 / 3; align-self:center; width:38px; height:38px; margin:0; border-radius:11px; }
  .tool-icon svg { width:23px; height:23px; }
  .tool-card h2 { grid-column:2; margin:0; font-size:20px; }
  .tool-card p { grid-column:2; margin:0; font-size:12px; line-height:1.5; }
  .tool-action { grid-column:3; grid-row:1 / 3; align-self:center; margin:0; padding:0; border:0; }
  .tool-action-label { display:none; }
  .tool-action svg { width:18px; height:18px; }
  .workspace-footer { padding-top:12px; padding-bottom:max(12px,env(safe-area-inset-bottom)); }
}
/* Native modals keep sign-in guidance visible and keyboard focus contained. */
body.notice-open { overflow:hidden; }
.invitation-notice { width:min(420px,calc(100% - 32px)); max-height:calc(100vh - 32px); max-height:calc(100dvh - 32px); margin:auto; padding:32px; border:1px solid var(--line); border-radius:24px; background:var(--surface); color:var(--ink); box-shadow:0 24px 80px rgba(35,28,22,.2); }
.invitation-notice[open] { animation:enter .2s ease-out; }
.invitation-notice::backdrop { background:rgba(36,30,26,.38); -webkit-backdrop-filter:blur(5px); backdrop-filter:blur(5px); }
.notice-close { position:absolute; top:12px; right:12px; display:grid; place-items:center; width:44px; height:44px; padding:0; border:0; border-radius:50%; background:transparent; color:var(--muted); }
.notice-close:hover { background:var(--bg); color:var(--ink); }
.notice-close svg { width:20px; height:20px; fill:none; stroke:currentColor; stroke-width:1.6; stroke-linecap:round; }
.notice-icon { display:grid; place-items:center; width:56px; height:56px; margin:0 0 22px; border:1px solid #ead9d5; border-radius:16px; background:var(--rose-soft); color:var(--rose-dark); }
.notice-icon svg { width:32px; height:32px; fill:none; stroke:currentColor; stroke-width:1.6; stroke-linecap:round; }
.invitation-notice h2 { margin:0 0 12px; font-size:28px; font-weight:500; letter-spacing:-.025em; line-height:1.2; }
.invitation-notice p { margin:0; color:var(--muted); font-size:16px; line-height:1.6; }
.invitation-notice .primary-button { margin-top:28px; font-size:15px; }
.email-link-notice strong { display:block; margin-top:6px; color:var(--ink); font-weight:500; overflow-wrap:anywhere; }
.email-link-notice p + p { margin-top:18px; }
@media (max-width:420px) { .invitation-notice { padding:28px 24px 24px; border-radius:20px; } .invitation-notice h2 { font-size:26px; } }
@keyframes enter { from { opacity:0; transform:translateY(7px); } to { opacity:1; transform:translateY(0); } }
@keyframes pulse { to { opacity:.3; } }
@media (prefers-reduced-motion:reduce) { *, *::before, *::after { animation:none !important; transition:none !important; } }

/* Keep the 1.5-second notice delay even when motion is disabled. */
@media (prefers-reduced-motion:reduce) {
  .workspace-shell[data-view="loading"] #home-loading { animation:workspace-checking-in 1ms step-end 1500ms forwards !important; }
}
