:root {
  color-scheme: light;
  --blue: #155eef;
  --blue-dark: #0f46b8;
  --blue-soft: #eaf1ff;
  --ink: #172033;
  --muted: #647087;
  --line: #dfe5ef;
  --surface: #ffffff;
  --canvas: #f4f7fb;
  --danger: #c52a35;
  --danger-soft: #fff0f1;
  --success: #16794b;
  --success-soft: #eaf8f1;
  --warning: #9a5a00;
  --purple: #6f42c1;
  --purple-dark: #57339b;
  --purple-soft: #f3edff;
  --shadow: 0 10px 32px rgba(23, 32, 51, .08);
  --radius: 18px;
  --radius-sm: 12px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html { min-height: 100%; background: var(--canvas); }

body {
  min-height: 100vh;
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button, input, textarea, select { font: inherit; }
button, .button, a { -webkit-tap-highlight-color: transparent; }
a { color: var(--blue); text-decoration-thickness: .08em; text-underline-offset: .18em; }
img, svg { display: block; max-width: 100%; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: .45rem; font-size: clamp(1.65rem, 7vw, 2.2rem); line-height: 1.12; letter-spacing: -.03em; }
h2 { margin-bottom: .75rem; font-size: 1.25rem; line-height: 1.25; }
h3 { margin-bottom: .35rem; font-size: 1rem; }
details > summary { cursor: pointer; }
dd { margin: .2rem 0 0; }

.skip-link {
  position: fixed;
  top: .5rem;
  left: .5rem;
  z-index: 100;
  transform: translateY(-180%);
  background: var(--ink);
  color: #fff;
  border-radius: 8px;
  padding: .65rem .8rem;
}
.skip-link:focus { transform: none; }

.shell { width: min(100%, 1040px); margin: 0 auto; }
.page { padding: 1rem 1rem calc(6.5rem + env(safe-area-inset-bottom)); }
.page--narrow { width: min(100%, 680px); margin-inline: auto; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid rgba(223, 229, 239, .9);
  background: rgba(244, 247, 251, .92);
  backdrop-filter: blur(16px);
}
.topbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  padding: .6rem 1rem;
}
.brand { display: inline-flex; align-items: center; gap: .7rem; color: var(--ink); font-weight: 800; text-decoration: none; }
.brand img { width: 38px; height: 38px; border-radius: 11px; }
.brand__text { max-width: 42vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar__user { display: flex; align-items: center; gap: .55rem; }
.notification-link { position: relative; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; color: var(--ink); text-decoration: none; }
.notification-link:hover, .notification-link[aria-current="page"] { background: var(--blue-soft); color: var(--blue-dark); }
.notification-link svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2; }
.notification-count { position: absolute; top: 1px; right: 0; display: grid; place-items: center; min-width: 19px; height: 19px; border: 2px solid #fff; border-radius: 999px; background: var(--danger); color: #fff; padding: 0 4px; font-size: .62rem; font-weight: 850; }
.avatar {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid #bed0fa;
  border-radius: 50%;
  background: var(--blue-soft);
  color: var(--blue-dark);
  font-size: .85rem;
  font-weight: 800;
  text-decoration: none;
}

.bottom-nav {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 30;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, .96);
  padding-bottom: env(safe-area-inset-bottom);
  backdrop-filter: blur(18px);
}
.bottom-nav__inner { display: grid; grid-template-columns: repeat(6, 1fr); width: min(100%, 680px); margin: 0 auto; }
.bottom-nav a {
  display: grid;
  place-items: center;
  gap: .15rem;
  min-height: 64px;
  padding: .4rem .2rem;
  color: var(--muted);
  font-size: .68rem;
  font-weight: 700;
  text-decoration: none;
}
.bottom-nav a[aria-current="page"] { color: var(--blue); }
.bottom-nav svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2; }
.bottom-nav a span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.page-heading { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 1rem; margin: .5rem 0 1.15rem; }
.page-heading > div:first-child { min-width: min(100%, 220px); flex: 1 1 260px; }
.page-heading p { margin: 0; color: var(--muted); }
.heading-actions { display: flex; flex-wrap: wrap; gap: .55rem; }
.page > .heading-actions { margin-bottom: 1rem; }

.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.card + .card { margin-top: 1rem; }
.card__body { padding: 1rem; }
.card__header { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: 1rem 1rem .2rem; }
.card__footer { padding: .8rem 1rem 1rem; }
.card--flat { box-shadow: none; }
.card--danger { border-color: #f2bec2; background: var(--danger-soft); }

.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: .75rem; margin-bottom: 1rem; }
.stat { padding: 1rem; }
.stat__number { display: block; color: var(--blue-dark); font-size: 1.75rem; font-weight: 850; line-height: 1; }
.stat__label { display: block; margin-top: .35rem; color: var(--muted); font-size: .82rem; }

.button, button.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .42rem;
  min-height: 46px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: .7rem .95rem;
  background: var(--blue);
  color: #fff;
  font-weight: 780;
  line-height: 1.1;
  text-decoration: none;
  cursor: pointer;
}
.button:hover { background: var(--blue-dark); }
.button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, a:focus-visible {
  outline: 3px solid #91afff;
  outline-offset: 2px;
}
.button--secondary { border-color: #b9c9e8; background: #fff; color: var(--blue-dark); }
.button--secondary:hover { background: var(--blue-soft); }
.button--quiet { border-color: var(--line); background: #fff; color: var(--ink); }
.button--quiet:hover { background: #f7f9fc; }
.button--danger { background: var(--danger); color: #fff; }
.button--danger:hover { background: #9f1e29; }
.button--discussion { background: var(--purple); color: #fff; }
.button--discussion:hover { background: var(--purple-dark); }
.button--small { min-height: 44px; border-radius: 10px; padding: .5rem .7rem; font-size: .86rem; }
.button--wide { width: 100%; }
.button svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
button[disabled], .button[aria-disabled="true"] { cursor: not-allowed; opacity: .55; }

.icon-button {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
}

.form-stack { display: grid; gap: 1rem; }
.form-section { border: 1px solid var(--line); border-radius: var(--radius); background: #fff; padding: 1rem; }
.form-section__title { display: flex; align-items: center; gap: .65rem; margin-bottom: .75rem; }
.step-number { display: grid; place-items: center; flex: 0 0 30px; width: 30px; height: 30px; border-radius: 50%; background: var(--blue-soft); color: var(--blue-dark); font-size: .82rem; font-weight: 850; }
.field { display: grid; gap: .38rem; }
.field + .field { margin-top: .9rem; }
.field-row { display: grid; gap: .8rem; }
label, .label { font-weight: 760; }
.hint { color: var(--muted); font-size: .85rem; font-weight: 450; }
.required { color: var(--danger); }
input[type="text"], input[type="password"], input[type="search"], input[type="email"], input[type="tel"], input[type="datetime-local"], input[type="date"], textarea, select {
  width: 100%;
  min-height: 48px;
  border: 1px solid #bbc5d5;
  border-radius: 11px;
  background: #fff;
  color: var(--ink);
  padding: .72rem .78rem;
}
textarea { min-height: 130px; resize: vertical; line-height: 1.5; }
input[aria-invalid="true"], textarea[aria-invalid="true"], select[aria-invalid="true"] { border-color: var(--danger); background: #fffafb; }
.field-error { margin: .1rem 0 0; color: var(--danger); font-size: .84rem; font-weight: 680; }
.input-with-button { position: relative; }
.input-with-button input { padding-right: 3.3rem; }
.input-with-button button { position: absolute; top: 4px; right: 4px; min-width: 40px; min-height: 40px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); }
.checkline { display: flex; align-items: center; gap: .68rem; min-height: 44px; font-weight: 500; }
.checkline input { flex: 0 0 22px; width: 22px; height: 22px; margin: .05rem 0 0; accent-color: var(--blue); }
.checkline span { display: grid; gap: .1rem; }
.checkline small { color: var(--muted); font-size: .78rem; font-weight: 450; line-height: 1.35; }
.checkbox-grid { display: grid; gap: .65rem; }
.form-actions { display: flex; flex-direction: column; gap: .65rem; }

.severity-grid { display: grid; gap: .65rem; }
.severity-choice { position: relative; }
.severity-choice input { position: absolute; opacity: 0; pointer-events: none; }
.severity-choice label {
  display: grid;
  grid-template-columns: 18px 1fr auto;
  align-items: center;
  gap: .7rem;
  min-height: 58px;
  border: 2px solid var(--line);
  border-radius: 13px;
  padding: .65rem .75rem;
  cursor: pointer;
}
.severity-choice input:focus-visible + label { outline: 3px solid #91afff; outline-offset: 2px; }
.severity-choice input:checked + label { border-color: var(--severity-color); box-shadow: 0 0 0 3px color-mix(in srgb, var(--severity-color) 18%, transparent); }
.severity-dot { width: 16px; height: 16px; border-radius: 50%; background: var(--severity-color); }
.severity-choice small { color: var(--muted); font-weight: 500; }
.severity-1 { --severity-color: #2e9b61; --severity-bg: #eaf8f1; }
.severity-2 { --severity-color: #d39a12; --severity-bg: #fff8df; }
.severity-3 { --severity-color: #e66a20; --severity-bg: #fff0e7; }
.severity-4 { --severity-color: #d63c48; --severity-bg: #fff0f1; }

.event-list, .todo-list, .contact-list, .plain-list { display: grid; gap: .75rem; margin: 0; padding: 0; list-style: none; }
.event-card { position: relative; display: block; overflow: hidden; border: 1px solid var(--line); border-radius: 15px; background: #fff; color: var(--ink); text-decoration: none; box-shadow: 0 5px 18px rgba(23,32,51,.05); }
.event-card::before { position: absolute; top: 0; bottom: 0; left: 0; width: 6px; background: var(--severity-color); content: ""; }
.event-card__body { padding: .9rem .9rem .9rem 1.1rem; }
.event-card__top { display: flex; align-items: flex-start; justify-content: space-between; gap: .8rem; }
.event-card h3 { margin: 0; font-size: 1.03rem; }
.event-card p { display: -webkit-box; overflow: hidden; margin: .48rem 0 0; color: var(--muted); -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.meta { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .75rem; margin-top: .55rem; color: var(--muted); font-size: .78rem; }
.meta span { display: inline-flex; align-items: center; gap: .28rem; }
.meta svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; }
.badge { display: inline-flex; align-items: center; gap: .32rem; border-radius: 999px; padding: .28rem .55rem; background: var(--severity-bg, #eef2f7); color: var(--ink); font-size: .74rem; font-weight: 760; white-space: nowrap; }
.badge::before { width: 8px; height: 8px; border-radius: 50%; background: var(--severity-color, #8791a3); content: ""; }
.tag-list { display: flex; flex-wrap: wrap; gap: .4rem; margin: .7rem 0 0; padding: 0; list-style: none; }
.tag { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; padding: .26rem .55rem; background: #f8fafd; color: #46526a; font-size: .78rem; }
.note-summary { display: flex; align-items: center; gap: .45rem; margin-top: .65rem; color: var(--muted); font-size: .8rem; font-weight: 650; }
.note-badge { display: inline-flex; align-items: center; width: fit-content; border-radius: 999px; padding: .28rem .6rem; background: var(--purple-soft); color: var(--purple-dark); font-size: .75rem; font-weight: 800; white-space: nowrap; }
.note-badge::before { width: 8px; height: 8px; margin-right: .35rem; border-radius: 50%; background: var(--purple); content: ""; }
.note-badge--small { padding: .2rem .48rem; font-size: .7rem; }

.todo-item { display: grid; grid-template-columns: auto 1fr; gap: .7rem; border: 1px solid var(--line); border-radius: 14px; background: #fff; padding: .85rem; }
.todo-item--done { opacity: .7; }
.todo-item--done h3 { text-decoration: line-through; }
.todo-check { width: 42px; height: 42px; margin: 0; border: 2px solid #aab5c7; border-radius: 12px; background: #fff; color: #fff; cursor: pointer; }
.todo-item--done .todo-check { border-color: var(--success); background: var(--success); }
.todo-main { min-width: 0; }
.todo-main h3 { margin: 0; }
.todo-actions { display: flex; flex-wrap: wrap; gap: .45rem; margin-top: .65rem; }

.calendar-count { display: grid; place-items: center; min-width: 30px; height: 30px; border-radius: 999px; background: var(--blue-soft); color: var(--blue-dark); font-size: .8rem; font-weight: 850; }
.calendar-list { display: grid; gap: .65rem; margin: 0; padding: 0; list-style: none; }
.calendar-item { display: grid; grid-template-columns: minmax(72px, 88px) minmax(0, 1fr) 16px; align-items: center; gap: .75rem; border: 1px solid var(--line); border-radius: 14px; background: #fff; padding: .8rem; color: var(--ink); text-decoration: none; }
.calendar-item:hover { border-color: #9db8f3; background: #fbfdff; }
.calendar-item time { display: grid; gap: .12rem; border-right: 1px solid var(--line); padding-right: .65rem; color: var(--blue-dark); }
.calendar-item time strong { font-size: .88rem; }
.calendar-item time span { color: var(--muted); font-size: .78rem; }
.calendar-item p { margin: 0 0 .35rem; }
.calendar-item__arrow { color: var(--muted); font-size: 1.45rem; }
.calendar-list--past { opacity: .78; }
.calendar-list--compact .calendar-item { border: 0; border-bottom: 1px solid var(--line); border-radius: 0; padding-inline: 0; }
.calendar-list--compact li:last-child .calendar-item { border-bottom: 0; }
.calendar-past > summary { display: flex; align-items: center; justify-content: space-between; cursor: pointer; }
.calendar-form { border-color: #bfd1f7; }

.notification-list { display: grid; gap: .65rem; margin: 0; padding: 0; list-style: none; }
.notification-item { border: 1px solid var(--line); border-radius: 14px; background: #fff; overflow: hidden; }
.notification-item--unread { border-color: #9db8f3; background: var(--blue-soft); }
.notification-item form { margin: 0; }
.notification-item button { display: grid; grid-template-columns: 10px minmax(0, 1fr) 16px; align-items: center; gap: .75rem; width: 100%; border: 0; background: transparent; padding: .9rem; color: var(--ink); text-align: left; cursor: pointer; }
.notification-item button:hover { background: rgba(255,255,255,.55); }
.notification-dot { width: 9px; height: 9px; border-radius: 50%; background: #bdc6d4; }
.notification-item--unread .notification-dot { background: var(--blue); box-shadow: 0 0 0 4px rgba(21,94,239,.12); }
.notification-content { display: grid; gap: .18rem; min-width: 0; }
.notification-content > span { overflow-wrap: anywhere; }
.notification-content time { color: var(--muted); font-size: .78rem; }
.notification-arrow { color: var(--muted); font-size: 1.45rem; }

.contact-card { border: 1px solid var(--line); border-radius: 15px; background: #fff; box-shadow: 0 5px 18px rgba(23,32,51,.05); padding: .9rem; }
.contact-card--archived { opacity: .72; }
.contact-card__top { display: grid; grid-template-columns: 46px minmax(0, 1fr) auto; align-items: center; gap: .75rem; }
.contact-avatar { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 14px; background: var(--blue-soft); color: var(--blue-dark); font-weight: 850; }
.contact-card h2 { margin: 0; font-size: 1.03rem; }
.contact-card h2 a { color: var(--ink); text-decoration: none; }
.contact-card__subtitle { margin: .12rem 0 0; color: var(--muted); font-size: .84rem; overflow-wrap: anywhere; }
.contact-actions { display: flex; flex-wrap: wrap; gap: .45rem; margin-top: .75rem; }
.contact-status { border-radius: 999px; padding: .25rem .5rem; background: #eef2f7; color: var(--muted); font-size: .72rem; font-weight: 750; }
.contact-status--active { background: var(--success-soft); color: var(--success); }
.address-lines { white-space: pre-line; }

.discussion-section { border-color: #d9cdf4; }
.discussion-section > .card__header { align-items: flex-start; flex-wrap: wrap; background: linear-gradient(180deg, var(--purple-soft), #fff); border-radius: var(--radius) var(--radius) 0 0; padding-bottom: .8rem; }
.discussion-section > .card__header h2 { margin-bottom: .25rem; }
.discussion-list { display: grid; gap: .9rem; }
.discussion-note { border: 1px solid #d9cdf4; border-left: 5px solid var(--purple); border-radius: 14px; background: #fff; padding: .9rem; }
.discussion-note__top { display: flex; align-items: flex-start; flex-wrap: wrap; justify-content: space-between; gap: .7rem; }
.discussion-note__top h3 { margin: .45rem 0 0; }
.discussion-note__content { margin-top: .8rem; }
.discussion-history { margin-top: .75rem; border-top: 1px solid #e6def7; padding-top: .65rem; }
.discussion-history > summary { color: var(--purple-dark); font-size: .84rem; font-weight: 750; }
.discussion-history .timeline { margin-top: .8rem; }
.discussion-form { border-color: #d9cdf4; }
.empty--compact { padding: 1.2rem .8rem; }
.empty--compact h3 { color: var(--ink); }

.filters { display: grid; gap: .7rem; padding: .85rem; }
.search-box { position: relative; }
.search-box svg { position: absolute; top: 15px; left: .8rem; width: 20px; height: 20px; fill: none; stroke: var(--muted); stroke-width: 2; }
.search-box input { padding-left: 2.55rem; }
.filter-grid { display: grid; gap: .65rem; }
.activity-filter-grid { display: grid; gap: .65rem; }

.flash { display: flex; align-items: flex-start; justify-content: space-between; gap: .75rem; margin: 0 0 1rem; border: 1px solid; border-radius: 13px; padding: .8rem .9rem; }
.flash--success { border-color: #addbc5; background: var(--success-soft); color: #0e603b; }
.flash--error { border-color: #f0b8bd; background: var(--danger-soft); color: #98202a; }
.flash--info { border-color: #bed0fa; background: var(--blue-soft); color: #103f9b; }
.flash button { min-width: 32px; min-height: 32px; border: 0; background: transparent; color: currentColor; font-size: 1.2rem; cursor: pointer; }

.empty { border: 1px dashed #b9c4d4; border-radius: var(--radius); padding: 2rem 1rem; text-align: center; color: var(--muted); }
.empty svg { width: 48px; height: 48px; margin: 0 auto .8rem; fill: none; stroke: #91a0b7; stroke-width: 1.6; }
.empty h2 { color: var(--ink); }

.detail-hero { border-left: 7px solid var(--severity-color); }
.detail-grid { display: grid; gap: 1rem; }
.detail-label { margin: 0 0 .15rem; color: var(--muted); font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.prose { white-space: pre-wrap; overflow-wrap: anywhere; }
.timeline { position: relative; margin: 0; padding: 0 0 0 1.5rem; list-style: none; }
.timeline::before { position: absolute; top: .4rem; bottom: .4rem; left: .38rem; width: 2px; background: var(--line); content: ""; }
.timeline li { position: relative; padding: 0 0 1rem; }
.timeline li::before { position: absolute; top: .28rem; left: -1.48rem; width: 11px; height: 11px; border: 3px solid #fff; border-radius: 50%; background: var(--blue); box-shadow: 0 0 0 2px #a9c0f5; content: ""; }
.timeline li:last-child { padding-bottom: 0; }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { padding: .7rem .75rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { background: #f6f8fc; color: #47536a; font-size: .76rem; text-transform: uppercase; letter-spacing: .03em; }
tr:last-child td { border-bottom: 0; }

.pagination { display: flex; align-items: center; justify-content: center; gap: .65rem; margin-top: 1rem; }
.pagination__text { color: var(--muted); font-size: .84rem; }

.privacy-badge { display: inline-flex; align-items: center; border: 1px solid #d9cdf4; border-radius: 999px; padding: .35rem .65rem; background: var(--purple-soft); color: var(--purple-dark); font-size: .78rem; font-weight: 800; }
.activity-stats { grid-template-columns: 1fr; }
.stat__number--text { font-size: 1.03rem; line-height: 1.25; }
.activity-list { display: grid; gap: .65rem; margin: 1rem 0 0; padding: 0; list-style: none; }
.activity-item { display: grid; grid-template-columns: 14px minmax(0, 1fr); gap: .7rem; border: 1px solid var(--line); border-radius: 14px; background: #fff; padding: .8rem; }
.activity-marker { width: 12px; height: 12px; margin-top: .3rem; border: 3px solid #fff; border-radius: 50%; background: var(--blue); box-shadow: 0 0 0 2px #a9c0f5; }
.activity-item--login .activity-marker { background: var(--success); box-shadow: 0 0 0 2px #a7d8c1; }
.activity-item--change .activity-marker { background: var(--purple); box-shadow: 0 0 0 2px #cbb9ec; }
.activity-item--security .activity-marker { background: var(--danger); box-shadow: 0 0 0 2px #efb4b9; }
.activity-main { min-width: 0; }
.activity-main p { margin: .25rem 0 0; font-weight: 680; }
.activity-top { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .25rem .7rem; }
.activity-top time { color: var(--muted); font-size: .78rem; }
.activity-target { margin-top: .3rem; color: var(--muted); font-size: .82rem; overflow-wrap: anywhere; }

.visit-clock { border-color: #b9c9e8; background: linear-gradient(155deg, #fff, var(--blue-soft)); }
.visit-clock--active { border-color: #8bc8aa; background: linear-gradient(155deg, #fff, var(--success-soft)); }
.visit-clock h2 { margin-top: .75rem; }
.visit-clock p { color: var(--muted); }
.visit-status { display: inline-flex; align-items: center; gap: .42rem; border-radius: 999px; padding: .32rem .62rem; background: var(--success-soft); color: var(--success); font-size: .78rem; font-weight: 820; }
.visit-status span { width: 9px; height: 9px; border-radius: 50%; background: currentColor; }
.visit-status--idle { background: #eef2f7; color: var(--muted); }
.visit-button { min-height: 58px; font-size: 1.05rem; }
.visit-list { display: grid; gap: .65rem; margin: 0; padding: 0; list-style: none; }
.visit-item { display: grid; grid-template-columns: minmax(82px, 100px) minmax(0, 1fr); align-items: center; gap: .8rem; border: 1px solid var(--line); border-radius: 14px; padding: .85rem; }
.visit-item--active { border-color: #8bc8aa; background: var(--success-soft); }
.visit-item time { display: grid; gap: .1rem; border-right: 1px solid var(--line); padding-right: .7rem; color: var(--blue-dark); }
.visit-item time strong { font-size: .85rem; }
.visit-item time span { color: var(--muted); font-size: .78rem; }

.auth-page { display: grid; min-height: 100vh; place-items: center; padding: 1rem; background: radial-gradient(circle at top, #e5edff 0, var(--canvas) 48%); }
.auth-card { width: min(100%, 430px); border: 1px solid var(--line); border-radius: 24px; background: #fff; box-shadow: 0 18px 55px rgba(23,32,51,.13); padding: 1.25rem; }
.auth-logo { width: 58px; height: 58px; margin-bottom: 1rem; border-radius: 16px; }
.auth-card__intro { margin-bottom: 1.15rem; color: var(--muted); }
.auth-footer { margin: 1rem 0 0; color: var(--muted); font-size: .78rem; text-align: center; }

.install-progress { display: flex; align-items: center; gap: .4rem; margin-bottom: 1rem; color: var(--muted); font-size: .82rem; }
.install-progress span { height: 5px; flex: 1; border-radius: 99px; background: var(--line); }
.install-progress span.is-active { background: var(--blue); }
.requirements { margin: 0; padding: 0; list-style: none; }
.requirements li { display: flex; justify-content: space-between; gap: .5rem; padding: .45rem 0; border-bottom: 1px solid var(--line); }
.requirements li:last-child { border: 0; }
.status-ok { color: var(--success); font-weight: 780; }
.status-bad { color: var(--danger); font-weight: 780; }

.settings-nav { display: grid; gap: .5rem; margin-bottom: 1rem; }
.settings-nav a { display: flex; align-items: center; justify-content: space-between; border: 1px solid var(--line); border-radius: 12px; background: #fff; padding: .8rem; color: var(--ink); font-weight: 700; text-decoration: none; }
.settings-nav a[aria-current="page"] { border-color: #9db8f3; background: var(--blue-soft); color: var(--blue-dark); }
.file-upload { border: 2px dashed #b5c1d2; border-radius: 14px; background: #f9fbfe; padding: 1rem; }
.code { border-radius: 10px; background: #172033; color: #eff4ff; padding: .75rem; overflow-wrap: anywhere; font: .8rem/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; }
.app-footer { display: flex; flex-wrap: wrap; justify-content: center; gap: .25rem .45rem; color: var(--muted); font-size: .75rem; text-align: center; margin: 1.3rem 0 0; }
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.mobile-only { display: initial; }

@media (min-width: 680px) {
  .page { padding: 1.5rem 1.5rem 3rem; }
  .topbar__inner { padding-inline: 1.5rem; }
  .brand__text { max-width: 53vw; }
  .bottom-nav { position: sticky; top: 64px; bottom: auto; border-top: 0; border-bottom: 1px solid var(--line); }
  .bottom-nav__inner { width: min(100%, 1040px); grid-template-columns: repeat(6, max-content); justify-content: start; gap: .25rem; padding: 0 1.5rem; }
  .bottom-nav a { grid-template-columns: 22px auto; min-height: 49px; padding: .55rem .8rem; border-bottom: 3px solid transparent; font-size: .84rem; }
  .bottom-nav a[aria-current="page"] { border-bottom-color: var(--blue); }
  .stats { grid-template-columns: repeat(4, 1fr); }
  .field-row { grid-template-columns: repeat(2, 1fr); }
  .severity-grid { grid-template-columns: repeat(2, 1fr); }
  .checkbox-grid { grid-template-columns: repeat(2, 1fr); }
  .form-actions { flex-direction: row; justify-content: flex-end; }
  .form-actions .button { width: auto; }
  .filter-grid { grid-template-columns: repeat(3, 1fr); }
  .activity-filter-grid { grid-template-columns: repeat(2, 1fr); }
  .activity-stats { grid-template-columns: repeat(3, 1fr); }
  .detail-grid { grid-template-columns: repeat(2, 1fr); }
  .settings-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); align-items: start; gap: 1rem; }
  .settings-nav { position: sticky; top: 130px; margin: 0; }
  .mobile-only { display: none; }
  .card__body, .form-section { padding: 1.2rem; }
  .button--small { min-height: 38px; }
}

@media (max-width: 360px) {
  .bottom-nav a { font-size: .61rem; }
  .bottom-nav svg { width: 21px; height: 21px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}

@media print {
  .topbar, .bottom-nav, .heading-actions, .form-actions, .button, .filters { display: none !important; }
  body, html { background: #fff; }
  .page { padding: 0; }
  .card, .event-card { break-inside: avoid; box-shadow: none; }
}
