:root {
  --paper: #ffffff;
  --surface: #f6f6f3;
  --surface-strong: #ecece7;
  --ink: #282727;
  --muted: #73706d;
  --line: #deded8;
  --wine: #713542;
  --wine-deep: #552631;
  --gold: #9b8356;
  --green: #4d6256;
  --danger: #9d3d42;
  --shadow: 0 18px 50px rgba(43, 39, 36, .11);
  --sans: "Pretendard", "Noto Sans KR", "Apple SD Gothic Neo", Arial, sans-serif;
  --serif: "Noto Serif KR", "Nanum Myeongjo", "Batang", Georgia, serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { color-scheme: light; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--surface);
  font-family: var(--sans);
  line-height: 1.55;
  letter-spacing: 0;
}
button, input, select, textarea { color: inherit; font: inherit; letter-spacing: 0; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin: 0; }

.login-view {
  min-height: 100svh;
  display: grid;
  grid-template-columns: minmax(280px, .72fr) minmax(420px, 1.28fr);
  background: var(--paper);
}
.login-brand {
  display: grid;
  place-content: center;
  gap: 22px;
  color: #fff;
  background: var(--wine-deep);
  text-align: center;
}
.login-brand span {
  width: 74px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  margin: auto;
  border: 1px solid rgba(255, 255, 255, .58);
  font-family: Georgia, serif;
  font-size: 27px;
}
.login-brand strong { font-family: Georgia, serif; font-size: 20px; font-weight: 500; }
.login-panel {
  width: min(420px, calc(100% - 48px));
  align-self: center;
  margin: 0 auto;
}
.eyebrow {
  color: var(--gold);
  font-family: Georgia, serif;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}
.login-panel h1 { margin: 12px 0 42px; font-family: var(--serif); font-size: 34px; font-weight: 500; }
.login-panel label { display: block; margin-bottom: 9px; font-size: 12px; font-weight: 700; }
.login-panel input {
  width: 100%;
  height: 50px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
  outline: none;
}
.login-panel input:focus { border-color: var(--wine); box-shadow: 0 0 0 3px rgba(113, 53, 66, .1); }
.login-panel button {
  width: 100%;
  height: 50px;
  margin-top: 14px;
  color: #fff;
  border: 0;
  border-radius: 4px;
  background: var(--wine);
  font-weight: 800;
}
.login-panel button:hover { background: var(--wine-deep); }
.login-status { min-height: 24px; margin-top: 12px; color: var(--danger); font-size: 12px; }

.admin-header {
  position: sticky;
  z-index: 20;
  top: 0;
  min-height: 68px;
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 24px;
  padding: 0 32px;
  background: rgba(255, 255, 255, .97);
  border-bottom: 1px solid var(--line);
}
.admin-brand { display: flex; align-items: center; gap: 12px; }
.admin-brand > span {
  width: 36px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  color: var(--wine);
  border: 1px solid rgba(113, 53, 66, .5);
  font-family: Georgia, serif;
  font-size: 14px;
}
.admin-brand strong { display: block; font-family: Georgia, serif; font-size: 15px; font-weight: 500; }
.admin-brand small { display: block; margin-top: 3px; color: var(--muted); font-size: 9px; text-transform: uppercase; }
.header-actions { display: flex; align-items: center; gap: 10px; }
.save-state { margin-right: 6px; color: var(--green); font-size: 11px; font-weight: 800; }
.secondary-button, .plain-button, .primary-button {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 15px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 800;
}
.secondary-button { border: 1px solid var(--line); background: #fff; }
.plain-button { border: 0; background: transparent; }
.primary-button { min-height: 42px; color: #fff; border: 1px solid var(--wine); background: var(--wine); }
.secondary-button:hover, .plain-button:hover { background: var(--surface); }
.primary-button:hover { background: var(--wine-deep); }
.primary-button:disabled, .secondary-button:disabled { cursor: wait; opacity: .55; }

.admin-main { width: min(1480px, 100%); margin: 0 auto; padding: 42px 32px 80px; }
.page-heading { display: flex; align-items: end; justify-content: space-between; gap: 30px; }
.page-heading h1 { margin-top: 7px; font-family: var(--serif); font-size: 32px; font-weight: 500; }
.admin-tabs { display: flex; gap: 28px; margin-top: 36px; border-bottom: 1px solid var(--line); }
.admin-tab {
  position: relative;
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0;
  border: 0;
  background: transparent;
  font-size: 14px;
  font-weight: 800;
}
.admin-tab::after { content: ""; position: absolute; inset: auto 0 -1px; height: 2px; background: transparent; }
.admin-tab.is-active { color: var(--wine); }
.admin-tab.is-active::after { background: var(--wine); }
.admin-tab span { min-width: 20px; height: 20px; display: grid; place-items: center; padding: 0 5px; color: #fff; border-radius: 10px; background: var(--wine); font-size: 10px; }
.admin-panel { padding-top: 28px; }
.content-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 30px; align-items: start; }

.settings-column { position: sticky; top: 94px; display: grid; gap: 18px; }
.settings-section, .storage-note {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 6px;
}
.settings-section { padding: 21px 20px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.section-heading h2 { font-size: 14px; }
.section-heading span { color: var(--muted); font-family: Georgia, serif; font-size: 8px; }
.switch-list label {
  min-height: 43px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid #eeeeea;
  font-size: 12px;
  cursor: pointer;
}
.switch-list label:last-child { border-bottom: 0; }
.switch-list input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.switch-list i {
  position: relative;
  width: 34px;
  height: 19px;
  flex: none;
  border-radius: 10px;
  background: #cccac4;
  transition: background .2s ease;
}
.switch-list i::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .2);
  transition: transform .2s ease;
}
.switch-list input:checked + i { background: var(--green); }
.switch-list input:checked + i::after { transform: translateX(15px); }
.switch-list input:focus-visible + i { outline: 2px solid var(--wine); outline-offset: 2px; }
.storage-note { padding: 22px; color: #fff; background: var(--green); border-color: var(--green); }
.storage-note span { font-family: Georgia, serif; font-size: 25px; }
.storage-note p { margin-top: 2px; color: rgba(255, 255, 255, .74); font-size: 10px; }

.media-column { min-width: 0; }
.media-heading, .inquiry-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 20px; }
.media-heading h2, .inquiry-heading h2 { font-family: var(--serif); font-size: 23px; font-weight: 500; }
.media-heading p, .inquiry-heading p { margin-top: 4px; color: var(--muted); font-size: 11px; }
.filter-tabs { display: flex; min-width: 0; border: 1px solid var(--line); border-radius: 4px; background: #fff; overflow-x: auto; }
.filter-tabs button { min-height: 36px; padding: 0 13px; border: 0; border-right: 1px solid var(--line); background: transparent; font-size: 10px; font-weight: 800; white-space: nowrap; }
.filter-tabs button:last-child { border-right: 0; }
.filter-tabs button.is-active { color: #fff; background: var(--wine); }
.slot-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.slot-card { min-width: 0; overflow: hidden; background: var(--paper); border: 1px solid var(--line); border-radius: 6px; }
.slot-preview {
  position: relative;
  aspect-ratio: 4 / 3;
  display: grid;
  place-items: center;
  overflow: hidden;
  color: #8a8781;
  background: var(--surface-strong);
}
.slot-preview::before, .slot-preview::after { content: ""; position: absolute; width: 130%; height: 1px; background: rgba(40, 39, 39, .12); transform: rotate(32deg); }
.slot-preview::after { transform: rotate(-32deg); }
.slot-preview img, .slot-preview video { position: absolute; z-index: 2; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #202020; }
.slot-preview span { position: relative; z-index: 1; padding: 7px 9px; color: #6f6c67; border: 1px solid rgba(40, 39, 39, .18); background: rgba(255, 255, 255, .72); font-size: 9px; }
.slot-status { position: absolute; z-index: 3; top: 10px; right: 10px; padding: 4px 7px; color: #fff; border-radius: 3px; background: rgba(40, 39, 39, .76); font-size: 8px; font-weight: 800; }
.slot-body { padding: 16px; }
.slot-title { display: flex; align-items: start; justify-content: space-between; gap: 14px; }
.slot-title h3 { font-size: 13px; }
.slot-title small { display: block; margin-top: 3px; color: var(--muted); font-family: Georgia, serif; font-size: 9px; }
.ratio-label { color: var(--gold); font-size: 9px; font-weight: 800; white-space: nowrap; }
.alt-field { display: block; margin-top: 14px; color: var(--muted); font-size: 9px; font-weight: 800; }
.alt-field input { width: 100%; height: 36px; margin-top: 5px; padding: 0 10px; border: 1px solid var(--line); border-radius: 3px; background: #fff; outline: none; font-size: 11px; }
.alt-field input:focus { border-color: var(--wine); box-shadow: 0 0 0 2px rgba(113, 53, 66, .09); }
.slot-actions { display: flex; gap: 8px; margin-top: 13px; }
.file-button, .delete-button { min-height: 36px; display: inline-flex; align-items: center; justify-content: center; padding: 0 12px; border-radius: 3px; font-size: 10px; font-weight: 800; }
.file-button { flex: 1; color: #fff; background: var(--wine); cursor: pointer; }
.file-button input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.delete-button { color: var(--danger); border: 1px solid #e6cacc; background: #fff; }
.delete-button:disabled { color: #aaa7a2; border-color: var(--line); cursor: default; }
.slot-card.is-busy { opacity: .58; pointer-events: none; }

.inquiry-list { display: grid; gap: 10px; }
.inquiry-empty { min-height: 280px; display: grid; place-items: center; color: var(--muted); background: #fff; border: 1px solid var(--line); border-radius: 6px; font-size: 13px; }
.inquiry-item {
  display: grid;
  grid-template-columns: 92px minmax(150px, .7fr) minmax(170px, .8fr) minmax(230px, 1.4fr) 130px;
  gap: 18px;
  align-items: center;
  padding: 18px 20px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
}
.inquiry-item time { color: var(--muted); font-family: Georgia, serif; font-size: 10px; }
.inquiry-person strong { display: block; font-size: 13px; }
.inquiry-person a { display: block; margin-top: 3px; color: var(--wine); font-size: 11px; }
.inquiry-meta { color: var(--muted); font-size: 11px; }
.inquiry-meta strong { display: block; color: var(--ink); font-size: 12px; }
.inquiry-message { min-width: 0; color: var(--muted); font-size: 11px; overflow-wrap: anywhere; }
.inquiry-item select { width: 100%; height: 36px; padding: 0 9px; border: 1px solid var(--line); border-radius: 3px; background: #fff; font-size: 11px; }

.toast {
  position: fixed;
  z-index: 50;
  right: 24px;
  bottom: 24px;
  max-width: min(360px, calc(100% - 48px));
  padding: 12px 16px;
  color: #fff;
  border-radius: 4px;
  background: var(--ink);
  box-shadow: var(--shadow);
  font-size: 12px;
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
}
.toast.is-visible { opacity: 1; transform: translateY(0); }
.toast.is-error { background: var(--danger); }

@media (max-width: 1180px) {
  .slot-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .inquiry-item { grid-template-columns: 76px minmax(140px, .7fr) minmax(160px, .8fr) minmax(200px, 1.2fr) 120px; gap: 12px; }
}

@media (max-width: 860px) {
  .admin-header { min-height: 60px; padding-inline: 18px; }
  .admin-brand small, .save-state { display: none; }
  .header-actions .secondary-button { min-width: 38px; padding-inline: 9px; font-size: 0; }
  .header-actions .secondary-button::before { content: "보기"; font-size: 10px; }
  .plain-button { padding-inline: 6px; }
  .admin-main { padding: 28px 18px 72px; }
  .content-layout { grid-template-columns: 1fr; }
  .settings-column { position: static; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .storage-note { grid-column: 1 / -1; }
  .media-heading { align-items: start; flex-direction: column; }
  .filter-tabs { width: 100%; }
  .filter-tabs button { flex: 1; }
  .inquiry-item { grid-template-columns: 84px 1fr 120px; }
  .inquiry-meta, .inquiry-message { grid-column: 2 / -1; }
}

@media (max-width: 580px) {
  .login-view { grid-template-columns: 1fr; }
  .login-brand { min-height: 180px; padding: 30px; }
  .login-brand span { width: 54px; font-size: 20px; }
  .login-panel { align-self: start; padding-block: 46px; }
  .login-panel h1 { margin-bottom: 30px; font-size: 28px; }
  .admin-brand > div { display: none; }
  .admin-header { gap: 10px; }
  .header-actions { gap: 3px; }
  .page-heading { align-items: start; }
  .page-heading h1 { font-size: 26px; }
  .primary-button { min-height: 38px; padding-inline: 11px; font-size: 10px; }
  .admin-tabs { margin-top: 24px; }
  .content-layout { gap: 22px; }
  .settings-column { grid-template-columns: 1fr; }
  .storage-note { grid-column: auto; }
  .slot-grid { grid-template-columns: 1fr; }
  .filter-tabs button { flex: none; }
  .inquiry-heading { align-items: start; }
  .inquiry-item { grid-template-columns: 1fr 112px; padding: 16px; }
  .inquiry-item time { grid-column: 1 / -1; }
  .inquiry-meta, .inquiry-message { grid-column: 1 / -1; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
