:root {
  --ink: #172033;
  --muted: #6d7585;
  --line: #dfe4ec;
  --surface: #ffffff;
  --surface-soft: #f4f7fb;
  --blue: #2583f7;
  --blue-dark: #1468d3;
  --cyan: #4dc8df;
  --danger: #da4453;
  --shadow: 0 18px 55px rgba(36, 55, 87, 0.1);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 0%, rgba(77, 200, 223, 0.2), transparent 24rem),
    radial-gradient(circle at 92% 8%, rgba(37, 131, 247, 0.14), transparent 27rem),
    #eef3f9;
}

button,
textarea,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.shell {
  width: min(1080px, calc(100% - 32px));
  margin: 0 auto;
  padding: 54px 0 80px;
}

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

.eyebrow,
.section-kicker {
  display: block;
  margin: 0 0 8px;
  color: var(--blue);
  font-size: 0.73rem;
  font-weight: 800;
  letter-spacing: 0.13em;
}

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

h1 {
  max-width: 680px;
  margin-bottom: 12px;
  font-size: clamp(2.25rem, 6vw, 4.65rem);
  line-height: 0.98;
  letter-spacing: -0.055em;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(1.35rem, 3vw, 1.9rem);
  letter-spacing: -0.025em;
}

.subtitle {
  max-width: 650px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 1.03rem;
  line-height: 1.65;
}

.stock-pill {
  flex: 0 0 auto;
  padding: 12px 16px;
  border: 1px solid rgba(37, 131, 247, 0.2);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.75);
  box-shadow: 0 8px 30px rgba(37, 131, 247, 0.08);
  color: #48536a;
  backdrop-filter: blur(10px);
}

.pulse {
  display: inline-block;
  width: 9px;
  height: 9px;
  margin-right: 8px;
  border-radius: 50%;
  background: #21c47b;
  box-shadow: 0 0 0 5px rgba(33, 196, 123, 0.13);
}

.panel {
  margin-bottom: 22px;
  overflow: hidden;
  border: 1px solid rgba(197, 207, 221, 0.78);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
}

.claim-panel {
  padding: 28px;
}

.sales-panel {
  padding: 28px;
}

.add-link-button {
  color: white;
  background: #172033;
}

.add-link-button span {
  margin-right: 5px;
  font-size: 1.2rem;
}

.link-form {
  display: grid;
  gap: 9px;
  margin-bottom: 15px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-soft);
}

.link-form label {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 750;
}

.link-form input[type="text"],
.link-form input[inputmode="url"] {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 10px;
  outline: none;
  padding: 0 13px;
  color: var(--ink);
  background: white;
}

.link-form input:focus {
  border-color: rgba(37, 131, 247, 0.65);
  box-shadow: 0 0 0 4px rgba(37, 131, 247, 0.1);
}

.link-form-actions {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 9px;
  margin-top: 5px;
}

.sale-form {
  display: grid;
  gap: 9px;
  margin-bottom: 15px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-soft);
}

.sale-form label {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 750;
}

.sale-form input[type="text"] {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 10px;
  outline: none;
  padding: 0 13px;
  color: var(--ink);
  background: white;
}

.sale-password-presets {
  display: grid;
  gap: 8px;
  margin: -2px 0 4px;
  padding: 10px;
  border: 1px dashed rgba(37, 131, 247, 0.28);
  border-radius: 12px;
  background: rgba(37, 131, 247, 0.04);
}

.sale-password-presets-title {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
}

.sale-password-preset-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
}

.sale-password-preset-row label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #526078;
  font-size: 0.82rem;
}

.sale-password-preset-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--blue);
}

.sale-password-presets small {
  color: #7d8797;
  font-size: 0.78rem;
  line-height: 1.45;
}

.sale-form input:focus {
  border-color: rgba(37, 131, 247, 0.65);
  box-shadow: 0 0 0 4px rgba(37, 131, 247, 0.1);
}

.sale-form-actions {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 9px;
  margin-top: 5px;
}

.sales-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.sales-total {
  padding: 12px 14px;
  border: 1px solid rgba(37, 131, 247, 0.17);
  border-radius: 13px;
  background: rgba(37, 131, 247, 0.055);
  color: #3d4a63;
  font-weight: 750;
}

.sales-total strong {
  color: var(--blue-dark);
  font-size: 1.1rem;
}

.sales-copy-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.sales-list {
  display: grid;
  gap: 12px;
}

.sale-item {
  display: grid;
  gap: 13px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--surface-soft);
}

.sale-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.sale-account-value {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sale-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 7px;
}

.sale-actions .icon-button {
  color: #526078;
  background: white;
}

.sale-delete-button {
  color: var(--danger) !important;
}

.sale-item-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(160px, 0.6fr);
  gap: 12px;
}

.links-empty {
  padding: 22px 0 8px;
  color: var(--muted);
  text-align: center;
}

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

.link-item {
  display: flex;
  align-items: stretch;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-soft);
}

.link-open {
  display: flex;
  flex: 1;
  align-items: center;
  min-width: 0;
  gap: 12px;
  padding: 14px;
  color: inherit;
  text-decoration: none;
}

.link-open:hover {
  background: rgba(37, 131, 247, 0.06);
}

.link-icon {
  display: grid;
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 11px;
  color: white;
  background: linear-gradient(135deg, var(--blue), var(--cyan));
  font-weight: 850;
}

.link-text {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.link-name,
.link-url {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.link-url {
  color: var(--muted);
  font-size: 0.75rem;
}

.link-actions {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px;
  border-left: 1px solid var(--line);
}

.link-actions .icon-button {
  color: #526078;
  background: white;
}

.link-delete-button {
  color: var(--danger) !important;
}

.icloud-list {
  display: grid;
  gap: 12px;
}

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

.icloud-form label:not(.show-password-row) {
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 750;
}

.icloud-form input[type="text"],
.icloud-form input[type="password"] {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 10px;
  outline: none;
  padding: 0 13px;
  color: var(--ink);
  background: #f8fafc;
}

.icloud-form input[type="text"]:focus,
.icloud-form input[type="password"]:focus {
  border-color: rgba(37, 131, 247, 0.65);
  box-shadow: 0 0 0 4px rgba(37, 131, 247, 0.1);
}

.show-password-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 3px 0 8px;
  color: var(--muted);
  font-size: 0.86rem;
}

.show-password-row input {
  width: 17px;
  height: 17px;
  accent-color: var(--blue);
}

.icloud-item {
  display: grid;
  gap: 13px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--surface-soft);
}

.icloud-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.icloud-name {
  overflow: hidden;
  font-size: 1rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.icloud-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 7px;
}

.icloud-actions .icon-button {
  color: #526078;
  background: white;
}

.icloud-delete-button {
  color: var(--danger) !important;
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

.button {
  min-height: 44px;
  border: 0;
  border-radius: 12px;
  padding: 0 18px;
  font-weight: 750;
  transition:
    transform 150ms ease,
    box-shadow 150ms ease,
    background 150ms ease;
}

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

.button:disabled {
  cursor: not-allowed;
  opacity: 0.6;
  transform: none;
}

.button-primary {
  color: white;
  background: linear-gradient(135deg, var(--blue), #246bea);
  box-shadow: 0 12px 26px rgba(37, 131, 247, 0.25);
}

.button-primary:hover {
  box-shadow: 0 15px 32px rgba(37, 131, 247, 0.35);
}

.button-large {
  width: 100%;
  min-height: 58px;
  font-size: 1rem;
}

.button-large span {
  margin-right: 7px;
  font-size: 1.3rem;
}

.button-secondary {
  width: 100%;
  color: white;
  background: #172033;
}

.button-ghost {
  border: 1px solid var(--line);
  color: #556075;
  background: var(--surface-soft);
}

.message {
  min-height: 24px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 0.91rem;
  white-space: pre-line;
}

.message.success {
  color: #118653;
}

.message.error {
  color: var(--danger);
}

.empty-state {
  margin-top: 8px;
  padding: 42px 20px 28px;
  text-align: center;
  color: var(--muted);
}

.empty-icon {
  margin-bottom: 10px;
  color: #a5b1c3;
  font-size: 2.2rem;
}

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

.claimed-list {
  display: grid;
  gap: 18px;
  margin-top: 10px;
}

.account-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: var(--surface);
}

.account-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 16px;
  color: white;
  background: linear-gradient(110deg, #1b79ef, #44b8dc);
}

.account-number {
  font-weight: 800;
}

.claimed-time {
  margin-left: 9px;
  color: rgba(255, 255, 255, 0.76);
  font-size: 0.78rem;
}

.icon-button {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 9px;
  color: white;
  background: rgba(255, 255, 255, 0.16);
  font-size: 1.35rem;
}

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

.field {
  min-width: 0;
}

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

.field-label {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
}

.value-row {
  display: flex;
  align-items: stretch;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f3f6fa;
}

.value-row code {
  display: flex;
  flex: 1;
  align-items: center;
  min-width: 0;
  min-height: 48px;
  overflow: auto hidden;
  padding: 0 13px;
  color: #263146;
  font-family: "SFMono-Regular", Consolas, monospace;
  white-space: nowrap;
}

.copy-button {
  flex: 0 0 auto;
  border: 0;
  border-left: 1px solid var(--line);
  padding: 0 13px;
  color: var(--blue-dark);
  background: white;
  cursor: pointer;
  font-size: 0.79rem;
  font-weight: 800;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.copy-button.copied {
  color: #118653;
  background: #eaf9f1;
}

.otp-field {
  padding: 14px;
  border: 1px solid rgba(37, 131, 247, 0.2);
  border-radius: 13px;
  background: rgba(37, 131, 247, 0.055);
}

.otp-heading {
  display: flex;
  justify-content: space-between;
}

.otp-countdown {
  color: var(--blue);
  font-size: 0.78rem;
  font-weight: 800;
}

.otp-value {
  color: var(--blue-dark) !important;
  font-size: 1.35rem;
  font-weight: 850;
  letter-spacing: 0.13em;
}

.countdown-track {
  height: 4px;
  margin-top: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(37, 131, 247, 0.14);
}

.countdown-track span {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue), var(--cyan));
  transition: width 250ms linear;
}

.collapsible-panel,
.add-panel {
  padding: 0;
}

.collapsible-panel summary,
.add-panel summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 21px 24px;
  cursor: pointer;
  list-style: none;
}

.collapsible-panel summary::-webkit-details-marker,
.add-panel summary::-webkit-details-marker {
  display: none;
}

.collapsible-panel summary strong,
.add-panel summary strong {
  display: block;
  font-size: 1.12rem;
}

.summary-action {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.collapsible-content,
.add-content {
  padding: 0 24px 24px;
  border-top: 1px solid var(--line);
}

.section-actions {
  display: flex;
  justify-content: flex-end;
  padding: 18px 0 14px;
}

.add-content label {
  display: block;
  margin: 20px 0 10px;
  color: var(--muted);
  font-size: 0.91rem;
}

.add-options {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px 12px;
  margin: -2px 0 12px;
}

.dedupe-toggle-button {
  min-height: 40px;
  border: 1px solid rgba(17, 134, 83, 0.22);
  color: #118653;
  background: rgba(17, 134, 83, 0.08);
}

.dedupe-toggle-button.is-off {
  border-color: rgba(224, 56, 72, 0.22);
  color: var(--danger);
  background: rgba(224, 56, 72, 0.08);
}

#dedupeToggleNote {
  min-width: 220px;
  flex: 1 1 260px;
  color: #7d8797;
  font-size: 0.82rem;
  line-height: 1.45;
}

.add-content code {
  color: var(--blue-dark);
}

textarea {
  width: 100%;
  resize: vertical;
  margin-bottom: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  outline: none;
  padding: 14px;
  color: var(--ink);
  background: #f8fafc;
  font-family: "SFMono-Regular", Consolas, monospace;
  line-height: 1.55;
}

textarea:focus {
  border-color: rgba(37, 131, 247, 0.65);
  box-shadow: 0 0 0 4px rgba(37, 131, 247, 0.1);
}

.note {
  margin: 4px 0 0;
  color: #8a93a3;
  font-size: 0.8rem;
  line-height: 1.55;
}

.inventory-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 30px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.inventory-heading strong {
  display: block;
  font-size: 1.08rem;
}

.inventory-heading-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.inventory-empty {
  padding: 24px 0 8px;
  color: var(--muted);
  text-align: center;
}

.inventory-list {
  display: grid;
  gap: 12px;
  margin-top: 8px;
}

.inventory-item {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-soft);
}

.inventory-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 9px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
}

.inventory-order {
  color: var(--blue-dark);
}

.inventory-input {
  margin-bottom: 10px;
  background: white;
}

.inventory-actions {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 9px;
}

.button-save {
  color: white;
  background: var(--blue);
}

.button-danger {
  border: 1px solid rgba(218, 68, 83, 0.25);
  color: var(--danger);
  background: #fff4f5;
}

@media (max-width: 720px) {
  .shell {
    width: min(100% - 20px, 1080px);
    padding-top: 30px;
  }

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

  .claim-panel {
    padding: 18px;
  }

  .sales-panel {
    padding: 18px;
  }

  .collapsible-panel,
  .add-panel {
    padding: 0;
  }

  .panel-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .sales-toolbar,
  .sale-item-grid {
    grid-template-columns: 1fr;
  }

  .sales-copy-actions {
    justify-content: stretch;
  }

  .sales-copy-actions .button {
    flex: 1 1 150px;
  }

  .inventory-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .inventory-heading-actions {
    width: 100%;
    justify-content: stretch;
  }

  .inventory-heading-actions .button {
    flex: 1 1 130px;
  }

  .field-grid {
    grid-template-columns: 1fr;
    padding: 13px;
  }

  .field-wide {
    grid-column: auto;
  }

  .value-row {
    flex-direction: column;
  }

  .copy-button {
    min-height: 44px;
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .claimed-time {
    display: block;
    margin: 3px 0 0;
  }

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

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

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

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

  .link-actions {
    justify-content: flex-end;
    border-top: 1px solid var(--line);
    border-left: 0;
  }
}
