:root {
  color-scheme: dark;
  --bg: #0b0b0c;
  --panel: #141416;
  --line: #2c2c30;
  --muted: #929297;
  --white: #f4f4f5;
  --accent: #d1ec92;
  font-family: "Noto Sans KR", sans-serif;
  font-size: 16px;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--white);
}
[hidden] {
  display: none !important;
}
button,
input,
select {
  font: inherit;
}
button,
a,
input,
select {
  outline-offset: 4px;
}
button,
a {
  touch-action: manipulation;
}
button {
  cursor: pointer;
}
button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
a {
  color: inherit;
  text-decoration: none;
}
button {
  border: 1px solid transparent;
  border-radius: 6px;
  min-height: 42px;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 500;
  background: transparent;
  color: inherit;
}
button:hover:not(:disabled) {
  filter: brightness(1.12);
}
.primary {
  background: var(--accent);
  color: #171b10;
  font-weight: 700;
}
.secondary {
  border-color: #48484d;
  background: #222225;
}
.quiet {
  color: #bcbcc2;
}
.quiet:hover {
  color: white;
  background: #222;
}
.admin-header {
  min-height: 96px;
  padding: 24px 5vw;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.brand {
  font-size: 22px;
  letter-spacing: 0.07em;
  font-weight: 700;
  line-height: 1.2;
}
.brand span {
  display: block;
  font-size: 10px;
  letter-spacing: 0.16em;
  color: var(--muted);
  margin-top: 8px;
}
.header-actions {
  display: flex;
  align-items: center;
  gap: 24px;
  font-size: 14px;
}
main {
  max-width: 1520px;
  padding: 0 5vw;
  margin: auto;
}
.eyebrow {
  font-size: 12px;
  letter-spacing: 0.16em;
  color: var(--accent);
  font-weight: 500;
  margin: 0 0 14px;
}
h1 {
  font-size: 40px;
  letter-spacing: -0.045em;
  margin: 0 0 14px;
  line-height: 1.25;
}
h2 {
  font-size: 24px;
  letter-spacing: -0.035em;
  margin: 0;
}
p {
  line-height: 1.7;
}
.muted {
  color: var(--muted);
}
.small {
  font-size: 13px;
}
.page-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  padding: 58px 0 38px;
}
.page-title .muted {
  margin: 0;
  font-size: 15px;
}
.page-title .primary {
  padding: 14px 22px;
}
.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--line);
  gap: 20px;
  padding-bottom: 16px;
}
.tabs {
  display: flex;
  gap: 24px;
}
.tabs button {
  padding: 12px 0;
  border-radius: 0;
  color: #9b9ba0;
  font-size: 17px;
}
.tabs button[aria-selected="true"] {
  color: white;
}
.tabs span {
  font-size: 13px;
  color: var(--accent);
  margin-left: 6px;
}
.save-status {
  font-size: 13px;
  color: var(--muted);
  text-align: right;
  min-height: 22px;
  margin: 10px 0;
}
.save-status.dirty {
  color: var(--accent);
}
.reorder-hint {
  font-size: 14px;
  color: var(--muted);
  margin: 16px 0 24px;
}
.project-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 26px 22px;
}
.project-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  overflow: hidden;
  transition: border-color 0.15s;
}
.project-card:hover {
  border-color: #606066;
}
.project-card.dragging {
  opacity: 0.4;
}
.project-card.drop-target {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}
.card-image {
  position: relative;
  aspect-ratio: 16/9;
  background: #202023;
  overflow: hidden;
  cursor: grab;
}
.card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}
.position-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: #000b;
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 12px;
  letter-spacing: 0.04em;
}
.drag-mark {
  position: absolute;
  right: 12px;
  top: 12px;
  background: #000b;
  padding: 2px 8px;
  border-radius: 4px;
  color: #fff;
}
.card-info {
  padding: 18px;
}
.card-category {
  color: var(--accent);
  font-size: 12px;
  margin: 0 0 8px;
}
.card-title {
  font-size: 16px;
  font-weight: 500;
  margin: 0;
  line-height: 1.5;
  min-height: 48px;
  overflow-wrap: anywhere;
}
.card-client {
  font-size: 13px;
  color: var(--muted);
  margin: 8px 0 18px;
  min-height: 22px;
}
.card-bottom {
  border-top: 1px solid var(--line);
  padding-top: 12px;
  display: flex;
  justify-content: space-between;
  gap: 8px;
}
.move-buttons {
  display: flex;
  gap: 2px;
}
.move-buttons button {
  padding: 4px 10px;
  font-size: 18px;
  min-height: 36px;
}
.edit-button {
  padding: 4px 12px;
  min-height: 36px;
  border: 1px solid #424247;
  font-size: 13px;
}
.category-intro {
  margin: 32px 0 24px;
}
.category-intro p {
  font-size: 15px;
}
.category-add {
  display: flex;
  gap: 12px;
  max-width: 740px;
  margin-bottom: 30px;
}
.category-row {
  display: grid;
  grid-template-columns: minmax(100px, 1fr) 100px 90px;
  align-items: center;
  gap: 16px;
  max-width: 740px;
  border-bottom: 1px solid var(--line);
  padding: 16px 0;
}
.category-row span {
  font-size: 14px;
  color: var(--muted);
  text-align: center;
}
input,
select {
  width: 100%;
  min-height: 48px;
  background: #111113;
  border: 1px solid #3b3b40;
  color: var(--white);
  border-radius: 5px;
  padding: 11px 13px;
  font-size: 16px;
}
input:focus,
select:focus {
  border-color: var(--accent);
  outline: 1px solid var(--accent);
}
label {
  display: block;
  font-size: 14px;
  margin-bottom: 9px;
  color: #ddd;
}
label span {
  color: var(--accent);
}
.login-card {
  max-width: 440px;
  margin: 100px auto 120px;
  padding: 36px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
}
.login-card h1 {
  font-size: 29px;
}
.login-card form {
  margin-top: 28px;
}
.login-card .primary {
  width: 100%;
  margin-top: 20px;
}
.message {
  font-size: 14px;
  min-height: 24px;
}
.error {
  color: #ffb1ab !important;
}
.preview-banner {
  margin-top: 24px;
  padding: 12px 18px;
  border: 1px solid #596b35;
  color: #dbecbb;
  border-radius: 6px;
  font-size: 14px;
  background: #202719;
}
.admin-footer {
  padding: 60px 5vw 30px;
  color: #68686f;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-align: center;
}
dialog {
  width: min(980px, calc(100% - 32px));
  max-height: 90dvh;
  border: 1px solid #44444b;
  border-radius: 12px;
  background: #171719;
  color: white;
  padding: 0;
  overflow: auto;
}
dialog::backdrop {
  background: #000b;
  backdrop-filter: blur(4px);
}
.dialog-header {
  padding: 28px 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--line);
}
.dialog-header .eyebrow {
  margin-bottom: 8px;
}
.icon-button {
  font-size: 28px;
  width: 44px;
  padding: 0;
}
.editor-layout {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 32px;
  padding: 32px;
}
.thumbnail-preview {
  aspect-ratio: 16/9;
  background: #242427;
  border: 1px dashed #4a4a50;
  border-radius: 6px;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}
.thumbnail-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.thumbnail-preview span {
  font-size: 13px;
  letter-spacing: 0.12em;
  color: #73737b;
}
.file-button {
  position: relative;
  border: 1px solid #505058;
  padding: 12px;
  text-align: center;
  border-radius: 6px;
  cursor: pointer;
  margin: 18px 0 8px;
}
.file-button input {
  position: absolute;
  inset: 0;
  opacity: 0;
  width: 100%;
  cursor: pointer;
}
.file-button:focus-within {
  outline: 2px solid var(--accent);
}
.thumbnail-column .quiet {
  width: 100%;
  font-size: 13px;
}
.fields {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.field-hint {
  font-size: 12px;
  color: var(--muted);
  margin: 8px 0 0;
}
.notice {
  font-size: 14px;
  color: #d9deca;
  background: #272b21;
  padding: 14px;
  border-radius: 5px;
  margin: 0;
}
.dialog-footer {
  border-top: 1px solid var(--line);
  padding: 20px 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  background: #171719;
  position: sticky;
  bottom: 0;
}
.dialog-footer p {
  font-size: 13px;
  margin: 0;
  flex: 1;
}
.dialog-footer > div {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}
fieldset {
  border: 0;
  margin: 0;
  padding: 0;
  min-width: 0;
}
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent);
  color: #151a0d;
  padding: 14px 24px;
  border-radius: 8px;
  box-shadow: 0 12px 50px #0008;
  font-size: 14px;
  z-index: 20;
  max-width: 90vw;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}
@media (min-width: 1500px) {
  .project-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
@media (max-width: 1000px) {
  .project-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .editor-layout {
    gap: 24px;
    padding: 24px;
  }
  .header-actions {
    gap: 12px;
  }
}
@media (max-width: 640px) {
  .admin-header {
    min-height: 80px;
    padding: 20px;
  }
  .brand {
    font-size: 19px;
  }
  .brand span {
    font-size: 9px;
  }
  .header-actions {
    gap: 4px;
    font-size: 12px;
  }
  .header-actions button {
    font-size: 12px;
    padding: 8px;
  }
  main {
    padding: 0 20px;
  }
  .page-title {
    padding: 36px 0 26px;
    align-items: flex-start;
    flex-direction: column;
    gap: 20px;
  }
  h1 {
    font-size: 34px;
  }
  .eyebrow {
    font-size: 11px;
  }
  .page-title .primary {
    width: 100%;
  }
  .project-grid {
    grid-template-columns: 1fr;
    gap: 18px;
  }
  .toolbar {
    gap: 12px;
  }
  .toolbar .secondary {
    font-size: 12px;
    padding: 10px;
  }
  .tabs {
    gap: 18px;
  }
  .tabs button {
    font-size: 15px;
  }
  .category-row {
    grid-template-columns: minmax(100px, 1fr) 60px 60px;
    gap: 8px;
  }
  .category-row button {
    padding: 8px;
  }
  .category-add {
    gap: 8px;
  }
  .category-add button {
    white-space: nowrap;
  }
  .login-card {
    margin: 56px auto;
    padding: 26px;
  }
  .editor-layout {
    grid-template-columns: 1fr;
    padding: 20px;
  }
  .dialog-header {
    padding: 22px 20px;
  }
  .dialog-footer {
    padding: 16px 20px;
    flex-wrap: wrap;
  }
  .dialog-footer p {
    flex-basis: 100%;
  }
  .dialog-footer > div {
    width: 100%;
    justify-content: flex-end;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}

.danger {color: #ffaca6; border: 1px solid #79413d; background: #301c1c; border-radius: 5px; padding: 10px 14px; cursor: pointer; white-space: nowrap;}
.selection-toolbar {display:flex; align-items:center; flex-wrap:wrap; gap:16px; margin:20px 0;}
.selection-toolbar label, .item-selection {display:inline-flex; align-items:center; gap:8px; cursor:pointer;}
.selection-toolbar input[type=checkbox], .item-selection input[type=checkbox] {width:18px; height:18px; min-height:18px; padding:0; accent-color:var(--white);}
.item-selection {font-size:13px; margin-bottom:10px;}
.category-row {grid-template-columns:minmax(100px,1fr) 64px 48px 65px 65px; gap:10px; max-width:900px;}
.category-row .item-selection {margin:0;}
.delete-content {padding:28px; max-width:620px;}
#deleteNames {max-height:180px; overflow:auto; padding-left:24px; line-height:1.7;}
.delete-actions {display:flex; gap:12px; justify-content:flex-end; margin-top:24px;}
#deleteWarning {line-height:1.6;}
#undoDelete {margin:12px 0;}
@media(max-width:600px) { .category-row {grid-template-columns: minmax(0,1fr) 60px 55px; } .category-row > input {grid-column:1 / -1;} .category-row .item-selection {grid-row:2;} .category-row > span {grid-row:2;grid-column:2;} .category-row > .secondary {grid-row:3;grid-column:2;} .category-row > .danger {grid-row:3;grid-column:3;} .delete-content {padding:20px;} }
#deleteDialog {width:min(620px,calc(100% - 32px));}
.category-add button {white-space:nowrap;flex-shrink:0;}
