:root {
  --bg: #F2F2F7;
  --bg-elevated: #FFFFFF;
  --bg-grouped: #F2F2F7;
  --label: #111111;
  --secondary: rgba(60, 60, 67, 0.65);
  --tertiary: rgba(60, 60, 67, 0.35);
  --separator: rgba(60, 60, 67, 0.16);
  --fill: rgba(120, 120, 128, 0.14);
  --fill-secondary: rgba(120, 120, 128, 0.1);
  --blue: #0A84FF;
  --red: #FF3B30;
  --green: #34C759;
  --orange: #FF9F0A;
  --nav-height: 44px;
  --tab-height: 50px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display",
    "Helvetica Neue", Helvetica, Arial, sans-serif;
  --shadow-nav: 0 0.5px 0 var(--separator);
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 18px;
  --touch: 44px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg);
  color: var(--label);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.29;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overscroll-behavior-y: none;
  user-select: none;
  -webkit-user-select: none;
}

input,
textarea,
button,
select {
  font: inherit;
  color: inherit;
}

button {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}

a {
  color: var(--blue);
  text-decoration: none;
}

#app {
  min-height: 100%;
  padding-bottom: calc(var(--tab-height) + var(--safe-bottom));
}

#app.no-tabs {
  padding-bottom: var(--safe-bottom);
}

.hidden {
  display: none !important;
}

/* —— Boot —— */
.boot {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  gap: 12px;
  color: var(--secondary);
  font-size: 15px;
}

.boot-spinner {
  width: 28px;
  height: 28px;
  border: 2.5px solid var(--fill);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* —— Screen shell —— */
.screen {
  min-height: 100vh;
  animation: fadeIn 0.22s ease;
}

.screen.slide-in {
  animation: slideIn 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideIn {
  from { transform: translateX(18px); opacity: 0.6; }
  to { transform: translateX(0); opacity: 1; }
}

.nav-bar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: calc(var(--nav-height) + var(--safe-top));
  padding: var(--safe-top) 8px 0;
  background: rgba(242, 242, 247, 0.86);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  box-shadow: var(--shadow-nav);
}

.nav-bar.solid {
  background: var(--bg-elevated);
}

.nav-side {
  width: 72px;
  display: flex;
  align-items: center;
}

.nav-side.end {
  justify-content: flex-end;
}

.nav-title {
  flex: 1;
  text-align: center;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  min-height: var(--touch);
  padding: 0 10px;
  color: var(--blue);
  font-size: 17px;
  font-weight: 400;
}

.nav-btn.destructive {
  color: var(--red);
}

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

.large-title {
  padding: 4px 16px 12px;
  font-size: 34px;
  font-weight: 700;
  letter-spacing: -0.045em;
  line-height: 1.1;
}

.content {
  padding: 0 0 24px;
}

.content.padded {
  padding: 0 16px 24px;
}

/* —— Tab bar —— */
.tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  display: flex;
  height: calc(var(--tab-height) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  background: rgba(249, 249, 249, 0.92);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-top: 0.5px solid var(--separator);
}

.tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: var(--secondary);
  font-size: 10px;
  font-weight: 500;
  transition: color 0.15s ease;
}

.tab.active {
  color: var(--blue);
}

.tab-icon {
  display: flex;
  width: 26px;
  height: 26px;
}

.tab-icon svg {
  width: 100%;
  height: 100%;
}

/* —— Login / PIN —— */
.auth-screen {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: calc(40px + var(--safe-top)) 22px calc(28px + var(--safe-bottom));
  background:
    radial-gradient(100% 70% at 50% -20%, rgba(10, 132, 255, 0.18), transparent 55%),
    radial-gradient(80% 50% at 100% 100%, rgba(255, 59, 48, 0.06), transparent 45%),
    linear-gradient(180deg, #E9F1FB 0%, var(--bg) 48%);
}

.brand-mark {
  width: 76px;
  height: 76px;
  margin: 0 auto 16px;
  border-radius: 20px;
  background: linear-gradient(145deg, #3BA0FF, #0055D4);
  box-shadow: 0 12px 32px rgba(0, 85, 212, 0.32);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}

.brand {
  text-align: center;
  margin-bottom: 36px;
}

.brand-mark svg {
  width: 38px;
  height: 38px;
}

.brand h1 {
  margin: 0;
  font-size: 34px;
  font-weight: 700;
  letter-spacing: -0.04em;
}

.brand p {
  margin: 6px 0 0;
  color: var(--secondary);
  font-size: 15px;
}

.field-label {
  display: block;
  margin: 0 0 8px 4px;
  font-size: 13px;
  font-weight: 600;
  color: var(--secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.select-wrap {
  position: relative;
  margin-bottom: 28px;
}

.select-wrap select {
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
  background: var(--bg-elevated);
  border: none;
  border-radius: var(--radius-md);
  padding: 14px 40px 14px 16px;
  font-size: 17px;
  box-shadow: 0 0.5px 0 var(--separator), 0 1px 3px rgba(0, 0, 0, 0.04);
}

.select-wrap::after {
  content: "";
  position: absolute;
  right: 16px;
  top: 50%;
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--secondary);
  border-bottom: 2px solid var(--secondary);
  transform: translateY(-60%) rotate(45deg);
  pointer-events: none;
}

.pin-dots {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin: 8px 0 28px;
}

.pin-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1.5px solid var(--blue);
  transition: background 0.12s ease, transform 0.12s ease;
}

.pin-dot.filled {
  background: var(--blue);
  transform: scale(1.05);
}

.pin-pad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px 18px;
  max-width: 280px;
  margin: 0 auto;
  width: 100%;
}

.pin-key {
  aspect-ratio: 1;
  max-height: 76px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.72);
  font-size: 28px;
  font-weight: 400;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.1s ease, transform 0.1s ease;
}

.pin-key:active {
  background: rgba(0, 0, 0, 0.08);
  transform: scale(0.96);
}

.pin-key.ghost {
  background: transparent;
  font-size: 15px;
  font-weight: 500;
  color: var(--blue);
}

.auth-error {
  text-align: center;
  color: var(--red);
  font-size: 14px;
  min-height: 20px;
  margin: 16px 0 0;
}

.auth-hint {
  text-align: center;
  color: var(--secondary);
  font-size: 14px;
  margin: 0 0 8px;
}

/* —— Grouped lists —— */
.section-label {
  padding: 22px 16px 7px;
  font-size: 13px;
  font-weight: 400;
  color: var(--secondary);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.group {
  margin: 0 16px;
  background: var(--bg-elevated);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.group + .group {
  margin-top: 20px;
}

.row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 10px 16px;
  background: var(--bg-elevated);
  position: relative;
  width: 100%;
  text-align: left;
  color: inherit;
  transition: background 0.12s ease;
}

.row:active {
  background: var(--fill-secondary);
}

.row + .row::before {
  content: "";
  position: absolute;
  left: 16px;
  right: 0;
  top: 0;
  height: 0.5px;
  background: var(--separator);
}

.row.has-thumb + .row::before,
.row + .row.has-thumb::before {
  left: 88px;
}

.thumb-wrap {
  width: 56px;
  height: 56px;
  border-radius: 10px;
  flex-shrink: 0;
  overflow: hidden;
  background:
    linear-gradient(145deg, rgba(0, 122, 255, 0.12), rgba(0, 122, 255, 0.04)),
    var(--fill);
  position: relative;
}

.thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 0;
}

.row-note {
  margin-top: 2px;
  font-size: 13px;
  color: var(--label);
  opacity: 0.72;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.detail-note {
  margin: 0 0 10px;
  font-size: 16px;
  line-height: 1.35;
  color: var(--secondary);
  user-select: text;
  -webkit-user-select: text;
}

/* —— Forms (add post) —— */
.form-stack {
  padding: 16px 16px 32px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.filters-flush {
  padding: 0;
  margin: 0 -4px;
}

.field-input {
  width: 100%;
  border: none;
  background: var(--bg-elevated);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  font-size: 16px;
  outline: none;
  box-shadow: 0 0 0 0.5px var(--separator);
  user-select: text;
  -webkit-user-select: text;
}

.field-input:focus {
  box-shadow: 0 0 0 2px rgba(0, 122, 255, 0.35);
}

.field-textarea {
  min-height: 88px;
  resize: vertical;
  line-height: 1.35;
}

.optional {
  text-transform: none;
  letter-spacing: 0;
  font-weight: 400;
  color: var(--tertiary);
}

.hint-card {
  background: rgba(0, 122, 255, 0.08);
  color: var(--secondary);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  font-size: 14px;
  line-height: 1.35;
}

.hint-card p {
  margin: 0;
}

.hint-card.warn {
  background: rgba(255, 149, 0, 0.14);
  color: #9a5b00;
}

.hint-card strong {
  color: var(--label);
  font-weight: 600;
}

.hint-card.warn strong {
  color: #7a4500;
}

.preview-thumb {
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #111;
  aspect-ratio: 16 / 9;
}

.preview-thumb img,
.preview-thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.mode-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 4px;
  background: var(--bg-elevated);
  border-radius: var(--radius-md);
  box-shadow: 0 0 0 0.5px var(--separator);
}

.mode-btn {
  border: none;
  background: transparent;
  min-height: 40px;
  border-radius: calc(var(--radius-md) - 2px);
  font-size: 15px;
  font-weight: 600;
  color: var(--secondary);
  cursor: pointer;
}

.mode-btn.active {
  background: var(--bg);
  color: var(--label);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.file-input-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.file-picker {
  display: flex;
  align-items: center;
  min-height: 48px;
  padding: 12px 16px;
  background: var(--bg-elevated);
  border-radius: var(--radius-md);
  box-shadow: 0 0 0 0.5px var(--separator);
  font-size: 16px;
  color: var(--label);
  cursor: pointer;
}

.file-picker span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.upload-inline-bar {
  margin-top: 10px;
  height: 6px;
  border-radius: 3px;
  background: rgba(0, 0, 0, 0.08);
  overflow: hidden;
}

.upload-inline-bar span {
  display: block;
  height: 100%;
  background: #0a84ff;
  border-radius: 3px;
  transition: width 0.15s ease;
}

.upload-inline-note {
  margin: 8px 0 0 !important;
  font-size: 13px !important;
  opacity: 0.85;
}

/* Achtergrond-upload dock */
.upload-dock {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(72px + env(safe-area-inset-bottom, 0px));
  z-index: 80;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

#tabbar.hidden ~ #upload-dock {
  bottom: calc(12px + env(safe-area-inset-bottom, 0px));
}

.upload-dock.hidden {
  display: none;
}

.upload-dock-item {
  pointer-events: auto;
  background: rgba(28, 28, 30, 0.94);
  color: #f5f5f7;
  border-radius: 14px;
  padding: 12px 14px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.upload-dock-item.status-error {
  background: rgba(140, 30, 30, 0.95);
}

.upload-dock-item.status-done {
  background: rgba(20, 100, 60, 0.95);
}

.upload-dock-top {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.upload-dock-top strong {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
}

.upload-dock-top span {
  opacity: 0.85;
  white-space: nowrap;
}

.upload-dock-link,
.upload-dock-x {
  border: none;
  background: rgba(255, 255, 255, 0.16);
  color: inherit;
  border-radius: 8px;
  min-height: 28px;
  padding: 0 10px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.upload-dock-x {
  padding: 0 8px;
  font-size: 18px;
  line-height: 1;
}

.upload-dock-bar {
  margin-top: 8px;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.2);
  overflow: hidden;
}

.upload-dock-bar span {
  display: block;
  height: 100%;
  background: #0a84ff;
}

.advanced {
  background: var(--bg-elevated);
  border-radius: var(--radius-md);
  padding: 4px 14px 12px;
  box-shadow: 0 0 0 0.5px var(--separator);
}

.advanced summary {
  list-style: none;
  min-height: 44px;
  display: flex;
  align-items: center;
  font-size: 15px;
  font-weight: 500;
  color: var(--blue);
  cursor: pointer;
}

.advanced summary::-webkit-details-marker {
  display: none;
}

.form-error {
  margin: 0;
  min-height: 18px;
  color: var(--red);
  font-size: 14px;
}

.btn-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 4px;
}

/* Platform logos remote */
.platform-icon,
.detail-meta img {
  background: var(--fill);
  object-fit: cover;
}

.select-wrap select:disabled {
  opacity: 0.55;
}

.chip {
  border: none;
}

.auth-screen .select-wrap select {
  max-width: 100%;
}

.row-chevron {
  margin-left: auto;
  color: var(--tertiary);
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

.row-chevron svg {
  width: 14px;
  height: 14px;
}

.row-main {
  flex: 1;
  min-width: 0;
}

.row-title {
  font-size: 16px;
  font-weight: 500;
  letter-spacing: -0.01em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.row-meta {
  margin-top: 2px;
  font-size: 13px;
  color: var(--secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.thumb {
  width: 56px;
  height: 56px;
  border-radius: 8px;
  object-fit: cover;
  background: var(--fill);
  flex-shrink: 0;
}

.thumb.lg {
  width: 72px;
  height: 72px;
}

.platform-icon {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  flex-shrink: 0;
}

.platform-icon.lg {
  width: 44px;
  height: 44px;
  border-radius: 11px;
}

/* —— Filters / chips —— */
.filters {
  display: flex;
  gap: 8px;
  padding: 4px 16px 12px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

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

.chip {
  flex-shrink: 0;
  height: 32px;
  padding: 0 14px;
  border-radius: 999px;
  background: var(--fill);
  color: var(--label);
  font-size: 14px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background 0.15s ease, color 0.15s ease;
}

.chip.active {
  background: var(--blue);
  color: #fff;
}

.chip img {
  width: 16px;
  height: 16px;
  border-radius: 4px;
}

/* —— Empty / loading —— */
.empty {
  text-align: center;
  padding: 48px 32px;
  color: var(--secondary);
}

.empty h3 {
  margin: 0 0 6px;
  color: var(--label);
  font-size: 20px;
  font-weight: 600;
}

.empty p {
  margin: 0;
  font-size: 15px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--tab-height) + var(--safe-bottom) + 16px);
  transform: translateX(-50%) translateY(12px);
  background: rgba(30, 30, 30, 0.92);
  color: #fff;
  padding: 10px 16px;
  border-radius: 12px;
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 100;
  max-width: calc(100% - 40px);
}

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

/* —— Buttons —— */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: 0 18px;
  border-radius: var(--radius-md);
  font-size: 17px;
  font-weight: 600;
  transition: opacity 0.12s ease, transform 0.1s ease;
}

.btn:active {
  opacity: 0.75;
  transform: scale(0.985);
}

.btn:disabled {
  opacity: 0.45;
  pointer-events: none;
}

.btn-primary {
  background: var(--blue);
  color: #fff;
  width: 100%;
}

.btn-secondary {
  background: var(--fill);
  color: var(--blue);
  width: 100%;
}

.btn-danger {
  background: transparent;
  color: var(--red);
  width: 100%;
  font-weight: 500;
}

.btn-row {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.fab {
  position: fixed;
  right: 18px;
  bottom: calc(var(--tab-height) + var(--safe-bottom) + 18px);
  z-index: 45;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: linear-gradient(145deg, #3BA0FF, #0A84FF);
  color: #fff;
  box-shadow: 0 8px 24px rgba(10, 132, 255, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease;
}

.fab:active {
  transform: scale(0.94);
}

.fab svg {
  width: 26px;
  height: 26px;
}

/* —— Platforms grid —— */
.platform-list .row {
  min-height: 64px;
}

/* —— Post detail —— */
.detail-hero {
  background: var(--bg-elevated);
  margin: 0 0 12px;
}

.detail-thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: #111;
  display: block;
}

.detail-video {
  object-fit: contain;
  background: #000;
  max-height: 70vh;
  aspect-ratio: auto;
  min-height: 200px;
}

.detail-body {
  padding: 14px 16px 16px;
}

.detail-body h1 {
  margin: 0 0 8px;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.25;
  user-select: text;
  -webkit-user-select: text;
}

.detail-meta {
  font-size: 14px;
  color: var(--secondary);
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.detail-meta img {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  vertical-align: middle;
}

.action-bar {
  display: flex;
  gap: 8px;
  padding: 0 16px 12px;
}

.action-btn {
  flex: 1;
  min-height: 44px;
  border-radius: var(--radius-sm);
  background: var(--fill);
  color: var(--label);
  font-size: 15px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.action-btn.liked {
  color: var(--red);
  background: rgba(255, 59, 48, 0.12);
}

.action-btn svg {
  width: 18px;
  height: 18px;
}

.likers {
  padding: 0 16px 8px;
  font-size: 14px;
  color: var(--secondary);
}

.likers strong {
  color: var(--label);
  font-weight: 600;
}

.comment-list {
  padding: 0 0 8px;
}

.comment {
  padding: 12px 16px;
  border-top: 0.5px solid var(--separator);
}

.comment-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

.comment-author {
  font-size: 14px;
  font-weight: 600;
}

.comment-time {
  font-size: 12px;
  color: var(--secondary);
}

.comment-body {
  font-size: 15px;
  line-height: 1.35;
  user-select: text;
  -webkit-user-select: text;
  word-break: break-word;
}

.comment-composer {
  position: sticky;
  bottom: 0;
  display: flex;
  gap: 8px;
  padding: 10px 12px calc(10px + var(--safe-bottom));
  background: rgba(249, 249, 249, 0.94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 0.5px solid var(--separator);
}

#app:not(.no-tabs) .comment-composer {
  bottom: calc(var(--tab-height) + var(--safe-bottom));
}

.comment-composer input {
  flex: 1;
  min-height: 36px;
  border: none;
  border-radius: 18px;
  background: var(--bg-elevated);
  padding: 8px 14px;
  font-size: 16px;
  box-shadow: inset 0 0 0 0.5px var(--separator);
  outline: none;
  user-select: text;
  -webkit-user-select: text;
}

.comment-composer button {
  color: var(--blue);
  font-weight: 600;
  padding: 0 8px;
  min-height: 36px;
}

.comment-composer button:disabled {
  color: var(--tertiary);
}

/* —— Add post —— */
.url-input {
  width: 100%;
  border: none;
  background: var(--bg-elevated);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  font-size: 16px;
  outline: none;
  box-shadow: 0 0.5px 0 var(--separator);
  user-select: text;
  -webkit-user-select: text;
}

.preview-card {
  margin: 16px 0 0;
  background: var(--bg-elevated);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.preview-card img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: var(--fill);
  display: block;
}

.preview-card .preview-text {
  padding: 12px 14px 14px;
}

.preview-card h3 {
  margin: 0 0 4px;
  font-size: 16px;
  font-weight: 600;
}

.preview-card p {
  margin: 0;
  font-size: 13px;
  color: var(--secondary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.form-block {
  padding: 0 16px;
}

.spinner-inline {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  vertical-align: middle;
  margin-right: 8px;
}

/* —— Profile —— */
.profile-header {
  text-align: center;
  padding: 28px 16px 8px;
}

.avatar {
  width: 72px;
  height: 72px;
  margin: 0 auto 12px;
  border-radius: 50%;
  background: linear-gradient(145deg, #5ac8fa, #007aff);
  color: #fff;
  font-size: 28px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
}

.profile-header h2 {
  margin: 0;
  font-size: 22px;
  font-weight: 600;
}

.profile-header p {
  margin: 4px 0 0;
  color: var(--secondary);
  font-size: 14px;
}

.badge {
  display: inline-block;
  margin-top: 8px;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(0, 122, 255, 0.12);
  color: var(--blue);
  font-size: 12px;
  font-weight: 600;
}

/* Modal sheet for PIN change */
.sheet-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  animation: fadeIn 0.2s ease;
}

.sheet {
  width: 100%;
  max-width: 520px;
  background: var(--bg);
  border-radius: 14px 14px 0 0;
  padding: 12px 0 calc(20px + var(--safe-bottom));
  animation: sheetUp 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes sheetUp {
  from { transform: translateY(40%); }
  to { transform: translateY(0); }
}

.sheet-handle {
  width: 36px;
  height: 5px;
  border-radius: 3px;
  background: var(--fill);
  margin: 0 auto 12px;
}

.sheet h2 {
  margin: 0 16px 8px;
  font-size: 20px;
  font-weight: 600;
  text-align: center;
}

@media (min-width: 600px) {
  #app {
    max-width: 480px;
    margin: 0 auto;
    border-left: 0.5px solid var(--separator);
    border-right: 0.5px solid var(--separator);
    min-height: 100vh;
    background: var(--bg);
  }

  .tabbar {
    left: 50%;
    right: auto;
    width: 480px;
    transform: translateX(-50%);
  }

  .fab {
    right: calc(50% - 240px + 16px);
  }

  .comment-composer {
    max-width: 480px;
    margin: 0 auto;
    left: 0;
    right: 0;
  }
}

.page-sub {
  margin: -4px 16px 14px;
  color: var(--secondary);
  font-size: 15px;
}

.post-feed {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 0 16px 24px;
}

.post-card {
  display: flex;
  flex-direction: column;
  width: 100%;
  text-align: left;
  background: var(--bg-elevated);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  color: inherit;
  transition: transform 0.12s ease;
}

.post-card:active {
  transform: scale(0.985);
}

.post-card-media {
  position: relative;
  aspect-ratio: 16 / 9;
  background:
    linear-gradient(145deg, rgba(10, 132, 255, 0.16), rgba(10, 132, 255, 0.04)),
    #1c1c1e;
}

.post-card-media > img:not(.post-card-badge),
.post-card-media > video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}

.post-card-badge {
  position: absolute;
  left: 10px;
  bottom: 10px;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  object-fit: cover;
}

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

.post-card-title {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-card-note {
  margin-top: 4px;
  font-size: 14px;
  color: var(--secondary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-card-meta {
  margin-top: 8px;
  font-size: 12px;
  color: var(--tertiary);
}

.platform-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 0 16px 24px;
}

.platform-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 22px 12px 18px;
  background: var(--bg-elevated);
  border-radius: var(--radius-lg);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  color: inherit;
  transition: transform 0.12s ease;
}

.platform-tile:active {
  transform: scale(0.97);
}

.platform-tile img {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  object-fit: cover;
  background: var(--fill);
}

.platform-tile span {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
