:root {
  color-scheme: light;
  --navy: #13213c;
  --ink: #172033;
  --muted: #667085;
  --line: #e1e6ee;
  --blue: #245eea;
  --blue-dark: #1746ba;
  --blue-soft: #edf3ff;
  --green: #177a4d;
  --green-soft: #e8f7ef;
  font-family: Inter, "Microsoft YaHei UI", "PingFang SC", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  background: #f2f5f8;
  color: var(--ink);
}

button,
input {
  font: inherit;
}

.worker-header {
  position: fixed;
  z-index: 40;
  top: 0;
  right: 0;
  left: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  min-height: 84px;
  padding: 14px max(18px, calc((100% - 520px) / 2));
  background: var(--navy);
  color: white;
}

.worker-header-main {
  min-width: 0;
}

.worker-header p {
  margin: 0 0 2px;
  color: #96b0f6;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.worker-header h1 {
  margin: 0;
  font-size: 24px;
}

.worker-greeting {
  display: block;
  margin-top: 5px;
  color: #dce6ff;
  font-size: 12px;
  line-height: 1.4;
}

.worker-header-actions {
  display: grid;
  flex: 0 0 auto;
  justify-items: end;
  gap: 7px;
}

.environment-badge {
  padding: 7px 10px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 999px;
  color: #dce6ff;
  font-size: 12px;
}

.header-logout {
  padding: 2px 5px;
  border: 0;
  background: transparent;
  color: #aebfe9;
  cursor: pointer;
  font-size: 12px;
}

.worker-main {
  width: min(100% - 24px, 520px);
  margin: 112px auto 110px;
}

.worker-card,
.claim-success {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: white;
  box-shadow: 0 8px 28px rgba(21, 31, 51, 0.06);
}

.worker-card {
  padding: 22px;
}

.worker-card + .worker-card {
  margin-top: 14px;
}

.step-label {
  margin: 0 0 4px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

h2 {
  margin: 0;
  font-size: 21px;
}

.helper {
  margin: 8px 0 18px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
}

form {
  display: grid;
  gap: 14px;
}

label {
  display: grid;
  gap: 7px;
  color: #344054;
  font-size: 13px;
  font-weight: 800;
}

input {
  width: 100%;
  min-height: 50px;
  padding: 12px 14px;
  border: 1px solid #cbd3df;
  border-radius: 10px;
  background: white;
  color: var(--ink);
  font-size: 16px;
  outline: none;
}

textarea {
  width: 100%;
  min-height: 84px;
  padding: 11px 12px;
  border: 1px solid #cbd3df;
  border-radius: 10px;
  color: var(--ink);
  font: inherit;
  resize: vertical;
}

input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(36, 94, 234, 0.12);
}

.section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.small-button {
  min-height: 36px;
  padding: 7px 11px;
  border: 1px solid #c9d1dd;
  border-radius: 8px;
  background: white;
  color: #475467;
  cursor: pointer;
}

.my-work-list {
  display: grid;
  gap: 9px;
}

.work-filters {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
  margin: 12px 0;
  padding: 4px;
  border-radius: 10px;
  background: #eef2f7;
}

.work-filters button {
  min-height: 36px;
  padding: 7px 8px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-weight: 800;
}

.work-filters button.active {
  background: white;
  color: var(--blue-dark);
  box-shadow: 0 1px 4px rgba(21, 38, 67, 0.12);
}

.work-date-group {
  display: grid;
  gap: 8px;
}

.work-date-group + .work-date-group {
  margin-top: 7px;
}

.work-date-heading {
  margin: 1px 2px 0;
  color: #667085;
  font-size: 12px;
  font-weight: 800;
}

.my-work-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 50px;
  padding: 10px 12px;
  border: 1px solid #d7dfeb;
  border-radius: 11px;
  background: #f8fafc;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}

.my-work-item strong {
  min-width: 0;
  font-size: 15px;
  overflow-wrap: anywhere;
}

.work-order-heading {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 7px;
}

.work-order-heading .worker-urgent-tag {
  flex: 0 0 auto;
}

.my-work-item .work-progress {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.my-work-item .work-status {
  padding: 5px 8px;
  border-radius: 999px;
  background: var(--blue-soft);
  color: var(--blue-dark);
  font-size: 12px;
  font-weight: 800;
}

.my-work-item .work-status.completed {
  background: var(--green-soft);
  color: var(--green);
}

.empty-work {
  margin: 0;
  padding: 14px;
  border-radius: 10px;
  background: #f7f8fa;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.worker-primary {
  width: 100%;
  min-height: 50px;
  padding: 12px 18px;
  border: 0;
  border-radius: 10px;
  background: var(--blue);
  color: white;
  cursor: pointer;
  font-weight: 900;
}

.worker-primary:active {
  background: var(--blue-dark);
  transform: translateY(1px);
}

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

.test-accounts {
  margin: 14px 0 0;
  padding: 10px 12px;
  border-radius: 8px;
  background: #fff7df;
  color: #8a5200;
  font-size: 12px;
  line-height: 1.6;
}

.worker-status {
  min-height: 18px;
  margin: 10px 0 0;
  color: #b54708;
  font-size: 13px;
}

.camera-button {
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid #c9d1dd;
  border-radius: 8px;
  background: white;
  color: #475467;
}

.camera-button {
  width: 100%;
  margin-top: 10px;
}

.order-input-label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.order-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.status-pill {
  flex: 0 0 auto;
  padding: 6px 9px;
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--green);
  font-size: 12px;
  font-weight: 900;
}

.status-pill.progress {
  background: var(--blue-soft);
  color: var(--blue-dark);
}

.task-list {
  display: grid;
  gap: 9px;
  margin: 14px 0 18px;
}

.task-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 13px 14px;
  border: 1px solid #dce3ed;
  border-radius: 10px;
  background: #f8fafc;
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.task-summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
}

.task-inline-evidence {
  display: grid;
  gap: 8px;
  width: 100%;
  padding-top: 9px;
  border-top: 1px solid #d9e9df;
}

.task-inline-evidence figure {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 8px;
  border-radius: 10px;
  background: rgba(255, 255, 255, .86);
}

.task-inline-evidence img {
  width: 84px;
  height: 84px;
  border-radius: 9px;
  object-fit: cover;
  background: #e8edf4;
}

.task-inline-evidence figcaption { min-width: 0; }
.task-inline-evidence figcaption b,
.task-inline-evidence figcaption span { display: block; overflow-wrap: anywhere; }
.task-inline-evidence figcaption b { color: #35506f; font-size: 12px; line-height: 1.5; }
.task-inline-evidence figcaption span { margin-top: 5px; color: var(--muted); font-size: 11px; line-height: 1.45; }

.task-item strong {
  font-size: 14px;
}

.task-item span {
  color: var(--muted);
  font-size: 12px;
}

.task-item:disabled {
  cursor: default;
  opacity: 1;
}

.task-item.completed {
  border-color: #b9dfca;
  background: #f0faf4;
}

.task-item.completed:not(:disabled) {
  cursor: pointer;
}

.task-item .task-state {
  display: grid;
  justify-items: end;
  gap: 4px;
}

.task-item .task-state em {
  color: var(--blue);
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
}

.evidence-card {
  scroll-margin-top: 12px;
}

.evidence-history-section {
  margin-top: 14px;
}

.evidence-history-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 9px;
}

.evidence-history-heading span {
  color: var(--muted);
  font-size: 12px;
}

.evidence-history {
  display: grid;
  gap: 10px;
}

.evidence-history-item {
  display: grid;
  grid-template-columns: 112px 1fr;
  gap: 11px;
  padding: 10px;
  border: 1px solid #d7dfeb;
  border-radius: 11px;
  background: #f8fafc;
}

.evidence-history-item img {
  width: 112px;
  height: 112px;
  border-radius: 8px;
  background: #e9eef5;
  object-fit: cover;
}

.evidence-history-meta {
  min-width: 0;
}

.evidence-history-meta strong,
.evidence-history-meta span,
.evidence-history-meta small {
  display: block;
}

.evidence-history-meta span,
.evidence-history-meta small {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.evidence-history-meta small {
  color: #475467;
}

.add-evidence-button {
  width: 100%;
  min-height: 44px;
  margin-top: 11px;
  border: 1px solid #c7d0de;
  border-radius: 10px;
  background: white;
  color: #344054;
  cursor: pointer;
  font-weight: 900;
}

#evidenceUploadSection {
  margin-top: 14px;
}

.photo-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.photo-choice {
  display: grid;
  min-height: 94px;
  padding: 14px;
  place-content: center;
  gap: 4px;
  border: 1px solid var(--blue);
  border-radius: 11px;
  background: var(--blue-soft);
  color: var(--blue-dark);
  cursor: pointer;
  text-align: center;
}

.photo-choice.secondary {
  border-color: #c7d0de;
  background: #f8fafc;
  color: #475467;
}

.photo-choice span {
  font-size: 11px;
  font-weight: 500;
}

.hidden-file {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
}

.photo-preview {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 12px;
  margin-top: 14px;
  padding: 10px;
  border: 1px solid #d7dfeb;
  border-radius: 11px;
  background: #f8fafc;
}

.photo-preview img {
  width: 92px;
  height: 92px;
  border-radius: 8px;
  object-fit: cover;
}

.photo-preview div {
  min-width: 0;
  align-self: center;
}

.photo-preview strong,
.photo-preview span {
  display: block;
}

.photo-preview strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.photo-preview span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.note-label {
  margin-top: 14px;
}

.evidence-actions {
  display: grid;
  grid-template-columns: 0.7fr 1.3fr;
  gap: 10px;
  margin-top: 14px;
}

.cancel-button {
  border: 1px solid #c7d0de;
  border-radius: 10px;
  background: white;
  color: #475467;
  cursor: pointer;
  font-weight: 800;
}

.claimed-info {
  margin: 0 0 14px;
  padding: 11px 12px;
  border-radius: 9px;
  background: var(--blue-soft);
  color: #2e4b86;
  font-size: 13px;
  line-height: 1.6;
}

.claim-success {
  display: flex;
  gap: 12px;
  margin-top: 14px;
  padding: 17px;
  border-color: #a8debf;
  background: var(--green-soft);
  color: #235d40;
}

.claim-success > span {
  display: grid;
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  background: var(--green);
  color: white;
  font-weight: 900;
}

.claim-success p {
  margin: 5px 0 0;
  font-size: 13px;
  line-height: 1.5;
}

.worker-urgent-tag {
  border-radius: 999px;
  background: #fff0ed;
  padding: 4px 7px;
  color: #b42318;
  font-size: 11px;
  font-weight: 900;
}

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

.salary-summary article {
  display: grid;
  gap: 5px;
  border-radius: 11px;
  background: #f5f7fa;
  padding: 12px 9px;
}

.salary-summary span {
  color: var(--muted);
  font-size: 11px;
}

.salary-summary strong {
  font-size: 16px;
}

.pricing-pending-banner {
  display: grid;
  gap: 5px;
  margin-top: 14px;
  border: 1px solid #f0cc93;
  border-radius: 11px;
  background: #fffaf0;
  padding: 13px;
  color: #81500d;
}

.pricing-pending-banner span {
  font-size: 12px;
  line-height: 1.6;
}

.salary-task-list {
  display: grid;
  gap: 9px;
  margin-top: 16px;
}

.salary-task-item {
  border: 1px solid var(--line);
  border-radius: 11px;
  overflow: hidden;
}

.salary-week-switcher {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
}

.salary-week-switcher button {
  border: 1px solid var(--line);
  border-radius: 9px;
  background: white;
  padding: 8px 10px;
  color: #475467;
}

.salary-week-switcher button:disabled {
  opacity: 0.4;
}

.salary-week-switcher strong {
  text-align: center;
  font-size: 13px;
}

.salary-day-group {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
}

.salary-day-toggle,
.salary-task-toggle {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 0;
  background: transparent;
  padding: 13px;
  color: var(--ink);
  text-align: left;
}

.salary-day-toggle span:first-child,
.salary-task-toggle span:first-child {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.salary-day-toggle small {
  color: var(--muted);
  font-size: 11px;
}

.salary-day-orders {
  display: grid;
  gap: 8px;
  border-top: 1px solid var(--line);
  background: #f8fafc;
  padding: 9px;
}

.salary-task-toggle b {
  flex: 0 0 auto;
  color: var(--green);
  font-size: 13px;
}

.salary-task-toggle em {
  width: fit-content;
  border-radius: 999px;
  background: #fff2e2;
  padding: 3px 6px;
  color: #9a4c00;
  font-size: 10px;
  font-style: normal;
}

.salary-task-detail {
  border-top: 1px solid var(--line);
  padding: 12px;
}

.salary-task-detail dl {
  display: grid;
  gap: 7px;
  margin: 0;
}

.salary-task-detail dl div {
  display: flex;
  justify-content: space-between;
  gap: 14px;
}

.salary-task-detail dt,
.salary-task-detail dd {
  margin: 0;
  font-size: 12px;
}

.salary-task-detail dt {
  color: var(--muted);
}

.salary-task-detail dd {
  text-align: right;
}

.salary-task-detail .long-duration {
  color: #b54708;
  font-weight: 900;
}

.salary-evidence-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  margin-top: 12px;
}

.salary-evidence-grid img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  border-radius: 8px;
  object-fit: cover;
}

.profile-details {
  display: grid;
  gap: 9px;
  margin: 18px 0;
}

.profile-details span {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid var(--line);
  padding: 9px 0;
  color: var(--muted);
}

.profile-details strong {
  color: var(--ink);
}

.profile-logout {
  width: 100%;
  margin-top: 12px;
  border: 1px solid #d4dae4;
  border-radius: 11px;
  background: white;
  padding: 12px;
  color: #475467;
  cursor: pointer;
  font-weight: 800;
}

.worker-bottom-nav {
  position: fixed;
  z-index: 30;
  right: 50%;
  bottom: max(10px, env(safe-area-inset-bottom));
  display: grid;
  width: min(calc(100% - 24px), 496px);
  grid-template-columns: repeat(3, 1fr);
  transform: translateX(50%);
  border: 1px solid #dfe5ed;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.96);
  padding: 6px;
  box-shadow: 0 12px 34px rgba(21, 31, 51, 0.16);
  backdrop-filter: blur(12px);
}

.worker-bottom-nav button {
  min-height: 48px;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-weight: 800;
}

.worker-bottom-nav button.active {
  background: var(--blue-soft);
  color: var(--blue-dark);
}

.worker-nav-label { position: relative; display: inline-flex; align-items: center; justify-content: center; }
.worker-nav-badge {
  position: absolute;
  top: -12px;
  right: -19px;
  display: grid;
  min-width: 19px;
  height: 19px;
  place-items: center;
  border: 2px solid white;
  border-radius: 999px;
  background: #e5484d;
  padding: 0 4px;
  color: white;
  font-size: 10px;
  font-style: normal;
  line-height: 1;
}

.quality-notice-section { display: grid; gap: 10px; margin-top: 16px; border: 1px solid #f0b6b2; border-radius: 14px; background: #fff7f5; padding: 14px; }
.quality-notice-heading { display: flex; justify-content: space-between; gap: 12px; }
.quality-notice-heading span { color: #b42318; font-size: 12px; font-weight: 800; }
.quality-notice-list { display: grid; gap: 8px; }
.quality-notice-list button { display: grid; gap: 5px; border: 1px solid #efd0cc; border-radius: 11px; background: white; padding: 11px; text-align: left; cursor: pointer; }
.quality-notice-list button span { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.quality-notice-list button i { border-radius: 999px; background: #e5484d; padding: 2px 7px; color: white; font-size: 10px; font-style: normal; }
.quality-notice-list button small { color: #8b4a43; line-height: 1.45; }

.hidden {
  display: none !important;
}

@media (max-width: 380px) {
  .worker-card {
    padding: 18px;
  }

  .worker-header h1 {
    font-size: 21px;
  }

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

/* Artisan mobile flow: compact controls and stacked glass notifications. */
.lookup-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}

.lookup-actions .worker-primary,
.lookup-actions .camera-button {
  width: 100%;
  min-height: 44px;
  margin: 0;
  padding: 9px 10px;
  white-space: nowrap;
}

.lookup-actions .camera-button {
  font-size: 12px;
}

.artisan-toast-container {
  position: fixed;
  z-index: 60;
  right: 50%;
  bottom: max(86px, calc(env(safe-area-inset-bottom) + 78px));
  display: flex;
  width: min(calc(100% - 28px), 492px);
  max-height: 52vh;
  flex-direction: column-reverse;
  gap: 8px;
  transform: translateX(50%);
  pointer-events: none;
}

.artisan-toast {
  display: grid;
  grid-template-columns: 30px 1fr;
  gap: 10px;
  align-items: center;
  border: 1px solid rgba(111, 194, 148, 0.52);
  border-radius: 14px;
  background: rgba(231, 248, 239, 0.86);
  padding: 12px 14px;
  box-shadow: 0 16px 36px rgba(17, 70, 45, 0.18);
  color: #235d40;
  opacity: 0;
  transform: translateY(18px) scale(0.98);
  transition: opacity 220ms ease, transform 240ms ease;
  backdrop-filter: blur(18px) saturate(135%);
}

.artisan-toast.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.artisan-toast.leaving {
  opacity: 0;
  transform: translateY(-18px) scale(0.98);
}

.artisan-toast > span {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 50%;
  background: var(--green);
  color: white;
  font-weight: 900;
}

.artisan-toast strong,
.artisan-toast p {
  display: block;
  margin: 0;
}

.artisan-toast p {
  margin-top: 3px;
  font-size: 12px;
  line-height: 1.45;
}

.salary-task-toggle small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
}

.salary-order-detail {
  display: grid;
  gap: 14px;
  background: white;
}

.salary-record-detail + .salary-record-detail {
  border-top: 1px dashed var(--line);
  padding-top: 14px;
}

.salary-record-detail h4 {
  margin: 0 0 9px;
  font-size: 13px;
}

@media (max-width: 560px) {
  .worker-header {
    min-height: 78px;
    padding-top: 11px;
    padding-bottom: 11px;
  }

  .worker-header h1 {
    font-size: 22px;
  }

  .worker-main {
    margin-top: 96px;
  }

  .worker-card {
    padding: 17px;
  }

  .worker-card + .worker-card {
    margin-top: 11px;
  }

  .helper {
    margin: 6px 0 13px;
    line-height: 1.55;
  }

  form {
    gap: 10px;
  }

  input {
    min-height: 46px;
  }

  .task-list {
    gap: 7px;
    margin: 10px 0 13px;
  }

  .task-item {
    padding: 11px 12px;
  }
}

/* Short-page mobile flow: order and evidence open as focused overlays. */
.worker-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 48;
  background: rgba(11, 25, 49, 0.48);
  backdrop-filter: blur(4px);
}

.order-card:not(.hidden),
.evidence-card:not(.hidden) {
  position: fixed;
  z-index: 50;
  inset: 96px max(12px, calc((100% - 520px) / 2)) 84px;
  margin: 0;
  overflow-y: auto;
  box-shadow: 0 28px 70px rgba(14, 28, 54, 0.28);
}

.evidence-card:not(.hidden) { z-index: 55; }

.worker-modal-close {
  position: absolute;
  z-index: 2;
  top: 12px;
  right: 12px;
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: #eef2f7;
  color: #344054;
  cursor: pointer;
  font-size: 23px;
}

.order-heading { padding-right: 42px; }
.evidence-card { position: relative; padding-top: 54px; }

@media (max-width: 560px) {
  .order-card:not(.hidden),
  .evidence-card:not(.hidden) {
    inset: 86px 8px 76px;
    border-radius: 18px;
  }
}
