/* =========================================
   BuddyPlanner v2 — Base & Reset
   ========================================= */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');
@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard/dist/web/variable/pretendardvariable-dynamic-subset.css');

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

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

body {
  font-family: var(--font-sans);
  font-weight: var(--fw-normal);
  line-height: var(--lh-normal);
  color: var(--text-100);
  background: var(--bg-app);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  min-height: 100vh;
  min-height: 100dvh;
}

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

button {
  border: none; background: none; cursor: pointer;
  font-family: inherit; font-size: inherit; color: inherit;
  outline: none; -webkit-tap-highlight-color: transparent;
}

input, select, textarea {
  font-family: inherit; font-size: inherit; color: inherit;
  border: none; outline: none; background: none;
  -webkit-appearance: none; appearance: none;
}

ul, ol { list-style: none; }
img { max-width: 100%; display: block; }

/* ── App Shell ── */
#app {
  position: relative;
  width: 100%;
  max-width: var(--app-w);
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg-elevated);
  overflow: hidden;
  overflow: clip;   /* 코드나 입력창 포커스로 틀이 밀리지 않게 (지원 브라우저) */
}

/* Desktop frame */
@media (min-width: 431px) {
  body {
    background: #e2e8f0;
  }
  #app {
    box-shadow: 0 0 40px rgba(0,0,0,0.05), inset 0 0 0 1px var(--border-subtle);
    border-radius: 0;
    margin-top: 0;
    margin-bottom: 0;
    min-height: 100vh;
  }
}

/* ── Screen System ── */
.screen { display:none; flex-direction:column; min-height:100vh; min-height:100dvh; }
@media (min-width: 431px) {
  .screen { min-height: calc(100vh - 40px); }
}
.screen.active { display:flex; animation: screenIn var(--dur-normal) var(--ease-out); }

.screen-scroll {
  flex:1; overflow-y:auto; overflow-x:hidden;
  -webkit-overflow-scrolling: touch;
  padding-top: var(--header-h);
  padding-bottom: calc(var(--safe-bottom) + 140px); /* Space for sticky ad + extra margin */
}

/* ── Keyframes ── */
@keyframes screenIn {
  from { opacity:0; transform:translateY(6px); }
  to { opacity:1; transform:translateY(0); }
}
@keyframes slideUp {
  from { opacity:0; transform:translateY(20px); }
  to { opacity:1; transform:translateY(0); }
}
@keyframes fadeIn {
  from { opacity:0; }
  to { opacity:1; }
}
@keyframes scaleIn {
  from { opacity:0; transform:scale(0.95); }
  to { opacity:1; transform:scale(1); }
}
@keyframes pulse {
  0%,100% { opacity:1; }
  50% { opacity:0.4; }
}
@keyframes float {
  0%,100% { transform:translateY(0); }
  50% { transform:translateY(-6px); }
}
@keyframes glow {
  0%,100% { box-shadow: 0 0 10px rgba(34,201,135,0.2); }
  50% { box-shadow: 0 0 24px rgba(34,201,135,0.45); }
}
@keyframes shimmer {
  0% { background-position: -200% center; }
  100% { background-position: 200% center; }
}
@keyframes dotBounce {
  0%,80%,100% { transform:scale(0); }
  40% { transform:scale(1); }
}
@keyframes rippleEffect {
  to { transform: scale(4); opacity:0; }
}
@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* ── Utilities ── */
.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; }
.truncate { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }

::-webkit-scrollbar { width:3px; }
::-webkit-scrollbar-track { background:transparent; }
::-webkit-scrollbar-thumb { background: var(--border-subtle); border-radius: var(--r-full); }
::selection { background: rgba(34,201,135,0.25); color: var(--text-100); }


.hq-toast { background: #1e293b; border: 1px solid #334155; border-radius: 12px; padding: 14px; box-shadow: 0 10px 25px rgba(0,0,0,0.5); color: #f8fafc; font-size: 14px; display: flex; align-items: flex-start; gap: 10px; animation: toastSlideDown 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards; pointer-events: auto; } @keyframes toastSlideDown { from { opacity: 0; transform: translateY(-20px); } to { opacity: 1; transform: translateY(0); } } .hq-toast.urgent { border-color: #ef4444; box-shadow: 0 10px 25px rgba(239, 68, 68, 0.2); }
/* 홈 화면 좌우 분할 틀도 밀리지 않게 */
.split-view { overflow: clip !important; }

/* 아이폰에서 입력칸을 누르면 화면이 확대되는 것 방지 (16px 미만이면 확대됨) */
@media (pointer: coarse) {
  input:not([type=checkbox]):not([type=radio]):not([type=range]), select, textarea { font-size: 16px !important; }
}

/* 한글은 단어 중간에서 줄바꿈하지 않음 (예: '로드/톡이' → '로드톡이'). 아주 긴 글자만 예외로 끊음 */
body { word-break: keep-all; overflow-wrap: break-word; }
