.producer-song-card{padding:16px!important;min-width:0}
.producer-parameters{margin:10px 0;display:grid;gap:0}
.producer-parameters>div{display:grid;grid-template-columns:minmax(90px,.7fr) minmax(0,1.6fr);gap:12px;padding:9px 0;border-bottom:1px solid rgba(144,171,180,.2)}
.producer-parameters dt{font-size:13px;color:var(--home-muted,#aab7be);font-weight:400}
.producer-parameters dd{margin:0;overflow-wrap:anywhere;font-size:14px;line-height:1.45}
.producer-parameters>div:has(dd):nth-child(n+9){grid-template-columns:1fr;gap:5px}
.producer-song-card details,.producer-history{border-top:1px solid rgba(144,171,180,.22);padding:13px 0}
.producer-song-card summary,.producer-history summary{cursor:pointer;color:var(--accent,#ff8a00);font-weight:600}
.producer-song-card pre{white-space:pre-wrap;overflow-wrap:anywhere;font:inherit;line-height:1.6;margin:14px 0;max-height:270px;overflow:auto;padding-right:10px}
.producer-song-card p{white-space:pre-wrap;overflow-wrap:anywhere;line-height:1.5}
.producer-song-card .secondary-button{min-height:42px;padding:10px 15px}
.producer-conversation{margin:18px 0;padding:16px;border-radius:22px;min-width:0}
.producer-conversation h3{margin:0 0 12px;font-size:20px}
.producer-message{display:grid;gap:6px;padding:12px 14px;border-radius:14px;background:rgba(100,130,145,.14);margin:10px 0;font-size:14px;line-height:1.45;overflow-wrap:anywhere;white-space:pre-wrap}
.producer-message b{font-size:12px;color:var(--accent,#ff8a00)}
.producer-message.from-user{margin-left:20px;background:rgba(255,132,15,.1)}
.producer-chat-composer{display:grid;gap:8px;margin-top:16px}
.producer-chat-composer .home-assistant-input-shell{position:relative;display:block}
.producer-chat-composer textarea{box-sizing:border-box;width:100%;min-height:100px;height:110px;max-height:200px;border-radius:18px;padding:14px 58px 20px 14px;resize:vertical}
.producer-chat-composer .home-assistant-mic{position:absolute;right:10px;bottom:10px}
.producer-limit{font-size:12px;line-height:1.4;color:var(--home-muted,#aab7be);margin:0}
.producer-chat-composer .primary-button{min-height:46px}
.producer-actions{margin-bottom:18px}
html[data-theme=light] .producer-conversation{color:#17252b}
@media(max-width:400px){.producer-parameters>div{gap:8px;grid-template-columns:minmax(80px,.7fr) minmax(0,1.5fr)}.producer-conversation,.producer-song-card{padding:12px!important}.producer-parameters dd{font-size:13px}}

body.producer-waiting-active{overflow:hidden}
.producer-waiting-overlay{position:fixed;inset:0;z-index:100000;display:grid;place-items:center;background:rgba(0,0,0,.32);backdrop-filter:blur(3px);-webkit-backdrop-filter:blur(3px);touch-action:none;cursor:progress}
.producer-waiting-indicator{display:grid;justify-items:center;gap:18px;padding:24px;color:#f5f5f5;text-align:center;font-size:15px;font-weight:600;text-shadow:0 1px 8px #000}
.producer-waiting-indicator .pechka-loading-dots{gap:12px;min-height:18px}
.producer-waiting-indicator .pechka-loading-dots i{width:12px;height:12px}

.producer-screen{--producer-card-lift:20px;display:grid;gap:8px;min-width:0;padding-bottom:6px}
.producer-screen>.premium-page-hero{overflow:visible}
.producer-screen .producer-song-card{margin:0;margin-block-start:calc(-1 * var(--producer-card-lift));padding:11px!important;border-radius:20px;min-width:0}
.producer-screen>.producer-song-card{z-index:1}
.producer-screen .final-title-editor{gap:4px;margin:0 0 8px;padding:0;border:0}
.producer-screen .final-title-editor>span:first-child{font-size:10px;color:var(--muted,#abb7bd)}
.producer-title-field{display:flex;position:relative;align-items:center;min-width:0}
.producer-screen .producer-title-field input{height:40px;min-height:40px;font-size:16px;padding:8px 40px 8px 11px;width:100%;box-sizing:border-box;border-radius:13px}
.producer-title-edit{position:absolute;right:3px;top:3px;width:34px;height:34px;border:0;background:transparent;color:var(--accent,#ff8a00);padding:6px}
.producer-title-edit .icon{width:18px;height:18px}
.producer-chips{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:5px;margin:0 0 8px}
.producer-chip{display:flex;align-items:center;gap:4px;min-width:0;border:1px solid rgba(160,180,185,.3);background:rgba(170,190,190,.055);border-radius:30px;padding:5px 7px;font-size:10px;line-height:1.2;cursor:default}
.producer-chip>.icon{color:var(--accent,#ff8a00);flex:0 0 13px;width:13px;height:13px}
.producer-chip>span:last-child{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.producer-screen .producer-section{border-top:1px solid rgba(144,171,180,.25);padding:0}
.producer-section>summary{display:flex;align-items:center;gap:9px;min-height:35px;font-size:13px;font-weight:600;list-style:none;cursor:pointer}
.producer-section>summary::-webkit-details-marker{display:none}
.producer-section>summary>.icon{color:var(--accent,#ff8a00);width:18px;height:18px}
.producer-chevron{margin-left:auto;font-size:20px;line-height:1;color:var(--muted,#abb7bd)}
.producer-section[open] .producer-chevron{transform:rotate(180deg)}
.producer-section-scroll{max-height:min(240px,32dvh);overflow:auto;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:#ff8a00 transparent;padding-right:7px}
.producer-section-scroll::-webkit-scrollbar,.producer-reply>span::-webkit-scrollbar{width:5px}
.producer-section-scroll::-webkit-scrollbar-thumb,.producer-reply>span::-webkit-scrollbar-thumb{background:#ff8a00;border-radius:10px}
.producer-screen .producer-lyrics pre{max-height:none;overflow:visible;margin:7px 0;font-size:13px;line-height:1.55;padding:0}
.producer-screen .producer-edit-lyrics{min-height:34px;font-size:12px;padding:6px 10px;margin:6px 0}
.producer-screen .producer-conversation{position:relative;display:grid;gap:7px;margin:0;padding:11px;border-radius:20px;min-width:0}
.producer-conversation-heading{display:flex;align-items:center;justify-content:space-between;gap:8px}
.producer-conversation-heading:has(+.producer-chat-log[data-chat-overflow=true]){min-height:22px}
.producer-screen .producer-conversation h3{display:flex;align-items:center;gap:6px;color:var(--accent,#ff8a00);font-size:18px;line-height:1.2;margin:0}
.producer-conversation-heading h3>.icon{width:18px;height:18px;flex:0 0 18px}
.producer-user-message{margin:0;padding:7px 9px;background:rgba(255,132,15,.1);border-radius:12px;font-size:12px;min-width:0}
.producer-user-message>summary{display:flex;gap:5px;align-items:center;cursor:pointer;list-style:none;min-width:0}
.producer-user-message summary::-webkit-details-marker{display:none}
.producer-user-message summary b{color:var(--accent,#ff8a00);flex-shrink:0}
.producer-user-message summary>span:first-of-type{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;flex:1}
.producer-user-message p{white-space:pre-wrap;overflow-wrap:anywhere;line-height:1.45;margin:8px 0 0;max-height:150px;overflow:auto;scrollbar-color:#ff8a00 transparent;scrollbar-width:thin}
.producer-reply{display:grid;gap:3px;min-width:0;margin:0;padding:8px 10px;border-radius:12px;background:rgba(100,150,160,.14);font-size:12px;line-height:1.4}
.producer-reply>b{color:var(--accent,#ff8a00);font-size:12px}
.producer-reply>span{white-space:pre-wrap;overflow-wrap:anywhere;max-height:100px;overflow:auto;scrollbar-color:#ff8a00 transparent;scrollbar-width:thin}
.producer-screen .producer-chat-composer{gap:4px;margin:0}
.producer-screen .producer-chat-composer textarea{height:68px;min-height:68px;max-height:100px;padding:10px 58px 12px 10px;font-size:12px;line-height:1.4;resize:none;border-radius:14px}
.producer-screen .producer-chat-composer .home-assistant-mic{width:36px;height:36px;min-width:36px;min-height:36px;right:16px;bottom:8px}
.producer-screen .home-assistant-meta-row{margin:0;height:14px;min-height:14px;font-size:10px}
.producer-screen .home-assistant-counter{font-size:10px}
.producer-screen .producer-limit{font-size:10px;margin:0}
.producer-screen .producer-chat-composer .primary-button,.producer-screen .producer-actions .primary-button{min-height:40px;height:40px;font-size:14px;padding:7px 12px}
.producer-screen .producer-actions{display:block;margin:0;padding:0}
.producer-screen .producer-actions button{width:100%}
.producer-screen .producer-history{border:0;padding:0;margin:0;font-size:11px}
.producer-history>summary{font-size:11px;font-weight:400}
.producer-history>div{position:absolute;z-index:30;top:36px;left:8px;right:8px;max-height:250px;overflow:auto;background:var(--card-solid,#0b1920);padding:10px;border:1px solid var(--line,#34444a);border-radius:13px;scrollbar-color:#ff8a00 transparent;scrollbar-width:thin;box-shadow:0 8px 25px #0008}
.producer-history p{display:grid;gap:3px;white-space:pre-wrap;font-size:12px;line-height:1.4;overflow-wrap:anywhere}
.producer-history b{color:var(--accent,#ff8a00)}
.restyled-shell.internal-flow-shell:has(.producer-screen)>main{padding-bottom:0}
@media(max-height:700px){.producer-screen{gap:6px}.producer-screen .producer-song-card,.producer-screen .producer-conversation{padding:9px!important}.producer-screen .producer-chat-composer textarea{height:56px;min-height:56px}.producer-reply>span{max-height:72px}.producer-screen .producer-section>summary{min-height:32px}}
@media(max-height:590px){.producer-screen{gap:5px}.producer-screen .producer-title-field input{height:34px;min-height:34px;font-size:14px}.producer-title-edit{width:28px;height:28px}.producer-screen .producer-song-card,.producer-screen .producer-conversation{padding:8px!important}.producer-chips{gap:4px;margin-bottom:5px}.producer-chip{padding:4px 6px;font-size:9px}.producer-screen .producer-conversation{gap:5px}.producer-screen .producer-conversation h3{font-size:16px}.producer-reply{font-size:11px;padding:6px 8px}.producer-screen .producer-chat-composer .primary-button,.producer-screen .producer-actions .primary-button{height:36px;min-height:36px}.producer-screen .producer-chat-composer textarea{height:50px;min-height:50px}.producer-screen .final-title-editor{margin-bottom:5px}.producer-screen .producer-section>summary{min-height:29px;font-size:12px}}

.restyled-shell.internal-flow-shell .flow-screen.final-flow-screen:has(>.producer-screen){padding-bottom:0!important}
.producer-screen .producer-chat-composer textarea{display:block}
@media(max-height:700px){.producer-screen .producer-reply>span{max-height:46px}}
@media(max-height:590px){.producer-screen .producer-reply>span{max-height:32px}}
@media(min-height:591px) and (max-height:700px){.producer-screen .producer-title-field input{height:36px;min-height:36px}.producer-screen .producer-chip{padding-block:3px}.producer-screen .producer-section>summary{min-height:30px}.producer-screen .producer-conversation{gap:5px}.producer-screen .producer-chat-composer textarea{height:50px;min-height:50px}}
@media(max-height:590px){.producer-screen .producer-conversation{gap:4px}.producer-screen .producer-reply{padding:5px 7px}.producer-screen .producer-chat-composer textarea{height:44px;min-height:44px}.producer-screen .producer-chip{padding:3px 5px}.producer-screen .producer-section>summary{min-height:27px}}

.producer-screen .producer-chevron{display:inline-flex;align-items:center;justify-content:center;flex:0 0 20px;width:20px;height:20px;margin-left:auto;color:#ff8a00;font-size:0;line-height:0;transform:none;align-self:center}
.producer-screen .producer-chevron>.icon{width:18px;height:18px;transform:rotate(90deg);color:#ff8a00}
.producer-screen details[open]>summary .producer-chevron{transform:none}
.producer-screen details[open]>summary .producer-chevron>.icon{transform:rotate(-90deg)}
.producer-screen .producer-title-edit .icon,.producer-screen .producer-edit-lyrics .icon{color:#ff8a00}
.producer-chat-log{--producer-history-height:clamp(100px,19dvh,180px);display:flex;flex-direction:column;gap:7px;min-width:0;max-height:calc(var(--producer-history-height) + var(--producer-card-lift));overflow-y:auto;overflow-x:hidden;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:#ff8a00 transparent;padding-right:4px;padding-block-end:var(--producer-card-lift)}
.producer-chat-log::-webkit-scrollbar{width:5px}
.producer-chat-log::-webkit-scrollbar-thumb{background:#ff8a00;border-radius:10px}
.producer-chat-log-has-history{height:calc(var(--producer-history-height) + var(--producer-card-lift))}
.producer-chat-log>[data-producer-chat-extra][hidden]{display:none!important}
.producer-screen .producer-chat-log>.producer-user-message{background:rgba(118,146,158,.09);border:1px solid rgba(144,171,180,.17);padding:6px 8px;flex-shrink:0}
.producer-chat-log .producer-user-message summary{min-height:18px;align-items:center}
.producer-chat-log .producer-user-message p{max-height:none;overflow:visible}
.producer-screen .producer-chat-log>.producer-reply{background:rgba(255,132,15,.16);border:1px solid rgba(255,132,15,.26);flex-shrink:0;margin-inline-start:clamp(21px,6.4vw,36px)}
.producer-screen .producer-chat-log .producer-reply>span{max-height:none;overflow:visible}
.producer-screen .producer-chat-history{display:inline-flex;align-items:center;gap:3px;color:#ff8a00;margin:0;padding:3px 0;font-size:11px;line-height:1.2;min-height:22px}
.producer-chat-history[hidden]{display:none!important}
.producer-chat-history>.icon{width:16px;height:16px;transform:rotate(90deg);color:#ff8a00}
.producer-chat-history[aria-expanded=true]>.icon{transform:rotate(-90deg)}
.producer-screen .producer-chat-composer .producer-action-row{display:grid;grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);align-items:center;gap:clamp(4px,1.4vw,9px);min-width:0}
.producer-screen .producer-action-row .producer-limit{display:flex;align-items:center;justify-self:start;position:relative;inset-block-start:var(--producer-edit-offset);gap:clamp(4.5px,calc(2.5vw - 3.5px),8px);margin:0;min-width:0;font-size:12px;line-height:1.15;color:var(--muted,#b9c4cb)}
.producer-action-row .producer-limit span{flex:none;text-align:right;white-space:nowrap}
.producer-action-row .producer-limit strong{font-size:1.1em;white-space:nowrap;color:var(--text,#f2f4f5);font-weight:700}
.producer-screen .producer-chat-composer .producer-send-edits{position:relative;inset-block-start:var(--producer-edit-offset);width:auto;min-width:0;min-height:36px;height:36px;padding:6px 24px;line-height:1.15;font-size:11px;white-space:nowrap;border-radius:13px}
.producer-screen .producer-chat-composer .secondary-button.producer-send-edits{color:var(--accent)}
.producer-screen .producer-chat-composer .secondary-button.producer-send-edits:is(:disabled,:not(:hover,:focus-visible,:active)){border-color:color-mix(in srgb,var(--accent) 62%,transparent);box-shadow:none}
.producer-screen .producer-chat-composer .secondary-button.producer-send-edits:not(:disabled):active{border-color:var(--accent);background:var(--accent-soft);transform:translateY(1px) scale(.99)}
.producer-screen .producer-chat-composer .secondary-button.producer-send-edits:disabled{opacity:.46;cursor:not-allowed;transform:none;background:rgba(7,19,26,.64)}
.producer-screen .producer-action-row .inline-voice-retry{justify-self:end;margin:0;padding:2px 6px 2px 0;color:#ff8a00;font-size:12px;line-height:1.1;white-space:normal;text-align:right;height:auto;min-height:28px;min-width:0;max-width:100%}
.producer-screen .producer-chat-composer .producer-input-counter{justify-self:end;font-size:11px;line-height:1.1;white-space:nowrap;margin:0}
@media(max-width:470px){.producer-screen .producer-chat-composer .producer-send-edits{padding-inline:17px}}
@media(max-width:360px){.producer-screen .producer-chat-composer .producer-action-row{gap:1px;margin-inline:-6px}.producer-screen .producer-action-row .producer-limit{font-size:11px}.producer-screen .producer-chat-composer .producer-send-edits{padding-inline:10px}.producer-screen .producer-chat-composer .producer-input-counter{font-size:10px}}
.producer-screen .producer-chat-composer{--producer-edit-offset:3px;gap:6px}
.producer-waiting-indicator{gap:8px}
.producer-waiting-indicator .producer-loading-brand{gap:14px}
.producer-waiting-indicator .producer-loading-brand .pechka-loading-logo{width:84px;height:84px}
.producer-waiting-indicator .producer-waiting-label{font-size:18px;line-height:1.25;font-weight:600;color:#ff9a27}
@media(max-height:700px){.producer-chat-log{--producer-history-height:118px}.producer-screen .producer-chat-composer{--producer-edit-offset:2px;gap:5px}}
@media(max-height:590px){.producer-chat-log{--producer-history-height:100px}.producer-waiting-indicator .producer-waiting-label{font-size:17px}}

.producer-screen .producer-version-parameter{display:flex;width:100%;align-items:center;gap:8px;text-align:left;background:transparent;border:0;border-bottom:1px solid rgba(144,171,180,.25);padding:10px 0;color:inherit}.producer-version-parameter>span{flex:1;min-width:0}.producer-version-parameter .icon{width:18px;height:18px;flex:0 0 18px;color:#ff8a00}.producer-parameters .producer-version-parameter dt,.producer-parameters .producer-version-parameter dd{display:block;overflow-wrap:anywhere;margin:0}.producer-parameters .producer-version-parameter dd{margin-top:4px}.version-parameter-editor .manual-flow-entry{max-height:90px}.version-parameter-editor .manual-flow-choice{min-height:45px}.version-parameter-editor{display:grid;gap:8px}

.producer-screen .producer-actions.has-version-back{display:grid;grid-template-columns:1fr 1.35fr;gap:8px}.producer-screen .producer-actions.has-version-back .secondary-button{height:40px;min-height:40px;padding:7px 10px;font-size:14px}@media(max-height:590px){.producer-screen .producer-actions.has-version-back .secondary-button{height:36px;min-height:36px}}

.occasion-back[data-manual-producer-back-lock]:disabled{opacity:.45;cursor:not-allowed}
[data-choice-field="intro"] .instrumental-choice-label,
[data-choice-field="outro"] .instrumental-choice-label,
[data-choice-field="instrumentChoices"] .instrumental-choice-label,
[data-choice-field="effects"] .instrumental-choice-label,
[data-choice-field="exclude"] .instrumental-choice-label{overflow-wrap:anywhere}

/* Producer controls use the shared visual treatment; viewport sizing remains WEB's. */
.restyled-shell .producer-screen .producer-chat-log { padding-block-end: 0; }
.restyled-shell .producer-screen .producer-chat-composer .home-assistant-field { gap: 0; }
.restyled-shell .producer-screen .producer-chat-composer .home-assistant-input-shell {
  border: 1px solid #718087;
  border-radius: 14px;
}
.restyled-shell .producer-screen .producer-chat-composer .home-assistant-input-shell:has(textarea:focus) {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 14%, transparent);
}
.restyled-shell .producer-screen .producer-chat-composer textarea {
  border: 0;
  outline: 0;
  box-shadow: none;
  padding-inline-end: 62px;
}
.restyled-shell .producer-screen .producer-action-row { --producer-edit-offset: 0px; margin-inline: 0; }
.restyled-shell .producer-screen .producer-action-row .producer-limit {
  padding-inline-start: 4px;
  gap: clamp(5px, 1.7vw, 8px);
  font-size: clamp(10px, 3vw, 12px);
}
.restyled-shell .producer-screen .producer-action-row .producer-limit span { text-align: center; }
.restyled-shell .producer-screen .producer-action-row .inline-voice-retry {
  margin-inline-end: 10px;
  padding-inline: 0;
  text-align: center;
}
@media (max-width: 340px) {
  .restyled-shell .producer-screen .producer-chat-composer .producer-action-row {
    grid-template-columns: minmax(min-content, 1fr) auto minmax(0, 1fr);
  }
}

.app-shell.restyled-shell .producer-screen > .producer-song-card {
  padding-block-start: 5px !important;
  box-shadow: none;
}
.app-shell.restyled-shell .producer-screen > :is(.producer-song-card, .producer-conversation) {
  border: 1px solid rgba(255, 142, 25, .25) !important;
  background: var(--home-panel, #07151b);
}
html[data-theme="light"] .app-shell.restyled-shell .producer-screen > :is(.producer-song-card, .producer-conversation) {
  background: #fff;
  box-shadow: none;
}
.restyled-shell .producer-screen .final-title-editor { gap: 5px; }
.restyled-shell .producer-screen .final-title-editor > span:first-child { padding-inline-start: 5px; }

.restyled-shell .producer-screen :is(.producer-section > summary .producer-chevron, .producer-chat-history > .icon) {
  position: relative;
  flex: 0 0 32px;
  width: 32px;
  transform: none;
}
.restyled-shell .producer-screen :is(.producer-section > summary .producer-chevron > .icon, .producer-chat-history > .icon svg) {
  position: absolute;
  width: 34px;
  height: 34px;
  top: 50%;
  right: -6px;
  transform: translateY(-50%) rotate(90deg);
}
.restyled-shell .producer-screen :is(.producer-section[open] > summary .producer-chevron > .icon, .producer-chat-history[aria-expanded="true"] > .icon svg) {
  transform: translateY(-50%) rotate(-90deg);
}
.restyled-shell .producer-screen .producer-chat-history[aria-expanded="true"] > .icon { transform: none; }
.restyled-shell .producer-screen :is(.producer-section > summary .producer-chevron, .producer-chat-history) svg {
  stroke-width: .95;
}

/* Compact MAX producer: the desktop Mini App can also be embedded. */
@media (max-width: 600px) {
  .restyled-shell .producer-screen {
    padding-bottom: max(12px, env(safe-area-inset-bottom));
  }
  .restyled-shell .producer-screen > .producer-song-card {
    margin-block-start: -14px;
  }
  /* Match the embedded hero's height curve so the gap under its note stays small. */
  html.embedded-mobile-webview .restyled-shell .producer-screen > .producer-song-card {
    margin-block-start: calc(115px - clamp(108px, 33vw, 132px));
  }
  .restyled-shell .producer-screen .producer-chat-composer textarea {
    height: clamp(86px, 13dvh, 100px);
    min-height: 86px;
  }
  .restyled-shell .producer-screen .producer-chat-composer .producer-action-row {
    grid-template-columns: minmax(max-content, 1fr) auto minmax(0, 1fr);
    gap: 8px;
  }
  .restyled-shell .producer-screen > .producer-actions {
    position: static;
  }
}

/* A usable multi-line composer, including the compact Android WebView layout. */
html .producer-screen .producer-chat-composer textarea,
html.android-native-webview .restyled-shell .producer-screen .producer-chat-composer textarea {
  min-height:112px!important;height:112px!important;max-height:200px!important;
  padding:12px 64px 14px 12px!important;font-size:14px!important;line-height:1.5!important;
  overflow-y:auto!important;box-sizing:border-box;
}
html .producer-screen .producer-chat-composer .home-assistant-input-shell {
  min-height:112px!important;flex-shrink:0;
}
html.android-native-webview .producer-screen{--producer-field-height:112px!important;}
