.portal-view {
  --portal-surface: linear-gradient(180deg, rgba(255, 255, 255, 0.78) 0%, rgba(255, 249, 243, 0.66) 100%);
  --portal-surface-soft: linear-gradient(180deg, rgba(255, 255, 255, 0.72) 0%, rgba(255, 249, 243, 0.54) 100%);
  --portal-surface-strong: rgba(255, 255, 255, 0.92);
  --portal-line: rgba(18, 18, 22, 0.08);
  --portal-line-strong: rgba(18, 18, 22, 0.13);
  --portal-shadow-sm: 0 18px 42px rgba(19, 19, 23, 0.07);
  --portal-shadow-lg: 0 28px 90px rgba(19, 19, 23, 0.11);
  --portal-muted: rgba(53, 55, 65, 0.78);
  --portal-radius-md: 28px;
  --portal-radius-lg: 40px;
  --font-label: 0.76rem;
  --font-meta: 0.92rem;
  --font-body: 1rem;
  --font-display: clamp(2rem, 4vw, 3rem);
  --font-heading: clamp(1.4rem, 2.5vw, 1.85rem);
  --font-stat: 1.85rem;
}

.portal-view .site-background {
  opacity: 0.44;
}

.portal-view .site-background__lines line {
  stroke: rgba(19, 19, 23, 0.085);
}

.portal-view .site-background__lines line[data-weight="soft"] {
  stroke: rgba(255, 255, 255, 0.28);
}

.portal-view .site-background__lines line[data-weight="strong"] {
  stroke: rgba(19, 19, 23, 0.13);
}

.portal-view .site-background__lines--accent line {
  stroke: rgba(20, 121, 98, 0.16);
}

.portal-view .site-background__node {
  fill: rgba(255, 255, 255, 0.93);
  stroke: rgba(19, 19, 23, 0.15);
}

.portal-view .site-background__node--major {
  stroke: rgba(20, 121, 98, 0.21);
}

.portal-page {
  position: relative;
  z-index: 1;
  width: min(1180px, calc(100vw - 2.5rem));
  margin: 0 auto;
  padding: 2.25rem 0 5rem;
}

.portal-login-view {
  min-height: 100vh;
  min-height: 100svh;
  min-height: 100dvh;
}

body.portal-view.portal-login-view {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100svh;
  min-height: 100dvh;
}

.portal-login-view main.section {
  flex: 1 0 auto;
  display: grid;
  align-items: center;
  padding: clamp(1rem, 3vh, 1.75rem) 0;
}

.portal-login-view .portal-page {
  display: grid;
  align-items: center;
  min-height: 0;
  padding-top: 0;
  padding-bottom: 0;
}

.portal-page,
.portal-page * {
  min-width: 0;
}

.portal-page .lead {
  max-width: 58ch;
  margin-top: 1rem;
  color: var(--portal-muted);
}

.portal-section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 1.5rem;
  margin-bottom: 1.35rem;
  position: relative;
  z-index: 20;
}

.portal-section-head .eyebrow {
  margin: 0;
  flex: 0 0 auto;
}

.portal-shell {
  position: relative;
  margin-left: auto;
  max-width: 100%;
  z-index: 520;
}

.portal-shell__toggle {
  appearance: none;
  display: none;
  align-items: center;
  gap: 0.55rem;
  min-height: 2.65rem;
  border: 1px solid var(--portal-line);
  border-radius: 999px;
  padding: 0.62rem 0.95rem;
  background: rgba(255, 255, 255, 0.62);
  color: rgba(19, 19, 23, 0.72);
  font: inherit;
  font-size: var(--font-meta);
  font-weight: 700;
  cursor: pointer;
  backdrop-filter: blur(18px);
  box-shadow: 0 14px 32px rgba(19, 19, 23, 0.06);
  transition:
    background-color 0.2s ease,
    color 0.2s ease,
    box-shadow 0.2s ease;
}

.portal-shell__toggle:hover {
  background: rgba(19, 19, 23, 0.05);
  color: var(--text);
}

.portal-shell__toggle-icon {
  width: 1rem;
  display: grid;
  gap: 0.2rem;
}

.portal-shell__toggle-icon span {
  display: block;
  width: 100%;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.portal-shell.is-open .portal-shell__toggle-icon span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

.portal-shell.is-open .portal-shell__toggle-icon span:nth-child(2) {
  opacity: 0;
}

.portal-shell.is-open .portal-shell__toggle-icon span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

.portal-shell__nav {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.3rem;
  margin: 0;
  padding: 0.35rem;
  list-style: none;
  max-width: 100%;
  border: 1px solid var(--portal-line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.62);
  backdrop-filter: blur(18px);
  box-shadow: 0 14px 32px rgba(19, 19, 23, 0.06);
}

.portal-shell__item {
  display: flex;
  flex: 0 0 auto;
  max-width: 100%;
}

.portal-shell__link {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.65rem;
  border-radius: 999px;
  border: none;
  padding: 0.7rem 1rem;
  background: transparent;
  color: rgba(19, 19, 23, 0.62);
  font: inherit;
  font-size: var(--font-body);
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  text-align: center;
  line-height: 1.2;
  box-shadow: none;
  transition:
    background-color 0.2s ease,
    color 0.2s ease,
    opacity 0.2s ease;
}

.portal-shell__link:hover {
  background: rgba(19, 19, 23, 0.05);
  color: var(--text);
  transform: none;
}

.portal-shell__link.is-active {
  background: rgba(20, 121, 98, 0.11);
  color: var(--accent-strong);
}

.portal-shell.is-collapsed .portal-shell__toggle {
  display: inline-flex;
}

.portal-shell.is-collapsed .portal-shell__nav {
  display: none;
  position: absolute;
  top: calc(100% + 0.55rem);
  right: 0;
  min-width: min(360px, calc(100vw - 2rem));
  max-width: min(360px, calc(100vw - 2rem));
  padding: 0.35rem;
  border-radius: 26px;
  z-index: 720;
}

.portal-shell.is-collapsed.is-open .portal-shell__nav {
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

.portal-shell.is-collapsed .portal-shell__item {
  width: 100%;
}

.portal-shell.is-collapsed .portal-shell__link {
  width: 100%;
  justify-content: flex-start;
  text-align: left;
}

.portal-card,
.portal-config,
.portal-loading-screen,
.portal-panel,
.project-card,
.portal-counter-card,
.portal-counter-day {
  border: 1px solid var(--portal-line);
  border-radius: var(--portal-radius-lg);
  background: var(--portal-surface);
  box-shadow: var(--portal-shadow-lg);
  backdrop-filter: blur(18px);
}

.portal-card,
.portal-config,
.portal-loading-screen,
.portal-panel {
  padding: 1.55rem;
}

.portal-page-content {
  display: grid;
  gap: 1rem;
}

.portal-page-header,
.portal-shell-section {
  padding: 0;
  margin-bottom: 1.5rem;
  position: relative;
  z-index: 420;
}

.portal-page-header h1,
.portal-page-header h2,
.portal-shell-section h1,
.portal-shell-section h2,
.portal-card h1,
.portal-card h2,
.portal-config h1,
.portal-panel > h2,
.project-card h2,
.portal-counter-day h3,
.portal-loading-screen h2 {
  margin-top: 0;
  margin-bottom: 0;
  font-family: "Sora", "Manrope", sans-serif;
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1;
  color: var(--text);
}

.portal-page-header h1,
.portal-page-header h2,
.portal-shell-section h1,
.portal-shell-section h2,
.portal-card h1,
.portal-config h1,
.portal-loading-screen h2 {
  font-size: var(--font-display);
}

.portal-panel > h2,
.project-card h2,
.portal-counter-day h3,
.portal-card h2 {
  font-size: var(--font-heading);
}

.portal-card--intro,
.portal-loading-screen {
  position: relative;
  isolation: isolate;
}

.portal-card--intro::before,
.portal-loading-screen::before {
  content: "";
  position: absolute;
  inset: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: calc(var(--portal-radius-lg) - 14px);
  pointer-events: none;
  z-index: -1;
}

.portal-intro {
  display: grid;
  gap: 0.8rem;
  margin-bottom: 1.5rem;
}

.portal-note,
.portal-feedback,
.portal-config__notice {
  border-radius: 22px;
  padding: 0.95rem 1rem;
}

.portal-note,
.portal-config__notice {
  background: rgba(20, 121, 98, 0.11);
  color: #0d4f42;
  border: 1px solid rgba(20, 121, 98, 0.1);
}

.portal-feedback {
  background: rgba(19, 19, 23, 0.045);
  color: rgba(19, 19, 23, 0.82);
  border: 1px solid rgba(19, 19, 23, 0.06);
}

.portal-feedback code,
.portal-code-list code {
  font-family: "Manrope", monospace;
}

.portal-feedback-message {
  display: none;
  margin: 0;
  padding: 0.95rem 1rem;
  border-radius: 18px;
  border: 1px solid transparent;
  font-weight: 600;
}

.portal-feedback-message.is-visible {
  display: block;
}

.portal-feedback-message.is-neutral {
  background: rgba(19, 19, 23, 0.05);
  border-color: rgba(19, 19, 23, 0.08);
  color: rgba(19, 19, 23, 0.86);
}

.portal-feedback-message.is-success {
  background: rgba(20, 121, 98, 0.12);
  border-color: rgba(20, 121, 98, 0.18);
  color: #0e5d4b;
}

.portal-feedback-message.is-error {
  background: rgba(189, 55, 40, 0.1);
  border-color: rgba(189, 55, 40, 0.16);
  color: #922f21;
}

.portal-toast-stack {
  position: fixed;
  left: 50%;
  bottom: 1.2rem;
  z-index: 2000;
  display: grid;
  gap: 0.75rem;
  width: min(32rem, calc(100vw - 1.5rem));
  pointer-events: none;
  transform: translateX(-50%);
}

.portal-toast {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 0.8rem;
  padding: 0.95rem 1rem 0.95rem 1.1rem;
  border-radius: 20px;
  border: 1px solid transparent;
  box-shadow: 0 24px 56px rgba(19, 19, 23, 0.18);
  backdrop-filter: blur(18px);
  pointer-events: auto;
  opacity: 0;
  transform: translate3d(0, 1rem, 0);
  transition:
    opacity 0.24s ease,
    transform 0.24s ease;
}

.portal-toast.is-visible {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

.portal-toast.is-leaving {
  opacity: 0;
  transform: translate3d(0, 0.8rem, 0);
}

.portal-toast--success {
  background: rgba(238, 250, 245, 0.94);
  border-color: rgba(20, 121, 98, 0.16);
  color: #0e5d4b;
}

.portal-toast--error {
  background: rgba(255, 243, 240, 0.96);
  border-color: rgba(189, 55, 40, 0.16);
  color: #922f21;
}

.portal-toast__copy {
  margin: 0;
  font-size: var(--font-body);
  font-weight: 600;
  line-height: 1.45;
}

.portal-toast__close {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  margin: -0.2rem -0.2rem 0 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: currentColor;
  font: inherit;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}

.portal-toast__close:hover {
  background: rgba(19, 19, 23, 0.06);
}

#admin-projects-status {
  margin-top: 0.5rem;
}

.portal-card--compact {
  padding: 1.2rem 1.5rem;
}

.portal-userline {
  margin: 0.45rem 0 0;
  color: var(--portal-muted);
}

#content {
  display: grid;
  gap: 1.5rem;
}

.portal-login-view #content {
  width: 100%;
}

#content [hidden] {
  display: none !important;
}

#auth-section {
  max-width: 40rem;
}

.portal-login-view #auth-section {
  width: min(40rem, 100%);
  margin: 0 auto;
}

.portal-loading-screen {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 0.75rem;
  min-height: clamp(320px, 56vh, 520px);
  padding: 1.8rem 1.6rem;
  text-align: center;
}

.portal-login-view .portal-loading-screen {
  position: absolute;
  inset: 0;
  align-content: center;
  z-index: 3;
}

.portal-loading-screen[hidden] {
  display: none !important;
}

.portal-loading-screen > p:last-child {
  max-width: 28rem;
  margin: 0;
  color: var(--portal-muted);
}

.portal-loading-screen__network {
  position: relative;
  width: 132px;
  height: 96px;
  margin-bottom: 0.25rem;
  filter: drop-shadow(0 14px 28px rgba(20, 121, 98, 0.1));
}

.portal-loading-screen__node,
.portal-loading-screen__line {
  position: absolute;
}

.portal-loading-screen__node {
  width: 12px;
  height: 12px;
  margin: -6px 0 0 -6px;
  border-radius: 999px;
  background: rgba(20, 121, 98, 0.9);
  box-shadow: 0 0 0 4px rgba(20, 121, 98, 0.1);
  animation: portal-node-drift 5.8s ease-in-out infinite;
}

.portal-loading-screen__node--1 {
  top: 30px;
  left: 18px;
  animation-delay: -0.5s;
}

.portal-loading-screen__node--2 {
  top: 16px;
  left: 72px;
  animation-delay: -2.1s;
}

.portal-loading-screen__node--3 {
  top: 64px;
  left: 56px;
  animation-delay: -1.3s;
}

.portal-loading-screen__node--4 {
  top: 42px;
  left: 114px;
  animation-delay: -3.4s;
}

.portal-loading-screen__line {
  --portal-line-rotation: 0deg;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(20, 121, 98, 0.14), rgba(20, 121, 98, 0.48), rgba(20, 121, 98, 0.14));
  transform-origin: left center;
  transform: rotate(var(--portal-line-rotation));
  animation: portal-line-breathe 4.9s ease-in-out infinite;
}

.portal-loading-screen__line--1 {
  top: 29px;
  left: 18px;
  width: 55px;
  --portal-line-rotation: -15deg;
  animation-delay: -0.4s;
}

.portal-loading-screen__line--2 {
  top: 20px;
  left: 68px;
  width: 38px;
  --portal-line-rotation: 33deg;
  animation-delay: -2.3s;
}

.portal-loading-screen__line--3 {
  top: 59px;
  left: 55px;
  width: 61px;
  --portal-line-rotation: -18deg;
  animation-delay: -1.6s;
}

.portal-loading-screen__line--4 {
  top: 41px;
  left: 23px;
  width: 40px;
  --portal-line-rotation: 34deg;
  animation-delay: -3.1s;
}

#auth-mode-switch {
  display: inline-flex;
  gap: 0.65rem;
  margin: 0 0 1.25rem;
}

#auth-mode-switch button {
  appearance: none;
  border: 1px solid var(--portal-line-strong);
  background: rgba(255, 255, 255, 0.78);
  color: rgba(19, 19, 23, 0.72);
  border-radius: 999px;
  padding: 0.78rem 1.12rem;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(19, 19, 23, 0.05);
}

#auth-mode-switch button[aria-selected="true"] {
  background: rgba(20, 121, 98, 0.12);
  color: var(--accent-strong);
  border-color: rgba(20, 121, 98, 0.12);
  box-shadow: none;
}

#content form {
  display: grid;
  gap: 1rem;
}

#content form > div {
  display: grid;
  gap: 0.5rem;
}

#content label {
  color: var(--muted-strong);
  font-size: var(--font-body);
  font-weight: 700;
}

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

#content input[type="text"],
#content input[type="email"],
#content input[type="password"],
#content input[type="date"],
#content textarea,
#content select {
  width: 100%;
  max-width: 100%;
  border-radius: 18px;
  border: 1px solid var(--portal-line-strong);
  padding: 0.92rem 1rem;
  background: rgba(255, 255, 255, 0.82);
  color: var(--text);
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    background-color 0.2s ease;
}

#content input[type="text"],
#content input[type="email"],
#content input[type="password"],
#content input[type="date"],
#content select {
  min-height: 3.35rem;
}

#content input[type="date"] {
  -webkit-appearance: none;
}

#content textarea {
  min-height: 140px;
}

#content input::placeholder,
#content textarea::placeholder {
  color: rgba(95, 96, 105, 0.7);
}

#content input[aria-invalid="true"],
#content textarea[aria-invalid="true"],
#content select[aria-invalid="true"] {
  border-color: rgba(189, 55, 40, 0.28);
  background: rgba(189, 55, 40, 0.08);
  box-shadow: 0 0 0 4px rgba(189, 55, 40, 0.06);
}

#content input:focus,
#content textarea:focus,
#content select:focus {
  outline: none;
  border-color: rgba(20, 121, 98, 0.3);
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 0 0 4px rgba(20, 121, 98, 0.08);
}

#content .portal-button,
.portal-action {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3.35rem;
  border-radius: 999px;
  border: 1px solid transparent;
  padding: 0.9rem 1.35rem;
  background: linear-gradient(135deg, #15161a 0%, #203330 100%);
  color: #ffffff;
  box-shadow: 0 16px 32px rgba(21, 22, 26, 0.18);
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

#content .portal-button.portal-button--compact {
  min-height: 2.55rem;
  padding: 0.58rem 0.88rem;
  font-size: var(--font-meta);
  box-shadow: 0 10px 20px rgba(21, 22, 26, 0.14);
}

#content .portal-button:hover,
.portal-action:hover {
  transform: translateY(-2px);
  box-shadow: 0 20px 40px rgba(21, 22, 26, 0.22);
}

#auth-mode-switch button:disabled,
#content .portal-button:disabled,
.portal-shell__link:disabled {
  background: rgba(19, 19, 23, 0.08);
  color: rgba(19, 19, 23, 0.42);
  border-color: rgba(19, 19, 23, 0.1);
  box-shadow: none;
  cursor: not-allowed;
  opacity: 0.8;
  transform: none;
}

#auth-mode-switch button:disabled:hover,
#content .portal-button:disabled:hover,
.portal-shell__link:disabled:hover {
  transform: none;
  box-shadow: none;
}

.portal-action--secondary,
#content .portal-button.portal-button--secondary {
  background: rgba(255, 255, 255, 0.8);
  color: var(--text);
  border-color: var(--portal-line-strong);
  box-shadow: 0 10px 24px rgba(19, 19, 23, 0.06);
}

#content .portal-button.portal-button--alert {
  background: linear-gradient(135deg, #c94e3b 0%, #9d2e22 100%);
  color: #ffffff;
  border-color: rgba(157, 46, 34, 0.26);
  box-shadow: 0 14px 28px rgba(157, 46, 34, 0.2);
}

#content .portal-button.portal-button--alert:hover {
  background: linear-gradient(135deg, #cf5742 0%, #a93427 100%);
  border-color: rgba(169, 52, 39, 0.32);
}

#content .portal-button.portal-button--alert:disabled,
#content .portal-button.portal-button--alert:disabled:hover {
  background: rgba(157, 46, 34, 0.12);
  color: rgba(157, 46, 34, 0.54);
  border-color: rgba(157, 46, 34, 0.16);
  box-shadow: none;
}

#auth-login-form > div:nth-child(3) {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

#auth-login-form > div:nth-child(3) input {
  width: auto;
}

#auth-login-form > div:nth-child(3) label {
  font-weight: 500;
}

#session-section > div {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

#settings-section > div:not(.portal-section-head),
#admin-users-section > div:not(.portal-section-head) {
  display: grid;
  gap: 0.65rem;
}

#settings-section > div:not(.portal-section-head) {
  margin-bottom: 0.95rem;
}

.account-settings-stack {
  display: grid;
  gap: 1.6rem;
  margin-top: 1.45rem;
}

.account-settings-block {
  display: grid;
  gap: 0.85rem;
}

.account-settings-block + .account-settings-block {
  padding-top: 1.3rem;
  border-top: 1px solid var(--portal-line);
}

.account-settings-block button {
  justify-self: start;
}

.account-settings-block--danger {
  gap: 0.85rem;
}

.account-settings-note {
  margin: 0;
  max-width: 42rem;
  color: #6d4a44;
  font-size: var(--font-body);
  line-height: 1.6;
}

.account-settings-note .obfuscated-email {
  color: #9d2e22;
}

#admin-users-section {
  overflow: hidden;
}

#admin-users-section .admin-users-table-wrap {
  width: 100%;
  max-width: 100%;
  margin-top: 1rem;
  overflow-x: auto;
  overflow-y: hidden;
  border-radius: 24px;
  border: 1px solid var(--portal-line);
  background: rgba(255, 255, 255, 0.66);
}

#admin-users-section table {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
  overflow: hidden;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.9);
  margin-top: 0;
}

#admin-users-section th,
#admin-users-section td {
  border-bottom: 1px solid var(--portal-line);
  padding: 0.9rem 0.95rem;
  text-align: left;
  vertical-align: top;
}

#admin-users-section th {
  color: rgba(19, 19, 23, 0.7);
  background: rgba(19, 19, 23, 0.04);
  font-size: var(--font-label);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

#admin-users-section tr:last-child td {
  border-bottom: 0;
}

#admin-users-section tr.is-inactive {
  background: rgba(19, 19, 23, 0.03);
}

#admin-users-section tr.is-inactive td:not(:last-child) {
  color: rgba(19, 19, 23, 0.45);
}

#admin-users-section tr.is-inactive td:last-child {
  opacity: 0.84;
}

.admin-users-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  width: 100%;
}

.admin-tabs {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.3rem;
  margin-top: -0.15rem;
  margin-bottom: 1rem;
  padding: 0.25rem;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  border: 0;
  border-radius: 0;
  background: transparent;
  backdrop-filter: none;
  box-shadow: none;
}

#content .admin-tabs__button {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.65rem;
  padding: 0.7rem 1rem;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.54);
  color: rgba(19, 19, 23, 0.8);
  border: 1px solid var(--portal-line);
  font: inherit;
  font-size: var(--font-body);
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  text-align: center;
  line-height: 1.2;
  cursor: pointer;
  flex: 0 0 auto;
  box-shadow: none;
  transition:
    background-color 0.2s ease,
    color 0.2s ease,
    opacity 0.2s ease;
}

#content .admin-tabs__button:hover {
  background: rgba(255, 255, 255, 0.74);
  color: var(--text);
  transform: none;
  box-shadow: none;
}

#content .admin-tabs__button.is-active {
  background: rgba(20, 121, 98, 0.12);
  border-color: rgba(20, 121, 98, 0.18);
  color: var(--accent-strong);
  box-shadow: none;
}

#content .admin-tabs__button:disabled,
#content .admin-tabs__button:disabled:hover {
  background: rgba(19, 19, 23, 0.08);
  color: rgba(19, 19, 23, 0.42);
  box-shadow: none;
  transform: none;
}

.portal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.15rem;
}

.portal-field-validation {
  margin: 0;
  color: #9a3021;
  font-size: var(--font-meta);
  font-weight: 600;
}

.admin-projects-section {
  display: grid;
  gap: 1rem;
}

.admin-project-grid {
  display: grid;
  gap: 1rem;
  margin-top: 0;
}

.admin-project-card {
  display: grid;
  gap: 1.1rem;
  padding: 1.35rem;
  background: var(--portal-surface-soft);
  border: 1px solid var(--portal-line);
  border-radius: 28px;
  box-shadow: var(--portal-shadow-sm);
}

.admin-project-card.is-inactive {
  background: rgba(19, 19, 23, 0.04);
  border-color: rgba(19, 19, 23, 0.08);
}

.admin-project-card__eyebrow {
  margin-bottom: 0.15rem;
}

.admin-project-card.is-inactive .admin-project-card__eyebrow,
.admin-project-card.is-inactive .admin-project-card__meta,
.admin-project-card.is-inactive .admin-project-card__hint,
.admin-project-card.is-inactive .admin-project-card__field label {
  color: rgba(19, 19, 23, 0.48);
}

.admin-project-card.is-inactive h3,
.admin-project-card.is-inactive h4,
.admin-project-card.is-inactive h5,
.admin-project-card.is-inactive .admin-project-card__meta strong {
  color: rgba(19, 19, 23, 0.58);
}

.admin-project-card.is-inactive .admin-project-card__folder-value {
  color: rgba(19, 19, 23, 0.48);
}

.admin-project-card__head {
  display: grid;
  gap: 0.45rem;
}

.admin-project-card h3,
.admin-project-card h4,
.admin-project-card h5 {
  margin: 0;
  font-family: "Sora", "Manrope", sans-serif;
  letter-spacing: -0.02em;
}

.admin-project-card h3 {
  font-size: var(--font-heading);
  line-height: 1;
}

.admin-project-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1rem;
  color: var(--portal-muted);
  font-size: var(--font-body);
}

.admin-project-card__meta-form {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(220px, 0.8fr);
  gap: 0.9rem 1rem;
  align-items: end;
}

.admin-project-card__description,
.admin-project-card__assign,
.admin-project-card__assignment,
.admin-project-card__status {
  display: grid;
  gap: 0.65rem;
}

.admin-project-card__field {
  display: grid;
  gap: 0.45rem;
  align-content: start;
}

.admin-project-card__field label {
  margin: 0;
}

.admin-project-card__folder-value {
  margin: 0;
  color: var(--portal-muted);
  font-size: var(--font-body);
  line-height: 1.5;
}

.admin-project-card__hint,
.admin-project-empty {
  margin: 0;
  color: var(--portal-muted);
  font-size: var(--font-meta);
}

.admin-project-card__actions,
.admin-project-assignment__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.admin-project-access-list {
  display: grid;
  gap: 0.85rem;
}

.admin-project-assignment {
  display: grid;
  gap: 0.85rem;
  padding: 1rem;
  border-radius: 22px;
  border: 1px solid var(--portal-line);
  background: rgba(255, 255, 255, 0.68);
}

.admin-project-assignment.is-inactive {
  background: rgba(19, 19, 23, 0.04);
  border-color: rgba(19, 19, 23, 0.08);
}

.admin-project-assignment.is-inactive .admin-project-assignment__meta-item {
  color: rgba(19, 19, 23, 0.48);
}

.admin-project-assignment__identity {
  display: grid;
  gap: 0.3rem;
}

.admin-project-assignment__identity-line {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  align-items: center;
}

.admin-project-assignment__email,
.admin-project-assignment__status {
  color: var(--portal-muted);
}

.admin-project-assignment__status {
  font-weight: 600;
}

.admin-project-assignment__meta-item {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.25rem;
  color: var(--portal-muted);
}

.admin-project-assignment__meta-item strong,
.admin-project-assignment__identity strong,
.admin-project-card__meta strong {
  color: var(--text);
}

.admin-project-assignment.is-inactive .admin-project-assignment__email,
.admin-project-assignment.is-inactive .admin-project-assignment__status,
.admin-project-assignment.is-inactive .admin-project-assignment__identity strong {
  color: rgba(19, 19, 23, 0.48);
}

.admin-project-assignment__window,
.admin-project-card__assign-grid {
  display: grid;
  gap: 0.7rem 0.85rem;
  align-items: end;
}

.admin-project-assignment__window {
  grid-template-columns: repeat(2, minmax(180px, 1fr));
}

.admin-project-card__assign-grid {
  grid-template-columns: minmax(0, 1.35fr) repeat(2, minmax(180px, 0.8fr));
}

.admin-project-card__assign-grid > div,
.admin-project-assignment__window > div {
  display: grid;
  gap: 0.45rem;
}

.admin-project-card__field--date label {
  color: var(--portal-muted);
  font-size: var(--font-meta);
}

.admin-project-card__field--date input {
  min-height: 2.85rem;
  padding: 0.72rem 0.85rem;
  font-size: var(--font-meta);
  border-radius: 16px;
}

.portal-steps {
  margin: 1.15rem 0 0;
  padding-left: 1.25rem;
  color: var(--portal-muted);
}

.portal-steps li + li {
  margin-top: 0.6rem;
}

.portal-code-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 1.15rem;
}

.portal-code-list code {
  display: inline-flex;
  align-items: center;
  min-height: 2.5rem;
  padding: 0.45rem 0.8rem;
  border-radius: 999px;
  background: rgba(19, 19, 23, 0.05);
  border: 1px solid var(--portal-line);
  color: var(--text);
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr));
  gap: 1.1rem;
}

.project-card {
  display: grid;
  gap: 0.95rem;
  padding: 1.5rem;
}

.project-card p,
.project-content-card p {
  margin: 0;
}

.portal-empty-state {
  text-align: left;
}

.project-content-card {
  display: grid;
  gap: 1rem;
}

.portal-counter-summary,
.portal-counter-day__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.9rem;
}

.portal-counter-summary {
  margin-bottom: 1.5rem;
}

.portal-counter-filters {
  margin-bottom: 1.25rem;
}

.portal-counter-filter-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr)) auto;
  gap: 0.9rem;
  align-items: end;
}

.portal-counter-filter-field {
  display: grid;
  gap: 0.45rem;
}

.portal-counter-filter-field span {
  display: block;
  font-size: var(--font-label);
  color: rgba(19, 19, 23, 0.56);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.portal-counter-filter-field input {
  width: 100%;
}

.portal-counter-filter-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.portal-counter-card,
.portal-counter-day {
  padding: 1.25rem;
}

.portal-counter-card span,
.portal-counter-day__label {
  display: block;
  font-size: var(--font-label);
  color: rgba(19, 19, 23, 0.56);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.portal-counter-card strong {
  display: block;
  margin-top: 0.6rem;
  font-family: "Sora", "Manrope", sans-serif;
  font-size: var(--font-stat);
  line-height: 1;
}

.portal-counter-days {
  display: grid;
  gap: 1rem;
}

.portal-counter-day h3 {
  margin: 0.3rem 0 0;
}

.portal-counter-timestamps {
  display: grid;
  gap: 0.75rem;
  margin-top: 1rem;
}

.portal-counter-timestamps details {
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid var(--portal-line);
  border-radius: 18px;
  padding: 0.9rem 1rem;
}

.portal-counter-timestamps summary {
  cursor: pointer;
  font-weight: 700;
}

.portal-counter-timestamps ul {
  margin: 0.8rem 0 0;
  padding-left: 1.1rem;
}

.portal-counter-entry-list {
  list-style: none;
  padding: 0;
  margin: 0.8rem 0 0;
  display: grid;
  gap: 0.55rem;
}

.portal-counter-entry-list li {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.4rem 1rem;
  padding-bottom: 0.45rem;
  border-bottom: 1px solid rgba(19, 19, 23, 0.08);
}

.portal-counter-entry-list li:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.portal-counter-entry-list strong {
  font-size: 0.95rem;
}

@media (max-width: 920px) {
  .portal-counter-filter-form {
    grid-template-columns: 1fr;
  }

  .portal-section-head {
    align-items: flex-start;
  }

  #admin-users-section table,
  #admin-users-section thead,
  #admin-users-section tbody,
  #admin-users-section tr,
  #admin-users-section th,
  #admin-users-section td {
    display: block;
    width: 100%;
  }

  #admin-users-section table {
    min-width: 0;
    border-collapse: separate;
    background: transparent;
    border-radius: 0;
    margin-top: 1rem;
  }

  #admin-users-section {
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
  }

  #admin-users-section .admin-users-table-wrap {
    margin-top: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    overflow: visible;
  }

  #admin-users-section thead {
    display: none;
  }

  #admin-users-section tbody {
    display: grid;
    gap: 0.9rem;
  }

  #admin-users-section tr {
    position: relative;
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 0.55rem 0.7rem;
    padding: 1.1rem;
    border: 1px solid var(--portal-line);
    border-radius: 24px;
    background: var(--portal-surface-soft);
    box-shadow: var(--portal-shadow-sm);
  }

  #admin-users-section tr::before {
    content: attr(data-card-label);
    display: inline-flex;
    align-items: center;
    order: -2;
    margin: 0 0 0.55rem;
    padding-left: 1.85rem;
    color: var(--accent-strong);
    font-size: var(--font-label);
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    background-image: linear-gradient(currentColor, currentColor);
    background-size: 1.25rem 1px;
    background-repeat: no-repeat;
    background-position: left center;
    white-space: nowrap;
  }

  #admin-users-section tr::after {
    display: none;
  }

  #admin-users-section td {
    border: 0;
    padding: 0;
    display: grid;
    gap: 0.45rem;
    align-content: start;
  }

  #admin-users-section tr.is-inactive {
    background: rgba(255, 255, 255, 0.46);
  }

  #admin-users-section tr.is-inactive td {
    color: rgba(19, 19, 23, 0.46);
  }

  #admin-users-section tr.is-inactive td::before,
  #admin-users-section tr.is-inactive::before {
    color: rgba(19, 19, 23, 0.44);
  }

  #admin-users-section tr.is-admin-user::before {
    color: #9d2e22;
  }

  #admin-users-section tr.is-admin-user.is-inactive::before {
    color: rgba(157, 46, 34, 0.58);
  }

  #admin-users-section td:nth-child(3) {
    order: -1;
    grid-column: 1 / -1;
    margin-top: 0;
    margin-bottom: 0.2rem;
    color: var(--text);
    font-family: "Sora", "Manrope", sans-serif;
    font-size: var(--font-heading);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1;
    overflow-wrap: anywhere;
  }

  #admin-users-section td:nth-child(3)::before {
    display: none;
    content: none;
  }

  #admin-users-section td:nth-child(1) {
    grid-column: 1 / 3;
  }

  #admin-users-section td:nth-child(2) {
    grid-column: 3 / 9;
  }

  #admin-users-section td:nth-child(4) {
    grid-column: 9 / -1;
  }

  #admin-users-section td:nth-child(6) {
    grid-column: 1 / 7;
  }

  #admin-users-section td:nth-child(7) {
    grid-column: 7 / -1;
  }

  #admin-users-section td:nth-child(1),
  #admin-users-section td:nth-child(2),
  #admin-users-section td:nth-child(4),
  #admin-users-section td:nth-child(6),
  #admin-users-section td:nth-child(7) {
    margin-top: 0;
  }

  #admin-users-section td:nth-child(5) {
    display: none;
  }

  #admin-users-section td:empty {
    display: none;
  }

  #admin-users-section td::before {
    content: attr(data-label);
    display: block;
    margin: 0;
    color: var(--muted-strong);
    font-size: var(--font-body);
    font-weight: 700;
    letter-spacing: 0;
    text-transform: none;
  }

  #admin-users-section td:last-child {
    display: flex;
    grid-column: 1 / -1;
    flex-wrap: wrap;
    gap: 0.65rem;
    margin-top: 0.25rem;
    padding-top: 0.85rem;
    border-top: 1px solid var(--portal-line);
  }

  #admin-users-section td:last-child::before {
    width: 100%;
  }

  #admin-users-section td:last-child button {
    flex: 1 1 160px;
  }
}

@media (max-width: 620px) {
  #admin-users-section td:nth-child(1),
  #admin-users-section td:nth-child(2),
  #admin-users-section td:nth-child(4),
  #admin-users-section td:nth-child(6),
  #admin-users-section td:nth-child(7) {
    grid-column: 1 / -1;
  }
}

@media (max-width: 720px) {
  .portal-page {
    width: calc(100vw - 1rem);
    padding: 1.5rem 0 3.5rem;
  }

  .portal-login-view .portal-page {
    min-height: calc(100vh - 5rem);
    padding-top: 1rem;
    padding-bottom: 1.5rem;
  }

  .portal-section-head {
    gap: 0.85rem;
    margin-bottom: 1rem;
  }

  .portal-shell.is-collapsed .portal-shell__nav {
    min-width: min(340px, calc(100vw - 1rem));
    max-width: min(340px, calc(100vw - 1rem));
  }

  .portal-shell__link {
    min-height: 2.55rem;
    padding: 0.65rem 0.82rem;
  }

  .admin-tabs {
    gap: 0.3rem;
    margin-bottom: 0.85rem;
    width: 100%;
    border-radius: 24px;
  }

  .admin-tabs__button {
    flex: 0 0 auto;
    min-width: max-content;
  }

  .portal-toast-stack {
    width: calc(100vw - 1rem);
    bottom: 0.75rem;
  }

  .portal-loading-screen {
    min-height: 300px;
    padding: 1.4rem 1.1rem;
  }

  .portal-loading-screen__network {
    transform: scale(0.92);
  }

  .portal-card,
  .portal-config,
  .portal-panel,
  .portal-loading-screen,
  .project-card,
  .portal-counter-card,
  .portal-counter-day {
    border-radius: 26px;
    padding: 1.15rem;
  }

  #auth-mode-switch {
    width: 100%;
    flex-wrap: wrap;
  }

  #auth-mode-switch button {
    flex: 1 1 0;
  }

  .portal-actions {
    flex-direction: column;
  }

  #content .portal-button,
  .portal-action {
    width: 100%;
  }

  .admin-project-card__actions,
  .admin-project-assignment__actions {
    flex-direction: column;
  }

  .admin-project-card__meta-form,
  .admin-project-card__assign-grid,
  .admin-project-assignment__window {
    grid-template-columns: 1fr;
  }

  .portal-code-list {
    flex-direction: column;
  }
}

@keyframes portal-node-drift {
  0%,
  100% {
    transform: translate3d(0, 0, 0) scale(0.96);
  }

  25% {
    transform: translate3d(2px, -3px, 0) scale(1);
  }

  50% {
    transform: translate3d(-2px, 2px, 0) scale(1.04);
  }

  75% {
    transform: translate3d(3px, 1px, 0) scale(0.98);
  }
}

@keyframes portal-line-breathe {
  0%,
  100% {
    opacity: 0.28;
    transform: rotate(var(--portal-line-rotation)) scaleX(0.94);
  }

  50% {
    opacity: 0.66;
    transform: rotate(var(--portal-line-rotation)) scaleX(1.04);
  }
}
