:root {
  color-scheme: light;
  --bg: #f4f6fa;
  --bg-2: #f4f6fa;
  --panel: #ffffff;
  --panel-strong: #ffffff;
  --line: rgba(26, 43, 94, 0.16);
  --text: #1c1c2e;
  --muted: #6b7280;
  --blue: #1a2b5e;
  --mint: #1d7a6b;
  --amber: #e87722;
  --period-p1: #e87722;
  --period-p2: #1d7a6b;
  --period-p3: #1a2b5e;
  --danger: #ff6b86;
  --shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  --radius: 8px;
  font-size: 16px;
}

* {
  box-sizing: border-box;
}

body * {
  font-family: "Inter", sans-serif;
}

h1,
h2,
h3,
.card-title {
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
}

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

button {
  cursor: pointer;
}

.ambient {
  display: none;
}

.ambient-one {
  width: 22rem;
  height: 22rem;
  left: -8rem;
  top: 18rem;
  background: rgba(55, 167, 255, 0.22);
}

.ambient-two {
  width: 18rem;
  height: 18rem;
  right: -5rem;
  bottom: 8rem;
  background: rgba(255, 179, 71, 0.16);
}

.institution-header {
  position: relative;
  z-index: 2;
  max-width: 1440px;
  margin: 0 auto;
  padding: 10px 22px 0;
  background: #ffffff;
}

.institution-letterhead {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
  object-position: center;
}

.app-shell {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 20px;
  width: min(1440px, 100%);
  margin: 18px auto 0;
  padding: 0 22px 28px;
}

.sidebar {
  position: sticky;
  top: 18px;
  align-self: start;
  min-height: calc(100vh - 40px);
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #1a2b5e;
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.brand-mark {
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  border-radius: 50%;
  background: #e87722;
  color: #ffffff;
  font-family: Inter, "Segoe UI", system-ui, sans-serif;
  font-weight: 700;
  font-size: 1.15rem;
}

.brand-mark.large {
  width: 96px;
  height: 96px;
  font-size: 2rem;
  margin-bottom: 14px;
}

.brand-block strong,
.brand-block small {
  display: block;
}

.brand-block small,
.sync-card span,
.eyebrow {
  color: var(--muted);
}

.sidebar .brand-block strong,
.sidebar .brand-block small,
.sidebar .sync-card span {
  color: #eef5ff;
}

.nav-list {
  display: grid;
  gap: 8px;
  margin: 18px 0;
}

.nav-item {
  width: 100%;
  padding: 13px 14px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  color: rgba(238, 245, 255, 0.78);
  font-family: Inter, "Segoe UI", system-ui, sans-serif;
  font-size: 13px;
  font-weight: 600;
  text-align: left;
  transition: 180ms ease;
}

.nav-item:hover {
  border-color: transparent;
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.nav-item.active {
  border-color: transparent;
  border-left: 4px solid #ffffff;
  background: #e87722;
  color: #ffffff;
}

.sync-card {
  margin-top: auto;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.1);
}

.auth-card {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.1);
}

.auth-card span,
.auth-card strong {
  color: #eef5ff;
}

.auth-card strong {
  font-size: 0.9rem;
}

.auth-help {
  margin: 0;
  color: rgba(238, 245, 255, 0.82);
  font-size: 0.78rem;
  line-height: 1.35;
}

.google-signin {
  display: grid;
  min-height: 44px;
  place-items: center;
  overflow: hidden;
  border-radius: 8px;
  background: #ffffff;
}

.hidden {
  display: none !important;
}

.sync-card strong {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  color: #ffffff !important;
  font-size: 0.9rem;
}

.sync-card strong::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.72);
  animation: pulse-status 1.6s infinite;
}

@keyframes pulse-status {
  0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.72); }
  70% { box-shadow: 0 0 0 9px rgba(34, 197, 94, 0); }
  100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

.workspace {
  min-width: 0;
}

.screen {
  display: none;
  animation: rise 260ms ease both;
}

.screen.active {
  display: block;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero,
.panel,
.metric-card,
.project-card,
.resource-card,
.portfolio-column,
.showcase-stage,
.modal-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: none;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 24px;
  align-items: center;
  padding: clamp(24px, 4vw, 44px);
}

.hidden-progress {
  display: none;
}

.acronym-card {
  min-height: 260px;
  padding: 24px;
  border: 1px solid rgba(59, 89, 152, 0.24);
  border-radius: var(--radius);
  background: linear-gradient(160deg, rgba(59, 89, 152, 0.16), rgba(219, 229, 242, 0.9));
}

.acronym-card strong {
  display: block;
  color: var(--blue);
  font-size: 1.25rem;
  text-align: center;
}

.usage-panel {
  margin: 16px 0;
}

.steps {
  display: grid;
  gap: 10px;
  margin: 12px 0 0;
  padding-left: 22px;
  color: var(--text);
  line-height: 1.55;
}

.eyebrow {
  margin: 0 0 8px;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 760px;
  margin-bottom: 14px;
  font-size: clamp(2rem, 3.9vw, 3.35rem);
  line-height: 1.06;
  letter-spacing: 0;
}

h1,
h2,
h3,
.screen-title h2,
.panel-head h2,
.planning-card h3 {
  font-family: "Space Grotesk", Inter, system-ui, sans-serif;
  font-weight: 700;
}

h2 {
  margin-bottom: 8px;
  font-size: clamp(1.45rem, 3vw, 2.2rem);
  letter-spacing: 0;
}

h3 {
  margin-bottom: 8px;
}

p {
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.6;
}

.hero-actions,
.mini-actions,
.showcase-top,
.panel-head,
.screen-title,
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}

.hero-actions,
.mini-actions {
  justify-content: flex-start;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 10px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font-family: Inter, "Segoe UI", system-ui, sans-serif;
  font-weight: 600;
  text-decoration: none;
  transition: 180ms ease;
}

.button:hover {
  transform: translateY(-1px);
  border-color: #e87722;
}

.button:disabled {
  cursor: progress;
  opacity: 0.7;
  transform: none;
}

.button.primary {
  border: 0;
  background: #1a2b5e;
  color: #ffffff;
}

.button.primary:hover {
  background: #e87722;
}

.button.soft {
  background: rgba(55, 167, 255, 0.12);
}

.button.small {
  min-height: 34px;
  padding: 7px 11px;
  font-size: 0.86rem;
}

.button.danger {
  border-color: rgba(198, 55, 77, 0.26);
  background: rgba(198, 55, 77, 0.09);
  color: #9d263a;
}

.orbital-card {
  display: grid;
  justify-items: center;
  gap: 14px;
}

.progress-ring {
  display: grid;
  width: 178px;
  height: 178px;
  place-items: center;
  border-radius: 50%;
  background:
    radial-gradient(circle closest-side, #ffffff 74%, transparent 76%),
    conic-gradient(var(--mint) calc(var(--value) * 1%), rgba(255, 255, 255, 0.09) 0);
  box-shadow: 0 0 34px rgba(71, 240, 191, 0.18);
}

.progress-ring span {
  font-size: 2.1rem;
  font-weight: 900;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin: 16px 0;
}

.metric-card {
  padding: 18px;
}

.metric-card span {
  display: block;
  color: var(--muted);
}

.metric-card strong {
  display: block;
  margin-top: 8px;
  font-size: 2.4rem;
}

.content-grid,
.knowledge-layout,
.form-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 16px;
}

.access-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  margin-bottom: 18px;
  border-left: 4px solid var(--amber);
}

.is-authenticated #writerGate {
  display: none;
}

.span-7 {
  grid-column: span 7;
}

.span-5 {
  grid-column: span 5;
}

.panel {
  padding: 20px;
}

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

.toolbar {
  justify-content: flex-start;
  margin-bottom: 16px;
}

.field,
label input,
label select,
label textarea {
  width: 100%;
  min-height: 42px;
  border: 0;
  border-bottom: 2px solid #1a2b5e;
  border-radius: 0;
  background: #ffffff;
  color: var(--text);
  padding: 10px 12px;
  font-size: 1rem;
  outline: none;
}

.field:focus,
label input:focus,
label select:focus,
label textarea:focus {
  border-color: #1a2b5e;
  box-shadow: 0 2px 0 #1a2b5e;
}

input[type="search"].field {
  padding-left: 38px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    #ffffff
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%236B7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E")
    no-repeat 12px center;
}

input[type="search"].field:focus {
  border-color: #1a2b5e;
  box-shadow: 0 0 0 3px rgba(26, 43, 94, 0.12);
}

select option {
  background: #eef4fb;
  color: var(--text);
}

.field.compact {
  max-width: 260px;
}

.timeline,
.stack-list,
.feed-list {
  display: grid;
  gap: 12px;
}

.timeline-item,
.stack-item,
.feed-item {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(59, 89, 152, 0.045);
}

.timeline-item {
  display: grid;
  grid-template-columns: 160px 1fr auto;
  gap: 14px;
  align-items: center;
}

.bar {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(59, 89, 152, 0.12);
}

.bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #1a2b5e;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(55, 167, 255, 0.14);
  color: var(--text);
  font-size: 0.8rem;
  font-weight: 900;
}

.badge.warn {
  background: rgba(255, 179, 71, 0.18);
  color: #8f5a0c;
}

.badge.danger {
  background: rgba(255, 107, 134, 0.18);
  color: #b83250;
}

.badge.success {
  background: rgba(71, 240, 191, 0.18);
  color: #0f6d5d;
}

.period-badge {
  margin-bottom: 10px;
  color: #ffffff;
  font-size: 0.76rem;
}

.period-badge.period-p1 { background: var(--period-p1); }
.period-badge.period-p2 { background: var(--period-p2); }
.period-badge.period-p3 { background: var(--period-p3); }

.project-grid,
.resource-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.project-card,
.resource-card {
  position: relative;
  overflow: hidden;
  padding: 18px;
}

.project-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: var(--accent, var(--blue));
}

.project-card header,
.resource-card header {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  justify-content: space-between;
}

.project-icon {
  display: grid;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 8px;
  background: color-mix(in srgb, var(--accent, var(--blue)) 24%, transparent);
  color: var(--accent, var(--blue));
  font-weight: 900;
}

.logo-slot {
  display: grid;
  min-height: 112px;
  margin: 14px 0;
  place-items: center;
  border: 1px dashed rgba(59, 89, 152, 0.28);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(59, 89, 152, 0.08), rgba(31, 159, 139, 0.06)),
    #eef4fb;
  color: var(--blue);
  font-weight: 900;
  text-align: center;
}

.logo-slot.has-logo {
  min-height: 142px;
  padding: 10px;
  background: #ffffff;
  border-style: solid;
}

.logo-slot img {
  max-width: 100%;
  max-height: 132px;
  object-fit: contain;
}

.logo-slot a {
  display: none;
  margin-top: 8px;
  color: var(--teal);
  font-size: 0.9rem;
  font-weight: 800;
}

.logo-slot.logo-error img {
  display: none;
}

.logo-slot.logo-error a {
  display: inline-flex;
}

.stage-list {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.final-folder {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  margin: 8px 0 10px;
  color: var(--teal);
  font-weight: 800;
  font-size: 0.92rem;
  text-decoration: none;
}

.final-folder::before {
  content: "↗";
  margin-right: 6px;
  font-weight: 900;
}

.final-folder.pending {
  color: var(--muted);
}

.final-folder.pending::before {
  content: "";
  margin: 0;
}

.final-grid {
  display: grid;
  grid-template-columns: minmax(320px, 0.9fr) minmax(0, 1.1fr);
  gap: 18px;
}

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

.inline-form .wide,
.inline-form button,
.inline-form .form-status {
  grid-column: 1 / -1;
}

.final-report-item {
  display: grid;
  gap: 12px;
}

.evaluation-chip {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f8fbff;
}

.evaluation-chip b,
.evaluation-chip span {
  display: block;
}

.evaluation-chip span {
  color: var(--muted);
  font-size: 0.92rem;
  margin-top: 2px;
}

.final-list-panel {
  grid-column: 1 / -1;
}

.socialization-showcase {
  display: grid;
  gap: 16px;
}

.social-project-head {
  display: grid;
  grid-template-columns: minmax(130px, 180px) minmax(0, 1fr);
  gap: 18px;
  align-items: center;
}

.social-project-head .logo-slot {
  margin: 0;
}

.compact-metrics {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.manual-block {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f8fbff;
}

.manual-block h4 {
  margin: 0 0 10px;
  color: var(--text);
}

.manual-block ul {
  margin: 0;
  padding-left: 18px;
  color: var(--text);
}

.welcome-modal .modal-card {
  max-width: 560px;
}

.welcome-card h2 {
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.05;
}

.remember-line {
  display: flex;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-weight: 700;
}

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

.aportes-mini {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.aportes-mini li {
  padding: 9px 10px;
  border-radius: 8px;
  background: rgba(59, 89, 152, 0.08);
}

.aportes-mini strong,
.aportes-mini span {
  display: block;
}

.aportes-mini span {
  color: var(--muted);
  font-size: 0.86rem;
}

.stage {
  display: grid;
  grid-template-columns: 1fr 72px;
  gap: 10px;
  align-items: center;
  color: var(--muted);
  font-size: 0.9rem;
}

.knowledge-layout .graph-panel {
  grid-column: span 7;
}

.knowledge-layout > .panel:last-child {
  grid-column: span 5;
}

.knowledge-graph {
  position: relative;
  min-height: 430px;
  overflow: hidden;
}

.graph-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.graph-svg line {
  stroke: rgba(31, 159, 139, 0.56);
  stroke-width: 0.32;
}

.node {
  position: absolute;
  display: grid;
  width: 142px;
  min-height: 72px;
  place-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(239, 245, 252, 0.92);
  text-align: center;
  font-weight: 800;
}

.node.core {
  left: calc(50% - 78px);
  top: calc(50% - 44px);
  width: 156px;
  background: linear-gradient(135deg, rgba(59, 89, 152, 0.95), rgba(31, 159, 139, 0.88));
  color: #ffffff;
}

.edge {
  position: absolute;
  left: 50%;
  top: 50%;
  width: var(--length);
  height: 1px;
  transform: rotate(var(--angle));
  transform-origin: left center;
  background: linear-gradient(90deg, rgba(71, 240, 191, 0.6), transparent);
}

.resource-card a,
.feed-item a {
  color: var(--mint);
  overflow-wrap: anywhere;
}

.portfolio-board {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 18px;
}

.planning-board,
.report-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.planning-card {
  position: relative;
  padding: 20px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--period-p1);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
  color: #1c1c2e;
}

.planning-card::before {
  display: none;
}

.planning-card.period-p1 { border-left-color: var(--period-p1); }
.planning-card.period-p2 { border-left-color: var(--period-p2); }
.planning-card.period-p3 { border-left-color: var(--period-p3); }

.planning-card h3 {
  color: #1c1c2e;
  font-size: 17px;
  line-height: 1.25;
}

.planning-card > p {
  color: #6b7280;
  font-family: Inter, system-ui, sans-serif;
  font-size: 12.5px;
}

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

.planning-card dt {
  color: var(--text);
  font-family: Inter, system-ui, sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.planning-card dd {
  margin: 0;
  color: #1c1c2e;
  line-height: 1.55;
  font-size: 14px;
}

.clamped-text {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  color: #1c1c2e;
  font-size: 14px;
}

.project-card,
.resource-card,
.portfolio-column,
.metric-card,
.panel,
.feed-item,
.portfolio-item {
  background: #ffffff;
  color: #1c1c2e;
}

.project-card p,
.resource-card p,
.portfolio-item p,
.feed-item p,
.stack-item p,
.timeline-item,
.planning-card p {
  color: #1c1c2e;
  font-size: 14px;
  opacity: 1;
}

.project-card h3,
.resource-card h3,
.portfolio-column h3 {
  color: #1c1c2e;
  font-size: 16px;
}

.link-button {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 8px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--blue);
  font-weight: 900;
  text-decoration: none;
}

.link-button.period-p1 { color: var(--period-p1); }
.link-button.period-p2 { color: var(--period-p2); }
.link-button.period-p3 { color: var(--period-p3); }

.portfolio-column {
  min-height: 320px;
  padding: 18px;
}

.portfolio-item {
  margin-top: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(59, 89, 152, 0.045);
}

.form-grid .form-panel {
  grid-column: span 6;
}

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

.form-panel :disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.readonly-field {
  background: #eef5ff;
  color: var(--blue);
  font-weight: 700;
}

.form-panel h3,
.form-panel .wide,
.form-panel button,
.form-panel .form-status {
  grid-column: 1 / -1;
}

.form-status {
  min-height: 38px;
  margin: 0;
  padding: 10px 12px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  background: rgba(59, 89, 152, 0.07);
  color: var(--muted);
  font-weight: 800;
}

.form-status:empty {
  display: none;
}

.form-status.pending {
  border-color: rgba(216, 137, 34, 0.35);
  background: rgba(216, 137, 34, 0.12);
  color: #79500f;
}

.form-status.success {
  border-color: rgba(31, 159, 139, 0.32);
  background: rgba(31, 159, 139, 0.12);
  color: #126f62;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-weight: 700;
}

textarea {
  resize: vertical;
}

.showcase-stage {
  min-height: calc(100vh - 180px);
  padding: clamp(24px, 4vw, 48px);
}

.showcase-content {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 28px;
  align-items: center;
  min-height: 520px;
}

.showcase-title {
  font-size: clamp(2.6rem, 7vw, 6rem);
  line-height: 0.93;
}

.showcase-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.modal {
  width: min(720px, calc(100% - 28px));
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--text);
}

.modal::backdrop {
  background: rgba(0, 0, 0, 0.68);
  backdrop-filter: blur(8px);
}

.modal-card {
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 22px;
}

.read-modal {
  display: block;
  max-height: min(78vh, 680px);
  overflow: auto;
}

.modal-meta {
  margin-bottom: 16px;
  color: var(--blue);
  font-weight: 800;
}

.modal-text {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(59, 89, 152, 0.07);
  color: var(--text);
  font-size: 1.12rem;
  line-height: 1.75;
  white-space: pre-wrap;
}

.period-detail {
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.period-detail:first-child {
  padding-top: 0;
}

.period-detail:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.period-detail h3 {
  margin-bottom: 6px;
  color: var(--blue);
  font-size: 1.18rem;
}

.period-detail p {
  margin-bottom: 0;
  color: var(--text);
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 20;
  width: min(380px, calc(100vw - 44px));
  padding: 16px 18px;
  border: 1px solid rgba(31, 159, 139, 0.24);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
  color: var(--text);
  opacity: 0;
  transform: translateY(14px);
  transition: 220ms ease;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.toast strong {
  display: block;
  color: var(--blue);
}

.modal-card h2,
.modal-card .eyebrow,
.modal-card .wide,
.modal-card button[type="submit"] {
  grid-column: 1 / -1;
}

.close-button {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  font-size: 1.4rem;
}

.empty {
  padding: 18px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  color: var(--muted);
}

@media (max-width: 1120px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    min-height: auto;
  }

  .nav-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .hero,
  .showcase-content,
  .knowledge-layout,
  .content-grid,
  .access-panel {
    grid-template-columns: 1fr;
  }

  .span-7,
  .span-5,
  .knowledge-layout .graph-panel,
  .knowledge-layout > .panel:last-child,
  .form-grid .form-panel {
    grid-column: auto;
  }

  .metric-grid,
  .project-grid,
  .resource-grid,
  .portfolio-board,
  .admin-grid,
  .planning-board,
  .report-grid,
  .final-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .institution-header {
    padding-inline: 12px;
  }

  .metric-grid,
  .project-grid,
  .resource-grid,
  .portfolio-board,
  .admin-grid,
  .planning-board,
  .report-grid,
  .final-grid,
  .inline-form,
  .form-panel,
  .modal-card,
  .showcase-metrics {
    grid-template-columns: 1fr;
  }

  .nav-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }

  .social-project-head,
  .compact-metrics {
    grid-template-columns: 1fr;
  }

  .nav-item {
    min-height: 44px;
    padding: 9px 10px;
    font-size: 12px;
  }

  .timeline-item {
    grid-template-columns: 1fr;
  }

  .knowledge-graph {
    min-height: 620px;
  }

  .node {
    position: static;
    width: 100%;
    margin-bottom: 10px;
  }

  .edge {
    display: none;
  }
}

@media (max-width: 420px) {
  .nav-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
