/* Unified form layout and control styling. Loaded after app.css. */
:root {
  --control-height: 44px;
  --control-radius: 10px;
  --control-border: #c7d9e3;
  --control-focus: #1982bc;
  --control-shadow: 0 1px 2px rgba(20, 61, 96, .05);
}

/* Barrier controller API documentation */
.card>form.row input[type="checkbox"]{min-width:0}.barrier-list-form{display:block;width:100%}.barrier-list-actions{display:flex;justify-content:flex-end;margin:16px 0 0}.barrier-list-table{width:100%;border-collapse:collapse;table-layout:fixed;margin-top:16px}.barrier-list-table th,.barrier-list-table td{padding:11px;vertical-align:top;text-align:left;border-bottom:1px solid var(--line)}.barrier-list-table th{color:var(--muted);font-size:.78rem;text-transform:uppercase}.barrier-list-table input:not([type="checkbox"]){width:100%;min-width:0}.barrier-list-table label{display:inline-flex;align-items:center;gap:5px;margin-top:6px}.barrier-id-col{width:7%}.barrier-name-col{width:20%}.barrier-ip-col{width:19%}.barrier-link-col{width:13%}.barrier-status-col{width:13%}.barrier-settings-col{width:28%}
.row > label.barrier-command-date-range-label{display:flex!important;align-items:center;gap:9px;flex:1 1 290px;white-space:nowrap}.row > label.barrier-command-date-range-label .barrier-command-date-range{flex:1;min-width:0}
.barrier-history-header{display:flex;align-items:center;justify-content:space-between;gap:14px;margin-bottom:15px}.barrier-history-header h2{margin:0}.barrier-history-export{display:inline-flex;align-items:center;min-height:34px;padding:6px 10px;border:1px solid var(--control-border);border-radius:8px;background:transparent;color:var(--muted);font-size:.88rem;font-weight:650;text-decoration:none}.barrier-history-export:hover,.barrier-history-export:focus{border-color:#8eafc0;background:#f2f8fa;color:#315c73;text-decoration:none}
.admin-user-actions{width:1%;white-space:nowrap}.admin-user-actions-wrap{display:flex;align-items:center;justify-content:flex-end;gap:6px}.admin-user-actions .icon-action{width:34px;min-height:34px;height:34px;padding:7px;flex:0 0 34px}.admin-user-actions .icon-action .ui-icon{width:18px;height:18px}.admin-user-actions .icon-action.is-danger{color:var(--danger)}.admin-user-actions .icon-action.is-danger:hover,.admin-user-actions .icon-action.is-danger:focus{background:#fbe9e9;color:#962e35}.admin-user-actions .modal-trigger{margin:0;flex:0 0 auto}
.barrier-api-page{max-width:1120px}.barrier-api-hero{display:flex;justify-content:space-between;gap:28px;align-items:center;padding:30px 34px;margin:18px 0 22px;border:1px solid #c8e4e9;border-radius:18px;background:linear-gradient(130deg,#e8f8f6,#eef6ff)}.barrier-api-hero h1{margin:0 0 10px;color:#143d60}.barrier-api-hero p{max-width:720px;margin:0;color:#496d83;font-size:1.02rem;line-height:1.55}.barrier-api-kicker{color:#087d84!important;font-size:.73rem!important;font-weight:800;letter-spacing:.11em}.barrier-api-hero-icon{display:grid;place-items:center;flex:0 0 auto;width:72px;height:72px;border-radius:20px;background:#087d84;color:#fff;font-size:2.2rem;box-shadow:7px 7px 0 #f3b74d}.barrier-api-steps{display:grid;grid-template-columns:repeat(3,1fr);gap:14px;margin:22px 0}.barrier-api-steps article{position:relative;padding:21px 20px 17px 58px;border:1px solid #d7e6ed;border-radius:14px;background:#fff}.barrier-api-steps span{position:absolute;left:17px;top:18px;display:grid;place-items:center;width:28px;height:28px;border-radius:50%;background:#dff4f3;color:#087d84;font-weight:800}.barrier-api-steps h2{margin:0 0 6px;font-size:1rem;color:#143d60}.barrier-api-steps p{margin:0;color:#5c798b;font-size:.9rem;line-height:1.5}.barrier-api-protocol{margin:24px 0;padding:24px;border-left:4px solid #16939b;border-radius:0 14px 14px 0;background:#f5fafb}.barrier-api-protocol h2{margin-top:0;color:#143d60}.barrier-api-protocol-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:12px;margin:15px 0}.barrier-api-protocol-grid>div{display:grid;gap:7px;padding:15px;border:1px solid #d7e7ec;border-radius:10px;background:#fff}.barrier-api-protocol-grid strong{color:#173f61}.barrier-api-protocol-grid small{color:#617e90;line-height:1.45}.barrier-sketch{margin:26px 0;overflow:hidden;border:1px solid #ccdfe6;border-radius:14px;background:#fff;box-shadow:0 8px 22px #143d6008}.barrier-sketch header{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:17px 20px;border-bottom:1px solid #d9e8ec;background:#f6fbfc}.barrier-sketch h2{margin:0;color:#143d60;font-size:1.18rem}.barrier-sketch header p{margin:3px 0 0;color:#668397;font-size:.9rem}.barrier-copy-button{flex:0 0 auto;padding:9px 14px;border:1px solid #0b757d;border-radius:8px;background:#087d84;color:#fff;font:inherit;font-weight:700;cursor:pointer}.barrier-copy-button:hover,.barrier-copy-button:focus{background:#05666d}.barrier-copy-button.is-copied{border-color:#3a9152;background:#3a9152}.barrier-sketch-code{overflow:auto;max-height:610px;background:#102a3d}.barrier-sketch-code pre{margin:0;padding:20px 22px;color:#e5f3f7;font:13px/1.55 ui-monospace,SFMono-Regular,Consolas,"Liberation Mono",monospace;tab-size:2}.barrier-sketch-code code{font:inherit;color:inherit;white-space:pre}.barrier-api-note{padding:17px 20px;border:1px solid #efd69d;border-radius:12px;background:#fff9e9;color:#69531c;line-height:1.55}@media(max-width:760px){.barrier-api-hero{padding:24px;align-items:flex-start}.barrier-api-hero-icon{width:52px;height:52px;border-radius:14px;font-size:1.6rem}.barrier-api-steps,.barrier-api-protocol-grid{grid-template-columns:1fr}.barrier-sketch header{align-items:flex-start;flex-direction:column}.barrier-copy-button{width:100%}.barrier-sketch-code pre{padding:16px;font-size:12px}.barrier-api-protocol{padding:19px}}

/* Global action feedback: fixed so it never changes a page's layout. */
.toast-stack {
  position: fixed;
  z-index: 200;
  top: 82px;
  right: 22px;
  display: grid;
  gap: 10px;
  width: min(380px, calc(100vw - 28px));
  pointer-events: none;
}

.toast-stack .notice,
.toast-stack .error {
  position: relative;
  margin: 0;
  padding: 13px 45px 13px 15px;
  border-radius: 12px;
  border-left-width: 4px;
  box-shadow: 0 12px 30px rgba(20, 61, 96, .18);
  pointer-events: auto;
  animation: toast-in .2s ease-out;
  transition: opacity .18s ease, transform .18s ease;
}

.toast-stack .notice { background: #e4f5ef; color: #116654; }
.toast-stack .error { background: #fff0f0; color: #963b41; }
.toast-stack .is-leaving { opacity: 0; transform: translateX(16px); }

.release-version-notice { display:flex; align-items:center; justify-content:space-between; gap:12px; width:min(calc(100% - 44px),1196px); min-height:44px; margin:16px auto -8px; padding:9px 16px; border:1px solid #b9dce8; border-radius:12px; background:var(--blue-soft); color:var(--blue-dark); box-shadow:0 4px 12px rgba(20,61,96,.06); font-size:.9rem; font-weight:650; }
.release-version-notice[hidden] { display:none; }
.release-version-notice a { color:inherit; font-weight:800; text-decoration:none; }
.release-version-close { width:27px; min-width:27px; min-height:27px; height:27px; padding:0 0 2px; border:0; border-radius:50%; background:transparent; color:inherit; font-size:1.3rem; font-weight:400; line-height:1; box-shadow:none; }
.release-version-close:hover,.release-version-close:focus { background:rgba(17,87,132,.14); color:inherit; box-shadow:none; transform:none; }

.toast-close {
  position: absolute;
  top: 50%;
  right: 9px;
  width: 28px;
  min-height: 28px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: currentColor;
  font-size: 22px;
  font-weight: 400;
  line-height: 1;
  transform: translateY(-50%);
  box-shadow: none;
}

.toast-close:hover,
.toast-close:focus { background: rgba(20, 61, 96, .1); transform: translateY(-50%); box-shadow: none; }

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

@media (max-width: 760px) {
  .toast-stack { top: 14px; right: 14px; }
  .release-version-notice { justify-content:space-between; width:calc(100% - 24px); margin:12px auto -2px; padding:8px 12px; font-size:.84rem; }
}

form {
  accent-color: var(--blue);
}

.favorites-toggle {
  margin: 0;
  padding: 6px;
  border-color: transparent;
  border-radius: 7px;
  background: transparent;
  color: #7491a3;
  box-shadow: none;
  vertical-align: middle;
}

.favorites-toggle:hover,
.favorites-toggle:focus { background: #edf5f8; color: #386b86; transform: none; box-shadow: none; }
h1:has(+ .favorites-toggle) { display: inline-block; }
.favorites-toggle [aria-hidden] { font-size: 1.28em; line-height: 1; }
.favorites-toggle-label { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.favorites-toggle.is-saved { color: #c38b19; }
.favorites-toggle.is-saved:hover,.favorites-toggle.is-saved:focus { background: #fff8e8; color: #a8730f; }
.favorites-heading { display: inline-flex; align-items: center; min-width: 0; margin: 22px 0 4px; }
.favorites-heading h1 { margin: 0; }
.task-header > .favorites-heading { margin: 0; }
.workspace-card > .favorites-heading { margin-left: 26px; margin-right: 26px; }
.workspace-card > .favorites-heading + .muted { font-size: .9rem; margin-bottom: 18px; }
.bar a.favorites-nav-link { padding: 7px 10px; border: 1px solid #ffffff2e; border-radius: 999px; color: #dbeef5; font-size: .84rem; }
.favorites-page { max-width: none; }
.favorites-page-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.favorites-page-header h1 { margin-top: 0; }
.favorites-list { display: grid; gap: 9px; margin: 20px 0 0; padding: 0; list-style: none; }
.favorite-item { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border: 1px solid #d5e4ec; border-radius: 11px; background: #f9fcfd; }
.favorite-item.is-dragging { opacity: .55; }
.favorite-drag-handle { flex: 0 0 auto; color: #8ba6b6; font-size: 1.35rem; line-height: 1; cursor: grab; user-select: none; }
.favorite-item:active .favorite-drag-handle { cursor: grabbing; }
.favorite-title { min-width: 0; flex: 1; }
.favorite-link { display: block; overflow-wrap: anywhere; font-weight: 700; }
.favorite-title small { display: block; overflow-wrap: anywhere; color: #6a8799; font-size: .78rem; }
.favorite-controls { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.favorite-controls button { min-height: 32px; padding: 5px 8px; background: #fff; color: #315d76; border-color: #c9dce6; font-size: .78rem; box-shadow: none; }
.favorite-controls button:hover { background: #e6f3f8; color: #145f8b; transform: none; box-shadow: none; }
.favorite-controls .favorite-delete { color: #963b41; border-color: #dca5aa; }
.favorite-controls .favorite-delete:hover { background: #fff0f1; color: #7d2f36; }

@media (max-width: 760px) {
  .favorites-page-header, .favorite-item { align-items: stretch; flex-direction: column; }
  .favorite-controls { justify-content: flex-start; }
}

label {
  color: #25465b;
  font-size: .91rem;
  font-weight: 650;
  line-height: 1.35;
}

input,
select,
textarea {
  border-color: var(--control-border);
  border-radius: var(--control-radius);
  box-shadow: var(--control-shadow);
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}

input:not([type=checkbox]):not([type=radio]),
select {
  min-height: var(--control-height);
}

textarea {
  min-height: 104px;
  line-height: 1.45;
  resize: vertical;
}

input::placeholder,
textarea::placeholder {
  color: #89a0af;
  opacity: 1;
}

input:hover,
select:hover,
textarea:hover {
  border-color: #93b5c7;
}

input:focus,
select:focus,
textarea:focus {
  background: #fff;
  border-color: var(--control-focus);
  box-shadow: 0 0 0 4px rgba(25, 130, 188, .16);
  outline: 0;
}

input:disabled {
  background: #eff4f6;
  color: #718896;
  cursor: not-allowed;
}

input[type=file] {
  padding: 7px;
  cursor: pointer;
}

input[type=file]::file-selector-button {
  margin-right: 10px;
  padding: 7px 10px;
  border: 0;
  border-radius: 7px;
  background: #e4f2f8;
  color: #176eaa;
  font: inherit;
  font-size: .82rem;
  font-weight: 700;
  cursor: pointer;
}

input[type=checkbox],
input[type=radio] {
  width: 17px;
  height: 17px;
  min-height: 0;
  margin: 0;
  vertical-align: -3px;
  box-shadow: none;
}

button,
.button {
  border-radius: var(--control-radius);
  letter-spacing: .005em;
}

button:focus-visible,
.button:focus-visible,
summary:focus-visible {
  outline: 3px solid rgba(25, 130, 188, .28);
  outline-offset: 2px;
}

/* Full forms: login, profile, installation, uploads and link creation. */
.card > form:not(.row):not(.search-form):not(.upload-panel):not(.inline-editor):not(.task-filter):not(.barrier-list-form):not(.group-editor) {
  display: grid;
  gap: 16px;
  max-width: 620px;
}

.direct-send-page > form[data-direct-send] {
  max-width: none;
}

.card > form:not(.row):not(.search-form):not(.upload-panel):not(.inline-editor):not(.task-filter):not(.barrier-list-form):not(.group-editor) > p {
  margin: 0;
}

.card > form:not(.row):not(.search-form):not(.upload-panel):not(.inline-editor):not(.task-filter):not(.barrier-list-form):not(.group-editor) label {
  display: block;
}

.card > form:not(.row):not(.search-form):not(.upload-panel):not(.inline-editor):not(.task-filter):not(.barrier-list-form) label input:not([type=checkbox]):not([type=radio]),
.card > form:not(.row):not(.search-form):not(.upload-panel):not(.inline-editor):not(.task-filter):not(.barrier-list-form) label select,
.card > form:not(.row):not(.search-form):not(.upload-panel):not(.inline-editor):not(.task-filter):not(.barrier-list-form) label textarea {
  display: block;
  width: 100%;
  margin-top: 7px;
}

.card > form:not(.row):not(.search-form):not(.upload-panel):not(.inline-editor):not(.task-filter):not(.barrier-list-form) > button,
.card > form:not(.row):not(.search-form):not(.upload-panel):not(.inline-editor):not(.task-filter):not(.barrier-list-form) > .button {
  justify-self: end;
  min-width: 138px;
}

.login {
  border-top: 4px solid #46a8c6;
}

.login form {
  margin-top: 22px;
}

.login form > p:has(label > input[type=checkbox]) {
  padding: 13px 14px;
  border: 1px solid #d7e6ed;
  border-radius: 10px;
  background: #f7fbfc;
}

.login form > p label:has(input[type=checkbox]) {
  display: flex;
  align-items: center;
  gap: 9px;
}

/* Compact horizontal forms in toolbars, filters and administration. */
.row,
.toolbar form {
  gap: 12px;
}

.row > input:not([type=hidden]),
.row > select,
.toolbar form > input:not([type=hidden]),
.toolbar form > select {
  flex: 1 1 180px;
}

.row > label:not(:has(input[type=checkbox])):not(:has(input[type=radio])),
.toolbar form > label {
  display: grid;
  flex: 1 1 145px;
  gap: 6px;
}

.row > label:has(input[type=checkbox]),
.row > label:has(input[type=radio]) {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 6px;
  min-height: var(--control-height);
  padding: 0 2px;
  white-space: nowrap;
}

.row > button,
.row > .button,
.toolbar form > button {
  flex: 0 0 auto;
}

.search-form {
  padding: 8px;
  border: 1px solid #d8e7ee;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 5px 14px rgba(20, 61, 96, .06);
}

.search-form input {
  border: 0;
  box-shadow: none;
}

.search-form input:focus {
  box-shadow: none;
}

.search-form button {
  border-radius: 8px;
}

.upload-panel {
  display: grid;
  gap: 12px;
}

/* These forms are moved into dialogs by app.js. Keep them out of the first
   paint, otherwise the workspace jumps while the scripts initialise. */
.workspace-card > #upload-form,
.workspace-card > .toolbar > form,
.workspace-card > .inline-editor,
.workspace-card > .shortcut-editor,
.workspace-card > .share-editor,
.file-table .actions > form,
.file-table .actions > .object-menu,
.card table .user-editor {
  position: absolute;
  visibility: hidden;
  pointer-events: none;
}

.upload-panel > label {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.upload-panel > label input {
  width: auto;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.drop-picker {
  cursor: pointer;
}

.drop-picker:focus-visible {
  outline: 3px solid rgba(25, 130, 188, .28);
  outline-offset: 3px;
}

.drop-picker strong {
  display: block;
}

.upload-progress {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  color: #52768a;
  font-size: .84rem;
  font-weight: 650;
}

.upload-progress-track {
  height: 14px;
  overflow: hidden;
  border-radius: 999px;
  background: #dcecf3;
}

.upload-progress-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #46a8c6, #176eaa);
  transition: width .14s linear;
}

.toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.toolbar form {
  flex: 1 1 360px;
}

/* Forms embedded in tables and object actions should never collapse into columns. */
.actions form,
.object-menu-content form,
.card > table:not(.file-table) form {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.card > table:not(.file-table) form {
  margin: 0;
}

.card > table:not(.file-table) input,
.card > table:not(.file-table) select {
  width: auto;
  min-width: 116px;
  max-width: 100%;
  margin: 0;
}

.card > table:not(.file-table) input[type=checkbox],
.card > table:not(.file-table) input[type=radio] {
  min-width: 0;
}

.card > table:not(.file-table) button {
  margin: 0;
}

.object-menu-content {
  display: grid;
  gap: 0;
}

.object-menu-content form {
  margin: 0;
}

.object-menu-content textarea {
  min-width: min(100%, 250px);
}

.actions form {
  margin: 8px 0;
}

.actions form button {
  margin-top: 0;
}

.update-pending-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
}

.update-pending-actions form {
  display: grid;
  gap: 10px;
  margin: 0;
}

.update-pending-actions label {
  max-width: 430px;
}

@media (max-width: 760px) {
  .workspace-card > .favorites-heading { margin-left: 17px; margin-right: 17px; }

  .card > form:not(.row):not(.search-form):not(.upload-panel):not(.inline-editor) > button,
  .card > form:not(.row):not(.search-form):not(.upload-panel):not(.inline-editor) > .button {
    width: 100%;
  }

  .row,
  .toolbar form {
    align-items: stretch;
  }

  .row > input:not([type=hidden]),
  .row > select,
  .row > label:not(:has(input[type=checkbox])),
  .toolbar form > input:not([type=hidden]),
  .toolbar form > select,
  .toolbar form > label,
  .row > button,
  .row > .button,
  .toolbar form > button {
    flex-basis: 100%;
    width: 100%;
  }

  .row > label:has(input[type=checkbox]),
  .row > label:has(input[type=radio]) {
    width: auto;
  }

  .search-form {
    padding: 5px;
  }

  .search-form button {
    min-width: 74px;
  }

  .toolbar form {
    flex-basis: 100%;
  }

  .update-pending-actions {
    align-items: stretch;
  }

  .update-pending-actions form,
  .update-pending-actions button {
    width: 100%;
  }

  .card > table:not(.file-table) form {
    align-items: stretch;
  }

  .card > table:not(.file-table) form > input:not([type=hidden]),
  .card > table:not(.file-table) form > select,
  .card > table:not(.file-table) form > button {
    width: 100%;
  }
}

/* Secondary actions are moved here by app.js to keep every page uncluttered. */
.modal-trigger {
  min-height: 34px;
  padding: 6px 10px;
  font-size: .8rem;
}

.toolbar > .modal-trigger {
  min-height: 40px;
  padding: 9px 12px;
  font-size: .9rem;
}

.task-header > .modal-trigger[data-modal-action="task_create"] {
  min-height: 40px;
  padding: 9px 12px;
  font-size: .9rem;
}

.admin-header-actions > .modal-trigger[data-modal-action="admin_create_user"],
.admin-header > .modal-trigger[data-modal-action="admin_group"] {
  min-height: 40px;
  padding: 9px 12px;
  font-size: .9rem;
}

.table-search {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 14px 0 18px;
}

.table-search input {
  width: min(360px, 100%);
}

.table-search-result {
  color: var(--muted);
  font-size: .86rem;
}

.search-toggle {
  width: 36px;
  min-height: 36px;
  padding: 0;
  border-radius: 8px;
  font-size: .94rem;
}

.search-form[hidden],
.task-filter[hidden] {
  display: none !important;
}

/* The advanced task filter is moved out of this row by app.js after parsing. */
.task-table tr:has(.task-advanced-filter) {
  display: none;
}

.task-filter .task-advanced-filter {
  flex: 1 0 100%;
  padding: 12px;
  border: 1px solid #d9e6ec;
  border-radius: 10px;
  background: #f8fbfc;
}

.task-filter .task-advanced-filter summary {
  color: #315c73;
  cursor: pointer;
  font-weight: 700;
}

.task-advanced-controls {
  margin-top: 12px;
}

.daterangepicker {
  z-index: 1000;
  border: 1px solid #c9d9e1;
  border-radius: 10px;
  box-shadow: 0 12px 28px rgba(28, 65, 81, .16);
  color: #25465b;
  font-family: inherit;
}

.daterangepicker .calendar-table {
  border-color: #d9e6ec;
  border-radius: 8px;
}

.daterangepicker td.active,
.daterangepicker td.active:hover {
  background-color: #176eaa;
}

.daterangepicker .drp-buttons .btn {
  min-height: 32px;
  padding: 5px 9px;
  border-radius: 7px;
  font-size: .8rem;
  box-shadow: none;
  transform: none;
}

.daterangepicker .drp-buttons .cancelBtn {
  border-color: #c9d9e1;
  background: #fff;
  color: #52768a;
}

.root-nav .search-toggle {
  margin-left: auto;
  border-color: transparent;
  background: transparent;
  color: #52768a;
  box-shadow: none;
}

.root-nav .search-toggle:hover,
.root-nav .search-toggle:focus {
  background: #e1eef4;
  color: #176eaa;
  box-shadow: none;
  transform: none;
}

.task-nav .search-toggle,
.groups-header-actions .search-toggle,
.admin-header-actions .search-toggle {
  margin-left: auto;
  border-color: transparent;
  background: transparent;
  color: #52768a;
  box-shadow: none;
}

.task-nav .search-toggle:hover,
.task-nav .search-toggle:focus,
.groups-header-actions .search-toggle:hover,
.groups-header-actions .search-toggle:focus,
.admin-header-actions .search-toggle:hover,
.admin-header-actions .search-toggle:focus {
  background: #e1eef4;
  color: #176eaa;
  box-shadow: none;
  transform: none;
}

.icon-action {
  width: 36px;
  height: 36px;
  min-height: 36px;
  padding: 0;
  display: inline-grid;
  flex: 0 0 36px;
  place-items: center;
  border-color: transparent;
  border-radius: 8px;
  background: transparent;
  color: #52768a;
  box-shadow: none;
  font-size: 1rem;
  line-height: 1;
  vertical-align: middle;
}

.icon-action:hover,
.icon-action:focus {
  background: #e1eef4;
  color: #176eaa;
  box-shadow: none;
  transform: none;
}

@media (min-width: 761px) and (pointer: fine) {
  .file-table .object-menu {
    display: none;
  }

  .file-table .actions {
    display: table-cell;
    min-width: 56px;
    text-align: right;
  }

  .file-table .actions > a {
    display: none;
  }

  .file-table .actions > :not(.row-context-trigger) {
    display: none !important;
  }

  .toolbar:has(> .modal-trigger[data-modal-action="mkdir"]:only-child) {
    display: none;
  }

  .workspace-card > .modal-trigger[data-modal-action="upload"] {
    display: none;
  }

  .workspace-card > .modal-trigger[data-modal-action="shortcut_create"],
  .workspace-card > .modal-trigger[data-modal-action="share_create"],
  .actions .modal-trigger[data-modal-action="shortcut_create"] {
    display: none;
  }

  .context-menu {
    position: fixed;
    z-index: 20;
    display: none;
    width: 232px;
    max-height: min(70vh, 560px);
    overflow-y: auto;
    padding: 7px;
    border: 1px solid #d2e1e8;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 18px 44px rgba(20, 61, 96, .22);
  }

  .context-menu.open {
    display: block;
  }

  .context-menu .object-menu-content {
    display: grid;
    gap: 2px;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
  }

  .context-menu .context-action {
    width: 100%;
    min-height: 34px;
    justify-content: flex-start;
    padding: 8px 10px;
    border-color: transparent;
    background: transparent;
    color: #315c73;
    box-shadow: none;
    border-radius: 8px;
    font-size: .83rem;
    font-weight: 600;
  }

  .context-menu .context-action::before {
    width: 18px;
    margin-right: 8px;
    color: #5c8094;
    content: attr(data-context-icon);
    font-size: 1rem;
    line-height: 1;
    text-align: center;
  }

  .context-menu .context-action:hover,
  .context-menu .context-action:focus {
    background: #e8f3f7;
    color: #115e8e;
    box-shadow: none;
    transform: none;
  }

  .context-menu .context-action:hover::before,
  .context-menu .context-action:focus::before {
    color: #176eaa;
  }

  .context-menu .object-menu-content form {
    display: block;
    margin: 0;
    padding: 0;
    border: 0;
  }

  .context-menu .actions {
    display: grid;
    gap: 2px;
  }

  .context-menu .context-more {
    margin: 5px 0;
    border-top: 1px solid #e2edf2;
    border-bottom: 1px solid #e2edf2;
  }

  .context-menu .context-more summary {
    display: flex;
    align-items: center;
    min-height: 34px;
    padding: 0 10px;
    color: #52768a;
    cursor: pointer;
    font-size: .8rem;
    font-weight: 650;
    list-style: none;
  }

  .context-menu .context-more summary::-webkit-details-marker {
    display: none;
  }

  .context-menu .context-more summary::after {
    margin-left: auto;
    content: '›';
    font-size: 1.25rem;
    line-height: 1;
    transition: transform .16s ease;
  }

  .context-menu .context-more[open] summary::after {
    transform: rotate(90deg);
  }

  .context-menu .context-more-content {
    display: grid;
    gap: 2px;
    padding: 0 0 5px;
  }

  .context-menu .context-more-content form {
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
  }

  .context-menu .actions > a,
  .context-menu .actions .modal-trigger,
  .context-menu .actions form > button {
    width: 100%;
    min-height: 36px;
    justify-content: flex-start;
    padding: 8px 10px;
    border-color: transparent;
    background: transparent;
    color: #315c73;
    box-shadow: none;
    font-size: .84rem;
  }
}

.context-menu {
  position: fixed;
  z-index: 30;
  display: none;
  width: min(232px, calc(100vw - 24px));
  max-height: min(70vh, 560px);
  overflow-y: auto;
  padding: 7px;
  border: 1px solid #d2e1e8;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 18px 44px rgba(20, 61, 96, .22);
}

.context-menu.open {
  display: block;
}

.context-menu .context-action {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 34px;
  padding: 8px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #315c73;
  box-shadow: none;
  font-size: .83rem;
  font-weight: 600;
  text-align: left;
}

.context-menu .context-action::before {
  width: 18px;
  margin-right: 8px;
  color: #5c8094;
  content: attr(data-context-icon);
  font-size: 1rem;
  text-align: center;
}

.context-menu .context-action-icon {
  flex:0 0 auto;
  width:21px;
  height:21px;
  margin-right:11px;
  color:#52768a;
  fill:none;
}

.context-menu .context-action:hover,
.context-menu .context-action:focus {
  background: #e8f3f7;
  color: #115e8e;
  box-shadow: none;
  transform: none;
}

.context-menu .actions,
.context-menu .object-menu-content,
.context-menu .context-more-content {
  display: grid;
  gap: 2px;
}

.context-menu form {
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
}

.context-menu .context-more {
  margin: 5px 0;
  border-top: 1px solid #e2edf2;
  border-bottom: 1px solid #e2edf2;
}

.context-menu .context-more summary {
  min-height: 34px;
  padding: 8px 10px;
  color: #52768a;
  cursor: pointer;
  font-size: .8rem;
  font-weight: 650;
}

/* Secondary file actions open as a side menu on hover or keyboard focus. */
.context-menu .context-submenu {
  position:relative;
  margin:7px 3px;
  border-top:1px solid #dbe7ed;
  border-bottom:1px solid #dbe7ed;
}

.context-menu .context-submenu::after {
  position:absolute;
  top:0;
  right:-8px;
  width:8px;
  height:100%;
  content:'';
}

.context-menu .context-submenu-trigger {
  display:flex;
  align-items:center;
  width:100%;
  min-height:40px;
  padding:0 9px;
  border:0;
  border-radius:9px;
  background:transparent;
  color:#52768a;
  box-shadow:none;
  font-size:.88rem;
  font-weight:650;
  text-align:left;
}

.context-menu .context-submenu-trigger::after {
  margin-left:auto;
  content:'›';
  font-size:1.35rem;
  line-height:1;
}

.context-menu .context-submenu:hover .context-submenu-trigger,
.context-menu .context-submenu:focus-within .context-submenu-trigger {
  background:var(--blue-soft);
  color:var(--blue-dark);
  transform:none;
}

.context-menu .context-submenu-content {
  position:absolute;
  z-index:1;
  top:-9px;
  left:calc(100% + 8px);
  display:none;
  width:260px;
  padding:9px;
  border:1px solid #c9dce7;
  border-radius:18px;
  background:linear-gradient(145deg,#fff 0%,#f4f9fc 100%);
  box-shadow:0 20px 52px rgba(20,61,96,.24),0 2px 8px rgba(20,61,96,.08);
}

.context-menu .context-submenu.is-left .context-submenu-content { right:calc(100% + 8px); left:auto; }
.context-menu .context-submenu.is-left::after { right:auto; left:-8px; }

.context-menu .context-submenu:hover .context-submenu-content,
.context-menu .context-submenu:focus-within .context-submenu-content { display:grid; gap:2px; }

@media (hover:none) {
  .context-menu .context-submenu-trigger { display:none; }
  .context-menu .context-submenu-content { position:static; display:grid; width:auto; padding:0 0 5px; border:0; border-radius:0; background:transparent; box-shadow:none; }
}

.row-context-trigger {
  display: grid;
  float: right;
  width: 22px;
  height: 26px;
  min-height: 26px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #5c8094;
  box-shadow: none;
  font-size: 1.22rem;
  font-weight: 800;
  line-height: 1;
  place-items: center;
}

.row-context-trigger:hover,
.row-context-trigger:focus-visible {
  background: #e8f3f7;
  color: #176eaa;
  box-shadow: none;
  transform: none;
}

.actions button {
  font-size: inherit;
}

/* File context menu: a compact, calm desktop panel aligned with the application palette. */
.context-menu {
  width: min(286px, calc(100vw - 24px));
  overflow: visible;
  padding: 9px;
  border: 1px solid #c9dce7;
  border-radius: 18px;
  background: linear-gradient(145deg, #ffffff 0%, #f4f9fc 100%);
  box-shadow: 0 20px 52px rgba(20, 61, 96, .24), 0 2px 8px rgba(20, 61, 96, .08);
}

.context-menu .context-action {
  min-height: 42px;
  padding: 10px 12px;
  border-radius: 11px;
  color: #17364d;
  font-size: .92rem;
  font-weight: 600;
}

.context-menu .context-action::before { content:none; }

.context-menu .context-action-icon {
  width:22px;
  height:22px;
  margin-right:11px;
}

.context-menu .context-action:hover,
.context-menu .context-action:focus-visible {
  background: var(--blue-soft);
  color: var(--blue-dark);
}

.context-menu .context-action:hover::before,
.context-menu .context-action:focus-visible::before {
  color: var(--blue);
}

.context-menu .context-action.danger,
.context-menu .context-action[data-context-icon="delete"] {
  color: #a13d46;
}

.context-menu .context-action.danger .context-action-icon,
.context-menu .context-action[data-context-icon="delete"] .context-action-icon {
  color: #b64a53;
}

.context-menu .context-action.danger:hover,
.context-menu .context-action.danger:focus-visible,
.context-menu .context-action[data-context-icon="delete"]:hover,
.context-menu .context-action[data-context-icon="delete"]:focus-visible {
  background: #fff0f1;
  color: #8b333b;
}

.context-menu .context-more {
  margin: 7px 3px;
  border-color: #dbe7ed;
}

.context-menu .context-more summary {
  min-height: 40px;
  padding: 0 9px;
  color: #52768a;
  font-size: .88rem;
  font-weight: 650;
}

.modal {
  width: min(60vw, 960px, calc(100vw - 28px));
  max-height: none;
  margin: auto;
  padding: 0;
  border: 0;
  border-radius: 16px;
  color: #17364d;
  background: transparent;
  overflow: visible;
  box-shadow: none;
}

.modal::backdrop {
  background: rgba(10, 35, 52, .56);
  backdrop-filter: blur(3px);
}

.modal-shell {
  display: grid;
  gap: 10px;
}

.modal-panel {
  position: relative;
  max-height: min(800px, calc(100vh - 102px));
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #afc5d1 transparent;
  padding: 24px;
  border: 1px solid #d4e3ea;
  border-radius: 16px;
  background: #fff;
}

.modal-panel::-webkit-scrollbar { width: 9px; }
.modal-panel::-webkit-scrollbar-track { margin: 10px 0; background: transparent; }
.modal-panel::-webkit-scrollbar-thumb { border: 3px solid transparent; border-radius: 999px; background: #afc5d1; background-clip: padding-box; }
.modal-panel::-webkit-scrollbar-thumb:hover { background: #89aebb; background-clip: padding-box; }

.modal .upload-panel,
.modal .inline-editor {
  margin: 0 !important;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.modal .upload-panel {
  box-shadow: none;
}

.modal .upload-panel .drop {
  margin-top: 2px;
  background: #fff;
}

.workspace-card > .modal-trigger[data-modal-action="shortcut_create"] {
  display: none;
}

.access-editor fieldset {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px 14px;
  margin: 0;
  padding: 14px;
  border: 1px solid #d9e6ec;
  border-radius: 10px;
}

.access-editor legend {
  padding: 0 5px;
  color: #52768a;
  font-size: .83rem;
  font-weight: 650;
}

.access-editor fieldset label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #315c73;
  font-size: .88rem;
  font-weight: 500;
}

.access-current {
  display: grid;
  gap: 8px;
  padding-bottom: 4px;
}

.access-current h3 {
  margin: 0;
  color: #315c73;
  font-size: .95rem;
}

.access-current .muted {
  margin: 0;
  font-size: .86rem;
}

.access-rule {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 0;
  border-bottom: 1px solid #e4edf1;
}

.access-rule strong,
.access-rule small {
  display: block;
}

.access-subject-type {
  display: inline-block;
  margin-bottom: 4px;
  padding: 2px 6px;
  border-radius: 999px;
  background: #edf4f7;
  color: #58778a;
  font-size: .67rem;
  font-weight: 700;
  letter-spacing: .03em;
  text-transform: uppercase;
}

.access-subject-type.is-group {
  background: #edf4f7;
  color: #58778a;
}

.access-rule strong {
  color: #25465b;
  font-size: .9rem;
}

.access-rule small {
  margin-top: 2px;
  color: #6c8797;
  font-size: .79rem;
}

.access-revoke {
  flex: 0 0 auto;
  min-height: auto;
  padding: 3px 0;
  border-color: transparent;
  background: transparent;
  color: #58778a;
  box-shadow: none;
  font-size: .82rem;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.access-revoke:hover,
.access-revoke:focus {
  background: transparent;
  color: var(--blue-dark);
  box-shadow: none;
  transform: none;
}

@media (min-width: 761px) and (pointer: fine) {
  .workspace-card > .modal-trigger[data-modal-action="acl"] {
    display: none;
  }
}

@media (max-width: 480px) {
  .access-editor fieldset {
    grid-template-columns: 1fr;
  }
}

.modal-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 0;
  color: #fff;
}

.modal-heading h2 {
  margin: 0;
  color: inherit;
  text-shadow: 0 2px 10px rgba(10, 35, 52, .36);
}

.modal-warning {
  margin: 0 0 18px;
  padding: 11px 13px;
  border-left: 3px solid #d5a56d;
  border-radius: 6px;
  background: #fffaf4;
  color: #735337;
  font-size: .9rem;
}

.modal-close {
  flex: 0 0 auto;
  width: 36px;
  min-height: 36px;
  padding: 0;
  border: 1px solid rgba(255,255,255,.72);
  border-radius: 50%;
  background: rgba(255,255,255,.9);
  color: #315c73;
  font-size: 1.6rem;
  font-weight: 400;
  line-height: 1;
}

.modal-close:hover {
  background: #fff;
  color: #17364d;
  box-shadow: none;
  transform: none;
}

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

.modal-form label {
  display: block;
}

.modal-form label input:not([type=checkbox]):not([type=radio]),
.modal-form label select,
.modal-form label textarea,
.modal-form > input:not([type=hidden]):not([type=checkbox]):not([type=radio]),
.modal-form > select,
.modal-form > textarea {
  display: block;
  width: 100%;
  max-width: none;
  margin: 7px 0 0;
}

.modal-form > button,
.modal-form > .button {
  justify-self: end;
}

.modal-buttons {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.cancel-action {
  border-color: #d4a2a6;
  background: #fff;
  color: #9b3b43;
}

.cancel-action:hover,
.cancel-action:focus {
  background: #fff1f2;
  color: #7d2f36;
}

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

.direct-send-list {
  margin: 12px 0 18px;
  padding: 0;
  list-style: none;
}

.direct-send-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 0;
  color: #52768a;
  font-size: .86rem;
}

.direct-send-list li + li {
  border-top: 1px solid #dbe7ed;
}

.direct-send-remove {
  min-height: 30px;
  padding: 4px 8px;
  border-color: #d4a2a6;
  background: #fff;
  color: #9b3b43;
  font-size: .75rem;
}

.direct-send-remove:hover,
.direct-send-remove:focus-visible {
  background: #fff1f2;
  color: #7d2f36;
  box-shadow: none;
  transform: none;
}

.modal-form.row {
  align-items: stretch;
}

.modal-form.row > label:not(:has(input[type=checkbox])):not(:has(input[type=radio])) {
  display: grid;
}

.modal-form.row > label:has(input[type=checkbox]),
.modal-form.row > label:has(input[type=radio]) {
  padding: 0;
}

.modal-form.row > input:not([type=hidden]),
.modal-form.row > select,
.modal-form.row > label {
  flex-basis: 100%;
}

.modal-form.row > button {
  width: auto;
}

.folder-comment-trigger {
  min-height: auto;
  padding: 3px 0;
  border-color: transparent;
  background: transparent;
  color: var(--blue);
  box-shadow: none;
  font-size: .87rem;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.folder-comment-line {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 3px 10px;
  margin-bottom: 18px;
}

.folder-comment-line .muted {
  margin: 0;
}

.folder-comment-trigger:hover,
.folder-comment-trigger:focus {
  background: transparent;
  color: var(--blue-dark);
  box-shadow: none;
  transform: none;
}

.nav-dropdown {
  position: relative;
  padding-bottom: 12px;
  margin-bottom: -12px;
}

.primary-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-toggle,
.primary-nav-heading,
.nav-backdrop { display: none; }

.nav-dropdown::after {
  position: absolute;
  top: 100%;
  right: 0;
  left: 0;
  height: 8px;
  content: '';
}

.nav-dropdown-menu {
  position: absolute;
  z-index: 30;
  top: 100%;
  left: 0;
  display: none;
  min-width: 190px;
  padding: 6px;
  border: 1px solid #d2e1e8;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 14px 36px rgba(20, 61, 96, .2);
}

.nav-dropdown-profile .nav-dropdown-menu {
  right: 0;
  left: auto;
}

.nav-profile-avatar { display: none; }

.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown:focus-within .nav-dropdown-menu,
.nav-dropdown.is-open .nav-dropdown-menu {
  display: block;
}

.nav-dropdown-menu a {
  display: block;
  color: #315c73;
  padding: 8px 10px;
  white-space: nowrap;
}

.nav-dropdown-menu a:hover,
.nav-dropdown-menu a:focus {
  background: #e8f3f7;
  color: #115e8e;
}

.nav-dropdown-menu .nav-task-count {
  display: inline-grid;
  min-width: 1.5em;
  margin-left: auto;
  padding: 1px 5px;
  place-items: center;
  border-radius: 999px;
  background: #dbeef6;
  color: #216786;
  font-size: .76rem;
  font-weight: 700;
  line-height: 1.35;
}

.nav-dropdown[data-task-counts-url] .nav-dropdown-menu a {
  display: flex;
  align-items: center;
  gap: 8px;
}

.guide-page {
  display: grid;
  grid-template-columns: minmax(230px, 290px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.guide-tree {
  position: sticky;
  top: 18px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--paper);
  box-shadow: 0 10px 28px #143d600d;
}

.guide-tree-label,
.guide-eyebrow {
  margin: 0 0 11px;
  color: var(--muted);
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.guide-tree ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.guide-tree li { margin: 3px 0; }
.guide-tree li > span,
.guide-tree a { display: block; padding: 7px 9px; border-radius: 7px; color: #38627b; font-size: .91rem; }
.guide-tree .guide-tree-group { padding: 9px 9px 3px; color: var(--navy); font-size: .82rem; font-weight: 700; }
.guide-tree a:hover { background: var(--blue-soft); text-decoration: none; }
.guide-tree a.current { background: var(--blue-soft); color: var(--blue-dark); font-weight: 700; }
.guide-tree li ul { margin: 2px 0 7px 13px; padding-left: 10px; border-left: 1px solid var(--line); }
.guide-tree li ul li > span { padding-top: 4px; padding-bottom: 4px; color: var(--muted); font-size: .84rem; }
.guide-content { min-height: 430px; margin-bottom: 0; }
.guide-content h1 { margin-top: 4px; }
.guide-lead { max-width: 700px; color: var(--muted); font-size: 1.08rem; }
.guide-section { max-width: 760px; margin-top: 30px; padding: 20px; border: 1px solid var(--line); border-radius: 12px; background: #f8fbfc; }
.guide-section h2 { margin-top: 0; }
.guide-section p:last-child { margin-bottom: 0; }
.guide-feedback { max-width: 760px; margin: 26px 0 0; font-size: .9rem; }

/* Icons are drawn from the common SVG sprite so their appearance does not depend on emoji fonts. */
.ui-icon { width: 1em; height: 1em; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vertical-align: -.14em; }
.brand-mark .ui-icon { width: 19px; height: 19px; vertical-align: 0; }
.file-node-icon { width: 1.1em; height: 1.1em; margin-right: 4px; color: #4d8099; }
.share-item-icon { width: 1.15em; height: 1.15em; margin-right: 5px; color: #4d8099; }
.task-attachment-icon .ui-icon { width: 20px; height: 20px; color: #46738a; vertical-align: 0; }
.task-comment-attachment-icon { width: 18px; height: 18px; margin-right: 6px; color: var(--blue); }
.task-sticker-summary-icon { width: 18px; height: 18px; margin-right: 5px; }
.task-comment-attach-icon { width: 18px; height: 18px; margin-right: 4px; }
.sova-icon .ui-icon { width: 25px; height: 25px; vertical-align: 0; }
.favorites-toggle-icon { width: 18px; height: 18px; vertical-align: -.2em; }
.search-toggle-icon { width: 19px; height: 19px; vertical-align: 0; }
.modal-action-icon { width: 18px; height: 18px; vertical-align: 0; }
.favorite-drag-handle .ui-icon { width: 18px; height: 18px; vertical-align: 0; }
.access-subject-icon { width: 13px; height: 13px; margin-right: 4px; vertical-align: -.18em; }
.context-menu .context-action::before { display: none; content: none; }

.task-filter {
  display: flex;
  width: 100%;
  flex-wrap: wrap;
  gap: 12px;
  align-items: stretch;
  align-self: flex-start;
  margin: 16px 0;
  padding: 14px;
  border: 1px solid #d9e6ec;
  border-radius: 12px;
  background: #f8fbfc;
}

.task-filter-main {
  display: flex;
  flex: 1 0 100%;
  gap: 9px;
  align-items: center;
}

.task-filter-main label { flex: 1; }
.task-filter input,
.task-filter select { width: 100%; }
.task-filter-main a { white-space: nowrap; }

.task-filter-details {
  flex: 1 0 100%;
  border-top: 1px solid #d9e6ec;
  padding-top: 10px;
}

.task-filter-details summary {
  color: #315c73;
  cursor: pointer;
  font-weight: 700;
}

.task-filter-grid,
.task-filter-dates {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px 14px;
  margin-top: 12px;
}

.task-filter-dates { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.task-filter-grid label,
.task-filter-dates label { color: #52768a; font-size: .86rem; }
.task-filter-grid select,
.task-filter-dates input { display: block; margin-top: 4px; }

@media (max-width: 560px) {
  .task-filter-main { flex-wrap: wrap; }
  .task-filter-main label { flex-basis: 100%; }
  .task-filter-grid,
  .task-filter-dates { grid-template-columns: 1fr; }
}

.root-nav .button.current {
  background: #d8edf7;
  color: #115e8e;
}

.root-nav .button:first-child:not(.current) {
  background: transparent;
  color: #38627b;
}

.file-table tbody tr[draggable=true] {
  cursor: grab;
}

.file-table tbody tr.drop-target {
  background: #e3f4fa;
  outline: 2px solid #46a8c6;
  outline-offset: -2px;
}

.empty-state {
  margin: 28px 26px !important;
  padding: 24px;
  border: 1px dashed #a8c8d8;
  border-radius: 12px;
  background: #f7fbfc;
  color: #315c73;
  font-size: 1.08rem;
  font-weight: 700;
  text-align: center;
}

.empty-state span {
  display: block;
  margin-top: 5px;
  color: #658095;
  font-size: .93rem;
  font-weight: 400;
}

.empty-upload-trigger {
  cursor: pointer;
  transition: border-color .16s ease, background .16s ease, transform .16s ease;
}

.empty-upload-trigger:hover {
  border-color: #4c9cc1;
  background: #eaf6fa;
  transform: translateY(-1px);
}

.empty-upload-trigger:focus-visible {
  outline: 3px solid rgba(25, 130, 188, .28);
  outline-offset: 3px;
}

.workspace-card.file-drop-active {
  position: relative;
  outline: 3px solid rgba(25, 130, 188, .35);
  outline-offset: 3px;
}

.workspace-drop-overlay {
  position: absolute;
  inset: 0;
  z-index: 8;
  display: grid;
  place-content: center;
  gap: 8px;
  padding: 24px;
  border: 3px dashed #2588b5;
  border-radius: inherit;
  background: rgba(229, 246, 252, .78);
  color: #135f87;
  pointer-events: none;
  text-align: center;
}

.workspace-drop-overlay[hidden] {
  display: none;
}

.workspace-drop-overlay strong {
  font-size: clamp(1.05rem, 2.2vw, 1.45rem);
}

.workspace-drop-overlay small {
  color: #416f85;
  font-size: .9rem;
}

.file-table tbody tr.file-upload-target td {
  background: #d8f2fb !important;
  box-shadow: inset 0 2px 0 #2588b5, inset 0 -2px 0 #2588b5;
}

.file-table tbody tr.file-upload-target td:first-child {
  box-shadow: inset 2px 0 0 #2588b5, inset 0 2px 0 #2588b5, inset 0 -2px 0 #2588b5;
}

.file-table tbody tr.file-upload-target td:last-child {
  box-shadow: inset -2px 0 0 #2588b5, inset 0 2px 0 #2588b5, inset 0 -2px 0 #2588b5;
}

.employee-profile dl {
  display: grid;
  grid-template-columns: minmax(130px, 180px) 1fr;
  gap: 9px 20px;
  max-width: 640px;
}

.employee-profile dt {
  color: #658095;
  font-weight: 700;
}

.employee-profile dd {
  margin: 0;
}

.employee-kpi {
  margin: 24px 0;
  padding: 18px;
  border: 1px solid #d9e8ef;
  border-radius: 13px;
  background: #f8fbfc;
}

.employee-kpi-link {
  display: block;
  color: inherit;
  text-decoration: none;
}

.employee-kpi h2 {
  margin: 0 0 13px;
  font-size: 1rem;
}

.employee-kpi > div {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 9px;
}

.employee-kpi p {
  display: grid;
  gap: 2px;
  margin: 0;
  padding: 10px 8px;
  border-radius: 9px;
  background: #fff;
  text-align: center;
}

.employee-kpi strong {
  color: #176eaa;
  font-size: 1.35rem;
  line-height: 1;
}

.employee-kpi span {
  color: #658095;
  font-size: .72rem;
  font-weight: 650;
}

.employee-kpi .is-overdue {
  background: #fff2f2;
}

.employee-kpi .is-overdue strong,
.employee-kpi .is-overdue span {
  color: #b4232d;
}

.employee-kpi-trend {
  margin: 18px 0 24px;
  border: 1px solid #d9e8ef;
  border-radius: 13px;
  overflow: hidden;
}

.employee-kpi-trend > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  background: #f8fbfc;
}

.employee-kpi-trend h3 {
  margin: 0;
  font-size: 1rem;
}

.employee-kpi-trend nav {
  display: flex;
  gap: 4px;
}

.employee-kpi-trend nav a {
  padding: 4px 8px;
  border-radius: 999px;
  color: #52768a;
  font-size: .78rem;
  font-weight: 650;
}

.employee-kpi-trend nav a.current {
  background: #dceff7;
  color: #176eaa;
}

.employee-kpi-trend table {
  width: 100%;
  border-collapse: collapse;
}

.employee-kpi-trend th,
.employee-kpi-trend td {
  padding: 9px 16px;
  border-top: 1px solid #e4edf1;
  text-align: left;
}

.employee-kpi-trend th {
  color: #658095;
  font-size: .72rem;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.employee-kpi-trend td:not(:first-child) {
  color: #176eaa;
  font-weight: 700;
}

.share-items {
  margin: 20px 0;
  padding: 0;
  list-style: none;
}

.share-items li {
  padding: 10px 0;
  border-bottom: 1px solid #d5e4ec;
}

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

.task-header h1 {
  margin-top: 0;
}

.file-add-trigger {
  gap: 6px;
}

.file-add-icon {
  width: 18px;
  height: 18px;
  vertical-align: 0;
}

.file-table {
  table-layout: fixed;
}

.file-table th[data-file-column="name"],
.file-table td[data-file-column="name"] {
  width: 33.333%;
  max-width: 33.333%;
  overflow-wrap: anywhere;
}

.file-table .file-actions-header {
  position: relative;
  padding-right: 48px;
  text-align: right;
}

.file-table .file-actions-header .task-column-settings {
  right: 11px;
}

/* The workspace normally clips table corners, but an open column picker must
   remain reachable beyond the last table row. */
.workspace-card:has([data-file-column-settings][open]) {
  overflow: visible;
}

.workspace-card > .file-browser-header {
  margin-top: 22px;
}

.file-browser-header h1 {
  margin: 0 0 4px;
}

.workspace-card > .file-browser-header + .muted {
  margin-bottom: 18px;
  font-size: .9rem;
}

.task-tab-count {
  display: inline-grid;
  min-width: 1.55em;
  height: 1.55em;
  margin-left: .18em;
  padding: 0 .34em;
  border-radius: 999px;
  place-items: center;
  vertical-align: middle;
  background: #dceff7;
  color: #176eaa;
  font-size: .72em;
  font-weight: 750;
}

/* Creation forms are moved into dialogs. Reserve only the header row until JS
   creates its matching action button, so admin pages do not flash on load. */
.card > form[action="index.php?r=admin_create_user"],
.card > form[action="index.php?r=admin_group"] {
  position: absolute;
  visibility: hidden;
  pointer-events: none;
}

.task-templates > .task-header > a.button:not(.task-template-new-trigger) {
  display: none;
}

.task-templates > form[action*="task_template_save"] {
  position: absolute;
  visibility: hidden;
  pointer-events: none;
}

.task-templates .task-table td:last-child,
.task-template-actions-cell {
  display: flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
}

.task-templates .task-table td:last-child form {
  display: inline-flex;
  margin: 0;
}

.task-template-action-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 5px 9px;
  border: 1px solid #d5e3e9;
  border-radius: 7px;
  background: #f8fbfc;
  color: #42657a;
  font-size: .82rem;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
  box-shadow: none;
}

.task-template-action-button:hover,
.task-template-action-button:focus {
  background: #e6f2f7;
  color: #176eaa;
  text-decoration: none;
  box-shadow: none;
  transform: none;
}

.task-template-action-button.is-danger {
  border-color: #efd3d5;
  background: #fff8f8;
  color: #b45050;
}

.task-template-action-button.is-danger:hover,
.task-template-action-button.is-danger:focus {
  background: #fff0f0;
  color: #922f37;
}

.task-templates .task-table td:last-child .icon-action {
  width: 30px;
  min-height: 30px;
  padding: 0;
  border-radius: 7px;
  font-size: 1rem;
}

.task-template-edit-trigger,
.task-template-toggle-trigger {
  color: #52768a;
}

.task-template-edit-trigger:hover,
.task-template-edit-trigger:focus,
.task-template-toggle-trigger:hover,
.task-template-toggle-trigger:focus {
  background: #e1eef4;
  color: #176eaa;
}

.task-template-delete {
  position: absolute;
  visibility: hidden;
  pointer-events: none;
  margin: 0;
}

.modal .task-template-delete {
  position: static;
  visibility: visible;
  pointer-events: auto;
}

.modal .task-template-delete button {
  min-height: 40px;
  padding: 9px 14px;
  border: 1px solid #a63e46;
  border-radius: 8px;
  background: #b45050;
  color: #fff;
}

.task-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 18px 0;
}

.task-nav a {
  padding: 7px 10px;
  border-radius: 8px;
  color: var(--blue-dark);
}

.task-nav a.current,
.task-nav a:hover {
  background: var(--blue-soft);
  color: var(--blue-dark);
  text-decoration: none;
}

.task-mobile-columns,
.task-mobile-search { display: none; }

.task-calendar { max-width: none; }
.task-calendar-controls { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 14px; margin: 18px 0; }
.task-calendar-controls > strong { text-align: center; }
.task-calendar-step, .task-calendar-views { display: flex; align-items: center; gap: 6px; }
.task-calendar-views { justify-content: flex-end; }
.task-calendar-step a, .task-calendar-views a { padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; color: var(--blue-dark); font-size: .86rem; font-weight: 700; text-decoration: none; }
.task-calendar-views a.current { border-color: var(--blue); background: var(--blue); color: #fff; }
.task-calendar-step a:hover, .task-calendar-step a:focus, .task-calendar-views a:hover, .task-calendar-views a:focus { background: var(--blue-soft); color: var(--blue-dark); }
.task-calendar-views a.current:hover, .task-calendar-views a.current:focus { background: var(--blue-dark); color: #fff; }
.task-calendar-legend { display: flex; flex-wrap: wrap; gap: 12px; margin: 0 0 14px; color: #587586; font-size: .8rem; }
.task-calendar-legend span::before { display: inline-block; width: .7em; height: .7em; margin-right: 5px; border-radius: 50%; background: #337ca7; content: ''; }
.task-calendar-legend .kind-template::before { background: #7867ab; }
.task-calendar-legend .is-closed::before { background: #94a4af; }
.task-calendar-legend .task-calendar-drag-hint::before { display: none; }
.task-calendar-drag-hint { color: #52768a; }
.task-calendar-event[draggable="true"] { cursor: grab; }
.task-calendar-event[draggable="true"]:active { cursor: grabbing; }
.task-calendar-event.is-dragging { opacity: .45; }
.task-calendar-event.is-saving { pointer-events: none; opacity: .6; }
.task-calendar-week > section.is-drop-target, .task-calendar-month-grid > section.is-drop-target { background: #dcedf5; box-shadow: inset 0 0 0 2px var(--blue); }
.task-calendar-events { display: grid; gap: 5px; }
.task-calendar-event { display: grid; grid-template-columns: auto minmax(0,1fr); gap: 2px 6px; padding: 6px 7px; border-left: 3px solid #337ca7; border-radius: 5px; background: #eaf5fa; color: #194b68; font-size: .8rem; line-height: 1.25; text-decoration: none; }
.task-calendar-event:hover, .task-calendar-event:focus { background: #dcedf5; color: #115e8e; text-decoration: none; }
.task-calendar-event time { font-weight: 800; white-space: nowrap; }
.task-calendar-event small { grid-column: 2; color: #587586; font-size: .72rem; }
.task-calendar-event.kind-template { border-left-color: #7867ab; background: #f0edf9; color: #51467e; }
.task-calendar-event.kind-template:hover, .task-calendar-event.kind-template:focus { background: #e5dff5; color: #403566; }
.task-calendar-event.is-closed { border-left-color: #94a4af; background: #f1f4f5; color: #657580; }
.task-calendar-event.is-closed span { text-decoration: line-through; }
.task-calendar-event.is-unscheduled { border-left-color: #6d8b4e; background: #eef6e8; color: #38592b; }
.task-calendar-event.is-unscheduled small { color: #628052; }
.task-calendar-unscheduled { margin-top: 22px; padding-top: 17px; border-top: 1px solid #d2e1e8; }
.task-calendar-unscheduled h2 { margin: 0; color: #42657a; font-size: 1rem; }
.task-calendar-unscheduled > p { margin: 5px 0 10px; color: #587586; font-size: .82rem; }
.task-calendar-day.is-drop-target { background: #dcedf5; box-shadow: inset 0 0 0 2px var(--blue); }
.task-calendar-day { max-width: 760px; }
.task-calendar-day h2 { margin: 0 0 12px; }
.task-calendar-day-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.task-calendar-create { display: inline-block; margin: 0 0 8px; color: var(--blue); font-size: .76rem; font-weight: 750; text-decoration: none; }
.task-calendar-create:hover, .task-calendar-create:focus { color: var(--blue-dark); text-decoration: underline; }
.task-calendar-day-heading .task-calendar-create { padding: 7px 10px; border-radius: 8px; background: var(--blue); color: #fff; font-size: .86rem; text-decoration: none; }
.task-calendar-day-heading .task-calendar-create:hover, .task-calendar-day-heading .task-calendar-create:focus { background: var(--blue-dark); color: #fff; }
.task-calendar-week { display: grid; grid-template-columns: repeat(7,minmax(130px,1fr)); overflow-x: auto; border: 1px solid #d2e1e8; border-radius: 9px; }
.task-calendar-week > section { position: relative; min-height: 240px; padding: 9px; border-right: 1px solid #dce8ed; }
.task-calendar-week > section:last-child { border-right: 0; }
.task-calendar-week h2 { margin: 0 0 9px; color: #42657a; font-size: .9rem; }
.task-calendar-week h2 small { color: #78909e; font-weight: 500; }
.task-calendar-empty { margin: 12px 0; color: #9aabb5; font-size: .78rem; }
.task-calendar-month { overflow-x: auto; }
.task-calendar-month-head, .task-calendar-month-grid { display: grid; grid-template-columns: repeat(7,minmax(130px,1fr)); min-width: 910px; }
.task-calendar-month-head { color: #587586; font-size: .8rem; font-weight: 750; text-align: center; }
.task-calendar-month-head span { padding: 7px; }
.task-calendar-month-grid { border-top: 1px solid #d2e1e8; border-left: 1px solid #d2e1e8; }
.task-calendar-month-grid > section { position: relative; min-height: 125px; padding: 7px; border-right: 1px solid #d2e1e8; border-bottom: 1px solid #d2e1e8; }
.task-calendar-month-grid > section.is-outside { background: #f7fafb; }
.task-calendar-month-grid > section.is-outside.is-drop-target { background: #dcedf5; }
.task-calendar-day-create { position: absolute; top: 6px; right: 6px; display: grid; width: 24px; height: 24px; border-radius: 50%; place-items: center; background: var(--blue); color: #fff; font-size: 1.15rem; font-weight: 500; line-height: 1; opacity: 0; text-decoration: none; transition: opacity .15s ease, background .15s ease; }
.task-calendar-week > section:hover .task-calendar-day-create, .task-calendar-month-grid > section:hover .task-calendar-day-create, .task-calendar-day-create:focus { opacity: 1; }
.task-calendar-day-create:hover, .task-calendar-day-create:focus { background: var(--blue-dark); color: #fff; text-decoration: none; }
.task-calendar-date { display: inline-grid; width: 25px; height: 25px; margin-bottom: 4px; border-radius: 50%; place-items: center; color: #42657a; font-size: .8rem; font-weight: 800; text-decoration: none; }
.task-calendar-date:hover, .task-calendar-date:focus { background: #e5f2f7; color: #115e8e; text-decoration: none; }
.task-calendar-month .task-calendar-event { padding: 4px 5px; font-size: .71rem; }
.task-calendar-month .task-calendar-event small { display: none; }

.task-report-card { max-width: none; }
.task-report-filter { display: flex; flex-wrap: wrap; align-items: end; gap: 10px; margin: 18px 0; }
.task-report-filter label { display: grid; gap: 4px; color: #52768a; font-size: .82rem; font-weight: 700; }
.task-report-filter input { min-width: 150px; }
.task-report-filter .task-report-date-range { min-width: 245px; cursor: pointer; }
.task-report-filter a { padding: 9px 3px; font-size: .86rem; font-weight: 700; }
.task-report-descriptions { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 0 0 18px; }
.task-report-descriptions > div { padding: 12px; border: 1px solid #d5e4ec; border-radius: 9px; background: #f7fbfd; }
.task-report-descriptions dt { margin-bottom: 5px; color: #315c73; font-size: .82rem; font-weight: 800; }
.task-report-descriptions dd { margin: 0; color: #587586; font-size: .77rem; line-height: 1.4; }
.task-report-table-wrap { overflow-x: auto; }
.task-report-table { width: 100%; min-width: 920px; border-collapse: collapse; }
.task-report-table th, .task-report-table td { padding: 12px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.task-report-table th { color: #587586; font-size: .76rem; letter-spacing: .04em; text-transform: uppercase; }
.task-report-table th a { color: inherit; text-decoration: none; }
.task-report-table th a:hover, .task-report-table th a:focus { color: var(--blue); text-decoration: underline; }
.task-report-table td:first-child { min-width: 180px; font-weight: 700; }
.task-report-table td:nth-child(2) { min-width: 150px; color: #587586; }
.task-report-progress { position: relative; display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 3px 8px; min-width: 120px; color: #17364d; font-size: .82rem; }
.task-report-progress::before { grid-column: 1 / -1; display: block; height: 8px; border-radius: 999px; background: #dcecf3; content: ''; }
.task-report-progress > span:first-child { position: absolute; top: 0; left: 0; height: 8px; max-width: 100%; border-radius: 999px; background: var(--blue); }
.task-report-progress b { font-size: .9rem; }
.task-report-progress small { color: #658095; font-size: .76rem; }
.task-report-progress[tabindex] { cursor: help; outline-offset: 4px; }
.task-report-missed { position: fixed; z-index: 160; display: grid; gap: 8px; width: min(340px, calc(100vw - 24px)); max-height: min(320px, calc(100vh - 24px)); padding: 12px; overflow: auto; border: 1px solid #9bbacb; border-radius: 9px; background: #fff; box-shadow: 0 12px 28px rgba(20, 61, 96, .24); color: #315c73; font-size: .8rem; line-height: 1.35; }
.task-report-missed[hidden] { display: none !important; }
.task-report-missed > strong { color: #17364d; font-size: .82rem; }
.task-report-missed > span { display: grid; gap: 5px; }
.task-report-missed a { color: var(--blue); text-decoration: none; }
.task-report-missed a:hover, .task-report-missed a:focus { text-decoration: underline; }
.task-report-empty { color: #9aabb5; }

@media (max-width: 900px) {
  .task-report-descriptions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 560px) {
  .task-report-descriptions { grid-template-columns: 1fr; }
  .task-report-filter .task-report-date-range { min-width: min(245px, 78vw); }
}

.task-column-settings {
  position: absolute;
  top: 50%;
  right: 7px;
  z-index: 4;
  transform: translateY(-50%);
  color: var(--blue-dark);
  font-size: .84rem;
}

.task-column-menu-cell {
  position: relative;
  width: 0;
  min-width: 0;
  max-width: 0;
  padding: 0;
  border: 0;
}

.task-column-settings summary {
  display: grid;
  width: 22px;
  height: 26px;
  padding: 0;
  border-radius: 5px;
  cursor: pointer;
  color: var(--blue);
  font-size: 1.22rem;
  font-weight: 800;
  line-height: 1;
  list-style: none;
  place-items: center;
  user-select: none;
}

.task-column-settings summary::-webkit-details-marker { display: none; }
.task-column-settings summary:hover,
.task-column-settings summary:focus-visible { background: var(--blue-soft); color: var(--blue-dark); }

.task-column-settings[open] {
  top: calc(100% + 3px);
  transform: none;
  min-width: 250px;
  padding: 11px;
  border: 1px solid var(--blue);
  border-radius: 9px;
  background: var(--paper);
  box-shadow: 0 8px 20px rgba(35, 76, 99, .13);
}

.task-column-settings[open] summary { display: none; }

.task-column-settings p {
  margin: 9px 0;
  color: var(--muted);
  font-size: .78rem;
}

.task-column-settings ul {
  display: grid;
  gap: 3px;
  margin: 0 0 9px;
  padding: 0;
  list-style: none;
}

.task-column-settings li {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 5px;
  border-radius: 6px;
  cursor: grab;
}

.task-column-settings li:hover,
.task-column-settings li.is-dragging { background: var(--blue-soft); }
.task-column-settings li.is-dragging { opacity: .5; }
.task-column-settings label { display: flex; flex: 1; align-items: center; gap: 7px; cursor: pointer; }
.task-column-drag { color: var(--blue); font-size: 1rem; line-height: 1; }

.admin-console { max-width: 900px; }
.admin-console-status { font-weight: 700; }
.admin-console-status.is-ok { color: #176b51; }
.admin-console-status.is-info { color: #52768a; }
.admin-console-status.is-error { color: #b4232d; }
.admin-console-load { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; margin: 20px 0; }
.admin-console-metric { padding: 13px; border: 1px solid var(--line); border-radius: 10px; background: #f8fcfe; }
.admin-console-metric > div:first-child { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 9px; font-size: .83rem; }
.admin-console-metric strong { color: #25465b; }
.admin-console-metric span { color: var(--muted); text-align: right; }
.admin-console-progress { height: 8px; overflow: hidden; border-radius: 999px; background: #e1edf2; }
.admin-console-progress span { display: block; height: 100%; border-radius: inherit; background: var(--blue); }
.admin-console-metric.is-warning .admin-console-progress span { background: #c98513; }
.admin-console-metric.is-critical .admin-console-progress span { background: var(--danger); }
.admin-console-metric.is-unknown { opacity: .72; }
@media (max-width: 760px) { .admin-console-load { grid-template-columns: 1fr; } }

.task-table th,
.task-table td {
  text-align: left;
  vertical-align: top;
}

.task-sort-link {
  color: inherit;
  text-decoration: none;
}

.task-sort-indicator {
  display: inline-block;
  width: 1.1em;
  margin-left: .3em;
  color: #90a9b7;
  font-size: 1.05em;
  text-align: center;
}

.task-sort-link.is-active .task-sort-indicator {
  color: #176eaa;
}

.task-sort-link:hover,
.task-sort-link:focus-visible {
  color: #176eaa;
  text-decoration: underline;
}

.task-table tbody td {
  position: relative;
}

.task-cell-link {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.task-table tbody td a:not(.task-cell-link) {
  position: relative;
  z-index: 2;
}

.task-executors-tooltip { position: relative; z-index: 2; display: inline-flex; margin-left: 5px; vertical-align: middle; color: #52768a; cursor: help; opacity: 0; outline: none; pointer-events: none; }
.task-cell-due:hover .task-executors-tooltip { opacity: 1; pointer-events: auto; }
.task-executors-tooltip-icon { width: 1.4em; height: 1.4em; }
.task-executors-tooltip:focus-visible { border-radius: 50%; box-shadow: 0 0 0 3px #b9e1f0; }
.task-executors-tooltip-content { position: absolute; z-index: 5; top: calc(100% + 7px); right: 0; display: none; width: max-content; min-width: 210px; max-width: min(320px,calc(100vw - 32px)); padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); box-shadow: 0 10px 24px rgba(20,61,96,.2); color: #17364d; font-size: .82rem; font-weight: 400; line-height: 1.35; }
.task-executors-tooltip:hover,.task-executors-tooltip:focus { z-index: 10; }
.task-executors-tooltip:hover .task-executors-tooltip-content,.task-executors-tooltip:focus .task-executors-tooltip-content { display: grid; gap: 6px; z-index: 10; }
.task-executors-tooltip-content > strong { color: var(--blue-dark); font-size: .84rem; }
.task-executors-tooltip-content > span { display: flex; justify-content: space-between; gap: 14px; }
.task-executors-tooltip-content > span > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-executors-tooltip-content b { flex: 0 0 auto; color: #52768a; font-weight: 600; }

.task-pagination {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin: 18px 0 0;
}

.task-pagination a {
  display: grid;
  min-width: 34px;
  min-height: 34px;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  place-items: center;
  color: var(--blue-dark);
  font-size: .85rem;
  font-weight: 700;
}

.task-pagination a.current {
  border-color: var(--blue);
  background: var(--blue-soft);
  color: var(--blue-dark);
}

.task-table a.task-closed {
  color: #658095;
  text-decoration: line-through;
  text-decoration-thickness: 1px;
}

.task-unread {
  display: inline-block;
  margin-left: 7px;
  padding: 2px 7px;
  border-radius: 999px;
  background: #e4f5ef;
  color: #116654;
  font-size: .73rem;
  font-weight: 700;
}

.task-table small {
  display: block;
  margin-top: 4px;
}

.task-table tbody tr.task-deadline-soon td {
  background: #fff8d8;
}

.task-table tbody tr.task-deadline-urgent td {
  background: #fff0d8;
}

.task-table tbody tr.task-deadline-overdue td {
  background: #ffe3e3;
}

.task-table tbody tr.task-deadline-soon .task-cell-due,
.task-table tbody tr.task-deadline-urgent .task-cell-due,
.task-table tbody tr.task-deadline-overdue .task-cell-due {
  font-weight: 800;
}

.task-table tbody tr.task-deadline-soon .task-row-leading {
  box-shadow: inset 4px 0 #d7a400;
}

.task-table tbody tr.task-deadline-urgent .task-row-leading {
  box-shadow: inset 4px 0 #e27920;
}

.task-table tbody tr.task-deadline-overdue .task-row-leading {
  box-shadow: inset 4px 0 #c63b42;
}

.task-table tbody tr.task-deadline-soon:hover td { background: #fff2bd; }
.task-table tbody tr.task-deadline-urgent:hover td { background: #ffe2bc; }
.task-table tbody tr.task-deadline-overdue:hover td { background: #ffd3d3; }

.task-table tbody tr.task-deadline-overdue .task-cell-due {
  animation: overdue-deadline-pulse 1.15s ease-in-out infinite;
}

@keyframes overdue-deadline-pulse {
  0%, 100% { color: #b4232d; text-shadow: 0 0 0 rgba(196, 54, 63, 0); }
  45% { color: #24070a; text-shadow: 0 0 8px rgba(196, 54, 63, .45); }
  62% { color: #b4232d; text-shadow: 0 0 3px rgba(196, 54, 63, .2); }
}

@media (prefers-reduced-motion: reduce) {
  .task-table tbody tr.task-deadline-overdue .task-cell-due {
    animation: none;
  }
}

.card > form.task-inbox-hide-completed {
  display: flex;
  width: 100%;
  max-width: none;
  gap: 0;
  justify-content: flex-start;
  margin: 18px 0 0;
  padding-top: 4px;
  text-align: left;
}

.task-inbox-hide-completed button {
  min-height: 34px;
  padding: 6px 12px;
  border: 1px solid #d5e2e8;
  border-radius: 8px;
  background: #f7fafb;
  color: #58758a;
  box-shadow: none;
  font-size: .82rem;
  font-weight: 600;
}

.task-inbox-hide-completed button:hover,
.task-inbox-hide-completed button:focus {
  border-color: #b9cfd9;
  background: #edf4f6;
  color: #315c73;
  box-shadow: 0 1px 3px rgba(35, 79, 99, .08);
  text-decoration: none;
  transform: none;
}

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

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

.tasks-card > .task-create-form {
  position: absolute;
  visibility: hidden;
  pointer-events: none;
  max-width: 880px;
  margin-top: 18px;
}

.task-create-form .task-form-row label,
.task-create-form .task-role-fields label {
  display: block;
}

.task-create-form .task-form-row input,
.task-create-form .task-role-fields select {
  display: block;
  width: 100%;
  margin-top: 7px;
}

.task-detail {
  max-width: none;
  min-width: 0;
  margin-bottom: 0;
}

.task-page-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 27%);
  gap: 18px;
  align-items: start;
}

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

.task-comment-compose,
.task-comment-editor,
.task-comment-editor .quill-editor {
  min-width: 0;
  max-width: 100%;
}

/* These forms are moved into dialogs by app.js. Keep them out of the initial
   document flow so the task page never flashes or jumps during startup. */
.task-main > .task-author-form,
.task-main > .task-participant-form,
.task-main > .task-executor-form,
.task-main > .task-reminder-form,
.task-main > .task-attachment-form {
  position: absolute;
  visibility: hidden;
  pointer-events: none;
}

/* PORTO templates keep semantic route actions; treat them like the original
   task form classes so app.js presents the same modal controls. */
.task-main > form[action*="r=task_update"],
.task-main > form[action*="r=task_participants"],
.task-main > form[action*="r=task_status"],
.task-main > form[action*="r=task_attachment"] {
  position: absolute;
  visibility: hidden;
  pointer-events: none;
}

/* Keep the two related deadline fields together in the task edit dialog. */
.task-edit-deadlines {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.task-edit-deadlines label,
.task-edit-deadlines input {
  box-sizing: border-box;
  min-width: 0;
  width: 100%;
}

/* Small deadline adjustments stay visually subordinate to the date field. */
.task-due-shortcuts {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 7px;
}

.task-due-shortcut {
  min-height: 28px;
  padding: 3px 8px;
  border: 1px solid #c9dce6;
  border-radius: 7px;
  background: #f8fbfc;
  color: #52768a;
  box-shadow: none;
  font: inherit;
  font-size: .78rem;
  font-weight: 700;
  line-height: 1;
}

.task-due-shortcut:hover,
.task-due-shortcut:focus {
  border-color: #9bbdce;
  background: #edf5f8;
  color: #315d76;
  box-shadow: none;
  transform: none;
}

.task-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.task-title-row > .favorites-heading {
  flex: 1 1 auto;
  margin: 0;
}

.task-title-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: flex-start;
  gap: 8px;
  margin-left: auto;
}

.task-title-row h1 {
  margin: 0;
  min-width: 0;
  flex: 1 1 auto;
}

.task-title-actions .modal-trigger[data-modal-action="task_reminder"] {
  max-width: min(15rem, 42vw);
  flex: 0 0 auto;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  min-height: 34px;
  padding: 6px 10px;
  border-color: #d5e3e9;
  background: #f8fbfc;
  color: #42657a;
  box-shadow: none;
  font-size: .85rem;
}

.task-title-actions .modal-trigger[data-modal-action="task_reminder"]:hover,
.task-title-actions .modal-trigger[data-modal-action="task_reminder"]:focus {
  background: #e6f2f7;
  color: #176eaa;
  box-shadow: none;
  transform: none;
}

.task-sidebar {
  position: sticky;
  top: 18px;
  margin-bottom: 0;
}

.task-sidebar h2 {
  margin: 0 0 12px;
  font-size: 1.08rem;
}

.task-sidebar h2:not(:first-child) {
  margin-top: 22px;
}

.task-participants-heading {
  display: flex;
  align-items: center;
  gap: 8px;
}

.task-status {
  padding: 6px 10px;
  border-radius: 999px;
  background: #e4f5ef;
  color: #116654;
  font-size: .82rem;
  font-weight: 700;
}

.task-status.closed {
  background: #edf1f3;
  color: #587078;
}

.task-description {
  margin: 22px 0;
  padding: 18px;
  border: 1px solid #d9e6ec;
  border-radius: 11px;
  background: #fbfdfe;
}

.task-description p:last-child,
.task-comment p:last-child {
  margin-bottom: 0;
}

.task-description .ql-align-center,
.task-comment .ql-align-center { text-align: center; }

.task-description .ql-align-right,
.task-comment .ql-align-right { text-align: right; }

.task-description .ql-align-justify,
.task-comment .ql-align-justify { text-align: justify; }

.task-description .ql-direction-rtl,
.task-comment .ql-direction-rtl { direction: rtl; text-align: inherit; }

.task-description .ql-indent-1,
.task-comment .ql-indent-1 { margin-left: 3em; }

.task-description .ql-indent-2,
.task-comment .ql-indent-2 { margin-left: 6em; }

.task-description .ql-indent-3,
.task-comment .ql-indent-3 { margin-left: 9em; }

.task-description .ql-indent-4,
.task-comment .ql-indent-4 { margin-left: 12em; }

.task-description .ql-indent-5,
.task-comment .ql-indent-5 { margin-left: 15em; }

.task-description .ql-indent-6,
.task-comment .ql-indent-6 { margin-left: 18em; }

.task-description .ql-indent-7,
.task-comment .ql-indent-7 { margin-left: 21em; }

.task-description .ql-indent-8,
.task-comment .ql-indent-8 { margin-left: 24em; }

.task-description .ql-font-serif,
.task-comment .ql-font-serif { font-family: Georgia, "Times New Roman", serif; }

.task-description .ql-font-monospace,
.task-comment .ql-font-monospace { font-family: Consolas, "Courier New", monospace; }

.task-description .ql-size-small,
.task-comment .ql-size-small { font-size: .75em; }

.task-description .ql-size-large,
.task-comment .ql-size-large { font-size: 1.5em; }

.task-description .ql-size-huge,
.task-comment .ql-size-huge { font-size: 2.5em; }

.task-description .ql-code-block-container,
.task-comment .ql-code-block-container {
  margin: 1em 0;
  padding: 10px 12px;
  border-radius: 7px;
  background: #eff4f6;
  color: #17364d;
  font-family: Consolas, "Courier New", monospace;
  font-size: .9em;
}

.task-description .ql-code-block,
.task-comment .ql-code-block { white-space: pre-wrap; }

.task-description li[data-list="checked"],
.task-description li[data-list="unchecked"],
.task-comment li[data-list="checked"],
.task-comment li[data-list="unchecked"] { list-style: none; }

.task-description li[data-list="checked"]::before,
.task-comment li[data-list="checked"]::before { content: "☑ "; }

.task-description li[data-list="unchecked"]::before,
.task-comment li[data-list="unchecked"]::before { content: "☐ "; }

.task-meta {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 7px 18px;
}

.task-meta dt {
  color: #658095;
  font-weight: 700;
}

.task-meta dd {
  margin: 0;
}

.task-sidebar .task-meta {
  display: block;
}

.task-sidebar .task-meta dt {
  display: inline;
  margin: 0 9px 0 0;
  font-size: .78rem;
  text-transform: uppercase;
  white-space: nowrap;
}

.task-sidebar .task-meta dd {
  display: inline;
  margin: 0;
  font-size: .92rem;
  white-space: normal;
  overflow-wrap: anywhere;
}

.task-sidebar .task-meta dd::after {
  content: "";
  display: block;
  height: 9px;
}

.task-participants {
  margin-bottom: 20px;
  line-height: 2;
}

.task-sidebar .task-participants {
  margin: 0;
  line-height: 1.55;
  font-size: .88rem;
}

.task-sidebar .task-participants > div {
  margin-top: 9px;
}

.task-sidebar .task-participants .access-subject-type {
  margin-bottom: 0;
  background: var(--blue-soft);
  color: var(--blue-dark);
}

.task-sidebar .task-participant-details {
  margin-top: 3px;
}

.task-participant-group {
  margin-top: 9px;
}

.task-participant-names {
  color: #17364d;
  margin-top: 3px;
}

.task-comment-compose {
  margin-top: 18px;
  padding: 18px 0 0;
  border: 0;
  border-top: 1px solid #dce8ed;
  border-radius: 0;
  background: transparent;
}

.task-comment-compose h2 {
  margin-top: 0;
  margin-bottom: 10px;
  font-size: 1.12rem;
}

.task-comments-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 18px 0 10px;
}

.task-comments-heading h2 { margin: 0; }

.task-system-comments-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #587586;
  font-size: .82rem;
  white-space: nowrap;
}

.task-system-comments-toggle input { margin: 0; }

.task-comment-form {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.task-comment-form > * { min-width: 0; }

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

.task-comment-actions small {
  color: #78909e;
  font-size: .78rem;
}

.task-sticker-picker { align-self: start; color: #587586; font-size: .84rem; }
.task-sticker-picker summary { width: fit-content; cursor: pointer; }
.task-sticker-options { display: flex; flex-wrap: wrap; gap: 6px; max-width: 520px; margin-top: 8px; }
.task-sticker-option { position: relative; display: grid; width: 54px; height: 54px; padding: 3px; border: 1px solid #d2e1e8; border-radius: 8px; background: #f8fcfe; place-items: center; }
.task-sticker-option:hover, .task-sticker-option:focus, .task-sticker-option.is-selected { border-color: #176eaa; background: #e5f2f7; box-shadow: 0 0 0 2px rgba(23,110,170,.16); }
.task-sticker-option img { display: block; max-width: 100%; max-height: 100%; object-fit: contain; }
.task-sticker-preview { position: relative; display: grid; width: 180px; height: 180px; margin-bottom: 32px; padding: 6px; border: 1px solid #c4d9e4; border-radius: 10px; background: #fff; box-shadow: 0 8px 22px rgba(28,69,92,.16); place-items: center; }
.task-sticker-preview[hidden] { display: none; }
.task-sticker-preview img { display: block; max-width: 100%; max-height: 100%; object-fit: contain; }
.task-sticker-preview span { position: absolute; right: -9px; bottom: -9px; display: grid; width: 31px; height: 31px; border: 3px solid #fff; border-radius: 50%; background: #238545; color: #fff; place-items: center; }
.task-sticker-selected-icon { width: 18px; height: 18px; }
.task-sticker-clear { position: absolute; right: -9px; top: -9px; display: grid; box-sizing: border-box; width: 31px; min-width: 31px; height: 31px; min-height: 31px; padding: 0 0 2px; aspect-ratio: 1 / 1; border: 3px solid #fff; border-radius: 50% !important; background: #d84c4c; color: #fff; flex: 0 0 31px; font-family: Arial,sans-serif; font-size: 1.5rem; font-weight: 500; line-height: 1; place-items: center; }
.task-sticker-clear:hover, .task-sticker-clear:focus { background: #b93434; color: #fff; box-shadow: 0 0 0 2px rgba(216,76,76,.28); }

.task-comment.is-live-new { animation:task-comment-arrive .35s ease-out; }
@keyframes task-comment-arrive { from { opacity:0; transform:translateY(8px); } to { opacity:1; transform:translateY(0); } }

.task-comment {
  margin: 0;
  padding: 6px 0;
  border: 0;
  border-bottom: 0;
  border-radius: 0;
  background: transparent;
}

.task-comment.system {
  display: flex;
  justify-content: center;
  margin: 12px 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #698596;
}

.task-comment-list:not(.show-system-changes) .task-comment.system { display: none; }

.task-comment-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  width: 100%;
}

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

.task-comment-avatar {
  display: grid;
  flex: 0 0 30px;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 50%;
  background: #dbeef6;
  color: #216786;
  font-size: .8rem;
  font-weight: 700;
}

.task-comment-avatar-link {
  display: block;
  flex: 0 0 30px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
}

.task-comment-avatar-link:focus-visible {
  outline: 2px solid #2175a3;
  outline-offset: 2px;
}

.task-comment-avatar-photo { object-fit: cover; }

.avatar-placeholder.avatar-tone-0 { background: #dbeef6; color: #216786; }
.avatar-placeholder.avatar-tone-1 { background: #e2edf8; color: #285d8d; }
.avatar-placeholder.avatar-tone-2 { background: #e4f0e8; color: #2f6b53; }
.avatar-placeholder.avatar-tone-3 { background: #f3ebdc; color: #80642e; }
.avatar-placeholder.avatar-tone-4 { background: #eee8f7; color: #5e4c88; }
.avatar-placeholder.avatar-tone-5 { background: #f4e5eb; color: #8b425e; }

.profile-avatar-editor,
.employee-profile-heading {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0 0 18px;
}

.employee-profile-heading h1 {
  min-width: 0;
  margin: 0;
}

.employee-profile-avatar-wrap {
  position: relative;
  display: block;
  flex: 0 0 76px;
  width: 76px;
  height: 76px;
}

.employee-profile-online {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 16px;
  height: 16px;
  border: 3px solid var(--paper);
  border-radius: 50%;
  background: var(--blue);
  animation: employee-online-pulse 1.5s ease-out infinite;
}

.employee-profile-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.employee-profile-actions .icon-action {
  display: inline-flex;
  width: auto;
  height: auto;
  flex: 0 0 auto;
  align-items: center;
  gap: 7px;
  min-height: 40px;
  padding: 8px 11px;
  border: 1px solid var(--control-border);
  border-radius: 8px;
  background: transparent;
  color: var(--blue);
  text-decoration: none;
  white-space: nowrap;
}

.employee-profile-actions .icon-action:hover,
.employee-profile-actions .icon-action:focus-visible {
  border-color: var(--blue);
  background: var(--blue-soft);
  color: var(--blue);
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: none;
}

.employee-profile-actions .ui-icon {
  width: 19px;
  height: 19px;
}

@media (max-width: 760px) {
  .employee-profile-heading {
    flex-wrap: wrap;
  }

  .employee-profile-actions {
    width: 100%;
    margin-left: 0;
    flex-wrap: wrap;
  }

  .employee-profile-online { animation: none; }
}

.profile-avatar-editor > img,
.profile-avatar-editor > span,
.employee-profile-avatar {
  display: grid;
  flex: 0 0 76px;
  width: 76px;
  height: 76px;
  place-items: center;
  border-radius: 50%;
  background: #dbeef6;
  color: #216786;
  font-size: 1.6rem;
  font-weight: 700;
  object-fit: cover;
}

.employee-list-avatar {
  position: relative;
  display: block;
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
}

.employee-list-avatar > img,
.employee-list-avatar > .avatar-placeholder {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 50%;
  font-size: .82rem;
  font-weight: 700;
  object-fit: cover;
}

.employee-list-online {
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 12px;
  height: 12px;
  border: 2px solid var(--paper);
  border-radius: 50%;
  background: var(--blue);
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--blue) 60%, transparent);
  animation: employee-online-pulse 1.5s ease-out infinite;
}

.employee-list-actions {
  width: 1%;
  white-space: nowrap;
  text-align: right !important;
}

.employee-list-table th {
  text-align: left;
}

.employee-list-photo {
  width: 1%;
  text-align: center !important;
}

.employee-list-actions .icon-action {
  display: inline-grid;
  width: 34px;
  min-height: 34px;
  margin: 0 4px 0 0;
  place-items: center;
  border: 1px solid var(--control-border);
  border-radius: 8px;
  color: var(--blue-dark);
  text-decoration: none;
}

.employee-list-actions .icon-action:hover,
.employee-list-actions .icon-action:focus-visible {
  border-color: var(--blue);
  background: var(--blue-soft);
  color: var(--blue);
}

.employee-list-actions .ui-icon {
  width: 18px;
  height: 18px;
}

@keyframes employee-online-pulse {
  0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--blue) 60%, transparent); }
  55% { box-shadow: 0 0 0 5px color-mix(in srgb, var(--blue) 0%, transparent); }
}

@media (prefers-reduced-motion: reduce) {
  .employee-list-online,
  .employee-profile-online { animation: none; }
}

.profile-avatar-editor > label { min-width: 0; }
.profile-avatar-editor > label input { display: block; margin-top: 5px; }
.profile-avatar-editor > label small { display: block; margin-top: 4px; }
.profile-avatar-editor .profile-avatar-remove { margin-left: auto; }

.task-comment-bubble {
  max-width: min(78%, 680px);
  padding: 8px 11px 7px;
  border-radius: 14px 14px 14px 4px;
  background: #f1f6f8;
  color: #17364d;
}

.task-comment.is-mine .task-comment-bubble {
  border-radius: 14px 14px 4px 14px;
  background: #dff1f8;
}

.task-comment.system .task-comment-bubble {
  display: inline;
  max-width: 100%;
  padding: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  font-size: .82rem;
  text-align: center;
}

.task-comment.system .task-comment-row {
  display: block;
  width: auto;
  text-align: center;
}

.task-comment header {
  display: flex;
  align-items: baseline;
  gap: 7px;
  margin: 0 0 4px;
  color: #5e7c8f;
  font-size: .76rem;
}

.task-comment header strong { color: #287191; }
.task-comment.is-mine header strong { color: #176eaa; }
.task-comment header time { color: #7893a3; font-size: .72rem; }

.task-comment-body { line-height: 1.42; }
.task-comment-body > :first-child { margin-top: 0; }
.task-comment-body > :last-child { margin-bottom: 0; }
.task-comment-sticker { display: block; margin: 5px 0; }
.task-comment-sticker img { display: block; width: min(180px,100%); height: auto; }

.task-comment-attachments {
  display: grid;
  gap: 5px;
  margin: 9px 0 0;
  padding: 0;
  list-style: none;
}

.task-comment-attachments a {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  gap: 7px;
  padding: 6px 8px;
  border-radius: 8px;
  background: rgba(255, 255, 255, .56);
  color: #315c73;
  font-size: .8rem;
  text-decoration: none;
}

.task-comment-attachments a:hover,
.task-comment-attachments a:focus { background: #fff; color: #176eaa; }

.task-comment-attachments span:last-child { min-width: 0; }
.task-comment-attachments strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-comment-attachments small { display: block; margin-top: 1px; color: #698596; }
.task-comment-attachments em { display: block; margin-top: 2px; color: #42657a; font-size: .82rem; font-style: normal; }

.task-comment-attachments .task-comment-image {
  display: grid;
  gap: 5px;
  width: fit-content;
  max-width: min(100%, 460px);
}

.task-comment-attachments .task-comment-image-link {
  display: block;
  padding: 0;
  overflow: hidden;
  border: 1px solid #d7e5ec;
  border-radius: 8px;
  background: #f8fcfe;
}

.task-comment-attachments .task-comment-image-link img {
  display: block;
  max-width: 100%;
  max-height: 360px;
  object-fit: contain;
}

.task-comment-image-meta { min-width: 0; }

.task-comment-attach {
  display: inline-flex;
  align-items: center;
  align-self: start;
  gap: 6px;
  margin: -3px 0 0;
  color: #587586;
  cursor: pointer;
  font-size: .84rem;
}

.task-comment-attach input { max-width: 220px; font-size: .76rem; }
.task-comment-attach small { color: #7893a3; font-size: .76rem; }

.task-comment-attachment-descriptions {
  display: grid;
  gap: 7px;
  max-width: 520px;
}

.task-comment-attachment-descriptions label {
  display: grid;
  grid-template-columns: minmax(110px, 1fr) minmax(190px, 2fr);
  align-items: center;
  gap: 10px;
  color: #587586;
  font-size: .82rem;
}

.task-comment-attachment-descriptions label > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-comment-attachment-descriptions input { margin: 0; }

@media (max-width: 560px) {
  .task-comment-attachment-descriptions label { grid-template-columns: 1fr; gap: 4px; }
}

.task-file-dropzone {
  display: flex !important;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 9px;
  padding: 10px 12px;
  border: 1px dashed #9cc8dc;
  border-radius: 9px;
  background: #f8fbfc;
  color: #315c73;
  transition: border-color .15s ease, background .15s ease;
}

.task-file-dropzone.is-dragging {
  border-color: #2175a3;
  background: #e4f4fa;
  box-shadow: inset 0 0 0 1px #74bddc;
}

.task-file-dropzone-status {
  flex: 1 1 180px;
  color: #587586;
  font-size: .82rem;
}

.task-file-dropzone input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.task-file-dropzone small {
  flex-basis: 100%;
  margin: 0;
}

.task-file-dropzone:focus-within {
  border-color: #2175a3;
  box-shadow: inset 0 0 0 1px #74bddc;
}

.scroll-top-rail {
  position: fixed;
  z-index: 40;
  top: 0;
  bottom: 0;
  left: 0;
  width: 20px;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: transparent;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: width .16s ease, background .16s ease, color .16s ease, opacity .16s ease;
}

.scroll-top-rail.is-visible {
  opacity: .02;
  pointer-events: auto;
}

.scroll-top-rail.is-visible:hover,
.scroll-top-rail.is-visible:focus-visible {
  width: 42px;
  background: rgba(40, 113, 145, .14);
  color: #287191;
  opacity: 1;
  outline: 0;
}

.scroll-top-rail span {
  display: grid;
  height: 100%;
  place-items: center;
  font-size: 18px;
  font-weight: 700;
}

.task-comment.system header {
  display: inline-flex;
  align-items: baseline;
  gap: 7px;
  margin: 0 6px 0 0;
  font-size: inherit;
  vertical-align: baseline;
}

.task-comment.system header strong { color: #587586; }
.task-comment.system header time { font-size: inherit; }
.task-comment.system .task-comment-body { display: inline; }
.task-comment.system .task-comment-body p { display: inline; margin: 0; }

@media (max-width: 760px) {
  .task-calendar-controls { grid-template-columns: 1fr; justify-items: stretch; }
  .task-calendar-controls > strong { order: -1; text-align: left; }
  .task-calendar-views { justify-content: flex-start; }
  .task-calendar-step a, .task-calendar-views a { flex: 1; text-align: center; }
  .task-calendar-week { grid-template-columns: repeat(7,minmax(170px,1fr)); }

  .task-comment-bubble { max-width: calc(100% - 38px); }
}

.task-comment footer { margin-top: 5px; }

.task-comment .task-comment-reply {
  display: inline-flex;
  min-height: 26px !important;
  margin: 0;
  padding: 2px 4px !important;
  border: 0 !important;
  border-radius: 5px;
  background: transparent !important;
  color: #698596;
  font-size: .78rem;
  font-weight: 600;
  box-shadow: none;
}

.task-comment .task-comment-reply:hover,
.task-comment .task-comment-reply:focus {
  background: transparent;
  color: #176eaa;
  transform: none;
  box-shadow: none;
}

.task-comment-parent {
  display: flex;
  align-items: baseline;
  gap: 7px;
  margin: 7px 0;
  padding: 5px 8px;
  border: 0;
  border-left: 2px solid #75b8d5;
  border-radius: 0 5px 5px 0;
  background: #f5fafc;
  color: #587586;
  font-size: .8rem;
}

.task-comment-parent > span,
.task-comment-replying small { display: none; }

.task-comment-parent strong { flex: 0 0 auto; color: #176eaa; }

.task-comment-parent small {
  min-width: 0;
  overflow: hidden;
  color: #587586;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-comment-replying {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  width: 100%;
  min-width: 0;
  overflow: hidden;
  box-sizing: border-box;
  min-height: 38px;
  margin: 0 0 8px;
  padding: 6px 9px;
  border: 0;
  border-left: 2px solid #75b8d5;
  border-radius: 0 5px 5px 0;
  background: #f5fafc;
}

.task-comment-replying[hidden] { display: none; }

.task-mention-menu {
  width: 300px;
  max-width: calc(100% - 20px);
  max-height: 156px;
  padding: 4px;
  border-radius: 9px;
}

.task-mention-menu::before {
  position: absolute;
  top: -5px;
  left: 14px;
  width: 9px;
  height: 9px;
  content: "";
  border-top: 1px solid #d5e4ec;
  border-left: 1px solid #d5e4ec;
  background: #fff;
  transform: rotate(45deg);
}

.task-mention-search {
  width: 100%;
  min-height: 30px !important;
  margin: 0 0 4px;
  padding: 5px 7px !important;
  border: 1px solid #d7e5eb;
  border-radius: 6px;
  font-size: .8rem;
}

.task-mention-options { max-height: 112px; overflow: auto; }

.task-mention-option {
  min-height: 32px !important;
  padding: 5px 8px !important;
  gap: 6px;
  justify-content: flex-start !important;
  text-align: left;
  font-size: .86rem;
  line-height: 1.2;
}

.task-mention-option span { font-size: .8rem; }

.task-comment-replying > span { display: flex; flex: 1 1 0; align-items: baseline; gap: 7px; min-width: 0; max-width: 100%; overflow: hidden; }
.task-comment-replying strong { flex: 0 1 auto; min-width: 0; overflow: hidden; color: #176eaa; font-size: .82rem; text-overflow: ellipsis; white-space: nowrap; }
.task-comment-replying span span { flex: 1 1 0; min-width: 0; overflow: hidden; color: #587586; font-size: .82rem; text-overflow: ellipsis; white-space: nowrap; }
.task-reply-cancel { flex: 0 0 26px; min-width: 26px; min-height: 26px; font-size: 20px; }

.task-comment:target .task-comment-bubble,
.task-comment-flash .task-comment-bubble {
  animation: task-comment-highlight 1.8s ease-out;
}

@keyframes task-comment-highlight {
  0% { background: #dff3fb; box-shadow: inset 3px 0 #43a5cf; }
  55% { background: #edf8fc; box-shadow: inset 3px 0 #80c6e2; }
  100% { background: transparent; box-shadow: inset 0 0 transparent; }
}

.task-new-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 26px 0 14px;
  color: #176eaa;
  font-size: .92rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.task-comment-day {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 18px 0 10px;
}

.task-comment-day span {
  padding: 4px 10px;
  border-radius: 999px;
  background: #e7f1f5;
  color: #537487;
  font-size: .76rem;
  font-weight: 700;
}

.task-new-divider span {
  padding: 4px 10px;
  border-radius: 999px;
  background: #e1f1f7;
}

.task-new-divider::before,
.task-new-divider::after {
  height: 1px;
  content: "";
  background: #9cc8dc;
}

.task-new-divider::before {
  flex: 1;
}

.task-new-divider::after {
  flex: 1;
}

.task-comment.is-new .task-comment-bubble {
  box-shadow: 0 0 0 1px #b9e0f0;
}

.task-comment.is-new.is-mine .task-comment-bubble {
  box-shadow: 0 0 0 1px #91cfe8;
}

.task-attachments {
  display: grid;
  gap: 10px;
  margin: 0 0 18px;
  padding: 0;
  list-style: none;
}

/* The attachment heading is meaningful only when at least one file is present. */
.task-detail h2:has(+ .task-attachments:empty),
.task-attachments:empty {
  display: none;
}

.task-attachments li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 13px 14px;
  border: 1px solid #d9e6ec;
  border-radius: 10px;
  background: #fbfdfe;
}

.task-attachment-file {
  display: flex;
  flex: 1 1 auto;
  align-items: flex-start;
  min-width: 0;
  gap: 11px;
  color: inherit;
  text-decoration: none;
}

.task-attachment-file:hover,
.task-attachment-file:focus {
  color: inherit;
  text-decoration: none;
}

.task-attachment-file:hover .task-attachment-info strong,
.task-attachment-file:focus .task-attachment-info strong {
  color: #176eaa;
  text-decoration: underline;
}

.task-attachment-icon {
  display: grid;
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 9px;
  background: #eaf3f7;
  font-size: 1.2rem;
}

.task-attachment-info {
  flex: 1 1 auto;
  min-width: 0;
}

.task-attachment-info strong,
.task-attachment-info span {
  display: block;
}

.task-attachment-info strong {
  overflow: hidden;
  color: #25465b;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-attachment-description {
  margin: 6px 0 0;
  color: #42657a;
  font-size: .88rem;
  line-height: 1.4;
}

.task-attachment-info span {
  margin-top: 3px;
  color: #658095;
  font-size: .83rem;
}

.task-attachment-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  margin-right: 8px;
  gap: 9px;
}

.task-attachment-actions a {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  color: #176eaa;
  font-size: .86rem;
  font-weight: 700;
}

.task-attachment-actions .task-attachment-download {
  display: inline-grid;
  width: 30px;
  min-height: 30px;
  padding: 5px;
  border-radius: 7px;
  place-items: center;
}

.task-attachment-actions .task-attachment-download:hover,
.task-attachment-actions .task-attachment-download:focus {
  background: var(--blue-soft);
  color: var(--blue-dark);
  text-decoration: none;
}

.task-attachment-download .ui-icon {
  width: 18px;
  height: 18px;
}

.task-attachment-delete {
  margin: 0;
}

.task-attachment-actions > .task-attachment-delete {
  position: absolute;
  visibility: hidden;
  pointer-events: none;
}

.task-attachment-delete button {
  min-height: auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: #b45050;
  font-size: .86rem;
  font-weight: 700;
}

.task-attachment-delete-trigger,
.task-template-delete-trigger {
  width: 20px;
  min-height: 20px;
  padding: 0;
  border-radius: 5px;
  color: #b45050;
  font-size: 1.15rem;
  line-height: 1;
}

.task-attachment-delete-trigger:hover,
.task-attachment-delete-trigger:focus,
.task-template-delete-trigger:hover,
.task-template-delete-trigger:focus {
  background: #fff0f0;
  color: #922f37;
}

.modal .task-attachment-delete {
  position: static;
  visibility: visible;
  pointer-events: auto;
}

.modal .task-attachment-delete button {
  min-height: 40px;
  padding: 9px 14px;
  border: 1px solid #a63e46;
  border-radius: 8px;
  background: #b45050;
  color: #fff;
}

.schedule-advanced {
  padding: 12px;
  border: 1px solid #d9e6ec;
  border-radius: 10px;
}

.schedule-advanced summary {
  color: #315c73;
  cursor: pointer;
  font-weight: 700;
}

.schedule-advanced label {
  display: block;
  margin-top: 12px;
}

.schedule-advanced select {
  width: 100%;
  margin-top: 6px;
}

.select2-container {
  margin-top: 6px;
  font-size: .95rem;
}

.task-role-fields .select2-container {
  width: 100% !important;
  margin-top: 7px;
}

/* Select2 replaces the native multiple select after the scripts load. Reserve only
   the final control's height so the option list never flashes on the page. */
.task-role-fields select[multiple]:not(.select2-hidden-accessible) {
  visibility: hidden;
  height: var(--control-height);
  min-height: var(--control-height);
}

.select2-container--default .select2-selection--multiple {
  min-height: 44px;
  padding: 4px 7px;
  border: 1px solid #c9d9e1;
  border-radius: 9px;
  background: #fff;
}

.direct-send-page .select2-container {
  width: 100% !important;
  margin-top: 7px;
}

.direct-send-page .select2-container--default .select2-selection--single {
  height: 44px;
  border: 1px solid var(--control-border);
  border-radius: 9px;
  background: var(--paper);
}

.direct-send-page .select2-container--default .select2-selection--single .select2-selection__rendered {
  padding-left: 11px;
  color: #17364d;
  line-height: 42px;
}

.direct-send-page .select2-container--default .select2-selection--single .select2-selection__arrow {
  height: 42px;
}

.direct-send-page .select2-container--default.select2-container--focus .select2-selection--single,
.direct-send-page .select2-container--default.select2-container--open .select2-selection--single {
  border-color: var(--blue);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--blue) 20%, transparent);
}

.select2-container--default.select2-container--focus .select2-selection--multiple,
.select2-container--default.select2-container--open .select2-selection--multiple {
  border-color: #7da8bb;
  box-shadow: 0 0 0 2px rgba(74, 133, 158, .16);
}

.select2-container--default .select2-selection--multiple .select2-selection__choice {
  display: inline-flex;
  align-items: center;
  box-sizing: border-box;
  min-height: 30px;
  margin: 3px 4px 3px 0;
  padding: 3px 7px;
  border: 0;
  border-radius: 6px;
  background: #edf5f7;
  color: #315c73;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice__remove {
  display: inline-grid;
  position: static;
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  min-height: 0;
  margin: 0 5px 0 0;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #587887;
  line-height: 1;
  place-items: center;
  transform: none;
  box-shadow: none;
  vertical-align: middle;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover,
.select2-container--default .select2-selection--multiple .select2-selection__choice__remove:focus {
  background: #d8eaf0;
  color: #315c73;
  box-shadow: none;
  transform: none;
}

.select2-container--default .select2-search--inline .select2-search__field {
  display: inline-block !important;
  box-sizing: border-box;
  min-width: 14ch !important;
  width: 14ch !important;
  min-height: 30px !important;
  height: 30px !important;
  max-height: 30px;
  margin: 3px 4px 3px 0;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0;
  box-shadow: none !important;
  background: transparent !important;
  color: #315c73;
  cursor: text;
}

.select2-container--default .select2-search--inline .select2-search__field:focus {
  box-shadow: none !important;
  outline: 0;
}

.select2-dropdown {
  overflow: hidden;
  border: 1px solid #c9d9e1;
  border-radius: 9px;
  box-shadow: 0 12px 28px rgba(28, 65, 81, .16);
}

.select2-container--default .select2-search--dropdown .select2-search__field {
  border-color: #c9d9e1;
  border-radius: 6px;
}

.select2-container--default .select2-results__option--highlighted.select2-results__option--selectable {
  background: #315c73;
}

.select2-container--default .select2-results__option--selected {
  background: #edf5f7;
  color: #315c73;
}

.quill-editor {
  overflow: hidden;
  margin-top: 7px;
  border: 1px solid #c9d9e1;
  border-radius: 9px;
  background: #fff;
}

.quill-editor .ql-toolbar.ql-snow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px;
  padding: 7px;
  border: 0;
  border-bottom: 1px solid #dce8ed;
  background: #f8fbfc;
}

.quill-editor .ql-toolbar.ql-snow .ql-formats {
  margin-right: 5px;
}

.quill-editor .ql-snow.ql-toolbar button {
  width: 30px;
  height: 30px;
  min-height: 0;
  padding: 4px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: inherit;
  box-shadow: none;
  display: inline-block;
  transform: none;
}

.quill-editor .ql-snow.ql-toolbar button:hover,
.quill-editor .ql-snow.ql-toolbar button.ql-active {
  border-color: #b8d0db;
  background: #edf5f7;
  box-shadow: none;
  transform: none;
}

.quill-editor .ql-container.ql-snow {
  min-height: 154px;
  border: 0;
  font: inherit;
}

.quill-editor .ql-editor {
  min-height: 154px;
  padding: 12px;
  line-height: 1.55;
}

.quill-editor .ql-editor.ql-blank::before {
  color: #78909d;
  content: 'Введите текст…';
  font-style: normal;
}

/* Keep the source textarea out of sight until Quill replaces it, without a layout shift. */
textarea.wysiwyg-source:not([hidden]) {
  visibility: hidden;
  min-height: 207px;
  resize: none;
}

textarea.wysiwyg-source[hidden] {
  display: none !important;
}

.project-logo {
  width: 29px;
  height: 29px;
  border-radius: 8px;
  object-fit: contain;
  background: #fff;
}

.project-logo-preview {
  max-width: 180px;
  max-height: 80px;
  border: 1px solid #d5e4ec;
  border-radius: 10px;
  padding: 8px;
}

.admin-actions {
  position: relative;
  display: inline-block;
}

.admin-actions summary {
  width: 38px;
  min-height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid #d5e4ec;
  border-radius: 8px;
  color: #315c73;
  cursor: pointer;
  list-style: none;
}

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

.admin-actions > div {
  position: absolute;
  z-index: 10;
  top: 44px;
  right: 0;
  width: min(320px, 78vw);
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid #d2e1e8;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 14px 36px rgba(20, 61, 96, .2);
}

.admin-actions:not([open]) > div {
  display: none;
}

.groups-page > .search-form { margin-bottom: 18px; }
.groups-page .task-header { align-items: center; }
.groups-header-actions { flex: 0 0 auto; }
.groups-table th:last-child, .groups-table td:last-child { width: 1%; text-align: right; }
.groups-header-actions,
.admin-header-actions,
.header-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }

.admin-header { justify-content: flex-start; }
.admin-header-actions { margin-left: auto; }
.groups-table tbody tr { border-bottom: 1px solid var(--line); }
.groups-table tbody tr:last-child { border-bottom: 0; }
.groups-table tbody td { border-bottom: 0 !important; }
.group-form-page { max-width: none; }
.group-editor { display: grid; gap: 18px; margin: 20px 0 0; padding: 20px; border: 1px solid #bdd7e5; border-radius: 12px; background: #f8fcfe; }
.group-editor h2 { margin: 0; }
.group-members { margin: 0; border: 1px solid #d5e4ec; border-radius: 10px; padding: 14px; }
.group-members legend { padding: 0 5px; font-weight: 600; }
.group-members > .muted { margin-top: 0; }
.group-members-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 16px; }
.group-members-list label { margin: 0; padding: 8px; border-radius: 7px; cursor: pointer; }
.group-members-list label:hover { background: #eaf5fa; }
.group-members-list small { color: #637985; }
.group-editor-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
.groups-table-actions { width: 1%; white-space: nowrap; text-align: right !important; vertical-align: middle !important; }
.groups-table-action-buttons { display: inline-flex; align-items: center; justify-content: flex-end; gap: 10px; }
.groups-table-action-buttons form { display: inline-flex; margin: 0; }
.groups-table-action-buttons .icon-action { display: inline-grid; width: 34px; min-height: 34px; margin: 0; padding: 6px; place-items: center; }
.groups-table-action-buttons .icon-action svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.9; }
.groups-table-actions .group-delete-action { color: var(--danger); }
.groups-table-actions .group-delete-action:hover, .groups-table-actions .group-delete-action:focus { background: #fbe9e9; color: #962e35; }

.task-comment-editor.is-invalid .quill-editor .ql-container,
.task-comment-editor.is-invalid textarea { border-color: var(--danger); }
.task-comment-validation { margin: 8px 0 0; }

@media (max-width: 760px) {
  .bar .nav-dropdown-profile > a {
    display: grid;
    width: 42px;
    min-height: 42px;
    max-width: none;
    padding: 4px;
    place-items: center;
  }

  .bar .nav-profile-name { display: none; }

  .bar .nav-profile-avatar {
    display: grid;
    width: 32px;
    height: 32px;
    border: 1px solid rgba(255, 255, 255, .45);
    border-radius: 50%;
    place-items: center;
    object-fit: cover;
    font-size: .72rem;
    font-weight: 700;
  }

  .tasks-card > .task-nav {
    flex-wrap: nowrap;
    gap: 6px;
    overflow-x: auto;
    margin-right: -18px;
    margin-left: -18px;
    padding: 0 18px 8px;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
  }

  .tasks-card > .task-nav > a {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  .task-mobile-search { display: flex; justify-content: flex-end; margin: -2px 0 10px; }
  .task-mobile-search .search-toggle { margin: 0; }

  .task-mobile-columns {
    display: block;
    margin: 0 0 14px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--paper);
  }

  .task-mobile-columns summary {
    display: flex;
    align-items: center;
    min-height: 42px;
    padding: 9px 12px;
    color: var(--blue-dark);
    font-weight: 700;
    cursor: pointer;
  }

  .task-mobile-columns p { margin: 0 12px 9px; color: var(--muted); font-size: .82rem; }
  .task-mobile-columns ul { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 10px; margin: 0; padding: 0 12px 10px; list-style: none; }
  .task-mobile-columns label { display: flex; align-items: center; gap: 6px; min-height: 32px; font-size: .88rem; }
  .task-mobile-columns button { margin: 0 12px 12px; }

  .tasks-card > .task-table { display: block; margin: 0; border-collapse: separate; border-spacing: 0; }
  .tasks-card > .task-table thead { display: none; }
  .tasks-card > .task-table tbody { display: grid; gap: 12px; }
  .tasks-card > .task-table tbody tr {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0;
    padding: 0;
    overflow: visible;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--paper);
    box-shadow: 0 4px 12px rgba(20, 61, 96, .07);
  }

  .tasks-card > .task-table tbody td {
    display: block;
    min-width: 0;
    padding: 10px 12px !important;
    border: 0 !important;
    overflow-wrap: anywhere;
  }

  .tasks-card > .task-table tbody td:not(.task-cell-title)::before {
    display: block;
    margin-bottom: 3px;
    color: var(--muted);
    content: attr(data-mobile-label);
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
  }

  .tasks-card > .task-table tbody .task-cell-title {
    grid-column: 1 / -1;
    padding: 13px 12px 10px !important;
    border-bottom: 1px solid var(--line) !important;
    font-size: 1rem;
  }

  .tasks-card > .task-table tbody .task-cell-title > a:not(.task-cell-link) { font-weight: 700; }
  .tasks-card > .task-table tbody tr.task-deadline-soon,
  .tasks-card > .task-table tbody tr.task-deadline-urgent,
  .tasks-card > .task-table tbody tr.task-deadline-overdue { border-left-width: 4px; }
  .tasks-card > .task-table tbody tr.task-deadline-soon { border-left-color: #d7a400; background: #fff8d8; }
  .tasks-card > .task-table tbody tr.task-deadline-urgent { border-left-color: #e27920; background: #fff0d8; }
  .tasks-card > .task-table tbody tr.task-deadline-overdue { border-left-color: #c63b42; background: #ffe3e3; }
  .tasks-card > .task-table tbody tr.task-deadline-soon td,
  .tasks-card > .task-table tbody tr.task-deadline-urgent td,
  .tasks-card > .task-table tbody tr.task-deadline-overdue td { background: transparent !important; }
  .tasks-card > .task-table tbody tr .task-row-leading { box-shadow: none; }
  .task-executors-tooltip-content { right: auto; left: 0; }

  .guide-page { grid-template-columns: 1fr; }
  .guide-tree { position: static; padding: 16px; }
  .guide-content { min-height: 0; }

  .group-editor-actions { align-items: stretch; flex-direction: column; }
  .group-members-list { grid-template-columns: 1fr; }
  .groups-table-actions { text-align: left !important; }
  .groups-table-action-buttons { justify-content: flex-start; }
}

@media (max-width: 760px) {
  .task-edit-deadlines {
    grid-template-columns: 1fr;
  }

  .modal {
    width: calc(100vw - 28px);
  }

  .modal-panel {
    padding: 18px;
  }

  .modal-heading {
    margin-bottom: 16px;
  }

  .modal-form > button,
  .modal-form > .button,
  .modal-form.row > button {
    width: auto;
    justify-self: end;
  }

  .employee-profile dl {
    grid-template-columns: 1fr;
    gap: 3px;
  }

  .employee-profile dd {
    margin-bottom: 9px;
  }

  .employee-kpi > div {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .task-header {
    align-items: flex-start;
    flex-direction: column;
  }

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

  .task-sidebar {
    position: static;
  }

  .task-attachments li {
    align-items: flex-start;
    flex-direction: column;
  }

  .task-role-fields,
  .schedule-grid,
  .task-form-row {
    grid-template-columns: 1fr;
  }

  .task-meta {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .task-sidebar .task-meta {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .task-meta dd {
    margin-bottom: 10px;
  }
}

@media (max-width: 1100px) {
  .bar {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-areas: 'toggle brand profile';
    gap: 6px 8px;
    position: relative;
    z-index: 120;
    min-height: 66px;
    padding-top: 8px;
    padding-bottom: 8px;
  }

  .bar .brand-lockup {
    grid-area: brand;
    min-width: 0;
    margin-right: 0;
    overflow: hidden;
    white-space: nowrap;
  }

  .nav-toggle {
    display: inline-grid;
    grid-area: toggle;
    width: 42px;
    min-height: 42px;
    padding: 9px;
    place-items: center;
    border: 1px solid #ffffff4a;
    border-radius: 8px;
    background: transparent;
    color: #d9edf6;
    box-shadow: none;
  }

  .nav-toggle:hover,
  .nav-toggle:focus { background: #245a80; color: #fff; transform: none; box-shadow: none; }
  .nav-toggle > span:first-child,
  .nav-toggle > span:first-child::before,
  .nav-toggle > span:first-child::after { display: block; width: 20px; height: 2px; border-radius: 2px; background: currentColor; content: ''; }
  .nav-toggle > span:first-child { position: relative; }
  .nav-toggle > span:first-child::before { position: absolute; top: -6px; left: 0; }
  .nav-toggle > span:first-child::after { position: absolute; top: 6px; left: 0; }

  .bar .primary-nav {
    position: fixed;
    z-index: 110;
    top: 66px;
    left: 0;
    bottom: 0;
    display: block;
    width: min(380px, calc(100vw - 32px));
    min-width: 0;
    padding: 14px;
    overflow-y: auto;
    background: #fff;
    box-shadow: 12px 0 32px rgba(20, 61, 96, .24);
    transform: translateX(-100%);
    transition: transform .2s ease;
  }

  .bar .primary-nav.is-open { transform: translateX(0); }

  .primary-nav-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 0 2px 12px; border-bottom: 1px solid #d5e4ec; color: #17364d; }
  .primary-nav-close { width: 36px; min-height: 36px; padding: 0; border: 0; border-radius: 8px; background: transparent; color: #315c73; font-size: 1.7rem; font-weight: 400; line-height: 1; box-shadow: none; }
  .primary-nav-close:hover,.primary-nav-close:focus { background: #e8f3f7; color: #115e8e; transform: none; box-shadow: none; }

  .primary-nav > a,
  .primary-nav > .nav-dropdown > a { display: block; margin-top: 6px; color: #315c73; font-weight: 700; }
  .primary-nav > a:hover,
  .primary-nav > a:focus,
  .primary-nav > .nav-dropdown > a:hover,
  .primary-nav > .nav-dropdown > a:focus { background: #e8f3f7; color: #115e8e; }

  .primary-nav .nav-dropdown { padding: 0; margin: 0; }
  .primary-nav .nav-dropdown::after { display: none; }
  .primary-nav .nav-dropdown-menu { position: static; min-width: 0; margin: 0 0 4px; padding: 3px 0 4px 12px; border: 0; border-left: 2px solid #d5e4ec; border-radius: 0; box-shadow: none; }
  .primary-nav .nav-dropdown-menu a { padding: 8px 10px; }

  .nav-backdrop { position: fixed; z-index: 100; top: 66px; right: 0; bottom: 0; left: 0; display: block; background: rgba(10, 30, 45, .48); opacity: 0; pointer-events: none; transition: opacity .2s ease; }
  .nav-backdrop.is-open { opacity: 1; pointer-events: auto; }
  body.nav-open { overflow: hidden; }

  .bar .spacer { display: none; }

  .bar .nav-dropdown-profile {
    grid-area: profile;
    justify-self: end;
  }

  .bar .nav-dropdown-profile > a {
    display: block;
    max-width: 46vw;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

@media (max-width: 760px) {
  .bar .nav-dropdown-profile > a {
    display: grid;
    width: 42px;
    min-height: 42px;
    max-width: none;
    padding: 4px;
    place-items: center;
  }
}
