@font-face {
  font-family: "Archivo";
  src: url("/fonts/archivo-400.ttf") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Archivo";
  src: url("/fonts/archivo-600.ttf") format("truetype");
  font-style: normal;
  font-weight: 600;
  font-display: swap;
}

@font-face {
  font-family: "Archivo";
  src: url("/fonts/archivo-700.ttf") format("truetype");
  font-style: normal;
  font-weight: 700 900;
  font-display: swap;
}

@font-face {
  font-family: "Libre Caslon Text";
  src: url("/fonts/libre-caslon-400.ttf") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Libre Caslon Text";
  src: url("/fonts/libre-caslon-700.ttf") format("truetype");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}

:root {
  --m4-red: #bf1818;
  --m4-red-deep: #8f1010;
  --m4-sand: #f8b06c;
  --m4-green: #0e5e2c;
  --m4-green-deep: #083e1d;
  --m4-yellow: #ffcf02;
  --m4-paper: #fbf3e8;
  --m4-paper-raised: #fffdfa;
  --m4-ink: #1d1a17;
  --m4-muted: #5c534b;
  --m4-line: #e4d5c2;
  --m4-ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --m4-ease-move: cubic-bezier(0.77, 0, 0.175, 1);
  --ink: var(--m4-ink);
  --muted: var(--m4-muted);
  --brand: var(--m4-red);
  --brand-deep: var(--m4-red-deep);
  --cyan: var(--m4-yellow);
  --cyan-soft: #fff3b5;
  --navy: var(--m4-green);
  --surface: var(--m4-paper-raised);
  --surface-soft: #f7ecdf;
  --line: var(--m4-line);
  --success: var(--m4-green);
  --page: var(--m4-paper);
  --text: var(--m4-ink);
  --shadow: 0 24px 70px rgba(74, 42, 18, 0.14);
  --fill-f7fafb: var(--m4-paper);
  --fill-fbfdfd: var(--m4-paper);
  --fill-f5fafb: #f8ecdd;
  --fill-f4f8f9: var(--m4-paper);
  --fill-f6fafb: var(--m4-paper);
  --fill-f9fbfb: var(--m4-paper);
  --fill-ffffff: var(--m4-paper-raised);
  --fill-edf6f8: #f4e5d4;
  --fill-ebf8fa: #fff1df;
  --fill-eaf8fa: #fff1df;
  --fill-eefafd: #fff1df;
  --fill-f0fafc: #fff1df;
  --fill-f1fafb: #fff4e5;
  --fill-e7f8f2: #e6f1e9;
  --fill-25a77f: var(--m4-green);
  --fill-0b5669: var(--m4-green);
  --fill-0d6275: var(--m4-red);
  --fill-123f62: var(--m4-green-deep);
  --fill-153e61: var(--m4-green-deep);
  --fill-163e61: var(--m4-green-deep);
  --border-b8d3da: var(--m4-line);
  --border-cbe6eb: var(--m4-line);
  --border-cddde2: var(--m4-line);
  --border-d5e7eb: var(--m4-line);
  --border-d8e9ee: var(--m4-line);
  --border-dcebed: var(--m4-line);
  --border-e5edef: var(--m4-line);
  --border-e6eef0: var(--m4-line);
  --border-ffffff: #fff;
  --text-123947: var(--m4-ink);
  --text-103847: var(--m4-ink);
  --text-365866: #493d34;
  --text-486773: var(--m4-muted);
  --text-496975: var(--m4-muted);
  --text-54727c: var(--m4-muted);
  --text-5e7780: var(--m4-muted);
  --text-64818b: var(--m4-muted);
  --text-66808a: var(--m4-muted);
  --text-758b93: #75685d;
  --text-789098: #75685d;
  --text-82969e: #7b6f65;
  --text-82979e: #7b6f65;
  --text-84969c: #7b6f65;
  --text-84989f: #7b6f65;
  --text-8ba0a7: #7b6f65;
  --text-8ca0a7: #7b6f65;
  --text-ffffff: #fff;
  color: var(--m4-ink);
  background: var(--m4-paper);
  font-family: "Archivo", Arial, sans-serif;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #102f1a;
  --ink: #fff8ef;
  --muted: #dbcbb9;
  --surface: #173d23;
  --surface-soft: #204a2c;
  --surface-glass: rgba(23, 61, 35, 0.96);
  --line: #5d765f;
  --focus: var(--m4-sand);
  --brand: var(--m4-sand);
  --brand-deep: #ffd59f;
  --cyan: var(--m4-yellow);
  --cyan-soft: #4b441b;
  --navy: var(--m4-green-deep);
  --success: #a8ddb6;
  --shadow: 0 20px 60px rgba(4, 25, 12, 0.46);
}

html {
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
  overscroll-behavior: none;
  background: var(--m4-paper);
}

body {
  min-height: 100dvh;
  color: var(--m4-ink);
  background-color: var(--m4-paper);
  background-image: url("/m4/texturas/grao.png");
  background-size: 512px;
  font-family: "Archivo", Arial, sans-serif;
}

body::before {
  content: "PRÉVIA PARALELA · 4ª MOSTRA";
  position: fixed;
  z-index: 2147481000;
  inset: auto max(12px, env(safe-area-inset-right, 0px)) max(12px, env(safe-area-inset-bottom, 0px)) auto;
  min-height: 28px;
  padding: 6px 11px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 999px;
  color: white;
  background: rgba(14, 94, 44, 0.92);
  box-shadow: 0 8px 24px rgba(29, 26, 23, 0.18);
  backdrop-filter: blur(14px) saturate(140%);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
  line-height: 1.45;
  pointer-events: none;
}

button,
a,
[role="button"],
.chip,
.tab {
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

input,
textarea,
select {
  min-height: 48px;
  border-color: var(--m4-line) !important;
  border-radius: 13px !important;
  color: var(--m4-ink) !important;
  background: rgba(255, 253, 250, 0.96) !important;
  font-family: "Archivo", Arial, sans-serif;
  font-size: 16px;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--m4-red) !important;
  outline: 0;
  box-shadow: 0 0 0 4px rgba(191, 24, 24, 0.12) !important;
}

h1,
h2,
h3,
.dashboard-heading h1,
.section-heading h2,
.auth-brand-copy h1,
.registration-copy h1,
.registration-form h2,
.auth-form h2,
.panel__header h2,
.group-title,
.certificate-hero h1,
.post-approval-heading h1,
.report-hero h1 {
  color: var(--m4-ink);
  font-family: "Libre Caslon Text", "Century Schoolbook", Georgia, serif;
  font-optical-sizing: auto;
  letter-spacing: -0.025em;
}

.eyebrow,
.m4-kicker,
.panel__header small,
.hero-card__title small,
.foundation-banner small {
  color: var(--m4-red);
  font-family: "Archivo", Arial, sans-serif;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.button,
.file-button,
.mode-button,
.export-archive-button,
.work-vote-bar a {
  min-height: 46px;
  border-color: var(--m4-red) !important;
  border-radius: 999px !important;
  color: #fff !important;
  background: var(--m4-red) !important;
  box-shadow: none;
  font-family: "Archivo", Arial, sans-serif;
  font-weight: 750;
  transition: transform 120ms var(--m4-ease-out), background-color 160ms ease, box-shadow 160ms ease;
}

.button:active,
.file-button:active,
.mode-button:active,
.icon-button:active,
.m4-action:active {
  transform: scale(0.97) !important;
}

.button--ghost,
.button--secondary,
.button--review {
  color: var(--m4-red) !important;
  background: transparent !important;
  box-shadow: inset 0 0 0 1.5px var(--m4-red) !important;
}

.button--light {
  color: var(--m4-red) !important;
  background: var(--m4-paper-raised) !important;
}

.icon-button {
  min-width: 44px;
  min-height: 44px;
  border-color: var(--m4-line);
  border-radius: 13px;
  color: var(--m4-red);
  background: var(--m4-paper-raised);
  transition: transform 120ms var(--m4-ease-out), background-color 160ms ease;
}

.brand__lockup,
.official-logo,
.auth-official-logo {
  object-fit: contain;
}

.public-page,
.registration-page,
.app-layout,
.operator-page,
.public-certificate-page {
  color: var(--m4-ink);
  background-color: var(--m4-paper);
  background-image: url("/m4/texturas/grao.png");
  background-size: 512px;
}

.public-header,
.registration-header,
.app-topbar {
  border-color: rgba(130, 88, 53, 0.18);
  background: rgba(251, 243, 232, 0.88);
  backdrop-filter: blur(18px) saturate(150%);
}

.public-header__inner {
  min-height: 78px;
  gap: 12px;
}

.public-header .brand__lockup,
.registration-header .brand__lockup {
  width: min(194px, 42vw);
  max-height: 58px;
}

.public-nav {
  gap: 14px !important;
}

.public-header .theme-control span {
  display: none;
}

.public-nav a {
  color: var(--m4-muted);
  font-weight: 700;
}

@media (max-width: 1300px) {
  .public-nav a[href="/#sobre"] {
    display: none;
  }

  .public-header .brand__lockup {
    width: min(174px, 38vw);
  }
}

.hero {
  min-height: min(780px, 100svh);
  padding-block: clamp(70px, 10vw, 118px);
  color: #fff;
  background-color: var(--m4-green);
  background-image:
    linear-gradient(110deg, rgba(14, 94, 44, 0.98), rgba(8, 62, 29, 0.9)),
    url("/m4/texturas/goivas.png"),
    url("/m4/ilustracoes/paisagem-tepui.svg");
  background-position: center, center, right bottom;
  background-repeat: repeat, repeat, no-repeat;
  background-size: auto, 900px, min(60vw, 760px) auto;
  overflow: hidden;
}

.hero::before {
  width: 360px;
  height: 360px;
  border: 0;
  border-radius: 0;
  background-image: radial-gradient(var(--m4-yellow) 3px, transparent 3.7px);
  background-size: 16px 16px;
  opacity: 0.48;
  mask-image: linear-gradient(to bottom left, #000, transparent 80%);
}

.hero__content h1,
.hero__content h1 em,
.hero__content > p,
.hero__trust,
.hero__trust svg,
.hero .eyebrow {
  color: #fff !important;
}

.hero__content h1 {
  max-width: 760px;
  font-size: clamp(3rem, 6.4vw, 5.7rem);
  font-weight: 700;
  letter-spacing: -0.035em;
  text-shadow: 5px 5px 0 var(--m4-red-deep);
}

.hero .official-logo--eyebrow {
  width: fit-content;
  max-width: min(440px, 92vw);
  padding: 12px 16px;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 16px;
  background: rgba(255, 253, 250, 0.95);
  box-shadow: 0 16px 38px rgba(4, 38, 17, 0.2);
}

.hero .official-logo--eyebrow img {
  width: min(400px, 84vw);
  max-height: 112px;
  object-fit: contain;
  filter: none !important;
}

.hero__content h1 em {
  font-family: "Archivo", Arial, sans-serif;
  font-size: 0.52em;
  font-style: normal;
  font-weight: 700;
  letter-spacing: 0.17em;
  text-shadow: none;
  text-transform: uppercase;
}

.hero__actions .button:first-child {
  border-color: var(--m4-red) !important;
  color: #fff !important;
  background: var(--m4-red) !important;
}

.hero__actions .button--ghost,
.hero__actions .button--light {
  border-color: #fff !important;
  color: #fff !important;
  background: rgba(255, 255, 255, 0.08) !important;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.72) !important;
}

.hero-card,
.panel,
.feature-grid article,
.schedule-card,
.registration-form,
.operator-card,
.metric-grid article,
.document-card,
.group-card,
.commission-stage-card,
.post-approval-card,
.certificate-group-card,
.certificate-metrics article,
.public-certificate-main form {
  border-color: var(--m4-line) !important;
  border-radius: 16px !important;
  color: var(--m4-ink);
  background: rgba(255, 253, 250, 0.96) !important;
  box-shadow: 0 16px 44px rgba(74, 42, 18, 0.08) !important;
}

.hero-card {
  border-radius: 22px !important;
}

.hero-card .mini-brand img {
  width: 82px;
  height: 44px;
  border-radius: 0;
  object-fit: contain;
  filter: none !important;
}

.hero-card__title h2,
.hero-card .stage-list strong {
  color: var(--m4-ink) !important;
}

.hero-card .stage-list small {
  color: var(--m4-muted) !important;
}

.hero-card .stage-list__state {
  color: var(--m4-green) !important;
  background: #e7f1e9 !important;
}

.stage-list__number,
.feature-grid article > svg,
.metric-grid svg,
.auth-form__icon,
.documents-preview__icon,
.guide-icon {
  color: var(--m4-red) !important;
  background: #fff1df !important;
  border-radius: 12px !important;
}

.status-pill,
.role-chip,
.post-approval-status,
.operator-badge {
  color: var(--m4-green) !important;
  background: #e7f1e9 !important;
  border-color: rgba(14, 94, 44, 0.18) !important;
}

.section--tinted {
  background: rgba(248, 176, 108, 0.16);
}

.callout,
.foundation-banner,
.report-hero,
.documents-hero,
.certificate-hero {
  border-color: rgba(255, 207, 2, 0.24) !important;
  color: #fff !important;
  background-color: var(--m4-green) !important;
  background-image:
    linear-gradient(115deg, rgba(14, 94, 44, 0.96), rgba(8, 62, 29, 0.92)),
    url("/m4/texturas/goivas.png") !important;
  background-size: auto, 900px !important;
  box-shadow: 0 20px 50px rgba(8, 62, 29, 0.2) !important;
}

.callout {
  border-color: rgba(248, 176, 108, 0.36) !important;
  background-color: var(--m4-red) !important;
  background-image:
    linear-gradient(115deg, rgba(191, 24, 24, 0.97), rgba(143, 16, 16, 0.93)),
    url("/m4/texturas/goivas.png") !important;
}

.callout h2,
.foundation-banner h2,
.report-hero h1,
.documents-hero h1,
.certificate-hero h1,
.callout p,
.foundation-banner p,
.report-hero p,
.documents-hero p,
.certificate-hero p {
  color: #fff !important;
}

.public-footer {
  border-color: var(--m4-line);
  background: var(--m4-paper-raised);
}

.auth-page {
  min-height: 100dvh;
}

.auth-panel {
  min-height: 100dvh;
}

.auth-panel--brand {
  background-color: var(--m4-green);
  background-image:
    linear-gradient(145deg, rgba(14, 94, 44, 0.93), rgba(8, 62, 29, 0.92)),
    url("/m4/texturas/goivas.png"),
    url("/m4/ilustracoes/paisagem-tepui.svg");
  background-position: center, center, center bottom;
  background-repeat: repeat, repeat, no-repeat;
  background-size: auto, 900px, 92% auto;
}

.auth-panel--brand::after {
  border: 0;
  background-image: radial-gradient(var(--m4-yellow) 3px, transparent 3.6px);
  background-size: 16px 16px;
  opacity: 0.3;
  mask-image: linear-gradient(to bottom left, #000, transparent 80%);
}

.auth-panel--form {
  background: var(--m4-paper);
  background-image: url("/m4/texturas/grao.png");
}

.auth-brand-copy h1,
.auth-brand-copy p,
.auth-panel--brand .back-link {
  color: #fff !important;
}

.auth-official-logo {
  max-width: 330px;
  border-radius: 0;
  background: transparent;
  padding: 0;
}

.registration-copy::after {
  content: "";
  display: block;
  width: min(460px, 100%);
  aspect-ratio: 2.7 / 1;
  margin-top: 36px;
  background: url("/m4/ilustracoes/paisagem-tepui.svg") center bottom / contain no-repeat;
}

.app-layout {
  min-height: 100dvh;
  background-color: var(--m4-paper);
}

.sidebar {
  height: 100dvh;
  border-color: rgba(255, 255, 255, 0.12);
  color: #fff;
  background-color: var(--m4-green);
  background-image:
    linear-gradient(rgba(14, 94, 44, 0.95), rgba(8, 62, 29, 0.96)),
    url("/m4/texturas/goivas.png");
  background-size: auto, 900px;
}

.sidebar .brand__lockup {
  width: 198px;
  max-height: 58px;
}

.sidebar .edition-chip,
.sidebar .mode-button {
  border-color: rgba(255, 255, 255, 0.2) !important;
  color: #fff !important;
  background: rgba(255, 255, 255, 0.09) !important;
}

.sidebar .app-nav a {
  min-height: 46px;
  color: rgba(255, 255, 255, 0.78);
  border-radius: 12px;
}

.sidebar .app-nav a.is-active {
  color: var(--m4-ink);
  background: var(--m4-yellow);
}

.sidebar .account-card {
  border-color: rgba(255, 255, 255, 0.16);
  color: #fff;
}

.sidebar .account-card small,
.sidebar .account-card__logout,
.sidebar .build-stamp,
.sidebar .legal-links a {
  color: rgba(255, 255, 255, 0.66) !important;
}

.sidebar .account-card__avatar {
  color: var(--m4-ink);
  background: var(--m4-yellow);
}

.app-topbar {
  position: sticky;
  z-index: 16;
  top: 0;
  min-height: 72px;
}

.dashboard {
  max-width: 1400px;
}

.dashboard > *,
.registration-form,
.auth-form {
  animation: m4-enter 180ms var(--m4-ease-out) both;
}

@keyframes m4-enter {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.filter-bar,
.document-filters,
.commission-filter-bar,
.post-approval-toolbar,
.certificate-toolbar {
  border-color: var(--m4-line) !important;
  border-radius: 16px !important;
  background: rgba(255, 253, 250, 0.9) !important;
}

.document-tabs,
.professor-work-tabs,
.work-document-tabs,
.work-library-semesters {
  scrollbar-width: none;
  overscroll-behavior-x: contain;
  scroll-snap-type: x proximity;
  touch-action: pan-y;
}

.document-tabs::-webkit-scrollbar,
.professor-work-tabs::-webkit-scrollbar,
.work-document-tabs::-webkit-scrollbar,
.work-library-semesters::-webkit-scrollbar {
  display: none;
}

.document-tabs > *,
.professor-work-tabs > *,
.work-document-tabs > *,
.work-library-semesters > * {
  scroll-snap-align: start;
}

.form-grid,
.form-section-title,
.form-actions,
.participant-upload-layout,
.group-registration-layout {
  min-width: 0;
}

.empty-state,
.compact-empty {
  border-color: var(--m4-line) !important;
  border-radius: 16px !important;
  background: rgba(255, 253, 250, 0.72) !important;
}

.form-error,
.correction-box {
  border-color: rgba(191, 24, 24, 0.24) !important;
  color: #7e1111 !important;
  background: #fff0ea !important;
}

.form-success,
.is-approved,
.is-complete,
.is-ready {
  color: var(--m4-green) !important;
}

.m4-title-banner {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  margin: 0 0 22px;
  padding: 17px 18px;
  border: 1px solid var(--m4-line);
  border-radius: 16px;
  background: rgba(255, 253, 250, 0.94);
  box-shadow: 0 12px 34px rgba(74, 42, 18, 0.07);
  animation: m4-enter 180ms var(--m4-ease-out) both;
}

.m4-title-banner__icon {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 13px;
  color: var(--m4-red);
  background: #fff0df;
  font-weight: 900;
}

.m4-title-banner strong,
.m4-title-banner span {
  display: block;
}

.m4-title-banner strong {
  color: var(--m4-ink);
}

.m4-title-banner span {
  margin-top: 4px;
  color: var(--m4-muted);
  font-size: 0.84rem;
  line-height: 1.45;
}

.m4-title-banner[data-status="APPROVED"] .m4-title-banner__icon {
  color: var(--m4-green);
  background: #e6f1e9;
}

.m4-title-banner[data-status="PENDING"] .m4-title-banner__icon {
  color: #8b6800;
  background: #fff4bd;
}

.m4-preview-link {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  border: 1px solid var(--m4-red);
  border-radius: 999px;
  color: var(--m4-red) !important;
  font-size: 0.82rem !important;
  font-weight: 800 !important;
}

.public-header .brand__lockup,
.registration-header .brand__lockup {
  filter: none !important;
}

:root[data-theme="dark"] .hero,
:root[data-theme="dark"] .auth-panel--brand {
  color: #fff;
  background-color: var(--m4-green) !important;
  background-image:
    linear-gradient(110deg, rgba(14, 94, 44, 0.98), rgba(8, 62, 29, 0.94)),
    url("/m4/texturas/goivas.png"),
    url("/m4/ilustracoes/paisagem-tepui.svg") !important;
  background-position: center, center, right bottom !important;
  background-repeat: repeat, repeat, no-repeat !important;
  background-size: auto, 900px, min(60vw, 760px) auto !important;
}

:root[data-theme="dark"] .official-logo img,
:root[data-theme="dark"] .documents-hero .official-logo img,
:root[data-theme="dark"] .public-header .brand__lockup,
:root[data-theme="dark"] .registration-header .brand__lockup {
  filter: none !important;
}

:root[data-theme="dark"] .hero-card,
:root[data-theme="dark"] .registration-form {
  color: var(--m4-ink);
  background: rgba(255, 253, 250, 0.97) !important;
}

html.m4-custom-page #root {
  display: none !important;
}

#m4-custom-root {
  min-height: 100dvh;
  color: var(--m4-ink);
  background-color: var(--m4-paper);
  background-image: url("/m4/texturas/grao.png");
}

.m4-review-shell {
  width: min(1180px, calc(100% - 36px));
  margin: 0 auto;
  padding: max(20px, env(safe-area-inset-top, 0px)) 0 max(72px, env(safe-area-inset-bottom, 0px));
}

.m4-review-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 72px;
}

.m4-review-header img {
  width: min(260px, 58vw);
  max-height: 64px;
  object-fit: contain;
}

.m4-review-hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  margin-top: 22px;
  padding: clamp(28px, 5vw, 58px);
  border-radius: 24px;
  color: #fff;
  background-color: var(--m4-red);
  background-image: linear-gradient(115deg, rgba(191, 24, 24, 0.97), rgba(143, 16, 16, 0.88)), url("/m4/texturas/goivas.png");
  background-size: auto, 900px;
}

.m4-review-hero::after {
  content: "";
  position: absolute;
  z-index: -1;
  right: -30px;
  bottom: -30px;
  width: 330px;
  aspect-ratio: 2 / 1;
  background: url("/m4/ilustracoes/tepui.svg") right bottom / contain no-repeat;
  opacity: 0.42;
}

.m4-review-hero h1 {
  max-width: 760px;
  margin: 7px 0 10px;
  color: #fff;
  font-size: clamp(2.3rem, 5vw, 4.4rem);
  line-height: 0.98;
  text-shadow: 4px 4px 0 var(--m4-red-deep);
}

.m4-review-hero p {
  max-width: 680px;
  margin: 0;
  color: rgba(255, 255, 255, 0.86);
  line-height: 1.62;
}

.m4-review-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 18px 0;
}

.m4-review-metric {
  min-height: 96px;
  padding: 18px;
  border: 1px solid var(--m4-line);
  border-radius: 16px;
  background: rgba(255, 253, 250, 0.94);
}

.m4-review-metric strong,
.m4-review-metric span {
  display: block;
}

.m4-review-metric strong {
  font-family: "Libre Caslon Text", Georgia, serif;
  font-size: 2rem;
}

.m4-review-metric span {
  margin-top: 5px;
  color: var(--m4-muted);
  font-size: 0.78rem;
}

.m4-review-toolbar {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 5px 0 13px;
  scrollbar-width: none;
  scroll-snap-type: x proximity;
}

.m4-filter {
  flex: 0 0 auto;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--m4-line);
  border-radius: 999px;
  color: var(--m4-muted);
  background: var(--m4-paper-raised);
  font: 700 0.82rem "Archivo", Arial, sans-serif;
  cursor: pointer;
  scroll-snap-align: start;
}

.m4-filter.is-active {
  border-color: var(--m4-red);
  color: #fff;
  background: var(--m4-red);
}

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

.m4-review-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 22px;
  align-items: center;
  padding: 20px;
  border: 1px solid var(--m4-line);
  border-radius: 16px;
  background: rgba(255, 253, 250, 0.96);
  box-shadow: 0 12px 34px rgba(74, 42, 18, 0.06);
  animation: m4-enter 180ms var(--m4-ease-out) both;
  animation-delay: var(--delay, 0ms);
}

.m4-review-card h2 {
  margin: 6px 0 8px;
  font-size: clamp(1.2rem, 2vw, 1.55rem);
  line-height: 1.2;
}

.m4-review-card p {
  margin: 0;
  color: var(--m4-muted);
  font-size: 0.84rem;
}

.m4-status {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  color: #775800;
  background: #fff0a6;
  font-size: 0.72rem;
  font-weight: 800;
}

.m4-status[data-status="APPROVED"] {
  color: var(--m4-green);
  background: #e3f1e7;
}

.m4-status[data-status="CHANGES_REQUESTED"] {
  color: #8a4b12;
  background: #ffe5c9;
}

.m4-status[data-status="REJECTED"] {
  color: #8b1111;
  background: #ffe2de;
}

.m4-review-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.m4-action {
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid var(--m4-line);
  border-radius: 999px;
  color: var(--m4-muted);
  background: transparent;
  font: 750 0.8rem "Archivo", Arial, sans-serif;
  cursor: pointer;
  transition: transform 120ms var(--m4-ease-out), background-color 160ms ease, color 160ms ease;
}

.m4-action--approve {
  border-color: var(--m4-green);
  color: #fff;
  background: var(--m4-green);
}

.m4-action--adjust {
  border-color: #c8792e;
  color: #9b4f0a;
  background: #fff4e7;
}

.m4-dialog {
  width: min(560px, calc(100% - 28px));
  padding: 0;
  border: 1px solid var(--m4-line);
  border-radius: 22px;
  color: var(--m4-ink);
  background: var(--m4-paper-raised);
  box-shadow: 0 30px 90px rgba(29, 26, 23, 0.26);
}

.m4-dialog::backdrop {
  background: rgba(29, 26, 23, 0.52);
  backdrop-filter: blur(5px);
}

.m4-dialog form {
  display: grid;
  gap: 18px;
  padding: 24px;
}

.m4-dialog h2,
.m4-dialog p {
  margin: 0;
}

.m4-dialog p {
  color: var(--m4-muted);
  line-height: 1.55;
}

.m4-dialog textarea {
  width: 100%;
  min-height: 126px;
  padding: 13px;
  resize: vertical;
}

.m4-dialog label {
  display: grid;
  gap: 8px;
  color: var(--m4-ink);
  font-weight: 750;
}

.m4-dialog [name="title"] {
  min-height: 108px;
}

.m4-dialog__actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.m4-demo-note {
  margin: 14px 0 0;
  padding: 12px 14px;
  border: 1px solid rgba(255, 207, 2, 0.44);
  border-radius: 13px;
  color: #6c5200;
  background: #fff3bd;
  font-size: 0.82rem;
}

.m4-demo-note[data-type="success"] {
  border-color: rgba(14, 94, 44, 0.28);
  color: var(--m4-green);
  background: #e7f2e9;
}

.m4-demo-note[data-type="error"] {
  border-color: rgba(191, 24, 24, 0.26);
  color: #821111;
  background: #ffe6df;
}

.m4-review-reason {
  margin-top: 12px !important;
  padding: 10px 12px;
  border-left: 3px solid var(--m4-sand);
  border-radius: 0 10px 10px 0;
  background: #fff5e9;
}

@media (hover: hover) and (pointer: fine) {
  .button:hover,
  .file-button:hover,
  .mode-button:hover,
  .m4-action:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 26px rgba(143, 16, 16, 0.18);
  }

  .button--ghost:hover,
  .m4-preview-link:hover {
    background: rgba(191, 24, 24, 0.07) !important;
  }

  .sidebar .app-nav a:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.09);
  }
}

@media (max-width: 900px) {
  body::before {
    right: 8px;
    bottom: max(8px, env(safe-area-inset-bottom, 0px));
    font-size: 8px;
  }

  .hero {
    min-height: auto;
    background-size: auto, 900px, 92vw auto;
  }

  .hero__grid {
    grid-template-columns: 1fr;
  }

  .hero__content h1 {
    font-size: clamp(3rem, 11.5vw, 5rem);
  }

  .registration-layout,
  .group-registration-layout,
  .participant-upload-layout,
  .master-detail,
  .commission-work-detail {
    grid-template-columns: 1fr !important;
    gap: 24px !important;
  }

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

@media (max-width: 720px) {
  .container,
  .registration-layout {
    width: min(100% - 28px, 1180px);
  }

  .public-header__inner,
  .registration-header,
  .app-topbar {
    min-height: 66px;
    padding-right: max(14px, env(safe-area-inset-right, 0px));
    padding-left: max(14px, env(safe-area-inset-left, 0px));
  }

  .public-header__inner {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 10px !important;
  }

  .public-header .public-nav {
    grid-column: 1 / -1;
    width: calc(100vw - 28px);
    max-width: 100%;
    justify-content: flex-start !important;
    overflow-x: auto;
    padding: 4px 0 9px;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
  }

  .public-header .public-nav > * {
    flex: 0 0 auto;
    scroll-snap-align: start;
  }

  .public-header .theme-control span {
    display: none;
  }

  .public-header .brand__lockup,
  .registration-header .brand__lockup {
    width: min(190px, 54vw);
  }

  .hero {
    padding-top: 50px;
    padding-bottom: 78px;
  }

  .hero__actions,
  .form-actions,
  .m4-dialog__actions {
    align-items: stretch;
    flex-direction: column;
  }

  .hero__actions .button,
  .form-actions .button,
  .m4-dialog__actions .button {
    width: 100%;
  }

  .hero-card,
  .panel,
  .registration-form,
  .operator-card {
    padding: 20px !important;
  }

  .dashboard {
    padding-right: 14px;
    padding-left: 14px;
  }

  .dashboard-heading,
  .panel__header,
  .commission-heading,
  .post-approval-heading {
    align-items: stretch !important;
    flex-direction: column !important;
    gap: 14px !important;
  }

  .filter-bar,
  .document-filters,
  .commission-filter-bar,
  .post-approval-toolbar,
  .certificate-toolbar {
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
    scroll-snap-type: x proximity;
  }

  .filter-bar > *,
  .document-filters > *,
  .commission-filter-bar > *,
  .post-approval-toolbar > *,
  .certificate-toolbar > * {
    flex: 0 0 auto;
    scroll-snap-align: start;
  }

  .form-grid,
  .member-form-list,
  .professor-form-list,
  .metric-grid,
  .management-grid,
  .guidance-grid,
  .document-grid,
  .certificate-metrics {
    grid-template-columns: 1fr !important;
  }

  .commission-work-table,
  .data-list,
  .audit-list {
    overflow-x: auto;
    overscroll-behavior-x: contain;
  }

  .m4-title-banner {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .m4-title-banner .button {
    grid-column: 1 / -1;
    width: 100%;
  }

  .m4-review-header img {
    width: min(210px, 62vw);
  }

  .m4-review-hero {
    padding: 30px 22px;
    border-radius: 20px;
  }

  .m4-review-hero h1 {
    font-size: clamp(2.35rem, 11vw, 3.7rem);
  }

  .m4-review-card {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .m4-review-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    justify-content: stretch;
  }

  .m4-action {
    width: 100%;
  }
}

@media (max-width: 430px) {
  .hero__content h1 {
    font-size: clamp(2.75rem, 13vw, 3.7rem);
  }

  .hero__trust {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .m4-review-metrics {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .m4-review-metric {
    min-height: 82px;
    padding: 14px;
  }

  .m4-review-actions {
    grid-template-columns: 1fr;
  }
}

@media (hover: none) {
  .button:hover,
  .file-button:hover,
  .mode-button:hover,
  .app-nav a:hover,
  .icon-button:hover {
    transform: none !important;
    box-shadow: none !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .dashboard > *,
  .registration-form,
  .auth-form,
  .m4-title-banner,
  .m4-review-card {
    animation: none !important;
    transform: none !important;
  }

  .button,
  .file-button,
  .mode-button,
  .icon-button,
  .m4-action {
    transition: color 160ms ease, background-color 160ms ease;
  }
}

@media (prefers-reduced-transparency: reduce) {
  .public-header,
  .registration-header,
  .app-topbar,
  .m4-title-banner,
  .m4-review-card {
    background: var(--m4-paper-raised) !important;
    backdrop-filter: none !important;
  }
}

@media (prefers-contrast: more) {
  .panel,
  .group-card,
  .document-card,
  .m4-review-card,
  .m4-title-banner {
    border-color: var(--m4-ink) !important;
  }
}
