:root {
  --bg: #f4efe7;
  --bg-accent: radial-gradient(circle at top left, rgba(228, 136, 57, 0.22), transparent 34%), radial-gradient(circle at top right, rgba(20, 76, 92, 0.2), transparent 30%), linear-gradient(180deg, #f7f1e8 0%, #efe5d9 100%);
  --surface: rgba(255, 252, 247, 0.88);
  --surface-strong: #fffdf9;
  --ink: #1f2931;
  --muted: #64707b;
  --line: rgba(31, 41, 49, 0.1);
  --brand: #144c5c;
  --brand-strong: #0d3641;
  --accent: #e48839;
  --accent-soft: #f7dbc2;
  --danger: #9b3b35;
  --success: #2f6b4f;
  --shadow: 0 20px 50px rgba(31, 41, 49, 0.08);
  --radius: 24px;
  --radius-sm: 16px;
}

* {
  box-sizing: border-box;
}

html {
  font-family: "IBM Plex Sans KR", "Pretendard", sans-serif;
  color: var(--ink);
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg-accent);
}

a {
  color: inherit;
}

img {
  display: block;
  max-width: 100%;
}

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

form {
  margin: 0;
}

.app-shell {
  max-width: 1480px;
  margin: 0 auto;
  padding: 24px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 24px;
}

.topbar-copy {
  margin: 8px 0 0;
  color: var(--muted);
}

.topbar-actions,
.toolbar,
.form-actions,
.project-card-footer,
.board-card-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

.brand {
  text-decoration: none;
  font-size: 1.5rem;
  font-weight: 700;
}

.page-shell {
  display: grid;
  gap: 24px;
}

.page-shell-auth {
  min-height: calc(100vh - 48px);
  place-items: center;
}

.panel {
  background: var(--surface);
  backdrop-filter: blur(14px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
}

.auth-card {
  width: min(980px, 100%);
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 24px;
  align-items: stretch;
}

.auth-copy {
  padding: 32px;
}

.auth-copy h1,
.section-heading h1 {
  margin: 10px 0 12px;
  font-size: clamp(2rem, 4vw, 3.3rem);
  line-height: 1;
}

.auth-panel {
  align-self: stretch;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.76rem;
  color: var(--brand);
  font-weight: 700;
}

.eyebrow::before {
  content: "";
  width: 28px;
  height: 1px;
  background: currentColor;
}

.auth-meta {
  margin: 24px 0 0;
  padding-left: 18px;
  color: var(--muted);
  display: grid;
  gap: 8px;
}

.flash {
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
}

.flash-notice {
  background: rgba(47, 107, 79, 0.12);
  border-color: rgba(47, 107, 79, 0.18);
}

.flash-alert {
  background: rgba(155, 59, 53, 0.12);
  border-color: rgba(155, 59, 53, 0.2);
}

.button {
  appearance: none;
  border: 0;
  text-decoration: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 999px;
  padding: 12px 18px;
  font-weight: 700;
  transition: transform 0.18s ease, background 0.18s ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button-primary {
  background: var(--brand);
  color: white;
}

.button-ghost {
  background: rgba(20, 76, 92, 0.08);
  color: var(--brand);
}

.button-outline {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
}

.button-small {
  padding: 8px 12px;
  font-size: 0.92rem;
}

.button-block {
  width: 100%;
}

.field,
.stack {
  display: grid;
  gap: 10px;
}

.stack {
  gap: 18px;
}

.field label {
  font-weight: 700;
}

.field input,
.field textarea,
.field select,
.inline-form input {
  width: 100%;
  border-radius: 16px;
  border: 1px solid var(--line);
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.84);
}

.field textarea {
  resize: vertical;
}

.narrow-panel {
  max-width: 720px;
}

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

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

.project-grid,
.gallery-grid,
.photo-grid {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.project-card,
.gallery-card,
.board-card {
  display: grid;
  gap: 14px;
}

.project-card-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.pill,
.status-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(31, 41, 49, 0.08);
  color: var(--ink);
  font-size: 0.9rem;
}

.status-candidate {
  background: rgba(228, 136, 57, 0.15);
}

.status-discussing {
  background: rgba(20, 76, 92, 0.15);
}

.status-confirmed {
  background: rgba(47, 107, 79, 0.16);
}

.status-completed {
  background: rgba(100, 112, 123, 0.2);
}

.status-on_hold {
  background: rgba(155, 59, 53, 0.14);
}

.board-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.segmented {
  display: inline-flex;
  padding: 6px;
  background: rgba(20, 76, 92, 0.08);
  border-radius: 999px;
}

.segmented-item {
  text-decoration: none;
  padding: 10px 18px;
  border-radius: 999px;
  color: var(--muted);
}

.segmented-item.is-active {
  background: white;
  color: var(--brand);
  box-shadow: 0 8px 18px rgba(20, 76, 92, 0.12);
}

.kanban-board {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(5, minmax(250px, 1fr));
  align-items: start;
  overflow-x: auto;
  padding-bottom: 8px;
}

.kanban-column {
  min-width: 250px;
  display: grid;
  gap: 12px;
}

.kanban-column-header,
.board-card-topline {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
}

.kanban-column-title-wrap {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.kanban-column-title-wrap h2 {
  margin: 0;
}

.kanban-stack {
  display: grid;
  gap: 12px;
}

.kanban-placeholder {
  color: var(--muted);
  padding: 20px;
  text-align: center;
  border: 1px dashed var(--line);
  border-radius: var(--radius-sm);
}

.board-card.is-completed,
.gallery-card.is-completed,
.checklist-item.is-completed,
.sub-item-row.is-completed {
  opacity: 0.58;
}

.board-card {
  cursor: grab;
  min-width: 0;
  overflow: hidden;
}

.board-card.is-dragging {
  opacity: 0.45;
  transform: rotate(1deg);
}

.board-card.is-updating {
  pointer-events: none;
  opacity: 0.5;
}

.kanban-column.is-drop-target {
  border-radius: 24px;
  box-shadow: 0 0 0 3px rgba(20, 76, 92, 0.18);
  background: rgba(20, 76, 92, 0.05);
}

.meta-grid,
.detail-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 0;
}

.meta-grid dt,
.detail-list dt {
  color: var(--muted);
  font-size: 0.88rem;
}

.meta-grid dd,
.detail-list dd {
  margin: 6px 0 0;
  font-weight: 700;
}

.board-card-copy {
  margin: 0;
  line-height: 1.45;
}

.meta-grid-compact {
  gap: 10px 14px;
}

.meta-grid-compact dd {
  margin-top: 2px;
}

.dday-badge {
  display: inline-flex;
  align-items: center;
  margin-left: 8px;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  vertical-align: middle;
}

.dday-normal {
  background: rgba(20, 76, 92, 0.10);
  color: var(--brand);
}

.dday-soon {
  background: rgba(228, 136, 57, 0.18);
  color: #9a4d0b;
  box-shadow: 0 0 0 1px rgba(228, 136, 57, 0.16) inset;
}

.dday-today {
  background: linear-gradient(135deg, rgba(155, 59, 53, 0.92), rgba(228, 136, 57, 0.92));
  color: white;
  box-shadow: 0 10px 24px rgba(155, 59, 53, 0.18);
}

.dday-past {
  background: rgba(100, 112, 123, 0.15);
  color: var(--muted);
}

.board-card-title,
.gallery-card-body h3 {
  margin: 0;
  line-height: 1.14;
}

.board-card-location {
  margin: -4px 0 0;
}

.board-card-actions {
  margin-top: 2px;
}

.card-photo-frame,
.gallery-card-image,
.photo-thumb {
  overflow: hidden;
  border-radius: 20px;
}

.card-photo-frame {
  position: relative;
  width: 100%;
  max-width: 100%;
  justify-self: stretch;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(20, 76, 92, 0.16), rgba(228, 136, 57, 0.2));
}

.board-card-photo {
  height: 220px;
  min-height: 220px;
  max-height: 220px;
}

.gallery-card-image {
  aspect-ratio: 16 / 10;
  min-height: 260px;
}

.card-frame-media,
.detail-media-preview,
.download-picker-preview,
.selected-photo-image,
.card-photo-frame img,
.card-photo-frame video,
.gallery-card-image img,
.gallery-card-image video,
.photo-thumb img,
.photo-thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  border-radius: inherit;
}

.gallery-placeholder {
  width: 100%;
  height: 100%;
  min-height: 220px;
  display: grid;
  place-items: center;
  color: var(--brand);
  letter-spacing: 0.2em;
  font-weight: 700;
}

.gallery-card-body {
  display: grid;
  gap: 10px;
}

.form-panel {
  display: grid;
  gap: 24px;
}

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

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

.checkbox-row {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
}

.upload-zone {
  border: 1px dashed rgba(20, 76, 92, 0.28);
  border-radius: var(--radius);
  padding: 18px;
  background: rgba(20, 76, 92, 0.04);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.upload-zone.is-dragging {
  background: rgba(228, 136, 57, 0.12);
  border-color: rgba(228, 136, 57, 0.6);
}

.upload-zone:focus,
.upload-zone.is-active {
  outline: none;
  border-color: rgba(20, 76, 92, 0.7);
  box-shadow: 0 0 0 4px rgba(20, 76, 92, 0.12);
}

.upload-zone input[type="file"] {
  max-width: 100%;
}

.upload-zone-copy {
  display: grid;
  gap: 4px;
  flex: 1;
}

.upload-zone-input {
  display: none;
}

.selected-photo-previews {
  display: grid;
  gap: 16px;
}

.selected-photo-previews-header h2 {
  margin: 10px 0 0;
}

.selected-photo-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.selected-photo-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.selected-photo-card {
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface-strong);
  overflow: hidden;
  display: grid;
  gap: 12px;
  padding-bottom: 14px;
  cursor: grab;
  transition: box-shadow 0.18s ease, transform 0.18s ease, opacity 0.18s ease;
}

.selected-photo-card:active {
  cursor: grabbing;
}

.selected-photo-card-existing,
.selected-photo-card-existing:active {
  cursor: default;
}

.selected-photo-card.is-representative {
  box-shadow: 0 0 0 2px rgba(228, 136, 57, 0.6), var(--shadow);
}

.selected-photo-card.is-removed {
  opacity: 0.42;
}

.selected-photo-media {
  position: relative;
  background: rgba(20, 76, 92, 0.08);
}

.selected-photo-image {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.media-kind-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 1;
  border-radius: 999px;
  padding: 8px 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  font-size: 0.74rem;
  background: rgba(20, 76, 92, 0.88);
  color: white;
}

.selected-photo-representative {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 1;
  border: 0;
  border-radius: 999px;
  padding: 8px 12px;
  font-weight: 700;
  background: rgba(31, 41, 49, 0.74);
  color: white;
  cursor: pointer;
}

.selected-photo-representative.is-selected {
  background: var(--accent);
}

.selected-photo-representative:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.selected-photo-meta {
  display: grid;
  gap: 4px;
  padding: 0 14px;
}

.selected-photo-meta span {
  color: var(--muted);
  font-size: 0.92rem;
}

.selected-photo-remove {
  margin: 0 14px;
}

.selected-photo-toggle {
  margin: 0 14px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
}

.photo-thumb {
  display: block;
  position: relative;
  background: rgba(20, 76, 92, 0.08);
}

.photo-thumb-edit {
  position: relative;
}

.photo-remove {
  position: absolute;
  left: 12px;
  bottom: 12px;
  background: rgba(31, 41, 49, 0.74);
  color: white;
  border-radius: 999px;
  padding: 8px 10px;
  display: inline-flex;
  gap: 8px;
  align-items: center;
}

.detail-photo-trigger {
  width: 100%;
  border: 0;
  padding: 0;
  background: transparent;
  cursor: zoom-in;
}

.lightbox-open {
  overflow: hidden;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(15, 21, 24, 0.82);
  display: grid;
  place-items: center;
  padding: 20px;
}

.lightbox[hidden] {
  display: none !important;
}

.lightbox-dialog {
  position: relative;
  width: min(1380px, calc(100vw - 24px));
  min-height: min(90vh, 980px);
  border-radius: 28px;
  background: rgba(255, 252, 247, 0.96);
  box-shadow: var(--shadow);
  padding: 20px 88px 18px;
  display: grid;
  align-items: center;
}

.lightbox-stage {
  display: grid;
  place-items: center;
}

.lightbox-media {
  max-width: 100%;
  max-height: min(84vh, 1200px);
  object-fit: contain;
  border-radius: 20px;
}

.lightbox-stage video {
  width: auto;
  background: #0f1518;
}

.lightbox-close,
.lightbox-nav,
.lightbox-download {
  position: absolute;
  border: 0;
  border-radius: 999px;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  background: rgba(31, 41, 49, 0.82);
  color: white;
  cursor: pointer;
  text-decoration: none;
}

.lightbox-close {
  top: 18px;
  right: 18px;
}

.lightbox-download {
  top: 18px;
  right: 76px;
  font-size: 1.1rem;
}

.lightbox-nav {
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.8rem;
}

.lightbox-nav-prev {
  left: 18px;
}

.lightbox-nav-next {
  right: 18px;
}

.lightbox-footer {
  margin-top: 18px;
  display: flex;
  justify-content: center;
}

.lightbox-footer-spread {
  justify-content: center;
}

.lightbox-footer span {
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(20, 76, 92, 0.08);
  font-weight: 700;
}

.icon-badge {
  width: 26px;
  height: 26px;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  background: rgba(20, 76, 92, 0.14);
  font-size: 0.95rem;
  line-height: 1;
}

.icon-badge-light {
  background: rgba(255, 255, 255, 0.18);
}

.photo-download-launch {
  align-self: center;
}

.download-browser-dialog {
  width: min(1420px, calc(100vw - 24px));
  min-height: min(90vh, 980px);
  align-content: start;
  overflow: auto;
  padding-top: 72px;
}

.download-browser-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 20px;
}

.download-browser-header h2 {
  margin: 10px 0 8px;
}

.download-browser-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.download-picker-card {
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--surface-strong);
  overflow: hidden;
  padding: 0;
  display: grid;
  gap: 14px;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  text-align: left;
}

.download-picker-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.download-picker-image {
  aspect-ratio: 4 / 3;
  position: relative;
  background: rgba(20, 76, 92, 0.08);
}

.download-picker-image img,
.download-picker-image video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.download-picker-meta,
.download-picker-action {
  padding: 0 16px;
}

.download-picker-meta {
  display: grid;
  gap: 4px;
}

.download-picker-meta span {
  color: var(--muted);
  font-size: 0.92rem;
}

.download-picker-action {
  padding-bottom: 16px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--brand);
  font-weight: 700;
}

.detail-grid {
  display: grid;
  gap: 20px;
  grid-template-columns: 1fr 1.15fr;
}

.detail-card {
  display: grid;
  gap: 22px;
}

.memo-box {
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.checklist-panel {
  display: grid;
  gap: 18px;
}

.review-panel {
  display: grid;
  gap: 18px;
}

.inline-form,
.checklist-item-main,
.sub-item-row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.inline-form-wide {
  display: grid;
  grid-template-columns: 1.2fr 1fr auto;
}

.inline-form-grow {
  flex: 1;
}

.inline-form-grow input,
.inline-form input {
  flex: 1;
}

.checklist-stack,
.sub-item-block,
.review-stack {
  display: grid;
  gap: 14px;
}

.checklist-item {
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 16px;
  background: var(--surface-strong);
  display: grid;
  gap: 14px;
}

.checklist-content {
  flex: 1;
}

.review-form {
  display: grid;
  gap: 16px;
}

.review-form-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(0, 1.15fr) minmax(200px, 260px);
}

.review-form-content {
  grid-column: 1 / -1;
}

.review-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.review-comment {
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 18px;
  background: var(--surface-strong);
  display: grid;
  gap: 14px;
}

.review-comment-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.review-comment-meta {
  display: grid;
  gap: 4px;
}

.review-comment-date {
  color: var(--muted);
  font-size: 0.92rem;
}

.review-comment-body {
  padding: 16px 18px;
  border-radius: 18px;
  background: rgba(20, 76, 92, 0.06);
  line-height: 1.65;
}

.review-comment-body p {
  margin: 0;
}

.review-comment-body p + p {
  margin-top: 12px;
}

.review-disclosure {
  display: grid;
  gap: 12px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.review-disclosure summary {
  list-style: none;
  width: fit-content;
}

.review-disclosure summary::-webkit-details-marker {
  display: none;
}

.sub-item-block {
  padding-left: 18px;
}

.empty-state {
  text-align: center;
  place-items: center;
}

.inline-message {
  border-radius: 16px;
  padding: 14px 16px;
}

.inline-message-warning {
  background: rgba(228, 136, 57, 0.16);
}

@media (max-width: 1100px) {
  .auth-card,
  .detail-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 860px) {
  .app-shell {
    padding: 16px;
  }

  .topbar,
  .section-heading,
  .section-heading-spread,
  .board-controls,
  .upload-zone {
    flex-direction: column;
    align-items: stretch;
  }

  .form-grid,
  .inline-form-wide,
  .meta-grid,
  .detail-list,
  .review-form-grid {
    grid-template-columns: 1fr;
  }

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

  .kanban-board {
    grid-template-columns: repeat(5, minmax(280px, 1fr));
  }

  .lightbox {
    padding: 12px;
  }

  .lightbox-dialog {
    min-height: min(86vh, 760px);
    padding: 70px 18px 18px;
  }

  .lightbox-nav {
    width: 42px;
    height: 42px;
    top: auto;
    bottom: 18px;
    transform: none;
  }

  .lightbox-download {
    top: 16px;
    right: 68px;
    width: 42px;
    height: 42px;
  }

  .lightbox-nav-prev {
    left: 18px;
  }

  .lightbox-nav-next {
    right: 18px;
  }

  .download-browser-header {
    flex-direction: column;
  }
}
