:root {
  color-scheme: light;
  --bg: #f7f6f1;
  --surface: #ffffff;
  --surface-soft: #f0eee8;
  --ink: #11151d;
  --muted: #687080;
  --line: rgba(17, 21, 29, 0.12);
  --strong-line: rgba(17, 21, 29, 0.24);
  --coral: #ff5946;
  --amber: #ffb33f;
  --lime: #d7ff4d;
  --cyan: #09a5a9;
  --blue: #3768ff;
  --pink: #f0569b;
  --safe: #0b8f55;
  --warn: #aa6900;
  --danger: #bd2e3a;
  --shadow: 0 20px 60px rgba(17, 21, 29, 0.1);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--ink);
  background:
    linear-gradient(120deg, rgba(215, 255, 77, 0.16), transparent 34%),
    linear-gradient(240deg, rgba(9, 165, 169, 0.12), transparent 36%),
    var(--bg);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  letter-spacing: 0;
}

button,
input,
textarea,
select {
  font: inherit;
  letter-spacing: 0;
}

button {
  cursor: pointer;
}

img {
  display: block;
  max-width: 100%;
}

svg {
  width: 19px;
  height: 19px;
  stroke-width: 2.15;
}

.hidden {
  display: none !important;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  font-size: 1.3rem;
  font-weight: 950;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius);
  color: #0b1018;
  background:
    linear-gradient(135deg, var(--lime) 0 22%, var(--amber) 47%, var(--coral) 75%, var(--pink));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.36);
  font-size: 1.55rem;
  font-weight: 1000;
  line-height: 1;
}

.auth-gate {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(360px, 0.88fr);
  gap: 24px;
  align-items: center;
  width: min(100% - 36px, 1180px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 24px 0;
}

.auth-brand {
  display: grid;
  gap: 20px;
}

.auth-visual {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  min-height: 520px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.auth-visual img {
  width: 100%;
  height: 100%;
  min-height: 520px;
  object-fit: cover;
}

.phone-glass {
  position: absolute;
  right: 26px;
  bottom: 26px;
  width: 205px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(18px);
  box-shadow: 0 18px 50px rgba(17, 21, 29, 0.2);
}

.mini-story-row,
.mini-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.mini-story-row span {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: conic-gradient(var(--coral), var(--amber), var(--cyan), var(--coral));
}

.mini-post {
  height: 160px;
  margin: 10px 0;
  border-radius: var(--radius);
  background:
    linear-gradient(150deg, rgba(255, 255, 255, 0.16), transparent),
    linear-gradient(35deg, var(--cyan), var(--blue) 47%, var(--pink));
}

.mini-actions {
  justify-content: space-between;
}

.auth-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  box-shadow: var(--shadow);
  padding: 18px;
  min-width: 0;
}

.auth-tabs,
.mode-tabs,
.chips,
.profile-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
}

.auth-tabs::-webkit-scrollbar,
.mode-tabs::-webkit-scrollbar,
.chips::-webkit-scrollbar,
.profile-tabs::-webkit-scrollbar {
  display: none;
}

.auth-tabs {
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.auth-tabs button,
.mode-tabs button,
.chips button,
.profile-tabs button {
  border: 1px solid transparent;
  border-radius: var(--radius);
  color: var(--muted);
  background: transparent;
  font-weight: 850;
  white-space: nowrap;
}

.auth-tabs button {
  flex: 1;
  min-height: 40px;
}

.auth-tabs button.active,
.mode-tabs button.active,
.chips button.active,
.profile-tabs button.active {
  color: var(--ink);
  border-color: var(--strong-line);
  background: var(--surface);
}

.auth-form {
  display: grid;
  gap: 14px;
  margin-top: 18px;
  min-width: 0;
}

.auth-form label {
  min-width: 0;
}

.auth-form h1 {
  margin: 0;
  font-size: 2.1rem;
  line-height: 1.05;
}

.auth-form p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

label span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.79rem;
  font-weight: 850;
  text-transform: uppercase;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  outline: 0;
  color: var(--ink);
  background: var(--surface);
}

input {
  min-height: 46px;
  padding: 0 12px;
}

textarea {
  padding: 12px;
  resize: vertical;
}

input:focus,
textarea:focus {
  border-color: color-mix(in srgb, var(--cyan) 62%, var(--line));
  box-shadow: 0 0 0 4px rgba(9, 165, 169, 0.12);
}

.check-row {
  display: flex;
  align-items: start;
  gap: 10px;
}

.check-row input {
  width: 18px;
  min-height: 18px;
  margin-top: 2px;
}

.check-row span {
  margin: 0;
  color: var(--ink);
  text-transform: none;
}

.auth-actions,
.auth-links,
.top-actions,
.post-actions,
.modal-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.command,
.icon-btn,
.text-btn {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  background: var(--surface);
  font-weight: 850;
}

.command {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 14px;
}

.command.filled {
  border-color: color-mix(in srgb, var(--coral) 55%, var(--ink));
  color: #0b1018;
  background: linear-gradient(135deg, var(--coral), var(--amber));
}

.command.small {
  min-height: 34px;
  padding: 0 10px;
  font-size: 0.86rem;
}

.icon-btn {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
}

.icon-btn:hover,
.command:hover,
.text-btn:hover {
  border-color: color-mix(in srgb, var(--cyan) 55%, var(--line));
}

.text-btn {
  min-height: 32px;
  padding: 0 10px;
  color: var(--cyan);
}

.auth-links button {
  border: 0;
  color: var(--muted);
  background: transparent;
  font-weight: 780;
}

.app-shell {
  display: grid;
  grid-template-columns: 244px minmax(0, 760px) 330px;
  gap: 18px;
  width: min(100% - 32px, 1390px);
  margin: 0 auto;
  padding: 18px 0 42px;
}

.rail,
.sidecar {
  position: sticky;
  top: 18px;
  align-self: start;
}

.rail {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 36px);
  border-right: 1px solid var(--line);
  padding-right: 16px;
}

.rail-brand {
  margin-bottom: 24px;
}

.nav-stack {
  display: grid;
  gap: 5px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 46px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  color: var(--ink);
  background: transparent;
  text-align: left;
  font-size: 1rem;
  font-weight: 760;
}

.nav-item:hover,
.nav-item.active {
  border-color: var(--line);
  background: color-mix(in srgb, var(--surface) 80%, transparent);
}

.nav-item.active {
  font-weight: 950;
}

.account-switch {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 22px;
  gap: 10px;
  align-items: center;
  margin-top: auto;
  min-height: 58px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  padding: 8px;
  text-align: left;
}

.account-switch strong,
.account-switch small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-switch small {
  color: var(--muted);
}

.avatar,
.story-avatar {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  color: #0b1018;
  background: linear-gradient(135deg, var(--amber), var(--coral));
  font-weight: 950;
}

.avatar.self,
.story-avatar.self {
  background: linear-gradient(135deg, var(--lime), var(--amber) 48%, var(--coral));
}

.avatar.blue {
  color: #fff;
  background: linear-gradient(135deg, var(--blue), var(--cyan));
}

.avatar.dark {
  color: #fff;
  background: linear-gradient(135deg, #10151d, var(--pink));
}

.avatar.green {
  background: linear-gradient(135deg, #1d8a4d, var(--lime));
}

.stage {
  min-width: 0;
}

.mobile-topbar {
  display: none;
}

.view {
  display: grid;
  gap: 14px;
}

.stories-wrap,
.notes-row,
.post-card,
.search-header,
.create-shell,
.messages-shell,
.side-section,
.profile-head,
.account-status,
.settings-card,
.activity-card,
.result-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface) 94%, transparent);
}

.stories-wrap {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 12px;
  scrollbar-width: none;
}

.stories-wrap::-webkit-scrollbar {
  display: none;
}

.stories {
  display: flex;
  gap: 12px;
}

.story {
  display: grid;
  justify-items: center;
  gap: 6px;
  min-width: 72px;
  border: 0;
  color: var(--ink);
  background: transparent;
}

.story-avatar {
  width: 62px;
  height: 62px;
  border: 3px solid var(--surface);
  outline: 2px solid var(--coral);
  outline-offset: 2px;
}

.story small {
  max-width: 76px;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 780;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.notes-row,
.note-list {
  display: grid;
  gap: 10px;
}

.notes-row {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding: 10px;
}

.note-pill {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  min-height: 52px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 8px;
}

.note-pill .avatar {
  width: 34px;
  height: 34px;
  font-size: 0.78rem;
}

.note-pill strong,
.note-pill small,
.result-card strong,
.result-card small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.note-pill small,
.result-card small {
  color: var(--muted);
}

.feed {
  display: grid;
  gap: 16px;
}

.post-card {
  overflow: hidden;
}

.post-head {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 12px;
}

.post-author strong,
.post-author small {
  display: block;
}

.post-author small {
  color: var(--muted);
}

.post-media {
  position: relative;
  overflow: hidden;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #10151d;
}

.post-media img,
.visual {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
}

.visual {
  position: relative;
  min-height: 410px;
  overflow: hidden;
}

.visual::before,
.visual::after {
  content: "";
  position: absolute;
  border: 1px solid rgba(255, 255, 255, 0.48);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.18);
}

.visual::before {
  left: 8%;
  top: 8%;
  width: 46%;
  height: 42%;
}

.visual::after {
  right: 8%;
  bottom: 9%;
  width: 40%;
  height: 36%;
}

.visual.city {
  background:
    linear-gradient(140deg, rgba(255, 255, 255, 0.14), transparent 44%),
    linear-gradient(35deg, #0e314c, var(--cyan) 45%, var(--amber));
}

.visual.neon {
  background:
    linear-gradient(150deg, rgba(255, 255, 255, 0.16), transparent 42%),
    linear-gradient(35deg, #171b25, var(--pink) 47%, var(--blue));
}

.visual.food {
  background:
    radial-gradient(circle at 24% 28%, rgba(255, 255, 255, 0.28) 0 12%, transparent 13%),
    linear-gradient(40deg, #2d7448, var(--lime) 44%, var(--coral));
}

.visual.shop {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.2), transparent),
    linear-gradient(45deg, #181d26, var(--amber), var(--lime));
}

.media-type {
  position: absolute;
  top: 12px;
  right: 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 0 9px;
  border-radius: var(--radius);
  color: #0b1018;
  background: rgba(255, 255, 255, 0.86);
  font-size: 0.78rem;
  font-weight: 950;
}

.post-actions {
  padding: 12px 12px 0;
}

.post-actions .icon-btn {
  border-color: transparent;
}

.post-actions .icon-btn.active {
  color: var(--coral);
}

.post-body {
  padding: 8px 12px 14px;
}

.post-body p {
  margin: 6px 0 10px;
  color: var(--muted);
  line-height: 1.45;
}

.post-body strong {
  display: inline;
  color: var(--ink);
}

.tag-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.tag-row span {
  padding: 4px 8px;
  border-radius: var(--radius);
  color: #0b1018;
  background: color-mix(in srgb, var(--lime) 54%, var(--surface));
  font-size: 0.78rem;
  font-weight: 850;
}

.push {
  margin-left: auto;
}

.search-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 40px;
  gap: 10px;
  padding: 10px;
}

.search-field {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.search-field input {
  border: 0;
  background: transparent;
  min-height: 40px;
}

.chips,
.mode-tabs,
.profile-tabs {
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface) 66%, var(--surface-soft));
}

.chips button,
.mode-tabs button {
  min-height: 36px;
  padding: 0 12px;
}

.result-list,
.activity-list,
.settings-grid,
.inbox-list,
.suggestions,
.profile-grid,
.explore-grid {
  display: grid;
  gap: 10px;
}

.result-card,
.activity-card {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 12px;
}

.explore-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-auto-flow: dense;
}

.explore-item,
.profile-item {
  position: relative;
  overflow: hidden;
  border: 0;
  border-radius: var(--radius);
  background: #11151d;
  color: #fff;
  padding: 0;
}

.explore-item.tall {
  grid-row: span 2;
}

.explore-item.wide {
  grid-column: span 2;
}

.explore-item .visual,
.explore-item img,
.profile-item .visual,
.profile-item img {
  height: 100%;
  min-height: 0;
  aspect-ratio: 1 / 1;
}

.explore-item.tall .visual,
.explore-item.tall img {
  aspect-ratio: 1 / 2;
}

.explore-item.wide .visual,
.explore-item.wide img {
  aspect-ratio: 2 / 1;
}

.explore-item span,
.profile-item span {
  position: absolute;
  left: 8px;
  bottom: 8px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 8px;
  border-radius: var(--radius);
  color: #11151d;
  background: rgba(255, 255, 255, 0.84);
  font-size: 0.76rem;
  font-weight: 900;
}

.view-head,
.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.view-head h2,
.section-title h2,
.profile-title h2 {
  margin: 0;
  font-size: 1.22rem;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--cyan);
  font-size: 0.76rem;
  font-weight: 950;
  text-transform: uppercase;
}

.reel-stage {
  display: grid;
  justify-items: center;
  min-height: calc(100vh - 36px);
}

.reel-card {
  position: relative;
  overflow: hidden;
  width: min(100%, 430px);
  min-height: calc(100vh - 36px);
  border-radius: var(--radius);
  background: #11151d;
  color: #fff;
}

.reel-card img,
.reel-card .visual {
  height: 100%;
  min-height: calc(100vh - 36px);
  aspect-ratio: 9 / 16;
}

.reel-overlay {
  position: absolute;
  inset: auto 0 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 54px;
  gap: 12px;
  padding: 18px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.72));
}

.reel-copy p {
  margin: 7px 0 0;
  color: rgba(255, 255, 255, 0.82);
  line-height: 1.35;
}

.reel-actions {
  display: grid;
  gap: 10px;
  align-content: end;
}

.reel-actions button {
  color: #fff;
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.2);
}

.create-shell {
  padding: 14px;
}

.create-layout {
  display: grid;
  grid-template-columns: minmax(260px, 0.92fr) minmax(0, 1.08fr);
  gap: 14px;
  margin-top: 14px;
}

.drop-zone {
  display: grid;
  place-items: center;
  gap: 8px;
  min-height: 420px;
  border: 1px dashed var(--strong-line);
  border-radius: var(--radius);
  color: var(--muted);
  background:
    linear-gradient(150deg, rgba(255, 255, 255, 0.26), transparent),
    linear-gradient(35deg, rgba(9, 165, 169, 0.2), rgba(255, 179, 63, 0.18));
  overflow: hidden;
}

.drop-zone span {
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  border-radius: 50%;
  color: var(--ink);
  background: var(--surface);
}

.drop-zone img,
.drop-zone video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.create-fields {
  display: grid;
  align-content: start;
  gap: 12px;
}

.tool-grid,
.settings-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.tool-grid {
  display: grid;
  gap: 8px;
}

.tool-grid button,
.settings-card {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-height: 56px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  padding: 10px;
  text-align: left;
}

.tool-grid button span,
.settings-card span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 850;
}

.tool-grid button.active {
  border-color: var(--cyan);
  background: color-mix(in srgb, var(--cyan) 10%, var(--surface));
}

.safety-strip {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 12px;
  border-radius: var(--radius);
  color: var(--safe);
  background: color-mix(in srgb, var(--safe) 11%, var(--surface));
  font-weight: 850;
}

.safety-strip.warn {
  color: var(--warn);
  background: color-mix(in srgb, var(--warn) 13%, var(--surface));
}

.messages-shell {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  overflow: hidden;
}

.inbox {
  padding: 12px;
  border-right: 1px solid var(--line);
}

.mode-tabs.compact {
  margin-bottom: 10px;
}

.mode-tabs.compact button {
  min-height: 32px;
  padding: 0 10px;
  font-size: 0.82rem;
}

.inbox-list {
  gap: 6px;
}

.inbox-item {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  width: 100%;
  min-height: 64px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  color: var(--ink);
  padding: 8px;
  text-align: left;
}

.inbox-item.active,
.inbox-item:hover {
  border-color: var(--line);
  background: var(--surface);
}

.inbox-item strong,
.inbox-item small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inbox-item small {
  color: var(--muted);
}

.chat {
  display: grid;
  grid-template-rows: auto minmax(280px, 1fr) auto;
  min-height: 620px;
}

.chat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px;
  border-bottom: 1px solid var(--line);
}

.chat-user {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.chat-body {
  display: grid;
  align-content: end;
  gap: 8px;
  padding: 14px;
}

.bubble {
  max-width: 78%;
  padding: 10px 12px;
  border-radius: var(--radius);
  background: var(--surface-soft);
  line-height: 1.35;
}

.bubble.me {
  justify-self: end;
  color: #0b1018;
  background: linear-gradient(135deg, var(--lime), var(--amber));
}

.chat-input {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) 40px;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid var(--line);
}

.chat-input input {
  min-height: 40px;
}

.activity-list {
  gap: 8px;
}

.activity-card strong,
.activity-card small {
  display: block;
}

.activity-card small {
  color: var(--muted);
}

.profile-head {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  padding: 18px;
}

.profile-avatar {
  width: 112px;
  height: 112px;
  font-size: 1.5rem;
}

.profile-title {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.stats {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin: 12px 0;
  color: var(--muted);
}

.stats strong {
  color: var(--ink);
}

.profile-copy p {
  margin: 0;
  color: var(--muted);
}

.highlights {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 4px 0;
}

.highlight {
  display: grid;
  justify-items: center;
  gap: 6px;
  min-width: 76px;
  border: 0;
  background: transparent;
  color: var(--ink);
}

.highlight span {
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
}

.highlight small {
  color: var(--muted);
  font-weight: 780;
}

.profile-tabs {
  justify-content: center;
}

.profile-tabs button {
  display: grid;
  place-items: center;
  min-width: 64px;
  min-height: 40px;
}

.profile-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.profile-item {
  aspect-ratio: 1 / 1;
}

.account-status {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  overflow: hidden;
}

.account-status div {
  padding: 16px;
  border-left: 1px solid var(--line);
}

.account-status div:first-child {
  border-left: 0;
}

.account-status span,
.account-status strong {
  display: block;
}

.account-status span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.account-status strong {
  margin-top: 4px;
  font-size: 1.45rem;
}

.settings-card small {
  grid-column: 2;
  color: var(--muted);
  line-height: 1.35;
}

.sidecar {
  display: grid;
  gap: 14px;
}

.side-section {
  padding: 14px;
}

.section-title {
  margin-bottom: 12px;
}

.note-list .note-pill {
  grid-template-columns: 34px minmax(0, 1fr);
}

.suggestion {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 9px;
  align-items: center;
}

.suggestion strong,
.suggestion small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.suggestion small {
  color: var(--muted);
}

.creator-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.creator-metrics span {
  display: grid;
  gap: 3px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.creator-metrics small {
  color: var(--muted);
  font-size: 0.72rem;
}

.mobile-nav {
  position: fixed;
  inset: auto 10px 10px;
  z-index: 20;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 4px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.mobile-nav button {
  display: grid;
  place-items: center;
  min-height: 46px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  color: var(--ink);
  background: transparent;
}

.mobile-nav button.active {
  border-color: var(--line);
  background: var(--surface);
}

.mobile-nav button.create {
  color: #0b1018;
  background: linear-gradient(135deg, var(--coral), var(--amber));
}

.modal {
  width: min(92vw, 520px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.modal::backdrop {
  background: rgba(17, 21, 29, 0.42);
}

.modal form,
#modalBody {
  display: grid;
  gap: 12px;
}

.modal-actions {
  justify-content: flex-end;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  z-index: 50;
  transform: translateX(-50%) translateY(18px);
  max-width: min(92vw, 430px);
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transition: 160ms ease;
}

.toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

[data-tip]::after {
  content: attr(data-tip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 7px);
  transform: translateX(-50%);
  width: max-content;
  max-width: 180px;
  padding: 6px 8px;
  border-radius: var(--radius);
  color: var(--surface);
  background: var(--ink);
  font-size: 0.72rem;
  opacity: 0;
  pointer-events: none;
}

[data-tip]:hover::after {
  opacity: 1;
}

@media (max-width: 1180px) {
  .app-shell {
    grid-template-columns: 224px minmax(0, 1fr);
  }

  .sidecar {
    display: none;
  }
}

@media (max-width: 900px) {
  .auth-gate {
    grid-template-columns: 1fr;
    min-height: auto;
    padding: 18px 0 40px;
  }

  .auth-visual {
    min-height: 360px;
  }

  .auth-visual img {
    min-height: 360px;
  }

  .phone-glass {
    right: 14px;
    bottom: 14px;
    width: 175px;
  }

  body:has(.app-shell:not(.hidden)) {
    padding-bottom: 78px;
  }

  .app-shell {
    display: block;
    width: min(100% - 20px, 720px);
    padding-top: 76px;
  }

  .rail {
    display: none;
  }

  .mobile-topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: auto;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100vw;
    max-width: 100vw;
    min-height: 64px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--line);
    background: rgba(247, 246, 241, 0.9);
    backdrop-filter: blur(18px);
  }

  .messages-shell,
  .create-layout {
    grid-template-columns: 1fr;
  }

  .chat {
    min-height: 500px;
    border-top: 1px solid var(--line);
  }

  .inbox {
    border-right: 0;
  }

  .notes-row {
    display: flex;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .notes-row::-webkit-scrollbar {
    display: none;
  }

  .notes-row .note-pill {
    min-width: 210px;
  }

  .reel-card,
  .reel-card img,
  .reel-card .visual {
    min-height: calc(100vh - 150px);
  }
}

@media (max-width: 620px) {
  .auth-gate {
    width: calc(100% - 20px);
    max-width: 520px;
  }

  .auth-visual {
    min-height: 300px;
  }

  .auth-visual img {
    min-height: 300px;
  }

  .phone-glass {
    display: none;
  }

  .auth-form h1 {
    font-size: 1.7rem;
  }

  .app-shell {
    width: 100%;
    padding-left: 10px;
    padding-right: 10px;
  }

  .post-head {
    grid-template-columns: 42px minmax(0, 1fr) 42px;
  }

  .result-card,
  .activity-card {
    grid-template-columns: 42px minmax(0, 1fr);
  }

  .result-card .command,
  .activity-card .command {
    grid-column: 1 / -1;
    justify-self: start;
  }

  .visual {
    min-height: 350px;
  }

  .explore-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .profile-head {
    grid-template-columns: 82px minmax(0, 1fr);
    padding: 12px;
  }

  .profile-avatar {
    width: 82px;
    height: 82px;
  }

  .profile-grid {
    gap: 3px;
  }

  .tool-grid,
  .settings-grid,
  .account-status {
    grid-template-columns: 1fr;
  }

  .account-status div {
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .account-status div:first-child {
    border-top: 0;
  }

  .command {
    min-width: 0;
    flex: 1 1 auto;
  }

  .auth-tabs,
  .auth-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .auth-links {
    justify-content: center;
  }
}
