:root {
  --auth-color-scheme: light; --auth-bg:#f6f7fb; --auth-surface:#fff;
  --auth-nav:#ffffffd9; --auth-empty-bg:#ffffff88; --auth-ink:#202434;
  --auth-muted:#7b8293; --auth-muted-soft:#8c92a2; --auth-placeholder:#9297a6;
  --auth-accent:#7950dc; --auth-accent-text:#7854bd; --auth-accent-soft:#eae4f7;
  --auth-code:#7950c8; --auth-next:#7b8395; --auth-border:#e3e5ee;
  --auth-divider:#e7e8ef; --auth-hover:#f4f1fb; --auth-focus:#b39add; --auth-icon:#646b7b;
  --auth-security-text:#67796f; --auth-security-icon:#4c8e73;
  --auth-avatar-bg:#eee8fa; --auth-avatar-border:#e8ddf7;
  --auth-mail-bg:#edf4fe; --auth-mail-border:#e3edfc; --auth-mail-text:#5682bb;
  --auth-openai-bg:#eaf4ef; --auth-openai-border:#deeee6; --auth-openai-text:#5c8b76;
  --auth-track:#f1edf8; --auth-error:#c04e58;
  --auth-canvas:radial-gradient(ellipse 70% 42% at 50% 8%, #eeeafa88 0, transparent 80%), #f6f7fb;
}
:root[data-auth-theme="dark"] {
  --auth-color-scheme:dark; --auth-bg:#14151e; --auth-surface:#1e202c;
  --auth-nav:#181a24e8; --auth-empty-bg:#1e202c88; --auth-ink:#e6e7ef;
  --auth-muted:#9ca3b7; --auth-muted-soft:#878fa5; --auth-placeholder:#727b92;
  --auth-accent:#b193f0; --auth-accent-text:#b89de9; --auth-accent-soft:#342b4d;
  --auth-code:#baa0f5; --auth-next:#9ca5bb; --auth-border:#303344;
  --auth-divider:#2a2d3c; --auth-hover:#282437; --auth-focus:#7f66ae; --auth-icon:#a2a8bb;
  --auth-security-text:#91b6a5; --auth-security-icon:#75b59a;
  --auth-avatar-bg:#352944; --auth-avatar-border:#453351;
  --auth-mail-bg:#243249; --auth-mail-border:#2a3b55; --auth-mail-text:#8aaddb;
  --auth-openai-bg:#223c35; --auth-openai-border:#29483e; --auth-openai-text:#93c5b0;
  --auth-track:#353043; --auth-error:#f0929b;
  --auth-canvas:radial-gradient(ellipse 70% 42% at 50% 8%, #33264644 0, transparent 80%), #14151e;
}

/* Ente Auth presentation only. Scoped markers are added to the pinned auth page. */
body:has([data-auth-shell]) {
  background: var(--auth-bg) !important;
  color: var(--auth-ink) !important;
  color-scheme: var(--auth-color-scheme);
}
[data-auth-shell] {
  min-height: 100svh;
  font-family: Inter, "Noto Sans", "Noto Sans CJK SC", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--auth-ink);
  background: var(--auth-canvas);
}
[data-auth-shell] *, [data-auth-shell] *::before, [data-auth-shell] *::after { box-sizing: border-box; }
[data-auth-nav] {
  position: relative !important;
  flex: 0 0 84px !important;
  height: 84px;
  margin: 0 !important;
  padding: 0 max(32px, calc((100% - 1120px) / 2)) !important;
  justify-content: space-between !important;
  gap: 24px;
  background: var(--auth-nav) !important;
  border-bottom: 1px solid var(--auth-divider) !important;
  backdrop-filter: blur(16px) !important;
  color: var(--auth-ink) !important;
}
[data-auth-brand] { display: flex; align-items: center; gap: 10px; white-space: nowrap; }
[data-auth-brand] > svg { width: 69px; height: 25px; color: #7443d5; }
[data-auth-brand-name] { font-size: 24px; line-height: 1; font-weight: 550; letter-spacing: -.8px; }
[data-auth-brand-divider] { width: 1px; height: 20px; margin: 0 7px 0 14px; background: var(--auth-divider); }
[data-auth-brand-description] { color: var(--auth-muted); font-size: 13px; letter-spacing: .02em; }
[data-auth-nav-actions] { display: flex; align-items: center; gap: 20px; }
[data-auth-security] { display: flex; align-items: center; gap: 7px; color: var(--auth-security-text); font-size: 12px; font-weight: 500; white-space: nowrap; }
[data-auth-security] svg { width: 15px; height: 15px; color: var(--auth-security-icon); }
[data-auth-nav-actions] button { color: var(--auth-icon) !important; border: 1px solid var(--auth-border); border-radius: 12px; width: 38px; height: 38px; }
[data-auth-nav-actions] button:hover { background: var(--auth-hover) !important; border-color: var(--auth-focus); }
[data-auth-main] { width: min(1120px, calc(100% - 64px)); max-width: none !important; margin: 0 auto !important; padding: 52px 0 28px; align-items: stretch !important; }
[data-auth-heading] { display: flex; align-items: center; justify-content: space-between; gap: 32px; margin-bottom: 31px; }
[data-auth-heading-copy] { min-width: 0; }
[data-auth-heading-copy] h1 { margin: 0 0 10px !important; color: var(--auth-ink) !important; font-size: 30px !important; line-height: 1.3 !important; font-weight: 650 !important; letter-spacing: -.9px !important; display: flex; align-items: center; gap: 13px; }
[data-auth-count] { display: inline-flex; align-items: center; padding: 4px 10px; border-radius: 7px; background: var(--auth-accent-soft); color: var(--auth-accent-text); font-size: 12px; font-weight: 550; line-height: 1.4; letter-spacing: 0; white-space: nowrap; }
[data-auth-heading-copy] > p { color: var(--auth-muted) !important; margin: 0 !important; font-size: 13px !important; line-height: 1.7 !important; }
[data-auth-search] { min-width: 0 !important; width: 310px; flex-shrink: 0; margin: 0 !important; }
[data-auth-search] .MuiInputBase-root { height: 46px; min-height: 46px; background: var(--auth-surface) !important; color: var(--auth-ink) !important; border-radius: 11px !important; box-shadow: 0 2px 4px #28274602; padding: 0 15px 0 41px !important; }
[data-auth-search] fieldset { border: 1px solid var(--auth-border) !important; border-radius: 11px !important; }
[data-auth-search] .Mui-focused fieldset { border-color: var(--auth-focus) !important; box-shadow: 0 0 0 3px #8658d911; }
[data-auth-search] .MuiInputBase-root::before { content: ""; width: 17px; height: 17px; position: absolute; left: 15px; top: 14px; background: center / contain no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239096a7' stroke-width='1.8' stroke-linecap='round'%3E%3Ccircle cx='10.5' cy='10.5' r='6.5'/%3E%3Cpath d='m16 16 4 4'/%3E%3C/svg%3E"); }
[data-auth-search] input { padding: 0 !important; height: 46px !important; line-height: 46px; font-size: 13px !important; letter-spacing: 0; }
[data-auth-search] input::placeholder { color: var(--auth-placeholder); opacity: 1 !important; }
[data-auth-grid] { display: grid !important; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin: 0 !important; align-items: start; }
[data-auth-item] { padding: 0 !important; min-width: 0; }
[data-auth-copy] { display: block !important; width: 100%; border-radius: 17px !important; text-align: left !important; vertical-align: top; cursor: pointer; -webkit-tap-highlight-color: transparent; }
[data-auth-card] { display: flex; flex-direction: column; position: relative; min-height: 206px; width: 100%; min-width: 0 !important; padding: 23px 23px 26px; background: var(--auth-surface) !important; border: 1px solid var(--auth-border); border-radius: 17px !important; overflow: hidden; box-shadow: 0 3px 7px #25314502, 0 8px 28px #33305003; transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease; }
[data-auth-copy]:hover [data-auth-card] { border-color: var(--auth-focus); box-shadow: 0 6px 22px #7250ad0b; transform: translateY(-2px); }
[data-auth-copy]:focus-visible { outline: 3px solid #c7b4ee; outline-offset: 4px; }
[data-auth-copy]:active [data-auth-card] { transform: translateY(0); background: var(--auth-hover) !important; }
[data-auth-card-head] { display: flex; align-items: center; gap: 12px; min-width: 0; }
[data-auth-avatar] { width: 40px; height: 40px; flex: 0 0 40px; display: flex; align-items: center; justify-content: center; background: var(--auth-avatar-bg); border: 1px solid var(--auth-avatar-border); color: var(--auth-accent-text); border-radius: 12px; font-size: 19px; font-weight: 600; }
[data-auth-avatar="microsoft"], [data-auth-avatar="account"] { background: var(--auth-mail-bg); border-color: var(--auth-mail-border); color: var(--auth-mail-text); }
[data-auth-avatar="openai"] { background: var(--auth-openai-bg); border-color: var(--auth-openai-border); color: var(--auth-openai-text); }
[data-auth-avatar] svg { width: 20px; height: 20px; }
[data-auth-identity] { min-width: 0; flex: 1; }
[data-auth-identity] p:first-child { margin: 0 0 4px !important; color: var(--auth-ink) !important; font-size: 14px !important; font-weight: 600 !important; line-height: 1.35 !important; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
[data-auth-identity] p:nth-of-type(2) { margin: 0 !important; color: var(--auth-muted) !important; font-size: 11.5px !important; line-height: 1.5 !important; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
[data-auth-copy-symbol] { color: var(--auth-placeholder); align-self: flex-start; margin: 2px -2px 0 2px; flex-shrink: 0; }
[data-auth-copy-symbol] svg { width: 16px; height: 16px; }
[data-auth-copy]:hover [data-auth-copy-symbol] { color: var(--auth-accent); }
[data-auth-code-row] { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 8px; margin-top: 27px; min-width: 0; }
[data-auth-current] { min-width: 0; flex-shrink: 0; }
[data-auth-current] > p { color: var(--auth-muted-soft) !important; font-size: 10px !important; line-height: 1.5 !important; margin: 0 0 5px !important; }
[data-auth-current] h3 { margin: 0 !important; color: var(--auth-code) !important; font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace !important; font-size: 31px !important; line-height: 1.15 !important; font-weight: 550 !important; letter-spacing: 1.5px !important; font-variant-numeric: tabular-nums; white-space: nowrap; }
[data-auth-next] { text-align: right; padding-bottom: 2px; flex-shrink: 0; margin-left: auto; }
[data-auth-next] p:first-child { margin: 0 0 5px !important; font-size: 10px !important; line-height: 1.5 !important; color: var(--auth-muted-soft) !important; }
[data-auth-next] p:last-child { margin: 0 !important; color: var(--auth-next) !important; font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace !important; font-size: 13px !important; line-height: 1.4 !important; letter-spacing: .2px; font-variant-numeric: tabular-nums; white-space: nowrap; }
[data-auth-validity] { position: absolute !important; left: 23px; right: 23px; bottom: 17px; height: 3px; border-radius: 3px; background: var(--auth-track); overflow: hidden; }
[data-auth-validity] > div { border-radius: 3px; height: 3px !important; opacity: .7; }
[data-auth-pin] { position: absolute; right: 22px; top: 68px; color: var(--auth-accent-text); }
[data-auth-pin] svg { width: 12px; height: 12px; }
[data-auth-empty] { grid-column: 1 / -1; padding: 72px 24px; border: 1px dashed var(--auth-border); border-radius: 18px; background: var(--auth-empty-bg); text-align: center; }
[data-auth-empty] > p { margin: 0; color: var(--auth-muted) !important; font-size: 14px; }
[data-auth-item] > .MuiStack-root { min-width: 0 !important; max-width: none !important; width: 100%; min-height: 206px; border: 1px solid var(--auth-border); border-radius: 17px !important; background: var(--auth-surface) !important; color: var(--auth-ink) !important; }
[data-auth-footer] { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px; margin: 34px 0 0 !important; padding: 22px 0 0; border-top: 1px solid var(--auth-divider); }
[data-auth-footer] > p { margin: 0 !important; color: var(--auth-muted-soft) !important; font-size: 12px !important; line-height: 1.6; }
[data-auth-footer] a { display: inline-flex; align-items: center; gap: 7px; color: var(--auth-accent-text); text-decoration: none; font-size: 12px; font-weight: 500; }
[data-auth-footer] a:hover { color: var(--auth-accent); }
[data-auth-footer] svg { width: 13px; height: 13px; }
/* The copied notification and overflow menu are portals owned by the upstream app. */
body:has([data-auth-shell]) .MuiSnackbarContent-root { color: var(--auth-accent-text) !important; background: var(--auth-accent-soft) !important; border: 1px solid var(--auth-focus); border-radius: 12px !important; box-shadow: 0 5px 24px #22233515; }
body:has([data-auth-shell]) #auth-options .MuiPaper-root { background: var(--auth-surface) !important; border: 1px solid var(--auth-border); border-radius: 12px !important; box-shadow: 0 8px 32px #29344d15; }
@media (min-width: 1500px) { [data-auth-main] { padding-top: 62px; } }
@media (max-width: 1023px) {
  [data-auth-grid] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  [data-auth-main] { padding-top: 38px; }
  [data-auth-heading] { gap: 20px; }
  [data-auth-search] { width: 270px; }
}
@media (max-width: 639px) {
  [data-auth-nav] { height: 70px; flex-basis: 70px !important; padding: 0 22px !important; gap: 12px; }
  [data-auth-brand] { gap: 8px; }
  [data-auth-brand] > svg { width: 58px; height: 21px; }
  [data-auth-brand-name] { font-size: 21px; }
  [data-auth-brand-divider], [data-auth-brand-description] { display: none; }
  [data-auth-nav-actions] { gap: 13px; }
  [data-auth-security] { font-size: 10px; gap: 4px; }
  [data-auth-nav-actions] button { width: 34px; height: 34px; border-radius: 10px; }
  [data-auth-main] { width: calc(100% - 40px); padding-top: 30px; }
  [data-auth-heading] { flex-direction: column; align-items: stretch; gap: 22px; margin-bottom: 22px; }
  [data-auth-heading-copy] h1 { font-size: 27px !important; margin-bottom: 8px !important; }
  [data-auth-heading-copy] > p { font-size: 12px !important; }
  [data-auth-search] { width: 100%; }
  [data-auth-grid] { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  [data-auth-card] { min-height: 199px; padding: 22px 22px 25px; }
  [data-auth-code-row] { margin-top: 25px; }
  [data-auth-current] h3 { font-size: 32px !important; }
  [data-auth-footer] { margin-top: 27px !important; gap: 12px; padding-top: 21px; }
}
@media (prefers-reduced-motion: reduce) { [data-auth-card] { transition: none; } }


[data-auth-theme-control] { display:flex; gap:3px; padding:3px; border:1px solid var(--auth-border); border-radius:11px; background:var(--auth-bg); }
[data-auth-theme-control] button { display:grid; place-items:center; width:29px; height:29px; padding:0; border:0; border-radius:7px; background:transparent; color:var(--auth-muted); cursor:pointer; }
[data-auth-theme-control] svg { width:15px; height:15px; }
[data-auth-theme-control] button[aria-pressed="true"] { color:var(--auth-accent-text) !important; background:var(--auth-surface) !important; box-shadow:0 1px 4px #20233513; }
[data-auth-theme-control] button:hover { background:var(--auth-hover) !important; }
[data-auth-theme-control] button:focus-visible, [data-auth-edit]:focus-visible { outline:2px solid var(--auth-focus); outline-offset:3px; }
[data-auth-item] { position:relative; }
[data-auth-card-head] { padding-right:32px; }
[data-auth-copy-symbol] { display:none; }
[data-auth-edit] { position:absolute; top:20px; right:16px; z-index:3; display:grid; place-items:center; width:31px; height:31px; padding:0; border:1px solid transparent; border-radius:9px; background:transparent; color:var(--auth-placeholder); cursor:pointer; }
[data-auth-edit] svg { width:16px; height:16px; }
[data-auth-edit]:hover { color:var(--auth-accent-text); background:var(--auth-hover); border-color:var(--auth-border); }
[data-auth-note] { display:block; margin-top:4px; color:var(--auth-muted); font-size:11px; line-height:1.4; max-width:100%; overflow:hidden; white-space:nowrap; text-overflow:ellipsis; }
[data-auth-notice] { position:fixed; bottom:26px; left:50%; transform:translateX(-50%); z-index:1500; margin:0; padding:12px 20px; border:1px solid var(--auth-focus); border-radius:12px; background:var(--auth-accent-soft); color:var(--auth-accent-text); font-size:13px; box-shadow:0 8px 30px #0002; }
[data-auth-editor] { color-scheme:var(--auth-color-scheme); width:min(480px, calc(100vw - 32px)); max-width:480px; max-height:calc(100svh - 40px); padding:0; border:1px solid var(--auth-border); border-radius:20px; background:var(--auth-surface); color:var(--auth-ink); box-shadow:0 24px 90px #0004; font-family:Inter,"Noto Sans","Noto Sans CJK SC",system-ui,sans-serif; overflow:auto; }
[data-auth-editor]::backdrop { background:#14132366; backdrop-filter:blur(5px); }
[data-auth-editor] * { box-sizing:border-box; }
[data-auth-editor-form] { margin:0; }
[data-auth-editor-form] header { display:flex; align-items:center; justify-content:space-between; padding:25px 26px 22px; gap:16px; border-bottom:1px solid var(--auth-divider); }
[data-auth-editor-form] header > div { display:flex; gap:13px; align-items:center; min-width:0; }
[data-auth-editor-icon] { display:grid; place-items:center; flex-shrink:0; width:39px; height:39px; border-radius:12px; background:var(--auth-accent-soft); color:var(--auth-accent-text); }
[data-auth-editor-icon] svg { width:19px; height:19px; }
[data-auth-editor-form] h2 { font-size:18px; line-height:1.4; margin:0 0 5px; font-weight:600; color:var(--auth-ink); }
[data-auth-editor-form] header p { margin:0; font-size:11px; line-height:1.6; color:var(--auth-muted); }
[data-auth-dialog-close] { display:grid; place-items:center; flex-shrink:0; width:30px; height:30px; padding:0; border:0; border-radius:8px; background:transparent; color:var(--auth-muted); cursor:pointer; }
[data-auth-dialog-close] svg { width:18px; height:18px; }
[data-auth-dialog-close]:hover { background:var(--auth-hover); }
[data-auth-editor-fields] { display:grid; grid-template-columns:minmax(0,1fr); padding:23px 26px 25px; gap:9px; }
[data-auth-editor-fields] > label { display:flex; align-items:center; justify-content:space-between; font-size:12px; font-weight:550; color:var(--auth-ink); margin-top:8px; }
[data-auth-editor-fields] > label:first-child { margin-top:0; }
[data-auth-editor-fields] > label > span:not(:only-child) { font-size:10px; font-weight:400; color:var(--auth-muted); }
[data-auth-editor-fields] > input, [data-auth-editor-fields] textarea { width:100%; min-width:0; border:1px solid var(--auth-border); border-radius:9px; padding:11px 12px; outline:none; background:var(--auth-bg); color:var(--auth-ink); font:400 13px/1.5 Inter,"Noto Sans CJK SC",system-ui,sans-serif; }
[data-auth-editor-fields] input::placeholder, [data-auth-editor-fields] textarea::placeholder { color:var(--auth-placeholder); }
[data-auth-editor-fields] > input:focus, [data-auth-editor-fields] textarea:focus { border-color:var(--auth-focus); box-shadow:0 0 0 3px #8a65d815; }
[data-auth-editor-fields] textarea { resize:vertical; min-height:84px; max-height:180px; }
[data-auth-editor-fields] [data-auth-pin-option] { justify-content:flex-start; gap:10px; margin-top:12px; cursor:pointer; }
[data-auth-pin-option] input { width:16px; height:16px; margin:0; accent-color:#8b5cce; }
[data-auth-editor-fields] [data-auth-pin-option] > span { display:flex; flex-direction:column; gap:4px; font-size:12px; font-weight:500; color:var(--auth-ink); }
[data-auth-pin-option] small { font-size:10px; font-weight:400; color:var(--auth-muted); }
[data-auth-editor-error] { margin:9px 0 0; padding:10px 12px; border-radius:8px; background:#e4616910; color:var(--auth-error); font-size:12px; line-height:1.7; }
[data-auth-editor-form] footer { display:flex; justify-content:flex-end; gap:10px; padding:18px 26px; border-top:1px solid var(--auth-divider); background:var(--auth-bg); }
[data-auth-editor-form] footer button { border:1px solid var(--auth-border); border-radius:9px; background:var(--auth-surface); color:var(--auth-muted); font-family:inherit; font-size:12px; font-weight:500; line-height:1.4; padding:10px 19px; cursor:pointer; }
[data-auth-editor-form] footer [data-auth-save] { color:#fff; background:#8054c8; border-color:#8054c8; }
[data-auth-editor-form] footer [data-auth-save]:hover:not(:disabled) { background:#7147b7; }
[data-auth-editor-form] button:disabled { opacity:.5; cursor:default; }
@media (max-width:639px) {
  [data-auth-nav-actions] { gap:10px; }
  [data-auth-security] { display:none; }
  [data-auth-theme-control] { padding:2px; gap:2px; border-radius:10px; }
  [data-auth-theme-control] button { width:26px; height:26px; border-radius:6px; }
  [data-auth-theme-control] svg { width:14px; height:14px; }
  [data-auth-edit] { top:19px; right:16px; }
  [data-auth-editor-form] header { padding:21px 20px 19px; }
  [data-auth-editor-fields] { padding:19px 20px 22px; }
  [data-auth-editor-form] footer { padding:16px 20px; }
}
