.auth-backdrop { position: fixed; inset: 0; z-index: 100; background: #0b0b0b99; backdrop-filter: blur(3px); }
.auth-backdrop[hidden] { display: none; }
dialog.auth-dialog[open] { position: fixed; inset: 0; height: fit-content; margin: auto; z-index: 101; }
dialog:has(#auth-form) {
  width: 440px;
  padding: 30px;
  border: 1px solid var(--tone-484848);
  border-radius: 18px;
  background: linear-gradient(150deg, var(--tone-303030), var(--tone-252525) 45%);
  box-shadow: 0 24px 80px #0006, inset 0 1px 0 #ffffff08;
}
dialog:has(#auth-form) .dialog-heading h2 { font-size: 28px; font-weight: 650; letter-spacing: -.7px; }
dialog:has(#auth-form) .dialog-heading button { width: 30px; height: 30px; border-radius: 8px; flex-shrink: 0; }
dialog .auth-intro { margin: 7px 0 0; font-size: 16px; line-height: 1.6; color: var(--tone-b5b5b5); }
.auth-form { display: grid; gap: 16px; margin-top: 24px; }
.auth-form button { padding: 11px 14px; border-radius: 9px; font-size: 16px; font-weight: 550; min-width: 0; }
.auth-providers { display: grid; gap: 10px; }
.auth-providers button { display: grid; grid-template-columns: 20px 1fr 20px; gap: 12px; width: 100%; min-height: 46px; border: 1px solid; transition: background .15s, border-color .15s, box-shadow .15s; }
.auth-providers button span { grid-column: 2; }
.auth-providers svg { width: 20px; height: 20px; }
.auth-providers [data-oauth="google"] { color: #1f1f1f; background: #fff; border-color: #dadce0; }
.auth-providers [data-oauth="google"]:hover { color: #1f1f1f; background: #f2f5fc; border-color: #b8c7e0; box-shadow: 0 1px 4px #0002; }
.auth-providers [data-oauth="github"] { color: #fff; background: #24292f; border-color: #57606a; }
.auth-providers [data-oauth="github"]:hover { color: #fff; background: #32383f; border-color: #8c959f; }
.auth-providers [data-oauth="azure"] { color: #1f1f1f; background: #fff; border-color: #8c8c8c; }
.auth-providers [data-oauth="azure"]:hover { color: #1f1f1f; background: #f2f2f2; border-color: #666; }
.auth-divider { display: flex; align-items: center; gap: 14px; margin: 4px 0; color: var(--tone-b5b5b5); font-size: 14px; }
.auth-divider::before, .auth-divider::after { content: ''; height: 1px; background: var(--tone-484848); flex: 1; }
.auth-form label { display: grid; gap: 8px; font-size: 15px; font-weight: 550; }
.auth-form input { width: 100%; min-width: 0; min-height: 44px; border: 1px solid var(--tone-575757); border-radius: 9px; padding: 11px 12px; background: var(--tone-191919); color: inherit; font: inherit; font-size: 17px; font-weight: 400; transition: border-color .15s, box-shadow .15s; }
.auth-form input:focus-visible { outline: 2px solid var(--tone-b5b5b5); outline-offset: 2px; border-color: var(--tone-b5b5b5); box-shadow: none; }
.auth-form .primary-button { min-height: 46px; background: var(--tone-f2f2f2); color: var(--tone-191919); font-weight: 650; box-shadow: 0 2px 4px #0002; }
.auth-form .primary-button:hover { background: var(--tone-d6d6d6); color: var(--tone-191919); }
.auth-switch { display: flex; flex-wrap: wrap; justify-content: center; align-items: baseline; gap: 4px 6px; font-size: 15px; color: var(--tone-b5b5b5); }
.auth-switch button { padding: 4px 2px; color: var(--tone-f2f2f2); font-size: 15px; }
.auth-form .auth-back { font-size: 15px; }
.auth-switch button:hover, .auth-back:hover { text-decoration: underline; text-underline-offset: 3px; }
.auth-form button:disabled { opacity: .55; cursor: wait; }
.auth-form p { margin: 0; overflow-wrap: anywhere; }
#auth-status { font-size: 15px; line-height: 1.6; color: var(--tone-eaeaea); }
#auth-status:empty { display: none; }
.auth-local-note { display: flex; align-items: flex-start; gap: 9px; margin-top: 22px; border-top: 1px solid var(--tone-484848); padding-top: 16px; color: var(--tone-b5b5b5); font-size: 14px; line-height: 1.6; }
.auth-local-note svg { width: 16px; height: 16px; flex-shrink: 0; margin-top: 2px; }
#auth-code { font-family: var(--mono); font-size: 24px; text-align: center; letter-spacing: .35em; }
@media (max-width: 480px) {
  dialog:has(#auth-form) { padding: 24px 20px; border-radius: 14px; }
}

.cloud-file-list { display:grid; gap:8px; margin-top:16px; }
.cloud-file-list button { display:grid; justify-content:start; text-align:left; padding:12px; background:var(--tone-292929); }
.cloud-file-list small { color:var(--tone-b5b5b5); }
.cloud-share-link { margin-top:18px; padding:12px; background:var(--tone-292929); overflow-wrap:anywhere; }
.cloud-share-link input { display:block; width:100%; font-size:13px; padding:8px; color:inherit; background:var(--tone-191919); border:0; }

.auth-form select,.auth-form textarea{width:100%;color:inherit;background:var(--tone-191919);padding:9px;border:1px solid var(--tone-666);border-radius:4px;}
.billing-team{border-top:1px solid var(--tone-484848);margin-top:22px;padding-top:12px;}
.billing-seat{display:grid;gap:5px;padding:12px 0;overflow-wrap:anywhere;}
.billing-seat small{color:var(--tone-b5b5b5);}.invite-results{white-space:pre-line;}

dialog:has(.file-dialog-form) { width: 460px; border: 1px solid var(--tone-484848); border-radius: 16px; padding: 28px; background: linear-gradient(145deg,var(--tone-303030),var(--tone-252525) 50%); }
.file-dialog-intro { display: flex; align-items: center; gap: 13px; margin: 20px 0 24px; }
.file-dialog-icon { display: grid; place-items: center; width: 44px; height: 44px; flex-shrink: 0; background: var(--tone-343434); border: 1px solid var(--tone-484848); border-radius: 12px; }
.file-dialog-icon svg { width: 23px; height: 23px; }
dialog .file-dialog-intro p { margin: 0; font-size: 16px; line-height: 1.5; }
.file-dialog-intro small { display: block; font-size: 13px; margin-top: 3px; color: var(--tone-b5b5b5); }
.file-dialog-form { display: grid; gap: 12px; }
.file-dialog-form label { display: grid; gap: 8px; font-size: 14px; font-weight: 550; }
.file-dialog-form input,.file-dialog-form select { width: 100%; min-width: 0; padding: 12px; border: 1px solid var(--tone-575757); border-radius: 9px; background: var(--tone-191919); color: inherit; font-size: 15px; }
.file-dialog-form input:focus-visible,.file-dialog-form select:focus-visible { outline: 2px solid var(--tone-b5b5b5); outline-offset: 2px; }
.file-dialog-form button { padding: 9px 12px; border-radius: 8px; font-size: 14px; }
.file-dialog-form button svg { width: 16px; height: 16px; }
.file-dialog-actions { display: flex; justify-content: flex-end; gap: 8px; border-top: 1px solid var(--tone-484848); margin-top: 8px; padding-top: 18px; }
.file-dialog-actions .primary-button { background: var(--tone-f2f2f2); color: var(--tone-191919); min-height: 42px; font-weight: 600; }
.file-dialog-actions .primary-button:hover { background: var(--tone-d6d6d6); }
.save-folder-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; }
.save-folder-heading label { display: block; }
.save-folder-heading label span { margin-left: 5px; color: var(--tone-b5b5b5); font-size: 12px; font-weight: 400; }
.save-folder-heading button { padding: 5px 7px; font-size: 13px; }
.save-new-folder { padding: 14px; background: var(--tone-292929); border: 1px solid var(--tone-484848); border-radius: 10px; }
.save-new-folder[hidden] { display: none; }
.save-new-folder > div { display: flex; gap: 6px; margin-top: 10px; }
.save-new-folder small,.save-location-note { font-size: 12px; color: var(--tone-b5b5b5); line-height: 1.6; }
.save-new-folder small { display: block; margin-top: 6px; }
dialog .file-dialog-form p { margin: 0; font-size: 13px; line-height: 1.6; overflow-wrap: anywhere; }
.file-dialog-form p:empty { display: none; }
.file-dialog-actions .danger-button { background: #a73737; color: #fff; min-height: 42px; }
.file-dialog-actions .danger-button:hover { background: #bd4141; }
/* Folder actions share the file menu's hover/focus behavior. */
.folder summary .folder-more { width: 26px; height: 26px; margin-left: 3px; padding: 0; font-size: 22px; color: var(--tone-b5b5b5); opacity: 0; flex-shrink: 0; }
.folder summary:hover .folder-more,.folder summary:focus-within .folder-more,.folder summary.menu-open .folder-more { opacity: 1; }
.folder-menu button:last-child { border-top: 0; margin-top: 0; }
@media (hover: none) { .folder summary .folder-more { opacity: 1; } }

.auth-qr { width: 180px; max-width: 100%; height: auto; justify-self: center; background: white; padding: 12px; border-radius: 8px; }
.auth-form .auth-secret { font-family: var(--mono); font-size: 14px; }

.auth-security-control { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.auth-security-control button { text-align: left; padding-inline: 0; }
#auth-mfa-state { font-size: 14px; color: var(--tone-b5b5b5); white-space: nowrap; }

dialog:has(.share-form) { width: 580px; max-width: calc(100vw - 32px); padding: 30px; border: 1px solid var(--tone-484848); border-radius: 16px; background: var(--tone-252525); }
.share-intro { display: flex; align-items: center; gap: 14px; margin: 24px 0; }
.share-intro > div { min-width: 0; }
.share-intro strong { overflow-wrap: anywhere; font-size: 17px; }
dialog .share-intro p { font-size: 14px; color: var(--tone-b5b5b5); margin: 5px 0 0; line-height: 1.6; }
.share-form { display: grid; gap: 16px; }
.share-option { border: 1px solid var(--tone-454545); border-radius: 11px; padding: 18px; background: var(--tone-292929); }
.share-switch-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; cursor: pointer; }
.share-switch-row strong { display: block; font-size: 15px; font-weight: 550; }
.share-switch-row small,.share-field small { display: block; margin-top: 5px; color: var(--tone-a7a7a7); font-size: 12px; line-height: 1.5; }
.share-switch-row input { appearance: none; flex: 0 0 36px; width: 36px; height: 21px; border-radius: 20px; background: var(--tone-575757); position: relative; cursor: pointer; }
.share-switch-row input::before { content: ''; position: absolute; width: 15px; height: 15px; left: 3px; top: 3px; border-radius: 50%; background: #fff; transition: transform .15s; }
.share-switch-row input:checked { background: #397eaf; }
.share-switch-row input:checked::before { transform: translateX(15px); }
.share-field { display: grid; gap: 8px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--tone-454545); font-size: 14px; }
.share-field input { width: 100%; padding: 12px; background: var(--tone-191919); border: 1px solid var(--tone-575757); border-radius: 8px; color: inherit; font-size: 15px; }
.share-field textarea { width:100%; padding:12px; background:var(--tone-191919); border:1px solid var(--tone-575757); border-radius:8px; color:inherit; font-size:15px; line-height:1.6; resize:vertical; min-height:90px; }
.share-form > .primary-button { min-height: 46px; border-radius: 8px; background: var(--tone-f2f2f2); color: var(--tone-191919); font-size: 15px; font-weight: 600; }
.share-form [data-cloud-status]:empty { display: none; }
.share-links:empty { display: none; }
.share-links { margin-top: 26px; border-top: 1px solid var(--tone-454545); }
.share-links .cloud-share-link { padding: 16px; border: 1px solid var(--tone-454545); border-radius: 10px; }
.share-link-heading { display: grid; gap: 5px; margin-bottom: 12px; }
.share-link-heading strong { font-size: 14px; }
.share-link-notes { margin-top: 12px; font-size: 13px; color: var(--tone-a7a7a7); }
.share-link-notes p { margin: 6px 0; }
.share-password-value { white-space: pre-wrap; overflow-wrap: anywhere; color: var(--tone-f2f2f2); }
.share-link-heading small { font-size: 12px; color: var(--tone-a7a7a7); }
.share-link-value { display: flex; gap: 8px; align-items: center; }
.share-link-value input { min-width: 0; flex: 1; border-radius: 6px; }
.share-copy { padding: 8px 10px; font-size: 13px; background: var(--tone-393939); flex-shrink: 0; }
.share-revoke { margin-top: 10px; padding: 4px 0; font-size: 12px; color: var(--tone-a7a7a7); }

.share-submit-actions { display:flex; gap:10px; flex-wrap:wrap; }
.share-submit-actions button { flex:1; padding:12px 14px; min-height:46px; border:1px solid var(--tone-575757); border-radius:8px; font-size:14px; }
.share-submit-actions .primary-button { background:var(--tone-f2f2f2); color:var(--tone-191919); font-weight:600; }
#share-email-note { font-size:12px; line-height:1.6; color:var(--tone-b5b5b5); }
dialog:has(#cloud-share) { width: 660px; padding: 20px 24px; }
dialog:has(#cloud-share) .share-intro { gap: 12px; margin: 14px 0; }
dialog:has(#cloud-share) .share-intro strong { font-size: 15px; }
#cloud-share { gap: 10px; }
#cloud-share .share-option { padding: 12px 14px; border-radius: 9px; }
#cloud-share .share-switch-row strong { font-size: 14px; }
#cloud-share .share-switch-row small { margin-top: 3px; }
#cloud-share .share-field { gap: 6px; margin-top: 10px; padding-top: 10px; }
#cloud-share .share-field input, #cloud-share .share-field textarea { padding: 9px 10px; font-size: 14px; }
#cloud-share .share-field textarea { min-height: 56px; line-height: 1.4; }
#cloud-share .share-submit-actions button { min-height: 40px; padding: 9px 12px; }
.share-pro-notice { padding: 11px 14px; border: 1px solid #c49a32; border-radius: 8px; background: #fff3cd; color: #59420b; font-size: 13px; line-height: 1.5; }
dialog .share-pro-notice p { margin: 3px 0 6px; color: inherit; font-size: 13px; line-height: 1.5; }
.share-pro-notice a { color: #694c00; font-weight: 650; text-decoration: underline; text-underline-offset: 3px; }
.share-pro-notice a:focus-visible { outline: 2px solid #694c00; outline-offset: 3px; }
dialog:has(.unshare-panel) { width:780px; max-width:calc(100vw - 32px); }
.unshare-panel .share-intro { margin:10px 0 8px; }
.unshare-links { max-height:45vh; overflow:auto; border:1px solid var(--tone-454545); border-radius:8px; }
.unshare-links:empty { border:0; }
.unshare-links > p { padding:16px; }
.unshare-table { width:100%; border-collapse:collapse; font-size:13px; text-align:left; }
.unshare-table th { position:sticky; top:0; z-index:1; background:var(--tone-303030); color:var(--tone-b5b5b5); font-size:12px; font-weight:550; }
.unshare-table th,.unshare-table td { padding:10px 12px; border-bottom:1px solid var(--tone-393939); white-space:nowrap; }
.unshare-table tr:last-child td { border-bottom:0; }
.unshare-recipient { max-width:230px; overflow:hidden; text-overflow:ellipsis; }
.unshare-row-actions { display:flex; align-items:center; gap:8px; }
.unshare-panel .unshare-remove { color:#e9a8a8; padding:4px 6px; font-size:12px; }
.unshare-panel .unshare-copy { padding:4px; width:26px; height:26px; color:var(--tone-b5b5b5); }
.unshare-panel .unshare-edit-expiry { width:24px; height:24px; padding:4px; margin-left:4px; vertical-align:middle; color:var(--tone-b5b5b5); }
.unshare-panel .unshare-edit-expiry svg { width:14px; height:14px; }
.unshare-expiry-editor { display:grid; gap:6px; min-width:155px; }
.unshare-panel .unshare-expiry-editor input { padding:6px; font-size:12px; }
.unshare-expiry-editor small { font-size:11px; color:var(--tone-a7a7a7); }
.unshare-expiry-editor > div { display:flex; gap:5px; }
.unshare-panel .unshare-expiry-editor button { padding:4px 6px; font-size:11px; background:var(--tone-393939); }

.billing-secondary-actions{display:flex;flex-direction:column;align-items:flex-start;gap:12px;margin-top:24px;padding-top:20px;border-top:1px solid var(--tone-484848);}
.billing-secondary-actions button{padding:8px 0;text-decoration:underline;text-underline-offset:3px;}
.billing-secondary-actions small{color:var(--tone-b5b5b5);}
.billing-cancellation-notice{padding:14px 16px;border:1px solid #a9843c;border-left:4px solid #c89a3d;border-radius:6px;background:rgba(200,154,61,.09);line-height:1.6;}

.billing-plan-cards { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; margin: 22px 0; }
.billing-plan-card { border: 1px solid var(--tone-484848); border-radius: 12px; padding: 20px; }
.billing-plan-card.current-plan { border: 2px solid #78b0ff; background: #78b0ff0b; }
.billing-plan-card h3 { font-size: 22px; margin: 0 0 8px; }
.billing-plan-card strong { color: #78b0ff; }
.billing-plan-card ul { padding-left: 18px; line-height: 1.8; }
.billing-payment-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.billing-payment-actions button { border: 1px solid var(--tone-484848); border-radius: 8px; padding: 12px 16px; }
dialog:has(.billing-plan-cards) { width: min(740px, 92vw); }
@media(max-width:540px) { .billing-plan-cards { grid-template-columns: 1fr; } }

.billing-purchase-form { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
.billing-purchase-form > label:first-child, .billing-purchase-form > button { grid-column:1 / -1; }
.billing-plan-card ul { line-height:1.5; margin-bottom:12px; }
.billing-plan-card { padding:16px; }
.billing-plan-cards { margin:16px 0; }
.folder-upgrade-link { color:var(--tone-f2f2f2); font-weight:600; text-decoration:underline; text-underline-offset:3px; }
.folder-upgrade-link:focus-visible { outline:2px solid currentColor; outline-offset:3px; border-radius:2px; }
.profile-plan { padding:14px 0; border-bottom:1px solid var(--tone-575757); }
.profile-plan p { margin:6px 0 10px; font-size:13px; line-height:1.5; }
.profile-plan > strong { display:block; margin-bottom:8px; }

/* Keep the settings summary and its primary actions together. */
.settings-billing > p { margin:0 0 8px; font-size:14px; line-height:1.45; }
.settings-billing > p:empty,.settings-billing > div:empty { display:none; }
.settings-billing .billing-cancellation-notice { margin:12px 0; padding:12px 14px; line-height:1.45; }
.settings-billing .billing-cancellation-notice h3 { margin:0 0 6px; font-size:17px; }
.settings-billing .billing-cancellation-notice p { margin:0 0 10px; font-size:13px; line-height:1.5; }
.settings-billing .billing-secondary-actions { flex-direction:row; flex-wrap:wrap; align-items:center; gap:8px 16px; margin-top:14px; padding-top:14px; }
.settings-billing .billing-secondary-actions button { font-size:13px; }
.settings-billing .billing-secondary-actions .billing-view-plans { min-height:42px; min-width:140px; padding:10px 22px; font-size:15px; font-weight:600; text-decoration:none; }
.settings-legal-copy { font-size:14px; line-height:1.6; }
