:root {
  color-scheme: light;
  --paper: #f3f0e8;
  --surface: #fffdf7;
  --ink: #171c1f;
  --ink-soft: #485052;
  --line: #d4cdbf;
  --teal: #1f7775;
  --teal-dark: #145a59;
  --red: #b93833;
  --brass: #b78534;
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

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

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.teacher-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0;
}

.teacher-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
}

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

h1,
h2,
p {
  overflow-wrap: anywhere;
}

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

h1 {
  font-size: clamp(30px, 4vw, 48px);
  line-height: 1.04;
}

h2 {
  font-size: 22px;
  line-height: 1.18;
}

.lede {
  max-width: 720px;
  margin: 12px 0 0;
  color: var(--ink-soft);
  line-height: 1.55;
}

.back-link,
.primary-button,
.inline-form button,
.delete-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border-radius: var(--radius);
  font-weight: 800;
  text-decoration: none;
}

.back-link {
  flex: 0 0 auto;
  padding: 0 14px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
}

.notice,
.access-panel,
.upload-panel,
.resource-panel {
  margin-top: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.notice {
  padding: 14px 16px;
  color: var(--ink-soft);
}

.notice.is-good {
  border-color: #a8ccc6;
  background: #eef7f4;
  color: #225653;
}

.notice.is-warning {
  border-color: #e0c286;
  background: #fff7e6;
  color: #5b431f;
}

.notice.is-error {
  border-color: #e5aaa6;
  background: #fff0ef;
  color: #7b2d29;
}

.access-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 420px);
  gap: 24px;
  padding: 22px;
}

.access-panel p,
.helper-text,
.resource-meta {
  color: var(--ink-soft);
  line-height: 1.5;
}

code {
  padding: 2px 5px;
  border-radius: 4px;
  background: var(--paper);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.92em;
}

.access-form,
.upload-panel {
  display: grid;
  gap: 10px;
}

.inline-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

label {
  color: var(--ink);
  font-size: 14px;
  font-weight: 800;
}

input,
select {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fffefa;
  color: var(--ink);
}

input:focus,
select:focus {
  border-color: var(--teal);
  outline: 3px solid rgba(31, 119, 117, 0.16);
}

.inline-form button,
.primary-button {
  border: 1px solid var(--teal-dark);
  background: var(--teal);
  color: #fffefa;
}

.inline-form button:hover,
.inline-form button:focus-visible,
.primary-button:hover,
.primary-button:focus-visible {
  background: var(--teal-dark);
  outline: none;
}

.primary-button:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

.studio-grid {
  display: grid;
  grid-template-columns: minmax(300px, 420px) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.upload-panel,
.resource-panel {
  padding: 22px;
}

.section-heading {
  margin-bottom: 12px;
}

.helper-text {
  margin: 2px 0 8px;
  font-size: 14px;
}

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

.resource-item {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #faf7ef;
}

.resource-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.resource-title {
  margin: 0;
  font-weight: 900;
}

.resource-meta {
  margin: 0;
  font-size: 14px;
}

.agent-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 8px;
  border: 1px solid #b6d6d2;
  border-radius: 999px;
  background: #eef7f4;
  color: #225653;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.delete-button {
  justify-self: end;
  min-height: 36px;
  padding: 0 10px;
  border: 1px solid #e2aaa5;
  background: #fff0ef;
  color: #7b2d29;
}

.empty-state {
  margin: 0;
  color: var(--ink-soft);
  line-height: 1.5;
}

@media (max-width: 840px) {
  .teacher-header,
  .access-panel,
  .studio-grid {
    grid-template-columns: 1fr;
  }

  .teacher-header {
    display: grid;
  }

  .back-link {
    justify-self: start;
  }
}

@media (max-width: 520px) {
  .teacher-shell {
    width: min(100% - 24px, 1180px);
    padding-top: 20px;
  }

  .inline-form {
    grid-template-columns: 1fr;
  }

  .resource-title-row {
    display: grid;
  }

  .agent-pill {
    justify-self: start;
  }
}

