/* Mobile-first styles for the Sejde z očí web app (Concept Hnedá). */
@import url("https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:wght@400;500;600;700&display=swap");

:root {
  --bg: #150e09;
  --canvas-start: #150e09;
  --canvas-end: #261d17;
  --surface: rgba(255, 255, 255, 0.12);
  --surface-solid: #2a211b;
  --field: rgba(255, 255, 255, 0.1);
  --inset: rgba(255, 255, 255, 0.1);
  --subtle: rgba(255, 255, 255, 0.05);
  --nav: rgba(255, 255, 255, 0.1);
  --nav-active: rgba(255, 255, 255, 0.16);
  --overlay: #241c16;
  --border: rgba(255, 255, 255, 0.5);
  --border-subtle: rgba(255, 255, 255, 0.12);
  --text: #ffffff;
  --text-muted: #eae3df;
  --text-disabled: rgba(255, 255, 255, 0.5);
  --accent: #f9b186;
  --accent-hover: #f4a274;
  --on-accent: #150e09;
  --accent-rgb: 249, 177, 134;
  --danger: #fe3434;
  --danger-text: #fa6b6b;
  --success: #10bc4f;
  --radius: 14px;
  --radius-card: 24px;
  --touch-min: 48px;
  --readonly-bg: rgba(255, 255, 255, 0.06);
  --table-header-bg: rgba(255, 255, 255, 0.06);
  --subtle-highlight: rgba(255, 255, 255, 0.06);
  --swatch-edge: rgba(255, 255, 255, 0.25);
  --interval-hour-line: rgba(255, 255, 255, 0.5);
  --day-toggle-bg: rgba(255, 255, 255, 0.08);
  --summary-panel-bg: rgba(255, 255, 255, 0.06);
  --shadow-toast: 0 6px 28px rgba(0, 0, 0, 0.45);
  --shadow-panel: -8px 0 32px rgba(0, 0, 0, 0.35);
  --shadow-dropdown: 0 8px 24px rgba(0, 0, 0, 0.4);
  --shadow-modal: 0 -8px 32px rgba(0, 0, 0, 0.35);
  --modal-backdrop: rgba(21, 14, 9, 0.5);
  --menu-backdrop: rgba(21, 14, 9, 0.5);
  --control-off: rgba(255, 255, 255, 0.25);
  --action-secondary: rgba(255, 255, 255, 0.15);
  --on-action-primary: #ffffff;
  --action-primary: #ffffff;
  color-scheme: dark;
}

html[data-theme="light"] {
  color-scheme: light;
  --bg: #eae3df;
  --canvas-start: #eae3df;
  --canvas-end: #ddd6d1;
  --surface: #ffffff;
  --surface-solid: #ffffff;
  --field: #ffffff;
  --inset: #f4f0ed;
  --subtle: rgba(244, 240, 237, 0.6);
  --nav: #ffffff;
  --nav-active: #f4f0ed;
  --overlay: #ffffff;
  --border: #928a85;
  --border-subtle: #eae3df;
  --text: #150e09;
  --text-muted: #58514c;
  --text-disabled: #928a85;
  --accent: #f9b186;
  --accent-hover: #f4a274;
  --on-accent: #150e09;
  --accent-rgb: 249, 177, 134;
  --danger: #dc2626;
  --danger-text: #ac1a1c;
  --success: #0ca445;
  --readonly-bg: rgba(21, 14, 9, 0.04);
  --table-header-bg: rgba(21, 14, 9, 0.04);
  --subtle-highlight: rgba(21, 14, 9, 0.05);
  --swatch-edge: rgba(21, 14, 9, 0.2);
  --interval-hour-line: rgba(21, 14, 9, 0.12);
  --day-toggle-bg: rgba(21, 14, 9, 0.06);
  --summary-panel-bg: rgba(21, 14, 9, 0.04);
  --shadow-toast: 0 6px 28px rgba(21, 14, 9, 0.12);
  --shadow-panel: -8px 0 32px rgba(21, 14, 9, 0.12);
  --shadow-dropdown: 0 8px 24px rgba(21, 14, 9, 0.12);
  --shadow-modal: 0 -8px 32px rgba(21, 14, 9, 0.12);
  --modal-backdrop: rgba(21, 14, 9, 0.5);
  --menu-backdrop: rgba(21, 14, 9, 0.5);
  --control-off: #c4bcb7;
  --action-secondary: #f4f0ed;
  --on-action-primary: #ffffff;
  --action-primary: #150e09;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  font-family: "Bricolage Grotesque", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.4;
  background: linear-gradient(137deg, var(--canvas-start) 8%, var(--canvas-end) 46%, var(--canvas-end) 85%);
  background-attachment: fixed;
  color: var(--text);
  min-height: 100vh;
  -webkit-tap-highlight-color: transparent;
}

.container {
  max-width: 390px;
  margin: 0 auto;
  padding: 24px 20px 40px;
}

.container--wide {
  max-width: 720px;
}

.events-container,
.report-container,
.activation-container,
.all-nodes-container,
.container:has(.interval-editor) {
  max-width: 960px;
}

body:has(.container--wide) .nav {
  max-width: min(720px, 100%);
}

body:has(.events-container) .nav,
body:has(.report-container) .nav,
body:has(.activation-container) .nav,
body:has(.all-nodes-container) .nav,
body:has(.interval-editor) .nav {
  max-width: min(960px, 100%);
}

h1 {
  font-size: 30px;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.4px;
  margin: 0 0 16px;
  text-align: left;
}

.form-group {
  margin-bottom: 16px;
}

label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--text);
  margin-bottom: 8px;
}

input, select, textarea {
  width: 100%;
  padding: 12px 16px;
  font-family: inherit;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.5;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--field);
  color: var(--text);
  min-height: var(--touch-min);
}

select {
  scrollbar-width: none;
  -ms-overflow-style: none;
  color-scheme: dark;
}
select::-webkit-scrollbar {
  display: none;
}
select option,
select optgroup {
  background-color: #2a211b;
  color: #ffffff;
  font-weight: 600;
}
html[data-theme="light"] select {
  color-scheme: light;
}
html[data-theme="light"] select option,
html[data-theme="light"] select optgroup {
  background-color: #ffffff;
  color: #150e09;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  border-width: 1.5px;
  box-shadow: none;
}

input::placeholder {
  color: var(--text-muted);
  font-weight: 400;
}

input.readonly-field,
input[readonly] {
  background: var(--readonly-bg);
  color: var(--text-muted);
  cursor: default;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px 20px;
  font-family: inherit;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.3;
  text-align: center;
  text-decoration: none;
  border: none;
  border-radius: 9999px;
  cursor: pointer;
  min-height: 56px;
  transition: background 0.2s, color 0.2s;
}

.btn-primary {
  background: var(--accent);
  color: var(--on-accent);
}

.btn-primary:hover, .btn-primary:focus {
  background: var(--accent-hover);
}
.btn-primary img,
.tabbar__add.is-accent img {
  filter: brightness(0);
}

.btn-secondary {
  background: var(--action-secondary);
  color: var(--text);
  border: 1px solid transparent;
}

.btn-secondary:hover {
  background: var(--border);
}

.pair-choice-buttons {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 24px;
}
.pair-choice-buttons .pair-choice-btn {
  margin: 0;
}
.link-back {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.875rem;
  display: inline-block;
  margin-bottom: 16px;
}
.link-back:hover {
  color: var(--accent);
}

.btn-danger {
  background: var(--danger);
  color: #fff;
}

.btn-danger:hover {
  background: #da3633;
}

.btn-small {
  min-height: 40px;
  padding: 8px 14px;
  font-size: 0.875rem;
  width: auto;
}

.links {
  text-align: center;
  margin-top: 24px;
  font-size: 0.9375rem;
}

.links a {
  color: var(--accent);
  text-decoration: none;
}

.links a:hover {
  text-decoration: underline;
}

.links span {
  color: var(--text-muted);
  margin: 0 8px;
}

.error-msg {
  color: var(--danger);
  font-size: 0.875rem;
  margin-top: 8px;
}

.success-msg {
  color: var(--success);
  font-size: 0.875rem;
  margin-top: 8px;
}

/* Toasts (e.g. profile saved feedback) */
.toast-stack {
  position: fixed;
  left: 50%;
  bottom: max(24px, env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  z-index: 2000;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
  max-width: min(420px, calc(100vw - 32px));
}
.toast {
  pointer-events: auto;
  padding: 12px 18px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-toast);
  font-size: 0.9375rem;
  line-height: 1.4;
  color: var(--text);
  text-align: center;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.28s ease, transform 0.28s ease;
}
.toast--visible {
  opacity: 1;
  transform: translateY(0);
}
.toast--success {
  border-left: 4px solid var(--success);
}
.toast--error {
  border-left: 4px solid var(--danger);
  color: var(--danger);
}

/* Nav */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px 12px;
  flex-wrap: wrap;
  width: 100%;
  max-width: min(390px, 100%);
  margin: 0 auto 8px;
  padding: 16px 20px;
  background: transparent;
  border-bottom: none;
}

.nav > a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
  white-space: nowrap;
  flex: none;
}

.nav a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}

.nav .nav-title-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.nav .title {
  font-weight: 600;
  color: var(--text);
}

.nav .nav-status {
  font-size: 0.75rem;
}

.nav .nav-status .badge {
  margin-left: 0;
}

.nav .title,
.nav .nav-title-block {
  min-width: 0;
  flex: 0 1 auto;
}

.nav .title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav .nav-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  margin-left: auto;
  flex: 1 1 16rem;
  flex-wrap: wrap;
  gap: 8px;
  min-width: min(100%, 16rem);
}

.nav .nav-actions .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  flex: none;
  height: auto;
  min-height: 36px;
  padding: 6px 14px;
  font-size: 0.875rem;
  line-height: 1.2;
  white-space: nowrap;
}

.nav .nav-actions .btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.nav-menu-btn {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  min-height: 40px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  cursor: pointer;
  flex-shrink: 0;
}

.nav-menu-btn:hover,
.nav-menu-btn:focus-visible {
  border-color: var(--accent);
  outline: none;
}

.nav-menu-bar {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--text);
  border-radius: 1px;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  min-height: 40px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
  flex-shrink: 0;
}

.theme-toggle:hover,
.theme-toggle:focus-visible {
  border-color: var(--accent);
  outline: none;
}

.theme-toggle svg {
  display: block;
}

.theme-toggle__icon {
  display: flex;
  align-items: center;
  justify-content: center;
}

html[data-theme="dark"] .theme-toggle__icon--moon,
html[data-theme="light"] .theme-toggle__icon--sun {
  display: none;
}

.theme-toggle--floating {
  position: fixed;
  top: max(12px, env(safe-area-inset-top, 0px));
  right: max(12px, env(safe-area-inset-right, 0px));
  z-index: 300;
}

.app-menu-backdrop {
  position: fixed;
  inset: 0;
  z-index: 450;
  background: var(--menu-backdrop);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.app-menu-backdrop.is-open {
  opacity: 1;
  visibility: visible;
}

.app-menu-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 460;
  width: min(132px, 46vw);
  max-width: 100%;
  background: var(--surface);
  border-left: 1px solid var(--border);
  box-shadow: var(--shadow-panel);
  transform: translateX(100%);
  transition: transform 0.25s ease;
  display: flex;
  flex-direction: column;
  padding: 12px 10px 18px;
  box-sizing: border-box;
}

.app-menu-panel.is-open {
  transform: translateX(0);
}

.app-menu-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 6px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.app-menu-title {
  font-weight: 600;
  font-size: 0.8125rem;
  line-height: 1.2;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-menu-close {
  width: 36px;
  height: 36px;
  min-height: 36px;
  flex-shrink: 0;
  padding: 0;
  border: none;
  border-radius: var(--radius);
  background: transparent;
  color: var(--text-muted);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
}

.app-menu-close:hover,
.app-menu-close:focus-visible {
  color: var(--text);
  outline: none;
  background: var(--subtle-highlight);
}

.app-menu-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.app-menu-list li {
  border-bottom: 1px solid var(--border);
}

.app-menu-list li:last-child {
  border-bottom: none;
}

.app-menu-link {
  display: block;
  width: 100%;
  padding: 16px 4px;
  color: var(--text);
  text-decoration: none;
  font: inherit;
  font-size: 1rem;
  text-align: left;
  background: none;
  border: none;
  cursor: pointer;
  box-sizing: border-box;
}

.app-menu-link:hover,
.app-menu-link:focus-visible {
  color: var(--accent);
  outline: none;
}

.app-menu-profile-item {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px 0 10px;
}

.app-menu-profile-item .app-menu-profile.theme-toggle {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  text-decoration: none;
}

.app-menu-profile.theme-toggle:hover,
.app-menu-profile.theme-toggle:focus-visible {
  border-color: var(--accent);
  color: var(--accent);
  outline: none;
}

.app-menu-activation-item,
.app-menu-all-nodes-item {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px 0 10px;
}

.app-menu-activation-item .app-menu-activation.theme-toggle,
.app-menu-all-nodes-item .app-menu-all-nodes.theme-toggle {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  text-decoration: none;
}

.app-menu-activation.theme-toggle:hover,
.app-menu-activation.theme-toggle:focus-visible,
.app-menu-all-nodes.theme-toggle:hover,
.app-menu-all-nodes.theme-toggle:focus-visible {
  border-color: var(--accent);
  color: var(--accent);
  outline: none;
}

.app-menu-theme-item {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px 0 10px;
}

.app-menu-theme-item .app-menu-theme.theme-toggle {
  margin: 0;
  background: var(--bg);
}

.app-menu-logout-item {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px 0 0;
}

.app-menu-logout-item .app-menu-logout.theme-toggle {
  margin: 0;
  background: var(--bg);
  color: var(--danger);
}

.app-menu-logout.theme-toggle:hover,
.app-menu-logout.theme-toggle:focus-visible {
  border-color: var(--danger);
  color: #ff7b72;
  outline: none;
}

.profile-value {
  margin: 0;
  padding: 14px 16px;
  font-size: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--readonly-bg);
  color: var(--text);
  word-break: break-all;
}

/* Lists */
.list-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.list-header h2 {
  font-size: 1.25rem;
  margin: 0;
}

.card-list {
  list-style: none;
  padding: 0;
  margin: 0 0 32px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
}

.card-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.card-actions .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  flex: 1;
  min-width: 80px;
}

.node-devices {
  margin-top: 10px;
  font-size: 0.875rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
}

/* Device badges live here; override global .badge margin-left: 8px */
.node-devices .badge {
  margin-left: 0;
}

.device-status-connected {
  color: var(--success);
}

.device-status-disconnected {
  color: var(--danger);
}

.badge-device-connected {
  background: rgba(63, 185, 80, 0.2);
  color: var(--success);
}

.badge-device-disconnected {
  background: rgba(248, 81, 73, 0.2);
  color: var(--danger);
}

.badge {
  display: inline-block;
  padding: 4px 10px;
  font-size: 0.75rem;
  border-radius: 999px;
  margin-left: 8px;
}

.badge-online,
.badge-sentinel-offline {
  background: rgba(63, 185, 80, 0.2);
  color: var(--success);
}

.badge-offline,
.badge-busy {
  background: rgba(248, 81, 73, 0.2);
  color: var(--danger);
}

.badge-allowance {
  background: rgba(63, 185, 80, 0.2);
  color: var(--success);
}

.badge-penalty {
  background: rgba(236, 72, 153, 0.22);
  color: #ec4899;
}

.badge-lock-override {
  background: rgba(139, 92, 246, 0.22);
  color: #8b5cf6;
}

.child-temp-block-row {
  margin: 8px 0 0;
}

.badge-temp-block {
  margin-left: 0;
  white-space: normal;
  line-height: 1.35;
}

/* Dashboard: node drawer open/closed (SVG uses currentColor) */
.node-drawer-indicator {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-right: 6px;
  vertical-align: -3px;
}

.node-drawer-indicator svg {
  display: block;
}

.node-drawer-indicator--open {
  color: var(--danger);
}

.node-drawer-indicator--closed {
  color: var(--text-muted);
  opacity: 0.85;
}

.node-drawer-indicator--unknown {
  color: var(--text-muted);
  opacity: 0.85;
}

.child-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.policy-shield-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--text-muted);
  text-decoration: none;
  border-radius: var(--radius);
  padding: 4px;
  margin: -4px;
  transition: color 0.15s ease, background-color 0.15s ease;
}

.policy-shield-link:hover,
.policy-shield-link:focus-visible {
  color: var(--accent);
  background: rgba(var(--accent-rgb), 0.12);
}

.policy-shield-link svg {
  display: block;
}

.child-card-icons {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.report-icon-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--text-muted);
  text-decoration: none;
  border-radius: var(--radius);
  padding: 4px;
  margin: -4px;
  transition: color 0.15s ease, background-color 0.15s ease;
}

.report-icon-link:hover,
.report-icon-link:focus-visible {
  color: var(--accent);
  background: rgba(var(--accent-rgb), 0.12);
}

.report-icon-link svg {
  display: block;
}

table.data-table tr.report-col-help th {
  font-weight: 400;
  text-transform: none;
  letter-spacing: normal;
  vertical-align: top;
  border-bottom-width: 2px;
}

table.data-table .col-help-text {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.75rem;
  line-height: 1.45;
  font-weight: 400;
  text-transform: none;
  letter-spacing: normal;
}

.section {
  margin-bottom: 32px;
}

.section h2 {
  font-size: 1.125rem;
  color: var(--text-muted);
  margin: 0 0 12px;
}

.empty {
  color: var(--text-muted);
  text-align: center;
  padding: 24px;
}

/* Detail page */
.detail-row {
  margin-bottom: 16px;
}

.detail-row label {
  margin-bottom: 4px;
}

.sub-list {
  list-style: none;
  padding: 0;
  margin: 8px 0 0;
}

.sub-list li {
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}

.sub-list li:last-child {
  border-bottom: none;
}

/* Data tables */
.data-table-section {
  margin-bottom: 32px;
}

.data-table-section h2 {
  font-size: 1.125rem;
  color: var(--text-muted);
  margin: 0 0 12px;
  font-weight: 600;
}

.data-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

table.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
}

table.data-table th,
table.data-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

table.data-table th {
  font-weight: 600;
  color: var(--text-muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--table-header-bg);
}

table.data-table tr:last-child td {
  border-bottom: none;
}

table.data-table tbody tr:hover td {
  background: rgba(var(--accent-rgb), 0.06);
}

table.data-table td a {
  color: var(--accent);
  text-decoration: none;
}

table.data-table td a:hover {
  text-decoration: underline;
}

table.data-table .empty-row td {
  color: var(--text-muted);
  font-style: italic;
  text-align: center;
  padding: 20px;
}

table.data-table .empty-row:hover td {
  background: var(--surface);
}

/* Center status badge (span.badge) inside table cell */
table.data-table td:has(> .badge) {
  text-align: center;
  vertical-align: middle;
}

/* Center Status column header (child.html: policies + nodes tables) */
#policiesTable th:nth-child(2),
#nodesTable th:nth-child(3) {
  text-align: center;
}

table.data-table .badge {
  display: inline-block;
  padding: 4px 10px;
  font-size: 0.75rem;
  border-radius: 999px;
  margin: 0;
}

/* Keep action buttons (e.g. Rename, Unregister) on one line */
table.data-table td.cell-actions-nowrap {
  white-space: nowrap;
}

.device-descriptor-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.device-descriptor-block {
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--summary-panel-bg);
  font-size: 0.8125rem;
  line-height: 1.4;
}

.device-descriptor-block + .device-descriptor-block {
  margin-top: 0;
}

.device-descriptor-identifiers {
  color: var(--text-muted);
  word-break: break-word;
}

.device-group-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.device-merge-target-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.device-merge-target-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
}

.device-merge-target-option:has(input:checked) {
  border-color: var(--accent);
  background: rgba(var(--accent-rgb), 0.12);
}

table.data-table td.cell-checkbox {
  width: 36px;
  text-align: center;
}

/* Login / signup note and one-time code (###-###) */
.reset-note {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.otp-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.otp-row input.otp-digit {
  width: auto;
  flex: 1 1 0;
  min-width: 0;
  max-width: 3rem;
  padding: 12px 0;
  text-align: center;
  font-size: 1.35rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.otp-dash {
  color: var(--text-muted);
  font-size: 1.35rem;
  font-weight: 600;
  line-height: 1;
  user-select: none;
}

.otp-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 16px;
  margin-top: 12px;
}

.otp-actions a {
  color: var(--accent);
  font-size: 0.875rem;
  text-decoration: none;
}

.otp-actions a:hover {
  text-decoration: underline;
}

/* Protection policy: weekday interval bars (15-min slots) */
.interval-editor {
  margin-top: 16px;
}
.interval-editor-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.interval-editor-toolbar-label {
  font-size: 0.875rem;
  color: var(--text-muted);
}
.interval-brush-dropdown {
  position: relative;
}
.interval-brush-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 8px 12px;
}
.interval-brush-btn .interval-brush-swatch {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  flex-shrink: 0;
  border: 1px solid var(--swatch-edge);
}
.interval-brush-chevron {
  font-size: 0.625rem;
  opacity: 0.8;
  margin-left: 2px;
}
.interval-brush-dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 4px;
  min-width: 180px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-dropdown);
  z-index: 50;
  padding: 4px 0;
}
.interval-brush-dropdown-menu[aria-hidden="true"] {
  display: none !important;
}
.interval-brush-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  font-size: 0.9375rem;
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  color: var(--text);
}
.interval-brush-option:hover,
.interval-brush-option:focus {
  background: rgba(var(--accent-rgb), 0.15);
  outline: none;
}
.interval-brush-option .swatch {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  flex-shrink: 0;
  border: 1px solid var(--swatch-edge);
}
.interval-editor-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
  margin-bottom: 12px;
  font-size: 0.8125rem;
  color: var(--text-muted);
}
.interval-editor-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.interval-editor-legend .swatch {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  flex-shrink: 0;
}
.swatch--quiet { background: #c53030; }
.swatch--accounted { background: #2b6cb0; }
.swatch--not-accounted { background: #276749; }
.interval-day-bars-wrap {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-bottom: 8px;
  position: relative;
  touch-action: pan-x pan-y pinch-zoom;
  user-select: none;
}
.interval-day-header-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}
.interval-day-header-spacer {
  flex-shrink: 0;
  width: 52px;
  padding-right: 6px;
  box-sizing: border-box;
}
.interval-day-header-cell {
  flex: 1;
  min-width: 0;
}
.interval-allowance-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}
.interval-allowance-label {
  flex-shrink: 0;
  width: 52px;
  padding-right: 6px;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
  text-align: right;
  box-sizing: border-box;
}
.interval-allowance-row .interval-allowance-wrap {
  flex: 1;
  min-width: 0;
  margin-bottom: 0;
}
.interval-allowance-wrap {
  width: 100%;
  margin-bottom: 6px;
  flex-shrink: 0;
}
.interval-allowance-select {
  width: 100%;
  min-width: 0;
  min-height: 32px;
  padding: 2px 4px;
  font-size: 0.50rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  box-sizing: border-box;
}
.interval-allowance-select:focus {
  outline: none;
  border-color: var(--accent);
}
.interval-allowance-select:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.interval-bars-row {
  display: flex;
  flex-direction: row;
  gap: 6px;
  align-items: flex-start;
  position: relative;
}
.interval-time-axis {
  flex-shrink: 0;
  width: 52px;
  padding-top: 0px;
  padding-right: 6px;
  box-sizing: border-box;
  touch-action: pan-x pan-y pinch-zoom;
}
.interval-time-axis-inner {
  position: relative;
  height: 576px;
  text-align: right;
  touch-action: pan-x pan-y pinch-zoom;
}
.interval-time-label {
  position: absolute;
  right: 0;
  transform: translateY(-50%);
  font-size: 0.6875rem;
  color: var(--text-muted);
  white-space: nowrap;
  touch-action: pan-x pan-y pinch-zoom;
}
.interval-hour-lines {
  position: absolute;
  left: 58px;
  right: 0;
  top: 0px;
  height: 576px;
  pointer-events: none;
  touch-action: none;
  z-index: 1;
}
.interval-hour-line {
  position: absolute;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--interval-hour-line);
  transform: translateZ(0);
}
.interval-current-time-line {
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: #805ad5;
  transform: translateY(-50%);
  z-index: 2;
  pointer-events: none;
}
.interval-day-column {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  min-width: 0;
  position: relative;
  z-index: 0;
  touch-action: none;
}
.interval-day-column .day-label,
.interval-day-header-row .day-label {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1;
  min-height: 36px;
  color: var(--text-muted);
  margin-bottom: 6px;
  flex-shrink: 0;
  box-sizing: border-box;
}
.interval-day-column .day-label.day-unlock-toggle,
.interval-day-header-row .day-label.day-unlock-toggle {
  display: flex;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--day-toggle-bg);
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px 5px;
  width: 100%;
  min-width: 0;
  overflow: hidden;
}
.interval-day-column .day-label .day-name,
.interval-day-header-row .day-label .day-name {
  line-height: 1;
  display: inline-block;
}
.interval-day-column .day-label .day-name.badge,
.interval-day-header-row .day-label .day-name.badge {
  margin-left: 0;
  padding: 0;
  background: none;
  border-radius: 0;
  color: var(--success);
}
.interval-day-column .day-label.day-unlock-toggle.is-unlocked,
.interval-day-header-row .day-label.day-unlock-toggle.is-unlocked {
  border-color: var(--accent);
  color: var(--text);
  background: rgba(var(--accent-rgb), 0.2);
}
.interval-day-column .day-label.day-unlock-toggle.is-locked,
.interval-day-header-row .day-label.day-unlock-toggle.is-locked {
  opacity: 0.88;
}
.interval-day-column .day-label.day-unlock-toggle:focus,
.interval-day-header-row .day-label.day-unlock-toggle:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgba(var(--accent-rgb), 0.3);
}
.day-unlock-state {
  position: relative;
  width: 10px;
  height: 12px;
  opacity: 0.92;
  flex-shrink: 0;
  margin-top: 1px;
}
.day-unlock-state::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 0;
  width: 7px;
  height: 6px;
  border: 1.4px solid currentColor;
  border-bottom: none;
  border-radius: 6px 6px 0 0;
  transform: translateX(-50%);
}
.day-unlock-state::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 7px;
  border: 1.4px solid currentColor;
  border-radius: 2px;
}
.day-unlock-state.is-unlocked::before {
  left: calc(50% + 2px);
}
.interval-day-bar {
  width: 100%;
  height: 576px;
  display: flex;
  flex-direction: column;
  min-width: 0;
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface);
  touch-action: none;
}
.interval-slot {
  flex: 1;
  min-height: 2px;
  cursor: pointer;
  transition: opacity 0.15s, filter 0.15s;
}
.interval-slot:hover {
  opacity: 0.9;
  filter: brightness(1.15);
}
.interval-slot:active {
  filter: brightness(1.3);
}
.interval-slot--quiet { background: #ae3314; }
.interval-slot--accounted { background: #4c9848; }
.interval-slot--not-accounted { background: #e59463; }
.interval-day-column--locked .interval-day-bar {
  opacity: 0.52;
  touch-action: pan-x pan-y pinch-zoom;
}
.interval-day-column--locked {
  touch-action: pan-x pan-y pinch-zoom;
}
.interval-day-column--locked .interval-slot {
  cursor: not-allowed;
}
.interval-editor-actions {
  margin-top: 16px;
  display: flex;
  gap: 10px;
  align-items: center;
}
.interval-editor-actions .error-msg { margin-top: 0; }

.interval-summary-wrap {
  margin-top: 20px;
  padding: 14px 16px;
  background: var(--summary-panel-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.interval-summary-label {
  display: block;
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.interval-summary {
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--text-muted);
  white-space: pre-wrap;
  word-break: break-word;
}

/* Modal (e.g. Bonus Time on dashboard) */
.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
}
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: var(--modal-backdrop);
  cursor: pointer;
}
.modal-dialog {
  position: relative;
  width: 100%;
  max-width: 430px;
  padding: 8px 20px 24px;
  background: var(--overlay);
  border: 1px solid var(--border-subtle);
  border-radius: 24px 24px 0 0;
  box-shadow: var(--shadow-modal);
}
.modal-dialog::before {
  content: "";
  display: block;
  width: 40px;
  height: 4px;
  margin: 4px auto 16px;
  border-radius: 999px;
  background: var(--control-off);
}
.modal-dialog h3 {
  margin: 0 0 8px;
  font-size: 26px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.2px;
}
.modal-desc {
  margin: 0 0 16px;
  font-size: 0.875rem;
  color: var(--text-muted);
}
.modal-dialog label {
  display: block;
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.modal-select {
  width: 100%;
  margin-bottom: 20px;
}
.modal-input {
  width: 100%;
  margin-bottom: 20px;
}
.modal-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}
.modal-actions .btn {
  width: auto;
  min-width: 100px;
}
.modal-actions .btn-start {
  margin-right: auto;
}

/* Stack modal buttons on narrow viewports so long labels (e.g. CS) fit */
@media (max-width: 480px) {
  .modal-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .modal-actions .btn {
    width: 100%;
    min-width: 0;
  }
  .modal-actions .btn-start {
    margin-right: 0;
  }
}

/* ---- Page boot & in-app navigation (MPA) -------------------------------- */

html.offliner-boot-pending {
  overflow: hidden;
}
html.offliner-boot-pending body {
  overflow: hidden;
  opacity: 0;
}

html.offliner-boot-pending::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 2147482647;
  background: var(--bg);
  pointer-events: none;
}

html.offliner-boot-pending::after {
  content: '';
  position: fixed;
  left: 50%;
  top: 50%;
  width: 40px;
  height: 40px;
  margin: -20px 0 0 -20px;
  z-index: 2147482648;
  border-radius: 50%;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  animation: offliner-boot-spin 0.65s linear infinite;
  pointer-events: none;
  box-sizing: border-box;
}

@keyframes offliner-boot-spin {
  to {
    transform: rotate(360deg);
  }
}

html.offliner-page-ready:not(.offliner-nav-leaving) body {
  opacity: 1;
  transition: opacity 0.32s ease-out;
}

html.offliner-nav-leaving body {
  opacity: 0;
  transition: opacity 0.2s ease-in;
}

@media (prefers-reduced-motion: reduce) {
  html.offliner-boot-pending::after {
    animation: none;
    border-top-color: var(--accent);
    opacity: 0.85;
  }
  html.offliner-page-ready:not(.offliner-nav-leaving) body,
  html.offliner-nav-leaving body {
    transition: none;
  }
}

/* ---- Concept Hnedá shell ------------------------------------------------ */

html[data-theme="light"] .icon-ink {
  filter: brightness(0);
}

.brand-logo {
  display: block;
  width: 85px;
  height: 64px;
  flex: none;
  object-fit: contain;
  object-position: center;
}
.brand-logo--header {
  width: 64px;
  height: 48px;
  object-position: left center;
}
.brand-logo--on-light {
  display: none;
}
html[data-theme="light"] .brand-logo--on-dark {
  display: none;
}
html[data-theme="light"] .brand-logo--on-light {
  display: block;
}

.auth-screen {
  height: 100dvh;
  min-height: 100dvh;
  overflow: hidden;
}
.auth-screen__inner {
  width: min(390px, 100%);
  height: 100%;
  min-height: 0;
  margin: 0 auto;
  padding: 16px 20px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow: hidden;
}
.auth-screen h1 {
  width: 100%;
  margin: 16px 0 0;
  text-align: center;
  font-size: 30px;
  flex: none;
}
.auth-screen.is-code h1 {
  text-align: left;
  font-size: 24px;
  letter-spacing: -0.2px;
  line-height: 1.2;
}
.auth-help {
  width: 100%;
  margin: 12px 0 0;
  flex: none;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.4;
  color: var(--text-muted);
}
.auth-screen.is-code .auth-help {
  margin-top: 8px;
}
.auth-form {
  width: 100%;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.auth-fields {
  margin: 16px 0 0;
  width: 100%;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
}
.auth-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: none;
  margin-top: auto;
  padding-top: 12px;
}
.btn-ghost {
  min-height: 44px;
  background: transparent;
  color: var(--text-muted);
  font-size: 15px;
}
.btn-ghost:hover {
  background: transparent;
  color: var(--text);
}
select.field-select {
  appearance: none;
  font-weight: 400;
  padding-right: 40px;
  background-image: url("../img/figma/icon-chevron-down.svg");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 20px 20px;
}
html[data-theme="light"] select.field-select {
  background-color: var(--field);
  background-image: url("../img/figma/icon-chevron-down-dark.svg");
}

.otp-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
.otp-digit {
  width: 48px;
  height: 52px;
  min-height: 52px;
  padding: 0;
  text-align: center;
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.3px;
  line-height: 1;
  border-radius: 14px;
  font-variant-numeric: tabular-nums;
}
.otp-digit:focus {
  border-width: 2px;
  border-color: var(--text);
}
.otp-dash {
  color: var(--text-disabled);
  font-size: 17px;
  font-weight: 600;
  padding: 0 2px;
}
.otp-resend {
  display: block;
  margin-top: 16px;
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
  text-decoration: none;
}
.auth-screen:not(.is-code) .code-only { display: none; }
.auth-screen.is-code .email-only { display: none; }
.auth-messages {
  width: 100%;
  margin-top: 12px;
}

.app-shell .phone {
  width: min(390px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: 24px 20px 128px;
  position: relative;
}
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
}
.icon-btn {
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 999px;
  background: var(--inset);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}
.icon-btn img { display: block; }

.screen-title {
  margin: 0 0 24px;
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.4px;
  line-height: 1.15;
}
.group-title {
  margin: 0 0 16px;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.2px;
  line-height: 1.2;
}

.list-row,
.section-card,
.schedule-card,
.drawer-card {
  background: var(--surface);
  border-radius: 20px;
}
.list-row {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 96px;
  padding: 16px;
  text-decoration: none;
  color: inherit;
  margin-bottom: 16px;
}
.list-row__icon,
.section-card__icon {
  width: 64px;
  height: 64px;
  border-radius: 999px;
  background: var(--subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
}
.list-row__title,
.section-card__title {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.2px;
  line-height: 1.2;
}
.section-card {
  padding: 16px;
  border-radius: 24px;
}
.section-card__head {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}
.section-card__text {
  margin: 0 0 20px;
  color: var(--text-muted);
  font-size: 15px;
  font-weight: 400;
  line-height: 1.4;
}

.home-list { display: flex; flex-direction: column; gap: 16px; }
.home-card {
  position: relative;
  display: flex;
  flex-direction: column;
  height: auto;
  min-height: 288px;
  padding: 0;
  overflow: hidden;
  background: transparent;
}
.home-card__top {
  position: relative;
  z-index: 1;
  display: flex;
  flex: none;
  height: 37px;
}
.home-card__tabs {
  position: relative;
  display: flex;
  align-items: stretch;
  max-width: calc(100% - 52px);
  height: 37px;
  background: var(--surface);
  border-top-left-radius: 24px;
}
.home-card__tabs::after {
  content: "";
  position: absolute;
  left: 100%;
  top: 0;
  width: 49px;
  height: 37px;
  background: var(--surface);
  clip-path: path("M0 0 C9.13 0 17.47 5.18 21.52 13.37 L26.59 23.63 C30.63 31.82 38.97 37 48.1 37 L0 37 Z");
}
.home-card__tab {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  height: 37px;
  margin: 0;
  padding: 0 14px 0 12px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
}
.home-card__tab:first-child { padding-left: 16px; }
.home-card__tab + .home-card__tab {
  border-left: 1px solid rgba(255, 255, 255, 0.16);
}
html[data-theme="light"] .home-card__tab + .home-card__tab {
  border-left-color: rgba(21, 14, 9, 0.12);
}
.home-card__tab-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.home-card__body {
  position: relative;
  flex: 1 0 auto;
  min-height: 0;
  padding: 16px 16px 96px;
  background: var(--surface);
  border-radius: 0 28px 28px 28px;
  overflow: hidden;
  -webkit-mask-image: radial-gradient(circle at 32px calc(100% - 32px), transparent 40px, #000 41px);
  mask-image: radial-gradient(circle at 32px calc(100% - 32px), transparent 40px, #000 41px);
}
.home-card--plain .home-card__body {
  border-radius: 28px;
}
.home-card--nodrawer { min-height: 0; }
.home-card--nodrawer .home-card__body {
  -webkit-mask-image: none;
  mask-image: none;
  border-radius: 28px;
  min-height: 0;
  padding-bottom: 16px;
}
.penalty-reset-box {
  margin: 0 0 16px;
  padding: 16px;
  border-radius: 12px;
  background: var(--subtle);
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.4;
}
.penalty-reset-notify {
  margin: 0 0 24px;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.4;
}
.btn-cancel-bypass {
  background: #f4f0ed;
  color: #150e09;
}
.btn-cancel-bypass:hover,
.btn-cancel-bypass:focus {
  background: #eae3df;
  color: #150e09;
}
.home-card__time.is-idle,
.home-card__time.is-idle strong { color: var(--text-muted); }
.nodrawer {
  margin-top: 16px;
  padding: 16px;
  border-radius: 14px;
  background: var(--inset);
}
.nodrawer__copy { display: flex; gap: 12px; align-items: flex-start; }
.nodrawer__copy img { flex: none; margin-top: 2px; }
.nodrawer__copy strong { display: block; font-size: 14px; font-weight: 600; }
.nodrawer__copy p { margin: 4px 0 0; color: var(--text-muted); font-size: 14px; font-weight: 400; line-height: 1.4; }
.nodrawer .btn { margin-top: 12px; }
.drawer-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 16px;
  margin-bottom: 32px;
  padding: 96px 16px 0;
}
.drawer-empty__icon {
  width: 80px;
  height: 80px;
  border-radius: 999px;
  background: var(--subtle);
  display: flex;
  align-items: center;
  justify-content: center;
}
.drawer-empty h2 { margin: 0; font-size: 22px; font-weight: 600; line-height: 1.25; }
.drawer-empty p { margin: 0; color: var(--text-muted); font-size: 15px; font-weight: 400; line-height: 1.4; }
.drawer-empty .btn { width: 100%; margin: 0; }
.hint-card--follow { margin-top: 16px; }
.drawer-page .subbar { margin-bottom: 8px; }
.drawer-status {
  display: flex;
  gap: 16px;
  align-items: center;
  padding: 20px;
  border-radius: 24px;
  background: var(--surface);
}
.drawer-status__icon {
  width: 64px;
  height: 64px;
  border-radius: 24px;
  background: rgba(12, 164, 69, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
}
.drawer-status__icon.is-off { background: rgba(220, 38, 38, 0.1); }
.drawer-status strong { display: flex; align-items: center; gap: 4px; font-size: 16px; }
.drawer-status p { margin: 4px 0 0; color: var(--text-muted); font-size: 14px; }
.drawer-block {
  margin-top: 16px;
  padding: 16px;
  border-radius: 24px;
  background: var(--surface);
}
.drawer-block h2 { margin: 0 0 8px; font-size: 17px; font-weight: 600; }
.drawer-block .home-card__banner { margin-bottom: 12px; }
.drawer-block p { margin: 0 0 12px; color: var(--text-muted); font-size: 13px; line-height: 1.4; }
.drawer-list {
  margin-top: 16px;
  border-radius: 24px;
  overflow: hidden;
  background: var(--surface);
}
.drawer-list h2 { margin: 0; padding: 16px 16px 8px; font-size: 17px; font-weight: 600; }
.drawer-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding: 16px;
  appearance: none;
  border: 0;
  border-top: 1px solid var(--border-subtle);
  color: inherit;
  text-decoration: none;
  background: transparent;
  width: 100%;
  text-align: left;
  font-family: inherit;
  cursor: pointer;
}
.drawer-row > div, .drawer-row > strong { flex: 1; min-width: 0; }
.drawer-row strong, .drawer-row span { display: block; }
.drawer-row strong { font-size: 15px; }
.drawer-row span { margin-top: 4px; font-size: 13px; color: var(--text-muted); font-weight: 400; }
.drawer-row span.is-online { color: var(--success); }
.drawer-row span.is-offline { color: var(--danger-text); }
.drawer-row em { margin-left: auto; font-style: normal; color: var(--text-muted); font-size: 14px; }
.drawer-row .is-in { color: #277f3e; }
.drawer-row .is-out { color: var(--danger-text); }
.drawer-row .is-other { color: var(--text-disabled); }
.drawer-row .is-pending { color: #704503; font-size: 14px; }
.drawer-row .is-accent { color: #98552a; font-weight: 600; }
.icon-btn--danger { background: rgba(220, 38, 38, 0.1); }
.unpair-points { display: flex; flex-direction: column; gap: 12px; margin: 4px 0 8px; }
.unpair-points li { display: flex; gap: 12px; align-items: flex-start; font-size: 14px; line-height: 1.4; }
.unpair-points img { flex: none; }
.tech-grid { display: grid; gap: 8px; padding: 0 16px 16px; }
.tech-grid div { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; font-size: 14px; }
.tech-grid span { color: var(--text-muted); }
.tech-grid strong { text-align: right; font-weight: 600; word-break: break-word; }
.home-card__status {
  position: relative;
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 12px;
  overflow: hidden;
  white-space: nowrap;
}
.status-dot {
  width: 16px;
  height: 16px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.status-dot--on { background: rgba(16, 188, 79, 0.15); }
.status-dot--off { background: rgba(254, 52, 52, 0.18); }
.status-dot i {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  display: block;
}
.status-dot--on i { background: var(--success); }
.status-dot--off i { background: var(--danger); }
.home-card__head {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.home-card__identity {
  min-width: 0;
  flex: 1;
}
.home-card__who {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.avatar {
  width: 48px;
  height: 48px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  background: rgba(152, 115, 243, 0.2);
}
.avatar--alt { background: rgba(16, 188, 79, 0.15); }
.avatar img { width: 24px; height: 24px; }
.home-card__name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 20px;
  font-weight: 600;
  color: inherit;
  text-decoration: none;
}
.home-card__schedule {
  margin: 8px 0 0;
  font-size: 14px;
  font-weight: 400;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.home-card__time {
  width: 151px;
  flex: none;
  background: var(--inset);
  border-radius: 14px;
  padding: 8px 12px;
  text-align: center;
}
.home-card__time span {
  display: block;
  font-size: 14px;
  font-weight: 400;
  color: var(--text-muted);
}
.home-card__time strong {
  display: block;
  font-size: 32px;
  font-weight: 600;
  letter-spacing: -1.2px;
  line-height: 1.1;
}
.home-card__time.is-exceeded {
  background: rgba(250, 162, 30, 0.35);
  color: #fec583;
}
.home-card__time.is-exceeded span,
.home-card__time.is-exceeded strong {
  color: inherit;
}
html[data-theme="light"] .home-card__time.is-exceeded {
  color: #704503;
}
.home-card__banner {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  margin-top: 16px;
  padding: 8px 20px;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
}
.home-card__banner-icon {
  width: 20px;
  height: 20px;
  flex: none;
  background: currentColor;
}
.home-card__banner-icon--penalty {
  -webkit-mask: url("../img/figma/icon-penalty.svg") center / contain no-repeat;
  mask: url("../img/figma/icon-penalty.svg") center / contain no-repeat;
}
.home-card__banner-icon--unlock {
  -webkit-mask: url("../img/figma/icon-unlock.svg") center / contain no-repeat;
  mask: url("../img/figma/icon-unlock.svg") center / contain no-repeat;
}
.home-card__banner-icon--exceeded {
  -webkit-mask: url("../img/figma/icon-device-out.svg") center / contain no-repeat;
  mask: url("../img/figma/icon-device-out.svg") center / contain no-repeat;
}
.home-card__banner-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.home-card__banner-reset {
  margin-left: auto;
  flex: none;
  border: 0;
  background: none;
  padding: 0;
  font: inherit;
  font-weight: 600;
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}
.home-card__banner--penalty,
.home-card__banner--override {
  min-height: 48px;
  padding: 12px 12px 12px 16px;
  border-radius: 12px;
}
.home-card__banner--penalty {
  background: rgba(220, 38, 38, 0.32);
  color: #fa6b6b;
}
html[data-theme="light"] .home-card__banner--penalty {
  background: rgba(220, 38, 38, 0.1);
  color: #ac1a1c;
}
html[data-theme="light"] .home-card__banner--penalty .home-card__banner-reset {
  color: #fa6b6b;
}
.home-card__banner--override {
  background: rgba(167, 139, 250, 0.28);
  color: #d0c4fe;
}
html[data-theme="light"] .home-card__banner--override {
  background: #e9e4fe;
  color: #5a399f;
}
.home-card__banner--exceeded {
  min-height: 46px;
  background: rgba(250, 162, 30, 0.35);
  color: #fec583;
}
html[data-theme="light"] .home-card__banner--exceeded {
  color: #704503;
}
.home-card__banner--block {
  align-items: flex-start;
  background: rgba(254, 52, 52, 0.16);
  color: var(--danger-text);
  white-space: normal;
}
.home-card__devices {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 16px;
}
.home-card__devices .unknown-row,
.home-card--nodrawer .unknown-row {
  grid-column: 1 / -1;
  margin: 0;
}
.home-card--nodrawer .unknown-row { margin-top: 16px; }
.device-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 8px 12px 8px 10px;
  border-radius: 14px;
  background: var(--subtle);
}
.device-chip__mark {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
}
.device-chip__mark--in { background: var(--success); }
.device-chip__mark--out { background: var(--danger); }
.device-chip__mark--other { background: #8f8782; }
.device-chip__mark--other::before {
  content: "";
  width: 10px;
  height: 1.5px;
  border-radius: 1px;
  background: #150e09;
}
.device-chip strong {
  display: block;
  font-size: 13px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.device-chip > span:last-child {
  display: block;
  min-width: 0;
  font-size: 12px;
  color: var(--text-disabled);
  font-weight: 400;
}
.device-chip > span:last-child > span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.home-card__bonus {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 64px;
  height: 64px;
  border-radius: 999px;
  border: 1.5px solid var(--accent);
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}
.home-card__actions {
  position: absolute;
  left: 90px;
  right: 16px;
  bottom: 12px;
  display: flex;
  gap: 12px;
}
.round-btn {
  flex: 1;
  height: 56px;
  border: none;
  border-radius: 999px;
  background: var(--action-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  text-decoration: none;
  padding: 0;
}
.child-note {
  position: relative;
  margin: 8px 0 0;
  font-size: 13px;
  color: var(--danger-text);
}

.drawer-group { margin-bottom: 28px; }
.drawer-card {
  padding: 16px;
  border-radius: 24px;
  margin-bottom: 16px;
}
.drawer-card__head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}
.drawer-card__title {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
  font-size: 20px;
  font-weight: 600;
  text-decoration: none;
  color: inherit;
  margin-bottom: 0;
}
.unknown-row {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 46px;
  padding: 0 12px 0 16px;
  border-radius: 12px;
  background: var(--inset);
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 16px;
}
.drawer-card .home-card__devices { margin-bottom: 20px; }
.drawer-card .home-card__banner {
  margin-top: 0;
  margin-bottom: 16px;
}
.drawer-card .btn { min-height: 56px; }

.schedule-list { display: flex; flex-direction: column; gap: 16px; }
.schedule-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 80px;
  padding: 16px 16px 16px 40px;
  border-radius: 16px 24px 24px 16px;
  text-decoration: none;
  color: inherit;
}
.schedule-card__stripe {
  position: absolute;
  left: 6px;
  top: 6px;
  bottom: 6px;
  width: 19px;
  border-radius: 999px;
}
.schedule-card__name {
  flex: 1;
  min-width: 0;
  font-size: 16px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.schedule-card__meta {
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 400;
}
.avatar-stack { display: flex; }
.avatar-stack .avatar { width: 40px; height: 40px; margin-right: -9px; }
.avatar-stack .avatar:last-child { margin-right: 0; }

.tabbar {
  position: fixed;
  left: 50%;
  bottom: 21px;
  transform: translateX(-50%);
  width: min(350px, calc(100% - 40px));
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 40;
}
.tabbar__tabs {
  width: 270px;
  max-width: calc(100% - 76px);
  height: 64px;
  padding: 4px;
  border-radius: 999px;
  background: var(--nav);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.tabbar__tab {
  width: 46px;
  height: 46px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  text-decoration: none;
  padding: 0;
}
.tabbar__tab.is-active {
  width: auto;
  height: 56px;
  padding: 0 16px 0 14px;
  background: var(--nav-active);
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
}
html[data-theme="light"] .tabbar__tab.is-active img {
  filter: brightness(0);
}
.tabbar__add {
  width: 64px;
  height: 64px;
  border-radius: 999px;
  border: none;
  background: var(--nav);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}
.tabbar__add.is-accent {
  background: var(--accent);
  border: 1.5px solid var(--accent);
}

.sheet {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.sheet[hidden] { display: none; }
.sheet__scrim {
  position: absolute;
  inset: 0;
  background: var(--modal-backdrop);
  border: none;
  padding: 0;
}
.sheet__panel {
  position: relative;
  width: min(430px, 100%);
  background: var(--overlay);
  border: 1px solid var(--border-subtle);
  border-radius: 24px 24px 0 0;
  padding: 8px 20px 32px;
}
.sheet__handle {
  width: 40px;
  height: 4px;
  border-radius: 999px;
  background: var(--control-off);
  margin: 0 auto 16px;
}
.sheet__head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 20px;
}
.sheet__head > :first-child { flex: 1; min-width: 0; }
.sheet__head .icon-btn { flex: none; width: 44px; height: 44px; }
html:not([data-theme="light"]) .sheet .icon-btn img {
  filter: invert(1);
}
.sheet__head h2 {
  margin: 0;
  flex: 1;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.2px;
  line-height: 1.2;
}
.sheet__head p {
  margin: 4px 0 0;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 400;
}
.add-option {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  margin-bottom: 16px;
  border-radius: 20px;
  border: 1px solid var(--border-subtle);
  background: var(--surface);
  color: inherit;
  text-decoration: none;
  text-align: left;
}
.add-option > .add-option__icon {
  width: 48px;
  height: 48px;
  margin: 0;
  padding: 0;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  font-size: 0;
  line-height: 0;
  color: inherit;
}
.add-option > .add-option__icon img {
  display: block;
  width: 24px;
  height: 24px;
  margin: 0;
  object-fit: contain;
  object-position: center;
}
.add-option__icon--child { background: rgba(249, 177, 134, 0.18); }
.add-option__icon--drawer { background: rgba(16, 188, 79, 0.15); }
.add-option__icon--schedule { background: rgba(250, 162, 30, 0.28); }
.add-option__icon--sentinel { background: rgba(76, 155, 240, 0.18); }
.add-option strong { display: block; font-size: 16px; font-weight: 600; }
.add-option span { display: block; margin-top: 2px; font-size: 14px; font-weight: 400; color: var(--text-muted); }
.option-tiles {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
}
.option-tile {
  flex: 1;
  min-height: 64px;
  border-radius: 14px;
  border: 1px solid var(--border-subtle);
  background: var(--action-secondary);
  color: var(--text);
  font-family: inherit;
  font-size: 17px;
  font-weight: 600;
  cursor: pointer;
}
.option-tile.is-selected {
  background: var(--action-primary);
  color: var(--on-action-primary);
  border-color: transparent;
}
html:not([data-theme="light"]) .option-tile.is-selected {
  color: #150e09;
}
.custom-time {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: -8px 0 24px;
  color: var(--text-muted);
  font-size: 14px;
}
.custom-time[hidden] { display: none !important; }
.custom-time__field {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-radius: 14px;
  background: var(--inset);
  color: var(--text);
}
.custom-time__field input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 17px;
  font-weight: 600;
  padding: 0;
}
.custom-time__field input:focus { outline: none; }
.duration-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.modal-dialog .sheet__head h3 {
  margin: 0;
}
.modal-dialog .sheet__head .modal-desc {
  margin: 4px 0 0;
}
html:not([data-theme="light"]) .modal .icon-btn img {
  filter: invert(1);
}

.app-menu-backdrop {
  background: var(--menu-backdrop);
}
.app-menu-panel {
  width: min(304px, 82vw);
  background: var(--overlay);
  border-radius: 28px 0 0 28px;
  color: var(--text);
  display: flex;
  flex-direction: column;
}
.app-menu-hero {
  background: var(--accent);
  color: var(--on-accent);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.app-menu-hero__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}
.app-menu-avatar {
  width: 56px;
  height: 56px;
  border-radius: 999px;
  background: var(--overlay);
  color: #98552a;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 600;
  text-decoration: none;
}
.app-menu-kicker {
  margin: 0;
  font-size: 13px;
  font-weight: 400;
}
.app-menu-email {
  margin: 2px 0 0;
  font-size: 18px;
  font-weight: 600;
}
.app-menu-body {
  flex: 1;
  padding: 28px 24px 16px;
}
.app-menu-label {
  margin: 0 0 4px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
}
.app-menu-row {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  background: none;
  border: none;
  color: inherit;
  font-family: inherit;
  font-size: 16px;
  font-weight: 500;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}
.app-menu-footer {
  padding: 16px 24px 32px;
}
.app-menu-footer .app-menu-logout {
  color: var(--danger-text);
}
.app-menu-switch {
  width: 64px;
  height: 40px;
  border-radius: 999px;
  background: #3a312b;
  position: relative;
  flex: none;
  margin-left: auto;
}
.app-menu-switch::after {
  content: "";
  position: absolute;
  top: 4px;
  left: 4px;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: #c9c2ff;
  transition: transform 0.2s ease;
}
.app-menu-theme.is-on .app-menu-switch::after {
  transform: translateX(24px);
}
html[data-theme="light"] .app-menu-switch { background: #ddd6d1; }
html[data-theme="light"] .app-menu-switch::after { background: #f4f0ed; }

.nav-menu-btn {
  width: 44px;
  height: 44px;
  min-height: 44px;
  border-radius: 999px;
  border: none;
  background: var(--inset);
  position: relative;
}
.nav-menu-btn::after {
  content: "";
  width: 20px;
  height: 20px;
  background: var(--text);
  -webkit-mask: url("../img/figma/icon-user.svg") center / contain no-repeat;
  mask: url("../img/figma/icon-user.svg") center / contain no-repeat;
}
.nav-menu-bar { display: none; }
.app-menu-panel {
  width: min(304px, 86vw);
  padding: 0;
  background: var(--overlay);
  border: none;
  border-radius: 28px 0 0 28px;
  overflow: auto;
}
.otp-row input.otp-digit {
  width: 48px;
  flex: none;
  max-width: 48px;
  height: 52px;
  min-height: 52px;
  padding: 0;
  font-size: 28px;
  font-weight: 600;
  border-radius: 14px;
}
.app-menu-close {
  width: 24px;
  height: 24px;
  min-height: 24px;
  border: none;
  background: transparent;
  color: var(--on-accent);
  font-size: 0;
  padding: 0;
}
.app-menu-theme.theme-toggle,
.app-menu-logout.theme-toggle,
.app-menu-profile.theme-toggle,
.app-menu-activation.theme-toggle,
.app-menu-all-nodes.theme-toggle {
  width: auto;
  height: auto;
  min-height: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  padding: 12px 0;
  justify-content: flex-start;
}

@media (max-height: 700px) {
  .app-shell .phone { padding-top: 12px; padding-bottom: 108px; }
  .app-header { margin-bottom: 12px; }
  .list-row { min-height: 72px; margin-bottom: 12px; }
  .list-row__icon,
  .section-card__icon { width: 48px; height: 48px; }
  .section-card__head { margin-bottom: 12px; }
  .section-card__text { margin-bottom: 12px; }

  .auth-screen .brand-logo { width: 68px; height: 48px; }
  .auth-screen h1 { margin-top: 8px; font-size: 26px; }
  .auth-help { margin-top: 8px; }
  .auth-fields { margin-top: 8px; }
  .auth-fields .form-group { margin-bottom: 8px; }
  .auth-fields label { margin-bottom: 4px; }
  .auth-screen input,
  .auth-screen select { min-height: 44px; padding-top: 8px; padding-bottom: 8px; }
  .auth-actions { padding-top: 8px; gap: 4px; }
  .auth-screen .btn-ghost { min-height: 36px; }

  .screen-title { margin-bottom: 12px; }
  .group-title { margin-bottom: 8px; }
  .drawer-card { padding: 12px; margin-bottom: 12px; }
  .drawer-card__head { margin-bottom: 8px; }
  .drawer-card .btn { min-height: 48px; }
}

/* Child detail, profile, devices and drawers */
.child-screen { display: flex; flex-direction: column; gap: 16px; }
.child-hero {
  margin: -24px -20px 8px;
  padding: 20px 20px 56px;
  border-radius: 0 0 20px 20px;
  background: linear-gradient(180deg, #5a399f 0%, #412a72 100%);
  color: #fff;
}
.child-hero__bar { display: flex; align-items: center; justify-content: space-between; }
.child-hero__back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #fff;
  text-decoration: none;
  font-size: 16px;
  font-weight: 600;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  font-family: inherit;
}
.child-hero__back i {
  width: 20px;
  height: 20px;
  background: #fff;
  -webkit-mask: url("../img/figma/icon-chevron-left.svg") center / contain no-repeat;
  mask: url("../img/figma/icon-chevron-left.svg") center / contain no-repeat;
}
.child-hero__edit {
  width: 56px;
  height: 56px;
  border: 0;
  border-radius: 999px;
  background: #f4f0ed;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.child-hero__edit img { filter: brightness(0); }
.hint-card img { filter: brightness(0); }
.child-hero__name {
  margin: 8px 0 0;
  text-align: center;
  font-size: 34px;
  font-weight: 700;
  letter-spacing: -0.5px;
  line-height: 1.15;
}
.child-hero__avatar {
  width: 72px;
  height: 72px;
  margin: 12px auto -92px;
  border-radius: 999px;
  background: #412a72;
  display: flex;
  align-items: center;
  justify-content: center;
}
.child-hero__avatar span {
  width: 64px;
  height: 64px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.child-hero__avatar img { width: 32px; height: 32px; }
.child-status { margin-top: 28px; min-height: 0; }
.child-status .home-card__body { min-height: 196px; }
.child-status .home-card__time {
  width: 100%;
  min-height: 85px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.child-status .home-card__time strong { font-size: 40px; }
.child-penalty {
  margin-top: 16px;
  padding: 14px 12px 14px 16px;
  border-radius: 12px;
  background: rgba(220, 38, 38, 0.32);
  color: #fa6b6b;
}
html[data-theme="light"] .child-penalty {
  background: rgba(220, 38, 38, 0.1);
  color: #ac1a1c;
}
.child-penalty .home-card__banner { margin: 0; padding: 0; background: transparent; color: inherit; }
.child-penalty__note {
  margin: 12px 0 0;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.4;
  color: var(--text-muted);
}
.child-schedule {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  min-height: 72px;
  padding: 16px;
  border: 0;
  border-radius: 20px;
  background: var(--surface);
  color: inherit;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
}
.child-schedule strong { display: block; font-size: 17px; font-weight: 600; }
.child-schedule > span:first-child { flex: 1; min-width: 0; }
.child-schedule > span:first-child span { display: block; margin-top: 4px; font-size: 14px; font-weight: 400; color: var(--success); }
.child-schedule > .child-schedule__btn {
  width: 64px;
  height: 64px;
  margin: 0;
  border-radius: 999px;
  background: var(--subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
}
.child-settings {
  background: var(--surface);
  border-radius: 24px;
  overflow: hidden;
}
.child-settings button,
.child-settings a {
  width: 100%;
  min-height: 56px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  border: 0;
  border-bottom: 1px solid var(--border-subtle);
  background: transparent;
  color: inherit;
  font-family: inherit;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}
.child-settings button:last-child,
.child-settings a:last-child { border-bottom: 0; }
.child-settings strong { flex: 1; font-size: 15px; font-weight: 600; }
.child-settings em {
  font-style: normal;
  font-size: 14px;
  font-weight: 400;
  color: var(--text-muted);
  max-width: 46%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.subbar { display: flex; align-items: center; justify-content: space-between; min-height: 44px; }
.back-link, .text-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 0;
  background: none;
  padding: 0;
  color: #98552a;
  font-family: inherit;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}
.back-link img { width: 20px; height: 20px; }
.child-title {
  margin: 8px 0 0;
  font-size: 34px;
  font-weight: 700;
  letter-spacing: -0.5px;
  line-height: 1.15;
}
.child-card {
  background: var(--surface);
  border-radius: 24px;
  padding: 16px;
}
.avatar-row { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.avatar-bubble {
  width: 64px;
  height: 64px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
}
.avatar-bubble img { width: 32px; height: 32px; }
.pill {
  height: 44px;
  padding: 0 20px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--action-secondary);
  color: var(--text);
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}
.child-field { display: block; margin-bottom: 16px; }
.child-field span { display: block; margin-bottom: 8px; font-size: 14px; font-weight: 600; }
.child-field input, .child-field select, .sheet-field {
  width: 100%;
  height: 48px;
  border-radius: 14px;
  border: 1.5px solid var(--text);
  background: var(--field);
  color: var(--text);
  font-family: inherit;
  font-size: 16px;
  font-weight: 700;
  padding: 0 16px;
}
.child-field select, .sheet-field { font-weight: 400; }
.form-error { margin: 0; color: var(--danger-text); font-size: 14px; }
.remove-block { margin-top: 8px; }
.btn-outline-danger {
  width: 100%;
  min-height: 56px;
  border-radius: 999px;
  border: 1px solid var(--danger-text);
  background: transparent;
  color: var(--danger-text);
  font-family: inherit;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
}
.btn-ghost-text {
  width: 100%;
  min-height: 44px;
  border: 0;
  background: none;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}
.help-text { margin: 12px 0 0; color: var(--text-muted); font-size: 14px; line-height: 1.4; }
.stack-card {
  background: var(--surface);
  border-radius: 24px;
  overflow: hidden;
}
.stack-card h2 { margin: 0; padding: 16px 16px 4px; font-size: 17px; font-weight: 600; }
.stack-card > .drawer-row:first-child,
.stack-card > .device-row:first-child { border-top: 0; }
.device-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 72px;
  padding: 16px;
  border-top: 1px solid var(--border-subtle);
}
.device-row__text { flex: 1; min-width: 0; }
.device-row__text strong, .device-row__text span { display: block; }
.device-row__text strong { font-size: 15px; font-weight: 600; }
.device-row__text span { margin-top: 4px; font-size: 14px; }
.device-row__text .is-in { color: var(--success); }
.device-row__text .is-out { color: var(--danger-text); }
.device-row__text .device-row__serial { color: var(--text-muted); font-size: 13px; }
.device-check {
  display: flex;
  align-items: center;
  flex: none;
}
.device-check input {
  width: 22px;
  height: 22px;
  margin: 0;
  accent-color: var(--accent);
}
.child-screen .btn:disabled { opacity: 0.45; cursor: not-allowed; }
.tech-descriptor { padding: 12px 0; border-top: 1px solid var(--border-subtle); }
.tech-descriptor:first-child { border-top: 0; padding-top: 0; }
.tech-descriptor h3 { margin: 0 0 8px; font-size: 15px; font-weight: 600; }
.tech-descriptor .tech-grid { padding: 0; }
.tech-descriptor .tech-grid div { align-items: flex-start; }
.tech-descriptor .tech-grid strong { text-align: right; word-break: break-word; }
.merge-target__detail { display: block; margin-top: 4px; color: var(--text-muted); font-size: 13px; font-weight: 400; }
.sheet .pick-row.is-selected .merge-target__detail { color: #58514c; }
.more-btn {
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 999px;
  background: var(--inset);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex: none;
}
.hint-card {
  background: #ffddc9;
  border: 1px solid #e59463;
  border-radius: 16px;
  padding: 16px;
  color: #150e09;
}
.hint-card__title { display: flex; align-items: center; gap: 12px; font-size: 16px; font-weight: 600; }
.hint-card p { margin: 12px 0 0; color: #58514c; font-size: 14px; line-height: 1.4; }
.device-menu {
  position: fixed;
  z-index: 90;
  width: 220px;
  padding: 6px 0;
  border-radius: 16px;
  border: 1px solid var(--border-subtle);
  background: var(--overlay);
  box-shadow: var(--shadow-dropdown);
}
.device-menu[hidden] { display: none; }
.device-menu button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border: 0;
  background: none;
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
}
.device-menu button.is-danger { color: var(--danger-text); }
.device-menu hr { margin: 0; border: 0; border-top: 1px solid var(--border-subtle); }
.parent-list {
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
}
.parent-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  margin: 0;
  background: var(--surface-solid);
  border: 0;
  border-bottom: 1px solid var(--border-subtle);
  border-radius: 0;
}
.parent-row:last-child { border-bottom: 0; }
.parent-row div { flex: 1; min-width: 0; }
.parent-row strong, .parent-row span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.parent-row strong { font-size: 15px; color: var(--text); }
.parent-row span { margin-top: 4px; font-size: 13px; color: var(--text); font-weight: 400; }
.parent-row .btn-outline-danger { width: auto; min-height: 52px; padding: 0 20px; font-size: 16px; }
.assign-list {
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
}
.assign-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 85px;
  padding: 16px;
  background: var(--surface-solid);
  border-bottom: 1px solid var(--border-subtle);
}
.assign-row:last-child { border-bottom: 0; }
.assign-row strong {
  flex: 1;
  min-width: 0;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.3;
}
.assign-badge {
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(12, 164, 69, 0.12);
  color: #277f3e;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
}
.assign-btn {
  width: auto;
  min-height: 52px;
  padding: 0 20px;
  background: var(--inset);
  color: var(--text);
}
.assign-btn:hover,
.assign-btn:focus { background: var(--inset); color: var(--text); }
.assign-create { margin-top: 32px; }
.pick-row {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
  padding: 14px 12px;
  border-radius: 14px;
  border: 1px solid var(--border-subtle);
  background: transparent;
  color: inherit;
  text-align: left;
  font-family: inherit;
  cursor: pointer;
}
.sheet .pick-row.is-selected,
.sheet .pick-row.is-selected:hover {
  background: #ffddc9;
  background-color: #ffddc9;
  border: 2px solid #e5905a;
  color: #150e09;
}
.sheet .pick-row.is-selected strong { color: #150e09; }
.pick-row strong { font-size: 16px; font-weight: 600; }
.pick-radio {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  border: 1.5px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
}
.pick-row.is-selected .pick-radio { background: var(--accent); border-color: var(--accent); }
.pick-badge {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(16, 188, 79, 0.18);
  color: #277f3e;
  font-size: 12px;
  font-weight: 600;
}
.avatar-choices { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; justify-items: center; }
.invite-screen { min-height: calc(100vh - 48px); display: flex; flex-direction: column; justify-content: space-between; gap: 24px; }
.invite-title { margin: 16px 0 0; font-size: 28px; font-weight: 700; letter-spacing: -0.3px; line-height: 1.15; }
.invite-lead { margin: 8px 0 0; color: var(--text-muted); font-size: 15px; font-weight: 400; line-height: 1.4; }
.invite-mid { display: flex; flex-direction: column; }
.invite-can { margin: 20px 0 0; font-size: 14px; font-weight: 600; }
.invite-capabilities { list-style: none; margin: 8px 0 0; padding: 0; }
.invite-capabilities li { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size: 14px; }
.invite-check { width: 20px; height: 20px; border-radius: 999px; background: rgba(12, 164, 69, 0.12); display: flex; align-items: center; justify-content: center; flex: none; }
.sent-card { background: var(--surface-solid); border-radius: 24px; padding: 32px 24px; text-align: center; }
.sent-card .invite-title, .sent-card .invite-lead { text-align: center; }
.sent-icon { width: 96px; height: 96px; margin: 0 auto 24px; border-radius: 999px; background: rgba(12, 164, 69, 0.18); display: flex; align-items: center; justify-content: center; }
.avatar-choices button {
  width: 56px;
  height: 56px;
  border-radius: 999px;
  border: 2px solid transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}
.avatar-choices button.is-selected { border-color: var(--accent); }
.avatar-choices img { width: 28px; height: 28px; }
.sheet-actions { display: flex; flex-direction: column; gap: 12px; margin-top: 20px; }
.sheet-field { margin-top: 8px; }

/* ---- Schedule editor (6 · Schedules) ----------------------------------- */
body.policy-page .phone { padding-bottom: 32px; }
body.policy-page.is-dock .phone { padding-bottom: 112px; }

.policy-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 44px;
  margin-bottom: 16px;
}
.policy-top__actions { display: flex; gap: 8px; }
.policy-close {
  border: 0;
  background: none;
  padding: 0;
  color: var(--accent);
  font-family: inherit;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
}
.policy-steps {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}
.policy-steps span {
  flex: 1;
  height: 4px;
  border-radius: 999px;
  background: var(--control-off);
}
.policy-steps span.is-done { background: var(--action-primary); }
.policy-kicker {
  margin: 0 0 16px;
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 400;
}
.policy-heading {
  margin: 0 0 8px;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.2px;
  line-height: 1.2;
}
.policy-lead {
  margin: 0 0 16px;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.4;
}
.policy-card {
  background: var(--surface);
  border-radius: 24px;
  padding: 24px 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.policy-card label {
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 600;
}
.policy-card input,
.policy-card select {
  min-height: 48px;
  margin: 0;
}
.policy-card select { font-weight: 400; }
.policy-note {
  margin: 8px 0 0;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.4;
}
.policy-stepper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 56px;
  padding: 6px 6px 6px 20px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--field);
}
.policy-stepper strong {
  font-size: 22px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.policy-stepper__btns { display: flex; gap: 8px; }
.policy-stepper__btns .icon-btn {
  width: 44px;
  height: 44px;
  background: var(--action-secondary);
  border: 1px solid var(--border);
}
.policy-colors { display: flex; justify-content: space-between; padding: 3px; }
.policy-color {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 999px;
  padding: 0;
  cursor: pointer;
  box-shadow: 0 0 0 0 transparent;
}
.policy-color.is-selected { box-shadow: 0 0 0 3px var(--text); }
.policy-days {
  display: flex;
  gap: 6px;
  margin: 16px 0;
}
.policy-daychip {
  flex: 1;
  min-width: 0;
  height: 48px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--action-secondary);
  color: var(--text);
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  padding: 0 2px;
}
.policy-daychip.is-selected {
  background: var(--action-primary);
  color: var(--on-action-primary);
  border-color: transparent;
}
html:not([data-theme="light"]) .policy-daychip.is-selected { color: #150e09; }
.policy-brush {
  position: sticky;
  top: 0;
  z-index: 6;
  margin: 0 -20px;
  padding: 12px 20px 8px;
  background: var(--bg);
}
.policy-brush__stuck { display: none; }
.policy-brush.is-stuck .policy-brush__stuck {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.policy-brush.is-stuck .policy-brush__hint { display: none; }
.policy-brush__stuck strong { font-size: 16px; font-weight: 600; }
.policy-brush__stuck span { color: var(--text-muted); font-size: 14px; }
.policy-brush__hint {
  margin: 0 0 12px;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
  white-space: pre-line;
}
.policy-brush__chips { display: flex; gap: 8px; }
.policy-brush__chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 56px;
  padding: 8px 12px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.policy-brush__chip.is-selected {
  flex: 1;
  background: #ffddc9;
  border: 2px solid #e5905a;
  color: #150e09;
}
.policy-dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  flex: none;
}
.policy-dot--quiet { background: #ae3314; }
.policy-dot--not-accounted { background: #e59463; }
.policy-dot--accounted { background: #4c9848; }
.policy-brush__help {
  margin: 8px 0 0;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.4;
}
.policy-track {
  position: relative;
  margin-top: 16px;
  user-select: none;
  -webkit-user-select: none;
}
.policy-track__grid {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  column-gap: 8px;
  margin-right: 36px;
}
.policy-track__labels { position: relative; height: 768px; }
.policy-track__label {
  position: absolute;
  right: 0;
  transform: translateY(-50%);
  font-size: 10px;
  line-height: 1.4;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}
.policy-track__bar {
  position: relative;
  height: 768px;
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  touch-action: none;
  background: var(--surface);
}
.policy-track__bar .interval-slot {
  flex: none;
  height: 8px;
  min-height: 8px;
  transition: none;
  touch-action: none;
}
.policy-track__bar .interval-slot:hover,
.policy-track__bar .interval-slot:active { opacity: 1; filter: none; }
.policy-hour-line {
  position: absolute;
  left: 0;
  right: 0;
  height: 1px;
  background: rgba(255, 255, 255, 0.35);
  pointer-events: none;
  z-index: 1;
}
html[data-theme="light"] .policy-hour-line { background: rgba(21, 14, 9, 0.18); }
.policy-now {
  position: absolute;
  left: 0;
  right: 0;
  height: 0;
  border-top: 1px solid #ac1a1c;
  pointer-events: none;
  z-index: 3;
}
.policy-now span {
  position: absolute;
  right: 0;
  top: -14px;
  color: #ac1a1c;
  font-size: 10px;
  line-height: 1.4;
  white-space: nowrap;
}
.policy-track > .policy-now {
  left: 50px;
  right: 36px;
}
.policy-track > .policy-now span {
  right: auto;
  left: calc(100% + 6px);
  top: -7px;
}
.policy-week .policy-now { grid-column: 1 / -1; }
.policy-week .policy-now span { right: auto; left: 0; }
.policy-drag { position: absolute; inset: 0; pointer-events: none; z-index: 4; }
.policy-drag[hidden] { display: none !important; }
.policy-drag__outline {
  position: absolute;
  border: 2px solid var(--text);
  border-radius: 4px;
  box-sizing: border-box;
}
.policy-drag__line {
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--text);
}
.policy-drag__time {
  position: absolute;
  left: 0;
  transform: translateY(-50%);
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--text);
  color: var(--bg);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.3px;
  font-variant-numeric: tabular-nums;
}
.policy-drag__bubble {
  position: absolute;
  transform: translateX(-50%);
  width: max-content;
  min-width: 140px;
  max-width: 320px;
  white-space: nowrap;
  padding: 10px 14px;
  border-radius: 14px;
  background: var(--text);
  color: var(--bg);
  box-shadow: var(--shadow-dropdown);
}
.policy-drag__bubble strong {
  display: block;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.3;
}
.policy-drag__bubble em {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
  font-style: normal;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.3px;
  opacity: 0.75;
}
.policy-summary {
  margin-top: 16px;
  padding: 16px 16px 4px;
  border-radius: 20px;
  background: var(--surface);
}
.policy-summary h2 {
  margin: 0 0 8px;
  font-size: 16px;
  font-weight: 600;
}
.policy-range {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 0;
  border-top: 1px solid var(--border-subtle);
  font-size: 14px;
}
.policy-range strong { flex: 1; font-weight: 600; }
.policy-range span { color: var(--text-muted); font-variant-numeric: tabular-nums; }
.policy-range b { width: 42px; text-align: right; font-weight: 600; }
.policy-dock {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: min(390px, 100%);
  display: flex;
  gap: 12px;
  padding: 16px 20px 24px;
  background: linear-gradient(180deg, var(--canvas-start), var(--canvas-end));
  z-index: 20;
}
.policy-dock .btn { min-height: 52px; flex: 1; }
.policy-actions { display: flex; flex-direction: column; gap: 12px; margin-top: 16px; }
.policy-actions .btn { min-height: 52px; }
.policy-titlecard {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 64px;
  margin-bottom: 16px;
  padding: 16px 20px;
  border-radius: 20px;
  background: var(--surface);
}
.policy-titlecard__name {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}
.policy-titlecard__stripe {
  width: 8px;
  height: 30px;
  border-radius: 999px;
  flex: none;
}
.policy-titlecard h1 {
  margin: 0;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.2px;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.policy-used {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
  font-size: 13px;
}
.avatar-stack--sm .avatar { width: 32px; height: 32px; }
.avatar-stack--sm .avatar img { width: 20px; height: 20px; }
.policy-legend {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px 16px;
  margin-bottom: 12px;
  color: var(--text-muted);
  font-size: 13px;
}
.policy-legend span { display: inline-flex; align-items: center; gap: 6px; }
.policy-week {
  background: var(--surface);
  border-radius: 20px;
  padding: 12px 10px 12px 8px;
  margin-bottom: 16px;
}
.policy-week__head, .policy-week__funds {
  display: grid;
  grid-template-columns: 34px repeat(7, minmax(0, 1fr));
  gap: 4px;
  margin-bottom: 6px;
}
.policy-week__head span, .policy-week__funds span {
  text-align: center;
  font-size: 14px;
  font-weight: 600;
}
.policy-week__funds span {
  border-radius: 6px;
  background: var(--subtle);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.4;
  padding: 2px 0;
}
.policy-week__chart {
  position: relative;
  display: grid;
  grid-template-columns: 34px repeat(7, minmax(0, 1fr));
  gap: 4px;
  height: 420px;
}
.policy-week__axis { position: relative; }
.policy-week__axis span {
  position: absolute;
  left: 0;
  transform: translateY(-50%);
  font-size: 11px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}
.policy-week__col { position: relative; height: 420px; }
.policy-week__block {
  position: absolute;
  left: 0;
  right: 0;
  border-radius: 6px;
}
.policy-week__block--quiet { background: #ae3314; }
.policy-week__block--not-accounted { background: #e59463; }
.policy-week__block--accounted { background: #4c9848; }
.policy-week__lines {
  position: absolute;
  left: 38px;
  right: 0;
  top: 0;
  height: 420px;
  pointer-events: none;
}
.policy-week__lines i {
  position: absolute;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--border-subtle);
}
.policy-rows { border-radius: 24px; overflow: hidden; background: var(--surface); margin-bottom: 32px; }
.policy-rows div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 52px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-subtle);
}
.policy-rows div:last-child { border-bottom: 0; }
.policy-rows strong { font-size: 15px; font-weight: 600; }
.policy-rows span {
  color: var(--text-muted);
  font-size: 14px;
  text-align: right;
}
.policy-check {
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
}
.policy-check button {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 52px;
  padding: 12px 16px;
  border: 0;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: 15px;
  text-align: left;
  cursor: pointer;
}
.policy-check button:last-child { border-bottom: 0; }
.policy-check i, .policy-checkline i {
  width: 24px;
  height: 24px;
  border-radius: 8px;
  border: 1.5px solid var(--border);
  background: var(--field);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  margin-left: auto;
}
.policy-check button.is-on i, .policy-checkline.is-on i {
  background: var(--action-primary);
  border-color: var(--action-primary);
}
html[data-theme="light"] .policy-check button.is-on i img,
html[data-theme="light"] .policy-checkline.is-on i img { filter: brightness(0) invert(1); }
.policy-checkline {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  margin-top: 16px;
  border: 0;
  background: none;
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  text-align: left;
  cursor: pointer;
}
.policy-checkline i { margin-left: 0; }
.policy-delete-note {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px 16px;
  border-radius: 16px;
  background: var(--subtle);
}
.policy-delete-note p { margin: 0; font-size: 14px; line-height: 1.4; }
.policy-delete-who { display: flex; align-items: center; gap: 12px; font-weight: 600; }
.schedule-empty .btn { width: auto; min-width: 186px; min-height: 48px; }
.schedule-empty { padding-top: 64px; }
