:root {
  --bg: #f7f3ea;
  --surface: #fffdf8;
  --ink: #173d31;
  --muted: #6c776f;
  --green: #165b44;
  --green2: #2f7a5c;
  --greenSoft: #e4ede6;
  --red: #aa4242;
  --redSoft: #f7e6e3;
  --amber: #a8660d;
  --amberSoft: #f7ecd9;
  --line: #e6dfd2;
  --shadow:
    0 12px 28px rgba(32, 61, 48, 0.08), 0 2px 5px rgba(32, 61, 48, 0.05);
  --radius: 20px;
}
* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: ui-rounded, "Avenir Next", "Segoe UI", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
button,
input,
select {
  font: inherit;
}
button {
  cursor: pointer;
}
.hidden {
  display: none !important;
}
.muted {
  color: var(--muted);
}
.kicker {
  margin: 0 0 7px;
  color: var(--green2);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  font-size: 23px;
  font-weight: 800;
}
.brand img {
  width: 42px;
  height: 42px;
}
.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 80% 5%, #e4ede6 0, transparent 35%), var(--bg);
}
.login-card {
  width: min(460px, 100%);
  padding: 42px;
  border: 1px solid var(--line);
  border-radius: 26px;
  background: rgba(255, 253, 248, 0.94);
  box-shadow: var(--shadow);
}
.brand-login {
  margin-bottom: 42px;
}
.login-card h1 {
  margin: 0;
  font-size: 45px;
  letter-spacing: -1.5px;
}
.stack {
  display: grid;
  gap: 17px;
  margin-top: 26px;
}
.stack label,
.dialog-form > label {
  display: grid;
  gap: 7px;
  font-size: 14px;
  font-weight: 750;
}
.stack input,
.dialog-form input,
.dialog-form select {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid #d9d1c5;
  border-radius: 13px;
  background: #fff;
  color: var(--ink);
  outline: none;
}
.stack input:focus,
.dialog-form input:focus,
.dialog-form select:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(22, 91, 68, 0.12);
}
.primary,
.secondary,
.danger-outline {
  min-height: 48px;
  padding: 0 19px;
  border-radius: 13px;
  font-weight: 800;
}
.primary {
  border: 0;
  background: var(--green);
  color: #fff;
  box-shadow: 0 7px 18px rgba(22, 91, 68, 0.17);
}
.secondary {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
}
.danger-outline {
  border: 1px solid #ddafaa;
  background: transparent;
  color: var(--red);
}
.wide {
  width: 100%;
}
.form-error {
  min-height: 20px;
  margin: 0;
  color: var(--red);
  font-size: 14px;
}
.app {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 276px 1fr;
}
.sidebar {
  position: relative;
  min-height: 100vh;
  border-right: 1px solid var(--line);
  background: rgba(255, 253, 248, 0.74);
}
.sidebar-inner {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 34px 24px;
}
.sidebar .brand {
  margin: 4px 8px 49px;
}
.nav {
  display: grid;
  gap: 9px;
}
.nav-item {
  min-height: 61px;
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 0 18px;
  border: 0;
  border-radius: 16px;
  background: transparent;
  color: #28483d;
  text-align: left;
  font-size: 17px;
  font-weight: 700;
}
.nav-item span {
  width: 25px;
  text-align: center;
  font-size: 23px;
}
.nav-item.active {
  background: var(--greenSoft);
  color: var(--green);
}
.sidebar-user {
  position: absolute;
  left: 24px;
  right: 24px;
  bottom: 25px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 4px 0;
  border-top: 1px solid var(--line);
}
.sidebar-user small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
}
.small-avatar {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  flex: none;
  border-radius: 50%;
  background: var(--greenSoft);
  font-size: 13px;
  font-weight: 850;
}
.content-shell {
  min-width: 0;
}
.mobile-header {
  display: none;
}
.page {
  display: none;
  min-width: 0;
  max-width: 100%;
  padding: 51px clamp(30px, 5vw, 75px) 72px;
}
.active-page {
  display: block;
}
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 36px;
}
.page-header h1 {
  margin: 0;
  font-size: clamp(43px, 4vw, 62px);
  line-height: 1.03;
  letter-spacing: -2px;
}
.page-header .muted {
  margin: 10px 0 0;
  font-size: 17px;
}
.calendar-toolbar {
  display: grid;
  grid-template-columns: 48px 1fr 48px;
  align-items: center;
  gap: 15px;
  margin: 0 auto 14px;
}
.calendar-toolbar h2 {
  text-align: center;
  margin: 0;
  font-size: 28px;
}
.icon-button {
  width: 48px;
  height: 48px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  color: var(--ink);
  font-size: 28px;
}
.legend {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 18px;
  margin-bottom: 19px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}
.legend span {
  display: flex;
  align-items: center;
  gap: 7px;
}
.legend i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
}
.legend .green {
  background: #57a262;
}
.legend .amber {
  background: #cb861d;
}
.legend .red {
  background: #c84d4d;
}
.month-card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.weekday-row,
.month-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
}
.weekday-row span {
  padding: 4px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}
.month-grid {
  margin-top: 8px;
}
.calendar-day {
  position: relative;
  min-height: 96px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: #fffdf9;
  text-align: left;
  color: var(--ink);
}
.calendar-day.outside {
  opacity: 0.4;
}
.calendar-day.selected {
  border: 2px solid var(--green);
  box-shadow: 0 0 0 3px rgba(22, 91, 68, 0.1);
}
.calendar-day.today .day-number {
  background: var(--green);
  color: #fff;
}
.day-number {
  width: 31px;
  height: 31px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-weight: 800;
}
.day-summary {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
}
.day-summary i {
  width: 8px;
  height: 8px;
  flex: none;
  border-radius: 50%;
}
.day-summary.green i {
  background: #57a262;
}
.day-summary.amber i {
  background: #cb861d;
}
.day-summary.red i {
  background: #c84d4d;
}
.day-section {
  margin-top: 42px;
}
.day-section h2 {
  margin: 0;
  font-size: 32px;
  letter-spacing: -1px;
}
.day-section .muted {
  margin: 8px 0 21px;
  font-size: 16px;
}
.people-list {
  display: grid;
  gap: 13px;
}
.person-card {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) auto;
  align-items: center;
  gap: 19px;
  min-height: 105px;
  padding: 18px 22px;
  border: 1px solid var(--line);
  border-radius: 19px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.avatar {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--greenSoft);
  font-size: 22px;
  font-weight: 850;
}
.person-card h3 {
  margin: 0 0 7px;
  font-size: 25px;
}
.person-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 750;
}
.person-status i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}
.person-status.green {
  color: var(--green2);
}
.person-status.green i {
  background: #57a262;
}
.person-status.amber {
  color: var(--amber);
}
.person-status.amber i {
  background: #cb861d;
}
.person-status.red {
  color: var(--red);
}
.person-status.red i {
  background: #c84d4d;
}
.phone-link {
  min-width: 175px;
  min-height: 56px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 0 20px;
  border-radius: 15px;
  background: var(--green);
  color: #fff;
  text-decoration: none;
  font-size: 18px;
  font-weight: 800;
}
.status-detail {
  max-width: 220px;
  color: var(--muted);
  text-align: right;
  font-size: 14px;
  line-height: 1.4;
}
.person-actions {
  min-width: 220px;
  display: grid;
  justify-items: end;
  gap: 9px;
}
.person-actions .status-detail {
  max-width: 260px;
}
.call-unavailable {
  max-width: 260px;
  padding: 9px 12px;
  border-radius: 11px;
  background: var(--redSoft);
  color: var(--red);
  text-align: right;
  font-size: 14px;
  font-weight: 750;
  line-height: 1.35;
}
.empty {
  padding: 28px;
  border: 1px dashed #d6ccbd;
  border-radius: 16px;
  color: var(--muted);
  text-align: center;
}
.two-column {
  display: grid;
  grid-template-columns: minmax(280px, 430px) minmax(360px, 1fr);
  gap: 24px;
}
.panel {
  min-width: 0;
  max-width: 100%;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 21px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.panel h2 {
  margin: 0 0 18px;
  font-size: 25px;
}
.check {
  display: flex !important;
  grid-template-columns: auto 1fr !important;
  align-items: center;
  gap: 10px !important;
}
.check input {
  width: 20px !important;
  min-height: 20px !important;
}
.entry-list {
  display: grid;
  gap: 10px;
}
.entry {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}
.entry strong,
.entry small {
  display: block;
}
.entry small {
  margin-top: 4px;
  color: var(--muted);
}
.entry button {
  border: 0;
  background: var(--redSoft);
  color: var(--red);
  padding: 8px 11px;
  border-radius: 10px;
  font-weight: 700;
}
.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}
.stat {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: var(--surface);
}
.stat strong {
  display: block;
  font-size: 30px;
}
.stat span {
  color: var(--muted);
  font-size: 13px;
}
.table-panel {
  padding: 0;
  overflow: hidden;
}
.table-wrap {
  overflow-x: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  white-space: nowrap;
}
th,
td {
  padding: 15px 16px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  font-size: 14px;
}
th {
  background: #f3eee5;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
tbody tr:last-child td {
  border-bottom: 0;
}
.user-cell strong,
.user-cell small {
  display: block;
}
.user-cell small {
  margin-top: 4px;
  color: var(--muted);
}
.pill {
  display: inline-block;
  padding: 5px 9px;
  border-radius: 99px;
  background: var(--greenSoft);
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
}
.pill.inactive {
  background: #eee;
  color: #777;
}
.table-action {
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  padding: 7px 10px;
  color: var(--green);
  font-weight: 750;
}
.account-panel {
  max-width: 600px;
}
.account-panel hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 25px 0;
}
.compact {
  max-width: 430px;
  margin-bottom: 30px;
}
.bottom-nav {
  display: none;
}
.toast {
  position: fixed;
  z-index: 100;
  top: 18px;
  left: 50%;
  transform: translate(-50%, -130%);
  padding: 12px 18px;
  border-radius: 12px;
  background: var(--ink);
  color: #fff;
  box-shadow: var(--shadow);
  transition: transform 0.2s;
}
.toast.show {
  transform: translate(-50%, 0);
}
dialog {
  width: min(520px, calc(100% - 28px));
  padding: 0;
  border: 0;
  border-radius: 22px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 24px 80px rgba(20, 45, 35, 0.25);
}
dialog::backdrop {
  background: rgba(18, 35, 29, 0.45);
  backdrop-filter: blur(3px);
}
.dialog-form {
  display: grid;
  gap: 15px;
  padding: 27px;
}
.dialog-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}
.dialog-head h2 {
  margin: 0;
  font-size: 29px;
}
.close {
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 12px;
  background: #f1ece3;
  font-size: 25px;
}
.hint {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}
@media (max-width: 900px) {
  .app {
    grid-template-columns: 220px 1fr;
  }
  .sidebar-inner {
    padding: 28px 16px;
  }
  .sidebar .brand span {
    display: none;
  }
  .two-column {
    grid-template-columns: 1fr;
  }
  .calendar-day {
    min-height: 78px;
  }
  .day-summary span {
    display: none;
  }
}
@media (max-width: 700px) {
  body {
    background: #fbf8f1;
  }
  .login-card {
    padding: 30px 23px;
  }
  .app {
    display: block;
  }
  .sidebar {
    display: none;
  }
  .content-shell {
    padding-bottom: 84px;
  }
  .mobile-header {
    position: sticky;
    z-index: 20;
    top: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: calc(12px + env(safe-area-inset-top)) 17px 12px;
    border-bottom: 1px solid var(--line);
    background: rgba(255, 253, 248, 0.93);
    backdrop-filter: blur(18px);
  }
  .mobile-header .brand {
    font-size: 18px;
  }
  .mobile-header .brand img {
    width: 33px;
    height: 33px;
  }
  .page {
    padding: 24px 16px 38px;
  }
  .page-header {
    margin-bottom: 25px;
  }
  .page-header h1 {
    font-size: 39px;
    letter-spacing: -1.5px;
  }
  .page-header .secondary {
    display: none;
  }
  .calendar-toolbar {
    grid-template-columns: 42px 1fr 42px;
  }
  .calendar-toolbar h2 {
    font-size: 22px;
  }
  .icon-button {
    width: 42px;
    height: 42px;
  }
  .legend {
    justify-content: flex-start;
    gap: 8px 14px;
    font-size: 11px;
  }
  .month-card {
    padding: 9px;
    border-radius: 18px;
  }
  .weekday-row,
  .month-grid {
    gap: 4px;
  }
  .weekday-row span {
    font-size: 11px;
  }
  .calendar-day {
    min-height: 58px;
    padding: 5px;
    border-radius: 10px;
  }
  .day-number {
    width: 25px;
    height: 25px;
    font-size: 13px;
  }
  .day-summary {
    left: 7px;
    bottom: 6px;
  }
  .day-summary span {
    display: none;
  }
  .day-section {
    margin-top: 28px;
  }
  .day-section h2 {
    font-size: 27px;
  }
  .person-card {
    grid-template-columns: 54px 1fr;
    gap: 13px;
    padding: 15px;
  }
  .avatar {
    width: 54px;
    height: 54px;
  }
  .person-card h3 {
    font-size: 22px;
  }
  .phone-link,
  .status-detail {
    grid-column: 1/-1;
    width: 100%;
    max-width: none;
  }
  .phone-link {
    min-height: 54px;
  }
  .status-detail {
    padding: 10px 12px;
    border-radius: 11px;
    background: #f5f0e7;
    text-align: left;
  }
  .person-actions {
    grid-column: 1/-1;
    width: 100%;
    min-width: 0;
    justify-items: stretch;
  }
  .person-actions .phone-link,
  .person-actions .status-detail,
  .person-actions .call-unavailable {
    width: 100%;
    max-width: none;
  }
  .person-actions .call-unavailable {
    text-align: left;
  }
  .two-column {
    display: block;
  }
  .two-column .panel + .panel {
    margin-top: 17px;
  }
  .panel {
    padding: 20px;
  }
  .stats {
    grid-template-columns: 1fr 1fr;
  }
  .stats .stat:last-child {
    grid-column: 1/-1;
  }
  .bottom-nav {
    position: fixed;
    z-index: 30;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    justify-content: space-around;
    padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--line);
    background: rgba(255, 253, 248, 0.95);
    backdrop-filter: blur(18px);
  }
  .bottom-nav button {
    min-width: 70px;
    display: grid;
    place-items: center;
    gap: 3px;
    border: 0;
    background: transparent;
    color: var(--muted);
    font-size: 11px;
    font-weight: 750;
  }
  .bottom-nav button span {
    font-size: 20px;
  }
  .bottom-nav button.active {
    color: var(--green);
  }
  .table-panel {
    margin: 0 -5px;
  }
  .page-header .primary {
    min-height: 43px;
    padding: 0 13px;
  }
  .dialog-form {
    padding: 22px;
  }
}
.notice {
  margin: 18px 0 0;
  padding: 13px 15px;
  border: 1px solid #dfc48d;
  border-radius: 12px;
  background: #fff5dc;
  color: #714a08;
  font-size: 14px;
  line-height: 1.45;
}
.notice a {
  color: inherit;
  font-weight: 800;
}
.sidebar .brand {
  max-width: 100%;
  gap: 8px;
  white-space: nowrap;
  font-size: 17px;
  letter-spacing: -0.25px;
}
.sidebar .brand img {
  width: 36px;
  height: 36px;
}
.toast {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translate(-50%, calc(-100% - 40px));
  transition:
    transform 0.2s,
    opacity 0.2s;
}
.toast.show {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
}
button[aria-busy="true"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  cursor: wait;
  opacity: 0.78;
}
button[aria-busy="true"]::before {
  content: "";
  width: 15px;
  height: 15px;
  flex: none;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: button-spin 0.7s linear infinite;
}
.delete-action {
  border-color: #ddafaa;
  color: var(--red);
}
@keyframes button-spin {
  to {
    transform: rotate(360deg);
  }
}
.brand-login {
  font-size: clamp(18px, 5.5vw, 23px);
}
.sidebar .sidebar-brand {
  align-items: flex-start;
  white-space: normal;
  font-size: 17px;
  line-height: 1.05;
}
.mobile-header .brand span {
  line-height: 1.05;
}
.calendar-day.past {
  cursor: not-allowed;
  opacity: 0.38;
  background: #f0ede6;
}
.calendar-day.past .day-summary {
  display: none;
}
.icon-button:disabled {
  cursor: not-allowed;
  opacity: 0.35;
}
.creator-credit {
  margin: 24px 0 0;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
  letter-spacing: 0.04em;
}
.app-credit {
  margin: 0;
  padding: 0 16px 24px;
}
@media (max-width: 700px) {
  .mobile-header .brand {
    font-size: 15px;
  }
  .creator-credit.app-credit {
    padding-bottom: 8px;
  }
}
.onboarding-card {
  width: min(520px, 100%);
}
.onboarding-card .brand-login {
  margin-bottom: 32px;
}
.onboarding-card h1 {
  font-size: clamp(37px, 8vw, 45px);
}
.text-button {
  display: block;
  margin: 18px auto 0;
  padding: 8px 12px;
  border: 0;
  background: transparent;
  color: var(--green);
  font-weight: 750;
  text-decoration: underline;
}
.stack input:disabled {
  background: #f1eee8;
  color: var(--muted);
}
.tutorial-card {
  padding: 34px;
  text-align: center;
}
.tutorial-icon {
  width: 94px;
  height: 94px;
  display: grid;
  place-items: center;
  margin: 14px auto 22px;
  border-radius: 28px;
  background: var(--greenSoft);
  font-size: 46px;
}
.tutorial-card h2 {
  margin: 0;
  font-size: 32px;
  letter-spacing: -1px;
}
.tutorial-card > .muted {
  min-height: 72px;
  margin: 13px auto 20px;
  max-width: 390px;
  font-size: 17px;
  line-height: 1.5;
}
.tutorial-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 4px 0 27px;
}
.tutorial-dots i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #d8d2c7;
}
.tutorial-dots i.active {
  width: 25px;
  border-radius: 99px;
  background: var(--green);
}
.tutorial-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.tutorial-actions > div {
  display: flex;
  gap: 9px;
}
.tutorial-actions .text-button {
  margin: 0;
}
.tutorial-actions .secondary,
.tutorial-actions .primary {
  min-width: 105px;
}
.account-panel > .secondary {
  margin-bottom: 4px;
}
@media (max-width: 500px) {
  .tutorial-card {
    padding: 27px 20px;
  }
  .tutorial-icon {
    width: 82px;
    height: 82px;
    font-size: 40px;
  }
  .tutorial-card h2 {
    font-size: 28px;
  }
  .tutorial-card > .muted {
    min-height: 92px;
    font-size: 16px;
  }
  .tutorial-actions {
    align-items: stretch;
    flex-direction: column-reverse;
  }
  .tutorial-actions > div {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  .tutorial-actions .text-button {
    width: 100%;
  }
}
html {
  -webkit-text-size-adjust: 100%;
}
button,
a {
  touch-action: manipulation;
}
@media (max-width: 700px) {
  input,
  select,
  textarea {
    font-size: 16px !important;
  }
}
.ha-layout {
  display: grid;
  gap: 20px;
}
.ha-active-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px 23px;
  border: 1px solid #b9d8c3;
  border-radius: 18px;
  background: var(--greenSoft);
}
.ha-active-banner small,
.ha-active-banner strong {
  display: block;
}
.ha-active-banner small {
  margin-bottom: 3px;
  color: var(--muted);
}
.ha-active-banner strong {
  font-size: 23px;
}
.status-dot {
  width: 13px;
  height: 13px;
  display: inline-block;
  flex: none;
  border-radius: 50%;
  background: #9b9b9b;
  box-shadow: 0 0 0 5px rgba(120, 120, 120, 0.1);
}
.status-dot.green {
  background: #57a262;
  box-shadow: 0 0 0 5px rgba(87, 162, 98, 0.12);
}
.status-dot.amber {
  background: #cb861d;
  box-shadow: 0 0 0 5px rgba(203, 134, 29, 0.12);
}
.status-dot.red {
  background: #c84d4d;
  box-shadow: 0 0 0 5px rgba(200, 77, 77, 0.12);
}
.ha-server-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}
.ha-server-card {
  padding: 23px;
  border: 1px solid var(--line);
  border-left: 5px solid #57a262;
  border-radius: 19px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.ha-server-card.amber {
  border-left-color: #cb861d;
}
.ha-server-card.red {
  border-left-color: #c84d4d;
}
.ha-server-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 19px;
}
.ha-server-head > div {
  display: flex;
  align-items: center;
  gap: 11px;
}
.ha-server-head strong {
  font-size: 20px;
}
.ha-server-card dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 15px;
  margin: 0;
}
.ha-server-card dl div {
  min-width: 0;
}
.ha-server-card dt,
.status-label {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.ha-server-card dd {
  margin: 0;
  overflow-wrap: anywhere;
  font-weight: 700;
}
.ha-server-card a {
  color: var(--green);
}
.ha-error {
  margin: 17px 0 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--redSoft);
  color: var(--red);
  font-size: 13px;
}
.ha-details-panel {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 18px;
}
.ha-details-panel strong {
  overflow-wrap: anywhere;
}
.presence-panel h2 { display: flex; align-items: center; gap: 9px; }
.presence-live-dot { width: 11px; height: 11px; border-radius: 50%; background: var(--greenBright); box-shadow: 0 0 0 5px rgba(80,168,98,.14); }
.presence-count { display: grid; place-items: center; min-width: 48px; height: 48px; padding: 0 14px; border-radius: 15px; background: var(--greenSoft); color: var(--green); font-size: 22px; }
.presence-list { display: grid; grid-template-columns: repeat(auto-fit,minmax(260px,1fr)); gap: 12px; margin-top: 18px; }
.presence-card { display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: 12px; padding: 14px; border: 1px solid var(--line); border-radius: 16px; background: #fffdfa; }
.presence-avatar { display: grid; place-items: center; width: 45px; height: 45px; border-radius: 50%; background: var(--greenSoft); color: var(--green); font-weight: 850; }
.presence-card > div { display: grid; gap: 3px; min-width: 0; }
.presence-card > div span { overflow-wrap: anywhere; color: var(--muted); font-size: 13px; }
.presence-card small { display: flex; align-items: center; gap: 7px; color: var(--green); font-weight: 750; white-space: nowrap; }
.presence-card small i { width: 8px; height: 8px; border-radius: 50%; background: var(--greenBright); }
.ha-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 11px;
  margin-top: 21px;
}
.ha-actions button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}
.ha-settings-form {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(220px, 1fr) auto;
  align-items: end;
  gap: 18px;
  max-width: 900px;
}
.ha-settings-form > label:not(.check) {
  display: grid;
  gap: 7px;
  font-size: 14px;
  font-weight: 750;
}
.ha-settings-form input[type="number"] {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid #d9d1c5;
  border-radius: 13px;
  background: #fff;
  color: var(--ink);
  font-size: 16px;
}
.ha-settings-form .form-error {
  grid-column: 1 / -1;
}
.ha-event-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
.ha-event-column {
  min-width: 0;
}
.ha-event-list {
  display: grid;
  gap: 8px;
  max-height: 360px;
  overflow: auto;
}
.ha-event {
  padding: 10px 12px;
  border-left: 4px solid #57a262;
  border-radius: 9px;
  background: var(--greenSoft);
}
.ha-event.warning {
  border-left-color: var(--amber);
  background: var(--amberSoft);
}
.ha-event.error {
  border-left-color: var(--red);
  background: var(--redSoft);
}
.ha-event strong,
.ha-event small {
  display: block;
}
.ha-event small {
  margin-top: 3px;
  color: var(--muted);
}
.ha-event-technical {
  margin-top: .55rem;
  border-top: 1px solid rgba(20, 72, 57, .12);
  padding-top: .45rem;
}
.ha-event-technical summary {
  color: var(--green);
  cursor: pointer;
  font-size: .8rem;
  font-weight: 800;
}
.ha-event-technical pre {
  background: #102c25;
  border-radius: 10px;
  color: #d9f5e9;
  font: 500 .74rem/1.55 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  margin: .55rem 0 0;
  max-height: 16rem;
  overflow: auto;
  padding: .75rem;
  white-space: pre-wrap;
  word-break: break-word;
}
.account-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  align-items: start;
}
.info-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 20px;
  max-width: 900px;
  align-items: start;
}
.info-grid > *,
.bulletin-meta > * {
  min-width: 0;
}
.info-grid textarea {
  width: 100%;
  max-width: 100%;
  resize: vertical;
}
.bulletin-list,
.document-list {
  display: grid;
  gap: 12px;
  margin-top: 20px;
}
.bulletin-card,
.document-card {
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
}
.bulletin-card p {
  margin: 7px 0 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.bulletin-card h3 {
  margin: 16px 0 0;
  font-size: 20px;
  overflow-wrap: anywhere;
}
.update-status {
  display: grid;
  gap: 4px;
  margin: 16px 0 20px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--greenSoft);
}
.update-status span,
.update-status small { color: var(--muted); }
.update-status.error { background: var(--redSoft); border-color: #ddafaa; }
.update-status.success { background: #e2f0e5; border-color: #acd1b5; }
.update-status.working { background: var(--amberSoft); border-color: #dfc48d; }
.privacy-note {
  margin: -2px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}
.cookie-intro {
  display: grid;
  gap: 4px;
  margin: 18px 0;
}
.update-server-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.update-server-card {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--surface);
}
.update-server-card h3 { margin: 0; }
.update-server-card .update-status { margin-bottom: 14px; }
.update-server-card > button { width: 100%; }
.visitor-toolbar,
.visitor-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 9px;
}
.visitor-toolbar label {
  display: grid;
  gap: 5px;
  font-size: 13px;
  font-weight: 750;
}
.visitor-toolbar select {
  min-height: 48px;
  padding: 0 34px 0 12px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface);
  color: var(--ink);
}
.visitor-map {
  margin: 18px 0 10px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.visitor-map-canvas { position: relative; aspect-ratio: 2 / 1; background: #eef4ef; }
.visitor-map-canvas img,
.visitor-map-canvas svg { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }
.visitor-map-canvas img { object-fit: fill; user-select: none; }
.visitor-map-canvas svg { overflow: visible; }
.visitor-map-point { cursor: pointer; outline: none; }
.visitor-map-pulse { fill: rgba(191,65,64,.22); stroke: rgba(191,65,64,.55); stroke-width: 2; }
.visitor-map-pin { fill: var(--red); stroke: white; stroke-width: 2.5; }
.visitor-map-point text { fill: white; font-size: 9px; font-weight: 900; text-anchor: middle; pointer-events: none; }
.visitor-map-point:hover .visitor-map-pulse,
.visitor-map-point:focus .visitor-map-pulse { fill: rgba(191,65,64,.35); stroke-width: 3; }
.visitor-map-caption { display: flex; justify-content: space-between; gap: 12px; padding: 12px 16px; color: var(--muted); font-size: 13px; border-top: 1px solid var(--line); }
.visitor-map-caption span { display: flex; align-items: center; gap: 7px; font-weight: 750; color: var(--ink); }
.visitor-map-caption i { width: 9px; height: 9px; border-radius: 50%; background: var(--red); }
.visitor-list { display: grid; gap: 12px; margin-top: 18px; }
.visitor-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--surface);
}
.visitor-card-head { display: flex; justify-content: space-between; gap: 12px; align-items: start; }
.visitor-card-head > div { display: grid; gap: 3px; min-width: 0; }
.visitor-ip { overflow-wrap: anywhere; }
.visitor-identity { color: var(--green); font-weight: 750; }
.visitor-card dl { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 13px; margin: 16px 0; }
.visitor-card dl div { min-width: 0; }
.visitor-card dt { color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.visitor-card dd { margin: 4px 0 0; overflow-wrap: anywhere; }
.pill.warning { color: #8b5900; background: var(--amberSoft); }
.bulletin-meta,
.document-meta,
.document-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.bulletin-meta small,
.document-card small {
  display: block;
  color: var(--muted);
}
.document-card > div {
  min-width: 0;
}
.document-card strong {
  overflow-wrap: anywhere;
}
.info-actions {
  display: flex;
  flex: none;
  gap: 8px;
}
.help-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.push-settings {
  margin-top: 1rem;
}
.technical-manual-settings {
  margin-top: 1rem;
}
.push-settings .help-actions {
  margin-top: .75rem;
}
.manual-dialog {
  width: min(1100px, calc(100% - 28px));
  height: min(850px, calc(100% - 28px));
  max-width: none;
}
.manual-viewer {
  height: 100%;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  gap: 12px;
  padding: 20px;
}
.manual-toolbar {
  display: grid;
  grid-template-columns: minmax(110px, 1fr) auto minmax(110px, 1fr);
  align-items: center;
  gap: 12px;
}
.manual-toolbar button:last-child {
  justify-self: end;
}
.manual-toolbar strong {
  min-width: 100px;
  text-align: center;
}
.manual-page-viewport {
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow: auto;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #ece8df;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
.manual-page-viewport canvas {
  display: block;
  max-width: 100%;
  height: auto;
  background: #fff;
  box-shadow: 0 3px 16px rgba(22, 66, 52, .14);
}
.manual-loading {
  align-self: center;
  margin: auto;
  color: var(--muted);
  text-align: center;
}
.manual-mobile-hint {
  margin: 0;
  color: var(--muted);
  text-align: center;
  font-size: .9rem;
}
.link-fieldset {
  min-width: 0;
  margin: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
}
.link-fieldset legend {
  padding: 0 6px;
  font-weight: 750;
}
.linked-users-list {
  display: grid;
  gap: 8px;
  max-height: 220px;
  overflow: auto;
}
.linked-users-list .check {
  padding: 10px 11px;
  border-radius: 10px;
  background: var(--greenSoft);
}
@media (max-width: 900px) {
  .ha-server-grid {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 700px) {
  .presence-card { grid-template-columns: auto minmax(0,1fr); }
  .presence-card small { grid-column: 2; white-space: normal; }
  .update-server-grid { grid-template-columns: 1fr; }
  .visitor-toolbar { display: grid; width: 100%; }
  .visitor-toolbar button,
  .visitor-toolbar select { width: 100%; }
  .visitor-card dl { grid-template-columns: 1fr; }
  .visitor-actions { display: grid; }
  .visitor-actions button { width: 100%; }
  .info-grid {
    grid-template-columns: 1fr;
    width: 100%;
  }
  .ha-event-grid {
    grid-template-columns: 1fr;
  }
  .document-card {
    align-items: flex-start;
  }
  .info-actions {
    flex-direction: column;
  }
  .help-actions {
    display: grid;
  }
  .help-actions button {
    width: 100%;
  }
  .manual-dialog {
    width: 100%;
    height: 100%;
    max-height: none;
    margin: 0;
    border-radius: 0;
  }
  .manual-viewer {
    padding: calc(12px + env(safe-area-inset-top)) 12px calc(12px + env(safe-area-inset-bottom));
  }
  .manual-toolbar {
    grid-template-columns: 1fr auto 1fr;
    gap: 7px;
  }
  .manual-toolbar button {
    min-width: 0;
    padding: 11px 12px;
  }
  .manual-toolbar strong {
    min-width: 76px;
    font-size: .92rem;
  }
  .manual-page-viewport {
    padding: 6px;
  }
  .account-grid {
    grid-template-columns: 1fr;
  }
  .ha-details-panel {
    grid-template-columns: 1fr;
  }
  .ha-server-card dl {
    grid-template-columns: 1fr 1fr;
  }
  .ha-actions {
    display: grid;
  }
  .ha-settings-form {
    grid-template-columns: 1fr;
  }
  .ha-actions button {
    width: 100%;
  }
  .bottom-nav button {
    min-width: 54px;
  }
  .bottom-nav button span {
    font-size: 18px;
  }
}
