/* Accounts UI: header sign-in fallback widget, download gate modal, My Files page.
   Colours come from site.css tokens so the site design applies automatically. Light theme only. */

/* ---- fallback header widget (only added when the page has no [data-acct-*] hooks) ---- */
.fd-acct{position:relative;display:flex;align-items:center;margin-left:8px;flex:none}
.fd-signin{display:inline-flex;align-items:center;gap:8px;height:38px;padding:0 14px;border-radius:999px;border:1px solid var(--line2);
  background:var(--surface);color:var(--text);font:600 var(--fs-sm)/1 var(--font);cursor:pointer;white-space:nowrap}
.fd-signin:hover{border-color:var(--brand)}
.fd-av-btn{display:none;padding:0;border:0;background:none;cursor:pointer;border-radius:50%}
.fd-av{display:grid;place-items:center;width:36px;height:36px;border-radius:50%;overflow:hidden;background:var(--brand);color:var(--brand-ink);
  font:700 14px/1 var(--font)}
.fd-av img{width:100%;height:100%;object-fit:cover;display:block}
body.acct-in .fd-signin{display:none}
body.acct-in .fd-av-btn{display:block}
.fd-menu{display:none;position:absolute;right:0;top:calc(100% + 8px);min-width:230px;z-index:60;padding:6px;border-radius:var(--r-md);
  background:var(--surface);box-shadow:var(--shadow-lg);border:1px solid var(--line)}
body.acct-in.acct-menu-open .fd-menu{display:block}
.fd-menu-who{display:flex;flex-direction:column;gap:2px;padding:8px 10px 10px;border-bottom:1px solid var(--line);margin-bottom:4px}
.fd-menu-who small{color:var(--muted);font-size:var(--fs-xs);overflow:hidden;text-overflow:ellipsis}
.fd-menu a,.fd-menu button{display:block;width:100%;text-align:left;padding:9px 10px;border:0;border-radius:8px;background:none;
  color:var(--text);font:500 var(--fs-sm)/1.2 var(--font);cursor:pointer;text-decoration:none}
.fd-menu a:hover,.fd-menu button:hover{background:var(--surface2)}
@media (max-width:600px){.fd-signin span:last-child{display:none}.fd-signin{padding:0 10px}}

/* ---- Google button ---- */
.fd-g{display:inline-flex}
.fd-gbtn{display:flex;align-items:center;justify-content:center;gap:12px;width:100%;height:46px;padding:0 18px;border-radius:999px;
  border:1px solid #dadce0;background:#fff;color:#1f1f1f;font:600 15px/1 var(--font);cursor:pointer;
  box-shadow:0 1px 2px rgba(60,64,67,.12)}
.fd-gbtn:hover{background:#f8faff;border-color:#c6cad0;box-shadow:0 1px 3px rgba(60,64,67,.2)}
.fd-gbtn:focus-visible{outline:2.5px solid var(--focus);outline-offset:2px}

/* ---- gate modal ---- */
body.fd-modal-open{overflow:hidden}
.fd-modal{position:fixed;inset:0;z-index:1000;display:grid;place-items:center;padding:16px;background:rgba(20,18,16,.45);
  animation:fdFade .15s ease-out}
.fd-modal-box{position:relative;width:min(440px,100%);max-height:calc(100vh - 32px);overflow:auto;padding:28px 24px 22px;
  border-radius:var(--r-lg);background:var(--surface);color:var(--text);box-shadow:var(--shadow-lg);animation:fdUp .18s ease-out}
.fd-modal-box h2{margin:0 36px 6px 0;font-size:var(--fs-lg)}
.fd-why{margin:0 0 16px;color:var(--muted)}
.fd-x{position:absolute;top:10px;right:10px;width:36px;height:36px;border:0;border-radius:50%;background:none;color:var(--muted);
  font-size:24px;line-height:1;cursor:pointer}
.fd-x:hover{background:var(--surface2);color:var(--text)}
.fd-file{display:flex;align-items:center;gap:12px;margin:0 0 16px;padding:12px;border-radius:var(--r-sm);background:var(--field);border:1px solid var(--line)}
.fd-file-ic{display:grid;place-items:center;width:40px;height:40px;flex:none;border-radius:10px;background:var(--brand-soft);color:var(--brand)}
.fd-file-meta{display:flex;flex-direction:column;min-width:0}
.fd-file-meta b{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:600}
.fd-file-meta small{color:var(--muted);font-size:var(--fs-xs)}
.fd-actions{display:flex;gap:10px;flex-wrap:wrap}
.fd-actions .btn{flex:1 1 150px}
.fd-small{margin:12px 0 0;color:var(--muted);font-size:var(--fs-xs)}
.fd-note{margin:10px 0 0;font-size:var(--fs-sm);min-height:0}
.fd-note:empty{display:none}
.fd-note.err{color:var(--err)}
.fd-wait{display:flex;align-items:center;gap:8px;margin:12px 0 0;color:var(--muted);font-size:var(--fs-sm)}
.fd-wait.hide{display:none}
@keyframes fdFade{from{opacity:0}}
@keyframes fdUp{from{opacity:0;transform:translateY(8px)}}
@media (prefers-reduced-motion:reduce){.fd-modal,.fd-modal-box{animation:none}}

/* ---- snackbar (gate off, signed in) ---- */
.fd-snack{position:fixed;left:50%;bottom:20px;transform:translateX(-50%);z-index:900;display:flex;align-items:center;gap:10px;
  max-width:calc(100% - 32px);padding:8px 8px 8px 16px;border-radius:999px;background:var(--surface);box-shadow:var(--shadow-lg);
  border:1px solid var(--line);font-size:var(--fs-sm)}
.fd-snack span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.fd-snack .fd-x{position:static;width:30px;height:30px;font-size:20px}

/* ---- My Files page ---- */
#fd-myfiles{min-height:240px}
.fd-mf-head{display:flex;justify-content:space-between;align-items:flex-end;gap:16px;flex-wrap:wrap;margin:0 0 18px}
.fd-mf-head>div{flex:1 1 280px;max-width:420px}
.fd-who{margin:0 0 8px;color:var(--muted);font-size:var(--fs-sm);overflow:hidden;text-overflow:ellipsis}
.fd-quota-t{display:flex;justify-content:space-between;font-size:var(--fs-sm);margin-bottom:6px}
.fd-quota .bar{height:8px}
.fd-mf-head .fd-small{margin:0;flex:1 1 240px;text-align:right}
.fd-list{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:10px}
.fd-row{display:flex;align-items:center;gap:14px;padding:12px 14px;border-radius:var(--r-md);background:var(--surface);
  border:1px solid var(--line);box-shadow:var(--shadow)}
.fd-ext{display:grid;place-items:center;width:46px;height:46px;flex:none;border-radius:10px;background:var(--brand-soft);color:var(--brand);
  font:700 11px/1 var(--font);letter-spacing:.04em}
.fd-fmeta{display:flex;flex-direction:column;min-width:0;flex:1 1 auto}
.fd-fname{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:600}
.fd-fmeta small{color:var(--muted);font-size:var(--fs-xs)}
.fd-row-act{display:flex;align-items:center;gap:8px;flex-wrap:wrap;justify-content:flex-end}
.fd-open{display:flex;gap:6px;align-items:center}
.fd-open select{height:34px;max-width:170px;padding:0 8px;border-radius:10px;border:1px solid var(--line2);background:var(--field);
  color:var(--text);font:inherit;font-size:var(--fs-xs)}
.fd-rename{display:flex;align-items:center;gap:6px;flex-wrap:wrap}
.fd-rename input{height:34px;min-width:0;flex:1 1 140px;padding:0 10px;border-radius:10px;border:1px solid var(--line2);background:var(--field);color:var(--text);font:inherit}
.fd-danger{color:var(--err)!important}
.fd-empty{text-align:center;padding:40px 16px;border-radius:var(--radius);background:var(--surface);border:1px dashed var(--dash)}
.fd-empty h2{margin:0 0 8px}
.fd-empty p{color:var(--muted);margin:0 auto 18px;max-width:440px}
.fd-empty .fd-gbtn{max-width:300px;margin:0 auto}
.fd-danger-zone{margin:36px 0 0;padding:18px;border-radius:var(--r-md);border:1px solid var(--line)}
.fd-danger-zone h3{margin:0 0 6px}
.fd-danger-zone p{margin:0 0 12px;color:var(--muted);font-size:var(--fs-sm)}
@media (max-width:720px){
  .fd-row{flex-wrap:wrap}
  .fd-fmeta{flex-basis:calc(100% - 60px)}
  .fd-row-act{width:100%;justify-content:flex-start}
  .fd-mf-head .fd-small{text-align:left}
}
