:root {
  --ink: #142033;
  --ink-2: #435064;
  --ink-3: #7b8799;
  --navy: #101c2c;
  --navy-2: #17263a;
  --navy-3: #22364f;
  --paper: #ffffff;
  --canvas: #f3f6f8;
  --line: #e5eaef;
  --line-strong: #d7dee6;
  --teal: #25b99a;
  --teal-dark: #16967d;
  --teal-soft: #e7f8f4;
  --orange: #ff8b5c;
  --orange-soft: #fff1ea;
  --blue: #4f7cf7;
  --blue-soft: #edf2ff;
  --amber: #eca93c;
  --amber-soft: #fff7e8;
  --red: #e95d64;
  --red-soft: #ffedef;
  --purple: #8b6de9;
  --purple-soft: #f1edff;
  --shadow-sm: 0 4px 15px rgba(18, 38, 60, 0.05);
  --shadow-md: 0 12px 34px rgba(18, 38, 60, 0.09);
  --shadow-lg: 0 24px 70px rgba(10, 24, 42, 0.18);
  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 24px;
  --sidebar: 248px;
  --topbar: 74px;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--canvas);
  color: var(--ink);
  font-family:
    Inter, "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", Arial,
    sans-serif;
  -webkit-font-smoothing: antialiased;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
}

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

button,
a,
select {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

svg {
  display: block;
}

img {
  max-width: 100%;
}

::selection {
  background: rgba(37, 185, 154, 0.2);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.boot-screen {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 28px;
  background:
    radial-gradient(circle at 50% 40%, rgba(37, 185, 154, 0.12), transparent 28%),
    var(--canvas);
  color: var(--ink);
  text-align: center;
}

.boot-screen > span {
  max-width: 460px;
  color: var(--ink-3);
  font-size: 12px;
  line-height: 1.7;
}

.boot-screen > .btn {
  margin-top: 8px;
}

.boot-mark {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  margin-bottom: 5px;
  border-radius: 17px;
  background: var(--teal);
  color: #fff;
  box-shadow: 0 12px 30px rgba(37, 185, 154, 0.24);
}

.boot-mark.error {
  background: var(--red);
  box-shadow: 0 12px 30px rgba(233, 93, 100, 0.2);
}

.boot-spinner {
  width: 24px;
  height: 24px;
  margin: 6px 0;
  border: 3px solid #dce5e8;
  border-top-color: var(--teal);
  border-radius: 50%;
  animation: boot-spin 700ms linear infinite;
}

@keyframes boot-spin {
  to { transform: rotate(360deg); }
}

.icon {
  width: 19px;
  height: 19px;
  flex: 0 0 auto;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

.icon-sm {
  width: 16px;
  height: 16px;
}

.icon-lg {
  width: 24px;
  height: 24px;
}

.btn {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 17px;
  border: 1px solid transparent;
  border-radius: 11px;
  background: var(--paper);
  color: var(--ink-2);
  font-weight: 650;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    background 160ms ease,
    border-color 160ms ease,
    opacity 160ms ease;
}

.btn:hover:not(:disabled) {
  transform: translateY(-1px);
}

.btn:focus-visible,
.icon-button:focus-visible,
.nav-item:focus-visible,
.tab-button:focus-visible {
  outline: 3px solid rgba(79, 124, 247, 0.2);
  outline-offset: 2px;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  color: #fff;
  background: var(--teal);
  box-shadow: 0 8px 18px rgba(37, 185, 154, 0.2);
}

.btn-primary:hover:not(:disabled) {
  background: var(--teal-dark);
  box-shadow: 0 10px 24px rgba(37, 185, 154, 0.25);
}

.btn-dark {
  color: #fff;
  background: var(--navy);
  box-shadow: 0 8px 20px rgba(16, 28, 44, 0.18);
}

.btn-secondary {
  border-color: var(--line-strong);
  background: var(--paper);
}

.btn-secondary:hover:not(:disabled) {
  border-color: #bcc7d2;
  background: #fafbfc;
}

.btn-danger-soft {
  color: var(--red);
  background: var(--red-soft);
}

.btn-orange {
  color: #fff;
  background: var(--orange);
  box-shadow: 0 8px 18px rgba(255, 139, 92, 0.23);
}

.btn-sm {
  min-height: 34px;
  padding: 0 12px;
  border-radius: 9px;
  font-size: 13px;
}

.btn-lg {
  min-height: 50px;
  padding: 0 22px;
  border-radius: 13px;
}

.btn-block {
  width: 100%;
}

.icon-button {
  width: 40px;
  height: 40px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--paper);
  color: var(--ink-2);
  cursor: pointer;
  transition: 160ms ease;
}

.icon-button:hover {
  color: var(--ink);
  border-color: var(--line-strong);
  background: #f9fafb;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field > label,
.field-label {
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 650;
}

.required::after {
  content: " *";
  color: var(--red);
}

.input,
.select,
.textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  background: var(--paper);
  color: var(--ink);
  outline: none;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    background 160ms ease;
}

.input,
.select {
  min-height: 44px;
  padding: 0 13px;
}

.textarea {
  min-height: 108px;
  padding: 12px 13px;
  line-height: 1.65;
  resize: vertical;
}

.input:hover,
.select:hover,
.textarea:hover {
  border-color: #bac5d0;
}

.input:focus,
.select:focus,
.textarea:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(37, 185, 154, 0.12);
}

.input::placeholder,
.textarea::placeholder {
  color: #a7b0bd;
}

.input-shell {
  position: relative;
}

.input-shell .icon {
  position: absolute;
  top: 50%;
  left: 14px;
  color: #91a0b1;
  transform: translateY(-50%);
  pointer-events: none;
}

.input-shell .input {
  padding-left: 42px;
}

.input-hint {
  color: var(--ink-3);
  font-size: 12px;
  line-height: 1.55;
}

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

.field-span-2 {
  grid-column: span 2;
}

.checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  color: var(--ink-2);
  font-size: 13px;
  line-height: 1.55;
}

.checkbox-row input {
  width: 16px;
  height: 16px;
  margin-top: 2px;
  accent-color: var(--teal);
}

.tag,
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  white-space: nowrap;
}

.tag {
  min-height: 26px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f7f9fa;
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 600;
}

.tag-teal {
  border-color: #caeee5;
  background: var(--teal-soft);
  color: var(--teal-dark);
}

.tag-orange {
  border-color: #ffdccd;
  background: var(--orange-soft);
  color: #cf6436;
}

.tag-blue {
  border-color: #d7e1ff;
  background: var(--blue-soft);
  color: #426bd7;
}

.tag-amber {
  border-color: #f8e1b5;
  background: var(--amber-soft);
  color: #a86c0a;
}

.tag-red {
  border-color: #fad5d8;
  background: var(--red-soft);
  color: #c6464d;
}

.tag-purple {
  border-color: #ded4ff;
  background: var(--purple-soft);
  color: #7357cd;
}

.badge {
  min-height: 24px;
  padding: 0 9px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 700;
}

.badge-success {
  background: var(--teal-soft);
  color: var(--teal-dark);
}

.badge-warning {
  background: var(--amber-soft);
  color: #aa6e0a;
}

.badge-info {
  background: var(--blue-soft);
  color: #426bd7;
}

.badge-danger {
  background: var(--red-soft);
  color: #c6464d;
}

.badge-neutral {
  background: #eef1f4;
  color: #687587;
}

.badge-purple {
  background: var(--purple-soft);
  color: #7357cd;
}

.muted {
  color: var(--ink-3);
}

.text-teal {
  color: var(--teal-dark);
}

.text-red {
  color: var(--red);
}

.text-amber {
  color: #a86c0a;
}

.section-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: var(--shadow-sm);
}

.card-header {
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 22px;
  border-bottom: 1px solid var(--line);
}

.card-heading h2,
.card-heading h3 {
  margin: 0;
  color: var(--ink);
  font-size: 16px;
  font-weight: 750;
}

.card-heading p {
  margin: 5px 0 0;
  color: var(--ink-3);
  font-size: 12px;
}

.card-body {
  padding: 22px;
}

/* Authentication */
.auth-page {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  overflow: hidden;
  background:
    radial-gradient(circle at 13% 17%, rgba(37, 185, 154, 0.13), transparent 30%),
    radial-gradient(circle at 84% 78%, rgba(79, 124, 247, 0.1), transparent 30%),
    #f6f8fa;
}

.auth-header {
  width: min(1240px, calc(100% - 56px));
  height: 82px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
}

.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--teal);
  color: #fff;
  box-shadow: 0 9px 20px rgba(37, 185, 154, 0.25);
}

.brand-mark svg {
  width: 23px;
  height: 23px;
}

.brand-copy strong {
  display: block;
  color: var(--ink);
  font-size: 16px;
  letter-spacing: 0.02em;
}

.brand-copy small {
  display: block;
  margin-top: 1px;
  color: var(--ink-3);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.auth-header-note {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-3);
  font-size: 13px;
}

.auth-main {
  width: min(1160px, calc(100% - 56px));
  margin: auto;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(390px, 0.72fr);
  align-items: center;
  gap: clamp(54px, 8vw, 120px);
  padding: 30px 0 50px;
}

.auth-showcase {
  position: relative;
  padding: 30px 0;
}

.auth-showcase::after {
  content: "";
  position: absolute;
  z-index: -1;
  top: -80px;
  left: -130px;
  width: 480px;
  height: 480px;
  border: 1px solid rgba(37, 185, 154, 0.12);
  border-radius: 50%;
  box-shadow:
    0 0 0 56px rgba(37, 185, 154, 0.035),
    0 0 0 120px rgba(37, 185, 154, 0.025);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 22px;
  color: var(--teal-dark);
  font-size: 13px;
  font-weight: 750;
  letter-spacing: 0.06em;
}

.eyebrow-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 0 5px rgba(37, 185, 154, 0.12);
}

.auth-showcase h1 {
  max-width: 630px;
  margin: 0;
  color: var(--navy);
  font-size: clamp(40px, 5vw, 66px);
  font-weight: 760;
  line-height: 1.13;
  letter-spacing: -0.055em;
}

.auth-showcase h1 span {
  color: var(--teal);
}

.auth-lead {
  max-width: 570px;
  margin: 25px 0 0;
  color: #657285;
  font-size: 16px;
  line-height: 1.9;
}

.auth-features {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 13px;
  margin-top: 38px;
}

.auth-feature {
  min-height: 116px;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.62);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(12px);
}

.auth-feature-icon {
  width: 35px;
  height: 35px;
  display: grid;
  place-items: center;
  margin-bottom: 14px;
  border-radius: 10px;
  background: var(--teal-soft);
  color: var(--teal-dark);
}

.auth-feature strong {
  display: block;
  margin-bottom: 5px;
  font-size: 14px;
}

.auth-feature span {
  color: var(--ink-3);
  font-size: 11px;
}

.auth-card {
  position: relative;
  padding: 30px;
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 25px;
  background: rgba(255, 255, 255, 0.93);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(16px);
}

.auth-card::before {
  content: "";
  position: absolute;
  top: 0;
  right: 34px;
  left: 34px;
  height: 3px;
  border-radius: 0 0 999px 999px;
  background: linear-gradient(90deg, var(--teal), #6e8ef7);
}

.auth-card-heading {
  margin-bottom: 24px;
}

.auth-card-heading h2 {
  margin: 0;
  font-size: 24px;
  letter-spacing: -0.02em;
}

.auth-card-heading p {
  margin: 8px 0 0;
  color: var(--ink-3);
  font-size: 13px;
  line-height: 1.6;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin-bottom: 22px;
  padding: 4px;
  border-radius: 12px;
  background: #eef2f5;
}

.tab-button {
  min-height: 38px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--ink-3);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.tab-button.active {
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 3px 10px rgba(30, 47, 68, 0.08);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.auth-code-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 104px;
  gap: 10px;
}

.auth-footer {
  width: min(1240px, calc(100% - 56px));
  min-height: 62px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-top: 1px solid rgba(215, 222, 230, 0.7);
  color: var(--ink-3);
  font-size: 11px;
}

.auth-footer-links {
  display: flex;
  gap: 18px;
}

/* App shell */
.app-shell {
  min-height: 100vh;
  display: flex;
  background: var(--canvas);
}

.sidebar {
  position: fixed;
  z-index: 30;
  inset: 0 auto 0 0;
  width: var(--sidebar);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background:
    radial-gradient(circle at 30% 12%, rgba(37, 185, 154, 0.12), transparent 28%),
    var(--navy);
  color: #dbe5ef;
}

.sidebar-brand {
  height: var(--topbar);
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 22px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.sidebar-brand .brand-mark {
  width: 35px;
  height: 35px;
  border-radius: 10px;
}

.sidebar-brand-copy strong {
  display: block;
  color: #fff;
  font-size: 15px;
}

.sidebar-brand-copy small {
  display: block;
  margin-top: 2px;
  color: #8292a6;
  font-size: 9px;
  letter-spacing: 0.13em;
}

.role-switcher {
  margin: 17px 14px 8px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.045);
}

.role-switcher-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #7f90a5;
  font-size: 10px;
}

.role-switcher-current {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 9px;
}

.role-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 0 4px rgba(37, 185, 154, 0.12);
}

.role-switcher-current strong {
  color: #fff;
  font-size: 12px;
}

.role-switcher-current span {
  margin-left: auto;
  color: #8292a6;
}

.side-nav {
  flex: 1;
  padding: 13px 12px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.12) transparent;
}

.nav-label {
  margin: 15px 11px 8px;
  color: #66788e;
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.11em;
}

.nav-item {
  width: 100%;
  min-height: 43px;
  display: flex;
  align-items: center;
  gap: 11px;
  margin: 3px 0;
  padding: 0 12px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #9eacbd;
  font-size: 13px;
  font-weight: 560;
  text-align: left;
  cursor: pointer;
  transition: 150ms ease;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.055);
  color: #eef4fa;
}

.nav-item.active {
  background: rgba(37, 185, 154, 0.14);
  color: #6ee1c8;
  font-weight: 680;
}

.nav-count {
  min-width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  margin-left: auto;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--orange);
  color: #fff;
  font-size: 10px;
  font-weight: 750;
}

.sidebar-footer {
  padding: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.sidebar-help {
  position: relative;
  overflow: hidden;
  padding: 14px;
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.055);
}

.sidebar-help::after {
  content: "";
  position: absolute;
  right: -24px;
  bottom: -32px;
  width: 82px;
  height: 82px;
  border-radius: 50%;
  background: rgba(37, 185, 154, 0.1);
}

.sidebar-help strong {
  display: block;
  color: #e9f0f7;
  font-size: 11px;
}

.sidebar-help p {
  position: relative;
  z-index: 1;
  margin: 6px 0 0;
  color: #7f90a5;
  font-size: 10px;
  line-height: 1.55;
}

.workspace {
  width: calc(100% - var(--sidebar));
  min-width: 0;
  min-height: 100vh;
  margin-left: var(--sidebar);
}

.topbar {
  position: sticky;
  z-index: 20;
  top: 0;
  height: var(--topbar);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 0 clamp(20px, 3vw, 38px);
  border-bottom: 1px solid rgba(222, 229, 235, 0.9);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(15px);
}

.topbar-left {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 13px;
}

.breadcrumb {
  min-width: 0;
}

.mobile-menu-button {
  display: none;
}

.breadcrumb small {
  display: block;
  margin-bottom: 3px;
  color: var(--ink-3);
  font-size: 10px;
}

.breadcrumb strong {
  display: block;
  overflow: hidden;
  font-size: 15px;
  font-weight: 730;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 11px;
}

.topbar-search {
  width: min(250px, 21vw);
  position: relative;
}

.topbar-search input {
  width: 100%;
  height: 39px;
  padding: 0 13px 0 38px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #f7f9fa;
  outline: none;
  font-size: 12px;
}

.topbar-search .icon {
  position: absolute;
  top: 50%;
  left: 12px;
  color: #98a4b2;
  transform: translateY(-50%);
}

.notification-button {
  position: relative;
}

.notification-dot {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 7px;
  height: 7px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--orange);
}

.user-menu {
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 6px 4px 5px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  cursor: pointer;
}

.user-menu:hover {
  background: #f5f7f9;
}

.avatar {
  width: 35px;
  height: 35px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 11px;
  background: linear-gradient(145deg, var(--navy-3), var(--navy));
  color: #fff;
  font-size: 12px;
  font-weight: 750;
}

.avatar.worker {
  background: linear-gradient(145deg, #45ceb0, #15977e);
}

.avatar.orange {
  background: linear-gradient(145deg, #ffad7d, #e66c3d);
}

.avatar.purple {
  background: linear-gradient(145deg, #a38af1, #7457cd);
}

.user-menu-copy {
  text-align: left;
}

.user-menu-copy strong {
  display: block;
  font-size: 12px;
}

.user-menu-copy span {
  display: block;
  margin-top: 2px;
  color: var(--ink-3);
  font-size: 10px;
}

.page {
  width: min(1540px, 100%);
  margin: 0 auto;
  padding: 30px clamp(20px, 3vw, 38px) 50px;
}

.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 22px;
  margin-bottom: 24px;
}

.page-title h1 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(24px, 2.2vw, 31px);
  font-weight: 760;
  letter-spacing: -0.035em;
}

.page-title p {
  margin: 8px 0 0;
  color: var(--ink-3);
  font-size: 13px;
  line-height: 1.6;
}

.page-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.mobile-bottom-nav {
  display: none;
}

.sidebar-overlay {
  display: none;
}

/* Dashboard */
.welcome-banner {
  position: relative;
  min-height: 154px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  margin-bottom: 22px;
  padding: 28px 32px;
  overflow: hidden;
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at 82% 18%, rgba(56, 218, 185, 0.22), transparent 26%),
    linear-gradient(125deg, #101c2c 0%, #172b40 62%, #1d3d4a 100%);
  color: #fff;
  box-shadow: 0 16px 38px rgba(16, 28, 44, 0.14);
}

.welcome-banner::after {
  content: "";
  position: absolute;
  right: 6%;
  bottom: -115px;
  width: 260px;
  height: 260px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  box-shadow:
    0 0 0 34px rgba(255, 255, 255, 0.025),
    0 0 0 68px rgba(255, 255, 255, 0.018);
}

.welcome-copy {
  position: relative;
  z-index: 1;
}

.welcome-kicker {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 9px;
  color: #87dccb;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.welcome-copy h2 {
  margin: 0;
  font-size: 25px;
  font-weight: 720;
  letter-spacing: -0.02em;
}

.welcome-copy p {
  margin: 9px 0 0;
  color: #9fb0c2;
  font-size: 12px;
  line-height: 1.65;
}

.welcome-actions {
  position: relative;
  z-index: 2;
  display: flex;
  gap: 10px;
}

.welcome-actions .btn-secondary {
  border-color: rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.08);
  color: #e6edf5;
}

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

.stat-card {
  min-width: 0;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: var(--shadow-sm);
}

.stat-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.stat-icon {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--teal-soft);
  color: var(--teal-dark);
}

.stat-icon.orange {
  background: var(--orange-soft);
  color: #db6c3d;
}

.stat-icon.blue {
  background: var(--blue-soft);
  color: #4d72db;
}

.stat-icon.purple {
  background: var(--purple-soft);
  color: #7b60d5;
}

.stat-trend {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: var(--teal-dark);
  font-size: 10px;
  font-weight: 700;
}

.stat-trend.neutral {
  color: var(--ink-3);
}

.stat-card strong.value {
  display: block;
  margin-top: 17px;
  overflow: hidden;
  font-size: clamp(24px, 2.2vw, 31px);
  font-weight: 760;
  text-overflow: ellipsis;
  white-space: nowrap;
  letter-spacing: -0.04em;
}

.stat-card .label {
  display: block;
  margin-top: 5px;
  color: var(--ink-3);
  font-size: 12px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(280px, 0.72fr);
  gap: 20px;
}

.dashboard-stack {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.chart-wrap {
  min-height: 260px;
  padding: 22px 22px 16px;
}

.chart-legend {
  display: flex;
  align-items: center;
  gap: 17px;
  margin-bottom: 24px;
  color: var(--ink-3);
  font-size: 11px;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.legend-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--teal);
}

.legend-dot.blue {
  background: #7c99ec;
}

.bar-chart {
  height: 178px;
  display: flex;
  align-items: flex-end;
  justify-content: space-around;
  gap: 14px;
  padding: 0 4px;
  border-bottom: 1px solid var(--line);
  background: repeating-linear-gradient(
    to bottom,
    transparent,
    transparent 43px,
    rgba(229, 234, 239, 0.7) 44px
  );
}

.bar-group {
  height: 100%;
  display: flex;
  align-items: flex-end;
  gap: 5px;
  position: relative;
  flex: 1;
  justify-content: center;
}

.bar {
  width: min(16px, 32%);
  min-height: 6px;
  border-radius: 5px 5px 2px 2px;
  background: var(--teal);
  transition: height 400ms ease;
}

.bar.secondary {
  background: #cdd8f8;
}

.bar-label {
  position: absolute;
  top: calc(100% + 10px);
  color: var(--ink-3);
  font-size: 10px;
}

.donut-wrap {
  display: flex;
  align-items: center;
  gap: 25px;
  padding: 24px 20px;
}

.donut {
  position: relative;
  width: 118px;
  height: 118px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 50%;
  background: conic-gradient(var(--teal) 0 38%, var(--blue) 38% 66%, var(--orange) 66% 83%, #e7ebf0 83% 100%);
}

.donut::before {
  content: "";
  position: absolute;
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: #fff;
}

.donut-center {
  position: relative;
  z-index: 1;
  text-align: center;
}

.donut-center strong {
  display: block;
  font-size: 22px;
}

.donut-center span {
  color: var(--ink-3);
  font-size: 9px;
}

.donut-legend {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 12px;
}

.donut-row {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-2);
  font-size: 11px;
}

.donut-row strong {
  margin-left: auto;
  color: var(--ink);
  font-size: 11px;
}

.activity-list {
  padding: 6px 21px 16px;
}

.activity-item {
  position: relative;
  display: flex;
  gap: 12px;
  padding: 15px 0;
}

.activity-item:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 16px;
  top: 47px;
  bottom: -1px;
  width: 1px;
  background: var(--line);
}

.activity-icon {
  width: 33px;
  height: 33px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 10px;
  background: var(--teal-soft);
  color: var(--teal-dark);
}

.activity-icon.orange {
  background: var(--orange-soft);
  color: #d36a3d;
}

.activity-icon.blue {
  background: var(--blue-soft);
  color: #4d72d9;
}

.activity-copy {
  min-width: 0;
  padding-top: 1px;
}

.activity-copy p {
  margin: 0;
  color: var(--ink-2);
  font-size: 11px;
  line-height: 1.55;
}

.activity-copy p strong {
  color: var(--ink);
}

.activity-copy time {
  display: block;
  margin-top: 5px;
  color: #99a5b3;
  font-size: 9px;
}

/* Toolbars and tables */
.toolbar {
  min-height: 67px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
}

.toolbar-left,
.toolbar-right,
.filter-group {
  display: flex;
  align-items: center;
  gap: 9px;
}

.search-box {
  width: 230px;
  position: relative;
}

.search-box .input {
  min-height: 38px;
  padding-left: 38px;
  font-size: 12px;
}

.search-box .icon {
  position: absolute;
  top: 50%;
  left: 12px;
  color: #96a2b0;
  transform: translateY(-50%);
}

.compact-select {
  min-height: 38px;
  padding: 0 31px 0 11px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: #fff;
  color: var(--ink-2);
  font-size: 12px;
  outline: none;
}

.segmented {
  display: inline-flex;
  gap: 3px;
  padding: 3px;
  border-radius: 10px;
  background: #eef2f5;
}

.segmented button {
  min-height: 31px;
  padding: 0 11px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink-3);
  font-size: 11px;
  font-weight: 650;
  cursor: pointer;
}

.segmented button.active {
  background: #fff;
  color: var(--ink);
  box-shadow: 0 2px 8px rgba(25, 44, 64, 0.07);
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  -webkit-overflow-scrolling: touch;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.data-table th {
  height: 46px;
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
  background: #fafbfc;
  color: var(--ink-3);
  font-size: 10px;
  font-weight: 700;
  text-align: left;
  white-space: nowrap;
  letter-spacing: 0.04em;
}

.data-table td {
  min-height: 64px;
  padding: 14px 16px;
  border-bottom: 1px solid #edf0f3;
  color: var(--ink-2);
  vertical-align: middle;
}

.data-table tbody tr {
  transition: background 120ms ease;
}

.data-table tbody tr:hover {
  background: #fbfcfd;
}

.data-table tbody tr:last-child td {
  border-bottom: 0;
}

.table-title {
  min-width: 190px;
}

.table-title strong {
  display: block;
  max-width: 310px;
  overflow: hidden;
  color: var(--ink);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.table-title span {
  display: block;
  margin-top: 5px;
  color: var(--ink-3);
  font-size: 10px;
}

.table-user {
  display: flex;
  align-items: center;
  gap: 9px;
}

.table-user .avatar {
  width: 31px;
  height: 31px;
  border-radius: 9px;
  font-size: 10px;
}

.table-user strong {
  display: block;
  color: var(--ink);
  font-size: 11px;
}

.table-user span {
  display: block;
  margin-top: 3px;
  color: var(--ink-3);
  font-size: 9px;
}

.table-actions {
  display: flex;
  align-items: center;
  gap: 7px;
}

.text-button {
  padding: 4px 2px;
  border: 0;
  background: transparent;
  color: var(--blue);
  font-size: 11px;
  font-weight: 650;
  cursor: pointer;
}

.text-button:hover {
  text-decoration: underline;
}

.text-button.danger {
  color: var(--red);
}

.table-footer {
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 18px;
  border-top: 1px solid var(--line);
  color: var(--ink-3);
  font-size: 11px;
}

.pagination {
  display: flex;
  gap: 6px;
}

.pagination button {
  width: 30px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink-2);
  font-size: 11px;
  cursor: pointer;
}

.pagination button.active {
  border-color: var(--teal);
  background: var(--teal);
  color: #fff;
}

/* Publish */
.publish-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  align-items: start;
  gap: 20px;
}

.form-section {
  padding: 24px;
  border-bottom: 1px solid var(--line);
}

.form-section:last-child {
  border-bottom: 0;
}

.form-section-heading {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 21px;
}

.form-index {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 9px;
  background: var(--teal-soft);
  color: var(--teal-dark);
  font-size: 11px;
  font-weight: 750;
}

.form-section-heading h2 {
  margin: 0;
  font-size: 15px;
}

.form-section-heading p {
  margin: 5px 0 0;
  color: var(--ink-3);
  font-size: 11px;
}

.choice-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.choice-card {
  position: relative;
  min-height: 82px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 6px;
  padding: 13px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
  transition: 150ms ease;
}

.choice-card:hover {
  border-color: #b8c4ce;
}

.choice-card.selected {
  border-color: var(--teal);
  background: var(--teal-soft);
  box-shadow: 0 0 0 2px rgba(37, 185, 154, 0.08);
}

.choice-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.choice-card strong {
  color: var(--ink);
  font-size: 12px;
}

.choice-card span {
  color: var(--ink-3);
  font-size: 10px;
}

.region-selector {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 13px;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  background: #fff;
}

.region-option {
  min-height: 31px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f8fafb;
  color: var(--ink-2);
  font-size: 11px;
  cursor: pointer;
}

.region-option.selected {
  border-color: #bfe8df;
  background: var(--teal-soft);
  color: var(--teal-dark);
  font-weight: 650;
}

.region-picker {
  padding: 13px;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  background: #fff;
}

.region-picker-toolbar {
  display: flex;
  align-items: end;
  gap: 12px;
}

.region-nationwide {
  min-height: 39px;
  padding-inline: 18px;
  flex: 0 0 auto;
}

.region-province-control {
  display: grid;
  grid-template-columns: auto minmax(180px, 260px);
  align-items: center;
  gap: 9px;
  margin-left: auto;
  color: var(--ink-3);
  font-size: 10px;
}

.region-province-control .select {
  min-height: 39px;
}

.region-city-panel,
.region-nationwide-note {
  margin-top: 13px;
  padding-top: 13px;
  border-top: 1px solid var(--line);
}

.region-nationwide-note {
  color: var(--ink-3);
  font-size: 11px;
  line-height: 1.7;
}

.region-city-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.region-city-heading strong {
  color: var(--ink);
  font-size: 12px;
}

.region-city-heading span {
  color: var(--ink-3);
  font-size: 10px;
}

.region-picker .region-selector {
  padding: 0;
  border: 0;
  border-radius: 0;
}

.selected-region-summary {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  margin-top: 13px;
  padding-top: 13px;
  border-top: 1px solid var(--line);
  color: var(--ink-3);
  font-size: 10px;
}

.selected-region-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.selected-region-chip {
  min-height: 27px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0 9px;
  border: 1px solid #bfe8df;
  border-radius: 999px;
  background: var(--teal-soft);
  color: var(--teal-dark);
  font: inherit;
}

button.selected-region-chip {
  cursor: pointer;
}

@media (max-width: 600px) {
  .region-picker-toolbar,
  .region-city-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .region-province-control {
    width: 100%;
    grid-template-columns: 1fr;
    margin-left: 0;
  }

  .selected-region-summary {
    grid-template-columns: 1fr;
  }
}

.steps-editor {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.step-editor {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  align-items: start;
  gap: 12px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fafbfc;
}

.step-drag {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: #fff;
  color: var(--ink-3);
  font-size: 11px;
  font-weight: 750;
  box-shadow: 0 2px 8px rgba(19, 38, 58, 0.06);
}

.step-fields {
  display: grid;
  grid-template-columns: 0.55fr 1fr;
  gap: 10px;
}

.step-fields .input,
.step-fields .textarea {
  min-height: 40px;
  font-size: 11px;
}

.step-fields .textarea {
  height: 40px;
  padding: 10px 12px;
}

.remove-step {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #9aa5b2;
  cursor: pointer;
}

.remove-step:hover {
  background: var(--red-soft);
  color: var(--red);
}

.add-step-btn {
  min-height: 50px;
  border: 1px dashed #bfc9d3;
  border-radius: 12px;
  background: #fbfcfd;
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
}

.add-step-btn:hover {
  border-color: var(--teal);
  background: var(--teal-soft);
  color: var(--teal-dark);
}

.publish-aside {
  position: sticky;
  top: calc(var(--topbar) + 20px);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.summary-list {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  color: var(--ink-3);
  font-size: 11px;
}

.summary-row strong {
  color: var(--ink);
  text-align: right;
}

.summary-total {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-top: 5px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  font-size: 12px;
}

.summary-total strong {
  color: var(--orange);
  font-size: 22px;
}

.compliance-note {
  display: flex;
  gap: 10px;
  padding: 14px;
  border: 1px solid #f7dfaf;
  border-radius: 12px;
  background: var(--amber-soft);
  color: #85601e;
  font-size: 10px;
  line-height: 1.6;
}

/* Marketplace */
.market-hero {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 30px;
  margin-bottom: 20px;
  padding: 26px 29px;
  overflow: hidden;
  border: 1px solid #d8e5e6;
  border-radius: 20px;
  background:
    linear-gradient(110deg, rgba(255, 255, 255, 0.96), rgba(236, 249, 246, 0.95)),
    #fff;
}

.market-hero::after {
  content: "";
  position: absolute;
  right: 6%;
  width: 160px;
  height: 160px;
  border: 26px solid rgba(37, 185, 154, 0.07);
  border-radius: 50%;
}

.market-hero-copy {
  position: relative;
  z-index: 1;
}

.market-hero h2 {
  margin: 0;
  font-size: 22px;
  letter-spacing: -0.02em;
}

.market-hero p {
  margin: 8px 0 0;
  color: var(--ink-3);
  font-size: 12px;
  line-height: 1.65;
}

.market-location {
  position: relative;
  z-index: 1;
  min-width: 190px;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 13px 15px;
  border: 1px solid rgba(37, 185, 154, 0.18);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.85);
  box-shadow: var(--shadow-sm);
}

.market-location-icon {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--teal-soft);
  color: var(--teal-dark);
}

.market-location span {
  display: block;
  color: var(--ink-3);
  font-size: 9px;
}

.market-location strong {
  display: block;
  margin-top: 4px;
  font-size: 12px;
}

.category-strip {
  display: flex;
  gap: 9px;
  margin-bottom: 18px;
  overflow-x: auto;
  scrollbar-width: none;
}

.category-strip::-webkit-scrollbar {
  display: none;
}

.category-chip {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--ink-2);
  font-size: 11px;
  font-weight: 630;
  white-space: nowrap;
  cursor: pointer;
}

.category-chip.active {
  border-color: var(--navy);
  background: var(--navy);
  color: #fff;
}

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

.task-card {
  position: relative;
  min-width: 0;
  padding: 19px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: #fff;
  box-shadow: var(--shadow-sm);
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    border-color 180ms ease;
}

.task-card:hover {
  border-color: #cbd4dc;
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.task-card.ineligible {
  background: #fafbfc;
}

.task-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 15px;
}

.task-category {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--ink-2);
  font-size: 10px;
  font-weight: 700;
}

.category-icon {
  width: 29px;
  height: 29px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: var(--teal-soft);
  color: var(--teal-dark);
}

.task-code {
  color: #9aa5b2;
  font-size: 9px;
}

.task-card h3 {
  min-height: 44px;
  margin: 0;
  display: -webkit-box;
  overflow: hidden;
  color: var(--ink);
  font-size: 15px;
  font-weight: 720;
  line-height: 1.5;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.task-card-desc {
  height: 38px;
  margin: 8px 0 15px;
  display: -webkit-box;
  overflow: hidden;
  color: var(--ink-3);
  font-size: 10px;
  line-height: 1.75;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.task-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  min-height: 58px;
  padding: 12px 0;
  border-top: 1px solid #edf0f3;
  border-bottom: 1px solid #edf0f3;
}

.task-card-footer {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 13px;
  padding-top: 15px;
}

.reward-label {
  display: block;
  margin-bottom: 3px;
  color: var(--ink-3);
  font-size: 9px;
}

.reward {
  color: var(--orange);
  font-size: 22px;
  font-weight: 760;
  letter-spacing: -0.03em;
}

.reward small {
  margin-left: 2px;
  font-size: 10px;
  font-weight: 650;
}

.eligibility-tip {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 8px;
  color: var(--red);
  font-size: 9px;
}

/* Assignment workspace */
.assignment-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  align-items: start;
  gap: 20px;
}

.assignment-header-card {
  margin-bottom: 20px;
  padding: 23px 25px;
}

.assignment-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 16px;
  border: 0;
  background: transparent;
  color: var(--ink-3);
  font-size: 11px;
  cursor: pointer;
}

.assignment-title-row {
  display: flex;
  justify-content: space-between;
  gap: 20px;
}

.assignment-title h1 {
  margin: 0;
  font-size: 21px;
}

.assignment-title p {
  margin: 8px 0 0;
  color: var(--ink-3);
  font-size: 11px;
}

.assignment-progress {
  min-width: 175px;
  text-align: right;
}

.assignment-progress strong {
  display: block;
  margin-bottom: 8px;
  color: var(--teal-dark);
  font-size: 13px;
}

.progress-track {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: #e9edf1;
}

.progress-track span {
  height: 100%;
  display: block;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--teal), #62d8c0);
}

.timeline-card {
  padding: 25px;
}

.step-timeline {
  position: relative;
}

.timeline-step {
  position: relative;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 14px;
  padding-bottom: 26px;
}

.timeline-step:last-child {
  padding-bottom: 0;
}

.timeline-step:not(:last-child)::before {
  content: "";
  position: absolute;
  top: 41px;
  bottom: 0;
  left: 19px;
  width: 2px;
  background: #e4e9ed;
}

.timeline-step.done:not(:last-child)::before {
  background: #bfeadf;
}

.timeline-marker {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  z-index: 1;
  border: 2px solid #e0e6eb;
  border-radius: 13px;
  background: #f8fafb;
  color: #9ba6b3;
  font-size: 11px;
  font-weight: 750;
}

.timeline-step.done .timeline-marker {
  border-color: #c1eadf;
  background: var(--teal-soft);
  color: var(--teal-dark);
}

.timeline-step.current .timeline-marker {
  border-color: var(--teal);
  background: var(--teal);
  color: #fff;
  box-shadow: 0 0 0 5px rgba(37, 185, 154, 0.1);
}

.timeline-content {
  min-width: 0;
  padding-top: 2px;
}

.timeline-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.timeline-title strong {
  font-size: 13px;
}

.timeline-content > p {
  margin: 7px 0 0;
  color: var(--ink-3);
  font-size: 11px;
  line-height: 1.65;
}

.submission-box {
  margin-top: 16px;
  padding: 16px;
  border: 1px solid #dce4e9;
  border-radius: 13px;
  background: #fafcfc;
}

.submission-preview {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}

.evidence-thumb {
  width: 82px;
  height: 70px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #edf2f4;
  color: #8290a0;
  font-size: 9px;
  text-align: center;
}

.evidence-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.upload-zone {
  min-height: 112px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 16px;
  border: 1px dashed #bac6d0;
  border-radius: 12px;
  background: #fff;
  color: var(--ink-3);
  text-align: center;
  cursor: pointer;
  transition: 150ms ease;
}

.upload-zone:hover {
  border-color: var(--teal);
  background: var(--teal-soft);
  color: var(--teal-dark);
}

.upload-zone strong {
  color: var(--ink-2);
  font-size: 11px;
}

.upload-zone span {
  font-size: 9px;
}

.upload-zone input {
  display: none;
}

.uploaded-file {
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 9px;
  padding: 8px 11px;
  border: 1px solid #ccebe4;
  border-radius: 10px;
  background: var(--teal-soft);
  color: var(--teal-dark);
  font-size: 10px;
}

.uploaded-file span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.assignment-aside {
  position: sticky;
  top: calc(var(--topbar) + 20px);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.detail-list {
  display: flex;
  flex-direction: column;
}

.detail-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid #edf0f3;
  color: var(--ink-3);
  font-size: 11px;
}

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

.detail-row strong {
  max-width: 60%;
  color: var(--ink);
  font-weight: 650;
  text-align: right;
}

.notice-box {
  display: flex;
  gap: 10px;
  padding: 14px;
  border-radius: 12px;
  background: var(--blue-soft);
  color: #4964a7;
  font-size: 10px;
  line-height: 1.6;
}

/* My tasks and wallet */
.my-task-list {
  display: flex;
  flex-direction: column;
  gap: 13px;
}

.my-task-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 180px 128px;
  align-items: center;
  gap: 22px;
  padding: 19px 20px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.my-task-main {
  min-width: 0;
}

.my-task-main-top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.my-task-main h3 {
  margin: 0;
  overflow: hidden;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.my-task-main p {
  margin: 7px 0 0;
  color: var(--ink-3);
  font-size: 10px;
}

.my-task-progress span {
  display: block;
  margin-bottom: 8px;
  color: var(--ink-3);
  font-size: 10px;
}

.my-task-progress .progress-track {
  height: 6px;
}

.my-task-action {
  text-align: right;
}

.wallet-summary {
  display: grid;
  grid-template-columns: 1.2fr repeat(2, 0.7fr);
  gap: 16px;
  margin-bottom: 20px;
}

.wallet-main {
  position: relative;
  min-height: 150px;
  padding: 24px;
  overflow: hidden;
  border-radius: 18px;
  background: linear-gradient(130deg, #112033, #1c3c48);
  color: #fff;
  box-shadow: 0 14px 32px rgba(16, 28, 44, 0.15);
}

.wallet-main::after {
  content: "¥";
  position: absolute;
  top: -28px;
  right: 22px;
  color: rgba(255, 255, 255, 0.045);
  font-size: 155px;
  font-weight: 800;
}

.wallet-main span {
  color: #93a7b7;
  font-size: 11px;
}

.wallet-main strong {
  display: block;
  margin-top: 11px;
  font-size: 34px;
  letter-spacing: -0.04em;
}

.wallet-main p {
  margin: 12px 0 0;
  color: #8ca2b3;
  font-size: 10px;
}

.wallet-mini {
  min-height: 150px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 22px;
}

.wallet-mini .stat-icon {
  margin-bottom: 17px;
}

.wallet-mini strong {
  font-size: 23px;
}

.wallet-mini span {
  margin-top: 4px;
  color: var(--ink-3);
  font-size: 10px;
}

/* Review */
.review-layout {
  min-height: 590px;
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  overflow: hidden;
}

.review-queue {
  border-right: 1px solid var(--line);
  background: #fafbfc;
}

.review-queue-header {
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.review-queue-header h2 {
  margin: 0 0 12px;
  font-size: 15px;
}

.queue-list {
  max-height: 620px;
  overflow-y: auto;
}

.queue-item {
  width: 100%;
  display: block;
  padding: 17px 18px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.queue-item:hover {
  background: #fff;
}

.queue-item.active {
  box-shadow: inset 3px 0 var(--teal);
  background: #fff;
}

.queue-item-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.queue-item h3 {
  margin: 9px 0 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.queue-item p {
  margin: 7px 0 0;
  color: var(--ink-3);
  font-size: 9px;
}

.review-detail {
  min-width: 0;
}

.review-detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 20px 23px;
  border-bottom: 1px solid var(--line);
}

.review-detail-header h2 {
  margin: 0;
  font-size: 17px;
}

.review-detail-header p {
  margin: 6px 0 0;
  color: var(--ink-3);
  font-size: 10px;
}

.review-detail-body {
  padding: 23px;
}

.review-user-strip {
  display: grid;
  grid-template-columns: auto repeat(3, 1fr);
  align-items: center;
  gap: 18px;
  margin-bottom: 20px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fafbfc;
}

.review-user-strip .table-user {
  padding-right: 18px;
  border-right: 1px solid var(--line);
}

.review-user-stat span {
  display: block;
  color: var(--ink-3);
  font-size: 9px;
}

.review-user-stat strong {
  display: block;
  margin-top: 5px;
  font-size: 11px;
}

.review-requirement {
  margin-bottom: 18px;
  padding: 15px;
  border-left: 3px solid var(--blue);
  border-radius: 4px 11px 11px 4px;
  background: var(--blue-soft);
}

.review-requirement strong {
  display: block;
  margin-bottom: 5px;
  color: #3e5eaf;
  font-size: 10px;
}

.review-requirement p {
  margin: 0;
  color: #586eaa;
  font-size: 10px;
  line-height: 1.6;
}

.review-evidence h3 {
  margin: 0 0 11px;
  font-size: 12px;
}

.evidence-gallery {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 11px;
}

.evidence-card {
  min-height: 132px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 11px;
  background:
    linear-gradient(135deg, #e7eef0, #f7f9fa);
  color: #8190a0;
  font-size: 10px;
  text-align: center;
}

.evidence-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.review-note {
  margin-top: 18px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fafbfc;
}

.review-note strong {
  display: block;
  margin-bottom: 7px;
  font-size: 10px;
}

.review-note p {
  margin: 0;
  color: var(--ink-2);
  font-size: 11px;
  line-height: 1.65;
}

.review-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 21px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

/* Profile and settings */
.profile-layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  align-items: start;
  gap: 20px;
}

.profile-card {
  padding: 27px 22px;
  text-align: center;
}

.profile-avatar {
  width: 76px;
  height: 76px;
  display: grid;
  place-items: center;
  margin: 0 auto 15px;
  border: 5px solid var(--teal-soft);
  border-radius: 24px;
  background: linear-gradient(145deg, #48cfb2, #15977e);
  color: #fff;
  font-size: 23px;
  font-weight: 760;
}

.profile-card h2 {
  margin: 0;
  font-size: 18px;
}

.profile-card > p {
  margin: 7px 0 0;
  color: var(--ink-3);
  font-size: 10px;
}

.profile-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.profile-meta div {
  padding: 10px;
  border-radius: 10px;
  background: #f7f9fa;
}

.profile-meta strong {
  display: block;
  font-size: 14px;
}

.profile-meta span {
  display: block;
  margin-top: 4px;
  color: var(--ink-3);
  font-size: 9px;
}

.settings-form {
  padding: 24px;
}

.permission-grid {
  display: grid;
  grid-template-columns: 170px repeat(2, minmax(120px, 1fr));
  overflow-x: auto;
}

.permission-cell {
  min-height: 51px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  color: var(--ink-2);
  font-size: 10px;
  text-align: center;
}

.permission-cell.header {
  min-height: 44px;
  background: #fafbfc;
  color: var(--ink-3);
  font-weight: 700;
}

.permission-cell.feature {
  justify-content: flex-start;
  padding-left: 17px;
  color: var(--ink);
  font-weight: 650;
  text-align: left;
}

.permission-check {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: var(--teal-soft);
  color: var(--teal-dark);
}

.permission-dash {
  color: #c2cad3;
}

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

.rule-card {
  padding: 21px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.rule-icon {
  width: 41px;
  height: 41px;
  display: grid;
  place-items: center;
  margin-bottom: 15px;
  border-radius: 12px;
  background: var(--teal-soft);
  color: var(--teal-dark);
}

.rule-card:nth-child(2) .rule-icon {
  background: var(--blue-soft);
  color: #4d72d9;
}

.rule-card:nth-child(3) .rule-icon {
  background: var(--orange-soft);
  color: #d36a3d;
}

.rule-card h3 {
  margin: 0;
  font-size: 14px;
}

.rule-card p {
  margin: 8px 0 0;
  color: var(--ink-3);
  font-size: 10px;
  line-height: 1.7;
}

.rule-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.rule-item {
  display: flex;
  gap: 12px;
  padding: 15px 0;
  border-bottom: 1px solid var(--line);
}

.rule-item:last-child {
  border-bottom: 0;
}

.rule-number {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 9px;
  background: #eef2f4;
  color: var(--ink-2);
  font-size: 10px;
  font-weight: 750;
}

.rule-item strong {
  display: block;
  margin-bottom: 5px;
  font-size: 11px;
}

.rule-item p {
  margin: 0;
  color: var(--ink-3);
  font-size: 10px;
  line-height: 1.6;
}

/* Empty states */
.empty-state {
  min-height: 310px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px;
  color: var(--ink-3);
  text-align: center;
}

.empty-illustration {
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  margin-bottom: 17px;
  border-radius: 23px;
  background: #edf2f4;
  color: #8e9cab;
}

.empty-state h3 {
  margin: 0;
  color: var(--ink);
  font-size: 15px;
}

.empty-state p {
  max-width: 360px;
  margin: 8px 0 18px;
  font-size: 11px;
  line-height: 1.65;
}

/* Modal and toast */
.modal-backdrop {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(8, 17, 28, 0.56);
  backdrop-filter: blur(5px);
  animation: fade-in 160ms ease;
}

.modal {
  width: min(560px, 100%);
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 28px 85px rgba(7, 18, 31, 0.3);
  animation: modal-in 180ms ease;
}

.modal-lg {
  width: min(760px, 100%);
}

.modal-header {
  min-height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 0 23px;
  border-bottom: 1px solid var(--line);
}

.modal-header h2 {
  margin: 0;
  font-size: 17px;
}

.modal-body {
  padding: 23px;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 23px;
  border-top: 1px solid var(--line);
  background: #fafbfc;
}

.modal-hero {
  margin: -23px -23px 20px;
  padding: 22px 23px;
  background: linear-gradient(120deg, #f2faf8, #f4f7ff);
}

.modal-hero h3 {
  margin: 10px 0 0;
  font-size: 20px;
}

.modal-hero p {
  margin: 8px 0 0;
  color: var(--ink-3);
  font-size: 11px;
  line-height: 1.65;
}

.confirm-icon {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  margin: 3px auto 16px;
  border-radius: 16px;
  background: var(--teal-soft);
  color: var(--teal-dark);
}

.confirm-copy {
  text-align: center;
}

.confirm-copy h3 {
  margin: 0;
  font-size: 18px;
}

.confirm-copy p {
  margin: 9px auto 0;
  max-width: 420px;
  color: var(--ink-3);
  font-size: 11px;
  line-height: 1.7;
}

.confirm-detail {
  margin-top: 20px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fafbfc;
}

.toast-root {
  position: fixed;
  z-index: 150;
  top: 21px;
  right: 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  min-width: 280px;
  max-width: 380px;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fff;
  box-shadow: var(--shadow-lg);
  color: var(--ink-2);
  font-size: 11px;
  animation: toast-in 250ms ease;
}

.toast-icon {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 9px;
  background: var(--teal-soft);
  color: var(--teal-dark);
}

.toast.error .toast-icon {
  background: var(--red-soft);
  color: var(--red);
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes modal-in {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes toast-in {
  from { opacity: 0; transform: translateX(18px); }
  to { opacity: 1; transform: translateX(0); }
}

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

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

  .review-layout {
    grid-template-columns: 300px minmax(0, 1fr);
  }

  .review-user-strip {
    grid-template-columns: auto repeat(2, 1fr);
  }

  .review-user-stat:last-child {
    display: none;
  }
}

@media (max-width: 980px) {
  :root {
    --sidebar: 232px;
  }

  .auth-main {
    grid-template-columns: 1fr 390px;
    gap: 45px;
  }

  .auth-features {
    grid-template-columns: 1fr;
  }

  .auth-feature {
    min-height: 68px;
    display: grid;
    grid-template-columns: 35px 1fr;
    column-gap: 12px;
    align-items: center;
    padding: 12px;
  }

  .auth-feature-icon {
    grid-row: span 2;
    margin: 0;
  }

  .auth-feature strong,
  .auth-feature span {
    margin: 0;
  }

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

  .dashboard-grid,
  .publish-layout,
  .assignment-layout {
    grid-template-columns: 1fr;
  }

  .publish-aside,
  .assignment-aside {
    position: static;
  }

  .dashboard-stack {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .review-queue {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .queue-list {
    max-height: 260px;
  }

  .profile-layout {
    grid-template-columns: 1fr;
  }

  .profile-card {
    display: grid;
    grid-template-columns: auto 1fr;
    column-gap: 17px;
    text-align: left;
  }

  .profile-avatar {
    grid-row: span 2;
    margin: 0;
  }

  .profile-meta {
    grid-column: span 2;
  }

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

@media (max-width: 760px) {
  :root {
    --topbar: 64px;
    --mobile-nav-clearance: calc(88px + env(safe-area-inset-bottom));
  }

  .auth-page,
  .app-shell,
  .workspace {
    min-height: 100dvh;
  }

  .auth-header,
  .auth-main,
  .auth-footer {
    width: min(100% - 32px, 520px);
  }

  .auth-header {
    height: calc(70px + env(safe-area-inset-top));
    padding-top: env(safe-area-inset-top);
  }

  .auth-header-note,
  .auth-showcase,
  .auth-footer-links {
    display: none;
  }

  .auth-main {
    grid-template-columns: 1fr;
    padding: 22px 0 38px;
  }

  .auth-card {
    padding: 24px 20px;
    border-radius: 20px;
  }

  .auth-footer {
    justify-content: center;
    min-height: calc(62px + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom);
    text-align: center;
  }

  .sidebar {
    width: min(280px, 82vw);
    padding-bottom: env(safe-area-inset-bottom);
    transform: translateX(-100%);
    transition: transform 220ms ease;
  }

  .sidebar-brand {
    height: calc(var(--topbar) + env(safe-area-inset-top));
    padding-top: env(safe-area-inset-top);
    padding-left: max(22px, env(safe-area-inset-left));
  }

  .app-shell.menu-open .sidebar {
    transform: translateX(0);
  }

  .sidebar-overlay {
    position: fixed;
    z-index: 25;
    inset: 0;
    display: block;
    background: rgba(8, 17, 28, 0.5);
    opacity: 0;
    pointer-events: none;
    transition: opacity 220ms ease;
  }

  .app-shell.menu-open .sidebar-overlay {
    opacity: 1;
    pointer-events: auto;
  }

  .workspace {
    width: 100%;
    margin-left: 0;
  }

  .topbar {
    height: calc(var(--topbar) + env(safe-area-inset-top));
    gap: 8px;
    padding-top: env(safe-area-inset-top);
    padding-right: max(16px, env(safe-area-inset-right));
    padding-left: max(16px, env(safe-area-inset-left));
  }

  .mobile-menu-button {
    display: inline-flex;
  }

  .topbar-search,
  .user-menu-copy,
  .user-menu > .icon {
    display: none;
  }

  .topbar-actions {
    flex: 0 0 auto;
    gap: 6px;
  }

  .user-menu {
    width: 44px;
    min-height: 44px;
    justify-content: center;
    padding: 0;
  }

  .icon-button {
    width: 44px;
    height: 44px;
  }

  .page {
    padding-top: 22px;
    padding-right: max(16px, env(safe-area-inset-right));
    padding-bottom: calc(var(--mobile-nav-clearance) + 4px);
    padding-left: max(16px, env(safe-area-inset-left));
  }

  .mobile-bottom-nav {
    position: fixed;
    z-index: 22;
    right: max(10px, env(safe-area-inset-right));
    bottom: calc(10px + env(safe-area-inset-bottom));
    left: max(10px, env(safe-area-inset-left));
    min-height: 66px;
    display: grid;
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, 1fr);
    padding: 6px;
    border: 1px solid rgba(225, 231, 237, 0.9);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 14px 40px rgba(13, 30, 50, 0.17);
    backdrop-filter: blur(15px);
  }

  .mobile-nav-item {
    min-width: 0;
    min-height: 52px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    border: 0;
    border-radius: 13px;
    background: transparent;
    color: var(--ink-3);
    font-size: 9px;
    cursor: pointer;
  }

  .mobile-nav-item.active {
    background: var(--teal-soft);
    color: var(--teal-dark);
    font-weight: 700;
  }

  .mobile-nav-item .icon {
    width: 18px;
    height: 18px;
  }

  .mobile-nav-item span {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .page-header {
    align-items: flex-start;
    flex-direction: column;
    margin-bottom: 19px;
  }

  .page-actions {
    width: 100%;
    flex-wrap: wrap;
  }

  .page-actions .btn {
    flex: 1 1 140px;
  }

  .welcome-banner {
    align-items: flex-start;
    flex-direction: column;
    padding: 24px;
  }

  .welcome-actions {
    width: 100%;
    flex-wrap: wrap;
  }

  .welcome-actions .btn {
    flex: 1 1 130px;
  }

  .stats-grid {
    gap: 12px;
  }

  .stat-card {
    padding: 16px;
  }

  .stat-card strong.value {
    font-size: 24px;
  }

  .dashboard-stack {
    grid-template-columns: 1fr;
  }

  .task-grid,
  .compliance-grid {
    grid-template-columns: 1fr;
  }

  .market-hero {
    grid-template-columns: 1fr;
    padding: 22px;
  }

  .market-location {
    width: 100%;
  }

  .toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .toolbar-left,
  .toolbar-right {
    width: 100%;
  }

  .search-box {
    width: 100%;
  }

  .filter-group {
    width: 100%;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    -webkit-overflow-scrolling: touch;
  }

  .category-strip,
  .permission-grid {
    overscroll-behavior-inline: contain;
    -webkit-overflow-scrolling: touch;
  }

  .my-task-card {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .my-task-action {
    text-align: left;
  }

  .my-task-action .btn {
    width: 100%;
  }

  .wallet-summary {
    grid-template-columns: 1fr 1fr;
  }

  .wallet-main {
    grid-column: span 2;
  }

  .assignment-title-row {
    flex-direction: column;
  }

  .assignment-progress {
    text-align: left;
  }

  .review-user-strip {
    grid-template-columns: 1fr 1fr;
  }

  .review-user-strip .table-user {
    grid-column: span 2;
    padding: 0 0 12px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .evidence-gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .submission-preview {
    flex-wrap: wrap;
  }

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

  .field-span-2 {
    grid-column: auto;
  }

  .input,
  .select,
  .textarea,
  .compact-select,
  .search-box .input,
  .step-fields .input,
  .step-fields .textarea,
  .step-review-select {
    font-size: 16px;
  }

  .btn,
  .btn-sm,
  .segmented button,
  .region-option,
  .category-chip,
  button.selected-region-chip,
  .pagination button,
  .text-button {
    min-height: 44px;
  }

  .pagination button {
    width: 44px;
  }

  .text-button {
    padding: 10px 6px;
  }

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

  .step-editor {
    grid-template-columns: 34px minmax(0, 1fr) auto;
    gap: 8px;
    padding: 11px;
  }

  .step-drag {
    width: 34px;
    height: 34px;
  }

  .remove-step,
  .asset-remove {
    width: 44px;
    height: 44px;
  }

  .step-fields {
    grid-template-columns: 1fr;
  }

  .modal-backdrop {
    align-items: flex-end;
    padding: 0;
    padding-top: env(safe-area-inset-top);
    overscroll-behavior: contain;
  }

  .modal {
    width: 100%;
    max-height: 91vh;
    max-height: calc(100dvh - env(safe-area-inset-top));
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: 22px 22px 0 0;
  }

  .modal-header,
  .modal-footer {
    flex: 0 0 auto;
  }

  .modal-body {
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }

  .modal-footer {
    padding-bottom: calc(16px + env(safe-area-inset-bottom));
  }

  .timeline-title,
  .review-detail-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .detail-row strong {
    overflow-wrap: anywhere;
  }
}

@media (max-width: 470px) {
  .stats-grid,
  .wallet-summary,
  .choice-grid {
    grid-template-columns: 1fr;
  }

  .wallet-main {
    grid-column: auto;
  }

  .auth-code-row {
    grid-template-columns: minmax(0, 1fr) 92px;
  }

  .page-title h1 {
    font-size: 24px;
  }

  .breadcrumb small {
    display: none;
  }

  .breadcrumb strong {
    font-size: 14px;
  }

  .card-header,
  .card-body,
  .form-section,
  .timeline-card,
  .review-detail-body {
    padding-right: 16px;
    padding-left: 16px;
  }

  .card-header {
    min-height: auto;
    align-items: stretch;
    flex-direction: column;
    padding-top: 16px;
    padding-bottom: 16px;
  }

  .table-footer {
    align-items: stretch;
    flex-direction: column;
    padding: 14px 16px;
  }

  .pagination {
    flex-wrap: wrap;
  }

  .modal-header {
    min-height: 62px;
    padding: 0 16px;
  }

  .modal-body {
    padding: 18px 16px;
  }

  .modal-footer {
    align-items: stretch;
    flex-direction: column;
    padding-right: 16px;
    padding-left: 16px;
  }

  .modal-footer .btn {
    width: 100%;
  }

  .modal-hero {
    margin: -18px -16px 18px;
    padding: 18px 16px;
  }

  .donut-wrap {
    align-items: flex-start;
    flex-direction: column;
  }

  .donut {
    margin: 0 auto;
  }

  .review-actions {
    flex-direction: column-reverse;
  }

  .review-actions .btn {
    width: 100%;
  }

  .toast-root {
    top: calc(12px + env(safe-area-inset-top));
    right: max(12px, env(safe-area-inset-right));
    left: max(12px, env(safe-area-inset-left));
  }

  .toast {
    width: 100%;
    min-width: 0;
  }
}

/* Shared media assets, review modes, support and release feedback */
.asset-preview-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.asset-preview-card {
  position: relative;
  min-width: 0;
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) 32px;
  align-items: center;
  gap: 11px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
  box-shadow: var(--shadow-sm);
}

.asset-preview-card img {
  width: 72px;
  height: 62px;
  display: block;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #edf2f4;
}

.asset-preview-placeholder {
  width: 72px;
  height: 62px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: linear-gradient(135deg, #edf3f4, #f8fafb);
  color: #8a99a9;
}

.asset-preview-copy {
  min-width: 0;
  color: var(--ink-2);
  font-size: 10px;
  line-height: 1.5;
}

.asset-preview-copy strong,
.asset-preview-copy span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.asset-preview-copy strong {
  margin-bottom: 3px;
  color: var(--ink);
  font-size: 11px;
}

.asset-preview-copy span {
  color: var(--ink-3);
}

.asset-remove {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--ink-3);
  cursor: pointer;
  transition: 150ms ease;
}

.asset-remove:hover {
  background: var(--red-soft);
  color: var(--red);
}

.asset-remove:focus-visible {
  outline: 2px solid rgba(233, 93, 100, 0.3);
  outline-offset: 2px;
}

.step-review-row {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: auto minmax(190px, 0.75fr) minmax(210px, 1fr);
  align-items: center;
  gap: 14px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
}

.step-review-row > label {
  color: var(--ink-2);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.step-review-select {
  min-width: 190px;
  min-height: 36px;
  padding: 0 34px 0 11px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background-color: #fff;
  color: var(--ink-2);
  font-size: 10px;
  cursor: pointer;
}

.step-review-select:focus {
  border-color: var(--teal);
  outline: 0;
  box-shadow: 0 0 0 3px rgba(37, 185, 154, 0.1);
}

.review-mode-hint {
  min-width: 0;
  color: var(--ink-3);
  font-size: 10px;
  line-height: 1.55;
}

.review-mode-hint strong {
  display: block;
  margin-bottom: 2px;
  color: var(--ink-2);
  font-size: 11px;
}

.task-reference-block {
  margin-top: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fafcfc;
}

.task-reference-block > :first-child {
  margin-top: 0;
}

.task-reference-block > :last-child {
  margin-bottom: 0;
}

.task-reference-block .submission-preview {
  flex-wrap: wrap;
}

.support-float {
  position: fixed;
  z-index: 60;
  right: 24px;
  bottom: 24px;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
}

.support-trigger {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 18px;
  background: linear-gradient(145deg, var(--teal), var(--teal-dark));
  box-shadow: 0 13px 32px rgba(22, 150, 125, 0.3);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.support-trigger .icon {
  width: 20px;
  height: 20px;
}

.support-trigger > span {
  display: block;
  margin-top: -4px;
  line-height: 1;
  white-space: nowrap;
}

.support-trigger:hover {
  transform: translateY(-2px);
  box-shadow: 0 17px 38px rgba(22, 150, 125, 0.34);
}

.support-trigger:focus-visible {
  outline: 3px solid rgba(37, 185, 154, 0.22);
  outline-offset: 3px;
}

.support-panel {
  position: absolute;
  right: 0;
  bottom: calc(100% + 10px);
  width: min(252px, calc(100vw - 32px));
  padding: 10px;
  border: 1px solid rgba(215, 222, 230, 0.92);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transform: translateY(9px) scale(0.98);
  transform-origin: right bottom;
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease, visibility 160ms ease;
  backdrop-filter: blur(16px);
}

.support-panel::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: -12px;
  width: 76px;
  height: 14px;
}

.support-panel.open,
.support-float.open .support-panel,
.support-float:focus-within .support-panel {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

@media (hover: hover) and (pointer: fine) {
  .support-float:hover .support-panel {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
    pointer-events: auto;
  }
}

.support-qr {
  position: relative;
  width: 230px;
  height: 230px;
  display: grid;
  place-items: center;
  margin: 0 auto;
  overflow: hidden;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  color: var(--ink-3);
  font-size: 10px;
  object-fit: contain;
  text-align: center;
}

.support-qr img,
.support-qr canvas,
.support-qr svg {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center;
}

.support-qr img {
  transform: scale(1.15);
  transform-origin: 50% 85%;
}

.support-qr.placeholder {
  display: flex;
  flex-direction: column;
  gap: 9px;
  justify-content: center;
  border-style: dashed;
  background: #f7faf9;
  line-height: 1.5;
}

.support-settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.support-settings-grid > .field-span-2,
.support-settings-grid > .support-settings-wide {
  grid-column: 1 / -1;
}

.release-warning {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  margin-top: 14px;
  padding: 13px 14px;
  border: 1px solid #f3d8a7;
  border-radius: 11px;
  background: var(--amber-soft);
  color: #8a6220;
  font-size: 10px;
  line-height: 1.65;
}

.release-warning > .icon,
.release-warning > svg {
  flex: 0 0 auto;
  margin-top: 1px;
  color: var(--amber);
}

.release-warning strong {
  color: #70501c;
}

.release-warning p {
  margin: 0;
}

@media (max-width: 760px) {
  .asset-preview-grid,
  .support-settings-grid {
    grid-template-columns: 1fr;
  }

  .support-settings-grid > .field-span-2,
  .support-settings-grid > .support-settings-wide {
    grid-column: auto;
  }

  .step-review-row {
    align-items: stretch;
    grid-template-columns: 1fr;
    gap: 9px;
  }

  .step-review-select {
    width: 100%;
    min-width: 0;
  }

  .task-reference-block {
    padding: 13px;
  }

  .support-float {
    right: max(16px, env(safe-area-inset-right));
    bottom: var(--mobile-nav-clearance);
  }

  .support-trigger {
    width: 50px;
    height: 50px;
    border-radius: 16px;
  }

  .support-panel {
    width: min(252px, calc(100vw - 32px));
    max-height: calc(100vh - 190px - env(safe-area-inset-bottom));
    max-height: calc(100dvh - 190px - env(safe-area-inset-bottom));
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }
}

@media (max-width: 470px) {
  .asset-preview-card {
    grid-template-columns: 64px minmax(0, 1fr) 44px;
    gap: 9px;
  }

  .asset-preview-card img {
    width: 64px;
    height: 58px;
  }

  .asset-preview-placeholder {
    width: 64px;
    height: 58px;
  }

  .support-panel {
    right: -2px;
    width: min(242px, calc(100vw - 32px));
    padding: 10px;
  }

  .support-qr {
    width: 220px;
    height: 220px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

.zoomable-image {
  cursor: zoom-in;
}

.zoomable-image:focus-visible {
  outline: 3px solid rgba(37, 185, 154, 0.55);
  outline-offset: -3px;
}

.image-preview-backdrop {
  position: fixed;
  z-index: 220;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px;
  background: rgba(8, 15, 27, 0.88);
  backdrop-filter: blur(8px);
  animation: image-preview-in 160ms ease;
}

.image-preview-dialog {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 100%;
  max-height: 100%;
}

.image-preview-dialog > img {
  display: block;
  max-width: min(1120px, calc(100vw - 56px));
  max-height: calc(100vh - 112px);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.38);
  object-fit: contain;
}

.image-preview-close {
  position: absolute;
  z-index: 1;
  top: -16px;
  right: -16px;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 50%;
  background: rgba(13, 21, 34, 0.88);
  color: #fff;
  cursor: pointer;
}

.image-preview-close:hover,
.image-preview-close:focus-visible {
  background: #fff;
  color: var(--ink);
  outline: none;
}

.image-preview-caption {
  max-width: min(760px, calc(100vw - 56px));
  margin-top: 13px;
  overflow: hidden;
  color: rgba(255, 255, 255, 0.9);
  font-size: 12px;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@keyframes image-preview-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@media (max-width: 600px) {
  .image-preview-backdrop {
    padding-top: max(16px, env(safe-area-inset-top));
    padding-right: max(16px, env(safe-area-inset-right));
    padding-bottom: max(16px, env(safe-area-inset-bottom));
    padding-left: max(16px, env(safe-area-inset-left));
  }

  .image-preview-dialog > img {
    max-width: calc(100vw - 32px);
    max-height: calc(100vh - 92px);
    max-height: calc(100dvh - 92px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    border-radius: 9px;
  }

  .image-preview-close {
    top: 8px;
    right: 8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .image-preview-backdrop {
    animation: none;
  }
}
