:root {
  --green: #127346;
  --green-2: #1d8a57;
  --dark: #12251d;
  --muted: #69776f;
  --line: #dfe8e2;
  --soft: #f3f8f5;
  --warn: #fff3dc;
  --danger: #b54040;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  color: var(--dark);
  background: radial-gradient(circle at top right, rgba(28, 138, 87, .12), transparent 34%), var(--soft);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", sans-serif;
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.login-card {
  width: min(480px, 100%);
  padding: 26px;
  border-radius: 28px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: 0 22px 70px rgba(18, 55, 36, .12);
}
.login-card img {
  width: 240px;
  max-width: 80%;
  display: block;
  margin-bottom: 28px;
}
.login-card h1 { margin: 8px 0; font-size: 34px; }
.login-card p { color: var(--muted); line-height: 1.7; }
.eyebrow {
  margin: 0;
  color: #c93737 !important;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .18em;
}

.shell {
  min-height: 100vh;
  width: min(860px, 100%);
  margin: 0 auto;
  padding: max(20px, env(safe-area-inset-top)) 16px 106px;
}
.shell.simple-mode {
  font-size: 18px;
}
.top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}
.top h1 {
  margin: 6px 0 6px;
  font-size: clamp(26px, 7vw, 38px);
  line-height: 1.12;
  letter-spacing: -.04em;
}
.top p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}
.text-button {
  border: 0;
  background: transparent;
  color: var(--green);
  font-weight: 900;
  padding: 0 0 4px;
}
.badge {
  border: 0;
  color: var(--green);
  background: #e4f4eb;
  border-radius: 999px;
  padding: 10px 13px;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.hero-card,
.card,
.item {
  background: rgba(255,255,255,.94);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: 0 12px 34px rgba(30,70,48,.07);
}
.hero-card {
  display: grid;
  gap: 6px;
  padding: 18px;
  margin-bottom: 14px;
}
.hero-card strong { font-size: 22px; }
.hero-card span { color: var(--muted); line-height: 1.5; }
.card { padding: 17px; margin-bottom: 14px; }

.module-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}
.module {
  min-height: 118px;
  border: 1px solid #cfe4d7;
  border-radius: 22px;
  padding: 18px;
  text-align: left;
  color: #fff;
  background: linear-gradient(135deg, #11673f, #20935c);
  box-shadow: 0 14px 34px rgba(20,105,66,.16);
}
.module strong {
  display: block;
  font-size: 23px;
  margin-bottom: 10px;
}
.module span {
  display: block;
  color: rgba(255,255,255,.84);
  line-height: 1.55;
}
.module.warn {
  background: linear-gradient(135deg, #a36b16, #d09126);
}
.module.neutral {
  color: var(--dark);
  background: #fff;
}
.module.neutral span { color: var(--muted); }

.wizard label,
.login-card label {
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin: 15px 0;
  color: #10271d;
  font-weight: 900;
}
input, select, textarea {
  width: 100%;
  min-height: 56px;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 13px 14px;
  color: var(--dark);
  background: #fff;
  outline: 0;
  font-size: 16px;
}
textarea { min-height: 118px; resize: vertical; }
input[type=file] {
  border-style: dashed;
  background: #f9fcfa;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 4px rgba(18,115,70,.11);
}
.mini-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.selected-project-card,
.location-status {
  margin: 14px 0;
  padding: 15px;
  border-radius: 18px;
  border: 1px solid #cfe4d7;
  background: #f4fbf7;
  color: var(--muted);
  line-height: 1.55;
}
.selected-project-card span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}
.selected-project-card strong {
  display: block;
  color: var(--dark);
  font-size: 20px;
  line-height: 1.35;
}
.location-button {
  width: 100%;
  color: #fff;
  background: linear-gradient(135deg, #127346, #1d8a57);
  box-shadow: 0 12px 28px rgba(18, 115, 70, .18);
}
.location-status.ok {
  color: var(--green);
  background: #e7f6ed;
  border-color: #b9dec9;
  font-weight: 900;
}
.actions,
.sticky-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 16px;
}
.sticky-actions {
  position: sticky;
  bottom: 86px;
  padding: 10px;
  border-radius: 22px;
  background: rgba(243,248,245,.92);
  backdrop-filter: blur(12px);
}
.button {
  min-height: 56px;
  border: 0;
  border-radius: 16px;
  padding: 0 18px;
  font-weight: 950;
}
.button.primary { color: #fff; background: var(--green); }
.button.secondary { color: var(--green); background: #e7f4ed; }
.button.danger { color: #fff; background: var(--danger); width: 100%; margin-top: 10px; }

.signature-box {
  margin-top: 14px;
  padding: 12px;
  border: 1px dashed #9ab9a8;
  border-radius: 18px;
  background: #f9fcfa;
}
#signature-pad {
  width: 100%;
  height: 180px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid var(--line);
  touch-action: none;
}

.confirm-list p {
  margin: 10px 0;
  line-height: 1.65;
}
.list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.list h2 {
  margin: 16px 2px 4px;
  font-size: 20px;
}
.item {
  padding: 15px;
}
.item h3 {
  margin: 0 0 8px;
  font-size: 18px;
  line-height: 1.35;
}
.item p {
  margin: 5px 0;
  color: var(--muted);
  line-height: 1.55;
}
.item small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
}
.pill {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  margin-top: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  color: var(--green);
  background: #e8f4ed;
  font-size: 12px;
  font-weight: 900;
}
.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.tag-list span {
  padding: 7px 10px;
  border-radius: 999px;
  color: var(--green);
  background: #e8f4ed;
  font-size: 12px;
  font-weight: 900;
}

.nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  padding: 10px 12px max(10px, env(safe-area-inset-bottom));
  background: rgba(255,255,255,.95);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(12px);
}
.nav button {
  min-height: 48px;
  border: 0;
  border-radius: 16px;
  color: var(--muted);
  background: transparent;
  font-weight: 900;
}
.nav button.active {
  color: #fff;
  background: var(--green);
}
.toast {
  position: fixed;
  left: 18px;
  right: 18px;
  bottom: 86px;
  z-index: 40;
  padding: 14px 16px;
  color: #fff;
  background: #143a29;
  border-radius: 15px;
  text-align: center;
  transform: translateY(28px);
  opacity: 0;
  transition: .18s ease;
}
.toast.show {
  transform: translateY(0);
  opacity: 1;
}

@media (min-width: 760px) {
  .module-grid { grid-template-columns: repeat(2, 1fr); }
  .module { min-height: 140px; }
  .nav { left: 50%; transform: translateX(-50%); max-width: 860px; border-radius: 24px 24px 0 0; }
}

/* Mobile Vibe AI Center Theme V1 */
body {
  background:
    radial-gradient(circle at 88% 4%, rgba(54, 226, 135, .24), transparent 30%),
    radial-gradient(circle at 16% 12%, rgba(49, 126, 255, .12), transparent 28%),
    linear-gradient(145deg, #f8fcf8 0%, #eff8f2 48%, #f9fcfa 100%);
}

body:before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  background-image:
    linear-gradient(rgba(18, 115, 70, .045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(18, 115, 70, .045) 1px, transparent 1px);
  background-size: 36px 36px;
  mask-image: linear-gradient(180deg, rgba(0,0,0,.72), rgba(0,0,0,.08));
}

.login-shell {
  background:
    radial-gradient(circle at 18% 18%, rgba(64, 242, 147, .24), transparent 30%),
    linear-gradient(145deg, #061812, #0d3f29 62%, #061812);
}

.login-card,
.hero-card,
.card,
.item,
.selected-project-card,
.location-status {
  border: 1px solid rgba(39, 116, 76, .18);
  background: linear-gradient(145deg, rgba(255,255,255,.92), rgba(246,252,248,.74));
  box-shadow: 0 16px 42px rgba(7, 35, 23, .10);
  backdrop-filter: blur(18px);
}

.top h1 {
  letter-spacing: -.05em;
}

.module {
  border-color: rgba(141, 255, 190, .26);
  background:
    radial-gradient(circle at 78% 10%, rgba(114,255,178,.28), transparent 30%),
    linear-gradient(135deg, #0a3a28, #16824f 58%, #25a765);
  box-shadow: 0 18px 42px rgba(13, 99, 58, .20);
}

.module.warn {
  background:
    radial-gradient(circle at 78% 10%, rgba(255,216,128,.28), transparent 30%),
    linear-gradient(135deg, #7a4e12, #d09126);
}

.module.neutral {
  color: var(--dark);
  background: linear-gradient(145deg, rgba(255,255,255,.92), rgba(246,252,248,.78));
}

.button.primary,
.location-button {
  background: linear-gradient(135deg, #25a765, #106d43);
  box-shadow: 0 16px 34px rgba(28, 126, 75, .24);
}

.nav {
  background: rgba(255,255,255,.82);
  border-top: 1px solid rgba(39,116,76,.16);
  box-shadow: 0 -16px 40px rgba(7,35,23,.10);
}

.nav button.active {
  background: linear-gradient(135deg, #25a765, #106d43);
  box-shadow: 0 10px 24px rgba(28,126,75,.22);
}

.toast {
  border: 1px solid rgba(137,255,187,.20);
  background: linear-gradient(135deg, rgba(8, 42, 27, .96), rgba(19, 103, 62, .94));
  box-shadow: 0 20px 55px rgba(8, 42, 27, .28);
}

/* Temporary task mobile flow */
[hidden] { display: none !important; }

.button:disabled,
.temporary-file-action:has(input:disabled) {
  cursor: not-allowed;
  opacity: .55;
  box-shadow: none;
}

.location-status.error {
  color: #9c2f2f;
  border-color: #efcaca;
  background: #fff1f1;
  font-weight: 800;
}

.module.temporary-module {
  background:
    radial-gradient(circle at 82% 12%, rgba(147, 221, 255, .34), transparent 32%),
    linear-gradient(135deg, #073d32, #11785a 56%, #1d9b75);
}

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

.nav.nav-5 button {
  padding-inline: 4px;
  font-size: 12px;
}

.temporary-loading,
.temporary-empty {
  color: var(--muted);
  line-height: 1.6;
}

.temporary-list-action {
  display: grid;
  gap: 14px;
}

.temporary-list-action div {
  display: grid;
  gap: 5px;
}

.temporary-list-action strong {
  font-size: 20px;
}

.temporary-list-action span,
.temporary-muted,
.temporary-photo-note {
  color: var(--muted);
  line-height: 1.55;
}

.temporary-task-item {
  width: 100%;
  display: grid;
  gap: 7px;
  color: var(--dark);
  text-align: left;
}

.temporary-task-item:active {
  transform: translateY(1px);
}

.temporary-item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.temporary-item-head > strong {
  font-size: 18px;
}

.temporary-item-head .pill {
  flex: 0 0 auto;
  margin: 0;
}

.temporary-item-project {
  color: var(--muted);
  line-height: 1.5;
}

.temporary-stepper {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
  padding: 0;
  margin: 0 0 14px;
  list-style: none;
}

.temporary-stepper li {
  display: grid;
  justify-items: center;
  gap: 6px;
  min-width: 0;
  color: #59675f;
  font-size: 12px;
  text-align: center;
}

.temporary-step-heading {
  margin: 0 2px 10px;
  font-size: 19px;
  line-height: 1.35;
}

.temporary-step-heading:focus-visible {
  outline: 3px solid rgba(28, 126, 75, .35);
  outline-offset: 4px;
}

.temporary-stepper li span {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(255,255,255,.8);
  font-weight: 950;
}

.temporary-stepper li.active,
.temporary-stepper li.done {
  color: var(--green);
}

.temporary-stepper li.active span,
.temporary-stepper li.done span {
  color: #fff;
  border-color: var(--green);
  background: linear-gradient(135deg, #25a765, #106d43);
  box-shadow: 0 8px 20px rgba(28,126,75,.22);
}

.temporary-project-toggle,
.temporary-workers {
  min-width: 0;
  margin: 15px 0;
  padding: 0;
  border: 0;
}

.temporary-project-toggle legend,
.temporary-workers legend {
  margin-bottom: 10px;
  font-weight: 900;
}

.temporary-project-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.temporary-project-toggle legend {
  grid-column: 1 / -1;
}

.wizard .temporary-project-toggle label {
  min-height: 52px;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: #f8fcf9;
}

.temporary-project-toggle input,
.worker-option input {
  width: 22px;
  min-height: 22px;
  flex: 0 0 22px;
  accent-color: var(--green);
}

.temporary-project-panel {
  padding: 1px 13px 3px;
  border: 1px solid #cee3d7;
  border-radius: 18px;
  background: rgba(244,251,247,.82);
}

.temporary-worker-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  max-height: 320px;
  overflow: auto;
  padding: 2px;
}

.temporary-current-driver,
.temporary-draft-tip,
.temporary-completion-hint {
  display: grid;
  gap: 4px;
  margin-bottom: 14px;
  padding: 13px 14px;
  border: 1px solid #c9dfd2;
  border-radius: 15px;
  background: #f1f9f4;
}

.temporary-current-driver span,
.temporary-current-driver small {
  color: var(--muted);
  font-size: 12px;
}

.temporary-current-driver strong {
  font-size: 18px;
}

.temporary-location-section {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.temporary-location-candidates,
.temporary-manual-location {
  display: grid;
  gap: 8px;
  min-width: 0;
  margin: 0;
  padding: 12px;
  border: 1px solid #c7ddd0;
  border-radius: 16px;
  background: #f7fcf9;
}

.temporary-location-candidates legend {
  padding: 0 4px;
  font-weight: 900;
}

.wizard .temporary-location-candidates label {
  min-height: 56px;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fff;
}

.temporary-location-candidates input {
  width: 22px;
  min-height: 22px;
  flex: 0 0 22px;
  accent-color: var(--green);
}

.temporary-location-candidates label > span {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.temporary-location-candidates small,
.temporary-manual-location small,
.temporary-draft-tip {
  color: var(--muted);
  line-height: 1.5;
}

.temporary-completion-hint {
  margin-top: 15px;
  color: #855900;
  border-color: #efd89c;
  background: #fff7df;
  font-weight: 800;
}

.wizard .temporary-worker-search {
  margin: 0 0 9px;
}

.wizard .worker-option {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 11px;
  margin: 0;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: #fbfdfc;
}

.worker-option span {
  display: grid;
  gap: 3px;
}

.worker-option small {
  color: var(--muted);
  font-weight: 600;
}

.temporary-confirm {
  border-left: 4px solid var(--green);
}

.temporary-stage-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.temporary-stage-heading > div {
  display: grid;
  gap: 4px;
}

.temporary-stage-heading strong {
  font-size: 18px;
}

.temporary-stage-heading span:not(.photo-count) {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.photo-count {
  min-width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 999px;
  color: var(--green);
  background: #e7f4ed;
  font-size: 13px;
  font-weight: 950;
}

.temporary-photo-picker {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}

.temporary-file-action {
  min-height: 76px;
  display: grid;
  align-content: center;
  gap: 4px;
  padding: 11px;
  border: 1px solid #bcd8c8;
  border-radius: 16px;
  color: var(--green);
  background: #edf8f1;
  text-align: center;
  cursor: pointer;
}

.temporary-file-action.gallery {
  color: #285da0;
  border-color: #c9d9ec;
  background: #f1f6fc;
}

.temporary-file-action:has(input:focus-visible) {
  outline: 3px solid #1b6fc2;
  outline-offset: 3px;
}

.temporary-file-action span {
  font-weight: 950;
}

.temporary-file-action small {
  color: var(--muted);
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  min-height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.photo-preview-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  margin-top: 12px;
}

.photo-preview-card {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: #fff;
}

.photo-preview-card > img,
.temporary-remote-preview,
.temporary-remote-preview img,
.photo-preview-fallback {
  width: 100%;
  aspect-ratio: 1 / 1;
}

.photo-preview-card > img,
.temporary-remote-preview img {
  display: block;
  object-fit: cover;
}

.temporary-remote-preview,
.photo-preview-fallback {
  display: grid;
  place-items: center;
  padding: 8px;
  color: var(--muted);
  background: #eef5f1;
  font-size: 12px;
  text-align: center;
}

.temporary-remote-preview.error {
  color: #9c2f2f;
  background: #fff1f1;
}

.photo-preview-card figcaption {
  display: grid;
  gap: 3px;
  padding: 8px 9px 6px;
}

.photo-preview-card figcaption strong {
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.photo-preview-card figcaption small {
  color: var(--muted);
  font-size: 11px;
}

.photo-remove {
  width: calc(100% - 16px);
  min-height: 44px;
  margin: 0 8px 8px;
  border: 0;
  border-radius: 10px;
  color: var(--danger);
  background: #fff0f0;
  font-size: 12px;
  font-weight: 900;
}

.photo-remove:focus-visible {
  outline: 3px solid rgba(181, 64, 64, .35);
  outline-offset: 2px;
}

.photo-remove:focus-visible {
  outline: 3px solid #1b6fc2;
  outline-offset: 3px;
}

.temporary-photo-pagination {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  margin-top: 12px;
}

.photo-empty {
  grid-column: 1 / -1;
  margin: 4px 0;
  padding: 13px;
  border: 1px dashed var(--line);
  border-radius: 13px;
  color: var(--muted);
  text-align: center;
}

.temporary-photo-note {
  margin: 3px 3px 16px;
  font-size: 13px;
}

.upload-summary {
  margin: 12px 0;
  padding: 13px 14px;
  border: 1px solid #b8ddc8;
  border-radius: 15px;
  background: #ebf8f0;
  line-height: 1.55;
}

.upload-summary p {
  margin: 5px 0 0;
}

.upload-summary ul {
  margin: 8px 0 0;
  padding-left: 20px;
}

.upload-summary.error {
  color: #812c2c;
  border-color: #efc4c4;
  background: #fff1f1;
}

.upload-summary.ok {
  color: #0c6540;
}

.upload-summary.progress {
  color: #184f7f;
  border-color: #b9d7ef;
  background: #eef7ff;
  font-weight: 850;
}

.temporary-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 13px;
}

.temporary-detail-grid > div {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.temporary-detail-grid .wide {
  grid-column: 1 / -1;
}

.temporary-detail-grid span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.temporary-detail-grid strong {
  overflow-wrap: anywhere;
  line-height: 1.45;
}

.temporary-detail-card > .pill {
  margin-top: 14px;
}

.temporary-section-title {
  margin: 20px 3px 10px;
  font-size: 20px;
}

.temporary-supplement-panel {
  margin-top: 20px;
  border-color: #afd7c0;
}

.temporary-supplement-panel > .temporary-photo-stage {
  padding: 13px;
  box-shadow: none;
  background: rgba(248,252,249,.8);
}

.temporary-upload-button {
  width: 100%;
  margin-top: 6px;
}

.temporary-detail-actions {
  z-index: 5;
}

@media (min-width: 760px) {
  .temporary-list-action {
    grid-template-columns: 1fr auto;
    align-items: center;
  }

  .temporary-worker-grid {
    grid-template-columns: 1fr 1fr;
  }

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