:root {
  font-family:
    "Inter",
    "Noto Sans JP",
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  color: #fff;
  background-color: transparent;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  width: 100vw;
  height: 100vh;
  background: transparent;
  overflow: hidden;
}

.notification {
  position: fixed;
  min-width: 280px;
  max-width: 360px;
  padding: 8px;
  border-radius: 14px;
  pointer-events: auto;
  opacity: 0;
  transform: translateY(10px);
  transition:
    opacity 360ms ease,
    transform 360ms ease;
  z-index: 10;
}

.notification.preview {
  position: relative;
  /* In-flow demo: corner classes (right/bottom offsets) must not shift it. */
  top: auto;
  right: auto;
  bottom: auto;
  left: auto;
  opacity: 1;
  transform: none;
  background: transparent;
  box-shadow: none;
}

.notification-surface {
  display: flex;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 12px;
  padding: 12px;
  backdrop-filter: blur(6px);
  align-items: center;
  gap: 12px;
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.35);
}

.notification.light .notification-surface {
  background: rgba(255, 255, 255, 0.75);
  color: #111;
}

.notification.dark .notification-surface {
  color: #fff;
}

.notification.custom .notification-surface {
  background: transparent;
  box-shadow: none;
  padding: 0;
}

/* Event colours on the toast itself (the primary colour carrier; the band /
   full-screen flashes are only a visibility aid sharing the same colours —
   see frontend/overlay.js COLORS and DESIGN.md). Dark/light tint the glass with
   the event colour; custom keeps the user's image as the surface and rings
   it with the event colour instead. */
.notification.dark.copy .notification-surface {
  background: linear-gradient(rgba(255, 59, 48, 0.45), rgba(255, 59, 48, 0.45)), rgba(0, 0, 0, 0.5);
}

.notification.dark.clear .notification-surface {
  background:
    linear-gradient(rgba(10, 132, 255, 0.45), rgba(10, 132, 255, 0.45)), rgba(0, 0, 0, 0.5);
}

.notification.light.copy .notification-surface {
  background:
    linear-gradient(rgba(255, 59, 48, 0.35), rgba(255, 59, 48, 0.35)), rgba(255, 255, 255, 0.75);
}

.notification.light.clear .notification-surface {
  background:
    linear-gradient(rgba(10, 132, 255, 0.35), rgba(10, 132, 255, 0.35)), rgba(255, 255, 255, 0.75);
}

.notification.custom.copy .notification-surface {
  box-shadow:
    0 0 0 2px rgba(255, 59, 48, 0.9),
    0 10px 32px rgba(0, 0, 0, 0.35);
}

.notification.custom.clear .notification-surface {
  box-shadow:
    0 0 0 2px rgba(10, 132, 255, 0.9),
    0 10px 32px rgba(0, 0, 0, 0.35);
}

.notification .notification-content {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
}

.icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  font-size: 1.35rem;
  line-height: 1;
  font-family: "DejaVu Sans", "Noto Sans Symbols 2", "Segoe UI Symbol", sans-serif;
}

.icon::before {
  content: "";
}

.icon[data-icon="copy"]::before {
  content: "\29C9";
}

.icon[data-icon="clear"]::before {
  content: "\2326";
}

.icon[data-icon="settings"]::before {
  content: "\2699";
}

.icon[data-icon="power"]::before {
  content: "\23FB";
}

.notification .message {
  font-size: 1rem;
  font-weight: 600;
}

.notification .custom-image {
  max-width: 260px;
  max-height: 160px;
  border-radius: 12px;
}

.notification .menu-button {
  background: none;
  border: none;
  color: inherit;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 4px 8px;
}

.notification .menu {
  position: absolute;
  right: 12px;
  top: 12px;
  display: flex;
  flex-direction: column;
  background: rgba(15, 15, 15, 0.9);
  border-radius: 10px;
  padding: 4px 0;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
}

.notification.light .menu {
  background: rgba(255, 255, 255, 0.95);
  color: #111;
}

.menu.hidden {
  display: none;
}

.menu-item {
  background: none;
  border: none;
  color: inherit;
  text-align: left;
  padding: 8px 16px;
  width: 100%;
  font-size: 0.95rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
}

.menu-item:hover {
  background: rgba(255, 255, 255, 0.12);
}

.notification.visible {
  opacity: 1;
  transform: translateY(0);
}

.notification.hidden {
  pointer-events: none;
}

.corner-bottom-right {
  right: 32px;
  bottom: 32px;
}

.corner-bottom-left {
  left: 32px;
  bottom: 32px;
}

.corner-top-right {
  right: 32px;
  top: 32px;
}

.corner-top-left {
  left: 32px;
  top: 32px;
}

.settings {
  position: absolute;
  inset: 32px;
  background: rgba(18, 18, 24, 0.88);
  border-radius: 18px;
  padding: 24px;
  color: #fff;
  backdrop-filter: blur(16px);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

.settings header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.settings .title {
  font-size: 1.3rem;
  font-weight: 700;
}

.settings .close {
  background: none;
  border: none;
  color: inherit;
  font-size: 1.4rem;
  cursor: pointer;
}

.settings .settings-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-height: calc(100% - 40px);
  overflow-y: auto;
}

.custom-image-picker {
  display: flex;
  gap: 12px;
  align-items: center;
}

/* Copy/clear pickers side by side so the toast tab stays one screen tall.
   The path drops under its button and ellipsizes within the column. */
.custom-image-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.custom-image-grid .custom-image-picker {
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
  min-width: 0;
}

.custom-image-grid .custom-image-picker button {
  justify-content: center;
}

.custom-image-grid .custom-image-picker .path {
  max-width: 100%;
}

.custom-image-picker button {
  border: 1px solid rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.08);
  color: inherit;
  border-radius: 8px;
  padding: 6px 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.custom-image-picker .path {
  font-size: 0.85rem;
  opacity: 0.8;
  max-width: 320px;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}

.note {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.7);
  margin: 8px 0 0;
}

.hidden {
  display: none;
}

.notification.handle-only {
  opacity: 1;
  transform: none;
  min-width: 0;
  padding: 0;
}

.notification.handle-only .notification-content {
  display: none;
}

.notification.handle-only .notification-surface {
  background: rgba(0, 0, 0, 0.35);
  box-shadow: none;
  padding: 2px;
}

/* Defence in depth for the handle's neutrality: even if a kind class ever
   survives onto the handle, these rules win over the event-colour rules
   above on specificity and keep the surface neutral. */
.notification.handle-only.copy .notification-surface,
.notification.handle-only.clear .notification-surface {
  background: rgba(0, 0, 0, 0.35);
  box-shadow: none;
}

.message-block {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.preview-text {
  font-size: 0.85rem;
  opacity: 0.7;
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---- Settings: sibling-app common skeleton (see DESIGN.md) ---- */
.section {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.section:last-child {
  border-bottom: none;
}

.section-title {
  margin: 0 0 4px;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  opacity: 0.7;
}

.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 40px;
}

.row-stack {
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
}

.row-label {
  font-size: 0.95rem;
  font-weight: 600;
}

.row-control {
  display: flex;
  align-items: center;
  gap: 12px;
}

.range-value {
  font-size: 0.9rem;
  opacity: 0.9;
  min-width: 3.5em;
  text-align: right;
}

/* Disabled slider row (e.g. preview length while preview is off): dim the value too. */
.row:has(input:disabled) .range-value {
  opacity: 0.45;
}

.switch {
  appearance: none;
  -webkit-appearance: none;
  position: relative;
  flex: none;
  width: 40px;
  height: 24px;
  margin: 0;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.2);
  cursor: pointer;
  transition: background 120ms ease;
}

.switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  transition: transform 120ms ease;
}

.switch:checked {
  background: #0a84ff;
}

.switch:checked::after {
  transform: translateX(16px);
}

.switch:focus-visible,
.slider:focus-visible,
.select:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.slider {
  width: 140px;
  accent-color: #0a84ff;
}

.select {
  background: rgba(255, 255, 255, 0.08);
  color: inherit;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 0.95rem;
}

.select option {
  color: #111;
}

.segmented {
  display: inline-flex;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 8px;
  overflow: hidden;
}

.segmented label {
  cursor: pointer;
}

.segmented input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.segmented span {
  display: block;
  padding: 6px 12px;
  font-size: 0.9rem;
}

.segmented input:checked + span {
  background: rgba(255, 255, 255, 0.22);
  font-weight: 600;
}

.segmented input:focus-visible + span {
  outline: 2px solid #fff;
  outline-offset: -2px;
}

.callout {
  margin: 0;
  padding: 12px;
  border-radius: 10px;
  background: rgba(255, 59, 48, 0.18);
  border: 1px solid rgba(255, 59, 48, 0.6);
  font-size: 0.9rem;
}

/* Settings group switcher: tabs styled after the segmented control (DESIGN.md).
   flex:none — the settings body is a column flexbox, and the tab labels can
   wrap, so without it the bar would be compressed instead of scrolling. */
.settings-tabs {
  display: flex;
  flex: none;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 8px;
  overflow: hidden;
}

/* .section sets display:flex later in this file than .hidden, so a hidden
   panel needs the more specific rule to actually disappear. */
.tab-panel.hidden {
  display: none;
}

.settings-tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  background: none;
  border: none;
  color: inherit;
  font: inherit;
  font-size: 0.8rem;
  padding: 4px;
  text-align: center;
  cursor: pointer;
}

.settings-tab[aria-selected="true"] {
  background: rgba(255, 255, 255, 0.22);
  font-weight: 600;
}

.settings-tab:focus-visible {
  outline: 2px solid #fff;
  outline-offset: -2px;
}

/* The preview is a live demo, not a settings group: always visible under the
   tab panels, without the demo notification's own outer padding. */
.preview-section {
  padding-bottom: 4px;
}

.preview-section .notification.preview {
  padding: 0;
}
