/* Compact host controls use the workspace's existing colors and buttons. */
.notes-widget-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

.notes-widget-card,
.notes-widget-empty {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--color-border);
  border-radius: 16px;
  background: var(--color-surface);
  color: var(--color-text);
}

.notes-widget-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.notes-widget-heading h3 {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
}

.notes-widget-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.notes-widget-actions .notes-btn {
  min-width: 32px;
  min-height: 36px;
  padding: 6px;
  font-size: 11px;
}

.notes-widget-handle {
  touch-action: none;
  cursor: grab;
}

.notes-widget-card.is-dragging {
  outline: 2px solid var(--color-primary);
  opacity: 0.75;
}

.notes-widget-content iframe {
  display: block;
  width: 100%;
  border: 0;
  border-radius: 18px;
  background: transparent;
  color-scheme: normal;
}

.notes-widget-message,
.notes-widget-status,
.notes-widget-attribution,
.notes-widget-empty,
.notes-widget-picker p {
  color: var(--color-muted);
  font-size: 12px;
  line-height: 1.5;
}

#notesWidgetList + .notes-widget-status,
.notes-widget-attribution {
  text-align: center;
}

.notes-widget-hint-tools {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: inherit;
  vertical-align: middle;
  cursor: pointer;
}

.notes-widget-hint-tools:hover {
  background: var(--color-surface);
  color: var(--color-primary);
}

.notes-widget-hint-tools:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

#notesWidgetList + .notes-widget-status svg {
  display: inline-block;
  width: 15px;
  height: 15px;
  vertical-align: -3px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.notes-widget-message:empty,
.notes-widget-status:empty {
  display: none;
}

.notes-widget-picker {
  position: fixed;
  right: auto;
  bottom: auto;
  margin: 0;
  width: min(520px, calc(100vw - 32px));
}

.notes-widget-choice {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 0;
  border-block: 1px solid var(--color-border);
}

.notes-widget-choice > div {
  flex: 1;
  min-width: 0;
}

.notes-widget-choice strong {
  font-size: 14px;
}

.notes-widget-choice p {
  margin: 5px 0 0;
}

.notes-widget-icon svg {
  width: 26px;
  height: 26px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
}

.notes-widget-card button:focus-visible,
.notes-widget-card a:focus-visible,
.notes-widget-picker button:focus-visible,
.notes-widget-picker a:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 3px;
}

@media (max-width: 1024px) {
  .funify-notes-page .notes-workspace-utilities {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 16px;
  }

  .funify-notes-page[data-notes-workspace-view='document'] .notes-workspace-utilities {
    display: none;
  }

  .notes-widget-actions .notes-btn {
    min-height: 40px;
  }
}

/* The official card supplies its own visible title, settings, and close controls. */
.notes-widget-native-card {
  position: relative;
  padding: 0;
  border: 0;
  border-radius: 18px;
  background: transparent;
}

.notes-widget-native-card .notes-widget-heading {
  margin: 0 0 4px;
}

.notes-widget-native-card .notes-widget-heading h3 {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}

.notes-widget-choice small {
  display: block;
  margin: 4px 0;
  color: var(--color-muted);
}

.notes-widget-provider-link {
  color: inherit;
  text-decoration: none;
}

.notes-widget-choice .notes-btn,
.notes-widget-providers .notes-btn {
  padding: 5px 8px;
  font-size: 11px;
}

.notes-widget-providers {
  margin-top: 12px;
  border-top: 1px solid var(--color-border);
  padding-top: 10px;
}

.notes-widget-provider {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 8px 0;
  font-size: 11px;
}

.notes-widget-provider span {
  flex: 1 1 100%;
  overflow-wrap: anywhere;
}

.notes-widget-providers form {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.notes-widget-providers input {
  min-width: 0;
  width: 100%;
  padding: 8px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-surface);
  color: var(--color-text);
  font: inherit;
}

.notes-widget-settings-dialog {
  width: min(560px, calc(100vw - 24px));
  max-height: calc(100dvh - 24px);
  overflow: auto;
  padding: 12px;
  border: 1px solid var(--color-border);
  border-radius: 16px;
  background: var(--color-surface);
  color: var(--color-text);
}

.notes-widget-settings-dialog::backdrop {
  background: #10203366;
}

@media (max-width: 767px) {
  .notes-widget-status[data-empty='true'],
  .notes-widget-attribution {
    display: none;
  }
}
