/* Reclorio on the website and wide screens. See docs/design/web-brief.md.
   Telegram keeps its look: everything below that is web-only sits under html.is-web. */

@font-face { font-family: "Inter"; src: url("/app/fonts/InterVariable.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }

:root {
  --motion-fast: 120ms; --motion-base: 200ms; --motion-slow: 320ms;
  --ease-standard: cubic-bezier(.2,0,0,1); --ease-emphasized: cubic-bezier(.16,1,.3,1);
  --side-width: 264px;
}
body { font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-feature-settings: "cv11", "ss01"; -webkit-font-smoothing: antialiased; }
.finance-number, .offer-amount, .stat-card strong, .side-badge { font-variant-numeric: tabular-nums; }

/* --- Top bar on the website (phone and tablet) ---------------------------------- */
.web-back, .web-account { display: none; }
html.is-web .topbar {
  position: sticky; top: 0; z-index: 20; margin: 0 calc(-1 * var(--space-lg, 16px)); padding: 0 var(--space-lg, 16px);
  background: rgb(8 12 17 / .82); backdrop-filter: saturate(140%) blur(14px); -webkit-backdrop-filter: saturate(140%) blur(14px);
}
html.is-web .topbar .brand { margin-right: auto; }
html.is-web .web-back:not([hidden]), html.is-web .web-account:not([hidden]) {
  display: grid; place-items: center; width: 40px; height: 40px; flex: none; padding: 0; border: 1px solid var(--border-soft, #1d2a37);
  border-radius: 12px; background: var(--surface, #0f1620); color: var(--text, #f2f5fb); cursor: pointer;
  transition: background var(--motion-fast) var(--ease-standard), transform var(--motion-fast) var(--ease-standard);
}
html.is-web .web-back:hover, html.is-web .web-account:hover { background: #162231; }
html.is-web .web-back:active, html.is-web .web-account:active { transform: scale(.96); }
.web-back svg, .web-account svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
html.is-web .role-badge { order: 3; }
html.is-web .web-account { order: 4; }
/* The top bar already has the account button. */
html.is-web .account-entry { display: none; }
/* The page's own "back" link duplicates the top-bar button on the website. */
html.is-web main > .back:first-child { display: none; }

/* --- Account screen (Telegram and website) --------------------------------------- */
.account-panel { display: grid; gap: 12px; margin-top: 8px; }
.account-card {
  display: grid; gap: 14px; padding: 18px; border: 1px solid var(--border-soft, #1d2a37); border-radius: 18px;
  background: var(--surface, #0f1620); animation: screen-in var(--motion-base) var(--ease-emphasized) both;
}
.account-card:nth-child(2) { animation-delay: 40ms; } .account-card:nth-child(3) { animation-delay: 80ms; }
.account-card-head { display: flex; gap: 14px; align-items: flex-start; }
.account-card-head h2 { margin: 0; font-size: 16px; line-height: 1.3; }
.account-card-head p { margin: 2px 0 0; color: var(--muted, #acbacb); font-size: 14px; overflow-wrap: anywhere; }
.account-card-icon { display: grid; place-items: center; width: 40px; height: 40px; flex: none; border-radius: 12px; background: rgb(47 140 255 / .12); color: var(--accent, #2f8cff); }
.account-card-icon .icon { width: 20px; height: 20px; }
.account-form { display: grid; gap: 10px; }
.account-form input { height: 48px; padding: 0 14px; border: 1px solid var(--border-soft, #1d2a37); border-radius: 12px; background: var(--surface-raised, #141d29); color: var(--text, #f2f5fb); font: inherit; font-size: 16px; }
.account-form input:focus { outline: none; border-color: var(--accent, #2f8cff); box-shadow: 0 0 0 4px rgb(47 140 255 / .16); }
.account-hint { margin: 0; color: var(--subtle, #6f8195); font-size: 13px; line-height: 1.45; }
.account-hint:empty { display: none; }
.account-card .danger { color: #ff8a8a; }

.account-card--wide { grid-column: 1 / -1; }
.account-toggles { display: grid; gap: 8px; }

/* --- Bell ----------------------------------------------------------------------------- */
html.is-web .web-bell { position: relative; order: 3; }
.bell-count { position: absolute; top: -5px; right: -5px; min-width: 18px; height: 18px; padding: 0 5px; border: 2px solid var(--bg, #080c11); border-radius: 9px; background: #ff4d4f; color: #fff; font: 700 10px/14px Inter, sans-serif; text-align: center; font-variant-numeric: tabular-nums; animation: bell-pop var(--motion-slow) var(--ease-emphasized); }
.bell-count[hidden] { display: none; }
@keyframes bell-pop { from { transform: scale(.4); opacity: 0; } }
.notifications-sheet { display: grid; gap: 10px; }
.notifications-sheet .sheet-heading { display: flex; align-items: center; gap: 12px; }
.notifications-sheet .sheet-heading h2 { flex: 1; margin: 0; font-size: 18px; }
.notice-list { display: grid; gap: 4px; max-height: min(70dvh, 560px); overflow: auto; }
.notice-item { display: flex; gap: 12px; align-items: flex-start; width: 100%; padding: 12px; border: 0; border-radius: 14px; background: none; color: var(--text, #f2f5fb); text-align: left; cursor: pointer; transition: background var(--motion-fast) var(--ease-standard); }
.notice-item:hover { background: rgb(255 255 255 / .04); }
.notice-dot { width: 8px; height: 8px; flex: none; margin-top: 7px; border-radius: 50%; background: transparent; }
.notice-item.unread .notice-dot { background: var(--accent, #2f8cff); box-shadow: 0 0 0 4px rgb(47 140 255 / .15); }
.notice-copy { display: grid; gap: 3px; min-width: 0; }
.notice-copy strong { font-size: 14px; font-weight: 600; }
.notice-item:not(.unread) .notice-copy strong { color: var(--muted, #acbacb); font-weight: 500; }
.notice-body { display: -webkit-box; overflow: hidden; color: var(--muted, #acbacb); font-size: 13px; line-height: 1.45; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.notice-copy time { color: var(--subtle, #6f8195); font-size: 12px; }

/* --- Tablet: a roomier single column ----------------------------------------------- */
@media (min-width: 600px) {
  .shell { max-width: 760px; }
  .account-panel { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .discovery-results { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
}

/* --- Desktop website: side navigation + content column ----------------------------- */
.side-nav { display: none; }
@media (min-width: 1024px) {
  html.is-web body { padding-left: var(--side-width); }
  html.is-web .side-nav:not([hidden]) {
    position: fixed; inset: 0 auto 0 0; z-index: 30; display: flex; flex-direction: column; gap: 18px; width: var(--side-width);
    padding: 22px 14px 18px; border-right: 1px solid var(--border-soft, #1d2a37);
    background: linear-gradient(180deg, rgb(47 140 255 / .06), transparent 220px), #0a0f15; overflow-y: auto;
  }
  html.is-web .shell { max-width: 960px; padding: 0 40px 56px; }
  html.is-web .topbar { margin: 0 -40px 8px; padding: 0 40px; min-height: 64px; }
  html.is-web .topbar .brand, html.is-web .web-account:not(.web-bell) { display: none !important; }
  html.is-web .topbar .role-badge { margin-left: auto; }
  /* The side navigation replaces the in-page section tabs. */
  html.is-web .switcher.creator-navigation, html.is-web .home-support { display: none; }
  html.is-web .hero h1 { font-size: 32px; line-height: 1.15; letter-spacing: -.02em; }
  html.is-web .profile-hero h1 { font-size: 28px; }
  html.is-web .sticky-actions {
    position: static; margin: 24px 0 0; padding: 0; border: 0; background: none; backdrop-filter: none; justify-content: flex-end;
  }
  html.is-web .sticky-actions > * { flex: 0 1 auto; min-width: 220px; }
  html.is-web .discovery-results { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  html.is-web .full-button { max-width: 420px; }
  html.is-web .summary { gap: 16px; }
  html.is-web .offer-card { transition: border-color var(--motion-fast) var(--ease-standard), background var(--motion-fast) var(--ease-standard), transform var(--motion-fast) var(--ease-standard); }
  html.is-web .offer-card:hover { border-color: #2a3c50; background: #111a25; }
  html.is-web .account-panel { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  html.is-web .legal-footer { justify-content: flex-start; }
}

/* Offer card on a wide screen: terms on the left, the conversation stays in view on the right. */
@media (min-width: 1280px) {
  html.is-web .shell:has(.ov2) { max-width: 1240px; }
  html.is-web .ov2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(380px, 460px); column-gap: 32px; align-items: start; }
  html.is-web .ov2 > :not(.ov2-tabs):not(.ov2-panel) { grid-column: 1; }
  html.is-web .ov2 > .ov2-tabs { grid-column: 2; grid-row: 1; position: sticky; top: 64px; margin: 0; padding-top: 4px; }
  html.is-web .ov2 > .ov2-panel {
    grid-column: 2; grid-row: 2 / span 30; position: sticky; top: 112px; max-height: calc(100dvh - 128px); overflow: auto;
    overscroll-behavior: contain; margin-top: 12px; padding: 16px; border: 1px solid var(--border-soft, #1d2a37); border-radius: 18px;
    background: var(--surface, #0f1620);
  }
}

.side-brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px; color: var(--text, #f2f5fb); font-size: 18px; font-weight: 700; letter-spacing: -.02em; text-decoration: none; }
.side-brand .brand-mark { width: 32px; height: 32px; border-radius: 10px; font-size: 22px; box-shadow: 0 6px 20px rgb(47 140 255 / .3); }
.side-role { display: grid; gap: 6px; padding: 12px; border: 1px solid var(--border-soft, #1d2a37); border-radius: 14px; background: rgb(255 255 255 / .02); }
.side-role-label { color: var(--subtle, #6f8195); font-size: 11px; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; }
.side-role-switch { justify-self: start; padding: 0; border: 0; background: none; color: var(--accent, #2f8cff); font: 600 13px/1.4 inherit; text-align: left; cursor: pointer; }
.side-role-switch::after { content: " →"; }
.side-role-switch:hover { text-decoration: underline; text-underline-offset: 3px; }
.side-role-switch .icon { display: none; }
.side-items { display: grid; gap: 2px; margin: 0; padding: 0; list-style: none; }
.side-item {
  position: relative; display: flex; align-items: center; gap: 12px; width: 100%; min-height: 42px; padding: 0 12px; border: 0;
  border-radius: 12px; background: none; color: var(--muted, #acbacb); font: 550 14px/1.2 inherit; text-align: left; cursor: pointer;
  transition: background var(--motion-fast) var(--ease-standard), color var(--motion-fast) var(--ease-standard);
}
.side-item .icon { width: 20px; height: 20px; flex: none; }
.side-item:hover { background: rgb(255 255 255 / .04); color: var(--text, #f2f5fb); }
.side-item.active { background: rgb(47 140 255 / .14); color: var(--text, #f2f5fb); }
.side-item.active::before { content: ""; position: absolute; left: -14px; top: 10px; bottom: 10px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent, #2f8cff); }
.side-item.active .icon { color: var(--accent, #2f8cff); }
.side-item .button-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-badge { min-width: 22px; padding: 2px 7px; border-radius: 11px; background: var(--accent, #2f8cff); color: #fff; font-size: 12px; font-weight: 650; text-align: center; }
.side-footer { display: grid; gap: 2px; margin-top: auto; padding-top: 14px; border-top: 1px solid var(--border-soft, #1d2a37); }
.side-user { margin: 8px 12px 0; overflow: hidden; color: var(--subtle, #6f8195); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.side-user strong { color: var(--muted, #acbacb); font-weight: 550; }

/* --- Screen transitions ------------------------------------------------------------ */
@supports (view-transition-name: none) {
  ::view-transition-old(root), ::view-transition-new(root) { animation-duration: var(--motion-base); animation-timing-function: var(--ease-standard); }
}
@media (prefers-reduced-motion: reduce) {
  .account-card { animation: none; }
  .side-item, html.is-web .offer-card { transition: none; }
}
