:root {
  --navy: #203a5f;
  --navy-dark: #162a45;
  --blue: #3f6fa7;
  --sky: #eaf3fb;
  --gold: #e7b455;
  --cream: #fffaf0;
  --text: #203047;
  --muted: #6f7d8f;
  --line: #dfe6ee;
  --white: #ffffff;
  --shadow: 0 14px 38px rgba(32, 58, 95, 0.12);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Inter, system-ui, sans-serif;
  color: var(--text);
  background: #f4f7fb;
}
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 28px;
  background: rgba(255,255,255,.96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}
.brand-wrap { display: flex; align-items: center; gap: 14px; }
.brand-mark {
  width: 48px; height: 48px; border-radius: 14px;
  display: grid; place-items: center;
  background: linear-gradient(145deg, var(--navy), var(--blue));
  color: #fff; font-family: Nunito, sans-serif; font-weight: 800;
}
h1 { margin: 0; font-size: 1.15rem; }
.brand-wrap p { margin: 3px 0 0; color: var(--muted); font-size: .88rem; }
.top-actions { display: flex; gap: 10px; }
.btn {
  border: 0; border-radius: 10px; padding: 11px 16px;
  font-weight: 700;
}
.btn.primary { background: var(--navy); color: #fff; }
.btn.secondary { background: var(--sky); color: var(--navy); }
.btn.light { background: #fff; color: var(--navy); }
.btn.small { padding: 9px 12px; font-size: .9rem; }
.icon-btn { border: 0; background: transparent; font-size: 1.1rem; color: var(--muted); }
.app-shell { display: grid; grid-template-columns: 300px 1fr; min-height: calc(100vh - 85px); }
.sidebar {
  background: var(--white);
  border-right: 1px solid var(--line);
  padding: 22px 16px;
}
.sidebar-head { display: flex; justify-content: space-between; align-items: center; padding: 0 8px 12px; font-weight: 800; }
.plan-list { display: grid; gap: 8px; }
.plan-item {
  width: 100%; text-align: left; border: 1px solid transparent;
  background: transparent; border-radius: 12px; padding: 12px;
}
.plan-item:hover { background: #f7f9fc; }
.plan-item.active { background: var(--sky); border-color: #c9dff2; }
.plan-date { display: block; font-size: .78rem; color: var(--muted); margin-bottom: 4px; }
.plan-name { display: block; font-weight: 800; }
.plan-meta { display: block; font-size: .78rem; color: var(--muted); margin-top: 4px; }
.workspace { padding: 28px; max-width: 1280px; width: 100%; margin: 0 auto; }
.hero-card {
  display: flex; justify-content: space-between; gap: 20px; align-items: center;
  padding: 24px 26px; border-radius: 18px; color: #fff;
  background: linear-gradient(135deg, var(--navy), #315b8c);
  box-shadow: var(--shadow); margin-bottom: 20px;
}
.eyebrow { font-size: .78rem; font-weight: 800; letter-spacing: .12em; opacity: .78; }
.hero-card h2 { margin: 8px 0 6px; font-family: Nunito, sans-serif; font-size: 2rem; }
.hero-card p { margin: 0; opacity: .86; }
.status-wrap { display: grid; gap: 6px; min-width: 150px; }
.status-wrap label { font-size: .75rem; opacity: .8; }
.status-wrap select { border: 0; border-radius: 9px; padding: 10px; }
.grid { display: grid; gap: 20px; margin-bottom: 20px; }
.two-col { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.panel {
  background: #fff; border: 1px solid var(--line); border-radius: 16px;
  padding: 22px; box-shadow: 0 8px 24px rgba(32, 58, 95, .05);
}
.panel h3 { margin: 0 0 16px; font-size: 1.05rem; }
.panel label { display: block; font-size: .8rem; font-weight: 700; margin: 12px 0 6px; color: var(--muted); }
input, textarea, select {
  width: 100%; border: 1px solid var(--line); border-radius: 10px;
  padding: 11px 12px; color: var(--text); background: #fff;
}
textarea { resize: vertical; }
.panel-heading { display: flex; justify-content: space-between; gap: 16px; align-items: center; margin-bottom: 16px; }
.panel-heading h3 { margin-bottom: 4px; }
.panel-heading p { margin: 0; color: var(--muted); font-size: .88rem; }
.media-list, .resource-list { display: grid; gap: 14px; }
.media-card, .resource-card {
  display: grid; grid-template-columns: 150px 1fr auto; gap: 14px; align-items: center;
  border: 1px solid var(--line); border-radius: 14px; padding: 12px;
}
.resource-panel { margin-bottom: 20px; }
.resource-icon {
  min-height: 88px; border-radius: 10px; background: var(--cream); border: 1px solid #f0dfbd;
  display: grid; place-items: center; color: #8a6420; font-size: .78rem; font-weight: 800; letter-spacing: .06em;
}
.resource-fields { display: grid; gap: 8px; }
.resource-type-row { display: grid; grid-template-columns: 140px 1fr; gap: 8px; }
.media-thumb {
  aspect-ratio: 16/9; border-radius: 10px; background: #edf1f6;
  overflow: hidden; display: grid; place-items: center; color: var(--muted); font-weight: 700;
}
.media-thumb img { width: 100%; height: 100%; object-fit: cover; }
.media-fields { display: grid; gap: 8px; }
.media-type-row { display: grid; grid-template-columns: 140px 1fr; gap: 8px; }
.media-actions { display: grid; gap: 8px; }
.link-btn { text-decoration: none; text-align: center; }
.comments-list { display: grid; gap: 10px; max-height: 260px; overflow: auto; margin-bottom: 14px; }
.comment { background: #f7f9fc; border-radius: 11px; padding: 11px 12px; }
.comment strong { display: block; margin-bottom: 4px; }
.comment small { color: var(--muted); }
.comment-form { display: grid; gap: 8px; }
.toast {
  position: fixed; right: 24px; bottom: 24px; background: var(--navy-dark); color: #fff;
  padding: 12px 16px; border-radius: 10px; opacity: 0; transform: translateY(12px);
  transition: .2s ease; pointer-events: none;
}
.toast.show { opacity: 1; transform: translateY(0); }
.presentation {
  position: fixed; inset: 0; z-index: 100; background: linear-gradient(145deg, var(--navy-dark), var(--navy));
  color: #fff; display: grid; grid-template-rows: auto 1fr auto; padding: 24px;
}
.presentation.hidden { display: none; }
.presentation-top { display: flex; justify-content: space-between; align-items: center; }
.slide-content { display: grid; place-items: center; text-align: center; padding: 40px; }
.slide-inner { max-width: 1000px; width: 100%; }
.slide-kicker { font-size: 1rem; letter-spacing: .14em; text-transform: uppercase; opacity: .7; font-weight: 800; }
.slide-title { font-family: Nunito, sans-serif; font-size: clamp(2.5rem, 7vw, 6rem); margin: 16px 0; }
.slide-body { font-size: clamp(1.4rem, 3vw, 2.6rem); line-height: 1.35; }
.slide-video {
  width: min(900px, 92vw); aspect-ratio: 16/9; border: 0; border-radius: 16px; margin-top: 20px; background: #000;
}
.presentation-controls { display: flex; justify-content: center; gap: 12px; }
@media (max-width: 900px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { border-right: 0; border-bottom: 1px solid var(--line); }
  .plan-list { grid-auto-flow: column; grid-auto-columns: minmax(210px, 1fr); overflow-x: auto; }
  .two-col { grid-template-columns: 1fr; }
  .media-card, .resource-card { grid-template-columns: 110px 1fr; }
  .media-actions { grid-column: 1 / -1; grid-template-columns: 1fr 1fr; }
}
@media (max-width: 620px) {
  .topbar { align-items: flex-start; padding: 14px; }
  .brand-wrap p { display: none; }
  .top-actions { flex-direction: column; }
  .workspace { padding: 16px; }
  .hero-card { align-items: flex-start; flex-direction: column; }
  .status-wrap { width: 100%; }
  .media-card, .resource-card { grid-template-columns: 1fr; }
  .media-thumb { width: 100%; }
  .media-type-row, .resource-type-row { grid-template-columns: 1fr; }
}


/* Resource dialog and v0.2 controls */
.eyebrow.dark { color: var(--blue); opacity: 1; }
.modal { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 18px; background: rgba(17, 31, 51, .62); }
.modal.hidden { display: none; }
.modal-card { width: min(620px, 100%); max-height: 92vh; overflow: auto; background: #fff; border-radius: 18px; padding: 24px; box-shadow: 0 24px 80px rgba(0,0,0,.28); }
.modal-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 18px; }
.modal-head h2 { margin: 6px 0 0; }
.modal-close { font-size: 2rem; line-height: 1; }
.resource-form { display: grid; gap: 8px; }
.resource-form label { margin-top: 8px; font-size: .82rem; color: var(--muted); font-weight: 700; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }
.resource-folder { display: inline-flex; align-items: center; width: fit-content; border-radius: 999px; background: var(--sky); color: var(--navy); padding: 5px 9px; font-size: .75rem; font-weight: 800; }
.resource-summary { display: grid; gap: 7px; }
.resource-summary h4 { margin: 0; font-size: 1rem; }
.resource-summary p { margin: 0; color: var(--muted); font-size: .86rem; line-height: 1.45; }
.resource-url-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 620px; }
.resource-actions { display: grid; gap: 8px; }
.danger-text { color: #a43838 !important; background: #fff0f0 !important; }
.autosave-note { color: var(--muted); font-size: .78rem; }
@media (max-width: 620px) { .modal-card { padding: 18px; } .modal-actions { display: grid; grid-template-columns: 1fr 1fr; } .resource-actions { grid-template-columns: 1fr 1fr 1fr; } }

/* v0.3 high-contrast action system */
:root {
  --action-blue: #2563eb;
  --action-blue-dark: #1d4ed8;
  --action-green: #15803d;
  --action-green-dark: #166534;
  --action-amber: #d97706;
  --action-amber-dark: #b45309;
  --action-red: #dc2626;
  --action-red-dark: #b91c1c;
  --action-slate: #475569;
  --action-slate-dark: #334155;
}
.btn {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 2px solid transparent;
  box-shadow: 0 5px 13px rgba(15, 23, 42, .14);
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 8px 18px rgba(15, 23, 42, .20); }
.btn:active { transform: translateY(0); box-shadow: 0 3px 8px rgba(15, 23, 42, .16); }
.btn:focus-visible { outline: 3px solid rgba(37, 99, 235, .28); outline-offset: 3px; }
.btn.small { min-height: 40px; }
.btn.action-add, .btn.action-save, .btn.action-post {
  background: var(--action-blue); color: #fff; border-color: var(--action-blue-dark);
}
.btn.action-add:hover, .btn.action-save:hover, .btn.action-post:hover { background: var(--action-blue-dark); }
.btn.action-start, .btn.action-open {
  background: var(--action-green); color: #fff; border-color: var(--action-green-dark);
}
.btn.action-start:hover, .btn.action-open:hover { background: var(--action-green-dark); }
.btn.action-edit {
  background: var(--action-amber); color: #fff; border-color: var(--action-amber-dark);
}
.btn.action-edit:hover { background: var(--action-amber-dark); }
.btn.action-delete {
  background: var(--action-red); color: #fff; border-color: var(--action-red-dark);
}
.btn.action-delete:hover { background: var(--action-red-dark); }
.btn.action-cancel {
  background: var(--action-slate); color: #fff; border-color: var(--action-slate-dark);
}
.btn.action-cancel:hover { background: var(--action-slate-dark); }
.btn.secondary {
  background: #e2e8f0; color: #1e293b; border-color: #94a3b8; box-shadow: none;
}
.btn.light { border: 2px solid rgba(255,255,255,.65); box-shadow: 0 5px 14px rgba(0,0,0,.18); }
.media-panel { border-top: 5px solid #2563eb; }
.resource-panel { border-top: 5px solid #0f766e; }
.grid.two-col .panel:first-child { border-top: 5px solid #7c3aed; }
.grid.two-col .panel:last-child { border-top: 5px solid #4f46e5; }
.panel-heading .action-add { min-width: 145px; }
.resource-actions, .media-actions { min-width: 104px; }
@media (max-width: 620px) {
  .top-actions .btn { width: 100%; }
  .panel-heading { align-items: stretch; flex-direction: column; }
  .panel-heading .action-add { width: 100%; }
  .resource-actions .btn, .media-actions .btn { width: 100%; }
}

.action-email{background:#7c3aed;color:#fff;border-color:#6d28d9;box-shadow:0 5px 14px rgba(124,58,237,.25)}
.action-email:hover{background:#6d28d9;transform:translateY(-1px)}
.action-email:disabled{opacity:.65;cursor:wait;transform:none}
.recipient-box{display:flex;flex-direction:column;gap:.3rem;padding:1rem;border:1px solid #c4b5fd;background:#f5f3ff;border-radius:12px;margin-bottom:.25rem;color:#4c1d95}
.recipient-box span{font-size:.92rem;color:#5b21b6}
