:root {
  color-scheme: light;
  font-family:
    Inter,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  color: #261b37;
  background: #f8f6fb;
  font-synthesis: none;
  --ink: #261b37;
  --muted: #675c74;
  --line: #e8e1ef;
  --soft: #f5f1fa;
  --accent: #6638ce;
  --accent-dark: #5026af;
  --focus: #7646e7;
  --success: #277050;
  --danger: #a42946;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}
[hidden] {
  display: none !important;
}

body {
  min-width: 280px;
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(ellipse at 80% 4%, #eee8f7 0, transparent 40rem), #f8f6fb;
  font-size: 14px;
  line-height: 1.5;
}

button,
input {
  font: inherit;
}
button,
a {
  -webkit-tap-highlight-color: transparent;
}
button {
  cursor: pointer;
}
button:disabled,
button[aria-disabled="true"] {
  cursor: default;
  opacity: 0.54;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}

h1,
h2,
p {
  margin: 0;
}
svg {
  display: block;
  flex: 0 0 auto;
}
.icon-defs {
  position: absolute;
  pointer-events: none;
}
.icon {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.topbar {
  border-bottom: 1px solid #e9e3ef;
  background: #fdfcff;
}

.topbar-inner,
.workspace {
  width: min(calc(100% - 88px), 1320px);
  margin-inline: auto;
}

.topbar-inner {
  min-height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.access-panel {
  max-width: 36rem;
  margin: 24px auto;
  padding: 24px;
}

.access-panel > p {
  margin-block: 8px 16px;
  color: var(--muted);
}

.employee-form {
  display: grid;
  gap: 6px;
}

.employee-form label {
  font-weight: 650;
}

.employee-form input {
  margin-bottom: 8px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: #fff;
}

.employee-form button {
  justify-self: start;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  text-decoration: none;
}
.brand-mark {
  display: grid;
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  place-items: center;
  border: 1px solid #6b43d0;
  border-radius: 9px;
  color: #fff;
  background: linear-gradient(145deg, #8759ed, #5c30c6);
  font-size: 16px;
  font-weight: 750;
}
.brand-mark svg {
  width: 18px;
  height: 18px;
}
.brand-name {
  font-weight: 750;
  font-size: 16px;
  letter-spacing: -0.035em;
}

.environment {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  max-width: 45%;
  border: 1px solid #e7def1;
  border-radius: 999px;
  padding: 4px 10px;
  color: #5b4477;
  background: #f7f1ff;
  font-size: 12px;
  font-weight: 650;
}
.environment > span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.environment-dot {
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  border-radius: 50%;
  background: #8b53e1;
}

.ops-top-actions,
.profile-control,
.workspace-nav {
  display: flex;
  align-items: center;
  gap: 12px;
}
.profile-control {
  color: var(--muted);
  font-size: 12px;
}
.profile-control select {
  max-width: 165px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: #fff;
  font: inherit;
  font-weight: 650;
}
.workspace-nav {
  gap: 6px;
  margin-bottom: 17px;
}
.workspace-nav button {
  padding: 8px 15px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--muted);
  background: transparent;
  font-weight: 650;
}
.workspace-nav button[aria-pressed="true"] {
  border-color: #dfd2f3;
  color: var(--accent-dark);
  background: #eee7fa;
}
.workspace-nav button:hover {
  background: #f0eaf8;
}
#activity-list {
  margin: 0;
  padding: 0 20px 12px;
  list-style: none;
}
.activity-row {
  display: grid;
  gap: 2px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}
.activity-row span {
  color: var(--muted);
  font-size: 12px;
}
@media (max-width: 520px) {
  .profile-control > span {
    display: none;
  }
  .ops-top-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 5px;
  }
  .ops-top-actions .environment {
    max-width: none;
    padding-inline: 7px;
  }
  .profile-control select {
    max-width: 130px;
  }
}

.workspace {
  padding-block: 28px 40px;
}

.hero {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 28px;
  min-height: 160px;
  overflow: hidden;
  padding: 26px 32px;
  border: 1px solid #40226b;
  border-radius: 17px;
  color: #fff;
  background: linear-gradient(110deg, #23143c, #352052 60%, #452769);
  box-shadow: 0 8px 21px #2b144419;
}
.hero::before {
  position: absolute;
  z-index: -1;
  inset: 0;
  background: radial-gradient(ellipse at 82% 10%, #9a60ff33, transparent 49%);
  content: "";
  pointer-events: none;
}
.hero::after {
  position: absolute;
  z-index: -1;
  top: -162px;
  right: -82px;
  width: 490px;
  height: 435px;
  border: 1px solid #d1aaff24;
  border-radius: 42%;
  box-shadow:
    inset 0 0 0 29px #9e6cf415,
    inset 0 0 0 30px #d1aaff22,
    inset 0 0 0 59px #9e6cf417,
    inset 0 0 0 60px #d1aaff22,
    inset 0 0 0 89px #9e6cf415,
    inset 0 0 0 90px #d1aaff22;
  transform: rotate(-31deg);
  content: "";
  pointer-events: none;
}
.hero h1 {
  font-size: clamp(27px, 3vw, 40px);
  line-height: 1.11;
  letter-spacing: -0.045em;
}
.hero p {
  max-width: 64ch;
  margin-top: 10px;
  color: #e1d5ef;
}
.hero-controls {
  display: flex;
  align-items: end;
  justify-content: flex-end;
  gap: 9px;
}
.date-field {
  display: grid;
  gap: 6px;
}
.date-field label {
  color: #f1e8fa;
  font-size: 12px;
  font-weight: 650;
}
.date-field label span {
  margin-inline-start: 4px;
  color: #d6c3ed;
  font-size: 11px;
  font-weight: 550;
}
.date-field input {
  min-width: 0;
  min-height: 40px;
  border: 1px solid #c7a7ec85;
  border-radius: 8px;
  padding: 6px 11px;
  color: #fff;
  background: #31204d;
  color-scheme: dark;
}
.hero :focus-visible {
  outline-color: #d1b0ff;
}
.date-controls {
  display: flex;
  align-items: center;
  gap: 5px;
}

.status-bar {
  display: flex;
  min-height: 53px;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
}
.status-bar strong {
  color: var(--ink);
  font-weight: 650;
}
.status-bar a {
  color: var(--accent-dark);
  font-weight: 650;
}

.board {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.3fr);
  align-items: stretch;
  gap: 20px;
}
.panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 2px 5px #2d174607;
}
.board > .panel {
  display: flex;
  min-height: 440px;
  flex-direction: column;
}
.panel-heading {
  display: flex;
  justify-content: space-between;
  align-items: start;
  flex-wrap: wrap;
  gap: 6px 12px;
  padding: 18px 20px 14px;
}
.panel-heading h2 {
  font-size: 19px;
  line-height: 1.25;
  letter-spacing: -0.025em;
}
.panel-heading p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}
.panel-heading > p {
  flex-basis: 100%;
  margin-top: 0;
}
.count {
  color: var(--muted);
  font-size: 12px;
  font-weight: 630;
}
.panel-heading .count {
  margin-top: 3px;
}

.search-field {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 41px;
  margin: 0 20px 8px;
  padding: 0 10px;
  border: 1px solid #e5deed;
  border-radius: 8px;
  color: #77658b;
  background: #fcfaff;
}
.search-field:focus-within {
  border-color: var(--focus);
  box-shadow: 0 0 0 2px #7646e725;
}
.search-field input {
  width: 100%;
  min-width: 0;
  height: 38px;
  border: 0;
  padding: 0;
  color: var(--ink);
  background: transparent;
  outline: none;
}
.search-field input::placeholder {
  color: #756883;
  opacity: 1;
}
.search-field svg {
  width: 16px;
  height: 16px;
}

.catalog-list,
.rank-list,
.published-list {
  margin: 0;
  padding: 0 20px;
  list-style: none;
}
.catalog-list,
.rank-list {
  min-height: 0;
  max-height: 322px;
  flex: 1;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #d3c2e7 transparent;
  scroll-padding-block: 7px;
}
.catalog-row,
.rank-row,
.published-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 56px;
  border-bottom: 1px solid #efeaf4;
  padding: 7px 0;
}
.catalog-row:last-child,
.rank-row:last-child,
.published-row:last-child {
  border-bottom: 0;
}
.group-icon {
  position: relative;
  display: grid;
  flex: 0 0 35px;
  width: 35px;
  height: 35px;
  place-items: center;
  overflow: hidden;
  border: 1px solid #e6daf6;
  border-radius: 9px;
  color: #6844a5;
  background: linear-gradient(145deg, #f4edfe, #eadcf9);
  font-size: 12px;
  font-weight: 750;
}
.group-avatar {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.group-icon[data-tone="blue"] {
  border-color: #dae2f6;
  color: #3c568f;
  background: #eaf0ff;
}
.group-icon[data-tone="rose"] {
  border-color: #efdce8;
  color: #8a3d64;
  background: #faedf4;
}
.group-icon[data-tone="teal"] {
  border-color: #d1e6e3;
  color: #2b675f;
  background: #e4f3ef;
}
.group-icon[data-tone="amber"] {
  border-color: #efe3d2;
  color: #87532e;
  background: #faf0e3;
}
.group-info {
  min-width: 0;
  flex: 1;
}
.group-info strong,
.group-info .location,
.group-info > span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.group-info strong {
  color: var(--ink);
  font-size: 13px;
  font-weight: 690;
}
.group-info .location,
.group-info > span {
  color: var(--muted);
  font-size: 12px;
}

.button,
.icon-button,
.add-button,
.load-more,
.drag-handle {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-weight: 650;
  text-decoration: none;
  transition:
    background-color 0.15s,
    border-color 0.15s,
    color 0.15s;
}
.button {
  min-height: 39px;
  padding: 7px 13px;
  white-space: nowrap;
}
.button.primary {
  border-color: var(--accent);
  color: #fff;
  background: var(--accent);
}
.button.primary:hover:not(:disabled, [aria-disabled="true"]) {
  border-color: var(--accent-dark);
  background: var(--accent-dark);
}
.button.secondary {
  border-color: #dfd4ec;
  color: #4f366e;
  background: #fff;
}
.button.secondary:hover:not(:disabled, [aria-disabled="true"]) {
  border-color: #c7addf;
  background: var(--soft);
}
.add-button,
.load-more {
  min-height: 33px;
  padding: 4px 9px;
  color: #5a2bb1;
  background: #f2eafb;
  font-size: 12px;
}
.add-button {
  width: 34px;
  flex: 0 0 34px;
  padding: 0;
}
.add-button.is-added {
  opacity: 1;
  color: #6e607c;
  background: #f3f0f6;
}
.add-button:hover:not(:disabled, [aria-disabled="true"]),
.load-more:hover:not(:disabled, [aria-disabled="true"]) {
  border-color: #d8c5f0;
  background: #eadcf8;
}
.add-button svg,
.button svg,
.icon-button svg,
.drag-handle svg {
  width: 16px;
  height: 16px;
}
.icon-button,
.drag-handle {
  width: 31px;
  min-height: 31px;
  flex: 0 0 auto;
  padding: 0;
  color: #685479;
  background: transparent;
}
.icon-button:hover:not(:disabled, [aria-disabled="true"]),
.drag-handle:hover:not(:disabled, [aria-disabled="true"]) {
  color: var(--accent-dark);
  background: var(--soft);
}
.date-controls .icon-button {
  width: 36px;
  min-height: 40px;
  border-color: #c7a7ec85;
  color: #fff;
  background: #31204d;
}
.date-controls .icon-button:hover:not(:disabled, [aria-disabled="true"]) {
  color: #fff;
  background: #543779;
}
.row-actions .remove,
.row-actions [data-action="remove"],
.icon-button.danger {
  color: var(--danger);
}
.row-actions .remove:hover,
.row-actions [data-action="remove"]:hover,
.icon-button.danger:hover {
  color: #8e1935;
  background: #fff0f3;
}

.rank-row {
  gap: 9px;
}
.drag-handle {
  width: 26px;
  cursor: grab;
}
.drag-handle:active {
  cursor: grabbing;
}
.rank-number {
  min-width: 22px;
  color: #746385;
  text-align: center;
  font-variant-numeric: tabular-nums;
  font-size: 13px;
  font-weight: 700;
}
.row-actions,
.button-group,
.dialog-actions {
  display: flex;
  align-items: center;
  justify-content: end;
  gap: 7px;
}
.row-actions {
  flex: 0 0 auto;
  gap: 3px;
}
.rank-row.is-dragging,
.rank-row[aria-grabbed="true"] {
  opacity: 0.55;
}
.rank-row.is-drop-target {
  box-shadow: inset 0 2px var(--focus);
}
.panel-footer,
.draft-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
  border-top: 1px solid var(--line);
  padding: 11px 20px;
}
.panel-footer {
  min-height: 55px;
  justify-content: center;
}
.draft-actions {
  min-height: 61px;
  background: #fcfaff;
  border-radius: 0 0 13px 13px;
}
.draft-info {
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
}
.draft-info strong {
  color: var(--ink);
}

.published {
  margin-top: 20px;
}
.published-list {
  padding-bottom: 7px;
}
.published-row {
  min-height: 44px;
}
.published-row .group-icon {
  flex-basis: 28px;
  width: 28px;
  height: 28px;
  font-size: 10px;
}
.empty-state {
  min-height: 108px;
  display: grid;
  place-content: center;
  gap: 4px;
  margin-block: 9px;
  border: 1px dashed #e2d6ee;
  border-radius: 9px;
  padding: 14px;
  text-align: center;
  color: var(--muted);
  background: #fcfaff;
}
.empty-state strong {
  color: var(--ink);
}
.notice {
  margin-block: 7px;
  border: 1px solid #e3d7f1;
  border-radius: 8px;
  padding: 8px 11px;
  color: #594074;
  background: #f5eefb;
}
.notice.error,
.notice[data-tone="error"] {
  border-color: #f2ccd4;
  color: #8e1935;
  background: #fff2f5;
}
.notice.success,
.notice[data-tone="success"] {
  border-color: #cbe7d7;
  color: var(--success);
  background: #eef9f2;
}
.toast {
  position: fixed;
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 10;
  right: 22px;
  bottom: 22px;
  max-width: min(390px, calc(100vw - 44px));
  border: 1px solid #563c74;
  border-radius: 10px;
  padding: 12px 16px;
  color: #fff;
  background: #34234b;
  box-shadow: 0 5px 20px #29163d3c;
}
.toast:empty {
  display: none;
}
.publish-dialog {
  width: min(calc(100% - 32px), 435px);
  max-width: none;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 24px;
  color: var(--ink);
  background: #fff;
  box-shadow: 0 18px 70px #29163d50;
}
.publish-dialog::backdrop {
  background: #24153b8a;
}
.publish-dialog h2 {
  font-size: 20px;
  line-height: 1.3;
}
.publish-dialog p {
  margin-block: 8px 20px;
  color: var(--muted);
}

@media (max-width: 950px) {
  .topbar-inner,
  .workspace {
    width: calc(100% - 44px);
  }
  .board {
    grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.25fr);
    gap: 14px;
  }
  .panel-heading,
  .panel-footer,
  .draft-actions {
    padding-inline: 14px;
  }
  .catalog-list,
  .rank-list,
  .published-list {
    padding-inline: 14px;
  }
  .search-field {
    margin-inline: 14px;
  }
  .draft-actions {
    align-items: start;
    flex-direction: column;
  }
  .draft-actions .button-group {
    width: 100%;
  }
}

@media (max-width: 700px) {
  .topbar-inner,
  .workspace {
    width: calc(100% - 32px);
  }
  .topbar-inner {
    min-height: 55px;
  }
  .workspace {
    padding-top: 17px;
  }
  .hero {
    grid-template-columns: minmax(0, 1fr);
    gap: 19px;
    padding: 22px 19px;
  }
  .hero-controls {
    justify-content: start;
  }
  .hero::after {
    right: -210px;
  }
  .status-bar {
    min-height: 48px;
  }
  .board {
    grid-template-columns: minmax(0, 1fr);
  }
  .board > .panel {
    min-height: 0;
  }
  .published {
    margin-top: 14px;
  }
}

@media (min-width: 701px) and (max-height: 800px) {
  .workspace {
    padding-top: 18px;
  }
  .hero {
    min-height: 122px;
    padding-block: 18px;
  }
  .board > .panel {
    min-height: 0;
  }
  .catalog-list,
  .rank-list {
    max-height: clamp(140px, calc(100dvh - 465px), 322px);
  }
}

@media (max-width: 380px) {
  .rank-row {
    gap: 5px;
  }
  .row-actions {
    gap: 1px;
  }
  .row-actions .icon-button {
    width: 28px;
  }
  .draft-actions .button-group {
    flex-wrap: wrap;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
