:root {
  --ink: #15221d;
  --ink-soft: #3e4d46;
  --muted: #6c7972;
  --muted-light: #99a39e;
  --paper: #f3f0e8;
  --paper-deep: #eae5da;
  --card: #fbfaf6;
  --line: rgba(21, 34, 29, 0.12);
  --line-strong: rgba(21, 34, 29, 0.2);
  --green: #1f6b52;
  --green-deep: #174d3d;
  --green-soft: #dfeae2;
  --gold: #c6a15b;
  --gold-soft: #f1e5cc;
  --blue: #416b87;
  --blue-soft: #e2ebf1;
  --violet: #6b5a86;
  --violet-soft: #eae5f1;
  --amber: #9a6a2f;
  --amber-soft: #f4e8d3;
  --night: #081512;
  --night-soft: #0e211c;
  --night-line: rgba(231, 224, 203, 0.14);
  --serif: "Songti SC", "Noto Serif CJK SC", "Source Han Serif SC", Georgia, "Times New Roman", serif;
  --sans: "Segoe UI", "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", system-ui, sans-serif;
  --mono: "Cascadia Mono", "SFMono-Regular", Consolas, monospace;
  --shadow-soft: 0 24px 70px rgba(31, 47, 39, 0.1);
  --shadow-card: 0 18px 50px rgba(31, 47, 39, 0.07);
}

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

html {
  min-width: 320px;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.is-locked {
  overflow: hidden;
}

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

button {
  color: inherit;
}

h1,
h2,
h3,
h4,
p,
dl,
dd {
  margin: 0;
}

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

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

[hidden] {
  display: none !important;
}

::selection {
  background: rgba(198, 161, 91, 0.35);
  color: var(--ink);
}

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

.svg-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.icon {
  width: 20px;
  height: 20px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--green);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.18em;
  line-height: 1.4;
  text-transform: uppercase;
}

.eyebrow--gold {
  color: var(--gold);
}

.eyebrow__line {
  width: 26px;
  height: 1px;
  background: currentColor;
  opacity: 0.55;
}

/* ---------- Shared interface pieces ---------- */

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  width: max-content;
}

.brand__mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(21, 34, 29, 0.24);
  border-radius: 50%;
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
}

.brand__word {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.brand__word strong {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.22em;
}

.brand__word small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0.28em;
}

.brand--light .brand__mark {
  border-color: rgba(231, 224, 203, 0.34);
  color: #f4efe1;
}

.brand--light .brand__word strong {
  color: #f4efe1;
}

.brand--light .brand__word small {
  color: rgba(244, 239, 225, 0.55);
}

.avatar {
  display: grid;
  width: 34px;
  height: 34px;
  flex: none;
  place-items: center;
  border-radius: 50%;
  background: var(--green);
  color: #f8f3e6;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0.04em;
  line-height: 1.6;
  white-space: nowrap;
}

.tag--private {
  border-color: rgba(107, 90, 134, 0.16);
  background: rgba(107, 90, 134, 0.06);
  color: var(--violet);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px;
  border: 1px solid rgba(31, 107, 82, 0.16);
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--green-deep);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.status-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 3px rgba(31, 107, 82, 0.12);
}

.status-pill--soft {
  border-color: var(--line);
  background: rgba(31, 107, 82, 0.07);
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 0 4px;
  border: 0;
  border-bottom: 1px solid var(--line-strong);
  background: transparent;
  color: var(--ink);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease, gap 0.2s ease;
}

.text-link .icon {
  width: 15px;
  height: 15px;
}

.text-link:hover {
  border-color: var(--green);
  color: var(--green);
  gap: 12px;
}

.icon-btn {
  display: grid;
  width: 38px;
  height: 38px;
  padding: 0;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.icon-btn .icon {
  width: 18px;
  height: 18px;
}

.icon-btn:hover {
  border-color: var(--line);
  background: var(--card);
  color: var(--ink);
}

.spinner {
  display: none;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(23, 34, 29, 0.24);
  border-top-color: #17221d;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

/* ---------- Login gate ---------- */

.gate {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  min-height: 100vh;
  padding: 34px 24px 28px;
  overflow-y: auto;
  place-items: center;
  background:
    radial-gradient(circle at 16% 15%, rgba(48, 108, 84, 0.28), transparent 38%),
    radial-gradient(circle at 88% 84%, rgba(173, 134, 65, 0.13), transparent 34%),
    linear-gradient(145deg, #06100e 0%, #0a1915 48%, #071310 100%);
  color: #f4efe1;
  animation: gate-in 0.55s ease both;
}

.gate.is-leaving {
  animation: gate-out 0.32s ease both;
  pointer-events: none;
}

.gate__grid {
  position: absolute;
  inset: 0;
  opacity: 0.24;
  background-image:
    linear-gradient(rgba(231, 224, 203, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(231, 224, 203, 0.06) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: radial-gradient(ellipse at center, black 15%, transparent 74%);
  pointer-events: none;
}

.gate__orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.35;
  pointer-events: none;
}

.gate__orb--one {
  top: -140px;
  right: 8%;
  width: 440px;
  height: 440px;
  background: #1f6b52;
}

.gate__orb--two {
  bottom: -200px;
  left: 4%;
  width: 500px;
  height: 500px;
  background: #7c6334;
  opacity: 0.18;
}

.gate__shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
  width: min(1080px, 100%);
  overflow: hidden;
  border: 1px solid var(--night-line);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.025);
  box-shadow: 0 50px 130px rgba(0, 0, 0, 0.46);
  backdrop-filter: blur(22px);
}

.gate__intro {
  display: flex;
  min-height: 660px;
  flex-direction: column;
  padding: 44px 50px 40px;
}

.gate__statement {
  margin-top: auto;
  padding-top: 54px;
}

.gate__statement h1 {
  margin: 20px 0 22px;
  color: #f8f3e4;
  font-family: var(--serif);
  font-size: clamp(42px, 5vw, 60px);
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.16;
}

.gate__desc {
  max-width: 400px;
  color: rgba(236, 231, 216, 0.64);
  font-size: 14px;
  line-height: 1.9;
}

.gate__features {
  display: grid;
  gap: 18px;
  margin: 38px 0 0;
  padding-top: 28px;
  border-top: 1px solid var(--night-line);
}

.gate__features li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.feature-dot {
  width: 5px;
  height: 5px;
  margin-top: 8px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 5px rgba(198, 161, 91, 0.09);
}

.gate__features strong {
  display: block;
  color: rgba(248, 243, 228, 0.9);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.gate__features small {
  display: block;
  margin-top: 2px;
  color: rgba(236, 231, 216, 0.45);
  font-size: 11px;
  letter-spacing: 0.03em;
}

.gate__intro-foot {
  margin-top: auto;
  padding-top: 34px;
  color: rgba(236, 231, 216, 0.28);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.18em;
}

.gate__card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 40px 44px;
  border-left: 1px solid var(--night-line);
  background:
    radial-gradient(circle at 80% 10%, rgba(198, 161, 91, 0.08), transparent 38%),
    rgba(8, 21, 18, 0.52);
}

.gate__lock {
  display: grid;
  width: 46px;
  height: 46px;
  margin-bottom: 20px;
  place-items: center;
  border: 1px solid rgba(198, 161, 91, 0.36);
  border-radius: 50%;
  background: rgba(198, 161, 91, 0.08);
  color: var(--gold);
  box-shadow: 0 0 0 8px rgba(198, 161, 91, 0.035);
}

.gate__lock .icon {
  width: 21px;
  height: 21px;
}

.gate__card .eyebrow {
  color: rgba(198, 161, 91, 0.72);
}

.gate__card h2 {
  margin-top: 12px;
  color: #f8f3e4;
  font-family: var(--serif);
  font-size: 30px;
  font-weight: 600;
  letter-spacing: 0.03em;
  line-height: 1.35;
}

.gate__lead {
  margin-top: 10px;
  color: rgba(236, 231, 216, 0.5);
  font-size: 12px;
  line-height: 1.8;
}

.gate form {
  margin-top: 26px;
}

.field-label {
  display: block;
  margin-bottom: 9px;
  color: rgba(244, 239, 225, 0.88);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
}

.field-label--spaced {
  margin-top: 16px;
}

.field-label--dark {
  color: var(--ink-soft);
}

.login-field {
  display: flex;
  align-items: center;
  height: 54px;
  padding: 0 16px;
  border: 1px solid rgba(231, 224, 203, 0.32);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.075);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.login-field:focus-within {
  border-color: rgba(225, 190, 119, 0.9);
  background: rgba(255, 255, 255, 0.1);
  box-shadow: 0 0 0 4px rgba(198, 161, 91, 0.14);
}

.login-field.is-error {
  border-color: rgba(231, 137, 118, 0.9);
  box-shadow: 0 0 0 4px rgba(217, 116, 98, 0.12);
  animation: shake 0.38s ease;
}

.login-field__icon {
  width: 18px;
  height: 18px;
  margin-right: 11px;
  color: rgba(244, 239, 225, 0.58);
}

.login-field input {
  min-width: 0;
  flex: 1;
  height: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: #fffdf6;
  caret-color: #e5c47e;
  font-family: var(--mono);
  font-size: 15px;
  letter-spacing: 0.08em;
}

.login-field input::placeholder {
  color: rgba(244, 239, 225, 0.52);
  font-family: var(--sans);
  font-size: 13px;
  letter-spacing: 0.02em;
}

.login-field--light {
  color-scheme: light;
  border-color: rgba(21, 34, 29, 0.22);
  background: #ffffff;
  box-shadow: inset 0 1px 2px rgba(21, 34, 29, 0.04);
}

.login-field--light:focus-within {
  border-color: rgba(31, 107, 82, 0.7);
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(31, 107, 82, 0.1);
}

.login-field--light .login-field__icon {
  color: var(--muted);
}

.login-field--light input {
  color: var(--ink);
  caret-color: var(--green);
}

.login-field--light input::placeholder {
  color: #77847c;
}

.password-field {
  display: flex;
  align-items: center;
  height: 58px;
  padding: 0 8px 0 16px;
  border: 1px solid rgba(231, 224, 203, 0.32);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.075);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.password-field:focus-within {
  border-color: rgba(225, 190, 119, 0.9);
  background: rgba(255, 255, 255, 0.1);
  box-shadow: 0 0 0 4px rgba(198, 161, 91, 0.14);
}

.password-field.is-error {
  border-color: rgba(231, 137, 118, 0.9);
  box-shadow: 0 0 0 4px rgba(217, 116, 98, 0.12);
  animation: shake 0.38s ease;
}

.password-field.password-field--light {
  color-scheme: light;
  border-color: rgba(21, 34, 29, 0.22);
  background: #ffffff;
  box-shadow: inset 0 1px 2px rgba(21, 34, 29, 0.04);
}

.password-field.password-field--light:focus-within {
  border-color: rgba(31, 107, 82, 0.7);
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(31, 107, 82, 0.1);
}

.password-field--light .password-field__icon {
  color: var(--muted);
}

.password-field.password-field--light input {
  color: #07120e;
  caret-color: var(--green);
  font-weight: 600;
}

.password-field.password-field--light input::placeholder {
  color: #4f5d55;
  opacity: 1;
  font-weight: 500;
}

.password-field--light .password-toggle {
  color: var(--muted);
}

.password-field--light .password-toggle:hover {
  background: rgba(21, 34, 29, 0.06);
  color: var(--ink);
}

.password-field__icon {
  width: 18px;
  height: 18px;
  margin-right: 11px;
  color: rgba(244, 239, 225, 0.58);
}

.password-field input {
  min-width: 0;
  flex: 1;
  height: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: #fffdf6;
  caret-color: #e5c47e;
  font-family: var(--mono);
  font-size: 15px;
  letter-spacing: 0.1em;
}

.password-field input::placeholder {
  color: rgba(244, 239, 225, 0.52);
  font-family: var(--sans);
  font-size: 13px;
  letter-spacing: 0.02em;
}

.login-field input:-webkit-autofill,
.login-field input:-webkit-autofill:hover,
.login-field input:-webkit-autofill:focus,
.password-field input:-webkit-autofill,
.password-field input:-webkit-autofill:hover,
.password-field input:-webkit-autofill:focus {
  -webkit-text-fill-color: #fffdf6;
  -webkit-box-shadow: 0 0 0 1000px #20332d inset;
  caret-color: #e5c47e;
}

.login-field--light input:-webkit-autofill,
.login-field--light input:-webkit-autofill:hover,
.login-field--light input:-webkit-autofill:focus,
.password-field--light input:-webkit-autofill,
.password-field--light input:-webkit-autofill:hover,
.password-field--light input:-webkit-autofill:focus {
  -webkit-text-fill-color: #07120e;
  -webkit-box-shadow: 0 0 0 1000px #ffffff inset;
  caret-color: var(--green);
}

.password-toggle {
  display: grid;
  width: 42px;
  height: 42px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: rgba(244, 239, 225, 0.68);
  cursor: pointer;
  transition: color 0.2s ease, background 0.2s ease;
}

.password-toggle:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fffdf6;
}

.password-toggle .icon {
  width: 18px;
  height: 18px;
}

.password-toggle .icon-eye-off,
.password-toggle[aria-pressed="true"] .icon-eye {
  display: none;
}

.password-toggle[aria-pressed="true"] .icon-eye-off {
  display: block;
}

.form-error {
  min-height: 22px;
  padding: 7px 2px 0;
  color: #e19a89;
  font-size: 11px;
  line-height: 1.5;
}

.form-error--dark {
  color: #a64b3b;
}

.primary-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  height: 54px;
  margin-top: 6px;
  padding: 0 20px;
  overflow: hidden;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(115deg, #d8b873, #c5a05a);
  color: #17221d;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.primary-btn::after {
  position: absolute;
  top: 0;
  left: -60%;
  width: 45%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.32), transparent);
  content: "";
  transform: skewX(-18deg);
  transition: left 0.55s ease;
}

.primary-btn:hover:not(:disabled) {
  filter: brightness(1.04);
  box-shadow: 0 12px 28px rgba(198, 161, 91, 0.2);
  transform: translateY(-1px);
}

.primary-btn:hover:not(:disabled)::after {
  left: 115%;
}

.primary-btn:active:not(:disabled) {
  transform: translateY(0);
}

.primary-btn:disabled {
  cursor: wait;
  opacity: 0.78;
}

.primary-btn__arrow {
  width: 18px;
  height: 18px;
}

.primary-btn.is-loading .spinner {
  display: block;
}

.primary-btn.is-loading .primary-btn__arrow {
  display: none;
}

.primary-btn--dark {
  margin-top: 2px;
  background: linear-gradient(115deg, #234638, #17382c);
  color: #f6f1e4;
  box-shadow: 0 12px 26px rgba(23, 56, 44, 0.15);
}

.primary-btn--dark::after {
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.12), transparent);
}

.primary-btn--dark .spinner {
  border-color: rgba(246, 241, 228, 0.25);
  border-top-color: #f6f1e4;
}

.gate__switch {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 14px;
  color: rgba(236, 231, 216, 0.42);
  font-size: 11px;
}

.gate__switch button {
  padding: 2px 0;
  border: 0;
  border-bottom: 1px solid rgba(198, 161, 91, 0.38);
  background: transparent;
  color: #d8b873;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.gate__switch button:hover {
  border-color: #e5c98f;
  color: #e5c98f;
}

.gate__hint {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--night-line);
  color: rgba(236, 231, 216, 0.38);
  font-size: 10px;
  line-height: 1.75;
}

.gate__hint .icon {
  width: 14px;
  height: 14px;
  margin-top: 2px;
}

.gate__copyright {
  position: relative;
  z-index: 1;
  margin-top: 26px;
  color: rgba(236, 231, 216, 0.26);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.2em;
  text-align: center;
}

.gate__icp {
  position: relative;
  z-index: 1;
  margin-top: 5px;
  color: rgba(236, 231, 216, 0.3);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  text-align: center;
}

.gate__icp a {
  border-bottom: 1px solid rgba(236, 231, 216, 0.14);
  transition: color 0.2s ease, border-color 0.2s ease;
}

.gate__icp a:hover {
  border-color: rgba(198, 161, 91, 0.5);
  color: rgba(236, 231, 216, 0.62);
}

.noscript-note {
  margin-top: 18px;
  padding: 10px 12px;
  border: 1px solid rgba(217, 116, 98, 0.28);
  border-radius: 8px;
  background: rgba(217, 116, 98, 0.08);
  color: #e19a89;
  font-size: 11px;
  line-height: 1.6;
}

/* ---------- Registration dialog ---------- */

.register-layer {
  position: fixed;
  z-index: 120;
  inset: 0;
  display: grid;
  padding: 24px;
  overflow-y: auto;
  place-items: center;
}

.register-layer__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 12, 9, 0.7);
  backdrop-filter: blur(12px);
  animation: gate-in 0.25s ease both;
}

.register-layer.is-leaving {
  animation: gate-out 0.3s ease both;
  pointer-events: none;
}

.register-card {
  position: relative;
  z-index: 1;
  width: min(470px, 100%);
  max-height: calc(100vh - 48px);
  padding: 30px 38px 24px;
  overflow-y: auto;
  border: 1px solid rgba(21, 34, 29, 0.1);
  border-radius: 24px;
  background:
    radial-gradient(circle at 100% 0, rgba(198, 161, 91, 0.1), transparent 32%),
    var(--card);
  color: var(--ink);
  color-scheme: light;
  box-shadow: 0 44px 120px rgba(0, 0, 0, 0.5);
  animation: modal-in 0.3s cubic-bezier(0.22, 0.72, 0.28, 1) both;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}

.register-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.register-card__kicker {
  color: var(--muted-light);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.18em;
}

.modal-close {
  display: grid;
  width: 34px;
  height: 34px;
  padding: 0;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.modal-close .icon {
  width: 16px;
  height: 16px;
}

.modal-close:hover {
  border-color: var(--line-strong);
  background: var(--paper);
  color: var(--ink);
}

.register-card__heading {
  display: flex;
  align-items: center;
  gap: 14px;
}

.register-icon {
  display: grid;
  width: 48px;
  height: 48px;
  flex: none;
  place-items: center;
  border-radius: 14px;
  background: var(--green-soft);
  color: var(--green);
}

.register-icon .icon {
  width: 21px;
  height: 21px;
}

.register-card__heading .eyebrow {
  font-size: 9px;
}

.register-card__heading h2 {
  margin-top: 3px;
  font-family: var(--serif);
  font-size: 29px;
  font-weight: 600;
  letter-spacing: 0.03em;
  line-height: 1.3;
}

.register-lead {
  margin-top: 14px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.8;
}

.register-steps {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  margin: 22px 0 24px;
  padding: 0;
  border-bottom: 1px solid var(--line);
  list-style: none;
}

.register-steps li {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: -1px;
  padding: 0 0 11px;
  border-bottom: 2px solid transparent;
  color: var(--muted-light);
  font-size: 10px;
  letter-spacing: 0.02em;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.register-steps li span {
  display: grid;
  width: 20px;
  height: 20px;
  place-items: center;
  border-radius: 50%;
  background: var(--paper-deep);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 8px;
  transition: background 0.2s ease, color 0.2s ease;
}

.register-steps li strong {
  font-weight: 600;
}

.register-steps li.is-active {
  border-color: var(--green);
  color: var(--ink);
}

.register-steps li.is-active span {
  background: var(--green);
  color: #f8f3e6;
}

.register-steps li.is-done {
  border-color: transparent;
  color: var(--green);
}

.register-steps li.is-done span {
  background: var(--green-soft);
  color: var(--green);
}

.register-form .field-label {
  margin-bottom: 8px;
}

.register-form .field-hint {
  margin-top: 8px;
  padding: 0 2px;
  color: var(--muted-light);
  font-size: 9px;
  line-height: 1.7;
}

.field-hint {
  margin-top: 8px;
  padding: 0 2px;
  color: var(--muted-light);
  font-size: 9px;
  line-height: 1.7;
}

.chosen-account {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 20px;
  padding: 10px 12px;
  border: 1px solid rgba(31, 107, 82, 0.14);
  border-radius: 10px;
  background: rgba(31, 107, 82, 0.055);
  color: var(--muted);
  font-size: 10px;
}

.chosen-account strong {
  color: var(--green-deep);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.05em;
}

.chosen-account button {
  margin-left: auto;
  padding: 0;
  border: 0;
  border-bottom: 1px solid var(--line-strong);
  background: transparent;
  color: var(--muted);
  font-size: 9px;
  cursor: pointer;
}

.register-back {
  display: block;
  width: max-content;
  margin: 14px auto 0;
  padding: 3px 0;
  border: 0;
  border-bottom: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  font-size: 10px;
  cursor: pointer;
}

.register-back:hover {
  border-color: var(--line-strong);
  color: var(--ink);
}

.register-success {
  padding: 22px 0 12px;
  text-align: center;
  animation: view-in 0.35s ease both;
}

.register-success__icon {
  display: grid;
  width: 58px;
  height: 58px;
  margin: 0 auto 16px;
  place-items: center;
  border-radius: 50%;
  background: var(--green-soft);
  color: var(--green);
  box-shadow: 0 0 0 8px rgba(31, 107, 82, 0.05);
}

.register-success__icon .icon {
  width: 28px;
  height: 28px;
}

.register-success h3 {
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 600;
  letter-spacing: 0.03em;
}

.register-success p {
  margin-top: 7px;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.03em;
}

.register-foot {
  margin-top: 20px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  color: var(--muted-light);
  font-size: 9px;
  text-align: center;
  letter-spacing: 0.02em;
}

/* ---------- Application shell ---------- */

.app {
  min-height: 100vh;
  background:
    radial-gradient(circle at 8% 4%, rgba(31, 107, 82, 0.07), transparent 30%),
    radial-gradient(circle at 94% 2%, rgba(198, 161, 91, 0.09), transparent 24%),
    var(--paper);
  animation: app-in 0.5s ease both;
}

.topbar {
  position: sticky;
  z-index: 20;
  top: 0;
  border-bottom: 1px solid var(--line);
  background: rgba(243, 240, 232, 0.86);
  backdrop-filter: blur(18px);
}

.topbar__inner {
  display: flex;
  align-items: center;
  gap: 44px;
  width: min(1180px, calc(100% - 64px));
  height: 78px;
  margin: 0 auto;
}

.main-nav {
  display: flex;
  align-self: stretch;
  gap: 4px;
  margin-left: auto;
}

.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 20px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: color 0.2s ease;
}

.nav-item::after {
  position: absolute;
  right: 20px;
  bottom: -1px;
  left: 20px;
  height: 2px;
  background: var(--green);
  content: "";
  opacity: 0;
  transform: scaleX(0.3);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.nav-item:hover {
  color: var(--ink);
}

.nav-item.is-active {
  color: var(--ink);
}

.nav-item.is-active::after {
  opacity: 1;
  transform: scaleX(1);
}

.nav-item__index {
  color: var(--muted-light);
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.04em;
}

.nav-item.is-active .nav-item__index {
  color: var(--gold);
}

.user-area {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: 6px;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 132px;
  padding: 6px 12px 6px 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(251, 250, 246, 0.65);
}

.user-chip__meta {
  display: flex;
  min-width: 0;
  flex-direction: column;
  line-height: 1.35;
}

.user-chip__meta strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-chip__meta small {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.04em;
}

.main {
  width: min(1180px, calc(100% - 64px));
  margin: 0 auto;
  padding: 0 0 72px;
}

.view {
  animation: view-in 0.42s ease both;
}

.footer {
  border-top: 1px solid var(--line);
  background: rgba(234, 229, 218, 0.32);
}

.footer__inner {
  display: flex;
  align-items: center;
  gap: 12px;
  width: min(1180px, calc(100% - 64px));
  min-height: 64px;
  margin: 0 auto;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.05em;
}

.footer__dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--muted-light);
}

.footer__spacer {
  flex: 1;
}

.footer__account strong {
  color: var(--ink-soft);
  font-weight: 600;
}

.footer__icp {
  color: var(--muted);
  transition: color 0.2s ease;
}

.footer__icp:hover {
  color: var(--green);
}

/* ---------- Animations ---------- */

@keyframes gate-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes gate-out {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

@keyframes app-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

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

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

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

@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }
  20% {
    transform: translateX(-5px);
  }
  40% {
    transform: translateX(4px);
  }
  60% {
    transform: translateX(-3px);
  }
  80% {
    transform: translateX(2px);
  }
}

/* ---------- Shell responsive ---------- */

@media (max-width: 1040px) {
  .gate__intro {
    padding: 40px 38px;
  }

  .gate__card {
    padding: 44px 36px;
  }

  .topbar__inner {
    gap: 24px;
  }
}

@media (max-width: 880px) {
  .gate {
    padding: 24px 18px;
  }

  .gate__shell {
    grid-template-columns: 1fr;
    max-width: 540px;
  }

  .gate__intro {
    min-height: 0;
    padding: 30px 34px 28px;
    border-bottom: 1px solid var(--night-line);
  }

  .gate__statement {
    margin-top: 28px;
    padding-top: 0;
  }

  .gate__statement h1 {
    margin: 14px 0;
    font-size: 38px;
  }

  .gate__desc,
  .gate__features,
  .gate__intro-foot {
    display: none;
  }

  .gate__card {
    padding: 36px 34px 38px;
    border-left: 0;
  }

  .gate__lock {
    width: 42px;
    height: 42px;
    margin-bottom: 18px;
  }

  .gate__card h2 {
    font-size: 26px;
  }

  .topbar__inner {
    width: calc(100% - 40px);
    height: auto;
    min-height: 72px;
    flex-wrap: wrap;
    gap: 0;
    padding: 10px 0 0;
  }

  .main-nav {
    order: 3;
    width: 100%;
    height: 44px;
    margin: 2px 0 0;
  }

  .nav-item {
    flex: 1;
    justify-content: center;
    padding: 0 12px;
  }

  .nav-item::after {
    right: 12px;
    left: 12px;
  }

  .user-area {
    margin-left: auto;
  }

  .main {
    width: calc(100% - 40px);
    padding-bottom: 54px;
  }

  .footer__inner {
    width: calc(100% - 40px);
    flex-wrap: wrap;
    gap: 8px;
    padding: 16px 0;
  }

  .footer__spacer {
    display: none;
  }

  .footer__account {
    width: 100%;
  }
}

@media (max-width: 560px) {
  .gate {
    padding: 12px;
    place-items: start center;
  }

  .gate__shell {
    margin: auto 0;
    border-radius: 20px;
  }

  .gate__intro {
    padding: 24px 24px 22px;
  }

  .gate__statement {
    margin-top: 22px;
  }

  .gate__statement h1 {
    font-size: 32px;
  }

  .gate__card {
    padding: 28px 24px 30px;
  }

  .gate__card h2 {
    font-size: 24px;
  }

  .gate__lead {
    font-size: 11px;
  }

  .gate form {
    margin-top: 24px;
  }

  .gate__copyright {
    margin-top: 16px;
    font-size: 8px;
  }

  .register-layer {
    padding: 10px;
  }

  .register-card {
    max-height: calc(100vh - 20px);
    padding: 24px 20px 20px;
    border-radius: 18px;
  }

  .register-card__top {
    margin-bottom: 16px;
  }

  .register-card__heading {
    gap: 11px;
  }

  .register-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
  }

  .register-card__heading h2 {
    font-size: 25px;
  }

  .register-lead {
    font-size: 10px;
  }

  .register-steps {
    margin: 18px 0 20px;
  }

  .brand__mark {
    width: 37px;
    height: 37px;
    font-size: 19px;
  }

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

  .user-chip {
    min-width: 0;
    padding-right: 6px;
  }

  .user-chip__meta {
    display: none;
  }

  .user-role-badge {
    display: none;
  }

  .user-area {
    gap: 2px;
  }

  .topbar__inner {
    width: calc(100% - 32px);
  }

  .main {
    width: calc(100% - 32px);
  }

  .footer__inner {
    width: calc(100% - 32px);
  }
}

@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;
  }
}

/* ==========================================================
   Workspace v0.3 — 公共协作区与个人区
   ========================================================== */

.main--workspace {
  padding-top: 0;
}

.avatar--small {
  width: 32px;
  height: 32px;
  font-size: 12px;
}

.avatar--xl {
  width: 82px;
  height: 82px;
  font-size: 25px;
  box-shadow: 0 0 0 7px rgba(31, 107, 82, 0.08);
}

.user-role-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 7px;
  border: 1px solid rgba(198, 161, 91, 0.34);
  border-radius: 999px;
  background: var(--gold-soft);
  color: var(--amber);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.user-chip .user-role-badge {
  margin-left: 2px;
}

.user-name.is-unset {
  color: var(--muted);
  font-weight: 500;
}

/* ---------- Page heading / tabs ---------- */

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 36px;
  padding: 56px 0 30px;
}

.page-head__copy h1 {
  margin: 17px 0 14px;
  font-family: var(--serif);
  font-size: clamp(42px, 5.2vw, 66px);
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.08;
}

.page-head__desc {
  max-width: 590px;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.9;
}

.page-head__side {
  display: flex;
  align-items: flex-end;
  flex-direction: column;
  gap: 11px;
  padding-bottom: 6px;
  white-space: nowrap;
}

.page-head__count {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.03em;
}

.page-head__count strong {
  color: var(--ink);
  font-weight: 600;
}

.seg-tabs {
  display: flex;
  width: max-content;
  max-width: 100%;
  gap: 4px;
  margin-bottom: 28px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(251, 250, 246, 0.7);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.8) inset;
}

.seg-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 40px;
  padding: 0 18px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.seg-tab .icon {
  width: 15px;
  height: 15px;
}

.seg-tab:hover {
  color: var(--ink);
}

.seg-tab.is-active {
  background: var(--ink);
  color: #f7f2e5;
  box-shadow: 0 5px 14px rgba(21, 34, 29, 0.14);
}

.seg-tabs--inner {
  margin-top: 24px;
  margin-bottom: 20px;
}

.public-panel {
  animation: view-in 0.35s ease both;
}

/* ---------- Buttons / forms ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 42px;
  padding: 0 17px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: var(--ink);
  color: #f8f3e7;
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.03em;
  line-height: 1.2;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.btn .icon {
  width: 15px;
  height: 15px;
}

.btn:hover:not(:disabled) {
  transform: translateY(-1px);
}

.btn:disabled {
  cursor: wait;
  opacity: 0.65;
}

.btn--primary {
  background: var(--green);
  color: #f8f3e7;
  box-shadow: 0 8px 20px rgba(31, 107, 82, 0.15);
}

.btn--primary:hover:not(:disabled) {
  background: var(--green-deep);
  box-shadow: 0 11px 26px rgba(31, 107, 82, 0.2);
}

.btn--small {
  min-height: 34px;
  padding: 0 12px;
  border-radius: 8px;
  font-size: 10px;
}

.btn--ghost {
  border-color: var(--line-strong);
  background: transparent;
  color: var(--ink-soft);
}

.btn--ghost:hover:not(:disabled) {
  background: var(--paper);
  color: var(--ink);
}

.btn--danger {
  background: #a64b3b;
  color: #fff8f4;
}

.btn--danger:hover:not(:disabled) {
  background: #8e3c2e;
}

.btn--danger-ghost {
  border-color: rgba(166, 75, 59, 0.28);
  background: rgba(166, 75, 59, 0.05);
  color: #984333;
}

.btn--danger-ghost:hover:not(:disabled) {
  background: rgba(166, 75, 59, 0.1);
}

.btn.is-loading::before {
  width: 12px;
  height: 12px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  content: "";
  animation: spin 0.7s linear infinite;
}

.icon-btn--danger {
  color: #a64b3b;
}

.icon-btn--danger:hover {
  border-color: rgba(166, 75, 59, 0.22);
  background: rgba(166, 75, 59, 0.06);
  color: #8e3c2e;
}

.tag--admin {
  border-color: rgba(198, 161, 91, 0.26);
  background: var(--gold-soft);
  color: var(--amber);
}

.field-label--dark {
  color: var(--ink-soft);
}

.composer,
.panel,
.role-card,
.activity-card,
.content-card {
  border: 1px solid var(--line);
  background: var(--card);
}

.composer {
  margin-bottom: 22px;
  padding: 22px;
  border-radius: 16px;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.85) inset;
}

.composer__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 14px;
}

.composer__label {
  display: block;
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.03em;
}

.composer__head p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.7;
}

.composer textarea,
.role-note-form textarea,
.modal-form input,
.modal-form textarea,
.inline-input input {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  outline: 0;
  background: #fff;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 12px;
  line-height: 1.8;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.composer textarea,
.role-note-form textarea,
.modal-form textarea {
  padding: 11px 13px;
  resize: vertical;
}

.composer textarea {
  min-height: 80px;
}

.modal-form input,
.inline-input input {
  height: 43px;
  padding: 0 12px;
}

.composer textarea:focus,
.role-note-form textarea:focus,
.modal-form input:focus,
.modal-form textarea:focus,
.inline-input input:focus {
  border-color: rgba(31, 107, 82, 0.55);
  box-shadow: 0 0 0 4px rgba(31, 107, 82, 0.07);
}

.composer__foot {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 11px;
  margin-top: 12px;
}

.file-pick {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 10px;
  border: 1px dashed rgba(21, 34, 29, 0.22);
  border-radius: 8px;
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.file-pick:hover {
  border-color: rgba(31, 107, 82, 0.45);
  background: rgba(31, 107, 82, 0.04);
  color: var(--green);
}

.file-pick .icon {
  width: 14px;
  height: 14px;
}

.file-pick input {
  display: none;
}

.file-pick--small {
  height: 32px;
  padding: 0 9px;
}

.file-pick__summary {
  min-width: 0;
  overflow: hidden;
  color: var(--muted-light);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.composer__foot .btn {
  margin-left: auto;
}

/* ---------- Shared content ---------- */

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

.section-heading--toolbar {
  margin-top: 2px;
}

.section-heading__actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.section-heading__note {
  padding-bottom: 4px;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.02em;
}

.content-list {
  display: grid;
  gap: 15px;
}

.content-card {
  position: relative;
  padding: 21px 22px;
  border-radius: 16px;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.85) inset;
}

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

.content-card__byline {
  display: flex;
  align-items: center;
  gap: 10px;
}

.content-card__byline > div {
  display: flex;
  flex-direction: column;
  line-height: 1.45;
}

.content-card__byline strong {
  font-size: 12px;
  font-weight: 600;
}

.content-card__byline > div span {
  color: var(--muted-light);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.02em;
}

.content-card__text {
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.95;
  white-space: pre-wrap;
  word-break: break-word;
}

.image-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
  margin-top: 15px;
}

.image-card {
  position: relative;
  min-width: 0;
  margin: 0;
}

.image-card > a {
  display: block;
  overflow: hidden;
  border-radius: 10px;
  background: var(--paper-deep);
}

.image-card img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.image-card:hover img {
  transform: scale(1.025);
}

.image-card figcaption {
  margin-top: 5px;
  overflow: hidden;
  color: var(--muted);
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.image-card__tools {
  position: absolute;
  top: 6px;
  right: 6px;
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.image-card:hover .image-card__tools,
.image-card:focus-within .image-card__tools {
  opacity: 1;
}

.image-card__tools .icon-btn {
  width: 29px;
  height: 29px;
  border-color: rgba(255, 255, 255, 0.35);
  background: rgba(10, 20, 16, 0.68);
  color: #fff;
  backdrop-filter: blur(6px);
}

.image-card__tools .icon-btn:hover {
  border-color: rgba(255, 255, 255, 0.65);
  background: rgba(10, 20, 16, 0.85);
  color: #fff;
}

.attachment-list {
  display: grid;
  gap: 7px;
  margin-top: 14px;
}

.attachment {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(243, 240, 232, 0.48);
}

.attachment__icon {
  display: grid;
  width: 30px;
  height: 30px;
  flex: none;
  place-items: center;
  border-radius: 7px;
  background: var(--green-soft);
  color: var(--green);
}

.attachment__icon .icon {
  width: 15px;
  height: 15px;
}

.attachment__meta {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
  line-height: 1.45;
}

.attachment__meta a {
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attachment__meta a:hover {
  color: var(--green);
}

.attachment__meta span {
  overflow: hidden;
  color: var(--muted-light);
  font-family: var(--mono);
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attachment .icon-btn {
  width: 29px;
  height: 29px;
  flex: none;
}

.attachment .icon-btn .icon {
  width: 14px;
  height: 14px;
}

.empty-state {
  display: flex;
  align-items: center;
  flex-direction: column;
  padding: 58px 24px;
  border: 1px dashed rgba(21, 34, 29, 0.16);
  border-radius: 16px;
  background: rgba(251, 250, 246, 0.46);
  text-align: center;
}

.empty-state__icon {
  display: grid;
  width: 48px;
  height: 48px;
  margin-bottom: 15px;
  place-items: center;
  border-radius: 50%;
  background: var(--paper-deep);
  color: var(--muted);
}

.empty-state__icon .icon {
  width: 21px;
  height: 21px;
}

.empty-state strong {
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 600;
}

.empty-state p {
  max-width: 410px;
  margin-top: 6px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.8;
}

.panel-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 250px;
  border: 1px dashed rgba(21, 34, 29, 0.13);
  border-radius: 16px;
  color: var(--muted);
  font-size: 10px;
}

.panel-loading__text {
  margin-left: 5px;
}

.loading-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--green);
  animation: load-pulse 1.1s ease-in-out infinite;
}

.loading-dot:nth-child(2) {
  animation-delay: 0.14s;
}

.loading-dot:nth-child(3) {
  animation-delay: 0.28s;
}

@keyframes load-pulse {
  0%,
  100% {
    opacity: 0.25;
    transform: translateY(0);
  }
  50% {
    opacity: 1;
    transform: translateY(-3px);
  }
}

/* ---------- Activities list ---------- */

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

.activity-card {
  display: flex;
  min-height: 300px;
  flex-direction: column;
  padding: 23px;
  border-radius: 18px;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.85) inset;
  transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
}

.activity-card:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow-card);
  transform: translateY(-3px);
}

.activity-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 13px;
}

.activity-card__title {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 25px;
  font-weight: 600;
  line-height: 1.3;
  text-align: left;
  cursor: pointer;
  transition: color 0.2s ease;
  word-break: break-word;
}

.activity-card__title:hover {
  color: var(--green);
}

.activity-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 13px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.6;
}

.activity-meta span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.activity-meta .icon {
  width: 13px;
  height: 13px;
  color: var(--muted-light);
}

.activity-card__desc {
  display: -webkit-box;
  overflow: hidden;
  margin-top: 15px;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.85;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  white-space: pre-wrap;
}

.activity-team {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: auto;
  padding-top: 16px;
}

.team-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
}

.team-chip small {
  color: var(--muted-light);
  font-size: 8px;
}

.team-chip strong {
  color: var(--muted);
  font-size: 8px;
  font-weight: 600;
}

.team-chip.has-person {
  border-color: rgba(31, 107, 82, 0.15);
  background: rgba(31, 107, 82, 0.055);
}

.team-chip.has-person strong {
  color: var(--green-deep);
}

.activity-card__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 17px;
  padding-top: 13px;
  border-top: 1px solid var(--line);
  color: var(--muted-light);
  font-size: 8px;
}

.activity-card__foot .text-link {
  border-bottom: 0;
  color: var(--green);
  font-size: 10px;
}

.activity-card__foot .text-link .icon {
  width: 14px;
  height: 14px;
}

/* ---------- Activity detail ---------- */

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 24px 0 12px;
  padding: 4px 0;
  border: 0;
  border-bottom: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.back-link:hover {
  border-color: var(--line-strong);
  color: var(--ink);
}

.back-link .icon {
  width: 14px;
  height: 14px;
}

.activity-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 40px;
  overflow: hidden;
  padding: 38px 40px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background:
    radial-gradient(circle at 96% 3%, rgba(198, 161, 91, 0.13), transparent 30%),
    radial-gradient(circle at 0% 100%, rgba(31, 107, 82, 0.06), transparent 35%),
    var(--card);
  box-shadow: var(--shadow-soft);
}

.activity-hero__main h1 {
  margin: 16px 0 12px;
  font-family: var(--serif);
  font-size: clamp(36px, 4.4vw, 54px);
  font-weight: 600;
  line-height: 1.15;
}

.activity-meta--large {
  gap: 18px;
  margin-top: 0;
  font-size: 10px;
}

.activity-preface {
  max-width: 760px;
  margin-top: 22px;
  padding-left: 16px;
  border-left: 2px solid rgba(198, 161, 91, 0.48);
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 2;
  white-space: pre-wrap;
  word-break: break-word;
}

.activity-hero__side {
  display: flex;
  align-items: flex-end;
  flex-direction: column;
  gap: 12px;
}

.activity-tab-content {
  animation: view-in 0.3s ease both;
}

.role-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 15px;
  align-items: start;
}

.role-card {
  overflow: hidden;
  border-radius: 16px;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.85) inset;
}

.role-card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 19px 18px 15px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(130deg, rgba(31, 107, 82, 0.05), transparent 55%);
}

.role-card__head > div {
  display: flex;
  align-items: baseline;
  gap: 7px;
}

.role-card__index {
  color: var(--gold);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.05em;
}

.role-card__head h3 {
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.role-assignee {
  max-width: 148px;
  height: 31px;
  padding: 0 25px 0 8px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  outline: 0;
  background: #fff;
  color: var(--ink-soft);
  font-size: 9px;
  cursor: pointer;
}

.role-assignee:focus {
  border-color: rgba(31, 107, 82, 0.55);
  box-shadow: 0 0 0 3px rgba(31, 107, 82, 0.07);
}

.role-assignee-text {
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink-soft);
  font-size: 9px;
  font-weight: 500;
  white-space: nowrap;
}

.role-block {
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

.role-block:last-child {
  border-bottom: 0;
}

.role-block__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.role-block__head h4 {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
}

.role-block__head span {
  color: var(--muted-light);
  font-family: var(--mono);
  font-size: 8px;
}

.role-hint {
  margin-bottom: 10px;
  color: var(--muted-light);
  font-size: 8.5px;
  line-height: 1.7;
}

.work-items {
  display: grid;
  gap: 5px;
}

.work-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 34px;
  padding: 6px 8px;
  border: 1px solid transparent;
  border-radius: 7px;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.work-item:hover {
  border-color: var(--line);
  background: rgba(243, 240, 232, 0.52);
}

.work-item.is-published {
  background: rgba(31, 107, 82, 0.035);
}

.work-item__check {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  color: var(--ink-soft);
  font-size: 10px;
  cursor: pointer;
}

.work-item__check input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.work-item__box {
  position: relative;
  width: 14px;
  height: 14px;
  flex: none;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: #fff;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.work-item__check input:checked + .work-item__box {
  border-color: var(--green);
  background: var(--green);
}

.work-item__check input:checked + .work-item__box::after {
  position: absolute;
  top: 1px;
  left: 4px;
  width: 3px;
  height: 6px;
  border: solid #fff;
  border-width: 0 1.5px 1.5px 0;
  content: "";
  transform: rotate(45deg);
}

.work-item__check input:focus-visible + .work-item__box {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

.work-item__static {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ink-soft);
  font-size: 10px;
}

.work-item__static .icon {
  width: 13px;
  height: 13px;
  color: var(--muted-light);
}

.work-item.is-completed .work-item__static {
  color: var(--muted);
  text-decoration: line-through;
}

.work-state {
  flex: none;
  padding: 2px 6px;
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--green);
  font-size: 8px;
  white-space: nowrap;
}

.work-state--done {
  background: rgba(31, 107, 82, 0.13);
  color: var(--green-deep);
}

.work-state--muted {
  background: var(--paper-deep);
  color: var(--muted-light);
}

.role-empty {
  padding: 12px 0;
  color: var(--muted-light);
  font-size: 9px;
}

.role-note-form,
.role-file-form {
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
}

.role-note-form textarea {
  min-height: 55px;
  flex: 1 1 100%;
  font-size: 10px;
}

.role-note-form .btn {
  margin-left: auto;
}

.role-file-form .file-pick__summary {
  flex: 1;
}

.note-list {
  display: grid;
  gap: 7px;
}

.note-item {
  padding: 9px 10px;
  border-radius: 8px;
  background: var(--paper);
}

.note-item p {
  color: var(--ink-soft);
  font-size: 9.5px;
  line-height: 1.75;
  white-space: pre-wrap;
  word-break: break-word;
}

.note-item__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 5px;
}

.note-item__meta span {
  color: var(--muted-light);
  font-size: 7.5px;
}

.note-item__meta .icon-btn {
  width: 24px;
  height: 24px;
}

.note-item__meta .icon-btn .icon {
  width: 12px;
  height: 12px;
}

.role-card .image-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 0;
  margin-bottom: 9px;
}

.role-card .attachment-list {
  margin-top: 0;
}

.role-card .attachment {
  padding: 7px 8px;
}

.role-card .attachment__meta a {
  font-size: 9px;
}

.role-card .attachment__meta span {
  font-size: 7px;
}

.display-layout .composer {
  margin-top: 4px;
}

/* ---------- Personal area ---------- */

.personal-hero {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 36px;
  overflow: hidden;
  margin-top: 34px;
  padding: 42px 44px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background:
    radial-gradient(circle at 93% 8%, rgba(107, 90, 134, 0.1), transparent 30%),
    radial-gradient(circle at 2% 100%, rgba(31, 107, 82, 0.08), transparent 35%),
    var(--card);
  box-shadow: var(--shadow-soft);
}

.personal-hero::before {
  position: absolute;
  top: -95px;
  right: 160px;
  width: 240px;
  height: 240px;
  border: 1px solid rgba(107, 90, 134, 0.11);
  border-radius: 50%;
  content: "";
  pointer-events: none;
}

.personal-identity {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 23px;
  min-width: 0;
}

.personal-identity h1 {
  margin: 10px 0 7px;
  font-family: var(--serif);
  font-size: clamp(38px, 4.5vw, 56px);
  font-weight: 600;
  line-height: 1.1;
}

.personal-sub {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.03em;
}

.personal-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 12px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  color: var(--muted);
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.badge .icon {
  width: 12px;
  height: 12px;
}

.badge--admin {
  border-color: rgba(198, 161, 91, 0.28);
  background: var(--gold-soft);
  color: var(--amber);
}

.badge--soft {
  border-color: rgba(31, 107, 82, 0.14);
  background: var(--green-soft);
  color: var(--green-deep);
}

.personal-stats {
  position: relative;
  z-index: 1;
  display: flex;
  flex: none;
  gap: 0;
  padding: 5px 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(251, 250, 246, 0.78);
}

.personal-stats > div {
  display: flex;
  align-items: center;
  min-width: 78px;
  flex-direction: column;
  padding: 9px 16px;
  border-right: 1px solid var(--line);
}

.personal-stats > div:last-child {
  border-right: 0;
}

.personal-stats strong {
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 600;
  line-height: 1;
}

.personal-stats span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 8px;
  white-space: nowrap;
}

.admin-notice {
  display: flex;
  align-items: flex-start;
  gap: 13px;
  margin-top: 17px;
  padding: 16px 19px;
  border: 1px solid rgba(198, 161, 91, 0.25);
  border-radius: 14px;
  background:
    linear-gradient(100deg, rgba(198, 161, 91, 0.1), transparent 60%),
    var(--card);
}

.admin-notice__icon {
  display: grid;
  width: 36px;
  height: 36px;
  flex: none;
  place-items: center;
  border-radius: 50%;
  background: var(--gold-soft);
  color: var(--amber);
}

.admin-notice__icon .icon {
  width: 17px;
  height: 17px;
}

.admin-notice strong {
  display: block;
  color: var(--ink);
  font-size: 11px;
  font-weight: 600;
}

.admin-notice p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.7;
}

.personal-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.82fr) minmax(0, 1.18fr);
  gap: 17px;
  margin-top: 18px;
  align-items: start;
}

.panel {
  padding: 24px;
  border-radius: 18px;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.85) inset;
}

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

.panel--error {
  margin-top: 30px;
}

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

.panel__head h2 {
  margin-top: 4px;
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 600;
  letter-spacing: 0.03em;
}

.panel__hint {
  margin-top: 8px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.8;
}

.name-form {
  margin-top: 3px;
}

.inline-input {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.inline-input input {
  min-width: 0;
  flex: 1;
}

.inline-input .btn {
  flex: none;
}

.danger-zone {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 21px;
  padding-top: 17px;
  border-top: 1px dashed var(--line);
}

.danger-zone strong {
  display: block;
  color: #8e3c2e;
  font-size: 10px;
  font-weight: 600;
}

.danger-zone p {
  margin-top: 3px;
  color: var(--muted-light);
  font-size: 8.5px;
  line-height: 1.7;
}

.todo-list {
  display: grid;
  gap: 7px;
}

.todo-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.todo-row:hover {
  border-color: rgba(31, 107, 82, 0.22);
  background: rgba(31, 107, 82, 0.025);
}

.todo-row input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.todo-row__box {
  position: relative;
  width: 17px;
  height: 17px;
  flex: none;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: var(--paper);
  transition: background 0.2s ease, border-color 0.2s ease;
}

.todo-row input:checked + .todo-row__box {
  border-color: var(--green);
  background: var(--green);
}

.todo-row input:checked + .todo-row__box::after {
  position: absolute;
  top: 2px;
  left: 5px;
  width: 4px;
  height: 8px;
  border: solid #fff;
  border-width: 0 1.7px 1.7px 0;
  content: "";
  transform: rotate(45deg);
}

.todo-row input:focus-visible + .todo-row__box {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

.todo-row__content {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
  line-height: 1.45;
}

.todo-row__content strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 11px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.todo-row__content span {
  overflow: hidden;
  margin-top: 2px;
  color: var(--muted);
  font-size: 8.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.todo-row__state {
  flex: none;
  padding: 3px 7px;
  border-radius: 999px;
  background: var(--paper);
  color: var(--muted);
  font-size: 8px;
}

.todo-row.is-completed {
  border-color: rgba(31, 107, 82, 0.13);
  background: rgba(31, 107, 82, 0.035);
}

.todo-row.is-completed .todo-row__content strong {
  color: var(--muted);
  text-decoration: line-through;
}

.todo-row.is-completed .todo-row__state {
  background: var(--green-soft);
  color: var(--green);
}

.personal-upload {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px;
  margin-bottom: 15px;
  padding-bottom: 15px;
  border-bottom: 1px dashed var(--line);
}

.personal-upload .file-pick__summary {
  flex: 1;
}

.personal-file-list {
  display: grid;
  gap: 7px;
}

.personal-file-list .attachment {
  background: #fff;
}

/* ---------- Modal ---------- */

body.modal-open {
  overflow: hidden;
}

.modal-layer {
  position: fixed;
  z-index: 200;
  inset: 0;
  display: grid;
  padding: 24px;
  overflow-y: auto;
  place-items: center;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 13, 10, 0.66);
  backdrop-filter: blur(10px);
  animation: gate-in 0.22s ease both;
}

.modal-card {
  position: relative;
  z-index: 1;
  width: min(560px, 100%);
  max-height: calc(100vh - 48px);
  padding: 28px 30px 26px;
  overflow-y: auto;
  border: 1px solid rgba(21, 34, 29, 0.1);
  border-radius: 22px;
  background:
    radial-gradient(circle at 100% 0, rgba(198, 161, 91, 0.1), transparent 28%),
    var(--card);
  color: var(--ink);
  box-shadow: 0 44px 120px rgba(0, 0, 0, 0.42);
  animation: modal-in 0.28s cubic-bezier(0.22, 0.72, 0.28, 1) both;
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
}

.modal-head h2 {
  margin-top: 4px;
  font-family: var(--serif);
  font-size: 29px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.modal-close {
  display: grid;
  width: 34px;
  height: 34px;
  flex: none;
  padding: 0;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.modal-close .icon {
  width: 15px;
  height: 15px;
}

.modal-close:hover {
  border-color: var(--line-strong);
  background: var(--paper);
  color: var(--ink);
}

.modal-message {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.9;
  white-space: pre-wrap;
}

.modal-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
  margin-top: 24px;
  padding-top: 17px;
  border-top: 1px solid var(--line);
}

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

.modal-form .field-label {
  margin-top: 8px;
}

.modal-form .field-label:first-child {
  margin-top: 0;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 8px;
}

.form-row .field-label {
  margin-top: 0;
}

/* ---------- Toast ---------- */

.toast-host {
  position: fixed;
  z-index: 300;
  right: 22px;
  bottom: 22px;
  display: flex;
  align-items: flex-end;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  max-width: min(380px, calc(100vw - 44px));
  padding: 11px 15px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-left: 3px solid #4f9d7f;
  border-radius: 9px;
  background: rgba(13, 28, 23, 0.94);
  color: #f5f0e3;
  font-size: 10px;
  line-height: 1.6;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.22);
  animation: toast-in 0.25s ease both;
  backdrop-filter: blur(10px);
}

.toast--error {
  border-left-color: #c96c56;
}

.toast.is-leaving {
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

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

.noscript-note--page {
  position: fixed;
  z-index: 400;
  right: 20px;
  bottom: 20px;
  left: 20px;
  margin: 0;
  text-align: center;
}

/* ---------- Workspace responsive ---------- */

@media (max-width: 1080px) {
  .role-grid {
    grid-template-columns: 1fr;
  }

  .role-assignee {
    max-width: none;
    min-width: 160px;
  }

  .role-card .image-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .personal-hero {
    align-items: flex-start;
    flex-direction: column;
    gap: 24px;
  }

  .personal-stats {
    align-self: stretch;
    justify-content: space-between;
  }

  .personal-stats > div {
    flex: 1;
  }
}

@media (max-width: 900px) {
  .page-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 18px;
    padding-top: 40px;
  }

  .page-head__side {
    align-items: flex-start;
    flex-direction: row;
    gap: 14px;
  }

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

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

  .panel--files {
    grid-column: auto;
  }

  .activity-hero {
    grid-template-columns: 1fr;
    gap: 22px;
  }

  .activity-hero__side {
    align-items: flex-start;
    flex-direction: row;
    flex-wrap: wrap;
  }

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

  .role-card .image-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .main--workspace {
    padding-bottom: 44px;
  }

  .page-head {
    padding: 32px 0 23px;
  }

  .page-head__copy h1 {
    font-size: 39px;
  }

  .seg-tabs {
    width: 100%;
    margin-bottom: 20px;
  }

  .seg-tab {
    flex: 1;
    padding: 0 10px;
    font-size: 11px;
  }

  .section-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .section-heading__actions {
    width: 100%;
    justify-content: space-between;
  }

  .composer {
    padding: 18px 16px;
  }

  .composer__head {
    gap: 12px;
  }

  .composer__foot .btn {
    width: 100%;
    margin-left: 0;
  }

  .file-pick__summary {
    flex: 1;
  }

  .content-card {
    padding: 18px 16px;
  }

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

  .activity-card {
    min-height: 0;
    padding: 20px;
  }

  .activity-card__title {
    font-size: 23px;
  }

  .activity-card__foot {
    align-items: flex-start;
    flex-direction: column;
    gap: 9px;
  }

  .activity-hero {
    padding: 26px 22px;
    border-radius: 18px;
  }

  .activity-hero__main h1 {
    font-size: 36px;
  }

  .activity-preface {
    padding-left: 12px;
    font-size: 11px;
  }

  .role-card__head {
    align-items: flex-start;
    flex-direction: column;
  }

  .role-assignee {
    width: 100%;
  }

  .work-item {
    align-items: flex-start;
  }

  .personal-hero {
    padding: 27px 22px;
    border-radius: 18px;
  }

  .personal-identity {
    align-items: flex-start;
    flex-direction: column;
    gap: 17px;
  }

  .personal-identity h1 {
    font-size: 38px;
  }

  .avatar--xl {
    width: 66px;
    height: 66px;
    font-size: 21px;
  }

  .personal-stats > div {
    min-width: 0;
    padding: 8px 10px;
  }

  .personal-stats strong {
    font-size: 22px;
  }

  .panel {
    padding: 19px 16px;
  }

  .inline-input {
    flex-direction: column;
  }

  .inline-input .btn {
    width: 100%;
  }

  .danger-zone {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }

  .danger-zone .btn {
    width: 100%;
  }

  .modal-layer {
    padding: 10px;
  }

  .modal-card {
    max-height: calc(100vh - 20px);
    padding: 23px 19px 20px;
    border-radius: 18px;
  }

  .modal-head h2 {
    font-size: 25px;
  }

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

  .modal-actions .btn {
    flex: 1;
  }

  .toast-host {
    right: 12px;
    bottom: 12px;
    left: 12px;
    align-items: stretch;
  }

  .toast {
    max-width: none;
  }
}

@media (hover: none) {
  .image-card__tools {
    opacity: 1;
  }
}
