.remote-session-dialog {
  width: min(640px, calc(100vw - 32px));
  max-width: calc(100vw - 32px);
  max-height: calc(100dvh - 32px);
  padding: 0;
  overflow-y: auto;
  color: var(--ui-ink, #182b30);
}

.remote-session-dialog form {
  display: grid;
  gap: 18px;
  min-width: 0;
  padding: 28px;
}

.remote-session-dialog .remote-dialog-head {
  align-items: flex-start;
  gap: 16px;
}

.remote-dialog-head > div { min-width: 0; }
.remote-dialog-head h2 { font-size: 24px; line-height: 1.25; }
.remote-session-dialog .remote-dialog-head button { flex: 0 0 44px; width: 44px; height: 44px; min-width: 44px; min-height: 44px; padding: 0; }

.remote-session-dialog #remote-request-fields:not([hidden]),
.remote-session-dialog #remote-approval-fields:not([hidden]),
.remote-session-dialog #remote-ready-fields:not([hidden]) {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: stretch;
  gap: 16px;
  min-width: 0;
}

.remote-session-dialog label {
  display: grid;
  gap: 8px;
  min-width: 0;
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
}

.remote-session-dialog input,
.remote-session-dialog textarea,
.remote-session-dialog select {
  min-width: 0;
  width: 100%;
  padding: 12px;
  font-size: 16px;
  line-height: 1.5;
}

.remote-session-dialog input,
.remote-session-dialog select { min-height: 46px; }
.remote-session-dialog textarea { min-height: 112px; resize: vertical; }

.remote-session-dialog .remote-form-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 160px;
  align-items: start;
  gap: 16px;
}

.remote-session-dialog p,
.remote-session-dialog > form > p {
  margin: 0;
  font-size: 14px;
  line-height: 1.6;
  color: var(--ui-muted, #6d7974);
}

.remote-session-dialog .remote-consent-note { padding: 14px; }
.remote-session-dialog #remote-approval-fields h3,
.remote-session-dialog #remote-ready-fields h3 { margin: 0; }
.remote-session-dialog .remote-code-icon { margin: 0 auto; }
.remote-session-dialog input[name="approvalCode"] {
  font-size: 26px;
  font-variant-numeric: tabular-nums;
  letter-spacing:normal;
  text-align: center;
}

.remote-session-dialog .error { color: #9a3e35; }
.remote-session-dialog .error:empty { display: none; }
.remote-session-dialog #remote-submit { min-height: 46px; margin-top: 0; }

.remote-history-list { list-style: none; margin: 0; padding: 0; }
.remote-history-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--portal-line);
}
.remote-history-item:last-child { border-bottom: 0; padding-bottom: 0; }
.remote-history-main { display: grid; min-width: 0; gap: 5px; }
.remote-history-main strong { font-size: 14px; line-height: 1.5; overflow-wrap: anywhere; }
.remote-history-main > span { color: var(--portal-muted); font-size: 14px; line-height: 1.5; overflow-wrap: anywhere; }
.remote-history-meta { display: grid; justify-items: end; gap: 7px; }
.remote-history-meta time { font-size: 14px; color: var(--portal-muted); white-space: nowrap; }
.remote-history-status { padding: 5px 10px; border-radius: 999px; background: #edf1ef; color: #596861; font-size: 14px; font-weight: 700; white-space: nowrap; }
.remote-history-status.active,
.remote-history-status.ready { background: #e1f4e9; color: #21724b; }
.remote-history-status.pending_approval { background: #fff0d6; color: #95631a; }
.remote-history-empty { margin-bottom: 0; color: var(--portal-muted); font-size: 14px; }

@media (max-width: 600px) {
  .remote-session-dialog form { padding: 20px; }
  .remote-dialog-head h2 { font-size: 21px; }
  .remote-session-dialog .remote-form-grid { grid-template-columns: minmax(0, 1fr); }
  .remote-history-item { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .remote-history-meta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
}
.remote-maintenance{grid-column:1/-1;min-width:0;width:100%}.remote-notes-list{list-style:none;margin:0;padding:0}.remote-notes-list li{margin:16px 0;padding:16px;border:1px solid var(--ui-line,#dce4e2);border-radius:10px;background:var(--ui-surface-soft,#f5f7f6)}.remote-notes-list li>div{display:flex;flex-wrap:wrap;gap:8px 16px;justify-content:space-between}.remote-notes-list time{font-size:14px;color:var(--ui-muted,#607577)}.remote-notes-list p{margin:10px 0 0;font-size:16px;white-space:pre-wrap;overflow-wrap:anywhere}.remote-maintenance summary{padding:12px 0;cursor:pointer;font-size:16px;font-weight:700}.remote-note-form{display:grid;gap:12px;margin:0;padding:0;max-width:760px}.remote-note-form label{display:grid;gap:8px;min-width:0;font-size:16px}.remote-note-form textarea{box-sizing:border-box;width:100%;min-height:120px;resize:vertical;padding:14px;border:1px solid var(--ui-line-strong,#bac8cb);border-radius:10px;background:#fff;color:var(--ui-ink,#21353a);font:inherit;font-size:16px;line-height:1.5}.remote-note-form button{justify-self:start}.remote-note-form [data-note-result]{margin:0;font-size:14px}
.maintenance-outcome{display:inline-flex;align-items:center;justify-self:start;padding:7px 11px;border-radius:8px;font-size:14px;font-weight:700;background:#fff0d6;color:#79510c}.maintenance-outcome.resolved{background:#e1f4e9;color:#21724b}.maintenance-latest{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;padding:16px 0}.maintenance-latest>div{display:grid;gap:6px;min-width:0}.maintenance-latest strong{font-size:18px}.maintenance-latest span,.maintenance-latest p{font-size:14px}.maintenance-latest p{margin:0}.portal-card [data-maintenance-details]>summary{padding:14px 0;cursor:pointer;font-size:16px;font-weight:700}.remote-note-form>.remote-note-template{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:12px;align-items:end;justify-content:stretch}.remote-note-template label{margin:0}.remote-note-template button{max-width:100%}@media(max-width:600px){.maintenance-latest{flex-direction:column}.remote-note-form>.remote-note-template{grid-template-columns:minmax(0,1fr)}}
