:root {
  color-scheme: light dark;
  --bg: #f3f6f3;
  --bg-soft: #f8faf8;
  --surface: rgba(255, 255, 255, 0.9);
  --surface-solid: #ffffff;
  --surface-muted: #f4f7f4;
  --text: #17221c;
  --text-soft: #33433a;
  --muted: #718078;
  --line: #dde6df;
  --line-strong: #ccd9d0;
  --accent: #147452;
  --accent-dark: #0d593e;
  --accent-soft: #e3f5eb;
  --accent-pale: #f0faf4;
  --warning: #9a6100;
  --warning-soft: #fff3d5;
  --danger: #b13a31;
  --danger-soft: #fff0ee;
  --shadow-sm: 0 2px 8px rgba(21, 50, 34, 0.05);
  --shadow-md: 0 18px 50px rgba(20, 48, 33, 0.08);
  --shadow-lg: 0 28px 80px rgba(16, 50, 31, 0.13);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 12% 18%, rgba(100, 210, 157, 0.1), transparent 27rem),
    radial-gradient(circle at 88% 6%, rgba(87, 169, 128, 0.08), transparent 25rem),
    var(--bg);
  color: var(--text);
  font: 15px/1.55 ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

button,
input,
summary {
  font: inherit;
}

button,
.button,
summary {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
.button:focus-visible,
summary:focus-visible,
input:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(33, 151, 103, 0.22);
  outline-offset: 2px;
}

a {
  color: inherit;
}

.page-orb {
  position: fixed;
  z-index: -1;
  border-radius: 50%;
  filter: blur(2px);
  pointer-events: none;
}

.page-orb-one {
  width: 380px;
  height: 380px;
  top: 90px;
  left: -240px;
  background: rgba(62, 181, 124, 0.08);
}

.page-orb-two {
  width: 310px;
  height: 310px;
  right: -190px;
  bottom: 60px;
  background: rgba(43, 132, 92, 0.06);
}

.topbar {
  position: sticky;
  z-index: 30;
  top: 0;
  height: 76px;
  border-bottom: 1px solid rgba(211, 224, 215, 0.82);
  background: rgba(250, 252, 250, 0.8);
  backdrop-filter: blur(22px) saturate(1.3);
}

.topbar-inner {
  width: min(1180px, calc(100% - 40px));
  height: 100%;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  text-decoration: none;
}

.brand-mark,
.hero-mark {
  display: grid;
  place-items: center;
  color: #fff;
  background: radial-gradient(circle at 35% 25%, #39b981, #147653 48%, #0b5138);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 8px 22px rgba(20, 116, 82, 0.22);
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 14px;
}

.brand-mark svg,
.hero-mark svg {
  width: 25px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.brand-copy {
  display: grid;
  line-height: 1.2;
}

.brand-copy strong {
  font-size: 16px;
  font-weight: 820;
  letter-spacing: -0.02em;
}

.brand-copy small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
}

.topbar-actions,
.actions,
.page-title,
.panel-title,
.content-card-top,
.content-meta,
.content-actions {
  display: flex;
  align-items: center;
}

.topbar-actions {
  gap: 12px;
}

.secure-pill,
.status-pill,
.count-pill,
.account-status {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
}

.secure-pill {
  gap: 7px;
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.7);
  font-size: 12px;
  font-weight: 750;
}

.secure-pill i,
.status-pill i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #2fb477;
  box-shadow: 0 0 0 4px rgba(47, 180, 119, 0.13);
}

.container {
  width: min(1180px, calc(100% - 40px));
  min-height: calc(100vh - 160px);
  margin: 0 auto;
  padding: 48px 0 76px;
}

.footer {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 0 0 30px;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  color: var(--muted);
  font-size: 12px;
}

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

h1,
h2,
h3 {
  color: var(--text);
  letter-spacing: -0.035em;
}

h1 {
  margin-bottom: 10px;
  font-size: clamp(34px, 4vw, 48px);
  line-height: 1.08;
}

h2 {
  margin-bottom: 8px;
  font-size: 23px;
  line-height: 1.2;
}

h3 {
  margin-bottom: 5px;
  font-size: 17px;
}

.eyebrow {
  margin: 0 0 7px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.muted,
.page-subtitle,
.account-meta {
  color: var(--muted);
}

.page-subtitle {
  margin: 0;
  font-size: 16px;
}

.hero-title {
  justify-content: space-between;
  gap: 24px;
  margin: 8px 0 30px;
}

.status-pill {
  gap: 9px;
  padding: 10px 15px;
  border: 1px solid #cce8d8;
  border-radius: 999px;
  color: var(--accent);
  background: rgba(237, 250, 243, 0.82);
  font-size: 13px;
  font-weight: 800;
}

.notice,
.alert {
  border-radius: 14px;
  font-weight: 720;
}

.notice {
  margin: -10px 0 22px;
  padding: 14px 17px;
  border: 1px solid #b9e1ca;
  color: var(--accent-dark);
  background: var(--accent-soft);
}

.alert {
  width: min(500px, 100%);
  margin: 0 auto 18px;
  padding: 13px 16px;
  border: 1px solid #f2c4bf;
  color: var(--danger);
  background: var(--danger-soft);
}

.panel,
.stat,
.auth-card {
  border: 1px solid rgba(215, 226, 218, 0.94);
  background: var(--surface);
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(18px);
}

.panel {
  padding: 28px;
  border-radius: 24px;
}

.panel-title {
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 23px;
}

.panel-title p:last-child {
  margin-bottom: 0;
}

.count-pill {
  justify-content: center;
  min-height: 30px;
  padding: 5px 11px;
  border-radius: 999px;
  color: var(--accent);
  background: var(--accent-soft);
  font-size: 12px;
  font-weight: 800;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}

.stat {
  min-height: 126px;
  padding: 22px;
  display: flex;
  align-items: center;
  gap: 17px;
  border-radius: 20px;
}

.stat-icon {
  width: 46px;
  height: 46px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 15px;
  color: var(--accent);
  background: var(--accent-soft);
  font-size: 20px;
  font-weight: 850;
}

.stat-icon.used {
  color: #6d5a1d;
  background: #f7f1df;
}

.stat > div {
  display: grid;
}

.stat > div > span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.stat strong {
  margin-top: 3px;
  font-size: 27px;
  line-height: 1.2;
  letter-spacing: -0.035em;
}

.stat strong small {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0;
}

.accent-stat {
  border-color: #bcdcca;
  background: linear-gradient(145deg, rgba(237, 250, 243, 0.96), rgba(255, 255, 255, 0.92));
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(310px, 0.75fr);
  align-items: start;
  gap: 20px;
}

.create-panel {
  position: sticky;
  top: 96px;
  background: linear-gradient(155deg, rgba(255, 255, 255, 0.97), rgba(241, 249, 244, 0.93));
}

.create-icon,
.section-icon {
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(145deg, #269b6d, #0f6547);
  box-shadow: 0 12px 26px rgba(20, 116, 82, 0.2);
}

.create-icon {
  width: 48px;
  height: 48px;
  margin-bottom: 22px;
  border-radius: 16px;
  font-size: 25px;
  font-weight: 350;
}

.stack {
  display: grid;
  gap: 16px;
}

.compact-stack {
  margin-top: 24px;
}

label {
  display: grid;
  gap: 8px;
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 780;
}

.optional {
  float: right;
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
}

input {
  width: 100%;
  min-height: 46px;
  padding: 11px 13px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.82);
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

input::placeholder {
  color: #a0aaa4;
}

input:hover {
  border-color: #b8cbbf;
}

input:focus {
  border-color: #54a981;
  outline: none;
  background: var(--surface-solid);
  box-shadow: 0 0 0 4px rgba(39, 151, 104, 0.11);
}

button,
.button,
summary.button {
  min-height: 40px;
  padding: 9px 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 11px;
  color: #fff;
  background: var(--accent);
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

button:hover,
.button:hover,
summary.button:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(18, 101, 70, 0.14);
}

button:active,
.button:active,
summary.button:active {
  transform: translateY(0);
}

.primary {
  background: linear-gradient(135deg, #1a825b, #0f6849);
  box-shadow: 0 10px 24px rgba(20, 116, 82, 0.18);
}

.secondary {
  color: var(--accent);
  background: var(--accent-soft);
}

.ghost {
  border: 1px solid var(--line);
  color: var(--text-soft);
  background: rgba(255, 255, 255, 0.65);
}

.compact {
  min-height: 34px;
  padding: 6px 11px;
  font-size: 12px;
}

.wide {
  width: 100%;
  min-height: 48px;
}

.icon-action {
  width: 40px;
  padding: 0;
  font-size: 17px;
}

.form-note {
  margin: 18px 0 0;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.form-note i {
  width: 17px;
  height: 17px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 50%;
  color: var(--accent);
  background: var(--accent-soft);
  font-size: 10px;
  font-style: normal;
  font-weight: 900;
}

.account-list {
  display: grid;
  gap: 11px;
}

.account-card {
  position: relative;
  padding: 17px;
  display: grid;
  grid-template-columns: auto minmax(120px, 1fr) auto;
  align-items: center;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: rgba(249, 251, 249, 0.72);
  transition: border-color 0.16s ease, background 0.16s ease, transform 0.16s ease;
}

.account-card:hover {
  border-color: #bfd2c5;
  background: var(--surface-solid);
  transform: translateY(-1px);
}

.account-avatar {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 15px;
  color: #fff;
  background: linear-gradient(145deg, #3ba779, #176d50);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28);
  font-size: 17px;
  font-weight: 850;
}

.account-avatar.large {
  width: 68px;
  height: 68px;
  border-radius: 22px;
  font-size: 25px;
}

.account-main {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.account-name {
  display: flex;
  align-items: center;
  gap: 9px;
}

.account-name strong {
  overflow: hidden;
  font-size: 15px;
  text-overflow: ellipsis;
}

.account-status {
  padding: 3px 7px;
  border-radius: 999px;
  color: var(--accent);
  background: var(--accent-soft);
  font-size: 10px;
  font-weight: 850;
}

.account-status.offline {
  color: var(--muted);
  background: #ecefed;
}

.account-meta {
  font-size: 12px;
}

.account-meta i,
.content-meta i {
  width: 3px;
  height: 3px;
  margin: 0 5px;
  display: inline-block;
  border-radius: 50%;
  background: #aab5ae;
  vertical-align: middle;
}

.actions {
  justify-content: flex-end;
  gap: 7px;
}

.account-controls {
  display: grid;
  justify-items: end;
}

.password-reset {
  position: relative;
}

.password-reset summary {
  list-style: none;
}

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

.password-reset[open] > summary {
  color: #fff;
  border-color: var(--accent);
  background: var(--accent);
}

.password-form {
  position: absolute;
  z-index: 20;
  top: calc(100% + 10px);
  right: 0;
  width: 320px;
  padding: 19px;
  display: grid;
  gap: 13px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface-solid);
  box-shadow: var(--shadow-lg);
}

.password-form h3,
.password-form p {
  margin-bottom: 0;
}

.password-form small {
  color: var(--muted);
  line-height: 1.5;
}

.empty-state {
  min-height: 230px;
  display: grid;
  place-content: center;
  justify-items: center;
  text-align: center;
  color: var(--muted);
}

.empty-state > span {
  width: 48px;
  height: 48px;
  margin-bottom: 14px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  color: var(--accent);
  background: var(--accent-soft);
  font-size: 24px;
}

.empty-state h3 {
  margin-bottom: 4px;
}

.empty-state p {
  margin-bottom: 0;
}

.auth-shell {
  min-height: calc(100vh - 260px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(380px, 470px);
  align-items: center;
  gap: clamp(50px, 8vw, 120px);
}

.auth-intro {
  max-width: 560px;
}

.hero-mark {
  width: 66px;
  height: 66px;
  margin-bottom: 32px;
  border-radius: 22px;
}

.hero-mark svg {
  width: 36px;
}

.auth-intro h1 {
  max-width: 540px;
  margin-bottom: 20px;
  font-size: clamp(44px, 5vw, 68px);
  line-height: 1.04;
}

.auth-description {
  max-width: 510px;
  margin-bottom: 28px;
  color: var(--muted);
  font-size: 17px;
}

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

.feature-list span {
  display: flex;
  align-items: center;
  gap: 11px;
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 700;
}

.feature-list i {
  width: 27px;
  height: 27px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  color: var(--accent);
  background: var(--accent-soft);
  font-size: 9px;
  font-style: normal;
  font-weight: 900;
}

.auth-card {
  padding: 34px;
  border-radius: 27px;
  background: linear-gradient(155deg, rgba(255, 255, 255, 0.98), rgba(247, 251, 248, 0.94));
}

.auth-heading {
  display: flex;
  align-items: center;
  gap: 14px;
}

.section-icon {
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  border-radius: 14px;
  font-size: 18px;
}

.auth-heading h2,
.auth-heading p {
  margin-bottom: 0;
}

.auth-card > .muted {
  margin: 18px 0 24px;
}

.auth-form {
  gap: 17px;
}

.auth-note {
  margin-top: 22px;
  padding: 13px;
  display: flex;
  align-items: flex-start;
  gap: 11px;
  border-radius: 14px;
  color: var(--text-soft);
  background: var(--surface-muted);
}

.auth-note > span {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 9px;
  color: var(--accent);
  background: var(--accent-soft);
  font-size: 12px;
}

.auth-note p {
  margin: 0;
  display: grid;
}

.auth-note strong {
  font-size: 12px;
}

.auth-note small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.content-title {
  justify-content: space-between;
  gap: 26px;
  margin-bottom: 28px;
}

.back-link {
  margin-bottom: 26px;
  display: inline-flex;
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}

.content-panel {
  padding-bottom: 30px;
}

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

.admin-device-list {
  display: grid;
  gap: 10px;
}

.admin-device {
  padding: 17px 18px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: rgba(250, 252, 250, 0.76);
}

.admin-device.revoked {
  opacity: 0.62;
}

.device-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: var(--accent);
  background: var(--accent-soft);
  font-weight: 900;
}

.admin-device.revoked .device-icon {
  color: var(--muted);
  background: var(--surface-muted);
}

.device-copy {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.device-copy > div {
  display: flex;
  align-items: center;
  gap: 9px;
}

.device-copy strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.device-copy small {
  color: var(--muted);
}

.content-card {
  padding: 21px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(250, 252, 250, 0.76);
  transition: border-color 0.16s ease, background 0.16s ease;
}

.content-card:hover {
  border-color: #bfd2c5;
  background: var(--surface-solid);
}

.content-card.trashed {
  opacity: 0.65;
}

.content-card-top {
  justify-content: space-between;
  gap: 15px;
}

.content-meta {
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 12px;
}

.device-dot {
  width: 7px;
  height: 7px;
  margin-right: 7px;
  border-radius: 50%;
  background: #3ab17a;
}

.content-card h3 {
  margin: 15px 0 5px;
  font-size: 18px;
}

.message {
  margin: 10px 0;
  white-space: pre-wrap;
  color: var(--text-soft);
}

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

.files a {
  padding: 11px 13px;
  display: flex;
  align-items: center;
  gap: 11px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--text-soft);
  background: var(--surface-muted);
  text-decoration: none;
}

.files a:hover {
  border-color: #b9d3c3;
  background: var(--accent-pale);
}

.file-icon {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 9px;
  color: var(--accent);
  background: var(--accent-soft);
  font-weight: 900;
}

.files a > span:last-child {
  min-width: 0;
  display: grid;
}

.files strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}

.files small {
  color: var(--muted);
  font-size: 11px;
}

.badge {
  display: inline-flex;
  padding: 4px 9px;
  border-radius: 999px;
  color: var(--muted);
  background: #ecefed;
  font-size: 10px;
  font-weight: 850;
}

.badge.warning {
  color: var(--warning);
  background: var(--warning-soft);
}

.content-actions {
  justify-content: flex-end;
  margin-top: 15px;
  padding-top: 13px;
  border-top: 1px solid var(--line);
}

.danger {
  color: var(--danger);
  border-color: #efcbc6;
  background: var(--danger-soft);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #101512;
    --bg-soft: #121914;
    --surface: rgba(24, 32, 27, 0.91);
    --surface-solid: #19211c;
    --surface-muted: #1e2822;
    --text: #edf4ef;
    --text-soft: #ced9d2;
    --muted: #91a097;
    --line: #2c3831;
    --line-strong: #3b4a41;
    --accent: #63d6a2;
    --accent-dark: #9ce7c3;
    --accent-soft: #183d2d;
    --accent-pale: #193326;
    --danger-soft: #3b201e;
    --warning-soft: #3d3018;
  }

  .topbar {
    border-bottom-color: rgba(50, 66, 56, 0.85);
    background: rgba(16, 21, 18, 0.82);
  }

  .secure-pill,
  .ghost,
  input {
    background: rgba(25, 33, 28, 0.8);
  }

  .accent-stat,
  .create-panel,
  .auth-card {
    background: linear-gradient(150deg, rgba(26, 36, 30, 0.98), rgba(21, 30, 24, 0.95));
  }

  .account-card,
  .content-card,
  .admin-device {
    background: rgba(26, 35, 29, 0.78);
  }
}

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

  .create-panel {
    position: static;
  }

  .auth-shell {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .auth-intro {
    display: none;
  }

  .auth-card {
    width: min(500px, 100%);
    margin: 40px auto;
  }
}

@media (max-width: 720px) {
  .topbar {
    height: 68px;
  }

  .topbar-inner,
  .container,
  .footer {
    width: min(100% - 28px, 1180px);
  }

  .container {
    padding: 32px 0 58px;
  }

  .brand-copy small,
  .secure-pill {
    display: none;
  }

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

  .stat {
    min-height: 100px;
  }

  .hero-title,
  .content-title,
  .panel-title {
    align-items: flex-start;
  }

  .hero-title,
  .content-title {
    flex-direction: column;
  }

  .panel {
    padding: 20px;
    border-radius: 20px;
  }

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

  .account-controls {
    grid-column: 1 / -1;
    width: 100%;
  }

  .admin-device {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .admin-device form {
    grid-column: 1 / -1;
  }

  .admin-device form button {
    width: 100%;
  }

  .actions {
    width: 100%;
    justify-content: stretch;
    flex-wrap: wrap;
  }

  .actions > a,
  .actions > details {
    flex: 1;
  }

  .actions > details > summary {
    width: 100%;
  }

  .password-form {
    position: fixed;
    right: 14px;
    left: 14px;
    top: 96px;
    width: auto;
  }

  .auth-card {
    margin: 8px auto 32px;
    padding: 24px;
    border-radius: 22px;
  }

  .footer {
    flex-direction: column;
    gap: 3px;
  }
}

@media (max-width: 440px) {
  .topbar-actions .ghost {
    border: 0;
    padding-right: 0;
    background: transparent;
  }

  h1 {
    font-size: 34px;
  }

  .count-pill {
    display: none;
  }
}
