:root {
  --bg:         #111118;
  --surface:    #18181f;
  --raised:     #1e1e2a;
  --card:       #222232;
  --border:     #2a2a3a;
  --bd-bright:  #383848;
  --accent:     #ff5f7e;
  --accent-dim: rgba(255,95,126,.15);
  --purple:     #a78bfa;
  --blue:       #60a5fa;
  --green:      #34d399;
  --amber:      #fbbf24;
  --pink:       #f472b6;
  --orange:     #fb923c;
  --t1:         #ffffff;
  --t2:         #8888aa;
  --t3:         #44445a;
  --nav-h:      72px;
  --header-h:   60px;
  --r-sm:       8px;
  --r-md:       14px;
  --r-lg:       20px;
  --r-xl:       28px;
  --sp-xs:      4px;
  --sp-sm:      8px;
  --sp-md:      16px;
  --sp-lg:      24px;
  --sp-xl:      40px;
  --ease:       cubic-bezier(.4,0,.2,1);
  --dur:        200ms;
}

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

* {
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

*::-webkit-scrollbar {
  width: 3px;
}
*::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 2px;
}
*::-webkit-scrollbar-track {
  background: transparent;
}

html, body {
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--t1);
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

#app {
  position: relative;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}

/* Screens */
.screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease);
}

.screen.active {
  opacity: 1;
  pointer-events: all;
  transform: none;
}

/* Loading screen */
#screen-loading {
  align-items: center;
  justify-content: center;
}

.loading-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.loading-icon {
  font-size: 3.5rem;
}

.loading-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--t1);
}

.loading-bar {
  width: 120px;
  height: 2px;
  background: var(--raised);
  border-radius: 1px;
  overflow: hidden;
}

.loading-bar-fill {
  width: 60%;
  height: 100%;
  background: var(--accent);
  border-radius: 1px;
  animation: pulse-width 1.2s ease-in-out infinite alternate;
}

/* Header */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  height: var(--header-h);
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.header-title {
  font-size: 1.15rem;
  font-weight: 700;
}

.header-date {
  font-size: .82rem;
  color: var(--t2);
}

/* Scroll area */
.screen-scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 16px 20px 100px;
}

/* Bottom Nav */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--nav-h);
  background: var(--surface);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: stretch;
  z-index: 100;
}

.nav-tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  transition: opacity var(--dur) var(--ease);
}

.nav-tab:active {
  opacity: .7;
}

.nav-icon {
  font-size: 1.3rem;
  line-height: 1;
}

.nav-label {
  font-size: .65rem;
  color: var(--t3);
  font-weight: 500;
  transition: color var(--dur) var(--ease);
}

.nav-tab.active .nav-label {
  color: var(--accent);
}

/* Icon button */
.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--raised);
  border: 1px solid var(--bd-bright);
  color: var(--t1);
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background var(--dur) var(--ease);
}

.icon-btn:hover {
  background: var(--card);
}

/* Section label */
.section-label {
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: 1.2px;
  color: var(--t3);
  text-transform: uppercase;
  padding: 8px 0 4px;
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.7);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 200;
  backdrop-filter: blur(4px);
}

.modal-card {
  background: var(--surface);
  border-radius: 24px 24px 0 0;
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 20px 0;
}

.modal-header h2 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--t1);
}

.modal-body {
  padding: 16px 20px 32px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-size: .78rem;
  font-weight: 600;
  color: var(--t2);
  letter-spacing: .5px;
  text-transform: uppercase;
}

.form-input {
  width: 100%;
  padding: 12px 14px;
  background: var(--raised);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  color: var(--t1);
  font-size: .95rem;
  font-family: inherit;
  outline: none;
  transition: border-color var(--dur) var(--ease);
}

.form-input:focus {
  border-color: var(--accent);
}

.form-input::placeholder {
  color: var(--t3);
}

.day-picker {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.day-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--raised);
  color: var(--t2);
  font-size: .82rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all var(--dur) var(--ease);
}

.day-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #111118;
}

.color-picker {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.color-swatch {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform var(--dur) var(--ease), border-color var(--dur) var(--ease);
}

.color-swatch.active {
  border-color: var(--t1);
  transform: scale(1.2);
}

/* Animations */
@keyframes pulse-width {
  from { width: 30%; }
  to   { width: 70%; }
}

@keyframes pop {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.15); }
  100% { transform: scale(1); }
}
