@charset "UTF-8";
:root {
  --ink: #0a2540;
  --muted: #61758c;
  --line: #e3eaf3;
  --paper: #ffffff;
  --wash: #f6f9fc;
  --accent: #635bff;
  --accent-strong: #5148d5;
  --accent-soft: #f0efff;
  --warning: #a75b00;
  --warning-soft: #fff8eb;
  --danger: #b84455;
  --danger-soft: #fff4f5;
  --shadow: 0 12px 32px rgba(10, 37, 64, .07);
  --green: var(--accent);
  --green-dark: var(--accent-strong);
  --coral: var(--danger);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--wash);
  color: var(--ink);
  font-family: "IBM Plex Sans Arabic", "Segoe UI", Tahoma, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

input::placeholder, textarea::placeholder {
  color: #8795a7;
  opacity: 1;
}

:where(button, input, select, textarea, summary, a):focus-visible {
  outline: 3px solid rgba(99, 91, 255, 0.24);
  outline-offset: 2px;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
  box-shadow: none;
  transform: none;
}

[hidden] {
  display: none !important;
}

.shell {
  display: grid;
  grid-template-columns: minmax(234px, 260px) minmax(0, 1fr);
  min-height: 100vh;
  direction: rtl;
}

aside, main {
  direction: rtl;
}

main {
  width: 100%;
  min-width: 0;
  max-width: 1500px;
  padding: 48px clamp(24px, 3.5vw, 64px) 72px;
  margin: 0 auto;
}

h1 {
  margin: 0;
  font-size: clamp(28px, 3vw, 38px);
  letter-spacing: -0.9px;
  line-height: 1.25;
}

.subtitle {
  color: var(--muted);
  margin: 5px 0 0;
  font-size: 13px;
}

.eyebrow {
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.4px;
  margin-bottom: 8px;
}

.stats {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 12px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 0 0 20px;
  overflow: hidden;
}

.stat {
  min-width: 0;
  padding: 16px 21px;
  display: grid;
  gap: 3px;
}
.stat:not(:last-child) {
  border-inline-end: 1px solid var(--line);
}
.stat label {
  color: var(--muted);
  font-size: 11px;
}
.stat strong {
  color: var(--ink);
  font-size: 24px;
  line-height: 1.15;
}

.toolbar {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 12px;
  display: flex;
  gap: 10px;
  align-items: center;
  margin: 0 0 20px;
  padding: 10px;
}

.toolbar-title {
  margin-inline-end: auto;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.view-toggle {
  display: inline-flex;
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface, #fff);
}

.view-toggle button {
  display: grid;
  place-items: center;
  width: 32px;
  min-height: 32px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 17px;
  cursor: pointer;
}

.view-toggle button.active {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.view-toggle button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.drag-hint {
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.sort {
  appearance: none;
  min-height: 44px;
  border-radius: 10px;
  font: inherit;
  min-width: 160px;
  border: 1px solid var(--line);
  background-color: #fff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 14 14'%3E%3Cpath d='m3.5 5 3.5 3.5L10.5 5' fill='none' stroke='%2361758c' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: left 14px center;
  color: var(--ink);
  padding: 0 14px 0 38px;
}

.list-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 20px 2px 12px;
}
.list-head h2 {
  margin: 0;
  font-size: 17px;
}

.hint {
  color: var(--muted);
  font-size: 12px;
}

aside {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
  background: #fff;
  border-inline-end: 1px solid var(--line);
  padding: 30px 18px 22px;
  display: flex;
  flex-direction: column;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  margin: 0 8px 35px;
  flex: none;
}
.brand .mark {
  width: 43px;
  height: 43px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--accent);
  border-radius: 12px;
  box-shadow: 0 5px 12px rgba(99, 91, 255, 0.16);
}
.brand .mark svg {
  width: 27px;
  height: 29px;
  display: block;
}
.brand strong {
  font-size: 19px;
  letter-spacing: -0.5px;
}
.brand small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-top: 2px;
}

.nav-label {
  color: #718198;
  font-size: 11px;
  font-weight: 800;
  margin: 0 13px 9px;
}

nav {
  display: grid;
  flex: none;
  gap: 4px;
}
nav button {
  border: 0;
  background: transparent;
  color: #43566f;
  min-height: 42px;
  padding: 8px 12px;
  border-radius: 10px;
  text-align: right;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 9px;
  font-size: 13px;
}
nav button:hover, nav button.active {
  color: var(--accent-strong);
  background: var(--accent-soft);
  font-weight: 700;
}

.nav-link-main {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.nav-icon {
  width: 18px;
  height: 18px;
  flex: none;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.count {
  color: #718198;
  background: #f0f4f8;
  border-radius: 999px;
  padding: 2px 7px;
  min-width: 26px;
  text-align: center;
  font-size: 11px;
}

.active .count {
  color: var(--accent-strong);
  background: #e2dfff;
}

.category-section {
  display: flex;
  flex: 1;
  min-height: 0;
  flex-direction: column;
  margin-top: 24px;
  padding-top: 15px;
  border-top: 1px solid var(--line);
}

.category-section .nav-label {
  flex: none;
}

.category-list {
  display: grid;
  align-content: start;
  gap: 3px;
  min-height: 0;
  overflow-y: auto;
  padding: 0 2px 6px;
  scrollbar-width: thin;
}

.category-list button {
  border: 0;
  background: transparent;
  color: #54667b;
  padding: 8px 10px;
  border-radius: 9px;
  text-align: right;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.category-list button:hover, .category-list button.active, .category-list button.drop-target {
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-weight: 700;
}
.category-list button.drop-target {
  outline: 2px dashed var(--accent);
  outline-offset: -2px;
}

.category-name {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.category-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  flex: none;
}

.category-list button:nth-child(5n+2) .category-dot {
  background: #1d74e8;
}

.category-list button:nth-child(5n+3) .category-dot {
  background: #18a87a;
}

.category-list button:nth-child(5n+4) .category-dot {
  background: #f28b22;
}

.category-list button:nth-child(5n+5) .category-dot {
  background: #e44977;
}

.category-tools {
  display: flex;
  flex: none;
  gap: 6px;
  margin-top: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.category-tools button {
  flex: 1;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--accent-strong);
  border-radius: 9px;
  padding: 8px 6px;
  font-size: 11px;
  font-weight: 700;
}
.category-tools button:hover {
  background: var(--accent-soft);
}

.sidebar-footer {
  display: grid;
  flex: none;
  gap: 9px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.sidebar-footer .account {
  width: 100%;
  justify-content: center;
  min-height: 40px;
}

.account-identity {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.account-identity[hidden] {
  display: none;
}

.account-avatar {
  display: grid;
  flex: none;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 14px;
  font-weight: 800;
}

.account-copy {
  display: grid;
  min-width: 0;
  gap: 2px;
  text-align: right;
}

.account-copy strong, .account-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-copy strong {
  color: var(--ink);
  font-size: 11px;
}

.account-copy small {
  color: var(--muted);
  font-size: 10px;
  direction: ltr;
  text-align: right;
}

.side-note {
  flex: none;
  margin-top: 10px;
  padding: 11px;
  border-radius: 10px;
  background: #f7f8ff;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
}

.category-manage-list {
  display: grid;
  gap: 8px;
  max-height: 48vh;
  overflow: auto;
  margin-top: 18px;
}

.category-manage-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.category-manage-row strong {
  flex: 1;
  font-size: 13px;
}

.category-manage-row span {
  color: var(--muted);
  font-size: 11px;
}

.category-manage-row button {
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--green-dark);
  border-radius: 7px;
  padding: 6px 8px;
  font-size: 11px;
}

.category-manage-row button.danger {
  color: var(--danger);
  border-color: #ecc6ca;
}

.category {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  border-radius: 7px;
  padding: 5px 10px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.category-empty {
  background: #f3f5f9;
  color: var(--muted);
}

.bookmarks {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 12px;
  display: grid;
  gap: 10px;
  min-width: 0;
  overflow: visible;
  border: 0;
  background: transparent;
  box-shadow: none;
}
.bookmarks.is-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.bookmark {
  position: relative;
  z-index: 0;
  display: grid;
  direction: rtl;
  grid-template-columns: 20px 42px minmax(0, 1fr) auto;
  align-items: start;
  gap: 12px;
  min-width: 0;
  min-height: 78px;
  padding: 13px 16px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  transition: background 0.16s;
}
.bookmark:first-child, .bookmark:last-child, .bookmark:only-child {
  border-radius: 12px;
}
.bookmark:hover {
  background: #fafbff;
}
.bookmark:has(.card-menu[open]) {
  z-index: 5;
}
.bookmark[draggable=true] {
  cursor: grab;
}
.bookmark.is-dragging {
  opacity: 0.42;
  cursor: grabbing;
}
.bookmarks.is-grid .bookmark {
  min-height: 132px;
  align-content: start;
  box-shadow: var(--shadow-sm, 0 1px 2px rgba(16, 24, 40, 0.04));
}
.bookmark.is-review {
  background: #fffcf7;
}

.bookmark-select {
  width: 18px;
  height: 18px;
  margin: 11px 0 0;
  accent-color: var(--accent);
  cursor: pointer;
}

.site-icon {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 1px solid #dfdfff;
  border-radius: 10px;
  background: #efefff;
  color: var(--accent-strong);
  font-size: 17px;
  font-weight: 800;
  text-transform: uppercase;
}

.bookmark-main {
  min-width: 0;
  direction: rtl;
  text-align: right;
}

.bookmark-main a {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ink);
  text-decoration: none;
  font-size: 13px;
  font-weight: 750;
}
.bookmark-main a:hover {
  color: var(--accent-strong);
  text-decoration: underline;
}

.bookmark-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 10px;
  min-width: 0;
  margin-top: 7px;
}

.domain {
  display: inline-block;
  max-width: 40%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  direction: ltr;
  text-align: right;
  color: var(--muted);
  font-size: 11px;
}

.tags {
  display: flex;
  justify-content: flex-start;
  gap: 5px;
  margin-top: 7px;
}

.tag {
  background: #f0f4fb;
  color: #607390;
  border-radius: 6px;
  padding: 2px 6px;
  font-size: 10px;
  white-space: nowrap;
}

.bookmark-category {
  min-width: 0;
  display: flex;
  justify-content: flex-start;
  direction: rtl;
}

.date {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 7px;
  min-width: 0;
  color: var(--muted);
  font-size: 10px;
  white-space: nowrap;
  direction: rtl;
  padding-top: 4px;
}
.date time {
  order: 3;
}

.card-favorite {
  order: 1;
  border: 0;
  background: transparent;
  color: #91a0b2;
  padding: 5px;
  font-size: 20px;
  line-height: 1;
}
.card-favorite[aria-pressed=true] {
  color: #f4a72c;
}

.card-menu {
  order: 2;
  position: relative;
}

.card-menu summary {
  list-style: none;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 7px;
  color: var(--muted);
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
}
.card-menu summary::-webkit-details-marker {
  display: none;
}
.card-menu summary:hover {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.card-menu-panel {
  position: absolute;
  top: calc(100% + 5px);
  right: 0;
  z-index: 8;
  display: grid;
  gap: 3px;
  width: 128px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  box-shadow: var(--shadow);
}

.card-menu-panel > button {
  appearance: none !important;
  -webkit-appearance: none !important;
  display: flex;
  width: 100%;
  min-height: 34px;
  align-items: center;
  justify-content: flex-start;
  border: 0 !important;
  border-radius: 7px;
  background: transparent !important;
  color: var(--ink);
  padding: 7px 9px;
  text-align: right;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
}
.card-menu-panel > button:hover {
  background: var(--accent-soft) !important;
  color: var(--accent-strong);
}

.card-menu-panel > .card-delete {
  color: var(--danger);
}
.card-menu-panel > .card-delete:hover {
  background: var(--danger-soft) !important;
  color: var(--danger);
}

.bookmark-note, .bookmark-origin {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.bookmark-note {
  display: block;
  margin-top: 7px;
  overflow-wrap: anywhere;
}

.bookmark-origin {
  flex: 1 1 160px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bookmark-note {
  white-space: pre-wrap;
}

.primary {
  min-height: 44px;
  border-radius: 10px;
  font: inherit;
  border: 1px solid var(--accent);
  color: #fff;
  background: var(--accent);
  padding: 0 17px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 750;
  white-space: nowrap;
  transition: background 0.16s, border-color 0.16s;
}
.primary:hover {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
}

.account, .import-btn {
  min-height: 44px;
  border-radius: 10px;
  font: inherit;
  border: 1px solid var(--line);
  color: var(--ink);
  background: #fff;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.secondary {
  min-height: 44px;
  border-radius: 10px;
  font: inherit;
  border: 1px solid var(--line);
  color: var(--muted);
  background: #fff;
  padding: 0 18px;
  font-weight: 700;
}

.review-tools {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 18px;
  padding: 13px 16px;
  background: #f9f8ff;
}

.review-tools-copy {
  display: grid;
  gap: 3px;
}
.review-tools-copy strong {
  color: var(--ink);
  font-size: 13px;
}
.review-tools-copy span {
  color: var(--muted);
  font-size: 11px;
}

.review-tools-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.review-tools-actions button {
  min-height: 38px;
  border-radius: 10px;
  font: inherit;
  border: 1px solid #d8dcf1;
  padding: 0 11px;
  background: #fff;
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 700;
}
.review-tools-actions button:hover:not(:disabled) {
  background: var(--accent-soft);
}

.review-tools-actions #jevBtn {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.review-tools-actions #jevBtn:hover:not(:disabled) {
  background: var(--accent-strong);
}

.review-box {
  grid-column: 3/-1;
  direction: rtl;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px;
  margin: 2px 0 0;
  padding: 9px 12px;
  border: 1px solid #f7e4c5;
  border-radius: 9px;
  background: var(--warning-soft);
  color: var(--warning);
  font-size: 11px;
}
.review-box > span {
  min-width: 0;
  line-height: 1.5;
  overflow-wrap: anywhere;
}
.review-box button {
  min-height: 32px;
  border-radius: 10px;
  font: inherit;
  border: 1px solid #e5d5bc;
  padding: 0 10px;
  background: #fff;
  color: #785024;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}
.review-box [data-apply] {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.review-box [data-apply]:hover {
  background: var(--accent-strong);
}

.review-action-buttons, .review-actions, .review-more-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.review-more {
  margin-inline-start: auto;
}

.review-more summary {
  padding: 5px;
  color: #805d31;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.review-more-actions {
  margin-top: 6px;
  padding-top: 8px;
  border-top: 1px solid #f1e2ca;
}

.review-more-actions [data-delete] {
  color: var(--danger);
  border-color: #e9bdc4;
}

.selection-toolbar {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 12px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  min-height: 44px;
  margin: 0 0 12px;
  padding: 7px 12px;
  color: var(--muted);
  font-size: 11px;
}

.selection-toolbar label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.selection-toolbar input {
  accent-color: var(--accent);
}

.selection-count {
  margin-inline-start: auto;
}

.selection-delete, .selection-move {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 11px;
  background: #fff;
  color: var(--ink);
  font-size: 11px;
  font-weight: 700;
}

.selection-delete {
  color: var(--danger);
  border-color: #ecc6ca;
}

.selection-move {
  color: var(--accent-strong);
  border-color: #d5d2ff;
}

.empty {
  padding: 52px 25px;
  text-align: center;
  direction: rtl;
}

.empty-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 14px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  color: var(--accent);
  background: var(--accent-soft);
  font-size: 23px;
}

.empty h3 {
  margin: 0 0 7px;
  font-size: 18px;
}

.empty p {
  color: var(--muted);
  font-size: 13px;
  margin: 0 auto 18px;
  max-width: 380px;
  line-height: 1.7;
}

.empty .primary {
  padding: 10px 15px;
  font-size: 13px;
}

.top {
  position: relative;
  z-index: 10;
  display: grid;
  grid-template-columns: minmax(170px, 1fr) minmax(220px, 390px) auto;
  align-items: center;
  gap: 18px;
  margin-bottom: 24px;
}

.top-intro {
  min-width: 0;
}

.top-actions {
  display: flex;
  gap: 9px;
  align-items: center;
  justify-content: flex-end;
  white-space: nowrap;
}

.search {
  position: relative;
  min-width: 0;
}
.search span {
  position: absolute;
  right: 15px;
  top: 11px;
  color: #8a98a9;
  font-size: 20px;
  line-height: 1;
}
.search input {
  min-height: 44px;
  border-radius: 10px;
  font: inherit;
  width: 100%;
  border: 1px solid var(--line);
  background: #fff;
  padding: 0 40px 0 14px;
  color: var(--ink);
  outline: none;
}
.search input:focus {
  border-color: #aaa5fa;
  box-shadow: 0 0 0 3px #efedff;
}

.actions-menu {
  position: relative;
  direction: rtl;
}

.actions-menu summary {
  min-height: 44px;
  border-radius: 10px;
  font: inherit;
  list-style: none;
  border: 1px solid #cdd8e7;
  color: var(--ink);
  background: #fff;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}
.actions-menu summary::-webkit-details-marker {
  display: none;
}
.actions-menu summary::after {
  content: "⌄";
  margin-right: 8px;
  color: var(--muted);
}

.actions-menu[open] summary {
  background: var(--accent-soft);
  border-color: #aaa5fa;
}

.actions-panel {
  position: absolute;
  z-index: 8;
  top: calc(100% + 10px);
  left: 0;
  width: 280px;
  max-width: calc(100vw - 32px);
  max-height: min(72vh, 560px);
  overflow-y: auto;
  display: grid;
  gap: 2px;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fff;
  box-shadow: 0 18px 40px rgba(10, 37, 64, 0.13);
}

.actions-group {
  display: grid;
  gap: 2px;
  padding-bottom: 7px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--line);
}
.actions-group:last-child {
  border-bottom: 0;
  padding-bottom: 0;
  margin-bottom: 0;
}

.actions-group-label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  padding: 7px 12px 4px;
}

.actions-panel .import-btn {
  width: 100%;
  min-height: 40px;
  text-align: right;
  justify-content: flex-start;
  border: 0;
  border-radius: 7px;
  background: transparent;
  font-size: 12px;
  padding: 0 12px;
}
.actions-panel .import-btn:hover {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.whatsapp-list {
  display: grid;
  gap: 10px;
  max-height: 52vh;
  overflow: auto;
  margin: 14px 0;
}

.whatsapp-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8f9fd;
  direction: rtl;
}

.whatsapp-row input[type=checkbox] {
  margin-top: 4px;
  accent-color: var(--green);
}

.whatsapp-row-main {
  min-width: 0;
  flex: 1;
}

.whatsapp-row-url {
  display: block;
  direction: ltr;
  text-align: left;
  color: var(--green-dark);
  font-size: 12px;
  overflow-wrap: anywhere;
  margin-top: 4px;
}

.whatsapp-row-note {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-top: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.whatsapp-row-options {
  display: flex;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.audit-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 18px 0;
}

.audit-summary div {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #f8f9fd;
  font-size: 11px;
  color: var(--muted);
}

.audit-summary strong {
  display: block;
  margin-top: 5px;
  color: var(--ink);
  font-size: 20px;
}

.audit-tabs {
  display: flex;
  flex: none;
  gap: 6px;
  overflow-x: auto;
  padding: 2px 2px 10px;
  scrollbar-width: thin;
}

.audit-tab {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 40px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: #52627a;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.audit-tab:hover {
  border-color: #aaa5fa;
  background: #faf9ff;
}

.audit-tab[aria-selected=true] {
  border-color: #aaa5fa;
  background: #f0efff;
  color: var(--green-dark);
}

.audit-tab:focus-visible {
  outline: 3px solid #aaa5fa;
  outline-offset: 2px;
}

.audit-tab-count {
  display: inline-grid;
  place-items: center;
  min-width: 23px;
  padding: 2px 5px;
  border-radius: 7px;
  background: #eef0fa;
  font-size: 11px;
}

.audit-tab[aria-selected=true] .audit-tab-count {
  background: #e1dfff;
}

.audit-content {
  overflow: auto;
  min-height: 0;
  flex: 1;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.audit-content h3 {
  font-size: 14px;
  margin: 3px 0 12px;
}

.audit-panel[hidden] {
  display: none;
}

.audit-empty {
  padding: 28px 16px;
  border: 1px dashed #d5deeb;
  border-radius: 11px;
  color: var(--muted);
  text-align: center;
  font-size: 13px;
}

.audit-row {
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  margin-bottom: 6px;
  background: #fff;
  font-size: 12px;
  overflow-wrap: anywhere;
}

.audit-row small {
  display: block;
  color: var(--muted);
  margin-top: 3px;
}

.audit-review-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.audit-review-row > span {
  min-width: 0;
}

.audit-review-actions {
  display: flex;
  flex: none;
  flex-wrap: wrap;
  gap: 6px;
}

.audit-review-actions button {
  min-height: 34px;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--green-dark);
  font-size: 12px;
  font-weight: 700;
}

.audit-review-actions button:hover {
  border-color: #aaa5fa;
  background: #faf9ff;
}

.audit-select-bar {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding: 10px;
  margin-bottom: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
  font-size: 12px;
  color: var(--muted);
}

.audit-select-bar label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
}

.audit-select-bar .primary {
  min-height: 38px;
  margin-inline-start: auto;
  font-size: 12px;
}

.audit-select-bar .primary:disabled, .audit-preview-actions .primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.audit-check-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
}

.audit-check-row input {
  flex: none;
  margin-top: 3px;
  accent-color: var(--green);
}

.audit-row-main {
  min-width: 0;
  flex: 1;
  overflow-wrap: anywhere;
}

.audit-row-url {
  direction: ltr;
  text-align: right;
  unicode-bidi: plaintext;
}

.modal.audit-preview-modal {
  width: min(900px, 100%);
  max-height: calc(100dvh - 40px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

#chromeAddPreviewModal {
  z-index: 50;
}

.audit-preview-list {
  min-height: 0;
  overflow: auto;
  display: grid;
  gap: 10px;
  margin-top: 14px;
  padding-inline-end: 2px;
}

.audit-preview-group {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #f8f9fd;
}

.audit-preview-group-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(200px, 45%);
  align-items: center;
  gap: 12px;
}

.audit-preview-group-head strong {
  display: block;
  font-size: 14px;
}

.audit-preview-group-head small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}

.audit-preview-group-head select {
  width: 100%;
  min-width: 0;
}

.audit-preview-group details {
  margin-top: 10px;
}

.audit-preview-group summary {
  width: fit-content;
  color: var(--green-dark);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.audit-preview-group-rows {
  display: grid;
  gap: 7px;
  margin-top: 10px;
}

.audit-preview-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(190px, 38%);
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.audit-preview-row strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}

.audit-preview-row small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  direction: ltr;
  text-align: right;
  color: var(--muted);
  margin-top: 4px;
}

.audit-preview-row select {
  width: 100%;
  min-width: 0;
}

.chrome-import-modal {
  width: min(980px, 100%);
  max-height: calc(100dvh - 40px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.chrome-import-modal .modal-top, .chrome-import-modal > .confirm-message, .chrome-import-summary, .chrome-import-modal > .quick-footer {
  flex: none;
}

.chrome-import-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 4px;
}

.chrome-import-summary span {
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f8f9fd;
  color: var(--muted);
  font-size: 12px;
}

.chrome-import-summary strong {
  color: var(--ink);
}

.chrome-import-groups {
  display: grid;
  gap: 10px;
  overflow: auto;
  min-height: 0;
  padding: 4px 2px 6px;
  margin-top: 10px;
}

.chrome-import-group {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #f8f9fd;
}

.chrome-import-group-head {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: center;
  gap: 12px;
}

.chrome-import-group-name {
  min-width: 0;
  grid-column: 1/-1;
}

.chrome-import-group-name strong {
  display: block;
  overflow-wrap: anywhere;
  font-size: 14px;
}

.chrome-import-group-name small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}

.chrome-import-group select, .chrome-import-group input {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}

.chrome-import-group input {
  direction: rtl;
}

.chrome-import-links {
  display: grid;
  gap: 5px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.chrome-import-links span {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chrome-import-links[hidden] {
  display: none;
}

.chrome-import-group details {
  margin-top: 10px;
}

.chrome-import-group summary {
  width: fit-content;
  cursor: pointer;
  color: var(--green-dark);
  font-size: 12px;
  font-weight: 700;
}

.chrome-import-modal .quick-footer {
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.audit-preview-actions {
  display: flex;
  flex: none;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
}

.audit-preview-actions .hint {
  margin-inline-start: auto;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(10, 37, 64, 0.34);
  display: grid;
  place-items: center;
  padding: 20px;
  z-index: 40;
}

.modal {
  width: min(500px, 100%);
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  background: var(--paper);
  border-radius: 20px;
  padding: 25px;
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.2);
}

.modal.audit-modal {
  width: min(1100px, 100%);
  max-height: calc(100dvh - 40px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.audit-modal .modal-top {
  flex: none;
}

.audit-modal .quick-footer {
  flex: none;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.modal-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 21px;
}

.modal h2 {
  margin: 0;
  font-size: 20px;
}

.close {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 22px;
}

.field {
  margin-bottom: 18px;
}

.field label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 7px;
}

.field input, .field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0 13px;
  outline: none;
  background: #fff;
  direction: ltr;
  text-align: left;
  resize: vertical;
}

.field input {
  min-height: 50px;
}

.field textarea {
  min-height: 110px;
  padding-top: 13px;
  padding-bottom: 13px;
}

.field .sort {
  width: 100%;
  min-height: 50px;
  height: 50px;
  line-height: normal;
  padding: 0 14px 0 38px;
}

.field input:focus, .field textarea:focus {
  border-color: #aaa5fa;
  box-shadow: 0 0 0 3px #e9e7ff;
}

.modal-actions {
  display: flex;
  justify-content: flex-start;
  gap: 10px;
  margin-top: 25px;
}

.modal-actions button {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.quick-card {
  background: #fff8eb;
  border: 1px solid #f0d9a6;
  border-radius: 15px;
  padding: 18px;
  margin-bottom: 18px;
}

.quick-card h3 {
  margin: 0 0 9px;
  font-size: 18px;
  line-height: 1.5;
}

.quick-url {
  direction: ltr;
  text-align: left;
  color: var(--green);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.quick-meta {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  margin-top: 15px;
}

.quick-meta span {
  background: #f0efff;
  color: #554cc4;
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 11px;
}

.quick-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.quick-actions button {
  border: 1px solid var(--line);
  background: white;
  color: #52627a;
  border-radius: 10px;
  padding: 11px 14px;
  font-weight: 700;
}

.quick-actions .approve {
  border-color: #aaa5fa;
  background: #f0efff;
  color: var(--green-dark);
}

.quick-actions .danger {
  border-color: #ecc6ca;
  color: var(--danger);
}

.quick-progress {
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 12px;
}

.quick-modal {
  width: min(760px, 100%);
  max-height: min(85vh, 760px);
  display: flex;
  flex-direction: column;
}

.quick-list {
  display: grid;
  gap: 8px;
  overflow: auto;
  padding: 2px 3px 5px;
}

.quick-row {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 11px;
  padding: 10px 12px;
  min-width: 0;
}

.quick-row-main {
  min-width: 0;
  flex: 1;
}

.quick-row-title {
  display: block;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.quick-row-url {
  display: block;
  direction: ltr;
  text-align: right;
  color: var(--green);
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-top: 3px;
}

.quick-row-meta {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.quick-row-meta span {
  color: #7b6535;
  background: #fff8eb;
  border-radius: 999px;
  padding: 3px 7px;
  font-size: 10px;
}

.quick-row-actions {
  display: flex;
  gap: 5px;
  flex-shrink: 0;
}

.quick-row-actions button {
  border: 1px solid var(--line);
  background: var(--paper);
  color: #61758c;
  border-radius: 7px;
  padding: 6px 8px;
  font-size: 11px;
  white-space: nowrap;
}

.quick-row-actions .skip {
  color: #86682e;
  border-color: #e6c985;
}

.quick-row-actions .approve {
  color: var(--green-dark);
  border-color: #c6c1ff;
}

.quick-row-actions .danger {
  color: var(--danger);
  border-color: #ecc6ca;
}

.quick-footer {
  display: flex;
  gap: 8px;
  margin-top: 14px;
}

.busy-layer {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  background: rgba(10, 37, 64, 0.28);
  backdrop-filter: blur(2px);
}

.busy-card {
  min-width: 190px;
  padding: 20px 24px;
  border-radius: 16px;
  background: var(--paper);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
  text-align: center;
  color: var(--green-dark);
  font-weight: 700;
}

.spinner {
  width: 30px;
  height: 30px;
  margin: 0 auto 12px;
  border: 3px solid #e9e7ff;
  border-top-color: var(--green);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.undo-toast {
  position: fixed;
  z-index: 15;
  bottom: 24px;
  left: 24px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 15px;
  border: 1px solid #dcdcf4;
  border-radius: 13px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 14px 35px rgba(10, 37, 64, 0.14);
}

.undo-toast button {
  border: 0;
  background: #f0efff;
  color: var(--green-dark);
  border-radius: 8px;
  padding: 7px 10px;
  font-weight: 700;
}

.app-toast {
  position: fixed;
  z-index: 80;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  width: min(520px, 100vw - 32px);
  padding: 15px 18px;
  border: 1px solid #dcdcf4;
  border-radius: 14px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 18px 45px rgba(10, 37, 64, 0.16);
  text-align: center;
  font-size: 14px;
  line-height: 1.6;
  animation: toast-in 0.2s ease-out;
}

.app-toast.error {
  border-color: #ecc6ca;
  color: #8e4432;
  background: #fff8f5;
}

.app-toast.success {
  border-color: #c6c1ff;
  color: var(--green-dark);
  background: #f7f6ff;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translate(-50%, -10px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}
.confirm-modal {
  width: min(430px, 100%);
}

#confirmModal {
  z-index: 70;
}

.confirm-message {
  color: #61758c;
  line-height: 1.7;
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.confirm-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-start;
  margin-top: 24px;
}

.confirm-actions button {
  min-height: 46px;
  padding: 0 18px;
  border-radius: 10px;
  font-weight: 700;
}

.confirm-actions .danger {
  border: 1px solid #ecc6ca;
  color: var(--danger);
  background: #fff8f5;
}

@media (max-width: 1200px) {
  .top {
    grid-template-columns: minmax(0, 1fr) auto;
  }
  .header-search {
    grid-column: 1/-1;
    grid-row: 2;
  }
  .bookmark {
    grid-template-columns: 20px 40px minmax(0, 1fr) auto;
  }
}
@media (max-width: 760px) {
  .shell {
    display: block;
  }
  aside {
    position: relative;
    top: auto;
    height: auto;
    overflow: visible;
    border-inline-end: 0;
    border-bottom: 1px solid var(--line);
    padding: 16px 18px 12px;
  }
  .brand {
    margin: 0 0 16px;
  }
  .nav-label, .side-note {
    display: none;
  }
  nav {
    display: flex;
    overflow-x: auto;
    gap: 4px;
    padding-bottom: 4px;
    scrollbar-width: thin;
  }
  nav button {
    flex: none;
    white-space: nowrap;
    min-height: 38px;
    padding: 7px 10px;
  }
  .category-section {
    flex: none;
    margin-top: 8px;
    padding-top: 8px;
  }
  .category-list {
    display: flex;
    overflow-x: auto;
    padding-bottom: 4px;
  }
  .category-list button {
    flex: none;
    white-space: nowrap;
  }
  .category-tools {
    margin-top: 3px;
    padding-top: 7px;
    border-top: 0;
    justify-content: flex-start;
  }
  .category-tools button {
    flex: none;
    padding: 7px 10px;
  }
  .sidebar-footer {
    position: static;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
    padding: 9px 0 0;
    border-top: 1px solid var(--line);
  }
  .sidebar-footer .account {
    width: auto;
    min-height: 36px;
  }
  .account-identity {
    flex: 1;
    max-width: min(290px, 70%);
  }
  main {
    padding: 28px 18px 46px;
  }
  .top {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 13px;
    margin-bottom: 18px;
  }
  .top-actions {
    justify-content: flex-start;
  }
  .actions-menu {
    position: static;
  }
  .actions-panel {
    left: 0;
    right: auto;
    width: min(280px, 100vw - 36px);
  }
  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .stat:nth-child(2) {
    border-inline-end: 0;
  }
  .stat:nth-child(-n+2) {
    border-bottom: 1px solid var(--line);
  }
  .toolbar {
    flex-wrap: wrap;
    gap: 8px;
  }
  .toolbar-title {
    width: 100%;
  }
  .toolbar .sort {
    min-width: 0;
    width: calc(50% - 4px);
  }
  .toolbar .view-toggle {
    margin-inline-start: auto;
  }
  .drag-hint {
    display: none;
  }
  .bookmarks.is-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .bookmark {
    grid-template-columns: 20px 38px minmax(0, 1fr);
    gap: 8px;
    padding: 12px;
  }
  .site-icon {
    width: 36px;
    height: 36px;
  }
  .bookmark-main {
    grid-column: 3;
    grid-row: 1;
    padding-inline-end: 70px;
  }
  .bookmark.is-review .bookmark-main {
    padding-inline-end: 36px;
  }
  .date {
    grid-column: 3;
    grid-row: 1;
    justify-content: flex-start;
    justify-self: end;
    align-self: start;
    padding-top: 0;
  }
  .date time {
    display: none;
  }
  .review-box {
    grid-column: 2/-1;
    grid-row: 2;
    margin: 2px 0 0;
    padding: 8px;
  }
  .review-tools-actions {
    width: 100%;
  }
  .review-tools-actions button {
    flex: 1;
  }
  .modal-backdrop:has(.audit-modal), #chromeAddPreviewModal, #chromeImportPreviewModal {
    padding: 10px;
  }
  .modal.audit-modal, .modal.audit-preview-modal, .modal.chrome-import-modal {
    max-height: calc(100dvh - 20px);
    padding: 18px;
  }
  .audit-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    margin: 12px 0;
  }
  .audit-summary div {
    padding: 9px;
    font-size: 10px;
  }
  .audit-summary strong {
    font-size: 17px;
  }
  .audit-tab {
    min-height: 38px;
    padding: 0 10px;
  }
  .audit-review-row {
    flex-direction: column;
  }
  .audit-review-actions {
    width: 100%;
  }
  .audit-preview-group-head, .audit-preview-row {
    grid-template-columns: 1fr;
  }
  .chrome-import-group-head {
    grid-template-columns: 1fr;
  }
  .chrome-import-modal .quick-footer > button {
    flex: 1;
  }
  .audit-select-bar .primary {
    margin-inline-start: 0;
  }
}
@media (max-width: 420px) {
  .brand strong {
    font-size: 17px;
  }
  .brand small {
    font-size: 10px;
  }
  .top-actions .primary, .top-actions .actions-menu summary {
    min-height: 40px;
    padding-inline: 10px;
    font-size: 12px;
  }
  .review-actions button {
    min-height: 30px;
  }
}
@media (max-height: 620px) and (min-width: 761px) {
  .side-note {
    display: none;
  }
  .brand {
    margin-bottom: 18px;
  }
  .category-section {
    margin-top: 12px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
