/* COS Space — quiet surfaces, precise hierarchy, immediate feedback.
   Design principles: Emil Kowalski / emil-design-eng, apple-design, mobile-native. */
:root {
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Microsoft YaHei", sans-serif;
  font-synthesis: none;
  font-optical-sizing: auto;
  color: #23252d;
  background: #fafaf9;
  --ink: #23252d;
  --muted: #757985;
  --accent: #4964e8;
  --line: rgba(25, 29, 45, 0.09);
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --surface-shadow:
    0 0 0 1px rgba(25, 29, 45, 0.075), 0 2px 3px rgba(25, 29, 45, 0.025),
    0 6px 16px rgba(25, 29, 45, 0.025);
}
* {
  box-sizing: border-box;
}
html {
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
  overscroll-behavior: none;
}
body {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.5;
}
button,
input,
select {
  font: inherit;
}
button,
a,
[role="button"] {
  touch-action: manipulation;
}
button {
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}
button,
a {
  -webkit-tap-highlight-color: transparent;
}
button {
  position: relative;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 0.45rem;
  min-height: 2.25rem;
  padding: 0.5rem 0.85rem;
  border: 0;
  border-radius: 0.5rem;
  background: white;
  color: #454955;
  box-shadow:
    0 0 0 1px var(--line),
    0 1px 2px #19203008;
  cursor: pointer;
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.3;
  white-space: nowrap;
  transition:
    transform 130ms var(--ease-out),
    background-color 130ms ease,
    opacity 130ms ease;
}
button:active:not(:disabled) {
  transform: scale(0.975);
}
button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}
button[aria-busy="true"] {
  cursor: progress;
  opacity: 0.8;
}
button[aria-busy="true"] > * {
  opacity: 0.15;
}
button[aria-busy="true"]::after {
  content: "";
  position: absolute;
  width: 1rem;
  height: 1rem;
  border: 1.5px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 650ms linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
button.primary {
  background: linear-gradient(#5470f1, #4661df);
  color: white;
  box-shadow:
    inset 0 1px 0 #ffffff20,
    0 0 0 1px #3851cb,
    0 2px 3px #2742ba20;
}
button.quiet {
  background: transparent;
  box-shadow: none;
}
button.danger {
  color: #b04c4c;
}
a {
  color: var(--accent);
  text-decoration: none;
}
:focus-visible {
  outline: 3px solid #7991ff;
  outline-offset: 3px;
}
input:focus-visible {
  outline: none;
}
.ui-icon {
  width: 1.125rem;
  height: 1.125rem;
  flex-shrink: 0;
  vertical-align: middle;
}
.icon-button {
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
}
.small {
  font-size: 0.75rem;
}
.muted {
  color: var(--muted);
}
.full {
  width: 100%;
}
.mono {
  font-family: ui-monospace, SFMono-Regular, monospace;
  font-size: 0.75rem;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  color: inherit;
  font-size: 1.125rem;
  font-weight: 650;
  letter-spacing: -0.035em;
  white-space: nowrap;
}
.brand-light {
  font-weight: 430;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  color: white;
  background: #506ae8;
  border-radius: 0.55rem;
  box-shadow:
    inset 0 1px 0 #ffffff26,
    0 2px 5px #00000018;
}
.brand-mark .ui-icon {
  width: 1.35rem;
  height: 1.35rem;
  stroke-width: 1.7;
}
.eyebrow {
  font-family: ui-monospace, SFMono-Regular, monospace;
  font-size: 0.625rem;
  letter-spacing: 0.11em;
  font-weight: 500;
  color: #9295a0;
}
.dot,
.status-dot {
  width: 0.375rem;
  height: 0.375rem;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
  background: currentColor;
}
.tag {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border-radius: 0.375rem;
  padding: 0.3rem 0.5rem;
  font-size: 0.6875rem;
  line-height: 1.2;
  color: #637082;
  background: #f2f3f5;
  white-space: nowrap;
}
.tag.ok {
  color: #397756;
  background: #eff7f1;
}
.tag.warn {
  color: #957031;
  background: #fbf5e8;
}
.tag.neutral {
  color: #858894;
  background: #f2f3f5;
}
.initial {
  padding: 25vh 10vw;
  color: var(--muted);
}
.skip-link {
  position: fixed;
  top: 0.5rem;
  left: 0.5rem;
  z-index: 100;
  background: white;
  padding: 0.7rem;
  border-radius: 0.5rem;
  transform: translateY(-160%);
}
.skip-link:focus {
  transform: none;
}
/* Login: an editorial introduction, followed by one clear task. */
.auth {
  display: grid;
  grid-template-columns: 1.04fr 1fr;
  min-height: 100svh;
}
.auth-story {
  position: relative;
  min-height: 100svh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 2.6rem clamp(2rem, 5vw, 5rem);
  background:
    radial-gradient(ellipse at 65% 77%, #323d632b, transparent 55%), #191c24;
  color: #f6f7fa;
}
.auth-story::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(#ffffff02 1px, transparent 1px),
    linear-gradient(90deg, #ffffff02 1px, transparent 1px);
  background-size: 48px 48px;
}
.auth-story > * {
  position: relative;
}
.story-body {
  margin: 3rem 0 1.6rem;
}
.story-kicker {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-family: ui-monospace, SFMono-Regular, monospace;
  font-size: 0.625rem;
  letter-spacing: 0.13em;
  color: #9cabc9;
}
.story-kicker .dot {
  color: #90a4f3;
  box-shadow: 0 0 0 4px #879deb10;
}
.auth-story h1 {
  font-size: clamp(2.7rem, 4.3vw, 4.5rem);
  font-weight: 550;
  line-height: 1.23;
  letter-spacing: -0.055em;
  margin: 1.6rem 0 1.3rem;
}
.auth-story h1 span {
  color: #b8bfce;
}
.auth-story p {
  color: #9ba3b4;
  font-size: 0.875rem;
  line-height: 1.9;
}
.cloud-visual {
  max-width: 31rem;
  margin: 0.5rem auto 0;
}
.cloud-visual svg {
  display: block;
  width: 100%;
  max-height: 17rem;
}
.visual-caption {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.9rem;
  color: #7f8ba6;
  font-size: 0.625rem;
}
.caption-line {
  width: 2.8rem;
  height: 1px;
  background: #4a536a;
}
.story-footer {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 1.5rem;
  border-top: 1px solid #ffffff0c;
  color: #969daf;
  font-size: 0.6875rem;
}
.story-footer > span {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.story-footer .ui-icon {
  width: 0.9375rem;
  height: 0.9375rem;
}
.auth-form-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 7rem 2.5rem;
  background: #fcfcfb;
}
.auth-topnote,
.auth-bottomnote {
  position: absolute;
  left: 3rem;
  right: 3rem;
  font-size: 0.625rem;
  color: #8a8d97;
  letter-spacing: 0.04em;
}
.auth-topnote {
  top: 3rem;
  display: flex;
  gap: 0.75rem;
}
.auth-topnote span {
  color: #d1d3d9;
}
.auth-bottomnote {
  bottom: 2.6rem;
  text-align: center;
  letter-spacing: 0.025em;
}
.auth-form {
  width: 100%;
  max-width: 22.5rem;
}
.auth-symbol {
  width: 3.15rem;
  height: 3.15rem;
  display: grid;
  place-items: center;
  border-radius: 0.9rem;
  background: #f0f2fc;
  color: #4f67d8;
  margin-bottom: 1.8rem;
  box-shadow: inset 0 0 0 1px #516bde0d;
}
.auth-symbol .ui-icon {
  width: 1.625rem;
  height: 1.625rem;
}
.auth-form h2 {
  font-size: 1.65rem;
  line-height: 1.3;
  font-weight: 600;
  letter-spacing: -0.045em;
  margin: 0 0 0.7rem;
}
.auth-form .intro {
  color: var(--muted);
  line-height: 1.8;
  font-size: 0.8125rem;
  margin: 0 0 2rem;
}
.field {
  display: grid;
  gap: 0.5rem;
  margin: 1.125rem 0;
}
.field label {
  font-size: 0.8125rem;
  color: #414550;
  font-weight: 500;
}
.field small {
  font-size: 0.6875rem;
  color: var(--muted);
  line-height: 1.75;
}
input,
select {
  width: 100%;
  min-width: 0;
  height: 2.65rem;
  border: 0;
  border-radius: 0.5rem;
  padding: 0.65rem 0.75rem;
  background: #fff;
  color: var(--ink);
  box-shadow:
    0 0 0 1px #22283820,
    0 1px 2px #22283803;
  font-size: 0.8125rem;
  transition: box-shadow 130ms ease;
}
input::placeholder {
  color: #a0a3ad;
}
input:focus,
select:focus {
  box-shadow:
    0 0 0 1px #7187ee,
    0 0 0 4px #4964e810;
}
input[type="checkbox"] {
  width: 0.9375rem;
  height: 0.9375rem;
  padding: 0;
  accent-color: var(--accent);
  box-shadow: none;
  cursor: pointer;
  flex-shrink: 0;
}
input[type="file"] {
  height: auto;
  min-height: 2.65rem;
  font-size: 0.75rem;
  padding: 0.5rem;
  background: #fafafb;
}
input::file-selector-button {
  border: 0;
  padding: 0.45rem 0.65rem;
  border-radius: 0.35rem;
  margin-right: 0.75rem;
  background: #edeff6;
  color: #4c5264;
  cursor: pointer;
}
.password-input {
  position: relative;
}
.password-input input {
  padding-right: 3rem;
}
.password-toggle {
  position: absolute;
  right: 0.2rem;
  top: 0.2rem;
  background: none;
  box-shadow: none;
  color: #9095a2;
}
.auth-submit {
  min-height: 2.65rem;
  margin-top: 0.75rem;
  justify-content: space-between;
  padding-inline: 1rem;
}
.auth-help {
  font-size: 0.6875rem;
  color: #8a8e98;
  text-align: center;
  margin: 1.125rem 0 2rem;
}
.auth-footer {
  display: flex;
  justify-content: space-between;
  gap: 0.6rem;
  padding-top: 1.35rem;
  border-top: 1px solid var(--line);
  font-size: 0.6875rem;
}
.auth-footer > span,
.auth-footer > a {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.auth-footer > span {
  color: #858a96;
}
.auth-footer .ui-icon {
  width: 0.85rem;
  height: 0.85rem;
}
.error {
  background: #fff2f0;
  color: #a3433c;
  padding: 0.75rem;
  border-radius: 0.5rem;
  margin: 0.8rem 0;
  font-size: 0.75rem;
  line-height: 1.7;
}
.error:empty {
  display: none;
}
/* Workspace: stable chrome, quiet content, an identifiable primary action. */
.shell {
  display: grid;
  grid-template-columns: 15.25rem minmax(0, 1fr);
  min-height: 100dvh;
}
.sidebar {
  position: sticky;
  top: 0;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: 1.65rem 1rem 1rem;
  color: #f2f3f6;
  background: #191b20;
}
.sidebar .brand {
  padding: 0.1rem 0.625rem;
}
.workspace-switch {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.75rem;
  border-radius: 0.55rem;
  margin-top: 2.05rem;
  background: #24262d;
  box-shadow: inset 0 0 0 1px #ffffff09;
  min-width: 0;
}
.workspace-icon {
  display: grid;
  place-items: center;
  width: 1.9rem;
  height: 1.9rem;
  background: #313540;
  border-radius: 0.4rem;
  color: #abb6db;
  flex-shrink: 0;
}
.workspace-switch > div:nth-child(2) {
  min-width: 0;
}
.workspace-switch strong {
  display: block;
  font-size: 0.75rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 7.5rem;
}
.workspace-switch small {
  display: block;
  font-size: 0.6rem;
  color: #8b909d;
  margin-top: 0.2rem;
}
.workspace-role {
  font-family: ui-monospace, SFMono-Regular, monospace;
  font-size: 0.5rem;
  letter-spacing: 0.035em;
  color: #9ba1b3;
  margin-left: auto;
}
.side-label {
  color: #777d8c;
  margin: 1.9rem 0.7rem 0.65rem;
  font-size: 0.625rem;
}
.nav {
  display: grid;
  gap: 0.35rem;
}
.nav button {
  justify-content: flex-start;
  color: #9da3b0;
  background: none;
  box-shadow: none;
  padding: 0.7rem 0.8rem;
  min-height: 2.5rem;
}
.nav button > .button-label {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
}
.nav button.active {
  background: #2c2f3b;
  color: #f3f4ff;
  box-shadow: inset 0 0 0 1px #ffffff05;
}
.nav button.active::before {
  content: "";
  position: absolute;
  width: 2px;
  height: 1.1rem;
  background: #8298fa;
  left: 0;
  border-radius: 2px;
}
.nav-count {
  margin-left: auto;
  font-variant-numeric: tabular-nums;
  font-size: 0.625rem;
  color: #8f96aa;
  background: #ffffff07;
  border-radius: 0.25rem;
  padding: 0.05rem 0.35rem;
}
.nav button.active .nav-count {
  color: #bcc8ff;
  background: #7186df1a;
}
.side-bottom {
  margin-top: auto;
  padding-top: 3rem;
}
.side-assurance {
  display: flex;
  gap: 0.65rem;
  padding: 0.9rem 0.65rem 1.1rem;
  color: #9097a6;
}
.side-assurance > .ui-icon {
  color: #757f98;
  margin-top: 0.1rem;
}
.side-assurance strong {
  font-size: 0.6875rem;
  font-weight: 450;
}
.side-assurance p {
  font-size: 0.625rem;
  line-height: 1.8;
  color: #717989;
  margin: 0.4rem 0 0;
}
button.side-help {
  justify-content: flex-start;
  width: 100%;
  color: #9ba2b2;
  background: transparent;
  box-shadow: none;
  padding: 0.6rem 0.7rem;
  font-size: 0.75rem;
}
.side-profile {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  border-top: 1px solid #ffffff0c;
  padding: 1.1rem 0.55rem 0.2rem;
  margin-top: 0.8rem;
}
.side-profile .identity strong {
  color: #c9ced9;
  font-size: 0.6875rem;
  max-width: 8rem;
}
.side-profile .identity small {
  color: #777f91;
  font-size: 0.6rem;
}
.side-profile .avatar {
  background: #303647;
  color: #a9b9ee;
  width: 1.95rem;
  height: 1.95rem;
  font-size: 0.75rem;
}
.profile-indicator {
  width: 0.4rem;
  height: 0.4rem;
  background: #74a788;
  border-radius: 50%;
}
.main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 0 2.75rem;
}
.topbar {
  min-height: 4.6rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  box-shadow: 0 1px 0 var(--line);
}
.top-crumb {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  color: #8b909c;
  font-size: 0.6875rem;
}
.top-crumb > .ui-icon:first-child {
  width: 0.95rem;
  height: 0.95rem;
}
.top-crumb > .ui-icon:not(:first-child) {
  width: 0.65rem;
  height: 0.65rem;
  color: #bec1c9;
}
.top-crumb strong {
  color: #565c69;
  font-weight: 450;
}
.top-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.top-actions button {
  font-size: 0.6875rem;
  min-height: 2rem;
  padding: 0.4rem 0.55rem;
  color: #858b99;
}
.top-actions .ui-icon {
  width: 0.9375rem;
  height: 0.9375rem;
}
.admin-badge {
  color: #737b8e;
  background: #eceef2;
  padding: 0.2rem 0.45rem;
  font-size: 0.625rem;
  border-radius: 0.3rem;
  margin-right: 0.5rem;
}
#content {
  flex: 1;
  min-width: 0;
  outline: none;
}
.page-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  margin: 2.75rem 0 2rem;
}
.page-heading .eyebrow {
  margin-bottom: 0.7rem;
}
.page-heading h1 {
  font-size: 1.875rem;
  letter-spacing: -0.045em;
  line-height: 1.3;
  font-weight: 600;
  margin: 0 0 0.55rem;
  overflow-wrap: anywhere;
}
.page-heading p {
  color: var(--muted);
  font-size: 0.8125rem;
  margin: 0;
  line-height: 1.8;
}
.heading-actions {
  display: flex;
  flex-shrink: 0;
  gap: 0.65rem;
}
.heading-actions button {
  min-height: 2.5rem;
  padding-inline: 1rem;
}
.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-radius: 0.75rem;
  background: white;
  box-shadow: var(--surface-shadow);
  margin-bottom: 2.4rem;
  overflow: hidden;
}
.stat {
  padding: 1.35rem 1.6rem;
}
.stat + .stat {
  border-left: 1px solid var(--line);
}
.stat-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.7rem;
}
.stat-top .ui-icon {
  color: #a7aebb;
  width: 1rem;
  height: 1rem;
}
.stat .label {
  font-size: 0.75rem;
  color: #6f7685;
}
.stat .value {
  font-size: 2.35rem;
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: -0.055em;
  font-variant-numeric: tabular-nums;
  margin: 0.8rem 0 0.6rem;
}
.stat-unit {
  font-size: 0.6875rem;
  letter-spacing: 0;
  margin-left: 0.6rem;
  color: #969ca8;
  font-weight: 400;
}
.stat .note {
  font-size: 0.6875rem;
  color: #969ca6;
}
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin: 1.75rem 0 1.15rem;
}
.section-head h2 {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.9375rem;
  letter-spacing: -0.02em;
  font-weight: 580;
  margin: 0;
}
.section-head p {
  margin: 0.3rem 0 0;
  font-size: 0.6875rem;
  color: #9095a0;
}
.count-pill {
  font-family: ui-monospace, SFMono-Regular, monospace;
  background: #eeeff2;
  color: #8b919f;
  font-size: 0.625rem;
  font-weight: 400;
  border-radius: 0.25rem;
  padding: 0.05rem 0.35rem;
}
.search-field {
  position: relative;
  width: 15.5rem;
}
.search-field > .ui-icon {
  position: absolute;
  top: 50%;
  left: 0.65rem;
  transform: translateY(-50%);
  width: 1rem;
  height: 1rem;
  color: #a2a7b2;
  pointer-events: none;
}
.search-field input {
  padding-left: 2.05rem;
  height: 2.2rem;
  font-size: 0.6875rem;
  background: #fff;
}
.filter-tabs {
  display: flex;
  gap: 0.35rem;
  margin-bottom: 1rem;
}
.filter-tabs button {
  box-shadow: none;
  background: transparent;
  min-height: 1.95rem;
  padding: 0.4rem 0.8rem;
  font-size: 0.6875rem;
  color: #858b98;
}
.filter-tabs button.active {
  background: #ebedf3;
  color: #4e576c;
}
.panel {
  background: white;
  border-radius: 0.7rem;
  box-shadow: var(--surface-shadow);
  overflow: hidden;
}
.table-wrap {
  overflow-x: auto;
  overscroll-behavior: contain;
}
table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  white-space: nowrap;
  font-size: 0.75rem;
}
th {
  padding: 0.95rem 1.15rem;
  font-size: 0.625rem;
  font-weight: 500;
  color: #969daa;
  background: #fcfcfd;
  border-bottom: 1px solid var(--line);
}
td {
  padding: 1.15rem;
  border-bottom: 1px solid #22283809;
  color: #6d7585;
}
tr:last-child td {
  border-bottom: 0;
}
td strong {
  font-weight: 500;
  color: #3e4658;
}
td small {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.625rem;
  color: #939aaa;
}
.identity {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  min-width: 0;
}
.avatar {
  flex-shrink: 0;
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 0.6rem;
  display: grid;
  place-items: center;
  background: #edf0fb;
  color: #6e7cc2;
  font-size: 0.875rem;
  font-weight: 500;
}
.tone-1 {
  color: #857397;
  background: #f1edf7;
}
.tone-2 {
  color: #9c8863;
  background: #f6f1e8;
}
.tone-3 {
  color: #628878;
  background: #eaf3ee;
}
.identity-text {
  min-width: 0;
}
.identity strong {
  display: block;
  max-width: 15rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.number-cell {
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
  color: #626c80;
}
.number-separator {
  color: #c6cad3;
  margin: 0 0.6rem;
}
.date-cell {
  font-size: 0.6875rem;
  font-variant-numeric: tabular-nums;
  color: #9ba2af;
}
.table-actions {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  justify-content: flex-end;
}
.table-actions button {
  font-size: 0.6875rem;
  min-height: 1.9rem;
  padding: 0.4rem 0.5rem;
  color: #7c869b;
}
.table-actions .ui-icon {
  width: 0.9rem;
  height: 0.9rem;
}
.table-actions button.danger {
  color: #ae7777;
}
.actions-header {
  text-align: right;
  padding-right: 1.8rem;
}
.table-footer {
  display: flex;
  justify-content: space-between;
  padding: 0.85rem 1.15rem;
  border-top: 1px solid var(--line);
  font-size: 0.625rem;
  color: #a0a6b2;
}
.context-note {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 1.25rem 0;
  margin-top: 1rem;
}
.context-note > .ui-icon {
  color: #9ca7ba;
  width: 1.3rem;
  height: 1.3rem;
}
.context-note strong {
  font-size: 0.6875rem;
  color: #7a8495;
  font-weight: 500;
}
.context-note p {
  margin: 0.25rem 0 0;
  color: #9aa1ae;
  font-size: 0.625rem;
  line-height: 1.8;
}
.context-note > button {
  margin-left: auto;
  font-size: 0.625rem;
  color: #929aaa;
}
.context-note > button .ui-icon {
  display: none;
}
.main-footer {
  display: flex;
  justify-content: space-between;
  color: #b0b5bf;
  font-size: 0.6rem;
  border-top: 1px solid var(--line);
  margin-top: 3.5rem;
  padding: 1.1rem 0 1.4rem;
}
.main-footer > span:first-child {
  font-weight: 500;
  letter-spacing: -0.02em;
  color: #969eac;
}
.cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}
.bucket-card {
  padding: 1.4rem;
  min-width: 0;
  background: white;
  box-shadow: var(--surface-shadow);
  border-radius: 0.75rem;
}
.bucket-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}
.bucket-icon {
  width: 2.55rem;
  height: 2.55rem;
  display: grid;
  place-items: center;
  background: #f0f2fa;
  color: #7687c5;
  border-radius: 0.7rem;
}
.bucket-icon .ui-icon {
  width: 1.3rem;
  height: 1.3rem;
}
.region-label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: #9aa1b0;
  font-size: 0.625rem;
}
.region-label .ui-icon {
  width: 0.8rem;
  height: 0.8rem;
}
.bucket-card h3 {
  margin: 1.15rem 0 0.55rem;
  font-size: 0.9375rem;
  font-weight: 550;
  letter-spacing: -0.02em;
  overflow-wrap: anywhere;
}
.bucket-account {
  margin: 0;
  color: #9199a9;
  font-size: 0.6875rem;
  display: flex;
  gap: 0.4rem;
  align-items: center;
}
.bucket-account .ui-icon {
  width: 0.9rem;
  height: 0.9rem;
}
.bucket-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  padding-top: 1rem;
  margin-top: 1.4rem;
  border-top: 1px solid var(--line);
}
.bucket-bottom > div {
  display: flex;
  gap: 0.2rem;
}
.bucket-bottom button {
  padding: 0.4rem 0.35rem;
  font-size: 0.6875rem;
  min-height: 1.9rem;
}
.bucket-open {
  color: #6175bf;
}
.bucket-open .ui-icon {
  width: 1rem;
  height: 1rem;
}
.empty {
  padding: 3.2rem 1.5rem;
  background: white;
  border-radius: 0.75rem;
  box-shadow: var(--surface-shadow);
  text-align: center;
}
.empty-art {
  position: relative;
  width: 7.5rem;
  height: 5.7rem;
  margin: 0 auto 1.1rem;
  display: grid;
  place-items: center;
}
.empty-orbit {
  position: absolute;
  width: 6.5rem;
  height: 4.4rem;
  border: 1px dashed #dce1ee;
  border-radius: 50%;
  transform: rotate(-23deg);
}
.empty-tile {
  display: grid;
  place-items: center;
  width: 3.5rem;
  height: 3.5rem;
  background: linear-gradient(#fff, #f2f4fb);
  border-radius: 1rem;
  transform: rotate(-8deg);
  box-shadow:
    0 0 0 1px #8291c61c,
    0 7px 12px #314a9310;
  color: #8c9bc9;
}
.empty-tile .ui-icon {
  width: 1.7rem;
  height: 1.7rem;
}
.empty-plus {
  display: grid;
  place-items: center;
  position: absolute;
  right: 0.8rem;
  bottom: 0.65rem;
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 50%;
  background: #e9edfb;
  color: #778bc9;
  box-shadow: 0 0 0 3px white;
}
.empty-plus .ui-icon {
  width: 0.8rem;
  height: 0.8rem;
}
.empty h3 {
  font-size: 1rem;
  font-weight: 550;
  letter-spacing: -0.025em;
  margin: 0.7rem 0;
}
.empty p {
  max-width: 24rem;
  margin: 0.5rem auto 1.3rem;
  font-size: 0.75rem;
  color: #8c93a3;
  line-height: 1.9;
}
.info-note {
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
  color: #969dab;
  font-size: 0.6875rem;
  line-height: 1.8;
  margin: 1.25rem 0;
}
.info-note .ui-icon {
  width: 0.9rem;
  height: 0.9rem;
  margin-top: 0.12rem;
}
.breadcrumb {
  display: flex;
  gap: 0.2rem;
  align-items: center;
  flex-wrap: wrap;
  margin: 1rem 0 1.25rem;
  color: #b4bac5;
  font-size: 0.6875rem;
}
.breadcrumb button {
  background: transparent;
  box-shadow: none;
  padding: 0.3rem 0.5rem;
  font-size: 0.6875rem;
  min-height: 1.8rem;
  color: #7a859b;
}
.breadcrumb button:last-child {
  color: #475676;
  background: #eff1f7;
}
.file-controls {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}
.file-controls input[type="search"] {
  max-width: 15.5rem;
  height: 2.25rem;
}
.file-controls button {
  font-size: 0.6875rem;
}
.check {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  font-size: 0.6875rem;
  color: #858e9e;
  padding: 0.25rem;
}
.file-name {
  max-width: 25rem;
  min-width: 12rem;
  white-space: normal;
  overflow-wrap: anywhere;
  color: #65728c;
}
.file-name button {
  padding: 0;
  box-shadow: none;
  background: none;
  text-align: left;
  font-size: 0.75rem;
  color: #65728c;
  white-space: normal;
}
.file-name .ui-icon {
  width: 1.1rem;
  height: 1.1rem;
  margin-right: 0.5rem;
  color: #9aaacc;
}
.file-name button .ui-icon {
  color: #c5ad7d;
}
.file-controls + .info-note {
  margin-bottom: 1rem;
}
.pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.6875rem;
  color: #939cab;
  margin-top: 1rem;
  gap: 0.75rem;
}
.pagination > div {
  display: flex;
  gap: 0.5rem;
}
.pagination button {
  font-size: 0.6875rem;
}
.loading {
  padding: 5rem 1rem;
  text-align: center;
  color: #939dac;
  font-size: 0.8125rem;
  background: white;
  border-radius: 0.75rem;
  box-shadow: var(--surface-shadow);
}
.activity-item {
  display: flex;
  gap: 0.85rem;
  padding: 1.25rem 1.5rem;
  align-items: flex-start;
  border-bottom: 1px solid var(--line);
  font-size: 0.75rem;
}
.activity-item:last-child {
  border: 0;
}
.activity-icon {
  color: #9aa6c1;
}
.activity-icon .ui-icon {
  width: 1rem;
  height: 1rem;
}
.activity-copy {
  flex: 1;
  color: #626e84;
}
.activity-copy .target {
  color: #9ba4b3;
  font-size: 0.6875rem;
  margin-top: 0.35rem;
  overflow-wrap: anywhere;
}
.activity-item time {
  color: #a0a7b3;
  font-size: 0.625rem;
  font-variant-numeric: tabular-nums;
}
/* Occasional surfaces move briefly; navigation and repeated list actions don't. */
dialog {
  width: min(31rem, calc(100% - 2rem));
  padding: 1.8rem;
  max-height: calc(100dvh - 3rem);
  border: 0;
  border-radius: 1rem;
  color: var(--ink);
  background: #fdfdfd;
  box-shadow:
    0 0 0 1px #0000000a,
    0 12px 40px #11172825,
    0 40px 100px #11172820;
  overflow-y: auto;
  overscroll-behavior: contain;
  opacity: 0;
  transform: translateY(6px) scale(0.98);
  transition:
    opacity 140ms var(--ease-out),
    transform 180ms var(--ease-out),
    display 180ms allow-discrete,
    overlay 180ms allow-discrete;
}
dialog[open] {
  opacity: 1;
  transform: translateY(0) scale(1);
}
dialog::backdrop {
  background: #181d2b66;
  backdrop-filter: blur(3px);
  opacity: 0;
  transition:
    opacity 180ms var(--ease-out),
    display 180ms allow-discrete,
    overlay 180ms allow-discrete;
}
dialog[open]::backdrop {
  opacity: 1;
}
@starting-style {
  dialog[open] {
    opacity: 0;
    transform: translateY(6px) scale(0.98);
  }
  dialog[open]::backdrop {
    opacity: 0;
  }
}
.dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.dialog-head h2 {
  font-size: 1.2rem;
  font-weight: 570;
  letter-spacing: -0.035em;
  margin: 0;
  overflow-wrap: anywhere;
}
.dialog-head .icon-button {
  background: transparent;
  box-shadow: none;
  color: #989faf;
  margin-right: -0.5rem;
}
.dialog-intro {
  font-size: 0.75rem;
  color: #8790a0;
  line-height: 1.8;
  margin: 0.8rem 0 1.6rem;
}
.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.65rem;
  margin-top: 1.7rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--line);
}
.divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 1.4rem 0;
  color: #9da5b3;
  font-size: 0.625rem;
}
.divider::before,
.divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}
.notice {
  background: #f3f5fb;
  border-radius: 0.5rem;
  padding: 0.85rem 1rem;
  color: #7c89a3;
  font-size: 0.6875rem;
  line-height: 1.85;
}
.linkbox {
  background: #f5f6fa;
  border: 1px solid #e5e8f0;
  border-radius: 0.5rem;
  padding: 0.85rem;
  font-size: 0.75rem;
  overflow-wrap: anywhere;
  margin: 1rem 0;
  color: #617192;
}
.progress {
  width: 100%;
  height: 0.45rem;
  accent-color: var(--accent);
  margin-top: 1rem;
  border: 0;
  border-radius: 1rem;
  overflow: hidden;
}
.progress::-webkit-progress-bar {
  background: #edf0f9;
}
.progress::-webkit-progress-value {
  background: var(--accent);
}
.guide-steps {
  counter-reset: steps;
  display: grid;
  gap: 1.2rem;
  padding: 0;
  list-style: none;
}
.guide-steps li {
  counter-increment: steps;
  display: grid;
  grid-template-columns: 1.6rem 1fr;
  gap: 0.65rem;
  color: #758198;
  font-size: 0.75rem;
  line-height: 1.8;
}
.guide-steps li::before {
  content: counter(steps);
  display: grid;
  place-items: center;
  width: 1.5rem;
  height: 1.5rem;
  background: #eef1fb;
  border-radius: 0.4rem;
  color: #7c8ec4;
  font-size: 0.65rem;
}
#toast {
  position: fixed;
  bottom: calc(1.5rem + env(safe-area-inset-bottom, 0px));
  right: 1.5rem;
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  max-width: min(27rem, calc(100vw - 3rem));
  background: #fff;
  color: #616d84;
  box-shadow:
    0 0 0 1px #15234010,
    0 6px 20px #15234014,
    0 18px 50px #1523400a;
  padding: 1rem 1.15rem;
  border-radius: 0.75rem;
  font-size: 0.75rem;
  line-height: 1.75;
  z-index: 100;
  opacity: 1;
  transform: translateY(0);
  transition:
    opacity 150ms var(--ease-out),
    transform 180ms var(--ease-out),
    display 180ms allow-discrete;
}
#toast > .ui-icon {
  color: #8293c1;
  margin-top: 0.1rem;
}
#toast[hidden] {
  opacity: 0;
  transform: translateY(0.5rem);
}
@starting-style {
  #toast {
    opacity: 0;
    transform: translateY(0.5rem);
  }
}
[hidden] {
  display: none !important;
}
@media (hover: hover) and (pointer: fine) {
  button:hover:not(:disabled) {
    background-color: #f0f2f7;
  }
  button.primary:hover:not(:disabled) {
    background: linear-gradient(#5d78f5, #4c67e7);
  }
  a:hover {
    color: #6b7fec;
  }
  .brand:hover {
    color: inherit;
  }
  .nav button:hover:not(.active) {
    background: #ffffff06;
    color: #c8cedb;
  }
  button.side-help:hover {
    background: #ffffff06;
    color: #d0d5e0;
  }
  .nav button.active:hover {
    background: #323646;
  }
  tbody tr:hover {
    background: #f9fafd;
  }
  .bucket-card:hover {
    box-shadow:
      0 0 0 1px #536ca423,
      0 4px 16px #536ca408;
  }
  .password-toggle:hover {
    background: #edf0f7;
  }
}
@media (min-width: 1550px) {
  .main {
    padding-inline: 3.75rem;
  }
  .cards {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (max-width: 1180px) {
  .shell {
    grid-template-columns: 13.4rem minmax(0, 1fr);
  }
  .main {
    padding-inline: 1.65rem;
  }
  .workspace-role {
    display: none;
  }
  .stat {
    padding: 1.2rem;
  }
  .table-actions button {
    padding: 0.35rem;
  }
  .table-actions .ui-icon {
    display: none;
  }
  th,
  td {
    padding-inline: 0.85rem;
  }
  .auth-story {
    padding-inline: 2.5rem;
  }
}
@media (max-width: 800px) {
  .shell {
    grid-template-columns: 11.5rem minmax(0, 1fr);
  }
  .sidebar {
    padding-inline: 0.7rem;
  }
  .sidebar .brand {
    font-size: 1rem;
    padding-inline: 0.4rem;
    gap: 0.4rem;
  }
  .main {
    padding-inline: 1.25rem;
  }
  .cards {
    grid-template-columns: 1fr;
  }
  .page-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 1.2rem;
  }
  .stat {
    padding: 1rem 0.85rem;
  }
  .stat .note {
    display: none;
  }
  .stat .value {
    font-size: 2rem;
  }
  .stat-top .ui-icon {
    display: none;
  }
  .stat-unit {
    margin-left: 0.3rem;
  }
  .search-field {
    width: 13rem;
  }
  .auth-story {
    padding-inline: 2rem;
  }
  .story-footer {
    gap: 0.5rem;
    flex-wrap: wrap;
  }
  .auth-topnote {
    left: 2rem;
  }
}
@media (max-width: 620px) {
  .auth {
    display: block;
  }
  .auth-story {
    min-height: 0;
    padding: calc(1.2rem + env(safe-area-inset-top, 0px)) 1.5rem 1.2rem;
  }
  .story-body,
  .story-footer {
    display: none;
  }
  .auth-form-wrap {
    min-height: calc(100svh - 4.5rem);
    padding: 5rem 1.6rem 4.5rem;
    align-items: flex-start;
  }
  .auth-topnote {
    top: 1.75rem;
    left: 1.6rem;
  }
  .auth-bottomnote {
    bottom: calc(1.5rem + env(safe-area-inset-bottom, 0px));
    left: 1rem;
    right: 1rem;
  }
  .auth-symbol {
    margin-bottom: 1.4rem;
  }
  .auth-form h2 {
    font-size: 1.55rem;
  }
  .shell {
    display: block;
  }
  .sidebar {
    position: static;
    height: auto;
    padding: calc(1rem + env(safe-area-inset-top, 0px)) 1rem 0.7rem;
  }
  .sidebar .brand {
    font-size: 1.05rem;
  }
  .workspace-switch,
  .side-label,
  .side-bottom {
    display: none;
  }
  .nav {
    display: flex;
    gap: 0.4rem;
    margin-top: 0.9rem;
  }
  .nav button {
    flex: 1;
    min-height: 2.55rem;
    padding: 0.6rem;
    font-size: 0.75rem;
  }
  .nav button > .button-label {
    gap: 0.45rem;
    justify-content: center;
  }
  .nav button.active::before {
    display: none;
  }
  .nav-count {
    margin-left: 0.2rem;
  }
  .main {
    padding-inline: 1.15rem;
  }
  .topbar {
    min-height: 3.5rem;
    gap: 0.5rem;
  }
  .top-crumb {
    font-size: 0.625rem;
    gap: 0.4rem;
  }
  .top-crumb > .ui-icon:first-child,
  .top-crumb > span {
    display: none;
  }
  .top-crumb > .ui-icon:not(:first-child) {
    display: none;
  }
  .top-actions {
    gap: 0.15rem;
  }
  .top-actions button {
    font-size: 0.625rem;
    min-height: 2.5rem;
    padding: 0.35rem 0.4rem;
  }
  .top-actions .ui-icon {
    display: none;
  }
  .page-heading {
    margin: 1.8rem 0 1.4rem;
    gap: 1.1rem;
  }
  .page-heading h1 {
    font-size: 1.65rem;
  }
  .page-heading p {
    font-size: 0.75rem;
  }
  .page-heading .eyebrow {
    font-size: 0.55rem;
    margin-bottom: 0.5rem;
  }
  .heading-actions {
    width: 100%;
  }
  .heading-actions button {
    flex: 1;
    min-height: 2.6rem;
  }
  .stats {
    margin-bottom: 1.7rem;
  }
  .stat {
    padding: 1rem 0.7rem;
  }
  .stat .label {
    font-size: 0.625rem;
  }
  .stat .value {
    font-size: 1.9rem;
    margin: 0.6rem 0 0.1rem;
  }
  .stat-unit {
    font-size: 0.55rem;
    margin-left: 0.3rem;
  }
  .section-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 1rem;
  }
  .section-head h2 {
    font-size: 0.875rem;
  }
  .search-field {
    width: 100%;
  }
  .search-field input {
    height: 2.6rem;
  }
  .filter-tabs button {
    min-height: 2.5rem;
    flex: 1;
  }
  .identity strong {
    max-width: 11rem;
  }
  .context-note {
    align-items: flex-start;
  }
  .context-note > button {
    display: none;
  }
  .main-footer {
    margin-top: 2.2rem;
    padding-bottom: calc(1.3rem + env(safe-area-inset-bottom, 0px));
  }
  .empty {
    padding: 2.5rem 1.2rem;
  }
  .file-controls {
    gap: 0.55rem;
  }
  .file-controls input[type="search"] {
    max-width: 100%;
  }
  .file-controls button,
  .file-controls .check {
    min-height: 2.5rem;
  }
  .file-name {
    min-width: 12rem;
  }
  .activity-item {
    padding: 1rem;
    gap: 0.6rem;
    flex-wrap: wrap;
  }
  .activity-item time {
    width: 100%;
    padding-left: 1.6rem;
  }
  dialog {
    padding: 1.4rem;
    border-radius: 1rem;
    max-height: calc(100dvh - 2rem);
    padding-bottom: calc(1.4rem + env(safe-area-inset-bottom, 0px));
  }
  .dialog-head h2 {
    font-size: 1.1rem;
  }
  #toast {
    left: 1rem;
    right: 1rem;
    bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
    max-width: none;
  }
}
/* 16px touch inputs avoid iOS focus zoom; preserve pinch zoom and content selection. */
@media (pointer: coarse) {
  input:not([type="checkbox"]),
  select,
  .search-field input {
    font-size: 1rem;
  }
  button {
    min-height: 2.5rem;
  }
}
@media (prefers-reduced-motion: reduce) {
  button {
    transition:
      opacity 100ms ease,
      background-color 100ms ease;
  }
  button:active:not(:disabled) {
    transform: none;
  }
  dialog,
  dialog[open],
  #toast,
  #toast[hidden] {
    transform: none;
    transition:
      opacity 100ms ease,
      display 100ms allow-discrete,
      overlay 100ms allow-discrete;
  }
  button[aria-busy="true"]::after {
    animation: none;
  }
  @starting-style {
    dialog[open],
    #toast {
      transform: none;
    }
  }
}
@media (prefers-reduced-transparency: reduce) {
  dialog::backdrop {
    backdrop-filter: none;
    background: #181d2ba6;
  }
}
@media (prefers-contrast: more) {
  :root {
    --muted: #505869;
    --line: #737b90;
  }
  .stat .note,
  .date-cell,
  .info-note,
  .section-head p,
  .context-note p {
    color: #525d72;
  }
  button,
  .panel,
  .stats {
    outline: 1px solid #737b90;
  }
}
html[data-input-mode="keyboard"] button,
html[data-input-mode="keyboard"] dialog,
html[data-input-mode="keyboard"] dialog::backdrop,
html[data-input-mode="keyboard"] #toast {
  transition-duration: 0ms;
}
