:root,
[data-theme='dark'] {
  --bg: #0f1419;
  --surface: #1a222d;
  --surface2: #243040;
  --text: #f0f4f8;
  --muted: #8b9cb3;
  --accent: #e85d04;
  --accent-hover: #f48c06;
  --critical: #ef4444;
  --warning: #eab308;
  --success: #22c55e;
  --info: #3b82f6;
  --shadow: rgba(0, 0, 0, 0.35);
  --radius: 12px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --header-h: 56px;
  --touch-min: 44px;
  --nav-h: 64px;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

.hidden {
  display: none !important;
}

[data-theme='light'] {
  --bg: #f0f2f5;
  --surface: #ffffff;
  --surface2: #e2e8f0;
  --text: #1a222d;
  --muted: #64748b;
  --accent: #e85d04;
  --accent-hover: #dc2f02;
  --critical: #dc2626;
  --warning: #ca8a04;
  --success: #16a34a;
  --info: #2563eb;
  --shadow: rgba(15, 20, 25, 0.08);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  overflow: hidden;
}

#app {
  height: 100%;
  max-width: 480px;
  margin: 0 auto;
  position: relative;
  display: flex;
  flex-direction: column;
}

.screen {
  display: none;
  flex: 1;
  flex-direction: column;
  min-height: 0;
  animation: fadeIn 0.2s ease;
}

.screen.active {
  display: flex;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

.header {
  min-height: calc(var(--header-h) + var(--safe-top));
  padding: var(--safe-top) max(12px, var(--safe-right)) 0 max(12px, var(--safe-left));
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border-bottom: 1px solid var(--surface2);
  flex-shrink: 0;
  position: relative;
  z-index: 50;
}

.header h1 {
  font-size: 1.1rem;
  font-weight: 600;
  flex: 1;
}

.app-chrome-menu {
  position: fixed;
  top: calc(6px + var(--safe-top));
  right: max(8px, var(--safe-right));
  z-index: 200;
}

.btn-kebab {
  width: var(--touch-min);
  height: var(--touch-min);
  border: none;
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 2px 8px var(--shadow);
}

.app-menu-dropdown {
  position: absolute;
  top: 44px;
  right: 0;
  min-width: 140px;
  background: var(--surface);
  border: 1px solid var(--surface2);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px var(--shadow);
  overflow: hidden;
}

.app-menu-dropdown button {
  display: block;
  width: 100%;
  padding: 14px 16px;
  border: none;
  background: none;
  color: var(--text);
  font-size: 0.95rem;
  text-align: left;
  cursor: pointer;
}

.app-menu-dropdown button:active {
  background: var(--surface2);
}

.back-btn {
  background: none;
  border: none;
  color: var(--accent);
  font-size: 2rem;
  line-height: 1;
  min-width: var(--touch-min);
  min-height: var(--touch-min);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0;
  cursor: pointer;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.header .back-btn {
  margin-left: -4px;
}

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #dc2f02);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  color: #fff;
  overflow: hidden;
  flex-shrink: 0;
}

.avatar.has-photo {
  background: var(--surface2);
  color: transparent;
}

.avatar-lg {
  width: 72px;
  height: 72px;
  font-size: 1.5rem;
  margin: 0 auto;
}

.avatar-upload-wrap {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.avatar-upload-hint {
  font-size: 0.78rem;
  color: var(--accent);
}

.badge-dot {
  position: relative;
}

.badge-dot::after {
  content: '';
  position: absolute;
  top: -2px;
  right: -2px;
  width: 10px;
  height: 10px;
  background: var(--critical);
  border-radius: 50%;
  border: 2px solid var(--surface);
  display: none;
}

.badge-dot.has-notify::after {
  display: block;
}

.scroll-body {
  flex: 1;
  overflow-y: auto;
  padding: 12px max(16px, var(--safe-left)) calc(80px + var(--safe-bottom)) max(16px, var(--safe-right));
  -webkit-overflow-scrolling: touch;
}

.scroll-body-auth {
  padding-top: calc(24px + var(--safe-top));
  padding-bottom: calc(24px + var(--safe-bottom));
}

.search-row {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.search-row input {
  flex: 1;
  padding: 12px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--surface2);
  background: var(--surface);
  color: var(--text);
  font-size: 1rem;
}

.search-row input::placeholder {
  color: var(--muted);
}

.btn-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius);
  border: 1px solid var(--surface2);
  background: var(--surface);
  color: var(--text);
  font-size: 1.2rem;
  cursor: pointer;
}

.chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  margin-bottom: 12px;
  scrollbar-width: none;
}

.chips::-webkit-scrollbar {
  display: none;
}

.chip {
  flex-shrink: 0;
  padding: 8px 14px;
  border-radius: 20px;
  border: 1px solid var(--surface2);
  background: var(--surface);
  color: var(--muted);
  font-size: 0.85rem;
  cursor: pointer;
  white-space: nowrap;
}

.chip.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 10px;
  border-left: 4px solid var(--info);
  cursor: pointer;
  transition: transform 0.1s;
}

.card:active {
  transform: scale(0.98);
}

.card.status-overdue { border-left-color: var(--critical); }
.card.status-in_progress { border-left-color: var(--warning); }
.card.status-resolved,
.card.status-verified { border-left-color: var(--success); }
.card.status-new { border-left-color: var(--info); }

.card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 6px;
}

.card-num {
  font-weight: 700;
  color: var(--accent);
  font-size: 0.95rem;
}

.status-pill {
  font-size: 0.7rem;
  padding: 3px 8px;
  border-radius: 10px;
  font-weight: 600;
  text-transform: uppercase;
}

.status-pill.overdue { background: rgba(239, 68, 68, 0.2); color: var(--critical); }
.status-pill.in_progress { background: rgba(234, 179, 8, 0.2); color: var(--warning); }
.status-pill.new { background: rgba(59, 130, 246, 0.2); color: var(--info); }
.status-pill.resolved,
.status-pill.verified { background: rgba(34, 197, 94, 0.2); color: var(--success); }

.card-meta {
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.5;
}

.card-desc {
  margin-top: 8px;
  font-size: 0.9rem;
  line-height: 1.4;
}

.card-deadline {
  margin-top: 8px;
  font-size: 0.8rem;
}

.card-deadline.overdue {
  color: var(--critical);
  font-weight: 600;
}

.fab {
  position: fixed;
  right: max(16px, calc(50% - 240px + 16px));
  bottom: calc(var(--nav-h) + 16px + var(--safe-bottom));
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  border: none;
  font-size: 2rem;
  line-height: 1;
  box-shadow: 0 4px 20px rgba(232, 93, 4, 0.45);
  cursor: pointer;
  z-index: 50;
}

.fab.hidden {
  display: none;
}

.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  height: calc(var(--nav-h) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  background: var(--surface);
  border-top: 1px solid var(--surface2);
  display: flex;
  z-index: 40;
}

.bottom-nav.hidden {
  display: none;
}

.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: var(--touch-min);
  background: none;
  border: none;
  color: var(--muted);
  font-size: 0.65rem;
  cursor: pointer;
  touch-action: manipulation;
  padding-top: 8px;
}

.nav-item .icon {
  font-size: 1.35rem;
}

.nav-item.active {
  color: var(--accent);
}

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

.form-group label {
  display: block;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 6px;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--surface2);
  background: var(--surface);
  color: var(--text);
  font-size: 1rem;
}

.form-group textarea {
  min-height: 100px;
  resize: vertical;
}

.btn-primary {
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: var(--radius);
  background: var(--accent);
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  margin-top: 8px;
}

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

.btn-secondary {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--surface2);
  border-radius: var(--radius);
  background: transparent;
  color: var(--text);
  font-size: 0.95rem;
  cursor: pointer;
  margin-top: 8px;
}

.link-muted {
  display: block;
  text-align: center;
  margin-top: 16px;
  color: var(--muted);
  font-size: 0.9rem;
  text-decoration: none;
}

.wizard-steps {
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
}

.wizard-steps span {
  flex: 1;
  height: 4px;
  border-radius: 2px;
  background: var(--surface2);
}

.wizard-steps span.done {
  background: var(--accent);
}

.wizard-steps span.current {
  background: var(--accent-hover);
}

.wizard-steps span.done {
  cursor: pointer;
}

.wizard-nav-row {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: 10px;
  margin-top: 12px;
  width: 100%;
  box-sizing: border-box;
}

.wizard-nav-row .btn-primary,
.wizard-nav-row .btn-secondary {
  width: auto;
  max-width: none;
  margin-top: 0;
}

.wizard-nav-row .btn-secondary {
  flex: 0 0 36%;
  min-width: 0;
  padding: 14px 10px;
  white-space: nowrap;
}

.wizard-nav-row .btn-primary {
  flex: 1 1 0;
  min-width: 0;
}

.login-mode-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}

.login-mode-btn {
  flex: 1;
  padding: 12px 8px;
  border-radius: var(--radius);
  border: 1px solid var(--surface2);
  background: var(--surface);
  color: var(--text);
  font-size: 0.85rem;
  cursor: pointer;
}

.login-mode-btn.active {
  border-color: var(--accent);
  background: rgba(232, 93, 4, 0.15);
  color: var(--accent);
  font-weight: 600;
}

.category-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.category-item {
  padding: 20px 12px;
  border-radius: var(--radius);
  border: 1px solid var(--surface2);
  background: var(--surface);
  text-align: center;
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.25;
  cursor: pointer;
  color: var(--text);
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.category-item.selected {
  border-color: var(--accent);
  background: rgba(232, 93, 4, 0.15);
}

.severity-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.severity-btn {
  padding: 14px;
  border-radius: var(--radius);
  border: 1px solid var(--surface2);
  background: var(--surface);
  text-align: left;
  cursor: pointer;
  color: var(--text);
}

.severity-btn.selected {
  border-color: var(--accent);
}

.severity-btn strong {
  display: block;
  margin-bottom: 4px;
}

.severity-btn small {
  color: var(--muted);
  font-size: 0.8rem;
}

.media-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 8px;
}

.media-thumb {
  aspect-ratio: 1;
  border-radius: 8px;
  object-fit: cover;
  background: var(--surface2);
}

.media-thumb-wrap {
  position: relative;
  aspect-ratio: 1;
}

.media-thumb-wrap .media-thumb {
  width: 100%;
  height: 100%;
}

.media-del {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 24px;
  height: 24px;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
}

.media-add {
  aspect-ratio: 1;
  border-radius: 8px;
  border: 2px dashed var(--surface2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: var(--muted);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.media-file-input {
  position: absolute;
  width: 0.1px;
  height: 0.1px;
  opacity: 0;
  overflow: hidden;
  z-index: -1;
}

.detail-gallery {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  margin-bottom: 16px;
  padding-bottom: 4px;
}

.detail-gallery img {
  height: 160px;
  border-radius: var(--radius);
  object-fit: cover;
  flex-shrink: 0;
}

.info-block {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 12px;
}

.info-block h3 {
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 10px;
  letter-spacing: 0.05em;
}

.info-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  font-size: 0.9rem;
  border-bottom: 1px solid var(--surface2);
}

.info-row:last-child {
  border-bottom: none;
}

.timeline {
  margin-top: 8px;
}

.timeline-item {
  padding-left: 16px;
  border-left: 2px solid var(--surface2);
  margin-bottom: 12px;
  position: relative;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -5px;
  top: 4px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}

.timeline-item time {
  font-size: 0.75rem;
  color: var(--muted);
}

.comments {
  max-height: 200px;
  overflow-y: auto;
}

.comment {
  background: var(--surface2);
  border-radius: 8px;
  padding: 10px;
  margin-bottom: 8px;
  font-size: 0.9rem;
}

.comment-meta {
  font-size: 0.75rem;
  color: var(--muted);
  margin-bottom: 4px;
}

.action-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.action-bar button {
  flex: 1;
  min-width: calc(50% - 4px);
  padding: 10px;
  border-radius: var(--radius);
  border: 1px solid var(--surface2);
  background: var(--surface);
  color: var(--text);
  font-size: 0.85rem;
  cursor: pointer;
}

.action-bar button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.kpi-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 16px;
}

.kpi-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 14px;
  text-align: center;
}

.kpi-card .value {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--accent);
}

.kpi-card .label {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 4px;
}

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

.empty-state .icon {
  font-size: 3rem;
  margin-bottom: 12px;
}

.toast {
  position: fixed;
  top: 70px;
  left: 50%;
  transform: translateX(-50%);
  max-width: 90%;
  padding: 12px 20px;
  background: var(--surface2);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.toast.show {
  opacity: 1;
}

.login-logo {
  text-align: center;
  padding: 48px 0 32px;
}

.login-logo h2 {
  font-size: 1.75rem;
  color: var(--accent);
}

.login-logo p {
  color: var(--muted);
  margin-top: 8px;
  font-size: 0.9rem;
}

.role-choice-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 8px;
}

.role-choice-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  width: 100%;
  padding: 18px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.role-choice-card.primary {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, var(--surface));
}

.role-choice-card .role-icon {
  font-size: 1.5rem;
}

.role-choice-card strong {
  font-size: 1rem;
}

.role-choice-card .role-desc {
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.4;
}

.filter-panel {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 12px;
  display: none;
}

.filter-panel.open {
  display: block;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 60;
  display: none;
  align-items: flex-end;
  justify-content: center;
}

.modal-overlay.open {
  display: flex;
}

.modal-sheet {
  width: 100%;
  max-width: 480px;
  max-height: 70vh;
  background: var(--surface);
  border-radius: 16px 16px 0 0;
  padding: 20px 16px calc(20px + var(--safe-bottom));
  overflow-y: auto;
}

.modal-sheet h3 {
  margin-bottom: 16px;
}

input[type='file']:not(.media-file-input) {
  display: none;
}

.theme-toggle {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.theme-toggle button {
  flex: 1;
  padding: 12px;
  border-radius: var(--radius);
  border: 1px solid var(--surface2);
  background: var(--bg);
  color: var(--muted);
  font-size: 0.9rem;
  cursor: pointer;
}

.theme-toggle button.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.settings-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 14px 0;
  border: none;
  border-bottom: 1px solid var(--surface2);
  background: none;
  color: var(--text);
  font-size: 0.95rem;
  cursor: pointer;
  text-align: left;
}

.settings-link:last-child {
  border-bottom: none;
}

.dir-list {
  margin-top: 12px;
}

.dir-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px;
  background: var(--bg);
  border-radius: var(--radius);
  margin-bottom: 8px;
  border: 1px solid var(--surface2);
}

.dir-item main {
  flex: 1;
  min-width: 0;
}

.dir-item .title {
  font-weight: 600;
  font-size: 0.9rem;
  word-break: break-word;
}

.dir-item .sub {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 4px;
}

.dir-item .type-badge {
  display: inline-block;
  font-size: 0.65rem;
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(232, 93, 4, 0.15);
  color: var(--accent);
  margin-right: 6px;
}

.btn-delete {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 8px;
  background: rgba(239, 68, 68, 0.15);
  color: var(--critical);
  font-size: 1.1rem;
  cursor: pointer;
}

.inline-form {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--surface2);
}

.inline-form .row {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

.inline-form .row > * {
  flex: 1;
}

.inline-form input,
.inline-form select {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--surface2);
  background: var(--bg);
  color: var(--text);
  font-size: 0.9rem;
}

.btn-sm {
  padding: 10px 14px;
  border: none;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

[data-theme='light'] .toast {
  box-shadow: 0 8px 24px var(--shadow);
}

[data-theme='light'] .card:active {
  background: var(--surface2);
}

.action-bar button.share-tg {
  border-color: #229ed9;
  color: #229ed9;
}

.action-bar button.share-email {
  border-color: var(--muted);
}

.push-card {
  background: var(--bg);
  border: 1px solid var(--surface2);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 10px;
  cursor: pointer;
  white-space: pre-line;
  font-size: 0.85rem;
  line-height: 1.45;
}

.push-card.unread {
  border-left: 3px solid var(--accent);
}

.push-card .push-meta {
  font-size: 0.7rem;
  color: var(--muted);
  margin-top: 8px;
  display: flex;
  justify-content: space-between;
}

.push-card .push-action {
  color: var(--accent);
  font-weight: 600;
}

.push-card.channel-email {
  font-size: 0.8rem;
}

.push-card .email-subject {
  font-weight: 600;
  margin-bottom: 6px;
}

.push-card.tg-sent {
  border-left: 3px solid var(--accent);
}

.push-card.tg-failed {
  border-left: 3px solid #ef4444;
}

.tg-preview {
  margin: 8px 0 0;
  padding: 8px;
  font-size: 0.75rem;
  line-height: 1.4;
  white-space: pre-wrap;
  word-break: break-word;
  background: var(--bg);
  border-radius: 8px;
  color: var(--muted);
  max-height: 120px;
  overflow: hidden;
}

.notify-check {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  font-size: 0.95rem;
  cursor: pointer;
}

.email-preview-box {
  background: var(--bg);
  border: 1px solid var(--surface2);
  border-radius: var(--radius);
  padding: 12px;
  max-height: 220px;
  overflow-y: auto;
  font-size: 0.75rem;
  line-height: 1.4;
}

.email-recipients-list {
  border: 1px solid var(--surface2);
  border-radius: var(--radius);
  overflow: hidden;
}

.email-recipient-row {
  padding: 10px 12px !important;
  border-bottom: 1px solid var(--surface2);
}

.email-recipient-row:last-child {
  border-bottom: none;
}

.email-preview-box pre {
  white-space: pre-wrap;
  margin-top: 8px;
  color: var(--muted);
  font-family: inherit;
}

.notify-banner {
  background: rgba(232, 93, 4, 0.15);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  padding: 12px;
  font-size: 0.85rem;
  margin-bottom: 12px;
  line-height: 1.4;
}

.notify-banner.hidden {
  display: none;
}

.role-matrix {
  font-size: 0.8rem;
  overflow-x: auto;
}

.role-matrix table {
  width: 100%;
  border-collapse: collapse;
}

.role-matrix th,
.role-matrix td {
  padding: 6px 8px;
  text-align: center;
  border-bottom: 1px solid var(--surface2);
}

.role-matrix th:first-child,
.role-matrix td:first-child {
  text-align: left;
}

.notify-settings .notify-section {
  margin-bottom: 16px;
}

.notify-settings .notify-section h4 {
  font-size: 0.95rem;
  margin-bottom: 8px;
  color: var(--accent);
}

.notify-settings .notify-section.disabled h4 {
  color: var(--muted);
}

.notify-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--surface2);
  font-size: 0.9rem;
}

.notify-row:last-child {
  border-bottom: none;
}

.notify-row.muted {
  opacity: 0.45;
  pointer-events: none;
}

.notify-row input[type='checkbox'] {
  width: 20px;
  height: 20px;
  accent-color: var(--accent);
}

.notify-quiet {
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 6px;
}
