/* Constellation Writer — Responsive (Intercom breakpoints: 425, 640, 768, 896, 1024) */

/* Wide desktop: >= 1440px */
@media (min-width: 1440px) {
  :root {
    --left-panel-width: 320px;
    --right-panel-width: 380px;
  }
}

/* Standard desktop: 1024-1439px */
@media (max-width: 1439px) and (min-width: 1024px) {
  .right-panel { width: 300px; }
}

/* Tablet: < 1024px — overlay panels */
@media (max-width: 1023px) {
  .workspace { position: relative; }
  .left-panel {
    position: absolute; left: 0; top: 0; bottom: 0;
    z-index: 50; box-shadow: var(--shadow-lg);
    width: 280px;
  }
  .left-panel.collapsed { width: 0; overflow: hidden; }
  .right-panel {
    position: absolute; right: 0; top: 0; bottom: 0;
    z-index: 50; box-shadow: var(--shadow-lg);
    width: 320px;
  }
  .right-panel.collapsed { width: 0; overflow: hidden; }
}

/* Tablet portrait: < 768px */
@media (max-width: 767px) {
  /* Welcome screen */
  .welcome-header h1 { font-size: 28px; letter-spacing: -0.8px; }
  .welcome-header p { font-size: 14px; }
  .project-grid {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
    padding: 16px !important;
  }
  .project-card, .new-project-card {
    min-height: 100px !important;
  }

  /* New project form — full responsive */
  .new-project-content {
    padding: 16px !important;
    max-width: 100% !important;
  }
  .new-project-heading {
    font-size: 20px !important;
    letter-spacing: -0.4px;
  }
  .type-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 10px !important;
  }
  .type-card {
    padding: 14px 10px !important;
  }
  .type-icon { font-size: 24px !important; }
  .type-name { font-size: 13px !important; }
  .type-desc { font-size: 11px !important; }
  .form-group { margin-bottom: 12px !important; }
  .form-label { font-size: 12px !important; }
  .form-input, .form-textarea {
    font-size: 14px !important;
    padding: 10px 12px !important;
  }
  .form-footer {
    flex-direction: column !important;
    gap: 8px !important;
  }
  .form-footer .btn { width: 100%; justify-content: center; }

  /* Workspace — panels hidden by default */
  .left-panel { display: none; }
  .right-panel { display: none; }
  .left-panel.mobile-open { display: flex; width: 100%; }
  .right-panel.mobile-open { display: flex; width: 100%; }

  /* Topbar compact */
  .topbar { padding: 0 8px; }
  .topbar-title { font-size: 14px; }
}

/* Mobile toggle buttons (hidden on desktop) */
.mobile-toggle { display: none; }
@media (max-width: 767px) {
  .mobile-toggle { display: inline-flex !important; font-size: 18px; }
}

/* Small phone: < 425px */
@media (max-width: 424px) {
  .type-grid {
    grid-template-columns: 1fr !important;
  }
  .welcome-header h1 { font-size: 24px; }
  .topbar { font-size: 12px; }
  .btn { padding: 6px 12px; font-size: 13px; }
}
