:root {
  --bg: #eef2f7;
  --panel: #ffffff;
  --ink: #122033;
  --muted: #66758a;
  --line: #e4eaf2;
  --brand: #4f46e5;
  --brand-2: #6366f1;
  --danger: #e11d48;
  --shadow: 0 10px 30px rgba(18, 32, 51, 0.08);
  font-family: "Segoe UI", "Nunito", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--ink);
}

body {
  display: grid;
  grid-template-columns: 240px 1fr;
}

a {
  color: inherit;
}

button,
input,
select,
textarea {
  font: inherit;
}

.auth-body {
  display: grid;
  grid-template-columns: 1fr;
  place-items: center;
  min-height: 100vh;
  background:
    radial-gradient(circle at 20% 20%, #c7d2fe, transparent 35%),
    radial-gradient(circle at 80% 10%, #fce7f3, transparent 30%),
    var(--bg);
}

.auth-card {
  width: min(420px, 92vw);
  background: var(--panel);
  border-radius: 24px;
  padding: 36px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 12px;
}

.logo,
.brand {
  margin: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  text-decoration: none;
  color: inherit;
}

.logo img,
.brand img {
  display: block;
  height: 40px;
  width: auto;
  margin: 0 auto;
}

.sidebar .brand {
  width: 100%;
}

.sidebar .brand img {
  height: 44px;
  max-width: 180px;
  object-fit: contain;
}

.auth-card h1,
.content h1 {
  margin: 0 0 6px;
  font-size: 28px;
}

.muted,
.hint {
  color: var(--muted);
  margin: 0 0 10px;
}

.hint {
  font-size: 13px;
}

label {
  display: grid;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 11px 12px;
  background: #f8fafc;
  font-weight: 400;
}

input::placeholder,
textarea::placeholder {
  font-weight: 400;
  color: var(--muted);
  opacity: 1;
}

.alert {
  background: #ffe4e6;
  color: #9f1239;
  padding: 10px 12px;
  border-radius: 12px;
  margin: 0;
}

.toast-stack {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 50;
  display: grid;
  gap: 8px;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  min-width: 220px;
  max-width: min(360px, calc(100vw - 32px));
  background: #111827;
  color: #fff;
  padding: 12px 16px;
  border-radius: 14px;
  box-shadow: var(--shadow);
  font-weight: 600;
  font-size: 14px;
  animation: toast-in 0.18s ease-out;
}

.toast.is-error {
  background: #9f1239;
}

.toast.is-out {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.sidebar {
  background: #111827;
  color: #e5e7eb;
  min-height: 100vh;
  padding: 24px 18px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.sidebar nav {
  display: grid;
  gap: 6px;
}

.sidebar a {
  text-decoration: none;
  padding: 10px 12px;
  border-radius: 12px;
  color: #cbd5e1;
}

.sidebar a.active,
.sidebar a:hover {
  background: #1f2937;
  color: #fff;
}

.sidebar a.brand,
.sidebar a.brand:hover,
.sidebar a.brand.active {
  padding: 0;
  background: transparent;
  color: inherit;
}

.sidebar-user {
  margin-top: auto;
  display: grid;
  gap: 4px;
  font-size: 14px;
}

.sidebar-user span,
.sidebar-user a {
  color: #94a3b8;
  padding: 0;
}

.sidebar-link {
  color: #93c5fd;
  text-align: left;
  padding: 0;
  font-weight: 700;
}

.check-line {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
}

.check-line input {
  width: auto;
}

.task-meta {
  display: block;
  color: var(--muted);
}

.task-block {
  display: grid;
  gap: 8px;
}

.task-hint {
  margin: 0;
  font-size: 13px;
}

.check-list,
.comment-list {
  display: grid;
  gap: 8px;
}

.check-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
}

.check-item .check-line {
  min-width: 0;
  font-weight: 600;
}

.check-item-title {
  overflow-wrap: anywhere;
}

.check-item input:checked + .check-item-title {
  text-decoration: line-through;
  color: var(--muted);
}

.check-add,
.comment-add {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: start;
}

.comment-item {
  background: #f8fafc;
  border-radius: 12px;
  padding: 10px 12px;
}

.comment-item.is-stage {
  background: #eef2ff;
}

.comment-item.is-file {
  background: #ecfdf5;
}

.comment-item.is-touch {
  background: #fff7ed;
}

.touch-fields,
.req-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.card-touch {
  margin: 6px 0 0;
  font-size: 13px;
  font-weight: 600;
}

.card p.card-touch {
  color: var(--brand);
}

.card p.card-touch.overdue {
  color: var(--danger);
}

.card.is-overdue {
  box-shadow: 0 0 0 1.5px #fecaca, var(--shadow);
  background: #fff7f7;
}

.card-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
}

.card-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 12px;
  font-weight: 700;
  background: #eef2ff;
  color: var(--brand);
}

.card-badge.is-overdue {
  background: #fee2e2;
  color: var(--danger);
}

.file-list {
  display: grid;
  gap: 8px;
}

.file-add {
  display: grid;
  grid-template-columns: 140px 1fr auto;
  gap: 8px;
  align-items: center;
}

.file-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
  background: #f8fafc;
  border-radius: 12px;
  padding: 8px 10px;
}

.file-link {
  display: grid;
  gap: 2px;
  min-width: 0;
  text-decoration: none;
}

.file-kind {
  font-size: 12px;
  font-weight: 700;
  color: var(--brand);
}

.file-name {
  font-weight: 600;
  overflow-wrap: anywhere;
}

.file-meta {
  font-size: 13px;
  color: var(--muted);
}

.card-files {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

.comment-item p {
  margin: 6px 0 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.comment-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.comment-head span {
  color: var(--muted);
}

.comment-head .text-btn {
  margin-left: auto;
}

.picked-list,
.related-tasks {
  display: grid;
  gap: 8px;
}

.picked-add {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
}

.new-contact {
  display: grid;
  gap: 8px;
  background: #f8fafc;
  border-radius: 12px;
  padding: 12px;
}

.new-contact[hidden] {
  display: none !important;
}

.picked-item,
.related-task {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
  background: #f8fafc;
  border-radius: 12px;
  padding: 8px 10px;
  text-align: left;
}

.related-task {
  width: 100%;
  border: 0;
  cursor: pointer;
  font: inherit;
}

.related-task span:last-child {
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.related-task.is-done .related-task-title {
  text-decoration: line-through;
  color: var(--muted);
}

.related-task-title {
  overflow-wrap: anywhere;
}

.content {
  padding: 28px;
  min-width: 0;
}

.app-footer {
  margin-top: 36px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
}

.app-footer a,
.app-footer-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 16px;
  border-radius: 12px;
  background: #fff;
  color: var(--brand);
  font-weight: 700;
  font-size: 14px;
  text-decoration: none;
  box-shadow: var(--shadow);
}

.app-footer a:hover,
.app-footer-link:hover {
  background: #eef2ff;
  text-decoration: none;
}

.app-footer a.app-footer-studio {
  background: transparent;
  box-shadow: none;
  color: var(--muted);
  padding-left: 0;
  padding-right: 8px;
}

.app-footer a.app-footer-studio:hover {
  background: transparent;
  color: var(--brand);
}

.auth-stack {
  display: grid;
  gap: 16px;
  justify-items: center;
  width: min(420px, 92vw);
}

.auth-stack .auth-card {
  width: 100%;
}

.auth-credit {
  margin: 8px 0 0;
  text-align: center;
  font-size: 14px;
  font-weight: 400;
  color: var(--muted);
}

.auth-credit a {
  color: var(--brand);
  font-weight: 700;
  text-decoration: none;
}

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

.app-footer-auth {
  margin: 0;
  padding: 0;
  border: 0;
  width: 100%;
}

.app-footer-auth a {
  width: 100%;
  box-sizing: border-box;
}

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

.today-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 18px;
  align-items: start;
}

.today-col {
  background: var(--panel);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 16px;
  display: grid;
  gap: 12px;
}

.today-col h2 {
  margin: 8px 0 0;
  font-size: 16px;
}

.today-col h2:first-child {
  margin-top: 0;
}

.today-list {
  display: grid;
  gap: 8px;
}

.today-item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: start;
  background: #f8fafc;
  border-radius: 12px;
  padding: 10px 12px;
}

.today-item .check {
  margin-top: 2px;
}

.today-item-body,
.today-deal {
  display: grid;
  justify-items: start;
  gap: 2px;
  width: 100%;
  border: 0;
  background: none;
  padding: 0;
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: inherit;
}

.today-item-body strong,
.today-deal strong {
  font-size: 14px;
}

.today-item-body small,
.today-deal small,
.today-deal em {
  color: var(--muted);
  font-size: 13px;
  font-style: normal;
}

.today-deal {
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 12px;
  background: #f8fafc;
  border-radius: 12px;
  padding: 10px 12px;
}

.today-deal-meta {
  display: grid;
  justify-items: end;
  gap: 2px;
  white-space: nowrap;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}

.filters input[data-filter-q] {
  flex: 1 1 240px;
  min-width: 180px;
}

.filters select {
  flex: 1 1 160px;
  min-width: 160px;
}

.filter-check {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
}

.filter-check input {
  width: auto;
}

.filter-empty {
  margin: 12px 0 0;
}

.empty-state {
  background: var(--panel);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 48px 24px;
  text-align: center;
  display: grid;
  justify-items: center;
  gap: 8px;
}

.empty-state h2 {
  margin: 0;
  font-size: 20px;
}

.empty-state p {
  margin: 0;
  max-width: 38ch;
  color: var(--muted);
}

.empty-state .btn {
  margin-top: 8px;
}

a.btn {
  display: inline-block;
  text-decoration: none;
  text-align: center;
}

.invoice-item {
  display: grid;
  gap: 8px;
  background: #f8fafc;
  border-radius: 12px;
  padding: 12px;
}

.invoice-item-nums {
  display: grid;
  grid-template-columns: 1fr 90px 1fr;
  gap: 8px;
}

.invoice-item input {
  min-width: 0;
}

.invoice-downloads {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.invoice-downloads .text-btn {
  margin-left: 0;
}

.org-images {
  display: grid;
  gap: 10px;
  background: #f8fafc;
  border-radius: 12px;
  padding: 12px;
}

.org-images-hint {
  margin: 0;
  font-size: 13px;
  line-height: 1.4;
  color: var(--muted);
}

.org-image-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.org-image-slot {
  display: grid;
  gap: 6px;
}

.org-image-title {
  font-size: 13px;
  font-weight: 600;
}

.org-image-preview {
  height: 96px;
  border-radius: 10px;
  border: 1px dashed #cbd5e1;
  background-color: #fff;
  background-image: linear-gradient(45deg, #e2e8f0 25%, transparent 25%),
    linear-gradient(-45deg, #e2e8f0 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #e2e8f0 75%),
    linear-gradient(-45deg, transparent 75%, #e2e8f0 75%);
  background-size: 16px 16px;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.org-image-preview img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.org-image-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.column[hidden],
.card[hidden],
tr[hidden] {
  display: none !important;
}

.btn,
.auth-card button {
  border: 0;
  background: linear-gradient(180deg, var(--brand-2), var(--brand));
  color: #fff;
  border-radius: 12px;
  padding: 11px 16px;
  font-weight: 700;
  cursor: pointer;
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 18px;
}

.stats article {
  background: var(--panel);
  border-radius: 16px;
  padding: 14px 16px;
  box-shadow: var(--shadow);
}

.stats span {
  color: var(--muted);
  font-size: 13px;
}

.stats strong {
  display: block;
  font-size: 22px;
  margin-top: 4px;
}

.board {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 12px;
}

.column {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 18px;
  min-height: 62vh;
  flex: 0 0 260px;
  display: flex;
  flex-direction: column;
}

.column header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px;
}

.column h2 {
  font-size: 14px;
  margin: 0;
  flex: 1;
}

.column em {
  color: var(--muted);
  font-style: normal;
  font-size: 12px;
}

.dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

.column-body {
  padding: 0 10px 10px;
  display: grid;
  align-content: start;
  gap: 10px;
  min-height: 120px;
  flex: 1;
}

.column-body.dragover {
  background: #eef2ff;
}

.card {
  background: var(--panel);
  border-radius: 14px;
  padding: 12px;
  box-shadow: var(--shadow);
  cursor: grab;
}

.card h3 {
  margin: 0 0 6px;
  font-size: 15px;
}

.card p,
.card footer span {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.card footer {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 10px;
}

.table-wrap {
  background: var(--panel);
  border-radius: 18px;
  box-shadow: var(--shadow);
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

th {
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

small {
  display: block;
  color: var(--muted);
  margin-top: 4px;
}

.is-done td {
  opacity: 0.55;
}

.is-done .linkish {
  text-decoration: line-through;
}

.overdue {
  color: var(--danger);
  font-weight: 700;
}

.linkish,
.text-btn {
  border: 0;
  background: none;
  padding: 0;
  color: var(--brand);
  cursor: pointer;
  font-weight: 700;
}

.contact-link {
  color: var(--brand);
  font-weight: 700;
  text-decoration: none;
}

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

.field-link {
  display: inline-block;
  margin: -4px 0 8px;
  font-size: 13px;
}

.text-btn.danger {
  color: var(--danger);
  margin-left: 10px;
}

.check {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  border: 2px solid #cbd5e1;
  background: #fff;
  cursor: pointer;
}

.check.on {
  background: var(--brand);
  border-color: var(--brand);
}

.modal-back {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  display: grid;
  place-items: center;
  padding: 20px;
  z-index: 20;
}

.modal {
  width: min(560px, 100%);
  max-height: min(92vh, 820px);
  overflow: auto;
  background: #fff;
  border-radius: 20px;
  padding: 22px;
  display: grid;
  gap: 12px;
}

.modal.modal-wide {
  width: min(760px, 100%);
}

.modal h2 {
  margin: 0;
}

.modal-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.modal-actions-right {
  display: flex;
  align-items: center;
  gap: 18px;
}

.modal-actions-right .text-btn.danger {
  margin-left: 0;
}

.contacts-block {
  display: grid;
  gap: 8px;
}

.contacts-label {
  font-size: 13px;
  font-weight: 700;
}

.contact-list {
  display: grid;
  gap: 8px;
}

.contact-row {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 8px;
  align-items: center;
}

.ghost {
  background: #e2e8f0;
  color: var(--ink);
}

.ghost-icon {
  width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 700;
}

.ghost-icon:disabled {
  opacity: 0.35;
  cursor: default;
}

input[type="color"] {
  width: 52px;
  height: 36px;
  padding: 3px;
}

.mobile-bar,
.sidebar-backdrop {
  display: none;
}

.menu-toggle {
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 12px;
  background: #1f2937;
  color: #fff;
  font-size: 22px;
  cursor: pointer;
}

input,
select,
textarea,
button {
  font-size: 16px;
}

@media (max-width: 980px) {
  .toast-stack {
    right: 12px;
    left: 12px;
    bottom: calc(12px + env(safe-area-inset-bottom));
  }

  .toast {
    max-width: none;
  }

  body {
    grid-template-columns: 1fr;
    min-height: 100dvh;
  }

  body.menu-open {
    overflow: hidden;
  }

  .mobile-bar {
    display: grid;
    grid-template-columns: 44px 1fr 44px;
    align-items: center;
    gap: 8px;
    position: sticky;
    top: 0;
    z-index: 30;
    padding: 10px 12px;
    padding-top: calc(10px + env(safe-area-inset-top));
    background: #111827;
    color: #fff;
  }

  .mobile-bar .brand {
    justify-self: center;
  }

  .mobile-bar .brand img {
    height: 28px;
    max-width: 160px;
    object-fit: contain;
  }

  .desktop-brand {
    display: none;
  }

  .sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    z-index: 35;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
  }

  body.menu-open .sidebar-backdrop {
    opacity: 1;
    pointer-events: auto;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(82vw, 320px);
    z-index: 40;
    min-height: 100dvh;
    padding-top: calc(24px + env(safe-area-inset-top));
    transform: translateX(-105%);
    transition: transform 0.22s ease;
    flex-direction: column;
    align-items: stretch;
  }

  body.menu-open .sidebar {
    transform: translateX(0);
  }

  .sidebar nav {
    grid-auto-flow: row;
  }

  .sidebar a,
  .sidebar-link {
    min-height: 44px;
    display: flex;
    align-items: center;
  }

  .sidebar a.brand {
    min-height: 0;
  }

  .sidebar-user {
    margin: auto 0 0;
  }

  .content {
    padding: 16px 14px calc(20px + env(safe-area-inset-bottom));
  }

  .app-footer {
    margin-top: 24px;
    padding-top: 14px;
  }

  .app-footer a,
  .app-footer-link {
    width: 100%;
    box-sizing: border-box;
  }

  .content h1,
  .auth-card h1 {
    font-size: 24px;
  }

  .top {
    flex-direction: column;
    align-items: stretch;
  }

  .top .btn {
    width: 100%;
  }

  .top-actions {
    flex-direction: column;
    margin-bottom: 16px;
  }

  .today-grid,
  .today-deal {
    grid-template-columns: 1fr;
  }

  .today-deal-meta {
    justify-items: start;
  }

  .filters {
    flex-direction: column;
  }

  .filters input[data-filter-q],
  .filters select {
    flex: 1 1 auto;
    width: 100%;
    min-width: 0;
  }

  .stats {
    grid-template-columns: 1fr 1fr;
  }

  .stats strong {
    font-size: 18px;
  }

  .board {
    margin: 0 -14px;
    padding: 4px 14px 16px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
  }

  .column {
    flex: 0 0 min(84vw, 320px);
    min-height: 52vh;
    scroll-snap-align: start;
  }

  .table-wrap {
    overflow: visible;
    background: transparent;
    box-shadow: none;
    border-radius: 0;
  }

  table,
  tbody,
  tr,
  td {
    display: block;
    width: 100%;
  }

  thead {
    display: none;
  }

  tr {
    background: var(--panel);
    border-radius: 16px;
    box-shadow: var(--shadow);
    padding: 12px 14px;
    margin-bottom: 10px;
  }

  th,
  td {
    border: 0;
    padding: 6px 0;
  }

  td[data-label] {
    display: grid;
    grid-template-columns: 110px 1fr;
    gap: 8px;
    align-items: start;
  }

  td[data-label]::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
  }

  td.row-check,
  td.row-actions {
    display: flex;
    gap: 10px;
    padding-top: 8px;
  }

  .text-btn.danger {
    margin-left: 0;
  }

  .check {
    width: 28px;
    height: 28px;
  }

  .ghost-icon {
    width: 40px;
    height: 40px;
  }

  .modal-back {
    padding: 0;
    align-items: end;
  }

  .modal {
    width: 100%;
    max-height: min(94dvh, 100%);
    border-radius: 20px 20px 0 0;
    padding: 18px 16px calc(18px + env(safe-area-inset-bottom));
  }

  .modal-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .modal-actions .btn,
  .modal-actions-right {
    width: 100%;
    justify-content: space-between;
  }

  .picked-add,
  .contact-row,
  .check-add,
  .comment-add,
  .picked-item,
  .related-task {
    grid-template-columns: 1fr;
  }

  .check-item {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .auth-card {
    width: min(420px, calc(100vw - 24px));
    padding: 24px 18px;
    margin: 16px;
  }
}

@media (max-width: 560px) {
  .stats {
    grid-template-columns: 1fr;
  }

  .file-add {
    grid-template-columns: 1fr;
  }

  .touch-fields,
  .req-fields {
    grid-template-columns: 1fr;
  }

  .invoice-item-nums {
    grid-template-columns: 1fr;
  }

  .org-image-grid {
    grid-template-columns: 1fr;
  }
}

.auth-card.install-card {
  width: min(640px, 94vw);
  gap: 14px;
}

.install-card h2 {
  margin: 12px 0 0;
  font-size: 16px;
}

.install-form {
  display: grid;
  gap: 12px;
}

.install-grid,
.install-row {
  display: grid;
  gap: 12px;
}

.req-list {
  list-style: none;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8fafc;
  display: grid;
  gap: 4px;
  font-size: 13px;
}

.req-ok {
  color: #047857;
}

.req-bad {
  color: #be123c;
  font-weight: 700;
}

.req-warn {
  color: var(--muted);
}

.check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}

.check-row input {
  width: auto;
}

.hint-inline {
  font-weight: 500;
  color: var(--muted);
  font-size: 13px;
}

.install-done {
  display: grid;
  gap: 10px;
  padding: 12px;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid var(--line);
}

.install-done code {
  font-size: 14px;
}

.install-card .btn {
  display: inline-flex;
  justify-content: center;
  text-decoration: none;
}

@media (min-width: 640px) {
  .install-row {
    grid-template-columns: 1fr 1fr;
  }
}

.update-box {
  padding: 24px;
  display: grid;
  gap: 12px;
}

.update-how {
  margin: 8px 0 0;
  font-size: 18px;
}

.update-steps {
  margin: 0;
  padding-left: 20px;
  display: grid;
  gap: 8px;
  color: var(--muted);
}

.update-box code {
  background: #f1f5f9;
  padding: 1px 6px;
  border-radius: 6px;
  font-size: 0.95em;
}

.flash-ok {
  background: #dcfce7;
  color: #166534;
  padding: 10px 12px;
  border-radius: 12px;
  margin: 0;
}

.update-req {
  margin: 0;
}

.nav-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 7px;
  border-radius: 999px;
  background: #e11d48;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0;
  vertical-align: middle;
}

.update-banner {
  margin: 0 0 16px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #eef2ff;
  color: #3730a3;
}

.update-banner a {
  font-weight: 700;
  color: inherit;
}
