/* ── Krinkled shared styles ── */

/* 0. Type scale */
:root {
  --text-h1:      26px;
  --text-h2:      20px;
  --text-body:    16px;
  --text-caption: 14px;
  --text-label:   12px;
}

/* 1. Reset */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* 2. Base page */
html, body {
  width: 100%;
  min-height: 100%;
  background: #FFFFFF;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  font-family: 'IBM Plex Serif', Georgia, serif;
}

/* 3. App root container */
#root {
  width: 100%;
  min-height: 100vh;
  background: #FFFFFF;
  display: flex;
  flex-direction: column;
}
@media (min-width: 768px) { #root { max-width: 900px; margin: 0 auto; } }

/* 4. Scroll areas */
.scroll-area::-webkit-scrollbar { width: 0; }

/* 5. Two-column grid layout (desktop — screens 2 & 3) */
.two-col-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 32px;
  align-items: start;
}
.two-col-layout .col-left {
  min-width: 0;
}
.two-col-layout .col-right {
  min-width: 0;
  overflow-y: auto;
}
.two-col-layout .col-right::-webkit-scrollbar { width: 0; }

/* 6. Style drawer */
.drawer-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.3);
  z-index: 100;
  animation: fadeIn 0.2s ease;
}

/* Mobile: full-screen takeover */
.drawer-sheet {
  position: fixed;
  inset: 0;
  background: #FFFFFF;
  border-radius: 0;
  z-index: 101;
  animation: fadeIn 0.2s ease;
  overflow-y: auto;
  padding: 20px 24px 40px;
}

/* Desktop: centred modal */
@media (min-width: 768px) {
  .drawer-sheet {
    bottom: auto;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    max-width: 900px;
    border-radius: 24px;
    max-height: 90vh;
    animation: fadeIn 0.2s ease;
    padding: 28px 28px 36px;
  }
  .drawer-handle { display: none; }
}

/* Style cards: single column on mobile, row on desktop */
.drawer-cards {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
@media (min-width: 768px) {
  .drawer-cards { flex-direction: row; }
  .drawer-card  { flex: 1; min-width: 0; }
}

@keyframes fadeIn  { from { opacity: 0 } to { opacity: 1 } }
@keyframes slideUp { from { transform: translateY(100%) } to { transform: translateY(0) } }

/* 7. Bottom button bar */
.btn-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  box-sizing: border-box;
  background: linear-gradient(to bottom, transparent, #FFFFFF 30%);
  padding: 24px 0 32px;
}
.btn-bar-inner {
  display: flex;
  gap: 10px;
  max-width: 900px;
  margin: 0 auto;
  padding: 0 48px;
}
@media (max-width: 767px) {
  .btn-bar-inner { padding: 0 24px; }
}

/* 8. Page transitions */
@keyframes page-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}
body { animation: page-fade-in 300ms ease-out both; }

/* 8. Utilities */
.drag-ghost { opacity: 0.4; }
.mono { font-family: 'IBM Plex Mono', monospace; }
textarea { resize: none; }
textarea:focus, input:focus { outline: none; }

/* 8. Loading screens */
.loading-page {
  width: 100%;
  height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
  overflow: hidden;
}

.loading-image {
  max-width: 280px;
  width: auto;
  height: auto;
  display: block;
  animation: loading-wiggle 0.5s ease-in-out infinite;
}

.loading-text {
  font-family: 'IBM Plex Serif', Georgia, serif;
  font-weight: 400;
  font-size: 18px;
  color: #ffffff;
  white-space: nowrap;
}

@keyframes loading-wiggle {
  0%, 100% { transform: rotate(-3deg); }
  50%       { transform: rotate(3deg); }
}
