:root {
  --bg: #f3f8fc;
  --surface: #ffffff;
  --ink: #14233a;
  --muted: #5a6d84;
  --line: rgba(20, 35, 58, 0.1);
  --sky: #5eb3e8;
  --sky-deep: #2f7fb8;
  --ok: #2f7a58;
  --warn: #a86b12;
  --danger: #b42318;
  --serif: "Fraunces", Georgia, serif;
  --sans: "Outfit", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --tab-h: calc(3.4rem + env(safe-area-inset-bottom));
  --top-pad: env(safe-area-inset-top);
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  overscroll-behavior: none;
}

body {
  min-height: 100dvh;
}

button,
input,
textarea,
select {
  font: inherit;
}

.app {
  min-height: 100dvh;
  padding: calc(0.75rem + var(--top-pad)) 1rem calc(var(--tab-h) + 0.75rem);
  max-width: 480px;
  margin: 0 auto;
}

.screen-header {
  margin-bottom: 1rem;
}

.screen-kicker {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 500;
}

.screen-header h1 {
  margin: 0.15rem 0 0;
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.85rem;
  letter-spacing: -0.02em;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 1rem;
  padding: 1rem;
  margin-bottom: 0.75rem;
}

.card h2,
.card h3 {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
}

.muted {
  color: var(--muted);
  font-size: 0.9rem;
}

.timer-card {
  background: linear-gradient(160deg, #dff1fb, #f7fbfe);
  border: 1px solid var(--line);
  border-radius: 1.15rem;
  padding: 1.1rem;
  margin-bottom: 1rem;
}

.timer-readout {
  display: block;
  margin: 0.35rem 0 0.85rem;
  font-variant-numeric: tabular-nums;
  font-size: 2.4rem;
  letter-spacing: 0.04em;
  font-weight: 600;
}

.row {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.row > * {
  flex: 1;
}

.btn {
  border: 0;
  border-radius: 999px;
  padding: 0.75rem 0.9rem;
  font-weight: 600;
  cursor: pointer;
  background: rgba(20, 35, 58, 0.07);
  color: var(--ink);
}

.btn:active {
  transform: scale(0.98);
}

.btn.primary {
  background: linear-gradient(135deg, var(--sky), var(--sky-deep));
  color: #041018;
}

.btn.danger {
  background: rgba(180, 35, 24, 0.1);
  color: var(--danger);
}

.btn.block {
  width: 100%;
  margin-top: 0.5rem;
}

.quick-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.quick-grid button {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 0.9rem;
  padding: 0.85rem 0.4rem;
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
}

.section-label {
  margin: 0.25rem 0 0.55rem;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}

.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.55rem;
}

.timeline li {
  display: grid;
  grid-template-columns: 3.5rem 1fr auto;
  gap: 0.65rem;
  align-items: start;
  padding: 0.8rem 0.85rem;
  border-radius: 0.95rem;
  background: var(--surface);
  border: 1px solid var(--line);
}

.timeline time {
  font-size: 0.78rem;
  color: var(--muted);
  padding-top: 0.15rem;
}

.timeline b {
  display: block;
}

.timeline small {
  color: var(--muted);
}

.badge {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.badge.requested {
  background: rgba(47, 127, 184, 0.12);
  color: var(--sky-deep);
}

.badge.approved {
  background: rgba(47, 122, 88, 0.12);
  color: var(--ok);
}

.badge.denied {
  background: rgba(180, 35, 24, 0.1);
  color: var(--danger);
}

.field {
  display: grid;
  gap: 0.35rem;
  margin-bottom: 0.75rem;
}

.field label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
}

.field input,
.field textarea,
.field select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 0.85rem;
  padding: 0.75rem 0.85rem;
  background: var(--surface);
  color: var(--ink);
}

.cal-day {
  display: grid;
  grid-template-columns: 3.8rem 1fr;
  gap: 0.75rem;
  padding: 0.9rem 1rem;
  border-radius: 1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  margin-bottom: 0.6rem;
}

.cal-day strong {
  font-size: 0.95rem;
}

.edu-card {
  cursor: pointer;
}

.edu-tag {
  margin: 0 0 0.25rem;
  color: var(--sky-deep);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.profile-hero {
  display: flex;
  gap: 0.85rem;
  align-items: center;
  margin-bottom: 1rem;
}

.avatar {
  width: 56px;
  height: 56px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, var(--sky), var(--sky-deep));
  color: #041018;
  font-weight: 700;
  font-size: 1.1rem;
}

.list-rows {
  border: 1px solid var(--line);
  border-radius: 1rem;
  overflow: hidden;
  background: var(--surface);
  margin-bottom: 1rem;
}

.list-rows div {
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
}

.list-rows div:last-child {
  border-bottom: 0;
}

.brand-foot {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  margin-top: 0.5rem;
  padding: 0.9rem;
  border-radius: 1rem;
  background: linear-gradient(160deg, #dff1fb, #f7fbfe);
  border: 1px solid var(--line);
}

.brand-foot img {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  object-fit: cover;
}

.brand-foot p {
  margin: 0.15rem 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.brand-foot a {
  color: var(--sky-deep);
}

.tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.1rem;
  padding: 0.4rem 0.35rem calc(0.45rem + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, 0.92);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  max-width: 480px;
  margin: 0 auto;
  z-index: 20;
}

.tab {
  border: 0;
  background: transparent;
  color: var(--muted);
  display: grid;
  justify-items: center;
  gap: 0.12rem;
  padding: 0.35rem 0.15rem;
  font-size: 0.68rem;
  font-weight: 500;
  cursor: pointer;
}

.tab .glyph {
  font-size: 1.05rem;
  line-height: 1;
}

.tab.is-active {
  color: var(--sky-deep);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--tab-h) + 0.75rem);
  transform: translateX(-50%);
  background: var(--ink);
  color: #fff;
  padding: 0.65rem 1rem;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 500;
  z-index: 30;
  max-width: calc(100% - 2rem);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.2);
}

.sheet {
  position: fixed;
  inset: 0;
  background: rgba(10, 18, 28, 0.45);
  z-index: 40;
  display: grid;
  align-items: end;
}

.sheet-panel {
  background: var(--bg);
  border-radius: 1.25rem 1.25rem 0 0;
  padding: 1.1rem 1rem calc(1.25rem + env(safe-area-inset-bottom));
  max-width: 480px;
  width: 100%;
  margin: 0 auto;
  animation: up 0.22s ease;
}

.sheet-panel h2 {
  margin: 0 0 0.85rem;
  font-family: var(--serif);
  font-size: 1.35rem;
}

@keyframes up {
  from {
    transform: translateY(24px);
    opacity: 0.6;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.empty {
  text-align: center;
  padding: 1.5rem 1rem;
  color: var(--muted);
}

@media (min-width: 520px) {
  body {
    background: #0c1a2c;
  }

  .app,
  .tabbar {
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.06);
  }

  .app {
    min-height: 100dvh;
    background: var(--bg);
  }

  .tabbar {
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    width: 480px;
  }
}
