/* ==========================================================================
   CHITTHI — Vintage Postal & Secret Messaging Stylesheet
   Color Palette: Very Light Brown, Light Khaki, Warm Khaki & Antique Ink
   ========================================================================== */

:root {
  /* Vintage Parchment & Paper */
  --paper: #fbf7ee;
  --paper-warm: #f5eedf;
  --paper-aged: #efe5d2;
  --card-bg: #fffdf9;
  --stationery: #fffdf8;

  /* Khaki Scale */
  --khaki-light: #ece0cd;
  --khaki: #cbb792;
  --khaki-dark: #988056;
  --khaki-border: #dfd0b7;
  --border-line: #e2d5be;
  --border-dark: #c5b28f;

  /* Brown & Antique Ink Scale */
  --brown-light: #7b5f3f;
  --brown: #543f29;
  --brown-deep: #342416;
  --ink: #221a12;
  --ink-muted: #6f5f4c;
  --ink-faded: #9a8873;

  /* Vintage Postal Accents */
  --stamp-red: #a43828;
  --stamp-red-soft: #fcf1ef;
  --stamp-green: #37633d;
  --stamp-green-soft: #edf5ee;
  --postmark-blue: #294c60;

  /* Shadows with antique warmth */
  --shadow-warm: 0 16px 44px rgba(52, 36, 22, 0.08), 0 2px 8px rgba(52, 36, 22, 0.03);
  --shadow-card: 0 4px 18px rgba(52, 36, 22, 0.06);
  --shadow-stamp: 0 2px 8px rgba(52, 36, 22, 0.1);
}

/* Base Reset & Box Sizing */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  background-color: var(--paper);
  color: var(--ink);
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow-x: hidden;
  background-image: 
    radial-gradient(circle at 12% 15%, rgba(203, 183, 146, 0.15) 0%, transparent 45%),
    radial-gradient(circle at 88% 85%, rgba(152, 128, 86, 0.12) 0%, transparent 50%),
    radial-gradient(circle at 50% 50%, rgba(245, 238, 223, 0.4) 0%, transparent 70%);
}

/* Vintage Paper Micro-grain Texture Overlay */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: radial-gradient(#98805615 1px, transparent 1px);
  background-size: 28px 28px;
  opacity: 0.65;
  z-index: 1;
}

header, main, footer, .brand-hero-center {
  position: relative;
  z-index: 2;
}

/* Typography Hierarchy */
h1, h2, h3, .serif-font {
  font-family: 'Playfair Display', Georgia, 'Times New Roman', serif;
}

.typewriter-font {
  font-family: 'Courier Prime', monospace;
}

.cinzel-font {
  font-family: 'Cinzel', serif;
}

button, input, textarea {
  font-family: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  touch-action: manipulation;
}

button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none !important;
}

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

/* ==========================================================================
   Header Bar (Centered on PC & Mobile)
   ========================================================================== */
.header-bar {
  width: 100%;
  background: rgba(251, 247, 238, 0.94);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-line);
  box-shadow: 0 1px 0 rgba(223, 208, 183, 0.4);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-actions-center {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  max-width: 440px;
}

/* ==========================================================================
   Buttons (Tactile Vintage Aesthetic)
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  min-height: 44px;
  border-radius: 12px;
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: 0.3px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
  user-select: none;
}

.btn:hover {
  transform: translateY(-1.5px);
}

.btn:active {
  transform: translateY(0.5px);
}

.btn-primary {
  background: linear-gradient(180deg, var(--brown) 0%, var(--brown-deep) 100%);
  color: #fffaf2;
  border: 1px solid rgba(52, 36, 22, 0.4);
  box-shadow: 0 4px 14px rgba(52, 36, 22, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.btn-primary:hover {
  background: var(--brown-deep);
  box-shadow: 0 6px 18px rgba(52, 36, 22, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.btn-soft {
  background: var(--paper-warm);
  color: var(--brown-deep);
  border: 1.5px solid var(--border-line);
  box-shadow: 0 2px 6px rgba(52, 36, 22, 0.04), inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.btn-soft:hover {
  background: var(--khaki-light);
  border-color: var(--khaki);
  color: var(--brown-deep);
}

.btn-ghost {
  color: var(--brown);
  padding: 8px 14px;
  min-height: 40px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.15s ease;
}

.btn-ghost:hover {
  color: var(--brown-deep);
  background: rgba(203, 183, 146, 0.25);
}

.btn-full {
  width: 100%;
  padding: 13px 20px;
  font-size: 14.5px;
  letter-spacing: 0.3px;
}

/* ==========================================================================
   Brand & Logo Section (Centered & Unboxed)
   ========================================================================== */
.brand-hero-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  margin: 38px auto 14px; /* Header se halka extra space */
  padding: 0 16px;
}

.brand-clean {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.brand-clean:hover {
  transform: translateY(-1px);
}

.brand-logo-main {
  height: 74px; /* Logo ka size bada */
  width: auto;
  max-width: 290px;
  object-fit: contain;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  display: block;
  margin: 0 auto 8px;
  transform: translateX(0.3cm); /* Sirf logo ko 0.3cm right mein khiskao */
  filter: drop-shadow(0 4px 12px rgba(52, 36, 22, 0.14));
}

.brand-fallback-clean {
  font-size: 40px;
  color: var(--brown);
  margin-bottom: 6px;
  line-height: 1;
}

.brand-subtitle-center {
  font-family: 'Cinzel', serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--khaki-dark);
  margin-top: 2px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-subtitle-center::before,
.brand-subtitle-center::after {
  content: "";
  height: 1px;
  width: 22px;
  background: var(--khaki);
  opacity: 0.6;
}

/* ==========================================================================
   Main Layout & Centered Container
   ========================================================================== */
main {
  flex: 1;
  width: min(1080px, 100% - 32px);
  margin: 0 auto;
  padding: 8px 0 50px;
}

/* ==========================================================================
   Hero Section
   ========================================================================== */
.hero {
  text-align: center;
  max-width: 680px;
  margin: 12px auto 30px;
  padding: 0 12px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  border-radius: 30px;
  background: var(--paper-warm);
  border: 1px solid var(--border-line);
  color: var(--brown);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  margin-bottom: 14px;
  box-shadow: 0 2px 6px rgba(52, 36, 22, 0.04);
}

.hero-badge i {
  color: var(--stamp-red);
}

.hero h1 {
  font-size: clamp(28px, 5.5vw, 46px);
  font-weight: 700;
  line-height: 1.2;
  color: var(--brown-deep);
  letter-spacing: -0.5px;
  margin-bottom: 12px;
}

.hero p {
  font-size: 15.5px;
  line-height: 1.75;
  color: var(--ink-muted);
  max-width: 530px;
  margin: 0 auto;
}

/* Vintage Postal Divider */
.postal-divider {
  margin: 20px auto 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--khaki-dark);
  font-size: 12px;
}

.postal-divider::before,
.postal-divider::after {
  content: "";
  height: 1px;
  width: 65px;
  background: linear-gradient(90deg, transparent, var(--border-line) 50%, transparent);
}

/* ==========================================================================
   Dedicated Recipient Banner (Shown when user opens /username)
   ========================================================================== */
.recipient-welcome-banner {
  background: linear-gradient(135deg, var(--paper-warm) 0%, #faecd7 100%);
  border: 1.5px solid var(--khaki);
  border-radius: 16px;
  padding: 16px 20px;
  margin-bottom: 22px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: 0 4px 14px rgba(52, 36, 22, 0.05);
  animation: fadeIn 0.3s ease;
  position: relative;
  overflow: hidden;
}

.recipient-welcome-banner::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 4px;
  background: var(--stamp-red);
}

.recipient-banner-icon {
  font-size: 26px;
  color: var(--brown);
  flex-shrink: 0;
}

.recipient-banner-content {
  flex: 1;
}

.recipient-banner-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--brown-deep);
}

.recipient-highlight {
  color: var(--brown-deep);
  background: var(--khaki-light);
  padding: 2px 8px;
  border-radius: 6px;
  font-family: 'Courier Prime', monospace;
  font-weight: 700;
  border: 1px solid var(--khaki);
}

.recipient-banner-sub {
  font-size: 12px;
  color: var(--ink-muted);
  margin-top: 3px;
  line-height: 1.45;
}

/* ==========================================================================
   2-Column Desktop Grid Layout
   ========================================================================== */
.app-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.22fr) minmax(290px, 0.78fr);
  gap: 28px;
  align-items: start;
}

/* ==========================================================================
   Panels (Vintage Letterbox Envelope Aesthetics)
   ========================================================================== */
.panel {
  background: var(--card-bg);
  border: 1.5px solid var(--border-line);
  border-radius: 20px;
  padding: clamp(20px, 3.8vw, 36px);
  box-shadow: var(--shadow-warm);
  position: relative;
  overflow: hidden;
}

/* Authentic Vintage Airmail Top Barber-Pole Border Accent */
.panel::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 5px;
  background-image: repeating-linear-gradient(
    -45deg,
    var(--stamp-red) 0,
    var(--stamp-red) 12px,
    transparent 12px,
    transparent 18px,
    var(--postmark-blue) 18px,
    var(--postmark-blue) 30px,
    transparent 30px,
    transparent 36px,
    var(--khaki) 36px,
    var(--khaki) 48px,
    transparent 48px,
    transparent 54px
  );
  opacity: 0.85;
}

/* Vintage Postage Rubber Stamp in Corner */
.panel::after {
  content: "AIR MAIL\A★ CHITTHI ★";
  white-space: pre-line;
  position: absolute;
  top: 18px;
  right: 18px;
  font-family: 'Cinzel', serif;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--khaki-dark);
  border: 1.5px dashed var(--khaki);
  border-radius: 8px;
  padding: 4px 8px;
  text-align: center;
  opacity: 0.7;
  pointer-events: none;
  line-height: 1.3;
  transform: rotate(5deg);
}

.panel-header {
  margin-bottom: 22px;
  padding-right: 60px; /* Room for stamp in corner */
}

.panel-header h2 {
  font-size: 26px;
  color: var(--brown-deep);
  font-weight: 700;
  letter-spacing: -0.4px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.panel-header p {
  color: var(--ink-muted);
  font-size: 14px;
  line-height: 1.6;
  margin-top: 5px;
}

/* ==========================================================================
   Form Fields & Ruled Stationery
   ========================================================================== */
.form-group {
  margin-bottom: 18px;
}

.form-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--brown-deep);
  letter-spacing: 0.2px;
  margin-bottom: 7px;
}

.form-label-hint {
  font-size: 11px;
  font-weight: 500;
  color: var(--ink-muted);
}

.input-wrapper {
  position: relative;
}

.input-prefix {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--khaki-dark);
  font-weight: 700;
  font-size: 16px;
  pointer-events: none;
  font-family: 'Courier Prime', monospace;
}

input[type="text"],
input[type="password"] {
  width: 100%;
  background: #ffffff;
  border: 1.5px solid var(--border-line);
  border-radius: 12px;
  padding: 12px 16px;
  min-height: 46px;
  color: var(--ink);
  font-size: 15px;
  transition: all 0.2s ease;
  outline: none;
  box-shadow: inset 0 1px 3px rgba(52, 36, 22, 0.04);
}

.has-prefix {
  padding-left: 34px !important;
}

input:focus {
  border-color: var(--brown);
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(203, 183, 146, 0.3), inset 0 1px 2px rgba(52, 36, 22, 0.05);
}

/* Vintage Ruled Letter Stationery for Textarea */
textarea {
  width: 100%;
  min-height: 180px;
  background-color: var(--stationery);
  /* Vintage ruled lines and left sepia margin line */
  background-image: 
    linear-gradient(90deg, transparent 40px, rgba(164, 56, 40, 0.2) 40px, rgba(164, 56, 40, 0.2) 41px, transparent 41px),
    repeating-linear-gradient(transparent, transparent 31px, rgba(203, 183, 146, 0.28) 31px, rgba(203, 183, 146, 0.28) 32px);
  background-attachment: local;
  line-height: 32px;
  padding: 12px 16px 12px 52px;
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 16px;
  color: var(--ink);
  border: 1.5px solid var(--border-line);
  border-radius: 14px;
  outline: none;
  resize: vertical;
  transition: all 0.2s ease;
  box-shadow: inset 0 2px 6px rgba(52, 36, 22, 0.04);
}

textarea:focus {
  border-color: var(--brown);
  box-shadow: 0 0 0 4px rgba(203, 183, 146, 0.3), inset 0 1px 3px rgba(52, 36, 22, 0.06);
}

textarea::placeholder {
  color: var(--ink-faded);
  font-style: italic;
  line-height: 32px;
}

.field-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 6px;
  font-size: 11px;
  color: var(--ink-muted);
}

/* Recipient Status Pill */
.recipient-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  margin-top: 6px;
  font-weight: 600;
}

.recipient-status.found {
  color: var(--stamp-green);
}

.recipient-status.not-found {
  color: var(--stamp-red);
}

/* ==========================================================================
   Mood Tags / Vintage Rubber Stamps
   ========================================================================== */
.mood-tags-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--ink-muted);
  text-transform: uppercase;
  letter-spacing: 1.2px;
  margin-bottom: 9px;
  font-family: 'Cinzel', serif;
}

.mood-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.mood-chip {
  background: var(--paper-warm);
  border: 1.5px solid var(--border-line);
  color: var(--brown-deep);
  font-size: 12px;
  font-weight: 600;
  padding: 8px 14px;
  min-height: 38px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.18s ease;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  user-select: none;
  box-shadow: 0 1px 3px rgba(52, 36, 22, 0.04);
}

.mood-chip i {
  font-size: 13px;
  color: var(--khaki-dark);
  transition: color 0.18s ease;
}

.mood-chip:hover {
  background: var(--khaki-light);
  border-color: var(--khaki);
  transform: translateY(-1px);
}

.mood-chip:hover i {
  color: var(--brown-deep);
}

.mood-chip.selected {
  background: var(--brown);
  color: #fff9f0;
  border-color: var(--brown);
  box-shadow: 0 3px 10px rgba(52, 36, 22, 0.2);
}

.mood-chip.selected i {
  color: #fff9f0;
}

/* ==========================================================================
   Status Notifications
   ========================================================================== */
.status-msg {
  display: none;
  margin-top: 16px;
  padding: 13px 16px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.6;
  border: 1px solid transparent;
  animation: fadeIn 0.25s ease;
}

.status-msg.show {
  display: block;
}

.status-msg.success {
  background: var(--stamp-green-soft);
  color: var(--stamp-green);
  border-color: #c0dbc2;
}

.status-msg.error {
  background: var(--stamp-red-soft);
  color: var(--stamp-red);
  border-color: #f5c8bf;
}

.status-msg.info {
  background: var(--paper-warm);
  color: var(--brown-deep);
  border-color: var(--border-line);
}

/* ==========================================================================
   Sender Page CTA (In-Panel)
   ========================================================================== */
.sender-create-cta {
  margin-top: 24px;
  padding: 20px 16px 8px;
  border-top: 1px dashed var(--border-line);
  text-align: center;
  background: linear-gradient(180deg, transparent 0%, rgba(236, 224, 205, 0.3) 100%);
  border-radius: 0 0 16px 16px;
}

.sender-create-cta p {
  font-size: 13px;
  color: var(--ink-muted);
  margin-bottom: 12px;
}

.btn-create-own {
  background: var(--paper-warm);
  border: 1.5px solid var(--khaki-dark);
  color: var(--brown-deep);
  font-weight: 700;
  padding: 11px 22px;
  min-height: 44px;
  border-radius: 12px;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 3px 10px rgba(152, 128, 86, 0.15);
  transition: all 0.2s ease;
}

.btn-create-own:hover {
  background: var(--khaki);
  color: #fffaf2;
  border-color: var(--khaki);
  transform: translateY(-1.5px);
  box-shadow: 0 5px 14px rgba(152, 128, 86, 0.25);
}

/* ==========================================================================
   Sidebar: Vintage How-It-Works Postal Notice
   ========================================================================== */
.side-card {
  background: var(--paper-warm);
  border: 1.5px solid var(--border-line);
  border-radius: 20px;
  padding: clamp(20px, 3vw, 28px);
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: hidden;
}

.side-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--khaki) 0%, var(--khaki-dark) 100%);
}

.side-card h3 {
  font-size: 22px;
  color: var(--brown-deep);
  margin-bottom: 10px;
  font-weight: 700;
}

.side-card p {
  color: var(--ink-muted);
  font-size: 13.5px;
  line-height: 1.7;
}

.how-it-works {
  list-style: none;
  margin-top: 20px;
  display: grid;
  gap: 16px;
}

.how-step {
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 12px;
  align-items: start;
}

.step-badge {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--khaki-light);
  border: 1.5px solid var(--khaki-dark);
  color: var(--brown-deep);
  font-size: 13px;
  font-weight: 700;
  display: grid;
  place-items: center;
  box-shadow: 0 2px 6px rgba(52, 36, 22, 0.08);
  font-family: 'Cinzel', serif;
}

.step-content strong {
  display: block;
  font-size: 14px;
  color: var(--brown-deep);
  margin-bottom: 3px;
}

.step-content span {
  display: block;
  font-size: 12px;
  color: var(--ink-muted);
  line-height: 1.5;
}

.vintage-seal-quote {
  margin-top: 22px;
  padding: 16px;
  background: rgba(255, 253, 249, 0.9);
  border-left: 3px solid var(--khaki-dark);
  border-radius: 0 12px 12px 0;
  font-style: italic;
  font-size: 13px;
  line-height: 1.65;
  color: var(--brown);
  font-family: 'Playfair Display', serif;
  box-shadow: 0 2px 8px rgba(52, 36, 22, 0.04);
}

/* ==========================================================================
   Auth Panel (Register / Login Modal Container)
   ========================================================================== */
.auth-container {
  max-width: 500px;
  margin: 0 auto;
  width: 100%;
}

.auth-tabs {
  display: flex;
  gap: 6px;
  background: var(--paper-warm);
  padding: 5px;
  border-radius: 14px;
  margin: 18px 0 22px;
  border: 1.5px solid var(--border-line);
}

.auth-tab-btn {
  flex: 1;
  padding: 10px 14px;
  min-height: 42px;
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-muted);
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.auth-tab-btn.active {
  background: var(--brown);
  color: #fffaf2;
  box-shadow: 0 3px 10px rgba(52, 36, 22, 0.2);
}

/* ==========================================================================
   Inbox Panel (Received Letters)
   ========================================================================== */
.inbox-container {
  max-width: 820px;
  margin: 0 auto;
  width: 100%;
}

.inbox-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 24px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border-line);
}

.inbox-user-greeting h2 {
  font-size: 26px;
  color: var(--brown-deep);
  display: flex;
  align-items: center;
  gap: 10px;
}

.inbox-user-greeting p {
  font-size: 13px;
  color: var(--ink-muted);
  margin-top: 3px;
}

/* Share Link Box */
.share-card {
  background: var(--paper-warm);
  border: 1.5px dashed var(--khaki);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 28px;
}

.share-card-title {
  font-family: 'Cinzel', serif;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--brown);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.share-tagline {
  font-size: 13px;
  color: var(--ink-muted);
  margin-bottom: 14px;
  line-height: 1.5;
}

.share-link-row {
  display: flex;
  gap: 10px;
  align-items: center;
}

.share-link-input {
  flex: 1;
  background: #ffffff;
  border: 1.5px solid var(--border-line);
  border-radius: 11px;
  padding: 12px 14px;
  font-size: 14px;
  font-weight: 600;
  color: var(--brown-deep);
  font-family: 'Courier Prime', monospace;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}

.share-button-group {
  display: flex;
  gap: 8px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.btn-tango-icon {
  width: 18px;
  height: 18px;
  object-fit: contain;
  border-radius: 4px;
  display: inline-block;
  vertical-align: middle;
}

/* Share Preview Box & Story Card */
.share-preview-box {
  margin-top: 18px;
  background: var(--paper-warm);
  border: 1px dashed var(--border-line);
  border-radius: 12px;
  padding: 14px;
  box-shadow: inset 0 1px 3px rgba(52, 36, 22, 0.04);
}

.share-preview-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--brown-deep);
  letter-spacing: 0.3px;
}

.share-preview-title {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.share-preview-download-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--brown);
  background: #ffffff;
  padding: 4px 10px;
  border-radius: 8px;
  border: 1px solid var(--border-line);
  text-decoration: none;
  transition: all 0.15s ease;
}

.share-preview-download-btn:hover {
  background: var(--khaki-light);
  color: var(--brown-deep);
  border-color: var(--khaki-dark);
}

.share-preview-image-wrap {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  border-radius: 10px;
  overflow: hidden;
  border: 1.5px solid var(--border-line);
  background: #ffffff;
  box-shadow: 0 4px 12px rgba(52, 36, 22, 0.08);
}

.share-preview-img {
  width: 100%;
  height: auto;
  aspect-ratio: 1371 / 720;
  display: block;
  object-fit: cover;
}

.share-preview-tip {
  margin-top: 9px;
  font-size: 11.5px;
  color: var(--ink-muted);
  display: flex;
  align-items: center;
  gap: 6px;
  line-height: 1.4;
}

/* Message Count Header */
.messages-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.messages-count-badge {
  background: var(--khaki-light);
  color: var(--brown-deep);
  font-size: 12px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 20px;
  font-family: 'Cinzel', serif;
  border: 1px solid var(--khaki);
}

/* Vintage Postcard Message Card */
.message-card {
  background: #fffdf9;
  border: 1.5px solid var(--border-line);
  border-radius: 16px;
  padding: 22px;
  margin-bottom: 18px;
  box-shadow: var(--shadow-card);
  position: relative;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  background-image: linear-gradient(to bottom, rgba(236, 224, 205, 0.15) 0%, transparent 40px);
}

.message-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(52, 36, 22, 0.1);
}

.message-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 14px;
  gap: 12px;
}

.message-sender-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sender-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--khaki-light);
  border: 1.5px solid var(--khaki);
  display: grid;
  place-items: center;
  font-size: 14px;
  color: var(--brown);
  box-shadow: 0 2px 6px rgba(52, 36, 22, 0.08);
}

.sender-name-text {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--brown-deep);
}

.message-timestamp {
  font-size: 11px;
  color: var(--ink-muted);
  margin-top: 2px;
  font-family: 'Courier Prime', monospace;
}

.vintage-tag-seal {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--paper-warm);
  border: 1px dashed var(--khaki-dark);
  color: var(--brown-deep);
  font-family: 'Cinzel', serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.8px;
  padding: 3px 10px;
  border-radius: 6px;
  margin-bottom: 8px;
}

.vintage-tag-seal i {
  color: var(--stamp-red);
  font-size: 11px;
}

.message-postmark-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: 'Cinzel', serif;
  font-size: 9px;
  letter-spacing: 1.5px;
  color: var(--khaki-dark);
  border: 1px dashed var(--khaki);
  border-radius: 6px;
  padding: 3px 8px;
  background: rgba(245, 238, 223, 0.5);
}

.message-text {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 16px;
  line-height: 1.8;
  color: var(--ink);
  white-space: pre-wrap;
  word-break: break-word;
  padding: 6px 0 14px;
}

.message-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px dashed var(--border-line);
}

.action-btn-sm {
  font-size: 11.5px;
  padding: 6px 14px;
  min-height: 34px;
  border-radius: 8px;
  color: var(--ink-muted);
  background: var(--paper-warm);
  border: 1px solid var(--border-line);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s;
}

.action-btn-sm:hover {
  color: var(--brown-deep);
  background: var(--khaki-light);
  border-color: var(--khaki);
}

.action-btn-danger:hover {
  color: var(--stamp-red);
  background: var(--stamp-red-soft);
  border-color: #f5c8bf;
}

/* Empty Inbox State */
.empty-inbox {
  text-align: center;
  padding: 48px 20px;
  background: var(--paper-warm);
  border: 1.5px dashed var(--border-line);
  border-radius: 18px;
  margin: 10px 0;
}

.empty-envelope-icon {
  font-size: 42px;
  color: var(--khaki-dark);
  margin-bottom: 14px;
  animation: gentleFloat 3s ease-in-out infinite;
}

.empty-inbox h3 {
  font-size: 20px;
  color: var(--brown-deep);
  margin-bottom: 8px;
}

.empty-inbox p {
  font-size: 13.5px;
  color: var(--ink-muted);
  max-width: 380px;
  margin: 0 auto 20px;
  line-height: 1.6;
}

/* ==========================================================================
   Bottom CTA Section (Only visible on /username link pages)
   Compact, sleek, perfectly aligned
   ========================================================================== */
.bottom-cta-container {
  width: min(1040px, 100% - 32px);
  margin: 16px auto 26px;
}

.bottom-cta-card {
  background: linear-gradient(135deg, var(--paper-warm) 0%, #faedd9 100%);
  border: 1.5px solid var(--khaki);
  border-radius: 16px;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  box-shadow: 0 4px 16px rgba(52, 36, 22, 0.05);
}

.bottom-cta-content {
  display: flex;
  align-items: center;
  gap: 14px;
}

.bottom-cta-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--card-bg);
  border: 1px solid var(--khaki);
  display: grid;
  place-items: center;
  color: var(--brown);
  font-size: 18px;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(52, 36, 22, 0.06);
}

.bottom-cta-text h3 {
  font-size: 15px;
  color: var(--brown-deep);
  font-weight: 700;
  margin-bottom: 2px;
}

.bottom-cta-text p {
  font-size: 12px;
  color: var(--ink-muted);
  line-height: 1.4;
  max-width: 480px;
}

.btn-bottom-cta {
  padding: 9px 18px;
  min-height: 40px;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
  background: var(--brown);
  color: #fffaf2;
  border-radius: 10px;
  box-shadow: 0 3px 12px rgba(52, 36, 22, 0.2);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.btn-bottom-cta:hover {
  background: var(--brown-deep);
  transform: translateY(-1.5px);
  box-shadow: 0 5px 16px rgba(52, 36, 22, 0.3);
}

/* ==========================================================================
   Footer
   ========================================================================== */
footer {
  border-top: 1px solid var(--border-line);
  background: rgba(251, 247, 238, 0.98);
  padding: 24px 20px;
  text-align: center;
  margin-top: auto;
}

.footer-content {
  max-width: 1080px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--ink-muted);
  font-size: 12.5px;
}

.footer-stamp {
  font-family: 'Cinzel', serif;
  font-size: 11px;
  letter-spacing: 2px;
  color: var(--khaki-dark);
  margin-bottom: 2px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.footer-copyright {
  font-weight: 600;
  color: var(--brown);
  letter-spacing: 0.3px;
}

/* ==========================================================================
   Animations & Utilities
   ========================================================================== */
.spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.65s linear infinite;
  vertical-align: -2px;
}

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

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes gentleFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

.hidden {
  display: none !important;
}

/* ==========================================================================
   Vintage Modal Overlay & Dialog (User Not Found / Invalid ID)
   ========================================================================== */
.vintage-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(34, 26, 18, 0.68);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: fadeIn 0.2s ease-out;
}

.vintage-modal-box {
  background: var(--card-bg);
  border: 2px solid var(--border-dark);
  border-radius: 20px;
  max-width: 440px;
  width: 100%;
  padding: 30px 24px 24px;
  text-align: center;
  position: relative;
  box-shadow: 0 20px 50px rgba(52, 36, 22, 0.35), 0 2px 10px rgba(52, 36, 22, 0.1);
  background-image: 
    radial-gradient(circle at 10% 10%, rgba(203, 183, 146, 0.15) 0%, transparent 40%),
    radial-gradient(circle at 90% 90%, rgba(152, 128, 86, 0.12) 0%, transparent 50%);
  animation: popIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes popIn {
  from {
    opacity: 0;
    transform: scale(0.92) translateY(8px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.modal-seal-badge {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--stamp-red-soft);
  border: 2px dashed var(--stamp-red);
  color: var(--stamp-red);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  margin: 0 auto 16px;
  box-shadow: 0 4px 14px rgba(164, 56, 40, 0.18);
}

.vintage-modal-box h3 {
  font-size: 22px;
  color: var(--brown-deep);
  margin-bottom: 10px;
}

.modal-body-content {
  margin-bottom: 22px;
}

.modal-main-text {
  font-size: 15px;
  color: var(--brown-deep);
  margin-bottom: 8px;
  line-height: 1.5;
}

.modal-main-text strong {
  color: var(--stamp-red);
  font-family: 'Courier Prime', monospace;
  font-size: 16px;
  word-break: break-all;
}

.modal-subtext {
  font-size: 13px;
  color: var(--ink-muted);
  line-height: 1.5;
}

.modal-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

@media (min-width: 480px) {
  .modal-actions {
    flex-direction: row;
    justify-content: center;
  }
  .modal-actions .btn {
    flex: 1;
  }
}


/* ==========================================================================
   Responsive Breakpoints & Mobile Alignment
   ========================================================================== */
@media (max-width: 840px) {
  .app-layout {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .side-card {
    order: 2;
  }
}

@media (max-width: 640px) {
  main {
    width: 100%;
    padding: 6px 14px 40px;
  }

  .header-inner {
    padding: 10px 14px;
  }

  .nav-actions-center {
    gap: 8px;
  }

  .nav-actions-center .btn {
    flex: 1 1 0;
    padding: 8px 10px;
    font-size: 12.5px;
    min-height: 42px;
  }

  .brand-hero-center {
    margin: 28px auto 8px;
  }

  .brand-logo-main {
    height: 60px;
    max-width: 240px;
  }

  .hero {
    margin: 8px auto 22px;
    padding: 0 4px;
  }

  .hero h1 {
    font-size: 26px;
    line-height: 1.25;
  }

  .hero p {
    font-size: 14px;
    line-height: 1.65;
  }

  .panel {
    padding: 20px 16px;
    border-radius: 16px;
  }

  .panel-header {
    margin-bottom: 18px;
    padding-right: 48px;
  }

  .panel-header h2 {
    font-size: 22px;
  }

  .panel-header p {
    font-size: 13px;
  }

  .panel::after {
    font-size: 7px;
    padding: 3px 6px;
    top: 14px;
    right: 14px;
  }

  /* Ruled stationery padding adjust for mobile */
  textarea {
    font-size: 15px;
    padding: 10px 14px 10px 38px;
    background-image: 
      linear-gradient(90deg, transparent 28px, rgba(164, 56, 40, 0.2) 28px, rgba(164, 56, 40, 0.2) 29px, transparent 29px),
      repeating-linear-gradient(transparent, transparent 31px, rgba(203, 183, 146, 0.28) 31px, rgba(203, 183, 146, 0.28) 32px);
    line-height: 32px;
    min-height: 160px;
  }

  .mood-tags {
    gap: 6px;
  }

  .mood-chip {
    padding: 7px 11px;
    font-size: 11.5px;
    min-height: 36px;
  }

  .share-link-row {
    flex-direction: column;
    align-items: stretch;
  }

  .share-link-row .btn {
    width: 100%;
  }

  .share-button-group {
    flex-direction: column;
  }

  .share-button-group .btn {
    width: 100%;
  }

  .bottom-cta-container {
    width: 100%;
    padding: 0 14px;
    margin: 12px auto 20px;
  }

  .bottom-cta-card {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
    padding: 16px;
    gap: 14px;
  }

  .bottom-cta-content {
    flex-direction: column;
    text-align: center;
    gap: 10px;
  }

  .bottom-cta-icon {
    margin: 0 auto;
  }

  .btn-bottom-cta {
    width: 100%;
    justify-content: center;
    min-height: 44px;
  }

  .message-card {
    padding: 18px 14px;
  }

  .message-text {
    font-size: 15px;
  }
}
