/* ================================================
   Soribogi — Style System
   Color Palette: "Slate & Amber"
   Mobile-first, PWA-ready, CJK-support
   ================================================ */

/* ================================================
   CSS CUSTOM PROPERTIES (Design Tokens)
   ================================================ */

:root {
  /* Colors - Ink (Slate family) */
  --ink-900: #1a1a2e;
  --ink-700: #2d2d44;
  --ink-500: #4a4a68;
  --ink-300: #7a7a9a;
  --ink-200: #b0b0c4;
  --ink-100: #c4c4d8;
  --ink-50: #e8e8f0;
  
  /* Colors - Amber */
  --amber-500: #e6a23c;
  --amber-600: #c98a2a;
  --amber-300: #f5c76e;
  --amber-100: #faf0d7;
  --amber-50: #fdf8eb;
  
  /* Colors - Paper (Backgrounds) */
  --paper: #faf9f7;
  --paper-warm: #f5f3ef;
  --paper-cool: #f0f0f3;
  --paper-dark: #e8e6e2;
  
  /* Colors - Semantic */
  --success: #2d8a4e;
  --success-bg: #e6f4ea;
  --warning: #c45c26;
  --warning-bg: #fef0e6;
  --error: #c43d4b;
  --error-bg: #fce8ea;
  --info: #3d7a9e;
  --info-bg: #e8f2f8;
  
  /* Colors - UI */
  --overlay: rgba(26, 26, 46, 0.6);
  --surface: #ffffff;
  
  /* Typography */
  --font-sans: "Noto Sans", "Noto Sans KR", "Noto Sans JP", "Noto Sans SC", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 1.875rem;
  --text-4xl: 2.25rem;
  
  --weight-normal: 400;
  --weight-medium: 500;
  --weight-semibold: 600;
  --weight-bold: 700;
  --weight-black: 800;
  
  --leading-tight: 1.25;
  --leading-snug: 1.375;
  --leading-normal: 1.5;
  --leading-relaxed: 1.625;
  --leading-loose: 2;
  
  /* Spacing */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;
  
  /* Border Radius */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-full: 9999px;
  
  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(26, 26, 46, 0.05);
  --shadow-md: 0 2px 8px rgba(26, 26, 46, 0.08);
  --shadow-lg: 0 4px 16px rgba(26, 26, 46, 0.12);
  --shadow-xl: 0 8px 32px rgba(26, 26, 46, 0.16);
  
  /* Motion */
  --duration-instant: 0ms;
  --duration-fast: 150ms;
  --duration-normal: 250ms;
  --duration-slow: 400ms;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.87, 0, 0.13, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  
  /* Z-Index */
  --z-base: 0;
  --z-elevated: 10;
  --z-sticky: 100;
  --z-overlay: 200;
  --z-modal: 300;
  --z-toast: 400;
  --z-max: 9999;
  
  /* Layout */
  --header-height: 64px;
  --nav-height: 64px;
  --container-max: 640px;
  --container-wide: 800px;
}

/* ================================================
   RESET & BASE
   ================================================ */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  font-weight: var(--weight-normal);
  line-height: var(--leading-normal);
  color: var(--ink-900);
  background-color: var(--paper);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  padding-bottom: calc(var(--nav-height) + env(safe-area-inset-bottom, 0px));
}

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

button, input, textarea, select {
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
  color: inherit;
}

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

a {
  color: inherit;
  text-decoration: none;
}

/* Focus states */
:focus {
  outline: none;
}

:focus-visible {
  outline: 2px solid var(--amber-500);
  outline-offset: 2px;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ================================================
   TYPOGRAPHY
   ================================================ */

h1, h2, h3, h4, h5, h6 {
  font-weight: var(--weight-bold);
  line-height: var(--leading-tight);
}

.text-xs { font-size: var(--text-xs); }
.text-sm { font-size: var(--text-sm); }
.text-base { font-size: var(--text-base); }
.text-lg { font-size: var(--text-lg); }
.text-xl { font-size: var(--text-xl); }
.text-2xl { font-size: var(--text-2xl); }
.text-3xl { font-size: var(--text-3xl); }
.text-4xl { font-size: var(--text-4xl); }

.font-normal { font-weight: var(--weight-normal); }
.font-medium { font-weight: var(--weight-medium); }
.font-semibold { font-weight: var(--weight-semibold); }
.font-bold { font-weight: var(--weight-bold); }

.text-muted { color: var(--ink-500); }
.text-faint { color: var(--ink-300); }

/* ================================================
   LAYOUT
   ================================================ */

.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--space-4);
}

.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.page-content {
  flex: 1;
  padding-top: var(--header-height);
  padding-bottom: calc(var(--nav-height) + var(--space-6) + env(safe-area-inset-bottom, 0px));
}

/* ================================================
   HEADER
   ================================================ */

.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: var(--paper);
  z-index: var(--z-sticky);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-4);
  border-bottom: 1px solid var(--ink-50);
}

.header-logo {
  display: flex;
  flex-direction: column;
}

.header-brand {
  font-size: var(--text-xl);
  font-weight: var(--weight-bold);
  color: var(--ink-900);
  letter-spacing: -0.02em;
}

.header-tagline {
  font-size: var(--text-xs);
  color: var(--ink-500);
  margin-top: 2px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

/* ================================================
   BOTTOM NAVIGATION
   ================================================ */

.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  background: var(--surface);
  border-top: 1px solid var(--ink-50);
  z-index: var(--z-sticky);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

.bottom-nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-around;
  height: var(--nav-height);
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
  padding: var(--space-2);
  color: var(--ink-500);
  transition: color var(--duration-fast) var(--ease-in-out);
  min-width: 64px;
}

.nav-item:hover {
  color: var(--ink-700);
}

.nav-item.active {
  color: var(--amber-500);
}

.nav-item-icon {
  width: 24px;
  height: 24px;
}

.nav-item-label {
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
}

/* Compose button - center prominence */
.nav-compose {
  width: 48px;
  height: 48px;
  background: var(--ink-900);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--paper);
  transition: transform var(--duration-fast) var(--ease-spring),
              background var(--duration-fast) var(--ease-in-out);
}

.nav-compose:hover {
  transform: scale(1.05);
  background: var(--ink-700);
}

.nav-compose:active {
  transform: scale(0.95);
}

/* ================================================
   TAB BAR
   ================================================ */

.tab-bar {
  display: flex;
  border-bottom: 1px solid var(--ink-100);
  background: var(--paper);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.tab-bar::-webkit-scrollbar {
  display: none;
}

.tab-item {
  flex: 1;
  min-width: 80px;
  padding: var(--space-3) var(--space-2);
  text-align: center;
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--ink-500);
  position: relative;
  transition: color var(--duration-fast) var(--ease-in-out);
  white-space: nowrap;
}

.tab-item:hover {
  color: var(--ink-700);
}

.tab-item.active {
  color: var(--ink-900);
}

.tab-item.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 50%;
  transform: translateX(-50%);
  width: 32px;
  height: 2px;
  background: var(--amber-500);
  border-radius: var(--radius-full);
}

/* ================================================
   POST CARD
   ================================================ */

.post-card {
  background: var(--surface);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  margin: var(--space-4) var(--space-4) 0;
  overflow: hidden;
  transition: box-shadow var(--duration-fast) var(--ease-in-out);
}

.post-card:hover {
  box-shadow: var(--shadow-md);
}

.post-header {
  display: flex;
  align-items: flex-start;
  padding: var(--space-4);
  gap: var(--space-3);
}

.post-avatar {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background: var(--paper-cool);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: var(--weight-bold);
  color: var(--ink-500);
  flex-shrink: 0;
  font-size: var(--text-sm);
}

.post-meta {
  flex: 1;
  min-width: 0;
}

.post-author {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.post-author-name {
  font-weight: var(--weight-semibold);
  color: var(--ink-900);
  font-size: var(--text-sm);
}

.post-time {
  font-size: var(--text-xs);
  color: var(--ink-300);
}

.post-language {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  margin-top: var(--space-1);
  padding: var(--space-1) var(--space-2);
  background: var(--amber-50);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  color: var(--amber-600);
  font-weight: var(--weight-medium);
}

.post-content {
  padding: 0 var(--space-4) var(--space-4);
}

.post-text {
  font-size: var(--text-lg);
  font-weight: var(--weight-medium);
  line-height: var(--leading-relaxed);
  color: var(--ink-900);
  white-space: pre-wrap;
  word-wrap: break-word;
}

/* Audio Player */
.post-audio {
  margin-top: var(--space-3);
  padding: var(--space-3);
  background: var(--paper-cool);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.audio-play-btn {
  width: 40px;
  height: 40px;
  background: var(--ink-900);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--paper);
  flex-shrink: 0;
  transition: transform var(--duration-fast) var(--ease-spring);
}

.audio-play-btn:hover {
  transform: scale(1.05);
}

.audio-play-btn:active {
  transform: scale(0.95);
}

.audio-progress-container {
  flex: 1;
  min-width: 0;
}

.audio-time {
  display: flex;
  justify-content: space-between;
  font-size: var(--text-xs);
  color: var(--ink-500);
  margin-bottom: var(--space-1);
  font-variant-numeric: tabular-nums;
}

.audio-progress {
  height: 4px;
  background: var(--ink-100);
  border-radius: var(--radius-full);
  overflow: hidden;
  cursor: pointer;
}

.audio-progress-fill {
  height: 100%;
  background: var(--amber-500);
  border-radius: var(--radius-full);
  width: 45%;
  transition: width var(--duration-fast) var(--ease-in-out);
}

.audio-waveform {
  display: flex;
  align-items: center;
  gap: 2px;
  height: 24px;
}

.waveform-bar {
  width: 3px;
  background: var(--amber-300);
  border-radius: var(--radius-full);
}

.waveform-bar:nth-child(1) { height: 40%; }
.waveform-bar:nth-child(2) { height: 70%; }
.waveform-bar:nth-child(3) { height: 50%; }
.waveform-bar:nth-child(4) { height: 90%; }
.waveform-bar:nth-child(5) { height: 60%; }
.waveform-bar:nth-child(6) { height: 80%; }
.waveform-bar:nth-child(7) { height: 45%; }
.waveform-bar:nth-child(8) { height: 75%; }
.waveform-bar:nth-child(9) { height: 55%; }
.waveform-bar:nth-child(10) { height: 85%; }
.waveform-bar:nth-child(11) { height: 40%; }
.waveform-bar:nth-child(12) { height: 65%; }

/* Audio speed control */
.audio-speed-btn {
  padding: var(--space-1) var(--space-2);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  color: var(--amber-600);
  background: var(--amber-50);
  border-radius: var(--radius-sm);
  cursor: pointer;
  border: none;
  white-space: nowrap;
  transition: background var(--duration-fast) var(--ease-in-out);
}

.audio-speed-btn:hover {
  background: var(--amber-100);
}

/* Post Actions */
.post-actions {
  display: flex;
  align-items: center;
  padding: var(--space-3) var(--space-4);
  border-top: 1px solid var(--ink-50);
  gap: var(--space-1);
}

.action-btn {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  color: var(--ink-500);
  transition: background var(--duration-fast) var(--ease-in-out),
              color var(--duration-fast) var(--ease-in-out);
}

.action-btn:hover {
  background: var(--paper-cool);
  color: var(--ink-700);
}

.action-btn.liked {
  color: var(--error);
}

.action-btn.liked .icon-heart {
  animation: pulse-heart var(--duration-normal) var(--ease-spring);
}

@keyframes pulse-heart {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.25); }
}

.like-count {
  display: inline-block;
  transition: transform var(--duration-fast) var(--ease-spring);
}

.like-count.pop {
  animation: count-pop var(--duration-normal) var(--ease-spring);
}

@keyframes count-pop {
  0% { transform: scale(1); }
  40% { transform: scale(1.3); }
  100% { transform: scale(1); }
}

.action-icon {
  width: 18px;
  height: 18px;
}

/* ================================================
   BUTTONS
   ================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-md);
  font-weight: var(--weight-medium);
  font-size: var(--text-base);
  transition: all var(--duration-fast) var(--ease-in-out);
  cursor: pointer;
  border: none;
  text-align: center;
}

.btn-primary {
  background: var(--ink-900);
  color: var(--paper);
}

.btn-primary:hover {
  background: var(--ink-700);
}

.btn-primary:active {
  background: var(--ink-900);
  transform: scale(0.98);
}

.btn-secondary {
  background: var(--paper-warm);
  color: var(--ink-700);
  border: 1px solid var(--ink-100);
}

.btn-secondary:hover {
  background: var(--paper-cool);
  border-color: var(--ink-300);
}

.btn-ghost {
  background: transparent;
  color: var(--ink-700);
}

.btn-ghost:hover {
  background: var(--paper-cool);
}

.btn-accent {
  background: var(--amber-500);
  color: var(--ink-900);
}

.btn-accent:hover {
  background: var(--amber-600);
}

.btn-lg {
  padding: var(--space-3) var(--space-6);
  font-size: var(--text-lg);
}

.btn-full {
  width: 100%;
}

.btn-sm {
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-sm);
}

.btn-icon {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: var(--radius-full);
}

/* Profile logout */
.profile-logout {
  margin-top: var(--space-4);
}

/* ================================================
   FORMS
   ================================================ */

.form-group {
  margin-bottom: var(--space-4);
}

.form-label {
  display: block;
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--ink-700);
  margin-bottom: var(--space-2);
}

.form-input {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  background: var(--paper-cool);
  border: 1px solid var(--ink-100);
  border-radius: var(--radius-md);
  font-size: var(--text-base);
  color: var(--ink-900);
  transition: border-color var(--duration-fast) var(--ease-in-out),
              box-shadow var(--duration-fast) var(--ease-in-out);
}

.form-input::placeholder {
  color: var(--ink-300);
}

.form-input:focus {
  border-color: var(--amber-500);
  box-shadow: 0 0 0 3px var(--amber-100);
}

.form-input.error {
  border-color: var(--error);
}

.form-helper {
  font-size: var(--text-xs);
  color: var(--ink-500);
  margin-top: var(--space-1);
}

.form-error {
  font-size: var(--text-xs);
  color: var(--error);
  margin-top: var(--space-1);
}

.form-input-icon {
  position: relative;
}

.form-input-icon .form-input {
  padding-right: var(--space-10);
}

.form-input-icon .icon-toggle {
  position: absolute;
  right: var(--space-3);
  top: 50%;
  transform: translateY(-50%);
  color: var(--ink-300);
  cursor: pointer;
  padding: var(--space-1);
}

/* Textarea */
.form-textarea {
  min-height: 120px;
  resize: vertical;
}

/* Select */
.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%237a7a9a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--space-3) center;
  padding-right: var(--space-10);
}

/* ================================================
   BADGES & CHIPS
   ================================================ */

.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
}

.badge-default {
  background: var(--ink-100);
  color: var(--ink-700);
}

.badge-success {
  background: var(--success-bg);
  color: var(--success);
}

.badge-warning {
  background: var(--warning-bg);
  color: var(--warning);
}

.badge-error {
  background: var(--error-bg);
  color: var(--error);
}

.badge-amber {
  background: var(--amber-100);
  color: var(--amber-600);
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-3);
  background: var(--paper-warm);
  border: 1px solid var(--ink-100);
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  color: var(--ink-700);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-in-out);
}

.chip:hover {
  border-color: var(--ink-300);
}

.chip.selected {
  background: var(--amber-100);
  border-color: var(--amber-500);
  color: var(--amber-600);
}

.chip-remove {
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: var(--space-1);
  border-radius: var(--radius-full);
  background: var(--ink-200);
  color: var(--ink-700);
}

/* ================================================
   AVATAR
   ================================================ */

.avatar {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background: var(--paper-cool);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: var(--weight-bold);
  color: var(--ink-500);
  font-size: var(--text-sm);
  overflow: hidden;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-xs { width: 24px; height: 24px; font-size: var(--text-xs); }
.avatar-sm { width: 32px; height: 32px; font-size: var(--text-xs); }
.avatar-md { width: 40px; height: 40px; font-size: var(--text-sm); }
.avatar-lg { width: 64px; height: 64px; font-size: var(--text-lg); }
.avatar-xl { width: 96px; height: 96px; font-size: var(--text-2xl); }

/* ================================================
   PROFILE
   ================================================ */

.profile-header {
  text-align: center;
  padding: var(--space-6) var(--space-4);
}

.profile-avatar {
  margin: 0 auto var(--space-4);
}

.profile-name {
  font-size: var(--text-xl);
  font-weight: var(--weight-bold);
  color: var(--ink-900);
  margin-bottom: var(--space-1);
}

.profile-username {
  font-size: var(--text-sm);
  color: var(--ink-500);
  margin-bottom: var(--space-1);
}

.profile-location {
  font-size: var(--text-sm);
  color: var(--ink-300);
  margin-bottom: var(--space-4);
}

.profile-stats {
  display: flex;
  justify-content: center;
  gap: var(--space-8);
  margin-bottom: var(--space-4);
}

.stat-item {
  text-align: center;
}

.stat-value {
  font-size: var(--text-lg);
  font-weight: var(--weight-bold);
  color: var(--ink-900);
}

.stat-label {
  font-size: var(--text-xs);
  color: var(--ink-500);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ================================================
   DIVIDER
   ================================================ */

.divider {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  color: var(--ink-300);
  font-size: var(--text-sm);
}

.divider::before,
.divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--ink-100);
}

/* ================================================
   LOGIN/REGISTER
   ================================================ */

.auth-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--paper);
}

.auth-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: var(--space-6) var(--space-4);
  max-width: 400px;
  margin: 0 auto;
  width: 100%;
}

.auth-logo {
  text-align: center;
  margin-bottom: var(--space-8);
}

.auth-logo-brand {
  font-size: var(--text-3xl);
  font-weight: var(--weight-black);
  color: var(--ink-900);
  letter-spacing: -0.02em;
}

.auth-logo-tagline {
  font-size: var(--text-sm);
  color: var(--ink-500);
  margin-top: var(--space-1);
}

.auth-form {
  margin-bottom: var(--space-6);
}

.auth-links {
  text-align: center;
  font-size: var(--text-sm);
  color: var(--ink-500);
}

.auth-links a {
  color: var(--amber-600);
  font-weight: var(--weight-medium);
}

.auth-links a:hover {
  text-decoration: underline;
}

.auth-divider {
  margin: var(--space-6) 0;
}

.social-btn {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  background: var(--surface);
  border: 1px solid var(--ink-100);
  border-radius: var(--radius-md);
  font-size: var(--text-base);
  font-weight: var(--weight-medium);
  color: var(--ink-700);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
  transition: all var(--duration-fast) var(--ease-in-out);
}

.social-btn:hover {
  background: var(--paper-warm);
  border-color: var(--ink-300);
}

.social-icon {
  width: 20px;
  height: 20px;
}

/* ================================================
   EMPTY STATE
   ================================================ */

.empty-state {
  text-align: center;
  padding: var(--space-8) var(--space-4);
}

.empty-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto var(--space-4);
  color: var(--ink-300);
}

.empty-title {
  font-size: var(--text-lg);
  font-weight: var(--weight-semibold);
  color: var(--ink-700);
  margin-bottom: var(--space-2);
}

.empty-description {
  font-size: var(--text-sm);
  color: var(--ink-500);
  margin-bottom: var(--space-4);
  max-width: 280px;
  margin-left: auto;
  margin-right: auto;
}

/* ================================================
   TOAST
   ================================================ */

.toast {
  position: fixed;
  bottom: calc(var(--nav-height) + var(--space-8) + env(safe-area-inset-bottom, 0px));
  left: 50%;
  transform: translateX(-50%);
  padding: var(--space-3) var(--space-5);
  background: var(--ink-900);
  color: var(--paper);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  box-shadow: var(--shadow-xl);
  z-index: var(--z-toast);
  opacity: 0;
  transition: opacity var(--duration-normal) var(--ease-out);
  white-space: nowrap;
  max-width: calc(100vw - var(--space-8));
}

.toast.visible {
  opacity: 1;
}

/* ================================================
   SKELETON
   ================================================ */

.skeleton {
  background: linear-gradient(
    90deg,
    var(--paper-cool) 25%,
    var(--paper-warm) 50%,
    var(--paper-cool) 75%
  );
  background-size: 200% 100%;
  animation: skeleton-loading 1s infinite;
  border-radius: var(--radius-sm);
}

@keyframes skeleton-loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ================================================
   SKELETON CARDS
   ================================================ */

.feed-skeleton {
  padding: var(--space-4);
}

.skeleton-card {
  background: var(--surface);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  margin-bottom: var(--space-4);
  overflow: hidden;
}

.skeleton-header {
  display: flex;
  align-items: center;
  padding: var(--space-4);
  gap: var(--space-3);
}

.skeleton-avatar {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  flex-shrink: 0;
}

.skeleton-meta {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.skeleton-name {
  width: 100px;
  height: 14px;
}

.skeleton-time {
  width: 60px;
  height: 10px;
}

.skeleton-body {
  padding: 0 var(--space-4) var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.skeleton-line {
  height: 16px;
  width: 100%;
}

.skeleton-line-short {
  width: 60%;
}

.skeleton-line-medium {
  width: 80%;
}

/* ================================================
   WELCOME BANNER
   ================================================ */

.welcome-banner {
  margin: var(--space-4);
  padding: var(--space-5);
  background: linear-gradient(135deg, var(--ink-900), var(--ink-700));
  border-radius: var(--radius-lg);
  color: var(--paper);
  position: relative;
}

.welcome-banner-dismiss {
  position: absolute;
  top: var(--space-2);
  right: var(--space-3);
  background: none;
  border: none;
  color: var(--ink-300);
  font-size: var(--text-xl);
  cursor: pointer;
  padding: var(--space-1);
  line-height: 1;
}

.welcome-banner-title {
  font-size: var(--text-xl);
  font-weight: var(--weight-bold);
  margin-bottom: var(--space-2);
}

.welcome-banner-text {
  font-size: var(--text-sm);
  color: var(--ink-100);
  margin-bottom: var(--space-4);
  line-height: var(--leading-relaxed);
}

/* ================================================
   FEED TOOLBAR (Language filter)
   ================================================ */

.feed-toolbar {
  padding: var(--space-3) var(--space-4);
}

.feed-filter {
  width: 100%;
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-sm);
}

/* Feed header with toolbar + refresh */
.feed-header-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
}

.feed-header-row .feed-filter {
  flex: 1;
}

.refresh-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--paper-cool);
  border: 1px solid var(--ink-100);
  border-radius: var(--radius-md);
  color: var(--ink-500);
  cursor: pointer;
  flex-shrink: 0;
  transition: all var(--duration-fast) var(--ease-in-out);
}

.refresh-btn:hover {
  background: var(--paper-warm);
  color: var(--ink-700);
}

.refresh-btn.spinning svg {
  animation: spin 0.6s linear infinite;
}

/* ================================================
   AUTH HELPER BOX
   ================================================ */

.auth-helper-box {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  margin-top: var(--space-2);
  padding: var(--space-3);
  background: var(--amber-50);
  border-radius: var(--radius-md);
  border-left: 3px solid var(--amber-500);
}

.auth-helper-box svg {
  flex-shrink: 0;
  color: var(--amber-600);
  margin-top: 1px;
}

.auth-helper-box p {
  font-size: var(--text-xs);
  color: var(--ink-700);
  line-height: var(--leading-normal);
}

/* Copy button */
.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-3);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  color: var(--amber-600);
  background: var(--amber-50);
  border: 1px solid var(--amber-300);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--duration-fast) var(--ease-in-out);
  margin-top: var(--space-2);
}

.copy-btn:hover {
  background: var(--amber-100);
}

.copy-btn.copied {
  color: var(--success);
  background: var(--success-bg);
  border-color: var(--success);
}

/* ================================================
   RESPONSIVE
   ================================================ */

/* Noscript fallback */
noscript .noscript-msg {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: var(--space-6);
  text-align: center;
  font-family: var(--font-sans);
  color: var(--ink-700);
  background: var(--paper);
}

noscript .noscript-msg p {
  max-width: 400px;
  font-size: var(--text-lg);
  line-height: var(--leading-relaxed);
}

@media (min-width: 640px) {
  :root {
    --header-height: 72px;
  }
  
  .post-card {
    margin: var(--space-4) auto 0;
    max-width: var(--container-max);
  }
  
  .bottom-nav {
    display: none;
  }
  
  .page-content {
    padding-bottom: var(--space-8);
  }
  
  /* Desktop nav in header */
  .header-nav {
    display: flex;
    align-items: center;
    gap: var(--space-4);
  }
  
  .header-nav-item {
    font-size: var(--text-sm);
    font-weight: var(--weight-medium);
    color: var(--ink-500);
    padding: var(--space-2) var(--space-3);
    transition: color var(--duration-fast) var(--ease-in-out);
    cursor: pointer;
    border: none;
    background: none;
    border-radius: var(--radius-sm);
  }
  
  .header-nav-item:hover {
    color: var(--ink-700);
    background: var(--paper-cool);
  }
  
  .header-nav-item.active {
    color: var(--ink-900);
    font-weight: var(--weight-semibold);
  }

  .welcome-banner {
    margin: var(--space-4) auto 0;
    max-width: var(--container-max);
  }

  .feed-toolbar,
  .feed-header-row {
    max-width: var(--container-max);
    margin: 0 auto;
  }

  .tab-bar {
    max-width: var(--container-max);
    margin: 0 auto;
    border-left: 1px solid transparent;
    border-right: 1px solid transparent;
  }

  .feed-skeleton {
    max-width: var(--container-max);
    margin: 0 auto;
  }

  .empty-state {
    max-width: var(--container-max);
    margin: 0 auto;
  }

  .auth-container {
    max-width: 420px;
  }
}

@media (min-width: 768px) {
  .container {
    padding: 0 var(--space-6);
  }
  
  .auth-container {
    padding: var(--space-8) var(--space-6);
  }
}

/* ================================================
   UTILITY CLASSES
   ================================================ */

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: var(--space-1); }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }
.gap-8 { gap: var(--space-8); }

.p-4 { padding: var(--space-4); }
.p-6 { padding: var(--space-6); }
.py-2 { padding-top: var(--space-2); padding-bottom: var(--space-2); }
.py-4 { padding-top: var(--space-4); padding-bottom: var(--space-4); }
.px-4 { padding-left: var(--space-4); padding-right: var(--space-4); }
.px-6 { padding-left: var(--space-6); padding-right: var(--space-6); }

.mt-2 { margin-top: var(--space-2); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ================================================
   SPA OVERRIDES
   ================================================ */

/* Login/Register toggle */
.login-toggle {
  display: flex;
  justify-content: center;
  margin-bottom: var(--space-6);
  background: var(--paper-cool);
  border-radius: var(--radius-md);
  padding: var(--space-1);
}

.login-toggle-btn {
  flex: 1;
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--ink-500);
  text-align: center;
  transition: all var(--duration-fast) var(--ease-in-out);
  border: none;
  background: none;
  cursor: pointer;
}

.login-toggle-btn.active {
  background: var(--surface);
  color: var(--ink-900);
  box-shadow: var(--shadow-sm);
}

/* Loading spinner */
.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--ink-100);
  border-top-color: var(--amber-500);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  margin: 0 auto var(--space-3);
}

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

.loading-state {
  text-align: center;
  padding: var(--space-8) var(--space-4);
}

/* Sort tabs inherit .tab-item styling */

/* Toast container */
#toast-container {
  pointer-events: none;
}

/* Page section visibility */
.page-section {
  display: none;
}
.page-section.active {
  display: block;
}

/* Flex wrap utility */
.flex-wrap {
  flex-wrap: wrap;
}

/* Color utilities */
.text-amber-600 { color: var(--amber-600); }
.text-error { color: var(--error); }

/* Hidden */
.hidden { display: none !important; }

/* ================================================
   ADDITIONAL UTILITIES
   ================================================ */

/* Overflow */
.overflow-hidden { overflow: hidden; }
.overflow-auto { overflow: auto; }

/* Width */
.w-full { width: 100%; }

/* Display */
.inline-block { display: inline-block; }
.block { display: block; }

/* Position */
.relative { position: relative; }
.absolute { position: absolute; }

/* Opacity */
.opacity-50 { opacity: 0.5; }
.opacity-75 { opacity: 0.75; }

/* Cursor */
.cursor-pointer { cursor: pointer; }

/* Border */
.border { border: 1px solid var(--ink-100); }
.border-top { border-top: 1px solid var(--ink-100); }
.border-bottom { border-bottom: 1px solid var(--ink-100); }
.rounded-md { border-radius: var(--radius-md); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-full { border-radius: var(--radius-full); }

/* Background utilities */
.bg-surface { background: var(--surface); }
.bg-paper { background: var(--paper); }
.bg-paper-warm { background: var(--paper-warm); }
.bg-paper-cool { background: var(--paper-cool); }

/* Shadow utilities */
.shadow-sm { box-shadow: var(--shadow-sm); }
.shadow-md { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }

/* Letter spacing */
.tracking-tight { letter-spacing: -0.02em; }
.tracking-wide { letter-spacing: 0.05em; }

/* Transition helpers */
.transition-all {
  transition: all var(--duration-fast) var(--ease-in-out);
}
.transition-colors {
  transition: color var(--duration-fast) var(--ease-in-out),
              background var(--duration-fast) var(--ease-in-out),
              border-color var(--duration-fast) var(--ease-in-out);
}

/* ================================================
   RESPONSIVE BREAKPOINT HELPERS
   ================================================ */

/* Show/hide at breakpoints */
.hide-mobile { display: none; }
.show-mobile { display: block; }

@media (min-width: 640px) {
  .hide-mobile { display: block; }
  .hide-mobile.flex { display: flex; }
  .show-mobile { display: none; }
}

@media (min-width: 768px) {
  .hide-tablet { display: none; }
  .hide-tablet.flex { display: none; }
  .show-tablet { display: block; }
  .show-tablet.flex { display: flex; }
}

@media (min-width: 1024px) {
  .hide-desktop { display: none; }
  .hide-desktop.flex { display: none; }
  .show-desktop { display: block; }
  .show-desktop.flex { display: flex; }
}

/* Responsive text sizing */
@media (min-width: 640px) {
  .sm\:text-sm { font-size: var(--text-sm); }
  .sm\:text-base { font-size: var(--text-base); }
  .sm\:text-lg { font-size: var(--text-lg); }
}

@media (min-width: 768px) {
  .md\:text-base { font-size: var(--text-base); }
  .md\:text-lg { font-size: var(--text-lg); }
  .md\:text-xl { font-size: var(--text-xl); }
  .md\:text-2xl { font-size: var(--text-2xl); }
}

/* Responsive padding */
@media (min-width: 640px) {
  .sm\:px-6 { padding-left: var(--space-6); padding-right: var(--space-6); }
}

@media (min-width: 768px) {
  .md\:px-8 { padding-left: var(--space-8); padding-right: var(--space-8); }
}

/* ================================================
   DARK MODE
   ================================================ */

@media (prefers-color-scheme: dark) {
  :root {
    /* Ink inverted: light text on dark */
    --ink-900: #f0f0f5;
    --ink-700: #d0d0e0;
    --ink-500: #a0a0b8;
    --ink-300: #707088;
    --ink-200: #505068;
    --ink-100: #404058;
    --ink-50: #2a2a3e;

    /* Amber stays warm but slightly brighter for dark bg */
    --amber-500: #f0b040;
    --amber-600: #d99a30;
    --amber-300: #f8d87a;
    --amber-100: #3d3220;
    --amber-50: #2e2818;

    /* Paper: dark backgrounds */
    --paper: #12121e;
    --paper-warm: #181828;
    --paper-cool: #1e1e30;
    --paper-dark: #28283e;

    /* Surfaces */
    --surface: #1a1a2e;
    --overlay: rgba(0, 0, 0, 0.7);

    /* Semantic: brighter on dark */
    --success: #4ade80;
    --success-bg: rgba(74, 222, 128, 0.12);
    --warning: #fb923c;
    --warning-bg: rgba(251, 146, 60, 0.12);
    --error: #f87171;
    --error-bg: rgba(248, 113, 113, 0.12);
    --info: #60a5fa;
    --info-bg: rgba(96, 165, 250, 0.12);

    /* Shadows: stronger for dark mode elevation */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.5);
    --shadow-xl: 0 8px 32px rgba(0, 0, 0, 0.6);
  }

  /* Dark mode specific adjustments */
  body {
    color: var(--ink-900);
    background-color: var(--paper);
  }

  .header {
    background: var(--paper);
    border-bottom-color: var(--ink-50);
  }

  .bottom-nav {
    background: var(--surface);
    border-top-color: var(--ink-50);
  }

  .post-card {
    background: var(--surface);
  }

  .form-input {
    background: var(--paper-cool);
    border-color: var(--ink-100);
    color: var(--ink-900);
  }

  .form-input::placeholder {
    color: var(--ink-300);
  }

  .form-input:focus {
    border-color: var(--amber-500);
    box-shadow: 0 0 0 3px rgba(240, 176, 64, 0.15);
  }

  .btn-secondary {
    background: var(--paper-cool);
    border-color: var(--ink-100);
    color: var(--ink-700);
  }

  .btn-primary {
    background: var(--amber-500);
    color: var(--ink-900);
  }

  .btn-primary:hover {
    background: var(--amber-600);
  }

  .nav-compose {
    background: var(--amber-500);
    color: var(--ink-900);
  }

  .nav-compose:hover {
    background: var(--amber-600);
  }

  .welcome-banner {
    background: linear-gradient(135deg, var(--ink-50), var(--paper-cool));
  }

  .tab-item.active {
    color: var(--ink-900);
  }

  .social-btn {
    background: var(--paper-cool);
    border-color: var(--ink-100);
    color: var(--ink-700);
  }

  .login-toggle {
    background: var(--paper-cool);
  }

  .login-toggle-btn.active {
    background: var(--surface);
    color: var(--ink-900);
  }

  .chip {
    background: var(--paper-cool);
    border-color: var(--ink-100);
    color: var(--ink-700);
  }

  .auth-helper-box {
    background: var(--amber-50);
    border-left-color: var(--amber-500);
  }

  /* Focus visible stays amber */
  :focus-visible {
    outline-color: var(--amber-500);
  }

  /* Images slightly dimmed to reduce glare */
  img {
    filter: brightness(0.95);
  }
}

/* ================================================
   MICRO-INTERACTIONS & POLISH
   ================================================ */

/* Button press feedback */
.btn:active:not(:disabled) {
  transform: scale(0.97);
}

.btn:disabled,
.btn[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* Card entrance animation */
@keyframes card-enter {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.post-card {
  animation: card-enter var(--duration-normal) var(--ease-out) both;
}

/* Stagger card animations */
.post-card:nth-child(1) { animation-delay: 0ms; }
.post-card:nth-child(2) { animation-delay: 50ms; }
.post-card:nth-child(3) { animation-delay: 100ms; }
.post-card:nth-child(4) { animation-delay: 150ms; }
.post-card:nth-child(5) { animation-delay: 200ms; }

/* Link hover underline */
a:not(.btn):not(.nav-item):not(.chip):not(.tab-item):not(.social-btn):not(.login-toggle-btn):not(.admin-tab-btn):hover {
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Input focus glow */
.form-input:focus {
  transition: border-color var(--duration-fast) var(--ease-out),
              box-shadow var(--duration-fast) var(--ease-out);
}

/* Smooth page transitions */
.page-section {
  animation: fade-in var(--duration-normal) var(--ease-out);
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Nav item tap feedback */
.nav-item:active {
  transform: scale(0.92);
  transition: transform var(--duration-instant);
}

/* Badge pulse for notifications (future use) */
@keyframes badge-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15); }
}

.badge-pulse {
  animation: badge-pulse 2s var(--ease-in-out) infinite;
}

/* Smooth scroll behavior */
html {
  scroll-behavior: smooth;
}

/* Selection color */
::selection {
  background: var(--amber-300);
  color: var(--ink-900);
}

::-moz-selection {
  background: var(--amber-300);
  color: var(--ink-900);
}

/* Textarea auto-grow feel */
.form-textarea {
  min-height: 120px;
  line-height: var(--leading-relaxed);
}

/* Post text CJK optimization */
.post-text {
  font-feature-settings: "palt" 1;
  text-wrap: pretty;
  overflow-wrap: break-word;
  word-break: normal;
}

/* CJK-specific: no word-break for CJK paragraphs */
:lang(ko) .post-text,
:lang(ja) .post-text,
:lang(zh) .post-text {
  word-break: keep-all;
  line-break: strict;
}

/* Smooth hover transitions on interactive elements */
.post-card,
.btn,
.nav-item,
.tab-item,
.chip,
.action-btn,
.social-btn {
  will-change: transform;
}

@media (prefers-reduced-motion: reduce) {
  .post-card,
  .page-section {
    animation: none;
  }
}

/* ================================================
   ACCESSIBILITY ENHANCEMENTS
   ================================================ */

/* High contrast focus ring */
:focus-visible {
  outline: 2px solid var(--amber-500);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* Ensure touch targets are at least 44x44px */
.nav-item,
.action-btn,
.btn-icon,
.chip {
  min-height: 44px;
  min-width: 44px;
}

/* Screen reader live region */
.sr-only[aria-live] {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ================================================
   WELCOME BANNER ENHANCEMENTS
   ================================================ */

.welcome-banner-icon {
  font-size: 2rem;
  margin-bottom: var(--space-2);
}

.welcome-banner-steps {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
}

.welcome-step {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: var(--text-sm);
  color: var(--ink-100);
}

.welcome-step-num {
  width: 24px;
  height: 24px;
  border-radius: var(--radius-full);
  background: var(--amber-500);
  color: var(--ink-900);
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.welcome-banner-actions {
  display: flex;
  gap: var(--space-2);
  align-items: center;
}

/* ================================================
   ERROR BOUNDARY
   ================================================ */

.error-boundary {
  position: fixed;
  inset: 0;
  z-index: var(--z-max);
  background: var(--paper);
  display: flex;
  align-items: center;
  justify-content: center;
}

.error-boundary-inner {
  text-align: center;
  padding: var(--space-6);
  max-width: 400px;
}

.error-boundary-icon {
  color: var(--error);
  margin-bottom: var(--space-4);
}

.error-boundary-inner h2 {
  font-size: var(--text-xl);
  margin-bottom: var(--space-2);
}

.error-boundary-inner p {
  color: var(--ink-500);
  font-size: var(--text-sm);
  margin-bottom: var(--space-4);
}

/* ================================================
   EMPTY STATE ACTIONS
   ================================================ */

.empty-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-2);
}

/* ================================================
   PROFILE CONTEXT
   ================================================ */

.profile-context {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-3);
  background: var(--amber-50);
  border-radius: var(--radius-full);
}

/* ================================================
   PULL-TO-REFRESH INDICATOR
   ================================================ */

.ptr-indicator {
  position: fixed;
  top: var(--header-height);
  left: 50%;
  transform: translateX(-50%);
  z-index: var(--z-sticky);
  padding: var(--space-2) var(--space-4);
  background: var(--surface);
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.ptr-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--ink-100);
  border-top-color: var(--amber-500);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

/* ================================================
   TOAST IMPROVEMENTS
   ================================================ */

.toast {
  position: fixed;
  bottom: calc(var(--nav-height) + var(--space-6) + env(safe-area-inset-bottom, 0px));
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  padding: var(--space-3) var(--space-5);
  background: var(--ink-900);
  color: var(--paper);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  box-shadow: var(--shadow-xl);
  z-index: var(--z-toast);
  opacity: 0;
  transition: opacity var(--duration-normal) var(--ease-out),
              transform var(--duration-normal) var(--ease-out);
  white-space: nowrap;
  max-width: calc(100vw - var(--space-8));
  cursor: pointer;
}

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

/* Dismiss hint */
.toast::after {
  content: ' · tap to dismiss';
  font-size: var(--text-xs);
  opacity: 0.6;
}

@media (min-width: 640px) {
  .toast {
    bottom: var(--space-6);
  }
  .toast::after {
    content: '';
  }
}

/* ================================================
   LIKE ANIMATION ENHANCEMENTS
   ================================================ */

@keyframes pulse-heart {
  0% { transform: scale(1); }
  30% { transform: scale(1.3); }
  50% { transform: scale(0.9); }
  70% { transform: scale(1.15); }
  100% { transform: scale(1); }
}

/* Heart particle burst on like */
.action-btn.liked .icon-heart {
  animation: pulse-heart 0.45s var(--ease-spring);
  color: var(--error);
}

.action-btn.liked .icon-thumb-down {
  animation: pulse-heart 0.45s var(--ease-spring);
  color: var(--info);
}

/* ================================================
   AUDIO PLAYER ENHANCEMENTS
   ================================================ */

.post-audio {
  flex-wrap: wrap;
}

.audio-speed-btn {
  order: 3;
}

@media (max-width: 400px) {
  .post-audio {
    padding: var(--space-2);
    gap: var(--space-2);
  }
  .audio-play-btn {
    width: 36px;
    height: 36px;
  }
}

/* ================================================
   AVATAR CONSISTENCY
   ================================================ */

.post-avatar {
  font-size: var(--text-sm);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  font-family: var(--font-sans);
}

/* ================================================
   DESKTOP ENHANCEMENTS (1024px+)
   ================================================ */

@media (min-width: 1024px) {
  :root {
    --header-height: 64px;
  }

  .page-content {
    max-width: var(--container-wide);
    margin: 0 auto;
    padding-top: var(--header-height);
    padding-bottom: var(--space-8);
  }

  .post-card {
    margin: var(--space-3) 0 0;
    border-radius: var(--radius-lg);
  }

  .header {
    max-width: none;
  }

  /* Larger font for post text on wide screens */
  .post-text {
    font-size: var(--text-xl);
  }
}

/* ================================================
   FORM SELECT CHEVRON (cross-browser)
   ================================================ */

.form-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%237a7a9a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--space-3) center;
  padding-right: var(--space-10);
}

/* ================================================
   POST LINE HEIGHT FIX
   ================================================ */

.post-text {
  white-space: pre-wrap;
  word-wrap: break-word;
}

/* ================================================
   SPACING CONSISTENCY
   ================================================ */

.feed-header-row {
  padding: var(--space-3) var(--space-4);
}

.tab-bar {
  padding: 0;
}

.feed {
  padding-bottom: var(--space-4);
}
