:root {
  color-scheme: light;
  --bg: #f3f6f7;
  --surface: #ffffff;
  --surface-strong: #ffffff;
  --ink: #20272b;
  --muted: #697780;
  --line: #dbe4e8;
  --line-soft: #eaf0f2;
  --primary: #0aa6d8;
  --primary-dark: #0786b1;
  --primary-soft: #e2f6fc;
  --navy: #31527f;
  --navy-dark: #203f68;
  --navy-soft: #e8eef5;
  --dark: #27476f;
  --dark-soft: #365b87;
  --success: #2f9a75;
  --success-soft: #e3f3ed;
  --warning: #b77a08;
  --warning-soft: #fff3d5;
  --danger: #d34d57;
  --danger-soft: #fde8e9;
  --shadow: 0 18px 46px rgba(40, 73, 99, 0.1);
  --shadow-soft: 0 8px 24px rgba(40, 73, 99, 0.08);
  --radius: 22px;
  --radius-sm: 13px;
  font-family:
    Inter, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-synthesis: none;
}

/* Рабочее пространство документов и ИИ */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.documents-hub {
  display: grid;
  gap: 22px;
}

.documents-hub-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding: 24px 26px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(135deg, #ffffff 0%, #eef9fc 100%);
  box-shadow: var(--shadow-soft);
}

.documents-hub-head h2,
.documents-hub-head p {
  margin: 0;
}

.documents-hub-head > div:first-child > p:last-child {
  margin-top: 7px;
  color: var(--muted);
}

.document-summary {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.document-summary span {
  min-width: 106px;
  display: grid;
  gap: 2px;
  padding: 10px 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--muted);
  font-size: 11px;
}

.document-summary strong {
  color: var(--navy);
  font-size: 18px;
}

.document-summary .complete strong {
  color: var(--success);
}

.document-stage-list {
  display: grid;
  gap: 0;
}

.document-stage {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 16px;
}

.document-stage-marker {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.document-stage-marker span {
  width: 38px;
  height: 38px;
  z-index: 1;
  display: grid;
  place-items: center;
  border: 5px solid var(--bg);
  border-radius: 50%;
  background: var(--navy);
  color: white;
  font-size: 12px;
  font-weight: 900;
}

.document-stage-marker i {
  width: 2px;
  flex: 1;
  min-height: 26px;
  background: #cce6ee;
}

.document-stage-content {
  min-width: 0;
  display: grid;
  gap: 16px;
  padding-bottom: 22px;
}

.final-stage .document-stage-marker span {
  background: var(--success);
}

.final-document-card.pending,
.approval-complete-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.final-document-card h2,
.final-document-card p,
.approval-complete-card h2,
.approval-complete-card p {
  margin: 0;
}

.final-document-card .file-entry {
  margin-top: 16px;
}

.file-entry.final {
  border-radius: 12px;
  outline: 2px solid rgba(41, 158, 121, 0.16);
}

.file-row .pill {
  margin-left: auto;
}

.version-compare-card {
  padding: 0;
}

.version-compare-card > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  list-style: none;
  cursor: pointer;
}

.version-compare-card > summary::-webkit-details-marker {
  display: none;
}

.version-compare-card form {
  padding: 0 22px 22px;
  border-top: 1px solid var(--line-soft);
}

.version-compare-fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
  padding-top: 18px;
}

.version-compare-arrow {
  padding-bottom: 13px;
  color: var(--primary);
  font-weight: 900;
}

.version-compare-result {
  margin-top: 16px;
}

.version-diff-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 11px;
}

.version-diff-list {
  max-height: 520px;
  display: grid;
  gap: 10px;
  overflow-y: auto;
}

.version-diff {
  display: grid;
  grid-template-columns: 82px repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: var(--surface);
}

.version-diff > span,
.version-diff small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
  text-transform: uppercase;
}

.version-diff p {
  margin: 4px 0 0;
  white-space: pre-wrap;
  line-height: 1.5;
}

.document-ai-studio {
  min-height: 680px;
  display: grid;
  grid-template-columns: minmax(460px, 1.15fr) minmax(380px, 0.85fr);
  gap: 18px;
  align-items: start;
}

.mobile-workspace-switch {
  display: none;
}

.document-editor-panel,
.ai-chat-panel {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: white;
  box-shadow: var(--shadow-soft);
}

.document-editor-panel {
  padding: 22px;
}

.document-workspace-head h2,
.document-workspace-head p {
  margin: 0;
}

.document-workspace-head > div > p:last-child {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
}

.document-editor-form {
  display: flex;
  flex-direction: column;
  margin-top: 18px;
}

.document-text-field {
  margin: 0;
}

#document-text {
  min-height: clamp(520px, calc(100vh - 300px), 760px);
  padding: 22px 24px;
  border-color: #dce5e9;
  background: #fffefb;
  box-shadow: inset 0 1px 2px rgba(32, 53, 64, 0.04);
}

.ai-chat-panel {
  position: sticky;
  top: 148px;
  height: clamp(620px, calc(100vh - 170px), 790px);
  display: flex;
  flex-direction: column;
  background: #f7fafb;
}

.ai-chat-header {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 15px 17px;
  border-bottom: 1px solid var(--line-soft);
  background: white;
}

.ai-chat-header > div {
  display: flex;
  align-items: center;
  gap: 11px;
}

.ai-chat-header h3,
.ai-chat-header p {
  margin: 0;
}

.ai-chat-header p {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.ai-online {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #287b60;
  font-size: 10px;
  font-weight: 800;
}

.ai-online i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 4px rgba(41, 158, 121, 0.12);
}

.ai-online.busy {
  color: #87651c;
}

.ai-online.busy i {
  background: #d69a18;
  animation: ai-pulse 1.1s ease-in-out infinite;
}

.ai-chat-panel .ai-messages {
  flex: 1;
  min-height: 0;
  max-height: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  padding: 18px;
  scroll-behavior: smooth;
}

.ai-chat-panel .ai-message {
  max-width: 88%;
  padding: 12px 14px;
  border-radius: 16px 16px 16px 5px;
  box-shadow: 0 4px 14px rgba(28, 54, 68, 0.05);
}

.ai-chat-panel .ai-message.user {
  align-self: flex-end;
  border-radius: 16px 16px 5px 16px;
  background: #dff4fb;
}

.ai-chat-panel .ai-message.assistant {
  align-self: flex-start;
}

.ai-pending-message {
  border: 1px solid #d9ecf5;
  background: #f4fbfe;
}

.ai-typing {
  display: flex;
  align-items: center;
  gap: 5px;
  min-height: 21px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.ai-typing i {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--primary);
  animation: ai-pulse 1s ease-in-out infinite;
}

.ai-typing i:nth-child(2) {
  animation-delay: 150ms;
}

.ai-typing i:nth-child(3) {
  animation-delay: 300ms;
}

@keyframes ai-pulse {
  0%, 100% { opacity: 0.35; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1.1); }
}

.ai-empty {
  margin: auto 0;
  padding: 26px 20px;
  border: 0;
  background: transparent;
  text-align: center;
}

.ai-empty-orb {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  margin: 0 auto 8px;
  border-radius: 16px;
  background: linear-gradient(145deg, #dff5fb, #edf3ff);
  color: var(--primary);
  font-size: 21px;
}

.ai-composer {
  display: grid;
  gap: 9px;
  padding: 12px;
  border-top: 1px solid var(--line-soft);
  background: white;
}

.ai-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding-bottom: 2px;
}

.ai-suggestions button,
.feed-filters button,
.history-filters button {
  flex: 0 0 auto;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: white;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: 10px;
  font-weight: 750;
}

.ai-suggestions button:hover,
.feed-filters button:hover,
.history-filters button:hover,
.feed-filters button.active,
.history-filters button.active {
  border-color: rgba(10, 166, 216, 0.32);
  background: var(--primary-soft);
  color: var(--navy);
}

.ai-composer-box {
  overflow: hidden;
  border: 1px solid #cbdde4;
  border-radius: 15px;
  background: white;
  box-shadow: 0 6px 20px rgba(28, 54, 68, 0.07);
}

#document-chat-message {
  width: 100%;
  display: block;
  box-sizing: border-box;
  min-height: 74px;
  max-height: 150px;
  padding: 13px 14px 6px;
  border: 0;
  border-radius: 0;
  background: transparent;
  resize: vertical;
}

#document-chat-message:focus {
  box-shadow: none;
}

.ai-composer-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 8px 8px 12px;
}

.quality-toggle.compact {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.quality-toggle.compact input {
  width: 16px;
  height: 16px;
}

.ai-send-button {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 8px 7px 12px;
  border: 0;
  border-radius: 10px;
  background: var(--navy);
  color: white;
  cursor: pointer;
  font: inherit;
  font-size: 11px;
  font-weight: 800;
}

.ai-send-button b {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.16);
}

.ai-disclaimer {
  color: var(--muted);
  text-align: center;
  font-size: 9px;
}

.ai-chat-locked {
  display: grid;
  gap: 4px;
  padding: 16px 18px;
  border-top: 1px solid var(--line-soft);
  background: white;
}

.ai-chat-locked span {
  color: var(--muted);
  font-size: 11px;
}

.feed-filters,
.history-filters {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  margin-bottom: 14px;
}

.history-card .panel-head {
  margin-bottom: 14px;
}

.history-more {
  width: 100%;
  margin-top: 12px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--navy);
  cursor: pointer;
  font: inherit;
  font-weight: 750;
}

.user-filters .search {
  flex: 1 1 280px;
}

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

.filter-result {
  margin-left: auto;
  color: var(--muted);
  font-size: 11px;
}

.metric-card,
.sla-stat,
.dashboard-bar-row {
  color: inherit;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
}

.metric-card {
  width: 100%;
}

.metric-card:hover {
  transform: translateY(-2px);
  border-color: rgba(10, 166, 216, 0.3);
  box-shadow: 0 14px 32px rgba(28, 54, 68, 0.11);
}

.metric-arrow {
  position: absolute;
  right: 18px;
  bottom: 16px;
  color: var(--primary);
  font-weight: 900;
}

.sla-stat,
.dashboard-bar-row {
  width: 100%;
  border: 0;
  background: transparent;
}

.sla-stat:hover,
.dashboard-bar-row:hover {
  background: #f3fafc;
}

.approval-complete-icon {
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: var(--success-soft);
  color: var(--success);
  font-size: 22px;
  font-weight: 900;
}

@media (max-width: 1120px) {
  .document-ai-studio {
    grid-template-columns: 1fr;
  }

  .ai-chat-panel {
    position: static;
    height: 680px;
  }
}

@media (max-width: 720px) {
  .mobile-workspace-switch {
    position: sticky;
    top: 66px;
    z-index: 8;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
    margin-bottom: 10px;
    padding: 4px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 8px 24px rgba(28, 54, 68, 0.09);
    backdrop-filter: blur(12px);
  }

  .mobile-workspace-switch button {
    min-height: 40px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--muted);
    font: inherit;
    font-size: 12px;
    font-weight: 800;
  }

  .mobile-workspace-switch button.active {
    background: var(--navy);
    color: white;
    box-shadow: 0 5px 14px rgba(37, 79, 132, 0.2);
  }

  .document-ai-studio[data-mobile-pane="editor"] .ai-chat-panel,
  .document-ai-studio[data-mobile-pane="chat"] .document-editor-panel {
    display: none;
  }

  .documents-hub-head,
  .final-document-card.pending,
  .approval-complete-card,
  .version-diff-head {
    align-items: stretch;
    flex-direction: column;
  }

  .document-summary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
  }

  .document-summary span {
    min-width: 0;
  }

  .document-stage {
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 8px;
  }

  .document-stage-marker span {
    width: 32px;
    height: 32px;
    border-width: 4px;
  }

  .version-compare-fields,
  .version-diff {
    grid-template-columns: 1fr;
  }

  .version-compare-arrow {
    display: none;
  }

  .document-editor-panel {
    padding: 16px;
  }

  #document-text {
    min-height: 520px;
    padding: 17px;
  }

  .ai-chat-panel {
    position: relative;
    top: auto;
    height: min(660px, calc(100vh - 150px));
    min-height: 570px;
  }

  .ai-send-button span {
    display: none;
  }

  .user-filters select,
  .user-filters .search {
    width: 100%;
  }

  .filter-result {
    margin-left: 0;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
}

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

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 272px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 22px;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 22px 18px 18px;
  background: #ffffff;
  border-right: 1px solid var(--line);
  z-index: 20;
}

.sidebar::-webkit-scrollbar {
  width: 6px;
}

.sidebar::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: #d8d8d1;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 56px;
  padding: 0 8px 12px;
  border-bottom: 1px solid var(--line-soft);
}

.brand-logo {
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  border-radius: 50%;
  object-fit: cover;
}

.brand-copy strong,
.brand-copy span {
  display: block;
}

.brand-copy strong {
  color: var(--navy-dark);
  font-size: 16px;
  font-weight: 900;
  letter-spacing: -0.025em;
}

.brand-copy span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

.nav-section {
  display: grid;
  gap: 6px;
}

.personal-work-nav,
.service-management-nav {
  padding-top: 18px;
  border-top: 1px solid var(--line-soft);
}

.nav-label {
  padding: 0 12px 6px;
  color: #8e9ba3;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.nav-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 13px;
  border: 0;
  border-radius: 11px;
  background: transparent;
  min-height: 44px;
  color: #586872;
  text-align: left;
  cursor: pointer;
  transition: 160ms ease;
}

.nav-badge {
  display: inline-flex;
  min-width: 19px;
  height: 19px;
  align-items: center;
  justify-content: center;
  margin-left: 6px;
  padding: 0 5px;
  border-radius: 999px;
  background: #df5f52;
  color: white;
  font-size: 9px;
}

.nav-item:hover {
  color: var(--navy-dark);
  background: #f0f7fa;
}

.nav-item.active {
  color: white;
  background: var(--navy);
  font-weight: 700;
  box-shadow: 0 10px 22px rgba(49, 82, 127, 0.18);
}

.nav-icon {
  width: 22px;
  color: currentColor;
  font-size: 16px;
  text-align: center;
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.sidebar-utilities {
  display: grid;
  gap: 4px;
  margin: 0 0 8px;
}

.sidebar-utilities .nav-item {
  min-height: 38px;
  padding-block: 8px;
  font-size: 12px;
}

.user-mini {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 8px;
}

.avatar {
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--navy);
  color: white;
  font-weight: 800;
}

.user-mini-copy {
  min-width: 0;
  flex: 1;
}

.user-mini-copy strong,
.user-mini-copy span {
  overflow: hidden;
  display: block;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-mini-copy strong {
  font-size: 12px;
}

.user-mini-copy span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
}

.logout-button {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.logout-button:hover {
  background: var(--danger-soft);
  color: var(--danger);
}

.connection {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 10px 10px 0;
  color: var(--muted);
  font-size: 10px;
}

.connection-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 4px rgba(47, 154, 117, 0.12);
}

.app-main {
  min-width: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 15;
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 12px clamp(24px, 3.5vw, 56px);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(16px);
}

.topbar-context,
.topbar-actions,
.topbar-profile {
  display: flex;
  align-items: center;
}

.topbar-context {
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
}

.topbar-chip {
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.topbar-actions {
  gap: 8px;
}

.mobile-more-button {
  display: none;
}

.mobile-more-button,
.topbar-notification,
.topbar-profile {
  border: 1px solid var(--line);
  background: white;
  cursor: pointer;
}

.mobile-more-button,
.topbar-notification {
  position: relative;
  width: 42px;
  height: 42px;
  border-radius: 13px;
  color: var(--primary);
}

.topbar-notification strong {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 19px;
  height: 19px;
  display: grid;
  place-items: center;
  padding: 0 4px;
  border: 2px solid white;
  border-radius: 999px;
  background: var(--danger);
  color: white;
  font-size: 9px;
}

.topbar-profile {
  gap: 9px;
  min-height: 46px;
  padding: 4px 11px 4px 5px;
  border-radius: 15px;
  text-align: left;
}

.topbar-profile .avatar {
  width: 34px;
  height: 34px;
  font-size: 11px;
}

.topbar-profile strong,
.topbar-profile small {
  display: block;
  max-width: 190px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-profile strong {
  font-size: 11px;
}

.topbar-profile small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 9px;
}

.admin-group {
  padding-top: 14px;
  border-top: 1px solid var(--line-soft);
}

.admin-group summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  padding: 0 12px;
  color: #8e9ba3;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  list-style: none;
}

.admin-group summary::-webkit-details-marker {
  display: none;
}

.workspace {
  min-width: 0;
  padding: 32px clamp(24px, 3.5vw, 56px) 56px;
}

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--primary-dark);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(30px, 3.1vw, 44px);
  line-height: 1.06;
  letter-spacing: -0.045em;
}

h2 {
  margin-bottom: 6px;
  font-size: 21px;
  letter-spacing: -0.025em;
}

h3 {
  margin-bottom: 6px;
  font-size: 16px;
}

.page-subtitle {
  max-width: 720px;
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.primary-button,
.secondary-button,
.ghost-button,
.danger-button,
.small-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 12px;
  font-weight: 750;
  cursor: pointer;
  transition:
    transform 150ms ease,
    box-shadow 150ms ease,
    background 150ms ease;
}

.primary-button,
.secondary-button,
.danger-button {
  min-height: 44px;
  padding: 0 18px;
}

.primary-button {
  background: var(--primary);
  color: white;
  box-shadow: 0 12px 26px rgba(10, 166, 216, 0.22);
}

.primary-button:hover {
  transform: translateY(-1px);
  background: var(--primary-dark);
}

.secondary-button {
  border-color: var(--line);
  background: var(--surface-strong);
}

.secondary-button:hover,
.small-button:hover {
  background: #f2f1ec;
}

.ghost-button {
  min-height: 38px;
  padding: 0 12px;
  background: transparent;
  color: var(--muted);
}

.ghost-button:hover {
  background: #efeee9;
  color: var(--ink);
}

.danger-button {
  background: var(--danger-soft);
  color: var(--danger);
}

.small-button {
  min-height: 34px;
  padding: 0 11px;
  border-color: var(--line);
  background: white;
  font-size: 12px;
}

button:disabled {
  opacity: 0.55;
  cursor: wait;
  transform: none !important;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(270px, 0.72fr);
  gap: 22px;
}

.metrics {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.dashboard-insights {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
}

.insight-card {
  padding: 22px 24px;
}

.panel-head.compact {
  padding: 0 0 18px;
  border: 0;
}

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

.sla-stat {
  display: grid;
  gap: 5px;
  padding: 14px;
  border-radius: 14px;
  background: #f4f7f8;
}

.sla-stat strong {
  font-size: 25px;
}

.sla-stat span {
  color: var(--muted);
  font-size: 10px;
}

.sla-stat.danger strong { color: var(--danger); }
.sla-stat.warning strong { color: var(--warning); }

.dashboard-bars {
  display: grid;
  gap: 12px;
}

.dashboard-bar-row {
  display: grid;
  grid-template-columns: minmax(110px, 0.8fr) minmax(100px, 1.4fr) 28px;
  gap: 12px;
  align-items: center;
  font-size: 11px;
}

.dashboard-bar-track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8edef;
}

.dashboard-bar-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary), #37b9dd);
}

.urgent-panel {
  grid-column: 1 / -1;
  border-color: #efc7be;
}

.metric-card,
.panel,
.focus-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.metric-card {
  position: relative;
  overflow: hidden;
  min-height: 132px;
  padding: 20px;
}

.metric-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: #c8d5dc;
}

.metric-card.navy::before {
  background: var(--navy);
}

.metric-card.cyan::before {
  background: var(--primary);
}

.metric-card.warning::before {
  background: #f5be3f;
}

.metric-card.danger::before {
  background: var(--danger);
}

.metric-label {
  color: #53636d;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.045em;
}

.metric-value {
  display: block;
  margin: 16px 0 2px;
  font-size: 32px;
  line-height: 1;
  letter-spacing: -0.05em;
}

.metric-note {
  color: #9a9f9c;
  font-size: 10px;
}

.metric-card.danger .metric-value {
  color: var(--danger);
}

.metric-card.warning .metric-value {
  color: var(--warning);
}

.panel {
  overflow: hidden;
}

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

.panel-head p,
.panel-copy {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.queue-list {
  display: grid;
}

.queue-item {
  display: grid;
  grid-template-columns: minmax(132px, 0.7fr) minmax(220px, 1.5fr) auto minmax(116px, auto);
  gap: 16px;
  align-items: center;
  min-height: 68px;
  padding: 14px 24px;
  border: 0;
  border-bottom: 1px solid var(--line-soft);
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.queue-item:last-child {
  border-bottom: 0;
}

.queue-item:hover {
  background: #f2f8fa;
}

.queue-number {
  font-size: 12px;
  font-weight: 800;
}

.queue-main,
.queue-subject {
  overflow: hidden;
}

.queue-main {
  display: grid;
  gap: 4px;
}

.queue-subject {
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.queue-main small,
.queue-deadline {
  color: var(--muted);
  font-size: 10px;
}

.queue-deadline {
  text-align: right;
  white-space: nowrap;
}

.queue-meta {
  color: var(--muted);
  font-size: 11px;
}

.focus-stack {
  display: grid;
  gap: 16px;
}

.focus-card {
  padding: 22px;
}

.focus-card.dark {
  position: relative;
  overflow: hidden;
  min-height: 190px;
  border-color: var(--navy);
  background: var(--navy);
  color: white;
}

.focus-card.dark::after {
  content: "";
  position: absolute;
  right: -62px;
  bottom: -90px;
  width: 210px;
  height: 210px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
}

.focus-card.dark .eyebrow {
  color: #86dcf4;
}

.focus-card.dark p {
  color: #cad0ce;
  line-height: 1.55;
}

.progress-ring {
  --value: 0deg;
  width: 128px;
  height: 128px;
  display: grid;
  place-items: center;
  margin: 18px auto;
  border-radius: 50%;
  background: conic-gradient(var(--primary) var(--value), #e9eff2 0);
}

.progress-ring::before {
  content: "";
  grid-area: 1 / 1;
  width: 98px;
  height: 98px;
  border-radius: 50%;
  background: var(--surface);
}

.progress-ring strong {
  z-index: 1;
  font-size: 25px;
}

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

.search {
  position: relative;
  min-width: 260px;
  flex: 1;
  display: flex;
  gap: 8px;
}

.search input,
.field input,
.field textarea,
.field select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  outline: none;
  background: var(--surface-strong);
  color: var(--ink);
  transition:
    border 150ms ease,
    box-shadow 150ms ease;
}

.search input {
  height: 44px;
  padding: 0 15px 0 42px;
  min-width: 0;
  flex: 1;
}

.search-button {
  min-height: 44px;
}

.search::before {
  content: "⌕";
  position: absolute;
  left: 15px;
  top: 9px;
  color: var(--muted);
  font-size: 20px;
}

.search input:focus,
.field input:focus,
.field textarea:focus,
.field select:focus {
  border-color: #62c7e6;
  box-shadow: 0 0 0 4px rgba(10, 166, 216, 0.12);
}

.segmented {
  display: flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface);
}

.segmented button {
  min-height: 34px;
  padding: 0 12px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.segmented button.active {
  background: var(--navy);
  color: white;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: white;
  box-shadow: var(--shadow-soft);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 860px;
}

.data-table th,
.data-table td {
  padding: 15px 18px;
  border-bottom: 1px solid var(--line-soft);
  text-align: left;
}

.data-table th {
  color: #929894;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.data-table tbody tr {
  cursor: pointer;
  transition: background 140ms ease;
}

.data-table tbody tr:hover {
  background: #f2f8fa;
}

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

.table-link {
  margin-left: 10px;
  border: 0;
  background: transparent;
  color: var(--primary);
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}

.number-link {
  font-weight: 850;
}

.subject-cell strong,
.subject-cell span {
  display: block;
}

.subject-cell span {
  max-width: 330px;
  margin-top: 4px;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 27px;
  padding: 0 9px;
  border-radius: 999px;
  background: #eeeee9;
  color: #5a635f;
  font-size: 10px;
  font-weight: 750;
  white-space: nowrap;
}

.pill::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.pill.primary {
  background: var(--primary-soft);
  color: var(--primary-dark);
}

.pill.success {
  background: var(--success-soft);
  color: var(--success);
}

.pill.warning {
  background: var(--warning-soft);
  color: var(--warning);
}

.pill.danger {
  background: var(--danger-soft);
  color: var(--danger);
}

.risk {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
}

.risk::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
}

.risk.medium::before {
  background: var(--warning);
}

.risk.high::before {
  background: var(--danger);
}

.form-card {
  max-width: 880px;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: white;
  box-shadow: var(--shadow-soft);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.field {
  display: grid;
  gap: 7px;
}

.field.full {
  grid-column: 1 / -1;
}

.field label {
  font-size: 11px;
  font-weight: 800;
}

.field small {
  color: var(--muted);
  line-height: 1.45;
}

.field input,
.field select {
  height: 44px;
  padding: 0 13px;
}

.field textarea {
  min-height: 122px;
  padding: 13px;
  resize: vertical;
  line-height: 1.5;
}

.check-field {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-strong);
  cursor: pointer;
}

.check-field.full {
  grid-column: 1 / -1;
}

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

.check-field input {
  width: 18px;
  height: 18px;
  margin: 1px 0 0;
  accent-color: var(--primary);
}

.check-field span {
  display: grid;
  gap: 4px;
}

.check-field strong {
  font-size: 12px;
}

.check-field small,
.notice {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.notice {
  margin: 0 0 18px;
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--primary-soft);
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.create-layout .form-card {
  max-width: none;
}

.process-guide {
  align-self: start;
  padding: 24px;
  border-radius: var(--radius);
  background: var(--navy);
  color: white;
  box-shadow: var(--shadow);
}

.process-guide .eyebrow {
  color: #8fe5f8;
}

.process-guide ol {
  display: grid;
  gap: 16px;
  margin: 24px 0;
  padding: 0;
  list-style: none;
}

.process-guide li {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 11px;
  align-items: center;
}

.process-guide li > span {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--primary);
  font-size: 11px;
  font-weight: 900;
}

.process-guide li strong,
.process-guide li small {
  display: block;
}

.process-guide li strong {
  font-size: 12px;
}

.process-guide li small {
  margin-top: 3px;
  color: #c7d7e4;
  line-height: 1.4;
}

.process-note {
  margin: 0;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.13);
  color: #c7d7e4;
  font-size: 11px;
  line-height: 1.6;
}

.detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(280px, 0.72fr);
  gap: 20px;
}

.detail-stack {
  display: grid;
  gap: 18px;
  min-width: 0;
}

.detail-card {
  min-width: 0;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: white;
  box-shadow: var(--shadow-soft);
}

.detail-hero {
  min-width: 0;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(226, 246, 252, 0.9), rgba(255, 255, 255, 0.7) 58%),
    white;
  box-shadow: var(--shadow-soft);
}

.detail-hero-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.detail-number {
  color: var(--primary-dark);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.detail-title {
  margin: 8px 0 14px;
  font-size: clamp(25px, 3vw, 36px);
  letter-spacing: -0.045em;
}

.workflow-progress {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin: 18px 0;
  padding: 14px;
  border: 1px solid rgba(10, 166, 216, 0.15);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.7);
}

.workflow-step {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 6px;
  color: #87949b;
  font-size: 9px;
  text-align: center;
}

.workflow-step:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 13px;
  left: calc(50% + 18px);
  right: calc(-50% + 18px);
  height: 2px;
  background: #dbe7eb;
}

.workflow-step span {
  position: relative;
  z-index: 1;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 2px solid #d4e0e5;
  border-radius: 50%;
  background: white;
  font-weight: 900;
}

.workflow-step.complete,
.workflow-step.current {
  color: var(--navy-dark);
}

.workflow-step.complete span {
  border-color: var(--success);
  background: var(--success);
  color: white;
}

.workflow-step.complete::after {
  background: var(--success);
}

.workflow-step.current span {
  border-color: var(--primary);
  background: var(--primary);
  color: white;
  box-shadow: 0 0 0 5px rgba(10, 166, 216, 0.13);
}

.workflow-step strong {
  font-size: 9px;
}

.detail-copy {
  margin: 0;
  color: #46504c;
  white-space: pre-wrap;
  line-height: 1.65;
  max-height: 180px;
  overflow: auto;
}

.facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 22px;
}

.fact {
  padding: 14px;
  border-radius: 12px;
  border: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, 0.84);
}

.fact span,
.fact strong {
  display: block;
}

.fact span {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 10px;
  text-transform: uppercase;
}

.fact strong {
  font-size: 13px;
}

.action-card {
  padding: 22px;
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 100% 0, rgba(10, 166, 216, 0.28), transparent 42%),
    var(--navy);
  color: white;
}

.detail-grid > aside.detail-stack {
  align-self: start;
  position: sticky;
  top: 94px;
}

.action-card p {
  color: #c5cdca;
  font-size: 12px;
  line-height: 1.55;
}

.action-card .primary-button {
  width: 100%;
}

.action-card .secondary-button {
  width: 100%;
  margin-top: 8px;
  border-color: #58779c;
  background: var(--dark-soft);
  color: white;
}

.management-hub {
  display: grid;
  gap: 18px;
}

.management-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: white;
  box-shadow: var(--shadow-soft);
}

.management-tab {
  min-height: 58px;
  padding: 12px 16px;
  border: 0;
  border-right: 1px solid var(--line);
  background: white;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  text-align: center;
}

.management-tab:last-child {
  border-right: 0;
}

.management-tab:hover {
  background: #f2fafc;
  color: var(--navy);
}

.management-tab.active {
  background: var(--navy);
  color: white;
  box-shadow: inset 0 -3px 0 var(--primary);
}

.management-body {
  display: grid;
  gap: 18px;
  align-items: start;
}

.management-main {
  display: grid;
  gap: 16px;
}

.management-intro {
  padding: 20px 22px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: white;
  box-shadow: var(--shadow-soft);
}

.management-intro h2,
.management-intro p {
  margin: 0;
}

.management-intro h2 {
  margin: 5px 0 8px;
}

.management-intro > p:last-child {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.management-card-grid {
  display: grid;
  gap: 10px;
}

.management-card {
  width: 100%;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: white;
  color: var(--navy-dark);
  cursor: pointer;
  font: inherit;
  text-align: left;
  transition: 160ms ease;
}

.management-card:hover {
  transform: translateY(-1px);
  border-color: rgba(10, 166, 216, 0.38);
  box-shadow: var(--shadow-soft);
}

.management-card-icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  background: #eaf8fc;
  color: var(--primary);
  font-size: 19px;
  font-weight: 900;
}

.management-card strong,
.management-card small {
  display: block;
}

.management-card strong {
  font-size: 14px;
}

.management-card small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.management-card i {
  color: var(--primary);
  font-size: 20px;
  font-style: normal;
}

.management-side-note {
  padding: 21px;
  border-radius: 18px;
  background: linear-gradient(155deg, #254f84, #16385e);
  color: white;
  box-shadow: 0 18px 38px rgba(29, 65, 109, 0.2);
}

.management-side-note h2,
.management-side-note p {
  margin: 0;
}

.management-side-note h2 {
  margin: 5px 0 9px;
  font-size: 19px;
}

.management-side-note > p:last-of-type {
  color: rgba(255, 255, 255, 0.72);
  font-size: 12px;
  line-height: 1.55;
}

.management-side-note .eyebrow {
  color: #8fe5f8;
}

.management-side-action {
  width: 100%;
  margin-top: 18px;
  padding: 11px 14px;
  border: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.13);
  color: white;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
}

.action-card form {
  display: grid;
  gap: 8px;
}

.action-card input[type="file"] {
  width: 100%;
  padding: 10px;
  border: 1px dashed #50625e;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  color: #d8dfdd;
  font-size: 11px;
}

.file-list,
.comment-list,
.request-list {
  display: grid;
  gap: 10px;
}

.delivery-list {
  display: grid;
  gap: 10px;
}

.similar-list,
.knowledge-list {
  display: grid;
  gap: 10px;
}

.similar-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(150px, auto);
  gap: 16px;
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  background: #f8fafb;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.similar-item:hover {
  border-color: #8ec7d8;
  background: #f0f9fb;
}

.similar-item span {
  display: grid;
  gap: 4px;
}

.similar-item span:last-child {
  text-align: right;
}

.similar-item small,
.knowledge-meta small {
  color: var(--muted);
  font-size: 10px;
}

.knowledge-item {
  display: grid;
  gap: 14px;
}

.knowledge-item.inactive {
  opacity: 0.65;
}

.knowledge-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.knowledge-content {
  color: #3f4c53;
  font-size: 13px;
  line-height: 1.65;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag-list span {
  padding: 4px 8px;
  border-radius: 999px;
  background: #e9f5f8;
  color: #26738a;
  font-size: 10px;
  font-weight: 700;
}

.approval-state {
  padding: 14px;
  border-radius: 14px;
}

.approval-state p {
  margin: 5px 0 0;
  font-size: 11px;
}

.approval-state.approved { background: rgba(86, 177, 122, 0.16); }
.approval-state.pending { background: rgba(245, 190, 63, 0.15); }
.approval-state.rejected { background: rgba(218, 88, 71, 0.16); }

.approval-review-card {
  display: grid;
  gap: 16px;
}

.delivery-item {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(180px, 0.7fr);
  gap: 8px 18px;
  padding: 16px;
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  background: #f8fafb;
}

.delivery-item > div {
  display: grid;
  gap: 4px;
}

.delivery-item span,
.delivery-item small {
  color: var(--muted);
  font-size: 11px;
}

.delivery-item small {
  grid-column: 1 / -1;
}

.completion-divider {
  margin-top: 10px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
}

.completion-divider p {
  margin: 5px 0 0;
  color: #bdc9c6;
  font-size: 11px;
}

.delivery-form {
  gap: 12px !important;
}

.history-list {
  display: grid;
  gap: 0;
}

.history-row {
  position: relative;
  display: grid;
  grid-template-columns: 14px 1fr;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line-soft);
}

.history-row:last-child {
  border-bottom: 0;
}

.history-dot {
  width: 8px;
  height: 8px;
  margin-top: 4px;
  border-radius: 50%;
  background: var(--primary);
}

.history-row strong {
  display: block;
  font-size: 12px;
}

.history-row p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 10px;
}

.notification-list {
  display: grid;
  gap: 10px;
}

.notification-card {
  display: grid;
  grid-template-columns: 10px 1fr auto;
  gap: 14px;
  align-items: center;
  width: 100%;
  padding: 17px 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition:
    transform 140ms ease,
    box-shadow 140ms ease;
}

.notification-card:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.notification-card.unread {
  border-color: #8ed9ee;
  background: #f1fbfe;
}

.notification-mark {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--line);
}

.notification-card.unread .notification-mark {
  background: var(--primary);
}

.notification-copy {
  display: grid;
  gap: 4px;
}

.notification-copy strong {
  font-size: 13px;
}

.notification-copy span,
.notification-copy small {
  color: var(--muted);
  font-size: 11px;
}

.notification-arrow {
  color: var(--primary);
  font-size: 18px;
}

.category-list {
  display: grid;
  gap: 10px;
}

.category-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 15px 17px;
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  background: var(--surface);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition:
    transform 140ms ease,
    border-color 140ms ease,
    box-shadow 140ms ease;
}

.category-row:hover {
  transform: translateY(-1px);
  border-color: #8ed9ee;
  box-shadow: var(--shadow-soft);
}

.category-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.category-copy strong {
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.category-copy small,
.category-deadline {
  color: var(--muted);
  font-size: 11px;
}

.file-row,
.comment,
.request-card {
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  background: white;
}

.file-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  color: inherit;
  text-decoration: none;
}

.file-entry {
  position: relative;
}

.file-entry .file-row {
  padding-right: 50px;
}

.file-delete {
  position: absolute;
  top: 50%;
  right: 12px;
  width: 30px;
  height: 30px;
  transform: translateY(-50%);
  border: 0;
  border-radius: 9px;
  background: #fff0ee;
  color: var(--danger);
  font-size: 20px;
  cursor: pointer;
}

.file-delete:hover {
  background: #ffe1dd;
}

.file-badge {
  width: 34px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-size: 11px;
  font-weight: 900;
}

.file-copy {
  min-width: 0;
}

.file-copy strong,
.file-copy span {
  overflow: hidden;
  display: block;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-copy strong {
  font-size: 12px;
}

.file-copy span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

.comment {
  padding: 14px;
}

.comment-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 10px;
}

.comment p {
  margin: 0;
  white-space: pre-wrap;
  line-height: 1.55;
}

.request-card {
  padding: 20px;
}

.request-top {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.request-meta {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 18px;
}

.request-meta .fact {
  background: #f6f5f0;
}

.empty-state {
  display: grid;
  place-items: center;
  min-height: 300px;
  padding: 42px;
  text-align: center;
}

.empty-icon {
  width: 62px;
  height: 62px;
  display: grid;
  place-items: center;
  margin-bottom: 16px;
  border-radius: 18px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 25px;
}

.empty-state p {
  max-width: 480px;
  color: var(--muted);
  line-height: 1.55;
}

.loading {
  display: grid;
  place-items: center;
  min-height: 50vh;
  color: var(--muted);
}

.spinner {
  width: 30px;
  height: 30px;
  margin-bottom: 14px;
  border: 3px solid #deddd6;
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}

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

.auth-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(360px, 0.86fr) minmax(520px, 1.14fr);
}

.auth-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(28px, 6vw, 92px);
  background: white;
}

.auth-brand {
  position: absolute;
  left: clamp(28px, 6vw, 92px);
  top: 34px;
  border-bottom: 0;
}

.auth-card {
  width: min(460px, 100%);
}

.auth-card h1 {
  margin-bottom: 14px;
  font-size: clamp(34px, 4.5vw, 52px);
}

.auth-lead {
  margin-bottom: 28px;
  color: var(--muted);
  line-height: 1.6;
}

.auth-form {
  display: grid;
  gap: 15px;
}

.auth-form .primary-button {
  width: 100%;
  margin-top: 4px;
}

.request-section {
  display: grid;
  gap: 14px;
  margin-top: 22px;
}

.request-section .section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.request-section .section-head h2 {
  margin: 2px 0 0;
  font-size: 20px;
}

.auth-switch {
  margin-top: 22px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.link-button {
  border: 0;
  background: transparent;
  color: var(--primary-dark);
  font-weight: 800;
  cursor: pointer;
}

.auth-visual {
  position: relative;
  overflow: hidden;
  display: grid;
  align-items: center;
  padding: 8vw;
  background:
    radial-gradient(circle at 18% 20%, rgba(10, 166, 216, 0.48), transparent 28%),
    radial-gradient(circle at 82% 74%, rgba(245, 190, 63, 0.18), transparent 30%),
    var(--navy);
  color: white;
}

.auth-visual::before,
.auth-visual::after {
  content: "";
  position: absolute;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 50%;
}

.auth-visual::before {
  width: 540px;
  height: 540px;
  right: -210px;
  top: -160px;
}

.auth-visual::after {
  width: 330px;
  height: 330px;
  left: -130px;
  bottom: -110px;
}

.auth-visual-copy {
  position: relative;
  z-index: 1;
  max-width: 560px;
}

.auth-visual .eyebrow {
  color: #8fe5f8;
}

.auth-visual h2 {
  margin: 0 0 20px;
  font-size: clamp(36px, 5vw, 68px);
  line-height: 1.02;
  letter-spacing: -0.055em;
}

.auth-visual p {
  max-width: 500px;
  color: #cbd2d0;
  line-height: 1.7;
}

.auth-feature {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-top: 34px;
  color: #e4e9e7;
  font-size: 12px;
}

.auth-company {
  display: inline-flex;
  margin-bottom: 24px;
  padding: 7px 11px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 999px;
  color: #d8f6fc;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.auth-feature-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 34px;
}

.auth-feature-grid .auth-feature {
  margin-top: 0;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.06);
}

.auth-feature span {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.12);
  color: #8fe5f8;
  font-size: 10px;
  font-weight: 900;
}

.inline-error {
  padding: 11px 13px;
  border-radius: 10px;
  background: var(--danger-soft);
  color: #9f3e3e;
  font-size: 12px;
  line-height: 1.45;
}

.inline-success {
  padding: 11px 13px;
  border-radius: 10px;
  background: var(--success-soft);
  color: #25795e;
  font-size: 12px;
  line-height: 1.45;
}

.document-workspace {
  display: grid;
  gap: 22px;
}

.document-workspace-head,
.document-save-row,
.ai-workspace-head,
.ai-workspace-head > div,
.ai-message-meta,
.ai-proposal-head,
.ai-chat-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.document-workspace-head {
  align-items: flex-start;
}

#document-text {
  min-height: 420px;
  resize: vertical;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 16px;
  line-height: 1.7;
}

#document-text[readonly] {
  background: var(--surface);
}

.document-save-row {
  margin-top: 12px;
}

.ai-workspace {
  display: grid;
  gap: 16px;
  padding-top: 22px;
  border-top: 1px solid var(--line-soft);
}

.ai-workspace-head {
  align-items: flex-start;
}

.ai-workspace-head h3,
.ai-workspace-head p {
  margin: 0;
}

.ai-workspace-head p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.ai-orb {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: linear-gradient(145deg, var(--primary), #2571a9);
  color: white;
  box-shadow: 0 10px 24px rgba(10, 166, 216, 0.2);
  font-size: 11px;
  font-weight: 900;
}

.ai-messages {
  max-height: 620px;
  display: grid;
  gap: 12px;
  overflow-y: auto;
  padding: 4px;
}

.ai-empty {
  display: grid;
  gap: 5px;
  padding: 18px;
  border: 1px dashed var(--line);
  border-radius: 14px;
  background: var(--surface);
  color: var(--muted);
}

.ai-empty strong {
  color: var(--ink);
}

.ai-message {
  max-width: 92%;
  padding: 15px 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: white;
}

.ai-message.user {
  justify-self: end;
  background: var(--primary-soft);
  border-color: rgba(10, 166, 216, 0.22);
}

.ai-message.assistant {
  justify-self: start;
}

.ai-message-meta {
  align-items: baseline;
  color: var(--muted);
  font-size: 10px;
}

.ai-message-meta strong {
  color: var(--ink);
  font-size: 12px;
}

.ai-message > p {
  margin: 9px 0 0;
  white-space: pre-wrap;
  line-height: 1.55;
}

.ai-proposal {
  display: grid;
  gap: 12px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line-soft);
}

.ai-proposal ul {
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
}

.ai-proposal details {
  padding: 12px;
  border-radius: 12px;
  background: var(--surface);
}

.ai-proposal summary {
  cursor: pointer;
  font-weight: 750;
}

.ai-proposal pre {
  max-height: 360px;
  overflow: auto;
  margin: 12px 0 0;
  white-space: pre-wrap;
  font: inherit;
  line-height: 1.55;
}

#document-chat-message {
  min-height: 104px;
}

.quality-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.quality-toggle input {
  width: 18px;
  height: 18px;
}

.quality-toggle span {
  display: grid;
  gap: 2px;
}

.quality-toggle small {
  color: var(--muted);
}

.dialog-backdrop {
  position: fixed;
  inset: 0;
  z-index: 220;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(18, 39, 58, 0.58);
  backdrop-filter: blur(5px);
}

.action-dialog {
  width: min(500px, 100%);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 14px 16px;
  padding: 24px;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 22px;
  background: white;
  box-shadow: 0 28px 80px rgba(22, 48, 68, 0.28);
}

.action-dialog h2 {
  margin: 2px 0 7px;
  font-size: 21px;
  letter-spacing: -0.025em;
}

.action-dialog p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.action-dialog-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-weight: 900;
}

.action-dialog-icon.danger {
  background: var(--danger-soft);
  color: var(--danger);
}

.action-dialog-form {
  grid-column: 1 / -1;
  display: grid;
  gap: 18px;
  margin-top: 4px;
}

.action-dialog-input {
  min-height: 116px;
}

.action-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.mobile-navigation-sheet {
  width: min(620px, 100%);
  max-height: min(82vh, 760px);
  overflow-y: auto;
  padding: 24px;
  border-radius: 24px;
  background: white;
  box-shadow: 0 28px 80px rgba(22, 48, 68, 0.28);
}

.mobile-navigation-sheet > header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.mobile-navigation-sheet h2 {
  margin: 3px 0 0;
  font-size: 24px;
}

.mobile-navigation-sheet .icon-button {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: white;
  color: var(--ink);
  font-size: 24px;
  cursor: pointer;
}

.mobile-navigation-label {
  margin: 22px 0 10px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.mobile-navigation-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.mobile-navigation-grid button {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.mobile-navigation-grid button span {
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: var(--primary-soft);
  color: var(--primary-dark);
}

.mobile-navigation-grid button strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

#toast-root {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 100;
  display: grid;
  gap: 10px;
  pointer-events: none;
}

.toast {
  width: min(380px, calc(100vw - 48px));
  padding: 14px 16px;
  border-radius: 13px;
  background: var(--dark);
  color: white;
  box-shadow: var(--shadow);
  font-size: 12px;
  line-height: 1.5;
  animation: toast-in 180ms ease both;
}

.toast.error {
  background: #8d3c3c;
}

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

@media (max-width: 1040px) {
  .app-shell {
    grid-template-columns: 88px minmax(0, 1fr);
  }

  .sidebar {
    padding-inline: 12px;
  }

  .brand-copy,
  .nav-item span:not(.nav-icon),
  .nav-label,
  .admin-group summary,
  .user-mini-copy,
  .connection span:not(.connection-dot) {
    display: none;
  }

  .brand,
  .nav-item,
  .user-mini {
    justify-content: center;
  }

  .nav-item {
    padding-inline: 8px;
  }

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

  .dashboard-insights {
    grid-template-columns: 1fr;
  }

  .detail-grid > aside.detail-stack {
    position: static;
  }

  .management-body {
    grid-template-columns: 1fr;
  }

  .metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .auth-page {
    grid-template-columns: 1fr;
  }

  .auth-visual {
    display: none;
  }
}

@media (max-width: 720px) {
  html,
  body {
    overflow-x: hidden;
  }

  .app-shell {
    display: block;
  }

  .sidebar {
    position: fixed;
    inset: auto 12px 12px;
    height: auto;
    flex-direction: row;
    justify-content: space-around;
    gap: 4px;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 16px;
    box-shadow: var(--shadow);
  }

  .brand,
  .sidebar-footer,
  .nav-label,
  .admin-group,
  .nav-item.mobile-hidden {
    display: none;
  }

  .personal-work-nav,
  .service-management-nav {
    display: none;
  }

  .nav-section {
    display: contents;
  }

  .nav-item {
    width: auto;
    min-width: 50px;
  }

  .management-tabs {
    display: flex;
    overflow-x: auto;
  }

  .management-tab {
    min-width: 172px;
    border-bottom: 0;
  }

  .workspace {
    padding: 24px 16px 100px;
  }

  .topbar {
    min-height: 62px;
    padding: 8px 16px;
  }

  .mobile-more-button {
    display: block;
  }

  .topbar-context > span:not(.topbar-chip),
  .topbar-profile > span:last-child {
    display: none;
  }

  .page-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .filters {
    min-width: 0;
  }

  .segmented {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scrollbar-width: thin;
  }

  .segmented button {
    flex: 0 0 auto;
  }

  .table-wrap {
    max-width: 100%;
  }

  .appeals-table {
    min-width: 0;
  }

  .appeals-table thead {
    display: none;
  }

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

  .appeals-table tr {
    padding: 10px 16px;
  }

  .appeals-table td {
    display: grid;
    grid-template-columns: minmax(92px, 0.8fr) minmax(0, 1.4fr);
    gap: 12px;
    align-items: start;
    padding: 9px 0;
    border-bottom: 1px solid var(--line-soft);
    overflow-wrap: anywhere;
  }

  .appeals-table td::before {
    content: attr(data-label);
    color: #929894;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }

  .appeals-table td:last-child {
    border-bottom: 0;
  }

  .metrics,
  .form-grid,
  .option-grid,
  .facts,
  .request-meta {
    grid-template-columns: 1fr;
  }

  .sla-summary,
  .delivery-item,
  .similar-item {
    grid-template-columns: 1fr;
  }

  .similar-item span:last-child {
    text-align: left;
  }

  .delivery-item small {
    grid-column: 1;
  }

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

  .detail-card,
  .detail-hero,
  .action-card {
    padding: 18px;
  }

  .detail-card,
  .detail-hero,
  .action-card,
  .detail-card *,
  .detail-hero *,
  .action-card * {
    min-width: 0;
    overflow-wrap: anywhere;
  }

  .category-row {
    grid-template-columns: minmax(0, 1fr) auto auto;
  }

  .category-deadline {
    display: none;
  }

  .queue-item {
    grid-template-columns: 1fr auto;
  }

  .queue-main {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .queue-deadline {
    display: none;
  }

  .workflow-progress {
    overflow-x: auto;
    grid-template-columns: repeat(5, minmax(82px, 1fr));
  }

  .auth-panel {
    min-height: 100vh;
    padding: 100px 22px 36px;
  }

  .auth-brand {
    left: 22px;
  }

  .action-dialog {
    grid-template-columns: 1fr;
    padding: 20px;
  }

  .action-dialog-form {
    grid-column: 1;
  }

  .action-dialog-actions {
    flex-direction: column-reverse;
  }

  .action-dialog-actions button {
    width: 100%;
  }

  .document-workspace-head,
  .document-save-row,
  .ai-workspace-head,
  .ai-chat-actions {
    align-items: stretch;
    flex-direction: column;
  }

  #document-text {
    min-height: 360px;
    font-size: 15px;
  }

  .document-save-row .form-actions,
  .document-save-row button,
  .ai-chat-actions button {
    width: 100%;
  }

  .ai-message {
    max-width: 100%;
  }

  .mobile-navigation-backdrop {
    place-items: end center;
    padding: 12px;
  }

  .mobile-navigation-sheet {
    width: 100%;
    max-height: 86vh;
    padding: 20px;
    border-radius: 22px;
  }

  .mobile-navigation-grid {
    grid-template-columns: 1fr;
  }
}

/* Compact tabbed appeal workspace */
.appeal-detail-head {
  margin-bottom: 18px;
  color: var(--muted);
  font-size: 12px;
}

.appeal-breadcrumb {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--primary-dark);
  font-weight: 800;
  cursor: pointer;
}

.appeal-title-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-top: 12px;
}

.appeal-title-row h1 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(28px, 3.4vw, 42px);
  letter-spacing: -0.045em;
}

.appeal-title-row p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.appeal-title-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.appeal-detail-tabs {
  position: sticky;
  z-index: 8;
  top: 70px;
  scroll-margin-top: 72px;
  display: grid;
  grid-template-columns: 0.9fr 1fr 1.05fr 1.45fr 0.9fr;
  margin-bottom: 20px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: white;
  box-shadow: var(--shadow-soft);
}

.appeal-detail-tab {
  min-width: 0;
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 10px;
  border: 0;
  border-right: 1px solid var(--line-soft);
  background: white;
  color: var(--muted);
  cursor: pointer;
}

.appeal-detail-tab:last-child {
  border-right: 0;
}

.appeal-detail-tab strong {
  font-size: 12px;
}

.appeal-detail-tab > span:first-child {
  color: var(--primary-dark);
  font-size: 15px;
}

.appeal-detail-tab small {
  min-width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-size: 10px;
  font-weight: 900;
}

.appeal-detail-tab:hover {
  background: #f7fbfc;
  color: var(--ink);
}

.appeal-detail-tab.active {
  background: var(--navy);
  color: white;
}

.appeal-detail-tab.active > span:first-child,
.appeal-detail-tab.active small {
  color: white;
}

.appeal-detail-tab.active small {
  background: rgba(255, 255, 255, 0.15);
}

.appeal-tab-panel {
  display: none;
}

.appeal-tab-panel.active {
  display: block;
}

.appeal-tab-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) minmax(280px, 0.78fr);
  gap: 18px;
  align-items: start;
}

.appeal-context-column {
  position: sticky;
  top: 148px;
  align-self: start;
}

.compact-panel-head {
  padding: 0 0 14px;
  border-bottom: 0;
}

.compact-panel-head h2 {
  margin: 3px 0 0;
}

.appeal-summary {
  max-height: 96px;
  overflow: hidden;
}

.appeal-summary.expanded {
  max-height: none;
  overflow: visible;
}

.text-button {
  margin-top: 9px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--primary-dark);
  font-size: 12px;
  font-weight: 800;
  text-align: left;
  cursor: pointer;
}

.appeal-facts {
  margin-top: 16px;
  gap: 10px;
}

.appeal-facts .fact {
  padding: 12px 14px;
  background: #fbfcfc;
}

.appeal-route-card .workflow-progress {
  margin: 10px 0 0;
  border: 0;
  background: transparent;
  padding: 6px 0 0;
}

.ticket-route-card {
  margin-bottom: 20px;
}

.ticket-route-progress {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.assignee-card .eyebrow,
.last-comment-card .eyebrow {
  margin-bottom: 12px;
}

.assignee-summary {
  display: flex;
  align-items: center;
  gap: 12px;
}

.assignee-summary strong,
.assignee-summary small {
  display: block;
}

.assignee-summary small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}

.transfer-disclosure {
  margin-top: 15px;
}

.transfer-disclosure > summary {
  width: 100%;
  display: flex;
  justify-content: center;
  list-style: none;
  cursor: pointer;
}

.transfer-disclosure > summary::-webkit-details-marker {
  display: none;
}

.transfer-disclosure form,
.transfer-disclosure > p {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line-soft);
}

.compact-action-card {
  display: grid;
  gap: 10px;
}

.compact-action-card h2,
.compact-action-card p {
  margin: 0;
}

.compact-action-card .primary-button {
  margin-top: 4px;
}

.last-comment-card > strong,
.last-comment-card > small {
  display: block;
}

.last-comment-card > p:not(.eyebrow) {
  margin: 6px 0;
  color: var(--muted);
  line-height: 1.55;
}

.last-comment-card > small {
  color: var(--muted);
  font-size: 10px;
}

.service-details {
  padding: 0;
}

.service-details > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 22px;
  list-style: none;
  cursor: pointer;
}

.service-details > summary::-webkit-details-marker {
  display: none;
}

.service-details > summary .eyebrow {
  margin-bottom: 4px;
}

.service-details-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  padding: 0 22px 22px;
  border-top: 1px solid var(--line-soft);
}

.service-details-content > div {
  padding-top: 18px;
}

.appeal-upload {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line-soft);
}

.response-tools {
  display: grid;
  gap: 14px;
}

.response-tool-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.response-tool-grid form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.response-tool-grid input[type="file"] {
  width: 100%;
  padding: 9px;
  border: 1px dashed var(--line);
  border-radius: 10px;
  background: var(--surface);
}

.clarification-inline {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
  padding-top: 14px;
  border-top: 1px solid var(--line-soft);
}

.clarification-inline .field {
  margin: 0;
}

.clarification-inline textarea {
  min-height: 78px;
}

.approval-delivery-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(300px, 0.75fr);
  gap: 18px;
  align-items: start;
}

.approval-delivery-layout > .detail-card:only-child {
  grid-column: 1 / -1;
}

.appeal-history-layout {
  display: grid;
  grid-template-columns: minmax(300px, 0.75fr) minmax(0, 1.25fr);
  gap: 18px;
  align-items: start;
}

.comment-field {
  flex: 1;
  min-width: 220px;
}

@media (max-width: 1040px) {
  .appeal-detail-tabs {
    grid-template-columns: repeat(5, minmax(142px, 1fr));
    overflow-x: auto;
  }

  .appeal-tab-layout,
  .approval-delivery-layout,
  .appeal-history-layout {
    grid-template-columns: 1fr;
  }

  .appeal-context-column {
    position: static;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .last-comment-card {
    grid-column: 1 / -1;
  }
}

@media (max-width: 720px) {
  .appeal-title-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .appeal-title-actions {
    width: 100%;
    justify-content: space-between;
  }

  .appeal-detail-tabs {
    position: static;
    display: flex;
    margin-inline: -4px;
    border-radius: 14px;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scrollbar-width: thin;
  }

  .appeal-detail-tab {
    flex: 0 0 auto;
    min-width: 132px;
    min-height: 52px;
  }

  .appeal-detail-tab:nth-child(4) {
    min-width: 205px;
  }

  .appeal-context-column,
  .service-details-content,
  .response-tool-grid,
  .response-tool-grid form,
  .clarification-inline {
    grid-template-columns: 1fr;
  }

  .last-comment-card {
    grid-column: auto;
  }

  .appeal-route-card .workflow-progress {
    grid-template-columns: repeat(5, minmax(76px, 1fr));
  }
}

/* Финальные переопределения рабочей области */
.document-ai-studio #document-text {
  min-height: clamp(520px, calc(100vh - 300px), 760px);
  padding: 22px 24px;
  border-color: #dce5e9;
  background: #fffefb;
}

.ai-chat-panel #document-chat-message {
  min-height: 74px;
  max-height: 150px;
  padding: 13px 14px 6px;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.ai-chat-panel .ai-empty {
  margin: auto 0;
  padding: 26px 20px;
  border: 0;
  background: transparent;
  text-align: center;
}

/* Развитие сервиса и продуктовые тикеты */
.hidden {
  display: none !important;
}

.ticket-overview {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.ticket-overview button {
  min-width: 0;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 5px 12px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: white;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  box-shadow: var(--shadow-soft);
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.ticket-overview button:hover {
  transform: translateY(-2px);
  border-color: rgba(10, 166, 216, 0.36);
  box-shadow: 0 14px 30px rgba(34, 68, 86, 0.1);
}

.ticket-overview span,
.ticket-overview small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.ticket-overview strong {
  grid-row: span 2;
  align-self: center;
  color: var(--navy);
  font-size: 29px;
}

.ticket-create-panel {
  display: grid;
  grid-template-columns: minmax(240px, 0.65fr) minmax(440px, 1.35fr);
  gap: 26px;
  margin-bottom: 20px;
  padding: 26px;
  border: 1px solid rgba(10, 166, 216, 0.22);
  border-radius: 20px;
  background: linear-gradient(135deg, #edfaff 0%, white 52%, #f2f7fd 100%);
  box-shadow: 0 18px 42px rgba(29, 70, 91, 0.1);
}

.ticket-create-copy {
  align-self: center;
}

.ticket-create-copy h2,
.ticket-create-copy p {
  margin: 0;
}

.ticket-create-copy h2 {
  margin: 7px 0 9px;
  font-size: 25px;
}

.ticket-create-copy > p:last-child {
  color: var(--muted);
  line-height: 1.55;
}

.ticket-create-icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  margin-bottom: 14px;
  border-radius: 15px;
  background: linear-gradient(145deg, var(--primary), #3474c3);
  color: white;
  font-size: 22px;
  box-shadow: 0 10px 24px rgba(10, 166, 216, 0.24);
}

.ticket-create-form {
  display: grid;
  grid-template-columns: 0.7fr 1.3fr;
  gap: 13px;
  padding: 18px;
  border: 1px solid rgba(212, 226, 232, 0.9);
  border-radius: 17px;
  background: rgba(255, 255, 255, 0.88);
}

.ticket-create-form textarea {
  min-height: 126px;
}

.ticket-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: white;
  box-shadow: var(--shadow-soft);
}

.ticket-search {
  flex: 1 1 330px;
  margin: 0;
}

.ticket-filters {
  display: flex;
  gap: 5px;
  overflow-x: auto;
}

.ticket-filters button,
.ticket-mine-toggle {
  flex: 0 0 auto;
  min-height: 36px;
  padding: 7px 11px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: 11px;
  font-weight: 800;
}

.ticket-filters button:hover,
.ticket-filters button.active,
.ticket-mine-toggle:hover,
.ticket-mine-toggle.active {
  background: var(--primary-soft);
  color: var(--navy);
}

.ticket-mine-toggle {
  border-left: 1px solid var(--line);
  border-radius: 0 10px 10px 0;
}

.ticket-result-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 15px 3px 11px;
  color: var(--muted);
  font-size: 11px;
}

.ticket-result-head strong {
  color: var(--ink);
  font-size: 13px;
}

.ticket-board {
  display: grid;
  gap: 10px;
}

.ticket-card {
  width: 100%;
  min-width: 0;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  gap: 15px;
  align-items: start;
  padding: 17px 18px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: white;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  box-shadow: var(--shadow-soft);
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.ticket-card:hover {
  transform: translateY(-2px);
  border-color: rgba(10, 166, 216, 0.36);
  box-shadow: 0 14px 32px rgba(32, 64, 81, 0.1);
}

.ticket-card-icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 14px;
  background: #e9f7fc;
  color: var(--primary);
  font-size: 20px;
  font-weight: 900;
}

.ticket-card-icon.problem {
  background: #fff2ed;
  color: #d85c36;
}

.ticket-card-icon.ux {
  background: #f1efff;
  color: #6d59c8;
}

.ticket-card-icon.integration {
  background: #eaf8f1;
  color: var(--success);
}

.ticket-card-content {
  min-width: 0;
  display: grid;
  gap: 7px;
}

.ticket-card-top,
.ticket-card-meta,
.ticket-detail-label,
.ticket-detail-badges {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.ticket-number {
  color: var(--primary-dark);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.05em;
}

.ticket-card-content > strong {
  font-size: 16px;
}

.ticket-card-description {
  display: -webkit-box;
  overflow: hidden;
  color: #54646d;
  font-size: 12px;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.ticket-card-meta {
  color: var(--muted);
  font-size: 10px;
}

.ticket-card-meta span + span::before {
  content: "·";
  margin-right: 8px;
}

.ticket-card-side {
  display: grid;
  justify-items: end;
  gap: 16px;
}

.ticket-card-side i {
  color: var(--primary);
  font-style: normal;
  font-size: 19px;
}

.ticket-status,
.ticket-priority,
.ticket-visibility {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 4px 9px;
  border-radius: 999px;
  background: #edf2f4;
  color: #607078;
  font-size: 9px;
  font-weight: 850;
  white-space: nowrap;
}

.ticket-status.new { background: #fff6df; color: #946700; }
.ticket-status.planned { background: #e9f4ff; color: #286da6; }
.ticket-status.in_progress { background: #e5f7fc; color: #087da3; }
.ticket-status.completed { background: #e8f7f0; color: #25765b; }
.ticket-status.rejected { background: #fff0ed; color: #b84c39; }
.ticket-priority.high { background: #fff1df; color: #a86708; }
.ticket-priority.critical { background: #ffebe7; color: #c13f2a; }
.ticket-priority.low { background: #eef5f7; color: #73838a; }
.ticket-visibility.private { background: #f1efff; color: #5e4eb2; }

.ticket-private-choice {
  align-items: flex-start;
  padding: 13px 14px;
  border: 1px solid #ddd9f8;
  border-radius: 14px;
  background: #faf9ff;
}

.ticket-private-choice input {
  margin-top: 3px;
  accent-color: #6d59c8;
}

.ticket-private-choice strong {
  color: #373154;
}

.ticket-detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin: 16px 0 18px;
}

.ticket-detail-head + .ticket-progress,
.ticket-detail-head + .ticket-rejected {
  scroll-margin-top: 90px;
}

.detail-breadcrumb button {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--primary-dark);
  cursor: pointer;
  font: inherit;
  font-weight: 800;
}

.detail-breadcrumb button:hover {
  color: var(--navy);
}

.ticket-detail-head h1,
.ticket-detail-head p {
  margin: 0;
}

.ticket-detail-head h1 {
  margin: 8px 0 7px;
  font-size: clamp(28px, 3vw, 43px);
  line-height: 1.08;
}

.ticket-detail-head p,
.ticket-detail-label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.ticket-detail-label .ticket-card-icon {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  font-size: 15px;
}

.ticket-progress {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 20px;
  padding: 17px 22px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: white;
  box-shadow: var(--shadow-soft);
}

.ticket-progress > div {
  position: relative;
  display: grid;
  grid-template-columns: 31px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  color: var(--muted);
}

.ticket-progress > div:not(:last-child)::after {
  content: "";
  position: absolute;
  left: calc(100% + 2px);
  width: 12px;
  top: 15px;
  height: 2px;
  background: var(--line);
}

.ticket-progress span {
  position: relative;
  z-index: 1;
  width: 31px;
  height: 31px;
  display: grid;
  place-items: center;
  border: 2px solid var(--line);
  border-radius: 50%;
  background: white;
  font-size: 10px;
  font-weight: 900;
}

.ticket-progress strong {
  min-width: 0;
  font-size: 12px;
}

.ticket-progress small {
  grid-column: 2;
  margin-top: -7px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
}

.ticket-progress .active,
.ticket-progress .done {
  color: var(--navy);
}

.ticket-progress .active span {
  border-color: var(--primary);
  background: var(--primary);
  color: white;
  box-shadow: 0 0 0 5px var(--primary-soft);
}

.ticket-progress .done span {
  border-color: var(--success);
  background: var(--success);
  color: white;
}

.ticket-progress .done::after {
  background: var(--success) !important;
}

.ticket-rejected {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  padding: 15px 18px;
  border: 1px solid #f0c8bf;
  border-radius: 15px;
  background: #fff4f1;
  color: #a34230;
}

.ticket-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 18px;
  align-items: start;
}

.ticket-detail-main,
.ticket-detail-side {
  min-width: 0;
  display: grid;
  gap: 16px;
}

.ticket-description-card h2,
.ticket-description-card p,
.ticket-resolution h2,
.ticket-resolution p {
  margin: 0;
}

.ticket-description-card h2,
.ticket-resolution h2 {
  margin: 5px 0 14px;
}

.ticket-rich-text,
.ticket-resolution > p:last-child {
  color: #394c56;
  font-size: 14px;
  line-height: 1.7;
}

.ticket-resolution {
  padding: 21px;
  border: 1px solid #bfe5d5;
  border-radius: 17px;
  background: linear-gradient(135deg, #eefaf5, white);
}

.ticket-resolution.rejected {
  border-color: #efc9c1;
  background: linear-gradient(135deg, #fff4f1, white);
}

.ticket-discussion {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: white;
  box-shadow: var(--shadow-soft);
}

.ticket-chat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 22px 16px;
}

.ticket-chat-head h2,
.ticket-chat-head p {
  margin: 0;
}

.ticket-chat-head h2 {
  margin: 4px 0 6px;
}

.ticket-chat-head > div > p:last-child {
  color: var(--muted);
  font-size: 11px;
}

.ticket-chat-count {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex: 0 0 auto;
  padding: 7px 10px;
  border-radius: 999px;
  background: #edf8fb;
  color: #167698;
  font-size: 11px;
  font-weight: 850;
}

.ticket-chat-body {
  max-height: 440px;
  min-height: 220px;
  overflow-y: auto;
  padding: 12px 20px;
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
  background: linear-gradient(180deg, #f8fafb, #f4f8fa);
}

.ticket-comments {
  display: grid;
  gap: 14px;
  padding: 4px 0;
}

.ticket-comment {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.ticket-comment > .avatar {
  width: 36px;
  height: 36px;
}

.ticket-comment > div:last-child {
  max-width: min(78%, 700px);
  padding: 12px 14px;
  border: 1px solid #dbe6ea;
  border-radius: 5px 15px 15px 15px;
  background: white;
}

.ticket-comment.admin > div:last-child {
  border-color: #cce9f3;
  background: #edf9fd;
}

.ticket-comment.mine > div:last-child {
  border-radius: 15px 5px 15px 15px;
}

.ticket-comment.mine {
  flex-direction: row-reverse;
}

.ticket-comment header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.ticket-comment header strong {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
}

.ticket-comment header strong span {
  padding: 3px 6px;
  border-radius: 999px;
  background: var(--navy);
  color: white;
  font-size: 8px;
}

.ticket-comment time {
  color: var(--muted);
  font-size: 9px;
}

.ticket-comment p {
  margin: 7px 0 0;
  color: #3d505a;
  font-size: 12px;
  line-height: 1.55;
}

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

.ticket-comments-empty > span {
  display: block;
  margin-bottom: 7px;
  font-size: 24px;
}

.ticket-comments-empty p {
  margin: 5px 0 0;
  font-size: 11px;
}

.ticket-comment-form {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 11px;
  padding: 16px 20px;
  background: white;
}

.ticket-composer {
  min-width: 0;
}

.ticket-composer textarea {
  width: 100%;
  box-sizing: border-box;
}

.ticket-comment-form textarea {
  min-height: 92px;
  resize: vertical;
}

.ticket-comment-form .form-actions {
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
}

.ticket-comment-form small {
  color: var(--muted);
  font-size: 9px;
}

.ticket-owner-card {
  padding: 18px;
}

.ticket-owner,
.ticket-no-owner,
.ticket-visibility-card {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-top: 11px;
}

.ticket-owner > div,
.ticket-no-owner {
  display: grid;
  gap: 3px;
}

.ticket-owner small,
.ticket-no-owner span,
.ticket-visibility-card p {
  color: var(--muted);
  font-size: 10px;
}

.ticket-admin-panel {
  display: grid;
  gap: 13px;
  padding: 20px;
  border-radius: 18px;
  background: linear-gradient(155deg, #254f84, #16385e);
  color: white;
  box-shadow: 0 18px 38px rgba(29, 65, 109, 0.2);
}

.ticket-admin-panel h2,
.ticket-admin-panel p {
  margin: 0;
}

.ticket-admin-panel h2 {
  margin: 4px 0 6px;
}

.ticket-admin-panel > div > p:last-child,
.ticket-admin-panel .eyebrow {
  color: rgba(255, 255, 255, 0.7);
}

.ticket-admin-panel label {
  color: rgba(255, 255, 255, 0.84);
}

.ticket-admin-panel select,
.ticket-admin-panel textarea {
  border-color: rgba(255, 255, 255, 0.18);
}

.ticket-admin-panel textarea {
  min-height: 105px;
}

.ticket-admin-panel .check-field {
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.08);
}

.ticket-admin-panel .check-field small {
  color: rgba(255, 255, 255, 0.62);
}

.ticket-admin-panel .field small {
  display: block;
  margin-top: 5px;
  color: rgba(255, 255, 255, 0.66);
  font-size: 9px;
  line-height: 1.35;
}

.ticket-admin-panel .primary-button {
  background: white;
  color: var(--navy);
}

.ticket-visibility-card {
  margin-top: 0;
  padding: 18px;
}

.ticket-visibility-card > span {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--primary-soft);
  color: var(--primary);
}

.ticket-visibility-card p {
  margin: 4px 0 0;
  line-height: 1.45;
}

.ticket-back-button {
  width: 100%;
}

@media (max-width: 1100px) {
  .ticket-overview {
    grid-template-columns: repeat(2, 1fr);
  }

  .ticket-create-panel,
  .ticket-detail-grid {
    grid-template-columns: 1fr;
  }

  .ticket-detail-side {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ticket-back-button {
    grid-column: 1 / -1;
  }

  .ticket-toolbar {
    align-items: stretch;
    flex-wrap: wrap;
  }
}

@media (max-width: 720px) {
  .ticket-overview {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  .ticket-overview button {
    padding: 14px;
  }

  .ticket-create-panel {
    padding: 18px;
  }

  .ticket-create-form {
    grid-template-columns: 1fr;
    padding: 14px;
  }

  .ticket-toolbar,
  .ticket-search,
  .ticket-filters {
    width: 100%;
  }

  .ticket-filters {
    padding-bottom: 3px;
  }

  .ticket-mine-toggle {
    width: 100%;
    border-top: 1px solid var(--line);
    border-left: 0;
    border-radius: 8px;
  }

  .ticket-result-head span {
    display: none;
  }

  .ticket-card {
    grid-template-columns: 40px minmax(0, 1fr);
    padding: 14px;
  }

  .ticket-card-icon {
    width: 38px;
    height: 38px;
  }

  .ticket-card-side {
    grid-column: 2;
    grid-row: 2;
    justify-items: start;
  }

  .ticket-card-side i {
    display: none;
  }

  .ticket-detail-head {
    align-items: stretch;
    flex-direction: column;
  }

  .ticket-progress {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 14px;
  }

  .ticket-progress > div:not(:last-child)::after {
    left: 15px;
    right: auto;
    top: 31px;
    width: 2px;
    height: 10px;
  }

  .ticket-detail-side {
    grid-template-columns: 1fr;
  }

  .ticket-back-button {
    grid-column: auto;
  }

  .ticket-comment > div:last-child {
    max-width: 100%;
  }

  .ticket-comment-form {
    grid-template-columns: 1fr;
  }

  .ticket-comment-form > .avatar {
    display: none;
  }

  .ticket-comment-form .form-actions {
    align-items: stretch;
    flex-direction: column;
  }
}

@media (max-width: 720px) {
  .document-ai-studio #document-text {
    min-height: 520px;
    padding: 17px;
  }
}

.updates-center { display: grid; gap: 22px; max-width: 980px; padding: 28px; border: 1px solid var(--line); border-radius: 26px; background: linear-gradient(135deg, #f7fcfd, #eef7f8); }
.updates-center-heading, .updates-latest, .updates-status { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.updates-center-heading h2, .updates-latest h2 { margin: 4px 0; }
.updates-center-heading p, .updates-latest p { margin: 0; color: var(--muted); }
.updates-version-badge { display: grid; gap: 5px; min-width: 165px; padding: 16px 18px; border: 1px solid #bfd8d6; border-radius: 18px; background: #dcefeb; color: #054b50; }
.updates-version-badge span { font-size: 11px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
.updates-version-badge strong { font-size: 25px; }
.updates-status { justify-content: flex-start; padding: 14px 17px; border: 1px solid #bfd8d6; border-radius: 17px; background: #e0f0ec; }
.updates-status .secondary-button { margin-left: auto; }
.updates-latest { align-items: end; padding-top: 4px; }
.updates-latest small { color: var(--muted); }
.release-modal-backdrop { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: 24px; overflow: auto; background: rgba(8, 43, 49, .44); backdrop-filter: blur(7px); }
.release-modal { position: relative; width: min(820px, 100%); max-height: min(900px, calc(100vh - 48px)); overflow: auto; padding: 34px; border: 1px solid #b7d4d1; border-radius: 30px; background: #f1fbf8; box-shadow: 0 28px 70px rgba(4, 49, 55, .28); color: #063f45; }
.release-modal h2 { max-width: 680px; margin: 12px 0; font-size: clamp(32px, 5vw, 52px); line-height: 1.04; }
.release-modal-copy { max-width: 700px; margin: 0 0 24px; color: #527d7d; font-size: 18px; line-height: 1.45; }
.release-modal-close { position: absolute; top: 22px; right: 22px; width: 43px; height: 43px; border: 1px solid #b7d4d1; border-radius: 50%; background: #e5f3ef; color: #356a6b; font-size: 28px; cursor: pointer; }
.release-modal-message { display: grid; grid-template-columns: 58px 1fr; gap: 15px; margin: 0 0 28px; padding: 18px; border: 1px solid #b7d4d1; border-radius: 22px; background: #dceceb; }
.release-modal-avatar { display: grid; width: 58px; height: 58px; place-items: center; border-radius: 50%; background: #245983; color: white; font-weight: 800; }
.release-modal-message small { display: block; margin-top: 3px; font-weight: 700; }.release-modal-message p { margin: 10px 0 0; color: #356a6b; line-height: 1.45; }
.release-modal-highlights { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }.release-modal-highlights article { display: grid; grid-template-columns: 42px 1fr; gap: 12px; padding: 18px; border: 1px solid #bfd8d6; border-radius: 19px; background: #e2f0ed; }.release-modal-highlights span { display: grid; width: 42px; height: 42px; place-items: center; border-radius: 13px; background: #d1ebe5; font-size: 18px; }.release-modal-highlights h3 { margin: 0 0 6px; font-size: 17px; }.release-modal-highlights p { margin: 0; color: #527d7d; line-height: 1.4; }
.release-modal-changes { margin-top: 18px; padding-top: 16px; border-top: 1px solid #bfd8d6; }.release-modal-changes summary, .release-history-item summary { cursor: pointer; font-weight: 800; }.release-modal-changes ul { color: #527d7d; line-height: 1.55; }
.release-modal footer { display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin-top: 24px; padding-top: 20px; border-top: 1px solid #bfd8d6; }.release-modal footer p { margin-right: auto; color: #527d7d; font-size: 13px; }
.release-history-list { display: grid; gap: 14px; }.release-history-item { padding: 22px; border: 1px solid #bfd8d6; border-radius: 20px; background: #dceceb; }.release-history-item > div { display: flex; justify-content: space-between; font-size: 12px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }.release-history-item time { color: #527d7d; }.release-history-item h3 { margin: 14px 0 8px; font-size: 22px; }.release-history-item p { color: #527d7d; line-height: 1.45; }
@media (max-width: 700px) { .updates-center { padding: 19px; }.updates-center-heading, .updates-latest, .updates-status, .release-modal footer { align-items: stretch; flex-direction: column; }.updates-status .secondary-button, .release-modal footer p { margin: 0; }.release-modal { padding: 24px 18px; border-radius: 23px; }.release-modal h2 { font-size: 32px; }.release-modal-highlights { grid-template-columns: 1fr; }.release-modal-close { top: 13px; right: 13px; } }

/* Центр обновлений использует фирменную палитру ГазДиалога. */
.updates-center { background: linear-gradient(135deg, #ffffff 0%, var(--primary-soft) 100%); }
.updates-version-badge { border-color: var(--line); background: var(--primary-soft); color: var(--navy-dark); }
.updates-status { border-color: var(--line); background: #f4fbfe; }
.release-modal-backdrop { background: rgba(32, 63, 104, .48); }
.release-modal { border-color: var(--line); background: #f8fcfe; box-shadow: 0 28px 70px rgba(32, 63, 104, .28); color: var(--ink); }
.release-modal-copy, .release-modal-message p, .release-modal-highlights p, .release-modal-changes ul, .release-modal footer p, .release-history-item time, .release-history-item p { color: var(--muted); }
.release-modal-close { border-color: var(--line); background: var(--primary-soft); color: var(--navy-dark); }
.release-modal-message { border-color: var(--line); background: #edf8fc; }
.release-modal-avatar { background: var(--navy); }
.release-modal-highlights article { border-color: var(--line); background: #f1f9fd; }
.release-modal-highlights span { background: var(--primary-soft); color: var(--primary-dark); }
.release-modal-changes, .release-modal footer { border-color: var(--line); }
.release-history-item { border-color: var(--line); background: #f1f9fd; }
