:root {
  --bg: #101114;
  --surface: #1b1d22;
  --surface-2: #252932;
  --text: #ffffff;
  --muted: rgba(255, 255, 255, 0.72);
  --line: #2d323d;
  --accent: #e74b4b;
  --blob-warm: #ff4a4a;
  --blob-cool: #4a7dff;
  --focus-ring: rgba(231, 75, 75, 0.18);
  --danger: #ff6b6b;
  --cosmos: #070912;
  --radius: 14px;
  /* Поле поиска и строки списка записей — одна высота */
  --toolbar-row-height: 48px;
  --font-ui: "Inter", "Segoe UI", Roboto, sans-serif;
  --font-head: "Unbounded", sans-serif;
  --font-caps: "Montserrat", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body.km-app-body {
  -webkit-user-select: none;
  user-select: none;
}

body.km-app-body input,
body.km-app-body textarea,
body.km-app-body select,
body.km-app-body [contenteditable="true"] {
  -webkit-user-select: text;
  user-select: text;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  position: relative;
  overflow-x: hidden;
}

body::before,
body::after {
  content: "";
  position: fixed;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.28;
  pointer-events: none;
  z-index: 0;
}

body::before {
  width: 420px;
  height: 420px;
  top: -120px;
  left: -100px;
  background: var(--blob-warm);
}

body::after {
  width: 380px;
  height: 380px;
  right: -80px;
  bottom: -120px;
  background: var(--blob-cool);
}

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

a:hover {
  text-decoration: underline;
}

.muted {
  color: var(--muted);
  font-size: 0.9rem;
}

.hidden {
  display: none !important;
}

.ic {
  width: 22px;
  height: 22px;
  display: block;
}

/* Layout shells */
.auth-shell,
.app {
  position: relative;
  z-index: 1;
}

.auth-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
}

.auth-card {
  width: min(520px, 100%);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.35);
}

.brand {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.brand-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius);
  flex-shrink: 0;
}

.brand-icon.sm {
  width: 40px;
  height: 40px;
}

.brand-title,
.modal-heading {
  margin: 0;
  font-family: var(--font-head);
  font-size: clamp(1.25rem, 3vw, 1.75rem);
  font-weight: 700;
  letter-spacing: 0.02em;
}

.brand-title span,
.brand-title-inline span {
  color: var(--accent);
}

.brand-tagline {
  margin: 0.35rem 0 0;
  font-family: var(--font-caps);
  font-size: 13px;
}

.auth-forgot-link {
  margin: -0.35rem 0 0.25rem;
  font-size: 14px;
}

.auth-forgot-link a {
  color: var(--accent);
  text-decoration: none;
}

.auth-forgot-link a:hover {
  text-decoration: underline;
}

.tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 1.25rem;
}

.tab {
  flex: 1;
  text-align: center;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
  font-family: var(--font-caps);
  font-size: 13px;
  font-weight: 500;
  background: rgba(42, 45, 52, 0.45);
  transition: border-color 0.2s ease, color 0.2s ease;
}

.tab:hover {
  color: var(--text);
  text-decoration: none;
  border-color: var(--accent);
}

.tab.active {
  color: var(--text);
  border-color: var(--accent);
  background: rgba(231, 75, 75, 0.1);
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.field span {
  display: block;
  font-size: 12px;
  font-family: var(--font-caps);
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

.field input,
.field textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(7, 9, 18, 0.45);
  color: var(--text);
  font: inherit;
}

.field .field-inline input,
.field .field-inline textarea {
  width: auto;
}

.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--focus-ring);
}

.field-inline {
  display: flex;
  align-items: center;
  gap: 8px;
}

.field-inline input,
.field-inline textarea {
  flex: 1;
  min-width: 0;
  width: auto;
}

.field-inline .field-select {
  flex: 1;
  min-width: 0;
  width: auto;
  min-height: 42px;
}

.field-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-shrink: 0;
  width: 92px;
  min-height: 42px;
}

.field-toolbar--empty {
  pointer-events: none;
}

.field-inline--textarea {
  align-items: flex-start;
}

.field-inline--textarea .field-toolbar {
  align-self: flex-start;
  padding-top: 4px;
}

.hint {
  font-size: 13px;
  color: var(--muted);
  margin: 0;
  font-family: var(--font-caps);
}

.banner {
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 14px;
}

.banner.error {
  background: rgba(248, 81, 73, 0.12);
  border: 1px solid rgba(248, 81, 73, 0.35);
  color: #ffa198;
}

.banner.success {
  background: rgba(63, 185, 80, 0.12);
  border: 1px solid rgba(63, 185, 80, 0.35);
  color: #8ae599;
}

/* Balls captcha */
.balls-mount {
  margin: 0.5rem 0 1rem;
}

.balls-hint {
  font-size: 13px;
  color: var(--muted);
  font-family: var(--font-caps);
  margin: 0 0 10px;
  line-height: 1.45;
}

.balls-stage {
  margin-bottom: 10px;
}

.balls-area {
  position: relative;
  height: 280px;
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: rgba(7, 9, 18, 0.35);
}

.ball {
  position: absolute;
  width: 44px;
  height: 44px;
  padding: 0;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  background: transparent;
  animation-name: ball-drift;
  animation-timing-function: ease-in-out;
  animation-iteration-count: infinite;
}

.ball:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--focus-ring);
}

.ball-inner {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: var(--ball-color);
  box-shadow:
    0 0 0 2px rgba(255, 255, 255, 0.12),
    0 8px 22px rgba(0, 0, 0, 0.45);
}

@keyframes ball-drift {
  0%,
  100% {
    transform: translate(0, 0);
  }
  25% {
    transform: translate(var(--drift-x), calc(-1 * var(--drift-y)));
  }
  50% {
    transform: translate(calc(-1 * var(--drift-x)), var(--drift-y));
  }
  75% {
    transform: translate(calc(0.55 * var(--drift-x)), calc(-0.45 * var(--drift-y)));
  }
}

.balls-trail {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.balls-trail-label {
  font-size: 12px;
  font-family: var(--font-caps);
  font-weight: 600;
  color: var(--muted);
}

.balls-trail-dots {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  min-height: 22px;
}

.trail-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.balls-reset-row {
  display: flex;
  justify-content: flex-end;
}

/* Buttons — брендбук */
.caps {
  font-family: var(--font-caps);
  font-weight: 600;
  letter-spacing: 0.04em;
  font-size: 13px;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 12px 18px;
  cursor: pointer;
  background: rgba(42, 45, 52, 0.85);
  color: var(--text);
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.btn-secondary:hover {
  border-color: var(--accent);
  background: rgba(231, 75, 75, 0.12);
  box-shadow: 0 0 0 3px rgba(231, 75, 75, 0.15);
}

.btn-secondary:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--focus-ring);
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 999px;
  padding: 12px 22px;
  cursor: pointer;
  background: var(--accent);
  color: #fff;
  box-shadow: 0 2px 16px rgba(231, 75, 75, 0.45);
  transition: filter 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
}

.btn-primary:hover {
  filter: brightness(1.08);
  box-shadow: 0 4px 22px rgba(231, 75, 75, 0.55);
}

.btn-primary:focus-visible {
  outline: none;
  box-shadow:
    0 0 0 3px var(--focus-ring),
    0 2px 16px rgba(231, 75, 75, 0.45);
}

.btn-primary-full {
  width: 100%;
  padding: 14px 22px;
  margin-top: 0.25rem;
  border-radius: 999px;
  border: none;
  background: var(--accent);
  color: #fff;
  font-family: var(--font-caps);
  font-weight: 600;
  letter-spacing: 0.04em;
  font-size: 13px;
  cursor: pointer;
  box-shadow: 0 2px 16px rgba(231, 75, 75, 0.45);
}

.btn-primary-full:hover {
  filter: brightness(1.08);
}

.btn-primary-full:focus-visible {
  outline: none;
  box-shadow:
    0 0 0 3px var(--focus-ring),
    0 2px 16px rgba(231, 75, 75, 0.45);
}

/* Icon buttons */
.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(42, 45, 52, 0.85);
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease, color 0.2s ease;
}

.btn-icon:hover {
  border-color: var(--accent);
  background: rgba(231, 75, 75, 0.12);
  box-shadow: 0 0 0 3px rgba(231, 75, 75, 0.15);
  color: var(--text);
}

.btn-icon:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--focus-ring);
}

.btn-accent-ring {
  border-color: rgba(231, 75, 75, 0.35);
  color: var(--accent);
}

.btn-danger-icon:hover {
  border-color: var(--danger);
  background: rgba(255, 107, 107, 0.12);
  color: #ffb4b4;
}

/* App */
.app {
  max-width: 1180px;
  margin: 0 auto;
  min-height: 100vh;
  padding: 28px 24px 48px;
}

.dashboard-layout {
  display: flex;
  align-items: stretch;
  gap: 0;
  min-height: 0;
}

.sidebar {
  width: 258px;
  flex-shrink: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(27, 29, 34, 0.92);
  padding: 14px 10px 18px;
  align-self: flex-start;
  position: sticky;
  top: 12px;
}

.sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
  padding: 0 6px;
}

.sidebar-title {
  font-family: var(--font-head);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.sidebar-tree {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: min(70vh, 560px);
  overflow-y: auto;
}

.sidebar-row {
  display: flex;
  align-items: stretch;
  gap: 4px;
}

.sidebar-item {
  flex: 1;
  min-width: 0;
  text-align: left;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text);
  font-family: var(--font-caps);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition:
    background 0.15s ease,
    border-color 0.15s ease;
}

.sidebar-item:hover {
  background: rgba(231, 75, 75, 0.08);
}

.sidebar-item.is-active {
  border-color: var(--line);
  background: rgba(231, 75, 75, 0.14);
}

.sidebar-item--sub {
  font-size: 12px;
  padding-left: 14px;
}

.sidebar-mini-btn {
  flex-shrink: 0;
  width: 24px;
  min-height: 34px;
  border-radius: 10px;
  border: none;
  background: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.sidebar-mini-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.sidebar-mini-btn.danger:hover {
  border-color: var(--danger);
  color: #ffb4b4;
}

.dashboard-main {
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-left: 20px;
}

.field-select {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(7, 9, 18, 0.45);
  color: var(--text);
  font: inherit;
}

.field-select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--focus-ring);
}

.field-input-full {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(7, 9, 18, 0.45);
  color: var(--text);
  font: inherit;
}

.field-input-full:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--focus-ring);
}

.modal--group {
  z-index: 65;
}

.modal--delete-group {
  z-index: 63;
}

@media (max-width: 900px) {
  .dashboard-layout {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    position: relative;
    top: 0;
    max-height: 240px;
  }

  .dashboard-main {
    padding-left: 0;
    padding-top: 16px;
  }
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 22px;
}

.brand-inline {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-title-inline {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: clamp(1.1rem, 2.5vw, 1.35rem);
  letter-spacing: 0.02em;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-pill {
  font-size: 13px;
  font-family: var(--font-caps);
}

.toolbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
  align-items: center;
}

.search {
  flex: 1;
  min-width: 200px;
  height: var(--toolbar-row-height);
  min-height: var(--toolbar-row-height);
  padding: 0 16px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  font: inherit;
}

.search:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--focus-ring);
}

.empty {
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  font-family: var(--font-caps);
  font-size: 14px;
}

.entry-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.entry-card--row {
  display: grid;
  grid-template-columns:
    minmax(100px, 1.1fr)
    minmax(88px, 1fr)
    minmax(96px, 1fr)
    minmax(96px, 1fr)
    min-content;
  align-items: center;
  gap: 8px 12px;
  padding: 0 16px;
  min-height: var(--toolbar-row-height);
  box-sizing: border-box;
  min-width: min(100%, 720px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.entry-card--row .btn-icon {
  width: calc(var(--toolbar-row-height) - 12px);
  height: calc(var(--toolbar-row-height) - 12px);
  flex-shrink: 0;
}

.entry-card--row .btn-icon .ic {
  width: 18px;
  height: 18px;
}

.entry-title {
  font-weight: 600;
  font-size: 15px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.entry-login--tap {
  font-family: inherit;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  text-align: left;
  color: var(--muted);
  cursor: pointer;
  border-radius: 6px;
}

.entry-login--tap:hover {
  color: var(--accent);
}

.entry-login--tap:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--focus-ring);
}

.entry-login-placeholder {
  font-size: 14px;
  white-space: nowrap;
}

.entry-col.entry-link {
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  color: var(--accent);
}

.entry-link:hover {
  text-decoration: underline;
}

.entry-link--empty {
  cursor: default;
  pointer-events: none;
}

.entry-notes {
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  color: rgba(255, 255, 255, 0.88);
}

.entry-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  justify-content: flex-end;
}

.app-footer {
  margin-top: 32px;
  text-align: center;
  font-size: 12px;
  font-family: var(--font-caps);
}

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal--confirm {
  z-index: 60;
}

.modal.hidden {
  display: none;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(7, 9, 18, 0.72);
  backdrop-filter: blur(6px);
}

.modal-panel {
  position: relative;
  width: min(460px, 100%);
  max-height: 90vh;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.55);
}

.modal-panel--entry {
  width: min(676px, 100%);
}

.stack--entry {
  gap: 0.875rem;
}

/* Форма записи: две колонки как на макете — название | группа; логин | пароль */
#entry-form .entry-field-row {
  display: grid;
  align-items: start;
  gap: 0.75rem 14px;
}

/* Одна линия: инпут и селект одной высоты, колонки по центру по вертикали */
#entry-form .entry-field-row--title-group {
  align-items: center;
}

#entry-form .entry-field-row--split.entry-field-row--title-group {
  grid-template-columns: minmax(0, 1fr) minmax(132px, 36%);
}

#entry-form .entry-field-row--split.entry-field-row--login-password {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

#entry-form .field--no-label {
  margin: 0;
}

#entry-form .field-inline--leading-icon {
  display: flex;
  align-items: center;
  gap: 10px;
}

#entry-form .field-leading-icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  color: var(--muted);
}

#entry-form .field-leading-icon .ic {
  width: 20px;
  height: 20px;
}

#entry-form .field-inline--leading-icon.field-inline--textarea {
  align-items: flex-start;
}

#entry-form .field-inline--leading-icon.field-inline--textarea .field-leading-icon {
  padding-top: 10px;
}

/* Общая обводка поля — на оболочке; контролы без своей рамки */
#entry-form .field-input-shell {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(7, 9, 18, 0.45);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

#entry-form .field-input-shell:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--focus-ring);
}

#entry-form .field-input-shell input,
#entry-form .field-input-shell select.field-select,
#entry-form .field-input-shell textarea {
  flex: 1;
  min-width: 0;
  width: auto;
  max-width: 100%;
  border: none;
  background: transparent;
  box-shadow: none;
  outline: none;
  color: var(--text);
  font: inherit;
  padding: 12px 6px 12px 14px;
}

#entry-form .field-input-shell input:focus,
#entry-form .field-input-shell select.field-select:focus,
#entry-form .field-input-shell textarea:focus {
  outline: none;
  border-color: transparent;
  box-shadow: none;
}

#entry-form .field-input-shell__actions {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  gap: 0;
  padding-right: 4px;
}

#entry-form .field-input-shell__actions--textarea {
  align-self: flex-start;
  padding-top: 8px;
}

#entry-form .field-input-shell--textarea {
  align-items: stretch;
}

#entry-form .field-input-shell--textarea textarea {
  min-height: 4.5rem;
  resize: vertical;
  padding-top: 12px;
  padding-bottom: 12px;
}

#entry-form .field-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease;
}

#entry-form .field-action-btn:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

#entry-form .field-action-btn:focus-visible {
  outline: none;
  color: var(--text);
  box-shadow: 0 0 0 2px var(--focus-ring);
}

#entry-form .ic--field-action {
  width: 18px;
  height: 18px;
}

#entry-form .entry-field-row--title-group .field-input-shell {
  min-height: 44px;
}

#entry-form .entry-field-row--title-group .field-input-shell input,
#entry-form .entry-field-row--title-group .field-input-shell select.field-select {
  min-height: 42px;
  box-sizing: border-box;
  line-height: 1.35;
  padding-top: 11px;
  padding-bottom: 11px;
}

#entry-form .field-inline--leading-icon.field-inline--select-only .field-input-shell {
  flex: 1;
  min-width: 0;
}

@media (max-width: 520px) {
  #entry-form .entry-field-row--split.entry-field-row--title-group,
  #entry-form .entry-field-row--split.entry-field-row--login-password {
    grid-template-columns: 1fr;
  }
}

/* Раскладка: Отмена слева, декоративные точки по центру, Сохранить справа — без переопределения виджетов кнопок */
#modal .modal-actions.modal-actions--split {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
}

#modal .modal-actions.modal-actions--split .btn-secondary {
  justify-self: start;
}

#modal .modal-actions.modal-actions--split .btn-primary {
  justify-self: end;
}

#modal .modal-actions__dots {
  justify-self: center;
  display: flex;
  align-items: center;
  gap: 8px;
}

#modal .modal-actions__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--line);
}

#modal .modal-actions__dot--mid {
  width: 9px;
  height: 9px;
}

.modal-heading {
  font-size: 1.15rem;
  margin-bottom: 1rem;
}

.modal-heading--confirm {
  font-family: var(--font-head);
  font-size: 1.25rem;
  margin-bottom: 0.65rem;
}

.modal-panel--confirm {
  width: min(400px, 100%);
  padding: 1.5rem 1.35rem 1.35rem;
}

.confirm-desc {
  margin: 0 0 1.35rem;
  font-size: 14px;
  line-height: 1.5;
  font-family: var(--font-ui);
}

.share-list {
  max-height: 220px;
  overflow-y: auto;
  margin: 0.5rem 0 0;
}

.share-list-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  font-family: var(--font-ui);
  font-size: 13px;
}

.share-list-remove {
  flex-shrink: 0;
  padding: 6px 12px !important;
  font-size: 12px !important;
}

.entry-shared-badge {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.03em;
}

.sidebar-section-label {
  font-size: 11px;
  font-family: var(--font-caps);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin: 1rem 0 0.35rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--line);
}

.sidebar-share-owner {
  font-size: 12px;
  margin: 0.35rem 0 0.25rem;
  padding-left: 2px;
}

.sidebar-share-block {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 10px;
}

.confirm-actions {
  margin-top: 0;
  flex-wrap: wrap;
}

.btn-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 999px;
  padding: 12px 22px;
  cursor: pointer;
  font-family: var(--font-caps);
  font-weight: 600;
  letter-spacing: 0.04em;
  font-size: 13px;
  background: var(--accent);
  color: #fff;
  box-shadow: 0 2px 16px rgba(231, 75, 75, 0.45);
  transition: filter 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
}

.btn-danger:hover {
  filter: brightness(1.06);
  box-shadow: 0 4px 22px rgba(231, 75, 75, 0.55);
}

.btn-danger:focus-visible {
  outline: none;
  box-shadow:
    0 0 0 3px var(--focus-ring),
    0 2px 16px rgba(231, 75, 75, 0.45);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 0.5rem;
}

.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  padding: 12px 22px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 13px;
  font-family: var(--font-caps);
  z-index: 100;
  animation: toast-in 0.25s ease;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translate(-50%, 12px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

@media (max-width: 640px) {
  .entry-card--row {
    gap: 6px;
    padding: 0 10px;
    min-height: var(--toolbar-row-height);
    min-width: 640px;
    grid-template-columns:
      minmax(90px, 1fr)
      minmax(72px, 0.95fr)
      minmax(88px, 1fr)
      minmax(88px, 1fr)
      min-content;
  }

  .entry-card--row .btn-icon {
    width: calc(var(--toolbar-row-height) - 14px);
    height: calc(var(--toolbar-row-height) - 14px);
  }

  .entry-card--row .btn-icon .ic {
    width: 17px;
    height: 17px;
  }

  .btn-icon {
    width: 38px;
    height: 38px;
  }

  .ic {
    width: 20px;
    height: 20px;
  }
}

/* Затруднение «быстрого» скрина из браузера (ОС всё равно может снять экран). */
.km-screenshot-overlay {
  position: fixed;
  inset: 0;
  z-index: 2147483647;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.07s ease;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
}

.km-screenshot-overlay--on {
  opacity: 1;
  pointer-events: auto;
}

.km-screenshot-overlay__inner {
  padding: 24px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface);
}

.km-screenshot-overlay__text {
  font-family: var(--font-caps);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--muted);
}

@media print {
  html.km-print-hidden body,
  html.km-print-hidden body * {
    visibility: hidden !important;
  }
}
