:root {
  --ink: #111318;
  --muted: #687080;
  --soft: #f6f7fb;
  --line: #e4e8f1;
  --white: #ffffff;
  --blue: #00cfff;
  --royal: #3a6dff;
  --magenta: #ff00a8;
  --orange: #ff4d2e;
  --yellow: #ffc400;
  --lime: #9cff00;
  --brand-primary: #00cfff;
  --brand-secondary: #3a6dff;
  --brand-accent: #ff00a8;
  --brand-warm: #ff4d2e;
  --brand-bright: #ffc400;
  --brand-glow-primary: rgba(0,207,255,0.16);
  --brand-glow-secondary: rgba(58,109,255,0.1);
  --brand-glow-accent: rgba(255,0,168,0.12);
  --gradient: linear-gradient(90deg, var(--brand-primary), var(--brand-secondary) 22%, var(--brand-accent) 46%, var(--brand-warm) 66%, var(--brand-bright) 100%);
  --gradient-loop: linear-gradient(90deg, var(--brand-primary), var(--brand-secondary), var(--brand-accent), var(--brand-warm), var(--brand-bright), var(--brand-primary));
  --shadow: 0 22px 62px rgba(17, 19, 24, 0.12);
  --shadow-soft: 0 12px 38px rgba(17, 19, 24, 0.08);
}

* { box-sizing: border-box; }

html {
  min-height: 100%;
  background: #f7f8fb;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 14% 0%, var(--brand-glow-primary), transparent 32rem),
    radial-gradient(circle at 86% 7%, var(--brand-glow-accent), transparent 30rem),
    linear-gradient(125deg, transparent 0%, var(--brand-glow-secondary) 28%, transparent 58%, var(--brand-glow-accent) 100%),
    linear-gradient(180deg, #fff 0%, #f6f7fb 56%, #fff 100%);
  background-size: 130% 130%, 140% 140%, 240% 240%, auto;
  background-position: 0% 0%, 100% 0%, 0% 50%, center;
  animation: ambientGradient 90s ease-in-out infinite;
}

@keyframes gradientFlow {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@keyframes ambientGradient {
  0% { background-position: 0% 0%, 100% 0%, 0% 50%, center; }
  50% { background-position: 12% 8%, 88% 12%, 100% 50%, center; }
  100% { background-position: 0% 0%, 100% 0%, 0% 50%, center; }
}

button, input, textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  width: min(100%, 1160px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 18px 18px 104px;
}

.topbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 22px;
  padding: 10px 4px 22px;
}

.brand-main {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-logo-wrap {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 54px;
  height: 54px;
  flex: 0 0 auto;
}

.brand-logo-wrap::before,
.brand-logo-wrap::after {
  content: "";
  position: absolute;
  z-index: 2;
  width: 5px;
  height: 5px;
  border-radius: 1px;
  background: #fff;
  transform: rotate(45deg) scale(0.72);
  filter: drop-shadow(0 1px 4px rgba(255,255,255,0.82));
  animation: logoSparkle 3.8s ease-in-out infinite;
  pointer-events: none;
}

.brand-logo-wrap::before {
  top: 9px;
  right: 5px;
  box-shadow: -39px 8px 0 rgba(255,255,255,0.88);
}

.brand-logo-wrap::after {
  right: 11px;
  bottom: 9px;
  width: 4px;
  height: 4px;
  animation-delay: 1.3s;
}

.brand-mark,
.welcome-logo {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  object-fit: cover;
  background: transparent;
  box-shadow: none;
}

@keyframes logoSparkle {
  0%, 100% {
    opacity: 0.42;
    transform: rotate(45deg) scale(0.72);
  }
  44% {
    opacity: 1;
    transform: rotate(45deg) scale(1.1);
  }
}

.brand-name {
  margin: 0;
  font-size: 28px;
  font-weight: 900;
  line-height: 0.98;
  letter-spacing: 0;
}

.brand-sub {
  margin: 2px 0 0;
  font-size: 11px;
  color: var(--muted);
  font-weight: 700;
}

.powered-line {
  display: flex;
  align-items: center;
  justify-self: end;
  gap: 10px;
  color: #2b3442;
  font-size: 14px;
  font-weight: 850;
  line-height: 1;
  white-space: nowrap;
}

.powered-line strong {
  font-weight: 950;
}

.powered-line img {
  width: 32px;
  height: auto;
  display: block;
  filter: drop-shadow(0 8px 14px rgba(17,19,24,0.12));
}

.phone-frame {
  display: block;
}

.view {
  display: none;
  animation: rise 0.22s ease;
}

.view.active {
  display: block;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.hero-panel {
  display: block;
}

.event-card,
.status-card,
.next-card,
.timeline-section,
.routine-card,
.place-card,
.class-card,
.import-hero,
.import-panel,
.review-panel,
.bag-card {
  border: 1px solid rgba(228,232,241,0.9);
  background: rgba(255,255,255,0.92);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.next-card:before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 5px;
  background: var(--gradient-loop);
  background-size: 400% 400%;
  animation: gradientFlow 30s ease infinite;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1, h2, h3, p {
  margin-top: 0;
}

h1 {
  margin-bottom: 14px;
  max-width: 760px;
  font-size: clamp(36px, 5.4vw, 64px);
  line-height: 0.98;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 8px;
  font-size: clamp(24px, 2.4vw, 34px);
  line-height: 1.02;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 8px;
  font-size: 18px;
  letter-spacing: 0;
}

.helper-copy,
.disclaimer {
  color: var(--muted);
  line-height: 1.5;
}

.event-card,
.status-card,
.timeline-section,
.import-hero,
.import-panel,
.review-panel {
  border-radius: 28px;
  padding: 22px;
}

.event-card,
.status-card {
  box-shadow: var(--shadow-soft);
}

.event-card {
  display: grid;
  gap: 16px;
}

.type-segmented {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(246,247,251,0.92);
}

.type-segmented button {
  min-height: 38px;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  line-height: 1.05;
  transition: transform 0.18s ease, color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.type-segmented button.active {
  color: #fff;
  background: var(--gradient-loop);
  background-size: 400% 400%;
  animation: gradientFlow 28s ease infinite;
  box-shadow: 0 10px 24px rgba(17,19,24,0.12);
}

label {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.clean-input,
textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 11px 13px;
  color: var(--ink);
  background: #fff;
  outline: none;
  transition: box-shadow 0.18s ease, border-color 0.18s ease;
}

.clean-input::placeholder,
textarea::placeholder {
  color: #9aa3b2;
  opacity: 1;
}

.clean-input:focus,
textarea:focus,
.custom-delay input:focus {
  border-color: rgba(47,128,255,0.72);
  box-shadow: 0 0 0 4px rgba(47,128,255,0.12);
}

.event-picker {
  position: relative;
}

.event-picker .clean-input {
  padding-right: 46px;
}

.event-picker-toggle {
  position: absolute;
  top: 50%;
  right: 8px;
  width: 32px;
  height: 32px;
  transform: translateY(-50%);
  border: 0;
  border-radius: 50%;
  background: rgba(17,19,24,0.05);
  color: var(--ink);
  font-size: 16px;
  font-weight: 950;
}

.event-picker-toggle:hover {
  background: var(--gradient-loop);
  background-size: 400% 400%;
  animation: gradientFlow 28s ease infinite;
  color: #fff;
}

.event-menu {
  position: absolute;
  inset: calc(100% + 8px) 0 auto;
  z-index: 20;
  display: grid;
  gap: 6px;
  max-height: 268px;
  overflow: auto;
  padding: 8px;
  border: 1px solid rgba(228,232,241,0.96);
  border-radius: 22px;
  background: rgba(255,255,255,0.94);
  box-shadow: 0 24px 62px rgba(17,19,24,0.16);
  backdrop-filter: blur(18px);
}

.event-menu[hidden] {
  display: none;
}

.event-option {
  min-height: 40px;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0 14px;
  background: transparent;
  color: var(--ink);
  font-weight: 850;
  text-align: left;
}

.event-option:hover,
.event-option.active {
  border-color: transparent;
  color: #fff;
  background: var(--gradient-loop);
  background-size: 400% 400%;
  animation: gradientFlow 30s ease infinite;
}

.event-option-empty {
  padding: 10px 14px;
  color: var(--muted);
  font-weight: 800;
}

.event-name {
  min-height: 58px;
  font-size: 25px;
  font-weight: 900;
  letter-spacing: 0;
}

.event-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.date-range {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 7px;
}

.date-range span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.date-range input {
  min-width: 0;
  padding-inline: 9px;
  font-size: 13px;
  font-weight: 750;
}

.date-summary {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.status-card {
  margin-top: 14px;
  padding: 16px 18px;
}

.status-heading,
.section-heading,
.dialog-heading,
.card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
}

.status-heading h2,
.section-heading h2 {
  margin-bottom: 0;
}

.delay-controls {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr)) minmax(88px, 0.8fr);
  gap: 7px;
  margin: 10px 0 9px;
}

.delay-controls button,
.import-tabs button,
.small-button,
.primary-mini,
.icon-button {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  border-radius: 999px;
  font-weight: 850;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.delay-controls button,
.import-tabs button {
  min-height: 36px;
}

.delay-controls button:hover,
.import-tabs button:hover,
.small-button:hover,
.primary-mini:hover,
.icon-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(17,19,24,0.08);
}

.delay-controls button.active,
.import-tabs button.active {
  border-color: transparent;
  color: #fff;
  background: var(--gradient-loop);
  background-size: 400% 400%;
  animation: gradientFlow 26s ease infinite;
}

.custom-delay {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  margin: 0;
  padding: 4px 6px 4px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
}

.custom-delay span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: none;
  letter-spacing: 0;
}

.custom-delay input {
  width: 36px;
  border: 0;
  outline: none;
  text-align: right;
  font-weight: 900;
}

.disclaimer {
  margin: 0;
  font-size: 11px;
  line-height: 1.35;
}

.next-card {
  position: relative;
  overflow: hidden;
  margin-top: 16px;
  border-radius: 30px;
  padding: 26px;
  border-color: rgba(17,19,24,0.08);
  background:
    linear-gradient(180deg, rgba(17,19,24,0.98), rgba(29,31,38,0.96)),
    var(--gradient-loop);
  background-size: auto, 400% 400%;
  animation: gradientFlow 34s ease infinite;
  color: #fff;
  box-shadow: 0 30px 84px rgba(17,19,24,0.22);
}

.next-card .eyebrow,
.next-card .next-meta,
.next-card .time-stack span {
  color: rgba(255,255,255,0.68);
}

.next-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: end;
}

.next-number {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  margin-bottom: 12px;
  padding: 0 12px;
  border-radius: 999px;
  color: #111318;
  background: #fff;
  font-size: 13px;
  font-weight: 900;
}

.next-title {
  margin: 0 0 6px;
  font-size: clamp(30px, 5vw, 52px);
  line-height: 0.95;
  letter-spacing: 0;
}

.next-meta {
  margin: 0;
  color: var(--muted);
  font-weight: 750;
}

.time-stack {
  min-width: 138px;
  padding: 14px;
  border-radius: 22px;
  background: rgba(255,255,255,0.09);
  border: 1px solid rgba(255,255,255,0.12);
  text-align: right;
}

.time-stack strong {
  display: block;
  font-size: 28px;
  letter-spacing: 0;
}

.time-stack span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.missing-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.missing-pill,
.ready-pill,
.count-pill,
.save-state {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border-radius: 999px;
  padding: 0 11px;
  font-size: 12px;
  font-weight: 850;
}

.missing-pill {
  color: #fff;
  background: rgba(255,255,255,0.13);
  border: 1px solid rgba(255,255,255,0.12);
}

.ready-pill {
  color: #111318;
  background: #9cff00;
}

.count-pill,
.save-state {
  color: var(--muted);
  background: #fff;
  border: 1px solid var(--line);
}

.quick-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  justify-items: center;
  gap: 8px;
  margin-top: 14px;
  padding: 8px 6px 2px;
}

.action-tile {
  width: fit-content;
  max-width: 112px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  padding: 0 6px;
  font-weight: 900;
  text-align: center;
  transition: transform 0.18s ease;
}

.action-tile:hover {
  transform: translateY(-1px);
}

.action-tile > span:last-child {
  display: block;
  max-width: 100px;
  color: #303744;
  font-size: 12px;
  line-height: 1.05;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tile-icon {
  width: 62px;
  height: 62px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--gradient-loop);
  background-size: 400% 400%;
  animation: gradientFlow 28s ease infinite;
  color: #fff;
  box-shadow: 0 18px 34px rgba(17,19,24,0.15);
  font-size: 20px;
  font-weight: 950;
  transition: transform 0.18s ease, filter 0.18s ease, opacity 0.18s ease;
}

button.tile-icon {
  border: 0;
  cursor: pointer;
}

button.tile-icon:disabled {
  cursor: wait;
  opacity: 0.72;
}

.export-download-icon {
  font-size: 28px;
  line-height: 1;
}

.export-option:hover .export-download-icon,
.export-download-icon:hover {
  filter: brightness(1.05);
  transform: translateY(-1px);
}

.timeline-section {
  margin-top: 16px;
}

.timeline-list,
.routine-list,
.results-list,
.places-list,
.class-list,
.bag-summary,
#importReviewList,
.source-list {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.timeline-item,
.review-item {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #fff;
}

.result-card {
  padding: 18px;
  border: 1px solid rgba(228,232,241,0.9);
  border-radius: 24px;
  background: rgba(255,255,255,0.94);
  box-shadow: var(--shadow-soft);
}

.result-card h3 {
  margin-bottom: 6px;
}

.result-card .card-sub {
  margin-bottom: 0;
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 16px 0 12px;
}

.result-grid.single {
  grid-template-columns: 1fr;
}

.scholarship-card {
  background:
    linear-gradient(120deg, rgba(255,255,255,0.96), rgba(255,255,255,0.88)),
    linear-gradient(90deg, var(--brand-glow-primary), var(--brand-glow-accent));
}

.timeline-item {
  position: relative;
  overflow: hidden;
  border-left-width: 6px;
}

.timeline-call {
  border-left-color: #3a6dff;
  background: linear-gradient(90deg, rgba(58,109,255,0.08), #fff 34%);
}

.timeline-routine {
  border-left-color: #ff00a8;
  background: linear-gradient(90deg, rgba(255,0,168,0.08), #fff 34%);
}

.timeline-class {
  border-left-color: #00cfff;
  background: linear-gradient(90deg, rgba(0,207,255,0.09), #fff 34%);
}

.timeline-event {
  border-left-color: #ffc400;
  background: linear-gradient(90deg, rgba(255,196,0,0.15), #fff 34%);
}

.timeline-timebox {
  min-width: 0;
}

.timeline-time {
  font-weight: 950;
  letter-spacing: 0;
}

.timeline-original {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.timeline-title {
  margin: 0 0 4px;
  font-weight: 900;
  letter-spacing: 0;
}

.timeline-type {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  margin-bottom: 7px;
  padding: 0 8px;
  border-radius: 999px;
  color: #111318;
  background: rgba(17,19,24,0.06);
  font-size: 10px;
  font-weight: 950;
  text-transform: uppercase;
}

.timeline-call .timeline-type {
  color: #1d4ed8;
  background: rgba(58,109,255,0.12);
}

.timeline-routine .timeline-type {
  color: #be007f;
  background: rgba(255,0,168,0.11);
}

.timeline-class .timeline-type {
  color: #0369a1;
  background: rgba(0,207,255,0.13);
}

.timeline-event .timeline-type {
  color: #92400e;
  background: rgba(255,196,0,0.2);
}

.timeline-sub {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.routine-card,
.place-card,
.class-card,
.bag-card {
  border-radius: 24px;
  padding: 18px;
}

.routine-card {
  display: grid;
  gap: 14px;
}

.routine-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
}

.routine-title {
  margin: 0 0 4px;
  font-size: 22px;
  font-weight: 950;
  letter-spacing: 0;
}

.routine-sub,
.card-sub {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.routine-number {
  min-width: 64px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  color: #fff;
  background: #111318;
  font-weight: 950;
}

.routine-details {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.detail-chip {
  min-height: 56px;
  border-radius: 18px;
  padding: 10px;
  background: var(--soft);
}

.detail-chip span {
  display: block;
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.detail-chip strong {
  display: block;
  overflow-wrap: anywhere;
  font-size: 13px;
}

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

.check-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 10px;
  background: #fff;
  color: var(--ink);
  font-size: 12px;
  font-weight: 850;
}

.check-pill input {
  width: 16px;
  height: 16px;
  accent-color: #111318;
}

.check-pill.done {
  color: var(--muted);
  text-decoration: line-through;
  background: #f8fafc;
}

.card-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.text-button {
  border: 0;
  background: transparent;
  color: var(--royal);
  font-weight: 900;
}

.sticky-section {
  position: sticky;
  top: 0;
  z-index: 4;
  align-items: center;
  margin: 0 0 14px;
  padding: 10px 12px;
  border: 1px solid rgba(228,232,241,0.88);
  border-radius: 999px;
  background: rgba(255,255,255,0.82);
  box-shadow: 0 14px 34px rgba(17,19,24,0.06);
  backdrop-filter: blur(18px);
}

.sticky-section h2 {
  font-size: 23px;
  line-height: 1;
}

.sub-section {
  margin-top: 28px;
}

.primary-mini,
.small-button,
.icon-button {
  min-height: 38px;
  padding: 0 14px;
}

.primary-mini {
  border-color: transparent;
  color: #fff;
  background: #111318;
}

.result-add-button {
  width: 38px;
  padding: 0;
  font-size: 20px;
  line-height: 1;
}

.primary-button {
  background-size: 400% 400%;
  animation: gradientFlow 28s ease infinite;
  box-shadow: 0 14px 34px rgba(58,109,255,0.16);
}

.icon-button {
  width: 40px;
  padding: 0;
  font-size: 20px;
}

.import-hero {
  margin-bottom: 14px;
}

.import-hero p:last-child {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.5;
}

.import-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 14px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255,255,255,0.72);
}

.import-panel {
  display: none;
}

.import-panel.active {
  display: grid;
  gap: 12px;
}

textarea {
  min-height: 190px;
  resize: vertical;
  line-height: 1.5;
}

.primary-button,
.secondary-button,
.danger-button {
  min-height: 48px;
  border-radius: 999px;
  padding: 0 18px;
  font-weight: 900;
  border: 1px solid transparent;
}

.primary-button {
  color: #fff;
  background: var(--gradient-loop);
}

.dialog-actions .primary-button {
  min-width: 112px;
  background: var(--gradient-loop);
  background-size: 400% 400%;
  animation: gradientFlow 32s ease infinite;
  box-shadow: 0 16px 34px var(--brand-glow-accent), 0 8px 18px rgba(17,19,24,0.12);
}

.secondary-button {
  color: var(--ink);
  background: #fff;
  border-color: var(--line);
}

.danger-button {
  color: #b42318;
  background: #fff5f5;
  border-color: #ffd1d1;
}

.file-input {
  width: 100%;
  padding: 14px;
  border: 1px dashed #cbd5e1;
  border-radius: 20px;
  background: #fff;
}

.helper-copy {
  margin: 0;
  font-size: 13px;
}

.source-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  font-size: 13px;
  font-weight: 800;
}

.source-chip span {
  min-width: 0;
  flex: 1;
}

.source-chip small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  white-space: nowrap;
}

.source-chip.processable {
  border-color: rgba(58,109,255,0.22);
  background: linear-gradient(90deg, var(--brand-glow-primary), rgba(255,255,255,0.94) 46%);
}

.review-panel {
  margin-top: 14px;
}

.review-item {
  grid-template-columns: minmax(0, 1fr) auto;
}

.review-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-bottom: 7px;
}

.review-tag {
  display: inline-flex;
  width: fit-content;
  padding: 5px 9px;
  border-radius: 999px;
  background: var(--soft);
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.review-check,
.review-ready {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 0 8px;
  color: var(--muted);
  background: rgba(17,19,24,0.05);
  border: 1px solid var(--line);
  font-size: 10px;
  font-weight: 950;
  text-transform: uppercase;
}

.review-check {
  color: #111318;
  background: linear-gradient(90deg, var(--brand-glow-primary), var(--brand-glow-accent));
}

.review-ready {
  color: #0f5132;
  background: rgba(34,197,94,0.12);
}

.review-actions {
  display: flex;
  gap: 14px;
  align-items: center;
}

.review-source {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.place-card .card-head,
.class-card .card-head,
.bag-card .card-head {
  align-items: center;
}

.bag-routine-title {
  margin: 0;
  font-size: 18px;
  font-weight: 950;
  letter-spacing: 0;
}

.empty-state {
  padding: 22px;
  border: 1px dashed #cbd5e1;
  border-radius: 22px;
  color: var(--muted);
  background: rgba(255,255,255,0.68);
  text-align: center;
  line-height: 1.45;
}

.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: 18px;
  z-index: 10;
  width: min(calc(100% - 28px), 680px);
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 5px;
  padding: 6px;
  border: 1px solid rgba(228,232,241,0.9);
  border-radius: 999px;
  background: rgba(255,255,255,0.86);
  box-shadow: 0 18px 54px rgba(17,19,24,0.15);
  backdrop-filter: blur(22px);
}

.bottom-nav button {
  min-height: 46px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  line-height: 1.1;
}

.bottom-nav button.active {
  color: #fff;
  background: #111318;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.08);
}

.edit-dialog {
  width: min(620px, calc(100% - 24px));
  border: 0;
  border-radius: 28px;
  padding: 0;
  box-shadow: 0 28px 90px rgba(17,19,24,0.24);
}

.edit-dialog::backdrop {
  background: rgba(17,19,24,0.42);
  backdrop-filter: blur(12px);
}

.edit-dialog form {
  padding: 22px;
}

#dialogFields {
  display: grid;
  gap: 12px;
  margin: 18px 0;
}

.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
}

.export-options {
  display: grid;
  gap: 12px;
  margin: 18px 0;
}

.export-option {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 14px;
  background: #fff;
  color: var(--ink);
  text-align: left;
}

.export-option strong,
.export-option small {
  grid-column: 2;
}

.export-option strong,
.wallpaper-option-copy strong {
  display: block;
  font-size: 16px;
  font-weight: 950;
}

.export-option small,
.wallpaper-option-copy small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  line-height: 1.4;
}

.wallpaper-option {
  align-items: start;
}

.wallpaper-option-copy {
  grid-column: 2;
  align-self: center;
}

.wallpaper-controls {
  grid-column: 1 / -1;
  padding: 12px;
  border: 1px solid rgba(228,232,241,0.9);
  border-radius: 20px;
  background: rgba(247,248,251,0.78);
}

.wallpaper-controls .helper-copy {
  margin: 9px 4px 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
}

.wallpaper-scope {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-top: 8px;
  padding: 5px;
  border: 1px solid rgba(228,232,241,0.9);
  border-radius: 999px;
  background: rgba(247,248,251,0.84);
}

.wallpaper-scope label {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 38px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 950;
  cursor: pointer;
}

.wallpaper-scope input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.wallpaper-scope label:has(input:checked) {
  color: #fff;
  background: var(--gradient-loop);
  background-size: 400% 400%;
  animation: gradientFlow 34s ease infinite;
  box-shadow: 0 14px 28px var(--brand-glow-accent);
}

.wallpaper-downloads {
  display: grid;
  gap: 8px;
  margin-top: -4px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(247,248,251,0.82);
}

.wallpaper-downloads[hidden] {
  display: none;
}

.wallpaper-downloads p {
  margin: 0 0 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
}

.wallpaper-download-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 14px;
  background: #fff;
  color: var(--ink);
  font-size: 13px;
  font-weight: 950;
  text-decoration: none;
}

.wallpaper-download-link::after {
  content: "Download";
  color: var(--royal);
  font-size: 12px;
}

.welcome-splash {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 18px;
  background:
    radial-gradient(circle at 18% 12%, rgba(0,207,255,0.24), transparent 25rem),
    radial-gradient(circle at 82% 18%, rgba(255,0,168,0.18), transparent 24rem),
    rgba(247,248,251,0.82);
  backdrop-filter: blur(18px);
}

.welcome-splash[hidden] {
  display: none;
}

.welcome-card {
  width: min(100%, 640px);
  border: 1px solid rgba(255,255,255,0.78);
  border-radius: 32px;
  padding: 24px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.96), rgba(255,255,255,0.9)),
    var(--gradient-loop);
  background-size: auto, 400% 400%;
  animation: gradientFlow 34s ease infinite;
  box-shadow: 0 32px 110px rgba(17,19,24,0.2);
}

.welcome-brand {
  display: grid;
  grid-template-columns: 80px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
}

.welcome-logo-wrap {
  width: 80px;
  height: 80px;
}

.welcome-logo {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  display: block;
  object-fit: cover;
  box-shadow: none;
}

.welcome-card h2 {
  max-width: none;
  margin-bottom: 0;
  background: var(--gradient-loop);
  background-size: 400% 400%;
  animation: gradientFlow 34s ease infinite;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  font-size: clamp(48px, 13vw, 72px);
  line-height: 0.9;
  letter-spacing: -0.02em;
}

.welcome-copy {
  margin: 20px 0;
  color: rgba(71,85,105,0.68);
  font-size: 15px;
  font-style: italic;
  font-weight: 600;
  line-height: 1.5;
}

.welcome-form {
  margin-top: 12px;
}

.welcome-form .primary-button {
  background: var(--gradient-loop);
  background-size: 400% 400%;
  animation: gradientFlow 28s ease infinite;
  box-shadow: 0 14px 34px var(--brand-glow-accent), 0 8px 18px rgba(17,19,24,0.12);
}

.welcome-email-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.welcome-terms {
  margin: 10px 0 0;
  color: rgba(71,85,105,0.42);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.55;
}

.welcome-error {
  min-height: 18px;
  margin: 8px 0 0;
  color: #d71920;
  font-size: 12px;
  font-weight: 850;
  line-height: 1.3;
}

body.welcome-locked {
  overflow: hidden;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 92px;
  z-index: 20;
  transform: translateX(-50%) translateY(18px);
  opacity: 0;
  pointer-events: none;
  min-height: 42px;
  display: grid;
  place-items: center;
  padding: 0 16px;
  border-radius: 999px;
  color: #fff;
  background: #111318;
  box-shadow: 0 14px 38px rgba(17,19,24,0.22);
  font-size: 13px;
  font-weight: 900;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@media (max-width: 760px) {
  .app-shell {
    padding: 12px 12px 96px;
  }

  .topbar {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px 12px;
    padding-bottom: 12px;
  }

  .brand-logo-wrap,
  .brand-mark {
    width: 50px;
    height: 50px;
  }

  .brand-name {
    font-size: 26px;
  }

  .powered-line {
    grid-column: 1 / -1;
    justify-self: start;
    margin-left: 62px;
    font-size: 11px;
    gap: 8px;
  }

  .powered-line img {
    width: 25px;
  }

  .next-grid {
    grid-template-columns: 1fr;
  }

  .event-grid {
    grid-template-columns: 1fr;
  }

  .event-card,
  .status-card,
  .timeline-section,
  .import-hero,
  .import-panel,
  .review-panel {
    border-radius: 24px;
    padding: 18px;
  }

  .delay-controls {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 6px;
  }

  .custom-delay {
    grid-column: auto;
  }

  .custom-delay span {
    font-size: 9px;
  }

  .custom-delay input {
    width: 24px;
  }

  .timeline-item {
    grid-template-columns: 74px minmax(0, 1fr);
  }

  .timeline-item .text-button {
    grid-column: 1 / -1;
    justify-self: end;
  }

  .routine-details {
    grid-template-columns: repeat(2, 1fr);
  }

  .result-grid {
    grid-template-columns: 1fr;
  }

  .time-stack {
    text-align: left;
  }

  .bottom-nav {
    bottom: 10px;
    width: calc(100% - 16px);
  }

  .bottom-nav button {
    min-height: 44px;
    font-size: 10px;
  }

  .field-grid {
    grid-template-columns: 1fr;
  }

  .dialog-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .tile-icon {
    width: 56px;
    height: 56px;
  }

  .welcome-card {
    border-radius: 28px;
    padding: 20px;
  }

  .welcome-email-row {
    grid-template-columns: 1fr;
  }
}

@media print {
  body {
    background: #fff;
  }

  .topbar,
  .bottom-nav,
  .quick-row,
  .welcome-splash,
  .import-tabs,
  .icon-button,
  .small-button,
  .primary-mini,
  .text-button,
  .card-actions {
    display: none !important;
  }

  .app-shell {
    width: 100%;
    padding: 0;
  }

  .view {
    display: block;
    break-after: page;
  }

  .view:not(.active) {
    display: none;
  }

  .event-card,
  .status-card,
  .next-card,
  .timeline-section,
  .routine-card,
  .place-card,
  .class-card,
  .bag-card {
    box-shadow: none;
    break-inside: avoid;
  }
}
