:root {
  --bg: #f7f3ea;
  --panel: rgba(255, 251, 245, 0.96);
  --panel-strong: #fffaf2;
  --line: rgba(77, 52, 32, 0.12);
  --text: #2d2016;
  --muted: #7d6857;
  --accent: #d86a2a;
  --accent-deep: #9e3f11;
  --danger: #b8483b;
  --shadow: 0 24px 80px rgba(93, 62, 34, 0.16);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: "SUIT", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(216, 106, 42, 0.18), transparent 28%),
    radial-gradient(circle at top right, rgba(51, 122, 85, 0.14), transparent 26%),
    linear-gradient(180deg, #efe3d1 0%, #f7f3ea 45%, #f4eee2 100%);
}

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

.device-bg {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.3) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.2) 1px, transparent 1px);
  background-size: 24px 24px;
  opacity: 0.4;
  pointer-events: none;
}

.app-shell {
  position: relative;
  width: min(100%, 430px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 18px 16px max(18px, env(safe-area-inset-bottom));
  background: rgba(247, 243, 234, 0.88);
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow);
}

.section-head, .sheet-header, .detail-meta, .card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.topbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}

.topbar > div:first-child {
  min-width: 0;
}

.brand {
  display: flex;
  align-items: center;
  width: 100%;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  text-align: left;
}

.eyebrow {
  margin: 0 0 6px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: var(--accent-deep);
}

.brand-logo {
  display: block;
  width: min(190px, 100%);
  height: 48px;
  object-fit: contain;
  object-position: left center;
}

.sheet-header h3, .section-head h2, .hero-card h1, .card h3 {
  display: block;
  margin: 0;
}

.hero-card p, .section-head p, .meta-chip, .card p, .status-banner, .detail-stack p, .empty-state p {
  color: var(--muted);
}

.top-actions {
  display: grid;
  grid-template-columns: minmax(52px, 82px) repeat(3, 34px);
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.icon-button, .ghost-button, .primary-button, .action-button, .auth-chip, .social-button {
  border: 0;
  transition: transform 0.18s ease, opacity 0.18s ease, background 0.18s ease;
}

.icon-button {
  position: relative;
  width: 34px;
  height: 34px;
  border-radius: 12px;
  background: var(--panel-strong);
  box-shadow: inset 0 0 0 1px var(--line);
  font-weight: 800;
}

.top-icon-button {
  display: grid;
  place-items: center;
  color: var(--accent-deep);
}

.top-icon-button svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.notification-button b {
  position: absolute;
  top: 6px;
  right: 7px;
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: #d9332e;
  box-shadow: 0 0 0 3px #fffaf2;
}

@media (max-width: 390px) {
  .brand-logo {
    width: min(168px, 100%);
    height: 44px;
  }

  .top-actions {
    grid-template-columns: minmax(48px, 72px) repeat(3, 32px);
    gap: 5px;
  }

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

  .auth-chip {
    height: 32px;
    padding: 0 7px;
  }
}

.notification-button.has-unread {
  color: #fff;
  background: #1f4f3b;
}

.auth-chip {
  min-width: 0;
  width: 100%;
  height: 34px;
  padding: 0 9px;
  border-radius: 12px;
  background: #2f6f4e;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.auth-chip.is-active {
  background: #1f4f3b;
}

.hero-card, .status-banner, .card, .sheet-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: 0 18px 42px rgba(93, 62, 34, 0.08);
}

.hero-card {
  display: grid;
  gap: 14px;
  padding: 18px;
  border-radius: 24px;
}

.hero-card.is-hidden-after-location {
  display: none;
}

.hero-card h1 {
  font-size: 1.5rem;
  line-height: 1.22;
}

.hero-card p, .status-banner, .card p, .detail-stack p {
  margin: 6px 0 0;
  line-height: 1.55;
}

.ghost-button, .primary-button, .action-button, .social-button {
  border-radius: 16px;
  padding: 14px 16px;
  font-weight: 700;
}

.ghost-button {
  background: #f4eadb;
  color: var(--accent-deep);
}

.primary-button, .action-button {
  background: linear-gradient(135deg, var(--accent), #eb8d53);
  color: #fff;
}

.social-button {
  display: block;
  color: #1c1c1c;
  text-align: center;
  text-decoration: none;
}

.social-button.naver {
  background: #03c75a;
}

.social-button.kakao {
  background: #fee500;
}

.tabbar {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  padding: 6px;
  margin: 18px 0 12px;
  border-radius: 20px;
  background: rgba(255, 250, 242, 0.76);
  border: 1px solid var(--line);
}

.region-filter, .region-selects {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.region-selects label {
  position: relative;
}

.region-selects label.has-select-placeholder::after {
  content: attr(data-select-placeholder);
  position: absolute;
  right: 28px;
  bottom: 15px;
  left: 14px;
  overflow: hidden;
  color: #8b7968;
  font-weight: 600;
  line-height: 1.2;
  pointer-events: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.region-selects label.has-select-placeholder::before {
  content: "";
  position: absolute;
  right: 15px;
  bottom: 19px;
  z-index: 2;
  width: 7px;
  height: 7px;
  border-right: 2px solid #8b7968;
  border-bottom: 2px solid #8b7968;
  pointer-events: none;
  transform: rotate(45deg);
}

.region-selects select.is-placeholder {
  color: transparent;
  -webkit-text-fill-color: transparent;
}

.region-selects select option {
  color: var(--text);
  -webkit-text-fill-color: var(--text);
}

.region-filter select {
  min-width: 0;
  padding: 10px 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
}

.tab {
  border: 0;
  border-radius: 15px;
  padding: 13px 14px;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
}

.tab.is-active {
  background: linear-gradient(135deg, #fff5e7, #ffe2c3);
  color: var(--accent-deep);
}

.sort-toggle {
  display: inline-grid;
  grid-template-columns: repeat(2, minmax(58px, 1fr));
  gap: 5px;
  padding: 5px;
  border-radius: 16px;
  background: rgba(255, 250, 242, 0.86);
  border: 1px solid var(--line);
}

.sort-toggle.hidden {
  display: none;
}

.sort-button {
  border: 0;
  border-radius: 12px;
  padding: 9px 10px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.sort-button.is-active {
  background: #fff0e0;
  color: var(--accent-deep);
  box-shadow: 0 8px 18px rgba(93, 62, 34, 0.08);
}

.status-banner {
  border-radius: 18px;
  padding: 12px 14px;
  transition: opacity 0.18s ease, transform 0.18s ease, margin 0.18s ease, padding 0.18s ease;
}

.status-banner.is-hidden {
  height: 0;
  margin: 0;
  padding-top: 0;
  padding-bottom: 0;
  overflow: hidden;
  opacity: 0;
  transform: translateY(-4px);
  border-width: 0;
}

.status-banner.is-error {
  border-color: rgba(184, 72, 59, 0.28);
  color: var(--danger);
  background: #fff1ec;
}

.list-section { margin-top: 16px; }
.page-view { margin-top: 16px; }
.page-view.hidden { display: none; }
.card-list { display: grid; gap: 12px; margin-top: 14px; }

.card {
  position: relative;
  border-radius: 24px;
  padding: 18px;
}

.card.is-unread {
  border-color: rgba(47, 111, 78, 0.34);
  background: #f3fbf5;
}

.card.is-closed {
  opacity: 0.48;
  filter: grayscale(0.25);
}

.card.is-closed::after {
  content: attr(data-status);
  position: absolute;
  top: 16px;
  right: 16px;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(184, 72, 59, 0.14);
  color: var(--danger);
  font-size: 12px;
  font-weight: 800;
}

.card-top {
  width: 100%;
  align-items: flex-start;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 8px 11px;
  border-radius: 999px;
  background: #fff0e0;
  color: var(--accent-deep);
  font-size: 12px;
  font-weight: 800;
}

.foreign-worker-badge {
  display: inline-flex;
  align-items: center;
  margin-left: 6px;
  padding: 7px 9px;
  border-radius: 999px;
  background: #eef7ef;
  color: #2f6f4e;
  border: 1px solid rgba(47, 111, 78, 0.18);
  font-size: 12px;
  font-weight: 900;
  vertical-align: middle;
  white-space: nowrap;
}

.detail-item p {
  overflow-wrap: anywhere;
}

.meta-row, .detail-stack, .detail-list, .form-grid {
  display: grid;
  gap: 12px;
}

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

.auth-stack, .recover-card {
  display: grid;
  gap: 14px;
}

.auth-switch {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  padding: 6px;
  border-radius: 18px;
  background: rgba(255, 250, 242, 0.86);
  border: 1px solid var(--line);
}

.auth-view.hidden, .role-fields.hidden, .foreign-fields.hidden {
  display: none;
}

.role-fields, .foreign-fields, .recover-card {
  padding: 14px;
  border-radius: 18px;
  background: #fbf6ee;
  border: 1px solid rgba(77, 52, 32, 0.08);
}

.checkbox-field {
  display: flex;
  grid-template-columns: auto 1fr;
  align-items: center;
}

.checkbox-field input {
  width: auto;
}

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

.recover-card h4 {
  margin: 0;
}

.meta-row {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 14px;
}

.job-meta-row {
  grid-template-columns: minmax(0, 1.65fr) minmax(82px, 0.75fr);
}

.job-meta-row .meta-chip {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.meta-chip {
  padding: 11px 12px;
  border-radius: 16px;
  background: #fbf6ee;
  border: 1px solid rgba(77, 52, 32, 0.08);
  font-size: 13px;
}

.card-top .time-chip {
  flex: 0 0 auto;
  white-space: nowrap;
}

.card .action-row, .detail-actions {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.status-group-title {
  margin: 10px 2px 0;
  color: var(--accent-deep);
  font-size: 13px;
  font-weight: 900;
}

.danger-button {
  color: var(--danger);
  background: #fff1ec;
}

.bottom-nav {
  position: sticky;
  left: 0;
  right: 0;
  bottom: max(8px, env(safe-area-inset-bottom));
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 4px;
  width: 100%;
  margin: 20px auto 0;
  padding: 8px;
  border-radius: 24px;
  background: rgba(255, 251, 245, 0.94);
  border: 1px solid var(--line);
  box-shadow: 0 16px 44px rgba(93, 62, 34, 0.18);
  backdrop-filter: blur(18px);
  z-index: 8;
}

.bottom-nav-item {
  display: grid;
  place-items: center;
  gap: 3px;
  min-width: 0;
  min-height: 54px;
  border: 0;
  border-radius: 18px;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
}

.bottom-nav-item svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.bottom-nav-item small {
  font-size: 11px;
  line-height: 1;
}

.bottom-nav-item.is-active {
  background: #fff0e0;
  color: var(--accent-deep);
}

.map-preview {
  position: relative;
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.map-frame {
  position: relative;
  margin-top: 14px;
}

.map-canvas {
  height: 420px;
  border-radius: 24px;
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: 0 18px 42px rgba(93, 62, 34, 0.08);
  transition: height 0.2s ease, margin 0.2s ease, border-radius 0.2s ease;
}

.map-canvas.hidden {
  display: none;
}

.map-frame.is-expanded {
  margin-left: -16px;
  margin-right: -16px;
}

.map-frame.is-expanded .map-canvas {
  height: 68vh;
  min-height: 520px;
  border-radius: 0;
}

.map-expand-button {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 14px;
  background: rgba(255, 251, 245, 0.94);
  color: var(--accent-deep);
  box-shadow: 0 10px 24px rgba(93, 62, 34, 0.16);
}

.map-expand-button svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.map-poi-card {
  display: grid;
  gap: 4px;
  width: 100%;
  padding: 14px;
  border: 0;
  border-radius: 18px;
  background: rgba(255, 253, 248, 0.94);
  color: var(--text);
  text-align: left;
  box-shadow: 0 12px 26px rgba(47, 111, 78, 0.12);
}

.map-pin {
  justify-self: start;
  padding: 8px 10px;
  border-radius: 999px;
  background: #2f6f4e;
  color: #fff;
  font-size: 12px;
  font-weight: 900;
}

.map-poi-card small {
  color: var(--muted);
}

.naver-pay-marker {
  position: relative;
  display: grid;
  place-items: center;
  min-width: 86px;
  padding: 9px 13px;
  border-radius: 999px;
  background: #2f6f4e;
  color: #fff;
  border: 2px solid #fffaf2;
  box-shadow: 0 12px 24px rgba(31, 79, 59, 0.28);
  font-size: 12px;
  font-weight: 900;
}

.map-canvas .zoomControl,
.map-canvas .map_zoomcontrol,
.map-canvas [class*="zoomControl"],
.map-canvas [class*="zoom_control"] {
  display: none !important;
}

.naver-pay-marker span {
  position: absolute;
  left: 50%;
  bottom: -8px;
  width: 14px;
  height: 14px;
  background: #2f6f4e;
  border-right: 2px solid #fffaf2;
  border-bottom: 2px solid #fffaf2;
  transform: translateX(-50%) rotate(45deg);
}

.address-field {
  position: relative;
}

.address-results {
  position: absolute;
  top: calc(100% - 2px);
  left: 0;
  right: 0;
  z-index: 5;
  display: grid;
  gap: 6px;
  max-height: 260px;
  padding: 8px;
  overflow: auto;
  border-radius: 16px;
  background: #fffdf8;
  border: 1px solid var(--line);
  box-shadow: 0 18px 40px rgba(93, 62, 34, 0.16);
}

.address-results.hidden {
  display: none;
}

.address-results button {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 0;
  border-radius: 12px;
  background: #fbf6ee;
  color: var(--text);
  text-align: left;
}

.address-results small, .address-results p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.preset-builder {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fffaf2;
}

.preset-builder-head,
.preset-editor-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.preset-builder-head div {
  display: grid;
  gap: 3px;
}

.preset-builder-head small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

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

.preset-editor {
  display: grid;
  gap: 12px;
  padding: 12px;
  border: 1px solid rgba(119, 92, 65, 0.18);
  border-radius: 14px;
  background: #fffdf8;
}

.preset-editor-head strong {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: #2f6f4e;
  color: #fffdf8;
  font-size: 14px;
}

.ghost-button.danger {
  color: #a1442f;
}

.grouped-job-button {
  display: grid;
  gap: 6px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fbf6ee;
  color: var(--text);
  text-align: left;
}

.grouped-job-button span {
  color: var(--muted);
  font-size: 13px;
}

.sheet {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: end center;
  z-index: 10;
}

.sheet.hidden { display: none; }

.sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(45, 32, 22, 0.48);
  z-index: 0;
}

.sheet-panel {
  position: relative;
  width: min(100%, 430px);
  max-height: 88vh;
  border-radius: 28px 28px 0 0;
  overflow: auto;
  z-index: 1;
}

.sheet-header {
  position: sticky;
  top: 0;
  padding: 18px 16px;
  background: rgba(255, 251, 245, 0.95);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
}

.sheet-body { padding: 18px 16px 24px; }

.form-feedback {
  display: none;
  margin: 14px 16px 0;
  padding: 12px 14px;
  border-radius: 16px;
  background: #fff0e8;
  border: 1px solid rgba(216, 106, 42, 0.24);
  color: var(--accent-deep);
  font-size: 13px;
  line-height: 1.45;
}

.form-feedback.is-visible { display: block; }

.submit-meta {
  grid-column: 1 / -1;
  display: grid;
  gap: 10px;
}

.submit-hint {
  min-height: 20px;
  font-size: 13px;
  color: var(--accent-deep);
}

.detail-list { margin-top: 16px; }

.detail-item {
  padding: 14px;
  border-radius: 18px;
  background: #fbf6ee;
}

.detail-item strong, label {
  display: grid;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
}

input, select, textarea {
  width: 100%;
  border: 1px solid rgba(77, 52, 32, 0.12);
  border-radius: 16px;
  background: #fffdf8;
  padding: 14px;
  color: var(--text);
}

select:disabled {
  color: #8b7968;
  -webkit-text-fill-color: #8b7968;
  opacity: 1;
  background: #f2ede5;
}

textarea { resize: vertical; }
.full { grid-column: 1 / -1; }

.region-help {
  margin: -4px 0 4px;
  color: #b34d32;
  font-size: 13px;
  line-height: 1.5;
}

.empty-state {
  padding: 28px 18px;
  border-radius: 24px;
  text-align: center;
  background: rgba(255, 251, 245, 0.75);
  border: 1px dashed rgba(77, 52, 32, 0.18);
}

.empty-state h3 { margin: 0 0 6px; }
.phone-value.is-masked { letter-spacing: 0.08em; }
button:hover { transform: translateY(-1px); }

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

@media (max-width: 480px) {
  .app-shell {
    width: 100%;
    box-shadow: none;
  }
}
