:root {
  color-scheme: light;
  --bg: #f5f6fb;
  --surface: #ffffff;
  --surface-soft: #f8f8fc;
  --surface-tint: #eef0ff;
  --text: #171825;
  --muted: #6b6d7c;
  --subtle: #9294a2;
  --border: #e3e4ec;
  --border-strong: #d4d6e1;
  --primary: #4f46e5;
  --primary-strong: #4338ca;
  --primary-soft: #ecebff;
  --success: #14945f;
  --warning: #c26b12;
  --danger: #c43f4f;
  --shadow-sm: 0 1px 2px rgba(24, 24, 35, 0.04), 0 7px 22px rgba(24, 24, 35, 0.05);
  --shadow-lg: 0 28px 80px rgba(33, 30, 70, 0.14);
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --container: 1160px;
  --container-wide: 1380px;
  --font-sans: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 15% 0%, rgba(79, 70, 229, 0.08), transparent 28rem),
    var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
input,
textarea {
  font: inherit;
}

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

button {
  color: inherit;
}

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

[hidden] {
  display: none !important;
}

::selection {
  background: rgba(79, 70, 229, 0.2);
}

.container,
.container-wide {
  width: min(100% - 40px, var(--container));
  margin-inline: auto;
}

.container-wide {
  width: min(100% - 40px, var(--container-wide));
}

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

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.025em;
}

.brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 11px;
  background: var(--primary);
  color: #fff;
  box-shadow: 0 8px 20px rgba(79, 70, 229, 0.22);
  font-size: 17px;
}

.brand-compact .brand-mark {
  width: 31px;
  height: 31px;
  border-radius: 10px;
}

.button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 10px 16px;
  cursor: pointer;
  font-weight: 750;
  line-height: 1;
  transition: transform 150ms ease, background-color 150ms ease, border-color 150ms ease, box-shadow 150ms ease, opacity 150ms ease;
}

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

.button:active:not(:disabled) {
  transform: translateY(0);
}

.button:focus-visible,
.text-button:focus-visible,
.demo-line:focus-visible,
.line-copy-button:focus-visible,
.title-input:focus-visible,
.content-input:focus-visible,
.link-input:focus-visible,
.switch input:focus-visible + .switch-track {
  outline: 3px solid rgba(79, 70, 229, 0.2);
  outline-offset: 2px;
}

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

.button-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 8px 20px rgba(79, 70, 229, 0.18);
}

.button-primary:hover:not(:disabled) {
  background: var(--primary-strong);
  box-shadow: 0 11px 25px rgba(79, 70, 229, 0.24);
}

.button-secondary {
  border-color: var(--border-strong);
  background: var(--surface);
  color: var(--text);
}

.button-secondary:hover:not(:disabled),
.button-ghost:hover:not(:disabled) {
  border-color: #c6c8d4;
  background: var(--surface-soft);
}

.button-ghost {
  border-color: transparent;
  background: transparent;
  color: var(--muted);
}

.button-large {
  min-height: 52px;
  border-radius: 14px;
  padding: 14px 20px;
  font-size: 16px;
}

.site-header {
  display: flex;
  min-height: 86px;
  align-items: center;
  justify-content: space-between;
}

.header-note {
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.74);
  color: var(--muted);
  padding: 8px 13px;
  font-size: 13px;
  font-weight: 700;
  backdrop-filter: blur(12px);
}

.hero {
  display: grid;
  min-height: 650px;
  grid-template-columns: minmax(0, 0.95fr) minmax(420px, 1.05fr);
  align-items: center;
  gap: 70px;
  padding-block: 58px 82px;
}

.eyebrow {
  margin: 0 0 15px;
  color: var(--primary);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.15em;
}

.hero h1 {
  max-width: 680px;
  margin: 0;
  font-size: clamp(47px, 6.3vw, 77px);
  line-height: 0.99;
  letter-spacing: -0.057em;
}

.hero-description {
  max-width: 600px;
  margin: 27px 0 0;
  color: var(--muted);
  font-size: clamp(17px, 1.8vw, 20px);
  line-height: 1.65;
}

.hero-actions {
  display: flex;
  min-height: 58px;
  align-items: center;
  gap: 16px;
  margin-top: 34px;
}

.micro-status {
  color: var(--muted);
  font-size: 13px;
}

.feature-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 26px;
}

.feature-pills span {
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.65);
  color: var(--muted);
  padding: 7px 11px;
  font-size: 12px;
  font-weight: 720;
}

.hero-preview {
  position: relative;
}

.hero-preview::before {
  position: absolute;
  z-index: -1;
  inset: 8% -8% -8% 12%;
  border-radius: 50%;
  background: rgba(79, 70, 229, 0.12);
  content: "";
  filter: blur(55px);
}

.preview-window {
  overflow: hidden;
  border: 1px solid rgba(208, 209, 224, 0.9);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow-lg);
  transform: rotate(1.2deg);
  backdrop-filter: blur(16px);
}

.preview-topbar {
  display: flex;
  min-height: 48px;
  align-items: center;
  gap: 7px;
  border-bottom: 1px solid var(--border);
  background: #f8f8fb;
  padding: 0 15px;
}

.preview-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #c9cad4;
}

.preview-address {
  overflow: hidden;
  flex: 1;
  margin-left: 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--subtle);
  padding: 6px 10px;
  font-family: var(--font-mono);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.preview-body {
  padding: 31px;
}

.preview-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.preview-title-row strong {
  display: block;
  font-size: 23px;
  letter-spacing: -0.03em;
}

.preview-kicker {
  margin: 0 0 6px;
  color: var(--subtle);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.saved-badge {
  border-radius: 999px;
  background: #e7f8f0;
  color: var(--success);
  padding: 7px 10px;
  font-size: 11px;
  font-weight: 800;
}

.demo-lines {
  display: grid;
  gap: 10px;
}

.demo-line {
  display: grid;
  min-height: 58px;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: #fff;
  padding: 10px 12px;
  cursor: pointer;
  text-align: left;
  transition: border-color 150ms ease, transform 150ms ease, box-shadow 150ms ease;
}

.demo-line:hover {
  border-color: #bfc1d2;
  box-shadow: var(--shadow-sm);
  transform: translateX(2px);
}

.line-index {
  color: var(--subtle);
  font-family: var(--font-mono);
  font-size: 11px;
}

.copy-symbol {
  border-radius: 8px;
  background: var(--surface-tint);
  color: var(--primary);
  padding: 6px 8px;
  font-size: 10px;
  font-weight: 800;
}

.preview-hint {
  margin: 16px 0 0;
  color: var(--subtle);
  font-size: 11px;
  text-align: center;
}

.steps-section {
  padding-block: 90px 110px;
}

.section-heading {
  max-width: 620px;
  margin-bottom: 34px;
}

.section-heading h2 {
  margin: 0;
  font-size: clamp(32px, 4vw, 46px);
  letter-spacing: -0.045em;
}

.steps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.step-card {
  min-height: 230px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.72);
  padding: 27px;
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(12px);
}

.step-number {
  color: var(--primary);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 800;
}

.step-card h3 {
  margin: 35px 0 10px;
  font-size: 21px;
  letter-spacing: -0.025em;
}

.step-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.site-footer {
  display: flex;
  min-height: 92px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 12px;
}

.site-footer span:first-child {
  color: var(--text);
  font-weight: 850;
}

.editor-header {
  position: sticky;
  z-index: 20;
  top: 0;
  border-bottom: 1px solid rgba(220, 221, 231, 0.88);
  background: rgba(248, 249, 252, 0.86);
  backdrop-filter: blur(18px);
}

.editor-header-inner {
  display: grid;
  min-height: 72px;
  grid-template-columns: minmax(170px, 1fr) auto minmax(360px, 1fr);
  align-items: center;
  gap: 20px;
}

.save-status {
  display: inline-flex;
  min-width: 115px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 740;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--subtle);
  box-shadow: 0 0 0 4px rgba(146, 148, 162, 0.12);
}

.save-status[data-state="saved"] .status-dot {
  background: var(--success);
  box-shadow: 0 0 0 4px rgba(20, 148, 95, 0.12);
}

.save-status[data-state="saving"] .status-dot {
  background: var(--primary);
  box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.12);
  animation: pulse 1.2s infinite;
}

.save-status[data-state="dirty"] .status-dot {
  background: var(--warning);
  box-shadow: 0 0 0 4px rgba(194, 107, 18, 0.12);
}

.save-status[data-state="error"] .status-dot,
.save-status[data-state="conflict"] .status-dot {
  background: var(--danger);
  box-shadow: 0 0 0 4px rgba(196, 63, 79, 0.12);
}

@keyframes pulse {
  50% {
    opacity: 0.45;
  }
}

.header-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(340px, 0.72fr);
  align-items: start;
  gap: 24px;
  padding-block: 30px 70px;
}

.editor-card,
.copy-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.editor-card {
  min-height: calc(100vh - 175px);
  padding: clamp(25px, 4.5vw, 56px);
}

.title-input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: clamp(31px, 4.3vw, 51px);
  font-weight: 850;
  letter-spacing: -0.05em;
}

.title-input::placeholder,
.content-input::placeholder {
  color: #b2b4c0;
}

.editor-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  color: var(--subtle);
  font-size: 11px;
  font-weight: 650;
}

.meta-separator {
  color: #cdced7;
}

.content-input {
  display: block;
  width: 100%;
  min-height: 520px;
  margin-top: 34px;
  resize: vertical;
  border: 0;
  outline: 0;
  background: transparent;
  color: #292a36;
  font-family: var(--font-mono);
  font-size: 16px;
  line-height: 1.86;
  tab-size: 2;
}

.privacy-note {
  display: flex;
  gap: 12px;
  margin: 16px 5px 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.privacy-note p {
  margin: 0;
}

.privacy-icon {
  display: grid;
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 8px;
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 800;
}

.copy-card {
  position: sticky;
  top: 102px;
  overflow: hidden;
}

.copy-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--border);
  padding: 24px;
}

.copy-card-header .eyebrow {
  margin-bottom: 8px;
}

.copy-card-header h2 {
  margin: 0;
  font-size: 20px;
  letter-spacing: -0.035em;
}

.text-button {
  flex: 0 0 auto;
  border: 0;
  background: transparent;
  color: var(--primary);
  padding: 5px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 800;
}

.text-button:hover {
  text-decoration: underline;
}

.line-number-start-row {
  display: flex;
  min-height: 62px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(90deg, rgba(79, 70, 229, 0.055), transparent);
  padding: 10px 24px;
}

.line-number-start-copy {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.line-number-start-copy strong {
  color: var(--text);
  font-size: 12px;
  font-weight: 850;
}

.line-number-start-copy small {
  color: var(--subtle);
  font-size: 10px;
  line-height: 1.3;
}

.line-number-start-input {
  width: 92px;
  min-height: 38px;
  flex: 0 0 92px;
  border: 2px solid rgba(79, 70, 229, 0.22);
  border-radius: 11px;
  background: var(--surface);
  color: var(--primary);
  padding: 7px 9px;
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 900;
  text-align: center;
  outline: none;
}

.line-number-start-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}

.quick-copy-filter-row {
  background: linear-gradient(90deg, rgba(14, 165, 233, 0.045), transparent);
}

.quick-copy-remove-input {
  width: min(190px, 48%);
  min-height: 38px;
  flex: 0 1 190px;
  border: 2px solid rgba(79, 70, 229, 0.22);
  border-radius: 11px;
  background: var(--surface);
  color: var(--text);
  padding: 7px 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 760;
  outline: none;
}

.quick-copy-remove-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--border);
  color: var(--muted);
  padding: 13px 24px;
  font-size: 12px;
  font-weight: 680;
}

.switch {
  position: relative;
  display: inline-flex;
}

.switch input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.switch-track {
  position: relative;
  width: 36px;
  height: 21px;
  border-radius: 999px;
  background: #c9cad5;
  cursor: pointer;
  transition: background 160ms ease;
}

.switch-track::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(24, 24, 35, 0.2);
  content: "";
  transition: transform 160ms ease;
}

.switch input:checked + .switch-track {
  background: var(--primary);
}

.switch input:checked + .switch-track::after {
  transform: translateX(15px);
}

.two-factor-import-panel {
  display: grid;
  gap: 10px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.07), rgba(79, 70, 229, 0.035));
  padding: 14px 24px;
}

.two-factor-import-copy {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 9px;
}

.two-factor-import-heading {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.two-factor-import-copy strong {
  color: var(--text);
  font-size: 12px;
  font-weight: 850;
}

.two-factor-import-copy small {
  color: var(--subtle);
  font-size: 10px;
  line-height: 1.35;
}

.two-factor-import-mark {
  display: inline-grid;
  width: 36px;
  height: 28px;
  flex: 0 0 36px;
  place-items: center;
  border: 1px solid rgba(5, 150, 105, 0.22);
  border-radius: 9px;
  background: rgba(16, 185, 129, 0.11);
  color: #047857;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 950;
}

.two-factor-vault-badge {
  flex: 0 0 auto;
  margin-left: auto;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  padding: 4px 7px;
  font-size: 8px;
  font-weight: 900;
  white-space: nowrap;
}

.two-factor-import-panel[data-vault-state="empty"] .two-factor-vault-badge {
  border-color: rgba(217, 119, 6, 0.24);
  background: rgba(245, 158, 11, 0.08);
  color: #b45309;
}

.two-factor-import-panel[data-vault-state="locked"] .two-factor-vault-badge {
  border-color: rgba(79, 70, 229, 0.22);
  background: rgba(79, 70, 229, 0.08);
  color: var(--primary);
}

.two-factor-import-panel[data-vault-state="unlocked"] .two-factor-vault-badge,
.two-factor-import-panel[data-vault-state="local"] .two-factor-vault-badge {
  border-color: rgba(5, 150, 105, 0.24);
  background: rgba(16, 185, 129, 0.1);
  color: #047857;
}

.two-factor-security-note,
.two-factor-vault-state > p,
.two-factor-local-only p {
  margin: 0;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.5;
}

.two-factor-security-note {
  border-left: 3px solid rgba(5, 150, 105, 0.38);
  padding-left: 8px;
}

.two-factor-vault-state {
  display: grid;
  gap: 9px;
}

.two-factor-vault-state[hidden] {
  display: none;
}

#twoFactorVaultChecking {
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  color: var(--muted);
  font-size: 10px;
}

.two-factor-vault-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(79, 70, 229, 0.16);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: two-factor-vault-spin 0.8s linear infinite;
}

@keyframes two-factor-vault-spin {
  to { transform: rotate(360deg); }
}

.two-factor-file-picker {
  display: flex;
  width: 100%;
  min-height: 38px;
  align-items: center;
  gap: 7px;
  border: 1px dashed rgba(79, 70, 229, 0.32);
  border-radius: 10px;
  background: rgba(79, 70, 229, 0.045);
  color: var(--primary);
  padding: 7px 10px;
  cursor: pointer;
  font-size: 10px;
  font-weight: 820;
  text-align: left;
}

.two-factor-file-picker:hover {
  border-color: var(--primary);
  background: rgba(79, 70, 229, 0.08);
}

.two-factor-file-picker:focus-visible,
.two-factor-local-only summary:focus-visible {
  outline: 3px solid rgba(79, 70, 229, 0.18);
  outline-offset: 2px;
}

.two-factor-vault-form {
  display: grid;
  gap: 6px;
}

.two-factor-vault-form label {
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
}

.two-factor-vault-form input {
  width: 100%;
  min-height: 37px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  outline: 0;
  background: var(--surface);
  color: var(--text);
  padding: 8px 10px;
  font-size: 11px;
}

.two-factor-vault-form input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.two-factor-vault-form .button {
  min-height: 38px;
  margin-top: 2px;
  font-size: 10px;
}

.two-factor-password-warning {
  display: block;
  color: #b45309;
  font-size: 9px;
  line-height: 1.45;
}

.two-factor-vault-unlock-form {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.two-factor-vault-unlock-form .button {
  margin: 0;
  white-space: nowrap;
}

.two-factor-unlocked-copy {
  display: flex;
  align-items: center;
  gap: 8px;
}

.two-factor-unlocked-copy > span:last-child {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.two-factor-unlocked-copy strong {
  color: #047857;
  font-size: 10px;
}

.two-factor-unlocked-copy small {
  color: var(--muted);
  font-size: 9px;
  line-height: 1.35;
}

.two-factor-unlocked-icon {
  display: grid;
  width: 26px;
  height: 26px;
  flex: 0 0 26px;
  place-items: center;
  border-radius: 50%;
  background: rgba(16, 185, 129, 0.13);
  color: #047857;
  font-size: 12px;
  font-weight: 950;
}

.two-factor-danger-button {
  border-color: rgba(196, 63, 79, 0.2);
  background: rgba(196, 63, 79, 0.06);
  color: var(--danger);
}

.two-factor-danger-button:hover:not(:disabled) {
  border-color: rgba(196, 63, 79, 0.4);
  background: rgba(196, 63, 79, 0.11);
}

.two-factor-delete-authorization {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 6px;
}

.two-factor-delete-authorization label {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
}

.two-factor-delete-authorization input {
  width: 100%;
  min-width: 0;
  min-height: 34px;
  border: 1px solid rgba(196, 63, 79, 0.2);
  border-radius: 9px;
  outline: 0;
  background: var(--surface);
  color: var(--text);
  padding: 7px 9px;
  font-size: 10px;
}

.two-factor-delete-authorization input:focus {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(196, 63, 79, 0.09);
}

.two-factor-delete-authorization .button {
  min-height: 34px;
  padding: 7px 9px;
  font-size: 9px;
  white-space: nowrap;
}

.two-factor-local-only {
  border-top: 1px solid rgba(79, 70, 229, 0.1);
  padding-top: 8px;
}

.two-factor-local-only summary {
  color: var(--muted);
  cursor: pointer;
  font-size: 9px;
  font-weight: 780;
}

.two-factor-local-only[open] {
  display: grid;
  gap: 7px;
}

.two-factor-import-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.two-factor-import-actions .button {
  min-height: 34px;
  padding: 7px 10px;
  font-size: 10px;
}

.two-factor-status {
  margin: 0;
  color: var(--subtle);
  font-size: 10px;
  line-height: 1.4;
}

.two-factor-status[data-state="ready"] {
  color: #047857;
}

.two-factor-status[data-state="error"] {
  color: var(--danger);
}

.two-factor-status[data-state="loading"] {
  color: var(--primary);
}

.line-list {
  display: grid;
  max-height: calc(100vh - 335px);
  gap: 8px;
  overflow: auto;
  border-bottom: 1px solid var(--border);
  padding: 15px;
  scrollbar-color: #c9cad5 transparent;
  scrollbar-width: thin;
}

.line-copy-row {
  display: grid;
  min-width: 0;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: stretch;
  gap: 7px;
}

.line-copy-button {
  display: grid;
  min-height: 52px;
  grid-template-columns: 52px minmax(0, 1fr) 28px;
  align-items: center;
  gap: 10px;
  border: 1px solid transparent;
  border-radius: 11px;
  background: var(--surface-soft);
  padding: 8px 9px;
  cursor: pointer;
  text-align: left;
  transition: background 140ms ease, border-color 140ms ease, transform 140ms ease;
}

.line-two-factor-button,
.line-two-factor-ambiguous {
  display: grid;
  width: 88px;
  min-height: 52px;
  place-content: center;
  gap: 2px;
  border: 1px solid rgba(5, 150, 105, 0.24);
  border-radius: 11px;
  background: rgba(16, 185, 129, 0.09);
  color: #047857;
  padding: 6px 7px;
  text-align: center;
}

.line-two-factor-button {
  cursor: pointer;
  transition: background 140ms ease, border-color 140ms ease, transform 140ms ease;
}

.line-two-factor-button:hover {
  border-color: rgba(5, 150, 105, 0.46);
  background: rgba(16, 185, 129, 0.15);
  transform: translateY(-1px);
}

.line-two-factor-button:focus-visible {
  outline: 3px solid rgba(16, 185, 129, 0.2);
  outline-offset: 2px;
}

.line-two-factor-code {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 950;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.line-two-factor-remaining {
  color: #059669;
  font-size: 9px;
  font-weight: 850;
}

.line-two-factor-ambiguous {
  align-items: center;
  border-color: rgba(217, 119, 6, 0.24);
  background: rgba(245, 158, 11, 0.09);
  color: #b45309;
  font-size: 10px;
  font-weight: 900;
}

.line-copy-button:hover {
  border-color: #d6d7e2;
  background: #f1f2f8;
  transform: translateX(2px);
}

.line-copy-button[data-copied="true"] {
  border-color: rgba(20, 148, 95, 0.25);
  background: #ebf8f2;
}

.line-number {
  color: var(--primary);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 950;
  letter-spacing: -0.02em;
  text-align: center;
}

.line-text {
  overflow-wrap: anywhere;
  color: #393a47;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.5;
  white-space: pre-wrap;
}

.line-text.is-empty {
  color: var(--subtle);
  font-style: italic;
}

.line-copy-icon {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 8px;
  background: #fff;
  color: var(--primary);
  font-size: 13px;
  font-weight: 850;
}

.line-copy-button[data-copied="true"] .line-copy-icon {
  background: var(--success);
  color: #fff;
}

.empty-lines {
  display: grid;
  min-height: 180px;
  place-items: center;
  color: var(--subtle);
  padding: 30px;
  font-size: 12px;
  line-height: 1.6;
  text-align: center;
}

.conflict-banner {
  position: fixed;
  z-index: 40;
  right: 24px;
  bottom: 24px;
  left: 24px;
  display: flex;
  max-width: 900px;
  min-height: 78px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin: 0 auto;
  border: 1px solid #f0c2c8;
  border-radius: 16px;
  background: #fff5f6;
  box-shadow: 0 18px 60px rgba(74, 33, 41, 0.2);
  padding: 14px 16px 14px 20px;
}

.conflict-banner strong,
.conflict-banner span {
  display: block;
}

.conflict-banner strong {
  margin-bottom: 4px;
  color: #8e2635;
  font-size: 14px;
}

.conflict-banner span {
  color: #8a5b62;
  font-size: 12px;
}

.conflict-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 8px;
}

.toast {
  position: fixed;
  z-index: 100;
  bottom: 24px;
  left: 50%;
  max-width: min(90vw, 440px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  background: #20212c;
  color: #fff;
  box-shadow: 0 14px 42px rgba(15, 16, 23, 0.28);
  padding: 11px 15px;
  font-size: 12px;
  font-weight: 720;
  text-align: center;
  transform: translateX(-50%);
  animation: toast-in 180ms ease-out;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translate(-50%, 6px);
  }
}

.not-found {
  display: flex;
  min-height: 100vh;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 35px;
  padding-block: 40px;
}

.not-found-card {
  width: min(100%, 600px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  padding: 55px 35px;
  text-align: center;
}

.not-found-code {
  color: var(--primary);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 850;
  letter-spacing: 0.12em;
}

.not-found-card h1 {
  margin: 13px 0 9px;
  font-size: clamp(32px, 6vw, 50px);
  letter-spacing: -0.05em;
}

.not-found-card p {
  margin: 0 0 28px;
  color: var(--muted);
  line-height: 1.6;
}



/* V3: link công khai tự cập nhật và kho liên kết */
.quick-open-copy {
  grid-row: 1 / span 3;
  align-self: center;
}

.quick-open-card > .runtime-link-row,
.quick-open-card > .link-form,
.quick-open-card > .compact-status {
  grid-column: 2;
}

.runtime-link-row {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 9px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--surface-soft);
  padding: 8px 10px;
}

.runtime-link-label {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.runtime-link-value {
  overflow: hidden;
  min-width: 0;
  flex: 1 1 auto;
  color: var(--primary);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.runtime-link-value[data-available="false"] {
  color: var(--subtle);
  font-family: var(--font-sans);
  font-weight: 650;
}

.runtime-link-row .text-button,
.manager-public-card .text-button {
  flex: 0 0 auto;
  font-size: 10px;
}

.compact-status {
  min-height: 15px;
  margin: 0;
  font-size: 10px;
  text-align: left;
}

.form-status[data-state="success"] {
  color: var(--success);
}

.manager-intro-side {
  display: grid;
  width: min(100%, 390px);
  gap: 10px;
}

.manager-security-note {
  max-width: none;
}

.manager-public-card {
  display: grid;
  min-width: 0;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 7px 10px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
  padding: 12px 14px;
}

.manager-public-card .runtime-link-label {
  grid-column: 1 / -1;
}

.manager-public-card .runtime-link-value {
  align-self: center;
}

.manager-link-form {
  display: grid;
  gap: 9px;
}

.manager-link-tool-card .link-form {
  grid-template-columns: minmax(0, 1fr) auto auto;
}

.manager-links-section {
  margin-top: 8px;
}

.manager-links-heading {
  margin-top: 32px;
}

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

.manager-link-card {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  padding: 16px 18px;
  transition: opacity 170ms ease, transform 170ms ease, border-color 170ms ease, box-shadow 170ms ease;
}

.manager-link-card:hover {
  border-color: var(--border-strong);
  box-shadow: 0 10px 28px rgba(24, 24, 35, 0.07);
  transform: translateY(-1px);
}

.manager-link-card[data-deleting="true"] {
  pointer-events: none;
  opacity: 0.5;
}

.manager-link-info {
  display: grid;
  min-width: 0;
  flex: 1 1 auto;
  gap: 5px;
}

.manager-link-info h3 {
  overflow: hidden;
  margin: 0;
  font-size: 16px;
  letter-spacing: -0.02em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.manager-link-url {
  overflow: hidden;
  color: var(--primary);
  font-family: var(--font-mono);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.manager-link-info time {
  color: var(--subtle);
  font-size: 10px;
  font-weight: 680;
}

.manager-link-actions {
  flex: 0 0 auto;
  margin-top: 0;
}

.manager-link-empty {
  min-height: 190px;
}

@media (max-width: 1050px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 45px;
    padding-top: 70px;
  }

  .hero-copy {
    max-width: 760px;
  }

  .hero-preview {
    width: min(100%, 680px);
    margin-inline: auto;
  }

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

  .step-card {
    min-height: 0;
  }

  .step-card h3 {
    margin-top: 24px;
  }

  .editor-header-inner {
    grid-template-columns: auto 1fr;
  }

  .save-status {
    grid-column: 1 / -1;
    grid-row: 2;
    min-height: 22px;
    justify-content: flex-start;
    padding-bottom: 8px;
  }

  .header-actions {
    grid-column: 2;
    grid-row: 1;
  }

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

  .copy-card {
    position: static;
  }

  .line-list {
    max-height: 520px;
  }
}

@media (max-width: 680px) {
  .container,
  .container-wide {
    width: min(100% - 24px, var(--container));
  }

  .site-header {
    min-height: 70px;
  }

  .header-note {
    display: none;
  }

  .hero {
    min-height: auto;
    gap: 42px;
    padding-block: 55px 75px;
  }

  .hero h1 {
    font-size: clamp(43px, 13vw, 64px);
  }

  .hero-description {
    font-size: 16px;
  }

  .hero-actions {
    align-items: flex-start;
    flex-direction: column;
  }

  .preview-body {
    padding: 20px;
  }

  .preview-window {
    border-radius: 17px;
    transform: none;
  }

  .preview-title-row strong {
    font-size: 20px;
  }

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

  .demo-line .copy-symbol {
    display: none;
  }

  .steps-section {
    padding-block: 72px 85px;
  }

  .site-footer {
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
    padding-block: 24px;
  }

  .editor-header-inner {
    min-height: 62px;
    gap: 10px;
  }

  .brand-compact > span:last-child {
    display: none;
  }

  .header-actions {
    gap: 5px;
  }

  .header-actions .button {
    min-height: 38px;
    padding: 9px 11px;
    font-size: 11px;
  }

  .header-actions .button-ghost {
    display: none;
  }

  .save-status {
    font-size: 11px;
  }

  .workspace {
    gap: 16px;
    padding-block: 14px 90px;
  }

  .editor-card,
  .copy-card {
    border-radius: 18px;
  }

  .editor-card {
    min-height: 58vh;
    padding: 25px 20px;
  }

  .title-input {
    font-size: 34px;
  }

  .content-input {
    min-height: 420px;
    margin-top: 27px;
    font-size: 15px;
    line-height: 1.8;
  }

  .copy-card-header {
    padding: 20px;
  }

  .copy-card-header h2 {
    font-size: 18px;
  }

  .toggle-row {
    padding-inline: 20px;
  }

  .two-factor-import-panel {
    padding-inline: 20px;
  }

  .two-factor-vault-unlock-form,
  .two-factor-delete-authorization {
    grid-template-columns: 1fr;
  }

  .two-factor-vault-unlock-form .button,
  .two-factor-delete-authorization .button {
    width: 100%;
  }

  .line-list {
    max-height: 460px;
    padding: 11px;
  }

  .conflict-banner {
    right: 12px;
    bottom: 12px;
    left: 12px;
    align-items: stretch;
    flex-direction: column;
  }

  .conflict-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .toast {
    bottom: 14px;
  }
}

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

@media (max-width: 430px) {
  .note-link-heading {
    flex-direction: column;
    gap: 10px;
  }

  .note-link-status {
    align-self: flex-start;
  }
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #101117;
    --surface: #181920;
    --surface-soft: #202129;
    --surface-tint: #282743;
    --text: #f2f2f6;
    --muted: #aaacb8;
    --subtle: #7d7f8c;
    --border: #2c2d36;
    --border-strong: #3a3b47;
    --primary: #7c73ff;
    --primary-strong: #8c84ff;
    --primary-soft: #27263e;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.15), 0 10px 28px rgba(0, 0, 0, 0.16);
    --shadow-lg: 0 28px 80px rgba(0, 0, 0, 0.38);
  }

  body {
    background:
      radial-gradient(circle at 15% 0%, rgba(124, 115, 255, 0.11), transparent 28rem),
      var(--bg);
  }

  .header-note,
  .feature-pills span,
  .step-card {
    background: rgba(24, 25, 32, 0.72);
  }

  .preview-window {
    border-color: #343641;
    background: rgba(24, 25, 32, 0.94);
  }

  .preview-topbar {
    border-color: #31323b;
    background: #202128;
  }

  .preview-address,
  .demo-line {
    border-color: #30313b;
    background: #181920;
  }

  .saved-badge {
    background: #19362a;
  }

  .editor-header {
    border-color: rgba(47, 48, 58, 0.9);
    background: rgba(16, 17, 23, 0.86);
  }

  .content-input,
  .line-text {
    color: #dedee6;
  }

  .line-copy-button:hover {
    border-color: #41434f;
    background: #252630;
  }

  .line-copy-icon {
    background: #2b2c35;
  }

  .line-copy-button[data-copied="true"] {
    border-color: rgba(40, 183, 121, 0.28);
    background: #193229;
  }

  .conflict-banner {
    border-color: #6a343d;
    background: #321d21;
  }

  .conflict-banner strong {
    color: #ffb4be;
  }

  .conflict-banner span {
    color: #d99ba4;
  }
}

/* ThượngQ: logo, mở link và khu vực quản lý */
.brand-mark-wide {
  width: 39px;
  min-width: 39px;
  font-size: 11px;
  letter-spacing: -0.06em;
}

.brand-compact .brand-mark-wide {
  width: 36px;
  min-width: 36px;
  font-size: 10px;
}

.site-nav,
.manager-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.button-danger {
  border-color: rgba(196, 63, 79, 0.22);
  background: #fff3f5;
  color: var(--danger);
}

.button-danger:hover:not(:disabled) {
  border-color: rgba(196, 63, 79, 0.38);
  background: #ffe9ed;
}

.link-input {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  outline: 0;
  background: var(--surface);
  color: var(--text);
  padding: 10px 13px;
  transition: border-color 150ms ease, box-shadow 150ms ease, background-color 150ms ease;
}

.link-input::placeholder {
  color: var(--subtle);
}

.link-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.12);
}

.link-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 9px;
}

.quick-open-card {
  display: grid;
  max-width: 630px;
  grid-template-columns: minmax(155px, 0.62fr) minmax(260px, 1.38fr);
  align-items: center;
  gap: 18px;
  margin-top: 25px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: var(--shadow-sm);
  padding: 15px;
  backdrop-filter: blur(12px);
}

.quick-open-copy strong,
.quick-open-copy span {
  display: block;
}

.quick-open-copy strong {
  margin-bottom: 4px;
  font-size: 13px;
}

.quick-open-copy span {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.editor-header-inner {
  grid-template-columns: minmax(170px, 1fr) auto minmax(460px, 1fr);
}

.manager-view {
  min-height: 100vh;
}

.manager-header {
  position: sticky;
  z-index: 20;
  top: 0;
  border-bottom: 1px solid rgba(220, 221, 231, 0.88);
  background: rgba(248, 249, 252, 0.88);
  backdrop-filter: blur(18px);
}

.manager-header-inner {
  display: flex;
  min-height: 76px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.manager-main {
  padding-block: 52px 90px;
}

.manager-intro {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 35px;
  margin-bottom: 28px;
}

.manager-intro h1 {
  margin: 0;
  font-size: clamp(39px, 6vw, 64px);
  letter-spacing: -0.055em;
  line-height: 1;
}

.manager-intro > div:first-child > p:last-child {
  max-width: 640px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.65;
}

.manager-security-note {
  display: flex;
  max-width: 330px;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
  padding: 12px 14px;
  font-size: 11px;
  font-weight: 680;
  line-height: 1.5;
}

.manager-unlock-card {
  display: grid;
  max-width: 760px;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.8fr);
  align-items: center;
  gap: 34px;
  margin: 52px auto 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  padding: clamp(28px, 5vw, 48px);
}

.manager-unlock-card h2,
.manager-tool-heading h2,
.manager-list-heading h2 {
  margin: 0;
  letter-spacing: -0.035em;
}

.manager-unlock-card h2 {
  font-size: 30px;
}

.manager-unlock-card p:not(.eyebrow):not(.form-status) {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

.manager-unlock-card code {
  border-radius: 6px;
  background: var(--surface-soft);
  padding: 2px 5px;
  font-family: var(--font-mono);
  font-size: 11px;
}

.manager-key-form {
  display: grid;
  gap: 10px;
}

.form-status {
  grid-column: 1 / -1;
  min-height: 20px;
  margin: -20px 0 0;
  color: var(--muted);
  font-size: 12px;
  text-align: right;
}

.form-status[data-state="error"] {
  color: var(--danger);
}

.form-status[data-state="loading"] {
  color: var(--primary);
}

.manager-content {
  margin-top: 38px;
}

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

.manager-tools-grid-single {
  grid-template-columns: minmax(0, 1fr);
}

.manager-tool-card {
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: var(--shadow-sm);
  padding: 21px;
  backdrop-filter: blur(12px);
}

.manager-tool-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 15px;
}

.manager-tool-heading .eyebrow,
.manager-list-heading .eyebrow {
  margin-bottom: 7px;
}

.manager-tool-heading h2 {
  font-size: 20px;
}

.manager-list-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin: 42px 2px 16px;
}

.manager-list-heading h2 {
  font-size: 29px;
}

.manager-loading {
  display: grid;
  min-height: 220px;
  place-items: center;
  border: 1px dashed var(--border-strong);
  border-radius: 18px;
  color: var(--muted);
  font-size: 13px;
}

.manager-note-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 15px;
}

.manager-note-card {
  display: flex;
  min-width: 0;
  min-height: 250px;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  padding: 21px;
  transition: opacity 170ms ease, transform 170ms ease, border-color 170ms ease, box-shadow 170ms ease;
}

.manager-note-card:hover {
  border-color: var(--border-strong);
  box-shadow: 0 12px 34px rgba(24, 24, 35, 0.08);
  transform: translateY(-2px);
}

.manager-note-card[data-deleting="true"] {
  pointer-events: none;
  opacity: 0.5;
  transform: scale(0.985);
}

.manager-note-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 15px;
}

.manager-note-title-wrap {
  min-width: 0;
}

.manager-note-title-wrap h3 {
  overflow: hidden;
  margin: 0;
  font-size: 20px;
  letter-spacing: -0.03em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.manager-note-title-wrap time {
  display: block;
  margin-top: 6px;
  color: var(--subtle);
  font-size: 10px;
  font-weight: 680;
}

.manager-note-badge {
  flex: 0 0 auto;
  border-radius: 999px;
  background: var(--surface-tint);
  color: var(--primary);
  padding: 6px 9px;
  font-size: 10px;
  font-weight: 800;
}

.manager-note-preview {
  display: -webkit-box;
  overflow: hidden;
  min-height: 67px;
  margin: 19px 0 16px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.6;
  white-space: pre-wrap;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.manager-note-meta {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
  border-top: 1px solid var(--border);
  color: var(--subtle);
  padding-top: 13px;
  font-size: 10px;
}

.manager-note-id {
  overflow: hidden;
  max-width: 55%;
  font-family: var(--font-mono);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.manager-note-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 15px;
}

.manager-note-actions .button {
  min-height: 38px;
  padding: 9px 12px;
  font-size: 11px;
}

.manager-empty {
  display: grid;
  min-height: 310px;
  place-items: center;
  border: 1px dashed var(--border-strong);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.5);
  padding: 40px;
  text-align: center;
}

.manager-empty-icon {
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  border-radius: 16px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 26px;
}

.manager-empty h3 {
  margin: 14px 0 4px;
  font-size: 22px;
}

.manager-empty p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.not-found-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

@media (max-width: 1050px) {
  .editor-header-inner {
    grid-template-columns: auto 1fr;
  }

  .manager-intro {
    align-items: flex-start;
    flex-direction: column;
  }

  .manager-intro-side {
    width: min(100%, 620px);
  }

  .manager-security-note {
    max-width: none;
  }
}

@media (max-width: 820px) {
  .quick-open-card,
  .manager-unlock-card,
  .manager-tools-grid,
  .manager-note-list {
    grid-template-columns: 1fr;
  }

  .quick-open-copy {
    grid-row: auto;
  }

  .quick-open-card > .runtime-link-row,
  .quick-open-card > .link-form,
  .quick-open-card > .compact-status {
    grid-column: 1;
  }

  .manager-unlock-card {
    max-width: 620px;
    gap: 24px;
  }

  .form-status {
    margin-top: -10px;
    text-align: left;
  }
}

@media (max-width: 680px) {
  .note-link-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .note-link-input {
    grid-column: 1 / -1;
  }

  .note-link-form .button {
    width: 100%;
  }

  .brand-mark-wide {
    width: 36px;
    min-width: 36px;
  }

  .site-nav .header-note {
    display: none;
  }

  .site-nav .button,
  .manager-header-actions .button {
    min-height: 38px;
    padding: 9px 11px;
    font-size: 11px;
  }

  .quick-open-card {
    align-items: stretch;
    padding: 14px;
  }

  .link-form,
  .manager-link-tool-card .link-form {
    grid-template-columns: 1fr;
  }

  .link-form .button {
    width: 100%;
  }

  .editor-header-inner .header-actions {
    overflow-x: auto;
    justify-content: flex-end;
    scrollbar-width: none;
  }

  .editor-header-inner .header-actions::-webkit-scrollbar {
    display: none;
  }

  .manager-header-inner {
    min-height: 68px;
  }

  .manager-header-actions .button-secondary {
    display: none;
  }

  .manager-main {
    padding-block: 36px 70px;
  }

  .manager-intro {
    gap: 22px;
  }

  .manager-intro h1 {
    font-size: 42px;
  }

  .manager-intro > div:first-child > p:last-child {
    font-size: 14px;
  }

  .manager-unlock-card {
    margin-top: 30px;
    border-radius: 18px;
    padding: 24px 20px;
  }

  .manager-tool-card,
  .manager-note-card,
  .manager-link-card {
    border-radius: 16px;
    padding: 18px;
  }

  .manager-link-card {
    align-items: stretch;
    flex-direction: column;
  }

  .manager-list-heading {
    align-items: flex-start;
    flex-direction: column;
    margin-top: 34px;
  }

  .manager-list-heading h2 {
    font-size: 25px;
  }

  .manager-note-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .manager-link-actions {
    width: 100%;
  }

  .manager-note-actions .button:first-child {
    grid-column: 1 / -1;
  }

  .not-found-actions {
    flex-direction: column;
  }
}

@media (prefers-color-scheme: dark) {
  .quick-open-card,
  .manager-security-note,
  .manager-public-card,
  .manager-tool-card,
  .manager-empty {
    background: rgba(24, 25, 32, 0.76);
  }

  .manager-header {
    border-color: rgba(47, 48, 58, 0.9);
    background: rgba(16, 17, 23, 0.88);
  }

  .link-input {
    background: var(--surface);
  }

  .button-danger {
    border-color: rgba(255, 130, 146, 0.22);
    background: #341e23;
    color: #ff9cab;
  }

  .button-danger:hover:not(:disabled) {
    border-color: rgba(255, 130, 146, 0.4);
    background: #42242b;
  }

  .manager-note-card:hover,
  .manager-link-card:hover {
    box-shadow: 0 12px 34px rgba(0, 0, 0, 0.24);
  }
}

/* V4: link đính kèm được lưu và đồng bộ cùng từng ghi chú */
.note-link-panel {
  margin-top: 30px;
  border: 1px solid var(--border);
  border-radius: 17px;
  background: var(--surface-soft);
  padding: 18px;
}

.note-link-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.note-link-heading .eyebrow {
  margin-bottom: 6px;
}

.note-link-heading h2 {
  margin: 0;
  font-size: 18px;
  letter-spacing: -0.025em;
}

.note-link-help {
  margin: 8px 0 14px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.note-link-form {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 9px;
}

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

.note-link-number {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid rgba(79, 70, 229, 0.16);
  border-radius: 10px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 12px;
  font-weight: 850;
}

.note-link-input {
  min-width: 0;
  font-family: var(--font-mono);
  font-size: 13px;
}

.note-link-form .button {
  min-height: 44px;
  white-space: nowrap;
}

.note-link-form .button-ghost {
  border-color: var(--border);
}

.note-link-status {
  flex: 0 0 auto;
  border-radius: 999px;
  background: var(--surface);
  color: var(--subtle);
  padding: 6px 9px;
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
}

.note-link-status[data-state="saved"] {
  background: #e7f8f0;
  color: var(--success);
}

.note-link-status[data-state="dirty"],
.note-link-status[data-state="loading"] {
  background: #fff4e8;
  color: var(--warning);
}

.link-input:disabled {
  cursor: wait;
  opacity: 0.7;
}

.manager-note-link-badge {
  overflow: hidden;
  max-width: 190px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  padding: 4px 8px;
  font-size: 10px;
  font-weight: 760;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 680px) {
  .note-link-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .note-link-form {
    grid-template-columns: 30px minmax(0, 1fr) minmax(0, 1fr);
  }

  .note-link-input {
    grid-column: 2 / -1;
  }

  .note-link-number {
    grid-row: 1 / span 2;
  }

  .note-link-form .button {
    width: 100%;
  }

  .manager-note-link-badge {
    max-width: 150px;
  }
}

@media (prefers-color-scheme: dark) {
  .note-link-panel {
    background: rgba(24, 25, 32, 0.76);
  }

  .note-link-status {
    background: var(--surface);
  }

  .note-link-status[data-state="saved"] {
    background: #173629;
    color: #7fe0ad;
  }

  .note-link-status[data-state="dirty"],
  .note-link-status[data-state="loading"] {
    background: #3b2b19;
    color: #f3b56e;
  }
}

/* Tep dinh kem duoc luu tren may chu va dong bo cho moi thiet bi */
.attachment-panel {
  margin-top: 18px;
  border: 1px solid var(--border);
  border-radius: 17px;
  background: var(--surface-soft);
  padding: 18px;
}

.attachment-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.attachment-heading .eyebrow {
  margin-bottom: 6px;
}

.attachment-heading h2 {
  margin: 0;
  font-size: 18px;
  letter-spacing: -0.025em;
}

.attachment-summary {
  flex: 0 0 auto;
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  padding: 6px 9px;
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
}

.attachment-help {
  margin: 8px 0 14px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.attachment-drop-zone {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 13px;
  border: 1px dashed var(--border-strong);
  border-radius: 14px;
  background: var(--surface);
  padding: 14px;
  transition: border-color 150ms ease, background-color 150ms ease, box-shadow 150ms ease;
}

.attachment-drop-zone[data-dragging="true"] {
  border-color: var(--primary);
  background: var(--primary-soft);
  box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.09);
}

.attachment-drop-zone[data-disabled="true"] {
  pointer-events: none;
  opacity: 0.65;
}

.attachment-drop-icon,
.attachment-file-icon {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 11px;
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 850;
}

.attachment-drop-icon {
  width: 38px;
  height: 38px;
  font-size: 20px;
}

.attachment-drop-copy {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.attachment-drop-copy strong {
  font-size: 13px;
}

.attachment-drop-copy span {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.attachment-upload-status {
  min-height: 17px;
  margin: 10px 2px 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 680;
}

.attachment-upload-status[data-state="loading"] {
  color: var(--primary);
}

.attachment-upload-status[data-state="saved"] {
  color: var(--success);
}

.attachment-upload-status[data-state="error"] {
  color: var(--danger);
}

.attachment-list {
  display: grid;
  gap: 8px;
  margin-top: 9px;
}

.attachment-empty {
  border: 1px dashed var(--border);
  border-radius: 12px;
  color: var(--subtle);
  padding: 14px;
  font-size: 11px;
  line-height: 1.55;
  text-align: center;
}

.attachment-item {
  display: grid;
  min-width: 0;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: var(--surface);
  padding: 10px 11px;
  transition: opacity 150ms ease, transform 150ms ease, border-color 150ms ease;
}

.attachment-item:hover {
  border-color: var(--border-strong);
}

.attachment-item[data-deleting="true"] {
  pointer-events: none;
  opacity: 0.45;
  transform: scale(0.99);
}

.attachment-file-icon {
  width: 32px;
  height: 32px;
  font-size: 15px;
}

.attachment-file-info {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.attachment-file-name {
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attachment-file-meta {
  color: var(--subtle);
  font-size: 10px;
}

.attachment-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.attachment-actions .button {
  min-height: 35px;
  padding: 8px 10px;
  font-size: 10px;
  white-space: nowrap;
}

.attachment-delete-button {
  border-color: transparent;
  color: var(--danger);
}

.manager-note-meta {
  flex-wrap: wrap;
  justify-content: flex-start;
}

.manager-note-id {
  margin-left: auto;
}

@media (max-width: 680px) {
  .attachment-heading {
    flex-direction: column;
    gap: 9px;
  }

  .attachment-drop-zone {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .attachment-drop-zone .button {
    width: 100%;
    grid-column: 1 / -1;
  }

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

  .attachment-actions {
    grid-column: 1 / -1;
  }

  .attachment-actions .button {
    flex: 1;
  }

  .manager-note-id {
    width: 100%;
    max-width: none;
    margin-left: 0;
  }
}

@media (prefers-color-scheme: dark) {
  .attachment-panel {
    background: rgba(24, 25, 32, 0.76);
  }

  .attachment-drop-zone,
  .attachment-item {
    background: var(--surface);
  }

  .attachment-drop-zone[data-dragging="true"] {
    background: rgba(79, 70, 229, 0.18);
  }
}

/* V9: tep toi da 1 GB, tai theo tung phan va tiep tuc khi mang gian doan */
.pending-attachment-panel {
  margin-top: 12px;
  border: 1px solid rgba(79, 70, 229, 0.22);
  border-radius: 14px;
  background: var(--primary-soft);
  padding: 13px;
}

.pending-attachment-heading,
.uploaded-attachment-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.pending-attachment-heading > div:first-child {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.pending-attachment-heading strong,
.uploaded-attachment-heading strong {
  color: var(--text);
  font-size: 12px;
}

.pending-attachment-heading span,
.uploaded-attachment-heading span {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
}

.pending-attachment-toolbar {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 6px;
}

.pending-attachment-toolbar .button {
  min-height: 35px;
  padding: 8px 10px;
  font-size: 10px;
  white-space: nowrap;
}

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

.pending-attachment-item {
  display: grid;
  min-width: 0;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(79, 70, 229, 0.18);
  border-radius: 12px;
  background: var(--surface);
  padding: 9px 10px;
}

.pending-attachment-icon {
  background: var(--surface-tint);
}

.pending-attachment-item[data-status="error"] {
  border-color: var(--danger);
}

.pending-upload-progress {
  overflow: hidden;
  width: 100%;
  height: 6px;
  margin-top: 6px;
  border-radius: 999px;
  background: var(--border);
}

.pending-upload-progress-fill {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--primary);
  transition: width 180ms ease;
}

.pending-attachment-remove {
  min-height: 34px;
  border-color: transparent;
  color: var(--danger);
  padding: 7px 9px;
  font-size: 10px;
  white-space: nowrap;
}

.uploaded-attachment-heading {
  align-items: flex-start;
  margin-top: 8px;
  border-top: 1px solid var(--border);
  padding-top: 13px;
}

.uploaded-attachment-heading span {
  max-width: 390px;
  text-align: right;
}

.attachment-delete-button {
  border-color: rgba(196, 63, 79, 0.18);
  background: rgba(196, 63, 79, 0.05);
  font-weight: 780;
}

@media (max-width: 680px) {
  /* Tren dien thoai, danh sach sao chep tung dong luon nam truoc khung soan thao. */
  .workspace .copy-column {
    order: -1;
  }

  .workspace .editor-column {
    order: 0;
  }

  .copy-card-header {
    padding-block: 17px;
  }

  .quick-copy-filter-row {
    align-items: stretch;
    flex-direction: column;
  }

  .quick-copy-remove-input {
    width: 100%;
    flex-basis: auto;
  }

  .line-list {
    max-height: 48vh;
  }

  .pending-attachment-heading,
  .uploaded-attachment-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .pending-attachment-toolbar {
    display: grid;
    width: 100%;
    grid-template-columns: 1fr 1fr;
  }

  .pending-attachment-toolbar .button {
    width: 100%;
  }

  .pending-attachment-item {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .pending-attachment-remove {
    width: 100%;
    grid-column: 1 / -1;
  }

  .uploaded-attachment-heading span {
    max-width: none;
    text-align: left;
  }
}

@media (prefers-color-scheme: dark) {
  .pending-attachment-panel {
    border-color: rgba(124, 115, 255, 0.28);
    background: rgba(79, 70, 229, 0.13);
  }

  .pending-attachment-item {
    border-color: rgba(124, 115, 255, 0.2);
  }

  .attachment-delete-button {
    background: rgba(196, 63, 79, 0.12);
  }
}

/* V10.1: logo ThượngQ Note và hai nút nổi mở link/tải tệp mới nhất */
.brand-text {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  white-space: nowrap;
}

.brand-text > span:first-child {
  background: linear-gradient(105deg, var(--text) 10%, #7c3aed 38%, #2563eb 58%, var(--text) 88%);
  background-size: 260% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: thuongq-logo-shine 4.2s ease-in-out infinite;
}

.brand-note {
  color: var(--primary);
  font-size: 0.64em;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  animation: thuongq-note-pulse 2.4s ease-in-out infinite;
}

.brand-mark-wide {
  animation: thuongq-mark-float 3s ease-in-out infinite;
}

@keyframes thuongq-logo-shine {
  0%, 22% { background-position: 100% 50%; }
  65%, 100% { background-position: 0% 50%; }
}

@keyframes thuongq-note-pulse {
  0%, 100% { opacity: 0.68; transform: translateY(0); }
  50% { opacity: 1; transform: translateY(-1px); }
}

@keyframes thuongq-mark-float {
  0%, 100% { transform: translateY(0) rotate(0deg); box-shadow: 0 8px 20px rgba(79, 70, 229, 0.22); }
  50% { transform: translateY(-2px) rotate(-2deg); box-shadow: 0 12px 26px rgba(79, 70, 229, 0.34); }
}

.latest-attachment-download {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 80;
  display: flex;
  max-width: min(340px, calc(100vw - 32px));
  min-height: 62px;
  align-items: center;
  gap: 11px;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 18px;
  background: linear-gradient(135deg, #4f46e5, #7c3aed 58%, #2563eb);
  padding: 10px 15px 10px 10px;
  color: #fff;
  box-shadow: 0 18px 48px rgba(49, 46, 129, 0.34);
  transition: transform 160ms ease, box-shadow 160ms ease;
  animation: latest-download-arrive 320ms ease-out both;
}

.latest-attachment-download:hover {
  transform: translateY(-3px);
  box-shadow: 0 22px 54px rgba(49, 46, 129, 0.42);
}

.latest-link-open {
  position: fixed;
  left: 22px;
  bottom: 22px;
  z-index: 80;
  display: flex;
  max-width: min(340px, calc(100vw - 32px));
  min-height: 62px;
  align-items: center;
  gap: 11px;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 18px;
  background: linear-gradient(135deg, #059669, #0f766e 58%, #0891b2);
  padding: 10px 15px 10px 10px;
  color: #fff;
  box-shadow: 0 18px 48px rgba(6, 95, 70, 0.32);
  cursor: pointer;
  text-align: left;
  transition: transform 160ms ease, box-shadow 160ms ease;
  animation: latest-download-arrive 320ms ease-out both;
}

.latest-link-open:hover {
  transform: translateY(-3px);
  box-shadow: 0 22px 54px rgba(6, 95, 70, 0.42);
}

.latest-download-icon {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  place-items: center;
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.18);
  font-size: 24px;
  font-weight: 900;
}

.latest-download-copy {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.latest-download-copy strong {
  font-size: 13px;
  line-height: 1;
}

.latest-download-copy span {
  overflow: hidden;
  opacity: 0.82;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@keyframes latest-download-arrive {
  from { opacity: 0; transform: translateY(14px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.check-ip-floating {
  position: fixed;
  top: 86px;
  left: 16px;
  z-index: 95;
  display: flex;
  min-height: 54px;
  max-width: min(230px, calc(100vw - 32px));
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(255, 255, 255, 0.48);
  border-radius: 16px;
  background: linear-gradient(135deg, #0f172a, #1d4ed8 62%, #0891b2);
  padding: 8px 13px 8px 8px;
  color: #fff;
  box-shadow: 0 16px 38px rgba(15, 23, 42, 0.28);
  text-decoration: none;
  transition: transform 160ms ease, box-shadow 160ms ease;
  animation: check-ip-floating-arrive 360ms ease-out both;
}

.check-ip-floating:hover {
  transform: translateY(-2px);
  box-shadow: 0 20px 44px rgba(15, 23, 42, 0.36);
}

.check-ip-floating-icon {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  place-items: center;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.17);
  font-size: 24px;
  font-weight: 900;
}

.check-ip-floating > span:last-child {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.check-ip-floating strong {
  font-size: 13px;
  line-height: 1.1;
}

.check-ip-floating small {
  overflow: hidden;
  opacity: 0.78;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@keyframes check-ip-floating-arrive {
  from { opacity: 0; transform: translateX(-14px) scale(0.96); }
  to { opacity: 1; transform: translateX(0) scale(1); }
}

@media (max-width: 680px) {
  .brand-compact > .brand-text {
    display: inline-flex;
  }

  .latest-attachment-download,
  .latest-link-open {
    max-width: calc(50vw - 18px);
    min-height: 60px;
    padding-right: 10px;
    border-radius: 16px;
  }

  .latest-attachment-download {
    right: 12px;
    bottom: max(12px, env(safe-area-inset-bottom));
  }

  .latest-link-open {
    left: 12px;
    bottom: max(12px, env(safe-area-inset-bottom));
  }

  .latest-download-icon {
    width: 36px;
    height: 36px;
    flex-basis: 36px;
    font-size: 20px;
  }

  .latest-download-copy strong {
    font-size: 11px;
  }

  .check-ip-floating {
    top: 74px;
    left: 10px;
    min-height: 48px;
    max-width: 172px;
    border-radius: 14px;
    padding: 6px 10px 6px 6px;
  }

  .check-ip-floating-icon {
    width: 34px;
    height: 34px;
    flex-basis: 34px;
    font-size: 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .brand-text > span:first-child,
  .brand-note,
  .brand-mark-wide,
  .check-ip-floating,
  .latest-link-open,
  .latest-attachment-download {
    animation: none;
  }
}
