:root {
  color-scheme: light;
  --bg: #f4f6f8;
  --surface: #ffffff;
  --surface-strong: #eef3f7;
  --text: #17212b;
  --muted: #617083;
  --line: #dce4ec;
  --teal: #16897a;
  --teal-soft: #dff5f1;
  --blue: #2d6cdf;
  --blue-soft: #e8f0ff;
  --amber: #d88912;
  --amber-soft: #fff1d8;
  --red: #d84d4d;
  --red-soft: #ffe4e3;
  --green: #2e9d61;
  --green-soft: #e4f7ec;
  --violet: #7057d9;
  --violet-soft: #eeeaff;
  --rose: #d84d7c;
  --rose-soft: #ffe5ee;
  --ink: #101824;
  --shadow: 0 18px 42px rgba(31, 45, 61, 0.09);
  --shadow-strong: 0 22px 58px rgba(31, 45, 61, 0.16);
  --radius: 8px;
}

body.dark {
  color-scheme: dark;
  --bg: #11161d;
  --surface: #171f29;
  --surface-strong: #202b37;
  --text: #edf3f8;
  --muted: #9aa9b8;
  --line: #2d3a48;
  --teal-soft: rgba(22, 137, 122, 0.22);
  --blue-soft: rgba(45, 108, 223, 0.2);
  --amber-soft: rgba(216, 137, 18, 0.19);
  --red-soft: rgba(216, 77, 77, 0.18);
  --green-soft: rgba(46, 157, 97, 0.18);
  --shadow: 0 18px 42px rgba(0, 0, 0, 0.24);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(115deg, rgba(22, 137, 122, 0.08), transparent 34%),
    linear-gradient(245deg, rgba(216, 77, 124, 0.07), transparent 36%),
    linear-gradient(180deg, #f8fbfd 0%, var(--bg) 56%, #edf3f7 100%);
  color: var(--text);
  font-family: "Inter", "Segoe UI", Arial, sans-serif;
  font-size: 15px;
  letter-spacing: 0;
  -webkit-text-size-adjust: 100%;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(105deg, transparent 0 18%, rgba(255, 255, 255, 0.62) 19%, transparent 28%),
    repeating-linear-gradient(135deg, rgba(23, 33, 43, 0.035) 0 1px, transparent 1px 28px);
  opacity: 0.55;
}

@keyframes surface-glide {
  0% {
    background-position: -220px 0, 0 0;
  }
  100% {
    background-position: 360px 0, 0 0;
  }
}

@keyframes soft-lift {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-2px);
  }
}

.is-hidden {
  display: none !important;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

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

.app-shell.single-workspace {
  display: block;
}

.boot-screen {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 24px;
  background:
    linear-gradient(135deg, rgba(22, 137, 122, 0.12), rgba(45, 108, 223, 0.08)),
    var(--bg);
}

.boot-card {
  display: grid;
  justify-items: center;
  gap: 10px;
  width: min(360px, 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  background: var(--surface);
  box-shadow: var(--shadow);
  text-align: center;
}

.boot-card span {
  color: var(--muted);
  font-size: 14px;
}

.single-workspace .sidebar,
.single-workspace #overview,
.single-workspace #deadlines,
.single-workspace #documents {
  display: none !important;
}

.single-workspace .workspace {
  max-width: 1500px;
  margin: 0 auto;
}

.single-workspace #requests,
.single-workspace #account {
  display: block;
}

.single-workspace #requests {
  margin-bottom: 18px;
}

.single-workspace #account .section-heading {
  margin-top: 8px;
}

.auth-screen {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 24px;
  background:
    linear-gradient(105deg, rgba(255, 255, 255, 0.68), transparent 28%),
    linear-gradient(135deg, rgba(22, 137, 122, 0.16), rgba(45, 108, 223, 0.09), rgba(216, 77, 124, 0.08)),
    var(--bg);
}

.auth-card {
  width: min(460px, 100%);
  border: 1px solid rgba(211, 222, 232, 0.88);
  border-radius: 14px;
  padding: 22px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.94), rgba(255, 255, 255, 0.82)),
    var(--surface);
  box-shadow: var(--shadow-strong);
}

.auth-brand {
  margin-bottom: 18px;
  color: var(--text);
}

.auth-brand span {
  color: var(--muted);
}

.auth-tabs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 4px;
  min-height: 42px;
  margin-bottom: 16px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-strong);
}

.auth-tabs button {
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
}

.auth-tabs button.is-selected {
  background: var(--surface);
  color: var(--text);
}

.auth-form {
  display: none;
  gap: 12px;
}

.auth-form.is-visible {
  display: grid;
}

.auth-form label,
.inline-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding: 22px 16px;
  background:
    linear-gradient(160deg, rgba(22, 137, 122, 0.34), transparent 42%),
    linear-gradient(25deg, rgba(112, 87, 217, 0.28), transparent 46%),
    #121b26;
  color: #f8fbfd;
  box-shadow: 10px 0 36px rgba(16, 24, 36, 0.18);
  overflow: hidden;
}

.sidebar::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.08), transparent 18%),
    repeating-linear-gradient(140deg, rgba(255, 255, 255, 0.055) 0 1px, transparent 1px 22px);
}

.sidebar > * {
  position: relative;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 54px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.28), transparent 38%),
    linear-gradient(135deg, #1aa38f, #2d6cdf 58%, #7057d9);
  box-shadow: 0 14px 30px rgba(45, 108, 223, 0.28);
  font-weight: 800;
  overflow: hidden;
}

.brand-mark img {
  width: 100%;
  height: 100%;
  display: block;
}

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

.brand strong {
  font-size: 16px;
}

.brand span {
  margin-top: 4px;
  color: #aab8c6;
  font-size: 12px;
}

.nav-stack {
  display: grid;
  gap: 7px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 0 12px;
  background: transparent;
  color: #c8d3dd;
  text-align: left;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.nav-item svg,
.topbar-actions svg,
.toolbar svg,
.panel-header svg,
.primary-button svg,
.secondary-button svg,
.ghost-button svg,
.icon-button svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.nav-item:hover,
.nav-item.is-active {
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  transform: translateX(2px);
}

.side-panel {
  margin-top: auto;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.11), rgba(255, 255, 255, 0.04)),
    rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(14px);
}

.panel-label {
  display: inline-flex;
  margin-bottom: 6px;
  color: var(--teal);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.side-panel .panel-label {
  color: #73dbc9;
}

.side-panel strong {
  display: block;
  margin-bottom: 8px;
  font-size: 20px;
}

.side-panel p {
  margin: 0;
  color: #c8d3dd;
  line-height: 1.5;
}

.workspace {
  min-width: 0;
  padding: 24px 28px 34px;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 26px;
  position: sticky;
  top: 0;
  z-index: 12;
  border: 1px solid rgba(220, 228, 236, 0.74);
  border-radius: 12px;
  padding: 12px;
  background: rgba(248, 251, 253, 0.76);
  box-shadow: 0 14px 36px rgba(31, 45, 61, 0.08);
  backdrop-filter: blur(16px);
}

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

h1 {
  max-width: 760px;
  margin-bottom: 0;
  font-size: 30px;
  line-height: 1.15;
}

h2 {
  margin-bottom: 6px;
  font-size: 22px;
  line-height: 1.2;
}

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

p {
  color: var(--muted);
  line-height: 1.5;
}

.topbar-actions,
.toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.topbar-actions {
  width: 100%;
}

.topbar-actions .search-field {
  margin-right: auto;
}

.requests-heading {
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 14px;
}

.search-field {
  display: flex;
  align-items: center;
  gap: 8px;
  width: min(390px, 36vw);
  min-height: 42px;
  border: 1px solid rgba(188, 203, 217, 0.78);
  border-radius: var(--radius);
  padding: 0 12px;
  background: rgba(255, 255, 255, 0.86);
  color: var(--muted);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.86);
}

.search-field input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
}

.primary-button,
.secondary-button,
.ghost-button,
.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  padding: 0 14px;
  white-space: nowrap;
  transition: transform 150ms ease, box-shadow 150ms ease, border-color 150ms ease, background 150ms ease;
}

.primary-button {
  background:
    linear-gradient(110deg, rgba(255, 255, 255, 0.22), transparent 34%),
    linear-gradient(135deg, var(--teal), #197bb6 62%, var(--violet));
  color: #ffffff;
  box-shadow: 0 14px 28px rgba(22, 137, 122, 0.24);
}

.primary-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 36px rgba(22, 137, 122, 0.3);
}

.secondary-button {
  border-color: rgba(188, 203, 217, 0.84);
  background: rgba(255, 255, 255, 0.9);
  color: var(--text);
}

.secondary-button:hover,
.icon-button:hover {
  transform: translateY(-1px);
  border-color: rgba(22, 137, 122, 0.36);
  box-shadow: 0 10px 24px rgba(31, 45, 61, 0.1);
}

.ghost-button {
  min-height: 36px;
  border-color: transparent;
  background: transparent;
  color: var(--teal);
}

.icon-button {
  width: 42px;
  padding: 0;
  border-color: var(--line);
  background: var(--surface);
  color: var(--text);
}

.view {
  display: none;
}

.view.is-visible {
  display: block;
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.section-heading p {
  margin-bottom: 0;
}

.segmented-control {
  display: inline-grid;
  grid-template-columns: repeat(3, minmax(76px, 1fr));
  gap: 4px;
  min-height: 42px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.segmented-control button {
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
}

.segmented-control button.is-selected {
  background: var(--surface-strong);
  color: var(--text);
  font-weight: 700;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 14px;
}

.metric-card,
.panel,
.doc-card {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(211, 222, 232, 0.88);
  border-radius: 12px;
  background:
    linear-gradient(120deg, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.78)),
    var(--surface);
  box-shadow: var(--shadow);
}

.metric-card::before,
.panel::before,
.doc-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(105deg, transparent 0 34%, rgba(255, 255, 255, 0.72) 43%, transparent 54%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.52), transparent 40%);
  background-size: 420px 100%, 100% 100%;
  background-repeat: no-repeat;
  opacity: 0;
  transform: translateX(-18%);
  transition: opacity 180ms ease;
}

.metric-card:hover::before,
.panel:hover::before,
.doc-card:hover::before {
  opacity: 0.55;
  animation: surface-glide 1.1s ease both;
}

.metric-card {
  display: grid;
  gap: 12px;
  padding: 16px;
  min-height: 136px;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.metric-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-strong);
}

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

.metric-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.metric-icon svg {
  width: 19px;
  height: 19px;
}

.metric-card strong {
  display: block;
  font-size: 28px;
  line-height: 1;
}

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

.trend {
  justify-self: start;
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 700;
}

.trend.up {
  background: var(--green-soft);
  color: var(--green);
}

.trend.warn {
  background: var(--amber-soft);
  color: var(--amber);
}

.trend.neutral,
.status-chip {
  background: var(--surface-strong);
  color: var(--muted);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.55fr);
  gap: 14px;
}

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

.panel {
  min-width: 0;
  padding: 18px;
}

.panel-wide {
  min-height: 320px;
}

.panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.panel-header p {
  margin-bottom: 0;
}

.task-board {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 12px;
}

.task-column {
  position: relative;
  display: grid;
  align-content: start;
  gap: 10px;
  min-height: 250px;
  border: 1px solid rgba(211, 222, 232, 0.86);
  border-radius: 12px;
  padding: 12px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(238, 243, 247, 0.78)),
    var(--surface-strong);
  overflow: hidden;
}

.task-column::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: var(--amber);
}

.task-column.is-work::before {
  background: var(--blue);
}

.task-column.is-risk::before {
  background: var(--red);
}

.task-column.is-done::before {
  background: var(--green);
}

.task-column-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.task-column-header strong {
  font-size: 13px;
  text-transform: uppercase;
}

.task-card {
  position: relative;
  display: grid;
  gap: 9px;
  width: 100%;
  min-height: 138px;
  border: 1px solid rgba(207, 219, 230, 0.9);
  border-left: 4px solid var(--amber);
  border-radius: 10px;
  padding: 12px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(248, 251, 253, 0.88)),
    var(--surface);
  color: var(--text);
  text-align: left;
  box-shadow: 0 8px 24px rgba(31, 45, 61, 0.07);
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.task-card.is-work {
  border-left-color: var(--blue);
}

.task-card.is-risk {
  border-left-color: var(--red);
}

.task-card.is-done {
  border-left-color: var(--green);
}

.task-card.deadline-warn {
  border-left-color: #d6a000;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(255, 242, 166, 0.34)),
    var(--surface);
}

.task-card.deadline-orange {
  border-left-color: #e26c22;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(255, 159, 28, 0.24)),
    var(--surface);
}

.task-card.deadline-hot {
  border-left-color: #dc5227;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(255, 90, 31, 0.2)),
    var(--surface);
  box-shadow: 0 10px 26px rgba(220, 82, 39, 0.14);
}

.task-card.deadline-danger {
  border-left-color: #e11d48;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.88), rgba(225, 29, 72, 0.18)),
    var(--surface);
  box-shadow: 0 10px 28px rgba(225, 29, 72, 0.18);
}

.task-card.deadline-overdue {
  border-left-color: #991b1b;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.84), rgba(153, 27, 27, 0.2)),
    var(--red-soft);
  box-shadow: 0 10px 30px rgba(153, 27, 27, 0.2);
}

.task-card:hover {
  border-color: rgba(22, 137, 122, 0.45);
  transform: translateY(-2px);
  box-shadow: 0 16px 34px rgba(31, 45, 61, 0.12);
}

.task-card strong,
.task-card span,
.task-card small {
  min-width: 0;
}

.task-card strong {
  display: -webkit-box;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  line-height: 1.25;
}

.task-card span,
.task-card small {
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.status-chip,
.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  border-radius: 999px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.status-chip.success,
.pill.done {
  background: var(--green-soft);
  color: var(--green);
}

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

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

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

.pill.deadline-pill {
  border: 1px solid transparent;
}

.pill.deadline-clear {
  border-color: rgba(188, 203, 217, 0.64);
  background: rgba(238, 243, 247, 0.68);
  color: var(--muted);
}

.pill.deadline-warn {
  border-color: #d6a000;
  background: #ffe066;
  color: #4b3600;
}

.pill.deadline-orange {
  border-color: #e26c22;
  background: #ff9f1c;
  color: #3f2100;
}

.pill.deadline-hot {
  border-color: #dc5227;
  background: #ff5a1f;
  color: #ffffff;
  text-shadow: 0 1px 0 rgba(90, 24, 8, 0.2);
}

.pill.deadline-danger {
  border-color: #b91c1c;
  background: #e11d48;
  color: #ffffff;
  text-shadow: 0 1px 0 rgba(75, 12, 18, 0.24);
}

.pill.deadline-overdue {
  border-color: #7f1d1d;
  background: #991b1b;
  color: #ffffff;
  text-shadow: 0 1px 0 rgba(45, 8, 8, 0.28);
}

.donut-wrap {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 205px;
}

.donut {
  width: 164px;
  height: 164px;
  border-radius: 50%;
  background: conic-gradient(var(--teal) 0 42%, var(--amber) 42% 68%, var(--blue) 68% 84%, var(--surface-strong) 84% 100%);
}

.donut::after {
  content: "";
  position: absolute;
  inset: calc(50% - 54px);
  border-radius: 50%;
  background: var(--surface);
}

.donut-center {
  position: absolute;
  display: grid;
  place-items: center;
  text-align: center;
}

.donut-center strong {
  font-size: 30px;
}

.donut-center span {
  max-width: 94px;
  color: var(--muted);
  font-size: 12px;
}

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

.legend-list span {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
}

.dot.teal {
  background: var(--teal);
}

.dot.amber {
  background: var(--amber);
}

.dot.blue {
  background: var(--blue);
}

.mini-gantt,
.gantt-board {
  display: grid;
  gap: 10px;
}

.timeline-row {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr) 84px;
  align-items: center;
  gap: 12px;
}

.timeline-title {
  min-width: 0;
}

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

.timeline-title span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.timeline-track {
  position: relative;
  height: 34px;
  border-radius: var(--radius);
  background:
    linear-gradient(90deg, transparent 24%, var(--line) 24% 25%, transparent 25% 49%, var(--line) 49% 50%, transparent 50% 74%, var(--line) 74% 75%, transparent 75%),
    var(--surface-strong);
  overflow: hidden;
}

.timeline-bar {
  position: absolute;
  top: 7px;
  height: 20px;
  border-radius: 999px;
  background: var(--teal);
}

.timeline-bar.deadline-clear {
  background: rgba(188, 203, 217, 0.86);
}

.timeline-bar.deadline-warn {
  background: #ffe066;
}

.timeline-bar.deadline-orange {
  background: #ff9f1c;
}

.timeline-bar.deadline-hot {
  background: #ff5a1f;
}

.timeline-bar.deadline-danger {
  background: #e11d48;
}

.timeline-bar.deadline-overdue {
  background: #991b1b;
}

.timeline-bar.warn {
  background: var(--amber);
}

.timeline-bar.risk {
  background: var(--red);
}

.risk-list,
.quality-stack {
  display: grid;
  gap: 12px;
}

.risk-item {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-strong);
}

.risk-item strong {
  font-size: 14px;
}

.risk-item p {
  margin-bottom: 0;
  font-size: 13px;
}

select,
.form-grid input,
.upload-panel input:not([type="file"]),
.auth-form input,
.auth-form select,
.inline-form input,
.inline-form select,
.personal-task-editor input,
textarea {
  min-height: 42px;
  border: 1px solid rgba(188, 203, 217, 0.86);
  border-radius: 10px;
  padding: 0 12px;
  background: rgba(255, 255, 255, 0.86);
  color: var(--text);
  font: inherit;
  min-width: 0;
  width: 100%;
}

.form-grid label.has-warning input {
  border-color: rgba(216, 77, 77, 0.78);
  background: linear-gradient(180deg, rgba(255, 247, 247, 0.98), rgba(255, 255, 255, 0.92));
  box-shadow: 0 0 0 3px rgba(216, 77, 77, 0.12);
}

.duplicate-warning {
  display: none;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(216, 77, 77, 0.28);
  border-radius: 10px;
  padding: 8px 10px;
  background: linear-gradient(135deg, rgba(255, 235, 235, 0.96), rgba(255, 248, 248, 0.9));
  color: var(--red);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
}

.duplicate-warning.is-visible {
  display: flex;
}

.duplicate-warning::before {
  content: "!";
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: var(--red);
  color: #ffffff;
  font-size: 12px;
  line-height: 1;
}

.request-number {
  color: inherit;
  font-weight: 900;
}

.request-number.is-duplicate {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  gap: 6px;
  border: 1px solid rgba(216, 77, 77, 0.42);
  border-radius: 999px;
  padding: 2px 7px;
  background: linear-gradient(135deg, rgba(255, 235, 235, 0.98), rgba(255, 247, 247, 0.92));
  color: var(--red);
  box-shadow: 0 6px 16px rgba(216, 77, 77, 0.12);
}

.request-number.is-duplicate::after {
  content: "дубль";
  border-radius: 999px;
  padding: 1px 6px;
  background: rgba(216, 77, 77, 0.12);
  color: var(--red);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

textarea {
  min-height: 96px;
  padding: 10px 12px;
  line-height: 1.45;
  resize: vertical;
}

#editSubject {
  min-height: 78px;
  overflow-wrap: anywhere;
}

.table-wrap {
  overflow: auto;
}

table {
  width: 100%;
  min-width: 1060px;
  border-collapse: collapse;
}

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

th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

td {
  color: var(--text);
}

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

tbody tr:hover {
  background:
    linear-gradient(90deg, rgba(22, 137, 122, 0.08), transparent),
    var(--surface-strong);
}

.request-mobile-tab-row {
  display: none;
}

.request-mobile-tab {
  border: 1px solid var(--line);
  border-left: 5px solid rgba(188, 203, 217, 0.88);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: 0 10px 26px rgba(31, 45, 61, 0.08);
  overflow: hidden;
}

.request-mobile-tab.deadline-warn {
  border-left-color: #d6a000;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(255, 224, 102, 0.28)),
    var(--surface);
}

.request-mobile-tab.deadline-orange {
  border-left-color: #e26c22;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(255, 159, 28, 0.24)),
    var(--surface);
}

.request-mobile-tab.deadline-hot {
  border-left-color: #dc5227;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(255, 90, 31, 0.22)),
    var(--surface);
}

.request-mobile-tab.deadline-danger {
  border-left-color: #e11d48;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(225, 29, 72, 0.2)),
    var(--red-soft);
}

.request-mobile-tab.deadline-overdue {
  border-left-color: #991b1b;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.86), rgba(153, 27, 27, 0.24)),
    var(--red-soft);
}

.request-mobile-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(116px, auto) 22px;
  align-items: center;
  gap: 10px;
  min-height: 74px;
  padding: 12px;
  cursor: pointer;
  list-style: none;
}

.request-mobile-summary::-webkit-details-marker {
  display: none;
}

.request-mobile-title,
.request-mobile-title strong,
.request-mobile-title span,
.request-mobile-deadline,
.request-mobile-deadline small,
.request-mobile-deadline b {
  display: block;
  min-width: 0;
}

.request-mobile-title strong {
  color: var(--text);
  font-size: 13px;
  font-weight: 900;
}

.request-mobile-title span {
  margin-top: 4px;
  color: var(--text);
  font-size: 14px;
  font-weight: 800;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.request-mobile-deadline {
  justify-self: end;
  max-width: 136px;
  border: 1px solid rgba(188, 203, 217, 0.62);
  border-radius: 10px;
  padding: 6px 8px;
  background: rgba(255, 255, 255, 0.78);
  text-align: right;
}

.request-mobile-deadline small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.request-mobile-deadline b {
  margin-top: 2px;
  color: var(--text);
  font-size: 12px;
  line-height: 1.2;
}

.request-mobile-summary > svg {
  color: var(--muted);
  transition: transform 160ms ease;
}

.request-mobile-tab[open] .request-mobile-summary > svg {
  transform: rotate(180deg);
}

.request-mobile-panel {
  display: grid;
  gap: 10px;
  border-top: 1px solid rgba(188, 203, 217, 0.64);
  padding: 10px 12px 12px;
  background: rgba(255, 255, 255, 0.58);
}

.request-mobile-field,
.request-mobile-note {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.request-mobile-field small,
.request-mobile-note small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.request-mobile-field strong,
.request-mobile-field span,
.request-mobile-note span {
  min-width: 0;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.request-mobile-note span {
  border: 1px solid rgba(188, 203, 217, 0.68);
  border-radius: 10px;
  padding: 9px 10px;
  background: rgba(255, 255, 255, 0.78);
}

.progress-cell {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 150px;
}

.progress-track {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: var(--surface-strong);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: inherit;
  background: var(--teal);
}

.gantt-board {
  min-height: 470px;
}

.gantt-header,
.gantt-row {
  display: grid;
  grid-template-columns: 220px repeat(8, minmax(72px, 1fr));
  align-items: center;
  gap: 0;
}

.gantt-header {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.gantt-header span,
.gantt-cell {
  min-height: 42px;
  border-bottom: 1px solid var(--line);
  padding: 10px;
}

.gantt-name {
  min-width: 0;
  color: var(--text);
  font-weight: 700;
}

.gantt-cell {
  position: relative;
  border-left: 1px solid var(--line);
}

.gantt-block {
  position: absolute;
  top: 11px;
  left: 8px;
  right: 8px;
  height: 20px;
  border-radius: 999px;
  background: var(--teal);
}

.gantt-block.alt {
  background: var(--blue);
}

.gantt-block.warn {
  background: var(--amber);
}

.gantt-block.risk {
  background: var(--red);
}

.gantt-header.work-schedule,
.gantt-row.work-schedule {
  grid-template-columns: minmax(180px, 1.3fr) minmax(140px, 0.9fr) minmax(110px, 0.55fr) minmax(110px, 0.55fr) minmax(160px, 0.8fr);
}

.gantt-row.work-schedule > div {
  min-height: 54px;
  border-bottom: 1px solid var(--line);
  padding: 12px 10px;
}

.gantt-row.work-schedule:hover {
  background: var(--surface-strong);
}

.analytics-grid,
.document-grid,
.account-grid,
.personal-control-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.personal-control-section {
  margin: 18px 0;
}

.personal-task-form {
  align-items: end;
}

.personal-task-list {
  display: grid;
  gap: 10px;
  padding: 14px;
}

.personal-task-card {
  border: 1px solid rgba(211, 222, 232, 0.9);
  border-left: 4px solid var(--blue);
  border-radius: 12px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.74), rgba(238, 243, 247, 0.86)),
    var(--surface-strong);
  box-shadow: 0 10px 28px rgba(31, 45, 61, 0.08);
  overflow: hidden;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.personal-task-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 34px rgba(31, 45, 61, 0.11);
}

.personal-task-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 24px;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 12px 14px;
  cursor: pointer;
  list-style: none;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.64), transparent),
    transparent;
}

.personal-task-summary::-webkit-details-marker {
  display: none;
}

.personal-task-summary strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.personal-task-summary-date {
  justify-self: end;
  max-width: 240px;
  border: 1px solid rgba(188, 203, 217, 0.86);
  border-radius: 10px;
  padding: 5px 8px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.personal-task-summary svg {
  width: 18px;
  height: 18px;
  color: var(--muted);
  transition: transform 160ms ease;
}

.personal-task-card[open] .personal-task-summary svg {
  transform: rotate(180deg);
}

.personal-task-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  border-top: 1px solid var(--line);
  padding: 12px;
}

.personal-task-card.is-overdue {
  border-color: rgba(216, 77, 77, 0.42);
  border-left-color: var(--red);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.64), rgba(255, 228, 227, 0.84)),
    var(--red-soft);
}

.personal-task-card.is-soon {
  border-color: rgba(216, 137, 18, 0.42);
  border-left-color: var(--amber);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.64), rgba(255, 241, 216, 0.86)),
    var(--amber-soft);
}

.personal-task-card.deadline-warn {
  border-color: rgba(214, 160, 0, 0.64);
  border-left-color: #d6a000;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.78), rgba(255, 224, 102, 0.34)),
    var(--surface);
}

.personal-task-card.deadline-orange {
  border-color: rgba(226, 108, 34, 0.68);
  border-left-color: #e26c22;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.74), rgba(255, 159, 28, 0.28)),
    var(--surface);
}

.personal-task-card.deadline-hot {
  border-color: rgba(220, 82, 39, 0.72);
  border-left-color: #ff5a1f;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.7), rgba(255, 90, 31, 0.25)),
    var(--surface);
}

.personal-task-card.deadline-danger {
  border-color: rgba(225, 29, 72, 0.76);
  border-left-color: #e11d48;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.68), rgba(225, 29, 72, 0.26)),
    var(--red-soft);
}

.personal-task-card.deadline-overdue {
  border-color: rgba(153, 27, 27, 0.8);
  border-left-color: #991b1b;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.62), rgba(153, 27, 27, 0.3)),
    var(--red-soft);
}

.personal-task-main {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.personal-task-main strong,
.personal-task-main small {
  overflow: hidden;
  text-overflow: ellipsis;
}

.personal-task-main small {
  color: var(--muted);
  line-height: 1.35;
}

.personal-task-meta,
.personal-task-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
}

.personal-task-actions {
  justify-content: flex-start;
  border-top: 1px solid rgba(23, 33, 43, 0.08);
  padding-top: 10px;
}

.personal-task-files {
  display: grid;
  gap: 6px;
  margin-top: 4px;
}

.personal-task-file {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) repeat(3, 30px);
  align-items: center;
  gap: 7px;
  min-height: 34px;
  border: 1px solid rgba(188, 203, 217, 0.82);
  border-radius: 8px;
  padding: 5px 6px;
  background: rgba(255, 255, 255, 0.84);
}

.personal-task-file span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.personal-task-editor {
  display: grid;
  gap: 8px;
  margin-top: 4px;
}

.personal-task-editor label:not(.file-picker) {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.personal-task-editor textarea {
  min-height: 72px;
}

.personal-task-schedule {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
}

.personal-task-quick-dates {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: 8px;
}

.personal-task-editor-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.personal-task-upload {
  min-height: 34px;
}

.mini-icon {
  width: 30px;
  min-height: 30px;
  padding: 0;
}

.check-field {
  display: flex !important;
  align-items: center;
  gap: 9px !important;
  min-height: 42px;
  color: var(--text) !important;
}

.check-field input {
  width: 18px;
  height: 18px;
  min-height: 0;
  padding: 0;
  accent-color: var(--teal);
}

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

.inline-form button {
  align-self: end;
}

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

.compact-item {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 54px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 9px;
  color: var(--text);
  text-decoration: none;
}

.compact-item:hover {
  background: var(--surface-strong);
}

.compact-item.no-link {
  color: var(--text);
  text-decoration: none;
}

.user-card {
  align-items: start;
}

.user-card.contractor-manager {
  border-color: rgba(22, 137, 122, 0.32);
  background: linear-gradient(180deg, var(--surface), var(--teal-soft));
}

.user-card.contractor-employee {
  margin-left: 20px;
}

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

.compact-item svg {
  width: 19px;
  height: 19px;
  color: var(--blue);
}

.compact-item strong,
.compact-item small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.compact-item small {
  margin-top: 3px;
  color: var(--muted);
}

.empty-state {
  display: grid;
  place-items: center;
  min-height: 120px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  padding: 18px;
  color: var(--muted);
  text-align: center;
}

.empty-state.small {
  min-height: 64px;
  border: 0;
  padding: 8px;
  text-align: left;
}

.empty-state.large {
  grid-column: 1 / -1;
  min-height: 220px;
}

.alert-list,
.deadline-board {
  display: grid;
  gap: 12px;
}

.alert-item {
  display: grid;
  gap: 5px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  background: var(--surface-strong);
  color: var(--text);
  text-align: left;
  touch-action: pan-y;
  transition: opacity 160ms ease, transform 160ms ease, box-shadow 160ms ease;
  will-change: transform;
}

.alert-item.is-swiping {
  box-shadow: 0 14px 30px rgba(31, 45, 61, 0.16);
}

.alert-item.is-dismissing {
  opacity: 0;
  transform: translateX(120%) !important;
}

.alert-item.overdue {
  border-color: rgba(216, 77, 77, 0.36);
  background: var(--red-soft);
}

.alert-item.soon,
.alert-item.work {
  border-color: rgba(216, 137, 18, 0.36);
  background: var(--amber-soft);
}

.alert-item.risk {
  border-color: rgba(216, 77, 77, 0.36);
  background: var(--red-soft);
}

.alert-item.done {
  border-color: rgba(46, 157, 97, 0.32);
  background: rgba(46, 157, 97, 0.1);
}

.alert-item.deadline-clear {
  border-color: var(--line);
  background: var(--surface-strong);
}

.alert-item.deadline-warn {
  border-color: rgba(214, 160, 0, 0.64);
  background:
    linear-gradient(90deg, rgba(255, 224, 102, 0.38), rgba(255, 255, 255, 0.8)),
    #fff7df;
}

.alert-item.deadline-orange {
  border-color: rgba(226, 108, 34, 0.68);
  background:
    linear-gradient(90deg, rgba(255, 159, 28, 0.34), rgba(255, 255, 255, 0.78)),
    #ffedda;
}

.alert-item.deadline-hot {
  border-color: rgba(220, 82, 39, 0.72);
  background:
    linear-gradient(90deg, rgba(255, 90, 31, 0.32), rgba(255, 255, 255, 0.76)),
    #ffe3d9;
}

.alert-item.deadline-danger {
  border-color: rgba(225, 29, 72, 0.74);
  background:
    linear-gradient(90deg, rgba(225, 29, 72, 0.3), rgba(255, 255, 255, 0.74)),
    #ffdddd;
}

.alert-item.deadline-overdue {
  border-color: rgba(153, 27, 27, 0.78);
  background:
    linear-gradient(90deg, rgba(153, 27, 27, 0.32), rgba(255, 255, 255, 0.72)),
    #f6caca;
}

.empty-state.compact-hint {
  min-height: auto;
  margin-top: 8px;
  padding: 10px 12px;
  font-size: 13px;
}

.alert-item span,
.alert-item small {
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.deadline-card {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(180px, 0.55fr) auto;
  align-items: center;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  background: var(--surface);
}

.deadline-card.overdue {
  border-color: rgba(216, 77, 77, 0.42);
}

.deadline-card.soon {
  border-color: rgba(216, 137, 18, 0.42);
}

.deadline-card.deadline-clear {
  border-color: var(--line);
}

.deadline-card.deadline-warn {
  border-color: rgba(214, 160, 0, 0.66);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(255, 224, 102, 0.36)),
    var(--surface);
}

.deadline-card.deadline-orange {
  border-color: rgba(226, 108, 34, 0.7);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(255, 159, 28, 0.3)),
    var(--surface);
}

.deadline-card.deadline-hot {
  border-color: rgba(220, 82, 39, 0.74);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.88), rgba(255, 90, 31, 0.28)),
    var(--surface);
}

.deadline-card.deadline-danger {
  border-color: rgba(225, 29, 72, 0.76);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.86), rgba(225, 29, 72, 0.26)),
    var(--red-soft);
}

.deadline-card.deadline-overdue {
  border-color: rgba(153, 27, 27, 0.8);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.82), rgba(153, 27, 27, 0.28)),
    var(--red-soft);
}

.deadline-card h3 {
  margin: 9px 0 4px;
}

.deadline-card p,
.deadline-card span {
  margin: 0;
  color: var(--muted);
}

.compact-action {
  min-height: 34px;
  padding: 0 10px;
}

.danger-action {
  border-color: rgba(216, 77, 77, 0.35);
  color: var(--red);
}

.response-note {
  color: var(--teal);
}

.bar-list {
  display: grid;
  gap: 16px;
}

.bar-row {
  display: grid;
  gap: 8px;
}

.bar-row header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.bar-row header span {
  color: var(--muted);
}

.bar-track {
  height: 12px;
  border-radius: 999px;
  background: var(--surface-strong);
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--teal), var(--blue));
}

.quality-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.quality-item strong,
.quality-item span {
  display: block;
}

.quality-item span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
}

.doc-card {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.file-link {
  justify-self: start;
  text-decoration: none;
}

.upload-panel {
  margin-bottom: 14px;
}

.upload-panel form {
  display: grid;
  grid-template-columns: minmax(180px, 0.85fr) minmax(180px, 0.85fr) minmax(220px, 1.2fr) auto;
  align-items: end;
  gap: 12px;
}

.upload-panel label,
.wide-field {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.file-picker {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  padding: 0 12px;
  background: var(--surface-strong);
  color: var(--text);
  cursor: pointer;
  transition:
    border-color 160ms ease,
    background 160ms ease,
    box-shadow 160ms ease;
}

.file-picker.is-dragover {
  border-color: var(--blue);
  background: var(--blue-soft);
  box-shadow: 0 0 0 3px rgba(45, 108, 223, 0.12);
}

.file-picker input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
  pointer-events: none;
}

.file-picker span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-picker svg {
  width: 18px;
  height: 18px;
}

.selected-files {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}

.upload-panel .selected-files {
  grid-column: 1 / -1;
}

.selected-file {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 4px 5px 4px 9px;
  background: var(--surface-strong);
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
}

.selected-file span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.selected-file button {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
}

.selected-file button:hover {
  background: var(--red-soft);
  color: var(--red);
}

.selected-file svg {
  width: 15px;
  height: 15px;
}

.wide-field {
  grid-column: span 2;
}

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

.doc-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: var(--radius);
  background: var(--blue-soft);
  color: var(--blue);
}

.doc-icon svg {
  width: 20px;
  height: 20px;
}

.doc-card h3 {
  margin-bottom: 0;
}

.doc-card p {
  margin-bottom: 0;
}

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

.file-workspace {
  display: block;
}

.file-section {
  display: grid;
  align-content: start;
  gap: 10px;
  min-width: 0;
}

.file-section h3 {
  margin: 0;
  color: var(--text);
}

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

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

.attachment-drawer {
  display: block;
  grid-column: 1 / -1;
  align-self: start;
  justify-self: stretch;
  min-width: 0;
  min-height: 68px;
  border: 1px solid rgba(188, 203, 217, 0.76);
  border-radius: 14px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(238, 243, 247, 0.82)),
    var(--surface);
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  overflow: visible;
}

.attachment-drawer.has-files {
  border-color: rgba(45, 108, 223, 0.34);
  box-shadow: 0 14px 34px rgba(45, 108, 223, 0.1);
}

.attachment-drawer.is-expanded.has-files {
  min-height: 930px;
}

.attachment-drawer.is-expanded:not(.has-files) {
  min-height: 220px;
}

.attachment-drawer.is-collapsed {
  min-height: 68px;
  overflow: hidden;
}

.edit-dialog .form-grid > .attachment-drawer {
  grid-column: 1 / -1;
}

.attachment-summary {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto 28px;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 68px;
  border: 0;
  padding: 12px 14px;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font: inherit;
  list-style: none;
  text-align: left;
}

.attachment-drawer.has-files .attachment-summary {
  background:
    linear-gradient(110deg, rgba(45, 108, 223, 0.12), rgba(22, 137, 122, 0.08)),
    rgba(255, 255, 255, 0.82);
}

.attachment-drawer.has-files #editAttachmentCount {
  background: var(--blue-soft);
  color: var(--blue);
}

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

.attachment-summary:focus-visible {
  outline: 3px solid rgba(45, 108, 223, 0.24);
  outline-offset: -3px;
}

.attachment-summary-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background:
    linear-gradient(135deg, rgba(45, 108, 223, 0.16), rgba(22, 137, 122, 0.14)),
    var(--blue-soft);
  color: var(--blue);
}

.attachment-summary strong,
.attachment-summary small {
  display: block;
  min-width: 0;
}

.attachment-summary small {
  margin-top: 3px;
  color: var(--muted);
  font-weight: 700;
}

.attachment-summary-chevron {
  color: var(--muted);
  transition: transform 160ms ease;
}

.attachment-drawer.is-expanded .attachment-summary-chevron {
  transform: rotate(180deg);
}

.attachment-drawer-body {
  display: grid;
  gap: 12px;
  border-top: 1px solid var(--line);
  padding: 12px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.74), rgba(238, 243, 247, 0.72)),
    var(--surface-strong);
}

.attachment-drawer.is-collapsed .attachment-drawer-body {
  display: none;
}

.attachment-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.attachment-tabs button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 36px;
  border: 1px solid rgba(188, 203, 217, 0.78);
  border-radius: 999px;
  padding: 0 10px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--muted);
  font-weight: 800;
}

.attachment-tabs button svg {
  width: 16px;
  height: 16px;
}

.attachment-tabs button strong {
  display: inline-grid;
  place-items: center;
  min-width: 24px;
  height: 22px;
  border-radius: 999px;
  background: var(--surface-strong);
  color: var(--text);
  font-size: 12px;
}

.attachment-tabs button.is-selected {
  border-color: rgba(22, 137, 122, 0.4);
  background:
    linear-gradient(135deg, rgba(22, 137, 122, 0.14), rgba(45, 108, 223, 0.1)),
    #ffffff;
  color: var(--teal);
}

.attachment-browser {
  display: grid;
  grid-template-columns: minmax(280px, 0.34fr) minmax(0, 1fr);
  gap: 12px;
  min-height: 760px;
  height: min(84vh, 920px);
  max-height: none;
}

.attachment-list,
.attachment-preview-panel {
  min-height: 0;
  border: 1px solid rgba(211, 222, 232, 0.9);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 12px 32px rgba(31, 45, 61, 0.08);
}

.attachment-list {
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 10px;
  overflow: auto;
}

.attachment-file {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 5px;
  background: rgba(248, 251, 253, 0.72);
  transition: background 150ms ease, border-color 150ms ease, transform 150ms ease;
}

.attachment-file:hover,
.attachment-file.is-selected {
  border-color: rgba(22, 137, 122, 0.34);
  background: rgba(255, 255, 255, 0.98);
}

.attachment-file.is-selected {
  box-shadow: inset 3px 0 0 var(--teal);
}

.attachment-file-main {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  min-width: 0;
  border: 0;
  padding: 4px;
  background: transparent;
  color: var(--text);
  text-align: left;
}

.attachment-file-main > svg {
  display: grid;
  place-self: center;
  width: 20px;
  height: 20px;
  color: var(--blue);
}

.attachment-file-main span,
.attachment-file-main strong,
.attachment-file-main small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attachment-file-main strong {
  font-size: 13px;
}

.attachment-file-main small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.attachment-file-actions {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.danger-icon {
  color: var(--red);
}

.attachment-preview-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
}

.attachment-preview-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
  border-bottom: 1px solid var(--line);
  padding: 10px;
}

.attachment-preview-header strong,
.attachment-preview-header span {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attachment-preview-header span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.attachment-preview-actions {
  display: inline-flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.attachment-preview-actions a[aria-disabled="true"],
.attachment-preview-actions button:disabled {
  opacity: 0.48;
  pointer-events: none;
}

.attachment-preview-shell {
  position: relative;
  min-height: 0;
  background: #ffffff;
}

.attachment-preview-frame {
  width: 100%;
  height: 100%;
  min-height: 0;
  border: 0;
  background: #ffffff;
}

.attachment-preview-frame[hidden] {
  display: none;
}

.attachment-preview-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  padding: 24px;
  color: var(--muted);
  text-align: center;
}

.attachment-preview-empty[hidden] {
  display: none;
}

.attachment-preview-empty svg {
  width: 36px;
  height: 36px;
  color: var(--blue);
}

.attachment-preview-empty strong {
  color: var(--text);
}

.file-preview-dialog {
  width: calc(100vw - 8px);
  height: calc(100dvh - 8px);
  border: 0;
  border-radius: var(--radius);
  padding: 0;
  background: transparent;
  color: var(--text);
  box-shadow: var(--shadow);
}

.file-preview-dialog::backdrop {
  background: rgba(13, 22, 32, 0.52);
  backdrop-filter: blur(2px);
}

.file-preview-window {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: 100%;
  height: 100%;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.file-preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
  border-bottom: 1px solid var(--line);
  padding: 10px;
  background: var(--surface);
}

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

.file-preview-header span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.file-preview-actions {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.file-preview-frame {
  width: 100%;
  height: 100%;
  min-height: 0;
  border: 0;
  background: #ffffff;
}

.file-preview-empty {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  min-height: 280px;
  padding: 20px;
  color: var(--muted);
  text-align: center;
}

.file-preview-empty svg {
  width: 34px;
  height: 34px;
  color: var(--blue);
}

.file-preview-empty strong {
  color: var(--text);
}

.task-dialog {
  width: min(820px, calc(100vw - 32px));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow);
}

.edit-dialog {
  width: min(1480px, calc(100vw - 14px));
  height: calc(100dvh - 14px);
  max-height: 1040px;
}

.task-dialog::backdrop {
  background: rgba(13, 22, 32, 0.42);
}

.task-dialog form {
  padding: 20px;
}

.edit-dialog form {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  height: 100%;
  overflow: hidden;
}

.edit-dialog .form-grid {
  align-content: start;
  overflow: auto;
  padding-right: 4px;
}

.dialog-header,
.dialog-actions {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin: 0;
  padding: 0;
}

.dialog-header {
  margin-bottom: 18px;
}

.dialog-header p {
  margin-bottom: 0;
}

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

.form-grid label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.dialog-actions {
  justify-content: flex-end;
  margin-top: 20px;
}

.dialog-actions-spacer {
  flex: 1 1 auto;
}

.danger-action {
  border-color: rgba(216, 77, 77, 0.34) !important;
  background: var(--red-soft) !important;
  color: var(--red) !important;
}

.danger-action:hover {
  box-shadow: 0 12px 26px rgba(216, 77, 77, 0.16);
}

.push-dialog {
  width: min(520px, calc(100vw - 24px));
  border: 0;
  border-radius: var(--radius);
  padding: 0;
  background: transparent;
  color: var(--text);
}

.push-dialog::backdrop {
  background: rgba(13, 22, 32, 0.44);
  backdrop-filter: blur(2px);
}

.push-card {
  display: grid;
  gap: 14px;
  border: 1px solid rgba(211, 222, 232, 0.92);
  border-radius: 14px;
  padding: 16px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(238, 243, 247, 0.94)),
    var(--surface);
  box-shadow: var(--shadow-strong);
}

.push-dialog .dialog-actions {
  flex-wrap: wrap;
}

.push-dialog .dialog-actions button {
  min-width: 0;
}

.push-status {
  border: 1px solid rgba(211, 222, 232, 0.92);
  border-radius: 12px;
  padding: 12px;
  background: rgba(238, 243, 247, 0.82);
  color: var(--text);
  font-weight: 800;
}

.push-status.good {
  border-color: rgba(46, 157, 97, 0.34);
  background: var(--green-soft);
}

.push-status.warn {
  border-color: rgba(216, 137, 18, 0.34);
  background: var(--amber-soft);
}

.push-linked {
  display: grid;
  gap: 3px;
  border: 1px solid rgba(211, 222, 232, 0.92);
  border-radius: 12px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.76);
  color: var(--muted);
  font-size: 13px;
}

.push-linked strong {
  color: var(--text);
  font-size: 14px;
}

.push-linked.good {
  border-color: rgba(46, 157, 97, 0.28);
  background: rgba(232, 247, 239, 0.86);
}

.push-linked.warn {
  border-color: rgba(216, 137, 18, 0.32);
  background: rgba(255, 247, 225, 0.88);
}

.push-steps {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.push-steps ol {
  margin: 0;
  padding-left: 20px;
}

.push-device-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.push-device-grid div {
  display: grid;
  gap: 4px;
  border: 1px solid rgba(211, 222, 232, 0.9);
  border-radius: 12px;
  padding: 10px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(248, 251, 253, 0.88)),
    var(--surface);
}

.push-device-grid strong {
  color: var(--text);
}

.push-device-grid span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  transform: translateY(20px);
  opacity: 0;
  pointer-events: none;
  max-width: 360px;
  border-radius: var(--radius);
  padding: 12px 14px;
  background: #17212b;
  color: #ffffff;
  box-shadow: var(--shadow);
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.is-visible {
  transform: translateY(0);
  opacity: 1;
}

.pull-refresh-indicator {
  position: fixed;
  top: calc(env(safe-area-inset-top) + 8px);
  left: 50%;
  z-index: 80;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  border: 1px solid rgba(188, 203, 217, 0.72);
  border-radius: 999px;
  padding: 0 13px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--text);
  font-size: 13px;
  font-weight: 900;
  box-shadow: 0 16px 34px rgba(31, 45, 61, 0.16);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -64px);
  transition: opacity 150ms ease, transform 150ms ease, border-color 150ms ease, background 150ms ease;
}

.pull-refresh-indicator svg {
  width: 17px;
  height: 17px;
}

.pull-refresh-indicator.is-visible {
  opacity: 1;
}

.pull-refresh-indicator.is-ready {
  border-color: rgba(22, 137, 122, 0.44);
  background: rgba(232, 247, 244, 0.96);
  color: var(--teal);
}

.pull-refresh-indicator.is-refreshing svg {
  animation: refresh-spin 820ms linear infinite;
}

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

@media (prefers-reduced-motion: no-preference) {
  .task-board-panel {
    animation: soft-lift 8s ease-in-out infinite;
  }

  .nav-item.is-active svg,
  .primary-button:hover svg {
    transform: translateX(1px);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.001ms !important;
  }
}

@media (max-width: 1180px) {
  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-grid,
  .analytics-grid,
  .document-grid,
  .account-grid,
  .personal-control-grid {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 900px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    padding: 16px;
  }

  .nav-stack {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .nav-item {
    justify-content: center;
    padding: 0 8px;
  }

  .nav-item span {
    display: none;
  }

  .side-panel {
    display: none;
  }

  .workspace {
    padding: 18px;
  }

  .topbar,
  .section-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar-actions,
  .toolbar {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .upload-panel form {
    grid-template-columns: 1fr;
  }

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

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

  .attachment-browser {
    grid-template-columns: 1fr;
    height: auto;
    max-height: none;
    min-height: 0;
  }

  .attachment-list {
    max-height: 280px;
  }

  .attachment-preview-panel {
    min-height: 540px;
  }

  .file-preview-dialog {
    width: calc(100vw - 18px);
    height: calc(100vh - 18px);
  }

  .wide-field {
    grid-column: auto;
  }

  .search-field {
    width: 100%;
  }
}

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

  h1 {
    font-size: 22px;
  }

  h2 {
    font-size: 19px;
  }

  h3 {
    font-size: 15px;
  }

  .auth-screen {
    align-items: start;
    padding: 12px;
  }

  .auth-card {
    padding: 16px;
  }

  .single-workspace .workspace,
  .workspace {
    width: 100%;
    padding: 12px;
  }

  .topbar {
    gap: 14px;
    margin-bottom: 16px;
  }

  .topbar-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
    gap: 8px;
  }

  .search-field {
    grid-column: 1 / -1;
    min-height: 44px;
  }

  #newRequestButton {
    grid-column: 1 / -1;
  }

  .section-heading {
    gap: 12px;
    margin-bottom: 12px;
  }

  .toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    width: 100%;
  }

  .toolbar select {
    min-width: 0;
    width: 100%;
  }

  .panel {
    padding: 12px;
    box-shadow: none;
  }

  .metric-grid,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .task-board {
    grid-template-columns: 1fr;
  }

  .task-column {
    min-height: 0;
  }

  .push-device-grid {
    grid-template-columns: 1fr;
  }

  .table-wrap {
    overflow: visible;
  }

  table {
    display: block;
    min-width: 0;
    width: 100%;
  }

  thead {
    display: none;
  }

  tbody {
    display: grid;
    gap: 10px;
  }

  tbody tr.request-desktop-row {
    display: none;
  }

  tbody tr.request-mobile-tab-row {
    display: block;
    border: 0;
    border-radius: 0;
    background: transparent;
    overflow: visible;
  }

  tbody tr.request-mobile-tab-row:hover {
    background: transparent;
  }

  .request-mobile-tab-row td {
    display: block;
    border: 0;
    padding: 0;
  }

  .request-mobile-tab-row td::before {
    content: "";
  }

  .request-mobile-tab {
    display: block;
  }

  .request-mobile-panel .compact-action {
    width: 100%;
  }

  tbody tr {
    display: grid;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    overflow: hidden;
  }

  tbody tr:hover {
    background: var(--surface);
  }

  td {
    display: grid;
    grid-template-columns: minmax(92px, 0.38fr) minmax(0, 1fr);
    gap: 10px;
    align-items: start;
    border-bottom: 1px solid var(--line);
    padding: 10px 11px;
    font-size: 14px;
  }

  td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
  }

  td[colspan] {
    display: block;
  }

  td[colspan]::before {
    content: "";
  }

  td:last-child {
    border-bottom: 0;
  }

  td[data-label="Письмо"],
  td[data-label="Действие"] {
    grid-template-columns: 1fr;
  }

  td[data-label="Письмо"]::before,
  td[data-label="Действие"]::before {
    margin-bottom: -4px;
  }

  .compact-action {
    width: 100%;
    min-height: 38px;
  }

  .pill {
    justify-self: start;
    max-width: 100%;
    white-space: normal;
    text-align: left;
  }

  .account-grid,
  .personal-control-grid {
    gap: 10px;
  }

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

  .personal-task-summary {
    grid-template-columns: minmax(0, 1fr) 22px;
  }

  .personal-task-summary-date {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-self: start;
    max-width: 100%;
  }

  .personal-task-summary svg {
    grid-column: 2;
    grid-row: 1;
  }

  .personal-task-actions {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }

  .personal-task-editor-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .personal-task-schedule,
  .personal-task-quick-dates {
    display: grid;
    grid-template-columns: 1fr;
  }

  .personal-task-upload {
    width: 100%;
  }

  .inline-form {
    gap: 10px;
  }

  .compact-item {
    grid-template-columns: 28px minmax(0, 1fr);
    min-height: 48px;
  }

  .compact-item strong,
  .compact-item small {
    white-space: normal;
  }

  .file-row {
    grid-template-columns: 28px minmax(0, 1fr);
  }

  .file-row-actions {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  .file-row-actions .secondary-button {
    min-width: 0;
    width: 100%;
  }

  .selected-file {
    width: 100%;
    justify-content: space-between;
  }

  .task-dialog {
    width: calc(100vw - 16px);
    max-height: calc(100dvh - 16px);
  }

  .task-dialog form {
    max-height: calc(100dvh - 16px);
    overflow: auto;
    padding: 14px;
  }

  .edit-dialog {
    width: 100vw;
    max-width: none;
    height: 100dvh;
    max-height: none;
    border: 0;
    border-radius: 0;
  }

  .edit-dialog form {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    height: 100%;
    max-height: 100dvh;
    overflow: hidden;
    padding: max(12px, env(safe-area-inset-top)) 12px 0;
  }

  .edit-dialog .form-grid {
    align-content: start;
    overflow: auto;
    padding-right: 0;
    padding-bottom: 12px;
    -webkit-overflow-scrolling: touch;
  }

  .edit-dialog .dialog-header {
    margin-bottom: 12px;
    border-bottom: 1px solid var(--line);
    padding-bottom: 10px;
    background: var(--surface);
  }

  .edit-dialog .dialog-header h2 {
    font-size: 18px;
    line-height: 1.25;
    overflow-wrap: anywhere;
  }

  .edit-dialog .dialog-header p {
    display: none;
  }

  .edit-dialog .form-grid label {
    min-width: 0;
    gap: 6px;
    font-size: 12px;
  }

  .edit-dialog .form-grid input,
  .edit-dialog .form-grid select,
  .edit-dialog .form-grid textarea {
    min-height: 48px;
    font-size: 16px;
    line-height: 1.35;
  }

  .edit-dialog .form-grid textarea {
    min-height: 128px;
  }

  .edit-dialog #editSubject {
    min-height: 112px;
  }

  .edit-dialog #editComment,
  .edit-dialog #editContractorComment {
    min-height: 148px;
  }

  .attachment-summary {
    grid-template-columns: 38px minmax(0, 1fr) 26px;
  }

  .attachment-summary .pill {
    grid-column: 2 / 3;
    justify-self: start;
  }

  .attachment-summary-icon {
    width: 38px;
    height: 38px;
  }

  .attachment-drawer,
  .attachment-drawer.is-expanded.has-files,
  .attachment-drawer.is-expanded:not(.has-files) {
    min-height: 0;
    overflow: hidden;
  }

  .attachment-drawer.is-expanded.has-files {
    min-height: calc(min(72dvh, 640px) + 380px);
  }

  .attachment-drawer.is-expanded:not(.has-files) {
    min-height: 180px;
  }

  .attachment-drawer-body {
    gap: 10px;
    padding: 10px;
  }

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

  .attachment-tabs button {
    justify-content: center;
  }

  .attachment-browser {
    gap: 10px;
    min-height: 0;
    height: auto;
  }

  .attachment-list {
    max-height: 232px;
    -webkit-overflow-scrolling: touch;
  }

  .attachment-file {
    grid-template-columns: minmax(0, 1fr);
  }

  .attachment-file-main {
    min-height: 48px;
  }

  .attachment-file-main span,
  .attachment-file-main strong,
  .attachment-file-main small {
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .attachment-file-actions {
    display: grid;
    grid-template-columns: repeat(3, 42px);
    justify-content: start;
  }

  .attachment-preview-panel {
    height: min(72dvh, 640px);
    min-height: min(72dvh, 520px);
  }

  .attachment-preview-header {
    align-items: stretch;
    flex-direction: column;
  }

  .attachment-preview-header strong,
  .attachment-preview-header span {
    white-space: normal;
  }

  .attachment-preview-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
  }

  .attachment-preview-actions .secondary-button {
    width: 100%;
  }

  .attachment-preview-shell,
  .attachment-preview-frame {
    height: 100%;
    min-height: 0;
  }

  .dialog-header {
    align-items: start;
    gap: 10px;
  }

  .dialog-actions {
    position: sticky;
    bottom: 0;
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    margin: 0 -14px -14px;
    border-top: 1px solid var(--line);
    padding: 12px 14px calc(12px + env(safe-area-inset-bottom));
    background: var(--surface);
  }

  .edit-dialog .dialog-actions {
    position: static;
    margin: 0 -12px;
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  }

  .dialog-actions-spacer {
    display: none;
  }

  .dialog-actions .primary-button,
  .dialog-actions .secondary-button {
    width: 100%;
  }

  .file-preview-dialog {
    width: 100vw;
    max-width: 100vw;
    height: 100dvh;
    max-height: 100dvh;
    border-radius: 0;
  }

  .file-preview-window {
    border: 0;
    border-radius: 0;
  }

  .file-preview-header {
    align-items: stretch;
    flex-direction: column;
    padding: 9px;
  }

  .file-preview-header strong,
  .file-preview-header span {
    white-space: normal;
  }

  .file-preview-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr)) 42px;
    width: 100%;
  }

  .file-preview-actions .secondary-button {
    width: 100%;
  }

  .timeline-row {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .gantt-board {
    overflow-x: auto;
  }

  .gantt-header,
  .gantt-row {
    min-width: 820px;
  }

  .segmented-control {
    width: 100%;
  }

  .primary-button,
  .secondary-button {
    flex: 1 1 148px;
    min-width: 0;
    padding: 0 10px;
  }

  .toast {
    right: 12px;
    bottom: 12px;
    left: 12px;
    max-width: none;
  }
}
