/* Shared desktop, mobile and form surfaces. Loaded after the existing console rules. */
:root {
  --bg: #f3f5f2;
  --surface: #ffffff;
  --ink: #243b32;
  --muted: #697b72;
  --line: #dfe6df;
  --green: #245e4d;
  --green-light: #eaf3ed;
  --red: #a63e35;
  --radius: 12px;
  --focus: 0 0 0 3px #245e4d24;
}
body {font-size: 14px; letter-spacing: .01em; -webkit-font-smoothing: antialiased;}
h1,h2,h3 {text-wrap: balance;}
p {text-wrap: pretty;}
button {transition: background 160ms ease, border-color 160ms ease, color 160ms ease, box-shadow 160ms ease;}
button:disabled {cursor: default;}
button:focus-visible,a:focus-visible {outline: 2px solid var(--green); outline-offset: 3px;}
.shell-header {background: #fcfdfb; border-bottom: 1px solid var(--line);}
.header-top {max-width: 1456px; padding: 22px 40px 16px;}
.brand {gap: 12px;}
.brand img {width: 31px; height: 31px;}
.brand strong {letter-spacing: 1.5px; font-size: 13px;}
.brand span {font-size: 12px;}
.header-actions {gap: 20px;}
.navigation {max-width: 1456px; padding: 6px 40px 14px; gap: 8px;}
.navigation button {padding: 12px 20px; border: 0; border-radius: 8px; font-size: 14px;}
.navigation button:hover {background: #f0f4ef; color: var(--ink);}
.navigation button[aria-current] {background: var(--green-light); color: var(--green);}
main {max-width: 1456px; padding: 30px 40px 36px;}
.section-navigation {gap: 26px; margin-bottom: 27px;}
.section-navigation button {font-size: 13px; padding: 0 4px 12px;}
.page-heading {align-items: flex-start; gap: 24px; margin-bottom: 28px;}
.page-heading h1 {font-size: 30px; font-weight: 650; letter-spacing: -.8px;}
.page-heading p {font-size: 13px; line-height: 1.9; max-width: 65ch; margin-top: 10px;}
.page-heading .eyebrow {font-size: 10px; color: #7e8e83; margin-bottom: 12px;}
.page-help-actions {padding-top: 10px; flex-wrap: wrap; justify-content: flex-end;}
.refresh-status {font-size: 11px; gap: 12px;}
.primary,.secondary,.danger-outline {border-radius: 8px; min-height: 40px; padding: 10px 17px; font-size: 13px; gap: 9px;}
.primary {background: var(--green); box-shadow: 0 1px 2px #173b2320;}
.primary:hover {background: #184b3b;}
.secondary {background: #fff; border-color: #d8e1d9;}
.secondary:hover {border-color: #b6c7ba; background: #f5f8f3;}
.small {font-size: 12px; min-height: 36px; padding: 8px 13px;}
.danger-outline {color: var(--red); border-color: #e8cfc9; font-size: 12px;}
.text-button {font-size: 12px; color: var(--green); min-height: 34px; padding: 7px 9px; border-radius: 6px;}
.text-button:hover {background: var(--green-light);}
.icon-button {border-radius: 8px;}
.icon-button:hover {background: #edf2eb;}
.surface,.plan-card,.getting-started {border-radius: var(--radius); border-color: var(--line);}
.surface {padding: 26px;}
.table-wrap {padding: 0; max-width: 100%;}
th {font-size: 11px; font-weight: 550; padding: 14px 20px; background: #f8faf6;}
td {font-size: 13px; padding: 19px 20px; line-height: 1.7;}
td small {font-size: 11px; line-height: 1.8;}
tbody tr:hover {background: #fbfcf9;}
td .text-button {white-space: nowrap;}
.mono {font-size: 11px; font-variant-numeric: tabular-nums;}
.badge {padding: 4px 8px; font-size: 11px; border-radius: 5px;}
.metrics {background: #fff; padding: 24px 8px; border: 1px solid var(--line); border-radius: var(--radius);}
.metric {padding: 0 24px;}
.metric:first-child {padding-left: 24px;}
.metric-number {font-size: 35px; font-weight: 550; letter-spacing: -1px;}
.metric-label {font-size: 12px;}
.metric-note {font-size: 11px; line-height: 1.8; margin-top: 6px;}
.overview-grid {gap: 22px;}
.section-heading h2,.library-section h2 {font-size: 16px;}
.section-heading p,.getting-started-heading p,.node-card .device-heartbeat {font-size: 12px; line-height: 1.85;}
.getting-started {padding: 25px 28px;}
.setup-steps>button {padding: 4px 26px; border-radius: 4px;}
.setup-steps>button:first-child {padding-left: 0;}
.setup-steps>button>span:last-child {font-size: 12px; max-width: 35ch;}
.worker-tile {padding: 17px; background: #f7faf5; border-radius: 8px;}
.worker-tile strong {font: 550 12px var(--sans);}
.empty {min-height: 220px; padding: 40px 24px; gap: 11px;}
.empty-symbol {width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: #eef4ed; color: #73927c; margin-bottom: 4px;}
.empty h3 {font-size: 15px; color: #3b5546;}
.empty p {font-size: 13px; line-height: 1.85; max-width: 45ch;}
.banner {font-size: 12px; border-radius: 9px; padding: 15px 18px; margin-bottom: 24px; line-height: 1.9;}
.toolbar {gap: 18px; margin-bottom: 20px; align-items: center;}
.toolbar>p {font-size: 12px; line-height: 1.85; max-width: 65ch;}
.toolbar>div {flex-wrap: wrap;}
.plan-card {padding: 25px;}
.plan-card p {font-size: 12px; line-height: 1.85;}
.plan-card footer {gap: 12px; flex-wrap: wrap;}
.node-card .device-actions {gap: 10px;}
.account-checks {border-radius: 8px; padding: 12px 15px; gap: 10px; background: #fafcf8;}
.resource-explanation {background: transparent; border: 0; border-bottom: 1px solid var(--line); padding: 0 0 25px; margin-bottom: 24px;}
.resource-explanation h2 {font-size: 15px; margin-bottom: 8px;}
.resource-explanation p {font-size: 12px; line-height: 1.9; max-width: 56ch;}
.page-footer {font-size: 10px; padding-top: 23px; margin-top: 32px;}
.version-badge {border-radius: 6px; border-color: #dce5dc; background: #fcfefb;}

/* Text entry surfaces retain semantics, autofill and input method support. */
input:not([type=checkbox]):not([type=radio]),textarea {
  appearance: none; -webkit-appearance: none;
  background: #fcfdfb; color: var(--ink); border: 1px solid #d5dfd5;
  border-radius: 8px; font-size: 13px; padding: 11px 13px; min-height: 43px;
  line-height: 1.6; max-width: 100%; min-width: 0;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}
input:not([type=checkbox]):not([type=radio]):hover,textarea:hover {border-color: #a9beb0;}
input:not([type=checkbox]):not([type=radio]):focus,textarea:focus {
  outline: 0; border-color: #608c70; box-shadow: var(--focus); background: #fff;
}
input::placeholder,textarea::placeholder {color: #8a998e; opacity: 1;}
input:disabled,textarea:disabled {background: #edf1eb; color: #8a978e; cursor: default;}
input:user-invalid,textarea:user-invalid {border-color: #bb6357;}
input[type=number] {appearance: textfield; -moz-appearance: textfield; font-variant-numeric: tabular-nums;}
input::-webkit-inner-spin-button,input::-webkit-outer-spin-button {appearance: none; margin: 0;}
input[type=search]::-webkit-search-cancel-button {
  appearance: none; cursor: pointer; height: 15px; width: 15px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='m6 6 8 8m0-8-8 8' fill='none' stroke='%23697b72' stroke-width='1.7' stroke-linecap='round'/%3E%3C/svg%3E") center/15px no-repeat;
}
input[type=file] {padding: 6px!important; font-size: 12px!important;}
input[type=file]::file-selector-button {
  border: 0; border-radius: 5px; background: var(--green-light); color: var(--green);
  font: 550 12px var(--sans); padding: 8px 12px; margin-right: 12px; cursor: pointer;
}
input[type=checkbox],input[type=radio] {
  appearance: none; -webkit-appearance: none; width: 17px; height: 17px; min-width: 17px;
  padding: 0; margin: 3px 0 0; border: 1px solid #bdcdbf; border-radius: 4px;
  background: #fff; cursor: pointer; display: inline-grid; place-content: center;
  vertical-align: middle; flex: 0 0 17px;
}
input[type=radio] {border-radius: 50%;}
input[type=checkbox]:checked,input[type=radio]:checked {border-color: var(--green); background: var(--green);}
input[type=checkbox]:checked::after {content: ''; width: 8px; height: 4px; border-left: 1.8px solid #fff; border-bottom: 1.8px solid #fff; transform: translateY(-1px) rotate(-45deg);}
input[type=radio]:checked::after {content: ''; width: 5px; height: 5px; background: #fff; border-radius: 50%;}
input[type=checkbox]:focus-visible,input[type=radio]:focus-visible {outline: 2px solid var(--green); outline-offset: 3px;}
input[type=checkbox]:disabled {opacity: .45; cursor: default;}
.check {line-height: 1.85; align-items: flex-start; gap: 10px;}
.form-stack {gap: 20px;}
.form-grid {grid-template-columns: repeat(2,minmax(0,1fr));}
.form-grid:has(>label:nth-child(3):last-child) {grid-template-columns: repeat(3,minmax(0,1fr));}
.form-stack label,.form-grid label {font-size: 12px; font-weight: 500; gap: 8px; color: #40594b;}
.form-stack textarea {min-height: 105px; font-weight: 400;}
.form-stack .code-area {font-size: 12px; line-height: 1.8;}
.form-stack .field-help {font-size: 12px; font-weight: 400; line-height: 1.85; margin: -8px 0 0;}
.form-stack .primary[type=submit],.form-stack>.primary:last-child {width: 100%; margin-top: 6px; min-height: 44px;}
.form-step-title {font-size: 14px; padding-top: 8px;}
.inline-note {border-radius: 8px; font-size: 12px; line-height: 1.9; background: #eef5ed; padding: 13px 15px;}
.error {font-size: 12px; line-height: 1.85; white-space: pre-wrap;}
.error:not(:empty) {background: #fcf0ed; border-radius: 8px; padding: 12px 15px; margin-top: 18px;}
.advanced-settings {border-color: var(--line);}
.advanced-settings summary {font-size: 12px; line-height: 1.9;}

/* Searchable, keyboard-operable select menus. */
.select-control {display: flex; flex-direction: column; position: relative; min-width: 0; width: 100%; gap: 6px;}
select.select-source {
  position: absolute!important; width: 1px!important; height: 1px!important; min-height: 0!important;
  padding: 0!important; margin: 0!important; border: 0!important; opacity: 0;
  clip-path: inset(50%); pointer-events: none;
}
.select-trigger {
  width: 100%; min-height: 43px; padding: 10px 13px; border: 1px solid #d5dfd5;
  border-radius: 8px; background: #fcfdfb; display: flex; align-items: center;
  justify-content: space-between; gap: 15px; font-size: 13px; font-weight: 400; text-align: left;
}
.select-trigger:hover {border-color: #a9beb0; background: #fff;}
.select-trigger:focus-visible,.select-control.is-open>.select-trigger {outline: 0; border-color: #608c70; box-shadow: var(--focus); background: #fff;}
.select-trigger:disabled {background: #edf1eb; opacity: .7;}
.select-trigger[aria-invalid=true] {border-color: #bb6357;}
.select-value {overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0;}
.select-chevron {width: 7px; height: 7px; border-right: 1.5px solid #6b8273; border-bottom: 1.5px solid #6b8273; transform: translateY(-2px) rotate(45deg); flex: 0 0 7px;}
.is-open .select-chevron {transform: translateY(2px) rotate(225deg);}
.control-error {color: var(--red); font-size: 11px; font-weight: 400;}
.select-popover {
  position: fixed; inset: auto; margin: 0; padding: 0; border: 1px solid #d6e2d7;
  border-radius: 11px; background: #fff; color: var(--ink); z-index: 100;
  box-shadow: 0 12px 35px #183f2326,0 2px 7px #183f2310;
  display: flex; flex-direction: column; overflow: hidden;
}
.select-search {width: calc(100% - 20px); margin: 10px; min-height: 37px!important; padding: 7px 10px!important; font-size: 12px!important; background: #f6f9f4!important; flex-shrink: 0;}
.select-options {scrollbar-width: thin; scrollbar-color: #b5c9b9 transparent; overflow-y: auto; padding: 0 6px 6px; min-height: 0; overscroll-behavior: contain;}
.select-option {display: block; position: relative; width: 100%; border-radius: 6px; font-size: 12px; line-height: 1.7; min-height: 38px; padding: 9px 31px 9px 11px; text-align: left;}
.select-option:hover,.select-option:focus-visible {background: #f1f6ee; outline: 0;}
.select-option[aria-selected=true] {color: var(--green); background: #eaf3e8; font-weight: 550;}
.select-option[aria-selected=true]::after {content: ''; position: absolute; right: 13px; top: 15px; width: 8px; height: 4px; border-left: 1.6px solid var(--green); border-bottom: 1.6px solid var(--green); transform: rotate(-45deg);}
.select-option:disabled {opacity: .45;}
.select-no-results {font-size: 12px; padding: 18px 12px; color: var(--muted);}
.filters .select-control {min-width: 160px;}
.filters label {white-space: nowrap;}

/* Focused panels and resource library. */
#drawer {width: min(600px,100%); padding: 0 30px 30px; background: #fdfefb; border-left: 1px solid #d7e2d7; box-shadow: -16px 0 60px #193c241a;}
#drawer .drawer-top {position: sticky; top: 0; z-index: 2; padding-top: 26px; background: #fdfefb; margin-bottom: 24px; gap: 12px;}
#drawer .drawer-top h2 {font-size: 23px; line-height: 1.5;}
#drawer::backdrop,.help-dialog::backdrop {background: #1b302c58; backdrop-filter: blur(3px);}
.drawer-tools {align-items: center;}
.resource-hub-intro {display: flex; align-items: center; justify-content: space-between; gap: 24px; padding-bottom: 23px;}
.resource-hub-intro p {font-size: 12px; line-height: 1.9; color: var(--muted);}
.hub-resource-count {font-size: 11px; font-variant-numeric: tabular-nums; color: var(--green); white-space: nowrap; background: #e8efe5; padding: 7px 11px; border-radius: 6px;}
.hub-tabs {display: flex; gap: 6px; border-bottom: 1px solid var(--line); margin-bottom: 24px;}
.hub-tabs button {font-size: 13px; padding: 13px 23px; border-bottom: 2px solid transparent; color: var(--muted);}
.hub-tabs button[aria-selected=true] {color: var(--green); border-color: var(--green); font-weight: 600;}
.hub-tabs button:hover {background: #eaf0e5; border-radius: 7px 7px 0 0;}
.persona-grid {display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 20px;}
.persona-grid>.empty {grid-column: 1/-1; background: #fff; border: 1px dashed #c9d9cb; border-radius: 12px; min-height: 290px;}
.persona-card {border: 1px solid var(--line); border-radius: 12px; background: #fff; padding: 23px; display: flex; flex-direction: column; min-width: 0;}
.persona-card header {display: flex; align-items: center; gap: 13px;}
.persona-card header>div {flex: 1; min-width: 0;}
.persona-card header h2 {font-size: 16px; margin-bottom: 4px; overflow-wrap: anywhere;}
.persona-card header p {font-size: 11px; color: var(--muted); overflow-wrap: anywhere;}
.persona-monogram {height: 43px; width: 43px; border-radius: 11px; background: #eaf3e8; color: var(--green); font-weight: 600; display: grid; place-items: center; flex: 0 0 43px;}
.persona-facts {display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin: 24px 0 16px;}
.persona-facts dt {font-size: 10px; color: var(--muted); margin-bottom: 5px;}
.persona-facts dd {font-size: 12px; margin: 0; overflow-wrap: anywhere;}
.persona-facts small {font-size: 10px; margin-left: 8px; color: var(--muted);}
.persona-tone {font-size: 12px; line-height: 1.85; color: #627b69; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-bottom: 23px;}
.persona-card footer {border-top: 1px solid #e9eee6; padding-top: 15px; margin-top: auto; display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap;}
.persona-card footer>div {display: flex; gap: 4px; align-items: center;}
.persona-delete {color: #89988b;}
.binding-summary {padding-bottom: 15px; border-bottom: 1px solid var(--line);}
.binding-actions {display: flex; gap: 6px; flex-wrap: wrap; align-items: center;}
.binding-actions>span {margin-left: auto;}
.binding-options {display: flex; flex-direction: column; gap: 8px; max-height: 280px; overflow: auto;}
.form-stack .binding-option {display: flex; flex-direction: row; align-items: flex-start; gap: 12px; border: 1px solid var(--line); border-radius: 8px; padding: 13px; cursor: pointer;}
.binding-option:hover {background: #f3f7f0;}
.binding-option:has(input:checked) {border-color: #93b69c; background: #edf5e9;}
.binding-option strong {font-size: 12px; font-weight: 550;}
.binding-option small {display: block; font-size: 11px; font-weight: 400; color: var(--muted); margin-top: 4px;}
.login-shell {gap: 90px;}
.login-form {padding: 35px; border: 1px solid var(--line); border-radius: 16px; background: #fcfefb; box-shadow: 0 12px 45px #173c2310;}
.login-form>label {font-size: 12px;}
.login-form input {margin-bottom: 17px;}
.login-form>p {font-size: 12px; line-height: 1.9;}
.login-form>button {margin-top: 8px;}
.login-intro h1 {font-size: 40px; font-weight: 600; letter-spacing: -1.5px;}
.login-intro p {font-size: 14px; line-height: 2;}
@media (max-width: 1000px) {
  .header-top {padding: 19px 24px 12px;}
  .navigation {padding: 6px 24px 12px; gap: 4px;}
  .navigation button {padding: 11px 13px; font-size: 13px;}
  main {padding: 26px 24px;}
  .header-actions {gap: 12px;}
  .resource-hub-intro {align-items: flex-start;}
  .login-shell {gap: 42px;}
}
@media (max-width: 700px) {
  .brand span {display: none;}
  .header-top {padding: 17px 18px 10px; gap: 12px; flex-wrap: wrap;}
  .header-actions {gap: 9px;}
  #operator-name {display: none;}
  .connection {font-size: 10px;}
  .navigation {display: flex; overflow-x: auto; gap: 6px; padding: 5px 18px 12px;}
  .navigation button {flex: 0 0 auto; font-size: 13px; padding: 10px 13px;}
  main {padding: 23px 18px;}
  .page-heading {gap: 18px; align-items: flex-start;}
  .page-heading h1 {font-size: 26px;}
  .page-heading p {font-size: 12px;}
  .page-help-actions {padding: 0; justify-content: flex-start;}
  .refresh-status>span {display: none;}
  .surface,.plan-card {padding: 20px;}
  .table-wrap {padding: 0;}
  .metrics {padding: 16px 0;}
  .metric,.metric:first-child {padding: 9px 18px;}
  .metric-number {font-size: 29px;}
  .resource-hub-intro {flex-direction: column; gap: 13px;}
  .persona-grid {grid-template-columns: minmax(0,1fr);}
  .form-grid,.form-grid:has(>label:nth-child(3):last-child) {grid-template-columns: minmax(0,1fr);}
  .persona-card {padding: 20px;}
  .toolbar {align-items: flex-start; flex-wrap: wrap; gap: 13px;}
  .hub-tabs button {flex: 1; padding: 12px;}
  #drawer {padding: 0 20px 24px;}
  #drawer .drawer-top {padding-top: 21px;}
  #drawer .drawer-top h2 {font-size: 21px;}
  .drawer-tools .page-help-button {padding: 5px;}
  input:not([type=checkbox]):not([type=radio]),textarea,.select-trigger {font-size: 16px;}
  .select-search {font-size: 16px!important;}
  .select-option {font-size: 14px; min-height: 42px;}
  .login-shell {padding: 28px 19px; gap: 30px;}
  .login-form {padding: 25px 21px;}
  .login-intro h1 {font-size: 32px;}
  .page-footer {gap: 9px; flex-wrap: wrap;}
}
@media (prefers-reduced-motion: reduce) {
  *,*::before,*::after {transition: none!important; scroll-behavior: auto!important; animation: none!important;}
}

#database-status,#database-setup-result{font-size:12px;line-height:1.9;margin:12px 0 18px;overflow-wrap:anywhere}
