:root {
  --bg-1: #f4f7ff;
  --bg-2: #eef5ff;
  --bg-3: #fff7ef;
  --bg-4: #f7fff8;

  --text-main: #16233f;
  --text-sub: #5d6880;
  --text-soft: #8d97ab;

  --primary: #4f7cff;
  --primary-dark: #315fdc;
  --primary-light: #8fb0ff;
  --primary-soft: #e9f0ff;

  --accent-orange: #ffb648;
  --accent-pink: #ff8ecf;
  --accent-mint: #72d8b5;
  --accent-violet: #a693ff;

  --success: #1fb874;
  --warning: #ffb648;
  --danger: #ff6b7d;

  --white: #ffffff;
  --card: rgba(255, 255, 255, 0.72);
  --card-strong: rgba(255, 255, 255, 0.92);
  --card-soft: rgba(255, 255, 255, 0.58);
  --border: rgba(255, 255, 255, 0.65);

  --shadow-xs: 0 4px 12px rgba(49, 76, 146, 0.06);
  --shadow-sm: 0 10px 24px rgba(49, 76, 146, 0.08);
  --shadow-md: 0 18px 40px rgba(44, 68, 134, 0.12);
  --shadow-lg: 0 26px 60px rgba(37, 58, 118, 0.16);
  --shadow-xl: 0 34px 90px rgba(33, 56, 118, 0.2);

  --radius-2xl: 36px;
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 18px;
  --radius-sm: 14px;

  --transition-fast: 0.18s ease;
  --transition-med: 0.28s ease;
  --transition-slow: 0.42s ease;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: "Inter", "Pretendard", "Noto Sans KR", Arial, sans-serif;
  color: var(--text-main);
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.96) 0%, transparent 34%),
    radial-gradient(circle at 85% 10%, rgba(255, 214, 145, 0.25) 0%, transparent 20%),
    linear-gradient(135deg, var(--bg-1) 0%, var(--bg-2) 45%, var(--bg-3) 78%, var(--bg-4) 100%);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  min-height: 100vh;
  overflow-x: hidden;
}

.app-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(circle at 12% 18%, rgba(79, 124, 255, 0.2), transparent 18%),
    radial-gradient(circle at 88% 16%, rgba(255, 182, 72, 0.18), transparent 16%),
    radial-gradient(circle at 78% 72%, rgba(114, 216, 181, 0.18), transparent 18%),
    radial-gradient(circle at 28% 82%, rgba(166, 147, 255, 0.14), transparent 16%);
}

.app-bg::before,
.app-bg::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  filter: blur(30px);
  opacity: 0.9;
}

.app-bg::before {
  width: 280px;
  height: 280px;
  top: 100px;
  right: 12%;
  background: rgba(255, 255, 255, 0.36);
}

.app-bg::after {
  width: 340px;
  height: 340px;
  bottom: 40px;
  left: 8%;
  background: rgba(255, 255, 255, 0.24);
}

.app-shell {
  position: relative;
  z-index: 1;
  max-width: 1480px;
  margin: 0 auto;
  padding: 28px;
}

/* =========================
   Premium Header
   ========================= */

.topbar {
  position: relative;
  margin-bottom: 24px;
}

.topbar-main {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  padding: 18px 22px;
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.58);
  border: 1px solid rgba(255, 255, 255, 0.72);
  box-shadow:
    0 18px 40px rgba(41, 66, 134, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  overflow: hidden;
}

.topbar-main::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.28), transparent 45%),
    radial-gradient(circle at 12% 30%, rgba(79, 124, 255, 0.1), transparent 24%),
    radial-gradient(circle at 88% 24%, rgba(255, 182, 72, 0.12), transparent 20%);
}

.topbar-main::after {
  content: "";
  position: absolute;
  top: -70px;
  right: 90px;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(143, 176, 255, 0.16), transparent 70%);
  pointer-events: none;
}

.brand {
  position: relative;
  display: flex;
  align-items: center;
  gap: 18px;
  min-width: 0;
  z-index: 1;
}

.brand-mark-wrap {
  position: relative;
  flex-shrink: 0;
}

.brand-mark-wrap::before {
  content: "";
  position: absolute;
  inset: -10px;
  border-radius: 30px;
  background: radial-gradient(circle, rgba(79, 124, 255, 0.18), transparent 68%);
  z-index: -1;
}

.brand-mark {
  position: relative;
  width: 78px;
  height: 78px;
  border-radius: 26px;
  display: grid;
  place-items: center;
  font-size: 36px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(232, 240, 255, 0.88));
  border: 1px solid rgba(255, 255, 255, 0.92);
  box-shadow:
    0 14px 30px rgba(60, 91, 176, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.95);
  transform: translateY(-1px);
}

.brand-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}

.brand-kicker {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  margin-bottom: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(79, 124, 255, 0.1);
  color: var(--primary-dark);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.12em;
  line-height: 1;
  text-transform: uppercase;
  box-shadow: inset 0 0 0 1px rgba(79, 124, 255, 0.08);
}

.brand-text h1 {
  margin: 0;
  font-size: 33px;
  line-height: 1.02;
  letter-spacing: -0.05em;
  font-weight: 950;
  color: var(--text-main);
  text-wrap: balance;
}

.brand-text p {
  margin: 7px 0 0;
  color: var(--text-sub);
  font-size: 15px;
  line-height: 1.4;
  font-weight: 650;
}

.topbar-badge {
  position: relative;
  z-index: 1;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid rgba(255, 255, 255, 0.84);
  box-shadow:
    0 12px 26px rgba(57, 81, 145, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.92);
  font-size: 14px;
  font-weight: 800;
  color: var(--text-sub);
  white-space: nowrap;
}

.badge-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--success);
  box-shadow:
    0 0 0 6px rgba(31, 184, 116, 0.12),
    0 0 18px rgba(31, 184, 116, 0.24);
  animation: badgePulse 1.8s infinite ease-in-out;
}

/* =========================
   Main Layout
   ========================= */

.main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.95fr) minmax(290px, 0.72fr);
  gap: 24px;
  align-items: start;
}

.hero-card,
.panel-card {
  position: relative;
  overflow: hidden;
  background: var(--card);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
}

.hero-card::before,
.panel-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.34) 0%,
    rgba(255, 255, 255, 0.08) 100%
  );
}

.hero-card {
  border-radius: 38px;
  padding: 28px 30px 30px;
  box-shadow:
    var(--shadow-xl),
    inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

.hero-card::after {
  content: "";
  position: absolute;
  top: -80px;
  right: -50px;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(143, 176, 255, 0.18), transparent 68%);
  pointer-events: none;
}

.hero-head {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  margin-bottom: 18px;
}

.hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.eyebrow {
  display: none;
}

.hero-head h2 {
  margin: 0;
  max-width: 760px;
  font-size: 42px;
  line-height: 1.08;
  letter-spacing: -0.05em;
  font-weight: 900;
}

.status-chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 13px 18px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.94);
  box-shadow:
    0 12px 24px rgba(57, 81, 145, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.95);
  font-size: 14px;
  font-weight: 800;
  color: var(--text-sub);
  white-space: nowrap;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 5px rgba(31, 184, 116, 0.12);
}

.hero-actions {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px 20px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.action-stack {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
}

.lang-badge {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 9px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.86);
  box-shadow:
    0 10px 20px rgba(79, 124, 255, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.92);
  color: var(--primary-dark);
  font-size: 14px;
  font-weight: 800;
  line-height: 1;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.lang-badge span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.lang-arrow {
  color: var(--primary);
  font-size: 16px;
  font-weight: 900;
  opacity: 0.9;
}

.primary-btn {
  position: relative;
  appearance: none;
  border: none;
  border-radius: 26px;
  padding: 20px 34px;
  min-width: 280px;
  min-height: 78px;
  background:
    linear-gradient(135deg, #4f7cff 0%, #6d95ff 52%, #90aeff 100%);
  color: #ffffff;
  font-size: 22px;
  font-weight: 900;
  letter-spacing: -0.03em;
  cursor: pointer;
  box-shadow:
    0 22px 40px rgba(79, 124, 255, 0.28),
    0 10px 18px rgba(79, 124, 255, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.44);
  transition:
    transform var(--transition-fast),
    box-shadow var(--transition-fast),
    filter var(--transition-fast),
    background var(--transition-fast);
  isolation: isolate;
}

.primary-btn::before {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: 25px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.24), rgba(255, 255, 255, 0.04));
  z-index: -1;
}

.primary-btn::after {
  content: "";
  position: absolute;
  inset: -10px;
  border-radius: 34px;
  background: radial-gradient(circle, rgba(79, 124, 255, 0.22), transparent 62%);
  z-index: -2;
  transition: opacity var(--transition-fast), transform var(--transition-fast);
}

.primary-btn:hover {
  transform: translateY(-3px) scale(1.01);
  box-shadow:
    0 26px 48px rgba(79, 124, 255, 0.34),
    0 12px 22px rgba(79, 124, 255, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.44);
  filter: saturate(1.06);
}

.primary-btn:hover::after {
  opacity: 1;
  transform: scale(1.03);
}

.primary-btn:active {
  transform: translateY(0) scale(0.995);
}

.primary-btn:focus-visible,
.ghost-btn:focus-visible {
  outline: 3px solid rgba(79, 124, 255, 0.26);
  outline-offset: 4px;
}

.primary-btn.listening {
  background:
    linear-gradient(135deg, #1fb874 0%, #37ca8d 50%, #6be0ae 100%);
  box-shadow:
    0 22px 42px rgba(31, 184, 116, 0.3),
    0 10px 20px rgba(31, 184, 116, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.44);
  animation: listeningPulse 1.7s infinite ease-in-out;
}

.primary-btn.listening::after {
  background: radial-gradient(circle, rgba(31, 184, 116, 0.28), transparent 62%);
}

.primary-btn:disabled {
  cursor: not-allowed;
  opacity: 0.88;
  filter: grayscale(0.06);
  transform: none !important;
}

.helper-text {
  margin: 0;
  color: var(--text-sub);
  font-size: 14px;
  line-height: 1.5;
  font-weight: 700;
  max-width: 300px;
}

/* =========================
   Translation Cards
   ========================= */

.translation-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 68px minmax(0, 1fr);
  gap: 16px;
  align-items: stretch;
}

.center-arrow {
  position: relative;
  display: grid;
  place-items: center;
  align-self: center;
  width: 68px;
  min-height: 68px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.76);
  border: 1px solid rgba(255, 255, 255, 0.84);
  box-shadow: var(--shadow-sm);
  font-size: 30px;
  color: var(--primary);
  font-weight: 900;
}

.glass-card {
  position: relative;
  border-radius: var(--radius-2xl);
  border: 1px solid rgba(255, 255, 255, 0.82);
  box-shadow:
    var(--shadow-md),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  padding: 24px;
  padding-top: 58px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.translation-grid .glass-card {
  min-height: 300px;
}

.glass-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.25) 0%,
    rgba(255, 255, 255, 0.04) 100%
  );
}

.glass-card::after {
  content: "";
  position: absolute;
  top: -40px;
  right: -40px;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  pointer-events: none;
}

.card-label {
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 62px;
  height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  box-shadow:
    0 8px 18px rgba(60, 85, 155, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.84);
}

.input-card {
  background:
    linear-gradient(180deg, rgba(255, 248, 233, 0.96), rgba(255, 255, 255, 0.88));
}

.input-card::after {
  background: radial-gradient(circle, rgba(255, 182, 72, 0.18), transparent 68%);
}

.input-card .card-label {
  background: rgba(255, 243, 221, 0.96);
  color: #b56d00;
  border: 1px solid rgba(255, 220, 160, 0.8);
}

.output-card {
  background:
    linear-gradient(180deg, rgba(235, 246, 255, 0.98), rgba(255, 255, 255, 0.88));
}

.output-card::after {
  background: radial-gradient(circle, rgba(79, 124, 255, 0.18), transparent 68%);
}

.output-card .card-label {
  background: rgba(232, 242, 255, 0.96);
  color: #2f62d8;
  border: 1px solid rgba(186, 212, 255, 0.9);
}

.card-head {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
  padding-right: 72px;
}

.card-icon {
  width: 58px;
  height: 58px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(247, 250, 255, 0.88));
  border: 1px solid rgba(255, 255, 255, 0.92);
  box-shadow:
    0 10px 22px rgba(80, 103, 172, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.95);
  font-size: 26px;
  flex-shrink: 0;
}

.card-head h3 {
  margin: 0;
  font-size: 24px;
  line-height: 1.15;
  letter-spacing: -0.04em;
  font-weight: 900;
}

.card-head p {
  margin: 4px 0 0;
  color: var(--text-sub);
  font-size: 14px;
  line-height: 1.45;
  font-weight: 700;
}

.card-body {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  align-items: center;
}

.result-text {
  margin: 0;
  width: 100%;
  font-size: 38px;
  line-height: 1.42;
  font-weight: 900;
  letter-spacing: -0.04em;
  word-break: keep-all;
  overflow-wrap: break-word;
  color: var(--text-main);
  text-wrap: pretty;
}

#inputText,
#translatedText {
  color: var(--text-main);
}

.placeholder-text {
  color: #7c879c !important;
  font-weight: 800;
}

.input-card .result-text {
  color: #273142;
}

.output-card .result-text {
  color: #17459d;
}

/* =========================
   Side Panel
   ========================= */

.side-panel {
  display: grid;
  gap: 20px;
}

.panel-card {
  border-radius: 30px;
  padding: 24px;
  box-shadow:
    var(--shadow-md),
    inset 0 1px 0 rgba(255, 255, 255, 0.84);
}

.panel-card h3 {
  margin: 0 0 16px;
  font-size: 22px;
  line-height: 1.15;
  letter-spacing: -0.04em;
  font-weight: 900;
}

.tip-card {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(249, 251, 255, 0.66));
}

.tip-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
}

.tip-list li {
  position: relative;
  padding: 15px 16px 15px 48px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--text-sub);
  font-size: 15px;
  line-height: 1.55;
  font-weight: 700;
  box-shadow: 0 8px 18px rgba(80, 103, 172, 0.07);
}

.tip-list li::before {
  content: "✓";
  position: absolute;
  left: 16px;
  top: 14px;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: rgba(31, 184, 116, 0.12);
  color: var(--success);
  font-size: 13px;
  font-weight: 900;
}

.history-card {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.8), rgba(245, 249, 255, 0.68));
}

.history-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.ghost-btn {
  appearance: none;
  border: none;
  border-radius: 16px;
  padding: 11px 15px;
  background:
    linear-gradient(180deg, #f4f7ff 0%, #e8efff 100%);
  color: var(--primary-dark);
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  box-shadow:
    0 8px 18px rgba(79, 124, 255, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.82);
  transition:
    background var(--transition-fast),
    transform var(--transition-fast),
    box-shadow var(--transition-fast);
}

.ghost-btn:hover {
  background:
    linear-gradient(180deg, #eef4ff 0%, #dfe8ff 100%);
  transform: translateY(-1px);
  box-shadow:
    0 12px 22px rgba(79, 124, 255, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.86);
}

.history-list {
  list-style: none;
  margin: 0;
  padding: 2px;
  display: grid;
  gap: 12px;
  max-height: 470px;
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(79, 124, 255, 0.35) transparent;
}

.history-list::-webkit-scrollbar {
  width: 10px;
}

.history-list::-webkit-scrollbar-thumb {
  background: rgba(79, 124, 255, 0.28);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

.history-list::-webkit-scrollbar-track {
  background: transparent;
}

.history-list li {
  position: relative;
  padding: 16px 16px 16px 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow:
    0 10px 22px rgba(80, 103, 172, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.88);
  color: var(--text-sub);
  font-size: 15px;
  line-height: 1.6;
  font-weight: 700;
  border: 1px solid rgba(255, 255, 255, 0.84);
  animation: itemFadeUp 0.34s ease;
}

.history-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 14px;
  bottom: 14px;
  width: 6px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--primary), var(--accent-violet));
}

/* =========================
   Hover Support
   ========================= */

@media (hover: hover) {
  .topbar-main {
    transition:
      transform 0.22s ease,
      box-shadow 0.22s ease,
      border-color 0.22s ease;
  }

  .topbar-main:hover {
    transform: translateY(-1px);
    box-shadow:
      0 22px 46px rgba(41, 66, 134, 0.12),
      inset 0 1px 0 rgba(255, 255, 255, 0.88);
    border-color: rgba(255, 255, 255, 0.82);
  }

  .brand-mark {
    transition:
      transform 0.22s ease,
      box-shadow 0.22s ease;
  }

  .topbar-main:hover .brand-mark {
    transform: translateY(-2px) scale(1.02);
    box-shadow:
      0 18px 34px rgba(60, 91, 176, 0.16),
      inset 0 1px 0 rgba(255, 255, 255, 0.95);
  }
}

/* =========================
   Animations
   ========================= */

@keyframes badgePulse {
  0%,
  100% {
    transform: scale(1);
    box-shadow:
      0 0 0 6px rgba(31, 184, 116, 0.12),
      0 0 18px rgba(31, 184, 116, 0.28);
  }
  50% {
    transform: scale(1.08);
    box-shadow:
      0 0 0 9px rgba(31, 184, 116, 0.08),
      0 0 24px rgba(31, 184, 116, 0.3);
  }
}

@keyframes listeningPulse {
  0%,
  100% {
    transform: scale(1);
    box-shadow:
      0 22px 42px rgba(31, 184, 116, 0.3),
      0 10px 20px rgba(31, 184, 116, 0.2),
      inset 0 1px 0 rgba(255, 255, 255, 0.44);
  }
  50% {
    transform: scale(1.025);
    box-shadow:
      0 28px 52px rgba(31, 184, 116, 0.34),
      0 14px 26px rgba(31, 184, 116, 0.22),
      0 0 0 10px rgba(31, 184, 116, 0.08),
      inset 0 1px 0 rgba(255, 255, 255, 0.44);
  }
}

@keyframes itemFadeUp {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* =========================
   Responsive
   ========================= */

@media (max-width: 1280px) {
  .hero-head h2 {
    font-size: 38px;
  }

  .result-text {
    font-size: 34px;
  }
}

@media (max-width: 1180px) {
  .main-grid {
    grid-template-columns: 1fr;
  }

  .side-panel {
    grid-template-columns: 1fr 1fr;
  }

  .hero-card {
    padding: 24px 26px 26px;
  }
}

@media (max-width: 920px) {
  .app-shell {
    padding: 12px;
  }

  .topbar {
    margin-bottom: 14px;
  }

  .topbar-main {
    padding: 14px 16px;
    border-radius: 24px;
    gap: 14px;
    align-items: flex-start;
  }

  .brand {
    gap: 12px;
  }

  .brand-mark-wrap::before {
    inset: -7px;
  }

  .brand-mark {
    width: 62px;
    height: 62px;
    border-radius: 20px;
    font-size: 30px;
    transform: none;
  }

  .brand-kicker {
    margin-bottom: 6px;
    padding: 5px 8px;
    font-size: 10px;
  }

  .brand-text h1 {
    font-size: 25px;
    line-height: 1.03;
  }

  .brand-text p {
    margin-top: 5px;
    font-size: 13px;
    line-height: 1.35;
  }

  .topbar-badge {
    padding: 10px 12px;
    font-size: 12px;
  }

  .main-grid {
    gap: 14px;
  }

  .hero-card {
    padding: 18px;
    border-radius: 24px;
  }

  .hero-head {
    flex-direction: column;
    gap: 10px;
    margin-bottom: 12px;
  }

  .hero-head h2 {
    font-size: 28px;
    line-height: 1.1;
    max-width: 100%;
  }

  .status-chip {
    padding: 9px 12px;
    font-size: 12px;
  }

  .hero-actions {
    gap: 10px;
    margin-bottom: 12px;
    align-items: stretch;
  }

  .action-stack {
    width: 100%;
    align-items: stretch;
    gap: 8px;
  }

  .lang-badge {
    justify-content: center;
    width: 100%;
    padding: 8px 12px;
    font-size: 12px;
  }

  .primary-btn {
    width: 100%;
    min-width: 0;
    min-height: 60px;
    padding: 14px 18px;
    font-size: 18px;
    border-radius: 18px;
  }

  .helper-text {
    max-width: none;
    font-size: 12px;
    line-height: 1.4;
  }

  .translation-grid {
    grid-template-columns: 1fr;
    gap: 6px;
    align-items: stretch;
  }

  .center-arrow {
    width: 100%;
    min-height: 16px;
    background: transparent;
    border: none;
    box-shadow: none;
    border-radius: 0;
    transform: none;
    font-size: 0;
    margin: -1px 0;
  }

  .center-arrow::before {
    content: "↓";
    font-size: 16px;
    font-weight: 900;
    color: var(--primary);
    line-height: 1;
  }

  .translation-grid .glass-card {
    min-height: unset;
    height: auto;
    padding: 10px 12px 12px;
    padding-top: 12px;
    border-radius: 18px;
  }

  .glass-card::after {
    width: 90px;
    height: 90px;
    top: -26px;
    right: -26px;
    opacity: 0.7;
  }

  .card-label {
    display: none;
  }

  .card-head {
    display: grid;
    grid-template-columns: 38px 1fr;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    padding-right: 0;
  }

  .card-icon {
    width: 38px;
    height: 38px;
    border-radius: 11px;
    font-size: 18px;
    box-shadow:
      0 6px 14px rgba(80, 103, 172, 0.1),
      inset 0 1px 0 rgba(255, 255, 255, 0.92);
  }

  .card-head h3 {
    font-size: 15px;
    line-height: 1.1;
    margin: 0;
    letter-spacing: -0.03em;
  }

  .card-head p {
    display: none;
  }

  .card-body {
    display: block;
    padding-left: 48px;
  }

  .result-text {
    font-size: 18px;
    line-height: 1.34;
    letter-spacing: -0.03em;
  }

  .side-panel {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .panel-card {
    padding: 16px;
    border-radius: 22px;
  }

  .panel-card h3 {
    font-size: 18px;
    margin-bottom: 12px;
  }

  .tip-list li,
  .history-list li {
    font-size: 13px;
  }

  .history-list {
    max-height: 240px;
  }
}

@media (max-width: 640px) {
  .app-shell {
    padding: 10px;
  }

  .topbar-main {
    padding: 12px 14px;
    border-radius: 22px;
    gap: 10px;
  }

  .brand {
    gap: 10px;
  }

  .brand-mark {
    width: 54px;
    height: 54px;
    border-radius: 18px;
    font-size: 26px;
  }

  .brand-kicker {
    margin-bottom: 5px;
    padding: 4px 7px;
    font-size: 9px;
    letter-spacing: 0.1em;
  }

  .brand-text h1 {
    font-size: 21px;
    line-height: 1.02;
  }

  .brand-text p {
    display: none;
  }

  .topbar-badge {
    display: none;
  }

  .hero-card,
  .panel-card {
    border-radius: 22px;
  }

  .hero-card {
    padding: 14px;
  }

  .hero-head {
    margin-bottom: 10px;
  }

  .hero-head h2 {
    font-size: 22px;
    line-height: 1.1;
    letter-spacing: -0.04em;
  }

  .hero-actions {
    gap: 8px;
    margin-bottom: 10px;
  }

  .action-stack {
    gap: 7px;
  }

  .lang-badge {
    gap: 10px;
    padding: 7px 10px;
    font-size: 11px;
    font-weight: 800;
  }

  .lang-arrow {
    font-size: 14px;
  }

  .primary-btn {
    min-height: 58px;
    padding: 14px 16px;
    font-size: 17px;
    border-radius: 18px;
  }

  .helper-text {
    display: none;
  }

  .translation-grid {
    gap: 5px;
  }

  .translation-grid .glass-card {
    min-height: unset;
    height: auto;
    padding: 9px 10px 11px;
    padding-top: 11px;
    border-radius: 16px;
  }

  .card-head {
    grid-template-columns: 34px 1fr;
    gap: 8px;
    margin-bottom: 6px;
  }

  .card-icon {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    font-size: 16px;
  }

  .card-body {
    padding-left: 42px;
  }

  .card-head h3 {
    font-size: 14px;
  }

  .result-text {
    font-size: 16px;
    line-height: 1.3;
  }

  .placeholder-text {
    font-size: 15px;
  }

  .center-arrow::before {
    font-size: 15px;
  }
}

@media (max-width: 390px) {
  .translation-grid .glass-card {
    min-height: unset;
    height: auto;
    padding: 8px 10px 10px;
    padding-top: 10px;
  }

  .card-head {
    margin-bottom: 5px;
  }

  .result-text {
    font-size: 15px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}