body.memo-page {
  --memo-amber: #d97706;
  --memo-amber-strong: #b45309;
  --memo-amber-soft: rgba(217, 119, 6, 0.12);
  --memo-border: rgba(217, 119, 6, 0.15);
  --memo-text: #1c1009;
  --memo-text-muted: #78716c;
  --memo-card: rgba(255, 255, 255, 0.92);
  --memo-card-strong: rgba(255, 255, 255, 0.98);
  --memo-shadow: 0 18px 48px rgba(15, 23, 42, 0.12);
  margin: 0;
  min-height: 100vh;
  color: var(--memo-text);
  background: #fffbf5;
  font-family: var(--font-app-sans), "Segoe UI", sans-serif;
}

body.memo-page.modal-open {
  overflow: hidden;
}

.memo-page-shell {
  min-height: 100vh;
  position: relative;
  padding: 1rem;
  background: linear-gradient(180deg, #fffdf7 0%, #fef9ec 46%, #fffff5 100%);
  display: flex;
  flex-direction: column;
}

.memo-layout {
  display: flex;
  gap: 1.5rem;
  width: min(1380px, 100%);
  margin: 0 auto;
  flex: 1;
  transition: gap 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== Sidebar panel ===== */

.memo-sidebar {
  width: 232px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 1rem;
  height: calc(100vh - 2rem);
  overflow: hidden;
  transition: width 0.26s cubic-bezier(0.4, 0, 0.2, 1);
  background: rgba(255, 255, 255, 0.97);
  border: 1px solid rgba(217, 119, 6, 0.18);
  border-radius: 20px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05), 0 6px 20px rgba(0, 0, 0, 0.06);
}

.is-sidebar-collapsed .memo-sidebar {
  width: 58px;
}

.is-sidebar-collapsed .memo-layout {
  gap: 0.75rem;
}

/* ---- Brand header ---- */

.memo-sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.875rem 0.75rem 0.75rem;
  flex-shrink: 0;
  border-bottom: 1px solid rgba(217, 119, 6, 0.1);
}

.memo-sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
  overflow: hidden;
}

.memo-sidebar-brand-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #fff;
  font-size: 0.78rem;
  box-shadow: 0 2px 6px rgba(217, 119, 6, 0.32);
}

.memo-sidebar-title {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #7c2d12;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: opacity 0.18s, max-width 0.26s;
  max-width: 120px;
}

.memo-sidebar-toggle {
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  color: #6b7280;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: 7px;
  transition: background 0.15s, color 0.15s;
  flex-shrink: 0;
}

.memo-sidebar-toggle:hover {
  background: rgba(217, 119, 6, 0.1);
  color: #d97706;
}

/* ---- Scrollable inner content ---- */

.memo-sidebar-inner {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  padding-bottom: 1rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 0, 0, 0.1) transparent;
}

.memo-sidebar-inner::-webkit-scrollbar {
  width: 4px;
}

.memo-sidebar-inner::-webkit-scrollbar-track {
  background: transparent;
}

.memo-sidebar-inner::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.1);
  border-radius: 4px;
}

/* ---- Nav ---- */

.memo-sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0.625rem 0.5rem 0;
}

.memo-sidebar-nav__item {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.5rem 0.75rem;
  border-radius: 10px;
  color: #374151;
  font-size: 0.875rem;
  font-weight: 500;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  width: 100%;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  position: relative;
}

.memo-sidebar-nav__item:hover {
  background: rgba(217, 119, 6, 0.07);
  color: #d97706;
}

.memo-sidebar-nav__item.is-active {
  background: rgba(217, 119, 6, 0.1);
  color: #d97706;
  font-weight: 600;
}

.memo-sidebar-nav__item.is-active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 55%;
  border-radius: 0 3px 3px 0;
  background: #d97706;
}

.memo-sidebar-nav__item i {
  font-size: 1rem;
  width: 1.125rem;
  flex-shrink: 0;
  display: flex;
  justify-content: center;
  color: inherit;
  opacity: 0.75;
}

.memo-sidebar-nav__item.is-active i,
.memo-sidebar-nav__item:hover i {
  opacity: 1;
}

/* ---- Divider ---- */

.memo-sidebar-divider {
  height: 1px;
  background: rgba(217, 119, 6, 0.1);
  margin: 0.625rem 0.75rem;
  flex-shrink: 0;
}

/* ---- Sections ---- */

.memo-sidebar-section {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0 0.5rem;
}

.memo-sidebar-section__title {
  padding: 0 0.625rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #9ca3af;
  margin-bottom: 0.125rem;
  white-space: nowrap;
  overflow: hidden;
  transition: opacity 0.18s;
}

/* ---- Sort ---- */

.memo-sidebar-sort {
  padding: 0;
}

/* ---- Collection list ---- */

.memo-sidebar-collection-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
  max-height: 240px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 0, 0, 0.08) transparent;
}

.memo-sidebar-collection-list::-webkit-scrollbar {
  width: 3px;
}

.memo-sidebar-collection-list::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.1);
  border-radius: 3px;
}

.memo-sidebar-collection-item {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.44rem 0.75rem;
  border-radius: 9px;
  color: #4b5563;
  font-size: 0.855rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  white-space: nowrap;
  overflow: hidden;
}

.memo-sidebar-collection-item:hover {
  background: rgba(217, 119, 6, 0.07);
  color: #374151;
}

.memo-sidebar-collection-item.is-active {
  background: rgba(217, 119, 6, 0.1);
  color: #d97706;
  font-weight: 600;
}

.memo-sidebar-collection-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  transition: transform 0.15s;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.8);
}

.memo-sidebar-collection-item.is-active .memo-sidebar-collection-dot {
  transform: scale(1.25);
}

.memo-sidebar-collection-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.memo-sidebar-collection-count {
  margin-left: auto;
  font-size: 0.7rem;
  font-weight: 600;
  color: #9ca3af;
  background: rgba(0, 0, 0, 0.06);
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
  min-width: 1.25rem;
  text-align: center;
  flex-shrink: 0;
  transition: background 0.15s, color 0.15s;
}

.memo-sidebar-collection-item.is-active .memo-sidebar-collection-count {
  background: rgba(217, 119, 6, 0.15);
  color: #d97706;
}

.memo-sidebar-collection-empty {
  padding: 0.5rem 0.75rem;
  font-size: 0.8rem;
  color: #9ca3af;
  margin: 0;
}

/* ---- Manage button ---- */

.memo-sidebar-manage-btn {
  margin-top: 0.375rem;
  padding: 0.44rem 0.75rem;
  font-size: 0.84rem;
  color: #6b7280;
  background: transparent;
  border: none;
  border-radius: 9px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  width: 100%;
}

.memo-sidebar-manage-btn:hover {
  background: rgba(217, 119, 6, 0.07);
  color: #d97706;
}

.memo-sidebar-manage-btn i {
  font-size: 0.95rem;
  flex-shrink: 0;
  opacity: 0.8;
}

/* ---- Collapsed state ---- */

.is-sidebar-collapsed .memo-sidebar-title {
  opacity: 0;
  max-width: 0;
  overflow: hidden;
}

.is-sidebar-collapsed .memo-sidebar-section__title,
.is-sidebar-collapsed .memo-sidebar-nav__item span,
.is-sidebar-collapsed .memo-sidebar-collection-item .memo-sidebar-collection-name,
.is-sidebar-collapsed .memo-sidebar-collection-item .memo-sidebar-collection-count,
.is-sidebar-collapsed .memo-sidebar-manage-btn span,
.is-sidebar-collapsed .memo-sidebar-sort,
.is-sidebar-collapsed .memo-sidebar-divider,
.is-sidebar-collapsed .memo-sidebar-collection-empty {
  display: none;
}

.is-sidebar-collapsed .memo-sidebar-nav__item {
  padding: 0.5rem;
  justify-content: center;
}

.is-sidebar-collapsed .memo-sidebar-collection-item {
  padding: 0.44rem;
  justify-content: center;
}

.is-sidebar-collapsed .memo-sidebar-nav__item.is-active::before {
  display: none;
}

.is-sidebar-collapsed .memo-sidebar-manage-btn {
  padding: 0.44rem;
  justify-content: center;
}

.is-sidebar-collapsed .memo-sidebar-manage-btn i {
  opacity: 1;
}

.is-sidebar-collapsed .memo-sidebar-section {
  align-items: center;
}

/* ---- Container (unchanged) ---- */

.memo-container {
  flex: 1;
  min-width: 0;
  padding: 0 0 3rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

@media (max-width: 1024px) {
  .memo-sidebar {
    display: none;
  }
  
  .memo-layout {
    gap: 0;
  }
}

@media (max-width: 640px) {
  .memo-page-shell {
    padding: 0.75rem;
  }
  
  .memo-history__list {
    columns: 1;
    column-gap: 0;
  }
  
  .memo-toolbar {
    padding: 0.85rem;
  }
}

.memo-page-shell #auth-buttons .auth-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  border: 1px solid rgba(255, 251, 235, 0.92);
  border-radius: 999px;
  padding: 0.5rem 0.98rem;
  color: #fffaf1;
  background: linear-gradient(135deg, var(--memo-amber) 0%, var(--memo-amber-strong) 100%);
  box-shadow: 0 10px 20px rgba(217, 119, 6, 0.28);
  cursor: pointer;
}

.memo-card {
  border: 1px solid var(--memo-border);
  border-radius: 22px;
  background: var(--memo-card);
  backdrop-filter: blur(10px);
  box-shadow: var(--memo-shadow);
}

.memo-toolbar {
  padding: 1rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.memo-crawl-summary {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
  border: 0 !important;
  box-shadow: none !important;
}

.memo-crawl-summary__content {
  min-width: 0;
}

.memo-crawl-summary__eyebrow {
  margin: 0 0 0.28rem;
  color: var(--memo-amber);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.memo-crawl-summary h2 {
  margin: 0;
  color: var(--memo-text);
  font-size: 1.05rem;
  line-height: 1.4;
}

.memo-crawl-summary p {
  margin: 0.5rem 0 0;
  color: var(--memo-text-muted);
  font-size: 0.92rem;
  line-height: 1.7;
}

.memo-crawl-summary__list {
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.45rem;
  list-style: none;
}

.memo-crawl-summary__list li {
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
  color: var(--memo-text);
  font-size: 0.86rem;
  font-weight: 700;
  line-height: 1.55;
}

.memo-crawl-summary__list i {
  margin-top: 0.18rem;
  color: var(--memo-amber);
  flex-shrink: 0;
}

.memo-toolbar__title {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
}

.memo-toolbar__title h1 {
  margin: 0;
  font-size: clamp(1.45rem, 1vw + 1rem, 1.9rem);
  line-height: 1.1;
  color: #4a2b09;
}

.memo-toolbar__count {
  min-height: 30px;
  border: 1px solid rgba(191, 122, 23, 0.16);
  border-radius: 999px;
  padding: 0.24rem 0.62rem;
  display: inline-flex;
  align-items: center;
  gap: 0.34rem;
  background: rgba(255, 255, 255, 0.74);
  color: var(--memo-text-muted);
  font-size: 0.8rem;
  font-weight: 700;
  white-space: nowrap;
}

.memo-toolbar__title p {
  margin: 0.42rem 0 0;
  color: var(--memo-text-muted);
  font-size: 0.95rem;
}

.memo-toolbar__search {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  background: var(--memo-card-strong);
  border: 1px solid rgba(191, 122, 23, 0.22);
  border-radius: 12px;
  padding: 0.58rem 0.68rem;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

.memo-toolbar__search:focus-within {
  border-color: rgba(217, 119, 6, 0.42);
  box-shadow: 0 0 0 3px rgba(217, 119, 6, 0.1);
  background: #fff;
}

.memo-toolbar__search > i {
  color: #b45309;
}

.memo-toolbar__search input {
  width: 100%;
  min-width: 0;
  border: none;
  background: transparent;
  color: var(--memo-text);
  font: inherit;
}

.memo-toolbar__search input:focus {
  outline: none;
}

.memo-toolbar__filters {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(170px, auto);
  align-items: center;
  gap: 0.55rem;
}

.memo-control,
.memo-share-modal__body input {
  min-height: 42px;
  border-radius: 12px;
  border: 1px solid rgba(191, 122, 23, 0.24);
  background: var(--memo-card-strong);
  color: var(--memo-text);
  font: inherit;
  padding: 0.52rem 0.72rem;
}

.memo-share-modal__body input {
  min-height: 48px;
  border-radius: 16px;
  border-color: rgba(191, 122, 23, 0.26);
  background: rgba(255, 255, 255, 0.86);
  padding: 0.9rem 1rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.92);
}

.memo-share-modal__body input:focus {
  outline: none;
  border-color: rgba(217, 119, 6, 0.42);
  box-shadow:
    0 0 0 4px rgba(217, 119, 6, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.96);
}

.memo-toolbar__clear {
  min-height: 42px;
  border: none;
  border-radius: 999px;
  padding: 0.5rem 0.95rem;
  background: rgba(146, 64, 14, 0.09);
  color: #7b4b13;
  font-weight: 700;
  cursor: pointer;
}

.memo-mobile-tabs {
  display: none;
}

.memo-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.85fr) minmax(0, 0.95fr);
  gap: 1rem;
  align-items: stretch;
}

.memo-history-panel,
.memo-compose-panel {
  min-height: 0;
  padding: 1rem;
  display: flex;
  flex-direction: column;
}

.memo-history-panel {
  background: rgba(255, 255, 255, 0.78);
}

.memo-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.9rem;
  margin-bottom: 0.68rem;
}

.memo-panel__heading {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}

.memo-panel__header h2 {
  margin: 0;
  font-size: 1.08rem;
  color: #4a2b09;
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
  white-space: nowrap;
}

.memo-panel__header h2 i {
  font-size: 0.95rem;
  color: #8f5a17;
}

.memo-panel__header p {
  margin: 0;
  color: var(--memo-text-muted);
  font-size: 0.84rem;
}

.memo-panel__count {
  min-height: 30px;
  border: 1px solid rgba(191, 122, 23, 0.16);
  border-radius: 999px;
  padding: 0.24rem 0.62rem;
  display: inline-flex;
  align-items: center;
  gap: 0.34rem;
  background: rgba(255, 255, 255, 0.72);
  color: var(--memo-text-muted);
  font-size: 0.8rem;
  font-weight: 700;
  white-space: nowrap;
}

.memo-flash {
  border-radius: 14px;
  border: 1px solid transparent;
  padding: 0.86rem 0.95rem;
  font-weight: 700;
  font-size: 0.9rem;
}

.memo-flash--success {
  color: #9a5b10;
  border-color: rgba(217, 119, 6, 0.28);
  background: rgba(245, 158, 11, 0.12);
}

.memo-flash--error {
  color: #b42318;
  border-color: rgba(248, 113, 113, 0.28);
  background: rgba(248, 113, 113, 0.12);
}

/* ============================================================
   Keep-style sticky-note cards — masonry grid
   ============================================================ */
.memo-history__sections {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  overflow: auto;
  /* allow the pin button (positioned with negative offsets) to bleed outside list bounds */
  padding: 0.4rem 0.4rem 0;
  margin: -0.4rem -0.4rem 0;
}

.memo-history__section {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.memo-history__section-label {
  margin: 0;
  padding: 0 0.15rem;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #9a7a52;
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
}

.memo-history__section-label i {
  font-size: 0.78rem;
  color: #b08642;
}

.memo-history__list {
  margin: 0;
  padding: 0;
  list-style: none;
  /* Modern Masonry via CSS Columns */
  columns: 320px;
  column-gap: 1.25rem;
}

.memo-history__list > li {
  break-inside: avoid;
  page-break-inside: avoid;
  -webkit-column-break-inside: avoid;
  margin: 0 0 1.25rem;
  display: block;
}

.memo-item {
  --memo-card-accent: #fff8b8;
  position: relative;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 16px;
  background: var(--memo-card-strong);
  padding: 1rem 1.15rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  transition: 
    box-shadow 0.25s cubic-bezier(0.16, 1, 0.3, 1), 
    border-color 0.25s cubic-bezier(0.16, 1, 0.3, 1), 
    transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
  isolation: isolate;
}

.memo-item.has-accent {
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--memo-card-accent) 18%, var(--memo-card-strong)) 0%, var(--memo-card-strong) 70%);
  border-color: color-mix(in srgb, var(--memo-card-accent) 32%, #d8dadc);
}

.memo-item::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 4px;
  background: var(--memo-card-accent);
  opacity: 0;
  transition: opacity 0.18s ease;
}

.memo-item.has-accent::before {
  opacity: 1;
}

.memo-item:hover {
  border-color: rgba(217, 119, 6, 0.2);
  transform: translateY(-2px);
  box-shadow:
    0 12px 24px -8px rgba(15, 23, 42, 0.12),
    0 4px 8px -2px rgba(15, 23, 42, 0.06);
}

.memo-item.is-pinned {
  background:
    linear-gradient(180deg, rgba(255, 244, 117, 0.32) 0%, var(--memo-card-strong) 80%);
  border-color: #e6c95f;
}

.memo-item.is-pinned.has-accent {
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--memo-card-accent) 24%, var(--memo-card-strong)) 0%, var(--memo-card-strong) 75%);
}

.memo-item.is-archived {
  opacity: 0.78;
  border-style: dashed;
}

.memo-item.is-selected {
  border-color: rgba(217, 119, 6, 0.55);
  box-shadow:
    0 0 0 2px rgba(245, 158, 11, 0.22),
    0 1px 2px 0 rgba(60, 64, 67, 0.18),
    0 2px 6px 2px rgba(60, 64, 67, 0.14);
}

.memo-item__archive-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  font-size: 0.76rem;
  font-weight: 700;
  color: #6b7280;
  background: rgba(107, 114, 128, 0.12);
  border: 1px solid rgba(107, 114, 128, 0.24);
  border-radius: 999px;
}

.memo-item__open {
  width: 100%;
  border: none;
  background: transparent;
  padding: 0;
  margin: 0;
  text-align: left;
  color: inherit;
  cursor: pointer;
}

.memo-item__open--content {
  display: flex;
  flex-direction: column;
  gap: 0.42rem;
  padding-right: 1.8rem; /* avoid overlapping the pin button */
}

.memo-item__title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 750;
  line-height: 1.4;
  color: #1a1a1a;
  word-break: break-word;
}

.memo-item__excerpt {
  margin: 0;
  color: #4b5563;
  font-size: 0.9rem;
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 12;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}

.memo-item__excerpt p { margin: 0 0 0.5rem; }
.memo-item__excerpt p:last-child { margin-bottom: 0; }

.memo-item__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  min-height: 36px;
  margin-top: 0.4rem;
  border-top: 1px solid rgba(0, 0, 0, 0.03);
  padding-top: 0.75rem;
}

.memo-item__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
  flex: 1 1 auto;
}

.memo-item__date {
  color: #9ca3af;
  font-size: 0.75rem;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  white-space: nowrap;
}

.memo-item__date i {
  font-size: 0.72rem;
}

/* Pin button — top-right of card, like Google Keep */
.memo-item__pin {
  position: absolute;
  top: 0.32rem;
  right: 0.32rem;
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: #5f6368;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.96rem;
  opacity: 0;
  transform: translateY(-2px);
  transition: opacity 0.18s ease, background 0.15s ease, color 0.15s ease, transform 0.18s ease;
  z-index: 2;
}

.memo-item:hover .memo-item__pin,
.memo-item:focus-within .memo-item__pin,
.memo-item__pin.is-pinned,
.memo-item__pin:focus-visible {
  opacity: 1;
  transform: translateY(0);
}

.memo-item__pin:hover {
  background: rgba(60, 64, 67, 0.09);
  color: #202124;
}

.memo-item__pin.is-pinned {
  color: #c08e10;
}

.memo-item__pin.is-pinned:hover {
  background: rgba(245, 158, 11, 0.16);
  color: #8a6306;
}

.memo-item__actions {
  display: flex;
  align-items: center;
  gap: 0.08rem;
  opacity: 0;
  transform: translateY(2px);
  transition: opacity 0.18s ease, transform 0.18s ease;
  flex-shrink: 0;
}

.memo-item:hover .memo-item__actions,
.memo-item:focus-within .memo-item__actions {
  opacity: 1;
  transform: translateY(0);
}

/* Always-on on touch devices so they aren't unreachable */
@media (hover: none) {
  .memo-item__pin,
  .memo-item__actions {
    opacity: 1;
    transform: none;
  }
}

.memo-item__action {
  width: 30px;
  height: 30px;
  min-height: 30px;
  flex: 0 0 30px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: #5f6368;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.86rem;
  transition: background 0.12s ease, color 0.12s ease;
}

.memo-item__action:hover:not(:disabled) {
  background: rgba(60, 64, 67, 0.09);
  color: #202124;
}

.memo-item__action.is-active {
  background: rgba(245, 158, 11, 0.18);
  color: #8a6306;
}

.memo-item__action.is-copied {
  background: rgba(217, 119, 6, 0.14);
  color: #b45309;
}

.memo-item__action:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.memo-item__menu-wrap {
  position: relative;
}

.memo-item__dropdown {
  position: fixed;
  min-width: 168px;
  background: rgba(255, 249, 240, 0.98);
  border: 1px solid rgba(191, 122, 23, 0.22);
  border-radius: 10px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.13);
  z-index: 200;
  padding: 4px;
  display: flex;
  flex-direction: column;
  gap: 1px;
  overflow-y: auto;
}

.memo-item__dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 7px 12px;
  background: transparent;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  color: #8f5a17;
  font-size: 0.875rem;
  text-align: left;
  white-space: nowrap;
  transition: background 0.12s;
}

.memo-item__dropdown-item:hover {
  background: rgba(191, 122, 23, 0.1);
}

.memo-item__dropdown-item.is-active {
  color: #d97706;
  background: rgba(245, 158, 11, 0.1);
}

.memo-item__dropdown-item--danger {
  color: #b42318;
}

.memo-item__dropdown-item--danger:hover {
  background: rgba(248, 113, 113, 0.12);
}

.memo-item__dropdown-divider {
  height: 1px;
  background: rgba(191, 122, 23, 0.15);
  margin: 2px 8px;
}

.memo-form {
  display: flex;
  flex-direction: column;
  gap: 0.88rem;
}

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

.form-group label {
  font-size: 0.9rem;
  font-weight: 700;
  color: #5c3610;
}

.optional {
  color: #9f7a4a;
  font-size: 0.8rem;
}

textarea.memo-control {
  resize: vertical;
  min-height: 132px;
}

.memo-control--response {
  min-height: 200px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.65rem;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
}

.primary-button,
.secondary-button {
  min-height: 42px;
  border-radius: 999px;
  padding: 0.55rem 1rem;
  border: none;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
}

.primary-button {
  color: #fffdf8;
  background: linear-gradient(135deg, var(--memo-amber) 0%, var(--memo-amber-strong) 100%);
  box-shadow: 0 14px 24px rgba(217, 119, 6, 0.24);
}

.secondary-button {
  color: #7b4b13;
  background: rgba(146, 64, 14, 0.1);
}

.primary-button:disabled,
.secondary-button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.memo-history__empty {
  border-radius: 12px;
  border: 1px dashed rgba(191, 122, 23, 0.24);
  background: rgba(255, 255, 255, 0.73);
  color: var(--memo-text-muted);
  text-align: center;
  padding: 1rem;
}

.memo-modal,
.memo-share-modal {
  position: fixed;
  inset: 0;
  z-index: 2100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background:
    radial-gradient(circle at top, rgba(217, 119, 6, 0.16), transparent 34%),
    rgba(41, 24, 6, 0.54);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s ease, backdrop-filter 0.32s ease;
}

.memo-modal.is-visible,
.memo-share-modal.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.memo-modal__overlay,
.memo-share-modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(41, 24, 6, 0.46);
  backdrop-filter: blur(6px);
}

.memo-modal__content,
.memo-share-modal__content {
  position: relative;
  z-index: 1;
  width: min(980px, 100%);
  height: min(90vh, 860px);
  max-height: 90vh;
  overflow: hidden;
  border-radius: 20px;
  border: 1px solid rgba(217, 119, 6, 0.2);
  background: rgba(255, 251, 235, 0.97);
  box-shadow: 0 30px 68px rgba(41, 24, 6, 0.3);
  display: flex;
  flex-direction: column;
}

.memo-share-modal__content {
  width: min(92%, 620px);
  height: auto;
  max-height: 92vh;
  padding: 1.5rem;
  gap: 1rem;
  overflow-y: auto;
  border-radius: 24px;
  border-color: rgba(217, 119, 6, 0.26);
  background:
    radial-gradient(circle at top right, rgba(245, 158, 11, 0.16), transparent 34%),
    linear-gradient(180deg, rgba(255, 251, 235, 0.985) 0%, rgba(255, 247, 237, 0.965) 100%);
  box-shadow:
    0 32px 80px rgba(41, 24, 6, 0.3),
    0 12px 30px rgba(217, 119, 6, 0.14);
}

.memo-modal__close,
.memo-share-modal__close {
  position: absolute;
  top: 0.95rem;
  right: 0.95rem;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 999px;
  border: 1px solid rgba(191, 122, 23, 0.2);
  background: rgba(255, 255, 255, 0.95);
  color: #7b4b13;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 12px 26px rgba(41, 24, 6, 0.12);
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.memo-share-modal__close:hover {
  background: #ffffff;
  border-color: rgba(217, 119, 6, 0.42);
  color: #4a2b09;
  transform: translateY(-1px);
}

.memo-modal__header,
.memo-share-modal__header {
  padding: 0.85rem 1.15rem 0.55rem;
}

.memo-share-modal__header {
  padding: 0 3.35rem 0 0;
}

.memo-modal__header h3,
.memo-share-modal__header h3 {
  margin: 0;
  font-size: 1.15rem;
  line-height: 1.3;
  color: #4a2b09;
}

.memo-share-modal__header h3 {
  font-size: clamp(1.42rem, 1vw + 1.05rem, 1.9rem);
  font-weight: 800;
  line-height: 1.25;
}

.memo-modal__date,
.memo-share-modal__header p {
  margin: 0.18rem 0 0;
  font-size: 0.84rem;
  line-height: 1.35;
  color: #9a7a52;
}

.memo-modal__title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.9rem;
  padding-right: 3rem;
}

.memo-modal__title-row > div:first-child {
  flex: 1 1 auto;
  min-width: 0;
}

.memo-modal__title-row h3 {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.memo-modal__header-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.45rem;
  flex: 0 0 auto;
  min-width: 0;
}

.memo-modal__icon-btn {
  width: 34px;
  height: 34px;
  min-width: 34px;
  border: 1px solid rgba(191, 122, 23, 0.2);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.82);
  color: #8f5a17;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.memo-modal__icon-btn:hover,
.memo-modal__icon-btn.is-active {
  border-color: rgba(217, 119, 6, 0.38);
  background: rgba(245, 158, 11, 0.12);
}

.memo-modal__autosave-status {
  min-height: 34px;
  max-width: min(18rem, 100%);
  border: 1px solid rgba(191, 122, 23, 0.2);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  color: #8f5a17;
  padding: 0.34rem 0.74rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.36rem;
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
}

.memo-modal__autosave-status--saving {
  color: #b45309;
  border-color: rgba(217, 119, 6, 0.28);
  background: rgba(217, 119, 6, 0.1);
}

.memo-modal__autosave-status--saved {
  color: #b45309;
}

.memo-modal__autosave-status--error {
  color: #b42318;
  border-color: rgba(248, 113, 113, 0.3);
  background: rgba(248, 113, 113, 0.12);
}

.memo-modal__edit-btn {
  min-height: 36px;
  border: 1px solid rgba(191, 122, 23, 0.22);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  color: #8f5a17;
  padding: 0.38rem 0.78rem;
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
  font-size: 0.82rem;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
}

.memo-modal__edit-btn:hover:not(:disabled) {
  border-color: rgba(217, 119, 6, 0.38);
  background: rgba(245, 158, 11, 0.12);
}

.memo-modal__edit-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.memo-modal__body {
  flex: 1;
  min-height: 0;
  padding: 0 1.15rem 1rem;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
  overflow-y: auto;
  overflow-x: hidden;
}

.memo-modal__section {
  border: none;
  border-radius: 0;
  background: transparent;
  padding: 0;
}

.memo-modal__section h4 {
  margin: 0;
  color: #8f5a17;
  font-size: 0.9rem;
}

.memo-modal__markdown {
  margin: 0.68rem 0 0;
  font-size: 0.9rem;
  line-height: 1.68;
  color: var(--memo-text);
  overflow-wrap: break-word;
  word-break: break-word;
}

.memo-modal__markdown > * {
  margin: 0.6rem 0;
}

.memo-modal__markdown p {
  margin: 0.48rem 0;
}

.memo-modal__markdown ul,
.memo-modal__markdown ol {
  margin: 0.4rem 0 0.4rem 1rem;
  padding-left: 0.8rem;
}

.memo-modal__markdown pre {
  overflow-x: auto;
  max-width: 100%;
}

.memo-modal__markdown code {
  word-break: break-all;
}

/* ============================================================
   Modal scrollbar – matches memo page amber/teal palette
   ============================================================ */
.memo-modal__body,
.memo-collection-modal__body {
  scrollbar-width: thin;
  scrollbar-color: rgba(217, 119, 6, 0.38) transparent;
}

.memo-modal__body::-webkit-scrollbar,
.memo-collection-modal__body::-webkit-scrollbar {
  width: 6px;
}

.memo-modal__body::-webkit-scrollbar-track,
.memo-collection-modal__body::-webkit-scrollbar-track {
  background: transparent;
  border-radius: 999px;
  margin-block: 0.6rem;
}

.memo-modal__body::-webkit-scrollbar-thumb,
.memo-collection-modal__body::-webkit-scrollbar-thumb {
  background: linear-gradient(
    180deg,
    rgba(217, 119, 6, 0.52) 0%,
    rgba(180, 83, 9, 0.52) 100%
  );
  border-radius: 999px;
  border: 1.5px solid rgba(255, 251, 235, 0.72);
  transition: background 0.2s;
}

.memo-modal__body::-webkit-scrollbar-thumb:hover,
.memo-collection-modal__body::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(
    180deg,
    rgba(217, 119, 6, 0.74) 0%,
    rgba(180, 83, 9, 0.74) 100%
  );
}

.memo-modal__body::-webkit-scrollbar-thumb:active,
.memo-collection-modal__body::-webkit-scrollbar-thumb:active {
  background: linear-gradient(180deg, var(--memo-amber) 0%, var(--memo-amber-strong) 100%);
}

.memo-share-modal__body {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.memo-share-modal__row {
  margin: 0;
}

.memo-share-modal__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
}

.memo-share-modal__icon-btn {
  width: 42px;
  height: 42px;
  min-width: 42px;
  padding: 0;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.memo-share-modal__icon-btn i {
  font-size: 1rem;
  line-height: 1;
}

.memo-share-modal__status {
  margin: 0;
  min-height: 1.35rem;
  font-size: 0.85rem;
  line-height: 1.55;
}

.memo-share-modal__status--success {
  color: #8f5a17;
}

.memo-share-modal__status--error {
  color: #b42318;
}

.memo-share-modal__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: #9a7a52;
}

.memo-share-modal__meta span {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0.34rem 0.74rem;
  border: 1px solid rgba(191, 122, 23, 0.18);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.68);
  font-weight: 700;
}

.memo-share-modal__sns {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.7rem;
}

.memo-share-modal__sns a {
  min-height: 46px;
  border: 1px solid rgba(191, 122, 23, 0.2);
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  color: #8f5a17;
  text-decoration: none;
  padding: 0.54rem 0.72rem;
  background: rgba(255, 255, 255, 0.78);
  font-size: 0.9rem;
  font-weight: 700;
  box-shadow: 0 10px 18px rgba(41, 24, 6, 0.04);
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.memo-share-modal__sns a:hover {
  background: rgba(255, 255, 255, 0.96);
  border-color: rgba(217, 119, 6, 0.4);
  transform: translateY(-1px);
}

.memo-share-modal__sns .share-x-icon {
  width: 0.92rem;
  height: 0.92rem;
  flex-shrink: 0;
}

.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;
}

/* ============================================================
   Toolbar top row: title + action buttons
   ============================================================ */
.memo-toolbar__top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.memo-toolbar__actions {
  display: flex;
  flex-shrink: 0;
  gap: 0.42rem;
  flex-wrap: wrap;
  align-items: center;
}

.memo-toolbar__icon-btn {
  width: 42px;
  height: 42px;
  min-height: 42px;
  border: 1px solid rgba(191, 122, 23, 0.22);
  border-radius: 12px;
  background: var(--memo-card-strong);
  color: #8f5a17;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s;
}

.memo-toolbar__icon-btn:hover {
  background: rgba(245, 158, 11, 0.1);
  border-color: rgba(217, 119, 6, 0.35);
}

.memo-toolbar__icon-btn.is-active {
  background: linear-gradient(135deg, var(--memo-amber) 0%, var(--memo-amber-strong) 100%);
  color: #fffdf8;
  border-color: transparent;
}

.memo-toolbar__btn-label {
  display: none;
}

/* Search AI badge */
.memo-search__badge {
  font-size: 0.72rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--memo-amber), var(--memo-amber-strong));
  color: #fffdf8;
  border-radius: 999px;
  padding: 0.2rem 0.55rem;
  display: inline-flex;
  align-items: center;
  gap: 0.24rem;
  white-space: nowrap;
  flex-shrink: 0;
}

.memo-search__badge i {
  color: currentColor;
  font-size: 0.78rem;
}

.memo-toolbar__search-clear {
  width: 30px;
  height: 30px;
  border: 1px solid rgba(191, 122, 23, 0.18);
  border-radius: 999px;
  background: rgba(146, 64, 14, 0.08);
  color: #7b4b13;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s, border-color 0.15s;
}

.memo-toolbar__search-clear:hover {
  border-color: rgba(217, 119, 6, 0.35);
  background: rgba(245, 158, 11, 0.14);
}

.memo-toolbar__search-clear i {
  color: currentColor;
  font-size: 0.76rem;
}

/* Toolbar filters */
.memo-filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.38rem;
  min-width: 0;
}

.memo-filter-chip {
  min-height: 38px;
  border: 1px solid rgba(191, 122, 23, 0.2);
  border-radius: 999px;
  background: var(--memo-card-strong);
  color: #8f5a17;
  padding: 0.38rem 0.72rem;
  display: inline-flex;
  align-items: center;
  gap: 0.34rem;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.memo-filter-chip:hover {
  border-color: rgba(217, 119, 6, 0.35);
  background: rgba(245, 158, 11, 0.1);
}

.memo-filter-chip.is-active {
  border-color: transparent;
  background: linear-gradient(135deg, var(--memo-amber) 0%, var(--memo-amber-strong) 100%);
  color: #fffdf8;
}

.memo-sort-control {
  position: relative;
  min-width: 170px;
}

.memo-sort-control > i {
  position: absolute;
  top: 50%;
  left: 0.74rem;
  z-index: 1;
  color: #8f5a17;
  transform: translateY(-50%);
  pointer-events: none;
}

.memo-sort-control .memo-select {
  width: 100%;
}

.memo-sort-control .memo-select__trigger {
  padding-left: 2rem;
}

/* ============================================================
   Collection filter in toolbar
   ============================================================ */
.memo-toolbar__collections {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.55rem;
  overflow: visible;
}

.memo-toolbar__collections-label {
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
  color: #5f6368;
  font-size: 0.82rem;
  font-weight: 700;
  white-space: nowrap;
}

.memo-select--collection-filter {
  width: min(18rem, 100%);
}

.memo-collection-chip {
  border: 1.5px solid rgba(191, 122, 23, 0.2);
  border-radius: 999px;
  min-height: 34px;
  padding: 0.3rem 0.75rem;
  background: var(--memo-card-strong);
  color: #8f5a17;
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 700;
  flex: 0 0 auto;
  transition: background 0.15s, border-color 0.15s;
}

.memo-collection-chip:hover {
  border-color: var(--badge-color, rgba(217, 119, 6, 0.45));
  background: color-mix(in srgb, var(--badge-color, #f59e0b) 12%, transparent);
}

.memo-collection-chip.is-active {
  background: var(--badge-color, var(--memo-amber));
  color: #fff;
  border-color: transparent;
}

.memo-collection-chip.is-drop-target {
  border-color: var(--badge-color, var(--memo-amber));
  background: color-mix(in srgb, var(--badge-color, var(--memo-amber)) 18%, #fff);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--badge-color, var(--memo-amber)) 22%, transparent);
}

.memo-collection-chip--drop {
  --badge-color: #6b7280;
}

.memo-collection-chip__count {
  font-size: 0.72rem;
  opacity: 0.82;
  font-variant-numeric: tabular-nums;
}

/* Collection badge inside memo item */
.memo-collection-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  max-width: 14rem;
  font-size: 0.72rem;
  font-weight: 700;
  border-radius: 6px;
  padding: 0.2rem 0.52rem;
  background: color-mix(in srgb, var(--badge-color, #6b7280) 14%, transparent);
  color: var(--badge-color, #6b7280);
  border: 1px solid color-mix(in srgb, var(--badge-color, #6b7280) 28%, transparent);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.memo-item__meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
}

/* Panel collection label */
.memo-panel__collection-label {
  font-weight: 600;
  color: var(--memo-text-muted);
  font-size: 0.88rem;
}

/* ============================================================
   Bulk selection
   ============================================================ */
.memo-bulk-checkbox {
  width: 18px;
  height: 18px;
  accent-color: var(--memo-amber);
  cursor: pointer;
  flex-shrink: 0;
}

.memo-item__checkbox-wrap {
  padding: 0 0.15rem 0.5rem;
}

.memo-item.is-selected {
  border-color: rgba(217, 119, 6, 0.45);
  background: rgba(245, 158, 11, 0.07);
}

.memo-bulk-bar {
  padding: 0.72rem 1rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
  border-radius: 16px;
}

.memo-bulk-bar__info {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.memo-bulk-bar__count {
  font-size: 0.88rem;
  font-weight: 700;
  color: #7b4b13;
  cursor: pointer;
}

.memo-bulk-bar__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}

.memo-bulk-btn {
  min-height: 34px;
  border: 1px solid rgba(191, 122, 23, 0.24);
  border-radius: 8px;
  background: var(--memo-card-strong);
  color: #8f5a17;
  padding: 0.32rem 0.7rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.memo-bulk-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.memo-bulk-btn--danger {
  color: #b42318;
  border-color: rgba(248, 113, 113, 0.35);
}

/* ============================================================
   Markdown preview in compose form
   ============================================================ */
.memo-response-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.memo-response-header label {
  font-size: 0.9rem;
  font-weight: 700;
  color: #5c3610;
}

.memo-response-tabs {
  display: flex;
  gap: 0.3rem;
}

.memo-response-tab {
  min-height: 32px;
  border: 1px solid rgba(191, 122, 23, 0.22);
  border-radius: 8px;
  background: transparent;
  color: #9a7a52;
  padding: 0.28rem 0.65rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s;
}

.memo-response-tab.is-active {
  background: linear-gradient(135deg, var(--memo-amber) 0%, var(--memo-amber-strong) 100%);
  color: #fffdf8;
  border-color: transparent;
}

.memo-response-tab:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.memo-preview-pane {
  min-height: 200px;
  border: 1px solid rgba(191, 122, 23, 0.22);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.92);
  padding: 0.82rem 0.92rem;
  overflow: auto;
}

.memo-preview-content {
  font-size: 0.9rem;
  line-height: 1.68;
  color: var(--memo-text);
}

.memo-preview-content > * { margin: 0.55rem 0; }
.memo-preview-content p { margin: 0.42rem 0; }
.memo-preview-content ul,
.memo-preview-content ol { margin: 0.4rem 0 0.4rem 1rem; padding-left: 0.8rem; }
.memo-preview-content pre { border-radius: 8px; padding: 0.75rem; overflow-x: auto; }
.memo-preview-content code { font-size: 0.85em; border-radius: 4px; padding: 0.15em 0.35em; }
.memo-preview-content input[type="checkbox"],
.memo-item__excerpt input[type="checkbox"],
.memo-modal__markdown input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
  margin: 0 0.42rem 0 0;
  vertical-align: -0.16rem;
  accent-color: var(--memo-amber);
}

.memo-preview-empty {
  color: var(--memo-text-muted);
  font-size: 0.88rem;
  font-style: italic;
  text-align: center;
  padding: 2rem 0;
}

/* ============================================================
   AI suggest button
   ============================================================ */
.memo-field-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.45rem;
}

.memo-field-header label {
  font-size: 0.9rem;
  font-weight: 700;
  color: #5c3610;
}

.memo-ai-suggest-btn {
  min-height: 30px;
  border: 1px solid rgba(139, 92, 246, 0.3);
  border-radius: 8px;
  background: rgba(139, 92, 246, 0.08);
  color: #7c3aed;
  padding: 0.25rem 0.62rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  white-space: nowrap;
}

.memo-ai-suggest-btn:hover:not(:disabled) {
  background: rgba(139, 92, 246, 0.15);
  border-color: rgba(139, 92, 246, 0.5);
}

.memo-ai-suggest-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.memo-ai-suggest-btn.is-loading {
  pointer-events: none;
}

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

.memo-spin {
  animation: memo-spin 0.75s linear infinite;
  display: inline-block;
}

/* Modal section full width */
.memo-modal__section--full {
  grid-column: 1 / -1;
}

.memo-modal__body--edit {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.memo-modal__edit-form {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  gap: 0;
  background: transparent;
}

.memo-modal__edit-fields {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  gap: 0;
}

.memo-modal__meta-panel {
  border: 1px solid rgba(191, 122, 23, 0.14);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.64);
  padding: 0.68rem;
  margin-bottom: 0.7rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.memo-modal__edit-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem;
}

.memo-modal__edit-field {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.memo-modal__edit-fields label {
  color: #5c3610;
  font-size: 0.88rem;
  font-weight: 700;
}

.memo-modal__field-label {
  color: #5c3610;
  font-size: 0.88rem;
  font-weight: 700;
}

.memo-modal__color-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.42rem;
}

.memo-modal__color-option {
  width: 32px;
  height: 32px;
  min-width: 32px;
  border: 2px solid transparent;
  border-radius: 999px;
  background: transparent;
  padding: 2px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.memo-modal__color-option span {
  width: 100%;
  height: 100%;
  border: 1px solid rgba(95, 99, 104, 0.24);
  border-radius: inherit;
  background: var(--palette-color, #fff);
}

.memo-modal__color-option:hover,
.memo-modal__color-option:focus-visible,
.memo-modal__color-option.is-active {
  border-color: rgba(217, 119, 6, 0.58);
  outline: none;
}

.memo-modal__response-header {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  padding-bottom: 0.4rem;
}

.memo-modal__edit-textarea {
  width: 100%;
  min-height: 130px;
  resize: vertical;
}

.memo-modal__edit-textarea--response {
  flex: 1 1 auto;
  min-height: 0;
  resize: none;
  padding: 0.3rem 0;
}

/* Three-class specificity (0,0,3,0) beats theme-scoped [attr]+class (0,0,2,0) */
.memo-modal__edit-fields .memo-control.memo-modal__edit-textarea--response,
.memo-modal__edit-fields .memo-control.memo-modal__edit-textarea--response:focus,
.memo-modal__edit-fields .memo-control.memo-modal__edit-textarea--response:focus-visible {
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  outline: none;
}

.memo-modal__preview-pane {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  border: none;
  border-radius: 0;
  background: transparent;
  padding: 0.3rem 0;
}

.memo-modal__edit-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.55rem;
}

/* ============================================================
   Collection management modal
   ============================================================ */
.memo-collection-modal {
  position: fixed;
  inset: 0;
  z-index: 2100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.memo-collection-modal.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.memo-collection-modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(41, 24, 6, 0.46);
  backdrop-filter: blur(6px);
}

.memo-collection-modal__content {
  position: relative;
  z-index: 1;
  width: min(560px, 100%);
  max-height: 88vh;
  overflow: hidden;
  border-radius: 20px;
  border: 1px solid rgba(217, 119, 6, 0.2);
  background: rgba(255, 251, 235, 0.97);
  box-shadow: 0 30px 68px rgba(41, 24, 6, 0.28);
  display: flex;
  flex-direction: column;
}

.memo-collection-modal__close {
  position: absolute;
  top: 0.8rem;
  right: 0.8rem;
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 999px;
  border: 1px solid rgba(191, 122, 23, 0.2);
  background: rgba(255, 255, 255, 0.95);
  color: #7b4b13;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.memo-collection-modal__header {
  padding: 1rem 1.15rem 0.75rem;
}

.memo-collection-modal__header h3 {
  margin: 0;
  font-size: 1.1rem;
  color: #4a2b09;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.memo-collection-modal__header p {
  margin: 0.35rem 0 0;
  font-size: 0.86rem;
  color: #9a7a52;
}

.memo-collection-modal__body {
  flex: 1;
  min-height: 0;
  padding: 0 1.15rem 1.1rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.memo-collection-create {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  border: 1px solid rgba(191, 122, 23, 0.18);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.8);
  padding: 0.85rem;
}

.memo-collection-create__input {
  min-height: 40px !important;
}

.memo-collection-create__color-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: #7b4b13;
}

.memo-collection-color-input {
  width: 36px;
  height: 28px;
  border: 1px solid rgba(191, 122, 23, 0.24);
  border-radius: 6px;
  padding: 2px;
  cursor: pointer;
  background: transparent;
}

.memo-collection-presets {
  display: flex;
  gap: 0.3rem;
  flex-wrap: wrap;
}

.memo-collection-preset {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.12s;
}

.memo-collection-preset.is-active,
.memo-collection-preset:hover {
  border-color: rgba(0, 0, 0, 0.3);
  transform: scale(1.18);
}

.memo-collection-create__btn {
  align-self: flex-end;
}

.memo-collection-empty {
  text-align: center;
  color: var(--memo-text-muted);
  font-size: 0.88rem;
  padding: 1.2rem 0;
}

.memo-collection-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.memo-collection-item {
  border: 1px solid rgba(191, 122, 23, 0.15);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.88);
  overflow: hidden;
}

.memo-collection-item__row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.65rem 0.85rem;
}

.memo-collection-item__dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}

.memo-collection-item__name {
  flex: 1;
  font-size: 0.9rem;
  font-weight: 700;
  color: #4a2b09;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.memo-collection-item__count {
  font-size: 0.78rem;
  color: var(--memo-text-muted);
  white-space: nowrap;
}

.memo-collection-item__action {
  width: 30px;
  height: 30px;
  border: 1px solid rgba(191, 122, 23, 0.2);
  border-radius: 8px;
  background: rgba(255, 249, 240, 0.9);
  color: #8f5a17;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  font-size: 0.82rem;
}

.memo-collection-item__action--danger {
  color: #b42318;
  border-color: rgba(248, 113, 113, 0.35);
}

.memo-collection-item__action:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.memo-collection-item__edit {
  padding: 0.75rem 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.memo-collection-item__edit-actions {
  display: flex;
  gap: 0.45rem;
}

/* ============================================================
   Export modal
   ============================================================ */
.memo-export-modal {
  position: fixed;
  inset: 0;
  z-index: 2100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.memo-export-modal.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.memo-export-modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(41, 24, 6, 0.46);
  backdrop-filter: blur(6px);
}

.memo-export-modal__content {
  position: relative;
  z-index: 1;
  width: min(620px, 100%);
  max-height: min(760px, calc(100vh - 2rem));
  border-radius: 20px;
  border: 1px solid rgba(217, 119, 6, 0.2);
  background: rgba(255, 251, 235, 0.97);
  box-shadow: 0 30px 68px rgba(41, 24, 6, 0.28);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.memo-export-modal__close {
  position: absolute;
  top: 0.8rem;
  right: 0.8rem;
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 999px;
  border: 1px solid rgba(191, 122, 23, 0.2);
  background: rgba(255, 255, 255, 0.95);
  color: #7b4b13;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.memo-export-modal__header {
  padding: 1rem 1.15rem 0.75rem;
}

.memo-export-modal__header h3 {
  margin: 0;
  font-size: 1.1rem;
  color: #4a2b09;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.memo-export-modal__header p {
  margin: 0.35rem 0 0;
  font-size: 0.86rem;
  color: #9a7a52;
}

.memo-export-modal__body {
  padding: 0 1.15rem 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  overflow-y: auto;
}

.memo-export-section {
  display: flex;
  flex-direction: column;
  gap: 0.52rem;
}

.memo-export-label {
  margin: 0;
  font-size: 0.86rem;
  font-weight: 700;
  color: #7b4b13;
}

.memo-export-formats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
}

.memo-export-format-option {
  border: 1.5px solid rgba(191, 122, 23, 0.22);
  border-radius: 12px;
  background: var(--memo-card-strong);
  color: #8f5a17;
  padding: 0.72rem 0.6rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 700;
  text-align: center;
  transition: background 0.15s, border-color 0.15s;
  user-select: none;
}

.memo-export-format-option i {
  font-size: 1.4rem;
}

.memo-export-format-option.is-active {
  background: linear-gradient(135deg, var(--memo-amber) 0%, var(--memo-amber-strong) 100%);
  color: #fffdf8;
  border-color: transparent;
}

.memo-export-scope {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
}

.memo-export-scope-option {
  border: 1.5px solid rgba(191, 122, 23, 0.22);
  border-radius: 12px;
  background: var(--memo-card-strong);
  color: #8f5a17;
  padding: 0.72rem 0.6rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 700;
  text-align: center;
  transition: background 0.15s, border-color 0.15s;
  user-select: none;
}

.memo-export-scope-option i {
  font-size: 1.4rem;
}

.memo-export-scope-option.is-active {
  background: linear-gradient(135deg, var(--memo-amber) 0%, var(--memo-amber-strong) 100%);
  color: #fffdf8;
  border-color: transparent;
}

.memo-export-scope-option.is-disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.memo-export-select {
  min-height: 0;
}

.memo-export-select__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.memo-export-select__actions {
  display: flex;
  gap: 0.4rem;
}

.memo-export-select__action {
  border: 1px solid rgba(191, 122, 23, 0.2);
  border-radius: 999px;
  background: var(--memo-card-strong);
  color: #8f5a17;
  padding: 0.28rem 0.68rem;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
}

.memo-export-select__action:hover:not(:disabled) {
  border-color: rgba(217, 119, 6, 0.35);
  background: rgba(245, 158, 11, 0.1);
}

.memo-export-select__action:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.memo-export-select__empty {
  margin: 0;
  border: 1px dashed rgba(191, 122, 23, 0.24);
  border-radius: 12px;
  padding: 0.85rem;
  color: #9a7a52;
  font-size: 0.84rem;
  text-align: center;
}

.memo-export-select__list {
  max-height: 260px;
  margin: 0;
  padding: 0;
  list-style: none;
  overflow-y: auto;
  border: 1px solid rgba(191, 122, 23, 0.18);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.62);
}

.memo-export-select__item {
  min-height: 58px;
  padding: 0.62rem 0.7rem;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  cursor: pointer;
  transition: background 0.15s;
}

.memo-export-select__list > li + li .memo-export-select__item {
  border-top: 1px solid rgba(191, 122, 23, 0.14);
}

.memo-export-select__item:hover,
.memo-export-select__item.is-selected {
  background: rgba(245, 158, 11, 0.1);
}

.memo-export-select__item input {
  width: 1rem;
  height: 1rem;
  flex: 0 0 auto;
  accent-color: var(--memo-amber);
}

.memo-export-select__content {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.18rem;
}

.memo-export-select__title {
  color: #4a2b09;
  font-size: 0.88rem;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.memo-export-select__meta {
  color: #9a7a52;
  font-size: 0.75rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.memo-export-actions {
  display: flex;
  gap: 0.55rem;
}

/* ============================================================
   Custom Select component (MemoSelect)
   ============================================================ */
.memo-select {
  position: relative;
  display: inline-block;
}

.memo-select--full {
  display: block;
  width: 100%;
}

.memo-select__trigger {
  width: 100%;
  min-height: 42px;
  border-radius: 12px;
  border: 1px solid rgba(191, 122, 23, 0.24);
  background: var(--memo-card-strong);
  color: var(--memo-text);
  font: inherit;
  font-size: 0.9rem;
  padding: 0.52rem 0.78rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
  white-space: nowrap;
}

.memo-select__trigger:hover:not(:disabled) {
  border-color: rgba(217, 119, 6, 0.45);
  background: rgba(255, 255, 255, 1);
}

.memo-select.is-open .memo-select__trigger {
  border-color: var(--memo-amber);
  box-shadow: 0 0 0 3px rgba(217, 119, 6, 0.12);
}

.memo-select.is-disabled .memo-select__trigger {
  opacity: 0.55;
  cursor: not-allowed;
}

.memo-select__label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.memo-select__chevron {
  flex-shrink: 0;
  font-size: 0.72rem;
  color: #8f5a17;
  transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.memo-select.is-open .memo-select__chevron {
  transform: rotate(180deg);
}

/* Small variant (bulk bar) */
.memo-select--sm .memo-select__trigger {
  min-height: 34px;
  font-size: 0.82rem;
  padding: 0.3rem 0.62rem;
  border-radius: 8px;
}

/* Menu – rendered at document.body via portal, position set inline */
.memo-select__menu {
  margin: 0;
  padding: 0.38rem;
  list-style: none;
  background: rgba(255, 251, 240, 0.98);
  border: 1px solid rgba(217, 119, 6, 0.18);
  border-radius: 14px;
  box-shadow:
    0 16px 40px rgba(15, 23, 42, 0.16),
    0 4px 10px rgba(217, 119, 6, 0.08);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  animation: memo-select-drop 0.14s ease;
}

@keyframes memo-select-drop {
  from { opacity: 0; transform: translateY(-5px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0)    scale(1);    }
}

.memo-select__option {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.6rem 0.75rem;
  border-radius: 9px;
  font-size: 0.88rem;
  color: var(--memo-text);
  cursor: pointer;
  transition: background 0.1s;
  user-select: none;
  white-space: nowrap;
}

.memo-select__option:hover {
  background: rgba(217, 119, 6, 0.09);
  color: #92400e;
}

.memo-select__option.is-selected {
  background: rgba(217, 119, 6, 0.11);
  color: #92400e;
  font-weight: 700;
}

.memo-select__check {
  font-size: 0.82rem;
  color: var(--memo-amber);
  flex-shrink: 0;
}

/* ============================================================
   Dark mode additions
   ============================================================ */
[data-theme="dark"] .memo-toolbar__icon-btn,
[data-theme="dark"] .memo-filter-chip,
[data-theme="dark"] .memo-toolbar__search-clear,
[data-theme="dark"] .memo-bulk-btn,
[data-theme="dark"] .memo-collection-chip,
[data-theme="dark"] .memo-response-tab,
[data-theme="dark"] .memo-export-format-option,
[data-theme="dark"] .memo-export-scope-option,
[data-theme="dark"] .memo-export-select__action {
  background: rgba(15, 23, 42, 0.72);
  border-color: rgba(148, 163, 184, 0.24);
  color: #fbbf24;
}

[data-theme="dark"] .memo-export-select__list,
[data-theme="dark"] .memo-export-select__empty {
  background: rgba(15, 23, 42, 0.48);
  border-color: rgba(148, 163, 184, 0.24);
}

[data-theme="dark"] .memo-export-select__list > li + li .memo-export-select__item {
  border-top-color: rgba(148, 163, 184, 0.18);
}

[data-theme="dark"] .memo-export-select__item:hover,
[data-theme="dark"] .memo-export-select__item.is-selected {
  background: rgba(251, 191, 36, 0.12);
}

[data-theme="dark"] .memo-export-select__title {
  color: #f8fafc;
}

[data-theme="dark"] .memo-export-select__meta,
[data-theme="dark"] .memo-export-select__empty {
  color: #cbd5e1;
}

[data-theme="dark"] .memo-preview-pane {
  background: rgba(15, 23, 42, 0.72);
  border-color: rgba(148, 163, 184, 0.25);
  color: #f8fafc;
}

[data-theme="dark"] .memo-modal__preview-pane {
  background: transparent;
  border: none;
}

[data-theme="dark"] .memo-sidebar {
  background: rgba(15, 23, 42, 0.92);
  border-color: rgba(148, 163, 184, 0.14);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3), 0 6px 20px rgba(0, 0, 0, 0.24);
}

[data-theme="dark"] .memo-sidebar-header {
  border-bottom-color: rgba(148, 163, 184, 0.1);
}

[data-theme="dark"] .memo-sidebar-title {
  color: #e2e8f0;
}

[data-theme="dark"] .memo-sidebar-toggle {
  color: #94a3b8;
}

[data-theme="dark"] .memo-sidebar-toggle:hover {
  background: rgba(245, 158, 11, 0.18);
  color: #fbbf24;
}

[data-theme="dark"] .memo-sidebar-nav__item {
  color: #cbd5e1;
}

[data-theme="dark"] .memo-sidebar-nav__item:hover {
  background: rgba(245, 158, 11, 0.14);
  color: #fbbf24;
}

[data-theme="dark"] .memo-sidebar-nav__item.is-active {
  background: rgba(245, 158, 11, 0.18);
  color: #fbbf24;
}

[data-theme="dark"] .memo-sidebar-divider {
  background: rgba(148, 163, 184, 0.1);
}

[data-theme="dark"] .memo-sidebar-section__title {
  color: #64748b;
}

[data-theme="dark"] .memo-sidebar-collection-item {
  color: #94a3b8;
}

[data-theme="dark"] .memo-sidebar-collection-item:hover {
  background: rgba(245, 158, 11, 0.12);
  color: #cbd5e1;
}

[data-theme="dark"] .memo-sidebar-collection-item.is-active {
  background: rgba(245, 158, 11, 0.18);
  color: #fbbf24;
}

[data-theme="dark"] .memo-sidebar-collection-count {
  background: rgba(255, 255, 255, 0.08);
  color: #64748b;
}

[data-theme="dark"] .memo-sidebar-collection-item.is-active .memo-sidebar-collection-count {
  background: rgba(245, 158, 11, 0.22);
  color: #fbbf24;
}

[data-theme="dark"] .memo-sidebar-collection-empty {
  color: #475569;
}

[data-theme="dark"] .memo-sidebar-manage-btn {
  color: #64748b;
}

[data-theme="dark"] .memo-sidebar-manage-btn:hover {
  background: rgba(245, 158, 11, 0.12);
  color: #fbbf24;
}

[data-theme="dark"] .memo-collection-modal__content,
[data-theme="dark"] .memo-export-modal__content {
  background: rgba(15, 23, 42, 0.94);
  border-color: rgba(148, 163, 184, 0.18);
}

[data-theme="dark"] .memo-collection-create,
[data-theme="dark"] .memo-collection-item {
  background: rgba(30, 41, 59, 0.8);
  border-color: rgba(148, 163, 184, 0.2);
}

[data-theme="dark"] .memo-collection-modal__header h3,
[data-theme="dark"] .memo-export-modal__header h3,
[data-theme="dark"] .memo-collection-item__name {
  color: #fbbf24;
}

[data-theme="dark"] .memo-collection-modal__close,
[data-theme="dark"] .memo-export-modal__close,
[data-theme="dark"] .memo-collection-item__action {
  background: rgba(15, 23, 42, 0.72);
  border-color: rgba(148, 163, 184, 0.24);
  color: #fbbf24;
}

[data-theme="dark"] .memo-ai-suggest-btn {
  background: rgba(124, 58, 237, 0.18);
  border-color: rgba(139, 92, 246, 0.4);
  color: #a78bfa;
}

[data-theme="dark"] .memo-collection-badge {
  background: color-mix(in srgb, var(--badge-color, #6b7280) 22%, rgba(15, 23, 42, 0.6));
  border-color: color-mix(in srgb, var(--badge-color, #6b7280) 40%, transparent);
}

[data-theme="dark"] .memo-bulk-bar {
  background: rgba(15, 23, 42, 0.88);
  border-color: rgba(148, 163, 184, 0.18);
}

[data-theme="dark"] .memo-bulk-bar__count {
  color: #fbbf24;
}

[data-theme="dark"] .memo-toolbar__count {
  background: rgba(15, 23, 42, 0.58);
  border-color: rgba(148, 163, 184, 0.2);
  color: #cbd5e1;
}

[data-theme="dark"] .memo-panel__count {
  background: rgba(15, 23, 42, 0.58);
  border-color: rgba(148, 163, 184, 0.2);
  color: #cbd5e1;
}

[data-theme="dark"] .memo-panel__header h2 i {
  color: #fbbf24;
}

[data-theme="dark"] .memo-toolbar__search:focus-within {
  background: rgba(15, 23, 42, 0.84);
  border-color: rgba(251, 191, 36, 0.42);
  box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.1);
}

[data-theme="dark"] .memo-toolbar__icon-btn.is-active,
[data-theme="dark"] .memo-filter-chip.is-active,
[data-theme="dark"] .memo-collection-chip.is-active,
[data-theme="dark"] .memo-response-tab.is-active,
[data-theme="dark"] .memo-export-format-option.is-active,
[data-theme="dark"] .memo-export-scope-option.is-active {
  background: linear-gradient(135deg, var(--memo-amber) 0%, var(--memo-amber-strong) 100%);
  color: #fffdf8;
  border-color: transparent;
}

[data-theme="dark"] .memo-toolbar__search-clear:hover {
  background: rgba(251, 191, 36, 0.14);
  border-color: transparent;
}

[data-theme="dark"] .memo-sort-control > i,
[data-theme="dark"] .memo-sort-control__select > i {
  color: #fbbf24;
}

/* ============================================================
   Responsive additions
   ============================================================ */
@media (max-width: 768px) {
  .memo-toolbar__top-row {
    gap: 0.65rem;
  }

  .memo-toolbar__actions {
    width: auto;
    margin-left: auto;
  }

  .memo-toolbar__icon-btn {
    width: 40px;
    height: 40px;
    min-height: 40px;
    flex: 0 0 40px;
  }

  .memo-export-formats {
    grid-template-columns: 1fr;
  }

  .memo-export-scope {
    grid-template-columns: 1fr;
  }

  .memo-bulk-bar {
    flex-direction: column;
    align-items: flex-start;
  }

  .memo-bulk-bar__actions {
    width: 100%;
  }

  .memo-collection-modal__content,
  .memo-export-modal__content {
    max-height: 92vh;
    overflow-y: auto;
  }
}

@media (max-width: 1024px) {
  .memo-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .memo-page-shell {
    padding: 0.8rem;
  }

  .memo-auth-bar {
    padding: 0 0 0.8rem;
  }

  .memo-container {
    padding: 0 0 2rem;
  }

  .memo-crawl-summary {
    grid-template-columns: 1fr;
  }

  .memo-toolbar {
    padding: 0.85rem;
    border-radius: 16px;
  }

  .memo-toolbar__filters {
    grid-template-columns: 1fr;
  }

  .memo-filter-chips {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .memo-filter-chips::-webkit-scrollbar {
    display: none;
  }

  .memo-sort-control {
    min-width: 0;
  }

  .memo-panel__header {
    align-items: flex-start;
  }

  .memo-panel__heading {
    flex-wrap: wrap;
  }

  .memo-panel__count {
    flex-shrink: 0;
  }

  .memo-mobile-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.48rem;
  }

  .memo-mobile-tabs button {
    min-height: 40px;
    border: 1px solid rgba(191, 122, 23, 0.22);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.9);
    color: #8f5a17;
    font-weight: 700;
    cursor: pointer;
  }

  .memo-mobile-tabs button.is-active {
    background: linear-gradient(135deg, var(--memo-amber) 0%, var(--memo-amber-strong) 100%);
    color: #fffdf8;
    border-color: transparent;
  }

  .memo-grid.show-list .memo-compose-panel {
    display: none;
  }

  .memo-grid.show-compose .memo-history-panel {
    display: none;
  }

  .memo-modal__edit-grid,
  .memo-modal__body {
    grid-template-columns: 1fr;
  }

  .memo-modal__title-row {
    flex-direction: column;
    padding-right: 3rem;
    gap: 0.55rem;
  }

  /* Give the memo body as much horizontal room as possible on phones:
     shrink the outer gutter and the inner header/body padding. */
  .memo-modal {
    padding: 0.35rem;
  }

  .memo-modal__content {
    height: calc(100dvh - 0.7rem);
    max-height: calc(100dvh - 0.7rem);
    border-radius: 14px;
  }

  .memo-modal__header {
    padding-left: 0.6rem;
    padding-right: 0.6rem;
  }

  .memo-modal__body {
    padding-left: 0.55rem;
    padding-right: 0.55rem;
  }

  .memo-modal__header-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .memo-modal__edit-btn {
    align-self: flex-start;
  }

  .memo-modal__autosave-status {
    align-self: flex-start;
    max-width: 100%;
  }

  .memo-item__actions {
    gap: 0.15rem;
    opacity: 1;
    transform: none;
  }

  .memo-item__pin {
    opacity: 1;
    transform: none;
  }

  .memo-history__list {
    columns: 200px;
    column-gap: 0.7rem;
  }

  .memo-history__list > li {
    margin-bottom: 0.7rem;
  }

  .memo-share-modal__sns {
    grid-template-columns: 1fr;
  }
}

[data-theme="dark"] body.memo-page {
  --memo-amber: #f59e0b;
  --memo-amber-strong: #d97706;
  --memo-amber-soft: rgba(245, 158, 11, 0.2);
  --memo-border: rgba(148, 163, 184, 0.14);
  --memo-text: #f8fafc;
  --memo-text-muted: #94a3b8;
  --memo-card: rgba(15, 23, 42, 0.84);
  --memo-card-strong: rgba(30, 41, 59, 0.96);
  --memo-shadow: 0 20px 56px rgba(0, 0, 0, 0.44);
  background: #0f172a;
}

[data-theme="dark"] .memo-page-shell {
  background: radial-gradient(ellipse 1100px 650px at 8% 6%, rgba(245, 158, 11, 0.08), transparent),
    radial-gradient(ellipse 820px 540px at 94% 8%, rgba(251, 191, 36, 0.08), transparent),
    linear-gradient(180deg, #0f172a 0%, #020617 100%);
}

[data-theme="dark"] .memo-toolbar__title h1,
[data-theme="dark"] .memo-crawl-summary h2,
[data-theme="dark"] .memo-panel__header h2,
[data-theme="dark"] .memo-item__title,
[data-theme="dark"] .memo-modal__header h3,
[data-theme="dark"] .memo-share-modal__header h3 {
  color: #fbbf24;
}

[data-theme="dark"] .memo-crawl-summary {
  border-color: var(--memo-border);
  background: var(--memo-card);
  box-shadow: var(--memo-shadow);
}

[data-theme="dark"] .memo-crawl-summary p {
  color: var(--memo-text-muted);
}

[data-theme="dark"] .memo-crawl-summary__eyebrow,
[data-theme="dark"] .memo-crawl-summary__list i {
  color: #fbbf24;
}

[data-theme="dark"] .memo-control,
[data-theme="dark"] .memo-share-modal__body input {
  background: rgba(15, 23, 42, 0.72);
  border-color: rgba(148, 163, 184, 0.25);
  color: #f8fafc;
  box-shadow: none;
}

[data-theme="dark"] .memo-share-modal__sns a,
[data-theme="dark"] .memo-modal__close,
[data-theme="dark"] .memo-share-modal__close,
[data-theme="dark"] .memo-modal__edit-btn,
[data-theme="dark"] .memo-modal__icon-btn,
[data-theme="dark"] .memo-modal__autosave-status,
[data-theme="dark"] .secondary-button,
[data-theme="dark"] .memo-toolbar__clear {
  background: rgba(15, 23, 42, 0.72);
  border-color: rgba(148, 163, 184, 0.24);
  color: #fbbf24;
}

[data-theme="dark"] .memo-item__action,
[data-theme="dark"] .memo-item__pin {
  background: transparent;
  color: #cbd5e1;
  border: none;
}

[data-theme="dark"] .memo-item__action:hover:not(:disabled),
[data-theme="dark"] .memo-item__pin:hover {
  background: rgba(248, 250, 252, 0.1);
  color: #f8fafc;
}

[data-theme="dark"] .memo-item__pin.is-pinned {
  color: #fbbf24;
}

[data-theme="dark"] .memo-item__pin.is-pinned:hover {
  background: rgba(245, 158, 11, 0.2);
  color: #fde68a;
}

[data-theme="dark"] .memo-item__action.is-active {
  background: rgba(245, 158, 11, 0.2);
  color: #fde68a;
}

[data-theme="dark"] .memo-item.is-pinned {
  background:
    linear-gradient(180deg, rgba(245, 158, 11, 0.16) 0%, var(--memo-card-strong) 80%);
  border-color: rgba(245, 158, 11, 0.45);
}

[data-theme="dark"] .memo-item__title {
  color: #f1f5f9;
}

[data-theme="dark"] .memo-item__excerpt {
  color: #94a3b8;
}

[data-theme="dark"] .memo-item__date {
  color: #94a3b8;
}

[data-theme="dark"] .memo-history__section-label {
  color: #94a3b8;
}

[data-theme="dark"] .memo-history__section-label i {
  color: #fbbf24;
}

[data-theme="dark"] .memo-history-panel {
  background: rgba(15, 23, 42, 0.6);
}

[data-theme="dark"] .memo-modal__autosave-status--saving,
[data-theme="dark"] .memo-modal__autosave-status--saved {
  color: #5eead4;
  border-color: rgba(45, 212, 191, 0.28);
}

[data-theme="dark"] .memo-modal__autosave-status--error {
  color: #fca5a5;
  border-color: rgba(248, 113, 113, 0.34);
  background: rgba(127, 29, 29, 0.28);
}

[data-theme="dark"] .memo-share-modal__close:hover,
[data-theme="dark"] .memo-share-modal__sns a:hover {
  background: rgba(30, 41, 59, 1);
  border-color: rgba(245, 158, 11, 0.34);
  color: #fde68a;
}

[data-theme="dark"] .memo-share-modal__meta span {
  background: rgba(15, 23, 42, 0.72);
  border-color: rgba(148, 163, 184, 0.2);
  color: #fcd34d;
}

[data-theme="dark"] .memo-item__action.is-copied {
  border-color: rgba(45, 212, 191, 0.36);
  background: rgba(20, 184, 166, 0.14);
  color: #5eead4;
}

[data-theme="dark"] .memo-item__dropdown {
  background: rgba(15, 23, 42, 0.97);
  border-color: rgba(148, 163, 184, 0.22);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .memo-item__dropdown-item {
  color: #fbbf24;
}

[data-theme="dark"] .memo-item__dropdown-item:hover {
  background: rgba(251, 191, 36, 0.1);
}

[data-theme="dark"] .memo-item__dropdown-item.is-active {
  color: #fcd34d;
  background: rgba(251, 191, 36, 0.12);
}

[data-theme="dark"] .memo-item__dropdown-item--danger {
  color: #f87171;
}

[data-theme="dark"] .memo-item__dropdown-item--danger:hover {
  background: rgba(248, 113, 113, 0.12);
}

[data-theme="dark"] .memo-item__dropdown-divider {
  background: rgba(148, 163, 184, 0.18);
}

[data-theme="dark"] .memo-modal__edit-fields label {
  color: #fbbf24;
}

[data-theme="dark"] .memo-history__empty {
  background: rgba(30, 41, 59, 0.52);
  border-color: rgba(148, 163, 184, 0.24);
}

[data-theme="dark"] .memo-modal__content,
[data-theme="dark"] .memo-share-modal__content {
  background: rgba(15, 23, 42, 0.92);
  border-color: rgba(148, 163, 184, 0.18);
}

[data-theme="dark"] .memo-modal__meta-panel {
  background: rgba(15, 23, 42, 0.6);
  border-color: rgba(148, 163, 184, 0.18);
}

[data-theme="dark"] .memo-item {
  background: rgba(30, 41, 59, 0.85);
  border-color: rgba(148, 163, 184, 0.22);
}

[data-theme="dark"] .memo-item.has-accent {
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--memo-card-accent) 22%, rgba(30, 41, 59, 0.9)) 0%, rgba(30, 41, 59, 0.92) 70%);
  border-color: color-mix(in srgb, var(--memo-card-accent) 38%, rgba(148, 163, 184, 0.28));
}

[data-theme="dark"] .memo-item:hover {
  border-color: rgba(148, 163, 184, 0.42);
  box-shadow:
    0 1px 2px 0 rgba(0, 0, 0, 0.4),
    0 4px 12px 2px rgba(0, 0, 0, 0.36);
}

[data-theme="dark"] .memo-share-modal__content {
  background:
    radial-gradient(circle at top right, rgba(245, 158, 11, 0.12), transparent 34%),
    rgba(15, 23, 42, 0.92);
}

[data-theme="dark"] .memo-select__trigger {
  background: rgba(15, 23, 42, 0.72);
  border-color: rgba(148, 163, 184, 0.25);
  color: #f8fafc;
}

[data-theme="dark"] .memo-select__trigger:hover:not(:disabled) {
  background: rgba(30, 41, 59, 0.9);
  border-color: rgba(245, 158, 11, 0.4);
}

[data-theme="dark"] .memo-select.is-open .memo-select__trigger {
  border-color: #f59e0b;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.12);
}

[data-theme="dark"] .memo-select__chevron {
  color: #fbbf24;
}

[data-theme="dark"] .memo-select__menu {
  background: rgba(15, 23, 42, 0.96);
  border-color: rgba(148, 163, 184, 0.2);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.42);
}

[data-theme="dark"] .memo-select__option {
  color: #f8fafc;
}

[data-theme="dark"] .memo-select__option:hover {
  background: rgba(245, 158, 11, 0.1);
  color: #fbbf24;
}

[data-theme="dark"] .memo-select__option.is-selected {
  background: rgba(245, 158, 11, 0.13);
  color: #fbbf24;
}

[data-theme="dark"] .memo-select__check {
  color: #f59e0b;
}

[data-theme="dark"] .memo-item__archive-badge {
  color: #94a3b8;
  background: rgba(148, 163, 184, 0.1);
  border-color: rgba(148, 163, 184, 0.22);
}

[data-theme="dark"] .memo-modal__body,
[data-theme="dark"] .memo-collection-modal__body {
  scrollbar-color: rgba(245, 158, 11, 0.48) transparent;
}

[data-theme="dark"] .memo-modal__body::-webkit-scrollbar-thumb,
[data-theme="dark"] .memo-collection-modal__body::-webkit-scrollbar-thumb {
  background: linear-gradient(
    180deg,
    rgba(245, 158, 11, 0.48) 0%,
    rgba(217, 119, 6, 0.48) 100%
  );
  border-color: rgba(15, 23, 42, 0.82);
}

[data-theme="dark"] .memo-modal__body::-webkit-scrollbar-thumb:hover,
[data-theme="dark"] .memo-collection-modal__body::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(
    180deg,
    rgba(245, 158, 11, 0.7) 0%,
    rgba(217, 119, 6, 0.7) 100%
  );
}

[data-theme="dark"] .memo-modal__body::-webkit-scrollbar-thumb:active,
[data-theme="dark"] .memo-collection-modal__body::-webkit-scrollbar-thumb:active {
  background: linear-gradient(180deg, #f59e0b 0%, #d97706 100%);
}

/* ============================================================
   Google Keep-inspired card memo UI
   ============================================================ */
body.memo-page {
  --memo-amber: #fbbc04;
  --memo-amber-strong: #f9ab00;
  --memo-amber-soft: rgba(251, 188, 4, 0.18);
  --memo-border: #dadce0;
  --memo-text: #202124;
  --memo-text-muted: #5f6368;
  --memo-card: #ffffff;
  --memo-card-strong: #ffffff;
  --memo-shadow: 0 1px 2px rgba(60, 64, 67, 0.3), 0 1px 3px 1px rgba(60, 64, 67, 0.15);
  background: #fff;
  color: var(--memo-text);
  font-family: var(--font-app-sans), Arial, "Segoe UI", sans-serif;
}

.memo-page-shell {
  min-height: 100vh;
  padding: 0;
  background: #fff;
}

.memo-auth-bar {
  width: 100%;
  padding: 0.5rem 1.5rem 0;
}

.memo-container {
  width: 100%;
  max-width: none;
  padding: 0 0 3rem;
  gap: 0;
}

.memo-card {
  border: 1px solid var(--memo-border);
  border-radius: 8px;
  background: var(--memo-card);
  box-shadow: none;
  backdrop-filter: none;
}

.memo-toolbar.memo-card {
  position: sticky;
  top: 0.6rem;
  z-index: 60;
  width: min(72rem, calc(100% - 2rem));
  margin: 0 auto;
  border: 1px solid rgba(217, 119, 6, 0.12);
  border-radius: 18px;
  padding: 0.7rem 0.95rem;
  background: rgba(255, 255, 255, 0.72);
  -webkit-backdrop-filter: blur(18px) saturate(180%);
  backdrop-filter: blur(18px) saturate(180%);
  box-shadow:
    0 1px 1px rgba(60, 64, 67, 0.04),
    0 2px 8px rgba(15, 23, 42, 0.05),
    0 14px 32px -14px rgba(180, 83, 9, 0.28);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "brand actions"
    "search search"
    "filters collections";
  align-items: center;
  column-gap: 1rem;
  row-gap: 0.65rem;
  transition: box-shadow 0.25s ease, border-color 0.25s ease, background 0.25s ease;
}

.memo-toolbar__top-row {
  display: contents;
}

.memo-toolbar__brand {
  grid-area: brand;
  display: flex;
  align-items: center;
  gap: 0.62rem;
  min-width: 0;
}

.memo-toolbar__app-mark {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.12rem;
  flex: 0 0 auto;
}

.memo-toolbar__title {
  min-width: 0;
  gap: 0.35rem;
}

.memo-toolbar__title h1 {
  color: #2b2017;
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: -0.012em;
  line-height: 1.2;
}

.memo-toolbar__count,
.memo-panel__count {
  min-height: 24px;
  border: 1px solid rgba(217, 119, 6, 0.2);
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.14), rgba(217, 119, 6, 0.08));
  color: #b45309;
  padding: 0.16rem 0.62rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.memo-toolbar__actions {
  grid-area: actions;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.32rem;
  min-width: 0;
  flex-wrap: nowrap;
}

.memo-toolbar__icon-btn {
  width: 40px;
  height: 40px;
  min-height: 40px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: #5f6368;
  font-size: 1.05rem;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease, transform 0.12s ease;
}

.memo-toolbar__action-btn {
  width: auto;
  min-width: 0;
  border-radius: 999px;
  padding: 0 0.72rem;
}

.memo-toolbar__action-label {
  display: inline;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  color: inherit;
  font-size: 0.82rem;
  font-weight: 700;
}

.memo-toolbar__icon-btn:hover {
  background: rgba(217, 119, 6, 0.1);
  border-color: rgba(217, 119, 6, 0.2);
  color: #b45309;
}

.memo-toolbar__icon-btn:active {
  transform: scale(0.93);
}

.memo-toolbar__icon-btn.is-active {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.2), rgba(217, 119, 6, 0.12));
  color: #b45309;
  border-color: rgba(217, 119, 6, 0.3);
}

/* Collapsible search/filter region: flows into the toolbar grid on desktop. */
.memo-toolbar__collapsible {
  display: contents;
}

/* The collapse toggle is only used on narrow screens. */
.memo-toolbar__filter-toggle {
  display: none;
  position: relative;
}

.memo-toolbar__filter-toggle.has-active-filters::after {
  content: "";
  position: absolute;
  top: 7px;
  right: 7px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #fbbc04;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.96);
}

.memo-toolbar__search {
  grid-area: search;
  width: clamp(13rem, 22vw, 20rem);
  min-height: 42px;
  border: 1px solid rgba(60, 64, 67, 0.14);
  border-radius: 12px;
  padding: 0.5rem 0.85rem;
  background: rgba(248, 250, 253, 0.9);
  box-shadow: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.memo-toolbar__search:focus-within {
  background: #fff;
  border-color: rgba(217, 119, 6, 0.55);
  box-shadow: 0 0 0 3px rgba(217, 119, 6, 0.14);
}

.memo-toolbar__search > i,
.memo-sort-control__select > i {
  color: #5f6368;
}

.memo-toolbar__search input::placeholder {
  color: #5f6368;
}

.memo-toolbar__filters {
  grid-area: filters;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  margin: 0;
  gap: 0.56rem 0.75rem;
  min-width: 0;
}

.memo-filter-group,
.memo-sort-control {
  display: flex;
  align-items: center;
  gap: 0.42rem;
  min-width: 0;
}

.memo-filter-group__label,
.memo-sort-control__label,
.memo-toolbar__collections-label {
  color: #5f6368;
  font-size: 0.76rem;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

.memo-filter-chips {
  align-items: center;
}

.memo-filter-chip,
.memo-collection-chip,
.memo-bulk-btn,
.memo-response-tab {
  min-height: 30px;
  border-color: #dadce0;
  background: #fff;
  color: #3c4043;
  border-radius: 999px;
  padding: 0.2rem 0.56rem;
  font-size: 0.78rem;
  font-weight: 600;
}

.memo-filter-chip:hover,
.memo-collection-chip:hover,
.memo-bulk-btn:hover:not(:disabled),
.memo-response-tab:hover:not(:disabled) {
  background: #f8fafd;
  border-color: #bdc1c6;
}

.memo-filter-chip.is-active,
.memo-collection-chip.is-active,
.memo-response-tab.is-active {
  background: rgba(217, 119, 6, 0.1);
  color: #b45309;
  border-color: rgba(217, 119, 6, 0.34);
}

.memo-sort-control__select {
  position: relative;
  min-width: 10rem;
}

.memo-sort-control__select > i {
  position: absolute;
  top: 50%;
  left: 0.72rem;
  z-index: 1;
  transform: translateY(-50%);
  pointer-events: none;
}

.memo-sort-control__select .memo-select {
  width: 100%;
}

.memo-toolbar__collections {
  grid-area: collections;
  display: flex;
  align-items: center;
  margin: 0;
  justify-content: flex-end;
  gap: 0.42rem;
  min-width: 0;
}

.memo-collection-chip {
  min-height: 28px;
  padding: 0.16rem 0.56rem;
}

.memo-toolbar .memo-select__trigger {
  min-height: 32px;
  padding-block: 0.3rem;
  font-size: 0.82rem;
}

.memo-toolbar .memo-sort-control .memo-select__trigger {
  padding-left: 1.8rem;
}

.memo-collection-chip.is-active {
  background: color-mix(in srgb, var(--badge-color, #fbbc04) 22%, #fff);
  border-color: var(--badge-color, #fbbc04);
}

.memo-collection-chip.is-drop-target {
  border-color: var(--badge-color, #fbbc04);
  background: color-mix(in srgb, var(--badge-color, #fbbc04) 22%, #fff);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--badge-color, #fbbc04) 24%, transparent);
}

.memo-flash {
  width: min(42rem, calc(100% - 2rem));
  margin: 1rem auto 0;
  border-radius: 8px;
}

.memo-bulk-bar.memo-card {
  width: min(72rem, calc(100% - 3rem));
  margin: 1rem auto 0;
  border-radius: 8px;
  box-shadow: var(--memo-shadow);
}

/* ── Quick capture (Google Keep–inspired) ── */
.memo-quick-capture {
  width: min(38rem, calc(100% - 2rem));
  margin: 1.5rem auto 1.75rem;
  padding: 0;
  overflow: visible;
  border-radius: 10px;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow:
    0 1px 2px rgba(60, 64, 67, 0.08),
    0 1px 3px 1px rgba(60, 64, 67, 0.06);
  transition:
    box-shadow 220ms cubic-bezier(0.2, 0, 0, 1),
    border-color 220ms cubic-bezier(0.2, 0, 0, 1),
    transform 220ms cubic-bezier(0.2, 0, 0, 1);
}

.memo-quick-capture:hover:not(.is-expanded) {
  box-shadow:
    0 1px 3px rgba(60, 64, 67, 0.12),
    0 4px 8px 3px rgba(60, 64, 67, 0.08);
}

.memo-quick-capture.is-expanded {
  border-color: rgba(0, 0, 0, 0.08);
  box-shadow:
    0 1px 2px rgba(60, 64, 67, 0.1),
    0 2px 6px 2px rgba(60, 64, 67, 0.12);
}

.memo-quick-capture__collapsed {
  width: 100%;
  min-height: 46px;
  border-radius: 10px;
  background: transparent;
  color: #5f6368;
  padding: 0.5rem 0.75rem 0.5rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  font: inherit;
  font-size: 0.98rem;
  font-weight: 600;
  text-align: left;
  cursor: text;
  letter-spacing: 0.01em;
  transition:
    color 160ms ease,
    transform 120ms ease;
  animation: memo-quick-capture-collapsed-mount 260ms cubic-bezier(0.2, 0, 0, 1);
}

.memo-quick-capture__text-button {
  min-width: 0;
  min-height: 36px;
  flex: 1 1 auto;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: inherit;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  font: inherit;
  font-weight: inherit;
  text-align: left;
  cursor: text;
}

.memo-quick-capture__text-button:hover,
.memo-quick-capture__text-button:focus-visible {
  background: transparent;
  color: #3c4043;
}

@keyframes memo-quick-capture-collapsed-mount {
  from {
    opacity: 0;
    transform: translateY(-2px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.memo-quick-capture__collapsed:active {
  transform: scale(0.995);
}

.memo-quick-capture__text-button span {
  transition: transform 220ms cubic-bezier(0.2, 0, 0, 1);
}

.memo-quick-capture__text-button:hover span {
  transform: translateX(2px);
}

.memo-quick-capture__shortcuts {
  display: inline-flex;
  gap: 0.15rem;
  color: #5f6368;
}

.memo-quick-capture__shortcut-btn {
  width: 36px;
  height: 36px;
  min-width: 36px;
  min-height: 36px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: #5f6368;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition:
    background-color 160ms ease,
    transform 160ms ease,
    color 160ms ease;
}

.memo-quick-capture__shortcut-btn i {
  color: currentColor !important;
  opacity: 1;
  visibility: visible;
  font-size: 1rem;
  line-height: 1;
}

.memo-quick-capture__collapsed:hover .memo-quick-capture__shortcut-btn {
  background: rgba(60, 64, 67, 0.08);
}

.memo-quick-capture__shortcut-btn:hover,
.memo-quick-capture__shortcut-btn:focus-visible {
  background: rgba(60, 64, 67, 0.14);
  color: #202124;
  transform: scale(1.05);
  outline: none;
}

.memo-quick-capture__shortcut-btn:active {
  transform: scale(0.95);
}

/* Expanded form */
.memo-form--quick {
  gap: 0;
  padding: 0.25rem 0 0;
  overflow: hidden;
  background: var(--memo-compose-color, transparent);
  transform-origin: top center;
  animation: memo-quick-capture-open 360ms cubic-bezier(0.2, 0, 0, 1);
}

@keyframes memo-quick-capture-open {
  from {
    max-height: 46px;
    opacity: 0;
    filter: blur(2px);
  }
  60% {
    opacity: 1;
    filter: blur(0);
  }
  to {
    max-height: 640px;
    opacity: 1;
    filter: blur(0);
  }
}

.memo-form--quick .form-group {
  gap: 0;
}

.memo-form--quick .memo-control,
.memo-form--quick .memo-preview-pane {
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.memo-form--quick .memo-control:focus,
.memo-form--quick .memo-control:focus-visible {
  outline: none;
  box-shadow: none;
  background: transparent;
}

.memo-quick-capture__title-input {
  min-height: 44px;
  padding: 0.65rem 1rem 0.2rem;
  color: #202124;
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0.005em;
  animation: memo-quick-capture-slide-down 320ms cubic-bezier(0.2, 0, 0, 1) 40ms both;
}

@keyframes memo-quick-capture-slide-down {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.memo-quick-capture__title-input::placeholder {
  color: #80868b;
  font-weight: 500;
}

.memo-form--quick textarea.memo-control--response {
  min-height: 92px;
  max-height: 520px;
  padding: 0.55rem 1rem 0.85rem;
  color: #202124;
  line-height: 1.6;
  resize: none;
  overflow-y: auto;
  transition: height 200ms cubic-bezier(0.2, 0, 0, 1);
  animation: memo-quick-capture-fade-in 360ms cubic-bezier(0.2, 0, 0, 1) 60ms both;
}

.memo-form--quick textarea.memo-control--response::placeholder {
  color: #80868b;
}

.memo-quick-capture__response-header {
  padding: 0.1rem 0.6rem 0.1rem 0.85rem;
  justify-content: flex-end;
  animation: memo-quick-capture-fade-in 320ms cubic-bezier(0.2, 0, 0, 1) 140ms both;
}

@keyframes memo-quick-capture-fade-in {
  from { opacity: 0; transform: translateY(-2px); }
  to { opacity: 1; transform: translateY(0); }
}

.memo-form--quick .memo-preview-pane {
  min-height: 116px;
  max-height: 320px;
  padding: 0.35rem 1rem 0.85rem;
}

.memo-quick-capture__bottom-row {
  min-height: 48px;
  border-top: 1px solid transparent;
  padding: 0.5rem 0.6rem 0.5rem 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  animation: memo-quick-capture-slide-up 360ms cubic-bezier(0.2, 0, 0, 1) 100ms both;
}

@keyframes memo-quick-capture-slide-up {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.memo-select--quick {
  width: min(14rem, 100%);
  flex: 0 1 14rem;
}

.memo-compose-palette {
  position: relative;
  display: inline-flex;
  flex: 0 0 auto;
}

.memo-compose-palette__trigger {
  width: 36px;
  height: 36px;
  min-width: 36px;
  min-height: 36px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: #3c4043;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition:
    background-color 160ms ease,
    color 160ms ease,
    transform 120ms ease;
}

.memo-compose-palette__trigger i {
  color: currentColor !important;
  opacity: 1;
  visibility: visible;
  line-height: 1;
}

.memo-compose-palette__trigger:hover,
.memo-compose-palette__trigger:focus-visible,
.memo-compose-palette__trigger.is-active {
  background: rgba(60, 64, 67, 0.08);
  color: #202124;
  outline: none;
}

.memo-compose-palette__trigger:active {
  transform: scale(0.97);
}

.memo-compose-palette__menu {
  position: absolute;
  left: 0;
  bottom: calc(100% + 8px);
  z-index: 50;
  min-width: 13.5rem;
  max-width: min(18rem, 82vw);
  max-height: 16rem;
  overflow-y: auto;
  border: 1px solid rgba(191, 122, 23, 0.22);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 14px 34px rgba(60, 64, 67, 0.18);
  padding: 0.35rem;
  display: grid;
  gap: 0.15rem;
}

.memo-compose-palette__option {
  width: 100%;
  min-height: 36px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: #3c4043;
  padding: 0.38rem 0.5rem;
  display: inline-flex;
  align-items: center;
  gap: 0.48rem;
  font-size: 0.84rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}

.memo-compose-palette__option:hover,
.memo-compose-palette__option:focus-visible,
.memo-compose-palette__option.is-active {
  background: rgba(60, 64, 67, 0.08);
  color: #202124;
  outline: none;
}

.memo-compose-palette__swatch {
  width: 18px;
  height: 18px;
  border: 1px solid color-mix(in srgb, var(--palette-color, #6b7280) 55%, #111827);
  border-radius: 50%;
  background: var(--palette-color, #6b7280);
  flex: 0 0 auto;
}

.memo-compose-palette__swatch--empty {
  border-color: rgba(95, 99, 104, 0.3);
  background:
    linear-gradient(135deg, transparent 46%, rgba(95, 99, 104, 0.55) 47%, rgba(95, 99, 104, 0.55) 53%, transparent 54%),
    #fff;
}

.memo-select--quick .memo-select__trigger,
.memo-select--sm .memo-select__trigger {
  min-height: 34px;
  border-radius: 999px;
  transition:
    background-color 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease;
}

.memo-quick-capture__actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.primary-button,
.secondary-button,
.memo-ai-suggest-btn {
  min-height: 36px;
  border-radius: 999px;
  box-shadow: none;
  font-weight: 600;
  transition:
    background-color 160ms ease,
    color 160ms ease,
    box-shadow 160ms ease,
    transform 120ms ease;
}

.primary-button {
  background: #feefc3;
  color: #202124;
}

.primary-button:hover:not(:disabled) {
  background: #fde293;
  box-shadow: 0 1px 2px rgba(60, 64, 67, 0.12);
}

.primary-button:active:not(:disabled) {
  transform: scale(0.97);
}

.secondary-button,
.memo-ai-suggest-btn {
  border-color: transparent;
  background: transparent;
  color: #3c4043;
}

.secondary-button:hover:not(:disabled),
.memo-ai-suggest-btn:hover:not(:disabled) {
  background: rgba(60, 64, 67, 0.08);
  border-color: transparent;
}

.secondary-button:active:not(:disabled),
.memo-ai-suggest-btn:active:not(:disabled) {
  background: rgba(60, 64, 67, 0.14);
  transform: scale(0.97);
}

.memo-ai-suggest-btn.is-loading {
  color: #5f6368;
}

@media (prefers-reduced-motion: reduce) {
  .memo-quick-capture,
  .memo-quick-capture__collapsed,
  .memo-quick-capture__collapsed > span:first-child,
  .memo-quick-capture__shortcuts i,
  .primary-button,
  .secondary-button,
  .memo-ai-suggest-btn,
  .memo-form--quick textarea.memo-control--response {
    transition: none;
  }
  .memo-form--quick,
  .memo-quick-capture__collapsed,
  .memo-quick-capture__title-input,
  .memo-quick-capture__response-header,
  .memo-quick-capture__bottom-row {
    animation: none;
  }
}

.memo-board {
  width: min(78rem, calc(100% - 3rem));
  margin: 0 auto;
}

.memo-history-panel {
  padding: 0;
  background: transparent;
}

.memo-panel__header {
  margin: 0 0 0.65rem;
  padding: 0 0.25rem;
}

.memo-panel__header h2 {
  color: #5f6368;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.memo-panel__header h2 i {
  color: #5f6368;
}

.memo-panel__header p {
  display: none;
}

.memo-history__sections {
  overflow: visible;
  gap: 1.35rem;
  padding: 0;
  margin: 0;
}

.memo-history__section {
  gap: 0.65rem;
}

.memo-history__section-label {
  padding: 0 0.25rem;
  color: #5f6368;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
}

.memo-history__list {
  columns: 240px;
  column-gap: 0.85rem;
}

.memo-history__list > li {
  margin: 0 0 0.85rem;
}

.memo-history__list.is-drop-ready {
  outline: 2px dashed rgba(95, 99, 104, 0.22);
  outline-offset: 0.35rem;
  border-radius: 10px;
}

.memo-board--list .memo-history__list {
  width: min(42rem, 100%);
  margin: 0 auto;
  columns: auto;
}

.memo-board--list .memo-history__list > li {
  margin-bottom: 0.75rem;
}

.memo-board--list .memo-item {
  min-height: 0;
}

.memo-item {
  --memo-card-accent: #fff8b8;
  min-height: 8.75rem;
  border-color: #dadce0;
  border-radius: 8px;
  background: #fff;
  padding: 0.8rem 0.95rem 0.55rem;
  box-shadow: none;
  overflow: visible;
  transition:
    box-shadow 0.16s ease,
    border-color 0.16s ease,
    transform 0.22s cubic-bezier(0.2, 0.8, 0.2, 1);
  will-change: transform;
}

.memo-item.has-accent {
  background: var(--memo-card-strong);
  border-color: #dadce0;
}

.memo-item::before {
  display: none;
}

.memo-item:hover,
.memo-item:focus-within {
  border-color: transparent;
  box-shadow:
    0 1px 2px rgba(60, 64, 67, 0.3),
    0 2px 6px 2px rgba(60, 64, 67, 0.15);
}

.memo-item.is-pinned {
  background: var(--memo-card-strong);
  border-color: #dadce0;
}

.memo-item.is-pinned.has-accent {
  background: var(--memo-card-strong);
}

.memo-item.is-selected {
  border-color: #fbbc04;
  background: #feefc3;
  box-shadow: 0 0 0 2px rgba(251, 188, 4, 0.35);
}

.memo-item.is-reorderable {
  cursor: grab;
}

.memo-item.is-reorderable:active {
  cursor: grabbing;
}

.memo-item.is-dragging {
  opacity: 0.58;
  border-style: dashed;
  border-color: #9aa0a6 !important;
  box-shadow:
    0 0 0 2px rgba(95, 99, 104, 0.08),
    inset 0 0 0 1px rgba(255, 255, 255, 0.45) !important;
  transition: none !important;
}

.memo-item--drag-preview {
  position: fixed !important;
  z-index: 2147483647 !important;
  pointer-events: none !important;
  opacity: 0.94 !important;
  box-shadow:
    0 12px 28px rgba(60, 64, 67, 0.24),
    0 4px 10px rgba(60, 64, 67, 0.18) !important;
  transform: rotate(1deg);
}

.memo-item__open--content {
  min-height: 5.5rem;
}

.memo-item__title {
  color: #202124;
  font-size: 1rem;
  font-weight: 600;
}

.memo-item__excerpt {
  color: #3c4043;
  font-size: 0.88rem;
  line-height: 1.5;
  -webkit-line-clamp: 10;
}

.memo-item__footer {
  margin-top: 0.2rem;
  min-height: 32px;
}

.memo-item__date,
.memo-collection-badge {
  color: #5f6368;
}

.memo-collection-badge {
  border-color: rgba(60, 64, 67, 0.12);
  background: rgba(255, 255, 255, 0.5);
}

.memo-item__pin,
.memo-item__action {
  color: #5f6368;
}

.memo-item__pin:hover,
.memo-item__action:hover:not(:disabled) {
  background: rgba(60, 64, 67, 0.1);
  color: #202124;
}

.memo-item__pin.is-pinned {
  color: #a96f00;
}

.memo-item__dropdown,
.memo-select__menu {
  border-color: #dadce0;
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--memo-shadow);
  backdrop-filter: none;
}

.memo-item__dropdown-item,
.memo-select__option {
  color: #202124;
}

.memo-item__dropdown-item:hover,
.memo-select__option:hover,
.memo-select__option.is-selected {
  background: #f1f3f4;
  color: #202124;
}

.memo-select__trigger,
.memo-control,
.memo-share-modal__body input {
  border-color: #dadce0;
  border-radius: 8px;
  background: #fff;
  color: #202124;
}

.memo-select.is-open .memo-select__trigger,
.memo-control:focus,
.memo-share-modal__body input:focus {
  border-color: #fbbc04;
  box-shadow: 0 0 0 3px rgba(251, 188, 4, 0.18);
  outline: none;
}

.memo-select__chevron,
.memo-select__check {
  color: #5f6368;
}

.memo-history__empty {
  width: min(38rem, 100%);
  margin: 0 auto;
  border-color: #dadce0;
  border-radius: 8px;
  background: #f8fafd;
}

.memo-modal,
.memo-share-modal {
  background: rgba(32, 33, 36, 0.42);
  backdrop-filter: none;
}

.memo-modal__overlay,
.memo-share-modal__overlay,
.memo-collection-modal__overlay,
.memo-export-modal__overlay {
  background: rgba(32, 33, 36, 0.42);
  backdrop-filter: none;
}

.memo-modal__content,
.memo-share-modal__content,
.memo-collection-modal__content,
.memo-export-modal__content {
  border-color: #dadce0;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 30px rgba(60, 64, 67, 0.3);
}

.memo-modal__header h3,
.memo-share-modal__header h3,
.memo-collection-modal__header h3,
.memo-export-modal__header h3 {
  color: #202124;
}

.memo-modal__date,
.memo-share-modal__header p,
.memo-collection-modal__header p,
.memo-export-modal__header p {
  color: #5f6368;
}

.memo-modal__meta-panel,
.memo-collection-create,
.memo-collection-item {
  border-color: #dadce0;
  border-radius: 8px;
  background: #fff;
}

@media (max-width: 1024px) {
  .memo-toolbar.memo-card {
    width: min(58rem, calc(100% - 2rem));
    grid-template-columns: minmax(10rem, 1fr) auto;
    grid-template-areas:
      "brand actions"
      "search search"
      "filters filters"
      "collections collections";
  }

  .memo-toolbar__search {
    width: 100%;
  }

  .memo-toolbar__collections {
    justify-content: flex-start;
  }
}

@media (max-width: 768px) {
  .memo-auth-bar {
    padding-inline: 1rem;
  }

  .memo-toolbar.memo-card {
    top: 0.4rem;
    width: calc(100% - 1rem);
    padding: 0.5rem 0.7rem;
    border-radius: 16px;
    row-gap: 0.5rem;
  }

  .memo-toolbar__app-mark {
    width: 36px;
    height: 36px;
    font-size: 1.15rem;
  }

  .memo-toolbar__title h1 {
    font-size: 1.18rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .memo-toolbar__count {
    display: none;
  }

  .memo-toolbar__actions {
    gap: 0.2rem;
  }

  .memo-toolbar__search {
    width: clamp(8rem, 38vw, 13rem);
    min-width: 0;
  }

  .memo-toolbar__icon-btn {
    width: 38px;
    height: 38px;
    min-height: 38px;
  }

  .memo-toolbar__action-btn {
    width: 38px;
    padding: 0;
    border-radius: 50%;
  }

  .memo-toolbar__action-label {
    display: none;
  }

  .memo-toolbar__filters {
    flex-direction: column;
    align-items: stretch;
  }

  .memo-filter-group,
  .memo-sort-control,
  .memo-toolbar__collections {
    width: 100%;
  }

  .memo-filter-group {
    align-items: flex-start;
    flex-direction: column;
  }

  .memo-sort-control__select,
  .memo-select--collection-filter {
    width: 100%;
    min-width: 0;
  }

  .memo-toolbar__collections {
    justify-content: flex-start;
  }

  /* Collapse the search/filter/collection region behind a toggle to free
     up vertical space on small screens. */
  .memo-toolbar__filter-toggle {
    display: inline-flex;
  }

  .memo-toolbar.memo-card:not(.is-filters-open) .memo-toolbar__collapsible {
    display: none;
  }

  .memo-toolbar.memo-card.is-filters-open {
    grid-template-areas:
      "brand actions"
      "search search"
      "filters filters"
      "collections collections";
  }

  .memo-toolbar.memo-card:not(.is-filters-open) {
    grid-template-areas: "brand actions";
    row-gap: 0;
  }

  @media (max-width: 420px) {
    .memo-toolbar.memo-card {
      padding-inline: 0.55rem;
    }

    .memo-toolbar__actions {
      gap: 0.1rem;
    }

    .memo-toolbar__app-mark {
      width: 32px;
      height: 32px;
      font-size: 1rem;
    }

    .memo-toolbar__title h1 {
      font-size: 1.05rem;
    }

    .memo-toolbar__search {
      width: clamp(6rem, 34vw, 10rem);
      min-height: 38px;
      padding-inline: 0.6rem;
    }

    .memo-toolbar__icon-btn,
    .memo-toolbar__action-btn {
      width: 36px;
      height: 36px;
      min-height: 36px;
    }
  }

  .memo-quick-capture {
    width: calc(100% - 1.5rem);
    margin-top: 1rem;
    margin-bottom: 1.25rem;
  }

  .memo-quick-capture__bottom-row {
    flex-wrap: wrap;
  }

  .memo-select--quick {
    flex: 1 1 100%;
    width: 100%;
  }

  .memo-quick-capture__actions {
    margin-left: 0;
    width: 100%;
    justify-content: flex-end;
  }

  .memo-board {
    width: calc(100% - 1.5rem);
  }

  .memo-history__list {
    columns: 1;
  }

  .memo-item {
    min-height: 0;
  }
}

[data-theme="dark"] body.memo-page {
  --memo-amber: #fbbc04;
  --memo-amber-strong: #f9ab00;
  --memo-border: rgba(95, 99, 104, 0.65);
  --memo-text: #e8eaed;
  --memo-text-muted: #bdc1c6;
  --memo-card: #202124;
  --memo-card-strong: #202124;
  background: #202124;
}

[data-theme="dark"] .memo-page-shell,
[data-theme="dark"] .memo-toolbar.memo-card,
[data-theme="dark"] .memo-quick-capture,
[data-theme="dark"] .memo-quick-capture__collapsed,
[data-theme="dark"] .memo-card,
[data-theme="dark"] .memo-form--quick .memo-control,
[data-theme="dark"] .memo-form--quick .memo-preview-pane {
  background: #202124;
}

[data-theme="dark"] .memo-quick-capture {
  border-color: rgba(232, 234, 237, 0.12);
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.35),
    0 1px 3px 1px rgba(0, 0, 0, 0.22);
}

[data-theme="dark"] .memo-quick-capture:hover:not(.is-expanded) {
  box-shadow:
    0 1px 3px rgba(0, 0, 0, 0.45),
    0 4px 8px 3px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .memo-quick-capture.is-expanded {
  border-color: rgba(232, 234, 237, 0.18);
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.45),
    0 2px 6px 2px rgba(0, 0, 0, 0.32);
}

[data-theme="dark"] .memo-quick-capture__title-input::placeholder,
[data-theme="dark"] .memo-form--quick textarea.memo-control--response::placeholder {
  color: #9aa0a6;
}

[data-theme="dark"] .memo-toolbar.memo-card {
  border-color: rgba(95, 99, 104, 0.65);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

[data-theme="dark"] .memo-toolbar__title h1,
[data-theme="dark"] .memo-quick-capture__title-input,
[data-theme="dark"] .memo-form--quick textarea.memo-control--response,
[data-theme="dark"] .memo-modal__header h3,
[data-theme="dark"] .memo-share-modal__header h3 {
  color: #e8eaed;
}

[data-theme="dark"] .memo-toolbar__search {
  background: #303134;
}

[data-theme="dark"] .memo-toolbar__search:focus-within {
  background: #202124;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.5), 0 1px 3px 1px rgba(0, 0, 0, 0.32);
}

[data-theme="dark"] .memo-filter-chip,
[data-theme="dark"] .memo-collection-chip,
[data-theme="dark"] .memo-bulk-btn,
[data-theme="dark"] .memo-response-tab,
[data-theme="dark"] .memo-select__trigger,
[data-theme="dark"] .memo-control,
[data-theme="dark"] .memo-share-modal__body input {
  border-color: rgba(95, 99, 104, 0.65);
  background: #202124;
  color: #e8eaed;
}

[data-theme="dark"] .memo-filter-chip.is-active,
[data-theme="dark"] .memo-collection-chip.is-active,
[data-theme="dark"] .memo-response-tab.is-active,
[data-theme="dark"] .primary-button {
  background: rgba(251, 188, 4, 0.22);
  border-color: #fbbc04;
  color: #e8eaed;
}

[data-theme="dark"] .memo-collection-chip.is-drop-target {
  background: rgba(251, 188, 4, 0.18);
  border-color: var(--badge-color, #fbbc04);
  box-shadow: 0 0 0 3px rgba(251, 188, 4, 0.2);
}

[data-theme="dark"] .memo-history__list > li:nth-child(n) .memo-item:not(.has-accent) {
  background: #202124;
}

[data-theme="dark"] .memo-item,
[data-theme="dark"] .memo-modal__content,
[data-theme="dark"] .memo-share-modal__content,
[data-theme="dark"] .memo-collection-modal__content,
[data-theme="dark"] .memo-export-modal__content,
[data-theme="dark"] .memo-modal__meta-panel,
[data-theme="dark"] .memo-collection-create,
[data-theme="dark"] .memo-collection-item,
[data-theme="dark"] .memo-item__dropdown,
[data-theme="dark"] .memo-select__menu {
  border-color: rgba(95, 99, 104, 0.65);
  background: #202124;
  color: #e8eaed;
}

[data-theme="dark"] .memo-item.has-accent {
  background: color-mix(in srgb, var(--memo-card-accent) 20%, #202124);
}

[data-theme="dark"] .memo-item.is-pinned {
  background: rgba(251, 188, 4, 0.18);
}

[data-theme="dark"] .memo-item__title,
[data-theme="dark"] .memo-item__excerpt,
[data-theme="dark"] .memo-select__option {
  color: #e8eaed;
}

[data-theme="dark"] .memo-toolbar__icon-btn,
[data-theme="dark"] .memo-quick-capture__collapsed,
[data-theme="dark"] .memo-quick-capture__shortcuts,
[data-theme="dark"] .memo-item__date,
[data-theme="dark"] .memo-panel__header h2,
[data-theme="dark"] .memo-history__section-label {
  color: #bdc1c6;
}

/* Final dark-mode polish: keep the memo page readable without the harsh black/yellow contrast. */
[data-theme="dark"] body.memo-page {
  --memo-amber: #fbbc04;
  --memo-amber-strong: #f9ab00;
  --memo-amber-soft: rgba(251, 188, 4, 0.16);
  --memo-border: rgba(148, 163, 184, 0.22);
  --memo-text: #f3f6f8;
  --memo-text-muted: #a8b3c2;
  --memo-card: rgba(28, 32, 38, 0.94);
  --memo-card-strong: rgba(35, 40, 48, 0.98);
  --memo-shadow: 0 18px 48px rgba(0, 0, 0, 0.38);
  background: #121417;
  color: var(--memo-text);
}

[data-theme="dark"] .memo-page-shell {
  background:
    radial-gradient(circle at 12% 0%, rgba(251, 188, 4, 0.08), transparent 28rem),
    linear-gradient(180deg, #121417 0%, #171a1f 48%, #15171b 100%);
}

[data-theme="dark"] .memo-toolbar.memo-card,
[data-theme="dark"] .memo-card,
[data-theme="dark"] .memo-crawl-summary,
[data-theme="dark"] .memo-history-panel,
[data-theme="dark"] .memo-quick-capture,
[data-theme="dark"] .memo-quick-capture__collapsed,
[data-theme="dark"] .memo-form--quick .memo-control,
[data-theme="dark"] .memo-form--quick .memo-preview-pane,
[data-theme="dark"] .memo-modal__content,
[data-theme="dark"] .memo-share-modal__content,
[data-theme="dark"] .memo-collection-modal__content,
[data-theme="dark"] .memo-export-modal__content,
[data-theme="dark"] .memo-modal__meta-panel,
[data-theme="dark"] .memo-collection-create,
[data-theme="dark"] .memo-collection-item,
[data-theme="dark"] .memo-item__dropdown,
[data-theme="dark"] .memo-select__menu {
  border-color: var(--memo-border);
  background: var(--memo-card);
  color: var(--memo-text);
  box-shadow: var(--memo-shadow);
}

[data-theme="dark"] .memo-quick-capture {
  background: var(--memo-card);
}

[data-theme="dark"] .memo-quick-capture:hover:not(.is-expanded) {
  border-color: rgba(148, 163, 184, 0.32);
  box-shadow: 0 22px 52px rgba(0, 0, 0, 0.46);
}

[data-theme="dark"] .memo-quick-capture.is-expanded {
  border-color: rgba(148, 163, 184, 0.34);
  box-shadow: 0 24px 58px rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] .memo-toolbar.memo-card {
  background: rgba(28, 32, 38, 0.72);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  backdrop-filter: blur(18px) saturate(160%);
  border-color: rgba(148, 163, 184, 0.18);
  box-shadow:
    0 1px 1px rgba(0, 0, 0, 0.2),
    0 14px 32px -14px rgba(0, 0, 0, 0.6);
}

[data-theme="dark"] .memo-toolbar__app-mark,
[data-theme="dark"] .primary-button,
[data-theme="dark"] .memo-filter-chip.is-active,
[data-theme="dark"] .memo-collection-chip.is-active,
[data-theme="dark"] .memo-response-tab.is-active,
[data-theme="dark"] .memo-export-format-option.is-active,
[data-theme="dark"] .memo-export-scope-option.is-active {
  border-color: transparent;
  background: linear-gradient(135deg, #fbbc04 0%, #f9ab00 100%);
  color: #3a2a00;
}

[data-theme="dark"] .memo-toolbar__title h1,
[data-theme="dark"] .memo-crawl-summary h2,
[data-theme="dark"] .memo-panel__header h2,
[data-theme="dark"] .memo-item__title,
[data-theme="dark"] .memo-modal__header h3,
[data-theme="dark"] .memo-share-modal__header h3,
[data-theme="dark"] .memo-collection-modal__header h3,
[data-theme="dark"] .memo-export-modal__header h3,
[data-theme="dark"] .memo-collection-item__name,
[data-theme="dark"] .memo-export-select__title {
  color: var(--memo-text);
}

[data-theme="dark"] .memo-toolbar__count,
[data-theme="dark"] .memo-crawl-summary p,
[data-theme="dark"] .memo-panel__count,
[data-theme="dark"] .memo-item__date,
[data-theme="dark"] .memo-history__section-label,
[data-theme="dark"] .memo-modal__date,
[data-theme="dark"] .memo-share-modal__header p,
[data-theme="dark"] .memo-collection-modal__header p,
[data-theme="dark"] .memo-export-modal__header p,
[data-theme="dark"] .memo-export-select__meta,
[data-theme="dark"] .memo-export-select__empty {
  color: var(--memo-text-muted);
}

[data-theme="dark"] .memo-crawl-summary__eyebrow,
[data-theme="dark"] .memo-crawl-summary__list i {
  color: #fcd34d;
}

[data-theme="dark"] .memo-toolbar__search,
[data-theme="dark"] .memo-control,
[data-theme="dark"] .memo-select__trigger,
[data-theme="dark"] .memo-share-modal__body input,
[data-theme="dark"] .memo-toolbar__icon-btn,
[data-theme="dark"] .memo-filter-chip,
[data-theme="dark"] .memo-collection-chip,
[data-theme="dark"] .memo-bulk-btn,
[data-theme="dark"] .memo-response-tab,
[data-theme="dark"] .memo-export-format-option,
[data-theme="dark"] .memo-export-scope-option,
[data-theme="dark"] .memo-export-select__action,
[data-theme="dark"] .secondary-button,
[data-theme="dark"] .memo-toolbar__clear {
  border-color: rgba(148, 163, 184, 0.24);
  background: #232830;
  color: #d7dee8;
}

[data-theme="dark"] .memo-toolbar__search:focus-within,
[data-theme="dark"] .memo-control:focus,
[data-theme="dark"] .memo-select.is-open .memo-select__trigger {
  border-color: rgba(251, 188, 4, 0.56);
  background: #272d36;
  box-shadow: 0 0 0 3px rgba(251, 188, 4, 0.12);
}

[data-theme="dark"] .memo-toolbar__search > i,
[data-theme="dark"] .memo-sort-control > i,
[data-theme="dark"] .memo-sort-control__select > i,
[data-theme="dark"] .memo-toolbar__collections-label i,
[data-theme="dark"] .memo-select__chevron,
[data-theme="dark"] .memo-select__check,
[data-theme="dark"] .memo-panel__header h2 i,
[data-theme="dark"] .memo-history__section-label i {
  color: #fcd34d;
}

[data-theme="dark"] .memo-toolbar__icon-btn:hover,
[data-theme="dark"] .memo-filter-chip:hover,
[data-theme="dark"] .memo-collection-chip:hover,
[data-theme="dark"] .memo-bulk-btn:hover:not(:disabled),
[data-theme="dark"] .memo-response-tab:hover:not(:disabled),
[data-theme="dark"] .memo-export-select__action:hover:not(:disabled),
[data-theme="dark"] .secondary-button:hover:not(:disabled) {
  border-color: rgba(251, 188, 4, 0.38);
  background: #2b323b;
  color: #f3f6f8;
}

[data-theme="dark"] .memo-quick-capture .memo-control,
[data-theme="dark"] .memo-quick-capture .memo-preview-pane,
[data-theme="dark"] .memo-quick-capture .memo-response-tab,
[data-theme="dark"] .memo-quick-capture .memo-quick-capture__bottom-row {
  border-color: transparent;
  background: transparent;
  box-shadow: none;
}

[data-theme="dark"] .memo-quick-capture__text-button,
[data-theme="dark"] .memo-quick-capture__shortcut-btn,
[data-theme="dark"] .memo-compose-palette__trigger {
  color: #d7dee8;
}

[data-theme="dark"] .memo-quick-capture__text-button:hover,
[data-theme="dark"] .memo-quick-capture__text-button:focus-visible,
[data-theme="dark"] .memo-quick-capture__shortcut-btn:hover,
[data-theme="dark"] .memo-quick-capture__shortcut-btn:focus-visible,
[data-theme="dark"] .memo-compose-palette__trigger:hover,
[data-theme="dark"] .memo-compose-palette__trigger:focus-visible,
[data-theme="dark"] .memo-compose-palette__trigger.is-active {
  background: rgba(251, 188, 4, 0.14);
  color: #f3f6f8;
}

[data-theme="dark"] .memo-quick-capture__collapsed:hover .memo-quick-capture__shortcut-btn {
  background: rgba(148, 163, 184, 0.14);
}

[data-theme="dark"] .memo-compose-palette__menu {
  border-color: rgba(148, 163, 184, 0.24);
  background: #232830;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.44);
}

[data-theme="dark"] .memo-compose-palette__option {
  color: #d7dee8;
}

[data-theme="dark"] .memo-compose-palette__option:hover,
[data-theme="dark"] .memo-compose-palette__option:focus-visible,
[data-theme="dark"] .memo-compose-palette__option.is-active {
  background: #2b323b;
  color: #f3f6f8;
}

[data-theme="dark"] .memo-compose-palette__swatch--empty {
  border-color: rgba(215, 222, 232, 0.32);
  background:
    linear-gradient(135deg, transparent 46%, rgba(215, 222, 232, 0.58) 47%, rgba(215, 222, 232, 0.58) 53%, transparent 54%),
    #232830;
}

[data-theme="dark"] .memo-modal__field-label,
[data-theme="dark"] .memo-modal__edit-fields label {
  color: #fcd34d;
}

[data-theme="dark"] .memo-modal__color-option span {
  border-color: rgba(215, 222, 232, 0.22);
}

[data-theme="dark"] .memo-quick-capture .memo-control:focus,
[data-theme="dark"] .memo-quick-capture .memo-control:focus-visible,
[data-theme="dark"] .memo-quick-capture .memo-preview-pane:focus,
[data-theme="dark"] .memo-quick-capture .memo-preview-pane:focus-visible {
  border-color: transparent;
  background: transparent;
  box-shadow: none;
}

[data-theme="dark"] .memo-quick-capture .memo-response-tab:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.06);
}

[data-theme="dark"] .memo-quick-capture .memo-response-tab.is-active {
  background: rgba(251, 188, 4, 0.18);
  color: var(--memo-text);
}

[data-theme="dark"] .memo-item {
  border-color: rgba(148, 163, 184, 0.2);
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.18);
}

[data-theme="dark"] .memo-item:hover {
  border-color: rgba(251, 188, 4, 0.32);
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.28);
}

[data-theme="dark"] .memo-item.has-accent {
  background: var(--memo-card-strong);
  border-color: rgba(148, 163, 184, 0.2);
}

[data-theme="dark"] .memo-item.is-pinned {
  background: var(--memo-card-strong);
  border-color: rgba(148, 163, 184, 0.2);
}

[data-theme="dark"] .memo-item__excerpt,
[data-theme="dark"] .memo-preview-content,
[data-theme="dark"] .memo-select__option {
  color: #d7dee8;
}

[data-theme="dark"] .memo-item__pin,
[data-theme="dark"] .memo-item__action,
[data-theme="dark"] .memo-modal__close,
[data-theme="dark"] .memo-share-modal__close,
[data-theme="dark"] .memo-collection-modal__close,
[data-theme="dark"] .memo-export-modal__close,
[data-theme="dark"] .memo-modal__icon-btn,
[data-theme="dark"] .memo-modal__edit-btn,
[data-theme="dark"] .memo-collection-item__action {
  border-color: rgba(148, 163, 184, 0.22);
  background: rgba(35, 40, 48, 0.86);
  color: #d7dee8;
}

[data-theme="dark"] .memo-item__pin:hover,
[data-theme="dark"] .memo-item__action:hover:not(:disabled),
[data-theme="dark"] .memo-modal__close:hover,
[data-theme="dark"] .memo-share-modal__close:hover,
[data-theme="dark"] .memo-collection-modal__close:hover,
[data-theme="dark"] .memo-export-modal__close:hover,
[data-theme="dark"] .memo-modal__icon-btn:hover:not(:disabled),
[data-theme="dark"] .memo-modal__edit-btn:hover:not(:disabled) {
  border-color: rgba(251, 188, 4, 0.36);
  background: rgba(251, 188, 4, 0.12);
  color: #ffe9a8;
}

[data-theme="dark"] .memo-item__pin.is-pinned,
[data-theme="dark"] .memo-item__action.is-active,
[data-theme="dark"] .memo-item__action.is-copied {
  background: rgba(245, 158, 11, 0.16);
  color: #facc15;
}

[data-theme="dark"] .memo-select__menu,
[data-theme="dark"] .memo-item__dropdown {
  background: #20262d;
  border-color: rgba(148, 163, 184, 0.24);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.44);
}

[data-theme="dark"] .memo-select__option:hover,
[data-theme="dark"] .memo-select__option.is-selected,
[data-theme="dark"] .memo-item__dropdown-item:hover,
[data-theme="dark"] .memo-item__dropdown-item.is-active,
[data-theme="dark"] .memo-export-select__item:hover,
[data-theme="dark"] .memo-export-select__item.is-selected {
  background: rgba(251, 188, 4, 0.12);
  color: #f3f6f8;
}

[data-theme="dark"] .memo-export-select__list,
[data-theme="dark"] .memo-export-select__empty {
  background: rgba(18, 20, 23, 0.42);
  border-color: rgba(148, 163, 184, 0.22);
}

[data-theme="dark"] .memo-modal__overlay,
[data-theme="dark"] .memo-share-modal__overlay,
[data-theme="dark"] .memo-collection-modal__overlay,
[data-theme="dark"] .memo-export-modal__overlay {
  background: rgba(10, 12, 15, 0.68);
  backdrop-filter: blur(8px);
}

[data-theme="dark"] .memo-history-panel,
[data-theme="dark"] .memo-history__sections,
[data-theme="dark"] .memo-history__list {
  border-color: transparent;
  background: transparent;
  box-shadow: none;
}

[data-theme="dark"] .memo-history__empty {
  background: transparent;
  box-shadow: none;
}

/* Uniform memo cards: keep organization badges, but stop color-coding card surfaces. */
.memo-history__list > li:nth-child(n) .memo-item,
.memo-item.has-accent,
.memo-item.is-pinned,
.memo-item.is-pinned.has-accent {
  background: var(--memo-card-strong);
  border-color: #dadce0;
}

.memo-item.has-accent::before {
  display: none;
  opacity: 0;
}

[data-theme="dark"] .memo-history__list > li:nth-child(n) .memo-item,
[data-theme="dark"] .memo-item.has-accent,
[data-theme="dark"] .memo-item.is-pinned,
[data-theme="dark"] .memo-item.is-pinned.has-accent {
  background: transparent;
  border-color: var(--memo-border);
  color: var(--memo-text);
  box-shadow: none;
}

[data-theme="dark"] .memo-history__list > li:nth-child(n) .memo-item:hover,
[data-theme="dark"] .memo-history__list > li:nth-child(n) .memo-item:focus-within {
  border-color: rgba(148, 163, 184, 0.32);
  box-shadow: none;
}

[data-theme="dark"] .memo-history__list > li:nth-child(n) .memo-item.is-selected {
  background: rgba(251, 188, 4, 0.14);
  border-color: rgba(251, 188, 4, 0.42);
}

[data-theme="dark"] .memo-item.has-accent::before {
  display: none;
  opacity: 0;
}

/* ============================================================
   Modern toolbar header polish (dark) — placed last so it wins
   over the earlier grouped toolbar rules.
   ============================================================ */
[data-theme="dark"] .memo-toolbar__icon-btn {
  background: transparent;
  border-color: transparent;
  color: #bdc1c6;
}

[data-theme="dark"] .memo-toolbar__icon-btn:hover {
  background: rgba(251, 188, 4, 0.16);
  border-color: rgba(251, 188, 4, 0.3);
  color: #fcd34d;
}

[data-theme="dark"] .memo-toolbar__icon-btn.is-active {
  background: linear-gradient(135deg, rgba(251, 188, 4, 0.24), rgba(249, 171, 0, 0.16));
  border-color: rgba(251, 188, 4, 0.4);
  color: #fcd34d;
}

[data-theme="dark"] .memo-toolbar__search {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(148, 163, 184, 0.22);
}

[data-theme="dark"] .memo-toolbar__search:focus-within {
  border-color: rgba(251, 188, 4, 0.56);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 0 3px rgba(251, 188, 4, 0.14);
}

[data-theme="dark"] .memo-toolbar__count {
  border-color: rgba(251, 188, 4, 0.32);
  background: linear-gradient(135deg, rgba(251, 188, 4, 0.18), rgba(249, 171, 0, 0.1));
  color: #fcd34d;
}
