:root {
  --bg-top: #eaf3ff;
  --bg-bottom: #edf9f4;
  --panel: rgba(255, 255, 255, 0.86);
  --line: #cfdae2;
  --ink: #10212f;
  --muted: #4f6575;
  --accent: #01a4a3;
  --accent-strong: #0079b8;
  --shadow: 0 16px 34px rgba(10, 28, 36, 0.14);
  --neon-a: #00e6ff;
  --neon-b: #2aff9a;
  --neon-c: #66a3ff;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "Spoqa Han Sans Neo", "Spoqa Han Sans", "Noto Sans KR", sans-serif;
  background:
    radial-gradient(circle at 12% 10%, rgba(113, 161, 255, 0.23), transparent 30%),
    radial-gradient(circle at 88% 16%, rgba(20, 208, 163, 0.2), transparent 35%),
    linear-gradient(180deg, var(--bg-top) 0%, var(--bg-bottom) 100%);
  background-repeat: no-repeat;
  background-size: 140% 120%, 130% 120%, 100% 100%;
  background-attachment: fixed;
}

.appShell {
  max-width: 1460px;
  margin: 0 auto;
  padding: 24px 18px 40px;
  display: grid;
  grid-template-columns: minmax(250px, 320px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.leftRail {
  position: sticky;
  top: 22px;
  display: grid;
  gap: 12px;
  align-self: start;
}

.appBrand {
  position: relative;
  z-index: 10;
  border-radius: 22px;
  padding: 20px 18px 18px;
  border: 1px solid rgba(255, 255, 255, 0.85);
  background:
    linear-gradient(155deg, rgba(255, 255, 255, 0.9), rgba(239, 248, 255, 0.68)),
    radial-gradient(circle at 90% 8%, rgba(57, 157, 255, 0.2), transparent 55%);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.brandDecor {
  position: absolute;
  inset: -2px;
  pointer-events: none;
}

.brandDecor::before,
.brandDecor::after {
  content: "";
  position: absolute;
  border-radius: 999px;
}

.brandDecor::before {
  width: 180px;
  height: 180px;
  right: -88px;
  top: -78px;
  background: radial-gradient(circle, rgba(44, 198, 237, 0.4), transparent 70%);
}

.brandDecor::after {
  width: 120px;
  height: 120px;
  left: -58px;
  bottom: -62px;
  background: radial-gradient(circle, rgba(54, 175, 140, 0.22), transparent 68%);
}

.appTitle {
  margin: 0;
  font-size: clamp(1.5rem, 2.3vw, 2.1rem);
  line-height: 1.15;
  letter-spacing: -0.03em;
  background: linear-gradient(118deg, #0a5fa2 8%, #00a58d 48%, #3e89da 85%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 8px 22px rgba(41, 117, 180, 0.18);
}

.appSubtitle {
  margin: 10px 0 0;
  color: #335163;
  font-size: 0.93rem;
  line-height: 1.48;
}

.appPills {
  margin-top: 14px;
}

.accountPanel {
  padding: 16px 18px;
}

.accountPanelHead {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
}

.accountPanelBody {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 12px;
  align-items: center;
}

.localeField {
  display: grid;
  gap: 6px;
  min-width: 152px;
}

.localeLabel {
  font-size: 0.74rem;
  font-weight: 700;
  color: #4b6070;
}

.localeSelect {
  min-height: 34px;
  padding: 6px 8px;
  border-radius: 10px;
  border: 1px solid rgba(12, 55, 86, 0.16);
  background: #fff;
  color: #214961;
  font-size: 0.78rem;
}

.authPanel {
  margin-top: 14px;
  border: 1px solid rgba(161, 193, 211, 0.7);
  border-radius: 16px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.82);
}

.authTitle {
  margin: 0;
  font-size: 0.86rem;
  font-weight: 800;
  color: #355265;
}

.authStatus {
  margin: 6px 0 0;
  font-size: 0.78rem;
  color: #4f6575;
}

.googleSignInMount {
  min-height: 40px;
}

.authUserBox {
  margin-top: 0;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  flex: 1 1 280px;
}

.authUserAvatar {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid #c8d8e0;
}

.authUserMeta {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.authUserMeta strong,
.authUserMeta small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.authUserMeta strong {
  font-size: 0.8rem;
  color: #223a49;
}

.authUserMeta small {
  font-size: 0.72rem;
  color: #5c7280;
}

.authLogoutBtn {
  padding: 7px 10px;
  font-size: 0.74rem;
  min-height: 0;
}

.tokenBadgeWrap {
  margin-top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 10px;
  border: 1px solid rgba(159, 186, 202, 0.48);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.82);
}

.tokenLabel {
  font-size: 0.75rem;
  color: #496173;
}

.tokenBadge {
  font-size: 0.9rem;
  color: #0e5577;
  font-weight: 800;
}

.tokenPackSection {
  margin-top: 10px;
  display: grid;
  gap: 8px;
}

.tokenPackTitle {
  margin: 0;
  font-size: 0.75rem;
  color: #496173;
}

.tokenPackList {
  display: grid;
  gap: 8px;
}

.tokenPackBtn {
  border: 1px solid rgba(11, 92, 130, 0.22);
  border-radius: 10px;
  background: #fff;
  color: #1f4f69;
  font-size: 0.78rem;
  font-weight: 700;
  min-height: 34px;
  padding: 6px 10px;
  text-align: left;
}

.tokenPackBtn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.tokenLedgerHead {
  margin-top: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.74rem;
  color: #496173;
  font-weight: 700;
}

.tokenLedgerRefresh {
  min-height: 0;
  padding: 5px 8px;
  border-radius: 8px;
  font-size: 0.7rem;
}

.tokenLedgerList {
  margin-top: 6px;
  max-height: 180px;
  overflow: auto;
  display: grid;
  gap: 6px;
}

.resultLedgerSection {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid rgba(166, 191, 206, 0.45);
  display: grid;
  gap: 8px;
}

.resultLedgerHead {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.resultLedgerTitle {
  margin: 0;
  font-size: 0.9rem;
  color: #3a5363;
}

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

.resultLedgerToggle {
  min-height: 0;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 0.74rem;
  border: 1px solid rgba(11, 92, 130, 0.22);
  background: #fff;
  color: #1f4f69;
  font-weight: 700;
}

.tokenLedgerItem {
  padding: 6px 8px;
  border-radius: 10px;
  border: 1px solid rgba(127, 156, 174, 0.35);
  background: rgba(255, 255, 255, 0.9);
  display: grid;
  gap: 3px;
}

.tokenLedgerTop {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.72rem;
}

.tokenLedgerDelta {
  font-weight: 800;
}

.tokenLedgerDelta--plus {
  color: #0f8d59;
}

.tokenLedgerDelta--minus {
  color: #bf3943;
}

.tokenLedgerMeta {
  font-size: 0.68rem;
  color: #587384;
}

.layout {
  width: 100%;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 18px;
}

.brandNav {
  border-radius: 16px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.8);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: var(--shadow);
  display: grid;
  gap: 8px;
}

.brandNavLink {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  border-radius: 12px;
  border: 1px solid rgba(12, 55, 86, 0.16);
  background: #ffffff;
  color: #214961;
  font-size: 0.86rem;
  font-weight: 700;
  text-decoration: none;
}

.brandNavLink--active {
  color: #ffffff;
  border-color: transparent;
  background: linear-gradient(130deg, #009d8c, #1179bf);
}

.gnbNav {
  display: none;
}

@media (max-width: 1320px) {
  .appShell {
    max-width: 1320px;
    grid-template-columns: minmax(240px, 292px) minmax(0, 1fr);
    gap: 16px;
  }

  .appTitle {
    font-size: clamp(1.42rem, 2.05vw, 1.9rem);
  }
}

@media (max-width: 1160px) {
  .appShell {
    grid-template-columns: minmax(220px, 260px) minmax(0, 1fr);
    gap: 14px;
    padding: 16px 14px 30px;
  }

  .appBrand {
    padding: 16px 14px 14px;
  }

  .appSubtitle {
    font-size: 0.88rem;
  }
}

.panel {
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 20px;
  padding: 20px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
}

.stageBox {
  position: relative;
  isolation: isolate;
  transition: padding 180ms ease;
}

.stageBox::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 20px;
  pointer-events: none;
  opacity: 0;
  z-index: 3;
  background: conic-gradient(
    from var(--spin-angle),
    transparent 0deg,
    var(--neon-a) 70deg,
    transparent 140deg,
    var(--neon-b) 220deg,
    transparent 300deg,
    var(--neon-c) 360deg
  );
  filter: drop-shadow(0 0 8px rgba(0, 190, 255, 0.35));
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  padding: 2px;
}

.stageBox--active {
  box-shadow:
    var(--shadow),
    0 0 0 1px rgba(1, 164, 163, 0.28);
}

.stageBox--loading::before {
  opacity: 1;
  animation: stageBorderGlow 1.2s linear infinite;
}

.stageBox--done {
  animation: stageDonePulse 520ms ease 1;
}

.stageLabel {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 10px;
  background: rgba(0, 140, 200, 0.1);
  color: #0a5f8c;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.stageHeader {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
}

.stageToggle {
  border: 0;
  padding: 0;
  box-shadow: none;
  background: transparent;
  color: inherit;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 7px;
}

.stageToggle:hover {
  transform: none;
  box-shadow: none;
}

.stageSummary {
  font-size: 0.9rem;
  color: #3c586a;
  font-weight: 500;
}

.stageHeaderAction {
  min-width: 280px;
}

.stageHeaderAction button {
  width: 100%;
}

.stepAction {
  position: relative;
  min-height: 46px;
  text-align: left;
  padding-left: 72px;
}

.stepAction::before {
  content: attr(data-step);
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 42px;
  height: 28px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.86rem;
  letter-spacing: 0.02em;
  color: #095e74;
  background: linear-gradient(140deg, #c4f6f2, #e7fff7);
  box-shadow: inset 0 0 0 1px rgba(13, 132, 126, 0.24), 0 5px 12px rgba(8, 109, 139, 0.16);
}

.stageBody {
  margin-top: 14px;
  max-height: 5000px;
  opacity: 1;
  overflow: hidden;
  transition: max-height 260ms ease, opacity 180ms ease, margin-top 180ms ease;
}

.stageBox--collapsed {
  padding-top: 14px;
  padding-bottom: 14px;
}

.stageBox--collapsed .stageBody {
  max-height: 0;
  opacity: 0;
  margin-top: 0;
  pointer-events: none;
}

.panel--hero {
  position: relative;
  overflow: hidden;
}

.panel--hero::after {
  content: "";
  position: absolute;
  right: -56px;
  top: -56px;
  width: 180px;
  height: 180px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(11, 143, 134, 0.25), transparent 70%);
  pointer-events: none;
  z-index: 1;
}

h1,
h2 {
  margin: 0;
}

h1 {
  font-size: clamp(1.45rem, 2vw, 2rem);
  letter-spacing: -0.02em;
}

h2 {
  font-size: 1.15rem;
  letter-spacing: -0.01em;
}

.heroPills {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.heroPill {
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid #c9ddef;
  background: rgba(255, 255, 255, 0.82);
  color: #27526d;
  font-size: 0.74rem;
  font-weight: 700;
}

.sectionHint {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.topPanelBody {
  margin-top: 16px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 16px;
  align-items: start;
}

.grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 10px;
}

.grid--range {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.9rem;
}

.field input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  font-size: 0.92rem;
  color: var(--ink);
  background: #fff;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.field--range .rangeInputPair {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 112px;
  gap: 10px;
  align-items: center;
}

.field--range input[type="range"] {
  padding: 0;
  accent-color: var(--accent-strong);
}

.field--checkbox input[type="checkbox"] {
  width: 18px;
  height: 18px;
}

.field input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(11, 143, 134, 0.12);
}

.hint {
  color: #687983;
  font-size: 0.76rem;
}

button {
  border: 0;
  border-radius: 12px;
  padding: 11px 15px;
  font-weight: 700;
  letter-spacing: 0.01em;
  cursor: pointer;
  color: #fff;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%);
  box-shadow: 0 10px 20px rgba(0, 145, 188, 0.28);
  transition: transform 120ms ease, box-shadow 120ms ease, opacity 120ms ease;
}

button:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 24px rgba(0, 145, 188, 0.34);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.6;
  transform: none;
  box-shadow: none;
}

.stageToggle,
.stageToggle:hover,
.stageToggle:disabled {
  border: 0;
  padding: 0;
  box-shadow: none;
  background: transparent;
  color: inherit;
  opacity: 1;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 20px;
  z-index: 90;
  max-width: min(420px, calc(100vw - 24px));
  padding: 11px 14px;
  border-radius: 12px;
  border: 1px solid rgba(122, 206, 224, 0.58);
  background:
    linear-gradient(130deg, rgba(248, 255, 255, 0.97), rgba(225, 248, 245, 0.95)),
    linear-gradient(90deg, rgba(34, 166, 211, 0.2), rgba(18, 184, 144, 0.16));
  box-shadow: 0 12px 30px rgba(12, 39, 58, 0.2);
  color: #1a4156;
  font-size: 0.9rem;
  line-height: 1.42;
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast--show {
  opacity: 1;
  transform: translateY(0);
}

.panelHeader {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin-bottom: 10px;
}

.previewList {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.previewCard {
  border: 1px solid #ddd9cf;
  border-radius: 16px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #fff;
  cursor: pointer;
  transition: border-color 120ms ease, transform 120ms ease, box-shadow 120ms ease;
}

.previewCard:hover {
  transform: translateY(-2px);
  border-color: #c6d5d4;
  box-shadow: 0 12px 24px rgba(24, 40, 46, 0.08);
}

.previewCard.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(11, 143, 134, 0.18);
}

.previewMeta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.previewMeta strong {
  font-size: 0.95rem;
}

.previewBadge {
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 0.72rem;
  font-weight: 700;
  color: #09659c;
  background: rgba(20, 127, 210, 0.14);
}

.originalPreviewBox,
.previewCard img {
  border: 1px solid #dfd8ca;
  border-radius: 12px;
  background: #fcfaf6;
}

.originalPreviewBox {
  padding: 10px;
  margin-top: 14px;
}

.originalPreviewBox h3 {
  margin: 0 0 8px;
  font-size: 0.88rem;
}

.originalPreviewBox img,
.previewCard img {
  width: 100%;
  height: 220px;
  object-fit: contain;
  image-rendering: auto;
}

.hidden {
  display: none;
}

.filamentSection {
  border-top: 1px solid #ece6da;
  padding-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.filamentSectionTitle {
  margin: 0;
  font-size: 0.78rem;
  color: var(--muted);
}

.filamentRow {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
}

.filamentLabel {
  font-size: 0.78rem;
  color: #4b5b65;
}

.filamentPicker {
  position: relative;
}

.filamentPickerTrigger {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  padding: 8px 10px;
  cursor: pointer;
}

.filamentPickerName {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.78rem;
  text-align: left;
}

.filamentPickerMenu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  max-height: 230px;
  overflow-y: auto;
  border: 1px solid #ddd4c8;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.14);
  z-index: 20;
}

.filamentOption {
  width: 100%;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 0;
  border-bottom: 1px solid #eee7dc;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
}

.filamentOption:last-child {
  border-bottom: 0;
}

.filamentOption:hover {
  background: #f7f2ea;
}

.filamentOptionName {
  font-size: 0.78rem;
  text-align: left;
}

.filamentOptionHex {
  font-size: 0.72rem;
  color: #6d7b84;
}

.swatch {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  border: 1px solid rgba(0, 0, 0, 0.18);
}

.swatch.large {
  width: 16px;
  height: 16px;
}

.viewer {
  width: 100%;
  height: 480px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: linear-gradient(160deg, #e9f0f8, #f3faf4);
  overflow: hidden;
}

.resultLinks {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 0.9rem;
}

.resultLinks a {
  display: inline-flex;
  align-items: center;
  padding: 8px 10px;
  border: 1px solid #cfd9da;
  border-radius: 999px;
  color: #1a5e8f;
  background: #fff;
  text-decoration: none;
}

.resultLinks .primaryDownloadBtn {
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  border-radius: 999px;
  border: 0;
  padding: 12px 18px;
  color: #ffffff;
  background: linear-gradient(135deg, #0aa86f 0%, #0285c7 100%);
  box-shadow: 0 16px 28px rgba(2, 133, 199, 0.3);
}

.resultSearch {
  margin-top: 16px;
  border-top: 1px solid #d6e0e5;
  padding-top: 12px;
}

.resultSearch h3 {
  margin: 0 0 8px;
  font-size: 0.96rem;
}

.resultSearchRow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.resultSearchRow input {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  font-size: 0.9rem;
}

.resultSearchBtn {
  min-height: 42px;
}

.myResultsList {
  margin-top: 10px;
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}

.resultItem {
  border: 1px solid #d6dfe6;
  border-radius: 12px;
  padding: 8px;
  background: rgba(255, 255, 255, 0.85);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.resultThumbWrap {
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid #dde6eb;
  background: linear-gradient(160deg, #f7fbff, #f5fcf8);
}

.resultThumb {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: contain;
}

.resultThumbPlaceholder {
  width: 100%;
  aspect-ratio: 1 / 1;
  display: grid;
  place-items: center;
  font-size: 0.78rem;
  color: #6e808d;
}

.resultCardBody {
  padding: 2px 4px 4px;
}

.resultItemHead {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.resultItemName {
  font-size: 0.86rem;
  font-weight: 700;
  color: #16384a;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.resultItemMeta {
  margin-top: 2px;
  font-size: 0.74rem;
  color: #5a6f7d;
}

.resultItemActions {
  margin-top: 8px;
  display: flex;
  gap: 8px;
}

.resultGhostBtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #c8d6df;
  background: #fff;
  color: #1c567e;
  box-shadow: none;
  border-radius: 999px;
  padding: 7px 10px;
  font-size: 0.76rem;
  text-decoration: none;
}

@property --spin-angle {
  syntax: "<angle>";
  inherits: false;
  initial-value: 0deg;
}

@keyframes stageBorderGlow {
  from {
    --spin-angle: 0deg;
    filter: drop-shadow(0 0 8px rgba(0, 190, 255, 0.3));
  }
  50% {
    filter: drop-shadow(0 0 12px rgba(42, 255, 154, 0.45));
  }
  to {
    --spin-angle: 360deg;
    filter: drop-shadow(0 0 8px rgba(102, 163, 255, 0.34));
  }
}

@keyframes stageDonePulse {
  0% {
    box-shadow: var(--shadow), 0 0 0 0 rgba(16, 200, 255, 0.18);
  }
  35% {
    box-shadow: var(--shadow), 0 0 0 5px rgba(16, 200, 255, 0.48);
  }
  70% {
    box-shadow: var(--shadow), 0 0 0 1px rgba(42, 255, 154, 0.55);
  }
  100% {
    box-shadow: var(--shadow), 0 0 0 0 rgba(16, 200, 255, 0.0);
  }
}

@media (max-width: 1080px) {
  .appShell {
    padding: 0 0 34px;
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .leftRail {
    position: static;
    top: auto;
    gap: 0;
  }

  .brandNav {
    display: none;
  }

  .appBrand {
    position: sticky;
    top: 0;
    z-index: 30;
    display: block;
    border-radius: 0 0 16px 16px;
    padding: 14px 16px 12px;
    border: 0;
    border-bottom: 1px solid rgba(169, 192, 208, 0.45);
    box-shadow: 0 10px 20px rgba(13, 35, 50, 0.12);
    backdrop-filter: blur(10px);
    background:
      linear-gradient(135deg, rgba(233, 247, 255, 0.95), rgba(229, 247, 242, 0.92)),
      linear-gradient(92deg, rgba(21, 138, 212, 0.18), rgba(12, 179, 141, 0.12));
  }

  .appTitle {
    font-size: clamp(1.22rem, 5vw, 1.48rem);
    background: linear-gradient(112deg, #0c66b5 0%, #129d8a 42%, #3a7acc 100%);
    -webkit-background-clip: text;
    background-clip: text;
  }

  .appSubtitle {
    margin-top: 6px;
    font-size: 0.84rem;
    line-height: 1.4;
  }

  .accountPanel {
    padding: 12px 14px;
  }

  .accountPanelHead {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .localeField {
    min-width: 0;
    width: 100%;
  }

  .accountPanelBody {
    align-items: flex-start;
  }

  .authUserBox {
    grid-template-columns: 36px minmax(0, 1fr) auto;
  }

  .gnbNav {
    display: flex;
    gap: 8px;
    margin-top: 10px;
  }

  .gnbNavLink {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 6px 11px;
    border-radius: 10px;
    border: 1px solid rgba(21, 76, 112, 0.18);
    background: rgba(255, 255, 255, 0.9);
    color: #1f4a64;
    font-size: 0.76rem;
    font-weight: 700;
    text-decoration: none;
  }

  .gnbNavLink--active {
    color: #ffffff;
    border-color: transparent;
    background: linear-gradient(130deg, #009d8c, #1179bf);
  }

  .appPills {
    display: none;
  }

  .layout {
    padding: 0 16px;
  }

  /* In top-GNB layout, keep brand header compact. */
  .appBrand .originalPreviewBox {
    display: none !important;
  }
}

@media (max-width: 900px) {
  .layout {
    gap: 14px;
    padding: 0 12px;
  }

  .panel {
    padding: 16px;
    border-radius: 16px;
  }

  .stageHeader {
    grid-template-columns: 1fr;
  }

  .stageHeaderAction {
    min-width: 0;
    width: 100%;
  }

  .stageHeaderAction button,
  button {
    padding: 10px 12px;
    font-size: 0.9rem;
  }

  .stageHeaderAction .stepAction {
    min-height: 44px;
    padding-left: 72px;
  }

  .stepAction::before {
    left: 10px;
    width: 40px;
    height: 26px;
    font-size: 0.8rem;
  }

  .panelHeader {
    flex-direction: column;
    align-items: stretch;
  }

  .topPanelBody {
    grid-template-columns: 1fr;
  }

  .grid {
    grid-template-columns: 1fr;
  }

  .field--range .rangeInputPair {
    grid-template-columns: 1fr;
  }

  .stageSummary {
    font-size: 0.84rem;
  }

  .previewList {
    grid-template-columns: 1fr;
  }

  .viewer {
    height: 360px;
  }

  .resultSearchRow {
    grid-template-columns: 1fr;
  }

  .resultLedgerHead {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 768px) {
  .appBrand {
    padding: 12px 12px 10px;
  }

  .accountPanel {
    padding: 12px;
  }

  .authUserMeta small {
    display: none;
  }

  .topPanelBody {
    gap: 12px;
  }
}

@media (max-width: 580px) {
  .appSubtitle {
    display: none;
  }

  .authUserMeta strong {
    max-width: 84px;
    font-size: 0.76rem;
  }

  .authLogoutBtn {
    padding: 6px 8px;
    font-size: 0.72rem;
  }

  .gnbNav {
    gap: 6px;
    margin-top: 2px;
  }

  .gnbNavLink {
    min-height: 32px;
    padding: 5px 8px;
    font-size: 0.72rem;
  }

  .toast {
    left: 12px;
    right: 12px;
    bottom: 12px;
    max-width: none;
    font-size: 0.84rem;
    padding: 10px 12px;
  }
}
