#service-dialog {
  --tv-ink: #152139;
  --tv-muted: #54647a;
  --tv-line: #d9e1eb;
  --tv-blue: #2864ee;
  box-sizing: border-box;
  margin: auto;
  padding: 0;
  width: min(590px, calc(100vw - 32px));
  max-width: none;
  max-height: min(88dvh, 920px);
  color: var(--tv-ink);
  background: #fff;
  border: 1px solid #cbd5e2;
  border-radius: 18px;
  box-shadow: 0 28px 100px #030d2866, 0 4px 16px #030d2820;
  overscroll-behavior: contain;
  font-family: 'Instrument Sans', system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.45;
}
#service-dialog:not([open]) { display: none; }
#service-dialog::backdrop { background: #08132cb3; backdrop-filter: blur(4px); }
body:has(#service-dialog[open]) { overflow: hidden; }
.tv-shell, .tv-shell * { box-sizing: border-box; }
.tv-shell { width: 100%; letter-spacing: normal; }
.tv-shell :is(h2,h3,h4,p,fieldset,legend,dl,dd) { margin: 0; }
.tv-shell button, .tv-shell input, .tv-shell textarea, .tv-shell select { font: inherit; color: inherit; }
.tv-shell .tv-icon { display: block; width: 18px; height: 18px; flex: 0 0 auto; }
.tv-header { display: flex; align-items: center; gap: 13px; padding: 23px 26px; border-bottom: 1px solid var(--tv-line); }
.tv-mark { display: grid; width: 43px; height: 43px; flex: 0 0 auto; place-items: center; border: 1px solid #c6d5f5; border-radius: 11px; color: #295edb; background: #edf3ff; }
.tv-mark .tv-icon { width: 23px; height: 23px; }
.tv-heading { min-width: 0; flex: 1; }
.tv-heading h2 { color: var(--tv-ink); font-size: 25px; font-weight: 660; letter-spacing: -.045em; line-height: 1.15; outline: none; }
.tv-heading p { margin-top: 3px; color: var(--tv-muted); font-size: 13px; }
.tv-body { padding: 23px 26px 26px; }
.tv-form, .tv-result { display: grid; gap: 20px; }
.tv-button { display: inline-flex; justify-content: center; align-items: center; gap: 8px; min-height: 39px; padding: 8px 14px; cursor: pointer; border: 1px solid transparent; border-radius: 7px; font-size: 13px!important; font-weight: 620!important; line-height: 1.25; text-decoration: none; transition: background-color .15s ease, border-color .15s ease; }
.tv-button:disabled { opacity: .58; cursor: wait; }
.tv-primary { color: #fff!important; background: var(--tv-blue); }
.tv-primary:hover { background: #194fce; }
.tv-secondary, .tv-copy { color: var(--tv-ink)!important; background: #fff; border-color: var(--tv-line); }
.tv-secondary:hover, .tv-copy:hover { border-color: #a8b8ce; background: #f4f7fb; }
.tv-close, .tv-remove { display: grid; width: 34px; min-height: 34px; padding: 0; color: #596879; background: #f2f5f9; }
.tv-close:hover, .tv-remove:hover { background: #e3eaf3; }
.tv-remove { background: transparent; }
.tv-link { color: #2459cc!important; background: transparent; padding-inline: 3px; }
.tv-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.tv-shell :is(button,a,input,select,textarea,summary):focus-visible, .tv-coin:has(input:focus-visible) { outline: 3px solid #8badff; outline-offset: 2px; }
.tv-summary { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 16px 18px; border: 1px solid #d9e3f2; border-radius: 10px; background: #f5f8fd; }
.tv-summary strong { color: var(--tv-ink); font-size: 20px; letter-spacing: -.04em; }
.tv-summary small, .tv-item small { display: block; color: var(--tv-muted); font-size: 12px; margin-top: 3px; }
.tv-price { display: flex; align-items: baseline; gap: 4px; white-space: nowrap; }
.tv-price strong { font-size: 25px; }
.tv-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.tv-field { display: grid; align-content: start; gap: 7px; min-width: 0; }
.tv-label { display: block; color: #29384e; font-size: 13px; font-weight: 620; }
.tv-control { display: block; width: 100%; min-height: 43px; padding: 10px 12px; background: #fff; border: 1px solid #cbd6e4; border-radius: 7px; font-size: 14px!important; line-height: 1.4; }
.tv-control::placeholder { color: #8591a2; }
.tv-control:is(select) { appearance: auto; cursor: pointer; padding-right: 6px; }
.tv-control:is(textarea) { resize: vertical; max-height: 170px; }
.tv-field small, .tv-network { color: var(--tv-muted); font-size: 12px; }
.tv-coins { border: 0; padding: 0; min-width: 0; }
.tv-coins legend { padding: 0; margin-bottom: 8px; }
.tv-coin-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 8px; }
.tv-coin { position: relative; display: flex; align-items: center; justify-content: center; gap: 7px; min-height: 43px; border: 1px solid #cfd9e5; border-radius: 7px; font-size: 13px; font-weight: 650; cursor: pointer; }
.tv-coin .tv-icon { width: 19px; height: 19px; }
.tv-coin:has(input:checked) { color: #1d50c0; border-color: #3474ed; background: #edf4ff; box-shadow: inset 0 0 0 1px #3474ed; }
.tv-coin input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; cursor: pointer; margin: 0; }
.tv-network { display: block; margin-top: 6px; }
.tv-network:empty, .tv-feedback:empty { display: none; }
.tv-notice { padding: 11px 14px; color: #364d70; border: 1px solid #dce5f3; background: #f3f7fc; border-radius: 7px; font-size: 13px; line-height: 1.5; }
.tv-notice.tv-error { color: #8b312e; background: #fff3f1; border-color: #efccc8; }
.tv-notice.tv-success { color: #1c634f; background: #edfaf3; border-color: #c9e7d6; }
.tv-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; border-top: 1px solid var(--tv-line); padding-top: 16px; }
.tv-actions > .tv-link { margin-right: auto; }
.tv-body > .tv-actions { margin-top: 18px; }
.tv-body > .tv-notice + .tv-section-title { margin-top: 20px; }
.tv-section-title { font-size: 15px; font-weight: 650; letter-spacing: -.02em; }
.tv-item + .tv-section-title { margin-top: 20px; }
.tv-item { display: flex; align-items: center; gap: 12px; padding: 14px 0; border-bottom: 1px solid #e3e9f0; }
.tv-item-main { min-width: 0; flex: 1; }
.tv-item strong { font-size: 15px; font-weight: 640; }
.tv-row-actions { display: flex; align-items: center; gap: 4px; }
.tv-empty { display: grid; justify-items: center; gap: 7px; padding: 24px 12px 30px; text-align: center; }
.tv-empty > .tv-icon { width: 38px; height: 38px; color: #4473d5; margin-bottom: 6px; }
.tv-empty h3, .tv-order-title h3 { font-size: 22px; color: var(--tv-ink); letter-spacing: -.04em; }
.tv-empty p, .tv-recovery p { color: var(--tv-muted); font-size: 14px; }
.tv-empty .tv-button { margin-top: 9px; }
.tv-library-footer { margin-top: 12px; text-align: center; }
.tv-order-title { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.tv-status { padding: 4px 9px; color: #2557ad; background: #edf4ff; border: 1px solid #d2e0fa; border-radius: 30px; font-size: 12px; font-weight: 600; }
.tv-details { display: grid; grid-template-columns: 1fr 1.4fr; gap: 8px; font-size: 14px; }
.tv-details dt { color: var(--tv-muted); }
.tv-details dd { text-align: right; font-weight: 570; overflow-wrap: anywhere; }
.tv-invoice { display: grid; gap: 10px; padding: 16px; border: 1px solid #cbdaf4; border-radius: 9px; background: #f5f8fe; }
.tv-invoice h4, .tv-invoice p { font-size: 15px; }
.tv-invoice > small { color: var(--tv-muted); font-size: 12px; }
.tv-copy-field { display: grid; gap: 6px; }
.tv-copy-box { display: flex; align-items: center; border: 1px solid #cbd5e2; border-radius: 7px; padding: 5px; background: white; }
.tv-copy-box input { width: 0; flex: 1; min-width: 0; padding: 6px; background: transparent; font-family: ui-monospace, monospace; font-size: 12px; border: 0; }
.tv-copy { min-height: 32px; padding: 5px 8px; }
.tv-recovery { margin: 18px 0 12px; padding: 12px 14px; border: 1px solid var(--tv-line); border-radius: 7px; background: #fafbfd; }
.tv-recovery summary { cursor: pointer; font-size: 14px; font-weight: 620; }
.tv-recovery p { margin: 8px 0 12px; font-size: 13px; }
@media (max-width: 520px) {
  #service-dialog { width: calc(100vw - 18px); max-height: 92dvh; border-radius: 13px; }
  .tv-header { padding: 18px 16px; gap: 10px; }
  .tv-heading h2 { font-size: 23px; }
  .tv-body { padding: 18px 16px; }
  .tv-price { flex-direction: column; align-items: flex-end; gap: 0; }
  .tv-summary { padding: 13px; }
  .tv-summary small { font-size: 11px; }
  .tv-pair { gap: 9px; }
  .tv-coin-grid { gap: 5px; }
  .tv-coin { gap: 4px; font-size: 12px; }
  .tv-coin .tv-icon { width: 15px; height: 15px; }
  .tv-item { flex-wrap: wrap; }
  .tv-item-main { min-width: 130px; }
}
@media (max-width: 350px) {
  .tv-pair { grid-template-columns: 1fr; }
  .tv-actions { flex-wrap: wrap; }
  .tv-coin-grid { grid-template-columns: repeat(2, 1fr); }
}
