:root {
  --blue: #12a9ec;
  --blue-dark: #0a8fcc;
  --blue-soft: #e6f6fd;
  --ink: #242529;
  --muted: #8a96a3;
  --line: #e9ebee;
  --bg: #fff;
  --soft: #f4f6f8;
  color-scheme: light;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: Roboto, -apple-system, "Segoe UI", sans-serif; font-size: 15px; line-height: 1.45; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

/* Buttons */
.btn {
  font: inherit; font-weight: 500; text-transform: uppercase; letter-spacing: .03em; font-size: 14px;
  border: 0; border-radius: 1000px; padding: 11px 22px; cursor: pointer;
  background: var(--blue); color: #fff; transition: background .15s, opacity .15s;
}
.btn:hover { background: var(--blue-dark); }
.btn-block { width: 100%; padding: 14px; }
.btn-line { background: #fff; color: var(--blue); border: 1px solid var(--blue); }
.btn-line:hover { background: var(--blue-soft); }
.btn-alt { width: 100%; background: #fff; color: var(--ink); border: 1px solid var(--line); text-transform: none; font-weight: 500; letter-spacing: 0; }
.btn-alt:hover { background: var(--soft); }
.btn-sub { display: flex; justify-content: space-between; align-items: center; width: 100%; padding: 12px 20px; }
.btn-sub.is-on { background: #fff; color: var(--blue); border: 1px solid var(--blue); }

/* Logo */
.logo { display: inline-flex; align-items: center; gap: 10px; }
.mark { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-weight: 900; font-size: 24px; background: var(--blue); color: #fff; }
.word { font-size: 30px; letter-spacing: -.02em; }
.word span { font-weight: 400; }
.word b { font-weight: 900; }
.logo-light .mark { background: #fff; color: var(--blue); }
.logo-light .word { color: #fff; }
.logo-dark .word { color: var(--ink); }

/* Auth */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr auto; }
.auth-brand { background: var(--blue); color: #fff; display: flex; align-items: center; justify-content: center; padding: 48px; }
.auth-brand-inner { max-width: 420px; }
.auth-brand h1 { font-size: 40px; font-weight: 500; line-height: 1.15; margin-top: 28px; }
.auth-form { display: flex; align-items: center; justify-content: center; padding: 48px 24px; }
.auth-form form { width: 100%; max-width: 360px; }
.auth-form h2 { font-size: 17px; font-weight: 500; margin-bottom: 18px; }
.auth-mobile-logo { display: none; margin-bottom: 28px; }
.auth-back { display: inline-block; font-size: 14px; margin-bottom: 18px; }
.field { display: block; margin-bottom: 14px; }
.field input { width: 100%; font: inherit; font-size: 16px; padding: 14px 16px; border: 1px solid #d7dde3; border-radius: 6px; outline: none; }
.field input:focus { border-color: var(--blue); }
.fine { font-size: 12px; color: var(--muted); margin: 14px 0 10px; }
.links { font-size: 13px; color: var(--muted); margin: 0 0 22px; text-align: center; }
.alt { display: grid; gap: 10px; }
.auth-foot { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px 22px; justify-content: center; padding: 18px; font-size: 13px; color: var(--muted); border-top: 1px solid var(--line); }
.auth-foot a { color: var(--muted); }
.shake { animation: shake .35s; }
@keyframes shake { 25% { transform: translateX(-8px); } 75% { transform: translateX(8px); } }

/* App shell */
.app { max-width: 1240px; margin: 0 auto; display: grid; grid-template-columns: 240px minmax(0, 620px) 340px; min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; border-right: 1px solid var(--line); }
.side-logo { margin: 0 0 14px 8px; }
.side-logo .mark { width: 44px; height: 44px; }
.nav { display: flex; align-items: center; gap: 16px; padding: 12px; border-radius: 1000px; color: var(--ink); font-size: 18px; position: relative; }
.nav:hover { background: var(--blue-soft); text-decoration: none; color: var(--blue); }
.nav.on { color: var(--ink); font-weight: 700; }
.nav svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; stroke-linecap: round; flex: none; }
.nav.on svg { stroke-width: 2.4; }
.badge { font-style: normal; background: var(--blue); color: #fff; font-size: 11px; font-weight: 700; border-radius: 10px; padding: 1px 6px; position: absolute; left: 30px; top: 6px; }
.nav-more { margin-top: auto; color: var(--muted); }

.main { border-right: 1px solid var(--line); min-height: 100vh; min-width: 0; }
.bar { position: sticky; top: 0; z-index: 5; background: rgba(255,255,255,.95); backdrop-filter: blur(6px); border-bottom: 1px solid var(--line); padding: 16px; display: flex; align-items: center; gap: 12px; }
.bar h2 { font-size: 19px; font-weight: 500; text-transform: uppercase; letter-spacing: .02em; }
.bar .back { border: 0; background: none; font-size: 22px; cursor: pointer; color: var(--ink); padding: 0 6px; }
.compose { padding: 14px 16px; border-bottom: 8px solid var(--soft); display: flex; gap: 12px; align-items: center; }
.compose input { flex: 1; border: 0; font: inherit; font-size: 16px; outline: none; }
.compose .btn { padding: 8px 18px; }

.rail { padding: 14px 20px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.search input { width: 100%; font: inherit; padding: 12px 18px; border: 1px solid var(--line); border-radius: 1000px; background: var(--soft); outline: none; }
.search input:focus { border-color: var(--blue); background: #fff; }
.rail-head { margin: 22px 0 12px; }
.rail-head h3 { font-size: 15px; font-weight: 500; text-transform: uppercase; color: var(--muted); letter-spacing: .03em; }
.rail-foot { font-size: 12px; color: var(--muted); margin-top: 18px; }

/* Avatars & cards */
.av { border-radius: 50%; display: grid; place-items: center; flex: none; border: 2px solid #fff; }
.av-s { width: 48px; height: 48px; font-size: 24px; }
.av-l { width: 104px; height: 104px; font-size: 52px; border-width: 4px; }
.tick { display: inline-block; width: 16px; height: 16px; vertical-align: -2px; margin-left: 4px; }
.card {
  position: relative; display: block; height: 120px; border-radius: 8px; overflow: hidden; margin-bottom: 12px; color: #fff; cursor: pointer;
}
.card:hover { text-decoration: none; opacity: .95; }
.card-cover { position: absolute; inset: 0; }
.card-shade { position: absolute; inset: 0; background: linear-gradient(transparent 30%, rgba(0,0,0,.55)); }
.card-row { position: absolute; left: 12px; right: 12px; bottom: 10px; display: flex; align-items: flex-end; gap: 10px; }
.card-row .av { width: 72px; height: 72px; font-size: 36px; }
.card-name { font-weight: 700; font-size: 17px; line-height: 1.2; }
.card-handle { font-size: 13px; opacity: .9; }
.card-free { position: absolute; top: 8px; left: 8px; background: rgba(0,0,0,.4); font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 4px; text-transform: uppercase; }
.cover-art { width: 100%; height: 100%; display: flex; align-items: center; justify-content: flex-end; font-size: 74px; padding-right: 18px; opacity: .85; overflow: hidden; }
.mobile-suggest { display: none; }

/* Posts */
.post { border-bottom: 8px solid var(--soft); padding: 14px 0 6px; }
.post-head { display: flex; gap: 12px; padding: 0 16px; align-items: center; }
.post-who { flex: 1; min-width: 0; }
.post-who b { font-weight: 700; color: var(--ink); }
.post-who small { display: block; color: var(--muted); font-size: 14px; }
.post-time { color: var(--muted); font-size: 14px; }
.post-text { padding: 10px 16px; margin: 0; }
.media { position: relative; aspect-ratio: 4 / 3; display: grid; place-items: center; overflow: hidden; }
.media-art { font-size: clamp(90px, 18vw, 150px); }
.locked .media { background: #f0f2f4 !important; }
.locked .media-art { display: none; }
.lockbox { display: none; text-align: center; padding: 20px; width: 100%; max-width: 380px; }
.locked .lockbox { display: block; }
.lockbox svg { width: 46px; height: 46px; fill: none; stroke: #b9c2cb; stroke-width: 1.6; }
.lockbox .counts { color: var(--muted); font-size: 14px; margin: 8px 0 16px; }
.lockbox .btn { width: 100%; }
.actions { display: flex; gap: 6px; padding: 8px 10px 4px; }
.act { border: 0; background: none; cursor: pointer; padding: 6px 8px; border-radius: 1000px; display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font: inherit; }
.act:hover { background: var(--blue-soft); color: var(--blue); }
.act svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; }
.act.liked { color: #ef3c5d; }
.act.liked svg { fill: currentColor; }
.act-tip { margin-left: auto; text-transform: uppercase; font-size: 13px; font-weight: 500; }
.post-likes { padding: 0 16px 8px; font-size: 13px; color: var(--muted); }

/* Profile */
.cover { height: 180px; position: relative; overflow: hidden; }
.cover .cover-art { font-size: 120px; }
.cover-bar { position: absolute; top: 0; left: 0; right: 0; padding: 12px 16px; display: flex; align-items: center; gap: 12px; color: #fff; background: linear-gradient(rgba(0,0,0,.45), transparent); }
.cover-bar button { border: 0; background: none; color: #fff; font-size: 24px; cursor: pointer; }
.cover-bar b { font-size: 19px; }
.cover-bar small { display: block; font-size: 13px; opacity: .9; }
.prof { padding: 0 16px 16px; border-bottom: 8px solid var(--soft); }
.prof .av-l { margin-top: -52px; position: relative; }
.prof-name { font-size: 21px; font-weight: 700; margin-top: 8px; }
.prof-handle { color: var(--muted); }
.prof-handle .live { color: #20c45a; }
.prof-bio { margin: 12px 0; }
.sub-box { margin-top: 14px; }
.sub-box h4 { margin: 0 0 8px; font-size: 13px; font-weight: 500; text-transform: uppercase; color: var(--muted); letter-spacing: .03em; }
.tabs { display: flex; border-bottom: 1px solid var(--line); }
.tabs span { flex: 1; text-align: center; padding: 14px; font-size: 14px; font-weight: 500; text-transform: uppercase; color: var(--muted); }
.tabs span.on { color: var(--ink); border-bottom: 2px solid var(--ink); }

/* Lists (notifications, messages) */
.row { display: flex; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); align-items: center; }
.row p { margin: 0; flex: 1; min-width: 0; }
.row small { color: var(--muted); }
.row .snippet { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row.unread { background: var(--blue-soft); }
.empty { padding: 48px 24px; text-align: center; color: var(--muted); }

/* Modal */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.5); display: grid; place-items: center; padding: 16px; z-index: 50; }
.modal-card { background: #fff; border-radius: 12px; width: min(440px, 100%); padding: 24px; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.modal-card h2 { font-size: 19px; font-weight: 500; margin-bottom: 16px; }
.steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.steps li { display: flex; gap: 10px; align-items: center; color: var(--muted); }
.steps li::before { content: ""; width: 18px; height: 18px; flex: none; border-radius: 50%; border: 2px solid #cfd6dc; }
.steps li.run { color: var(--ink); }
.steps li.run::before { border-color: var(--blue); border-right-color: transparent; animation: spin .7s linear infinite; }
.steps li.ok { color: var(--ink); }
.steps li.ok::before { background: var(--blue) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5 10l3 3 7-7' fill='none' stroke='white' stroke-width='2.5'/%3E%3C/svg%3E") center/14px no-repeat; border-color: var(--blue); }
.steps li.bad { color: #e0344f; }
.steps li.bad::before { background: #e0344f; border-color: #e0344f; }
@keyframes spin { to { transform: rotate(360deg); } }
.verdict { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.verdict h3 { font-size: 20px; margin-bottom: 6px; }
.verdict p { margin: 0 0 16px; color: #555; }
.verdict .row-btns { display: flex; gap: 10px; flex-wrap: wrap; }

/* Toast */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 200%); background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 8px; max-width: min(440px, calc(100% - 32px)); font-size: 14px; transition: transform .25s; z-index: 60; }
.toast.show { transform: translate(-50%, 0); }

@media (max-width: 1100px) {
  .app { grid-template-columns: 84px minmax(0, 1fr) 300px; }
  .nav span { display: none; }
  .side { align-items: center; }
  .side-logo { margin-left: 0; }
}
@media (max-width: 860px) {
  .auth { grid-template-columns: 1fr; }
  .auth-brand { display: none; }
  .auth-mobile-logo { display: inline-flex; }
  .app { grid-template-columns: minmax(0, 1fr); padding-bottom: 64px; }
  .rail { display: none; }
  .main { border-right: 0; }
  .side { position: fixed; top: auto; bottom: 0; left: 0; right: 0; height: 60px; flex-direction: row; justify-content: space-around; padding: 4px; border-right: 0; border-top: 1px solid var(--line); background: #fff; z-index: 20; }
  .side-logo, .nav-more { display: none; }
  .nav { padding: 10px; }
  .mobile-suggest { display: flex; gap: 10px; overflow-x: auto; padding: 12px 16px; border-bottom: 8px solid var(--soft); }
  .mobile-suggest .card { flex: 0 0 240px; margin: 0; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before { animation: none !important; transition: none !important; }
}
