:root {
  color-scheme: light;
  --bg: #f5f7fa;
  --surface: #ffffff;
  --surface-strong: #ffffff;
  --ink: #171717;
  --muted: #66717d;
  --line: #dce2e8;
  --soft: #eaf0f5;
  --accent: #e23d62;
  --accent-strong: #b81742;
  --sky: #2978a0;
  --green: #157f60;
  --shadow: 0 18px 45px rgba(25, 35, 48, 0.12);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    linear-gradient(135deg, rgba(226, 61, 98, 0.12), transparent 28%),
    linear-gradient(315deg, rgba(41, 120, 160, 0.13), transparent 28%),
    var(--bg);
  color: var(--ink);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

svg {
  display: block;
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.app-shell {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 26px 18px;
  border-right: 1px solid rgba(98, 111, 126, 0.25);
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(18px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  text-decoration: none;
  font-size: 23px;
  font-weight: 800;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: var(--radius);
  background: var(--ink);
  color: #fff;
  font-weight: 800;
}

.nav-list {
  display: grid;
  gap: 8px;
  margin-top: 36px;
}

.nav-item,
.primary-button,
.secondary-button,
.icon-button,
.action-button,
.segment {
  border: 0;
  border-radius: var(--radius);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 0 14px;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
  text-align: left;
}

.nav-item:hover,
.nav-item.active {
  background: var(--ink);
  color: #fff;
}

.sidebar-links {
  position: absolute;
  right: 18px;
  bottom: 112px;
  left: 18px;
  display: grid;
  gap: 6px;
}

.sidebar-links button {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  text-align: left;
}

.sidebar-links button:hover,
.sidebar-links button.active {
  color: var(--ink);
}

.sidebar-card {
  position: absolute;
  right: 18px;
  bottom: 24px;
  left: 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-strong);
}

.mini-avatar,
.avatar,
.profile-avatar {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 50%;
  background:
    radial-gradient(circle at 30% 25%, #ffca5f 0 24%, transparent 25%),
    linear-gradient(135deg, var(--accent), var(--sky));
  color: #fff;
  font-weight: 800;
  text-transform: uppercase;
}

.mini-avatar {
  width: 40px;
  height: 40px;
  font-size: 13px;
}

.sidebar-card strong,
.sidebar-card span {
  display: block;
}

.sidebar-card span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 13px;
}

.main {
  min-width: 0;
  padding: 22px clamp(16px, 4vw, 42px) 44px;
}

.topbar {
  position: sticky;
  z-index: 3;
  top: 0;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 12px 0 18px;
  background: linear-gradient(180deg, rgba(245, 247, 250, 0.98), rgba(245, 247, 250, 0.82) 78%, transparent);
  backdrop-filter: blur(12px);
}

.search-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--muted);
}

.search-wrap input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
}

.primary-button,
.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 46px;
  padding: 0 16px;
  font-weight: 800;
}

.primary-button {
  background: var(--accent);
  color: #fff;
}

.primary-button:hover {
  background: var(--accent-strong);
}

.secondary-button {
  border: 1px solid var(--line);
  background: var(--surface-strong);
  color: var(--ink);
}

.secondary-button:hover {
  border-color: #b9ada0;
}

.icon-button {
  display: inline-grid;
  width: 42px;
  height: 42px;
  place-items: center;
  background: var(--surface-strong);
  color: var(--ink);
}

.icon-button:hover {
  background: var(--soft);
}

.icon-button.quiet {
  background: transparent;
  color: var(--muted);
}

.mobile-only {
  display: none;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.stories {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding: 8px 2px 22px;
  scrollbar-width: none;
}

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

.story {
  display: grid;
  gap: 8px;
  justify-items: center;
  min-width: 76px;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
}

.story-ring {
  display: grid;
  width: 66px;
  height: 66px;
  place-items: center;
  border: 3px solid transparent;
  border-radius: 50%;
  background:
    linear-gradient(var(--surface), var(--surface)) padding-box,
    linear-gradient(135deg, var(--accent), #ffb24d, var(--sky)) border-box;
}

.story-ring span {
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
  text-transform: uppercase;
}

.story-ring span.has-poster {
  overflow: hidden;
  background-position: center;
  background-size: cover;
  color: transparent;
}

.story small {
  margin-top: -4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.story-modal {
  width: min(94vw, 520px);
  border: 0;
  border-radius: var(--radius);
  background: #111;
  color: #fff;
  padding: 0;
}

.story-modal::backdrop {
  background: rgba(9, 12, 16, 0.72);
}

.story-card {
  display: grid;
  gap: 12px;
  padding: 12px;
}

.story-progress {
  display: grid;
  grid-auto-flow: column;
  gap: 5px;
}

.story-progress span {
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.28);
}

.story-progress span.active {
  background: #fff;
}

.story-top,
.story-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.story-top strong,
.story-top span {
  display: block;
}

.story-top span {
  margin-top: 3px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 13px;
}

.story-video {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius);
  background: #000;
  object-fit: cover;
}

.story-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.feed-layout {
  display: grid;
  grid-template-columns: minmax(0, 640px) minmax(260px, 340px);
  gap: clamp(18px, 4vw, 42px);
  align-items: start;
  max-width: 1040px;
}

.feed-column {
  display: grid;
  gap: 24px;
}

.post,
.trend-panel,
.profile-header {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-strong);
  box-shadow: var(--shadow);
}

.post {
  overflow: hidden;
}

.post.controller-focus {
  outline: 3px solid var(--accent);
  outline-offset: 4px;
}

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

.avatar {
  width: 44px;
  height: 44px;
}

.post-head strong,
.post-head span {
  display: block;
}

.post-head strong {
  cursor: pointer;
}

.post-head strong:hover {
  color: var(--sky);
}

.post-head span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 13px;
}

.follow-button {
  min-height: 36px;
  padding-inline: 12px;
  white-space: nowrap;
}

.video-frame {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(226, 61, 98, 0.2), rgba(41, 120, 160, 0.22)),
    #1b1b1b;
}

.video-frame::before {
  content: "";
  display: block;
  aspect-ratio: 16 / 9;
}

.post-video,
.grid-item video,
.upload-preview {
  width: 100%;
  background: #111;
  object-fit: cover;
}

.post-video {
  position: absolute;
  inset: 0;
  height: 100%;
}

.post-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 12px 14px 4px;
}

.action-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 10px;
  background: transparent;
  color: var(--ink);
  font-weight: 800;
}

.action-button:hover {
  background: var(--soft);
}

.like-button.liked {
  color: var(--accent);
}

.share-button {
  margin-left: auto;
  color: var(--muted);
}

.tag-button {
  border: 0;
  text-align: left;
}

.tag-button:hover {
  background: #dff0f4;
}

.caption {
  margin: 8px 14px 0;
  line-height: 1.5;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 14px 14px;
}

.tag {
  border-radius: 999px;
  background: #eef6f8;
  color: var(--sky);
  font-size: 13px;
  font-weight: 800;
  padding: 6px 10px;
}

.comments {
  border-top: 1px solid var(--line);
  padding: 12px 14px 14px;
}

.comment-list {
  display: grid;
  gap: 8px;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 14px;
}

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

.comment-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: start;
}

.comment-delete {
  min-height: 28px;
  border: 0;
  border-radius: var(--radius);
  background: var(--soft);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  padding: 0 8px;
}

.comment-delete:hover {
  color: var(--ink);
}

.comment-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.comment-form input {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0 12px;
  outline: 0;
}

.comment-form button {
  min-height: 38px;
  border: 0;
  border-radius: var(--radius);
  background: var(--ink);
  color: #fff;
  font-weight: 800;
  padding: 0 12px;
}

.trend-panel {
  position: sticky;
  top: 86px;
  padding: 18px;
}

.panel-heading,
.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.panel-heading h2,
.section-heading h1,
.profile-row h1 {
  margin: 0;
  line-height: 1.1;
}

.panel-heading h2 {
  font-size: 18px;
}

.panel-heading span {
  border-radius: 999px;
  background: rgba(21, 127, 96, 0.12);
  color: var(--green);
  font-size: 12px;
  font-weight: 900;
  padding: 6px 9px;
  text-transform: uppercase;
}

.trend-list {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.trend {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 0;
  border-radius: var(--radius);
  background: #f1f5f8;
  text-align: left;
}

.trend:hover {
  background: #e8eef4;
}

.trend strong {
  color: var(--sky);
}

.trend span {
  color: var(--muted);
  font-size: 13px;
}

.section-heading {
  margin: 10px 0 20px;
}

.section-heading h1 {
  font-size: clamp(28px, 5vw, 44px);
}

.reels-column {
  display: grid;
  gap: 18px;
  max-width: min(860px, 100%);
  scroll-snap-type: y proximity;
}

.reel-card {
  position: relative;
  overflow: hidden;
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #0f1115;
  box-shadow: var(--shadow);
  scroll-snap-align: start;
}

.reel-card::before {
  content: "";
  display: block;
  aspect-ratio: 16 / 9;
}

.reel-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background: #000;
  object-fit: cover;
}

.reel-overlay {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 1;
  display: grid;
  gap: 8px;
  padding: clamp(14px, 3vw, 22px);
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.72));
  color: #fff;
}

.reel-overlay p {
  max-width: 62ch;
  margin: 0;
  line-height: 1.45;
}

.reel-author {
  justify-self: start;
  border: 0;
  background: transparent;
  color: #fff;
  font-weight: 900;
  padding: 0;
}

.reel-actions {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  max-width: min(520px, calc(100% - 24px));
}

.reel-actions .action-button {
  min-height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(17, 17, 17, 0.68);
  color: #fff;
  backdrop-filter: blur(10px);
}

.reel-actions .action-button:hover {
  background: rgba(255, 255, 255, 0.18);
}

.segmented-control {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.segment {
  min-height: 36px;
  padding: 0 12px;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
}

.segment.active {
  background: var(--ink);
  color: #fff;
}

.clip-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 14px;
}

.grid-item {
  position: relative;
  overflow: hidden;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: var(--radius);
  background: #111;
  box-shadow: var(--shadow);
}

.grid-open {
  position: relative;
  display: block;
  width: 100%;
  overflow: hidden;
  padding: 0;
  border: 0;
  border-radius: inherit;
  background: #111;
}

.grid-open::before {
  content: "";
  display: block;
  aspect-ratio: 16 / 9;
}

.grid-item video {
  position: absolute;
  inset: 0;
  height: 100%;
}

.grid-meta {
  position: absolute;
  right: 10px;
  bottom: 10px;
  left: 10px;
  overflow: hidden;
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  text-align: left;
  text-overflow: ellipsis;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.75);
  white-space: nowrap;
}

.grid-edit {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  min-height: 34px;
  border: 0;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
  padding: 0 10px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.grid-edit:hover {
  background: #fff;
}

.profile-header {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 22px;
  align-items: center;
  margin: 10px 0 18px;
  padding: clamp(18px, 4vw, 32px);
}

.profile-avatar {
  width: clamp(86px, 18vw, 128px);
  height: clamp(86px, 18vw, 128px);
  font-size: 28px;
}

.profile-row {
  display: flex;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
}

.profile-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.profile-row h1 {
  overflow-wrap: anywhere;
  font-size: clamp(24px, 5vw, 36px);
}

.profile-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin: 14px 0 10px;
}

.profile-stats span {
  color: var(--muted);
}

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

.profile-copy p {
  max-width: 540px;
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.profile-settings {
  display: grid;
  gap: 12px;
  margin: 0 0 18px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-strong);
  box-shadow: var(--shadow);
}

.profile-settings[hidden] {
  display: none;
}

.profile-settings h2 {
  margin: 0;
  font-size: 18px;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
}

.settings-grid label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.settings-grid select {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  padding: 0 12px;
}

.settings-grid input,
.settings-grid textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  outline: 0;
  padding: 10px 12px;
  resize: vertical;
}

.settings-grid input:focus,
.settings-grid textarea:focus,
.settings-grid select:focus {
  border-color: var(--sky);
  box-shadow: 0 0 0 3px rgba(41, 120, 160, 0.12);
}

.wide-setting {
  grid-column: 1 / -1;
}

.admin-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.admin-stat,
.admin-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-strong);
  box-shadow: var(--shadow);
}

.admin-stat {
  display: grid;
  gap: 4px;
  padding: 16px;
}

.admin-stat strong {
  font-size: 28px;
}

.admin-stat span {
  color: var(--muted);
  font-weight: 800;
}

.admin-warning {
  grid-column: 1 / -1;
  display: grid;
  gap: 4px;
  padding: 14px 16px;
  border: 1px solid rgba(226, 61, 98, 0.35);
  border-radius: var(--radius);
  background: rgba(226, 61, 98, 0.08);
}

.admin-warning strong {
  color: var(--accent-strong);
}

.admin-warning span {
  color: var(--muted);
  font-weight: 800;
}

.admin-layout {
  display: grid;
  gap: 16px;
}

.admin-panel {
  padding: 16px;
}

.admin-panel h2 {
  margin: 0 0 12px;
  font-size: 18px;
}

.admin-list {
  display: grid;
  gap: 10px;
}

.admin-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border-radius: var(--radius);
  background: #f1f5f8;
}

.admin-item strong,
.admin-item span {
  display: block;
}

.admin-item span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
}

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.upload-modal {
  width: min(720px, calc(100vw - 28px));
  padding: 0;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
}

.upload-modal::backdrop {
  background: rgba(23, 23, 23, 0.62);
  backdrop-filter: blur(6px);
}

.upload-card {
  display: grid;
  gap: 16px;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: var(--radius);
  background: var(--surface-strong);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.25);
}

.auth-card {
  gap: 18px;
}

.auth-switch {
  width: 100%;
}

.auth-switch .segment {
  flex: 1;
}

.auth-hint {
  margin: -4px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.modal-head,
.modal-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.modal-head h2 {
  margin: 0;
}

.dropzone {
  display: grid;
  gap: 8px;
  min-height: 180px;
  place-items: center;
  border: 2px dashed #cdbfb1;
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(226, 61, 98, 0.08), rgba(41, 120, 160, 0.08)),
    #f8fbfd;
  color: var(--muted);
  text-align: center;
}

.dropzone.dragging {
  border-color: var(--accent);
  background: #fff5f7;
}

.dropzone input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

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

.drop-icon {
  display: grid;
  width: 56px;
  height: 56px;
  place-items: center;
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
}

.upload-preview {
  max-height: 360px;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius);
}

.highlight-maker {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f8fbfd;
}

.highlight-maker[hidden] {
  display: none;
}

.highlight-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.highlight-head h3 {
  margin: 0;
  font-size: 16px;
}

.highlight-head span {
  color: var(--sky);
  font-size: 13px;
  font-weight: 900;
}

.highlight-ranges {
  display: grid;
  gap: 10px;
}

.highlight-ranges label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.highlight-ranges label span {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

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

.highlight-ranges input {
  width: 100%;
  accent-color: var(--accent);
}

.editor-tools {
  display: grid;
  gap: 10px;
}

.editor-tools label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.editor-tools input[type="text"],
.editor-tools select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  outline: 0;
  padding: 11px 12px;
}

.editor-check {
  display: flex !important;
  flex-direction: row;
  gap: 9px !important;
  align-items: center;
}

.editor-check input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.editor-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.editor-status {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
}

.editor-status[hidden] {
  display: none;
}

.editor-status span {
  overflow: hidden;
  height: 10px;
  border-radius: 999px;
  background: var(--soft);
}

.editor-status i {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--sky), var(--accent));
  transition: width 160ms ease;
}

.editor-status strong {
  min-width: 120px;
  color: var(--muted);
  font-size: 13px;
  text-align: right;
}

.upload-progress {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
}

.upload-progress[hidden] {
  display: none;
}

.upload-progress span {
  overflow: hidden;
  height: 10px;
  border-radius: 999px;
  background: var(--soft);
}

.upload-progress i {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--sky));
  transition: width 160ms ease;
}

.upload-progress strong {
  min-width: 44px;
  color: var(--muted);
  font-size: 13px;
  text-align: right;
}

.field-grid {
  display: grid;
  gap: 12px;
}

.field-grid label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.field-grid input,
.field-grid textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  outline: 0;
  padding: 12px;
  resize: vertical;
}

.empty-state {
  display: grid;
  gap: 12px;
  justify-items: start;
  padding: 28px;
  border: 1px dashed #cdbfb1;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.76);
  color: var(--muted);
}

.empty-state h2 {
  margin: 0;
  color: var(--ink);
}

.empty-state p {
  max-width: 46ch;
  margin: 0;
  line-height: 1.5;
}

.legal-page {
  max-width: 860px;
}

.legal-card {
  display: grid;
  gap: 12px;
  padding: clamp(18px, 4vw, 28px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-strong);
  box-shadow: var(--shadow);
}

.legal-card h2,
.legal-card p {
  margin: 0;
}

.legal-card h2 {
  margin-top: 6px;
  font-size: 18px;
}

.legal-card p {
  color: var(--muted);
  line-height: 1.6;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 10;
  max-width: min(360px, calc(100vw - 36px));
  padding: 13px 15px;
  border-radius: var(--radius);
  background: var(--ink);
  color: #fff;
  box-shadow: var(--shadow);
  font-weight: 800;
  transform: translateY(24px);
  opacity: 0;
  pointer-events: none;
  transition: transform 180ms ease, opacity 180ms ease;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

@media (max-width: 920px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    top: auto;
    z-index: 5;
    display: block;
    height: auto;
    padding: 8px 10px;
    border-top: 1px solid rgba(98, 111, 126, 0.25);
    border-right: 0;
  }

  .brand,
  .sidebar-card,
  .sidebar-links {
    display: none;
  }

  .nav-list {
    grid-template-columns: repeat(auto-fit, minmax(56px, 1fr));
    gap: 4px;
    margin: 0;
  }

  .nav-item {
    display: grid;
    gap: 3px;
    justify-items: center;
    min-height: 56px;
    padding: 6px 2px;
    font-size: 11px;
  }

  .nav-item svg {
    width: 22px;
    height: 22px;
  }

  .main {
    padding-bottom: 92px;
  }

  .feed-layout {
    grid-template-columns: 1fr;
  }

  .reels-column {
    max-width: 100%;
  }

  .trend-panel {
    position: static;
    box-shadow: none;
  }
}

@media (max-width: 680px) {
  .main {
    padding-inline: 12px;
  }

  .topbar {
    grid-template-columns: auto 1fr;
  }

  .topbar > .primary-button {
    display: none;
  }

  .mobile-only {
    display: inline-grid;
  }

  .stories {
    padding-bottom: 14px;
  }

  .post {
    margin-inline: -4px;
  }

  .section-heading,
  .profile-row {
    align-items: stretch;
    flex-direction: column;
  }

  .segmented-control {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
  }

  .clip-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .reel-actions {
    position: static;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    padding: 10px;
    background: #0f1115;
  }

  .reel-actions .action-button {
    justify-content: center;
    min-width: 0;
    padding-inline: 6px;
    font-size: 12px;
  }

  .reel-overlay {
    padding: 12px;
  }

  .profile-header {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }

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

  .modal-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  }

  .admin-item {
    grid-template-columns: 1fr;
  }

  .admin-actions {
    justify-content: stretch;
  }

  .admin-actions .secondary-button {
    flex: 1;
  }
}
