/* Machigana web app: the web-only parts on top of app.css (Alpha's AM-2 look). Full-page layout in luxe dark grey (never
   black), the base look Alpha's app stylesheet gives its controls, the account parts, the sign-up / plans dialog, toasts,
   and the phone layout. Prefix: mgw- (web), ams- (studio). */
:root { color-scheme: dark; }
html, body.mgw-body { margin: 0; height: 100%; background: #16181c; color: #dfe5ec; }
body.mgw-body { overflow: hidden; font: 13px Inter, "Segoe UI Variable", "Segoe UI", system-ui, sans-serif; -webkit-font-smoothing: antialiased; }
.mgw-root { height: 100dvh; }
.mgw-boot { height: 100%; display: grid; place-items: center; font: 700 14px "Space Grotesk", Bahnschrift, sans-serif; letter-spacing: 0.4em; color: #acd531; animation: ams-blink 1.2s infinite; }
.ams-studio { position: relative; width: 100% !important; height: 100% !important; border-radius: 0 !important; border: 0 !important; box-shadow: none !important;
  background: radial-gradient(1200px 700px at 12% -10%, rgba(172, 213, 49, 0.06), transparent 60%), radial-gradient(900px 600px at 110% 110%, rgba(160, 124, 255, 0.08), transparent 60%), #16181c !important;
  font-family: Inter, "Segoe UI Variable", "Segoe UI", system-ui, sans-serif; }
.ams-studio * { box-sizing: border-box; }
.ams-studio button, .mgw-modal button { font: inherit; cursor: pointer; border: 1px solid var(--edge, rgba(255, 255, 255, 0.07)); color: inherit; background: transparent; }
.ams-studio button:disabled, .mgw-modal button:disabled { cursor: not-allowed; }
.ams-studio :is(input, select, textarea), .mgw-modal input { font: inherit; color: inherit; }
.ams-studio .ams-btn:disabled, .ams-studio .ams-icon:disabled, .ams-studio .ams-segk:disabled { opacity: 0.45; }
.ams-studio a.ams-logo { text-decoration: none; }
.ams-studio .ams-select { color-scheme: dark; }
.ams-studio .ams-select option, .ams-studio .ams-select optgroup { background: #1c1f24; color: #e7ecf1; }
.ams-studio input[type="checkbox"] { accent-color: #acd531; width: 15px; height: 15px; }
.ams-studio :focus-visible, .mgw-modal :focus-visible { outline: 2px solid #c8ef4a; outline-offset: 2px; }
.ams-studio input.ams-input { padding: 0 10px; height: 30px; }
.ams-studio textarea.ams-input { padding: 8px 10px; }
.ams-studio .ams-player { flex: none; }
.ams-studio a.ams-mi { text-decoration: none; display: flex; align-items: center; width: 100%; min-height: 28px; padding: 4px 10px; border-radius: 8px; color: var(--text); font-size: 13px; }
.ams-studio a.ams-mi:hover, .ams-studio .ams-mi:hover:not(:disabled) { background: rgba(172, 213, 49, 0.1) !important; }
.ams-studio .ams-mi:disabled { opacity: 0.55; }
.ams-studio .ams-mi.sub.open > .ams-submenu { display: block; }
.ams-studio .ams-badge.mgw-b { background: linear-gradient(135deg, var(--lime2), var(--lime)); }
.ams-studio .mgw-dl { color: var(--lime) !important; }
.mgw-cost { font: 600 10.5px "Cascadia Mono", Consolas, monospace; color: var(--dim); text-align: right; min-height: 13px; }
.mgw-takenote { opacity: 0.8; }
.mgw-dlblock .ams-row { margin-top: 6px; }
.ams-studio .mgw-dlblock .ams-btn { color: var(--lime) !important; }

/* the account in the header */
.mgw-account { position: relative; display: flex; align-items: center; gap: 6px; }
.ams-studio .mgw-quota { cursor: pointer; color: #101214; background: linear-gradient(135deg, var(--lime2), var(--lime)); border: 0; font-weight: 700; }
.ams-studio .mgw-quota.low { background: linear-gradient(135deg, #f7c06a, #f0a83a); }
.ams-studio .mgw-join { color: #101214 !important; border: 0 !important; background: linear-gradient(110deg, var(--lime2), var(--lime) 45%, var(--purple)) !important; box-shadow: 0 0 18px rgba(172, 213, 49, 0.35); }
.ams-studio .mgw-acct { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ams-studio .mgw-acctmenu { position: absolute; right: 0; top: calc(100% + 6px); min-width: 260px; }
.mgw-acctinfo { display: flex; flex-direction: column; gap: 3px; padding: 6px 10px; }
.mgw-acctinfo b { font-size: 12.5px; word-break: break-all; }
.ams-studio .mgw-queue { color: #f0d36a; }
.ams-studio .mgw-link, .mgw-modal .mgw-link { border: 0 !important; background: none !important; padding: 0; color: var(--lime, #acd531) !important; text-decoration: underline; text-underline-offset: 3px; font: inherit; height: auto; letter-spacing: 0; }
.mgw-libguest { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.mgw-libguest p { margin: 0; }
.ams-studio .mgw-cta { max-width: 320px; width: 100%; }

/* the sign-up / sign-in / plans dialog */
.mgw-modal { --lime: #acd531; --lime2: #c8ef4a; --purple: #a07cff; --edge: rgba(255, 255, 255, 0.08); --dim: #8b929d; --text: #dfe5ec;
  position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 16px; background: rgba(14, 15, 18, 0.72); backdrop-filter: blur(6px); animation: ams-rise 0.25s ease; color: var(--text); font: 14px Inter, "Segoe UI", system-ui, sans-serif; }
.mgw-card { position: relative; width: min(460px, 100%); max-height: calc(100dvh - 32px); overflow: auto; padding: 26px 24px 22px; border-radius: 18px; border: 1px solid transparent;
  background: linear-gradient(#1c1f24, #1c1f24) padding-box, linear-gradient(135deg, rgba(172, 213, 49, 0.6), rgba(63, 216, 232, 0.25) 45%, rgba(160, 124, 255, 0.65)) border-box; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55); }
.mgw-card h2 { margin: 6px 0; font: 700 24px "Space Grotesk", Bahnschrift, sans-serif; }
.mgw-lead { margin: 0 0 14px; color: #c3cbd4; line-height: 1.5; }
.mgw-brand { display: flex; gap: 8px; align-items: baseline; }
.mgw-brand b { font: 700 10px "Space Grotesk", sans-serif; letter-spacing: 0.32em; color: var(--dim); }
.mgw-brand strong { font: 700 12px "Space Grotesk", sans-serif; letter-spacing: 0.24em; color: var(--lime); }
.mgw-modal .mgw-x { position: absolute; top: 12px; right: 12px; width: 32px; height: 32px; border-radius: 50%; font-size: 18px; line-height: 1; background: rgba(255, 255, 255, 0.05); color: var(--text); }
.mgw-form { display: flex; flex-direction: column; gap: 12px; }
.mgw-field { display: flex; flex-direction: column; gap: 5px; }
.mgw-modal .ams-lab { font: 700 10px "Space Grotesk", Bahnschrift, sans-serif; letter-spacing: 0.18em; text-transform: uppercase; color: color-mix(in srgb, var(--lime) 65%, #9aa1ab); }
.mgw-modal .ams-input { height: 42px; padding: 0 12px; border-radius: 10px; background: rgba(10, 11, 13, 0.5); border: 1px solid rgba(255, 255, 255, 0.1); color: #eef3f7; font-size: 15px; }
.mgw-modal .ams-input:focus { outline: none; border-color: rgba(172, 213, 49, 0.65); box-shadow: 0 0 0 3px rgba(172, 213, 49, 0.14); }
.mgw-modal .ams-create { height: 46px; border: 0; border-radius: 12px; font: 800 13px "Space Grotesk", Bahnschrift, sans-serif; letter-spacing: 0.2em; color: #0f1112; background: linear-gradient(110deg, var(--lime2), var(--lime) 30%, #3fd8e8 60%, var(--purple) 85%, var(--lime2)); background-size: 260% 100%; animation: ams-flow 6s linear infinite; box-shadow: 0 8px 26px rgba(172, 213, 49, 0.28); }
.mgw-modal .ams-btn { height: 36px; padding: 0 14px; border-radius: 10px; font: 700 11px "Space Grotesk", Bahnschrift, sans-serif; letter-spacing: 0.12em; background: rgba(255, 255, 255, 0.05); color: var(--text); }
.mgw-modal .ams-row { display: flex; gap: 8px; flex-wrap: wrap; }
.mgw-check { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; line-height: 1.45; }
.mgw-check input { margin-top: 2px; accent-color: #acd531; width: 16px; height: 16px; flex: none; }
.mgw-check a { color: var(--lime); }
.mgw-fine { margin: 0; font-size: 11.5px; line-height: 1.45; color: var(--dim); }
.mgw-msg { margin: 0; color: #f0c36a; font-size: 13px; }
.mgw-msg:empty { display: none; }
.mgw-alt { margin: 4px 0 0; text-align: center; color: var(--dim); font-size: 13px; }
.mgw-plans { display: grid; gap: 10px; margin: 4px 0 12px; }
.mgw-plan { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "n p" "l s" "b b"; gap: 2px 10px; padding: 14px; border-radius: 14px; text-decoration: none; color: var(--text); background: rgba(255, 255, 255, 0.03); border: 1px solid var(--edge); transition: transform 0.2s, border-color 0.2s; }
.mgw-plan:hover { transform: translateY(-2px); border-color: rgba(172, 213, 49, 0.5); }
.mgw-plan.featured { border-color: rgba(172, 213, 49, 0.55); box-shadow: 0 0 24px rgba(172, 213, 49, 0.12); }
.mgw-plan.current { border-color: rgba(160, 124, 255, 0.7); }
.mgw-plan b { grid-area: n; font: 700 16px "Space Grotesk", sans-serif; }
.mgw-plan .mgw-price { grid-area: p; font: 700 20px "Space Grotesk", sans-serif; color: var(--lime2); text-align: right; }
.mgw-plan small { grid-area: s; text-align: right; color: var(--dim); }
.mgw-plan .ams-sub { grid-area: l; font-size: 12.5px; color: #b7c0ca; }
.mgw-plan .ams-btn { grid-area: b; margin-top: 8px; display: grid; place-items: center; }
.mgw-plan.featured .ams-btn { color: #101214; background: linear-gradient(135deg, var(--lime2), var(--lime)); border: 0; }

.mgw-toasts { position: fixed; right: 16px; bottom: 76px; z-index: 120; display: flex; flex-direction: column; gap: 8px; max-width: min(380px, calc(100vw - 32px)); }
.mgw-toast { padding: 10px 14px; border-radius: 12px; background: rgba(30, 33, 39, 0.96); border: 1px solid rgba(172, 213, 49, 0.35); color: #e8eef3; box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45); font: 13px Inter, sans-serif; animation: ams-rise 0.3s ease; transition: opacity 0.4s, transform 0.4s; }
.mgw-toast.out { opacity: 0; transform: translateY(6px); }

.mgw-mtabs { display: none; }
.ams-left { overflow-x: hidden; }
.ams-resgrid > *, .ams-result, .ams-drawer { min-width: 0; }
.ams-resgrid .ams-knobs { flex-wrap: wrap; }
.ams-studio .ams-knob { min-width: 58px; }

@media (max-width: 1200px) and (min-width: 821px) {
  .ams-main { position: relative; }
}
@media (max-width: 820px) {
  .ams-head { flex-wrap: wrap; gap: 8px 10px; padding: 8px 12px; }
  .ams-logo b { display: none; }
  .ams-engine-row { width: 100%; margin-left: 0; gap: 5px; }
  .ams-engine-row .am-gpu, .ams-engine-row .mgw-queue { display: none; }
  .mgw-account { margin-left: auto; }
  .ams-studio .mgw-acct { max-width: 110px; }
  .ams-studio .ams-btn.mgw-signin, .ams-studio .ams-btn.mgw-join { padding: 0 9px; }
  .ams-tabs .ams-segk { padding: 0 14px; }
  .mgw-mtabs { display: flex; gap: 4px; padding: 6px 12px 0; }
  .ams-studio .mgw-mtab { flex: 1; height: 32px; border-radius: 10px; font: 700 11px "Space Grotesk", Bahnschrift, sans-serif; letter-spacing: 0.16em; color: var(--dim); background: rgba(0, 0, 0, 0.3); }
  .ams-studio .mgw-mtab.on { color: #101214; background: linear-gradient(135deg, var(--lime2), var(--lime)); border-color: transparent; }
  .ams-main { display: block; padding: 8px 12px; overflow: auto; position: relative; }
  .ams-studio[data-mview="create"] .ams-library, .ams-studio[data-mview="library"] .ams-left { display: none; }
  .ams-left { overflow: visible; }
  .ams-library { min-height: 70vh; }
  .ams-details { position: fixed; inset: 8px; width: auto; z-index: 40; }
  .ams-grid2 { grid-template-columns: 1fr; }
  .ams-row.ams-top, .ams-libhead .ams-row, .ams-titlerow { flex-wrap: wrap; }
  .ams-libhead .ams-search { min-width: 140px; }
  .ams-card { grid-template-columns: 52px minmax(0, 1fr); grid-template-areas: "art meta" "act act"; }
  .ams-card .ams-sel { display: none; }
  .ams-card .ams-art { grid-area: art; width: 52px; height: 52px; }
  .ams-card .ams-meta { grid-area: meta; }
  .ams-card .ams-cact { grid-area: act; justify-content: flex-end; }
  .ams-studio .ams-card .ams-cardplay { opacity: 1; transform: none; }
  .ams-player { flex-wrap: wrap; gap: 6px 10px; padding: 8px 12px calc(8px + env(safe-area-inset-bottom)); }
  .ams-player .ams-status { order: 9; flex-basis: 100%; white-space: normal; }
  .ams-player .mgw-vollab, .ams-studio input.ams-range.ams-vol { display: none; }
  .ams-now { min-width: 0; max-width: 120px; }
  .ams-player .ams-val { min-width: 0; }
  .ams-resgrid { grid-template-columns: 1fr; }
  .ams-kb { overflow-x: auto; max-width: calc(100vw - 110px); }
  .ams-notekeys { flex-wrap: wrap; }
  .ams-soundprompt { flex-wrap: wrap; }
  .ams-soundprompt .ams-sound-desc { min-width: 100%; }
  .ams-studio .ams-menu { max-width: calc(100vw - 24px); }
  .ams-studio .ams-submenu { position: static; margin: 4px 0 0 8px; }
  .ams-fullscreen { inset: 8px; }
  .mgw-toasts { bottom: 110px; }
}
