:root {
  --bg: #ffd23f;
  --surface: #fffdf6;
  --ink: #1e1f24;
  --muted: #4f5570;
  --line: #e3c042;
  --brand-purple: #6d3ac6;
  --brand-cyan: #1db9d2;
  --danger: #b23838;
  --ok: #2f6b4f;
  --radius: 14px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Onest", "Segoe UI", Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
}

.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 16px 32px;
}

.topbar {
  background: #f5e8b5;
  border-bottom: 1px solid rgba(67, 49, 12, 0.2);
}

.topbar-inner {
  min-height: 82px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.brand-logo { height: 52px; width: auto; }

.topbar-title {
  margin: 0;
  font-size: 24px;
  font-weight: 700;
  color: var(--muted);
  text-align: right;
}

.card {
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 16px;
}

h1, h2, h3, h4 { margin: 0 0 10px; line-height: 1.2; }

h1 { font-size: clamp(1.5rem, 3vw, 2rem); }
h2 { font-size: 1.25rem; }

.auth-row,
.meta-row,
.toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

button,
select,
input {
  font: inherit;
}

button {
  border: 0;
  border-radius: 10px;
  padding: 10px 14px;
  color: #fff;
  background: var(--brand-purple);
  font-weight: 700;
  cursor: pointer;
}

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

input, select {
  border: 1px solid #e0cb75;
  background: #fff;
  border-radius: 10px;
  padding: 10px 12px;
  color: var(--ink);
}

.pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 700;
}

.pill.ok { background: #e3f5ea; color: var(--ok); }
.pill.warn { background: #ffe8e8; color: var(--danger); }
.pill.info { background: #e7f5f8; color: #1f6f7c; }

.results {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

.submission {
  border: 1px solid #ead88b;
  border-radius: 10px;
  background: #fff8dd;
  padding: 12px;
}

.submission h3 {
  margin-bottom: 8px;
  font-size: 1.05rem;
}

.submission .meta {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 8px;
}

.submission-actions {
  margin-top: 16px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.submission-actions button {
  padding: 14px 24px;
}

.actions-list {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 6px;
}

.empty {
  color: var(--muted);
  font-weight: 600;
}

.status-message {
  margin: 12px 0 0;
  min-height: 20px;
  color: var(--brand-purple);
  font-weight: 700;
}

.status-message.error { color: var(--danger); }

.status-detail {
  margin: 4px 0 0;
  min-height: 18px;
  color: var(--muted);
  font-size: 13px;
}

.details-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: var(--bg);
  overflow: auto;
  padding: 12px;
}

.details-panel {
  width: min(1080px, 100%);
  margin: 0 auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 16px 24px;
}

.details-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}

.details-head h2 {
  margin: 0;
  font-size: clamp(1.35rem, 3vw, 2rem);
  line-height: 1.2;
}

.details-close {
  width: auto;
  min-height: 0;
  padding: 10px 16px;
  background: var(--brand-purple);
  color: #fff;
  border: 0;
  border-radius: 10px;
  font-weight: 700;
}

.details-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  color: var(--muted);
  font-weight: 600;
}

.details-body {
  display: grid;
  gap: 14px;
}

.detail-meta {
  color: var(--muted);
  font-size: 15px;
}

.detail-section {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 12px;
  padding: 14px;
  display: grid;
  gap: 12px;
}

.detail-section h3 {
  margin: 0;
  font-size: 1.2rem;
}

.detail-group {
  border-top: 1px solid #efe5b6;
  padding-top: 10px;
  display: grid;
  gap: 10px;
}

.detail-group h4 {
  margin: 0;
  font-size: 1.03rem;
}

.detail-fields {
  display: grid;
  gap: 10px;
}

.detail-row {
  display: grid;
  gap: 6px;
  align-items: start;
  padding: 10px 12px;
  border-radius: 10px;
  background: #fffdf4;
  border: 1px solid #ecdca0;
}

.detail-label {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.92rem;
}

.detail-value {
  word-break: break-word;
  font-size: 1.02rem;
}

body.modal-open {
  overflow: hidden;
}

.signout-row {
  margin-top: 14px;
  display: flex;
  justify-content: flex-end;
}

.signout-btn {
  padding: 8px 12px;
  width: auto;
  min-height: 0;
  font-size: 13px;
  font-weight: 600;
  background: transparent;
  color: var(--muted);
  border: 1px solid #c7b57a;
  border-radius: 999px;
}

@media (max-width: 720px) {
  .topbar-title { font-size: 18px; }
  .brand-logo { height: 42px; }
  button { width: 100%; min-height: 46px; }
  .signout-btn { width: auto; min-height: 0; }
  .toolbar > * { width: 100%; }
  input, select { width: 100%; }
  .submission-actions > * { width: 100%; }
  .details-modal {
    padding: 8px 8px 16px;
  }
  .details-panel {
    padding: 12px 12px 20px;
  }
  .details-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }
  .details-close { width: auto; min-height: 44px; }
}
