:root {
  --ink: #17201c;
  --muted: #66736d;
  --line: #dbe3de;
  --paper: #f8faf7;
  --panel: #ffffff;
  --green: #1f6b52;
  --green-deep: #164535;
  --gold: #c59b3b;
  --red: #b42318;
  --blue: #2f5f99;
  --shadow: 0 18px 48px rgba(21, 44, 35, .13);
  font-family: "Aptos", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--paper); }
button, input, select, textarea { font: inherit; }
button { border: 0; cursor: pointer; }
a { color: inherit; }

.public-shell {
  min-height: 100vh;
  background:
    linear-gradient(135deg, rgba(31,107,82,.09), transparent 42%),
    linear-gradient(315deg, rgba(197,155,59,.14), transparent 36%),
    var(--paper);
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 8px;
  background: var(--green-deep);
  color: white;
  font-weight: 800;
  letter-spacing: 0;
}
.brand-logo {
  width: 92px;
  height: 92px;
  object-fit: contain;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 26px rgba(21, 44, 35, .12);
  flex: 0 0 auto;
}
.small-logo {
  width: 46px;
  height: 46px;
  box-shadow: none;
}
.centered-logo {
  display: block;
  margin: 0 auto 18px;
}

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

.feedback-layout, .public-page {
  width: min(1060px, calc(100% - 32px));
  margin: 0 auto;
  padding: 34px 0;
}

.feedback-head, .brand-panel {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 22px;
}

h1 { margin: 0; font-size: clamp(30px, 3.6vw, 44px); line-height: 1.08; max-width: 900px; }
h2 { margin: 0 0 18px; font-size: 24px; }
.lead, .feedback-head p:last-child { color: var(--muted); margin: 6px 0 0; }
.sublead { font-size: 15px; }

.step-card, .login-box, .thanks-page {
  background: rgba(255,255,255,.92);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  border-radius: 8px;
}

.step-card { padding: 24px; }
.progress {
  height: 8px;
  border-radius: 999px;
  background: #e9eee9;
  overflow: hidden;
  margin-bottom: 28px;
}
.progress span {
  display: block;
  height: 100%;
  width: 16%;
  background: linear-gradient(90deg, var(--green), var(--gold));
  transition: width .22s ease;
}

.step { display: none; min-height: 330px; }
.step.active { display: block; animation: lift .18s ease-out; }
@keyframes lift { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.choice-grid, .rating-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
}
.feedback-type-grid {
  grid-template-columns: repeat(3, minmax(220px, 1fr));
}
.choice-grid.two { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.choice-grid button, .rating-grid button {
  min-height: 74px;
  padding: 15px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 8px;
  color: var(--ink);
  text-align: left;
  font-weight: 750;
  transition: border-color .16s, transform .16s, box-shadow .16s;
}
.choice-grid button:hover, .rating-grid button:hover, .choice-grid button.selected, .rating-grid button.selected {
  border-color: var(--green);
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(31, 107, 82, .12);
}
.rating-grid button { font-size: 30px; }
.feedback-type-grid button {
  align-items: center;
  display: flex;
  font-size: 30px;
  gap: 16px;
  min-height: 132px;
}
.feedback-type-icon {
  align-items: center;
  background: #f5f8f5;
  border: 1px solid var(--line);
  border-radius: 999px;
  display: inline-flex;
  flex: 0 0 auto;
  font-size: 44px;
  height: 78px;
  justify-content: center;
  line-height: 1;
  width: 78px;
}
.feedback-type-label {
  line-height: 1.25;
}
.rating-grid span { display: block; font-size: 14px; color: var(--muted); margin-top: 6px; }

.field-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
  margin-top: 18px;
}
.purchase-waiver {
  width: fit-content;
  max-width: 100%;
  padding: 12px 14px;
  border: 1px solid rgba(31, 107, 82, .22);
  border-radius: 8px;
  background: #f7faf8;
  color: var(--green-deep);
}
.purchase-waiver input {
  flex: 0 0 auto;
}
.field-grid.is-disabled {
  opacity: .55;
}
label { display: grid; gap: 7px; font-weight: 700; color: var(--ink); }
input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 13px;
  background: white;
  color: var(--ink);
}
textarea { min-height: 210px; resize: vertical; line-height: 1.5; }
.message-field { display: block; }
.cn-note { color: var(--muted); }
.hidden { display: none !important; }

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  border-top: 1px solid var(--line);
  padding-top: 18px;
}
.form-actions button, .login-box button, .inline-form button, .filter-row button, .export-btn {
  background: var(--green);
  color: white;
  border-radius: 8px;
  padding: 12px 16px;
  font-weight: 800;
  text-decoration: none;
}
.form-actions .ghost { background: #e8efeb; color: var(--green-deep); }
.error-text { color: var(--red); min-height: 22px; font-weight: 700; }

.trust-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 18px 0;
}
.trust-strip span {
  border: 1px solid rgba(31, 107, 82, .18);
  background: rgba(255, 255, 255, .7);
  border-radius: 8px;
  padding: 12px 14px;
  color: var(--green-deep);
  font-weight: 800;
  font-size: 14px;
}
.store-links { display: grid; gap: 12px; }
.store-link {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 18px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  text-decoration: none;
  align-items: center;
  transition: border-color .16s, box-shadow .16s, transform .16s;
}
.store-link:hover {
  border-color: var(--green);
  box-shadow: 0 12px 28px rgba(31, 107, 82, .12);
  transform: translateY(-1px);
}
.store-link small { display: block; margin-top: 5px; color: var(--muted); }
.thanks-page, .login-box {
  width: min(460px, calc(100% - 32px));
  margin: 10vh auto 0;
  padding: 28px;
}
.thanks-page { text-align: center; }
.login-box h1 { font-size: 32px; margin: 18px 0; }
.login-box form { display: grid; gap: 14px; }

.admin-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 230px 1fr;
  background: #f1f4f0;
}
.admin-side {
  background: #16231d;
  color: white;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.brand-line { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.nav-btn {
  width: 100%;
  text-align: left;
  padding: 12px;
  border-radius: 8px;
  background: transparent;
  color: #dbe8e1;
  font-weight: 750;
}
.nav-btn.active, .nav-btn:hover { background: rgba(255,255,255,.12); }
.nav-btn.low { margin-top: auto; color: #ffc9c2; }
.admin-main { padding: 20px; overflow: hidden; }
.admin-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  gap: 14px;
}
.admin-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.admin-actions .gpt-btn { background: var(--gold); color: #17201c; }
.admin-top h1 { font-size: 30px; }
.admin-view { display: none; }
.admin-view.active { display: block; }
.filter-row, .inline-form {
  display: grid;
  grid-template-columns: repeat(8, minmax(120px, 1fr));
  gap: 8px;
  margin-bottom: 12px;
  align-items: center;
}
.check { display: flex; gap: 6px; align-items: center; font-size: 13px; }
.check input { width: auto; }
.admin-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) 420px;
  gap: 12px;
  height: calc(100vh - 145px);
}
.table-wrap, .detail-panel, .stats-columns section, .store-admin-list, .user-list {
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
th, td {
  border-bottom: 1px solid var(--line);
  padding: 10px;
  text-align: left;
  vertical-align: top;
}
th { position: sticky; top: 0; background: #eef4f0; z-index: 1; }
tr { cursor: pointer; }
tr:hover { background: #f7faf8; }
tbody tr.selected-row {
  background: #f8fbf9;
  box-shadow: inset 4px 0 0 var(--green);
}
.detail-panel { padding: 18px; }
.detail-panel h2 { font-size: 22px; }
.detail-message {
  white-space: pre-wrap;
  border-left: 4px solid var(--green);
  padding: 10px 12px;
  background: #f7faf8;
  border-radius: 0 8px 8px 0;
}
.readonly-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin: 14px 0;
}
.readonly-fields p {
  margin: 0;
  padding: 10px;
  background: #fbfcfb;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.muted { color: var(--muted); }
.badge {
  display: inline-block;
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 800;
  background: #e8efeb;
}
.status-pending, .priority-urgent { background: #ffe4df; color: #8d1f13; }
.status-resolved, .status-closed { background: #e3f4e8; color: #166238; }
.detail-form { display: grid; gap: 10px; margin: 14px 0; }
.attachment-list, .log-list, .store-admin-list, .user-list { display: grid; gap: 10px; padding: 12px; }
.feedback-action-panel {
  background: #fffaf0;
  border: 1px solid #eadca8;
  border-radius: 8px;
  display: grid;
  gap: 12px;
  margin: 14px 0;
  padding: 14px;
}
.feedback-action-panel h3 { margin: 0; }
.feedback-action-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.feedback-action-buttons button {
  border: 0;
  border-radius: 999px;
  color: #15221c;
  cursor: pointer;
  font-weight: 900;
  padding: 10px 14px;
}
.feedback-action-buttons button.primary { background: #d7ecff; color: #164e8f; }
.feedback-action-buttons button.success { background: #dff5e8; color: #12643b; }
.feedback-action-buttons button.danger { background: #ffe3df; color: #9f2417; }
.feedback-action-buttons button.muted-action { background: #e8eceb; color: #4c5b56; }
.feedback-action-buttons button:disabled {
  cursor: wait;
  opacity: .6;
}
.action-note-label { gap: 8px; }
.action-note-label textarea { min-height: 92px; }
.attachment-list a, .store-row, .user-row {
  display: block;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
}
.store-row-head, .store-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.store-edit-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
}
.user-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.small-delete-user {
  width: auto;
  min-width: 110px;
  background: #ffe3df;
  color: #9f2417;
  border-color: #f3b6ad;
  padding: 10px 14px;
  border-radius: 10px;
}
.store-actions button {
  background: var(--green);
  color: white;
  border-radius: 8px;
  padding: 12px 16px;
  font-weight: 800;
}
.store-actions .poster-btn {
  background: var(--gold);
  color: #182018;
}
.stats-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}
.stat-card {
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
}
.stat-card strong { display: block; font-size: 32px; }
.stats-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.stats-columns section { padding: 16px; }
.store-rating-line {
  border-bottom: 1px solid var(--line);
  padding: 12px 0;
}
.store-rating-line:last-child { border-bottom: 0; }
.store-rating-line p { margin: 0; }
.store-rating-head {
  align-items: baseline;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  justify-content: space-between;
  margin-bottom: 8px;
}
.store-rating-head span {
  color: var(--muted);
  font-size: 14px;
}
.store-rating-score {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}
.store-rating-score > strong {
  font-size: 24px;
  line-height: 1;
}
.store-rating-score > span:last-child {
  color: var(--muted);
  font-size: 13px;
}
.store-star-meter {
  display: inline-block;
  font-size: 22px;
  letter-spacing: 1px;
  line-height: 1;
  position: relative;
}
.store-star-empty {
  color: #d8d8d8;
}
.store-star-fill {
  color: #fbbc04;
  left: 0;
  overflow: hidden;
  position: absolute;
  top: 0;
  white-space: nowrap;
}
.rating-breakdown {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.rating-breakdown span {
  background: #f5f1e2;
  border: 1px solid #eadca8;
  border-radius: 999px;
  font-weight: 800;
  padding: 6px 10px;
  white-space: nowrap;
}
.rating-breakdown b {
  color: #b37b00;
}

@media (max-width: 980px) {
  .admin-shell { grid-template-columns: 1fr; }
  .admin-side { position: static; flex-direction: row; flex-wrap: wrap; }
  .nav-btn { width: auto; }
  .admin-grid, .stats-columns { grid-template-columns: 1fr; height: auto; }
  .filter-row, .inline-form { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
  .feedback-type-grid { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
}

@media (max-width: 640px) {
  .feedback-layout, .public-page { width: min(100% - 20px, 920px); padding: 16px 0; }
  .feedback-head, .brand-panel { align-items: flex-start; gap: 12px; }
  .brand-logo { width: 68px; height: 68px; }
  .small-logo { width: 42px; height: 42px; }
  h1 { font-size: 30px; }
  .trust-strip { grid-template-columns: 1fr; }
  .step-card { padding: 16px; }
  .step { min-height: 420px; }
  .form-actions { justify-content: stretch; }
  .form-actions button { flex: 1; }
}
