.portal { min-height: 100vh; background: #f6f5ee; color: #16382e; }
.portal-header { background: #173f32; color: #fff; }
.portal-header-inner, .portal-nav, .portal-main { max-width: 68rem; margin-inline: auto; padding-inline: clamp(0.75rem, 4vw, 2rem); }
.portal-header-inner { min-height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.portal-brand { display: inline-flex; align-items: center; gap: 11px; min-height: 44px; color: #fff; font-size: 0.84rem; font-weight: 650; text-decoration: none; }
.portal-brand img { width: 110px; height: auto; }
.portal-signout { min-height: 44px; padding-inline: 10px; color: #fff; font-size: 0.86rem; text-decoration: underline; text-underline-offset: 3px; }
.portal-nav { display: flex; gap: 8px; }
.portal-nav a { display: inline-flex; min-height: 44px; align-items: center; padding: 0 12px; border-radius: 8px 8px 0 0; color: #fff; font-size: 0.92rem; }
.portal-nav a[aria-current="page"] { background: #f6f5ee; color: #173f32; font-weight: 700; }
.portal-main { padding-block: clamp(20px, 4vw, 40px) 40px; }
.portal-main h1 { font-size: clamp(1.65rem, 4.5vw, 2.35rem); margin: 0 0 12px; line-height: 1.1; overflow-wrap: anywhere; }
.portal-main h2 { margin: 0 0 14px; font-size: 1.2rem; overflow-wrap: anywhere; }
.portal-main h3 { margin: 0 0 12px; font-size: 1rem; }
.portal-heading, .portal-member { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.portal-heading :is(h1, h2) { margin: 0; }
.portal-panel { padding: clamp(14px, 3vw, 24px); margin-block: 14px; border: 1px solid #d6ded4; border-radius: 12px; background: #fffefa; }
.portal-login { max-width: 31rem; }
.portal-login .portal-panel { padding: clamp(18px, 5vw, 32px); }
.portal-form { display: grid; gap: 11px; }
.portal-form .btn { justify-self: start; }
.portal input[type="submit"].btn { width: auto; }
.portal-form .field { margin: 0; min-width: 0; }
.portal-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 12px; }
.portal-search { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-block: 12px; }
.portal-search input:not([type="submit"]) { flex: 1 1 130px; min-width: 0; }
.portal :is(input:not([type="checkbox"]):not([type="hidden"]), select, .btn) { min-height: 44px; }
.portal :is(input[type="search"], input[type="text"], input[type="email"], input[type="password"], input[type="number"], select) { border: 1px solid #a7b8ad; border-radius: 8px; color: #16382e; background: white; padding: 8px 10px; font-size: max(16px, 0.95rem); max-width: 100%; }
.portal-form .field :is(input, select) { width: 100%; }
.portal input[type="checkbox"] { width: 18px; height: 18px; accent-color: #173f32; margin: 0; flex: none; }
.portal-checks { display: flex; flex-wrap: wrap; gap: 0 14px; padding: 0; min-width: 0; }
.portal-checks legend { font-weight: 650; }
.portal-checks label { min-height: 44px; display: flex; gap: 7px; align-items: center; overflow-wrap: anywhere; }
.portal-list { list-style: none; padding: 0; margin: 0 0 12px; }
.portal-list a { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; min-height: 48px; gap: 2px 12px; padding: 10px 2px; border-bottom: 1px solid #d6ded4; overflow-wrap: anywhere; }
.portal-list span, .portal-muted { color: #52695f; font-size: 0.9rem; }
.portal-muted { margin: 0; overflow-wrap: anywhere; }
.portal-actions { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.portal-back, .portal-actions a, .portal-confirm summary { min-height: 44px; display: inline-flex; align-items: center; text-decoration: underline; text-underline-offset: 3px; }
.portal-confirm summary { cursor: pointer; }
.portal-confirm p { margin: 0 0 8px; }
.portal-member-card { border-top: 1px solid #d6ded4; padding-block: 12px 6px; overflow-wrap: anywhere; }
.portal-member { border-block-start: 1px solid #e1e5dd; padding: 7px 0; }
.portal-device-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 12px; }
.portal-device { margin: 0; }
.portal-device dl { margin: 0 0 14px; }
.portal-device dl div { display: grid; grid-template-columns: 1fr 1.25fr; gap: 5px; padding: 3px 0; }
.portal-device dd { margin: 0; overflow-wrap: anywhere; font-weight: 650; }
.portal-state { border-radius: 999px; padding: 4px 9px; font-size: 0.8rem; background: #eeead5; color: #4e4014; }
.portal-state[data-state="active"] { background: #e1edce; color: #254415; }
.portal-skip, .portal-visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.portal-skip:focus { width: auto; height: auto; clip-path: none; color: #173f32; background: white; z-index: 20; padding: 8px; }
@media (max-width: 380px) {
  .portal-brand img { width: 84px; }
  .portal-brand { gap: 7px; font-size: 0.75rem; }
  .portal-nav { gap: 2px; }
  .portal-nav a { padding-inline: 8px; }
}
