:root {
  --bg: #f6f2ee;
  --card: #ffffff;
  --ink: #171717;
  --muted: #6c6760;
  --accent: #f55d3e;
  --accent-dark: #c84930;
  --accent-soft: #fff3ee;
  --line: #e6dfd8;
  --shadow: 0 18px 44px rgba(23, 23, 23, 0.08);
  --radius: 20px;
  font-family: "Sora", "Space Grotesk", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at top, #fff5ec 0%, #f6f2ee 48%, #eee7df 100%);
  color: var(--ink);
}

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

.oa-app {
  min-height: 100vh;
  padding: 14px 14px 28px;
}

.oa-topbar,
.oa-shell {
  max-width: 760px;
  margin: 0 auto;
}

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

.oa-topbar h1 {
  margin: 4px 0 0;
  font-size: 2rem;
  line-height: 1;
}

.oa-topbar-actions {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.oa-topbar-session {
  text-align: right;
}

.oa-kicker {
  margin: 0;
  color: var(--accent-dark);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.oa-card {
  background: var(--card);
  border: 1px solid rgba(200, 73, 48, 0.1);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
}

.oa-subcard {
  margin-top: 12px;
  padding: 14px;
  box-shadow: none;
  background: #fbf8f4;
}

.oa-auth-card {
  max-width: 480px;
  margin: 10vh auto 0;
}

.oa-admin-view,
.oa-editor {
  display: grid;
  gap: 14px;
}

.oa-section-title,
.oa-card h2,
.oa-card h3 {
  margin: 0;
}

.oa-muted {
  color: var(--muted);
}

.oa-small {
  font-size: 0.88rem;
}

.oa-strong {
  font-weight: 700;
}

label {
  display: block;
  margin: 14px 0 6px;
  font-weight: 700;
}

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

textarea {
  resize: vertical;
}

.oa-primary,
.oa-ghost,
.oa-event-item,
.oa-search-item {
  border-radius: 14px;
  cursor: pointer;
}

.oa-primary {
  width: 100%;
  margin-top: 16px;
  border: none;
  padding: 14px 16px;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
  box-shadow: 0 10px 22px rgba(245, 93, 62, 0.28);
}

.oa-primary:disabled,
.oa-ghost:disabled {
  opacity: 0.6;
  cursor: default;
}

.oa-ghost {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink);
  padding: 11px 14px;
}

.oa-small-btn {
  width: auto;
  margin: 0;
  padding: 8px 12px;
}

.oa-danger {
  color: #b53016;
  border-color: rgba(181, 48, 22, 0.2);
}

.oa-row {
  display: flex;
  align-items: center;
}

.oa-row-spread {
  justify-content: space-between;
}

.oa-gap-sm {
  gap: 10px;
}

.oa-event-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.oa-link-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.oa-grid-2 {
  display: grid;
  gap: 12px;
}

.oa-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 0.78rem;
  font-weight: 800;
  background: var(--accent);
  color: #fff;
}

.oa-pill-soft {
  background: #f3eee8;
  color: #544d45;
}

.oa-pill-live {
  background: #fff3ee;
  color: var(--accent-dark);
}

.oa-pill-alert {
  background: #121212;
  color: #fff;
}

.oa-event-list,
.oa-assignment-list,
.oa-search-results {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.oa-event-picker {
  margin-top: 12px;
}

.oa-event-picker-head {
  align-items: center;
}

.oa-event-picker-head strong {
  display: block;
  flex: 1 1 auto;
  min-width: 0;
}

.oa-event-picker-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.oa-event-item,
.oa-search-item {
  display: grid;
  gap: 4px;
  width: 100%;
  padding: 14px;
  border: 1px solid var(--line);
  background: #fff;
  text-align: left;
}

.oa-event-item.is-selected {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.oa-event-date {
  color: var(--accent-dark);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.oa-card-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.oa-card-head > :last-child {
  flex-shrink: 0;
}

.oa-status-grid {
  margin-top: 12px;
}

.oa-status-box {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px 14px;
  background: #fbf8f4;
}

.oa-status-box strong {
  display: block;
  margin-top: 4px;
  font-size: 1.05rem;
}

.oa-status-box-alert {
  border-color: #b42318;
  background: #c21d12;
  color: #fff;
}

.oa-status-box-alert .oa-muted {
  color: rgba(255, 255, 255, 0.9);
}

.oa-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.oa-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 8px 12px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-weight: 700;
}

.oa-banner {
  margin-top: 12px;
  border-radius: 16px;
  padding: 12px 14px;
  font-weight: 600;
}

.oa-banner-soft {
  background: #f5f1ec;
  color: #4f4942;
}

.oa-banner-note {
  margin: 12px 0 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: #b42318;
  font-weight: 800;
}

.oa-deviation-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.oa-deviation-entry {
  display: grid;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fbf8f4;
}

.oa-deviation-controls {
  display: grid;
  gap: 10px;
}

.oa-deviation-entry strong {
  display: block;
  margin-top: 2px;
}

.oa-deviation-clear-btn {
  justify-self: start;
}

.oa-deviation-entry input:disabled {
  background: #f1ece6;
  color: var(--muted);
}

.oa-action-row {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.oa-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
}

.oa-toggle input {
  width: auto;
  margin: 0;
}

.oa-session-name {
  margin: 0;
  font-weight: 800;
}

.oa-error {
  margin-top: 12px;
  color: #b53016;
  font-weight: 700;
}

.oa-assignment-item {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  background: #faf7f3;
}

.oa-toast {
  position: fixed;
  left: 14px;
  right: 14px;
  bottom: 14px;
  z-index: 40;
  padding: 14px 16px;
  border-radius: 16px;
  background: #121212;
  color: #fff;
  font-weight: 700;
  box-shadow: 0 18px 40px rgba(18, 18, 18, 0.24);
}

.oa-toast[data-type="success"] {
  background: #1f7a45;
}

.oa-toast[data-type="error"] {
  background: #b53016;
}

.oa-modal-shell {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 16px;
}

.oa-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(18, 18, 18, 0.5);
}

.oa-modal {
  position: relative;
  z-index: 1;
  width: min(680px, 100%);
  max-height: min(80vh, 720px);
  overflow: auto;
  border-radius: var(--radius);
  background: var(--card);
  border: 1px solid rgba(200, 73, 48, 0.12);
  box-shadow: var(--shadow);
  padding: 18px;
}

.oa-modal-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.oa-modal-item {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  background: #faf7f3;
}

.oa-modal-item.is-failed {
  border-color: rgba(181, 48, 22, 0.24);
  background: #fff3ee;
}

.oa-modal-item.is-success {
  border-color: rgba(31, 122, 69, 0.18);
  background: #f4fbf6;
}

.oa-modal-item-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.oa-modal-item p {
  margin: 6px 0 0;
}

.oa-pill-danger {
  background: #b53016;
  color: #fff;
}

@media (min-width: 720px) {
  .oa-app {
    padding: 20px 20px 36px;
  }

  .oa-grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .oa-action-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .oa-topbar {
    flex-direction: column;
    align-items: stretch;
  }

  .oa-topbar-actions {
    justify-content: space-between;
    align-items: flex-start;
  }

  .oa-topbar-session {
    text-align: left;
  }

  .oa-event-picker-head {
    flex-direction: column;
    align-items: stretch;
  }

  .oa-event-picker-actions {
    width: 100%;
  }

  .oa-event-picker-actions .oa-ghost {
    flex: 1 1 0;
  }
}
