:root {
  --bg: #f7f4ed;
  --surface: #ffffff;
  --surface-soft: #f4f7f5;
  --ink: #17201b;
  --muted: #69746d;
  --line: #dfe6df;
  --green: #2f9461;
  --green-dark: #1d6f48;
  --coral: #d9634f;
  --blue: #2f6f9f;
  --gold: #b8872f;
  --shadow: 0 14px 35px rgba(21, 31, 25, 0.08);
  color-scheme: light;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--bg);
}

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

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

a {
  color: inherit;
  text-decoration: none;
}

.customer-shell {
  background:
    linear-gradient(180deg, rgba(47, 148, 97, 0.12), transparent 280px),
    var(--bg);
}

.phone-page {
  width: min(100%, 520px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 18px 16px calc(28px + env(safe-area-inset-bottom));
}

.customer-header,
.admin-top,
.panel-heading,
.button-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.customer-header {
  padding: 16px 0 10px;
}

.customer-header h1,
.admin-top h2,
.panel-heading h2,
.section-title h2,
.empty-state h2 {
  margin: 0;
  letter-spacing: 0;
}

.customer-header h1 {
  font-size: 34px;
  line-height: 1.1;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--gold);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.subtle {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.admin-link,
.preview-link,
.ghost-button,
.primary-button,
.secondary-button,
.danger-button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 8px;
  padding: 0 16px;
  border: 1px solid transparent;
  font-weight: 800;
}

.admin-link,
.ghost-button,
.secondary-button {
  border-color: var(--line);
  background: var(--surface);
  color: var(--ink);
}

.primary-button {
  background: var(--green);
  color: white;
}

.danger-button {
  border-color: rgba(217, 99, 79, 0.3);
  background: rgba(217, 99, 79, 0.08);
  color: #a33b2b;
}

.status-bar {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 8px 0 18px;
  padding: 10px 12px;
  border: 1px solid rgba(47, 148, 97, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.7);
  color: var(--muted);
  font-size: 14px;
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 5px rgba(47, 148, 97, 0.12);
}

.platform-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin: -4px 0 16px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
}

.platform-switch a {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  color: var(--muted);
  font-weight: 900;
}

.platform-switch a.active {
  background: var(--green);
  color: white;
  box-shadow: 0 6px 14px rgba(47, 148, 97, 0.18);
}

.notice-card {
  margin: 0 0 16px;
  border: 1px solid rgba(217, 99, 79, 0.28);
  border-radius: 8px;
  padding: 12px 13px;
  background: #fff6f3;
  color: #4b2a24;
}

.notice-card strong {
  display: block;
  margin-bottom: 5px;
  font-size: 15px;
}

.notice-card p {
  margin: 0;
  line-height: 1.55;
  color: #74443a;
}

.section-block,
.empty-state,
.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.section-block,
.empty-state {
  margin-bottom: 16px;
  padding: 16px;
}

.section-title {
  margin-bottom: 14px;
}

.section-title h2 {
  font-size: 24px;
}

.package-list {
  display: grid;
  gap: 12px;
}

.package-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.package-card.selected {
  border-color: rgba(47, 148, 97, 0.45);
  box-shadow: 0 0 0 3px rgba(47, 148, 97, 0.12);
}

.image-strip {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr;
  gap: 6px;
  padding: 8px;
  background: #eff3ef;
}

.image-strip img,
.locked-gallery img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 6px;
  background: var(--surface-soft);
}

.image-strip img {
  aspect-ratio: 1 / 1;
}

.package-body {
  padding: 14px;
}

.package-body h3 {
  margin: 0 0 8px;
  font-size: 18px;
  line-height: 1.35;
  letter-spacing: 0;
}

.package-body p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 12px 0;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  border-radius: 8px;
  padding: 0 8px;
  background: rgba(47, 111, 159, 0.1);
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
}

.package-actions,
.locked-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: 13px;
}

.locked-gallery {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 14px;
}

.locked-gallery img:first-child {
  grid-column: span 2;
  aspect-ratio: 16 / 10;
}

.locked-gallery img:not(:first-child) {
  aspect-ratio: 1 / 1;
}

.copy-box {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 13px;
  background: #fbfcfa;
}

.copy-box h3 {
  margin: 0 0 8px;
  font-size: 20px;
}

.copy-box p {
  margin: 0;
  color: #445048;
  line-height: 1.7;
  white-space: pre-wrap;
}

.empty-state {
  text-align: center;
}

.empty-state p {
  margin: 8px 0 0;
  color: var(--muted);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  z-index: 20;
  width: min(calc(100% - 32px), 480px);
  transform: translate(-50%, 18px);
  border-radius: 8px;
  padding: 12px 14px;
  background: rgba(23, 32, 27, 0.92);
  color: white;
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

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

.admin-shell {
  display: grid;
  grid-template-columns: 260px 1fr;
  background: #f5f7f6;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 22px;
  border-right: 1px solid var(--line);
  background: #11231b;
  color: white;
}

.sidebar .eyebrow,
.sidebar .subtle {
  color: rgba(255, 255, 255, 0.68);
}

.sidebar h1 {
  margin: 0;
  font-size: 24px;
  line-height: 1.25;
}

.brand-mark {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: 8px;
  background: var(--green);
  font-size: 25px;
  font-weight: 900;
}

.sidebar nav {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.sidebar nav a,
.preview-link {
  border-radius: 8px;
  padding: 11px 12px;
  background: rgba(255, 255, 255, 0.08);
  color: white;
  font-weight: 800;
}

.preview-link {
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.preview-stack {
  display: grid;
  gap: 8px;
  margin-top: auto;
}

.admin-main {
  width: min(1180px, 100%);
  padding: 26px;
}

.admin-top {
  margin-bottom: 16px;
}

.admin-top h2 {
  font-size: 30px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.stat-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 13px;
  background: var(--surface);
}

.stat-card span {
  color: var(--muted);
  font-size: 13px;
}

.stat-card strong {
  display: block;
  margin-top: 8px;
  font-size: 28px;
  line-height: 1;
}

.panel {
  margin-bottom: 16px;
  padding: 16px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

label {
  display: grid;
  gap: 7px;
  margin: 13px 0;
  color: #344039;
  font-size: 14px;
  font-weight: 800;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 12px;
  background: white;
  color: var(--ink);
  outline: none;
}

textarea {
  resize: vertical;
  line-height: 1.6;
}

input:focus,
textarea:focus,
select:focus {
  border-color: rgba(47, 148, 97, 0.7);
  box-shadow: 0 0 0 3px rgba(47, 148, 97, 0.12);
}

.media-list {
  display: grid;
  gap: 12px;
}

.media-row {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fbfcfa;
}

.media-row .image-strip {
  align-self: start;
  border-radius: 8px;
}

.media-details h3 {
  margin: 0 0 6px;
  font-size: 19px;
}

.copy-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.copy-item {
  border-left: 3px solid var(--green);
  padding: 9px 10px;
  background: white;
}

.copy-item strong {
  display: block;
  margin-bottom: 4px;
}

.copy-item p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.assignment-list {
  display: grid;
  gap: 8px;
}

.assignment-item {
  display: grid;
  grid-template-columns: 120px 1fr 150px;
  gap: 12px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding: 10px 0;
}

.badge {
  display: inline-flex;
  width: fit-content;
  min-height: 24px;
  align-items: center;
  border-radius: 8px;
  padding: 0 8px;
  background: rgba(184, 135, 47, 0.12);
  color: #76561c;
  font-size: 12px;
  font-weight: 900;
}

.badge-ok {
  background: rgba(47, 148, 97, 0.12);
  color: var(--green-dark);
}

.badge-miss {
  background: rgba(217, 99, 79, 0.12);
  color: #a33b2b;
}

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

.channel-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 13px;
  background: #fbfcfa;
}

.channel-card.active {
  border-color: rgba(47, 148, 97, 0.5);
  box-shadow: 0 0 0 3px rgba(47, 148, 97, 0.1);
}

.channel-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}

.channel-card > p {
  margin: 0 0 8px;
}

.issue-list {
  display: grid;
  gap: 5px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 13px;
}

.issue-list li {
  padding-left: 18px;
  position: relative;
  line-height: 1.5;
}

.issue-list li::before {
  position: absolute;
  left: 0;
  font-weight: 900;
}

.issue-list li.ok {
  color: var(--green-dark);
}

.issue-list li.ok::before {
  content: "✓";
}

.issue-list li.miss {
  color: #a33b2b;
}

.issue-list li.miss::before {
  content: "✕";
}

.channel-current {
  margin: 10px 0 0;
  color: var(--green-dark);
  font-size: 13px;
  font-weight: 900;
}

.channel-note {
  margin: 12px 0 0;
}

@media (max-width: 900px) {
  .admin-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
  }

  .stats-grid,
  .form-grid {
    grid-template-columns: 1fr 1fr;
  }

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

@media (max-width: 620px) {
  .phone-page {
    padding-inline: 12px;
  }

  .customer-header h1 {
    font-size: 30px;
  }

  .stats-grid,
  .form-grid,
  .media-row,
  .assignment-item,
  .channel-grid {
    grid-template-columns: 1fr;
  }

  .admin-main {
    padding: 14px;
  }

  .button-row {
    align-items: stretch;
    flex-direction: column;
  }
}
