:root {
  color-scheme: light;
  --canvas: #f5f7f8;
  --surface: #ffffff;
  --surface-subtle: #f8fafb;
  --surface-strong: #eef2f3;
  --ink: #172033;
  --ink-soft: #344054;
  --muted: #667085;
  --muted-light: #98a2b3;
  --line: #e4e7ec;
  --line-strong: #d0d5dd;
  --brand: #217a74;
  --brand-dark: #185c57;
  --brand-deep: #123f3d;
  --brand-soft: #e5f3f1;
  --accent: #e8793e;
  --accent-soft: #fff0e7;
  --danger: #b42318;
  --danger-soft: #fef3f2;
  --warning: #8a4b0f;
  --success: #116149;
  --sidebar: #14232a;
  --sidebar-soft: #1d3038;
  --sidebar-line: rgba(255, 255, 255, 0.1);
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.05);
  --shadow-md: 0 14px 36px rgba(16, 24, 40, 0.12);
  --shadow-lg: 0 26px 80px rgba(16, 24, 40, 0.22);
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 18px;
  --focus-ring: 0 0 0 3px rgba(33, 122, 116, 0.24);
  --font-sans: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  min-height: 100%;
  background: var(--canvas);
  -webkit-text-size-adjust: 100%;
}

body {
  min-width: 320px;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  color: var(--ink);
  background: var(--canvas);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

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

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

button {
  border: 0;
}

button:not(:disabled),
select:not(:disabled),
input[type="date"]:not(:disabled),
input[type="range"]:not(:disabled) {
  cursor: pointer;
}

button:disabled,
input:disabled,
select:disabled,
textarea:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

a {
  color: inherit;
  text-decoration: none;
}

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

h1,
h2,
h3,
strong {
  font-weight: 700;
}

button,
a,
input,
select,
textarea,
[tabindex] {
  outline: none;
}

:focus-visible {
  outline: 2px solid var(--brand) !important;
  outline-offset: 2px;
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  border-color: var(--brand) !important;
  box-shadow: var(--focus-ring);
  outline: none !important;
}

::selection {
  color: var(--brand-deep);
  background: #bde5df;
}

::placeholder {
  color: #98a2b3;
  opacity: 1;
}

[hidden] {
  display: none !important;
}

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

.skip-link {
  position: fixed;
  z-index: 10000;
  top: 10px;
  left: 12px;
  padding: 10px 14px;
  color: #fff;
  background: var(--brand-dark);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  transform: translateY(-160%);
  transition: transform 160ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.eyebrow {
  margin-bottom: 6px;
  color: var(--brand);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.3;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.eyebrow-light {
  color: #9ed9d2;
}

/* Shared controls */
.primary-button,
.secondary-button,
.danger-button,
.text-button,
.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  line-height: 1;
  transition: color 160ms ease, background-color 160ms ease, border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.primary-button {
  gap: 8px;
  padding: 0 18px;
  color: #fff;
  background: var(--brand);
  box-shadow: 0 1px 2px rgba(18, 63, 61, 0.22);
}

.primary-button:hover:not(:disabled) {
  background: var(--brand-dark);
  box-shadow: 0 7px 16px rgba(33, 122, 116, 0.2);
  transform: translateY(-1px);
}

.secondary-button {
  gap: 7px;
  padding: 0 15px;
  color: var(--ink-soft);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow-sm);
}

.secondary-button:hover:not(:disabled) {
  color: var(--brand-dark);
  background: var(--brand-soft);
  border-color: #a8d2cd;
}

.danger-button {
  padding: 0 15px;
  color: var(--danger);
  background: var(--danger-soft);
  border: 1px solid #fecdca;
}

.danger-button:hover:not(:disabled) {
  color: #fff;
  background: var(--danger);
  border-color: var(--danger);
}

.text-button {
  min-height: 38px;
  padding: 0 10px;
  color: var(--brand-dark);
  background: transparent;
}

.text-button:hover:not(:disabled) {
  background: var(--brand-soft);
}

.icon-button {
  width: 40px;
  min-width: 40px;
  min-height: 40px;
  padding: 0;
  color: var(--muted);
  background: transparent;
}

.icon-button:hover:not(:disabled) {
  color: var(--ink);
  background: var(--surface-strong);
}

.compact {
  min-height: 40px;
  padding-right: 14px;
  padding-left: 14px;
}

.full-width {
  width: 100%;
}

.field {
  display: grid;
  align-content: start;
  gap: 7px;
  min-width: 0;
}

.field > span {
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 700;
}

.field > span b {
  float: right;
  color: var(--brand);
  font-size: 12px;
}

.field > small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.field input:not([type="range"]),
.field select,
.field textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  transition: border-color 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}

.field textarea {
  min-height: 104px;
  line-height: 1.6;
  resize: vertical;
}

.field input:hover:not(:disabled),
.field select:hover:not(:disabled),
.field textarea:hover:not(:disabled) {
  border-color: #98a2b3;
}

.field input[type="range"] {
  width: 100%;
  min-height: 30px;
  margin: 0;
  accent-color: var(--brand);
}

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

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

.form-alert {
  margin-bottom: 18px;
  padding: 11px 13px;
  color: #8f2018;
  background: var(--danger-soft);
  border: 1px solid #fecdca;
  border-radius: var(--radius-sm);
  font-size: 13px;
}

.form-alert.notice {
  color: var(--brand-dark);
  background: var(--brand-soft);
  border-color: rgba(33, 122, 116, 0.24);
}

.setup-form code {
  padding: 1px 4px;
  color: var(--ink-soft);
  background: var(--surface-strong);
  border-radius: 4px;
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: 0.95em;
}

/* cPanel installer */
.setup-page {
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 93% 8%, rgba(33, 122, 116, 0.08), transparent 24rem),
    radial-gradient(circle at 8% 92%, rgba(232, 121, 62, 0.06), transparent 22rem),
    var(--canvas);
}

.setup-shell {
  display: grid;
  grid-template-columns: minmax(330px, 430px) minmax(560px, 720px);
  align-items: start;
  justify-content: center;
  gap: clamp(32px, 5vw, 76px);
  width: 100%;
  max-width: 1340px;
  min-height: 100vh;
  min-height: 100dvh;
  padding: clamp(32px, 5vw, 72px) clamp(24px, 4vw, 56px);
  margin: 0 auto;
}

.setup-intro {
  position: sticky;
  top: clamp(28px, 5vw, 72px);
  display: flex;
  flex-direction: column;
  min-height: min(670px, calc(100dvh - clamp(56px, 10vw, 144px)));
  padding: clamp(32px, 4vw, 48px);
  overflow: hidden;
  color: #fff;
  background:
    radial-gradient(circle at 90% 8%, rgba(158, 217, 210, 0.2), transparent 30%),
    radial-gradient(circle at 6% 94%, rgba(232, 121, 62, 0.15), transparent 32%),
    linear-gradient(150deg, #142d32 0%, #123f3d 58%, #185c57 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 24px;
  box-shadow: 0 26px 70px rgba(15, 40, 43, 0.2);
}

.setup-intro::before,
.setup-intro::after {
  position: absolute;
  content: "";
  pointer-events: none;
}

.setup-intro::before {
  top: -72px;
  right: -78px;
  width: 250px;
  height: 250px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 50%;
  box-shadow: 0 0 0 42px rgba(255, 255, 255, 0.025), 0 0 0 84px rgba(255, 255, 255, 0.015);
}

.setup-intro::after {
  right: 36px;
  bottom: 26%;
  width: 72px;
  height: 2px;
  background: rgba(158, 217, 210, 0.4);
  border-radius: 999px;
}

.setup-intro .product-mark {
  position: relative;
  z-index: 1;
  margin-bottom: clamp(70px, 12vh, 130px);
  color: #fff;
}

.setup-intro .product-mark > span {
  color: var(--brand-deep);
  background: #a9e0d8;
}

.setup-intro > .eyebrow,
.setup-intro h1,
.setup-intro > p,
.setup-note {
  position: relative;
  z-index: 1;
}

.setup-intro > .eyebrow {
  margin-bottom: 12px;
  color: #9ed9d2;
}

.setup-intro h1 {
  max-width: 390px;
  margin-bottom: 20px;
  font-size: clamp(38px, 4vw, 56px);
  line-height: 1.14;
  letter-spacing: -0.045em;
}

.setup-intro > p:not(.eyebrow) {
  max-width: 360px;
  margin-bottom: 30px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 14px;
  line-height: 1.8;
}

.setup-note {
  display: grid;
  gap: 5px;
  padding: 15px 16px;
  margin-top: auto;
  color: rgba(255, 255, 255, 0.7);
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  backdrop-filter: blur(8px);
}

.setup-note strong {
  color: #bde5df;
  font-size: 11px;
  letter-spacing: 0.04em;
}

.setup-note span {
  font-size: 11px;
  line-height: 1.65;
}

.setup-card {
  width: 100%;
  max-width: 720px;
  padding: clamp(28px, 4vw, 42px);
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(228, 231, 236, 0.96);
  border-radius: 22px;
  box-shadow: 0 22px 65px rgba(16, 24, 40, 0.1);
}

.setup-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 22px;
  margin-bottom: 22px;
  border-bottom: 1px solid var(--line);
}

.setup-heading h2,
.setup-card > h2 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(24px, 3vw, 30px);
  line-height: 1.25;
  letter-spacing: -0.025em;
}

.setup-badge {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  color: var(--brand-dark);
  background: var(--brand-soft);
  border: 1px solid #c8e4e0;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.requirements {
  margin-bottom: 26px;
  overflow: hidden;
  background: var(--surface-subtle);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.requirements summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 50px;
  padding: 0 15px;
  color: var(--ink-soft);
  background: var(--surface-subtle);
  font-size: 12px;
  font-weight: 750;
  list-style: none;
  cursor: pointer;
  user-select: none;
}

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

.requirements summary::before {
  display: grid;
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  margin-right: -7px;
  color: var(--muted);
  content: "+";
  background: var(--surface-strong);
  border-radius: 6px;
  font-size: 14px;
  place-items: center;
}

.requirements[open] summary::before {
  content: "−";
}

.requirements summary strong {
  margin-left: auto;
  color: var(--success);
  font-size: 10px;
}

.requirements[open] summary {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.requirements ul {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 14px;
  padding: 14px 15px;
  margin: 0;
  list-style: none;
}

.requirements li {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}

.requirements li > span {
  display: grid;
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  font-size: 9px;
  font-weight: 900;
  place-items: center;
}

.requirements li.passed > span {
  color: var(--success);
  background: #e3f4ee;
}

.requirements li.failed {
  color: var(--danger);
  font-weight: 700;
}

.requirements li.failed > span {
  color: var(--danger);
  background: var(--danger-soft);
  border: 1px solid #fecdca;
}

.requirements .field-help {
  padding: 11px 15px 13px;
  margin: 0;
  color: #7a4709;
  background: #fff8e8;
  border-top: 1px solid #f5dfaa;
  font-size: 10px;
  line-height: 1.6;
}

.setup-form {
  display: grid;
  gap: 0;
}

.setup-form fieldset {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 17px 16px;
  min-width: 0;
  padding: 0 0 25px;
  margin: 0 0 25px;
  border: 0;
  border-bottom: 1px solid var(--line);
}

.setup-form legend {
  grid-column: 1 / -1;
  width: 100%;
  padding: 0;
  margin-bottom: 16px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

.setup-form .field > small {
  margin-top: -2px;
}

.setup-form > .primary-button {
  min-height: 50px;
  margin-top: 2px;
  font-size: 14px;
}

.setup-form > .primary-button span,
.setup-card > .primary-button span {
  margin-left: auto;
  font-size: 17px;
}

.form-caption {
  max-width: 520px;
  margin: 12px auto 0;
  color: var(--muted-light);
  font-size: 10px;
  line-height: 1.6;
  text-align: center;
}

.success-icon {
  display: grid;
  width: 68px;
  height: 68px;
  margin: clamp(22px, 6vh, 64px) auto 24px;
  color: #fff;
  background: var(--brand);
  border: 8px solid var(--brand-soft);
  border-radius: 50%;
  box-shadow: 0 0 0 1px #b8dcd7;
  font-size: 24px;
  font-weight: 900;
  place-items: center;
}

.success-icon ~ .eyebrow,
.success-icon ~ h2,
.success-icon ~ p {
  text-align: center;
}

.success-icon ~ .eyebrow {
  margin-bottom: 8px;
}

.success-icon ~ h2 {
  margin-bottom: 12px;
}

.success-icon ~ p:not(.eyebrow) {
  max-width: 430px;
  margin: 0 auto 28px;
  color: var(--muted);
  line-height: 1.7;
}

.setup-card > .primary-button {
  max-width: 430px;
  min-height: 50px;
  margin: 0 auto clamp(22px, 6vh, 64px);
}

@media (max-width: 980px) {
  .setup-shell {
    grid-template-columns: minmax(270px, 340px) minmax(450px, 1fr);
    gap: 26px;
    padding: 28px;
  }

  .setup-intro {
    top: 28px;
    min-height: calc(100dvh - 56px);
    padding: 30px;
  }

  .setup-intro .product-mark {
    margin-bottom: 80px;
  }

  .setup-intro h1 {
    font-size: 38px;
  }

  .setup-card {
    padding: 28px;
  }
}

@media (max-width: 820px) {
  .setup-shell {
    display: block;
    max-width: 720px;
    padding: 24px;
  }

  .setup-intro {
    position: relative;
    top: auto;
    min-height: 350px;
    margin-bottom: 24px;
  }

  .setup-intro .product-mark {
    margin-bottom: 56px;
  }

  .setup-note {
    margin-top: 20px;
  }

  .setup-card {
    max-width: none;
  }
}

@media (max-width: 760px) {
  .setup-page {
    background: var(--canvas);
  }

  .setup-shell {
    width: 100%;
    max-width: none;
    padding: 0 0 24px;
  }

  .setup-intro {
    min-height: 330px;
    padding: 24px 22px 46px;
    margin: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .setup-intro .product-mark {
    margin-bottom: 44px;
  }

  .setup-intro h1 {
    margin-bottom: 14px;
    font-size: clamp(32px, 10vw, 42px);
  }

  .setup-intro > p:not(.eyebrow) {
    margin-bottom: 18px;
    font-size: 13px;
  }

  .setup-note {
    display: none;
  }

  .setup-card {
    position: relative;
    width: auto;
    padding: 24px 18px 28px;
    margin: -24px 12px 0;
    border-radius: 18px;
    box-shadow: 0 16px 44px rgba(16, 24, 40, 0.12);
  }

  .setup-heading {
    gap: 12px;
    padding-bottom: 18px;
    margin-bottom: 18px;
  }

  .setup-heading h2,
  .setup-card > h2 {
    font-size: 24px;
  }

  .setup-badge {
    min-height: 27px;
    padding: 0 8px;
    font-size: 9px;
  }

  .requirements {
    margin-bottom: 22px;
  }

  .requirements summary {
    min-height: 48px;
  }

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

  .setup-form fieldset {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
    padding-bottom: 22px;
    margin-bottom: 22px;
  }

  .setup-form legend {
    margin-bottom: 14px;
  }

  .setup-form .field input:not([type="range"]),
  .setup-form .field select {
    min-height: 46px;
  }

  .success-icon {
    margin-top: 28px;
  }

  .setup-card > .primary-button {
    margin-bottom: 28px;
  }
}

/* Login */
.login-page {
  overflow-x: hidden;
  background: var(--surface);
}

.login-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(420px, 0.88fr);
  min-height: 100vh;
  min-height: 100dvh;
}

.login-story {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 100%;
  padding: clamp(30px, 5vw, 72px);
  overflow: hidden;
  color: #fff;
  background:
    radial-gradient(circle at 82% 18%, rgba(104, 202, 189, 0.2), transparent 28%),
    radial-gradient(circle at 7% 92%, rgba(232, 121, 62, 0.13), transparent 28%),
    linear-gradient(145deg, #142d32 0%, #123f3d 56%, #185c57 100%);
}

.login-story::before,
.login-story::after {
  position: absolute;
  content: "";
  pointer-events: none;
}

.login-story::before {
  top: 10%;
  right: -11%;
  width: 340px;
  aspect-ratio: 1;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  box-shadow: 0 0 0 48px rgba(255, 255, 255, 0.025), 0 0 0 96px rgba(255, 255, 255, 0.018);
}

.login-story::after {
  bottom: 24%;
  left: 7%;
  width: 90px;
  height: 1px;
  background: rgba(255, 255, 255, 0.2);
}

.product-mark {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 11px;
  width: fit-content;
  color: #fff;
}

.product-mark > span {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  color: #fff;
  background: var(--brand);
  border-radius: 10px 10px 10px 3px;
  font-size: 16px;
  font-weight: 800;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.product-mark > strong {
  font-size: 18px;
  letter-spacing: 0.02em;
}

.product-mark-light > span {
  color: var(--brand-deep);
  background: #a9e0d8;
}

.login-copy {
  position: relative;
  z-index: 1;
  width: min(650px, 90%);
  margin: 8vh 0 7vh;
}

.login-copy h1 {
  margin-bottom: 22px;
  font-size: clamp(38px, 5vw, 68px);
  line-height: 1.12;
  letter-spacing: -0.045em;
}

.login-copy h1 em {
  color: #a9e0d8;
  font-style: normal;
}

.login-copy > p:last-child {
  max-width: 560px;
  margin-bottom: 0;
  color: rgba(255, 255, 255, 0.72);
  font-size: 16px;
  line-height: 1.8;
}

.login-preview {
  position: relative;
  z-index: 1;
  width: min(620px, 92%);
  padding: 10px;
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 18px;
  box-shadow: 0 28px 70px rgba(3, 23, 25, 0.26);
  backdrop-filter: blur(12px);
}

.preview-toolbar {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 38px;
  padding: 0 8px;
  color: rgba(255, 255, 255, 0.68);
  font-size: 11px;
}

.preview-toolbar i {
  width: 7px;
  height: 7px;
  background: rgba(255, 255, 255, 0.32);
  border-radius: 50%;
}

.preview-toolbar span {
  margin-left: 7px;
}

.preview-grid {
  overflow: hidden;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.96);
  border-radius: 11px;
}

.preview-grid > div {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 53px;
  padding: 8px 14px;
  border-bottom: 1px solid var(--line);
}

.preview-grid > div:last-child {
  border-bottom: 0;
}

.preview-grid strong {
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.preview-check,
.preview-avatar,
.preview-dot {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  color: var(--success);
  background: #e3f4ee;
  border-radius: 50%;
  font-size: 10px;
  font-style: normal;
  font-weight: 800;
}

.preview-avatar {
  color: #fff;
  background: #5b5bd6;
}

.preview-dot {
  width: 9px;
  height: 9px;
  margin-left: 7px;
  background: var(--muted-light);
}

.chip,
.priority-pill,
.role-pill,
.overdue-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}

.chip-review {
  color: #7a4709;
  background: #fff0ca;
}

.chip-working {
  color: #175cd3;
  background: #eaf2ff;
}

.chip-backlog {
  color: #475467;
  background: #edf0f3;
}

.login-footnote {
  position: relative;
  z-index: 1;
  margin: 26px 0 0;
  color: rgba(255, 255, 255, 0.48);
  font-size: 12px;
  letter-spacing: 0.04em;
}

.login-panel {
  display: grid;
  min-height: 100%;
  padding: clamp(28px, 6vw, 84px);
  place-items: center;
  background:
    radial-gradient(circle at 100% 0%, rgba(33, 122, 116, 0.06), transparent 30%),
    var(--surface);
}

.login-card {
  width: min(100%, 430px);
}

.login-card h2 {
  margin-bottom: 10px;
  color: var(--ink);
  font-size: clamp(26px, 3vw, 34px);
  line-height: 1.25;
  letter-spacing: -0.025em;
}

.login-subtitle {
  margin-bottom: 30px;
  color: var(--muted);
}

.login-form {
  display: grid;
  gap: 18px;
}

.login-form .primary-button {
  min-height: 48px;
  margin-top: 4px;
}

.login-form .primary-button span {
  margin-left: auto;
  font-size: 18px;
}

.login-help {
  margin: 22px 0 0;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

/* Application shell */
.app-page {
  overflow: hidden;
}

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

.sidebar {
  position: relative;
  z-index: 30;
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: 100vh;
  height: 100dvh;
  padding: 20px 14px 14px;
  overflow: hidden;
  color: rgba(255, 255, 255, 0.84);
  background:
    radial-gradient(circle at 18% 0%, rgba(69, 156, 147, 0.2), transparent 28%),
    var(--sidebar);
  border-right: 1px solid rgba(0, 0, 0, 0.12);
}

.sidebar-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 44px;
  padding: 0 7px;
  margin-bottom: 18px;
}

.sidebar .product-mark > span {
  width: 32px;
  height: 32px;
  border-radius: 9px 9px 9px 3px;
  font-size: 14px;
  box-shadow: none;
}

.sidebar .product-mark > strong {
  font-size: 16px;
}

.sidebar-close,
.mobile-menu {
  display: none;
}

.sidebar .icon-button {
  color: rgba(255, 255, 255, 0.62);
}

.sidebar .icon-button:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.09);
}

.workspace-switcher {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  min-height: 58px;
  padding: 10px;
  margin-bottom: 20px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--sidebar-line);
  border-radius: 11px;
}

.workspace-icon {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  color: #bde5df;
  background: rgba(158, 217, 210, 0.12);
  border-radius: 8px;
  font-size: 12px;
  font-weight: 800;
}

.workspace-switcher div {
  min-width: 0;
}

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

.workspace-switcher small {
  margin-bottom: 2px;
  color: rgba(255, 255, 255, 0.46);
  font-size: 10px;
}

.workspace-switcher strong {
  color: #fff;
  font-size: 12px;
}

.workspace-switcher > button {
  width: 24px;
  height: 28px;
  padding: 0;
  color: rgba(255, 255, 255, 0.45);
  background: transparent;
  border-radius: 6px;
}

.main-nav {
  display: grid;
  gap: 4px;
  margin-bottom: 22px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  color: rgba(255, 255, 255, 0.66);
  background: transparent;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 650;
  text-align: left;
  transition: color 150ms ease, background-color 150ms ease;
}

.nav-item > span {
  display: grid;
  width: 20px;
  color: rgba(255, 255, 255, 0.42);
  place-items: center;
  font-size: 14px;
}

.nav-item:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.055);
}

.nav-item.active {
  color: #fff;
  background: rgba(142, 213, 203, 0.14);
  box-shadow: inset 3px 0 0 #80cfc4;
}

.nav-item.active > span {
  color: #a9e0d8;
}

.project-nav-section {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
}

.sidebar-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 30px;
  padding: 0 9px;
  margin-bottom: 5px;
  color: rgba(255, 255, 255, 0.39);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.sidebar-label button {
  display: grid;
  width: 28px;
  height: 28px;
  padding: 0;
  color: rgba(255, 255, 255, 0.58);
  background: transparent;
  border-radius: 7px;
  font-size: 18px;
  place-items: center;
}

.sidebar-label button:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.project-nav {
  min-height: 0;
  overflow-y: auto;
  scrollbar-color: rgba(255, 255, 255, 0.18) transparent;
  scrollbar-width: thin;
}

.project-nav-item {
  display: grid;
  grid-template-columns: 9px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 38px;
  padding: 0 10px;
  color: rgba(255, 255, 255, 0.61);
  background: transparent;
  border-radius: 8px;
  font-size: 12px;
  text-align: left;
}

.project-nav-item:hover,
.project-nav-item.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.07);
}

.project-nav-item i {
  width: 8px;
  height: 8px;
  background: var(--project-color, var(--brand));
  border-radius: 3px;
}

.project-nav-item span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-nav-item small {
  color: rgba(255, 255, 255, 0.34);
  font-size: 10px;
}

.sidebar-empty {
  padding: 12px 10px;
  color: rgba(255, 255, 255, 0.34);
  font-size: 12px;
}

.sidebar-tip {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 11px;
  margin: 14px 0;
  color: rgba(255, 255, 255, 0.62);
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.065);
  border-radius: 10px;
}

.sidebar-tip > span {
  color: #9ed9d2;
}

.sidebar-tip strong,
.sidebar-tip small {
  display: block;
}

.sidebar-tip strong {
  margin-bottom: 2px;
  color: rgba(255, 255, 255, 0.8);
  font-size: 11px;
}

.sidebar-tip small {
  color: rgba(255, 255, 255, 0.38);
  font-size: 10px;
  line-height: 1.5;
}

.user-menu {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 36px;
  align-items: center;
  gap: 9px;
  min-height: 56px;
  padding: 9px 8px 0;
  border-top: 1px solid var(--sidebar-line);
}

.user-menu > div {
  min-width: 0;
}

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

.user-menu strong {
  color: #fff;
  font-size: 12px;
}

.user-menu small {
  color: rgba(255, 255, 255, 0.37);
  font-size: 9px;
}

.avatar {
  display: inline-grid;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  color: #fff;
  background: var(--avatar-color, #667085);
  border: 2px solid rgba(255, 255, 255, 0.32);
  border-radius: 50%;
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
  place-items: center;
}

.avatar.small {
  width: 28px;
  height: 28px;
  border-width: 1px;
  font-size: 9px;
}

.avatar.large {
  width: 50px;
  height: 50px;
  border: 0;
  font-size: 15px;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.06);
}

.sidebar-backdrop {
  position: fixed;
  z-index: 25;
  inset: 0;
  background: rgba(9, 18, 24, 0.5);
  backdrop-filter: blur(2px);
}

.app-main {
  min-width: 0;
  height: 100vh;
  height: 100dvh;
  overflow: auto;
  scrollbar-color: #c5cbd3 transparent;
  scrollbar-width: thin;
}

.topbar {
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 68px;
  padding: 10px clamp(20px, 2.6vw, 40px);
  background: rgba(255, 255, 255, 0.9);
  border-bottom: 1px solid rgba(228, 231, 236, 0.92);
  backdrop-filter: blur(14px);
}

.topbar-title {
  display: flex;
  align-items: center;
  min-width: 0;
}

.topbar-title p {
  margin-bottom: 1px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.topbar-title h1 {
  max-width: min(36vw, 420px);
  margin-bottom: 0;
  overflow: hidden;
  font-size: 18px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 9px;
}

.global-search {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) 24px;
  align-items: center;
  width: clamp(210px, 20vw, 320px);
  height: 42px;
  padding: 0 9px 0 12px;
  color: var(--muted);
  background: var(--surface-subtle);
  border: 1px solid var(--line);
  border-radius: 10px;
  transition: background-color 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.global-search:focus-within {
  background: var(--surface);
  border-color: var(--brand);
  box-shadow: var(--focus-ring);
}

.global-search input {
  width: 100%;
  min-width: 0;
  padding: 0 7px;
  background: transparent;
  border: 0;
}

.global-search input:focus-visible {
  box-shadow: none;
  outline: none !important;
}

.global-search kbd {
  display: grid;
  width: 23px;
  height: 23px;
  color: var(--muted);
  background: #fff;
  border: 1px solid var(--line);
  border-bottom-color: var(--line-strong);
  border-radius: 6px;
  font-family: inherit;
  font-size: 10px;
  place-items: center;
}

.topbar-filter {
  display: none;
}

.topbar-filter > span {
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  color: #fff;
  background: var(--brand);
  border-radius: 999px;
  font-size: 10px;
  line-height: 20px;
}

#mainContent {
  width: 100%;
  max-width: 1660px;
  min-height: calc(100vh - 68px);
  min-height: calc(100dvh - 68px);
  padding: 28px clamp(20px, 2.6vw, 40px) 52px;
  margin: 0 auto;
}

.view {
  min-width: 0;
  animation: view-in 220ms ease both;
}

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

/* Loading and empty states */
.loading-state {
  display: grid;
  min-height: calc(100vh - 160px);
  min-height: calc(100dvh - 160px);
  color: var(--muted);
  place-content: center;
  place-items: center;
  text-align: center;
}

.loading-state > span:not(.error-mark) {
  width: 32px;
  height: 32px;
  margin-bottom: 12px;
  border: 3px solid #d9e6e4;
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 750ms linear infinite;
}

.loading-state p {
  margin: 0;
  font-size: 13px;
}

.error-mark {
  display: grid;
  width: 38px;
  height: 38px;
  margin-bottom: 12px;
  color: var(--danger);
  background: var(--danger-soft);
  border-radius: 50%;
  font-weight: 800;
  place-items: center;
}

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

.empty-state {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 12px;
  min-height: 110px;
  padding: 24px;
  color: var(--muted);
}

.empty-state > span {
  display: grid;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  color: var(--brand);
  background: var(--brand-soft);
  border-radius: 9px;
  place-items: center;
}

.empty-state strong {
  display: block;
  margin: 1px 0 3px;
  color: var(--ink-soft);
}

.empty-state p {
  margin: 0;
  font-size: 12px;
}

.large-empty {
  display: grid;
  min-height: min(620px, calc(100dvh - 150px));
  padding: 48px 20px;
  color: var(--muted);
  place-content: center;
  place-items: center;
  text-align: center;
}

.large-empty > span {
  display: grid;
  width: 64px;
  height: 64px;
  margin-bottom: 18px;
  color: var(--brand);
  background: var(--brand-soft);
  border-radius: 18px;
  font-size: 24px;
  place-items: center;
}

.large-empty h2 {
  margin-bottom: 7px;
  color: var(--ink);
  font-size: 24px;
}

.large-empty p {
  margin-bottom: 22px;
}

/* Dashboard */
.welcome-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

.welcome-row h2,
.board-header h2,
.team-header h2 {
  margin-bottom: 5px;
  color: var(--ink);
  font-size: clamp(24px, 2.4vw, 32px);
  line-height: 1.22;
  letter-spacing: -0.025em;
}

.welcome-row > div > p:last-child,
.board-heading-copy > div > p:last-child,
.team-header > div > p:last-child {
  margin-bottom: 0;
  color: var(--muted);
}

.welcome-row time {
  flex: 0 0 auto;
  padding: 7px 11px;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 12px;
  box-shadow: var(--shadow-sm);
}

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

.metric-card {
  position: relative;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  grid-template-rows: auto auto auto;
  gap: 0 12px;
  min-height: 132px;
  padding: 18px;
  overflow: hidden;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  text-align: left;
  transition: border-color 170ms ease, box-shadow 170ms ease, transform 170ms ease;
}

.metric-card::after {
  position: absolute;
  right: -20px;
  bottom: -32px;
  width: 86px;
  height: 86px;
  content: "";
  background: var(--brand-soft);
  border-radius: 50%;
  opacity: 0.42;
}

.metric-card:hover {
  border-color: #b9d8d4;
  box-shadow: 0 12px 28px rgba(16, 24, 40, 0.08);
  transform: translateY(-2px);
}

.metric-card small {
  align-self: end;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.metric-card strong {
  align-self: center;
  margin: 2px 0;
  font-size: 29px;
  line-height: 1.15;
  letter-spacing: -0.03em;
}

.metric-card em {
  color: var(--muted-light);
  font-size: 10px;
  font-style: normal;
}

.metric-icon {
  display: grid;
  grid-row: 1 / 4;
  width: 42px;
  height: 42px;
  color: var(--brand-dark);
  background: var(--brand-soft);
  border-radius: 11px;
  font-size: 14px;
  place-items: center;
}

.metric-indigo {
  color: #4141a5;
  background: #eeeeff;
}

.metric-blue {
  color: #175cd3;
  background: #eaf2ff;
}

.metric-coral {
  color: #a43b15;
  background: var(--accent-soft);
}

.metric-green {
  color: var(--success);
  background: #e3f4ee;
}

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

.panel {
  min-width: 0;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.panel-focus,
.panel-activity {
  grid-column: span 7;
}

.panel-progress,
.panel-status {
  grid-column: span 5;
}

.panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  min-height: 45px;
  margin-bottom: 10px;
}

.panel-heading h3 {
  margin: 0;
  color: var(--ink);
  font-size: 17px;
}

.panel-heading button {
  padding: 7px 4px;
  color: var(--brand-dark);
  background: transparent;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
}

.panel-heading button:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.focus-list,
.project-progress-list,
.activity-list {
  display: grid;
}

.focus-item {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto minmax(70px, auto);
  align-items: center;
  gap: 11px;
  width: 100%;
  min-height: 58px;
  padding: 8px 7px;
  color: inherit;
  background: transparent;
  border-top: 1px solid var(--line);
  text-align: left;
}

.focus-item:hover {
  background: var(--surface-subtle);
}

.focus-status,
.task-check,
.kanban-status,
.mobile-task-top > i {
  display: grid;
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 10px;
  font-style: normal;
  font-weight: 800;
  place-items: center;
}

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

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

.focus-copy strong {
  color: var(--ink-soft);
  font-size: 13px;
}

.focus-copy small {
  margin-top: 2px;
  color: var(--muted-light);
  font-size: 10px;
}

.focus-date {
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.overdue,
.focus-date.overdue,
.cell-date.overdue,
.kanban-card time.overdue {
  color: var(--danger) !important;
  font-weight: 700;
}

.project-progress-item {
  display: grid;
  grid-template-columns: 9px minmax(90px, 1fr) minmax(80px, 1.2fr) 36px;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 64px;
  padding: 9px 5px;
  color: inherit;
  background: transparent;
  border-top: 1px solid var(--line);
  text-align: left;
}

.project-progress-item:hover {
  background: var(--surface-subtle);
}

.project-dot {
  width: 8px;
  height: 28px;
  background: var(--project-color, var(--brand));
  border-radius: 4px;
}

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

.project-progress-item strong {
  color: var(--ink-soft);
  font-size: 12px;
}

.project-progress-item small {
  margin-top: 2px;
  color: var(--muted-light);
  font-size: 10px;
}

.mini-progress,
.progress-track,
.row-progress > span {
  display: block;
  height: 7px;
  overflow: hidden;
  background: var(--surface-strong);
  border-radius: 999px;
}

.mini-progress i,
.progress-track i,
.row-progress i {
  display: block;
  height: 100%;
  background: var(--project-color, var(--brand));
  border-radius: inherit;
}

.project-progress-item > b {
  color: var(--muted);
  font-size: 11px;
  text-align: right;
}

.status-chart {
  display: grid;
  gap: 16px;
  padding: 12px 4px 4px;
}

.chart-row {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) 28px;
  align-items: center;
  gap: 10px;
}

.chart-row > span,
.chart-row > strong {
  color: var(--muted);
  font-size: 11px;
}

.chart-row > strong {
  text-align: right;
}

.chart-row > div {
  height: 9px;
  overflow: hidden;
  background: var(--surface-strong);
  border-radius: 999px;
}

.chart-row > div > i {
  display: block;
  min-width: 3px;
  height: 100%;
  border-radius: inherit;
}

.activity-item {
  position: relative;
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 11px;
  min-height: 57px;
  padding: 9px 6px;
  border-top: 1px solid var(--line);
}

.activity-avatar {
  display: grid;
  width: 30px;
  height: 30px;
  color: var(--brand-dark);
  background: var(--brand-soft);
  border-radius: 9px;
  font-size: 9px;
  font-weight: 800;
  place-items: center;
}

.activity-item p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.activity-item p strong {
  color: var(--ink-soft);
}

.activity-item small {
  display: block;
  margin-top: 2px;
  color: var(--muted-light);
  font-size: 10px;
}

/* Shared statuses and priorities */
.status-backlog {
  color: #475467 !important;
  background-color: #edf0f3 !important;
}

.status-working {
  color: #175cd3 !important;
  background-color: #eaf2ff !important;
}

.status-review {
  color: #7a4709 !important;
  background-color: #fff0ca !important;
}

.status-done {
  color: var(--success) !important;
  background-color: #e3f4ee !important;
}

.priority-low {
  color: #475467 !important;
  background-color: #f0f2f4 !important;
}

.priority-medium {
  color: #315e78 !important;
  background-color: #e8f3f7 !important;
}

.priority-high {
  color: #9a4a10 !important;
  background-color: #fff0df !important;
}

.priority-urgent {
  color: #9b241c !important;
  background-color: #fee9e7 !important;
}

.overdue-tag {
  color: var(--danger);
  background: var(--danger-soft);
  border: 1px solid #fecdca;
}

/* Project workspace */
.board-header,
.team-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 20px;
}

.board-heading-copy {
  display: flex;
  align-items: flex-start;
  min-width: 0;
  gap: 13px;
}

.board-heading-copy > div:last-child {
  min-width: 0;
}

.board-color {
  flex: 0 0 auto;
  width: 9px;
  height: 58px;
  margin-top: 2px;
  background: var(--project-color, var(--brand));
  border-radius: 6px;
}

.breadcrumb {
  margin-bottom: 3px;
  color: var(--muted-light);
  font-size: 10px;
  font-weight: 700;
}

.board-header h2 {
  max-width: min(62vw, 800px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.board-heading-copy > div > p:last-child {
  max-width: 720px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.board-progress-summary {
  display: grid;
  flex: 0 0 180px;
  gap: 8px;
}

.board-progress-summary > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-align: right;
}

.progress-track {
  height: 8px;
}

.progress-track i {
  background: var(--brand);
  transition: width 260ms ease;
}

.board-toolbar {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 11px;
  margin-bottom: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.view-switch {
  display: inline-flex;
  flex: 0 0 auto;
  padding: 3px;
  background: var(--surface-strong);
  border-radius: 9px;
}

.view-switch button {
  min-height: 34px;
  padding: 0 12px;
  color: var(--muted);
  background: transparent;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 700;
}

.view-switch button:hover {
  color: var(--ink-soft);
}

.view-switch button.active {
  color: var(--brand-dark);
  background: var(--surface);
  box-shadow: 0 1px 3px rgba(16, 24, 40, 0.12);
}

.filter-bar {
  display: flex;
  flex: 1;
  flex-wrap: wrap;
  align-items: end;
  gap: 8px;
  min-width: 0;
}

.filter-bar label {
  display: grid;
  gap: 3px;
}

.filter-bar label > span {
  padding-left: 2px;
  color: var(--muted-light);
  font-size: 9px;
  font-weight: 700;
}

.filter-bar select {
  min-width: 116px;
  height: 38px;
  padding: 0 29px 0 10px;
  color: var(--ink-soft);
  background-color: var(--surface-subtle);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 11px;
}

.board-panel {
  min-width: 0;
}

.task-group {
  margin-bottom: 22px;
}

.group-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 42px;
  padding: 0 7px;
}

.group-heading > div {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 9px;
}

.group-heading i {
  width: 7px;
  height: 27px;
  background: var(--group-color, var(--brand));
  border-radius: 4px;
}

.group-heading h3 {
  max-width: min(55vw, 720px);
  margin: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.group-heading > div > span {
  display: grid;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  color: var(--muted);
  background: var(--surface-strong);
  border-radius: 999px;
  font-size: 10px;
  place-items: center;
}

.task-table-wrapper {
  overflow-x: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius) var(--radius) 0 0;
  box-shadow: var(--shadow-sm);
  scrollbar-color: #c5cbd3 transparent;
  scrollbar-width: thin;
}

.task-table {
  width: 100%;
  min-width: 1020px;
  border-spacing: 0;
  border-collapse: separate;
  table-layout: fixed;
}

.task-table th,
.task-table td {
  height: 54px;
  padding: 7px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

.task-table th {
  height: 38px;
  color: var(--muted);
  background: var(--surface-subtle);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.025em;
}

.task-table th:first-child,
.task-table td:first-child {
  padding-left: 15px;
}

.task-table th:nth-child(1) { width: 31%; }
.task-table th:nth-child(2) { width: 15%; }
.task-table th:nth-child(3) { width: 13%; }
.task-table th:nth-child(4) { width: 12%; }
.task-table th:nth-child(5) { width: 14%; }
.task-table th:nth-child(6) { width: 11%; }
.task-table th:nth-child(7) { width: 44px; }

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

.task-table tbody tr {
  position: relative;
  background: var(--surface);
  transition: background-color 130ms ease;
}

.task-table tbody tr:hover {
  background: #f8fbfb;
}

.task-table tbody tr.is-overdue td:first-child {
  box-shadow: inset 3px 0 0 #e86157;
}

.task-name-cell > button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-width: 0;
  padding: 0;
  color: inherit;
  background: transparent;
  text-align: left;
}

.task-name-cell > button > span:last-child {
  min-width: 0;
}

.task-name-cell strong,
.task-name-cell small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-name-cell strong {
  color: var(--ink-soft);
  font-size: 12px;
}

.task-name-cell small {
  max-width: 440px;
  margin-top: 2px;
  color: var(--muted-light);
  font-size: 9px;
}

.task-check {
  width: 26px;
  height: 26px;
}

.cell-select,
.cell-date {
  width: 100%;
  min-height: 34px;
  padding: 0 8px;
  color: var(--ink-soft);
  background-color: transparent;
  border: 1px solid transparent;
  border-radius: 7px;
  font-size: 10px;
  font-weight: 700;
}

.cell-select:hover:not(:disabled),
.cell-date:hover:not(:disabled) {
  border-color: var(--line-strong);
}

.owner-select {
  color: var(--ink-soft);
  background: var(--surface-subtle);
}

.status-select,
.priority-select {
  padding-right: 22px;
}

.cell-date {
  font-weight: 600;
}

.row-progress {
  display: grid;
  grid-template-columns: minmax(42px, 1fr) 30px;
  align-items: center;
  gap: 7px;
}

.row-progress > span {
  height: 6px;
}

.row-progress i {
  background: var(--brand);
}

.row-progress small {
  color: var(--muted);
  font-size: 9px;
  text-align: right;
}

.row-more {
  width: 32px;
  min-width: 32px;
  min-height: 32px;
  font-size: 12px;
}

.table-empty {
  height: 84px !important;
  color: var(--muted-light);
  font-size: 12px;
  text-align: center !important;
}

.quick-task {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: center;
  min-height: 46px;
  overflow: hidden;
  color: var(--muted-light);
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
  border-top: 0;
  border-radius: 0 0 var(--radius) var(--radius);
}

.quick-task > span {
  padding-left: 13px;
  color: var(--brand);
  font-size: 16px;
}

.quick-task input {
  width: 100%;
  min-width: 0;
  height: 44px;
  padding: 0 8px;
  background: transparent;
  border: 0;
  font-size: 12px;
}

.quick-task input:focus-visible {
  box-shadow: none;
  outline: none !important;
}

.quick-task:focus-within {
  background: var(--surface);
  border-color: #a8d2cd;
  box-shadow: 0 0 0 3px rgba(33, 122, 116, 0.1);
}

.quick-task button {
  height: 32px;
  padding: 0 13px;
  margin-right: 7px;
  color: var(--brand-dark);
  background: var(--brand-soft);
  border-radius: 7px;
  font-size: 11px;
  font-weight: 700;
}

.add-group-button {
  min-height: 40px;
  padding: 0 13px;
  color: var(--brand-dark);
  background: transparent;
  border: 1px dashed #a8c7c3;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 700;
}

.add-group-button:hover {
  background: var(--brand-soft);
  border-color: var(--brand);
}

/* Kanban */
.kanban-board {
  display: grid;
  grid-template-columns: repeat(4, minmax(245px, 1fr));
  align-items: start;
  gap: 12px;
  padding-bottom: 12px;
  overflow-x: auto;
  scrollbar-color: #c5cbd3 transparent;
  scrollbar-width: thin;
}

.kanban-column {
  min-width: 0;
  padding: 10px;
  background: #edf1f2;
  border: 1px solid #e0e5e7;
  border-radius: var(--radius);
  transition: background-color 150ms ease, border-color 150ms ease, box-shadow 150ms ease;
}

.kanban-column > header {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) 24px 30px;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  padding: 0 3px 8px;
}

.kanban-column > header h3 {
  margin: 0;
  color: var(--ink-soft);
  font-size: 12px;
}

.kanban-column > header b {
  display: grid;
  width: 22px;
  height: 22px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.72);
  border-radius: 50%;
  font-size: 9px;
  place-items: center;
}

.kanban-column > header button {
  display: grid;
  width: 30px;
  height: 30px;
  padding: 0;
  color: var(--brand-dark);
  background: transparent;
  border-radius: 7px;
  font-size: 17px;
  place-items: center;
}

.kanban-column > header button:hover {
  background: var(--surface);
}

.kanban-status {
  width: 24px;
  height: 24px;
  font-size: 9px;
}

.kanban-list {
  display: grid;
  gap: 8px;
  min-height: 96px;
}

.kanban-card {
  padding: 13px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.06);
  transition: border-color 150ms ease, box-shadow 150ms ease, opacity 150ms ease, transform 150ms ease;
}

.kanban-card:hover {
  border-color: #b8cfcc;
  box-shadow: 0 10px 24px rgba(16, 24, 40, 0.1);
  transform: translateY(-1px);
}

.kanban-card.dragging {
  opacity: 0.56;
  transform: rotate(1deg) scale(0.98);
}

.kanban-column.drag-over {
  background: var(--brand-soft);
  border-color: var(--brand);
  box-shadow: inset 0 0 0 1px rgba(33, 122, 116, 0.14);
}

.kanban-card-title {
  width: 100%;
  padding: 0;
  color: var(--ink);
  background: transparent;
  font-size: 12px;
  font-weight: 750;
  line-height: 1.5;
  text-align: left;
}

.kanban-card > p {
  display: -webkit-box;
  margin: 7px 0 10px;
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.55;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.kanban-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 10px;
}

.kanban-card footer {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding-top: 11px;
  margin-top: 11px;
  color: var(--muted);
  border-top: 1px solid var(--line);
}

.kanban-card footer time,
.kanban-card footer small {
  font-size: 9px;
}

.kanban-card footer small {
  color: var(--brand-dark);
  font-weight: 800;
}

.kanban-empty {
  display: grid;
  min-height: 88px;
  color: var(--muted-light);
  border: 1px dashed #cdd4d7;
  border-radius: 9px;
  font-size: 10px;
  place-items: center;
}

.mobile-task-list {
  display: none;
}

/* Team */
.team-header {
  align-items: center;
}

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

.member-card {
  display: grid;
  grid-template-columns: 50px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 112px;
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.member-card:hover {
  border-color: #b9d8d4;
  box-shadow: 0 12px 26px rgba(16, 24, 40, 0.07);
  transform: translateY(-1px);
}

.member-card > div {
  min-width: 0;
}

.member-card h3,
.member-card p {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.member-card h3 {
  margin-bottom: 3px;
  font-size: 14px;
}

.member-card p {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
}

.member-card > small {
  grid-column: 2 / -1;
  color: var(--muted-light);
  font-size: 10px;
}

.role-pill {
  min-height: 23px;
  color: var(--ink-soft);
  background: var(--surface-strong);
}

.role-admin {
  color: #4141a5;
  background: #eeeeff;
}

.role-member {
  color: var(--success);
  background: #e3f4ee;
}

.role-viewer {
  color: #475467;
  background: #edf0f3;
}

/* Dialogs */
.modal {
  width: min(680px, calc(100vw - 40px));
  max-width: none;
  max-height: calc(100vh - 40px);
  max-height: calc(100dvh - 40px);
  padding: 0;
  overflow: hidden;
  color: var(--ink);
  background: var(--surface);
  border: 0;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}

.modal[open] {
  animation: modal-in 190ms ease-out both;
}

.modal::backdrop {
  background: rgba(15, 28, 35, 0.54);
  backdrop-filter: blur(4px);
}

#taskModal {
  width: min(520px, calc(100vw - 32px));
  height: calc(100vh - 32px);
  height: calc(100dvh - 32px);
  max-height: none;
  margin: 16px 16px 16px auto;
  border-radius: 18px;
}

#taskModal[open] {
  animation-name: drawer-in;
}

.modal-small {
  width: min(520px, calc(100vw - 40px));
  margin: auto;
}

@keyframes modal-in {
  from { opacity: 0; transform: translateY(10px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

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

.modal > form {
  display: flex;
  flex-direction: column;
  max-height: inherit;
}

#taskModal > form {
  height: 100%;
}

.modal-header {
  display: flex;
  flex: 0 0 auto;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 21px 22px 17px;
  border-bottom: 1px solid var(--line);
}

.modal-header h2 {
  margin: 0;
  font-size: 21px;
  line-height: 1.3;
}

.modal-close {
  margin: -5px -6px 0 0;
  font-size: 20px;
}

.modal-body {
  display: grid;
  flex: 1 1 auto;
  gap: 18px;
  min-height: 0;
  padding: 22px;
  overflow-y: auto;
  scrollbar-color: #c5cbd3 transparent;
  scrollbar-width: thin;
}

.modal-footer {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 9px;
  min-height: 68px;
  padding: 12px 22px;
  background: var(--surface-subtle);
  border-top: 1px solid var(--line);
}

.modal-footer > span {
  flex: 1;
}

.color-options {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.color-options button {
  position: relative;
  width: 38px;
  height: 38px;
  padding: 0;
  background: var(--swatch);
  border: 3px solid #fff;
  border-radius: 10px;
  box-shadow: 0 0 0 1px var(--line-strong);
}

.color-options button:hover,
.color-options button.selected {
  box-shadow: 0 0 0 2px var(--ink), 0 0 0 4px #fff;
}

.color-options button.selected::after {
  position: absolute;
  inset: 0;
  display: grid;
  color: #fff;
  content: "✓";
  font-size: 15px;
  font-weight: 900;
  place-items: center;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.38);
}

/* Toast and busy state */
.toast {
  position: fixed;
  z-index: 1000;
  right: 24px;
  bottom: 24px;
  width: fit-content;
  max-width: min(420px, calc(100vw - 32px));
  min-height: 48px;
  padding: 13px 17px 13px 42px;
  color: #fff;
  background: #172f34;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 11px;
  box-shadow: var(--shadow-lg);
  font-size: 13px;
  font-weight: 650;
  animation: toast-in 220ms ease-out both;
}

.toast::before {
  position: absolute;
  top: 50%;
  left: 16px;
  display: grid;
  width: 18px;
  height: 18px;
  color: var(--brand-deep);
  content: "✓";
  background: #9ed9d2;
  border-radius: 50%;
  font-size: 10px;
  font-weight: 900;
  place-items: center;
  transform: translateY(-50%);
}

.toast[data-tone="error"] {
  background: #52201c;
}

.toast[data-tone="error"]::before {
  color: #7a271a;
  content: "!";
  background: #fda29b;
}

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

.is-busy {
  cursor: progress;
}

.is-busy button,
.is-busy select,
.is-busy input[type="date"] {
  cursor: progress;
}

.is-busy .modal-footer .primary-button {
  opacity: 0.68;
}

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

  .panel-focus,
  .panel-progress,
  .panel-status,
  .panel-activity {
    grid-column: span 6;
  }

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

  .filter-bar label {
    flex: 1 1 120px;
  }

  .filter-bar select {
    width: 100%;
  }
}

@media (max-width: 920px) and (min-width: 761px) {
  .app-shell {
    grid-template-columns: 210px minmax(0, 1fr);
  }

  .sidebar {
    padding-right: 10px;
    padding-left: 10px;
  }

  .topbar {
    padding-right: 20px;
    padding-left: 20px;
  }

  .global-search {
    width: 200px;
  }

  #mainContent {
    padding-right: 20px;
    padding-left: 20px;
  }

  .panel-focus,
  .panel-progress,
  .panel-status,
  .panel-activity {
    grid-column: 1 / -1;
  }

  .board-toolbar {
    flex-direction: column;
  }

  .filter-bar {
    width: 100%;
  }
}

/* Mobile application and login */
@media (max-width: 760px) {
  .login-shell {
    display: block;
    min-height: 100dvh;
  }

  .login-story {
    min-height: 300px;
    padding: 24px;
  }

  .login-copy {
    width: 100%;
    margin: 48px 0 8px;
  }

  .login-copy h1 {
    margin-bottom: 14px;
    font-size: clamp(34px, 10vw, 46px);
  }

  .login-copy > p:last-child {
    font-size: 14px;
    line-height: 1.7;
  }

  .login-preview,
  .login-footnote {
    display: none;
  }

  .login-panel {
    min-height: calc(100dvh - 300px);
    padding: 34px 24px 48px;
    place-items: start center;
  }

  .login-card h2 {
    font-size: 27px;
  }

  .app-page {
    overflow: hidden;
  }

  .app-shell {
    display: block;
  }

  .sidebar {
    position: fixed;
    z-index: 50;
    top: 0;
    bottom: 0;
    left: 0;
    width: min(84vw, 292px);
    height: 100dvh;
    padding-top: max(16px, env(safe-area-inset-top));
    padding-bottom: max(14px, env(safe-area-inset-bottom));
    box-shadow: 18px 0 50px rgba(3, 17, 21, 0.24);
    transform: translateX(-104%);
    transition: transform 220ms ease;
  }

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

  .sidebar-close,
  .mobile-menu {
    display: inline-flex;
  }

  .sidebar-close {
    color: rgba(255, 255, 255, 0.74) !important;
  }

  .app-main {
    width: 100%;
    height: 100dvh;
  }

  .topbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 9px 10px;
    min-height: 64px;
    padding: 10px 14px;
    padding-top: max(10px, env(safe-area-inset-top));
  }

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

  .mobile-menu {
    flex: 0 0 auto;
    margin-right: 5px;
  }

  .topbar-title p {
    display: none;
  }

  .topbar-title h1 {
    max-width: calc(100vw - 90px);
    font-size: 16px;
  }

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

  .global-search {
    width: 100%;
    height: 40px;
  }

  .global-search kbd {
    display: none;
  }

  .global-search {
    grid-template-columns: 20px minmax(0, 1fr);
  }

  .topbar-actions .primary-button {
    min-width: 44px;
    min-height: 42px;
    padding: 0 10px;
    font-size: 12px;
  }

  .app-main:has(#boardView:not([hidden]) #filterBar) .topbar-filter {
    display: inline-flex;
  }

  #mainContent {
    min-height: calc(100dvh - 114px);
    padding: 18px 14px calc(34px + env(safe-area-inset-bottom));
  }

  .view {
    animation-duration: 140ms;
  }

  .welcome-row,
  .board-header,
  .team-header {
    align-items: flex-start;
    gap: 13px;
  }

  .welcome-row,
  .board-header {
    flex-direction: column;
  }

  .welcome-row h2,
  .board-header h2,
  .team-header h2 {
    font-size: 24px;
  }

  .welcome-row time {
    padding: 5px 9px;
  }

  .metric-grid {
    gap: 10px;
    margin-bottom: 14px;
  }

  .metric-card {
    display: grid;
    grid-template-columns: 32px minmax(0, 1fr);
    min-height: 102px;
    padding: 13px;
  }

  .metric-icon {
    width: 32px;
    height: 32px;
    border-radius: 9px;
    font-size: 11px;
  }

  .metric-card strong {
    font-size: 23px;
  }

  .metric-card em {
    display: none;
  }

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

  .panel-focus,
  .panel-progress,
  .panel-status,
  .panel-activity {
    grid-column: 1;
  }

  .panel {
    padding: 16px;
  }

  .focus-item {
    grid-template-columns: 30px minmax(0, 1fr) auto;
    min-height: 60px;
  }

  .focus-item .priority-pill {
    display: none;
  }

  .focus-date {
    font-size: 10px;
  }

  .project-progress-item {
    grid-template-columns: 8px minmax(90px, 1fr) 36px;
  }

  .project-progress-item .mini-progress {
    display: none;
  }

  .board-heading-copy {
    width: 100%;
  }

  .board-header h2 {
    max-width: calc(100vw - 66px);
  }

  .board-heading-copy > div > p:last-child {
    white-space: normal;
  }

  .board-color {
    height: 50px;
  }

  .board-progress-summary {
    width: 100%;
    flex-basis: auto;
    grid-template-columns: minmax(0, 1fr) 90px;
    align-items: center;
  }

  .board-progress-summary > span {
    grid-column: 2;
    grid-row: 1;
  }

  .board-progress-summary .progress-track {
    grid-column: 1;
    grid-row: 1;
  }

  .board-toolbar {
    display: block;
    padding: 0;
    margin-bottom: 12px;
    background: transparent;
    border: 0;
    box-shadow: none;
  }

  .view-switch {
    display: none;
  }

  .filter-bar {
    display: none;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    padding: 14px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
  }

  .filter-bar.mobile-open {
    display: grid;
  }

  .filter-bar label {
    width: 100%;
  }

  .filter-bar select {
    width: 100%;
    min-height: 44px;
  }

  .filter-bar .text-button {
    grid-column: 1 / -1;
    min-height: 44px;
  }

  .board-panel,
  .kanban-board {
    display: none !important;
  }

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

  .mobile-task-card {
    display: grid;
    gap: 13px;
    width: 100%;
    min-height: 92px;
    padding: 14px;
    color: inherit;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    text-align: left;
  }

  .mobile-task-card:hover,
  .mobile-task-card:active {
    border-color: #a8d2cd;
    background: #f8fbfb;
  }

  .mobile-task-top,
  .mobile-task-bottom {
    display: grid;
    align-items: center;
  }

  .mobile-task-top {
    grid-template-columns: 28px minmax(0, 1fr) auto;
    gap: 9px;
  }

  .mobile-task-top > i {
    width: 26px;
    height: 26px;
  }

  .mobile-task-top strong {
    min-width: 0;
    overflow: hidden;
    color: var(--ink-soft);
    font-size: 13px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-task-bottom {
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 12px;
    padding-top: 10px;
    color: var(--muted);
    border-top: 1px solid var(--line);
    font-size: 10px;
  }

  .mobile-task-bottom > span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-task-bottom em {
    color: var(--brand-dark);
    font-style: normal;
    font-weight: 800;
  }

  .team-header {
    margin-bottom: 16px;
  }

  .team-header .primary-button {
    flex: 0 0 auto;
    min-height: 44px;
    padding: 0 11px;
    font-size: 11px;
  }

  .team-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
  }

  .member-card {
    min-height: 104px;
    padding: 15px;
  }

  .modal,
  #taskModal,
  .modal-small {
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    max-width: none;
    max-height: none;
    margin: 0;
    border-radius: 0;
  }

  .modal[open],
  #taskModal[open] {
    animation-name: mobile-dialog-in;
  }

  @keyframes mobile-dialog-in {
    from { opacity: 0; transform: translateY(18px); }
    to { opacity: 1; transform: translateY(0); }
  }

  .modal-header {
    padding: max(17px, env(safe-area-inset-top)) 16px 14px;
  }

  .modal-body {
    padding: 18px 16px;
  }

  .form-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
  }

  .modal-footer {
    flex-wrap: wrap;
    min-height: 72px;
    padding: 11px 16px max(11px, env(safe-area-inset-bottom));
  }

  .modal-footer .primary-button,
  .modal-footer .secondary-button,
  .modal-footer .danger-button {
    min-height: 44px;
  }

  .toast {
    right: 16px;
    bottom: max(16px, env(safe-area-inset-bottom));
    left: 16px;
    width: auto;
    max-width: none;
  }
}

@media (max-width: 430px) {
  .topbar-actions .primary-button {
    max-width: 96px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

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

  .filter-bar .text-button {
    grid-column: 1;
  }

  .metric-card {
    grid-template-columns: 28px minmax(0, 1fr);
    gap: 0 8px;
    padding: 12px;
  }

  .metric-icon {
    width: 28px;
    height: 28px;
  }

  .metric-card small {
    font-size: 10px;
  }

  .metric-card strong {
    font-size: 21px;
  }

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

  .focus-date {
    grid-column: 2;
  }

  .member-card {
    grid-template-columns: 44px minmax(0, 1fr) auto;
  }

  .member-card .avatar.large {
    width: 44px;
    height: 44px;
  }

  .modal-footer > span {
    display: none;
  }

  .modal-footer .primary-button,
  .modal-footer .secondary-button {
    flex: 1;
  }

  .modal-footer .danger-button {
    width: 100%;
  }
}

/* Language selection and bilingual copy */
.setup-brand-row,
.login-story-top {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
}

.setup-brand-row {
  margin-bottom: clamp(70px, 12vh, 130px);
}

.setup-brand-row .product-mark {
  margin-bottom: 0;
}

.language-switcher {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 2px;
  padding: 3px;
  background: var(--surface-subtle);
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: var(--shadow-sm);
}

.language-switcher a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 34px;
  padding: 0 10px;
  color: var(--muted);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 750;
  line-height: 1;
  white-space: nowrap;
  transition: color 150ms ease, background-color 150ms ease, box-shadow 150ms ease;
}

.language-switcher a:hover {
  color: var(--brand-dark);
  background: var(--brand-soft);
}

.language-switcher a.is-active,
.language-switcher a[aria-current="true"] {
  color: var(--brand-dark);
  background: var(--surface);
  box-shadow: 0 1px 3px rgba(16, 24, 40, 0.14);
}

.language-switcher-dark,
.setup-language-switcher {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.18);
  box-shadow: none;
  backdrop-filter: blur(10px);
}

.language-switcher-dark a,
.setup-language-switcher a {
  color: rgba(255, 255, 255, 0.68);
}

.language-switcher-dark a:hover,
.setup-language-switcher a:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.language-switcher-dark a.is-active,
.language-switcher-dark a[aria-current="true"],
.setup-language-switcher a.is-active,
.setup-language-switcher a[aria-current="true"] {
  color: var(--brand-deep);
  background: #fff;
}

.language-switcher-topbar {
  min-height: 42px;
}

.language-switcher-sidebar {
  display: none;
  width: calc(100% - 16px);
  padding: 3px;
  margin: 0 8px 12px;
  background: rgba(255, 255, 255, 0.055);
  border-color: var(--sidebar-line);
  box-shadow: none;
}

.language-switcher-sidebar a {
  flex: 1 1 50%;
  min-height: 38px;
  color: rgba(255, 255, 255, 0.58);
}

.language-switcher-sidebar a:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.language-switcher-sidebar a.is-active,
.language-switcher-sidebar a[aria-current="true"] {
  color: #fff;
  background: rgba(158, 217, 210, 0.17);
  box-shadow: inset 0 0 0 1px rgba(158, 217, 210, 0.18);
}

html[lang="en"] .login-copy {
  width: min(700px, 94%);
}

html[lang="en"] .login-copy h1 {
  font-size: clamp(38px, 4.65vw, 64px);
  letter-spacing: -0.038em;
}

html[lang="en"] .login-copy > p:last-child {
  max-width: 610px;
}

html[lang="en"] .nav-item {
  letter-spacing: -0.005em;
}

html[lang="en"] .sidebar-tip small {
  letter-spacing: -0.01em;
}

html[lang="en"] .metric-card {
  min-height: 140px;
}

html[lang="en"] .metric-card small,
html[lang="en"] .metric-card em {
  line-height: 1.35;
}

html[lang="en"] .focus-date {
  min-width: 72px;
}

html[lang="en"] .filter-bar select {
  min-width: 128px;
}

html[lang="en"] .member-card {
  grid-template-columns: 50px minmax(0, 1fr) auto;
}

html[lang="en"] .role-pill {
  max-width: 100%;
}

html[lang="en"] .modal-footer button {
  white-space: nowrap;
}

@media (min-width: 1181px) {
  html[lang="en"] .app-shell {
    grid-template-columns: 248px minmax(0, 1fr);
  }
}

@media (max-width: 1180px) {
  .language-switcher-topbar {
    display: none;
  }

  .language-switcher-sidebar {
    display: inline-flex;
  }
}

@media (max-width: 760px) {
  .setup-brand-row,
  .login-story-top {
    gap: 10px;
  }

  .setup-brand-row {
    margin-bottom: 44px;
  }

  .language-switcher-dark,
  .setup-language-switcher {
    padding: 2px;
  }

  .language-switcher-dark a,
  .setup-language-switcher a {
    min-width: 42px;
    min-height: 36px;
    padding: 0 8px;
    font-size: 10px;
  }

  .language-switcher-sidebar a {
    min-height: 44px;
  }

  html[lang="en"] .login-copy {
    width: 100%;
    margin-top: 38px;
  }

  html[lang="en"] .login-copy h1 {
    max-width: 560px;
    font-size: clamp(31px, 9.5vw, 42px);
    line-height: 1.12;
  }

  html[lang="en"] .login-copy > p:last-child {
    font-size: 13px;
    line-height: 1.62;
  }

  html[lang="en"] .metric-card {
    min-height: 112px;
  }

  html[lang="en"] .metric-card small {
    white-space: normal;
  }

  html[lang="en"] .team-header .primary-button {
    max-width: 132px;
    white-space: normal;
    line-height: 1.2;
    text-align: center;
  }

  html[lang="en"] .mobile-task-bottom {
    grid-template-columns: minmax(0, 1fr) minmax(70px, auto) auto;
  }
}

@media (max-width: 430px) {
  .setup-brand-row .product-mark,
  .login-story-top .product-mark {
    gap: 8px;
  }

  .setup-brand-row .product-mark > strong,
  .login-story-top .product-mark > strong {
    font-size: 16px;
  }

  html[lang="en"] .member-card {
    grid-template-columns: 44px minmax(0, 1fr);
  }

  html[lang="en"] .member-card .role-pill,
  html[lang="en"] .member-card > small {
    grid-column: 2;
    justify-self: start;
  }

  html[lang="en"] .modal-footer button {
    min-width: 0;
    white-space: normal;
  }
}

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

@media (prefers-contrast: more) {
  :root {
    --line: #b7bec8;
    --line-strong: #858f9d;
    --muted: #475467;
    --muted-light: #667085;
  }

  .primary-button,
  .secondary-button,
  .metric-card,
  .panel,
  .member-card,
  .task-table-wrapper,
  .mobile-task-card {
    border-width: 2px;
  }
}

@media (forced-colors: active) {
  .sidebar,
  .login-story,
  .status-backlog,
  .status-working,
  .status-review,
  .status-done,
  .priority-low,
  .priority-medium,
  .priority-high,
  .priority-urgent {
    forced-color-adjust: auto;
  }

  .nav-item.active,
  .view-switch button.active,
  .kanban-column.drag-over {
    outline: 2px solid Highlight;
  }
}

@media print {
  .sidebar,
  .topbar,
  .board-toolbar,
  .quick-task,
  .add-group-button,
  .toast {
    display: none !important;
  }

  .app-shell {
    display: block;
  }

  .app-main {
    height: auto;
    overflow: visible;
  }

  #mainContent {
    max-width: none;
    padding: 0;
  }

  .panel,
  .metric-card,
  .task-table-wrapper {
    box-shadow: none;
  }
}
