@import url("https://cdn.jsdelivr.net/gh/orioncactus/pretendard/dist/web/variable/pretendardvariable-dynamic-subset.css");

:root {
  color-scheme: light;
  --bg: #f6f7f4;
  --surface: #ffffff;
  --surface-2: #eef3f1;
  --text: #18201d;
  --muted: #65716d;
  --line: #dce4e0;
  --accent: #e23d28;
  --accent-dark: #aa2415;
  --ink: #263b69;
  --green: #276c51;
  --shadow: 0 16px 40px rgba(22, 31, 27, 0.08);
  font-family:
    -apple-system,
    BlinkMacSystemFont,
    "SF Pro Display",
    "SF Pro Text",
    "Pretendard Variable",
    "Pretendard",
    "Apple SD Gothic Neo",
    "Segoe UI",
    "Inter",
    "Malgun Gothic",
    system-ui,
    sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(135deg, rgba(226, 61, 40, 0.08), transparent 28%),
    linear-gradient(225deg, rgba(39, 108, 81, 0.08), transparent 32%),
    var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.app-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 40px;
}

.topbar,
.workspace,
.history-panel {
  width: 100%;
}

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

.eyebrow {
  margin: 0 0 5px;
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(36px, 5vw, 64px);
  line-height: 0.95;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 6px;
  font-size: 22px;
  line-height: 1.2;
  letter-spacing: 0;
}

h3 {
  font-size: 18px;
  line-height: 1.35;
  letter-spacing: 0;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(320px, 0.95fr) minmax(360px, 1.25fr);
  gap: 18px;
  align-items: start;
}

.composer,
.results-panel,
.history-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: var(--shadow);
}

.composer,
.results-panel {
  min-height: 590px;
}

.composer {
  padding: 22px;
}

.composer-head,
.panel-head,
.controls,
.topbar {
  display: flex;
  align-items: center;
}

.composer-head,
.panel-head {
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.composer-head p,
.empty-state p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.55;
}

.input-label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 800;
}

textarea {
  width: 100%;
  min-height: 152px;
  resize: vertical;
  border: 1px solid #cfd9d4;
  border-radius: 8px;
  padding: 14px;
  background: #fbfcfb;
  color: var(--text);
  line-height: 1.55;
  outline: none;
}

textarea:focus,
input:focus,
select:focus,
button:focus-visible,
a:focus-visible {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(226, 61, 40, 0.16);
  outline: none;
}

input {
  width: 100%;
  height: 42px;
  border: 1px solid #cfd9d4;
  border-radius: 8px;
  padding: 0 12px;
  background: #fbfcfb;
  color: var(--text);
  outline: none;
}

.ghost-button,
.ghost-link,
.icon-button {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  cursor: pointer;
  text-decoration: none;
}

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

.controls label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

select {
  width: 100%;
  height: 42px;
  border: 1px solid #cfd9d4;
  border-radius: 8px;
  padding: 0 11px;
  background: #fff;
  color: var(--text);
}

.api-box {
  margin-bottom: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
}

.api-box p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.primary-button {
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  font-weight: 900;
  text-decoration: none;
}

.primary-button {
  width: 100%;
  min-height: 50px;
}

.primary-button:hover {
  background: var(--accent-dark);
}

.primary-button:disabled {
  cursor: wait;
  opacity: 0.72;
}

.ghost-link,
.ghost-button,
.icon-button {
  min-height: 38px;
  padding: 0 13px;
  font-weight: 800;
}

.icon-button {
  width: 40px;
  padding: 0;
  font-size: 20px;
}

.results-panel,
.history-panel {
  padding: 22px;
}

.empty-state {
  display: grid;
  place-items: center;
  min-height: 420px;
  padding: 28px;
  border: 1px dashed #cdd8d2;
  border-radius: 8px;
  background: var(--surface-2);
  text-align: center;
}

.record-art {
  position: relative;
  width: min(210px, 62vw);
  aspect-ratio: 1;
  margin-bottom: 18px;
  border-radius: 50%;
  background:
    radial-gradient(circle, #ffffff 0 9%, #18201d 10% 13%, transparent 14%),
    repeating-radial-gradient(circle, #2a3833 0 7px, #17201d 8px 14px);
  box-shadow: inset 0 0 0 16px rgba(255, 255, 255, 0.07);
}

.record-art span {
  position: absolute;
  right: -16px;
  bottom: 30px;
  width: 74px;
  height: 74px;
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.45), transparent),
    var(--accent);
  box-shadow: 0 14px 32px rgba(170, 36, 21, 0.28);
}

.result-list {
  display: grid;
  gap: 12px;
}

.result-card {
  display: grid;
  grid-template-columns: 168px 1fr;
  gap: 16px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: var(--surface);
}

.thumb-link {
  display: block;
  overflow: hidden;
  border-radius: 8px;
  background: var(--surface-2);
  aspect-ratio: 16 / 9;
}

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

.result-body {
  min-width: 0;
}

.result-label {
  margin-bottom: 7px;
  color: var(--green);
  font-size: 12px;
  font-weight: 900;
}

.result-query {
  color: inherit;
  text-decoration: none;
  margin-bottom: 8px;
  overflow-wrap: anywhere;
}

.result-query:hover {
  color: var(--accent-dark);
}

.result-note {
  display: -webkit-box;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.result-meta {
  margin: 10px 0 0;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

.history-panel {
  margin-top: 18px;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 18px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.site-footer nav {
  display: flex;
  gap: 12px;
  white-space: nowrap;
}

.site-footer a,
.document-page a {
  color: var(--accent-dark);
  font-weight: 700;
  text-decoration: none;
}

.site-footer a:hover,
.document-page a:hover {
  text-decoration: underline;
}

.document-page {
  width: min(760px, calc(100% - 32px));
  margin: 0 auto;
  padding: 44px 0 64px;
}

.document-page h1 {
  margin: 18px 0 20px;
  font-size: 42px;
  line-height: 1.05;
}

.document-page h2 {
  margin: 28px 0 10px;
  font-size: 20px;
}

.document-page p {
  color: var(--muted);
  line-height: 1.75;
}

.doc-back {
  display: inline-flex;
  margin-bottom: 8px;
}

.compact {
  margin-bottom: 12px;
}

.history-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 40px;
}

.history-pill {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 11px;
  background: #fff;
  color: var(--text);
  cursor: pointer;
  font-size: 14px;
}

.notice-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: var(--surface);
}

.notice-card h3 {
  margin-bottom: 8px;
}

.notice-card p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.55;
}

.is-hidden {
  display: none;
}

@media (max-width: 860px) {
  .app-shell {
    width: min(100% - 20px, 720px);
    padding-top: 18px;
  }

  .workspace {
    grid-template-columns: 1fr;
  }

  .composer,
  .results-panel {
    min-height: 0;
  }

  .controls {
    grid-template-columns: 1fr;
  }

  .result-card {
    grid-template-columns: 150px 1fr;
  }

}

@media (max-width: 520px) {
  .topbar,
  .composer-head,
  .panel-head {
    align-items: flex-start;
  }

  .composer-head,
  .panel-head {
    flex-direction: column;
  }

  .topbar {
    flex-direction: column;
  }

  .site-footer {
    flex-direction: column;
  }

  .ghost-link {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .result-card {
    grid-template-columns: 1fr;
  }
}
