:root {
  color-scheme: light;
  --page: #eef3f8;
  --panel: #ffffff;
  --ink: #0b1220;
  --muted: #64748b;
  --line: #d8e2ee;
  --nav: #111827;
  --nav-soft: #1d293b;
  --blue: #2457d6;
  --blue-dark: #1e40af;
  --cyan: #0891b2;
  --red: #b91c1c;
  --amber: #b45309;
  --green: #15803d;
  --soft-blue: #eaf2ff;
  --soft-red: #fff1f2;
  --soft-amber: #fff7ed;
  --soft-green: #ecfdf5;
  --shadow: 0 22px 60px rgba(15, 23, 42, .08);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: radial-gradient(circle at 12% 0%, #e7f0ff 0, #f7f9fc 34%, var(--page) 100%);
  color: var(--ink);
  font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", Arial, sans-serif;
  letter-spacing: 0;
}
button, input, select { font: inherit; }
button {
  min-height: 40px;
  border: 0;
  border-radius: 12px;
  background: var(--blue);
  color: #fff;
  padding: 0 16px;
  font-weight: 700;
  cursor: pointer;
}
button:hover { background: var(--blue-dark); }
button:disabled { cursor: not-allowed; background: #94a3b8; }
input, select {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0 12px;
  background: #fff;
  min-width: 0;
}
.secondary { background: #e7edf5; color: #213047; }
.secondary:hover { background: #d5deeb; }
.ghost { background: transparent; color: var(--blue); border: 1px solid var(--line); }
.ghost:hover { background: #eff6ff; }
.danger { color: var(--red); border-color: #fecdd3; }
.danger:hover { background: #fff1f2; }
.cancel-task-button {
  width: 100%;
  background: #b91c1c;
  color: #fff;
  border: 1px solid #991b1b;
}
.cancel-task-button:hover {
  background: #991b1b;
}
.hidden { display: none !important; }
.eyebrow { margin: 0 0 5px; color: var(--muted); font-size: 12px; font-weight: 700; }

.deploy-assistant-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 280px 1fr;
}
.app-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  background: linear-gradient(180deg, var(--nav), var(--nav-soft));
  color: #fff;
  padding: 22px 16px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 22px;
}
.brand-block {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 12px;
  align-items: center;
  padding: 4px 6px 12px;
  border-bottom: 1px solid rgba(255,255,255,.12);
}
.brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #3b82f6, #06b6d4);
  font-weight: 900;
}
.brand-block h1 { margin: 0; font-size: 20px; }
.brand-block .eyebrow { color: #aab7c9; }
.step-list { display: grid; gap: 8px; align-content: start; }
.step {
  width: 100%;
  min-height: 64px;
  display: grid;
  grid-template-columns: 34px 1fr;
  grid-template-rows: auto auto;
  align-items: center;
  gap: 2px 10px;
  text-align: left;
  background: transparent;
  color: #d8e1ee;
  border-radius: 14px;
  padding: 10px;
}
.step:hover { background: rgba(255,255,255,.08); }
.step.active { background: var(--blue); color: #fff; box-shadow: 0 14px 28px rgba(36,87,214,.28); }
.step span {
  grid-row: 1 / 3;
  width: 32px;
  height: 32px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: rgba(255,255,255,.11);
  font-weight: 800;
}
.step small { color: #9fb0c7; margin-top: 3px; }
.step.active small { color: #dbeafe; }
.sidebar-foot {
  border-top: 1px solid rgba(255,255,255,.12);
  padding: 14px 6px 4px;
  color: #aab7c9;
  display: grid;
  gap: 5px;
  font-size: 13px;
}
.sidebar-foot strong { color: #fff; font-size: 14px; }

.app-main { padding: 24px; min-width: 0; }
.topbar {
  height: 70px;
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 12px;
  align-items: center;
  margin-bottom: 18px;
}
.topbar h2 { margin: 0; font-size: 28px; }
.login-form { display: flex; gap: 8px; }
.login-card-copy, .login-message { display: none; }

body.auth-locked {
  min-height: 100vh;
  background: radial-gradient(circle at 50% 18%, #e7f0ff 0, #f7f9fc 42%, var(--page) 100%);
}
body.auth-locked .deploy-assistant-shell {
  grid-template-columns: 1fr;
  min-height: 100vh;
}
body.auth-locked .app-sidebar,
body.auth-locked .app-main > :not(.topbar),
body.auth-locked .topbar > div:first-child,
body.auth-locked #logout-button {
  display: none !important;
}
body.auth-locked .app-main {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
}
body.auth-locked .topbar {
  width: min(460px, 100%);
  height: auto;
  display: block;
  margin: 0;
}
body.auth-locked .login-form {
  display: grid;
  gap: 14px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255,255,255,.94);
  box-shadow: var(--shadow);
}
body.auth-locked .login-card-copy {
  display: grid;
  gap: 8px;
}
body.auth-locked .login-card-copy h2 {
  margin: 0;
  font-size: 28px;
  line-height: 1.2;
}
body.auth-locked .login-card-copy p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}
body.auth-locked .login-form input,
body.auth-locked .login-form button {
  width: 100%;
  min-height: 48px;
}
body.auth-locked .login-message {
  display: block;
  min-height: 22px;
  color: var(--red);
  font-weight: 700;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, .75fr);
  gap: 18px;
  margin-bottom: 14px;
}
.status-panel, .next-panel, .detail-panel, .metric-strip article, .focus-panel {
  background: rgba(255,255,255,.9);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow);
}
.status-panel { padding: 22px; min-height: 190px; }
.status-panel h2 { margin: 6px 0 8px; font-size: 36px; line-height: 1.15; }
.status-panel p { margin: 0; line-height: 1.7; color: #314155; }
.state-ready { background: linear-gradient(135deg, var(--soft-green), #fff); }
.state-warn { background: linear-gradient(135deg, var(--soft-amber), #fff); }
.state-fail, .state-unsupported { background: linear-gradient(135deg, var(--soft-red), #fff); }
.state-ready h2 { color: var(--green); }
.state-warn h2 { color: var(--amber); }
.state-fail h2, .state-unsupported h2 { color: var(--red); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.next-panel { padding: 20px; }
.next-panel h3 { margin: 5px 0 8px; font-size: 24px; }
.next-panel p { margin: 0 0 16px; color: var(--muted); line-height: 1.7; }
.meta-grid { display: grid; gap: 10px; margin: 0; }
.meta-grid div { display: grid; grid-template-columns: 84px 1fr; gap: 8px; }
.meta-grid dt { color: var(--muted); }
.meta-grid dd { margin: 0; overflow-wrap: anywhere; }

.metric-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 18px; }
.metric-strip article { padding: 15px; box-shadow: none; }
.metric-strip span { display: block; color: var(--muted); font-size: 13px; }
.metric-strip strong { display: block; margin-top: 6px; font-size: 26px; }

.detail-panel { padding: 20px; min-height: 470px; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.panel-heading h2, .panel-heading h3 { margin: 0; }
.panel-heading.compact { margin-bottom: 12px; }
.notice, .result-box {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f8fbff;
  padding: 14px;
  line-height: 1.7;
}
.overview-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 14px; }
.focus-panel { padding: 16px; box-shadow: none; }
.focus-panel h3 { margin: 0 0 10px; }
.quick-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.quick-action {
  min-height: 94px;
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line);
  text-align: left;
  display: grid;
  align-content: center;
  gap: 6px;
}
.quick-action:hover { background: var(--soft-blue); }
.quick-action span { color: var(--muted); font-weight: 400; }
.service-overview-panel { margin-top: 14px; }
.service-list { display: grid; gap: 8px; }
.service-row {
  display: grid;
  grid-template-columns: minmax(120px, .8fr) minmax(90px, auto) minmax(180px, 1.4fr) auto;
  gap: 10px;
  align-items: center;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}
.service-row strong { color: var(--ink); }
.service-row span { color: var(--muted); overflow-wrap: anywhere; }
.service-row.pass span.state { color: var(--green); font-weight: 800; }
.service-row.fail span.state { color: var(--red); font-weight: 800; }
.service-row.warn span.state { color: var(--amber); font-weight: 800; }
.service-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.service-action {
  min-height: 34px;
  padding: 0 10px;
  border-radius: 10px;
  font-size: 13px;
}
.service-management-list { display: grid; gap: 18px; }
.service-group h3 { margin: 0 0 10px; }
.service-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.service-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-left: 6px solid #cbd5e1;
  border-radius: 14px;
  background: #f8fafc;
}
.service-card.pass { border-left-color: var(--green); }
.service-card.warn { border-left-color: var(--amber); }
.service-card.fail { border-left-color: var(--red); }
.service-card.selected {
  border-color: #93c5fd;
  border-left-color: var(--blue);
  background: linear-gradient(180deg, #eff6ff, #ffffff);
  box-shadow: 0 18px 34px rgba(36, 87, 214, .14);
}
.service-card strong { display: block; font-size: 18px; }
.service-card small { color: var(--muted); }
.service-card-hint {
  line-height: 1.5;
  overflow-wrap: anywhere;
}
.current-service-badge {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: #dbeafe;
  color: var(--blue-dark);
  font-size: 13px;
  font-weight: 800;
}
.service-card dl, .service-detail-card dl {
  display: grid;
  gap: 8px;
  margin: 0;
}
.service-card dl div, .service-detail-card dl div {
  display: grid;
  grid-template-columns: 70px 1fr;
  gap: 8px;
}
.service-card dt, .service-detail-card dt { color: var(--muted); }
.service-card dd, .service-detail-card dd { margin: 0; overflow-wrap: anywhere; }
.service-manage-button {
  justify-self: stretch;
  min-height: 48px;
  border-radius: 12px;
  background: var(--blue);
  color: #fff;
  border: 1px solid var(--blue);
  box-shadow: 0 10px 20px rgba(36, 87, 214, .18);
}
.service-manage-button::after {
  content: "  >";
  font-weight: 900;
}
.service-manage-button:hover {
  background: var(--blue-dark);
  border-color: var(--blue-dark);
}
.service-card-actions {
  display: grid;
  gap: 8px;
}
.service-card-migration-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.service-history-link {
  justify-self: start;
  min-height: 32px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--blue);
  box-shadow: none;
  font-weight: 800;
}
.service-history-link::after {
  content: "";
}
.service-history-link:hover {
  background: transparent;
  color: var(--blue-dark);
  text-decoration: underline;
}
.service-manager {
  margin: 0 0 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px;
  background: #fff;
}
.service-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}
.service-tab {
  min-height: 36px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--blue);
}
.service-tab.active { background: var(--blue); color: #fff; border-color: var(--blue); }
.service-tab-content { display: grid; gap: 14px; }
.service-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.service-detail-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  background: #f8fbff;
}
.service-detail-card h3 { margin: 0 0 12px; }
.muted { color: var(--muted); line-height: 1.6; }
.service-migration-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
}
.service-migration-toolbar strong { display: block; font-size: 18px; }
.service-migration-toolbar p { margin: 4px 0; color: var(--muted); }
.service-migration-actions {
  display: grid;
  grid-template-columns: auto minmax(160px, 1fr) auto auto;
  gap: 8px;
  align-items: center;
}
.file-picker-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--primary);
  font-weight: 700;
  cursor: pointer;
}
.file-picker-button:hover {
  border-color: rgba(37, 99, 235, 0.45);
  background: #f8fbff;
}
.visually-hidden-file {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
.file-picker-name {
  min-width: 0;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.service-migration-sections {
  display: grid;
  gap: 12px;
}
.service-migration-panel {
  background: #fff;
}
.service-migration-list {
  display: grid;
  gap: 8px;
}
.service-migration-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f8fbff;
}
.service-migration-file {
  min-width: 0;
  display: grid;
  gap: 4px;
}
.service-migration-file strong {
  overflow-wrap: anywhere;
}
.service-migration-file small {
  color: var(--muted);
}
.service-migration-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}
.manager-actions, .operation-grid, .range-form {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: end;
}
.range-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
}
.manager-log {
  min-height: 360px;
  max-height: 520px;
}
.danger-zone {
  border: 1px solid #fecdd3;
  border-radius: 14px;
  background: #fff1f2;
  padding: 14px;
}
.danger-zone p { color: #7f1d1d; line-height: 1.6; }
.env-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f8fbff;
}
.env-toolbar p {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.6;
}
.env-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.env-field {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}
.env-field span {
  display: grid;
  gap: 3px;
}
.env-field small, .env-field em {
  color: var(--muted);
  font-style: normal;
  line-height: 1.5;
}
.env-input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}
.env-toggle {
  min-width: 64px;
  padding: 0 10px;
}
.db-ops-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f8fbff;
}
.db-ops-toolbar p {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.6;
}
.db-ops-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  align-items: start;
}
.db-ops-grid.single {
  grid-template-columns: minmax(0, 1fr);
}
.db-ops-panel {
  display: grid;
  gap: 12px;
  align-content: start;
}
.db-field {
  display: grid;
  gap: 6px;
  color: var(--muted);
}
.db-field small {
  color: var(--muted);
  line-height: 1.5;
}
.db-field.field-error {
  color: var(--red);
}
.db-field.field-error input {
  border-color: #fca5a5;
  background: #fff1f2;
}
.db-field.field-error small {
  color: var(--red);
  font-weight: 700;
}
.db-upload-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}
.db-upload-row input[type="file"] {
  min-width: 0;
  width: 100%;
}
.db-sync-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
}
.db-sync-apply-grid {
  grid-template-columns: minmax(0, 1fr) minmax(320px, .42fr) auto;
  align-items: start;
}
.db-sync-apply-grid .manager-actions {
  align-self: start;
  padding-top: 31px;
}
.db-file-list {
  display: grid;
  gap: 8px;
  max-height: 360px;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 4px;
  align-content: start;
  scrollbar-gutter: stable;
}
.db-file-list .notice { margin: 0; }
.db-file-empty { margin: 0; }
.db-file-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}
.db-file-row.selected {
  border-color: #93c5fd;
  background: #eff6ff;
}
.db-file-row strong {
  display: block;
  overflow-wrap: anywhere;
}
.db-file-row small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  overflow-wrap: anywhere;
}
.download-button {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  border-radius: 12px;
  background: #e7edf5;
  color: #213047;
  font-weight: 800;
  text-decoration: none;
}
.download-button:hover { background: #d5deeb; }
.image-migration-grid {
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}
.image-upload-card,
.image-file-panel {
  min-width: 0;
}
.image-upload-card p {
  margin: 0 0 12px;
}
.image-upload-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}
.image-upload-row input[type="file"] {
  width: 100%;
  min-width: 0;
}
.image-file-list,
.image-file-list-inner {
  display: grid;
  gap: 8px;
  min-width: 0;
}
.image-file-list-inner {
  max-height: 420px;
  overflow-y: auto;
  padding-right: 4px;
  scrollbar-gutter: stable;
}
.image-file-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  min-width: 0;
}
.image-file-name {
  min-width: 0;
}
.image-file-name strong {
  display: block;
  overflow-wrap: anywhere;
}
.image-file-name small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  overflow-wrap: anywhere;
}
.image-file-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}
.image-task-details {
  width: 100%;
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f8fbff;
}
.image-task-details dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 12px;
  margin: 0;
}
.image-task-details dl div {
  min-width: 0;
}
.image-task-details dt {
  color: var(--muted);
  font-size: 13px;
}
.image-task-details dd {
  margin: 2px 0 0;
  overflow-wrap: anywhere;
  font-weight: 700;
}
.db-checkbox-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.db-check {
  display: flex;
  gap: 8px;
  align-items: center;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}
.db-check input {
  min-height: 18px;
  width: 18px;
}
.db-check span { overflow-wrap: anywhere; }
.risk-result {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-left: 6px solid var(--green);
  border-radius: 14px;
  background: #fff;
}
.risk-result.medium { border-left-color: var(--amber); }
.risk-result.high { border-left-color: var(--red); }
.risk-result div {
  display: grid;
  gap: 4px;
}
.risk-result span {
  color: var(--muted);
  font-size: 13px;
}
.risk-result p {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.check-list { display: grid; gap: 10px; margin-top: 12px; }
.check-card {
  background: #fff;
  border: 1px solid var(--line);
  border-left: 6px solid #cbd5e1;
  border-radius: 16px;
  padding: 14px;
}
.check-card strong { display: block; font-size: 17px; }
.check-card p { margin: 6px 0 0; color: var(--muted); line-height: 1.55; }
.check-card.pass { border-left-color: var(--green); }
.check-card.warn, .check-card.medium { border-left-color: var(--amber); }
.check-card.fail, .check-card.high { border-left-color: var(--red); }
details { margin-top: 6px; color: var(--muted); }
.remediation-box {
  margin-top: 12px;
  border-radius: 14px;
  padding: 12px;
  display: grid;
  gap: 10px;
  line-height: 1.55;
}
.remediation-box span { color: #334155; }
.remediation-box.command {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  border: 1px solid #bfdbfe;
  background: #eff6ff;
}
.remediation-box.manual {
  border: 1px solid #fed7aa;
  background: #fff7ed;
}
.action-button {
  min-width: 160px;
  white-space: normal;
}

.confirm-line { display: grid; gap: 8px; margin: 14px 0; color: var(--muted); }
.deployment-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.logs-layout { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(300px, .75fr); gap: 16px; }
.log-panel, .task-history, .side-stack, .service-side-panel { min-width: 0; }
.side-stack { display: grid; gap: 14px; align-content: start; }
.service-side-panel {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  padding: 14px;
}
.log-help {
  margin: -4px 0 12px;
  color: var(--muted);
  line-height: 1.6;
}
.service-side-panel .service-row {
  grid-template-columns: 1fr;
  gap: 5px;
}
.service-side-panel .service-actions { justify-content: flex-start; }
.task-status-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  margin-bottom: 12px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #f8fbff;
}
.task-status-card span {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  background: #e2e8f0;
  color: #334155;
  font-size: 13px;
  font-weight: 800;
}
.task-status-card strong {
  display: block;
  margin-top: 8px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.task-status-card dl {
  display: grid;
  gap: 6px;
  margin: 0;
  min-width: 260px;
}
.task-status-card dl div {
  display: grid;
  grid-template-columns: 74px 1fr;
  gap: 8px;
}
.task-status-card dt { color: var(--muted); }
.task-status-card dd { margin: 0; text-align: right; }
.task-status-card.running {
  border-color: #bfdbfe;
  background: #eff6ff;
}
.task-status-card.running span { background: #dbeafe; color: var(--blue-dark); }
.task-status-card.waiting {
  border-color: #fed7aa;
  background: #fff7ed;
}
.task-status-card.waiting span { background: #ffedd5; color: var(--amber); }
.task-status-card.succeeded {
  border-color: #bbf7d0;
  background: #f0fdf4;
}
.task-status-card.succeeded span { background: #dcfce7; color: var(--green); }
.task-status-card.failed {
  border-color: #fecdd3;
  background: #fff1f2;
}
.task-status-card.failed span { background: #ffe4e6; color: var(--red); }

.task-downloads {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0 0;
}

.task-controls {
  width: 100%;
  padding: 12px;
  border: 1px solid #fecdd3;
  border-radius: 14px;
  background: #fff1f2;
}

.task-downloads:empty {
  display: none;
}
pre {
  min-height: 300px;
  max-height: 420px;
  overflow: auto;
  margin: 0;
  padding: 16px;
  border-radius: 18px;
  background: #0b1220;
  color: #dbeafe;
  white-space: pre-wrap;
  line-height: 1.6;
}
.log-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}
.task-history-list { display: grid; gap: 8px; }
.task-row {
  width: 100%;
  min-height: 58px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 10px;
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line);
  text-align: left;
}
.task-row:hover { background: #f8fbff; }
.task-row small { grid-column: 1 / 3; color: var(--muted); font-weight: 400; }
.update-form { display: grid; gap: 12px; margin-bottom: 12px; }
.update-type-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.update-type-option {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: center;
  min-height: 64px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}
.update-type-option input,
.update-targets input {
  min-height: 18px;
  width: 18px;
}
.update-type-option strong,
.update-type-option small {
  display: block;
}
.update-type-option small {
  color: var(--muted);
  margin-top: 3px;
}
.update-targets {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.update-targets label {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}
.update-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.update-confirm-line { margin: 0; }

@media (max-width: 980px) {
  .deploy-assistant-shell { grid-template-columns: 1fr; }
  .app-sidebar { position: static; height: auto; padding: 16px; }
  .brand-block { border-bottom: 0; }
  .step-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sidebar-foot { display: none; }
  .app-main { padding: 14px; }
  .topbar, .hero-grid, .overview-grid, .logs-layout, .service-card-grid, .service-detail-grid, .env-toolbar, .env-grid, .db-ops-toolbar, .db-ops-grid, .db-upload-row, .db-sync-grid, .db-sync-apply-grid, .image-migration-grid, .image-upload-row, .service-migration-toolbar, .service-migration-row { grid-template-columns: 1fr; }
  .service-migration-actions { grid-template-columns: 1fr 1fr; }
  .file-picker-name { grid-column: 1 / -1; }
  .service-card-migration-actions { grid-template-columns: repeat(2, minmax(112px, 1fr)); }
  .service-migration-row-actions { justify-content: flex-start; }
  .metric-strip, .quick-grid { grid-template-columns: repeat(2, 1fr); }
  .login-form { flex-wrap: wrap; }
}
@media (max-width: 560px) {
  .app-sidebar { padding: 12px; }
  .brand-block { grid-template-columns: 38px 1fr; }
  .brand-mark { width: 38px; height: 38px; }
  .brand-block h1 { font-size: 18px; }
	.step-list { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
	.step { min-height: 46px; display: block; padding: 7px 4px; text-align: center; font-size: 12px; }
	.step span, .step small { display: none; }
	body[data-active-step="online-release"] .hero-grid,
	body[data-active-step="online-release"] .metric-strip { display: none; }
	.metric-strip, .quick-grid { grid-template-columns: 1fr; }
  .topbar { height: auto; }
  .status-panel h2 { font-size: 30px; }
  .hero-actions, .deployment-actions, .update-actions, .update-targets, .update-type-grid, .log-actions, .manager-actions, .operation-grid, .range-form, .env-input-row, .db-file-row, .db-checkbox-grid, .risk-result, .image-file-row, .image-file-actions, .image-task-details dl { display: grid; grid-template-columns: 1fr; }
  .service-row { grid-template-columns: 1fr; }
  .service-actions { justify-content: flex-start; }
  .task-status-card { grid-template-columns: 1fr; }
  .task-status-card dl { min-width: 0; }
  .task-status-card dd { text-align: left; }
  .panel-heading { display: grid; grid-template-columns: 1fr; align-items: stretch; }
  .remediation-box.command { grid-template-columns: 1fr; }
  .db-sync-apply-grid .manager-actions { padding-top: 0; }
  .db-file-list { max-height: 280px; }
  .image-file-list-inner { max-height: 280px; }
  button { width: 100%; }
  .meta-grid div { grid-template-columns: 76px 1fr; }
}
