
:root {
  --bg-cream: #FDF8F4;
  --frame-border: #c9a8a8;
  --label-charcoal: #4A4A4A;
  --accent-mauve: #B8878C;
  --white: #FFFFFF;
  --primary: #B8878C;
  --primary-light: #c9a8a8;
  --primary-lighter: #e8d4d4;
  --sync-fill: #f1f1ef;
  --text: #555;
  --text-muted: #6B6B6B;
  --border-color: var(--frame-border);
  
  --frame-width: 238.5px;
  --frame-height: 310px;
  --frame-radius: 119px;
  --frame-gap: 60px;
  --frame-gap-base: 60px;
  
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

:root[data-theme="dark"] {
  --bg-cream: #181515;
  --sync-fill: #2a2a2a;
  --white: #201b1b;
  --cream: #2d2626;
  --label-charcoal: #e6dad9;
  --text: #e6dad9;
  --text-muted: #ab9b9a;
  --primary-light: #523b3d;
  --primary-lighter: #2a2021;
  --border-color: #523b3d;
  --frame-border: #523b3d;
  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg-cream: #FDF8F4;
  --sync-fill: #f1f1ef;
  --white: #fff;
  --cream: #f8f0f0;
  --label-charcoal: #4A4A4A;
  --text: #555;
  --text-muted: #6B6B6B;
  --border-color: var(--frame-border);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg-cream: #181515;
    --sync-fill: #2a2a2a;
    --white: #201b1b;
    --cream: #2d2626;
    --label-charcoal: #e6dad9;
    --text: #e6dad9;
    --text-muted: #ab9b9a;
    --primary-light: #523b3d;
    --primary-lighter: #2a2021;
    --border-color: #523b3d;
    --frame-border: #523b3d;
    color-scheme: dark;
  }
}


*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-family);
  background-color: transparent;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
  color: var(--label-charcoal);
}


.app {
  position: relative;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}


.settings-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: var(--text-muted);
  border: none;
  border-radius: 50%;
  width: 26px;
  height: 26px;
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 0.15s, background-color 0.15s, color 0.15s;
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 100;
  padding: 0;
}

.settings-btn:hover {
  opacity: 1;
  background: var(--primary-lighter);
  color: var(--primary);
}

.settings-btn svg {
  display: block;
  transition: transform 0.3s ease;
}

.settings-btn:hover svg {
  transform: rotate(45deg);
}


.gallery-container {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  width: 100%;
}

.frames-row {
  display: flex;
  gap: var(--frame-gap);
  justify-content: center;
  align-items: flex-end;
}


.frame {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  color: inherit;
}

.frame-image-wrapper {
  width: var(--frame-width);
  height: var(--frame-height);
  border: 2px solid var(--frame-border);
  border-radius: var(--frame-radius) var(--frame-radius) 0 0;
  overflow: hidden;
  background-color: var(--white);
  position: relative;
}

.frame-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 0.2s ease;
}


.frame-flourish {
  display: none;
}



.frame-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
  z-index: 10;
}



.frame-image-wrapper.lined-arch {
  border-radius: var(--frame-radius) var(--frame-radius) 0 0;
}


.frame-image-wrapper.oval {
  border-radius: 50% / 40%;
}


.frame-image-wrapper.circle {
  border-radius: 50%;
  
  height: var(--frame-width) !important;
}

.frame-image-wrapper.circle .frame-image {
  object-fit: cover;
}

.frame-image-wrapper.heart,
.frame-image-wrapper.star,
.frame-image-wrapper.pixel-heart {
  height: var(--frame-width) !important;
  border: none !important;
  background-color: transparent !important;
  overflow: visible;
  border-radius: 0;
}

.frame-border-svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 5;
}

.frame-border-svg path {
  fill: none;
  stroke: var(--frame-border);
  stroke-width: 2px;
  vector-effect: non-scaling-stroke;
}

.frame-border-svg rect {
  fill: var(--frame-border);
}


.frame:hover .frame-image,
.frame:hover .frame-svg-content image {
  opacity: 0.8;
}

.frame:hover {
  cursor: pointer;
}

.frame-svg-content image {
  transition: opacity 0.2s ease;
}


.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: transparent;
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.modal-overlay.active {
  display: flex;
}

.modal {
  background-color: var(--white);
  border: 1px solid var(--primary);
  border-radius: 16px;
  width: 220px;
  max-width: 90%;
  max-height: 85vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0 8px 0;
  margin: 0 16px 0 12px;
  border-bottom: 1px solid var(--primary-lighter);
}

.modal-header h3 {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 0;
}

.settings-close {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  color: var(--text-muted);
  opacity: 0.5;
  transition: opacity 0.15s, background-color 0.15s;
  padding: 0;
}

.settings-close:hover {
  opacity: 1;
  background: var(--primary-lighter);
}

.modal-body {
  padding: 12px;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
  scrollbar-gutter: stable;
}


.modal-body::-webkit-scrollbar {
  width: 4px;
}

.modal-body::-webkit-scrollbar-track {
  background: transparent;
}

.modal-body::-webkit-scrollbar-thumb {
  background: var(--primary);
  border-radius: 2px;
}

.setting-group {
  margin-bottom: 12px;
}

.setting-group:last-child {
  margin-bottom: 0;
}

.setting-group label {
  display: block;
  font-size: 9px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 5px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.frame-count-selector {
  display: flex;
  gap: 8px;
  justify-content: flex-start;
}

.frame-count-selector button {
  width: 24px;
  height: 24px;
  padding: 0;
  border: none;
  background-color: transparent;
  font-family: var(--font-family);
  font-size: 10px;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 50%;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.frame-count-selector button:hover {
  color: var(--label-charcoal);
}

/* the picked count matches the settings icon picker: soft fill, no outline */
.frame-count-selector button.active {
  background-color: var(--primary-lighter);
  color: var(--primary);
  border: none;
  font-weight: 600;
}


.size-slider-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
}

.size-slider {
  flex: 1;
  min-width: 0; /* webkit won't shrink a range below 129px, guards a narrow embed */
  height: 3px; /* the fleet's thin slider: 3px tint track, 12px thumb (nari, 10/02) */
  -webkit-appearance: none;
  appearance: none;
  background: var(--primary-lighter);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}

.size-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
}

.size-slider::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
  border: none;
}

.size-value {
  font-size: 10px;
  font-family: var(--font-family);
  color: var(--text-muted);
  min-width: 45px;
  text-align: right;
}


.color-picker-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
}

.color-input {
  width: 18px;
  height: 18px;
  border: 1px solid var(--primary-lighter);
  border-radius: 50%;
  cursor: pointer;
  padding: 0;
  background: none;
}

.color-input::-webkit-color-swatch-wrapper {
  padding: 0;
}

.color-input::-webkit-color-swatch {
  border: none;
  border-radius: 50%;
}

.color-hex-input {
  width: 62px;
  height: 18px;
  font-size: 10px;
  font-family: var(--font-family);
  color: var(--text);
  font-weight: 400;
  background: var(--primary-lighter);
  border: none;
  border-radius: 999px;
  padding: 3px 6px;
  text-align: center;
  outline: none;
  transition: background-color 0.15s ease;
}

.color-hex-input:focus {
  background: var(--primary-light);
}


.shape-select {
  width: 100%;
  padding: 6px 28px 6px 12px;
  border: none;
  border-radius: 999px;
  font-family: var(--font-family);
  font-size: 10px;
  font-weight: 500;
  color: var(--label-charcoal);
  background-color: var(--primary-lighter);
  cursor: pointer;
  transition: all 0.15s ease;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 1 24 24' fill='none' stroke='%23888' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
}

.shape-select:focus {
  outline: none;
  border-color: var(--primary);
  background-color: var(--primary-light);
}

.shape-select:hover {
  border-color: var(--primary);
  background-color: var(--primary-light);
}


/* no outline: the photo boxes are soft fills like the fleet's other panels (nari, 10/02) */
.frame-config-item {
  padding: 12px;
  margin-bottom: 10px;
  border-radius: 8px;
  background-color: var(--primary-lighter);
}

.frame-config-item:last-child {
  margin-bottom: 0;
}

.frame-config-header {
  display: flex;
  align-items: center;
  margin-bottom: 10px;
}

.frame-config-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.frame-config-title {
  font-size: 11px;
  font-weight: 500;
  color: var(--label-charcoal);
}

.uploaded-indicator {
  font-size: 9px;
  font-weight: 600;
  text-transform: lowercase;
  color: var(--primary);
  background-color: var(--primary-lighter);
  padding: 2px 8px;
  border-radius: 999px;
  opacity: 0;
  transform: scale(0.9);
  transition: all 0.2s ease;
}

.uploaded-indicator.visible {
  opacity: 1;
  transform: scale(1);
}

.input-group {
  margin-bottom: 8px;
}

.input-group:last-child {
  margin-bottom: 0;
}

.input-group label {
  display: block;
  font-size: 8px;
  font-weight: 400;
  color: var(--text-muted);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.input-group input {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--frame-border);
  border-radius: 6px;
  font-family: var(--font-family);
  font-size: 11px;
  color: var(--label-charcoal);
  background-color: var(--white);
  transition: border-color 0.2s ease;
}

.input-group input:focus {
  outline: none;
  border-color: var(--primary);
}

.input-group input::placeholder {
  color: #A0A0A0;
}


.upload-btn {
  display: inline-block;
  padding: 5px 10px;
  border: 1px solid var(--primary);
  border-radius: 999px;
  background-color: transparent;
  color: var(--primary);
  font-family: var(--font-family);
  font-size: 10px;
  font-weight: 500;
  cursor: pointer;
  transition: opacity 0.15s;
  text-align: center;
}

.upload-btn:hover {
  opacity: 0.8;
}

.upload-btn.has-image {
  background-color: var(--bg-cream);
}

.file-input {
  display: none;
}

.image-hint {
  font-size: 9px;
  color: #A0A0A0;
  margin-top: 4px;
}


.reset-btn {
  width: 100%;
  padding: 6px 12px;
  font-size: 9px;
  font-weight: 600;
  font-family: var(--font-family);
  background: var(--primary-lighter);
  border: none;
  border-radius: 12px;
  cursor: pointer;
  color: #e53e3e;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: background-color 0.15s;
}

.reset-btn:hover {
  background: #fff5f5;
}

/* the confirm popup: no dim (the overlay stays only so a tap outside closes it), as wide as its words
   and never wider than the panel's rows, flat. same as kouid (nari, 10/07) */
.confirm-popup-overlay {
  position: fixed;
  inset: 0;
  background: transparent;
  display: none;
  z-index: 1050;
}

.confirm-popup-overlay.active {
  display: block;
}

.confirm-popup {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--white);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  width: max-content;
  padding: 14px 16px;
  display: none;
  flex-direction: column;
  gap: 14px;
  z-index: 1060;
  box-sizing: border-box;
    max-width: 196px;
}

.confirm-popup.active {
  display: flex;
}

.confirm-popup-message {
  font-size: 11px;
  line-height: 1.5;
  color: var(--text);
  text-align: center;
}

.confirm-popup-actions {
  display: flex;
  justify-content: center;
  gap: 6px;
}

.confirm-popup-btn {
  font-size: 10px;
  padding: 4px 10px;
  border: 1px solid var(--border-color);
  border-radius: 50px;
  cursor: pointer;
  background: var(--white);
  color: var(--text);
  font-family: inherit;
  transition: background-color 0.15s, border-color 0.15s;
}

.confirm-popup-btn:hover {
  background-color: rgba(0, 0, 0, 0.04);
}

.confirm-popup-btn.danger {
  color: #e53e3e;
  border-color: #feb2b2;
}

.confirm-popup-btn.danger:hover {
  background: #fff5f5;
}


.sync-section {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--primary-lighter);
}

.sync-section label {
  display: block;
  font-size: 9px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-bottom: 6px;
}

.sync-status {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px 12px;
  background: transparent;
  border-radius: 999px;
  margin-bottom: 8px;
  text-align: center;
  border: 1px solid var(--primary-lighter);
}

.sync-status-text {
  font-size: 10px;
  font-weight: 500;
  color: var(--text-muted);
}

.sync-status-text.synced {
  color: var(--primary);
}


.sync-status-indicator {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  font-size: 10px;
  font-weight: 500;
}

.sync-status-indicator.synced {
  color: var(--primary);
}

.sync-status-indicator.syncing {
  color: var(--text-muted);
}

.sync-status-indicator.error {
  color: #c44;
}

.sync-status-indicator.not-synced {
  color: var(--text-muted);
}


.sync-spinner {
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 2px solid var(--primary);
  border-top-color: transparent;
  border-radius: 50%;
  animation: sync-spin 0.8s linear infinite;
  flex-shrink: 0;
}

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


.sync-status-icon {
  font-size: 12px;
  line-height: 1;
}

.sync-controls {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  margin-top: 12px;
  margin-bottom: 6px;
}


.sync-btn {
  flex: 1;
  min-width: 80px;
  padding: 6px 10px;
  border: none;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 500;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  transition: all 0.15s ease;
  background: var(--primary);
  color: var(--on-accent, white);
  display: flex;
  align-items: center;
  justify-content: center;
}

.sync-btn:hover {
  opacity: 0.85;
  transform: scale(1.02);
}

.sync-btn:active {
  transform: scale(0.98);
}

.sync-btn:not(.secondary):not(.danger) {
  background: var(--primary);
  color: var(--on-accent, white);
}

.sync-btn.secondary {
  background: var(--sync-fill);
  color: var(--text);
}

.sync-btn.danger {
  background: rgba(231, 76, 60, 0.15);
  color: #c0392b;
}

.sync-btn.danger:hover {
  background: rgba(231, 76, 60, 0.25);
}

#sync-code-input {
  flex: 1;
  min-width: 80px;
  padding: 6px 10px;
  border: none;
  border-radius: 999px;
  font-size: 10px;
  font-family: 'Inter', sans-serif;
  background: var(--primary-lighter);
  transition: background-color 0.15s ease;
}

#sync-code-input:focus {
  outline: none;
  background: var(--primary-light);
}

.sync-hint {
  font-size: 10px;
  color: var(--text-muted);
  margin: 6px 0;
  text-align: center;
}


.sync-status-panel {
  background: var(--primary-lighter);
  border-radius: 10px;
  padding: 10px;
  margin-bottom: 8px;
  border: 1px solid var(--primary-lighter);
}

.sync-buttons-row {
  display: flex;
  flex-direction: row;
  gap: 6px;
  width: 100%;
}

.sync-buttons-row .sync-btn {
  flex: 1;
  min-width: 0;
  font-size: 10px;
}

.sync-status-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  min-height: 24px;
}

.sync-status-row:not(:last-child) {
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.sync-label {
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 500;
  line-height: 1.3;
}

.sync-value {
  font-size: 10px;
  color: var(--text);
  font-weight: 500;
  line-height: 1.3;
  display: flex;
  align-items: center;
}

.sync-time-value {
  color: var(--text-muted);
  font-size: 10px;
}

.sync-code-row {
  flex-wrap: nowrap;
  gap: 6px;
}


.sync-code-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 8px;
  background: var(--white);
  border-radius: 999px;
  border: 1px solid var(--primary-lighter);
  min-width: 0;
  flex-shrink: 1;
  max-width: 100%;
  cursor: pointer;
  transition: all 0.15s ease;
}

.sync-code-pill:hover {
  background: var(--primary-lighter);
}

.sync-code-pill:active {
  transform: scale(0.97);
}

.sync-code-value {
  font-family: 'Courier Prime', monospace;
  font-size: 10px;
  font-weight: 600;
  color: var(--primary);
  letter-spacing: 0.3px;
  margin-top: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}


.share-link-section {
  margin-top: 12px;
  padding-top: 12px;
  margin-bottom: 12px;
  border-top: 1px solid var(--primary-lighter);
}

.share-link-section label {
  display: block;
  font-size: 9px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-bottom: 8px;
}

.share-link-container {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--primary-lighter);
  border-radius: 999px;
  padding: 6px 6px 6px 12px;
}

.share-link-input {
  flex: 1;
  min-width: 0;
  padding: 6px 0;
  border: none;
  background: transparent;
  font-size: 11px;
  font-family: 'Inter', sans-serif;
  color: var(--text);
  outline: none;
  text-overflow: ellipsis;
  line-height: 1.4;
}

.share-copy-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  padding: 0;
  background: var(--primary);
  color: var(--on-accent, white);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.share-copy-btn:hover {
  opacity: 0.85;
  transform: scale(1.02);
}

.share-copy-btn:active {
  transform: scale(0.98);
}

.share-copy-btn svg {
  width: 11px;
  height: 11px;
  flex-shrink: 0;
}


.pages-section {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--primary-lighter);
}

.pages-section label {
  display: block;
  font-size: 9px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-bottom: 8px;
}

/* the hint sits under the links it explains, like koubit's embed hint (nari, 10/02) */
.pages-hint {
  font-size: 8px;
  color: var(--text-muted);
  margin: 6px 0 0 0;
  text-align: center;
}

.page-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.page-link-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.page-label {
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 500;
  min-width: 45px;
  flex-shrink: 0;
}

.page-link-input {
  flex: 1;
  min-width: 0;
  padding: 5px 8px;
  border: 1px solid var(--primary-lighter);
  border-radius: 999px;
  background: var(--primary-lighter);
  font-size: 9px;
  font-family: 'Inter', sans-serif;
  color: var(--text);
  outline: none;
  text-overflow: ellipsis;
}

.page-copy-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  padding: 0;
  background: var(--primary);
  color: var(--on-accent, white);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.page-copy-btn:hover {
  opacity: 0.85;
  transform: scale(1.02);
}

.page-copy-btn:active {
  transform: scale(0.98);
}

.page-copy-btn svg {
  width: 11px;
  height: 11px;
  flex-shrink: 0;
}


.sync-error-panel {
  background: rgba(231, 76, 60, 0.1);
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 12px;
  border: 1px solid rgba(231, 76, 60, 0.3);
  display: flex;
  align-items: center;
  gap: 10px;
}

.sync-error-icon {
  font-size: 16px;
  color: #c0392b;
}

.sync-error-message {
  font-size: 11px;
  color: #c0392b;
  flex: 1;
}


.toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(8px);

  color: var(--primary);
  font-size: 11px;
  font-weight: 600;

  opacity: 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
  z-index: 1001;
  pointer-events: none;
  font-family: 'Inter', sans-serif;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}


@media (max-width: 768px) {
  .modal {
    max-width: 95%;
    margin: 10px;
  }
}



@supports (aspect-ratio: 1) {
  .frame-image-wrapper {
    aspect-ratio: 200 / 260;
    height: auto;
  }
}

.shape-select option {
  background: var(--white);
  color: var(--text);
}

.app.hide-border .frame-image-wrapper {
  border-color: transparent !important;
}

.app.hide-border .frame-border-svg {
  display: none !important;
}

.setting-toggle-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.setting-toggle-row .settings-label {
  font-size: 9px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-bottom: 0;
}

.cute-toggle {
  position: relative;
  display: inline-block;
  width: 32px;
  height: 18px;
  flex-shrink: 0;
}

.cute-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--primary-lighter);
  transition: .2s ease;
  border-radius: 999px;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 14px;
  width: 14px;
  left: 2px;
  bottom: 2px;
  background-color: var(--white);
  transition: .2s ease;
  border-radius: 50%;
}

.cute-toggle input:checked + .toggle-slider {
  background-color: var(--primary);
}

.cute-toggle input:checked + .toggle-slider:before {
  transform: translateX(14px);
}
#settingsBtn {
  width: 18px;
  height: 18px;
  top: 8px;
  left: 8px;
  padding: 0;
  background: var(--white);
  border: 1px solid var(--primary);
  border-radius: 50%;
  opacity: 1;
  color: var(--primary);
}

#settingsBtn svg {
  width: 12px;
  height: 12px;
  transition: none;
}

.hide-border #settingsBtn,
[data-settings-border="off"] #settingsBtn {
  border-color: transparent;
  background: transparent;
}

#settingsBtn:hover {
  background: var(--primary-lighter);
  color: var(--primary);
}

#settingsBtn:hover,
#settingsBtn:hover svg {
  transform: none;
}

[data-settings-hover="on"] #settingsBtn {
  opacity: 0;
  transition: opacity 0.15s, background-color 0.15s, color 0.15s;
}

[data-settings-hover="on"]:hover #settingsBtn,
[data-settings-hover="on"] #settingsBtn:focus-visible {
  opacity: 1;
}

@media (hover: none) {
  [data-settings-hover="on"] #settingsBtn {
    opacity: 1;
  }
}

.window-style-btn {
  font-size: 10px;
  /* the words sat low in their pills (nari, 10/02): Inter's lowercase sits under the line
     box's middle, so the text rides half a pixel higher, same pill height (1px read too high) */
  padding-top: 4.5px;
  padding-bottom: 5.5px;
}

.window-style-btn.active {
  color: var(--on-accent, #fff);
  background: var(--primary);
}

.settings-icon-btn:hover {
  background: var(--primary-lighter);
}


/* Additional Pages sits at the top of the embed block, above Your Embed Link,
   like koubit's Weekly Embed. no line of its own, the sync section's line covers it. */
.share-link-section > .pages-section {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
    margin-bottom: 12px;
}

/* the embed block is the first thing inside the sync section, so its own top
   margin, padding and border doubled the section's own. one divider, not two.
   nari spotted the gap in koucard 2026-10-01. */
.sync-section > .share-link-section:first-child {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}
