:root {
  --turquoise: #56A69F;
  --turquoise-dark: #3F847E;
  --turquoise-soft: rgba(86, 166, 159, 0.12);
  --beige: #E2D3AB;
  --beige-soft: rgba(226, 211, 171, 0.28);
  --ivory: #F5F5EF;
  --surface: #FFFFFF;
  --ink: #2C2F33;
  --grey: #55585F;
  --muted: #7C8088;
  --border: rgba(85, 88, 95, 0.14);
  --ok: #2E7D6B;
  --ok-bg: #E7F5F1;
  --warn: #A86B1A;
  --warn-bg: #FDF4E3;
  --danger: #B8423E;
  --danger-bg: #FDECEA;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 8px 28px rgba(44, 47, 51, 0.06);
}

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

html, body {
  margin: 0;
  padding: 0;
  background: var(--ivory);
  color: var(--ink);
  font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 15px;
  line-height: 1.55;
  min-height: 100vh;
}

.app-shell {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  min-height: 100vh;
  padding-bottom: 72px;
}

/* Top Bar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(245, 245, 239, 0.94);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand-mark {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-dot {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--turquoise);
  color: var(--ivory);
  display: grid;
  place-items: center;
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 18px;
  font-weight: 700;
}

.brand-title {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--grey);
}

.brand-sub {
  font-size: 11px;
  color: var(--muted);
}

.role-pill {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 999px;
  padding: 6px 11px;
  font-size: 11px;
  font-weight: 600;
  color: var(--grey);
  cursor: pointer;
}

/* Demo Banner */
.demo-banner {
  margin: 12px 18px 0;
  padding: 9px 13px;
  border-radius: var(--radius-sm);
  background: var(--beige-soft);
  border: 1px solid rgba(226, 211, 171, 0.7);
  font-size: 12px;
  color: var(--grey);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

/* Hero / Home */
.section { padding: 18px; }

.greeting {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 32px;
  font-weight: 600;
  line-height: 1.15;
  margin: 4px 0 6px;
  color: var(--ink);
}

.greeting-sub {
  color: var(--grey);
  font-size: 14px;
  margin: 0 0 18px;
}

.package-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

.package-kicker {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--turquoise-dark);
}

.package-name {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 24px;
  font-weight: 600;
  margin: 4px 0 2px;
}

.package-period {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 16px;
}

.progress-track {
  height: 8px;
  border-radius: 999px;
  background: rgba(86, 166, 159, 0.16);
  overflow: hidden;
  margin-bottom: 14px;
}

.progress-fill {
  height: 100%;
  background: var(--turquoise);
  border-radius: 999px;
  transition: width 0.35s ease;
}

.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 18px;
}

.stat-box {
  background: var(--ivory);
  border-radius: var(--radius-sm);
  padding: 10px 6px;
  text-align: center;
}

.stat-num {
  font-size: 18px;
  font-weight: 700;
  color: var(--ink);
}

.stat-lbl {
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  border: none;
  border-radius: 14px;
  padding: 14px 18px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.12s ease, opacity 0.15s ease, background 0.15s ease;
}

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

.btn-primary {
  background: var(--turquoise);
  color: #FFFFFF;
}

.btn-primary:hover { background: var(--turquoise-dark); }

.btn-approve { background: var(--ok); color: #FFFFFF; }
.btn-changes { background: var(--warn-bg); color: var(--warn); border: 1px solid rgba(168, 107, 26, 0.25); }
.btn-reject { background: var(--danger-bg); color: var(--danger); border: 1px solid rgba(184, 66, 62, 0.22); }
.btn-ghost { background: transparent; color: var(--grey); border: 1px solid var(--border); }

/* Material List */
.list-heading {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin: 22px 0 10px;
}

.material-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.material-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  display: flex;
  gap: 13px;
  align-items: center;
  cursor: pointer;
  box-shadow: 0 3px 12px rgba(44, 47, 51, 0.04);
}

.material-thumb {
  width: 68px;
  height: 68px;
  border-radius: 12px;
  flex-shrink: 0;
  background: var(--beige-soft);
  display: grid;
  place-items: center;
  overflow: hidden;
  font-size: 11px;
  font-weight: 600;
  color: var(--grey);
}

.material-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.material-meta { flex: 1; min-width: 0; }

.material-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 3px;
}

.material-order {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
}

.material-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.material-sub {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.badge-pending { background: var(--beige-soft); color: #755D26; }
.badge-approved { background: var(--ok-bg); color: var(--ok); }
.badge-changes { background: var(--warn-bg); color: var(--warn); }
.badge-rejected { background: var(--danger-bg); color: var(--danger); }
.badge-prelim { background: #EEECE6; color: var(--grey); }

/* Detail View */
.back-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.back-btn {
  background: none;
  border: none;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--turquoise-dark);
  cursor: pointer;
  padding: 6px 0;
}

.detail-card {
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

/* Carousel / Media Stage */
.media-stage {
  position: relative;
  background: #1E2022;
  aspect-ratio: 4 / 5;
  overflow: hidden;
}

.carousel-track {
  display: flex;
  height: 100%;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}

.carousel-track::-webkit-scrollbar { display: none; }

.carousel-slide {
  min-width: 100%;
  height: 100%;
  scroll-snap-align: start;
  position: relative;
  display: grid;
  place-items: center;
}

.carousel-slide img, .carousel-slide video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.slide-counter {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(20, 22, 24, 0.72);
  color: #FFFFFF;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  pointer-events: none;
}

.carousel-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: none;
  background: rgba(20, 22, 24, 0.56);
  color: #FFFFFF;
  font-size: 22px;
  line-height: 1;
  display: grid;
  place-items: center;
  cursor: pointer;
  z-index: 5;
  transition: background 0.15s ease, transform 0.12s ease;
}

.carousel-nav:hover { background: rgba(20, 22, 24, 0.82); }
.carousel-nav.prev { left: 12px; }
.carousel-nav.next { right: 12px; }

.carousel-dots {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 7px;
  z-index: 5;
  background: rgba(20, 22, 24, 0.35);
  padding: 5px 10px;
  border-radius: 999px;
}

.carousel-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: none;
  padding: 0;
  background: rgba(255, 255, 255, 0.45);
  cursor: pointer;
}

.carousel-dot.active { background: #FFFFFF; transform: scale(1.2); }

.pager-bar {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 18px;
}

.pager-bar .btn { width: auto; padding: 10px 16px; font-size: 13px; }

.prelim-overlay {
  width: 100%;
  height: 100%;
  background: linear-gradient(145deg, #EAE4D6, #F5F5EF);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 28px;
  text-align: center;
  color: var(--grey);
}

.detail-body { padding: 18px; }

.detail-title {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 26px;
  font-weight: 600;
  line-height: 1.2;
  margin: 6px 0 8px;
}

.meta-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}

.chip {
  font-size: 12px;
  color: var(--grey);
  background: var(--ivory);
  padding: 4px 10px;
  border-radius: 8px;
}

.caption-box {
  background: var(--ivory);
  border-radius: var(--radius-sm);
  padding: 14px;
  font-size: 14px;
  white-space: pre-line;
  margin-bottom: 12px;
}

.hashtags {
  font-size: 12px;
  color: var(--turquoise-dark);
  margin-bottom: 14px;
}

.version-diff {
  background: var(--turquoise-soft);
  border-left: 3px solid var(--turquoise);
  border-radius: 8px;
  padding: 11px 13px;
  font-size: 13px;
  margin-bottom: 14px;
}

.clarification-box {
  background: var(--warn-bg);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 13px;
  margin-bottom: 14px;
}

/* Action Panel */
.action-panel {
  margin-top: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
}

.action-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.comment-area {
  width: 100%;
  min-height: 92px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  font-family: inherit;
  font-size: 14px;
  background: var(--ivory);
  color: var(--ink);
  resize: vertical;
  margin: 10px 0 12px;
}

.comment-area:focus {
  outline: 2px solid var(--turquoise);
  background: #FFFFFF;
}

.history-list {
  margin-top: 16px;
  font-size: 12px;
  color: var(--grey);
  border-top: 1px solid var(--border);
  padding-top: 12px;
}

.history-entry {
  padding: 7px 0;
  border-bottom: 1px dashed var(--border);
}

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(15, 17, 19, 0.94);
  display: none;
  place-items: center;
  padding: 16px;
}

.lightbox.open { display: grid; }
.lightbox img { max-width: 100%; max-height: 88vh; border-radius: 10px; }

.toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: #FFFFFF;
  padding: 11px 18px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  z-index: 90;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.toast.show { opacity: 1; }

/* ==================== RESPONSIVE TABLET & DESKTOP ==================== */
@media (min-width: 768px) {
  .section { padding: 28px 32px; }
  .demo-banner { margin: 16px 32px 0; }
  .topbar { padding: 16px 32px; }

  .home-hero-grid {
    display: grid;
    grid-template-columns: 1fr 1.15fr;
    gap: 28px;
    align-items: center;
    margin-bottom: 28px;
  }

  .material-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
  }

  .material-item {
    padding: 16px;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
  }

  .material-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 26px rgba(44, 47, 51, 0.08);
  }

  .detail-layout {
    display: grid;
    grid-template-columns: minmax(320px, 460px) 1fr;
    gap: 28px;
    align-items: start;
  }

  .detail-media-col {
    position: sticky;
    top: 86px;
  }

  .action-panel {
    margin-top: 18px;
  }
}

@media (min-width: 1080px) {
  .greeting { font-size: 40px; }
  .detail-layout {
    grid-template-columns: 480px 1fr;
    gap: 36px;
  }
}
