:root {
  --bg: #fff;
  --card: #FFD600;
  --ink: #101010;
  --ink-dim: #5a5a5a;
  --line: rgba(0, 0, 0, .20);
  --line-soft: rgba(0, 0, 0, .10);
  --font-ui: 'Swiss-721', sans-serif;
  --pad: 1.5rem;
  --gap: 1rem;
  --fs: 13.5px;
  --fs-head: 11px;
  --inflow: #1ba64a;
  --outflow: #d0342c;
  --transfer: #666666;
  --snap-inset: 0px;


  --corner-radius: 42px;
  --corner-squircle: 0.4;


  --fill-color: transparent;
  --stroke-width: 0px;
  --stroke-color: rgba(0, 0, 0, .12);


  --grid-step: 64px;
}

@font-face {
  font-family: 'ABC ROM';
  src: url('../fonts/ABCROM-Medium.otf') format('opentype');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Swiss-721';
  src: url('../fonts/Swiss721Light.woff2') format('woff2'),
       url('../fonts/Swiss721Light.woff') format('woff');
  font-weight: 100;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Swiss-721';
  src: url('../fonts/Swiss721Roman.woff2') format('woff2'),
       url('../fonts/Swiss721Roman.woff') format('woff');
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Swiss-721';
  src: url('../fonts/Swiss721Medium.woff2') format('woff2'),
       url('../fonts/Swiss721Medium.woff') format('woff');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Swiss-721';
  src: url('../fonts/Swiss721Bold.woff2') format('woff2'),
       url('../fonts/Swiss721Bold.woff') format('woff');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

* { box-sizing: border-box; scrollbar-width: none; -ms-overflow-style: none; }
*::-webkit-scrollbar { display: none; }

html, body {

  width: 100%;
  max-width: 100%;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;

  overflow-anchor: none;

  overscroll-behavior: none;
}
html {
  overscroll-behavior-y: none;
  color-scheme: light;
  background: #fff;
}
body {
  position: relative;
  overscroll-behavior-y: none;
  background: #fff;
  color: #111;
}
body.is-dark-mode {
  color-scheme: dark;
}

body, h1, h2, h3, h4, h5, h6, p,
ul, ol, li, figure, blockquote, dl, dd { margin: 0; }
ul, ol { padding: 0; list-style: none; }
table { border-collapse: collapse; border-spacing: 0; }
button, input, textarea { font: inherit; outline: none; border: none; background: none; }
:focus { outline: none; }

.wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  position: relative;
  z-index: 1;
}

.module {
  position: relative;
  padding: var(--snap-inset);
  background: transparent;
  cursor: move;
  container-type: inline-size;
  container-name: module;
  z-index: 1;

  /* `paint` containment can break compositing of descendant `mask: paint(...)` in some engines. */
  contain: layout;
}

.module.is-movable {
  position: absolute !important;
  max-width: none !important;
  aspect-ratio: auto !important;
}

.module[data-grid-pending="1"] {
  visibility: hidden !important;
}

body:not(.is-dark-mode) .module {

}
.module.is-dragging,
.module.is-resizing { user-select: none; }
html.cursor-resize-nwse .module { cursor: nwse-resize; }
html.cursor-resize-nesw .module { cursor: nesw-resize; }
body.is-view-mode .module { cursor: default !important; }

.module-inner {

}

.module > .module-inner {
  width: 100%;
  height: 100%;
  position: relative;
  display: flex;
  flex-direction: column;
}

.module > .module-inner > .module-body {
  flex: 1 1 auto;
  min-height: 0;
  position: relative;
  overflow: hidden;
}

.module-body {
  overflow: hidden;
  background: var(--fill-color, transparent);
  color: inherit;
  /* Fallback when CSS Paint / worklet is unavailable or failed — unscoped paint()
     masks hide module content in several engines. Mirrors index.php adding
     html.has-squircle-paint only after addModule resolves. */
  border-radius: var(--corner-radius, 42px);
}
body.is-grid-visible .module .module-body,
html body.is-grid-visible :is(#module-pages, [data-module-slug="pages"]) .module-body {
  opacity: 0.95 !important;
}
/* Superellipse comes only from paint — circular `border-radius` on the same box
   visually cancels squircle changes (corners stay circular). Fill uses `fixed-squircle`
   so `--fill-color` / `--stroke-*` paint correctly under `mask: paint(...)`. */
html.has-squircle-paint .module:not([data-module-slug="notes"]):not([data-module-slug="ornament"]):not([data-module-slug="controls"]):not(.grid-cell-hover):not(.grid-cell-add-popover):not(#module-timer-v2) .module-body {
  border-radius: 0;
  background: paint(fixed-squircle);
  -webkit-mask: paint(fixed-squircle-fill);
  mask: paint(fixed-squircle-fill);
  -webkit-mask-mode: alpha;
  mask-mode: alpha;
}

.module[data-content-padding] .module-body,
.module[data-content-padding-y] .module-body,
.module[data-content-padding-x] .module-body {
  padding: var(--module-content-padding-y, var(--module-content-padding, 0px))
           var(--module-content-padding-x, var(--module-content-padding, 0px)) !important;
  box-sizing: border-box;
}

.module .module-inner {
  padding: var(--module-cell-padding-y, var(--module-cell-padding, 0px))
           var(--module-cell-padding-x, var(--module-cell-padding, 0px)) !important;
  box-sizing: border-box;
}

.module .mod-chrome {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 5;
  pointer-events: auto;
}
.module > .module-inner > .mod-actions {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 5;
  pointer-events: auto;
}
.module .mod-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}
body.is-view-mode .module .mod-actions {
  display: none !important;
}
.module .mod-actions .no-drag {
  appearance: none;
  border: 0;
  border-radius: 8px;
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 14px;
  cursor: pointer;
}
.module .mod-actions .no-drag:hover {
}

.module .mod-actions .mod-focus,
.module .mod-actions .mod-pin,
.module .mod-actions .mod-delete {
  appearance: none;
  border: 0;
  border-radius: 10px;
  padding: 6px 8px;
  color: #fff;
  cursor: pointer;
  font: inherit;
  line-height: 1;
}
.module .mod-actions .mod-focus {
  background: rgba(0, 0, 0, 0.5);
}
.module .mod-actions .mod-pin {
  background: rgba(0, 0, 0, 0.45);
  font-size: 15px;
  line-height: 1;
}
.module .mod-actions .mod-pin.is-active {
  background: rgba(22, 163, 74, 0.85);
}
.module .mod-actions .mod-delete {
  background: rgba(255, 0, 0, 0.75);
}

.module .mod-title {
  position: absolute;
  left: 8px;
  top: 8px;
  z-index: 5;
  padding: 4px 8px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  font: 600 12px/1.2 system-ui, sans-serif;
}

body.page-error-minimal {
  font-family: system-ui, sans-serif;
  padding: 24px;
}

#focus-portal { position: fixed; inset: 0; z-index: 2147483646; pointer-events: none; }

.wrap.is-stage { position: relative; }
.module.is-movable { max-width: none !important; box-sizing: border-box; }

#core.grid-fixed {
  z-index: 900;
  pointer-events: auto;
}

.wrap.is-stage {
  position: relative !important;
  display: block !important;
  background: transparent;

  height: auto;
}

nav {
  pointer-events: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: 'Swiss-721';
}
nav #main {
  font-size: 3.5em;
  letter-spacing: -.05em;
  display: flex;
  align-items: center;
  gap: .25em;
}
nav #main .bold { font-weight: 500; }
nav #main .light { font-weight: 100; }
nav #cta {
  font-size: 2em;
  letter-spacing: -.02em;
  font-weight: 300;
  display: flex;
  align-items: center;
  gap: .75em;
}
.nav-item { overflow: visible; white-space: nowrap; }

#launcherBand,
#gridSettingsBand {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  z-index: 2;
  border-top: 1px solid rgba(0,0,0,.15);
  border-bottom: .5px solid rgba(0,0,0,.15);
  background-color: white !important;
  overflow: hidden;
  pointer-events: none;
}
#launcherBand[hidden],
#gridSettingsBand[hidden] { display: none; }

.grid-panel {
  position: absolute;
  left: 0; top: 0;
  width: 100%; height: 100%;
  padding: 12px;
  font: 14px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  pointer-events: auto;
}
.grid-panel__row {
  display: grid;
  grid-template-columns: 1fr 110px;
  gap: 8px;
  align-items: center;
  margin-bottom: 10px;
}
.grid-panel__row:last-child { margin-bottom: 0; }
.grid-panel label { color: #333; font-weight: 600; }
.grid-panel input[type="number"],
.grid-panel input[type="color"] {
  width: 110px;
  padding: 6px 8px;
  border: 1px solid #d1d5db;
  background: #fff;
}
.grid-panel__actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
.grid-panel__actions button {
  padding: 6px 10px;
  border: 1px solid #d1d5db;
  background: #f8f9fa;
  cursor: pointer;
}
.grid-panel__row--switch { grid-template-columns: 1fr auto; }
.switch {
  appearance: none;
  width: 42px;
  height: 24px;
  background: #d1d5db;
  position: relative;
  cursor: pointer;
  transition: background .15s ease;
}
.switch::after {
  content: "";
  position: absolute;
  top: 3px; left: 3px;
  width: 18px; height: 18px;
  background: #fff;
  transition: left .15s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .18);
}
.switch:checked { background: #16a34a; }
.switch:checked::after { left: 21px; }

#camera-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.35);
  opacity: 0;
  pointer-events: none;
  transition: opacity 300ms cubic-bezier(.25,.9,.2,1);
  z-index: 0;
}
#camera-backdrop.is-visible { opacity: 1; pointer-events: auto; }
.module.is-movable.is-focused {
  z-index: 10002 !important;
  pointer-events: auto;
}

/* Floating edit/view hint — single icon for the active mode (grid-snap.js swaps SVG) */
.grid-mode-cursor-hint {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 100100;
  padding: 0;
  margin: 0;
  border: none;
  pointer-events: none;
  background: transparent;
  opacity: 0;
  overflow: visible;
  --grid-mode-hint-icon: 20px;
  transform: translate3d(0, 0, 0);
  /* Only fade visibility — never interpolate position (follows cursor in JS every event). */
  transition-property: opacity;
  transition-duration: 0.14s;
  transition-timing-function: ease;
}
.grid-mode-cursor-hint.is-visible {
  opacity: 1;
}
.grid-mode-cursor-hint__chip {
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: auto;
  height: auto;
  padding: 0;
  margin: 0;
  background: transparent;
  color: #111;
  border: none;
  border-radius: 0;
  box-shadow: none;
}
.grid-mode-cursor-hint__ico {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  line-height: 0;
}
.grid-mode-cursor-hint__svg {
  display: block;
  flex-shrink: 0;
}
@media (prefers-reduced-motion: reduce) {
  .grid-mode-cursor-hint {
    transition-duration: 0.05s;
  }
}

@container module (max-width: 300px) {
  .module > .inner .bank,
  .module > .inner .card-last4 { display: none; }
}
@container module (min-width: 300px) and (max-width: 600px) {
  .module > .inner .bank,
  .module > .inner .card-last4 { display: none; }
}
@container module (min-width: 600px) and (max-width: 900px) {
  .module > .inner .bank,
  .module > .inner .card-last4 { display: none; }
}
@container module (min-width: 900px) {
  .module > .inner .bank { display: block; }
}
