/* 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; }
}

/* =====================================================================================
   Desktop website (≥1024px): a work tool, not a stretched phone.
   Dense type, controls sized to their content, lists as tables, forms in two columns,
   actions on the right. Telegram never gets these rules (html.is-web only).
   ===================================================================================== */
@media (min-width: 1024px) {
  html.is-web body { font-size: 14px; }
  html.is-web .shell { max-width: 1180px; padding: 0 48px 64px; }
  html.is-web .topbar { margin: 0 -48px 4px; padding: 0 48px; min-height: 56px; border-bottom: 1px solid var(--border-soft); }
  html.is-web .shell:has(.ov2) .topbar { margin: 0 -48px 4px; }

  /* Page header: small kicker, compact title, one-line lead. */
  html.is-web .hero { padding: 28px 0 18px; }
  html.is-web .hero .eyebrow { margin-bottom: 6px; font-size: 11px; }
  html.is-web .hero h1 { margin: 0; font-size: 26px; line-height: 1.2; letter-spacing: -.02em; }
  html.is-web .hero .lead { margin-top: 6px; max-width: 720px; font-size: 14px; }
  html.is-web .profile-hero { padding: 24px 0 12px; }
  html.is-web .profile-hero h1 { font-size: 24px; }
  html.is-web .section-head { margin: 28px 0 10px; }
  html.is-web .section-head h2 { font-size: 15px; font-weight: 650; letter-spacing: -.01em; }
  html.is-web .section-head .text-button { font-size: 13px; }

  /* Buttons are sized by their label; only explicit bars stretch them. */
  html.is-web .primary, html.is-web .secondary, html.is-web .danger {
    min-height: 38px; padding: 0 16px; border-radius: 10px; font-size: 13.5px; font-weight: 600;
  }
  html.is-web .primary .icon, html.is-web .secondary .icon { width: 17px; height: 17px; }
  html.is-web .full-button { width: auto; max-width: none; margin-top: 16px; }
  html.is-web .profile-actions, html.is-web .secondary-actions { display: flex; flex-wrap: wrap; gap: 8px; }
  html.is-web .profile-actions > *, html.is-web .secondary-actions > * { flex: 0 0 auto; width: auto; margin: 0; }
  /* The side navigation already has these entries. */
  html.is-web .advertiser-more { display: none; }
  html.is-web .back { min-height: 32px; margin: 16px 0 0; font-size: 13px; }
  html.is-web #root > .full-button + .full-button { margin-left: 8px; }

  /* Bars of actions: right-aligned row, no sticky phone footer. */
  html.is-web .sticky-actions {
    position: static; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin: 24px 0 0; padding: 16px 0 0;
    border: 0; border-top: 1px solid var(--border-soft); background: none; backdrop-filter: none;
  }
  html.is-web .sticky-actions > * { flex: 0 0 auto; min-width: 0; }
  html.is-web .sticky-actions > .primary { min-width: 180px; }

  /* Stats: a slim row of figures. */
  html.is-web .summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; margin: 8px 0 4px; }
  html.is-web .stat-card { min-height: 0; padding: 14px 16px; border-radius: 14px; }
  html.is-web .stat-card .stat-number { font-size: 24px; }
  html.is-web .stat-card .stat-label { font-size: 12.5px; }

  /* Offer lists (blogger side and the old list): one table with hairline rows. */
  html.is-web .more-list > .list { gap: 0; overflow: hidden; border: 1px solid var(--border-soft); border-radius: 14px; background: var(--surface); }
  html.is-web .more-list > .list > .offer-card {
    display: grid; grid-template-columns: 32px minmax(0, 1fr) auto 16px; align-items: center; gap: 14px; min-height: 56px; margin: 0;
    padding: 10px 16px; border: 0; border-bottom: 1px solid var(--border-soft); border-radius: 0; background: transparent; box-shadow: none;
  }
  html.is-web .more-list > .list > .offer-card:last-child { border-bottom: 0; }
  html.is-web .more-list > .list > .offer-card:hover { background: rgb(255 255 255 / .025); }
  html.is-web .offer-card .offer-avatar { width: 32px; height: 32px; border-radius: 10px; font-size: 12px; }
  html.is-web .offer-card .offer-main { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) 80px; align-items: center; gap: 2px 16px; }
  html.is-web .offer-card .offer-target { grid-column: 1 / -1; font-size: 12px; }
  html.is-web .offer-card .offer-title { overflow: hidden; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
  html.is-web .offer-card .offer-meta { overflow: hidden; color: var(--muted); font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
  html.is-web .offer-card .offer-date { color: var(--subtle); font-size: 12px; text-align: right; }
  html.is-web .offer-card .offer-side { display: grid; grid-template-columns: 110px 170px; align-items: center; justify-items: end; gap: 4px 12px; max-width: none; }
  html.is-web .offer-card .offer-amount { font-size: 14px; }
  html.is-web .offer-card .status-chip { justify-self: start; max-width: 170px; }
  html.is-web .offer-card .offer-unread { grid-column: 2; justify-self: start; }
  html.is-web .more-list-button { margin-top: 8px; min-height: 36px; border-radius: 10px; font-size: 13px; }

  /* Forms: two columns of fields, compact inputs, choice chips sized to their text. */
  html.is-web .form-card { gap: 18px; }
  html.is-web .form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 20px; }
  html.is-web .form-grid > .field.full, html.is-web .form-grid > .date-range-field { grid-column: 1 / -1; }
  html.is-web .field input:not([type="hidden"]):not([type="file"]), html.is-web .field textarea, html.is-web .picker-trigger {
    min-height: 40px; font-size: 14px; border-radius: 10px;
  }
  html.is-web .field textarea { min-height: 96px; }
  html.is-web .field-heading { margin-bottom: 6px; }
  html.is-web .field-heading label, html.is-web .field > span { font-size: 13px; color: var(--muted); }
  html.is-web .profile-setup-chips { display: flex !important; flex-wrap: wrap; gap: 6px; }
  html.is-web .profile-setup-chip {
    flex: 0 0 auto !important; width: auto !important; min-height: 34px !important; padding: 0 14px !important;
    border-radius: 999px !important; font-size: 13px !important;
  }
  html.is-web .simple-offer-form { max-width: 820px; }
  html.is-web .simple-offer-form > .creator-card { max-width: 420px; }
  html.is-web .surface-card { border-radius: 14px; }

  /* Cards in lists of people: compact rows. */
  html.is-web .creator-card { min-height: 56px; padding: 10px 14px; border-radius: 12px; }

  /* Empty states: quiet inline block instead of a phone placeholder. */
  html.is-web .empty-state { padding: 22px 20px; border-radius: 14px; }

  /* Offer card page: the decision bar sits under the terms, sized to its buttons. */
  html.is-web .deal-actions.ov2-actions.sticky-actions {
    flex-direction: row; justify-content: flex-start; align-items: center; gap: 8px; border-top: 0; padding-top: 4px;
  }
  html.is-web .deal-actions.ov2-actions > .primary { width: auto; min-width: 220px; min-height: 40px; font-size: 14px; }
  html.is-web .ov2-subactions { display: flex; gap: 8px; width: auto; overflow: visible; border: 0; background: none; }
  html.is-web .ov2-subaction {
    min-height: 40px; padding: 0 16px; border: 1px solid var(--border) !important; border-radius: 10px; background: var(--surface-raised);
  }
  html.is-web .ov2-subaction:hover { background: var(--surface-hover); }
  html.is-web .ov2-panel .full-button { width: 100%; }
  html.is-web .ai-advice .full-button { width: auto; }
  html.is-web .ov2-amount { font-size: 34px; }

  /* Confirmations open as a centred card, not a full page. */
  html.is-web #root[data-screen="confirm"] {
    max-width: 560px; margin: 32px auto 0; padding: 8px 28px 24px; border: 1px solid var(--border-soft); border-radius: 18px;
    background: var(--surface);
  }
  html.is-web #root[data-screen="confirm"] .sticky-actions { justify-content: flex-end; }

  html.is-web .legal-footer { margin-top: 40px; font-size: 12.5px; }
}
