:root {
  --bg: #fafafa;
  --text: #111111;
  --muted: rgba(17, 17, 17, .62);
  --soft: rgba(17, 17, 17, .46);
  --line: rgba(17, 17, 17, .10);
  --orange: #ff9900;
  --white: #ffffff;
  --radius: 10px;
  --shadow: 0 22px 70px rgba(15, 23, 42, .10), 0 8px 24px rgba(15, 23, 42, .06);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background: var(--bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body.modal-open { overflow: hidden; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .55; }

.btn-primary,
.btn-secondary {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 850;
  transition: transform .16s ease, background .16s ease;
}

.btn-primary {
  border: 1px solid #000;
  background: #000;
  color: #fff;
}

.btn-primary:hover { border-color: #ffaa24; background: #ffaa24; transform: translateY(-1px); }
.btn-secondary { border: 1px solid var(--line); background: #fff; color: var(--text); }
.btn-secondary:hover { background: rgba(17, 17, 17, .06); }

.support-nav {
  width: min(1180px, calc(100% - 40px));
  min-height: 86px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin: 0 auto;
}

.support-brand,
.auth-brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
}

.support-brand img,
.auth-brand img {
  width: 48px;
  height: 48px;
  border-radius: var(--radius);
  object-fit: cover;
}

.support-brand span,
.auth-brand span { display: grid; gap: 3px; }
.support-brand strong,
.auth-brand strong { font-size: 17px; font-weight: 950; line-height: 1; }
.support-brand small,
.auth-brand small { color: var(--soft); font-size: 11px; font-weight: 750; }

.support-main {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 52px 0 90px;
}

.support-hero {
  max-width: 780px;
  padding: 52px 0 70px;
}

.support-kicker,
.support-card-label {
  display: block;
  margin-bottom: 12px;
  color: #a46100;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 1.5px;
}

.support-hero h1 {
  margin: 0;
  max-width: 760px;
  font-size: clamp(44px, 8vw, 82px);
  font-weight: 950;
  letter-spacing: -.055em;
  line-height: .96;
}

.support-hero p {
  max-width: 680px;
  margin: 24px 0 0;
  color: var(--muted);
  font-size: clamp(17px, 2.4vw, 21px);
  font-weight: 600;
  line-height: 1.55;
}

.support-hero-action { margin-top: 28px; }

.support-loading {
  min-height: 180px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 14px;
}

.support-loading p { margin: 0; color: var(--muted); }

.support-spinner {
  width: 34px;
  height: 34px;
  border: 4px solid rgba(17, 17, 17, .12);
  border-top-color: #000;
  border-radius: 50%;
  animation: spin .75s linear infinite;
}

.support-guest,
.support-tickets-section {
  padding: clamp(24px, 5vw, 40px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .90);
  box-shadow: var(--shadow);
}

.support-guest {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
}

.support-guest h2,
.support-section-head h2 {
  margin: 0;
  font-size: clamp(28px, 4vw, 40px);
  line-height: 1.05;
}

.support-guest p { max-width: 650px; margin: 12px 0 0; color: var(--muted); line-height: 1.55; }

.support-guest-copy { flex: 1 1 auto; }

.support-benefits {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 26px 0 0;
  padding: 0;
  list-style: none;
}

.support-benefits li {
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fafafa;
}

.support-benefits strong,
.support-benefits span { display: block; }
.support-benefits strong { margin-bottom: 6px; font-size: 13px; }
.support-benefits span { color: var(--muted); font-size: 12px; line-height: 1.45; }

.support-section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 28px;
}

.support-ticket-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.support-ticket-card {
  width: calc((100% - 32px) / 3);
  min-height: 210px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--text);
  text-align: left;
  box-shadow: 0 14px 38px rgba(15, 23, 42, .06);
}

.support-ticket-card:hover { border-color: rgba(255, 153, 0, .55); transform: translateY(-2px); }
.support-ticket-top { width: 100%; display: flex; justify-content: space-between; gap: 10px; }
.support-ticket-category { color: var(--soft); font-size: 11px; font-weight: 900; letter-spacing: 1px; text-transform: uppercase; }
.support-status { padding: 5px 8px; border-radius: 999px; background: rgba(255,153,0,.12); color: #8a5300; font-size: 10px; font-weight: 900; text-transform: uppercase; }
.support-ticket-card h3 { margin: 24px 0 10px; font-size: 20px; line-height: 1.15; }
.support-ticket-card p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.support-ticket-card small { margin-top: auto; padding-top: 20px; color: var(--soft); font-weight: 700; }

.support-empty { padding: 48px 20px; text-align: center; border: 1px dashed rgba(17,17,17,.16); border-radius: var(--radius); }
.support-empty h3 { margin: 0; }
.support-empty p { margin: 8px 0 0; color: var(--muted); }

.ui-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 24px;
  overflow: auto;
  background: rgba(255,255,255,.78);
  backdrop-filter: blur(18px);
}

.ui-modal {
  position: relative;
  width: min(100%, 560px);
  max-height: calc(100dvh - 48px);
  margin: auto;
  padding: clamp(24px, 5vw, 34px);
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255,255,255,.97);
  box-shadow: 0 24px 80px rgba(17,17,17,.16);
}

.ui-ticket-modal { width: min(100%, 720px); }
.ui-modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: #111;
  font-size: 22px;
}

.ui-modal-header { padding-right: 44px; margin-bottom: 24px; }
.ui-modal-header h2 { margin: 0; font-size: clamp(28px, 5vw, 38px); line-height: 1.05; }
.ui-modal-header p { margin: 10px 0 0; color: var(--muted); line-height: 1.5; }
.auth-brand { margin-bottom: 28px; }

.support-form { display: grid; gap: 15px; }
.support-form label { display: grid; gap: 7px; color: var(--text); font-size: 13px; font-weight: 850; }
.support-form input,
.support-form select,
.support-form textarea {
  width: 100%;
  min-height: 50px;
  padding: 0 14px;
  border: 1px solid rgba(17,17,17,.13);
  border-radius: var(--radius);
  background: #fff;
  color: var(--text);
  outline: none;
}

.support-form select,
.ticket-admin-controls select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 42px;
  background-color: #fff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 640 640'%3E%3Cpath fill='%23111111' d='M297.4 438.6C309.9 451.1 330.2 451.1 342.7 438.6L502.7 278.6C515.2 266.1 515.2 245.8 502.7 233.3C490.2 220.8 469.9 220.8 457.4 233.3L320 370.7L182.6 233.4C170.1 220.9 149.8 220.9 137.3 233.4C124.8 245.9 124.8 266.2 137.3 278.7L297.3 438.7z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 16px 16px;
}

.support-form textarea { min-height: 160px; padding: 14px; resize: vertical; line-height: 1.5; }
.support-form input:focus,
.support-form select:focus,
.support-form textarea:focus { border-color: rgba(0,0,0,.34); box-shadow: 0 0 0 4px rgba(255,153,0,.14); }

.support-form-error,
.support-form-message { padding: 12px; border-radius: var(--radius); font-size: 13px; font-weight: 750; line-height: 1.45; }
.support-form-error { border: 1px solid rgba(180,35,47,.18); background: #fff0f1; color: #a11925; }
.support-form-message { border: 1px solid rgba(18,138,80,.22); background: #eaf7f0; color: #086638; }

.auth-policy { display: flex !important; grid-template-columns: auto 1fr; align-items: flex-start; gap: 9px !important; color: var(--muted) !important; }
.auth-policy input { width: auto; min-height: 18px; margin-top: 1px; accent-color: var(--orange); }
.auth-policy a { font-weight: 900; text-decoration: underline; text-decoration-color: var(--orange); }
.auth-code { display: flex; justify-content: center; gap: clamp(5px, 1.8vw, 8px); }
.auth-code input { width: clamp(38px, 10vw, 48px); min-height: 54px; padding: 0; text-align: center; font-size: 24px; font-weight: 900; }

.ticket-detail-head { padding-right: 44px; margin-bottom: 24px; }
.ticket-detail-head h2 { margin: 10px 0; font-size: clamp(28px, 5vw, 38px); line-height: 1.08; }
.ticket-detail-meta { display: flex; flex-wrap: wrap; gap: 8px 16px; color: var(--soft); font-size: 12px; font-weight: 750; }
.ticket-admin-controls { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.ticket-admin-controls select { min-height: 48px; padding: 0 38px 0 13px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; text-transform: capitalize; }
.ticket-original { margin: 22px 0; padding: 18px; border-radius: var(--radius); background: #fafafa; color: var(--text); white-space: pre-wrap; line-height: 1.6; }
.ticket-replies { display: grid; gap: 12px; margin: 24px 0; }
.ticket-reply { padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.ticket-reply.admin { border-left: 4px solid var(--orange); }
.ticket-reply strong { display: block; margin-bottom: 7px; font-size: 12px; text-transform: uppercase; }
.ticket-reply p { margin: 0; white-space: pre-wrap; line-height: 1.55; }
.ticket-reply small { display: block; margin-top: 10px; color: var(--soft); }
.support-reply-form { padding-top: 22px; border-top: 1px solid var(--line); }

.support-toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 1200;
  max-width: min(380px, calc(100vw - 44px));
  padding: 14px 18px;
  border-radius: var(--radius);
  background: #000;
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  box-shadow: var(--shadow);
}

@media (max-width: 820px) {
  .support-ticket-card { width: calc((100% - 16px) / 2); }
}

@media (max-width: 560px) {
  .support-nav,
  .support-main { width: min(100% - 28px, 1180px); }
  .support-nav { min-height: 74px; }
  .support-brand img { width: 44px; height: 44px; }
  .support-main { padding-top: 22px; }
  .support-hero { padding: 38px 0 50px; }
  .support-guest,
  .support-section-head { align-items: stretch; flex-direction: column; }
  .support-benefits { grid-template-columns: 1fr; }
  .support-ticket-card { width: 100%; }
  .ui-modal-backdrop { padding: 14px; }
  .ui-modal { max-height: calc(100dvh - 28px); }
}

@keyframes spin { to { transform: rotate(360deg); } }
