@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,500;9..144,600&family=Manrope:wght@400;500;600;700&family=JetBrains+Mono:wght@500;700&display=swap');

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

.diary-root {
  --bg: #EAF0EE;
  --surface: #FFFFFF;
  --ink: #1F2A28;
  --ink-muted: #5C6B67;
  --line: #D9E2DE;
  --accent: #3E7C6B;
  --accent-soft: #3E7C6B22;
  --warn: #D98E3B;
  font-family: 'Manrope', sans-serif;
  color: var(--ink);
  background:
    linear-gradient(var(--bg), var(--bg)),
    repeating-linear-gradient(0deg, transparent, transparent 39px, #ffffff55 40px),
    repeating-linear-gradient(90deg, transparent, transparent 39px, #ffffff55 40px);
  min-height: 100vh;
  max-width: 480px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  position: relative;
}
.diary-center { align-items: center; justify-content: center; }
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid #ffffff; border-top-color: var(--accent); animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.onboard-card { background: var(--surface); border-radius: 24px; padding: 36px 28px; text-align: center; box-shadow: 0 10px 30px #1f2a2814; max-width: 320px; }
.onboard-icon { font-size: 40px; }
.onboard-title { font-family: 'Fraunces', serif; font-size: 26px; margin: 8px 0 4px; }
.onboard-sub { color: var(--ink-muted); font-size: 14px; margin-bottom: 20px; }
.onboard-btns { display: flex; flex-direction: column; gap: 10px; }
.onboard-btn { padding: 14px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--bg); font-size: 15px; font-weight: 600; color: var(--ink); cursor: pointer; }
.onboard-btn:hover { border-color: var(--accent); color: var(--accent); }
.onboard-note { font-size: 12px; color: var(--ink-muted); margin-top: 16px; }

.topbar { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px 10px; }
.topbar-title { font-family: 'Fraunces', serif; font-size: 20px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.topbar-emoji { font-size: 18px; }
.topbar-me { font-size: 12px; color: var(--ink-muted); background: var(--surface); padding: 5px 10px; border-radius: 999px; border: 1px solid var(--line); }

.content { flex: 1; padding: 6px 18px 90px; overflow-y: auto; }

.status-card { display: flex; align-items: center; gap: 12px; background: var(--surface); border-radius: 16px; padding: 14px 16px; box-shadow: 0 4px 14px #1f2a2810; margin-bottom: 18px; }
.status-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.status-active .status-dot { box-shadow: 0 0 0 4px #d98e3b33; }
.status-label { font-size: 12px; color: var(--ink-muted); }
.status-value { font-size: 15px; font-weight: 600; }

.fab-zone { display: flex; flex-direction: column; align-items: center; padding: 18px 0 24px; }
.fab-timer { font-family: 'JetBrains Mono', monospace; font-size: 32px; font-weight: 700; margin-bottom: 14px; color: var(--warn); }
.fab { width: 108px; height: 108px; border-radius: 50%; border: none; background: var(--accent); color: white; display: flex; align-items: center; justify-content: center; cursor: pointer; box-shadow: 0 10px 24px #3e7c6b55; transition: transform 0.15s ease; font-size: 32px; }
.fab:active { transform: scale(0.96); }
.fab-active { background: var(--warn); animation: pulse-ring 1.6s ease-out infinite; }
@keyframes pulse-ring {
  0% { box-shadow: 0 0 0 0 #d98e3b4d; }
  70% { box-shadow: 0 0 0 20px #d98e3b00; }
  100% { box-shadow: 0 0 0 0 #d98e3b00; }
}
.fab-caption { margin-top: 12px; font-size: 14px; font-weight: 600; color: var(--ink-muted); }
.cancel-link { margin-top: 8px; background: none; border: none; font-size: 12px; color: #B5562C; text-decoration: underline; cursor: pointer; }

.stat-row { display: flex; gap: 10px; margin-bottom: 20px; }
.stat-card { flex: 1; background: var(--surface); border-radius: 14px; padding: 12px 8px; text-align: center; box-shadow: 0 4px 14px #1f2a2810; }
.stat-num { font-family: 'JetBrains Mono', monospace; font-size: 18px; font-weight: 700; color: var(--accent); }
.stat-label { font-size: 11px; color: var(--ink-muted); margin-top: 2px; }

.section-title { font-size: 13px; font-weight: 700; color: var(--ink-muted); margin: 6px 0 10px; text-transform: uppercase; letter-spacing: 0.03em; }

.entry-row { display: flex; align-items: flex-start; gap: 10px; background: var(--surface); border-radius: 14px; padding: 12px; margin-bottom: 8px; box-shadow: 0 3px 10px #1f2a2808; }
.entry-emoji { width: 34px; height: 34px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 16px; flex-shrink: 0; }
.entry-main { flex: 1; min-width: 0; }
.entry-top { display: flex; justify-content: space-between; font-size: 13px; }
.entry-name { font-weight: 700; }
.entry-time { color: var(--ink-muted); }
.entry-sub { font-size: 12px; color: var(--ink-muted); margin-top: 2px; display: flex; gap: 6px; }
.dot-sep { opacity: 0.5; }
.entry-memo { font-size: 12px; margin-top: 6px; background: var(--bg); border-radius: 8px; padding: 6px 8px; color: var(--ink); }
.entry-del { background: none; border: none; color: #B5562C; cursor: pointer; padding: 4px; font-size: 14px; }

.cal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.cal-title { font-family: 'Fraunces', serif; font-size: 17px; font-weight: 600; }
.cal-nav { background: var(--surface); border: 1px solid var(--line); width: 30px; height: 30px; border-radius: 8px; font-size: 16px; cursor: pointer; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-weekdays { margin-bottom: 4px; }
.cal-weekday { text-align: center; font-size: 11px; color: var(--ink-muted); font-weight: 600; }
.cal-cell { aspect-ratio: 1; border: none; background: var(--surface); border-radius: 10px; display: flex; flex-direction: column; align-items: center; justify-content: center; cursor: pointer; font-size: 13px; gap: 3px; }
.cal-cell.empty { background: transparent; cursor: default; }
.cal-cell.today { border: 1.5px solid var(--accent); }
.cal-cell.selected { background: var(--accent); color: white; }
.cal-dots { display: flex; gap: 2px; }
.cal-dot { width: 5px; height: 5px; border-radius: 50%; }
.cal-detail { margin-top: 20px; }
.empty-note { color: var(--ink-muted); font-size: 13px; background: var(--surface); padding: 16px; border-radius: 12px; text-align: center; }

.settings-tab { padding-top: 6px; }
.settings-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.settings-input { flex: 1; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); font-size: 14px; }
.me-badge { font-size: 11px; background: var(--accent-soft); color: var(--accent); padding: 3px 8px; border-radius: 999px; font-weight: 700; }
.profile-switch { flex: 1; padding: 10px; border-radius: 10px; border: 1.5px solid var(--line); background: var(--surface); cursor: pointer; font-weight: 600; }
.profile-switch.active { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }

.push-card { background: var(--surface); border-radius: 16px; padding: 16px; box-shadow: 0 4px 14px #1f2a2810; }
.push-note { font-size: 12.5px; color: var(--ink-muted); line-height: 1.6; margin: 0; }
.test-push-btn { width: 100%; background: var(--warn); color: white; border: none; border-radius: 10px; padding: 12px; font-size: 13px; font-weight: 700; cursor: pointer; }

.tabbar { display: flex; background: var(--surface); border-top: 1px solid var(--line); position: sticky; bottom: 0; max-width: 480px; margin: 0 auto; width: 100%; }
.tab-btn { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 10px 0 12px; background: none; border: none; color: var(--ink-muted); font-size: 11px; cursor: pointer; }
.tab-btn.active { color: var(--accent); }

.toast { position: absolute; top: 14px; left: 50%; transform: translateX(-50%); background: var(--ink); color: white; padding: 10px 16px; border-radius: 999px; font-size: 13px; z-index: 50; box-shadow: 0 6px 20px #00000030; }

.modal-overlay { position: fixed; inset: 0; background: #1f2a2866; display: flex; align-items: flex-end; justify-content: center; z-index: 100; }
.modal-card { background: var(--surface); width: 100%; max-width: 480px; border-radius: 22px 22px 0 0; padding: 20px 20px 28px; }
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.modal-title { font-family: 'Fraunces', serif; font-size: 19px; font-weight: 600; }
.modal-close { background: var(--bg); border: none; border-radius: 8px; width: 30px; height: 30px; cursor: pointer; }
.modal-duration { display: flex; align-items: center; gap: 6px; color: var(--warn); font-weight: 700; font-family: 'JetBrains Mono', monospace; margin-bottom: 16px; }
.modal-label { font-size: 12px; font-weight: 700; color: var(--ink-muted); margin-bottom: 8px; text-transform: uppercase; letter-spacing: 0.03em; }
.cond-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 18px; }
.cond-chip { padding: 10px 4px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--bg); font-size: 12.5px; font-weight: 600; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 4px; }
.modal-textarea { width: 100%; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; font-size: 13px; font-family: inherit; resize: none; margin-bottom: 16px; box-sizing: border-box; }
.modal-confirm { width: 100%; background: var(--accent); color: white; border: none; padding: 14px; border-radius: 14px; font-size: 15px; font-weight: 700; display: flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer; }
