@font-face {
  font-family: 'Satoshi';
  src: url('../fonts/Satoshi-Light.woff') format('woff');
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Satoshi';
  src: url('../fonts/Satoshi-Regular.woff') format('woff');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Satoshi';
  src: url('../fonts/Satoshi-Medium.woff') format('woff');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Satoshi';
  src: url('../fonts/Satoshi-Bold.woff') format('woff');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@import url('https://fonts.googleapis.com/css2?family=Geist+Mono:wght@100..900&family=Geist:wght@100..900&display=swap');

::-moz-selection {
  background: var(--border-color);
}

::selection {
  background: var(--border-color);
}

:root {
  --background: #141414;
  --foreground: #ebebeb;
  --kbd-background: #222;
  --text-primary: #d4d4d8;
  --text-secondary: #737373;
  --border-color: #404040;
  --border-subtle: #262626;
  --hover-bg: rgba(64, 64, 64, 0.2);
  --font-geist-sans: "Geist", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --font-geist-mono: "Geist Mono", monospace;
  --font-satoshi: "Satoshi", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --bookmark-max-height: calc(100vh - 20rem);
}

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

html {
  scroll-behavior: smooth;
}

::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: var(--background);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 3px;
  transition: background-color 0.3s ease;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-secondary);
}

* {
  scrollbar-width: thin;
  scrollbar-color: var(--border-color) var(--hover-bg);
}

body {
  background-color: var(--background);
  color: var(--foreground);
  font-family: var(--font-geist-sans);
  margin: 0;
  padding: 0;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body[data-drop-active="true"]::after {
  content: "DROP TO SAVE A BOOKMARK";
  position: fixed;
  inset: 0;
  border: 2px dashed rgba(255, 255, 255, 0.25);
  background: rgba(10, 10, 10, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-geist-mono);
  font-size: 0.85rem;
  letter-spacing: 0.18em;
  color: var(--text-primary);
  z-index: 2000;
  pointer-events: none;
}

body[data-view="app"] {
  overflow-y: auto;
}

@media (max-width: 768px) {
  body[data-view="app"] {
    overflow: auto;
  }
  :root {
    --bookmark-max-height: calc(100dvh - 18rem);
  }
}

@media (max-width: 640px) {
  :root {
    --bookmark-max-height: calc(100dvh - 16rem);
  }
}

[hidden] {
  display: none !important;
}

.loading-view {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--background);
  color: var(--text-secondary);
  font-family: var(--font-geist-sans);
}

.loading-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.app-view {
  display: none;
}

body[data-view="app"] .app-view {
  display: block;
}

.app-view .container {
  min-height: 100vh;
  height: auto;
  display: flex;
  flex-direction: column;
  overflow: visible;
  padding-bottom: 2rem;
}

.app-header,
.search-container {
  flex-shrink: 0;
}

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

.container {
  max-width: 56rem;
  margin: 0 auto;
  padding: 1.5rem 1rem;
  position: relative;
  min-height: 100vh;
}

@media (min-width: 640px) {
  .container {
    padding: 2rem 1.5rem;
  }
}

/* Header */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0 2rem;
  width: 100%;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-satoshi);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.logo-icon {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: linear-gradient(135deg, #f26659, #ff9b6a);
  display: grid;
  place-items: center;
  font-weight: 700;
  color: #050607;
  font-size: 0.875rem;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  position: relative;
}

/* Group Picker */
.group-picker {
  position: relative;
}

.group-picker-button {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.25rem;
  background: transparent;
  border: none;
  border-radius: 0;
  color: var(--text-primary);
  font-family: var(--font-geist-mono);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.15s ease;
}

.group-picker-button svg {
  color: #cbcbcb;
}

.group-picker-button:hover,
.group-picker-button:focus-visible {
  color: var(--foreground);
  text-decoration: underline;
}

.group-dropdown {
  position: absolute;
  top: calc(100% + 0.5rem);
  left: 0;
  min-width: 200px;
  background: var(--background);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 0.5rem;
  display: none;
  z-index: 100;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

.group-picker[data-open="true"] .group-dropdown {
  display: block;
}

.group-options {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding-bottom: 0.4rem;
}

.group-divider {
  border: none;
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
  margin: 0.35rem 0;
}

.group-actions {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0 0.1rem 0.35rem;
}

.group-action-button {
  width: 100%;
  padding: 0.5rem 0.65rem;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-family: var(--font-satoshi);
  font-size: 0.875rem;
  font-weight: 500;
  text-align: left;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.group-action-button:hover {
  background: var(--hover-bg);
  color: var(--text-primary);
}

.group-action-button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  background: transparent;
}

.group-action-button.danger {
  color: #f87171;
}

.group-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0.5rem 0.75rem;
  background: transparent;
  border: none;
  border-radius: 4px;
  color: var(--text-primary);
  font-family: var(--font-satoshi);
  font-size: 0.875rem;
  cursor: pointer;
  transition: background 0.15s ease;
  text-align: left;
}

.group-option-content {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex: 1;
  min-width: 0;
}

.group-option-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.group-color-chip {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: var(--group-color, var(--border-subtle));
  border: 1px solid rgba(255, 255, 255, 0.25);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35);
  flex-shrink: 0;
}

.group-option:hover {
  background: var(--hover-bg);
}

.group-option.active {
  background: var(--hover-bg);
  color: var(--foreground);
}

.tag {
  padding: 0.125rem 0.375rem;
  background: var(--border-subtle);
  border-radius: 4px;
  font-family: var(--font-geist-mono);
  font-size: 0.625rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.tag.tiny {
  font-size: 0.625rem;
}

.tag.muted {
  opacity: 0.7;
}

.tag.danger {
  background: rgba(248, 113, 113, 0.15);
  color: #f87171;
}

.group-form {
  padding: 0.5rem;
  border-top: 1px solid var(--border-subtle);
  margin-top: 0.5rem;
  display: none;
  flex-direction: column;
  gap: 0.5rem;
}

.group-form.visible {
  display: flex;
}

.group-form input[type="text"],
.group-form input:not([type]) {
  width: 100%;
  padding: 0.5rem;
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  color: var(--text-primary);
  font-family: var(--font-geist-sans);
  font-size: 0.875rem;
  margin-bottom: 0.5rem;
}

.group-form input[type="text"]:focus,
.group-form input:not([type]):focus {
  outline: none;
  border-color: var(--text-secondary);
}

.group-color-picker {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.65rem;
  border: 1px dashed var(--border-color);
  border-radius: 999px;
  color: var(--text-secondary);
  font-family: var(--font-geist-mono);
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  flex-shrink: 0;
  width: 100%;
  justify-content: space-between;
}

.group-color-picker span {
  pointer-events: none;
}

.group-color-picker input[type="color"] {
  appearance: none;
  border: none;
  background: transparent;
  width: 24px;
  height: 24px;
  padding: 0;
  cursor: pointer;
}

.group-color-picker input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 0;
}

.group-color-picker input[type="color"]::-webkit-color-swatch {
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.group-color-picker input[type="color"]::-moz-color-swatch {
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.group-form button {
  width: 100%;
  padding: 0.5rem;
  background: var(--hover-bg);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  color: var(--text-primary);
  font-family: var(--font-geist-mono);
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.group-form button:hover {
  background: var(--border-subtle);
}

.group-form button + button,
.group-form button + .ghost-chip {
  margin-top: 0.25rem;
}

.group-color-controls {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.group-color-controls input[type="color"] {
  appearance: none;
  width: 44px;
  height: 44px;
  padding: 0;
  border: none;
  border-radius: 10px;
  background: transparent;
  cursor: pointer;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.group-color-controls input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 0;
}

.group-color-controls input[type="color"]::-webkit-color-swatch {
  border: none;
  border-radius: 10px;
}

.group-color-controls input[type="color"]::-moz-color-swatch {
  border: none;
  border-radius: 10px;
}

.form-hint {
  font-family: var(--font-geist-mono);
  font-size: 0.65rem;
  color: var(--text-secondary);
  margin-top: -0.2rem;
}

/* Search Bar */
.search-container {
  position: relative;
  width: 100%;
  max-width: 100%;
  margin: 0 auto 2rem;
}

.search-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.search-input {
  width: 100%;
  padding: 0.6rem 2.75rem 0.6rem 2.25rem;
  background: var(--border-subtle);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  color: var(--text-primary);
  font-family: var(--font-geist-sans);
  font-size: 0.875rem;
  transition: all 0.15s ease;
}

.search-input:focus {
  outline: none;
  border-color: var(--text-secondary);
  background: var(--hover-bg);
}

.search-input::placeholder {
  color: var(--text-secondary);
}

.search-input::-ms-clear,
.search-input::-ms-reveal {
  display: none;
  width: 0;
  height: 0;
}

.search-input::-webkit-search-decoration,
.search-input::-webkit-search-cancel-button,
.search-input::-webkit-search-results-button,
.search-input::-webkit-search-results-decoration {
  display: none;
}

.add-bookmark-btn {
  position: absolute;
  left: 0.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  transition: color 0.15s ease;
}

.add-bookmark-btn:hover {
  color: var(--text-primary);
}

.clear-search-btn {
  position: absolute;
  right: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  transition: color 0.15s ease;
}

.clear-search-btn:hover {
  color: var(--text-primary);
}

/* User Chip */
.user-chip {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0;
  background: transparent;
  border: none;
  border-radius: 0;
  cursor: pointer;
  transition: color 0.15s ease;
}

.user-chip:hover,
.user-chip:focus-visible {
  color: var(--foreground);
}

.user-chip svg {
  color: #c7c7c7;
}

.user-avatar {
  width: 24px;
  height: 24px;
  border-radius: 4px;
  background: var(--border-color);
  display: grid;
  place-items: center;
  font-family: var(--font-geist-mono);
  font-size: 0.625rem;
  font-weight: 600;
  color: var(--text-primary);
  overflow: hidden;
}

.user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.user-menu {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  min-width: 200px;
  background: var(--background);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 0.5rem;
  display: none;
  z-index: 100;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

.user-menu[data-open="true"] {
  display: block;
}

.user-menu hr {
  border: none;
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
  margin: 0.35rem 0;
}

.user-menu-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.5rem 0.75rem;
  background: transparent;
  border: none;
  border-radius: 4px;
  color: var(--text-primary);
  font-family: var(--font-satoshi);
  font-size: 0.875rem;
  cursor: pointer;
  transition: background 0.15s ease;
  text-align: left;
}

.user-menu-item:hover {
  background: var(--hover-bg);
}

.user-menu-item.signout {
  color: #f87171;
}

.user-menu-item.signout:hover {
  background: rgba(248, 113, 113, 0.12);
}

/* Bookmarks List */
.bookmarks-section {
  margin-top: 2rem;
}

.app-view .bookmarks-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  max-height: var(--bookmark-max-height);
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-subtle);
}

.section-title {
  font-family: var(--font-geist-mono);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.bookmark-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: block;
}

.bookmark-row + .bookmark-row {
  margin-top: 0.2rem;
}

.app-view .bookmark-list {
  flex: 1;
  overflow-y: auto;
  padding-right: 0.15rem;
  max-height: var(--bookmark-max-height);
}

.loading-state {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 2rem 0.5rem;
  color: var(--text-secondary);
  font-family: var(--font-geist-sans);
  font-size: 0.85rem;
}

.spinner {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.15);
  border-top-color: var(--text-primary);
  animation: spin 0.8s linear infinite;
}

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

.bookmark-row {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  display: block;
  width: 100%;
  min-height: 52px;
}

.bookmark-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.45rem;
  padding: 0.25rem 0.45rem;
  background: transparent;
  border-radius: 10px;
  transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.18s ease;
  cursor: pointer;
  will-change: transform;
  transform: translateX(var(--swipe-offset, 0px));
  width: 100%;
}

.bookmark-row.is-swiping .bookmark-card {
  transition: none;
}

.bookmark-row:hover .bookmark-card {
  background: rgba(255, 255, 255, 0.05);
}

.bookmark-row.is-focused .bookmark-card {
  background: rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.15);
}

.bookmark-row.is-focused .bookmark-actions {
  opacity: 1;
  pointer-events: auto;
}

.bookmark-date {
  font-family: var(--font-satoshi);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  min-width: 110px;
  text-align: right;
  white-space: nowrap;
}

.bookmark-main {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex: 1;
  min-width: 0;
}

.bookmark-side {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: nowrap;
  flex-shrink: 0;
}

.bookmark-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
}

.bookmark-row:hover .bookmark-actions {
  opacity: 1;
  pointer-events: auto;
}

.bookmark-action {
  width: 22px;
  height: 22px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
  font-size: 0.65rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.bookmark-action:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.2);
}

.bookmark-action.delete {
  border-color: rgba(248, 113, 113, 0.4);
  color: #f87171;
}

.bookmark-action.delete:hover {
  background: rgba(248, 113, 113, 0.15);
  color: #fecaca;
}

.bookmark-icon {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.08);
}

.bookmark-icon--image {
  border: none;
  background: rgba(255, 255, 255, 0.08);
}

.bookmark-icon--image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.bookmark-icon img {
  width: 70%;
  height: 70%;
  object-fit: contain;
  display: block;
}

.bookmark-icon--link {
  border: none;
  background: transparent;
  font-family: var(--font-geist-mono);
  font-size: 0.65rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-primary);
}

.bookmark-icon--link img {
  width: 100%;
  height: 100%;
}

.bookmark-icon-fallback {
  display: none;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.bookmark-icon--link.show-fallback .bookmark-icon-fallback {
  display: flex;
}

.bookmark-icon--link.has-favicon .bookmark-icon-fallback {
  display: none;
}

.bookmark-icon--link.show-fallback img {
  display: none;
}

.bookmark-copy {
  flex: 1;
  min-width: 0;
}

.bookmark-line {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
}

.bookmark-title {
  font-family: var(--font-satoshi);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-primary);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bookmark-title:hover {
  text-decoration: underline;
}

.bookmark-meta-inline {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-family: var(--font-geist-mono);
  font-size: 0.72rem;
  color: var(--text-secondary);
  min-width: 0;
}

.bookmark-group-tag {
  --tag-color: #a1a1aa;
  display: inline-flex;
  align-items: center;
  padding: 0.08rem 0.5rem;
  border-radius: 999px;
  font-family: var(--font-geist-mono);
  font-size: 0.6rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--tag-color);
}

.bookmark-domain {
  opacity: 0.75;
  white-space: nowrap;
}

.empty-state {
  padding: 3rem 1rem;
  text-align: center;
  color: var(--text-secondary);
  font-family: var(--font-satoshi);
  font-size: 0.875rem;
}

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
}

.modal[aria-hidden="false"] {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  width: 480px;
  max-width: calc(100vw - 2rem);
  max-height: calc(100vh - 2rem);
  background: rgba(12, 12, 12, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 1.25rem;
  overflow-y: auto;
  transform: translateY(4px) scale(0.99);
  transition: transform 0.18s ease;
}

.modal-content.small {
  width: 360px;
}

.modal[aria-hidden="false"] .modal-content {
  transform: translateY(0) scale(1);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.modal-title {
  font-family: var(--font-satoshi);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary);
}

.modal-close {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s ease;
}

.modal-close:hover {
  color: var(--text-primary);
}

.modal-body {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.form-label {
  font-family: var(--font-geist-mono);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 0.7rem 0.85rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  color: var(--text-primary);
  font-family: var(--font-geist-sans);
  font-size: 0.88rem;
  transition: all 0.15s ease;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.05);
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--text-secondary);
}

.preview-card {
  padding: 1rem;
  background: var(--border-subtle);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.preview-icon {
  width: 40px;
  height: 40px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.preview-icon img {
  width: 24px;
  height: 24px;
}

.preview-details {
  flex: 1;
  min-width: 0;
}

.preview-title {
  font-family: var(--font-satoshi);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.preview-meta {
  font-family: var(--font-geist-mono);
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.btn-primary {
  width: 100%;
  padding: 0.75rem;
  background: var(--hover-bg);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  color: var(--text-primary);
  font-family: var(--font-geist-mono);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-primary:hover {
  background: var(--border-subtle);
  border-color: var(--text-secondary);
}

.modal-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.btn-danger {
  width: 100%;
  padding: 0.65rem;
  border-radius: 6px;
  border: 1px solid rgba(239, 68, 68, 0.45);
  background: transparent;
  color: #fca5a5;
  font-family: var(--font-geist-mono);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.7);
}

.is-hidden {
  display: none !important;
}

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  padding: 0.55rem 1rem;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  font-family: var(--font-geist-mono);
  font-size: 0.75rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 1200;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.swipe-backdrop {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
  padding: 0.35rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  gap: 0.35rem;
}

.bookmark-row.swipe-active .swipe-backdrop,
.bookmark-row.is-swiping .swipe-backdrop {
  opacity: 1;
}

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

.combo-field {
  position: relative;
}

.combo-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.7rem 0.85rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-primary);
  font-family: var(--font-geist-sans);
  font-size: 0.88rem;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.combo-trigger:hover,
.combo-field[data-open="true"] .combo-trigger {
  border-color: rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.05);
}

.combo-trigger svg {
  flex-shrink: 0;
}

.combo-panel {
  position: absolute;
  top: calc(100% + 0.35rem);
  left: 0;
  width: 100%;
  background: rgba(10, 10, 10, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 0.5rem;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.4);
  opacity: 0;
  pointer-events: none;
  transform: translateY(4px);
  transition: opacity 0.15s ease, transform 0.15s ease;
  z-index: 60;
}

.combo-field[data-open="true"] .combo-panel {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.combo-search-row {
  padding-bottom: 0.4rem;
  margin-bottom: 0.4rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.combo-search {
  width: 100%;
  padding: 0.4rem 0.6rem;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-primary);
  font-family: var(--font-geist-sans);
  font-size: 0.85rem;
}

.combo-search:focus {
  outline: none;
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.05);
}

.combo-options {
  max-height: 220px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding-right: 0.1rem;
}

.combo-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
  padding: 0.4rem 0.5rem;
  border-radius: 6px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-primary);
  font-family: var(--font-satoshi);
  font-size: 0.85rem;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.combo-option:hover,
.combo-option.is-active {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.12);
}

.combo-option-main {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
  flex: 1;
}

.combo-option-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.combo-option-meta {
  font-family: var(--font-geist-mono);
  font-size: 0.65rem;
  color: var(--text-secondary);
}

.combo-color {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: var(--chip-color, var(--border-subtle));
  border: 1px solid rgba(255, 255, 255, 0.2);
  flex-shrink: 0;
}

.combo-empty {
  font-family: var(--font-geist-mono);
  font-size: 0.75rem;
  color: var(--text-secondary);
  padding: 0.5rem 0.25rem;
  text-align: center;
}

.swipe-pill {
  border-radius: 10px;
  font-family: var(--font-geist-mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  opacity: 0.25;
  padding: 0 1rem;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.swipe-pill.edit {
  justify-content: flex-start;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.45), rgba(14, 165, 233, 0.55));
}

.swipe-pill.delete {
  justify-content: flex-end;
  background: linear-gradient(135deg, rgba(248, 113, 113, 0.6), rgba(239, 68, 68, 0.7));
}

.bookmark-row[data-swipe-direction="right"] .swipe-pill.edit,
.bookmark-row[data-swipe-direction="left"] .swipe-pill.delete {
  opacity: 1;
  transform: scale(1.02);
}

.ghost-chip {
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-geist-mono);
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.35rem 0.85rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.ghost-chip:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
}

.ghost-chip.tertiary {
  border-style: dashed;
}

.modal-subtitle {
  font-family: var(--font-satoshi);
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin: 0.35rem 0 0;
}

.modal-simple {
  width: min(520px, calc(100vw - 2rem));
}

.simple-form {
  gap: 1rem;
}

.form-inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.85rem;
}

.attachment-zone {
  border: 1px dashed rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  padding: 0.75rem;
  background: rgba(255, 255, 255, 0.02);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.attachment-zone[data-has-file="true"] {
  border-style: solid;
  border-color: rgba(255, 255, 255, 0.35);
}

.attachment-zone.is-dragging {
  border-color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.attachment-dropcopy {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
  font-family: var(--font-geist-mono);
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.attachment-preview {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.attachment-preview[hidden] {
  display: none;
}

.attachment-preview-media {
  width: 56px;
  height: 56px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  flex-shrink: 0;
}

.attachment-preview-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.attachment-preview-details {
  flex: 1;
  min-width: 0;
}

.attachment-name {
  margin: 0;
  font-family: var(--font-satoshi);
  font-size: 0.85rem;
  color: var(--text-primary);
}

.attachment-meta {
  margin: 0.1rem 0 0;
  font-family: var(--font-geist-mono);
  font-size: 0.7rem;
  color: var(--text-secondary);
}

.modal-actions.simple {
  flex-direction: row;
  align-items: center;
  gap: 0.75rem;
}

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

.modal-actions.simple .btn-danger {
  max-width: 180px;
}

@media (max-width: 600px) {
  .modal-actions.simple {
    flex-direction: column;
    align-items: stretch;
  }
}

@media (max-width: 640px) {
  .bookmark-card {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
  }

  .bookmark-main {
    min-width: 0;
    flex: 1;
    width: 100%;
  }

  .bookmark-side {
    margin-left: 0;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  .bookmark-date {
    min-width: auto;
    text-align: right;
  }

  .bookmark-actions {
    display: none;
  }
}

