:root {
  --bg: #f5f7fa;
  --panel: #ffffff;
  --ink: #18212f;
  --muted: #6c7788;
  --line: #dfe5ee;
  --accent: #2f6fed;
  --ok: #1f8f5f;
  --shadow: 0 14px 34px rgba(24, 33, 47, 0.08);
}

* {
  box-sizing: border-box;
}

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

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

button {
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  padding: 0 16px;
  background: var(--accent);
  color: white;
  font-weight: 800;
  cursor: pointer;
}

button.ghost {
  border: 1px solid var(--line);
  background: white;
  color: var(--ink);
}

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

textarea {
  resize: vertical;
}

label {
  display: grid;
  gap: 7px;
  font-weight: 800;
}

.shell {
  width: min(1100px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 26px 0 42px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.account-greeting {
  margin: 0;
  color: var(--muted);
  font-weight: 800;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  width: fit-content;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #eef3f8;
  padding: 4px;
  margin-bottom: 16px;
}

.tab {
  min-height: 36px;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  box-shadow: none;
}

.tab.active {
  background: var(--accent);
  color: white;
  box-shadow: 0 1px 4px rgba(24, 33, 47, 0.08);
}

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

h1,
h2,
h3 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: 32px;
}

h2 {
  font-size: 21px;
}

h3 {
  font-size: 24px;
  line-height: 1.25;
}

.app-layout {
  display: grid;
  gap: 16px;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  padding: 20px;
}

.embedded-panel {
  margin-top: 18px;
  border-top: 1px solid var(--line);
  padding-top: 18px;
}

.tab-view {
  display: none;
}

.tab-view.active {
  display: block;
}

.stack {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

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

.practice-card {
  display: grid;
  gap: 14px;
}

.completion-card {
  display: grid;
  gap: 12px;
  border: 1px solid #b9dfca;
  border-radius: 8px;
  background: #f1fbf5;
  padding: 16px;
}

.completion-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.admin-actions {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto auto;
  align-items: end;
  gap: 12px;
  margin-bottom: 8px;
}

.reward-summary {
  margin-bottom: 14px;
}

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

.reward-total {
  display: flex;
  align-items: baseline;
  gap: 10px;
  border: 1px solid #c7ddff;
  border-radius: 8px;
  background: #f7fbff;
  padding: 14px;
}

.reward-total.secondary {
  background: #fbfcfe;
  border-color: var(--line);
}

.reward-total strong {
  font-size: 34px;
  line-height: 1;
}

.reward-total span {
  color: var(--muted);
  font-weight: 800;
}

.redeem-controls {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 120px auto;
  align-items: end;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
  padding: 14px;
  margin-bottom: 14px;
}

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

.daily-check-card {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
  padding: 14px;
}

.daily-check-card h3 {
  font-size: 18px;
}

.daily-check-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 120px;
  gap: 12px;
}

.practice-card dl {
  display: grid;
  gap: 10px;
  margin: 0;
}

.practice-card dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.practice-card dd {
  margin: 0;
  line-height: 1.45;
}

.recording-panel {
  display: grid;
  gap: 12px;
  border: 1px solid #c7ddff;
  border-radius: 8px;
  background: #f7fbff;
  padding: 14px;
}

.recording-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.recording-header h3 {
  font-size: 18px;
}

.recording-chip {
  border: 1px solid #c7ddff;
  border-radius: 999px;
  background: white;
  color: #164a9f;
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 900;
}

.recording-chip.active {
  border-color: #ffc46b;
  background: #fff8eb;
  color: #8a5600;
}

.recording-chip.ready {
  border-color: #b9dfca;
  background: #f1fbf5;
  color: #1f6f4b;
}

.recording-video {
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #101723;
}

.recording-controls,
.recording-fields {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, max-content));
  gap: 10px;
}

.recording-fields {
  grid-template-columns: minmax(180px, 0.8fr) minmax(220px, 1.2fr);
}

.recording-detail {
  display: grid;
  gap: 8px;
}

.recording-link {
  width: fit-content;
  color: var(--accent);
  font-weight: 800;
}

.mode-pill {
  width: fit-content;
  border: 1px solid #c7ddff;
  border-radius: 999px;
  padding: 6px 10px;
  background: #edf4ff;
  color: #164a9f;
  font-size: 12px;
  font-weight: 900;
}

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

.self-check-grid input {
  max-width: 92px;
}

.history {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.history-item {
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbfcfe;
}

.inline-action {
  width: fit-content;
  min-height: 34px;
  margin-top: 4px;
}

.detail {
  margin-top: 16px;
  border: 1px solid #c7ddff;
  border-radius: 8px;
  background: #f7fbff;
  padding: 14px;
}

.detail-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.detail dl {
  display: grid;
  gap: 8px;
  margin: 0;
}

.detail dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.detail dd {
  margin: 0;
  line-height: 1.45;
}

.answer-text {
  white-space: pre-wrap;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  padding: 12px;
}

.feedback-form {
  margin-top: 16px;
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

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

.checkbox-label {
  align-content: end;
}

.checkbox-label input {
  width: auto;
  margin-right: 8px;
}

.history-item span,
.muted,
.message {
  color: var(--muted);
}

.message {
  min-height: 22px;
}

.hidden {
  display: none !important;
}

@media (max-width: 780px) {
  .app-layout,
  .self-check-grid,
  .feedback-controls,
  .admin-actions,
  .redeem-controls,
  .reward-totals,
  .daily-check-grid,
  .recording-controls,
  .recording-fields {
    grid-template-columns: 1fr;
  }
}
