:root {
  --ink: #073f5a;
  --muted: #5a7c8e;
  --cyan: #00bfe9;
  --cyan-dark: #008db5;
  --magenta: #ec39d4;
  --line: rgba(0, 104, 145, 0.15);
  --glass: rgba(255, 255, 255, 0.78);
  font-family: "Outfit", "Noto Sans JP", sans-serif;
  color: var(--ink);
  background: #c8efff;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 12% 5%, rgba(255,255,255,.95), transparent 28rem),
    radial-gradient(circle at 88% 20%, rgba(255,0,240,.15), transparent 24rem),
    linear-gradient(145deg, #dcf7ff 0%, #9fdfff 100%);
}

button, input, textarea, select { font: inherit; }
button, summary, .drop-zone { -webkit-tap-highlight-color: transparent; }

.admin-header {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 34px 0 20px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}

.admin-header h1, .section-heading h2 { margin: 0; font-weight: 900; }
.admin-header h1 { font-size: clamp(28px, 5vw, 44px); letter-spacing: -.04em; }
.admin-header a { color: var(--ink); font-weight: 900; text-decoration: none; border-bottom: 2px solid var(--cyan); }
.eyebrow { margin: 0 0 4px; font-size: 11px; font-weight: 900; letter-spacing: .18em; color: var(--cyan-dark); }

.admin-layout {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto 60px;
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, .75fr);
  gap: 20px;
  align-items: start;
}

.panel {
  border: 1px solid rgba(255,255,255,.85);
  border-radius: 26px;
  background: var(--glass);
  box-shadow: 0 22px 60px rgba(0, 74, 110, .13);
  backdrop-filter: blur(24px);
  padding: 24px;
}

.list-panel { position: sticky; top: 16px; max-height: calc(100vh - 32px); overflow: auto; }
.section-heading { display: flex; justify-content: space-between; gap: 16px; align-items: center; margin-bottom: 20px; }
.section-heading h2 { font-size: 22px; }

label { display: grid; gap: 7px; margin-bottom: 17px; }
label > span { font-size: 12px; font-weight: 900; letter-spacing: .04em; }
input, textarea, select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(255,255,255,.9);
  padding: 12px 13px;
  color: var(--ink);
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
input:focus, textarea:focus, select:focus { border-color: var(--cyan); box-shadow: 0 0 0 4px rgba(0,191,233,.13); }
textarea { resize: vertical; }

.field-grid { display: grid; gap: 14px; }
.two-columns { grid-template-columns: 1fr 1fr; }

.apple-search-box {
  margin-bottom: 20px;
  padding: 16px;
  border: 1px solid rgba(236, 57, 212, .22);
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(255,255,255,.86), rgba(238,226,255,.72));
}
.apple-search-box > div:first-child { display: grid; gap: 3px; margin-bottom: 12px; }
.apple-search-box small { color: var(--muted); }
.apple-search-row { display: grid; grid-template-columns: 1fr auto; gap: 9px; }
.apple-search-row input { margin: 0; }
.apple-search-row .secondary-button { width: auto; min-width: 76px; }
.apple-track-results { display: grid; gap: 7px; max-height: 300px; overflow: auto; }
.apple-track-result {
  width: 100%;
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 10px;
  align-items: center;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255,255,255,.9);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}
.apple-track-result:hover { border-color: var(--magenta); }
.apple-track-result img { width: 48px; height: 48px; border-radius: 8px; object-fit: cover; }
.apple-track-result span { min-width: 0; display: grid; gap: 3px; }
.apple-track-result strong, .apple-track-result small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.apple-track-result small { color: var(--muted); }

.role-fieldset { margin: 0 0 17px; padding: 0; border: 0; }
.role-fieldset legend { margin-bottom: 9px; font-size: 12px; font-weight: 900; letter-spacing: .04em; }
.role-options { display: flex; flex-wrap: wrap; gap: 8px; }
.role-chip { display: block; margin: 0; cursor: pointer; }
.role-chip input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.role-chip span {
  display: block;
  padding: 9px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255,255,255,.86);
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  transition: .18s ease;
}
.role-chip input:checked + span {
  border-color: var(--cyan-dark);
  background: var(--ink);
  color: #fff;
  box-shadow: 0 5px 15px rgba(0, 92, 125, .2);
}
.role-chip.remix-role input:checked + span {
  border-color: transparent;
  background: linear-gradient(135deg, var(--magenta), #7754ff);
}
.role-chip input:focus-visible + span { outline: 3px solid rgba(0,191,233,.28); }

.drop-zone {
  min-height: 240px;
  border: 2px dashed rgba(0, 143, 181, .34);
  border-radius: 20px;
  background: rgba(224, 248, 255, .7);
  display: grid;
  place-items: center;
  overflow: hidden;
  cursor: pointer;
  text-align: center;
  margin-bottom: 20px;
  position: relative;
}
.drop-zone.dragging { border-color: var(--magenta); background: rgba(255,255,255,.95); }
.drop-zone input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.drop-zone img { width: 100%; height: 100%; min-height: 240px; max-height: 420px; object-fit: contain; background: rgba(255,255,255,.55); }
#drop-copy { display: grid; gap: 7px; padding: 28px; }
#drop-copy strong { font-size: 18px; }
#drop-copy small { color: var(--muted); }

.primary-button, .secondary-button, .text-button, .icon-button, .edit-button, .delete-button {
  border: 0;
  cursor: pointer;
  font-weight: 900;
}
.primary-button {
  align-self: end;
  min-height: 47px;
  border-radius: 14px;
  color: white;
  background: linear-gradient(135deg, var(--cyan-dark), var(--cyan));
  box-shadow: 0 10px 25px rgba(0, 151, 190, .24);
}
.primary-button:disabled, .secondary-button:disabled { opacity: .55; cursor: wait; }
.secondary-button { width: 100%; padding: 12px; border-radius: 12px; color: white; background: var(--ink); }
.text-button, .icon-button { color: var(--cyan-dark); background: transparent; }
.icon-button { width: 38px; height: 38px; border-radius: 50%; background: rgba(0,191,233,.12); font-size: 22px; }
.status-message { min-height: 1.4em; margin: 4px 0 0; color: var(--muted); font-size: 13px; font-weight: 700; }
.status-message.error { color: #b51c4f; }
.status-message.success { color: #008369; }

.category-select-field { padding: 12px; border: 2px solid rgba(0, 191, 233, .22); border-radius: 14px; background: rgba(223, 247, 255, .55); }
.category-select-field > span { color: var(--ink); }
.category-select-field small { color: var(--muted); font-size: 10px; font-weight: 700; }
.category-select-field select { border-color: rgba(0, 151, 190, .4); font-weight: 900; }
.archive-filters { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; margin-bottom: 12px; }
.archive-filter { min-width: 0; padding: 9px 5px; border: 1px solid var(--line); border-radius: 11px; color: var(--muted); background: rgba(255,255,255,.62); cursor: pointer; font-size: 11px; font-weight: 900; }
.archive-filter span { display: inline-grid; min-width: 18px; height: 18px; margin-left: 2px; place-items: center; border-radius: 9px; background: rgba(0,0,0,.07); font-size: 9px; }
.archive-filter.is-active { border-color: var(--cyan); color: var(--cyan-dark); background: rgba(0,191,233,.12); box-shadow: inset 0 0 0 1px var(--cyan); }
.work-list { display: grid; gap: 11px; }
.work-item { display: grid; grid-template-columns: 84px 1fr; gap: 12px; padding: 10px; border: 1px solid var(--line); border-radius: 16px; background: rgba(255,255,255,.72); }
.work-item.is-draft { border-color: rgba(221, 151, 0, .56); background: rgba(255, 247, 215, .92); box-shadow: inset 4px 0 0 #e4a400; }
.work-item.is-published { border-color: rgba(0, 151, 133, .28); box-shadow: inset 4px 0 0 #00a991; }
.work-item-image { width: 84px; height: 84px; border-radius: 11px; object-fit: cover; background: #dff5ff; }
.work-item-body { min-width: 0; }
.work-item-topline { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.work-item-meta { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 10px; font-weight: 900; text-transform: uppercase; }
.work-item-category { padding: 3px 7px; border-radius: 999px; }
.work-item-category.release { color: #8a3156; background: #ffd4e5; }
.work-item-category.works { color: #075e91; background: #cfeeff; }
.work-item-status { flex: 0 0 auto; padding: 3px 7px; border-radius: 999px; font-size: 9px; font-weight: 900; }
.work-item-status.draft { color: #775000; background: #ffe49a; }
.work-item-status.published { color: #00695d; background: #baf4e8; }
.work-item-title { display: block; margin: 4px 0 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.work-item-roles { margin: -3px 0 8px; color: var(--magenta); font-size: 10px; font-weight: 900; }
.work-item-actions { display: flex; gap: 8px; }
.edit-button, .delete-button { padding: 5px 9px; border-radius: 8px; font-size: 11px; }
.edit-button { color: var(--cyan-dark); background: rgba(0,191,233,.12); }
.delete-button { color: #b51c4f; background: rgba(255,47,118,.09); }
.empty-list { padding: 36px 12px; text-align: center; color: var(--muted); }

.import-box { margin-top: 20px; border-top: 1px solid var(--line); padding-top: 18px; }
.import-box summary { cursor: pointer; font-size: 13px; font-weight: 900; }
.import-content { padding-top: 15px; }
.import-content p { font-size: 12px; color: var(--muted); }
.check-label { display: flex; align-items: center; gap: 8px; grid-template-columns: auto 1fr; }
.check-label input { width: auto; }

@media (max-width: 780px) {
  .admin-header { padding-top: 24px; }
  .admin-layout { grid-template-columns: 1fr; }
  .list-panel { position: static; max-height: none; }
}

@media (max-width: 500px) {
  .admin-layout, .admin-header { width: min(100% - 20px, 1180px); }
  .panel { padding: 18px; border-radius: 20px; }
  .two-columns { grid-template-columns: 1fr; }
  .publish-row { gap: 0; }
  .drop-zone, .drop-zone img { min-height: 190px; }
  .apple-search-row { grid-template-columns: 1fr; }
  .apple-search-row .secondary-button { width: 100%; }
}
