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

/* Visually hidden but still readable by screen readers/search engines - used for the
   landing page's SEO/accessibility <h1>, which the visual design otherwise has no room
   for (the logo image already conveys the brand). Not display:none, which would hide
   it from both. */
.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;
}

:root {
  --mobile-scale: 1;
  --mobile-width-scale: 1;
}

@media (max-width: 600px) {
  :root {
    /* Narrow/mobile: icons render 40% smaller than the configured scale, and the
       link item's width (icon + text column) shrinks by a further 20% on top of
       that so links sit closer together. */
    --mobile-scale: 0.6;
    --mobile-width-scale: 0.8;
  }

  /* Grid link labels only (not the bookmarks bar) - 20% smaller than the usual 10pt */
  .links-grid .link-label {
    font-size: 8pt;
  }

  /* "Multiple" search box type: stack the logo above the search boxes instead of
     squeezing two columns into a narrow screen. The desktop rule's `flex: 1 1 0`
     is a width-splitting rule for the row layout - reset to natural height and
     full width now that the main axis is vertical, so both stack cleanly. */
  .multi-search-row {
    flex-direction: column;
    gap: 20px;
    max-width: 1400px;
  }

  .multi-search-logo,
  .multi-search-engines {
    flex: 0 1 auto;
    width: 100%;
  }
}

/* The Configuration modal (~1150px wide at full size) gets cramped well before the
   600px breakpoint used everywhere else, so its narrow/mobile layout switches over
   at its own, wider threshold. */
@media (max-width: 800px) {
  /* Configuration modal's two columns are a fixed 2fr/3fr grid (see .config-form-columns) -
     stack them into one column, in the same source order, instead of squeezing both
     into a shared row. Scoped to #configModal (not just `.config-form-columns`) so
     this override always wins on specificity - the unconditional 2fr/3fr rule lives
     later in this file and would otherwise win the cascade tie despite this media
     query matching, since @media alone adds no specificity. */
  #configModal .config-form-columns {
    grid-template-columns: 1fr;
  }

  /* Configuration modal can now be taller than the viewport once its two columns
     collapse into one (see .config-form-columns above) - let the overlay itself
     scroll instead of centering-and-clipping a modal window taller than 100vh. */
  #configModal {
    align-items: flex-start;
    overflow-y: auto;
    padding: 20px 0;
  }

  /* Button row: the left-hand group (Leave my page / Copy my link / Copy bookmarklet
     text / Info) wraps onto its own line(s) above Cancel/OK. A zero-height spacer
     (`.config-buttons-break`, a plain empty <span> in the markup right after Info)
     is given `flex-basis: 100%` to force a line break after it, without stretching
     the Info button itself to fill the row (which is what giving Info that same
     `flex-basis: 100%` directly did before - it forced the break but also became
     the width of the whole row). Cancel then gets `margin-left: auto` to pin
     Cancel+OK to the bottom-right of that fresh line. */
  #configModal .modal-buttons {
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  #configModal .modal-btn-group-end {
    margin-right: 0;
  }

  #configModal .config-buttons-break {
    display: block;
    flex-basis: 100%;
    height: 0;
  }

  #configModal .modal-btn-cancel {
    margin-left: auto;
  }
}

.config-buttons-break {
  display: none;
}

body {
  background-color: #000;
  font-family: "Segoe UI", Tahoma, sans-serif;
  font-size: 10pt;
  color: #fff;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  min-height: 100vh;
  padding: 0 20px 80px 20px;
  position: relative;
  padding-top: 40px;
}

.add-link-btn,
.settings-btn {
  position: fixed;
  bottom: 20px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.3);
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s;
  z-index: 500;
  line-height: 1;
  padding: 0;
}

.add-link-btn {
  right: 70px;
  opacity: 0.5;
}

.settings-btn {
  right: 20px;
  opacity: 0.5;
}

.add-link-btn:hover,
.settings-btn:hover {
  background-color: rgba(255, 255, 255, 0.2);
  opacity: 1;
}

.container {
  width: 100%;
  max-width: 1400px;
  text-align: center;
}

.container-no-logo {
  margin-top: 84px;
}

.bookmarks-bar {
  position: fixed;
  top: 4px;
  left: 4px;
  right: 4px;
  height: 44px;
  padding-top: 2px;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 12px;
  overflow-x: auto;
  overflow-y: hidden;
  white-space: nowrap;
  z-index: 400;
}

.bookmarks-add-btn {
  position: sticky;
  right: 0;
  margin-left: auto;
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.3);
  font-size: 9px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  padding: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, background-color 0.2s;
}

.bookmarks-bar:hover .bookmarks-add-btn {
  opacity: 0.5;
  pointer-events: auto;
}

.bookmarks-add-btn:hover {
  opacity: 1;
  background-color: rgba(255, 255, 255, 0.2);
}

.logo-container {
  margin-top: 20px;
  margin-bottom: 40px;
  text-align: center;
}

.logo-image {
  max-width: 42.75vw;
  max-height: 27.08vh;
  object-fit: contain;
}

.search-box-wrapper {
  position: relative;
  width: 100%;
  max-width: 600px;
  margin: 0 auto 60px;
}

.search-box-wrapper-hidden {
  display: none;
}

/* "Multiple" search box type: logo and one search box per engine, side by side
   in an area 90% as wide as a full row of links (full width on mobile - see
   the mobile media query above). */
.multi-search-row {
  display: flex;
  align-items: center;
  gap: 40px;
  width: 100%;
  max-width: 1260px;
  margin: 20px auto 40px;
}

.multi-search-logo {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.multi-search-logo-image {
  max-width: 100%;
  max-height: 160px;
  object-fit: contain;
}

.multi-search-engines {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* No logo configured: there's no .multi-search-logo column at all (see index.php), so
   center the remaining search boxes column in the row instead of letting it stretch to
   the row's full width on its own. */
.multi-search-row-no-logo {
  justify-content: center;
}

.multi-search-row-no-logo .multi-search-engines {
  flex: 0 1 600px;
  max-width: 600px;
}

.multi-search-box-wrapper {
  position: relative;
}

.multi-search-engines .search-box {
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding-left: 46px;
}

/* Search engine homepage favicon (fetched/cached the same way as regular link
   favicons - see getSearchEngineIconInfo() in functions.php), or a plain midtone-grey
   circle when there's no favicon to show. Same size/position as the single search
   box's lightning-bolt button, which "Multiple" boxes don't have - every engine is
   already visible at once, so there's nothing to cycle between. */
.multi-search-engine-icon {
  position: absolute;
  top: 50%;
  left: 6px;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

/* Only shown when no favicon could be found at all - a found favicon gets no
   background circle of its own, just the image, still cropped to a circle above.
   Colour/background come from the dynamic $searchBoxStyle-aware rule shared with
   .search-engine-btn in index.php - same look as the single search box's own bolt
   fallback. */
.multi-search-engine-icon-fallback {
  font-size: 12px;
}

a.multi-search-engine-icon {
  cursor: pointer;
}

span.multi-search-engine-icon {
  cursor: default;
}

.multi-search-engine-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.5;
  mix-blend-mode: multiply;
  transition: opacity 0.2s;
}

.multi-search-engine-icon:hover img,
.multi-search-box-wrapper:focus-within img {
  opacity: 1;
}

.search-box {
  width: 100%;
  max-width: 600px;
  margin: 0 auto 60px;
  padding: 12px 20px;
  border: 1px solid #000;
  border-radius: 50px;
  background-color: #fff;
  font-size: 14px;
  font-family: "Segoe UI", Tahoma, sans-serif;
}

.search-box-wrapper .search-box {
  margin: 0;
  padding-left: 46px;
}

.search-box-wrapper.search-box-wrapper-single .search-engine-btn,
.search-box-wrapper.search-box-wrapper-single .search-engine-menu {
  display: none;
}

.search-box-wrapper.search-box-wrapper-single .search-box {
  padding-left: 20px;
}

.search-box:focus {
  outline: none;
  border-color: #ccc;
}

.search-engine-btn {
  position: absolute;
  top: 50%;
  left: 6px;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  overflow: hidden;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  line-height: 1;
  padding: 0;
  opacity: 0.5;
  transition: background-color 0.2s, opacity 0.2s;
  z-index: 2;
}

/* The active engine's favicon, shown in place of the bolt when one's available (see
   updateSearchEngineButtonState()) - same circle-crop/white-hiding treatment as the
   "Multiple" type's per-engine icons, but no fixed opacity of its own: the button's
   own opacity (above) is what fades it in on hover, exactly like the bolt icon. */
.search-engine-btn-icon {
  width: 100%;
  height: 100%;
  object-fit: cover;
  mix-blend-mode: multiply;
}

.search-engine-btn:hover {
  opacity: 1;
}

.search-engine-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  background-color: #1a1a1a;
  border: 1px solid #333;
  border-radius: 4px;
  min-width: 160px;
  z-index: 1000;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
  display: none;
  overflow: hidden;
}

.search-engine-menu.active {
  display: block;
}

.search-engine-menu-item {
  padding: 10px 15px;
  cursor: pointer;
  font-size: 9pt;
  color: #ccc;
  text-align: left;
}

.search-engine-menu-item:hover {
  background-color: #333;
  color: #fff;
}

.search-engine-menu-item.active {
  color: #fff;
  font-weight: 600;
}

.links-grid {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 30px;
  margin-bottom: 40px;
  width: 100%;
}

.links-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
  width: 100%;
  max-width: 1400px;
}

.links-row-phantom {
  min-height: 0;
}

.grid-dragging .links-row-phantom {
  min-height: 50px;
}

/* A row that's had its last item dragged out of it, mid-drag - kept visible as a blank
   drop target (same height as the phantom row) so the item can still be dropped back
   where it came from, instead of the row collapsing to zero height immediately. */
.grid-dragging .links-row-emptying {
  min-height: 50px;
}

.link-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  position: relative;
  z-index: 1;
  width: calc(120px * var(--icon-scale, 1) * var(--mobile-scale, 1) * var(--mobile-width-scale, 1));
  border-radius: 8px;
  color: inherit;
  text-decoration: none;
}

.link-item[data-link-id]::before {
  content: '';
  position: absolute;
  top: -8px;
  left: -8px;
  right: -8px;
  bottom: -8px;
  background-color: rgba(128, 128, 128, 0.2);
  border-radius: 8px;
  z-index: -1;
  opacity: 0;
  transition: opacity 0.2s;
}

.link-item[data-link-id]:hover::before {
  opacity: 1;
}


.link-icon {
  width: calc(72px * var(--icon-scale, 1) * var(--mobile-scale, 1));
  height: calc(72px * var(--icon-scale, 1) * var(--mobile-scale, 1));
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  flex-shrink: 0;
  z-index: 1;
}

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

.link-icon-placeholder {
  width: calc(40px * var(--icon-scale, 1) * var(--mobile-scale, 1));
  height: calc(40px * var(--icon-scale, 1) * var(--mobile-scale, 1));
  background: linear-gradient(135deg, #ccc, #999);
  border-radius: 50%;
}

.link-icon-plus {
  font-size: 40px;
  color: #000;
  font-weight: 300;
  line-height: 1;
  margin-top: -8px;
}

.link-label {
  font-size: 10pt;
  color: #ccc;
  word-break: break-word;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  width: 100%;
  position: relative;
  z-index: 1;
}

.link-menu-btn {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 24px;
  height: 24px;
  background-color: rgba(0, 0, 0, 0.6);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 12px;
  color: #fff;
  opacity: 0;
  transition: opacity 0.2s;
  z-index: 2;
}

.link-item:hover .link-menu-btn {
  opacity: 1;
}

.link-menu {
  position: absolute;
  top: 20px;
  right: -20px;
  background-color: #1a1a1a;
  border: 1px solid #333;
  border-radius: 4px;
  min-width: 120px;
  z-index: 1500;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
  display: none;
}

.link-menu.active {
  display: block;
}

.link-menu-item {
  padding: 10px 15px;
  cursor: pointer;
  font-size: 9pt;
  color: #ccc;
  text-align: left;
  border-bottom: 1px solid #333;
}

.link-menu-item:last-child {
  border-bottom: none;
}

.link-menu-item:hover {
  background-color: #333;
  color: #fff;
}

/* Bookmarks bar reskin: the same .link-item markup, laid out as a small inline
   icon + single-line text "pill" instead of the grid's vertical icon tile. */
.bookmarks-bar .link-item {
  flex-direction: row;
  align-items: center;
  gap: 5px;
  width: auto;
  flex-shrink: 0;
  padding: 1px 14px 1px 1px;
}

.bookmarks-bar .link-item[data-link-id]::before {
  top: -1px;
  left: -1px;
  right: -1px;
  bottom: -1px;
}

.bookmarks-bar .link-icon {
  width: 20px;
  height: 20px;
  background-color: transparent;
  border-radius: 0;
  overflow: visible;
}

.bookmarks-bar .link-icon img {
  object-fit: contain;
}

.bookmarks-bar .link-icon-placeholder {
  width: 12px;
  height: 12px;
}

.bookmarks-bar .link-label {
  display: block;
  width: auto;
  white-space: nowrap;
  overflow: visible;
  -webkit-line-clamp: unset;
}

.bookmarks-bar .link-menu-btn {
  top: 50%;
  right: 0;
  width: 16px;
  height: 16px;
  font-size: 9px;
  transform: translateY(-50%);
}

.bookmarks-bar .link-menu {
  top: 100%;
  right: 0;
  margin-top: 6px;
}

/* "Move to new row" only makes sense for the grid, not the bookmarks bar - the menu
   itself gets reparented to document.body while open (see openLinkMenu()), so this is
   a class on the menu (set at open time, before that move) rather than an ancestor
   selector, which wouldn't stay matched once reparented. */
.link-menu-in-bar .link-menu-item-move-row {
  display: none;
}

.id-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.id-input {
  padding: 10px 15px;
  font-size: 12px;
  border: 1px solid #333;
  border-radius: 4px;
  background-color: #1a1a1a;
  color: #fff;
  width: 200px;
  text-align: center;
}

.id-button {
  padding: 10px 30px;
  font-size: 11pt;
  background-color: #333;
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.2s;
}

.id-button:hover {
  background-color: #444;
}

.id-screen-logo {
  max-width: 300px;
  width: 100%;
  height: auto;
}

.id-fields-row {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
}

.id-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.id-field-label {
  font-size: 10pt;
  color: #ccc;
}

.id-button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

.id-screen-footer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 4px;
  font-size: 9pt;
  color: #fff;
  opacity: 0.5;
  text-align: center;
}

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.7);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-overlay.active {
  display: flex;
}

.modal-window {
  background-color: #1a1a1a;
  border: 1px solid #333;
  border-radius: 8px;
  padding: 30px;
  max-width: 400px;
  width: 90%;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.8);
}

.modal-title {
  font-size: 16px;
  margin-bottom: 20px;
  color: #fff;
}

.modal-form {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.form-group label {
  font-size: 10pt;
  color: #ccc;
  text-align: left;
}

.form-group input {
  padding: 8px 10px;
  font-size: 11pt;
  border: 1px solid #333;
  border-radius: 4px;
  background-color: #000;
  color: #fff;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: #555;
}

.form-group select {
  padding: 8px 10px;
  font-size: 11pt;
  border: 1px solid #333;
  border-radius: 4px;
  background-color: #000;
  color: #fff;
  width: 100%;
}

.checkbox-row {
  flex-direction: row;
  flex-wrap: wrap;
  gap: 20px;
}

.form-group-row {
  display: flex;
  flex-direction: row;
  gap: 15px;
}

.form-group-row .form-group {
  flex: 1 1 0;
  min-width: 0;
}

.checkbox-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-direction: row;
}

.checkbox-group input[type="checkbox"] {
  width: auto;
  height: auto;
  margin: 0;
}

.checkbox-group label {
  margin: 0;
}

.color-input-group {
  display: flex;
  gap: 8px;
  align-items: center;
}

.color-input-group input[type="color"] {
  width: 50px;
  height: 40px;
  border: 1px solid #333;
  border-radius: 4px;
  cursor: pointer;
  padding: 2px;
}

.color-input-group input[type="text"] {
  flex: 1;
  min-width: 70px;
}

.icon-scale-group {
  display: flex;
  gap: 10px;
  align-items: center;
}

.icon-scale-group input[type="range"] {
  flex: 1;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
}

.icon-scale-group input[type="number"] {
  flex: 0 0 60px;
  width: 60px;
  text-align: center;
  -moz-appearance: textfield;
}

.icon-scale-group input[type="number"]::-webkit-outer-spin-button,
.icon-scale-group input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.image-input-group {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.image-input-group input[type="text"] {
  flex: 1;
  min-width: 90px;
}

.gallery-picker-btn {
  width: 33px;
  height: 33px;
  padding: 0;
  background-color: #333;
  border: 1px solid #444;
  border-radius: 4px;
  cursor: pointer;
  color: #ccc;
  font-size: 11pt;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background-color 0.2s;
}

.gallery-picker-btn:hover {
  background-color: #444;
}

.file-upload-label {
  padding: 8px 12px;
  background-color: #333;
  border: 1px solid #444;
  border-radius: 4px;
  cursor: pointer;
  font-size: 9pt;
  color: #ccc;
  white-space: nowrap;
  transition: background-color 0.2s;
}

.file-upload-label:hover {
  background-color: #444;
}

.file-name-display {
  display: none;
  font-size: 9pt;
  color: #999;
  flex-basis: 100%;
  text-align: left;
}

.modal-window-wide {
  max-width: 1150px;
}

.modal-window-info {
  max-width: 640px;
}

.info-modal-logo {
  display: block;
  max-width: 140px;
  width: 100%;
  height: auto;
  margin: 0 auto 20px;
}

.info-modal-content {
  max-height: 60vh;
  overflow-y: auto;
  margin-bottom: 20px;
  padding-right: 16px;
  color: #ccc;
  line-height: 1.6;
}

.info-modal-content a {
  color: #6cb4ff;
  text-decoration: none;
}

.info-heading {
  display: inline-block;
  font-size: 1.5em;
  font-weight: bold;
  color: #fff;
}

.gallery-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  max-height: 500px;
  overflow-y: auto;
  padding: 4px;
  margin-bottom: 15px;
}

.gallery-item {
  height: 110px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
  background-color: #1a1a1a;
  border: 3px solid transparent;
  border-radius: 4px;
  cursor: pointer;
  box-sizing: border-box;
  padding: 4px;
}

.gallery-item:hover {
  border-color: #666;
}

.gallery-item.selected {
  border-color: #ffd700;
}

.config-form-columns {
  display: grid;
  grid-template-columns: 2fr 3fr;
  gap: 25px;
}

.config-col-left {
  display: flex;
  flex-direction: column;
  gap: 15px;
  min-width: 0;
}

.config-col-right {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.search-engines-label {
  font-size: 10pt;
  color: #ccc;
  text-align: left;
}

.search-engines-table-wrapper {
  max-height: 440px;
  overflow-y: auto;
  overflow-x: hidden;
  border: 1px solid #333;
  border-radius: 4px;
}

.search-engines-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.search-engines-table th:nth-child(1),
.search-engines-table td:nth-child(1) {
  width: 28px;
}

.search-engines-table th:nth-child(2),
.search-engines-table td:nth-child(2) {
  width: 22%;
}

.search-engines-table th:nth-child(4),
.search-engines-table td:nth-child(4) {
  width: 36px;
}

.search-engines-table th:nth-child(5),
.search-engines-table td:nth-child(5) {
  width: 40px;
}

.search-engines-table th {
  font-size: 8pt;
  color: #999;
  text-transform: uppercase;
  text-align: left;
  padding: 6px 8px;
  border-bottom: 1px solid #333;
  background-color: #111;
  position: sticky;
  top: 0;
  white-space: nowrap;
}

.search-engines-table th:nth-child(1),
.search-engines-table th:nth-child(4),
.search-engines-table th:nth-child(5) {
  text-align: center;
}

.search-engines-table th:nth-child(1),
.search-engines-table td:nth-child(1),
.search-engines-table th:nth-child(4),
.search-engines-table td:nth-child(4),
.search-engines-table th:nth-child(5),
.search-engines-table td:nth-child(5) {
  padding-left: 4px;
  padding-right: 4px;
}

.search-engines-table td {
  padding: 6px 8px;
  border-bottom: 1px solid #222;
}

.search-engines-table input[type="text"] {
  display: block;
  width: 100%;
  padding: 6px 8px;
  font-size: 9pt;
  border: 1px solid #333;
  border-radius: 4px;
  background-color: #000;
  color: #fff;
}

.se-center {
  text-align: center;
}

.se-controls {
  display: flex;
  gap: 4px;
  justify-content: center;
}

.se-btn {
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
  border: 1px solid #333;
  border-radius: 4px;
  background-color: #222;
  color: #ccc;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  padding: 0;
}

.se-btn:hover {
  background-color: #333;
  color: #fff;
}

.se-drag-handle {
  text-align: center;
  color: #666;
  cursor: grab;
  font-size: 12px;
  user-select: none;
}

.se-drag-handle:hover {
  color: #999;
}

.se-row-dragging {
  opacity: 0.4;
  cursor: grabbing;
}

.search-engines-actions {
  display: flex;
  gap: 10px;
  margin-top: 5px;
}

.modal-buttons {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 20px;
}

.modal-btn {
  padding: 10px 20px;
  font-size: 10pt;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.2s;
}

.modal-btn-ok {
  background-color: #333;
  color: #fff;
}

.modal-btn-ok:hover {
  background-color: #444;
}

.modal-btn-cancel {
  background-color: #222;
  color: #ccc;
}

.modal-btn-cancel:hover {
  background-color: #333;
}

.modal-btn-leave {
  background-color: #444;
  color: #ccc;
}

.modal-btn-leave:hover {
  background-color: #555;
}

.modal-btn-group-end {
  margin-right: auto;
}

.confirmation-text {
  margin-bottom: 20px;
  color: #ccc;
  font-size: 10pt;
}

.link-item.dragging {
  opacity: 0.5;
}

.loading-indicator {
  position: fixed;
  bottom: 20px;
  right: 20px;
  display: none;
  align-items: center;
  gap: 10px;
  background-color: #1a1a1a;
  border: 1px solid #333;
  border-radius: 4px;
  padding: 12px 16px;
  z-index: 2000;
}

.loading-indicator.active {
  display: flex;
}

.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid #333;
  border-top-color: #999;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.copy-notification {
  position: fixed;
  bottom: 20px;
  right: 20px;
  display: none;
  background-color: #1a1a1a;
  border: 1px solid #333;
  border-radius: 4px;
  padding: 12px 16px;
  z-index: 2000;
  max-width: 400px;
}

.copy-notification.active {
  display: block;
}

.notification-content {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.notification-title {
  font-size: 10pt;
  color: #ccc;
}

.notification-url {
  font-size: 9pt;
  color: #999;
  word-break: break-all;
  font-family: monospace;
  padding: 6px 8px;
  background-color: #000;
  border: 1px solid #333;
  border-radius: 2px;
  max-height: 60px;
  overflow-y: auto;
}

.helpful-tips {
  position: fixed;
  bottom: 20px;
  left: 20px;
  font-size: 10pt;
  color: rgba(128, 128, 128, 0.5);
  z-index: 500;
  max-width: calc(100vw - 150px);
  word-break: break-word;
  opacity: 1;
  transition: opacity 0.5s;
}

.helpful-tips-fading {
  opacity: 0;
}
