/* Form layout, toolbar and print-PDF preview; document generation is unchanged. */
@media screen {
  html body > main {
    width:100%!important; max-width:none!important; min-width:0;
    margin-left:0!important; margin-right:0!important;
    padding-left:clamp(12px,1.5vw,24px)!important;
    padding-right:clamp(12px,1.5vw,24px)!important;
    box-sizing:border-box;
  }
  #toolWrap { container-type:inline-size; width:100%; max-width:none!important; margin-inline:0; box-sizing:border-box; }
  #toolWrap .talimat-layout, #toolWrap .work-grid { width:100%; max-width:none!important; min-width:0; box-sizing:border-box; }
  #toolWrap .work-grid { grid-template-columns:minmax(0,1fr) minmax(0,1.4fr); gap:16px; align-items:start; }
  #toolWrap .cascade-wrap { display:block; width:100%; min-width:0; max-width:100%; overflow:visible; box-sizing:border-box; }
  #toolWrap .panel-left-col, #toolWrap .panel-alici-col, #toolWrap .panel-right-col { min-width:0; max-width:100%; box-sizing:border-box; }
  #toolWrap .panel-right-col { position:relative; margin-top:0!important; padding-right:52px; }
  #toolWrap .panel-left-col>.form-card, #toolWrap .panel-alici-col>.form-card, #toolWrap .cascade-wrap-inner {
    width:100%; min-width:0; max-width:100%; box-sizing:border-box;
    padding:16px; border-radius:14px; box-shadow:none; background:var(--surface); border:1px solid var(--hairline);
  }
  #toolWrap .xcell-title { padding-left:0!important; font-size:18px; font-weight:700; line-height:1.4; color:var(--text); letter-spacing:0; text-transform:none; }
  #toolWrap .xcell-title::before { display:none; }
  #toolWrap .xcell-group { display:grid; min-width:0; gap:12px; padding:0; border:0; border-radius:0; background:transparent; overflow:visible; }
  #toolWrap .xcell { min-width:0; grid-template-columns:minmax(0,1fr) 32px 48px; gap:6px 8px; padding:0; background:transparent; border:0; }
  #toolWrap .xcell.xcell-full { grid-template-columns:minmax(0,1fr)!important; }
  #toolWrap .xcell-label { grid-column:1/-1; padding:0; background:transparent; border:0; color:var(--muted); font:600 12px/1.4 Inter,system-ui,sans-serif; letter-spacing:.02em; }
  #toolWrap .xcell input:not([type="checkbox"]):not([type="radio"]), #toolWrap .xcell select, #toolWrap .xcell textarea {
    box-sizing:border-box; min-width:0; width:100%; min-height:44px; padding:10px 12px;
    border:1px solid var(--hairline); border-radius:9px; background:var(--surface-2); color:var(--text); font-size:14px; max-width:100%;
  }
  #toolWrap .xcell input:focus, #toolWrap .xcell select:focus, #toolWrap .xcell textarea:focus { outline:2px solid var(--brass); outline-offset:1px; }
  #toolWrap .talimat-bank-controls, #toolWrap .talimat-account-controls { grid-column:1/-1; width:100%; min-width:0; gap:8px; }
  #toolWrap .talimat-bank-controls { grid-template-columns:repeat(2,minmax(0,1fr)); }
  #toolWrap .talimat-account-controls { grid-template-columns:110px minmax(0,1fr); }
  #toolWrap .talimat-bank-controls>.mmg-ac-liste, #toolWrap .talimat-account-controls>.mmg-ac-liste { width:100%!important; min-width:0; }
  #toolWrap .talimat-bank-controls .mmg-ac-btn, #toolWrap .talimat-account-controls .mmg-ac-btn { width:100%!important; height:44px; min-height:44px; }
  #toolWrap .xcell .mmg-ac-liste>select.mmg-ac-gizli { display:none!important; }
  #toolWrap .talimat-representative { grid-template-columns:1fr; gap:6px; background:transparent; }
  #toolWrap .talimat-representative label { padding:0; font:600 12px/1.4 Inter,system-ui,sans-serif; }
  #toolWrap .talimat-representative input { box-sizing:border-box; min-height:44px; padding:10px 12px; border:1px solid var(--hairline); border-radius:9px; }
  #toolWrap .talimat-account-state[hidden] { display:none!important; }
  #toolWrap #panel-havale-tekli .xcell-group { container-type:inline-size; }
  #toolWrap #panel-havale-tekli .xcell-3col:has(input[id*="Tutar"]) { grid-template-columns:minmax(0,1fr); }
  #toolWrap #panel-havale-tekli .xcell-3col:has(input[id*="Tutar"])>div { grid-column:1/-1; min-width:0; width:100%; box-sizing:border-box; }
  @container(max-width:420px){
    #toolWrap .talimat-account-controls { grid-template-columns:94px minmax(0,1fr); }
    #toolWrap .talimat-account-controls>input:not([data-account-field]) { grid-column:2; grid-row:1; }
  }
  #toolWrap #mmgTalimatUstSatir { display:flex; flex-wrap:wrap; gap:10px; align-items:end; min-width:0; }
  #toolWrap #mmgTalimatUstSatir>.xcell { width:100%; min-width:0; margin:0!important; }
  #toolWrap #mmgTalimatUstSatir>.xcell { flex:1 1 0; }
  #toolWrap #mmgTalimatUstSatir>#tarihSlotHavale,
  #toolWrap #mmgTalimatUstSatir>#tarihSlotSerbest { flex:0 0 150px; margin-left:auto!important; }
  #toolWrap #mmgTalimatUstSatir>#talimatTurWrap { flex:1 1 120px; }
  #toolWrap #mmgTalimatUstSatir:has(>#altKategoriWrap[style*="grid"])>#talimatTurWrap { flex:1.6 1 190px; }
  #toolWrap #mmgTalimatUstSatir>#altKategoriWrap { flex:1 1 120px; }
  #toolWrap #mmgTalimatUstSatir>#paraBirimiSlotHavale { flex:0 1 96px; }
  #toolWrap #mmgTalimatUstSatir .xcell-label { white-space:normal; }
  #toolWrap #panel-havale-tekli:not([hidden]):not([style*="display:none"]):not([style*="display: none"]) { display:grid!important; }
  #toolWrap #panel-havale-tekli>.panel-left-col { display:flex; flex-direction:column; gap:24px; }
  #toolWrap #panel-havale-tekli>.panel-left-col>.cascade-wrap,
  #toolWrap #panel-havale-tekli>.panel-left-col>.form-card { margin-block:0!important; }
  #toolWrap .doc-preview-row { position:static; display:block!important; }
  #toolWrap .doc-preview { min-width:0; width:100%; box-sizing:border-box; }
  #toolWrap .doc-preview.mmg-pdf-preview {
    position:relative; display:block; width:100%!important; max-width:210mm!important;
    height:auto!important; min-height:0!important; margin-inline:auto!important;
    padding:0!important; border:0!important; border-radius:0!important;
    background:transparent!important; box-shadow:none!important; overflow:visible!important;
    transform:none!important;
  }
  #toolWrap .mmg-pdf-preview>:not(.mmg-pdf-pages):not(.mmg-pdf-status):not(.mmg-fullscreen-exit-btn) { display:none!important; }
  #toolWrap .mmg-pdf-pages { display:grid; gap:16px; width:100%; min-width:0; }
  #toolWrap .mmg-pdf-pages:empty { aspect-ratio:210 / 297; background:#fff; }
  #toolWrap .mmg-pdf-page {
    display:block; width:100%!important; max-width:100%!important; height:auto!important;
    margin:0; padding:0; border:0; background:#fff; transform:none!important;
    box-shadow:0 3px 18px rgba(20,28,43,.16);
  }
  #toolWrap .mmg-pdf-preview[aria-busy="true"] .mmg-pdf-pages { opacity:.4; }
  #toolWrap .mmg-pdf-status {
    position:absolute; top:16px; left:12px; right:12px; z-index:1;
    padding:12px; border:1px solid var(--hairline); border-radius:8px;
    background:var(--surface); color:var(--text); font-size:13px; line-height:1.5;
  }
  #toolWrap .mmg-pdf-status[hidden] { display:none!important; }
  #toolWrap .mmg-pdf-retry { padding:6px 10px; border:1px solid var(--hairline); border-radius:6px; background:var(--surface-2); color:var(--text); cursor:pointer; }
  #toolWrap .doc-preview.mmg-pdf-preview:fullscreen { max-width:none!important; overflow:auto!important; background:var(--surface-2)!important; }
  #toolWrap .mmg-pdf-preview:fullscreen .mmg-pdf-pages { max-width:210mm; margin-inline:auto; }
  #toolWrap .vtool-col {
    position:absolute; top:0; right:0; left:auto; display:flex; flex-direction:column;
    flex-wrap:nowrap; align-items:center; width:44px; max-width:44px; margin:0; padding:0; gap:8px;
  }
  #toolWrap .vtool-col button {
    width:44px!important; min-width:44px!important; max-width:44px!important;
    height:28px!important; min-height:28px!important; flex:0 0 44px;
    display:inline-flex; align-items:center; justify-content:center; gap:0; padding:0!important;
    font-size:0!important; line-height:0; border:1px solid var(--hairline); border-radius:9px;
    background:var(--surface); color:var(--text); box-shadow:none!important;
  }
  #toolWrap .vtool-col button::before, #toolWrap .vtool-col button::after { content:none!important; display:none!important; }
  #toolWrap .vtool-col button>span { display:none!important; }
  #toolWrap .vtool-col button>svg, #toolWrap .vtool-col button>img { display:block; flex:0 0 20px; width:20px; height:20px; }
  @container (max-width:719px) {
    #toolWrap .work-grid { grid-template-columns:minmax(0,1fr)!important; }
    #toolWrap .xcell-title { font-size:17px; }
    #toolWrap .xcell input:not([type="checkbox"]):not([type="radio"]), #toolWrap .xcell select, #toolWrap .xcell textarea { min-height:44px; font-size:16px; }
  }
  @container (max-width:359px) {
    #toolWrap #mmgTalimatUstSatir { flex-wrap:wrap; }
    #toolWrap #mmgTalimatUstSatir>.xcell { flex:1 1 130px; }
  }
}
#docPreviewGeneric table td { font-family:inherit!important; font-size:inherit!important; line-height:1.5; padding:10px 12px!important; vertical-align:middle; color:#222!important; }
@media print { #toolWrap .vtool-col { display:none!important; } #toolWrap .panel-right-col { padding-right:0; } }
/* Amount and currency are one compact entry row in every instruction. */
#toolWrap .talimat-amount-currency{display:grid;grid-template-columns:minmax(0,1fr) 96px;gap:10px;grid-column:1/-1;width:100%;min-width:0;align-items:end}
#toolWrap .talimat-amount-currency>.xcell{min-width:0;width:100%;margin:0!important;grid-column:auto!important}
#toolWrap .talimat-amount-currency input,#toolWrap .talimat-amount-currency select{min-width:0;width:100%}
#toolWrap #mmgTalimatUstSatir>#tarihSlotHavale,#toolWrap #mmgTalimatUstSatir>#tarihSlotSerbest{order:10;margin-left:auto!important}
@media(max-width:600px){#toolWrap .talimat-amount-currency{grid-template-columns:minmax(0,1fr) 82px;gap:8px}}
/* Sender: currency, account method, account number. Recipient: kind, name. */
#toolWrap .talimat-currency-account{display:grid;grid-template-columns:76px minmax(0,1fr);gap:8px;align-items:end;grid-column:1/-1;min-width:0}
#toolWrap .talimat-currency-account>.xcell{width:100%;min-width:0;grid-column:auto!important;margin:0!important}
#toolWrap .talimat-currency-account .talimat-account-controls{grid-template-columns:96px minmax(0,1fr)}
#toolWrap .talimat-recipient-heading{display:grid;grid-template-columns:minmax(142px,1fr) minmax(0,2.4fr);gap:10px;grid-column:1/-1;min-width:0}
#toolWrap .talimat-recipient-heading>.xcell{grid-column:auto!important;min-width:0;width:100%}
#toolWrap .talimat-currency-account select{padding-inline:8px}
#toolWrap .talimat-currency-account>.talimat-representative{grid-column:1/-1;width:100%;min-width:0}


/* Mobile form: critical account values own a full-width row. */
@media screen and (max-width:860px){
 #toolWrap .panel-left-col>.form-card,#toolWrap .panel-alici-col>.form-card,#toolWrap .cascade-wrap-inner{padding:8px 0;border:0;border-radius:0;background:transparent;margin-bottom:8px!important}
 #toolWrap .panel-right-col{padding-right:0}
 #toolWrap .talimat-currency-account{grid-template-columns:minmax(0,1fr)}
 #toolWrap .talimat-account-controls,#toolWrap .talimat-currency-account .talimat-account-controls{grid-template-columns:minmax(0,1fr)}
 #toolWrap .talimat-account-controls>input:not([data-account-field]){grid-column:1/-1;grid-row:auto}
 #toolWrap .xcell .talimat-account-controls input:not([type="checkbox"]):not([type="radio"]){width:100%;min-width:0;box-sizing:border-box;font-size:14px;font-family:Arial,sans-serif;padding-inline:6px}
 #toolWrap .xcell-title{padding-left:0!important;font-size:14px;margin:4px 0}
}

/* Keep amount and currency in separate layout columns. */
#toolWrap .xcell:has(>.xcell-label)>div:has(>.alici-para-birimi-label){display:grid!important;grid-template-columns:minmax(0,1fr) auto;gap:10px;align-items:center;padding-right:12px;background:var(--input-bg,#eef0f4);border-radius:8px}
#toolWrap input[id^="fAliciTutar_"]{min-width:0;padding-right:0!important}
#toolWrap .alici-para-birimi-label{position:static!important;white-space:nowrap}

/* Account values keep a full row; compact currency and method controls. */
#toolWrap .talimat-currency-account{grid-template-columns:62px minmax(0,1fr)}
#toolWrap .talimat-account-controls,#toolWrap .talimat-currency-account .talimat-account-controls{grid-template-columns:78px minmax(0,1fr)}
#toolWrap .talimat-account-controls>input:not([data-account-field]){grid-column:1/-1!important;grid-row:auto!important;width:100%;min-width:0;box-sizing:border-box;font-size:14px!important;padding-inline:6px!important}
@media(max-width:600px){#toolWrap .talimat-currency-account{grid-template-columns:minmax(0,1fr)}#toolWrap .talimat-currency-account>#paraBirimiSlotHavale{max-width:62px}}

/* Sender identity and recipient payment details follow the form reading order. */
#toolWrap .talimat-sender-pair,#toolWrap .talimat-amount-description{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:12px;width:100%;min-width:0;grid-column:1/-1}
#toolWrap .talimat-sender-pair>.xcell,#toolWrap .talimat-amount-description>.xcell{min-width:0;width:100%;grid-column:auto!important}
#toolWrap .talimat-sender-pair>.talimat-representative{min-width:0;display:grid;grid-template-columns:minmax(0,1fr);align-content:start;gap:6px}
#toolWrap .talimat-sender-pair input{width:100%;min-width:0;box-sizing:border-box}
#toolWrap .talimat-amount-description input[id^="fAliciTutar_"]{padding-right:44px!important;font-variant-numeric:tabular-nums}
@media(max-width:420px){#toolWrap .talimat-amount-description{grid-template-columns:minmax(0,1fr)} }

#toolWrap .talimat-sender-pair>.xcell{grid-template-columns:minmax(0,1fr)}
#toolWrap .talimat-sender-pair>.xcell>input{grid-column:1/-1}

#toolWrap .talimat-partner-toggle{display:inline-flex;align-items:center;gap:4px;margin-left:10px;font-size:12px;text-transform:none;cursor:pointer}
#toolWrap .talimat-partner-toggle input{width:15px!important;height:15px!important;min-height:0!important;margin:0;padding:0}

#toolWrap .talimat-senet-pair{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;grid-column:1/-1;min-width:0}
#toolWrap .talimat-senet-pair>.xcell{grid-column:auto!important;min-width:0;grid-template-columns:minmax(0,1fr)}
@media(min-width:421px){
#toolWrap .talimat-currency-account{align-items:end;grid-template-columns:54px minmax(0,1fr)}
#toolWrap .talimat-account-controls,#toolWrap .talimat-currency-account .talimat-account-controls{grid-template-columns:70px minmax(0,1fr);align-items:center}
#toolWrap .talimat-account-controls>input:not([data-account-field]){grid-column:2!important;grid-row:1!important}
#toolWrap .talimat-account-controls>select,#toolWrap .talimat-account-controls>.mmg-ac-liste{grid-column:1!important;grid-row:1!important}
}

#toolWrap .talimat-amount-currency.talimat-with-rate{grid-template-columns:minmax(0,1.6fr) 68px minmax(0,1fr);gap:8px}
#toolWrap .talimat-with-rate>.xcell{grid-template-columns:minmax(0,1fr)}

/* Account selector and identifier share one row in both sender and recipient forms. */
#toolWrap .talimat-account-controls{display:grid!important;grid-template-columns:78px minmax(0,1fr)!important;align-items:center;min-width:0}
#toolWrap .talimat-account-controls>input:not([data-account-field]){grid-column:2!important;grid-row:1!important;min-width:0;width:100%;box-sizing:border-box}
#toolWrap .talimat-account-controls>select,#toolWrap .talimat-account-controls>.mmg-ac-liste{grid-column:1!important;grid-row:1!important;min-width:0}
#toolWrap .talimat-currency-account>.xcell{display:grid;grid-template-columns:minmax(0,1fr)!important;align-content:end}
#toolWrap .talimat-currency-account .talimat-account-controls{grid-column:1/-1!important}

/* Consistent compact instruction form fields. */
@media screen {
 #toolWrap .xcell input:not([type="checkbox"]):not([type="radio"]),#toolWrap .xcell select,#toolWrap .xcell textarea,#toolWrap .xcell .mmg-ac-btn,#toolWrap .talimat-representative input{font:400 14px/20px Arial,sans-serif!important;min-height:26px!important;padding:2px 8px!important;border-radius:7px!important}
 #toolWrap .xcell input:not([type="checkbox"]):not([type="radio"]),#toolWrap .xcell select,#toolWrap .xcell .mmg-ac-btn,#toolWrap .talimat-representative input{height:26px!important}
 #toolWrap .xcell-group{gap:8px!important}
 #toolWrap .xcell{row-gap:4px!important}
 #toolWrap .panel-left-col>.form-card,#toolWrap .panel-alici-col>.form-card,#toolWrap .cascade-wrap-inner{padding:12px!important}
 #toolWrap #panel-havale-tekli>.panel-left-col{gap:14px!important}
 #toolWrap .xcell-title{font-size:16px!important;line-height:22px!important}
}
@media screen and (max-width:600px){
 #toolWrap .xcell input:not([type="checkbox"]):not([type="radio"]),#toolWrap .xcell select,#toolWrap .xcell textarea,#toolWrap .xcell .mmg-ac-btn,#toolWrap .talimat-representative input{font-size:16px!important;min-height:28px!important}
 #toolWrap .xcell input:not([type="checkbox"]):not([type="radio"]),#toolWrap .xcell select,#toolWrap .xcell .mmg-ac-btn,#toolWrap .talimat-representative input{height:28px!important}
}

@layer mmgInstructionCompact {
 @media screen {
  #toolWrap #panel-generic-letter #genericFieldsContainer :is(input:not([type="checkbox"]):not([type="radio"]),select),#toolWrap input[type="date"]{height:26px!important;min-height:26px!important;max-height:26px!important;font:400 14px/20px Arial,sans-serif!important;box-sizing:border-box!important;padding:2px 8px!important}
 }
 @media screen and (max-width:600px){
  #toolWrap #panel-generic-letter #genericFieldsContainer :is(input:not([type="checkbox"]):not([type="radio"]),select),#toolWrap input[type="date"]{height:28px!important;min-height:28px!important;max-height:28px!important;font:400 16px/22px Arial,sans-serif!important}
  #toolWrap #panel-havale-tekli .talimat-currency-account{grid-template-columns:minmax(0,1fr)!important}
  #toolWrap #panel-havale-tekli .talimat-currency-account>#paraBirimiSlotHavale{max-width:76px!important}
  #toolWrap #panel-havale-tekli .talimat-account-controls{grid-template-columns:minmax(0,1fr)!important}
  #toolWrap #panel-havale-tekli .talimat-account-controls>:is(select,.mmg-ac-liste){grid-column:1!important;grid-row:1!important;max-width:94px!important}
  #toolWrap #panel-havale-tekli .talimat-account-controls>input:not([data-account-field]){grid-column:1/-1!important;grid-row:2!important;width:100%!important;min-width:0!important}
 }
}

@layer mmgInstructionCompact {
 #toolWrap{--instruction-control-height:26px}
 #toolWrap .xcell-savebtn,#toolWrap .mmg-person-remove{height:var(--instruction-control-height)!important;min-height:0!important;max-height:none!important;width:var(--instruction-control-height)!important;min-width:0!important;flex-basis:var(--instruction-control-height)!important;padding:2px!important;box-sizing:border-box!important}
 #toolWrap #genericFieldsContainer .gl-firma-controls{grid-template-columns:minmax(0,1fr) var(--instruction-control-height) var(--instruction-control-height)!important}
 @media(max-width:600px){#toolWrap{--instruction-control-height:28px}}
}
@layer mmgInstructionCompact {
 #toolWrap :is(.io-btn:not(.io-btn-icon),#vgDemoAnahtar,.reset-btn){height:auto!important;min-height:0!important;max-height:none!important;font-size:14px!important;line-height:20px!important;padding:2px 8px!important;box-sizing:border-box!important}
 #toolWrap #vgDemoAnahtar{margin-top:0!important}
 @media(max-width:600px){#toolWrap :is(.io-btn:not(.io-btn-icon),#vgDemoAnahtar,.reset-btn){font-size:16px!important;line-height:22px!important}}
}

/* Keep the currency label and all instruction actions legible. */
@media screen {
#toolWrap .talimat-amount-currency.talimat-with-rate{grid-template-columns:minmax(0,1.6fr) 96px minmax(0,1fr)}
#toolWrap .talimat-amount-currency .mmg-ac-liste{min-width:0;width:100%}
#toolWrap .talimat-amount-currency .mmg-ac-btn{box-sizing:border-box;width:100%;padding-inline:8px 24px!important}
#toolWrap #genericFieldsContainer .gl-firma-controls .xcell-savebtn{display:inline-flex!important;align-items:center;justify-content:center;padding:0!important;line-height:1!important}
#toolWrap .vtool-col button{display:inline-flex!important;align-items:center;justify-content:center;background:linear-gradient(180deg,var(--mmg-action-top),var(--mmg-action-bottom))!important;color:var(--mmg-action-ink)!important;border:1px solid var(--mmg-action-line)!important;border-radius:8px!important;box-shadow:0 3px 0 var(--mmg-action-base),0 4px 5px var(--mmg-action-shadow),inset 0 1px 0 #ffffff60!important}
}

.talimat-currency-dialog{box-sizing:border-box;width:min(320px,calc(100vw - 32px));margin:auto;border:1px solid var(--mmg-action-line);border-radius:12px;padding:16px;background:var(--mmg-action-top);color:var(--mmg-action-ink)}
.talimat-currency-dialog h3{margin:0 0 12px;font-size:16px}.talimat-currency-dialog label{display:grid;gap:5px}.talimat-currency-dialog input{box-sizing:border-box;width:100%;padding:4px 8px;text-transform:uppercase}.talimat-currency-actions{display:flex;justify-content:space-between;gap:16px}.talimat-currency-dialog::backdrop{background:#152c4155}
