:root {
  --ink: #173e59;
  --ink-soft: #527084;
  --deep: #1f587d;
  --blue: #368caf;
  --blue-bright: #56a9c5;
  --mist: #c8ddea;
  --mist-pale: #e8f0f3;
  --cream: #f8f6f1;
  --paper: rgba(255, 255, 255, .72);
  --line: rgba(35, 93, 124, .14);
  --shadow: 0 26px 70px rgba(47, 95, 120, .12);
  --radius-xl: 34px;
  --radius-lg: 24px;
  --motion-ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }
*, *::before, *::after { transition-timing-function: var(--motion-ease); }
html { scroll-behavior: smooth; }
body {
  position: relative;
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background:
    radial-gradient(circle at 83% 12%, rgba(183, 213, 228, .56), transparent 24rem),
    linear-gradient(180deg, #fbfaf7 0%, #f6f7f4 46%, #edf4f5 100%);
  font-family: "Avenir Next", "PingFang SC", "Noto Sans CJK SC", system-ui, sans-serif;
  line-height: 1.5;
  overflow-x: hidden;
}
body::before,
body::after {
  content: "";
  position: fixed;
  inset: -12% -8% auto;
  z-index: -1;
  height: 28rem;
  pointer-events: none;
  filter: blur(36px);
  opacity: .7;
  animation: drift 18s ease-in-out infinite alternate;
}
body::before {
  left: -10%;
  background: radial-gradient(circle, rgba(120, 186, 208, .24), transparent 68%);
  animation-duration: 22s;
}
body::after {
  right: -10%;
  background: radial-gradient(circle, rgba(92, 148, 179, .18), transparent 72%);
  animation-duration: 26s;
}
button, input, textarea { font: inherit; }
button { color: inherit; }
button:focus-visible, input:focus-visible, textarea:focus-visible { outline: 3px solid rgba(54, 140, 175, .28); outline-offset: 3px; }
body.auth-locked { overflow: hidden; }

.auth-gate {
  position: fixed; inset: 0; z-index: 50; display: grid; grid-template-columns: minmax(340px, .9fr) minmax(500px, 1.1fr);
  min-height: 100dvh; overflow: auto; background: #f8f6f1;
}
.auth-gate[hidden] { display: none; }
.auth-visual { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; overflow: hidden; color: white; text-align: center; background: linear-gradient(155deg, #d5e5ed 0%, #75adc4 48%, #215d80 100%); }
.auth-visual::before, .auth-visual::after { content: ""; position: absolute; border: 1px solid rgba(255,255,255,.23); border-radius: 48% 52% 44% 56%; }
.auth-visual::before { width: 420px; height: 420px; animation: rotate 38s linear infinite; }
.auth-visual::after { width: 570px; height: 570px; animation: rotate 56s linear infinite reverse; }
.auth-orb { position: relative; z-index: 1; width: 210px; height: 210px; display: grid; place-items: center; border-radius: 50%; background: rgba(255,255,255,.18); box-shadow: inset 0 0 60px rgba(255,255,255,.23), 0 30px 80px rgba(18,67,95,.2); backdrop-filter: blur(14px); }
.auth-orb img { width: 128px; height: 128px; filter: brightness(0) invert(1); opacity: .9; }
.auth-visual p { position: relative; z-index: 1; margin: 36px 0 8px; font-family: Georgia, "Songti SC", serif; font-size: 28px; letter-spacing: .14em; }
.auth-visual > span { position: relative; z-index: 1; max-width: 320px; color: rgba(255,255,255,.72); font-size: 12px; line-height: 1.8; letter-spacing: .05em; }
.auth-card { width: min(480px, calc(100% - 64px)); margin: auto; padding: 45px 0; }
.auth-brand { display: flex; align-items: center; gap: 11px; margin-bottom: 48px; }
.auth-brand img { width: 43px; height: 43px; }
.auth-brand span { display: grid; line-height: 1; }
.auth-brand b { font-family: Georgia, "Songti SC", serif; letter-spacing: .2em; }
.auth-brand small { margin-top: 6px; color: var(--ink-soft); font-size: 7px; letter-spacing: .35em; }
.auth-eyebrow { margin: 0 0 10px; color: var(--blue); font-size: 9px; letter-spacing: .25em; }
.auth-card h1 { margin: 0; font-family: Georgia, "Songti SC", serif; font-size: clamp(27px, 3vw, 38px); font-weight: 400; letter-spacing: .06em; }
.auth-lead { margin: 12px 0 25px; color: #768b97; font-size: 12px; line-height: 1.8; }
.auth-lead b { color: var(--deep); }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; margin-bottom: 24px; border-bottom: 1px solid var(--line); }
.auth-tabs button { border: 0; border-bottom: 2px solid transparent; background: none; padding: 10px; color: #91a0a7; font-size: 12px; cursor: pointer; }
.auth-tabs button.active { border-bottom-color: var(--blue); color: var(--deep); }
.auth-form { display: none; gap: 14px; }
.auth-form.active { display: grid; }
.auth-form label, .account-panel label { display: grid; gap: 6px; color: #627b89; font-size: 10px; }
.auth-form input, .account-panel input, .account-panel select { width: 100%; border: 1px solid rgba(37,96,128,.16); border-radius: 13px; background: rgba(255,255,255,.72); padding: 12px 13px; color: var(--ink); font-size: 12px; }
.auth-form input:focus, .account-panel input:focus, .account-panel select:focus { border-color: rgba(54,140,175,.55); outline: 3px solid rgba(54,140,175,.1); }
.auth-submit { border: 0; border-radius: 13px; color: white; background: linear-gradient(135deg, #3f98b8, #205a7e); padding: 13px 17px; box-shadow: 0 11px 25px rgba(31,88,125,.17); cursor: pointer; }
.auth-submit span { float: right; }
.auth-submit:disabled { opacity: .55; cursor: wait; }
.text-action, .back-action { width: max-content; margin: 0 auto; border: 0; background: none; padding: 3px; color: #658294; font-size: 10px; cursor: pointer; }
.back-action { margin: 0 0 24px; }
.consent { display: flex !important; grid-template-columns: auto 1fr; align-items: start; }
.consent input { width: 14px; margin-top: 2px; }
.consent span { color: #83959e; line-height: 1.6; }
.dev-captcha { margin: 0; border: 1px dashed rgba(54,140,175,.25); border-radius: 11px; background: #edf5f6; padding: 10px; color: #668493; font-size: 9px; text-align: center; }
cap-widget { --cap-background: rgba(255,255,255,.72); --cap-border-color: rgba(37,96,128,.16); --cap-border-radius: 12px; --cap-color: #173e59; }
.auth-message { min-height: 17px; margin: 12px 0 0; color: #b05f58; font-size: 10px; text-align: center; }
.auth-message.success { color: #43846f; }
.auth-step[hidden] { display: none; }
.code-input { font-size: 22px !important; letter-spacing: .42em; text-align: center; }
.reset-confirm { margin-top: 15px; padding-top: 17px; border-top: 1px solid var(--line); }

.ambient { position: fixed; z-index: -1; border-radius: 999px; filter: blur(1px); pointer-events: none; animation: ambientDrift 14s ease-in-out infinite alternate; }
.ambient-one { width: 26rem; height: 26rem; left: -13rem; top: 34rem; background: rgba(176, 210, 225, .22); }
.ambient-two { width: 18rem; height: 18rem; right: -8rem; top: 72rem; background: rgba(86, 169, 197, .12); animation-duration: 18s; }

.site-header {
  width: min(1180px, calc(100% - 44px));
  height: 84px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  border-bottom: 1px solid var(--line);
}
.brand { display: inline-flex; align-items: center; gap: 11px; width: max-content; color: inherit; text-decoration: none; }
.brand img { width: 42px; height: 42px; object-fit: contain; }
.brand span { display: grid; line-height: 1; }
.brand strong { font-family: Georgia, "Songti SC", serif; font-size: 18px; letter-spacing: .2em; }
.brand small { margin-top: 6px; color: var(--ink-soft); font-size: 8px; letter-spacing: .34em; }
nav { display: flex; gap: 28px; }
.nav-link { position: relative; border: 0; background: none; padding: 28px 2px 25px; color: #688091; font-size: 13px; cursor: pointer; transition: color .24s var(--motion-ease), transform .24s var(--motion-ease); }
.nav-link.active, .nav-link:hover { color: var(--deep); }
.nav-link.active::after { content: ""; position: absolute; left: 18%; right: 18%; bottom: -1px; height: 2px; background: var(--blue); border-radius: 4px; }
.header-actions { justify-self: end; display: flex; gap: 8px; align-items: center; }
.headphone-note { border: 1px solid var(--line); border-radius: 999px; background: rgba(255,255,255,.42); padding: 9px 13px; font-size: 11px; letter-spacing: .04em; cursor: help; }
.headphone-note span { display: inline-block; width: 6px; height: 6px; margin-right: 6px; border-radius: 50%; background: #62a592; box-shadow: 0 0 0 4px rgba(98,165,146,.12); }
.account-button { display: flex; align-items: center; gap: 7px; border: 1px solid var(--line); border-radius: 999px; background: white; padding: 5px 11px 5px 5px; color: #5c7584; font-size: 10px; cursor: pointer; }
.account-button i { display: grid; place-items: center; width: 25px; height: 25px; border-radius: 50%; color: white; background: var(--deep); font-style: normal; }

.modal-backdrop { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; padding: 20px; background: rgba(17,50,70,.32); backdrop-filter: blur(8px); }
.modal-backdrop[hidden] { display: none; }
.account-modal { position: relative; width: min(560px, 100%); max-height: min(760px, calc(100dvh - 40px)); overflow: auto; border: 1px solid rgba(255,255,255,.8); border-radius: 28px; background: #f8faf8; padding: 30px; box-shadow: 0 30px 90px rgba(20,65,89,.25); }
.modal-close { position: absolute; right: 20px; top: 20px; width: 31px; height: 31px; border: 1px solid var(--line); border-radius: 50%; background: white; color: #718792; cursor: pointer; }
.account-heading { display: flex; gap: 13px; align-items: center; }
.account-heading > span { display: grid; place-items: center; width: 50px; height: 50px; border-radius: 16px; color: white; background: linear-gradient(145deg, #4aa1bf, #205a7e); font-size: 19px; }
.account-heading p { margin: 0; color: #6f8a98; font-size: 8px; letter-spacing: .2em; }
.account-heading h2 { margin: 2px 0; font-family: Georgia, "Songti SC", serif; font-size: 22px; font-weight: 400; }
.account-heading small { color: #8b9ca4; font-size: 9px; }
.account-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; margin: 25px 0 20px; padding: 4px; border-radius: 13px; background: #eaf0f1; }
.account-tabs button { border: 0; border-radius: 9px; background: transparent; padding: 9px 4px; color: #7b8f99; font-size: 10px; cursor: pointer; }
.account-tabs button.active { color: var(--deep); background: white; box-shadow: 0 4px 13px rgba(35,78,101,.08); }
.account-panel { display: none; gap: 14px; }
.account-panel.active { display: grid; }
.account-panel label small { color: #98a6ac; font-size: 8px; }
.settings-save { border: 0; border-radius: 12px; color: white; background: var(--deep); padding: 11px; cursor: pointer; }
.settings-hint { margin: 0; border-radius: 12px; background: #e9f2f3; padding: 11px; color: #66818f; font-size: 9px; line-height: 1.6; }
.logout-button { border: 1px solid rgba(174,78,72,.18); border-radius: 12px; color: #a0514c; background: #fff6f4; padding: 10px; cursor: pointer; }
.account-message { min-height: 15px; margin: 13px 0 0; color: #a05750; font-size: 9px; text-align: center; }

main { width: min(1180px, calc(100% - 44px)); margin: 0 auto; display: grid; grid-template-columns: minmax(0, 1.46fr) minmax(310px, .84fr); column-gap: 20px; }
.intro { grid-column: 1 / -1; padding: 42px 0 30px; text-align: center; }
.eyebrow, .section-heading > p, .card-heading p { margin: 0 0 13px; color: #588097; font-size: 10px; letter-spacing: .28em; }
.eyebrow span { display: inline-block; width: 24px; height: 1px; margin-right: 10px; vertical-align: middle; background: var(--blue); }
.intro h1 { margin: 0; color: #204e6d; font-family: Georgia, "Songti SC", serif; font-size: clamp(32px, 4vw, 48px); font-weight: 400; line-height: 1.14; letter-spacing: .06em; }
.intro h1 em { color: #3d91af; font-style: normal; }
.intro h1 em::before { content: " "; }
.intro-copy { margin: 12px 0 18px; color: #6a808e; font-family: Georgia, "Songti SC", serif; font-size: 12px; line-height: 1.75; letter-spacing: .05em; }
.mode-switch { display: inline-flex; gap: 5px; padding: 5px; border: 1px solid rgba(43, 106, 139, .1); border-radius: 999px; background: rgba(255,255,255,.64); box-shadow: 0 10px 34px rgba(51, 104, 132, .08); }
.mode { border: 0; border-radius: 999px; background: transparent; padding: 10px 17px; color: #728691; font-size: 12px; cursor: pointer; transition: transform .24s var(--motion-ease), box-shadow .24s var(--motion-ease), background-color .24s var(--motion-ease), color .24s var(--motion-ease); }
.mode span { margin-right: 5px; }
.mode.active { color: white; background: var(--deep); box-shadow: 0 7px 16px rgba(31, 88, 125, .22); }

.studio-grid { display: contents; }
.glass-card { border: 1px solid rgba(255,255,255,.78); border-radius: var(--radius-xl); background: var(--paper); box-shadow: var(--shadow); backdrop-filter: blur(20px); transition: transform .28s var(--motion-ease), box-shadow .28s var(--motion-ease), border-color .28s var(--motion-ease); }
.glass-card:hover, .control-card:hover, .history-item:hover { transform: translateY(-2px); box-shadow: 0 20px 50px rgba(47,95,120,.14); }
.player-card { position: relative; height: 100%; min-height: 610px; padding: 25px 34px 20px; overflow: hidden; text-align: center; }
.player-card::before { content: ""; position: absolute; inset: 0; z-index: -1; background: radial-gradient(circle at 50% 42%, rgba(185, 219, 231, .3), transparent 45%); }
.player-topline { display: flex; justify-content: space-between; align-items: center; color: #78909d; font-size: 10px; letter-spacing: .08em; }
.live-dot { display: inline-block; width: 7px; height: 7px; margin-right: 8px; border-radius: 50%; background: #9aafb9; }
body.is-playing .live-dot { background: #59a894; box-shadow: 0 0 0 5px rgba(89,168,148,.12); animation: pulse 2s infinite; }
.icon-button { width: 31px; height: 31px; border: 1px solid var(--line); border-radius: 50%; background: transparent; cursor: pointer; }

.sound-orb { position: relative; width: 278px; height: 278px; margin: 8px auto -3px; display: grid; place-items: center; }
.orb-halo { position: absolute; border-radius: 50%; border: 1px solid rgba(70, 148, 178, .16); }
.halo-one { inset: 11px; background: radial-gradient(circle, transparent 55%, rgba(133,190,209,.12)); animation: breathe 7s ease-in-out infinite; }
.halo-two { inset: 28px; border-style: dashed; animation: rotate 30s linear infinite; }
.orb-core { position: relative; width: 190px; height: 190px; border-radius: 44% 56% 51% 49% / 54% 47% 53% 46%; overflow: hidden; background: linear-gradient(150deg, rgba(221,236,242,.96) 8%, rgba(92,169,196,.7) 68%, rgba(38,106,143,.83)); box-shadow: inset 18px 15px 44px rgba(255,255,255,.45), 0 28px 50px rgba(55,128,160,.22); animation: morph 9s ease-in-out infinite; }
.orb-core::after { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 35% 25%, rgba(255,255,255,.6), transparent 30%); }
.wave-line { position: absolute; left: -18%; width: 136%; height: 42%; border-radius: 50%; border-top: 2px solid rgba(255,255,255,.66); }
.wave-one { top: 42%; transform: rotate(4deg); }
.wave-two { top: 51%; opacity: .6; transform: rotate(-6deg); }
.wave-three { top: 60%; opacity: .35; transform: rotate(2deg); }
body.is-playing .orb-core { animation-duration: 5.6s; }
body.is-playing .wave-line { animation: waveDrift 4s ease-in-out infinite alternate; }

.now-playing p { margin: 0; color: #78919f; font-size: 10px; letter-spacing: .13em; }
.now-playing h2 { margin: 7px 0; font-family: Georgia, "Songti SC", serif; font-size: 25px; font-weight: 400; letter-spacing: .12em; }
.now-playing #soundSubtitle { color: #9aabb4; font-size: 10px; }
.transport { position: relative; display: flex; justify-content: center; align-items: center; gap: 28px; margin: 19px 0 13px; }
.transport > span { width: 45px; color: #8ba0ab; font-variant-numeric: tabular-nums; font-size: 11px; text-align: right; }
.play-button { width: 62px; height: 62px; border: 0; border-radius: 50%; color: white; background: linear-gradient(145deg, #4aa1bf, #205a7e); box-shadow: 0 13px 25px rgba(31,88,125,.25); cursor: pointer; transition: transform .24s var(--motion-ease), box-shadow .24s var(--motion-ease); }
.play-button:hover, .auth-submit:hover, .settings-save:hover, .mode.active:hover, .nav-link:hover, .feedback-chips button:hover, .instrument-list button:hover, .timer-button:hover, .segmented button:hover, .noise-options button:hover, .account-tabs button:hover, .auth-tabs button:hover { transform: translateY(-1px); box-shadow: 0 10px 22px rgba(31,88,125,.16); }
.pause-icon { display: none; font-weight: 700; letter-spacing: -3px; }
body.is-playing .play-icon { display: none; }
body.is-playing .pause-icon { display: inline; }
.timer-button { display: flex; align-items: center; gap: 6px; width: 74px; border: 0; background: transparent; color: #738b99; font-size: 10px; cursor: pointer; }
.timer-button b { font-weight: 500; white-space: nowrap; }
.timer-menu { position: absolute; z-index: 5; right: 18%; top: 57px; width: 112px; padding: 6px; border: 1px solid var(--line); border-radius: 13px; background: #fff; box-shadow: 0 12px 30px rgba(31,88,125,.16); }
.timer-menu button { width: 100%; border: 0; border-radius: 8px; background: transparent; padding: 7px; color: var(--ink-soft); font-size: 11px; cursor: pointer; }
.timer-menu button:hover { background: var(--mist-pale); color: var(--deep); }
.master-row { width: min(320px, 80%); margin: 0 auto; display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; color: #8da0aa; font-size: 10px; }
input[type="range"] { width: 100%; height: 4px; appearance: none; border-radius: 999px; background: linear-gradient(90deg, var(--blue) var(--range-fill, 50%), #dce6e9 var(--range-fill, 50%)); cursor: pointer; }
input[type="range"]::-webkit-slider-thumb { width: 14px; height: 14px; appearance: none; border: 3px solid white; border-radius: 50%; background: var(--blue); box-shadow: 0 2px 7px rgba(31,88,125,.25); }
.safety-note { margin: 13px 0 0; color: #a0adb3; font-size: 9px; letter-spacing: .04em; }

.feedback-card { grid-column: 2; grid-row: 2; align-self: stretch; height: 100%; padding: 32px 30px; }
.card-heading { display: flex; gap: 13px; align-items: flex-start; }
.soft-icon, .control-icon { display: grid; flex: 0 0 auto; place-items: center; width: 38px; height: 38px; border-radius: 13px; color: var(--deep); background: #dbeaf0; }
.card-heading p { margin: 0 0 5px; font-size: 8px; }
.card-heading h2 { margin: 0; font-family: Georgia, "Songti SC", serif; font-size: 18px; font-weight: 400; letter-spacing: .04em; }
.feedback-intro { margin: 25px 0 17px; color: #708592; font-family: Georgia, "Songti SC", serif; font-size: 12px; line-height: 1.8; }
.feedback-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.feedback-chips button { border: 1px solid var(--line); border-radius: 999px; background: rgba(255,255,255,.55); padding: 8px 11px; color: #637d8c; font-size: 10px; cursor: pointer; }
.feedback-chips button:hover { border-color: rgba(54,140,175,.35); color: var(--deep); background: #eef6f8; }
#feedbackForm { margin-top: 24px; }
#feedbackForm label { display: block; margin-bottom: 7px; color: #78909d; font-size: 10px; }
.feedback-input-wrap { position: relative; }
.feedback-input-wrap textarea { width: 100%; resize: none; border: 1px solid rgba(39,103,135,.15); border-radius: 16px; background: rgba(248,250,249,.86); padding: 13px 44px 13px 14px; color: var(--ink); font-size: 12px; line-height: 1.6; }
.feedback-input-wrap textarea::placeholder { color: #acb9bf; }
.feedback-input-wrap button { position: absolute; right: 9px; bottom: 10px; width: 30px; height: 30px; border: 0; border-radius: 50%; color: white; background: var(--deep); cursor: pointer; }
.ai-response { min-height: 61px; margin-top: 15px; display: flex; gap: 11px; align-items: center; border-radius: 14px; background: rgba(222,238,241,.65); padding: 11px 12px; }
.response-mark { display: grid; place-items: center; width: 25px; height: 25px; border-radius: 50%; color: white; background: #64a791; font-size: 11px; }
.ai-response p { margin: 0; display: grid; }
.ai-response b { font-family: Georgia, "Songti SC", serif; font-size: 11px; font-weight: 500; }
.ai-response small { margin-top: 3px; color: #78909c; font-size: 9px; }
.ai-response.loading .response-mark { animation: rotate 1.2s linear infinite; }
.adaptation-meter { margin-top: 19px; }
.adaptation-meter > div:first-child { display: flex; justify-content: space-between; color: #7d909a; font-size: 9px; }
.adaptation-meter b { color: var(--deep); }
.meter-track { height: 4px; margin-top: 8px; overflow: hidden; border-radius: 99px; background: #dfe8e9; }
.meter-track span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #79b8c8, #438eac); transition: width .6s ease; }

.mixer-section { grid-column: 1 / -1; grid-row: 3; padding: 20px 0 0; }
.mixer-section .section-heading { padding: 0 8px; text-align: left; }
.mixer-section .section-heading > p { margin-bottom: 6px; font-size: 11px; letter-spacing: .3em; }
.mixer-section .section-heading h2 { font-size: 28px; line-height: 1.2; }
.mixer-section .section-heading > span { margin-top: 7px; font-size: 12px; line-height: 1.7; }
.section-heading { text-align: center; }
.section-heading h2 { margin: 0; font-family: Georgia, "Songti SC", serif; font-size: 32px; font-weight: 400; letter-spacing: .08em; }
.section-heading > span { display: block; margin-top: 10px; color: #81939c; font-size: 12px; }
.mixer-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 16px; }
.mixer-grid .instruments-card { grid-column: auto; }
.control-card { min-width: 0; border: 1px solid rgba(255,255,255,.74); border-radius: var(--radius-lg); background: rgba(255,255,255,.64); padding: 23px; box-shadow: 0 18px 45px rgba(45,94,118,.08); transition: transform .28s var(--motion-ease), box-shadow .28s var(--motion-ease), border-color .28s var(--motion-ease), background-color .28s var(--motion-ease); will-change: transform, box-shadow; }
.control-title { display: flex; align-items: center; gap: 11px; }
.control-title > div:nth-child(2) { min-width: 0; flex: 1; }
.control-title p { margin: 0 0 3px; color: #8397a2; font-size: 12px; letter-spacing: .08em; }
.control-title h3 { margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: Georgia, "Songti SC", serif; font-size: 18px; font-weight: 400; }
.switch { position: relative; width: 34px; height: 19px; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; border-radius: 99px; background: #cbd8dc; cursor: pointer; transition: background-color .24s var(--motion-ease), transform .24s var(--motion-ease); }
.switch span::after { content: ""; position: absolute; width: 13px; height: 13px; left: 3px; top: 3px; border-radius: 50%; background: white; transition: transform .24s var(--motion-ease), box-shadow .24s var(--motion-ease); box-shadow: 0 1px 4px rgba(0,0,0,.15); }
.switch input:checked + span { background: var(--blue); }
.switch input:checked + span::after { transform: translateX(15px); }
.segmented { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin: 22px 0; padding: 4px; border-radius: 12px; background: #edf2f2; }
.segmented button { min-width: 0; border: 0; border-radius: 9px; background: transparent; padding: 8px 2px; color: #8799a1; font-size: 12px; cursor: pointer; transition: background-color .24s var(--motion-ease), color .24s var(--motion-ease), box-shadow .24s var(--motion-ease), transform .24s var(--motion-ease); }
.segmented small { display: block; margin-top: 3px; font-size: 9px; }
.segmented button.active { color: var(--deep); background: white; box-shadow: 0 4px 12px rgba(44,88,110,.1); }
.range-label { display: flex; justify-content: space-between; margin: 21px 0 9px; color: #7a909b; font-size: 12px; }
.range-label b { color: var(--deep); font-weight: 500; }
.noise-options { display: grid; grid-template-columns: repeat(2, 1fr); gap: 7px; margin-top: 21px; }
.noise-options button { display: flex; align-items: center; gap: 8px; border: 1px solid transparent; border-radius: 12px; background: #f0f4f3; padding: 9px; color: #718692; text-align: left; cursor: pointer; transition: background-color .24s var(--motion-ease), border-color .24s var(--motion-ease), color .24s var(--motion-ease), transform .24s var(--motion-ease), box-shadow .24s var(--motion-ease); }
.noise-options button.active { border-color: rgba(54,140,175,.25); color: var(--deep); background: #e5f1f4; }
.noise-options span { font-size: 12px; }
.noise-options small { display: block; margin-top: 2px; color: #9aa9af; font-size: 10px; }
.noise-swatch { flex: 0 0 auto; width: 21px; height: 21px; border-radius: 7px; background: #a9bbc4; }
.noise-swatch.white { background: linear-gradient(135deg, #fff, #cbd9dd); }
.noise-swatch.pink { background: linear-gradient(135deg, #dbe8ed, #75aabf); }
.noise-swatch.brown { background: linear-gradient(135deg, #b9a68e, #776c65); }
.noise-swatch.green { background: linear-gradient(135deg, #b9d4c8, #719989); }
.instrument-list { display: grid; gap: 6px; margin-top: 18px; }
.instrument-list button { display: grid; grid-template-columns: 27px 1fr auto; gap: 8px; align-items: center; border: 1px solid transparent; border-radius: 11px; background: #f1f4f3; padding: 7px 9px; color: #8a999f; text-align: left; cursor: pointer; transition: background-color .24s var(--motion-ease), border-color .24s var(--motion-ease), color .24s var(--motion-ease), transform .24s var(--motion-ease), box-shadow .24s var(--motion-ease); }
.instrument-list button.active { border-color: rgba(54,140,175,.2); color: var(--deep); background: #e9f3f5; }
.instrument-list i { display: grid; place-items: center; width: 25px; height: 25px; border-radius: 8px; background: white; font-style: normal; }
.instrument-list span { font-size: 12px; }
.instrument-list small { display: block; margin-top: 2px; color: #9aa9af; font-size: 10px; }
.instrument-list b { font-size: 14px; font-weight: 400; }

.fine-tune { grid-column: 1 / -1; grid-row: 4; display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 12px; border: 1px solid rgba(255,255,255,.76); border-radius: var(--radius-lg); background: rgba(255,255,255,.56); padding: 20px 24px; }
.fine-control { display: grid; grid-template-columns: 1fr 1fr; }
.fine-control label, .fine-control input { grid-column: 1 / -1; }
.fine-control label { display: flex; justify-content: space-between; margin-bottom: 12px; color: #637e8c; font-size: 10px; }
.fine-control label b { color: var(--deep); font-weight: 500; }
.fine-control span { margin-top: 7px; color: #9aa8ae; font-size: 8px; }
.fine-control span:last-child { text-align: right; }

.history-section { grid-column: 1 / -1; grid-row: 5; padding: 110px 0 30px; }
.inline-heading { display: flex; justify-content: space-between; align-items: end; text-align: left; }
.inline-heading p { margin-bottom: 7px; }
.inline-heading button { border: 1px solid var(--line); border-radius: 999px; background: rgba(255,255,255,.5); padding: 8px 15px; color: var(--ink-soft); font-size: 10px; cursor: pointer; }
.history-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 13px; margin-top: 25px; }
.history-item, .empty-history { margin: 0; border: 1px solid rgba(255,255,255,.7); border-radius: 18px; background: rgba(255,255,255,.56); padding: 18px; }
.history-item { display: grid; grid-template-columns: auto 1fr; gap: 12px; }
.history-item > span { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 13px; color: var(--deep); background: var(--mist-pale); }
.history-item p { margin: 0; font-family: Georgia, "Songti SC", serif; font-size: 13px; }
.history-item small { display: block; margin-top: 5px; color: #85979f; font-size: 8px; }
.empty-history { grid-column: 1 / -1; color: #8d9ca2; text-align: center; }
.closing-note { grid-column: 1 / -1; grid-row: 6; padding: 90px 0 55px; text-align: center; }
.closing-note img { width: 50px; height: 50px; opacity: .74; }
.closing-note blockquote { margin: 18px 0; font-family: Georgia, "Songti SC", serif; font-size: 20px; line-height: 1.8; letter-spacing: .1em; }
.closing-note p { color: #9aa7ac; font-size: 9px; }
.closing-note .powered-by { margin-top: 12px; color: var(--deep); font-size: 10px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; }
.toast { position: fixed; z-index: 20; left: 50%; bottom: 24px; transform: translate(-50%, 20px); pointer-events: none; opacity: 0; border-radius: 999px; color: white; background: rgba(24,62,87,.92); padding: 10px 17px; box-shadow: 0 10px 30px rgba(24,62,87,.2); font-size: 11px; transition: .25s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@keyframes pulse { 50% { opacity: .45; } }
@keyframes rotate { to { transform: rotate(360deg); } }
@keyframes breathe { 50% { transform: scale(1.08); opacity: .6; } }
@keyframes morph { 0%,100% { border-radius: 44% 56% 51% 49% / 54% 47% 53% 46%; transform: rotate(-1deg) scale(1); } 50% { border-radius: 56% 44% 46% 54% / 45% 58% 42% 55%; transform: rotate(2deg) scale(1.035); } }
@keyframes waveDrift { to { transform: translateX(7%) rotate(-3deg); } }
@keyframes drift { 0% { transform: translate3d(0, 0, 0) scale(1); } 100% { transform: translate3d(2%, -4%, 0) scale(1.06); } }
@keyframes ambientDrift { 0% { transform: translate3d(0, 0, 0) scale(1); } 100% { transform: translate3d(3%, -2%, 0) scale(1.04); } }

@media (max-width: 900px) {
  .auth-gate { grid-template-columns: 1fr; }
  .auth-visual { display: none; }
  .site-header { grid-template-columns: 1fr auto; }
  nav { display: none; }
  main { grid-template-columns: 1fr; }
  .player-card { grid-column: 1; grid-row: 2; }
  .mixer-section { grid-column: 1; grid-row: 3; }
  .fine-tune { grid-column: 1; grid-row: 4; }
  .feedback-card { grid-column: 1; grid-row: 5; align-self: auto; height: auto; margin-top: 20px; }
  .history-section { grid-column: 1; grid-row: 6; }
  .closing-note { grid-column: 1; grid-row: 7; }
  .player-card { min-height: 590px; }
  .mixer-grid { grid-template-columns: 1fr 1fr; }
  .mixer-grid .instruments-card { grid-column: 1 / -1; }
  .instrument-list { grid-template-columns: 1fr 1fr; }
  .history-list { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 620px) {
  .auth-card { width: min(100% - 38px, 480px); padding: 26px 0; }
  .auth-brand { margin-bottom: 32px; }
  :root { --radius-xl: 26px; }
  .site-header, main { width: min(100% - 24px, 1180px); }
  .site-header { height: 72px; }
  .headphone-note { display: none; }
  .account-button span { display: none; }
  .account-button { padding-right: 5px; }
  .account-modal { padding: 25px 18px; }
  .intro { padding: 34px 0 24px; }
  .intro-copy br { display: none; }
  .mode-switch { width: 100%; display: grid; grid-template-columns: repeat(4, 1fr); }
  .mode { padding: 9px 5px; }
  .player-card { min-height: auto; padding: 20px 17px; }
  .sound-orb { width: 236px; height: 236px; }
  .orb-core { width: 165px; height: 165px; }
  .feedback-card { padding: 25px 20px; }
  .mixer-section { padding-top: 16px; }
  .history-section { padding-top: 78px; }
  .mixer-grid, .fine-tune, .history-list { grid-template-columns: 1fr; }
  .mixer-grid .instruments-card { grid-column: auto; }
  .instrument-list { grid-template-columns: 1fr; }
  .fine-tune { gap: 24px; padding: 23px; }
  .transport { gap: 18px; }
  .timer-menu { right: 8%; }
  .closing-note blockquote { font-size: 17px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
