html {
  width: 360px;
  height: 580px;
  margin: 0;
  overflow: hidden;
}

body {
  width: 360px;
  height: 100%;
  margin: 0;
  overflow: hidden;
  font-family: system-ui, sans-serif;
  font-size: 13px;
  color: #18191c;
  box-sizing: border-box;
}

.popup-root {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  box-sizing: border-box;
  overflow: hidden;
}

.popup-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 0 0 8px;
  box-sizing: border-box;
}

.popup-resize-wrap {
  flex: 0 0 auto;
}

.popup-resize-hint {
  margin: 0;
  padding: 4px 10px 0;
  font-size: 10px;
  color: #9499a0;
  text-align: center;
  line-height: 1.35;
}

.bug-notify-banner {
  margin: 0 0 8px;
  padding: 8px 10px;
  border-radius: 8px;
  background: #fff6e5;
  border: 1px solid #ffe0a3;
  color: #8a6116;
  font-size: 12px;
  line-height: 1.45;
  cursor: pointer;
}

.bug-notify-banner.hidden {
  display: none !important;
}

.bug-form textarea {
  width: 100%;
  min-height: 120px;
  box-sizing: border-box;
  margin-top: 6px;
  padding: 8px;
  border: 1px solid #e3e5e7;
  border-radius: 6px;
  font-size: 12px;
  font-family: inherit;
  resize: vertical;
}

.bug-char-counter {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  color: #9499a0;
  text-align: right;
}

.bug-image-label {
  display: block;
  margin-top: 10px;
  font-size: 12px;
  color: #61666d;
}

.bug-image-label input[type="file"] {
  display: block;
  width: 100%;
  margin-top: 6px;
  font-size: 11px;
}

html.popup-standalone-mode,
html.popup-standalone-mode body {
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
  height: 100vh !important;
  min-height: 100vh;
  max-height: none !important;
  overflow: hidden !important;
}

html.popup-standalone-mode .popup-root {
  height: 100%;
  min-height: 0;
  max-height: 100vh;
}

html.popup-standalone-mode .popup-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

html.popup-standalone-mode #popup-resize-hint {
  display: none;
}

.popup-resize-handle {
  flex: 0 0 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: ns-resize;
  user-select: none;
  background: linear-gradient(to bottom, #f6f7f8, #eceff1);
  border-top: 1px solid #e3e5e7;
  touch-action: none;
}

.popup-resize-handle:hover {
  background: #e3f6fc;
}

.popup-resize-grip {
  width: 40px;
  height: 4px;
  border-radius: 999px;
  background: #c9ccd0;
}

.popup-resize-handle:hover .popup-resize-grip {
  background: #00aeec;
}

body.is-resizing-popup {
  cursor: ns-resize;
}

body.is-resizing-popup .popup-scroll {
  pointer-events: none;
}

.banner {
  padding: 8px 12px;
  font-size: 12px;
  line-height: 1.4;
}

.banner.warn {
  background: #fff6e5;
  color: #8a6116;
}

.banner.danger {
  background: #ffe8e8;
  color: #c23a3a;
}

header.popup-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 14px 8px;
}

header.popup-header .app-title {
  flex: 1 1 auto;
  min-width: 0;
}

.btn-settings-gear {
  position: relative;
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  margin: 0;
  padding: 0;
  border: 1px solid #e3e5e7;
  border-radius: 8px;
  background: #f6f7f8;
  color: #61666d;
  cursor: pointer;
  line-height: 1;
}

.btn-settings-gear:hover {
  border-color: #00aeec;
  background: #e3f6fc;
  color: #00aeec;
}

.btn-settings-gear-icon {
  display: block;
  font-size: 17px;
  line-height: 32px;
  text-align: center;
}

.settings-notify-dot,
.settings-menu-notify-dot {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #f85a54;
  border: 1.5px solid #fff;
}

.settings-menu-notify-dot {
  position: static;
  display: inline-block;
  margin-left: 6px;
  vertical-align: middle;
  flex-shrink: 0;
}

.settings-notify-dot.hidden,
.settings-menu-notify-dot.hidden {
  display: none !important;
}

.popup-settings {
  position: absolute;
  inset: 0;
  z-index: 8000;
  pointer-events: none;
  visibility: hidden;
}

.popup-settings.is-open {
  pointer-events: auto;
  visibility: visible;
}

.popup-settings-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.28);
  opacity: 0;
  transition: opacity 0.26s ease;
}

.popup-settings.is-open .popup-settings-backdrop {
  opacity: 1;
}

.popup-settings-drawer {
  position: absolute;
  top: 25%;
  right: 0;
  width: 50%;
  height: 50%;
  min-width: 140px;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  background: #fff;
  border-left: 1px solid #e3e5e7;
  box-shadow: -4px 0 16px rgba(0, 0, 0, 0.12);
  transform: translateX(100%);
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

.popup-settings.is-open .popup-settings-drawer {
  transform: translateX(0);
}

.popup-settings-head {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 0 0 auto;
  padding: 8px 8px 6px;
  border-bottom: 1px solid #e3e5e7;
}

.popup-settings-title {
  flex: 1 1 auto;
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.3;
  min-width: 0;
}

.popup-settings-back,
.popup-settings-close {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: #61666d;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.popup-settings-back.hidden {
  visibility: hidden;
  pointer-events: none;
}

.popup-settings-back:hover,
.popup-settings-close:hover {
  background: #f1f2f3;
  color: #18191c;
}

.popup-settings-menu {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  padding: 6px 0;
}

.popup-settings-menu.hidden {
  display: none !important;
}

.popup-settings-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin: 0;
  padding: 10px 12px;
  border: none;
  border-radius: 0;
  background: transparent;
  color: #18191c;
  font-size: 12px;
  text-align: left;
  cursor: pointer;
  line-height: 1.35;
}

.popup-settings-item:hover {
  background: #f6f7f8;
  color: #00aeec;
}

.popup-settings-panel {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 8px 10px 10px;
}

.popup-settings-panel.hidden {
  display: none !important;
}

.api-mode-label {
  margin: 0 0 6px;
  font-size: 11px;
  font-weight: 600;
  color: #61666d;
}

.api-mode-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
}

.api-mode-tab {
  flex: 1 1 0;
  margin: 0;
  padding: 8px 6px;
  border: 1px solid #e3e5e7;
  border-radius: 8px;
  background: #fff;
  font-size: 11px;
  font-weight: 600;
  color: #61666d;
  cursor: pointer;
  line-height: 1.3;
}

.api-mode-tab:hover {
  border-color: #00aeec;
  color: #00aeec;
}

.api-mode-tab.active {
  border-color: #00aeec;
  background: #e3f6fc;
  color: #00aeec;
}

.api-mode-pane.hidden {
  display: none !important;
}

.api-mode-fixed-url {
  margin: 0 0 6px;
  padding: 8px 10px;
  border-radius: 6px;
  background: #e8e9eb;
  border: 1px solid #d9d9d9;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 11px;
  color: #9499a0;
  word-break: break-all;
  user-select: all;
  cursor: default;
}

.super-admin-fp-block {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid #e3e5e7;
}

.super-admin-fp-input {
  display: block;
  width: 100%;
  margin-top: 6px;
  box-sizing: border-box;
  font-size: 10px;
  font-family: ui-monospace, monospace;
  padding: 6px 8px;
  border: 1px solid #e3e5e7;
  border-radius: 6px;
  background: #f6f7f8;
}

.popup-settings-api-label {
  display: block;
  font-size: 11px;
  color: #61666d;
  line-height: 1.4;
}

.popup-settings-api-label input {
  display: block;
  width: 100%;
  margin-top: 4px;
  box-sizing: border-box;
  font-size: 11px;
  padding: 6px 8px;
  border: 1px solid #e3e5e7;
  border-radius: 6px;
}

.settings-notify-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.settings-notify-item {
  margin: 0 0 6px;
  padding: 8px;
  border: 1px solid #e3e5e7;
  border-radius: 6px;
  background: #fafbfc;
  font-size: 11px;
  line-height: 1.4;
  cursor: pointer;
}

.settings-notify-item:hover {
  border-color: #00aeec;
  background: #e3f6fc;
}

.settings-notify-item strong {
  display: block;
  margin-bottom: 4px;
  font-size: 11px;
  color: #18191c;
}

.settings-announce-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.settings-announce-item {
  margin: 0 0 8px;
  padding: 10px;
  border: 1px solid #e3e5e7;
  border-radius: 6px;
  background: #fafbfc;
  font-size: 11px;
  line-height: 1.45;
  cursor: pointer;
}

.settings-announce-item:hover {
  border-color: #00aeec;
  background: #e3f6fc;
}

.settings-announce-item strong {
  display: block;
  font-size: 12px;
  color: #18191c;
  margin-bottom: 4px;
}

.settings-announce-preview {
  margin: 6px 0 0;
  color: #61666d;
}

.register-privacy-row {
  align-items: flex-start;
  line-height: 1.45;
}

.privacy-inline-link {
  color: #00aeec;
  text-decoration: none;
  margin: 0 2px;
}

.privacy-inline-link:hover {
  text-decoration: underline;
}

#logged-in .action-msg {
  margin: 10px 0 6px;
  padding: 8px 10px;
  line-height: 1.45;
  color: #61666d;
  background: #f6f7f8;
  border-radius: 8px;
  border: 1px solid #e3e5e7;
  min-height: 0;
}

#logged-in .action-msg:empty {
  display: none;
  margin: 0;
  padding: 0;
  border: none;
}

.popup-extra-actions {
  margin: 12px 0 10px;
}

#logged-in .popup-extra-actions {
  margin-top: 4px;
}

.block-panel {
  margin: 10px 0;
  padding: 10px;
  border: 1px solid #e3e5e7;
  border-radius: 8px;
  background: #fafbfc;
}

.block-panel-head {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin-bottom: 6px;
  padding-right: 42px;
}

.block-panel-head h3 {
  margin: 0;
  font-size: 14px;
}

.shield-mode-tabs {
  display: flex;
  flex: 1 1 auto;
  flex-wrap: nowrap;
  align-items: center;
  gap: 4px;
  min-width: 0;
}

.shield-mode-tab {
  margin: 0;
  flex: 1 1 0;
  min-width: 0;
  padding: 4px 4px;
  border: 1px solid #e3e5e7;
  border-radius: 6px;
  background: #fff;
  font-size: 12px;
  font-weight: 600;
  color: #61666d;
  cursor: pointer;
  white-space: nowrap;
  text-align: center;
  line-height: 1.25;
}

.shield-mode-tab:hover {
  border-color: #00aeec;
  color: #00aeec;
}

.shield-mode-tab.active {
  border-color: #00aeec;
  background: #e3f6fc;
  color: #00aeec;
}

.shield-mode-tab.active#shield-tab-super {
  border-color: #f85a5a;
  background: #fff0f0;
  color: #c41e3a;
}

.shield-mode-pane.hidden {
  display: none !important;
}

.keyword-block-inputs {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 8px 0 10px;
}

.keyword-slot-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.keyword-slot-label {
  font-size: 12px;
  color: #61666d;
  font-weight: 600;
}

.keyword-slot-input {
  width: 100%;
  box-sizing: border-box;
  padding: 6px 8px;
  border: 1px solid #e3e5e7;
  border-radius: 6px;
  font-size: 14px;
}

.keyword-slot-input:disabled,
.keyword-slot-input.is-locked {
  background: #f1f2f3;
  color: #9499a0;
  cursor: not-allowed;
}

.keyword-slot-row.is-locked .keyword-slot-input {
  pointer-events: none;
}

.shield-mode-tab.active#shield-tab-keyword {
  border-color: #fb7299;
  color: #fb7299;
}

.block-picked.is-super-tag {
  background: #fff0f0;
  border-color: #f85a5a;
  color: #c41e3a;
}

.block-picked.is-super-up {
  background: #fff5f5;
  border-color: #e88;
  color: #a33;
}

.super-hate-up-row {
  margin: 6px 0 8px;
}

.super-hate-up-label {
  font-size: 11px;
  color: #61666d;
  margin-bottom: 4px;
}

.super-hate-add-page-btn {
  display: block;
  width: 100%;
  margin-bottom: 6px;
  padding: 8px 10px;
  font-size: 12px;
  text-align: center;
}

#super-hate-up-mid {
  display: block;
  width: 100%;
  box-sizing: border-box;
  padding: 6px 8px;
  border: 1px solid #e3e5e7;
  border-radius: 6px;
  font-size: 12px;
  background: #f6f7f8;
  color: #18191c;
}

#super-hate-up-mid:not(:placeholder-shown) {
  font-weight: 600;
  color: #00aeec;
  background: #e3f6fc;
  border-color: #00aeec;
}

.block-pool-chip.is-shield-conflict {
  opacity: 0.4;
  text-decoration: line-through;
  cursor: not-allowed;
}

.block-pool-chip.is-super-hate-chip {
  border-color: #f85a5a;
  color: #c41e3a;
  font-weight: 600;
}

.block-pool-chip.is-super-hate-chip:hover:not(:disabled) {
  background: #fff0f0;
  border-color: #f85a5a;
  color: #c41e3a;
}

#btn-save-block-tags.is-super-hate-save {
  border-color: #f85a5a;
  color: #c41e3a;
}

#btn-save-block-tags.is-super-hate-save:hover {
  background: #fff0f0;
}

.block-member-badge {
  position: absolute;
  top: 0;
  right: 0;
  flex-shrink: 0;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  background: #fff6e5;
  color: #8a6116;
}

.block-selected {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0;
  min-height: 24px;
}

.block-picked {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #e3f6fc;
  border: 1px solid #00aeec;
  font-size: 12px;
  color: #00aeec;
}

.block-remove {
  border: none;
  background: transparent;
  color: #9499a0;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  padding: 0 2px;
}

.block-tag-pool {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
  gap: 6px;
  max-height: 120px;
  overflow-y: auto;
  margin-bottom: 8px;
  align-items: stretch;
}

.block-tag-pool > .hint {
  grid-column: 1 / -1;
}

.block-pool-chip {
  width: 100%;
  min-width: 0;
  margin: 0;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid #e3e5e7;
  background: #fff;
  font-size: 11px;
  cursor: pointer;
  box-sizing: border-box;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.block-pool-chip:hover:not(:disabled) {
  border-color: #00aeec;
  color: #00aeec;
}

.block-pool-chip.active,
.block-pool-chip:disabled {
  opacity: 0.55;
  cursor: default;
}

.block-tag-pool.block-tag-pool--emoji {
  grid-template-columns: repeat(auto-fill, 36px);
  justify-content: start;
}

.block-tag-pool.block-tag-pool--emoji .block-pool-chip {
  width: 36px;
  padding: 3px 2px;
}

.block-pool-chip.block-pool-chip-emoji {
  width: 36px;
  justify-self: center;
  font-size: 17px;
  line-height: 1.15;
  padding: 3px 2px;
  text-align: center;
}

.block-picked.is-emoji-picked {
  font-size: 16px;
  line-height: 1.2;
}

.extra-row {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

.extra-row:last-child {
  margin-bottom: 0;
}

.extra-row-top .extra-btn {
  flex: 1 1 0;
  min-width: 0;
  width: 100%;
}

.extra-btn {
  width: auto;
  margin: 0;
  padding: 8px;
  border-radius: 6px;
  border: 1px solid #e3e5e7;
  background: #fff;
  color: #18191c;
  font-size: 13px;
  cursor: pointer;
  line-height: 1.3;
}

.extra-btn:hover:not(:disabled) {
  border-color: #00aeec;
  background: #fff;
  color: #00aeec;
}

.extra-btn-buy {
  background: #ffe4ec;
  border-color: #ffb3c6;
  color: #18191c;
}

.extra-btn-buy:hover:not(:disabled) {
  background: #ffd6e3;
  border-color: #ff8fab;
  color: #18191c;
}

.extra-btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  color: #9499a0;
}

.btn-tooltip-wrap {
  position: relative;
  display: block;
  width: 100%;
  margin-bottom: 8px;
}

.btn-tooltip-wrap + .btn-tooltip-wrap,
.btn-tooltip-wrap + .secondary,
.btn-tooltip-wrap + .btn-tooltip-wrap .secondary {
  margin-top: 0;
}

.btn-tooltip-wrap > .secondary {
  width: 100%;
  margin-bottom: 0;
}

.btn-tooltip {
  display: none;
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(100% + 8px);
  z-index: 120;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid #e3e5e7;
  background: #fff;
  color: #18191c;
  font-size: 12px;
  line-height: 1.45;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
  pointer-events: none;
  text-align: left;
}

.btn-tooltip::after {
  content: "";
  position: absolute;
  left: 24px;
  bottom: -6px;
  width: 10px;
  height: 10px;
  background: #fff;
  border-right: 1px solid #e3e5e7;
  border-bottom: 1px solid #e3e5e7;
  transform: rotate(45deg);
}

.btn-tooltip-wrap:hover .btn-tooltip,
.btn-tooltip-wrap:focus-within .btn-tooltip {
  display: block;
}


.popup-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  box-sizing: border-box;
}

.popup-modal.hidden {
  display: none !important;
}

.popup-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
}

.popup-modal-panel {
  position: relative;
  width: 100%;
  max-width: 336px;
  max-height: min(85vh, 720px);
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.18);
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.popup-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid #e3e5e7;
}

.popup-modal-head h2 {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
}

.popup-modal-close {
  width: auto;
  margin: 0;
  padding: 0 8px;
  border: none;
  background: transparent;
  font-size: 20px;
  line-height: 1;
  color: #9499a0;
  cursor: pointer;
}

.popup-modal-body {
  padding: 12px 14px 14px;
  overflow-y: auto;
  font-size: 12px;
  line-height: 1.55;
  color: #18191c;
}

.popup-modal-body h3 {
  margin: 14px 0 6px;
  font-size: 13px;
}

.popup-modal-body h3:first-child {
  margin-top: 0;
}

.popup-modal-body ol,
.popup-modal-body ul {
  margin: 0 0 10px;
  padding-left: 1.25em;
}

.popup-modal-body p {
  margin: 0 0 8px;
}

.popup-modal-body .author-note-text {
  white-space: pre-wrap;
  word-break: break-word;
}

.popup-modal-body .empty-hint {
  color: #9499a0;
  text-align: center;
  padding: 16px 8px;
}

.privacy-version-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  padding: 8px 10px;
  background: #f6f7f8;
  border: 1px solid #e3e5e7;
  border-radius: 8px;
  font-size: 12px;
}

.privacy-version-bar select {
  flex: 1;
  min-width: 160px;
  padding: 6px 8px;
  border: 1px solid #e3e5e7;
  border-radius: 6px;
  font-size: 12px;
}

.member-purchase {
  font-size: 12px;
  line-height: 1.5;
  color: #18191c;
}

.member-plan-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
}

.member-plan-btn {
  width: 100%;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid #e3e5e7;
  border-radius: 8px;
  background: #fff;
  color: #18191c;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.member-plan-btn:hover {
  background: #fff;
  border-color: #00aeec;
  color: #00aeec;
}

.member-plan-btn:active {
  background: #f6fbff;
}

.member-plan-btn:disabled {
  cursor: not-allowed;
  opacity: 0.85;
  color: #61666d;
}

.member-benefits {
  padding: 10px;
  border-radius: 8px;
  background: #fafbfc;
  border: 1px solid #e3e5e7;
}

.member-benefits-title {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 700;
}

.member-benefits-list {
  margin: 0 0 10px;
  padding-left: 18px;
}

.member-benefits-list li {
  margin-bottom: 6px;
}

.member-benefits-list li:last-child {
  margin-bottom: 0;
}

.member-probe-title {
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 700;
  color: #61666d;
}

.member-probe-desc {
  margin: 0;
  font-size: 11px;
  color: #61666d;
  line-height: 1.55;
}

.member-activation {
  margin: 12px 0 14px;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid #00aeec;
  background: #f0fbff;
}

.member-activation-title {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 700;
  color: #00aeec;
}

.member-activation-label {
  display: block;
  font-size: 11px;
  color: #61666d;
}

.member-activation-input {
  display: block;
  width: 100%;
  margin-top: 4px;
  box-sizing: border-box;
  padding: 8px 10px;
  border: 1px solid #e3e5e7;
  border-radius: 6px;
  font-size: 12px;
  font-family: ui-monospace, Consolas, monospace;
  letter-spacing: 0.02em;
}

.member-activation-submit {
  width: 100%;
  margin-top: 8px;
}

.activation-code-status {
  margin: 8px 0 0;
  min-height: 1.2em;
  line-height: 1.45;
}

.activation-code-status.is-success {
  color: #2d8f47;
}

.member-purchase-hint {
  margin: 10px 0 0;
  text-align: center;
  font-size: 11px;
}

h1.app-title {
  margin: 0;
  font-size: 14px;
  line-height: 1.35;
  font-weight: 700;
}

h1.app-title .app-version {
  font-size: 12px;
  font-weight: 600;
  color: #61666d;
}

h1.app-title .privacy-policy-link {
  margin-left: 6px;
  font-size: 12px;
  font-weight: 500;
  color: #00aeec;
  text-decoration: none;
  cursor: pointer;
}

h1.app-title .privacy-policy-link:hover {
  text-decoration: underline;
}

section {
  padding: 0 14px;
}

.tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}

.tab {
  flex: 1;
  padding: 6px;
  border: 1px solid #e3e5e7;
  border-radius: 6px;
  background: #f6f7f8;
  cursor: pointer;
}

.tab.active {
  background: #00aeec;
  color: #fff;
  border-color: #00aeec;
}

.form-panel label {
  display: block;
  margin-bottom: 8px;
}

.auth-options {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
  margin: 4px 0 10px;
}

.checkbox-row {
  display: inline-flex !important;
  align-items: center;
  gap: 6px;
  margin: 0 !important;
  font-size: 12px;
  color: #61666d;
  cursor: pointer;
}

.checkbox-row input {
  width: auto;
  margin: 0;
}

.auth-links {
  margin: 10px 0 0;
  font-size: 12px;
  line-height: 1.6;
}

.auth-links a {
  color: #00aeec;
  text-decoration: none;
  margin-right: 10px;
}

.auth-links a:hover {
  text-decoration: underline;
}

.hint.mono {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 11px;
  word-break: break-all;
  margin-top: 6px;
}

input {
  width: 100%;
  box-sizing: border-box;
  margin-top: 4px;
  padding: 6px 8px;
  border: 1px solid #e3e5e7;
  border-radius: 4px;
}

button[type="submit"],
button.primary {
  width: 100%;
  margin-top: 8px;
  padding: 8px;
  border: none;
  border-radius: 6px;
  background: #00aeec;
  color: #fff;
  cursor: pointer;
}

button.secondary {
  width: 100%;
  margin-top: 8px;
  padding: 8px;
  border-radius: 6px;
  background: #fff;
  color: #18191c;
  border: 1px solid #e3e5e7;
  cursor: pointer;
}

#auth-error.ok {
  color: #1a7f4b;
  background: #e4f7ed;
  padding: 8px;
  border-radius: 6px;
}

.error {
  color: #f85a54;
  font-size: 12px;
}

.hint {
  color: #9499a0;
  font-size: 12px;
}

.hidden {
  display: none !important;
}

.user-line {
  display: flex;
  justify-content: space-between;
  font-weight: 600;
}

.passerby-scan-block {
  margin: 8px 0 4px;
}

.passerby-scan-row {
  display: flex;
  align-items: stretch;
  border: 1px solid #e3e5e7;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.passerby-scan-row-eco {
  margin-top: 6px;
}

.passerby-scan-row-eco .passerby-scan-label {
  color: #1a7f4b;
}

.passerby-scan-row-eco .passerby-scan-check input {
  accent-color: #1a7f4b;
}

.passerby-scan-check {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  flex-shrink: 0;
}

.passerby-scan-check input {
  margin: 0;
  cursor: pointer;
}

.passerby-scan-divider {
  width: 1px;
  align-self: stretch;
  background: #e3e5e7;
  flex-shrink: 0;
}

.passerby-scan-label {
  flex: 1;
  margin: 0;
  padding: 8px 10px;
  border: none;
  background: transparent;
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  color: #18191c;
  cursor: pointer;
  line-height: 1.4;
}

.passerby-scan-label:hover {
  background: #f6f7f8;
}

.passerby-scan-label[aria-expanded="true"] {
  background: #f1f2f3;
  color: #00aeec;
}

.passerby-scan-hint-box {
  margin-top: 6px;
  padding: 8px 10px;
  font-size: 11px;
  line-height: 1.55;
  color: #61666d;
  background: #f6f7f8;
  border: 1px solid #e3e5e7;
  border-radius: 6px;
}

.passerby-scan-hint-box strong {
  color: #18191c;
  font-weight: 600;
}

.passerby-scan-quota {
  margin: 6px 0 0;
  font-size: 11px;
  color: #00aeec;
}

.login-api-hint {
  margin: 4px 0 8px;
  font-size: 11px;
  color: #9499a0;
  word-break: break-all;
}

.api-mode-url-input {
  width: 100%;
  box-sizing: border-box;
  margin-top: 6px;
  padding: 6px 8px;
  border: 1px solid #e3e5e7;
  border-radius: 6px;
  font-size: 12px;
}

.api-mode-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.api-mode-actions .secondary {
  flex: 1;
}

#cloud-api-status {
  min-height: 1.2em;
  margin-top: 6px;
}

#membership-status {
  color: #fb7299;
  font-size: 12px;
}

.tag-panel {
  margin: 12px 0;
  padding: 10px 0;
  border-top: 1px solid #e3e5e7;
  border-bottom: 1px solid #e3e5e7;
}

.tag-panel h2 {
  margin: 0;
  font-size: 14px;
}

.tag-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.link-btn {
  width: auto;
  margin-top: 0;
  border: none;
  background: none;
  color: #00aeec;
  cursor: pointer;
  font-size: 12px;
  padding: 0;
}

.up-mid-row {
  margin: 8px 0;
}

.up-mid-inputs {
  display: flex;
  gap: 6px;
  margin-top: 4px;
}

.up-mid-inputs input {
  flex: 1;
  margin-top: 0;
}

.up-mid-inputs button {
  width: auto;
  margin-top: 0;
  white-space: nowrap;
  padding: 6px 8px;
}

.tag-sections {
  overflow: visible;
}

.tag-group {
  margin-bottom: 10px;
}

.tag-group-title {
  font-size: 12px;
  color: #9499a0;
  margin-bottom: 6px;
}

.tag-group-collapsible .tag-group-collapse-head {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  margin: 0 0 6px;
  padding: 6px 8px;
  border: 1px solid #e3e5e7;
  border-radius: 8px;
  background: #f6f7f8;
  color: #61666d;
  font-size: 12px;
  line-height: 1.35;
  text-align: left;
  cursor: pointer;
}

.tag-group-collapsible .tag-group-collapse-head:hover {
  border-color: #00aeec;
  background: #e3f6fc;
  color: #00aeec;
}

.tag-group-collapse-title {
  flex: 1 1 auto;
  min-width: 0;
}

.collapse-arrow {
  flex: 0 0 auto;
  display: inline-block;
  font-size: 10px;
  transition: transform 0.15s ease;
}

.collapse-arrow.expanded {
  transform: rotate(90deg);
}

.tag-group-collapse-body[hidden] {
  display: none !important;
}

/* 一级 / 二级双栏 */
.tag-dual-pane {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: 8px;
  min-height: 0;
}

.tag-pane-l1,
.tag-pane-l2 {
  border: 1px solid #e3e5e7;
  border-radius: 8px;
  background: #fff;
  min-height: 0;
}

.tag-pane-l1 {
  flex: 0 0 38%;
  /* 7 行一级选项高度 */
  max-height: calc(7 * 34px);
  overflow-y: auto;
}

.tag-pane-l2 {
  flex: 1 1 0;
  min-width: 0;
  max-height: calc(7 * 34px);
  overflow-y: auto;
  padding: 6px;
  box-sizing: border-box;
}

.tag-l1-item {
  display: block;
  width: 100%;
  margin: 0;
  padding: 8px 10px;
  border: none;
  border-bottom: 1px solid #f1f2f3;
  border-radius: 0;
  background: #fff;
  color: #18191c;
  text-align: left;
  font-size: 12px;
  line-height: 1.25;
  cursor: pointer;
  box-sizing: border-box;
}

.tag-l1-item:last-child {
  border-bottom: none;
}

.tag-l1-item:hover {
  background: #f6f7f8;
}

.tag-l1-item.active {
  background: #e3f6fc;
  color: #00aeec;
  font-weight: 600;
}

.tag-pane-placeholder {
  margin: 0;
  padding: 12px 8px;
  font-size: 12px;
  color: #9499a0;
  text-align: center;
  line-height: 1.4;
}

.tag-chips-pane {
  gap: 5px;
}

.tag-chips {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
  gap: 6px;
  align-items: stretch;
}

.tag-chips > .hint {
  grid-column: 1 / -1;
}

/* 表情区：上方网格 + 底部分类 */
.tag-emoji-picker {
  margin-top: 8px;
  overflow-x: hidden;
}

.tag-emoji-picker .tag-emoji-grid {
  margin-bottom: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid #e3e5e7;
}

.tag-emoji-cat-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  overflow: visible;
  margin-bottom: 4px;
}

.tag-emoji-cat-btn {
  padding: 4px 10px;
  border: 1px solid #e3e5e7;
  border-radius: 999px;
  background: #f6f7f8;
  font-size: 12px;
  cursor: pointer;
}

.tag-emoji-cat-btn.active {
  background: #00aeec;
  border-color: #00aeec;
  color: #fff;
}

.tag-emoji-grid {
  margin-top: 0;
}

/* 表情区：每行 7 个，超出竖向滚动 */
.tag-chips.tag-chips-emoji {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  grid-auto-rows: 36px;
  gap: 6px;
  justify-content: start;
  align-content: start;
  width: 100%;
  max-width: 100%;
  max-height: calc(3 * 36px + 2 * 6px);
  overflow-x: hidden;
  overflow-y: auto;
  box-sizing: border-box;
}

.tag-chips.tag-chips-emoji .tag-chip {
  width: 100%;
  max-width: 36px;
  justify-self: center;
  padding: 3px 2px;
}

.tag-chip {
  width: 100%;
  min-width: 0;
  margin-top: 0;
  padding: 5px 8px;
  border: 1px solid #e3e5e7;
  border-radius: 999px;
  background: #f6f7f8;
  color: #18191c;
  cursor: pointer;
  font-size: 12px;
  line-height: 1.3;
  box-sizing: border-box;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tag-chip:hover {
  border-color: #00aeec;
  background: #e3f6fc;
}

.tag-chip.selected,
.tag-l1-item.selected {
  border-color: #00aeec;
  background: #e3f6fc;
  color: #00aeec;
  font-weight: 600;
  box-shadow: 0 0 0 1px #00aeec;
}

.tag-draft-bar {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 8px;
  margin: 8px 0 6px;
  padding: 8px;
  background: #f6f7f8;
  border-radius: 8px;
  font-size: 11px;
  line-height: 1.35;
  color: #61666d;
}

.tag-draft-bar .draft-slot {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tag-draft-bar .draft-slot.done {
  color: #00aeec;
  font-weight: 600;
}

.tag-group.is-passerby-skip {
  opacity: 0.45;
  pointer-events: none;
}

.tag-special-tag1-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}

.tag-special-btn {
  flex: 1 1 auto;
  min-width: 0;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid #e3e5e7;
  background: #fff;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  color: #18191c;
}

.tag-special-btn.is-passerby {
  border-color: #ffb020;
  background: #fff8e8;
  color: #b25d00;
}

.tag-special-btn.is-super-hate {
  border-color: #f85a5a;
  background: #fff0f0;
  color: #c41e3a;
}

.tag-special-btn:hover {
  filter: brightness(0.97);
}

.tag-special-btn.selected {
  box-shadow: 0 0 0 2px #00aeec;
}

.tag-chip.emoji {
  background: #fff5f8;
  border-color: #ffd6e0;
  color: #18191c;
}

.tag-chip.tag-chip-emoji-only {
  font-size: 17px;
  line-height: 1.1;
  text-align: center;
}

.tag-chip:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.captcha-slot {
  margin: 8px 0 4px;
}

.auth-captcha-wrap {
  margin: 0 0 6px;
  padding: 0 2px;
  display: flex;
  justify-content: center;
}

.auth-captcha-wrap:not(.hidden) {
  min-height: 188px;
}

.captcha-slider {
  width: 280px;
  max-width: 100%;
}

.captcha-slider-visual {
  position: relative;
  width: 280px;
  height: 120px;
  margin: 0 auto 8px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #e3e5e7;
  background: #f6f7f8 no-repeat 0 0 / 280px 120px;
  box-sizing: border-box;
}

.captcha-slider-piece {
  position: absolute;
  left: 0;
  top: 0;
  width: 44px;
  height: 44px;
  border-radius: 6px;
  background: #00aeec;
  box-shadow: 0 2px 8px rgba(0, 94, 160, 0.35);
  border: 2px solid #fff;
  box-sizing: border-box;
  pointer-events: none;
  will-change: transform;
}

.captcha-slider-track {
  position: relative;
  width: 280px;
  height: 36px;
  margin: 0 auto;
  background: #f1f2f3;
  border-radius: 999px;
  border: 1px solid #e3e5e7;
  box-sizing: border-box;
}

.captcha-slider-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0;
  border-radius: 999px 0 0 999px;
  background: rgba(0, 174, 236, 0.25);
  pointer-events: none;
}

.captcha-slider-knob {
  position: absolute;
  top: 3px;
  left: 0;
  width: 30px;
  height: 30px;
  border-radius: 6px;
  background: #00aeec;
  border: 2px solid #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  cursor: grab;
  touch-action: none;
  box-sizing: border-box;
  will-change: transform;
}

.captcha-slider-knob:active {
  cursor: grabbing;
}

.captcha-slider-hint {
  margin: 6px 0 4px;
  font-size: 11px;
  color: #9499a0;
  text-align: center;
}

.captcha-slider-hint.ok {
  color: #00aeec;
  font-weight: 600;
}

.captcha-slider-hint.error {
  color: #f85a5a;
}

.captcha-slider-refresh {
  display: block;
  margin: 0 auto;
  font-size: 11px;
}
