@layer components {
    .auth-modal, .community-compose-overlay { position: fixed; inset: 0; }
    .auth-modal[hidden], .community-compose-overlay[hidden], .community-compose-media[hidden], .community-compose-poll[hidden], .cookie-consent[hidden] { display: none; }
    .auth-modal { z-index: 2300; display: grid; place-items: center; padding: 24px; background: rgba(0,0,0,.72); backdrop-filter: blur(10px); }
    .auth-dialog { position: relative; width: min(100%, 380px); padding: 30px; border: 1px solid var(--tr-border-strong); border-radius: var(--tr-radius-card); background: #141414; }
    .auth-close { position: absolute; top: 14px; right: 14px; width: 34px; height: 34px; border: 1px solid var(--tr-border-strong); border-radius: var(--tr-radius-control); background: transparent; cursor: pointer; }
    .auth-close::before, .auth-close::after { content: ""; position: absolute; top: 16px; left: 10px; right: 10px; height: 2px; border-radius: 2px; background: var(--tr-text); }
    .auth-close::before { transform: rotate(45deg); }
    .auth-close::after { transform: rotate(-45deg); }
    .auth-logo { display: inline-flex; align-items: center; min-height: 36px; margin-bottom: 22px; padding: 8px 12px 8px 38px; border-radius: var(--tr-radius-control); background: #1d1d1d url('/imgs/tradingray-logo.svg') 8px center / 24px no-repeat; color: #fff; text-decoration: none; font-size: 15px; font-weight: 600; }
    .auth-dialog h2 { margin: 28px 0 18px; color: var(--tr-text); font-size: 26px; }
    .auth-dialog p { margin: -12px 0 22px; color: var(--tr-text-secondary); font-size: 14px; }
    .auth-form { display: grid; gap: 14px; }
    .auth-field { display: grid; gap: 8px; color: var(--tr-text-secondary); font-size: 11px; }
    .auth-field input { width: 100%; height: 44px; padding: 0 13px; border: 1px solid var(--tr-border-strong); border-radius: var(--tr-radius-control); background: var(--tr-border); color: var(--tr-text); font-size: 16px; outline: none; }
    .auth-field .auth-code-input { text-align: center; letter-spacing: .28em; font-size: 20px; font-weight: 600; }
    .auth-submit-row { display: flex; gap: 8px; }
    .auth-submit-row .auth-primary { flex: 1; }
    .auth-primary, .auth-secondary { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: var(--tr-radius-control); font-size: 14px; font-weight: 600; cursor: pointer; }
    .auth-primary { border: 0; background: #fff; color: #0a0a0a; }
    .auth-secondary { border: 1px solid var(--tr-border-strong); background: transparent; color: var(--tr-text); }
    .auth-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
    .auth-forgot, .auth-back-link { width: fit-content; padding: 0; border: 0; background: transparent; color: var(--tr-text-secondary); cursor: pointer; font-size: 12px; }
    .auth-forgot { justify-self: end; margin-top: -6px; }
    .auth-back-link { justify-self: center; }
    .auth-dialog label.checkbox { display: block; padding: 5px 5px 5px 25px; background: url('/imgs/r_offw.svg') left center / 16px no-repeat; color: #99a1ad; cursor: pointer; font-size: 12px; }
    .auth-dialog label.checkbox:has(input:checked) { background-image: url('/imgs/r_on.svg'); }
    .auth-dialog label.checkbox input { display: none; }
    .auth-dialog label.checkbox a, .auth-link { color: #bbcde5; text-decoration: none; }
    .auth-modal .exist { color: var(--tr-text-secondary); font-size: 12px; text-align: center; }
    .auth-modal .exist > div { display: inline; color: var(--tr-link); cursor: pointer; }
    .auth-terms-note { margin-top: 24px; color: var(--tr-text-muted); font-size: 13px; text-align: center; }
    .auth-terms-note a { color: var(--tr-link); }
    .auth-divider { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; margin: 8px 0; color: var(--tr-text-muted); font-size: 13px; }
    .auth-divider::before, .auth-divider::after { content: ""; height: 1px; background: var(--tr-border-strong); }
    .auth-socials { display: grid; gap: 8px; }
    .auth-socials > a, .auth-socials > button { width: 100%; padding: 12px; border: 1px solid var(--tr-border-strong); border-radius: var(--tr-radius-control); background: #141414; color: var(--tr-text); text-align: center; text-decoration: none; cursor: pointer; }
    .auth-socials > .google { background: #141414 url('/imgs/socials/google.svg') 16px center / 18px no-repeat; }
    .auth-socials > .apple { background: #141414 url('/imgs/socials/apple.svg') 16px center / 18px no-repeat; }
    .auth-note { min-height: 20px; color: var(--tr-text-secondary); font-size: 13px; }
    .auth-note:empty { display: none; }
    .auth-note.error { color: #ff8f9c; }
    .auth-note.success { color: var(--tr-link); }
    .auth-button-loader, .auth-web-qr-loader { display: none; width: 14px; height: 14px; border: 2px solid rgba(10,10,10,.18); border-top-color: #0a0a0a; border-radius: 50%; }
    .auth-primary.is-loading .auth-button-loader, .auth-web-qr-code.is-loading .auth-web-qr-loader { display: block; }
    .auth-resend, .auth-strength-text { color: var(--tr-text-secondary); font-size: 13px; text-align: center; }
    .auth-strength { display: grid; gap: 8px; }
    .auth-strength-bar { height: 6px; overflow: hidden; border-radius: var(--tr-radius-pill); background: var(--tr-border-strong); }
    .auth-strength-bar span { display: block; width: var(--strength, 0%); height: 100%; background: var(--tr-link); }
    .auth-reqs { display: grid; gap: 6px; margin: 0; padding: 0; }
    .auth-reqs li { display: grid; grid-template-columns: 16px 1fr; gap: 6px; color: var(--tr-text-muted); list-style: none; font-size: 13px; }
    .auth-reqs li::before { content: "-"; text-align: center; }
    .auth-reqs li.ok::before { content: "✓"; color: var(--tr-link); }
    .auth-qr-trigger { width: 44px; flex: 0 0 44px; border: 0; border-radius: var(--tr-radius-control); background: var(--tr-border) url('/imgs/icons/qr-login.svg') center / 21px no-repeat; cursor: pointer; }
    .auth-web-qr { display: flex; flex-direction: column; align-items: center; gap: 12px; }
    .auth-web-qr-code { width: min(236px, 100%); aspect-ratio: 1; display: grid; place-items: center; padding: 10px; border-radius: 12px; background: #fff; }
    .auth-web-qr-code img { width: 100%; height: 100%; }
    .auth-web-qr-countdown, .auth-web-qr-status { min-height: 18px; color: var(--tr-text-secondary); font-size: 12px; text-align: center; }

    .community-compose-overlay { position: fixed; inset: 0; z-index: 10020; display: flex; align-items: flex-end; justify-content: center; padding: 24px 16px 0; background: rgba(3,4,6,var(--community-compose-backdrop-alpha, 0)); transition: background-color .22s ease; }
    .community-compose-overlay.is-open { background: rgba(3,4,6,var(--community-compose-backdrop-alpha, .82)); }
    .community-compose-dialog { position: relative; width: min(720px, 100%); max-height: min(760px, calc(100dvh - 24px)); overflow: hidden; border: 1px solid var(--tr-card-border); border-bottom: 0; border-radius: 16px 16px 0 0; background: var(--tr-surface); color: var(--tr-text); box-shadow: 0 -10px 40px rgba(0,0,0,.6); transform: translate3d(0, 100%, 0); will-change: transform; }
    .community-compose-dialog.is-before-open { transform: translate3d(0, 100%, 0); }
    .community-compose-dialog.is-opening { transition: transform .28s cubic-bezier(.2,0,.2,1); }
    .community-compose-overlay.is-open .community-compose-dialog { transform: translate3d(0, 0, 0); }
    .community-compose-dialog.is-dragging { transition: none; }
    .community-compose-dialog.is-returning { transition: transform .18s cubic-bezier(.2,0,.2,1); }
    .community-compose-dialog.is-closing { transform: translate3d(0, 100%, 0); transition: transform .22s cubic-bezier(.4,0,1,1); }
    .community-compose-handle { position: absolute; top: 10px; left: 50%; width: 52px; height: 5px; border-radius: var(--tr-radius-pill); background: #474a52; transform: translateX(-50%); cursor: grab; touch-action: none; z-index: 2; transition: background-color 150ms ease; }
    .community-compose-handle:hover { background: #6b7280; }
    .community-compose-dialog.is-dragging .community-compose-handle { cursor: grabbing; background: #8e96a4; }
    .community-compose-dialog > header { min-height: 62px; display: flex; align-items: center; justify-content: space-between; padding: 24px 20px 14px; border-bottom: 1px solid var(--tr-card-border); }
    .community-compose-dialog h2 { margin: 0; font-size: 19px; font-weight: 600; letter-spacing: -.02em; color: var(--tr-text); }
    .community-compose-close-btn { display: flex; align-items: center; justify-content: center; width: 32px; height: 32px; border: 0; border-radius: var(--tr-radius-control); background: transparent; color: var(--tr-text-muted); font-size: 22px; line-height: 1; cursor: pointer; transition: background 150ms, color 150ms; }
    .community-compose-close-btn:hover { background: var(--tr-surface-hover); color: var(--tr-text); }
    .community-compose-dialog form { max-height: calc(min(760px, calc(100dvh - 24px)) - 62px); display: grid; gap: 12px; overflow-y: auto; padding: 16px 20px max(16px, env(safe-area-inset-bottom)); }
    .community-compose-input { min-height: 150px; max-height: 320px; overflow-y: auto; padding: 12px 14px; border: 0; border-radius: var(--tr-radius-control); background: #08090a; color: var(--tr-text); font-size: 16px; line-height: 1.55; outline: none; transition: background-color 150ms ease; }
    .community-compose-input:focus { background: #14161a; outline: none; }
    .community-compose-input:empty::before { content: attr(data-placeholder); color: var(--tr-text-muted); }
    .community-compose-media { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; max-height: 180px; overflow-y: auto; }
    .community-compose-media-item { position: relative; display: block; overflow: hidden; aspect-ratio: 1; border-radius: var(--tr-radius-control); background: #07080a; border: 1px solid var(--tr-card-border); }
    .community-compose-media-item img, .community-compose-media-item video { display: block; width: 100%; height: 100%; object-fit: cover; }
    .community-compose-media-item button { position: absolute; top: 6px; right: 6px; display: flex; align-items: center; justify-content: center; width: 24px; height: 24px; padding: 0; border: 0; border-radius: 50%; background: rgba(0, 0, 0, .75); color: #ffffff; font-size: 16px; line-height: 1; cursor: pointer; backdrop-filter: blur(4px); transition: background-color 150ms ease, transform 150ms ease; }
    .community-compose-media-item button:hover { background: rgba(0, 0, 0, .95); transform: scale(1.08); }
    .community-compose-poll { display: grid; gap: 8px; padding: 12px; border-radius: var(--tr-radius-control); background: rgba(255,255,255,.02); }
    .community-compose-poll label { display: grid; gap: 5px; color: var(--tr-text-secondary); font-size: 12px; }
    .community-compose-poll input { width: 100%; min-height: 40px; padding: 9px 12px; border: 0; border-radius: var(--tr-radius-control); background: #08090a; color: var(--tr-text); font-size: 16px; outline: none; transition: background-color 150ms ease; }
    .community-compose-poll input:focus { background: #14161a; outline: none; }
    .community-compose-tools { display: flex; flex-wrap: wrap; gap: 8px; }
    .community-compose-tool { min-height: 36px; display: inline-flex; align-items: center; padding: 6px 14px; border: 1px solid var(--tr-border); border-radius: 14px; background: var(--tr-surface); color: var(--tr-text-secondary); cursor: pointer; font-size: 12px; font-weight: 600; transition: border-color 150ms, background-color 150ms, color 150ms; }
    .community-compose-tool:hover { border-color: var(--tr-border-strong); background: var(--tr-surface-hover); color: var(--tr-text); }
    .community-compose-dialog form > footer { position: sticky; bottom: -16px; display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin: 0 -20px -16px; padding: 14px 20px max(16px, env(safe-area-inset-bottom)); border-top: 1px solid var(--tr-card-border); background: var(--tr-surface); }
    .community-compose-dialog form > footer span { min-width: 0; margin-right: auto; color: var(--tr-text-muted); font-size: 12px; }
    .community-compose-dialog form > footer .tr-button { min-height: 40px; border-radius: 14px; padding: 0 18px; font-size: 13px; font-weight: 600; }
    .community-publish-lock { position: absolute; inset: 0; z-index: 50; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 24px; border-radius: 16px 16px 0 0; background: rgba(13, 13, 13, .88); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); color: var(--tr-text); animation: tr-fade-in 180ms ease; }
    .community-publish-spinner { width: 32px; height: 32px; border: 3px solid rgba(255, 255, 255, .12); border-top-color: var(--tr-accent); border-radius: 50%; animation: comment-spin 650ms linear infinite; }
    .community-publish-lock strong { font-size: 15px; font-weight: 500; letter-spacing: -.01em; color: var(--tr-text); }
    @keyframes tr-fade-in { from { opacity: 0; } to { transform: scale(1); opacity: 1; } }

    .community-confirm-overlay { position: fixed; inset: 0; z-index: 10040; display: flex; align-items: center; justify-content: center; padding: 20px; background: rgba(3,4,6,var(--community-confirm-backdrop-alpha, 0)); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); transition: background-color .24s ease; }
    .community-confirm-overlay.is-open { background: rgba(3,4,6,var(--community-confirm-backdrop-alpha, .78)); }
    .community-confirm-dialog { position: relative; width: min(440px, 100%); padding: 30px 24px 22px; border: 1px solid var(--tr-card-border); border-radius: 16px; background: var(--tr-surface); color: var(--tr-text); box-shadow: 0 24px 60px rgba(0, 0, 0, .7); transform: translate3d(0, calc(50vh + 60%), 0); will-change: transform; }
    .community-confirm-dialog.is-before-open { transform: translate3d(0, calc(50vh + 60%), 0); }
    .community-confirm-dialog.is-opening { transition: transform .32s cubic-bezier(.16, 1, .3, 1); }
    .community-confirm-overlay.is-open .community-confirm-dialog { transform: translate3d(0, 0, 0); }
    .community-confirm-dialog.is-dragging { transition: none; }
    .community-confirm-dialog.is-returning { transition: transform .22s cubic-bezier(.16, 1, .3, 1); }
    .community-confirm-dialog.is-closing { transform: translate3d(0, calc(50vh + 60%), 0) !important; transition: transform .24s cubic-bezier(.4, 0, 1, 1); }
    .community-confirm-handle { position: absolute; top: 12px; left: 50%; width: 44px; height: 4px; border-radius: var(--tr-radius-pill); background: #3b3e47; transform: translateX(-50%); cursor: grab; touch-action: none; z-index: 2; transition: background-color 150ms ease; }
    .community-confirm-handle:hover { background: #555b68; }
    .community-confirm-dialog.is-dragging .community-confirm-handle { cursor: grabbing; background: #71798a; }
    .community-confirm-dialog header { display: flex; align-items: center; justify-content: flex-start; margin: 10px 0 10px; padding: 0; border: 0; }
    .community-confirm-dialog header h2 { margin: 0; font-size: 18px; font-weight: 600; letter-spacing: -.02em; color: var(--tr-text); }
    .community-confirm-dialog p { margin: 0 0 22px; padding: 0; border: 0; color: var(--tr-text-secondary); font-size: 13px; line-height: 1.5; }
    .community-confirm-dialog footer { display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin: 0; padding: 0; border: 0; background: transparent; }
    .community-confirm-dialog footer .tr-button { min-height: 38px; padding: 0 18px; border-radius: 12px; font-size: 13px; font-weight: 500; letter-spacing: 0; transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease; }
    .community-confirm-dialog footer [data-community-confirm-cancel] { background: #14161a; border: 1px solid #252830; color: #9ca3af; }
    .community-confirm-dialog footer [data-community-confirm-cancel]:hover { background: #1c1e24; border-color: #353945; color: #e5e7eb; }
    .community-confirm-dialog footer [data-community-confirm-ok] { background: #272a33; border: 1px solid #383d4a; color: #ffffff; }
    .community-confirm-dialog footer [data-community-confirm-ok]:hover { background: #323642; border-color: #464c5c; color: #ffffff; }

    @media (max-width: 700px) {
        .community-compose-overlay { padding: 0; }
        .community-compose-dialog { width: 100%; max-height: 92dvh; border-radius: 16px 16px 0 0; }
        .community-compose-handle { top: 8px; width: 44px; height: 4px; }
        .community-compose-dialog form { padding: 13px 16px max(16px, env(safe-area-inset-bottom)); }
        .community-compose-dialog form > footer { margin: 0 -16px -13px; padding: 12px 16px max(16px, env(safe-area-inset-bottom)); }
    }

    html.community-reaction-sheet-open { overflow: hidden; }
    .community-reaction-sheet-overlay { position: fixed; z-index: 10040; inset: 0; display: flex; align-items: flex-end; justify-content: center; padding: 24px 16px 0; background: rgba(3,4,6,0); transition: background-color 200ms ease; }
    .community-reaction-sheet-overlay.is-open { background: rgba(3,4,6,.82); }
    .community-reaction-sheet { width: min(480px, 100%); overflow: hidden; border: 0; border-radius: 14px 14px 0 0; background: #171717; color: var(--tr-text); transform: translate3d(0,100%,0); transition: transform 220ms cubic-bezier(.2,0,.2,1); }
    .community-reaction-sheet.is-dragging { transition: none; }
    .community-reaction-sheet-overlay.is-open .community-reaction-sheet { transform: translate3d(0,0,0); }
    .community-reaction-sheet-handle { width: 52px; height: 5px; margin: 10px auto 0; border-radius: var(--tr-radius-pill); background: #555d67; cursor: grab; touch-action: none; }
    .community-reaction-sheet-handle:active { cursor: grabbing; }
    .community-reaction-sheet > header { min-height: 58px; display: flex; align-items: center; padding: 13px 18px 10px; }
    .community-reaction-sheet h2 { margin: 0; font-size: 18px; font-weight: 600; }
    .community-reaction-sheet-options { max-height: 44dvh; display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 8px; overflow-y: auto; padding: 0 18px 14px; }
    .community-reaction-sheet-options button { min-width: 0; height: 64px; display: flex; align-items: center; justify-content: center; padding: 0; border: 0; border-radius: 10px; background: #222; color: var(--tr-text); cursor: pointer; }
    .community-reaction-sheet-options button:hover, .community-reaction-sheet-options button.selected { background: var(--tr-selection-surface); }
    .community-reaction-sheet-options span { width: 38px; height: 38px; display: flex; align-items: center; justify-content: center; font-size: 31px; }
    .community-reaction-sheet > footer { display: flex; align-items: center; justify-content: flex-end; padding: 11px 18px max(16px,env(safe-area-inset-bottom)); border-top: 1px solid var(--tr-border); }
    .community-reaction-sheet > footer button { min-height: 38px; display: inline-flex; align-items: center; justify-content: center; padding: 8px 14px; border: 0; border-radius: var(--tr-radius-control); background: var(--tr-control-surface); color: var(--tr-text); font-weight: 600; cursor: pointer; }

    .cookie-consent { position: fixed; right: 24px; bottom: 24px; z-index: 2200; width: min(340px, calc(100vw - 48px)); display: flex; flex-direction: column; gap: 16px; padding: 24px; border: 1px solid var(--tr-border-strong); border-radius: 12px; background: var(--tr-border); box-shadow: 0 10px 30px rgba(0,0,0,.5); }
    .cookie-consent-header { display: flex; align-items: center; gap: 12px; }
    .cookie-consent-header img { width: 32px; height: 32px; }
    .cookie-consent-header h3 { margin: 0; font-size: 18px; }
    .cookie-consent p { margin: 0; color: var(--tr-text-secondary); font-size: 13px; text-align: center; }
    .cookie-consent-actions { display: flex; gap: 12px; margin-top: 8px; }
    .cookie-consent-actions button { height: 40px; flex: 1; border-radius: var(--tr-radius-control); cursor: pointer; font-weight: 600; }
    .cookie-consent-accept { border: 0; background: #7c3aed; color: #fff; }
    .cookie-consent-decline { border: 1px solid #3f3f3f; background: transparent; color: var(--tr-text-secondary); }

    body.feature-modal-open { overflow: hidden; }
    .feature-modal { position: fixed; inset: 0; z-index: 2400; display: flex; padding: 0; background: #0c0d10; }
    .feature-modal-dialog { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; display: grid; grid-template-rows: auto minmax(0, 1fr); margin: 0; overflow: hidden; border: 0; border-radius: 0; background: #141414; }
    .feature-modal-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px clamp(16px, 4vw, 40px); border-bottom: 1px solid var(--tr-card-border); }
    .feature-modal-head b { color: var(--tr-text); font-size: 17px; font-weight: 600; }
    .feature-modal-close { position: relative; width: 32px; height: 32px; border: 0; border-radius: var(--tr-radius-control); background: var(--tr-control-surface); cursor: pointer; }
    .feature-modal-close::before, .feature-modal-close::after { content: ""; position: absolute; top: 15px; left: 9px; width: 14px; height: 2px; border-radius: 2px; background: var(--tr-text-secondary); }
    .feature-modal-close::before { transform: rotate(45deg); }
    .feature-modal-close::after { transform: rotate(-45deg); }
    .feature-modal-body { min-height: 0; display: grid; gap: 16px; overflow-y: auto; padding: 20px clamp(16px, 4vw, 40px); max-width: 1200px; width: 100%; margin: 0 auto; box-sizing: border-box; }
    .feature-modal-loading { margin: 0; color: var(--tr-text-muted); font-size: 13px; }
    .feature-modal-error { margin: 0; padding: 10px 12px; border: 0; border-radius: var(--tr-radius-control); background: rgba(234,54,79,.12); color: #ff8f9c; font-size: 13px; }
    .feature-field, .feature-field-row label { min-width: 0; display: grid; gap: 6px; }
    .feature-field > span, .feature-field-label, .feature-field-row label > span { color: var(--tr-text-secondary); font-size: 12px; font-weight: 500; }
    .feature-field-hint { color: var(--tr-text-muted); font-size: 11px; font-style: normal; overflow-wrap: anywhere; }
    .feature-field-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 10px; }
    .feature-modal-body input[type="text"], .feature-modal-body input[type="url"], .feature-modal-body select, .feature-modal-body textarea { width: 100%; min-height: 40px; padding: 9px 11px; border: 0; border-radius: var(--tr-radius-control); outline: 0; background: var(--tr-control-surface); color: var(--tr-text); font: inherit; font-size: 16px; }
    .feature-modal-body textarea { resize: vertical; }
    .feature-modal-body input:focus, .feature-modal-body select:focus, .feature-modal-body textarea:focus { background: var(--tr-surface-hover); }
    .feature-inline-add, .feature-inline-actions button, .feature-image-buttons button, .feature-modal-actions button, .feature-editor-link button { min-height: 36px; padding: 0 13px; border: 0; border-radius: var(--tr-radius-control); background: var(--tr-control-surface); color: var(--tr-text-secondary); cursor: pointer; font-size: 12px; font-weight: 600; }
    .feature-inline-form { display: grid; gap: 10px; padding: 14px; border: 0; border-radius: var(--tr-radius-control); background: var(--tr-surface-soft); }
    .feature-inline-form b { color: var(--tr-text); font-size: 13px; font-weight: 600; }
    .feature-inline-actions, .feature-image-buttons, .feature-modal-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; }
    .feature-inline-actions button:last-child, .feature-modal-actions button[type="submit"] { background: var(--tr-selection-surface); color: var(--tr-link); }
    .feature-check { display: flex; align-items: center; gap: 9px; color: var(--tr-text-secondary); font-size: 13px; cursor: pointer; }
    .feature-check input { width: 17px; height: 17px; accent-color: var(--tr-link); }
    .feature-image { display: grid; grid-template-columns: 180px minmax(0, 1fr); align-items: start; gap: 14px; }
    .feature-image > img { width: 100%; aspect-ratio: 16 / 9; display: block; object-fit: cover; border-radius: var(--tr-radius-control); background: #080808; }
    .feature-image-controls { min-width: 0; display: grid; gap: 9px; }
    .feature-image-buttons { justify-content: flex-start; }
    .feature-image-buttons em { color: var(--tr-text-muted); font-size: 11px; font-style: normal; }
    .feature-modal-actions { position: sticky; bottom: -20px; margin: 0 calc(-1 * clamp(16px, 4vw, 40px)) -20px; padding: 14px clamp(16px, 4vw, 40px) 20px; border-top: 1px solid var(--tr-card-border); background: #141414; }
    .feature-modal-delete { margin-right: auto; color: #ff8f9c; }

    .feature-editor { min-width: 0; overflow: hidden; border: 0; border-radius: var(--tr-radius-control); background: var(--tr-control-surface); }
    .feature-editor-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 7px; border-bottom: 1px solid var(--tr-card-border); }
    .feature-editor-tools { min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 2px; }
    .feature-editor-tool, .feature-editor-mode { min-width: 30px; height: 30px; padding: 0 8px; border: 0; border-radius: 6px; background: transparent; color: var(--tr-text-secondary); cursor: pointer; font-size: 12px; font-weight: 600; }
    .feature-editor-tool:hover, .feature-editor-mode:hover, .feature-editor-mode.is-active { background: var(--tr-surface-hover); color: var(--tr-text); }
    .feature-editor-sep { width: 1px; height: 18px; margin: 0 3px; background: var(--tr-card-border); }
    .feature-editor-link { display: flex; gap: 8px; padding: 8px; border-bottom: 1px solid var(--tr-card-border); }
    .feature-editor-link input { min-width: 0; flex: 1; }
    .feature-editor-link[hidden], .feature-editor-source[hidden], .feature-editor-rich[hidden], .feature-inline-form[hidden], .feature-editor-status[hidden] { display: none; }
    .feature-editor-status { margin: 0; padding: 8px 11px; color: var(--tr-text-muted); font-size: 11px; }
    .feature-editor-status.is-error { color: #ff8f9c; }
    .feature-editor-rich, .feature-modal-body .feature-editor-source { min-height: 320px; max-height: 58dvh; padding: 15px; overflow-y: auto; border: 0; background: transparent; color: var(--tr-text-secondary); font-size: 14px; line-height: 1.65; }
    .feature-editor-rich:focus, .feature-modal-body .feature-editor-source:focus { outline: 0; background: transparent; }
    .feature-modal-body .feature-editor-source { display: block; resize: vertical; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; white-space: pre-wrap; }
    .feature-editor-rich h2, .feature-editor-rich h3, .feature-editor-rich h4 { color: var(--tr-text); }
    .feature-editor-rich h2 { margin: 20px 0 8px; font-size: 21px; }
    .feature-editor-rich h3 { margin: 16px 0 6px; font-size: 18px; }
    .feature-editor-rich h4 { margin: 14px 0 6px; font-size: 15px; }
    .feature-editor-rich p { margin: 0 0 12px; }
    .feature-editor-rich img { max-width: 100%; height: auto; }
    .feature-editor-hint { margin: 0; padding: 0 12px 10px; color: var(--tr-text-muted); font-size: 11px; }

    .community-report-overlay { position: fixed; inset: 0; z-index: 10030; display: flex; align-items: center; justify-content: center; padding: 20px; background: rgba(0, 0, 0, .75); backdrop-filter: blur(8px); }
    .community-report-overlay[hidden] { display: none; }
    .community-report-dialog { position: relative; width: min(460px, 100%); padding: 24px; border: 1px solid var(--tr-border-strong); border-radius: var(--tr-radius-card); background: #141414; color: var(--tr-text); }
    .community-report-dialog header h2 { margin: 0 0 12px; font-size: 18px; font-weight: 600; color: var(--tr-text); }
    .community-report-dialog p { margin: 0 0 14px; color: var(--tr-text-secondary); font-size: 13px; }
    .community-report-options { display: grid; gap: 8px; margin-bottom: 20px; }
    .community-report-options label { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; border: 1px solid var(--tr-border); border-radius: var(--tr-radius-control); background: #1a1a1a; color: var(--tr-text); cursor: pointer; font-size: 13px; }
    .community-report-options label:hover { background: #222; }
    .community-report-options input { accent-color: var(--tr-link); }
    .community-report-dialog footer { display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
    .community-report-dialog footer button { min-height: 38px; padding: 8px 16px; border-radius: var(--tr-radius-control); cursor: pointer; font-size: 13px; font-weight: 600; }
    .community-report-dialog footer button[type="button"] { border: 1px solid var(--tr-border-strong); background: transparent; color: var(--tr-text-secondary); }
    .community-report-dialog footer button[type="submit"] { border: 0; background: var(--tr-link); color: #fff; }

    /* Profile Edit Dialog */
    .profile-edit-dialog { width: min(620px, calc(100% - 24px)); max-height: calc(100dvh - 24px); margin: auto auto 0; padding: 0; border: 1px solid var(--tr-card-border); border-radius: 16px 16px 0 0; background: var(--tr-surface); color: var(--tr-text); transform: translateY(100%); transition: transform .28s cubic-bezier(.2,0,.2,1); }
    .profile-edit-dialog[open] { transform: translateY(0); }
    .profile-edit-dialog::backdrop { background: rgba(0, 0, 0, .75); backdrop-filter: blur(4px); }
    .profile-edit-dialog form { position: relative; display: grid; gap: 12px; max-height: calc(100dvh - 24px); overflow-y: auto; padding: 28px 20px max(20px, env(safe-area-inset-bottom)); }
    .profile-edit-handle { position: absolute; top: 10px; left: 50%; width: 48px; height: 5px; border-radius: 999px; background: #404552; transform: translateX(-50%); cursor: grab; touch-action: none; }
    .profile-edit-dialog header { display: flex; align-items: center; justify-content: space-between; }
    .profile-edit-dialog h2 { margin: 0; font-size: 19px; font-weight: 600; color: var(--tr-text); }
    .profile-edit-dialog label { display: grid; gap: 6px; color: var(--tr-text-muted); font-size: 12px; }
    .profile-edit-dialog input, .profile-edit-dialog textarea { width: 100%; min-height: 40px; padding: 9px 12px; border: 1px solid var(--tr-card-border); border-radius: 9px; outline: 0; background: #141720; color: var(--tr-text); font: inherit; font-size: 16px; box-sizing: border-box; }
    .profile-edit-dialog input:focus, .profile-edit-dialog textarea:focus { border-color: #3b82f6; background: #181c28; }
    .profile-edit-dialog textarea { min-height: 88px; resize: vertical; }
    .profile-edit-media { display: grid; grid-template-columns: 1fr 1.35fr; gap: 10px; }
    .profile-photo-picker, .profile-banner-picker { display: flex !important; align-items: center; gap: 10px; min-height: 82px; padding: 10px 12px; border-radius: 10px; background: #141720; border: 1px solid var(--tr-card-border); cursor: pointer; box-sizing: border-box; }
    .profile-photo-picker img { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; }
    .profile-photo-picker span { display: grid; gap: 4px; }
    .profile-photo-picker b, .profile-banner-picker b { color: #ffffff; font-size: 12px; }
    .profile-banner-picker { position: relative; overflow: hidden; align-content: end; background: #141720 var(--profile-edit-banner, none) center/cover no-repeat; }
    .profile-banner-picker::before { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,.25), rgba(0,0,0,.75)); }
    .profile-banner-picker span, .profile-banner-picker b { position: relative; z-index: 1; }
    .profile-slug-field { display: flex !important; align-items: center; gap: 0; min-height: 40px; padding-left: 12px; border-radius: 9px; background: #141720; border: 1px solid var(--tr-card-border); color: var(--tr-text-muted); font-size: 13.5px; }
    .profile-slug-field small { white-space: nowrap; color: var(--tr-text-muted); }
    .profile-slug-field input { border: none; background: transparent; padding-left: 2px; }
    .profile-slug-field input:focus { background: transparent; border: none; }
    .profile-edit-dialog form.is-submitting { pointer-events: none; }
    .profile-edit-dialog form.is-submitting .profile-edit-media,
    .profile-edit-dialog form.is-submitting label,
    .profile-edit-dialog form.is-submitting input,
    .profile-edit-dialog form.is-submitting textarea { opacity: 0.55; cursor: not-allowed; }
    .profile-edit-dialog [data-profile-status] { display: none; }
    .profile-edit-dialog [data-profile-status].is-error {
        display: block;
        color: #ff5252;
        background: rgba(255, 82, 82, 0.1);
        border: 1px solid rgba(255, 82, 82, 0.25);
        border-radius: 8px;
        padding: 8px 12px;
        font-size: 12px;
        line-height: 1.4;
    }
    .profile-edit-dialog footer { position: sticky; bottom: -20px; margin: 0 -20px -20px; padding: 14px 20px max(20px, env(safe-area-inset-bottom)); background: var(--tr-surface); border-top: 1px solid var(--tr-card-border); display: flex; justify-content: flex-end; gap: 10px; }
    .profile-edit-dialog footer button { min-height: 38px; padding: 8px 18px; border: 1px solid var(--tr-card-border); border-radius: 9px; background: #252833; color: #ffffff; font-weight: 600; font-size: 13px; cursor: pointer; }
    .profile-edit-dialog footer button:disabled { opacity: 0.5; cursor: not-allowed; }
    .profile-edit-dialog footer button[type="submit"] { background: #ffffff; color: #0c0e12; border: none; }
    .profile-edit-dialog footer button[type="submit"].is-loading {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        opacity: 0.85;
        cursor: wait;
        pointer-events: auto;
    }
    .profile-edit-dialog footer button[type="submit"].is-loading::before {
        content: "";
        width: 13px;
        height: 13px;
        border: 2px solid rgba(0, 0, 0, 0.2);
        border-top-color: #0c0e12;
        border-radius: 50%;
        animation: profile-edit-spin 0.6s linear infinite;
        flex-shrink: 0;
    }
    @keyframes profile-edit-spin {
        to { transform: rotate(360deg); }
    }

    @media (max-width: 760px) { .auth-modal { align-items: end; padding: 16px; } .auth-dialog { width: 100%; padding: 24px 18px 20px; } .community-reaction-sheet-overlay { padding: 0; } .community-reaction-sheet { width: 100%; } .feature-modal { padding: 0; } .feature-modal-dialog { width: 100vw; height: 100dvh; max-height: 100dvh; border: 0; border-radius: 0; } .feature-image { grid-template-columns: 1fr; } .feature-image > img { width: min(240px, 100%); } .feature-field-row { grid-template-columns: 1fr; } .profile-edit-dialog { width: 100%; } .profile-edit-media { grid-template-columns: 1fr; } }
    @media (max-width: 520px) { .cookie-consent { right: 12px; left: 12px; bottom: 12px; width: auto; } }
}
