@font-face {
  font-family: 'Noto Sans Local';
  src: url('/static/fonts/NotoSans-ExtraLight.woff2') format('woff2');
  font-weight: 200;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Noto Sans Local';
  src: url('/static/fonts/NotoSans-Light.woff2') format('woff2');
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Noto Sans Local';
  src: url('/static/fonts/NotoSans-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Noto Sans Local';
  src: url('/static/fonts/NotoSans-Medium.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Noto Sans Local';
  src: url('/static/fonts/NotoSans-Bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}


:root {
  --tile-min-width: 220px;
  --tile-height: 124px;
  --tile-aspect-ratio: calc(var(--tile-height) / var(--computed-tile-width));
  --page-max-width: 1600px;
  --page-background: radial-gradient(circle at top left, rgba(30, 41, 59, 0.85), rgba(15, 23, 42, 0.96)), linear-gradient(135deg, #334155 0%, #0f172a 100%);
  --tiles-per-row: 8;
  --actual-cols: 8;
  --tile-gap: 28px;
  --grid-gap-x: 28px;
  --computed-tile-width: var(--tile-min-width);
  --grid-gap-y: 24px;
  --clock-font-family: 'Noto Sans Local', Inter, system-ui, Arial, sans-serif;
  --clock-font-weight: 700;
  --clock-font-style: normal;
  --clock-color: #dbeafe;
  --date-font-family: 'Noto Sans Local', Inter, system-ui, Arial, sans-serif;
  --date-font-weight: 600;
  --date-font-style: normal;
  --date-color: #c7d2fe;
  --datetime-edge-padding-x: 12px;
  --datetime-edge-padding-y: 12px;
  --datetime-reserve-height: 84px;
  --text-main: #eff4ff;
  --text-soft: rgba(239, 244, 255, 0.72);
  --panel: rgba(255, 255, 255, 0.08);
  --panel-strong: rgba(255, 255, 255, 0.14);
  --border: rgba(255,255,255,0.10);
  --shadow: 0 10px 40px rgba(0,0,0,0.28);
}
* { box-sizing: border-box; }
html, body { min-height: 100%; margin: 0; font-family: Inter, system-ui, Arial, sans-serif; color: var(--text-main); }
body {
  background: var(--page-background);
  display: flex;
  align-items: stretch;
  justify-content: center;
}
a { color: inherit; text-decoration: none; }
button, input, select {
  font: inherit;
}
.page-shell {
  position: relative;
  width: 100%;
  max-width: none;
  margin: 0 auto;
  min-height: 100vh;
  padding: 20px 18px 26px;
  display: flex;
  flex-direction: column;
}
.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 2px 0 18px;
}
.brand {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: .02em;
  text-shadow: 0 2px 14px rgba(0,0,0,0.3);
}
.brand-spacer { flex: 1 1 auto; }
.topbar-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.datetime-wrap {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 0;
  min-height: 0;
  overflow: visible;
  pointer-events: none;
  z-index: 8;
  flex: 0 0 0;
  background: transparent;
}

.datetime-wrap::before {
  content: none;
}
.datetime-block {
  position: absolute;
  top: var(--datetime-edge-padding-y);
  display: inline-flex;
  flex-direction: column;
  gap: 2px;
  text-shadow: 0 2px 14px rgba(0,0,0,0.3);
  min-height: 0;
  justify-content: flex-start;
  width: auto;
  color: var(--clock-color);
}
body[data-datetime-align="left"] .datetime-block {
  position: absolute;
  top: var(--datetime-edge-padding-y);
  display: inline-flex;
  flex-direction: column;
  gap: 2px;
  text-shadow: 0 2px 14px rgba(0,0,0,0.3);
  min-height: 0;
  justify-content: flex-start;
  width: auto;
  color: var(--clock-color);
}
body[data-datetime-align="center"] .datetime-block {
  position: absolute;
  top: var(--datetime-edge-padding-y);
  display: inline-flex;
  flex-direction: column;
  gap: 2px;
  text-shadow: 0 2px 14px rgba(0,0,0,0.3);
  min-height: 0;
  justify-content: flex-start;
  width: auto;
  color: var(--clock-color);
}
body[data-datetime-align="right"] .datetime-block {
  position: absolute;
  top: var(--datetime-edge-padding-y);
  display: inline-flex;
  flex-direction: column;
  gap: 2px;
  text-shadow: 0 2px 14px rgba(0,0,0,0.3);
  min-height: 0;
  justify-content: flex-start;
  width: auto;
  color: var(--clock-color);
}
.datetime-block.is-empty { opacity: 0; pointer-events: none; }
.clock-text { font-size: 34px; line-height: 1; font-family: var(--clock-font-family); font-weight: var(--clock-font-weight); font-style: var(--clock-font-style); color: var(--clock-color); }
.date-text { font-size: 15px; line-height: 1.15; color: var(--date-color); font-family: var(--date-font-family); font-weight: var(--date-font-weight); font-style: var(--date-font-style); }
button {
  background: rgba(255,255,255,0.16);
  color: white;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 12px;
  cursor: pointer;
  backdrop-filter: blur(12px);
}
button:hover {
  background: rgba(255,255,255,0.22);
}
button.ghost {
  background: rgba(10,15,25,0.35);
}
button.danger {
  border-color: rgba(255, 140, 140, 0.4);
}
.folder-strip-wrap {
  margin-bottom: 22px;
}
.folder-strip {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 6px;
}
.folder-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
  border-radius: 999px;
  padding: 11px 16px;
  background: rgba(12, 18, 30, 0.33);
  transition: background .18s ease, box-shadow .18s ease, transform .18s ease, opacity .18s ease;
}
body[data-show-folder-background="0"] .folder-pill {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  padding-left: 8px;
  padding-right: 8px;
}
body[data-show-folder-background="0"] .folder-pill.active {
  background: transparent;
  box-shadow: none;
  text-decoration: underline;
  text-underline-offset: 6px;
}
.folder-pill.active {
  background: rgba(255,255,255,0.2);
  box-shadow: var(--shadow);
}
.folder-mini-actions {
  display: inline-flex;
  gap: 8px;
  opacity: .85;
}
.folder-mini-actions span {
  font-size: 13px;
}
.grid-wrap {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  min-height: 0;
  padding-top: 0;
}
.tile-grid {
  display: flex;
  flex-wrap: wrap;
  gap: var(--grid-gap-y) var(--grid-gap-x);
  align-content: flex-start;
  justify-content: center;
  width: min(100%, calc(var(--actual-cols) * var(--computed-tile-width) + (var(--actual-cols) - 1) * var(--grid-gap-x)));
  max-width: 100%;
  margin: 0 auto;
}
.tile {
  position: relative;
  display: flex;
  flex: 0 0 var(--computed-tile-width);
  width: var(--computed-tile-width);
  flex-direction: column;
  gap: 3px;
  transition: transform 120ms linear, box-shadow 180ms ease, opacity 140ms ease;
  will-change: transform;
  background: transparent;
  border: 0;
  outline: none;
  box-shadow: none;
}
.tile-link {
  display: flex;
  width: 100%;
  flex-direction: column;
  gap: 3px;
  background: transparent;
  border: 0;
  outline: none;
  box-shadow: none;
}
.tile-link:focus, .tile-link:focus-visible { outline: none; box-shadow: none; }

.tile-link {
  cursor: pointer;
  user-select: none;
  -webkit-user-drag: none;
}
body.admin .tile-link { touch-action: none; }
.tile-image {
  height: var(--tile-height);
  background: #000;
  border: 0;
  box-shadow: 0 10px 34px rgba(0,0,0,0.28);
  background-size: contain;
  background-position: center center;
  background-repeat: no-repeat;
  display: flex;
  align-items: stretch;
  justify-content: center;
  position: relative;
  overflow: hidden;
  transition: transform .18s ease, box-shadow .22s ease, opacity .18s ease;
}
body[data-shape="rounded"] .tile-image { border-radius: 8px; }
body[data-shape="square"] .tile-image { border-radius: 0; }
.tile:hover .tile-image {
  transform: none;
}
.tile.drop-target .tile-image {
  box-shadow: 0 12px 38px rgba(0,0,0,0.32), 0 0 0 2px rgba(255,255,255,0.26);
  transform: scale(1.03);
}
.tile.dragging {
  z-index: 5;
}
.tile.dragging .tile-image {
  opacity: 0.5;
  transform: scale(0.98);
}
.tile-overlay-title {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  z-index: 2;
  padding: 8px 10px;
  border-radius: 12px;
  font-weight: 600;
  background: rgba(12, 18, 30, 0.56);
  backdrop-filter: blur(8px);
}
.tile-meta {
  min-height: 25px;
  padding: 0 8px 0;
  display: flex;
  align-items: stretch;
  justify-content: center;
  text-align: center;
  transition: opacity .18s ease;
}
.tile-title {
  width: 100%;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.15;
  margin-top: 2px;
}
.tile-subtitle { display: none !important; }
body[data-show-below="0"] .tile-meta { opacity: 1; visibility: visible; pointer-events: none; }
body[data-show-below="0"] .tile-title { opacity: 0; visibility: hidden; }
body[data-show-overlay="0"] .tile-overlay-title { display: none; }

.footer-note {
  min-height: 22px;
  padding-top: 14px;
  color: var(--text-soft);
  font-size: 13px;
}
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  z-index: 60;
}
.modal {
  width: min(520px, calc(100vw - 36px));
  background: rgba(20, 20, 20, 0.94);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 12px;
  padding: 14px;
  box-shadow: 0 16px 34px rgba(0,0,0,0.42);
  backdrop-filter: blur(10px);
  max-height: calc(100vh - 36px);
  overflow: auto;
}
.modal.wide { width: min(980px, calc(100vw - 36px)); }
.modal h2 {
  margin: 0 0 10px;
  font-size: 18px;
}
label {
  display: block;
  font-size: 12px;
  color: var(--text-soft);
  margin-bottom: 7px;
}
input, select {
  width: 100%;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.06);
  color: white;
  padding: 9px 10px;
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.form-grid .full {
  grid-column: 1 / -1;
}
.modal-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  align-items: center;
}
.grow { flex: 1; }
.error {
  min-height: 20px;
  margin-top: 10px;
  color: #ffb4b4;
}
.hint {
  margin-top: 8px;
  color: var(--text-soft);
  font-size: 12px;
}
@media (max-width: 700px) {
  .page-shell { max-width: calc(100vw - 12px); padding: 12px 8px 16px; }
  .brand { font-size: 22px; }
  .topbar { flex-direction: column; align-items: flex-start; padding-bottom: 14px; }
  .tile-grid { gap: 16px 12px; }
  .form-grid { grid-template-columns: 1fr; }
}


.tile.dragging { opacity: .55; }
.folder-pill.dragging { opacity: .6; }
.tile.drop-target .tile-image, .tile:hover .tile-image {
  transform: translateY(-2px);
  transition: transform .16s ease, box-shadow .16s ease;
  box-shadow: 0 14px 44px rgba(0,0,0,0.34);
}


.tile.drop-target .tile-image { outline: none; }
.tile.dragging { opacity: .85; }
.tile.dragging { opacity: 0.6; }

.hint {
  font-size: 12px;
  color: var(--text-soft);
  margin-top: 6px;
}

@media (max-width: 720px) {
  .page-shell { padding-left: 12px; padding-right: 12px; }
  .form-grid { grid-template-columns: 1fr; }
}

.tile.dragging { opacity: 0.65; }
.tile-handle { user-select: none; }

.tile.drag-source {
  opacity: 0.35;
}
.tile.drag-source .tile-image {
  transform: scale(0.98);
}
.drag-proxy {
  position: fixed;
  z-index: 1000;
  pointer-events: none;
  opacity: 0.96;
  transform: scale(1.03);
  filter: drop-shadow(0 22px 42px rgba(0,0,0,0.42));
}
.drag-proxy .tile-image {
  margin: 0;
}

body[data-show-page-title="0"] .brand { display:none; }
body[data-show-folder-strip="0"] .folder-strip-wrap { display:none; }
.drag-proxy { position: fixed; z-index: 9999; pointer-events: none; transform: scale(1.02); opacity: .96; filter: drop-shadow(0 16px 30px rgba(0,0,0,.35)); }
.drag-proxy .tile-image { transition:none !important; }


/* v10 drag polish */
.tile-grid { position: relative; }
.tile { transition: transform 160ms cubic-bezier(0.22, 1, 0.36, 1), box-shadow 130ms ease, opacity 110ms ease; }
.tile-image { transition: transform .16s ease, box-shadow .16s ease, opacity .12s ease; }
.tile.drag-source { opacity: 0.20; }
.tile.drag-source .tile-image { transform: scale(0.97); }
.tile.drop-target .tile-image { box-shadow: 0 16px 46px rgba(0,0,0,0.36), 0 0 0 2px rgba(255,255,255,0.28); }
.drag-proxy {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: .98;
  will-change: transform;
  transition: none;
  filter: drop-shadow(0 18px 34px rgba(0,0,0,.36));
}
.drag-proxy.drop-settling {
  transition: transform 180ms cubic-bezier(0.2, 0.9, 0.25, 1), opacity 180ms ease;
}
.drag-proxy .tile-image,
.drag-proxy .tile-meta { transition: none !important; }

.tile.dragging .tile-link { visibility: hidden; }
.context-backdrop { position: fixed; inset: 0; z-index: 80; }
.context-menu { position: fixed; min-width: 190px; background: rgba(20, 20, 20, 0.94); border: 1px solid rgba(255,255,255,0.12); border-radius: 12px; box-shadow: 0 16px 34px rgba(0,0,0,0.42); overflow: hidden; z-index: 81; backdrop-filter: blur(10px); }
.context-menu button { display:block; width:100%; text-align:left; background:transparent; border:0; border-radius:0; padding:9px 11px; font-size: 13px; line-height: 1.2; }
.context-menu button:hover { background: rgba(255,255,255,0.09); }
.context-menu .danger-item { color: #ffb4b4; }


/* v11h polish */
.context-menu { background: rgba(20, 20, 20, 0.94) !important; color: #f8fafc !important; }
.context-menu button { background: transparent !important; color: #f8fafc !important; border: 0 !important; box-shadow: none !important; text-shadow: none !important; }
.context-menu button:hover { background: rgba(255,255,255,0.16) !important; color: #f8fafc !important; }
.context-menu .danger-item { color: #ffb4b4 !important; }
.context-menu .danger-item:hover { background: rgba(255,140,140,0.12) !important; color: #ffd5d5 !important; }


/* v11i fixes */
.tile-image {
  background-color: #000000;
  background-image: none;
  border: 0 !important;
  outline: none !important;
  box-shadow: 0 10px 28px rgba(0,0,0,0.28) !important;
}
.tile-image::after { display:none !important; }
body[data-shape="rounded"] .tile-image { border-radius: 8px !important; }
body[data-shape="square"] .tile-image { border-radius: 0 !important; }
.tile.drop-target .tile-image {
  box-shadow: 0 12px 34px rgba(0,0,0,0.30) !important;
}
.tile:hover .tile-image {
  transform: none;
}
.tile.drag-source { opacity: 0.12 !important; }
.tile.drag-source .tile-link { visibility: hidden !important; }
.drag-proxy .tile-handle, .drag-proxy .tile-edit { display:none !important; }
.drag-proxy .tile-image { box-shadow: 0 18px 36px rgba(0,0,0,0.34) !important; }
.drag-proxy.drop-settling {
  transition: none !important;
}
select, option, optgroup {
  color: #0f172a !important;
  background: #ffffff !important;
}
.context-menu, .context-menu * {
  color: #f8fafc !important;
}


/* keep hover calm but preserve tile shadow */
.tile:hover .tile-image, .tile-link:hover .tile-image, .tile-link:focus-visible .tile-image {
  transform: none !important;
  box-shadow: 0 10px 34px rgba(0,0,0,0.28) !important;
}
.tile.drop-target .tile-image {
  transform: none !important;
  box-shadow: 0 12px 38px rgba(0,0,0,0.32), 0 0 0 2px rgba(255,255,255,0.26) !important;
}
.tile-link, .tile-image, .tile {
  transition: opacity .09s ease, box-shadow .09s ease, transform .06s linear;
}

/* v11t fixes */
.tile-grid { width: min(100%, calc(var(--actual-cols) * var(--computed-tile-width) + (var(--actual-cols) - 1) * var(--grid-gap-x))); }
.drag-proxy { transition: none !important; }

.topbar-hint{color: rgba(255,255,255,0.68);font-size: 13px;}
.page-menu{min-width:220px;}

/* v12 polish */
.toggle-stack { display: grid; gap: 10px; }
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
}
.toggle-row > span:first-child { color: var(--text-main); font-size: 14px; }
.toggle-switch { position: relative; display: inline-flex; align-items: center; }
.toggle-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.toggle-slider {
  width: 48px; height: 28px; border-radius: 999px;
  background: rgba(148,163,184,0.45); position: relative; transition: background .18s ease;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.08);
}
.toggle-slider::after {
  content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px;
  border-radius: 50%; background: #fff; transition: transform .18s ease;
  box-shadow: 0 2px 8px rgba(0,0,0,0.22);
}
.toggle-switch input:checked + .toggle-slider { background: #3b82f6; }
.toggle-switch input:checked + .toggle-slider::after { transform: translateX(20px); }
.path-field { display: grid; grid-template-columns: auto 1fr; gap: 0; }
.path-prefix {
  display: inline-flex; align-items: center; padding: 0 12px; border-radius: 12px 0 0 12px;
  background: rgba(255,255,255,0.10); color: var(--text-soft); border: 1px solid var(--border); border-right: 0;
}
.path-field input { border-radius: 0 12px 12px 0; }
.palette-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.color-swatch {
  width: 100%; aspect-ratio: 1.8 / 1; border-radius: 10px; border: 2px solid rgba(255,255,255,0.18);
  padding: 0; min-height: 40px; box-shadow: 0 6px 18px rgba(0,0,0,0.18);
}
.color-swatch.active { border-color: #ffffff; box-shadow: 0 0 0 2px rgba(59,130,246,0.45), 0 8px 18px rgba(0,0,0,0.28); }
.delete-toast {
  position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 90;
  display: flex; align-items: center; gap: 16px; min-width: min(560px, calc(100vw - 24px));
  background: rgba(10,14,22,0.95); border: 1px solid rgba(255,255,255,0.10); border-radius: 14px;
  padding: 12px 14px; box-shadow: 0 18px 40px rgba(0,0,0,0.38); backdrop-filter: blur(16px);
}
.delete-toast-sub { color: var(--text-soft); font-size: 13px; margin-top: 2px; }
.delete-toast-actions { margin-left: auto; display: flex; gap: 10px; }
.delete-toast .ghost { background: rgba(255,255,255,0.08); }
#tile-image-picker option, #background-picker option { color: #0f172a !important; background: #fff !important; }


/* v12a options and tile-title polish */
.topbar-actions:empty { display:none; }
body[data-showOverlay="1"] .tile-overlay-title { display: none !important; }
.toggle-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 12px;
}
.options-layout {
  gap: 14px;

  display: grid;
  gap: 16px;
}
.options-section {
  border-top: 1px solid rgba(255,255,255,0.10);
  padding-top: 14px;
}
.options-section:first-child {
  border-top: 0;
  padding-top: 0;
}
.options-section-header {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-soft);
  margin-bottom: 12px;
}
.options-section-body {
  display: grid;
  gap: 12px;
}
.compact-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
@media (max-width: 700px) {
  .toggle-grid { grid-template-columns: 1fr; }
  .compact-grid { grid-template-columns: 1fr; }
}
.color-picker-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.12);
}
.color-picker-row label {
  margin: 0;
  color: var(--text-main);
  font-size: 14px;
}
#tile-color-picker {
  width: 56px;
  min-width: 56px;
  height: 36px;
  padding: 3px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.08);
}

.deleted-list { display:grid; gap:10px; max-height:50vh; overflow:auto; }
.deleted-row { display:flex; justify-content:space-between; align-items:center; gap:12px; padding:12px; border-radius:12px; background:rgba(255,255,255,0.05); border:1px solid rgba(255,255,255,0.08); }
.deleted-row-main { min-width:0; }
.deleted-row-title { font-weight:600; }
.deleted-row-sub { color:var(--text-soft); font-size:12px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; max-width:420px; }
.deleted-row-actions { display:flex; gap:8px; }


.options-stack { display:grid; gap:12px; }
.radio-choice {
  display:grid;
  gap:8px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.12);
}
.radio-choice-label {
  color: var(--text-main);
  font-size: 14px;
}
.radio-choice-group {
  display:flex;
  flex-wrap:wrap;
  gap:8px;
}
.radio-pill {
  position:relative;
  display:inline-flex;
}
.radio-pill input {
  position:absolute;
  opacity:0;
  pointer-events:none;
}
.radio-pill span {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:84px;
  padding:9px 12px;
  border-radius:999px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  color: var(--text-main);
}
.radio-pill input:checked + span {
  background:#3b82f6;
  border-color:#60a5fa;
  color:#fff;
  box-shadow: 0 8px 18px rgba(59,130,246,0.28);
}

.options-section-body .compact-grid label{font-size:13px;}
.options-section-body .compact-grid input, .options-section-body .compact-grid select{padding:8px 10px;}


/* v12g options tabs + gap fix */
.modal.wide.options-modal { width: min(1040px, calc(100vw - 24px)); }
.options-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.options-tab {
  border-radius: 999px;
  padding: 7px 12px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.10);
  color: var(--text-main);
}
.options-tab.active {
  background: rgba(59,130,246,0.24);
  border-color: rgba(96,165,250,0.55);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.06);
}
.options-layout-tabbed {
  min-height: 400px;
}
.options-compact label {
  font-size: 11px;
  margin-bottom: 4px;
}
.options-compact input,
.options-compact select,
.options-compact button {
  padding: 7px 9px;
  font-size: 13px;
}
.options-stack {
  display: grid;
  gap: 12px;
}
@media (max-width: 800px) {
  .modal.wide.options-modal { width: min(96vw, 820px); max-height: calc(100vh - 16px); }
  .options-layout-tabbed { min-height: 0; }
}

.options-panel { display: none; }
.options-panel.active { display: block; }


.options-modal .options-tabs { display:flex; gap:6px; margin-bottom: 10px; }
.options-modal .options-tab { padding: 7px 10px; border-radius: 8px; font-size: 13px; }
.options-modal .options-section { margin-bottom: 12px; }
.options-modal .options-section-header { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: rgba(255,255,255,.62); margin-bottom: 8px; }
.options-modal .options-layout { min-height: 360px; }
.options-modal .radio-choice-group { display:flex; gap:8px; flex-wrap:wrap; }
.options-modal .radio-pill span { padding: 7px 10px; border-radius: 8px; background: rgba(255,255,255,0.04); border:1px solid rgba(255,255,255,0.08); display:inline-block; }
.options-modal .radio-pill input { display:none; }
.options-modal .radio-pill input:checked + span { background: rgba(255,255,255,0.14); }

.compact-modal { width: min(460px, calc(100vw - 36px)); }
.form-grid.single-col { grid-template-columns: 1fr; }
.modal, .options-modal, .xwide { color: rgba(255,255,255,0.96); }
.modal label { color: rgba(255,255,255,0.78); }
.modal input, .modal select { background: rgba(255,255,255,0.09); }

.deleted-note{font-size:12px;color:rgba(255,255,255,.68);margin-bottom:10px;}
.deleted-list{display:flex;flex-direction:column;gap:8px;max-height:48vh;overflow:auto;}
.deleted-row{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:10px 12px;border:1px solid rgba(255,255,255,.08);border-radius:10px;background:rgba(255,255,255,.04);}
.deleted-title{font-size:14px;font-weight:600;}
.deleted-meta{font-size:12px;color:rgba(255,255,255,.62);margin-top:2px;}
.deleted-empty{padding:12px;border:1px dashed rgba(255,255,255,.12);border-radius:10px;color:rgba(255,255,255,.72);}


/* patch: no drag-over border glow */
.tile.drop-target .tile-image,
.tile:hover .tile-image {
  transform: none !important;
  outline: none !important;
  box-shadow: 0 10px 34px rgba(0,0,0,0.28) !important;
}


/* v12gkw3: options sidebar drawer + tiles higher */
.modal-backdrop.options-drawer-backdrop {
  justify-content: flex-end;
  align-items: stretch;
  padding: 0;
  background: rgba(0,0,0,0.42);
}
.options-modal.drawer {
  width: min(560px, 94vw);
  max-width: 560px;
  height: 100vh;
  max-height: 100vh;
  margin: 0;
  border-radius: 0;
  border-left: 1px solid rgba(255,255,255,0.12);
  border-right: 0;
  border-top: 0;
  border-bottom: 0;
  padding: 12px 12px 14px;
  background: rgba(34, 34, 34, 0.96);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.options-drawer-header {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding: 2px 2px 10px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  margin-bottom: 10px;
}
.options-drawer-header h2 { margin:0; font-size:16px; }
.options-drawer-shell {
  display:grid;
  grid-template-columns: 132px minmax(0,1fr);
  gap: 12px;
  min-height: 0;
  flex: 1;
}
.options-sidebar {
  display:flex;
  flex-direction:column;
  gap: 6px;
  padding-right: 10px;
  border-right: 1px solid rgba(255,255,255,0.08);
}
.options-sidebar .options-tab {
  width:100%;
  text-align:left;
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 13px;
  background: rgba(255,255,255,0.05);
}
.options-content {
  min-height:0;
  overflow:auto;
  padding-right: 4px;
}
.options-content .options-layout-tabbed { min-height: 0; }
.options-content .options-panel.active { display:block; }
.options-content .toggle-grid {
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 8px 10px;
}
.options-content .toggle-card {
  padding: 8px 10px;
  min-height: 48px;
}
.options-content .toggle-label { font-size: 12px; }
.options-content .options-section { margin-bottom: 10px; }
.options-content .options-section-header { margin-bottom: 6px; font-size: 11px; }
.options-content .form-grid { gap: 8px; }
.options-content .options-compact label { font-size: 10px; margin-bottom: 3px; }
.options-content .options-compact input,
.options-content .options-compact select,
.options-content .options-compact button { padding: 6px 8px; font-size: 12px; }
.options-content .radio-pill span { min-width: 70px; padding: 6px 8px; font-size: 12px; }
.options-modal.drawer .modal-actions {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(255,255,255,0.08);
}
@media (max-width: 760px) {
  .options-modal.drawer { width: 100vw; max-width: 100vw; }
  .options-drawer-shell { grid-template-columns: 1fr; }
  .options-sidebar {
    flex-direction: row;
    border-right: 0;
    padding-right: 0;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    overflow:auto;
  }
  .options-sidebar .options-tab { width:auto; white-space:nowrap; }
}


/* sidebar motion polish */
.options-drawer-backdrop.opening { animation: optionsBackdropIn .18s ease both; }
.options-drawer-backdrop.closing { animation: optionsBackdropOut .18s ease both; }
.options-modal.drawer.opening { animation: optionsDrawerIn .18s cubic-bezier(0.22, 1, 0.36, 1) both; }
.options-modal.drawer.closing { animation: optionsDrawerOut .18s cubic-bezier(0.4, 0, 1, 1) both; }
@keyframes optionsDrawerIn {
  from { transform: translateX(28px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}
@keyframes optionsDrawerOut {
  from { transform: translateX(0); opacity: 1; }
  to { transform: translateX(28px); opacity: 0; }
}
@keyframes optionsBackdropIn {
  from { background: rgba(0,0,0,0); }
  to { background: rgba(0,0,0,0.42); }
}
@keyframes optionsBackdropOut {
  from { background: rgba(0,0,0,0.42); }
  to { background: rgba(0,0,0,0); }
}


/* v12 mobile/tablet responsive tuning */
@media (max-width: 1024px) {
  :root {
    --datetime-reserve-height: 76px;
  }
  .page-shell {
    padding: 16px 14px 22px;
  }
  .options-drawer {
    width: min(420px, calc(100vw - 14px));
  }
}

@media (max-width: 820px) {
  :root {
    --grid-gap-x: 28px;
    --grid-gap-y: 24px;
    --datetime-reserve-height: 72px;
  }
  .page-shell {
    padding: 12px 10px 18px;
  }
  .clock-text { font-size: 28px; }
  .date-text { font-size: 13px; }
  .options-drawer {
    width: min(390px, calc(100vw - 10px));
  }
  .tile-title {
    font-size: 13px;
  }
}

@media (max-width: 560px) {
  :root {
    --grid-gap-x: 28px;
    --grid-gap-y: 24px;
    --datetime-reserve-height: 64px;
  }
  .page-shell {
    padding: 10px 8px 16px;
  }
  .clock-text { font-size: 24px; }
  .date-text { font-size: 12px; }
  .options-drawer {
    width: calc(100vw - 6px);
    border-radius: 14px 0 0 14px;
  }
  .tile-title {
    font-size: 12px;
  }
}


/* mobile/tablet grid + header reserve */
@media (max-width: 820px) {
  .tile-grid { width: min(100%, calc(var(--actual-cols) * var(--computed-tile-width) + (var(--actual-cols) - 1) * var(--grid-gap-x))); }
.datetime-wrap {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 0;
  min-height: 0;
  overflow: visible;
  pointer-events: none;
  z-index: 8;
  flex: 0 0 0;
  background: transparent;
}

}
@media (max-width: 560px) {
.datetime-wrap {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 0;
  min-height: 0;
  overflow: visible;
  pointer-events: none;
  z-index: 8;
  flex: 0 0 0;
  background: transparent;
}

  .tile-title { font-size: 11px; }
}

@media (max-width: 820px) {
  .page-shell { padding-left: 12px; padding-right: 12px; }
  .folder-strip-wrap { margin-bottom: 14px; }
  .tile-grid { gap: calc(var(--grid-gap-y) - 1px) calc(var(--grid-gap-x) - 1px); }
  .tile-title { font-size: 13px; }
  .clock-text { font-size: 28px; }
  .date-text { font-size: 14px; }
}
@media (max-width: 560px) {
  :root { --datetime-reserve-height: 74px; }
  .page-shell { padding: 10px 8px 16px; }
  .folder-pill { padding: 8px 12px; }
  .tile-meta { min-height: 22px; padding: 0 4px 0; }
  .tile-title { font-size: 12px; line-height: 1.1; }
  .clock-text { font-size: 24px; }
  .date-text { font-size: 12px; }
}


@media (hover: hover) and (pointer: fine) {
  .tile-image { height: var(--tile-height) !important; }
}

/* Sortable ported movement layer */
.tile-grid .tile { touch-action: none; }
.tile.drag-source { opacity: 0.18 !important; }
.tile.drag-source .tile-link { visibility: hidden !important; }
.selected { opacity: 0 !important; }
.drag-proxy-sortable {
  position: fixed !important;
  z-index: 9999 !important;
  pointer-events: none !important;
  opacity: 0.96 !important;
  filter: drop-shadow(0 16px 30px rgba(0,0,0,.35));
}
.drag-proxy-sortable .tile-link,
.drag-proxy-sortable .tile-image,
.drag-proxy-sortable .tile-meta {
  transition: none !important;
}
body.tile-sort-active .tile-grid { cursor: grabbing; }


/* Sortable visual layer v2 */
.drag-proxy-sortable {
  opacity: 0 !important;
  visibility: hidden !important;
}
.drag-proxy {
  position: fixed !important;
  left: 0;
  top: 0;
  z-index: 10000 !important;
  pointer-events: none !important;
  opacity: 0.98 !important;
  will-change: transform !important;
  transition: none !important;
  filter: drop-shadow(0 18px 34px rgba(0,0,0,.36));
}
.drag-proxy .tile-image,
.drag-proxy .tile-meta,
.drag-proxy .tile-link {
  transition: none !important;
}
.tile.drag-source { opacity: 0.10 !important; }
.tile.drag-source .tile-link { visibility: hidden !important; }
.tile-grid.sort-animating .tile {
  transition: transform 170ms cubic-bezier(0.22, 1, 0.36, 1), opacity 100ms ease !important;
}

/* Clock/date reset */
.datetime-wrap {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 0 !important;
  min-height: 0 !important;
  flex: 0 0 0 !important;
  overflow: visible !important;
  pointer-events: none !important;
  z-index: 8 !important;
  background: transparent !important;
}

.datetime-block {
  position: absolute !important;
  top: var(--datetime-edge-padding-y, 12px) !important;
  display: inline-flex !important;
  flex-direction: column !important;
  gap: 2px !important;
  width: auto !important;
  min-height: 0 !important;
  transform: none;
}

body[data-datetime-align="right"] .datetime-block {
  right: calc(26px + var(--datetime-edge-padding-x, 12px)) !important;
  left: auto !important;
  text-align: right !important;
  align-items: flex-end !important;
}

body[data-datetime-align="left"] .datetime-block {
  left: calc(26px + var(--datetime-edge-padding-x, 12px)) !important;
  right: auto !important;
  text-align: left !important;
  align-items: flex-start !important;
}

body[data-datetime-align="center"] .datetime-block {
  left: 50% !important;
  right: auto !important;
  transform: translateX(-50%) !important;
  text-align: center !important;
  align-items: center !important;
}

/* Resize overlay - tiles only */








/* Clock/date barrier above tiles */
.datetime-wrap {
  position: relative !important;
  top: auto !important;
  left: auto !important;
  width: 100% !important;
  height: var(--datetime-reserve-height, 104px) !important;
  min-height: var(--datetime-reserve-height, 104px) !important;
  flex: 0 0 var(--datetime-reserve-height, 104px) !important;
  overflow: visible !important;
  pointer-events: none !important;
  z-index: 8 !important;
  background: transparent !important;
}

.datetime-block {
  position: absolute !important;
  top: var(--datetime-edge-padding-y, 12px) !important;
}

.grid-wrap {
  align-items: flex-start !important;
  padding-top: 18px !important;
}

body[data-datetime-align="right"] .datetime-block {
  right: calc(26px + var(--datetime-edge-padding-x, 12px)) !important;
  left: auto !important;
}

body[data-datetime-align="left"] .datetime-block {
  left: calc(26px + var(--datetime-edge-padding-x, 12px)) !important;
  right: auto !important;
}

body[data-datetime-align="center"] .datetime-block {
  left: 50% !important;
  right: auto !important;
  transform: translateX(-50%) !important;
}


/* Clock/date barrier above the tiles */
.grid-wrap {
  padding-top: clamp(72px, 10vh, 128px) !important;
}

/* Clock/date barrier above tiles */
.datetime-wrap {
  position: relative !important;
  width: 100% !important;
  height: var(--datetime-reserve-height, 104px) !important;
  min-height: var(--datetime-reserve-height, 104px) !important;
  flex: 0 0 var(--datetime-reserve-height, 104px) !important;
  overflow: visible !important;
  pointer-events: none !important;
  z-index: 8 !important;
  background: transparent !important;
}

.datetime-block,
#datetime-block {
  position: absolute !important;
  top: var(--datetime-edge-padding-y, 12px) !important;
}

body[data-datetime-align="right"] .datetime-block {
  right: calc(26px + var(--datetime-edge-padding-x, 12px)) !important;
  left: auto !important;
}

body[data-datetime-align="left"] .datetime-block {
  left: calc(26px + var(--datetime-edge-padding-x, 12px)) !important;
  right: auto !important;
}

body[data-datetime-align="center"] .datetime-block {
  left: 50% !important;
  right: auto !important;
  transform: translateX(-50%) !important;
}

/* Resize animation: JS owns tile transforms */
body.tile-resize-animating #tile-grid > .tile[data-tile-id],
body.tile-resize-animating .tile-grid > .tile[data-tile-id] {
  transition: none !important;
  will-change: transform !important;
  backface-visibility: hidden !important;
  -webkit-backface-visibility: hidden !important;
}

body.tile-resize-animating #tile-grid > .tile[data-tile-id] *,
body.tile-resize-animating .tile-grid > .tile[data-tile-id] * {
  transition-property: opacity, box-shadow, color, background-color !important;
}

/* Clean YASD-style resize ownership */
body.tile-resize-animating #tile-grid > .tile[data-tile-id],
body.tile-resize-animating .tile-grid > .tile[data-tile-id] {
  transition: none !important;
  will-change: transform !important;
  backface-visibility: hidden !important;
  -webkit-backface-visibility: hidden !important;
}

/* YASD-style drop settling */
.tile.drop-receiving .tile-link {
  visibility: hidden !important;
}

.drag-proxy.drop-settling {
  pointer-events: none !important;
  z-index: 99999 !important;
  transition: none !important;
}


/* Make drag release snap cleanly, closer to YASD */
.drag-proxy,
.drag-proxy *,
.drag-proxy.drop-settling,
.drag-proxy.drop-settling * {
  transition: none !important;
  animation: none !important;
}

.tile.drop-receiving .tile-link {
  visibility: visible !important;
}


/* Fix duplicate-looking tile during drop */
.tile.drop-receiving .tile-link,
.tile.drop-receiving .tile-image,
.tile.drop-receiving .tile-title {
  visibility: hidden !important;
}

/* Tighten/remove lingering drag shadow */
.drag-proxy,
.drag-proxy *,
.drag-proxy.drop-settling,
.drag-proxy.drop-settling * {
  box-shadow: none !important;
  filter: none !important;
  transition: none !important;
  animation: none !important;
}

/* Make dragged/settling tile visually cleaner */
.tile.is-dragging,
.tile.dragging,
.tile.drag-active,
.tile.drop-receiving {
  box-shadow: none !important;
}


/* Strong consistent tile shadow, including after drag/drop cleanup */
.tile,
.tile *,
.tile .tile-link,
.tile-link,
.tile.is-dragging .tile-link,
.tile.dragging .tile-link,
.tile.drag-active .tile-link,
.tile.drop-receiving .tile-link,
.drag-proxy,
.drag-proxy .tile-link {
  filter: none !important;
}

.tile .tile-link,
.tile-link,
.tile.is-dragging .tile-link,
.tile.dragging .tile-link,
.tile.drag-active .tile-link,
.tile.drop-receiving .tile-link,
.drag-proxy,
.drag-proxy .tile-link {
  box-shadow: 0 10px 26px rgba(0,0,0,0.28) !important;
}

/* Don't let older drag/drop rules remove the shadow */
.tile.drop-receiving,
.tile.is-dragging,
.tile.dragging,
.tile.drag-active {
  box-shadow: none !important;
}


/* Fix tile shadow: only image/card area gets shadow, not label/title area */
.tile,
.tile *,
.tile .tile-link,
.tile-link,
.tile-title {
  box-shadow: none !important;
  filter: none !important;
}

/* Apply shadow only to the visual tile image/background area */
.tile-image,
.drag-proxy .tile-image,
.tile.is-dragging .tile-image,
.tile.dragging .tile-image,
.tile.drag-active .tile-image,
.tile.drop-receiving .tile-image {
  box-shadow: 0 10px 26px rgba(0,0,0,0.28) !important;
  filter: none !important;
}

/* Keep titles/labels clean */
.tile-title,
.tile .tile-title,
.drag-proxy .tile-title {
  box-shadow: none !important;
  filter: none !important;
}


/* Stop any outer-tile shadow flash on drop */
.tile,
.tile-link,
.tile .tile-link,
.tile-title,
.tile .tile-title,
.drag-proxy,
.drag-proxy .tile-link,
.drag-proxy .tile-title,
.tile.is-dragging .tile-link,
.tile.dragging .tile-link,
.tile.drag-active .tile-link,
.tile.drop-receiving .tile-link,
.tile.is-dragging,
.tile.dragging,
.tile.drag-active,
.tile.drop-receiving {
  box-shadow: none !important;
  filter: none !important;
}

/* The ONLY place allowed to have a shadow */
.tile-image,
.tile .tile-image,
.drag-proxy .tile-image,
.tile.is-dragging .tile-image,
.tile.dragging .tile-image,
.tile.drag-active .tile-image,
.tile.drop-receiving .tile-image {
  box-shadow: 0 10px 26px rgba(0,0,0,0.28) !important;
  filter: none !important;
  transition: none !important;
}

/* Keep labels clean */
.tile-title,
.tile .tile-title,
.drag-proxy .tile-title {
  box-shadow: none !important;
  filter: none !important;
  transition: none !important;
}


/* Drop release should snap cleanly, no final settle/twitch */
.drag-proxy,
.drag-proxy.drop-settling {
  transition: none !important;
  animation: none !important;
}

.tile.drop-receiving,
.tile.drop-receiving .tile-link,
.tile.drop-receiving .tile-image,
.tile.drop-receiving .tile-title {
  transition: none !important;
  animation: none !important;
}


/* Move tile area upward without changing tile size or clock/date styling */
#tile-grid,
.tile-grid {
  transform: translateY(-18px) !important;
}


/* Move tile area upward a bit more */
#tile-grid,
.tile-grid {
  transform: translateY(-32px) !important;
}

