/* Keep scaling layout isolated from the other EC2 tools. */
#tab-ec2-scaling { color: #25324a; height: auto; min-height: 100%; }
#tab-ec2-scaling .scale-notice { position: fixed; top: 76px; right: 24px; z-index: 1080; display: flex; align-items: flex-start; gap: 16px; width: max-content; max-width: min(480px, calc(100vw - 32px)); padding: 15px 16px; border: 1px solid #cad8f7; border-left: 4px solid #6385ee; border-radius: 10px; background: #f4f7ff; color: #30466d; box-shadow: 0 8px 30px #24345226; font-size: 14px; line-height: 1.6; overflow-wrap: anywhere; }
#tab-ec2-scaling .scale-notice[hidden] { display: none; }
#tab-ec2-scaling .scale-notice.is-error { background: #fff5f5; border-color: #efc6ca; border-left-color: #d75260; color: #943641; }
#tab-ec2-scaling .scale-notice > span { min-width: 0; max-height: 50vh; overflow-y: auto; }
#tab-ec2-scaling .scale-notice-close { flex: 0 0 28px; width: 28px; height: 28px; padding: 0; background: transparent; border: 0; border-radius: 5px; color: inherit; font-size: 23px; line-height: 24px; }
#tab-ec2-scaling .scale-notice-close:hover { background: #2434520d; }
#tab-ec2-scaling .scale-notice-close:focus-visible { outline: 2px solid #6385ee; outline-offset: 2px; }
@media (max-width: 480px) { #tab-ec2-scaling .scale-notice { top: 65px; right: 16px; font-size: 13px; } }
#tab-ec2-scaling > p { font-size: 13px; margin-bottom: 18px; }
#tab-ec2-scaling > .alert { padding: 12px 16px; font-size: 13px; border: 0; border-left: 3px solid #6385ee; border-radius: 8px; }
#tab-ec2-scaling .scale-workspace { display: grid; grid-template-columns: 290px minmax(0, 1fr); gap: 24px; align-items: start; }
#tab-ec2-scaling .scale-sidebar { position: sticky; top: 16px; display: flex; flex-direction: column; max-height: calc(100vh - 132px); max-height: calc(100dvh - 132px); min-height: 0; }
#tab-ec2-scaling .scale-sidebar-heading { flex-shrink: 0; }
#scale-plans { overflow-y: auto; min-height: 0; overscroll-behavior-y: contain; scrollbar-gutter: stable; }
#tab-ec2-scaling #scale-preview { z-index: 1090; }
#tab-ec2-scaling .scale-preview-text { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13px; }
#tab-ec2-scaling .scale-sidebar-heading { display: flex; align-items: center; justify-content: space-between; font-size: 13px; font-weight: 600; color: #66748c; margin: 2px 0 12px; }
#scale-plan-count { background: #e5eaf3; padding: 2px 9px; border-radius: 20px; font-size: 12px; }
#tab-ec2-scaling .scale-plan { background: #fff; border: 1px solid #e1e6ef; border-radius: 12px; padding: 17px; margin-bottom: 12px; transition: border-color .15s, box-shadow .15s; }
#tab-ec2-scaling .scale-plan.is-selected { border-color: #6483ee; box-shadow: 0 0 0 2px #6483ee15; }
#tab-ec2-scaling .scale-plan-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
#tab-ec2-scaling .scale-plan-title { background: none; border: 0; padding: 0; color: #263650; font-weight: 650; font-size: 15px; text-align: left; overflow-wrap: anywhere; }
#tab-ec2-scaling .is-selected .scale-plan-title { color: #496ce0; }
#tab-ec2-scaling .scale-state { font-size: 11px; padding: 4px 7px; border-radius: 5px; white-space: nowrap; background: #eff2f6; color: #627087; }
#tab-ec2-scaling .scale-state.is-on { background: #e9f6f0; color: #287657; }
#tab-ec2-scaling .scale-state.is-paused { background: #fff5df; color: #896515; }
#tab-ec2-scaling .scale-plan-schedule { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 16px 0 8px; padding: 10px 12px; background: #f7f9fc; border-radius: 8px; }
#tab-ec2-scaling .scale-plan-schedule div { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
#tab-ec2-scaling .scale-plan-schedule span { color: #7c879a; font-size: 11px; }
#tab-ec2-scaling .scale-plan-schedule strong { font-size: 14px; font-variant-numeric: tabular-nums; }
#tab-ec2-scaling .scale-plan-meta, #tab-ec2-scaling .scale-plan-note { color: #7c879a; font-size: 11px; display: block; margin: 6px 0; }
#tab-ec2-scaling .scale-plan-execute { display: grid; grid-template-columns: 1fr 1fr auto; gap: 6px; margin-top: 14px; }
#tab-ec2-scaling .scale-plan-execute .btn { font-size: 12px; padding: 6px 8px; border-radius: 6px; }
#tab-ec2-scaling .scale-plan-manage { display: flex; justify-content: space-between; border-top: 1px solid #edf0f5; margin-top: 14px; padding-top: 10px; }
#tab-ec2-scaling .scale-plan-manage .btn { margin: 0 !important; border: 0; font-size: 12px; padding: 4px 0; color: #727f94; background: transparent; }
#tab-ec2-scaling .scale-plan-manage .btn:hover { color: #365dcf; text-decoration: underline; }
#tab-ec2-scaling .scale-plan-manage [data-delete-plan]:hover { color: #c3414c; }
#tab-ec2-scaling .scale-editor { min-width: 0; }
#tab-ec2-scaling .scale-editor > .card { border: 1px solid #e1e6ef; border-radius: 14px; padding: 26px; box-shadow: 0 3px 12px #24345204; }
#tab-ec2-scaling .scale-editor-heading { border-bottom: 1px solid #e9edf4; margin-bottom: 22px; padding-bottom: 18px; }
#tab-ec2-scaling .scale-eyebrow { color: #7283a2; font-size: 11px; letter-spacing: 1px; }
#tab-ec2-scaling .scale-editor-heading h5 { margin: 6px 0; font-size: 20px; font-weight: 650; }
#tab-ec2-scaling .scale-editor-heading p { font-size: 12px; color: #7c879a; margin: 0; }
#tab-ec2-scaling .scale-section-label { font-size: 14px; font-weight: 650; margin-bottom: 16px; }
#tab-ec2-scaling .scale-instance-heading { border-top: 1px solid #e9edf4; padding-top: 22px; margin-bottom: 0; }
#tab-ec2-scaling .form-label { font-size: 12px; font-weight: 550; color: #57657c; margin-bottom: 7px; }
#tab-ec2-scaling .form-control, #tab-ec2-scaling .form-select { font-size: 13px; border-color: #dfe5ef; border-radius: 7px; min-height: 38px; }
#tab-ec2-scaling .form-control:focus, #tab-ec2-scaling .form-select:focus { border-color: #7f98ef; box-shadow: 0 0 0 3px #6385ee15; }
#tab-ec2-scaling .form-text { font-size: 11px; line-height: 1.7; color: #818b9c; }
#tab-ec2-scaling section { border-top: 1px solid #e9edf4; padding-top: 24px; }
#tab-ec2-scaling section h6 { font-size: 14px; font-weight: 650; }
#tab-ec2-scaling .badge { font-size: 10px; vertical-align: middle; background: #edf2ff !important; color: #5273de; }
#tab-ec2-scaling [data-entry], #scale-verification-rows > div { background: #fafbfd; border-color: #e5eaf2 !important; border-radius: 10px !important; }
#tab-ec2-scaling .btn { font-size: 13px; }
#tab-ec2-scaling .btn:focus-visible, #tab-ec2-scaling .scale-plan-title:focus-visible { outline: 3px solid #9eb5ff; outline-offset: 3px; }
#tab-ec2-scaling details { padding: 14px; background: #f7f9fc; border-radius: 8px; font-size: 12px; }
#tab-ec2-scaling .scale-form-actions { border-top: 1px solid #e9edf4; padding-top: 20px; }
#tab-ec2-scaling .table { font-size: 12px; background: white; }
#tab-ec2-scaling .table th { color: #738098; font-weight: 550; background: #f7f9fc; }
#tab-ec2-scaling .table td, #tab-ec2-scaling .table th { padding: 12px; }
#scale-detail { font-size: 12px; border: 1px solid #e2e7f0; border-radius: 10px; line-height: 1.8; }
#tab-ec2-scaling .scale-log-panel { --bs-offcanvas-width: min(980px, 100vw); z-index: 1090; }
#tab-ec2-scaling .scale-log-body { display: flex; flex-direction: column; gap: 12px; min-height: 0; padding-top: 0; }
#tab-ec2-scaling .scale-log-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
#tab-ec2-scaling .scale-log-history { max-height: 28vh; flex: 0 1 auto; min-height: 90px; border: 1px solid #e2e7f0; border-radius: 8px; }
#tab-ec2-scaling .scale-log-history thead { position: sticky; top: 0; }
#tab-ec2-scaling .scale-log-history [aria-pressed="true"] { color: #263650; background: #edf2ff; font-weight: 650; }
#tab-ec2-scaling .scale-log-body #scale-detail { flex: 1 1 200px; min-height: 120px; overflow: auto; margin: 0; white-space: pre-wrap !important; overflow-wrap: anywhere; }
#tab-ec2-scaling .scale-log-progress { flex: 0 0 auto; max-height: 30vh; overflow: auto; border: 1px solid #e2e7f0; border-radius: 8px; padding: 10px; overflow-wrap: anywhere; }
#tab-ec2-scaling .scale-log-progress details { padding: 8px; margin-top: 6px; }
#tab-ec2-scaling .scale-log-phase-row { display: grid; gap: 3px; border-bottom: 1px solid #e2e7f0; padding: 8px 0; font-size: 12px; }
#scale-log-artifacts { white-space: pre-wrap; }
@media (max-width: 480px) {
  #tab-ec2-scaling .scale-log-body { padding: 0 12px 12px; gap: 8px; }
  #tab-ec2-scaling .scale-log-history { max-height: 23vh; }
  #tab-ec2-scaling .scale-log-history thead { display: none; }
  #tab-ec2-scaling .scale-log-history tbody { display: block; }
  #tab-ec2-scaling .scale-log-history tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; padding: 8px; border-bottom: 1px solid #e2e7f0; }
  #tab-ec2-scaling .scale-log-history td { border: 0; padding: 3px 4px; overflow-wrap: anywhere; }
  #tab-ec2-scaling .scale-log-history td:nth-child(1) { grid-column: 1 / -1; color: #738098; font-size: 11px; }
  #tab-ec2-scaling .scale-log-history td:nth-child(1)::before { content: 'UTC '; }
  #tab-ec2-scaling .scale-log-history td:nth-child(2) { grid-column: 1 / -1; font-weight: 600; }
  #tab-ec2-scaling .scale-log-history td:nth-child(3) { grid-column: 1; grid-row: 3; }
  #tab-ec2-scaling .scale-log-history td:nth-child(3)::before { content: '动作：'; }
  #tab-ec2-scaling .scale-log-history td:nth-child(4) { grid-column: 1; grid-row: 4; }
  #tab-ec2-scaling .scale-log-history td:nth-child(4)::before { content: '状态：'; }
  #tab-ec2-scaling .scale-log-history td:nth-child(5) { grid-column: 2; grid-row: 3 / 5; align-self: center; white-space: nowrap; }
  #tab-ec2-scaling .scale-log-history td[colspan]::before { content: none; }
}
#tab-ec2-scaling .scale-empty { padding: 28px 16px; border: 1px dashed #cdd6e6; border-radius: 10px; text-align: center; color: #76849c; }
@media (max-width: 1100px) { #tab-ec2-scaling .scale-workspace { grid-template-columns: 250px minmax(0, 1fr); gap: 16px; } #tab-ec2-scaling .scale-editor > .card { padding: 20px; } }
@media (max-width: 850px) { #tab-ec2-scaling .scale-workspace { grid-template-columns: 1fr; } #scale-plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; } #tab-ec2-scaling .scale-plan { margin: 0; } }
@media (max-width: 850px) { #tab-ec2-scaling .scale-sidebar { position: static; max-height: none; } #scale-plans { max-height: 45vh; max-height: 45dvh; } }
@media (max-width: 480px) { #tab-ec2-scaling .scale-editor > .card { padding: 16px; } #tab-ec2-scaling .scale-form-actions .btn { flex: 1 1 40%; } #tab-ec2-scaling > .d-flex { flex-wrap: wrap; } }
