:root { color-scheme: light; font: 14px/1.5 system-ui, "Microsoft YaHei", sans-serif; color: #16334a; background: #f4f7fa }
* { box-sizing: border-box }
[hidden] { display: none !important }
body { margin: 0 }
header { background: #17334b; color: white; min-height: 56px; display: flex; padding: 8px max(20px, calc((100vw - 1160px) / 2)); gap: 16px; align-items: center; justify-content: space-between }
header strong { font-size: 17px }
header div { display: flex; align-items: center; gap: 12px }
header button { color: inherit; background: transparent; border-color: #7995aa }
header a { color: inherit }
.entry-help-menu { position: relative }
.entry-help-menu summary { cursor: pointer; padding: 4px 2px; white-space: nowrap }
.entry-help-menu nav { position: absolute; z-index: 2; right: 0; top: calc(100% + 4px); min-width: max-content; padding: 4px;
  color: #16334a; background: white; border: 1px solid #cbd9e5; border-radius: 5px; box-shadow: 0 4px 12px #17334b24 }
.entry-help-menu nav a { display: block; padding: 6px 10px; text-decoration: none }
.entry-help-menu nav a:is(:hover,:focus-visible) { background: #eaf1f7 }
#welcome { max-width: 760px; margin-inline: auto }
.welcome-resources { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); gap: 12px; margin: 16px 0 }
.welcome-resources section { margin: 0; padding: 16px; background: #f4f7fa }
.welcome-resources h2 { margin-bottom: 4px }
.welcome-resources p { margin: 4px 0 8px }
.welcome-resources video { display: block; width: 100%; aspect-ratio: 16 / 9; border-radius: 4px; background: #17334b }
.welcome-actions { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; row-gap: 10px }
.welcome-actions label { display: flex; align-items: center; gap: 6px }
main { max-width: 1200px; padding: 24px 20px; margin: auto }
h1, h2 { margin: 0 0 16px; font-size: 20px }
h2 { font-size: 16px }
section { background: white; border: 1px solid #d9e3ec; border-radius: 6px; padding: 20px; margin-bottom: 16px }
body:has(main > #admin-shell:not([hidden]), main > .entry-pane:not([hidden])) {
  display: flex; flex-direction: column; height: 100dvh; overflow: hidden
}
body:has(main > #admin-shell:not([hidden]), main > .entry-pane:not([hidden])) > main {
  display: flex; flex-direction: column; flex: 1 1 0; width: 100%; min-height: 0; overflow: hidden
}
body > header { flex-shrink: 0 }
#admin-shell, .entry-panels, .entry-pane { flex: 1 1 0; min-height: 0; min-width: 0; overflow: hidden }
.entry-panels, .entry-pane { display: flex; flex-direction: column }
.entry-pane > :not(.entry-pane, .entry-content-scroll) { flex-shrink: 0 }
.entry-content-scroll { flex: 1 1 0; min-height: 0; overflow: auto; overscroll-behavior: contain; scrollbar-width: thin }
.entry-content-scroll:focus-visible { outline: 2px solid #225a87; outline-offset: -2px }
body:has(main > .sign-in:not([hidden])) {
  background: linear-gradient(90deg, rgb(10 25 37 / 78%), rgb(10 25 37 / 40%) 38%, transparent 74%),
    #243b49 url("/entry/substation.webp") 68% center / cover no-repeat;
}
body:has(main > .sign-in:not([hidden])) header { background: rgb(15 38 55 / 92%) }
main:has(> .sign-in:not([hidden])) { min-height: calc(100svh - 56px); display: grid; align-content: center; padding-block: clamp(28px, 6vh, 64px) }
.sign-in { width: min(100%, 416px); margin: 0; padding: clamp(24px, 4vw, 36px); border: 0; border-radius: 14px; box-shadow: 0 18px 48px rgb(9 25 37 / 28%) }
.sign-in h1 { margin: 0 0 24px; font-size: 28px; line-height: 1.25 }
.sign-in form { gap: 16px }
.sign-in input, .sign-in .primary { min-height: 44px }
.sign-in button.primary:hover:not([aria-disabled=true]) { background: #1b4b71; border-color: #1b4b71 }
.sign-in :is(input, button, a):focus-visible { position: relative; outline: 2px solid #225a87; outline-offset: 2px; z-index: 1 }
.login-destination { margin-top: 16px; padding-top: 8px; border-top: 1px solid #d9e3ec; text-align: center }
.login-switch { display: inline-grid; min-height: 40px; align-items: center; text-underline-offset: 3px }
.login-switch:hover { color: #17334b }
.auth-field, #registration-fields { display: grid; gap: 5px }
#registration-fields { gap: 13px }
.password-control { position: relative }
.password-control input { display: block; padding-inline-end: 46px }
.password-control input::-ms-reveal { display: none }
.password-control .password-toggle {
  position: absolute; inset-block: 2px; inset-inline-end: 2px; width: 40px; min-height: 0;
  border: 0; padding: 0; background: transparent; color: #50677b;
}
.password-control .password-toggle:hover { color: #16334a; background: #edf3f8 }
.sign-in .password-toggle:focus-visible { position: absolute; outline-offset: -2px }
.password-toggle svg { width: 20px; height: 20px; stroke-width: 1.6 }
.password-control input[type="password"] + .password-toggle .password-eye-off,
.password-control input[type="text"] + .password-toggle .password-eye { display: none }
.auth-hint, .auth-error { margin: 0; font-size: 13px; line-height: 1.5 }
.auth-hint { color: #50677b }
.auth-error { color: #8a2323 }
.auth-feedback { margin: 0 0 12px; padding: 8px 10px; border-radius: 4px; background: #edf5fc }
.auth-feedback[data-error=true] { color: #8a2323; background: #fff1ef }
.sign-in input[aria-invalid=true] { border-color: #a73030 }
.auth-return { margin-top: 12px }
label { display: grid; gap: 5px }
.required-mark { color: #a73030; margin-inline-end: 4px }
label:has(> :not(:required):is(input, select)) .required-mark { display: none }
form { display: grid; gap: 13px }
input, select, button { font: inherit; color: inherit; border: 1px solid #bdcedb; border-radius: 4px; padding: 6px 10px; min-height: 34px; background: white }
input, select { min-width: 0; width: 100% }
button { cursor: pointer }
button:disabled { cursor: default; opacity: .55 }
button[aria-disabled=true] { cursor: wait; opacity: .65 }
.command-result:empty { display: none }
button.primary { color: white; background: #225a87; border-color: #225a87 }
button:has(svg) { display: inline-flex; align-items: center; justify-content: center; gap: 6px }
button svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round }
button.plain { background: transparent; padding-inline: 0; border: 0; color: #225a87 }
a { color: #225a87 }
#admin-shell { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 16px }
nav { display: flex; flex-direction: column; align-self: start; gap: 6px }
nav a { padding: 6px 10px; text-decoration: none; border-radius: 4px }
nav a[aria-current=page] { background: #e5eff8; font-weight: 650 }
nav a:hover, nav a:focus-visible { background: #e5eff8; text-decoration: underline }
.row-form { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 18px }
.row-form label { min-width: 120px }
.row-form label:first-child { flex: 1 1 250px }
.row-form input[type=number] { width: 100px }
.project-list { display: grid }
.project-list > * { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px; padding: 10px 4px; border-top: 1px solid #e1e8ee; text-decoration: none }
.project-list a:hover { background: #eff5fa; text-decoration: underline }
.project-list small { color: #50677b }
.project-list .project-choice { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 24px; padding: 16px 8px; color: #16334a; overflow-wrap: anywhere }
.project-list .project-choice:hover, .project-list .project-choice:focus-visible { background: #eff5fa; text-decoration: none }
.project-choice:focus-visible { outline: 2px solid #225a87; outline-offset: -2px }
.project-choice-heading, .project-choice-details { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 16px }
.project-choice-heading strong { font-size: 16px }
.project-choice-details { margin: 6px 0 0; font-size: 13px }
.project-choice-details > div { display: flex; flex-wrap: wrap; gap: 0 6px }
.project-choice-details dt { color: #50677b }
.project-choice-details dd { margin: 0 }
.project-choice-summary { margin: 6px 0 0; color: #405c70 }
.project-choice-action { display: inline-flex; align-items: center; gap: 8px; padding: 6px 10px; color: #225a87; white-space: nowrap }
.project-choice-action::after { content: ''; width: 6px; height: 6px; border: solid currentColor; border-width: 1.5px 1.5px 0 0; transform: rotate(45deg) }
.project-choice:hover .project-choice-action, .project-choice:focus-visible .project-choice-action { text-decoration: underline }
#feedback { background: #edf5fc; border: 1px solid #bdd6eb; padding: 8px 12px; border-radius: 4px; margin: 0 0 16px }
#feedback[data-error=true] { color: #8a2323; background: #fff1ef; border-color: #efc3bc }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px }
.profile-dialog {
  width: min(416px, calc(100% - 32px)); max-height: calc(100dvh - 32px); padding: 20px;
  border: 1px solid #d9e3ec; border-radius: 6px; color: inherit;
  box-shadow: 0 16px 48px rgb(9 25 37 / 24%);
}
.profile-dialog::backdrop { background: rgb(11 30 47 / 45%); }
.profile-dialog input[readonly] { color: #50677b; background: #f4f7fa; }
.profile-dialog #profile-hint { margin-top: -8px; }
#login-name { max-width: 12em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.expert-settings { margin-bottom: 0; align-items: center }
fieldset { min-width: 0; margin: 0; border: 1px solid #d9e3ec; border-radius: 4px; padding: 6px 12px 10px }
legend { padding: 0 4px }
#project-count { color: #50677b; margin-inline-start: 4px }
#project-checklist { display: grid; max-height: 270px; overflow: auto }
#project-checklist label { display: flex; align-items: center; gap: 8px; padding: 3px 4px; border-radius: 3px }
#project-checklist label:hover, #project-checklist label:focus-within { background: #edf3f8 }
#project-checklist input { min-height: 0; width: 16px; height: 16px; flex-shrink: 0; accent-color: #225a87 }
#invite-created { margin: 14px 0 0 }
.section-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px }
.section-heading h1 { margin: 0 }
#aid-details, #aid-tasks { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0 0 16px }
#aid-details dd, #aid-tasks dd { margin: 0 }
#aid-details dt, #aid-tasks dt { color: #50677b }
#aid-models { margin: 0 0 16px; padding-inline-start: 18px }
#management-levels { display: grid; grid-template-columns: repeat(auto-fit, minmax(132px, 1fr)); gap: 8px; margin: 4px 0 10px }
.aid-views { display: flex; gap: 8px; margin-bottom: 16px }
.aid-views [aria-pressed=true] { background: #edf5fc; border-color: #6891b3 }
.aid-probes { display: flex; flex-wrap: wrap; gap: 10px; align-items: end }
.aid-probes label { flex: 1 1 165px }
#aid-connection-form .row-form { margin: 0 }
#aid-connection-form .row-form label { flex: 1 1 180px }
#aid-connection-view p:empty, #aid-status:empty { display: none }
#aid-default-details { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0 0 16px }
#aid-default-details dd { margin: 0 }
#aid-model-checklist { display: grid; max-height: 260px; overflow: auto }
#aid-model-checklist label { display: flex; align-items: center; gap: 8px; padding: 3px }
#aid-model-checklist input { min-height: 0; width: 16px; height: 16px; flex-shrink: 0; accent-color: #225a87 }
#aid-model-count { margin: 0; color: #50677b }
@media (max-width: 700px) {
  body:has(main > .sign-in:not([hidden])) {
    background: linear-gradient(180deg, rgb(10 25 37 / 15%), #f4f7fa 280px),
      #f4f7fa url("/entry/substation.webp") 72% top / max(100%, 498px) auto no-repeat;
  }
  main:has(> .sign-in:not([hidden])) { align-content: start; justify-items: center; padding-top: 112px }
  #admin-shell { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr) }
  nav { flex-direction: row; flex-wrap: wrap }
}

@media (max-width: 520px) {
  body[data-portal=expert] header { flex-wrap: wrap; row-gap: 8px }
  body[data-portal=expert] #login-name { min-width: 0; overflow-wrap: anywhere }
  .project-list .project-choice { grid-template-columns: 1fr }
  .project-choice-action { justify-self: start; padding-inline: 0 }
}
