/* ==========================================================================
   1. VARIABLES, RESET & BASE STYLES
   ========================================================================== */
:root {
  --bg: #dddddd;
  --panel: #ffffff;
  --accent: #0f172a;
  --accent-hover: #1e293b;
  --muted: #64748b;
  --line: #e2e8f0;
  --input-bg: #ffffff;
  --green: #059669;
  --greenbg: #ecfdf5;
  --red: #dc2626;
  --redbg: #fef2f2;
  --amber: #d97706;
  --amberbg: #fffbe6;
  --blue: #2563eb;
  --bluebg: #eff6ff;
  --radius: 12px;
  --shadow: 0 4px 6px -1px #00000010, 0 2px 4px -2px #0000000a;
  --sheet-w: 794px;
  --sheet-h: 1123px;
}

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

html, body {
  height: 100vh;
  margin: 0;
  padding: 0;
  overflow: hidden;
}

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg);
  color: var(--accent);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* App Main Container */
.app {
  display: grid;
  grid-template-columns: 460px 1fr;
  height: 100vh;
  overflow: hidden;
}

/* Right Stage Container */
.stage {
  height: 100vh;
  padding: 36px 40px;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  overflow-y: auto;
  overflow-x: auto;
}

.sheet-wrap {
  position: relative;
}

.preview-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.preview-label::before {
  content: '';
  width: 7px;
  height: 7px;
  background: var(--green);
  border-radius: 50%;
  display: inline-block;
}

/* ==========================================================================
   RESPONSIVE & PRINT MEDIA QUERIES
   ========================================================================== */
@media (max-width: 900px) {
  html, body {
    height: auto;
    overflow: auto;
  }

  .app {
    display: block;
    height: auto;
    overflow: visible;
  }

  .editor {
    position: static;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--line);
  }

  .stage {
    height: auto;
    overflow: visible;
    padding: 20px 12px;
  }

  .sheet {
    transform: scale(0.9);
    transform-origin: top center;
  }
}

@media print {
  body {
    background: #ffffff !important;
  }

  .app {
    display: block !important;
  }

  .editor,
  .preview-label {
    display: none !important;
  }

  .stage {
    padding: 0 !important;
    overflow: visible !important;
  }

  .sheet-wrap {
    width: 100% !important;
  }

  .sheet {
    box-shadow: none !important;
    border-radius: 0 !important;
    width: 100% !important;
    min-height: 100vh !important;
    margin: 0 !important;
    padding: 0 !important;
  }
}