/* -------------------------------------------------------------------------
   aimusic — base
   디자인 참조 : writer.dothome.co.kr (typing.works)
   ---------------------------------------------------------------------- */
:root {
  --bg: #232323;
  --bg-soft: #2a2a2a;
  --bg-soft-2: #303030;
  --bg-deep: #1c1c1c;
  --fg: #ffffff;
  --fg-soft: #c9c9c9;
  --muted: #888888;
  --dim: #666666;
  --line: rgba(255, 255, 255, 0.16);
  --line-strong: rgba(255, 255, 255, 0.72);
  --orange: #ff5224;
  --pink: #fe7176;
  --green: #7fd39b;
  --ui: 'Poppins', 'Noto Sans KR', 'Noto Sans', sans-serif;
  --text: 'Noto Sans KR', sans-serif;
  --display: 'Noto Sans KR', 'Noto Sans', sans-serif;
  --wrap: 910px;
}

html[data-theme="light"] {
  --bg: #f5f4f0;
  --bg-soft: #ffffff;
  --bg-soft-2: #f0eee9;
  --bg-deep: #eae8e2;
  --fg: #1b1b1b;
  --fg-soft: #3d3d3d;
  --muted: #77736c;
  --dim: #9a958d;
  --line: rgba(27, 27, 27, 0.14);
  --line-strong: rgba(27, 27, 27, 0.7);
  --orange: #e8451b;
  --pink: #d9363e;
  --green: #1f8a4c;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
  color-scheme: dark;
}

html[data-theme="light"] {
  color-scheme: light;
}

body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--fg);
  font: 500 14px/1.5 var(--ui);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

::selection {
  background: rgba(255, 82, 36, 0.35);
  color: var(--fg);
}

a {
  color: inherit;
  text-decoration: none;
}

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

button {
  border: 0;
  padding: 0;
  background: none;
  cursor: pointer;
}

input,
textarea,
select {
  border-radius: 0;
  outline: none;
}

img,
svg {
  display: block;
}

h1, h2, h3, h4, h5, p, ul, ol, figure, blockquote {
  margin: 0;
  padding: 0;
}

ul, ol {
  list-style: none;
}

hr {
  border: 0;
}

:focus-visible {
  outline: 1px solid var(--orange);
  outline-offset: 2px;
}

.app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* -------------------------------------------------------------------------
   typography helpers
   ---------------------------------------------------------------------- */
.eyebrow {
  display: block;
  color: var(--muted);
  font-family: var(--ui);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.16em;
  line-height: 1.4;
  text-transform: uppercase;
}

.display {
  font-family: var(--display);
}

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

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

/* -------------------------------------------------------------------------
   header
   ---------------------------------------------------------------------- */
.site-header {
  flex: 0 0 auto;
  height: 88px;
  position: relative;
  z-index: 30;
  border-bottom: 1px solid var(--line);
}

.header-inner {
  width: min(var(--wrap), calc(100% - 40px));
  height: 100%;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand {
  font-family: var(--ui);
  font-size: 16px;
  font-weight: 300;
  line-height: 1;
  letter-spacing: 0.5px;
  color: var(--fg);
  white-space: nowrap;
}

.brand span {
  font-weight: 700;
  color: var(--orange);
}

.main-nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 26px;
  height: 100%;
}

.nav-link {
  font-family: var(--ui);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--fg);
  position: relative;
  white-space: nowrap;
  opacity: 0.78;
}

.nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  right: 100%;
  bottom: -5px;
  height: 1px;
  background: currentColor;
  transition: right 0.25s ease;
}

.nav-link:hover,
.nav-link.is-active {
  opacity: 1;
}

.nav-link:hover::after,
.nav-link.is-active::after {
  right: 0;
}

/* 로그아웃 : 아이콘 버튼 (아이콘 색 강조) */
.logout-btn {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--orange);
  font-size: 12px;
  line-height: 1;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.logout-btn:hover {
  border-color: var(--orange);
  background: rgba(255, 82, 36, 0.12);
}

.logout-btn:focus-visible {
  outline: 1px solid var(--orange);
  outline-offset: 2px;
}

/* -------------------------------------------------------------------------
   page
   ---------------------------------------------------------------------- */
.page-main {
  flex: 1 0 auto;
  width: min(var(--wrap), calc(100% - 40px));
  margin: 0 auto;
  padding: 58px 0 96px;
}

.page-title {
  font-family: var(--ui);
  font-size: clamp(34px, 4.6vw, 54px);
  font-weight: 600;
  line-height: 1.04;
  letter-spacing: -0.045em;
  margin: 14px 0 16px;
  color: var(--fg);
}

.page-title .thin {
  font-weight: 200;
}

.page-desc {
  max-width: 560px;
  color: var(--muted);
  font-family: var(--text);
  font-size: 13px;
  line-height: 1.9;
  word-break: keep-all;
}

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 30px;
  padding-bottom: 26px;
}

.page-head .page-title {
  font-size: clamp(30px, 3.6vw, 42px);
  margin-bottom: 10px;
}

.page-head-side {
  flex: 0 0 auto;
  text-align: right;
  color: var(--muted);
  font-family: var(--ui);
  font-size: 9px;
  line-height: 1.9;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.page-head-side strong {
  display: block;
  color: var(--fg);
  font-size: 28px;
  font-weight: 500;
  letter-spacing: -0.03em;
}

.section-rule {
  height: 1px;
  background: var(--line-strong);
  margin: 0 0 22px;
  opacity: 0.5;
}

/* -------------------------------------------------------------------------
   composer
   ---------------------------------------------------------------------- */
.composer {
  margin-top: 30px;
  border: 1px solid var(--line);
  background: var(--bg-soft);
  padding: 16px 20px 12px;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.composer:focus-within {
  border-color: rgba(255, 255, 255, 0.42);
}

html[data-theme="light"] .composer:focus-within {
  border-color: rgba(27, 27, 27, 0.4);
}

.composer-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.composer-hint {
  color: var(--dim);
  font-family: var(--ui);
  font-size: 9px;
  letter-spacing: 0.04em;
}

.composer textarea {
  display: block;
  width: 100%;
  min-height: 34px;
  max-height: 320px;
  border: 0;
  background: transparent;
  color: var(--fg);
  font-family: var(--display);
  font-size: 20px;
  font-weight: 400;
  line-height: 1.6;
  resize: none;
  overflow-y: auto;
}

.composer textarea::placeholder {
  color: var(--dim);
}

.composer-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.composer-count {
  color: var(--dim);
  font-family: var(--ui);
  font-size: 9px;
  letter-spacing: 0.06em;
}

.composer-count.is-over {
  color: var(--pink);
}


.accent {
  color: var(--orange);
}

.smaller {
  font-size: 12px;
}

/* -------------------------------------------------------------------------
   buttons
   ---------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 20px;
  border: 1px solid transparent;
  font-family: var(--ui);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.06em;
  line-height: 1;
  text-transform: uppercase;
  white-space: nowrap;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.btn i {
  font-size: 11px;
}

.btn-orange {
  background: var(--orange);
  border-color: var(--orange);
  color: #fff;
}

.btn-orange:hover {
  background: #ff6a42;
  border-color: #ff6a42;
}

.btn-light {
  background: #f4f4f4;
  border-color: #f4f4f4;
  color: #111;
}

.btn-light:hover {
  background: #fff;
  border-color: #fff;
}

.btn-ghost {
  border-color: rgba(255, 255, 255, 0.42);
  color: var(--fg);
}

html[data-theme="light"] .btn-ghost {
  border-color: rgba(27, 27, 27, 0.32);
}

.btn-ghost:hover {
  background: var(--fg);
  color: var(--bg);
  border-color: var(--fg);
}

.btn-sm {
  height: 32px;
  padding: 0 14px;
  font-size: 9px;
}

.btn[disabled] {
  opacity: 0.45;
  pointer-events: none;
}

.icon-btn {
  width: 26px;
  height: 26px;
  display: inline-grid;
  place-items: center;
  border: 1px solid transparent;
  color: var(--muted);
  font-size: 11px;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.icon-btn:hover {
  color: var(--fg);
  border-color: var(--line);
}

.icon-btn.is-starred {
  color: #f5b301;
}

/* -------------------------------------------------------------------------
   result cards
   ---------------------------------------------------------------------- */
.result {
  margin-top: 26px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.card {
  border: 1px solid var(--line);
  background: var(--bg-soft);
  padding: 18px 22px 20px;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.card-tools {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.card-quote {
  font-family: var(--display);
  font-size: 19px;
  font-weight: 400;
  line-height: 1.65;
  color: var(--fg);
  word-break: break-word;
}

.card-quote.is-english {
  font-size: 20px;
}

.card-translation {
  margin-top: 8px;
  color: var(--orange);
  font-family: var(--text);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.7;
}

.card-note {
  margin-top: 8px;
  color: var(--muted);
  font-family: var(--text);
  font-size: 12px;
  line-height: 1.9;
  word-break: keep-all;
}

.card-note:first-child {
  margin-top: 0;
}

.verdict {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  color: var(--fg-soft);
  font-family: var(--text);
  font-size: 13px;
  line-height: 1.8;
}

.verdict i {
  margin-top: 4px;
  font-size: 11px;
}

/* 사용 빈도 (AI 추정) */
.freq {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.freq-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.freq-hint {
  margin-left: 4px;
  color: var(--dim);
  font-size: 8px;
  letter-spacing: 0.04em;
  text-transform: none;
}

.freq-value {
  font-family: var(--ui);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}

.freq-value b {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.freq-value small {
  margin-left: 2px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 400;
}

.freq-bar {
  height: 3px;
  background: var(--line);
  overflow: hidden;
}

.freq-bar span {
  display: block;
  height: 100%;
  transition: width 0.3s ease;
}

/* Natural 바로 아래에 붙을 때는 구분선을 한 번만 */
.natural-row + .freq {
  margin-top: 10px;
  padding-top: 0;
  border-top: 0;
}

/* 오답 표시 (한국어만 입력한 기록) */
.wrong-badge,
.record-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border: 1px solid var(--pink);
  border-radius: 999px;
  color: var(--pink);
  font-family: var(--ui);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.08em;
  line-height: 1.5;
  text-transform: uppercase;
  vertical-align: middle;
}

.score {
  display: inline-flex;
  align-items: baseline;
  gap: 3px;
  color: var(--score-color, var(--fg));
  font-family: var(--ui);
  font-size: 28px;
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1;
}

.score small {
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0;
  color: var(--muted);
}

.issue-list {
  margin-top: 14px;
  border-top: 1px solid var(--line);
}

.issue-list li {
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
  color: var(--fg-soft);
  font-family: var(--text);
  font-size: 12px;
  line-height: 1.85;
}

.issue-list li b {
  color: var(--pink);
  font-weight: 600;
}

.issue-list li ins {
  color: var(--green);
  text-decoration: none;
}

.rule {
  height: 1px;
  background: var(--line);
  margin: 16px 0;
}

.natural-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  color: var(--fg);
  font-family: var(--text);
  font-size: 13px;
  line-height: 1.8;
}

.natural-row .eyebrow {
  flex: 0 0 auto;
  padding-top: 3px;
}

/* 표현 검사 : 오류 없는 전체 문장 */
.fixed-block {
  margin-top: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  background: var(--bg-soft-2);
}

.fixed-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}

.fixed-block .card-quote {
  font-size: 17px;
  line-height: 1.6;
}

/* -------------------------------------------------------------------------
   record list (recent / saved)
   ---------------------------------------------------------------------- */
.record-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.record {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  padding: 14px 16px 12px;
  border: 1px solid var(--line);
  background: var(--bg-soft);
  transition: border-color 0.2s ease, background 0.2s ease;
}

.record:hover {
  border-color: rgba(255, 255, 255, 0.34);
}

html[data-theme="light"] .record:hover {
  border-color: rgba(27, 27, 27, 0.3);
}

.record-title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: var(--fg);
  font-family: var(--text);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.6;
  word-break: break-word;
}

.record-title:hover {
  border-bottom: 1px solid rgba(255, 255, 255, 0.5);
}

.record-wrong {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 0;
  color: var(--dim);
  font-family: var(--text);
  font-size: 11px;
  line-height: 1.6;
  text-decoration: line-through;
  word-break: break-word;
}

.record-foot {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.record-meta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.record-date {
  color: var(--dim);
  font-family: var(--ui);
  font-size: 9px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.record-tools {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

/* 검색 + 페이지 이동 */
.list-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.list-search {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 240px;
  max-width: 360px;
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--line);
  background: var(--bg-soft);
  transition: border-color 0.2s ease;
}

.list-search:focus-within {
  border-color: var(--line-strong);
}

.list-search > i {
  flex: 0 0 auto;
  color: var(--dim);
  font-size: 11px;
}

.list-search input {
  flex: 1 1 auto;
  min-width: 0;
  height: 100%;
  border: 0;
  background: none;
  color: var(--fg);
  font-family: var(--text);
  font-size: 13px;
}

.list-search input::placeholder {
  color: var(--dim);
}

/* 브라우저 기본 지우기 버튼은 숨기고 아래 버튼을 씁니다 */
.list-search input::-webkit-search-cancel-button,
.list-search input::-webkit-search-decoration {
  -webkit-appearance: none;
  appearance: none;
}

.list-search-clear {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  color: var(--dim);
  font-size: 12px;
}

.list-search-clear:hover {
  color: var(--fg);
}

.list-search-clear[hidden] {
  display: none;
}

.list-meta {
  color: var(--dim);
  font-family: var(--ui);
  font-size: 9px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}

.pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin-top: 24px;
}

.pager:empty {
  display: none;
}

.pager-btn {
  min-width: 30px;
  height: 30px;
  padding: 0 8px;
  border: 1px solid transparent;
  color: var(--muted);
  font-family: var(--ui);
  font-size: 10px;
  letter-spacing: 0.06em;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.pager-btn:hover:not(:disabled) {
  color: var(--fg);
  border-color: var(--line);
}

.pager-btn.is-active {
  color: var(--bg);
  background: var(--fg);
  border-color: var(--fg);
}

.pager-btn:disabled {
  opacity: 0.35;
  cursor: default;
}

.pager-btn i {
  font-size: 9px;
}

.pager-btn:focus-visible {
  outline: 1px solid var(--orange);
  outline-offset: 2px;
}

.pager-gap {
  min-width: 18px;
  text-align: center;
  color: var(--dim);
  font-size: 10px;
}

@media (max-width: 560px) {
  .list-toolbar {
    flex-wrap: wrap;
    gap: 8px;
  }

  .list-search {
    max-width: none;
    flex-basis: 100%;
  }

  .list-meta {
    width: 100%;
  }
}

.empty {
  padding: 26px 0;
  color: var(--muted);
  font-family: var(--text);
  font-size: 12px;
  line-height: 1.9;
}

/* -------------------------------------------------------------------------
   auth (login / register)
   ---------------------------------------------------------------------- */
.auth-wrap {
  width: min(420px, calc(100% - 40px));
  margin: 0 auto;
  padding: 80px 0 110px;
}

.auth-head {
  margin-bottom: 26px;
}

.auth-card {
  border: 1px solid var(--line);
  background: var(--bg-soft);
  padding: 28px 26px 26px;
}

.field {
  margin-bottom: 16px;
}

.field-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 7px;
  color: var(--fg-soft);
  font-family: var(--ui);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.field-input {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: transparent;
  color: var(--fg);
  font-family: var(--text);
  font-size: 13px;
}

html[data-theme="light"] .field-input {
  border-color: rgba(27, 27, 27, 0.24);
}

.field-input:focus {
  border-color: var(--line-strong);
}

.field-input::placeholder {
  color: var(--dim);
}

.form-error {
  margin-bottom: 16px;
  padding: 9px 0 9px 11px;
  border-left: 2px solid var(--pink);
  color: var(--pink);
  font-family: var(--text);
  font-size: 12px;
  line-height: 1.7;
}

.form-actions {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  margin-top: 22px;
}

.auth-switch {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
  color: var(--muted);
  font-family: var(--text);
  font-size: 11px;
}

.auth-switch a,
.auth-switch button {
  color: var(--fg-soft);
  border-bottom: 1px solid var(--line);
  padding-bottom: 1px;
}

.auth-switch a:hover,
.auth-switch button:hover {
  color: var(--fg);
  border-color: var(--line-strong);
}

.plain-list li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  color: var(--fg-soft);
  font-family: var(--text);
  font-size: 13px;
  line-height: 1.8;
}

.plain-list li:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.plain-list .word {
  color: var(--fg);
  font-weight: 600;
}

.plain-list .pos {
  color: var(--orange);
  font-family: var(--ui);
  font-size: 9px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding-top: 3px;
}

.plain-list .meaning {
  color: var(--muted);
}

.result-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 6px;
}


/* -------------------------------------------------------------------------
   toast
   ---------------------------------------------------------------------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 34px;
  z-index: 120;
  transform: translate(-50%, 16px);
  max-width: calc(100% - 40px);
  padding: 12px 20px;
  background: #f4f4f4;
  color: #111;
  font-family: var(--text);
  font-size: 12px;
  line-height: 1.5;
  text-align: center;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.28);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s ease;
}

.toast.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
}

.toast.is-error {
  background: var(--pink);
  color: #2a0000;
}

.toast.is-warning {
  background: #ffd166;
  color: #2b2100;
}

/* -------------------------------------------------------------------------
   footer
   ---------------------------------------------------------------------- */
.site-footer {
  margin-top: auto;
  border-top: 1px solid var(--line);
  padding: 30px 0 34px;
}

.footer-inner {
  width: min(var(--wrap), calc(100% - 40px));
  margin: 0 auto;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}

.footer-brand {
  font-family: var(--ui);
  font-size: 14px;
  letter-spacing: 0.4px;
  color: var(--fg);
}

.footer-brand span {
  font-weight: 700;
  color: var(--orange);
}

.footer-left p {
  margin-top: 8px;
  color: var(--dim);
  font-family: var(--text);
  font-size: 10px;
  line-height: 1.6;
}

.footer-right {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  color: var(--dim);
  font-family: var(--ui);
  font-size: 9px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.footer-right a:hover,
.footer-right button:hover {
  color: var(--fg);
}

/* 테마 선택 (System / Light / Dark) */
.theme-switch {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: 999px;
}

.theme-opt {
  font-family: var(--ui);
  font-size: 9px;
  line-height: 1.4;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--dim);
  padding: 3px 9px;
  border-radius: 999px;
  transition: color 0.15s ease, background 0.15s ease;
}

.theme-opt:hover {
  color: var(--fg);
}

.theme-opt[aria-pressed="true"] {
  color: var(--bg);
  background: var(--fg);
}

.theme-opt:focus-visible {
  outline: 1px solid var(--orange);
  outline-offset: 2px;
}

/* -------------------------------------------------------------------------
   responsive
   ---------------------------------------------------------------------- */

@media (max-width: 768px) {
  .site-header {
    height: 72px;
  }

  .header-inner,
  .page-main,
  .footer-inner {
    width: calc(100% - 32px);
  }

  .main-nav {
    gap: 16px;
  }

  .nav-link {
    font-size: 11px;
  }

  .nav-link::after {
    display: none;
  }

  .page-main {
    padding: 40px 0 64px;
  }

  .page-title {
    font-size: clamp(30px, 9vw, 40px);
  }

  .composer {
    padding: 14px 16px 10px;
  }

  .composer textarea {
    font-size: 17px;
  }

  .card {
    padding: 16px 16px 18px;
  }

  .card-quote,
  .card-quote.is-english {
    font-size: 17px;
  }

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

  .record-title,
  .record-wrong {
    -webkit-line-clamp: 1;
  }

  .footer-inner {
    flex-direction: column;
    gap: 18px;
  }

  .footer-right {
    gap: 14px;
  }

  .auth-wrap {
    padding: 48px 0 80px;
  }
}

@media (max-width: 560px) {
  .main-nav {
    gap: 12px;
  }
}

@media (max-width: 420px) {
  .main-nav {
    gap: 10px;
  }

  .footer-right span {
    width: 100%;
  }
}

@media (max-width: 360px) {
  .main-nav {
    gap: 8px;
  }
}


.auth-tabs {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 22px;
  border-bottom: 1px solid var(--line);
}

.auth-tabs a {
  margin-bottom: -1px;
  padding-bottom: 9px;
  border-bottom: 1px solid transparent;
  color: var(--muted);
  font-family: var(--ui);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.auth-tabs a.is-active {
  color: var(--fg);
  border-bottom-color: var(--orange);
}

/* -------------------------------------------------------------------------
   aimusic — intro / header
   ---------------------------------------------------------------------- */
.nav-user {
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-family: var(--ui);
  font-size: 10px;
  letter-spacing: 0.04em;
  padding-bottom: 1px;
}

.nav-user:hover {
  color: var(--fg);
  border-bottom: 1px solid var(--line-strong);
}

.intro {
  padding-bottom: 46px;
}

.intro-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 24px;
}

.intro-meta {
  margin-top: 18px;
  color: var(--dim);
  font-family: var(--ui);
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.intro-meta strong {
  color: var(--fg-soft);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0;
}

.intro-meta span {
  margin: 0 6px;
}

.library-head {
  padding-top: 8px;
}

.side-link {
  display: block;
  width: fit-content;
  margin: 8px 0 0 auto;
  color: var(--fg-soft);
  font-family: var(--text);
  font-size: 10px;
  letter-spacing: 0;
  text-transform: none;
  border-bottom: 1px solid var(--line);
}

.side-link:hover {
  color: var(--fg);
  border-color: var(--line-strong);
}

/* -------------------------------------------------------------------------
   aimusic — list toolbar
   ---------------------------------------------------------------------- */
.list-toolbar {
  flex-wrap: wrap;
}

.list-filters {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.filter-select {
  height: 36px;
  padding: 0 28px 0 10px;
  border: 1px solid var(--line);
  background-color: var(--bg-soft);
  color: var(--fg-soft);
  font-family: var(--ui);
  font-size: 10px;
  letter-spacing: 0.04em;
  appearance: none;
  -webkit-appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 14px) 15px, calc(100% - 9px) 15px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  cursor: pointer;
}

.filter-select:focus {
  border-color: var(--line-strong);
}

.filter-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--line);
  background: var(--bg-soft);
  color: var(--muted);
  font-family: var(--ui);
  font-size: 10px;
  letter-spacing: 0.04em;
  cursor: pointer;
  white-space: nowrap;
}

.filter-check input {
  accent-color: var(--orange);
}

.filter-check i {
  color: var(--dim);
  font-size: 9px;
}

.filter-check input:checked + i {
  color: #ff3b30;
}

.list-toolbar .list-meta {
  margin-left: auto;
}

/* -------------------------------------------------------------------------
   aimusic — track list
   ---------------------------------------------------------------------- */
.track-list {
  border-top: 1px solid var(--line-strong);
}

.track {
  --tools-w: 112px;
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) 74px 54px 62px 46px var(--tools-w);
  align-items: center;
  gap: 14px;
  padding: 10px 8px;
  border-bottom: 1px solid var(--line);
  transition: background 0.15s ease;
}

/* 도구 개수에 따라 우측 열 폭을 맞춥니다. (정보 1개 / 정보+수정+다운로드+삭제 4개) */
.track.tools-1 {
  --tools-w: 30px;
}

.track.tools-2 {
  --tools-w: 58px;
}

.track.tools-3 {
  --tools-w: 84px;
}

.track.tools-4 {
  --tools-w: 112px;
}

.track:hover {
  background: var(--bg-soft);
}

.track.is-playing {
  background: var(--bg-soft-2);
}

.track-play {
  display: block;
  width: 42px;
  height: 42px;
  border: 0;
  padding: 0;
  background: none;
  cursor: pointer;
}

.track-art {
  position: relative;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  overflow: hidden;
  color: rgba(255, 255, 255, 0.9);
  background: linear-gradient(135deg, hsl(var(--h, 20), 42%, 34%), hsl(calc(var(--h, 20) + 42), 55%, 18%));
}

.track-art > i {
  font-size: 14px;
  opacity: 0.9;
  transition: opacity 0.15s ease;
}

.track.is-paused .track-art {
  filter: brightness(0.82);
}

.track-play:hover .track-art {
  filter: brightness(1.15);
}

.track.is-playing .track-art > i {
  opacity: 0;
}

.track-eq {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  display: none;
  align-items: flex-end;
  justify-content: center;
  gap: 2px;
  padding-bottom: 14px;
}

.track.is-playing .track-eq {
  display: flex;
}

/* 커버 위 반투명 재생 버튼 */
.track-play-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.4);
  color: #fff;
  font-size: 9px;
  line-height: 1;
  pointer-events: none;
  transition: background 0.15s ease, transform 0.15s ease;
}

.track-play-overlay i {
  margin-left: 1px;
}

.track.is-paused .track-play-overlay {
  background: rgba(0, 0, 0, 0.55);
}

.track.is-paused .track-play-overlay i {
  color: #ff3b30;
}

.track-play:hover .track-play-overlay {
  background: var(--orange);
  transform: translate(-50%, -50%) scale(1.08);
}

.track-play:hover .track-play-overlay i {
  color: #fff;
}

.track.is-playing .track-play-overlay {
  display: none;
}

.track-eq span {
  display: block;
  width: 3px;
  height: 8px;
  background: #fff;
  animation: track-eq 0.8s ease-in-out infinite;
}

.track-eq span:nth-child(2) {
  height: 13px;
  animation-delay: 0.15s;
}

.track-eq span:nth-child(3) {
  height: 6px;
  animation-delay: 0.3s;
}

@keyframes track-eq {
  0%, 100% {
    transform: scaleY(0.45);
  }
  50% {
    transform: scaleY(1);
  }
}

.track-main {
  min-width: 0;
}

.track-title-line {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.track-title-line .track-title {
  min-width: 0;
  flex: 0 1 auto;
}

.track-like {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  flex: 0 0 auto;
  padding: 4px 2px;
  border: 0;
  background: none;
  color: var(--dim);
  font-family: var(--ui);
  font-size: 9px;
  line-height: 1;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: color 0.15s ease, opacity 0.15s ease;
}

.track-like i {
  font-size: 10px;
}

.track-like:hover {
  color: var(--fg-soft);
}

.track-like.is-liked {
  color: #ff3b30;
}

.track-like.is-liked:hover {
  color: #ff6a60;
}

.track-like:disabled {
  opacity: 0.6;
  cursor: default;
}

.track-like:focus-visible {
  outline: 1px solid var(--orange);
  outline-offset: 3px;
}

.track-like-count {
  font-variant-numeric: tabular-nums;
}

.track-title {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--fg);
  font-family: var(--text);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.5;
  text-align: left;
}

.track-title:hover {
  color: var(--orange);
}

.track-sub {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-family: var(--text);
  font-size: 11px;
  line-height: 1.6;
}

.track-genre {
  justify-self: start;
  padding: 2px 8px;
  border: 1px solid var(--line);
  color: var(--muted);
  font-family: var(--ui);
  font-size: 8px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.track-duration,
.track-date,
.track-plays {
  color: var(--dim);
  font-family: var(--ui);
  font-size: 10px;
  letter-spacing: 0.04em;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.track-plays i {
  margin-right: 2px;
  font-size: 9px;
}

.track-tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 2px;
}

.track-tools .icon-btn {
  opacity: 0.55;
  transition: opacity 0.15s ease, color 0.15s ease;
}

.track:hover .track-tools .icon-btn,
.track-tools .icon-btn:focus-visible {
  opacity: 1;
}

.empty p {
  margin-bottom: 12px;
}

.empty .btn {
  margin-top: 2px;
}


/* -------------------------------------------------------------------------
   aimusic — player
   ---------------------------------------------------------------------- */
body.has-player .app {
  padding-bottom: 90px;
}

.player {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 80;
  border-top: 1px solid var(--line);
  background: rgba(28, 28, 28, 0.94);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
}

html[data-theme="light"] .player {
  background: rgba(245, 244, 240, 0.95);
}

.player[hidden] {
  display: none;
}

.player-inner {
  width: min(var(--wrap), calc(100% - 40px));
  min-height: 76px;
  margin: 0 auto;
  padding: 10px 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(250px, 1.25fr) minmax(0, 1fr);
  align-items: center;
  gap: 22px;
}

.player-now {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.player-art {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  color: #fff;
  background: linear-gradient(135deg, hsl(var(--h, 20), 42%, 34%), hsl(calc(var(--h, 20) + 42), 55%, 18%));
  font-size: 14px;
}

.player-text {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.player-text strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--fg);
  font-family: var(--text);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.5;
}

.player-text span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-family: var(--text);
  font-size: 10px;
  line-height: 1.5;
}

.player-center {
  min-width: 0;
}

.player-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.player-btn {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  color: var(--fg-soft);
  font-size: 12px;
  transition: color 0.15s ease;
}

.player-btn:hover {
  color: var(--fg);
}

.player-toggle {
  width: 38px;
  height: 38px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  color: var(--fg);
  font-size: 13px;
}

.player-toggle:hover {
  border-color: var(--orange);
  background: var(--orange);
  color: #fff;
}

.player-progress {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) 36px;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}

.player-time {
  color: var(--dim);
  font-family: var(--ui);
  font-size: 9px;
  letter-spacing: 0.04em;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.player-range {
  width: 100%;
  height: 14px;
  margin: 0;
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  cursor: pointer;
}

.player-range::-webkit-slider-runnable-track {
  height: 2px;
  background: linear-gradient(to right, var(--orange) var(--p, 0%), var(--line) var(--p, 0%));
}

.player-range::-moz-range-track {
  height: 2px;
  background: var(--line);
}

.player-range::-moz-range-progress {
  height: 2px;
  background: var(--orange);
}

.player-range::-webkit-slider-thumb {
  width: 9px;
  height: 9px;
  margin-top: -3.5px;
  border-radius: 50%;
  background: var(--fg);
  opacity: 0;
  transition: opacity 0.15s ease;
  -webkit-appearance: none;
  appearance: none;
}

.player-range:hover::-webkit-slider-thumb,
.player-range:focus-visible::-webkit-slider-thumb {
  opacity: 1;
}

.player-range::-moz-range-thumb {
  width: 9px;
  height: 9px;
  border: 0;
  border-radius: 50%;
  background: var(--fg);
}

.player-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 2px;
}

.player-mini {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  color: var(--dim);
  font-size: 10px;
  transition: color 0.15s ease;
}

.player-mini:hover {
  color: var(--fg);
}

.player-mini.is-active {
  color: var(--orange);
}

.player-mini.is-one {
  position: relative;
}

.player-mini.is-one::after {
  content: "1";
  position: absolute;
  right: 1px;
  bottom: 1px;
  font-family: var(--ui);
  font-size: 7px;
  font-weight: 700;
  line-height: 1;
}

.player-volume {
  width: 74px;
  margin-left: 4px;
}

.player.is-playing .player-art {
  animation: player-pulse 2.4s ease-in-out infinite;
}

@keyframes player-pulse {
  0%, 100% {
    filter: brightness(1);
  }
  50% {
    filter: brightness(1.28);
  }
}


/* -------------------------------------------------------------------------
   aimusic — upload
   ---------------------------------------------------------------------- */
.upload-card {
  border: 1px solid var(--line);
  background: var(--bg-soft);
  padding: 22px;
}

.drop {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 170px;
  padding: 24px;
  border: 1px dashed var(--line-strong);
  background: var(--bg-deep);
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.drop:hover,
.drop.is-drag {
  border-color: var(--orange);
  background: rgba(255, 82, 36, 0.06);
}

.drop input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.drop-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-bottom: 4px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--orange);
  font-size: 16px;
}

.drop-title {
  color: var(--fg);
  font-family: var(--text);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.6;
  word-break: break-all;
}

.drop-hint {
  color: var(--dim);
  font-family: var(--ui);
  font-size: 9px;
  letter-spacing: 0.06em;
  line-height: 1.6;
}

.drop.has-file {
  border-style: solid;
  border-color: var(--orange);
}

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

.field-textarea {
  height: auto;
  min-height: 84px;
  padding: 10px 12px;
  line-height: 1.7;
  resize: vertical;
}

select.field-input {
  padding-right: 30px;
  appearance: none;
  -webkit-appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 15px) 18px, calc(100% - 10px) 18px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  cursor: pointer;
}

.upload-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 8px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.upload-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.upload-progress {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
}

.upload-progress[hidden] {
  display: none;
}

.upload-bar {
  flex: 1 1 auto;
  height: 3px;
  background: var(--line);
  overflow: hidden;
}

.upload-bar span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--orange);
  transition: width 0.2s ease;
}

.upload-pct {
  flex: 0 0 auto;
  min-width: 34px;
  color: var(--muted);
  font-family: var(--ui);
  font-size: 9px;
  letter-spacing: 0.04em;
  text-align: right;
  font-variant-numeric: tabular-nums;
}


/* -------------------------------------------------------------------------
   aimusic — edit (file info)
   ---------------------------------------------------------------------- */
.file-info {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  background: var(--bg-deep);
}

.file-info-icon {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  color: var(--orange);
  font-size: 14px;
}

.file-info-text {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.file-info-text strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--fg);
  font-family: var(--text);
  font-size: 13px;
  font-weight: 500;
}

.file-info-text span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-family: var(--ui);
  font-size: 9px;
  letter-spacing: 0.04em;
}

.file-info-actions {
  flex: 0 0 auto;
  margin-left: auto;
}

@media (max-width: 560px) {
  .file-info {
    flex-wrap: wrap;
  }

  .file-info-actions {
    width: 100%;
    margin-left: 0;
  }

  .file-info-actions .btn {
    width: 100%;
  }
}



/* -------------------------------------------------------------------------

/* -------------------------------------------------------------------------
   aimusic — cover images
   ---------------------------------------------------------------------- */
.cover-upload {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
}

.cover-drop {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border: 1px solid var(--line);
  background: var(--bg-deep);
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.cover-drop:hover,
.cover-drop.is-drag {
  border-color: var(--orange);
  background: rgba(255, 82, 36, 0.06);
}

.cover-drop.has-file {
  border-color: var(--orange);
}

.cover-drop input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.cover-preview {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  overflow: hidden;
  border: 1px solid var(--line);
  color: var(--dim);
  font-size: 20px;
  background: var(--bg-soft);
}

.cover-preview img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cover-text {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.cover-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--fg);
  font-family: var(--text);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.6;
}

.cover-hint {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--dim);
  font-family: var(--ui);
  font-size: 9px;
  letter-spacing: 0.04em;
  line-height: 1.6;
}

.cover-clear {
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.cover-clear:hover {
  color: var(--fg);
  border-color: var(--line-strong);
}

.cover-edit {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 16px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  background: var(--bg-deep);
}

.cover-edit-text {
  flex: 1 1 auto;
  min-width: 0;
}

.cover-edit .field-label {
  margin-bottom: 4px;
}

.cover-edit-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.cover-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.track-cover {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.player-cover {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.detail-cover-img {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.track.is-playing .track-eq {
  background: rgba(0, 0, 0, 0.35);
}

.detail-cover.is-playing .detail-cover-img {
  filter: brightness(0.78);
}

@media (max-width: 560px) {
  .cover-edit {
    align-items: flex-start;
  }

  .cover-edit .cover-preview {
    width: 60px;
    height: 60px;
  }
}

   aimusic — detail
   ---------------------------------------------------------------------- */
.detail-top {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  align-items: start;
  gap: 32px;
}

.detail-cover {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  max-width: 260px;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  color: rgba(255, 255, 255, 0.92);
  background: linear-gradient(135deg, hsl(var(--h, 20), 42%, 34%), hsl(calc(var(--h, 20) + 42), 55%, 18%));
}

.detail-cover > i {
  font-size: 54px;
  opacity: 0.9;
  transition: opacity 0.15s ease;
}

.detail-cover.is-playing > i {
  opacity: 0.35;
  animation: player-pulse 2.4s ease-in-out infinite;
}

.detail-cover-play {
  position: absolute;
  right: 14px;
  bottom: 14px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.34);
  color: #fff;
  font-size: 16px;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  transition: background 0.15s ease, border-color 0.15s ease;
}

.detail-cover-play:hover {
  border-color: var(--orange);
  background: var(--orange);
}

.detail-title {
  margin: 12px 0 8px;
  font-size: clamp(30px, 4vw, 48px);
}

.detail-artist {
  color: var(--fg-soft);
  font-family: var(--text);
  font-size: 15px;
  line-height: 1.7;
  word-break: break-word;
}

.detail-badges {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 16px;
}

.detail-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border: 1px solid var(--line);
  color: var(--muted);
  font-family: var(--ui);
  font-size: 8px;
  letter-spacing: 0.08em;
  line-height: 1.5;
  text-transform: uppercase;
  white-space: nowrap;
}

.detail-like {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font-family: var(--ui);
  cursor: pointer;
  text-transform: uppercase;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.detail-like:hover {
  color: var(--fg-soft);
  border-color: var(--line-strong);
}

.detail-like.is-liked {
  color: #ff3b30;
  border-color: rgba(255, 59, 48, 0.5);
}

.detail-like.is-liked:hover {
  color: #ff6a60;
}

.detail-like i {
  font-size: 9px;
}

.detail-like [data-like-count] {
  font-variant-numeric: tabular-nums;
}

.detail-like:disabled {
  opacity: 0.6;
  cursor: default;
}

.detail-like:focus-visible {
  outline: 1px solid var(--orange);
  outline-offset: 2px;
}

.detail-share {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font-family: var(--ui);
  cursor: pointer;
  text-transform: uppercase;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.detail-share:hover {
  color: var(--fg-soft);
  border-color: var(--line-strong);
}

.detail-share i {
  font-size: 9px;
}

.detail-share:focus-visible {
  outline: 1px solid var(--orange);
  outline-offset: 2px;
}

.share-menu-popover {
  position: fixed;
  z-index: 1200;
  min-width: 164px;
  padding: 4px;
  border: 1px solid var(--line);
  background: var(--bg-soft);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.45);
}

.share-menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 9px 10px;
  border: 0;
  background: none;
  color: var(--fg-soft);
  font-family: var(--ui);
  font-size: 10px;
  letter-spacing: 0.02em;
  line-height: 1.4;
  text-align: left;
  white-space: nowrap;
  cursor: pointer;
}

.share-menu-item:hover,
.share-menu-item:focus-visible {
  background: var(--bg-soft-2);
  color: var(--fg);
  outline: none;
}

.share-menu-item i {
  width: 14px;
  text-align: center;
  font-size: 10px;
}

.share-menu-item.is-kakao {
  color: #f7e04a;
}

.share-menu-item.is-kakao:hover,
.share-menu-item.is-kakao:focus-visible {
  color: #fee500;
}

.detail-desc {
  max-width: 640px;
  margin-top: 18px;
  color: var(--muted);
  font-family: var(--text);
  font-size: 13px;
  line-height: 1.9;
  white-space: pre-line;
  word-break: keep-all;
}

.detail-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 22px;
}

.detail-player {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 30px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  background: var(--bg-soft);
}

.detail-progress {
  flex: 1 1 auto;
  min-width: 0;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 38px;
  align-items: center;
  gap: 8px;
}

.detail-player .player-volume {
  flex: 0 0 auto;
  width: 74px;
}

.detail-meta {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  margin-top: 24px;
  border: 1px solid var(--line);
  background: var(--line);
}

.detail-meta > div {
  min-width: 0;
  padding: 14px 16px;
  background: var(--bg-soft);
}

.detail-meta strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-top: 6px;
  color: var(--fg);
  font-family: var(--ui);
  font-size: 16px;
  font-weight: 500;
  letter-spacing: -0.02em;
}

@media (max-width: 768px) {
  .detail-top {
    grid-template-columns: 180px minmax(0, 1fr);
    gap: 20px;
  }

  .detail-cover {
    max-width: 180px;
  }

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

@media (max-width: 560px) {
  .detail-top {
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
  }

  .detail-cover {
    max-width: 240px;
  }

  .detail-cover > i {
    font-size: 44px;
  }

  .detail-cover-play {
    width: 46px;
    height: 46px;
  }

  .detail-player {
    flex-wrap: wrap;
    gap: 10px;
  }

  .detail-progress {
    order: 3;
    flex-basis: 100%;
  }

  .detail-player .player-volume {
    display: none;
  }

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

  .detail-meta > div {
    padding: 12px 14px;
  }

  .detail-meta strong {
    font-size: 14px;
  }
}

/* -------------------------------------------------------------------------
   aimusic — account
   ---------------------------------------------------------------------- */
.form-section {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 22px 0 14px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.form-section .composer-count {
  text-align: right;
}

.form-success {
  margin-bottom: 16px;
  padding: 9px 0 9px 11px;
  border-left: 2px solid var(--green);
  color: var(--green);
  font-family: var(--text);
  font-size: 12px;
  line-height: 1.7;
}

.field-hint {
  display: block;
  margin-top: 6px;
  color: var(--dim);
  font-family: var(--text);
  font-size: 10px;
  line-height: 1.6;
}

.field-input:disabled {
  color: var(--muted);
  border-color: var(--line);
  background: var(--bg-deep);
  cursor: not-allowed;
}

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

/* -------------------------------------------------------------------------
   aimusic — info modal (cover · memo)
   ---------------------------------------------------------------------- */
body.modal-open {
  overflow: hidden;
}

.modal {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.modal[hidden] {
  display: none;
}

.modal.is-visible {
  opacity: 1;
  visibility: visible;
}

.modal-backdrop {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background: rgba(0, 0, 0, 0.62);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
}

.modal-card {
  position: relative;
  z-index: 1;
  width: min(480px, 100%);
  max-height: calc(100vh - 40px);
  overflow: auto;
  border: 1px solid var(--line);
  background: var(--bg-soft);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
  transform: translateY(10px);
  transition: transform 0.2s ease;
}

.modal.is-visible .modal-card {
  transform: translateY(0);
}

.modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.4);
  color: #fff;
  font-size: 12px;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.modal-close:hover {
  border-color: var(--orange);
  background: var(--orange);
}

.info-modal-cover {
  padding: 20px 20px 0;
  background: var(--bg-deep);
}

.info-modal-art {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  max-width: 240px;
  aspect-ratio: 1 / 1;
  margin: 0 auto;
  overflow: hidden;
  color: rgba(255, 255, 255, 0.9);
  background: linear-gradient(135deg, hsl(var(--h, 20), 42%, 34%), hsl(calc(var(--h, 20) + 42), 55%, 18%));
}

.info-modal-art > i {
  font-size: 44px;
  opacity: 0.9;
}

.info-modal-img {
  display: none;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.info-modal-art.has-image .info-modal-img {
  display: block;
}

.info-modal-art.has-image > i {
  display: none;
}

.info-modal-body {
  padding: 18px 22px 22px;
}

.info-modal-title {
  margin: 10px 0 6px;
  color: var(--fg);
  font-family: var(--display);
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.35;
  word-break: break-word;
}

.info-modal-artist {
  color: var(--muted);
  font-family: var(--text);
  font-size: 12px;
  line-height: 1.7;
  word-break: break-word;
}

.info-modal-badges {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.info-modal-memo {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  color: var(--fg-soft);
  font-family: var(--text);
  font-size: 13px;
  line-height: 1.9;
  white-space: pre-line;
  word-break: keep-all;
}

.info-modal-memo.is-empty {
  color: var(--dim);
}

@media (max-width: 560px) {
  .modal {
    padding: 16px;
  }

  .modal-card {
    max-height: calc(100vh - 32px);
  }

  .info-modal-cover {
    padding: 16px 16px 0;
  }

  .info-modal-art {
    max-width: 200px;
  }

  .info-modal-body {
    padding: 16px 18px 20px;
  }

  .info-modal-title {
    font-size: 21px;
  }
}

/* -------------------------------------------------------------------------
   aimusic — responsive
   ---------------------------------------------------------------------- */
@media (max-width: 768px) {
  .intro {
    padding-bottom: 34px;
  }

  .track {
    grid-template-columns: 42px minmax(0, 1fr) 46px var(--tools-w);
    gap: 10px;
    padding: 9px 2px;
  }

  .track-genre,
  .track-date,
  .track-plays {
    display: none;
  }

  .track-duration {
    display: block;
    text-align: right;
  }

  .track-tools .icon-btn {
    opacity: 1;
  }

  .list-filters {
    width: 100%;
  }

  .list-toolbar .list-meta {
    width: 100%;
    margin-left: 0;
  }

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

  .upload-card {
    padding: 16px;
  }

  .drop {
    min-height: 140px;
    padding: 18px;
  }

  .upload-foot {
    flex-direction: column;
    align-items: stretch;
  }

  .upload-actions {
    justify-content: flex-end;
  }

  body.has-player .app {
    padding-bottom: 150px;
  }

  .player-inner {
    width: calc(100% - 32px);
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "now right"
      "center center";
    gap: 6px 12px;
    min-height: 0;
    padding: 10px 0 12px;
  }

  .player-now {
    grid-area: now;
  }

  .player-center {
    grid-area: center;
  }

  .player-right {
    grid-area: right;
  }

  .player-volume {
    display: none;
  }

  .player-progress {
    margin-top: 2px;
  }

  .player-text strong {
    font-size: 12px;
  }
}

@media (max-width: 560px) {
  .nav-user {
    max-width: 64px;
    font-size: 9px;
  }

  .page-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .page-head-side {
    text-align: left;
  }

  .form-section {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .form-section .composer-count {
    text-align: left;
  }

  .side-link {
    margin-left: 0;
  }

  .intro-actions .btn {
    flex: 1 1 auto;
  }

  .filter-select {
    flex: 1 1 auto;
    min-width: 0;
  }

  .filter-check {
    flex: 0 0 auto;
  }

  .track {
    grid-template-columns: 42px minmax(0, 1fr) 44px var(--tools-w);
  }

  .player-right .player-mini {
    width: 26px;
  }
}

@media (hover: none) {
  .track-tools .icon-btn {
    opacity: 1;
  }
}

