@import url("https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,300..900&family=IBM+Plex+Mono:wght@400;500;600&family=VT323&display=swap");

:root {
  --crt-black: #050203;
  --wallpaper-blue: #1b17d6;
  --cream: #ece2c8;
  --ink: #17130f;
  --ink-soft: rgba(23, 19, 15, .62);
  --divider: rgba(23, 19, 15, .14);

  --boot-fg: #e8dfc3;
  --amber: #f5b800;
  --amber-glow: rgba(245, 184, 0, .55);

  --font-display: "Fraunces", Georgia, serif;
  --font-mono: "IBM Plex Mono", Consolas, Menlo, monospace;
  --font-terminal: "VT323", Consolas, monospace;

  --frame-inset: 4.5vmin;
  --frame-radius: 64px;

  --ease-spring: cubic-bezier(.24, 1.1, .4, 1);
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

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

html, body {
  height: 100%;
  background:
    radial-gradient(ellipse 70% 55% at 50% 38%, rgba(255,255,255,.03), transparent 70%),
    #030303;
  overflow: hidden;
  font-family: var(--font-display);
  color: var(--ink);
  cursor: url(../images/cursor.svg) 12 12, auto;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
}

img.icon {
  width: 1em;
  height: 1em;
  display: block;
}

/* ---- CRT monitor shell (reused from the reference template) ---- */

.crt {
  position: fixed;
  inset: var(--frame-inset);
  background: radial-gradient(ellipse 120% 100% at 50% 50%, #0c0608, #060305 55%, #020001 90%, #000);
  border-radius: var(--frame-radius);
  overflow: hidden;
  isolation: isolate;
  --frame-glow: rgba(70, 70, 255, .5);
  box-shadow:
    0 0 1px 0 color-mix(in srgb, var(--frame-glow) 65%, transparent),
    0 0 3px 1px color-mix(in srgb, var(--frame-glow) 40%, transparent),
    0 0 42px 6px color-mix(in srgb, var(--frame-glow) 22%, transparent),
    0 0 120px 30px color-mix(in srgb, var(--frame-glow) 11%, transparent),
    0 0 240px 70px color-mix(in srgb, var(--frame-glow) 5%, transparent),
    inset 0 0 2px 0 color-mix(in srgb, var(--frame-glow) 25%, transparent);
  transition: box-shadow .3s ease-out;
}

.crt-screen {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  overflow: hidden;
}

/* vignette: darkens the four corners + edges of the tube (matches the reference template's recipe) */
.crt:before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background:
    radial-gradient(ellipse 60% 70% at 0% 0%, rgba(0,0,0,.4) 0%, transparent 55%),
    radial-gradient(ellipse 60% 70% at 100% 0%, rgba(0,0,0,.4) 0%, transparent 55%),
    radial-gradient(ellipse 60% 70% at 0% 100%, rgba(0,0,0,.4) 0%, transparent 55%),
    radial-gradient(ellipse 60% 70% at 100% 100%, rgba(0,0,0,.4) 0%, transparent 55%);
  box-shadow: inset 0 0 70px 16px rgba(0,0,0,.35);
  pointer-events: none;
  mix-blend-mode: multiply;
  z-index: 40;
}

/* scanlines, faded out toward the rim so they don't band the corners */
.crt:after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: repeating-linear-gradient(to bottom, #0000 0px 2px, #00000030 3px 4px);
  pointer-events: none;
  z-index: 25;
  mix-blend-mode: multiply;
  opacity: .5;
  -webkit-mask-image: radial-gradient(ellipse 100% 95% at 50% 50%, #000 60%, transparent 100%);
  mask-image: radial-gradient(ellipse 100% 95% at 50% 50%, #000 60%, transparent 100%);
}

.icon--invert {
  filter: invert(1);
}

/* glass curvature highlight, drawn above content but below UI chrome (z-index 45) */
.crt-bulge {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  z-index: 35;
  background:
    radial-gradient(ellipse 80% 65% at 50% 45%, rgba(255,220,160,.05) 0%, transparent 60%),
    radial-gradient(ellipse 95% 80% at 50% 55%, transparent 65%, rgba(0,0,0,.35) 92%, rgba(0,0,0,.55) 100%);
  mix-blend-mode: overlay;
}

/* glass reflection sheen */
.crt-glass {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  z-index: 36;
  pointer-events: none;
  background:
    radial-gradient(ellipse 85% 45% at 22% -8%, rgba(255,255,255,.07) 0%, transparent 65%),
    radial-gradient(ellipse 60% 55% at 78% 112%, rgba(255,200,150,.025) 0%, transparent 60%);
}

/* ---- Boot screen (terminal/BIOS-format startup) ---- */

.bios {
  position: relative;
  z-index: 5;
  padding: 6.5vh 5.5vw;
  color: var(--boot-fg);
  font-family: var(--font-terminal);
  font-size: clamp(15px, 1.6vw, 23px);
  line-height: 1.4;
  letter-spacing: .015em;
  filter: url(#crt-chroma);
  animation: brightness-flicker 7.3s infinite steps(1);
}

.bios[hidden] { display: none; }

.bios__cursor-block {
  display: inline-block;
  width: 9px;
  height: 17px;
  background: #4b46ff;
  vertical-align: -3px;
  margin-right: 6px;
  animation: blink 1.05s steps(1) infinite;
}

.bios pre {
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
  white-space: pre-wrap;
}

.bios .hot {
  color: #fffce8;
  text-shadow: 0 0 1px rgba(255,252,232,.9), 0 0 8px rgba(255,240,200,.5), 0 0 22px rgba(255,240,200,.18);
}

.bios .boot-prompt {
  display: inline-block;
  opacity: 0;
}

.bios .boot-prompt.is-shown {
  opacity: 1;
  animation: blink 1.05s steps(1) infinite;
}

.energy-star {
  position: absolute;
  top: 6.5vh;
  right: 5.5vw;
  z-index: 6;
  text-align: center;
  color: var(--amber);
  filter: drop-shadow(0 0 4px var(--amber-glow)) drop-shadow(0 0 14px rgba(245,184,0,.35));
  animation: brightness-flicker 7.3s infinite steps(1);
}

.energy-star img { width: clamp(90px, 10vw, 150px); display: block; margin: 0 auto; }

.energy-star-label {
  font-family: var(--font-terminal);
  font-size: clamp(12px, 1.1vw, 17px);
  letter-spacing: .06em;
  margin-top: 4px;
  color: var(--amber);
}

@keyframes brightness-flicker {
  0%, 89%, to { opacity: 1; }
  90%         { opacity: .88; }
  90.5%       { opacity: 1; }
  93%         { opacity: .94; }
  93.5%       { opacity: 1; }
}

@keyframes blink {
  50% { opacity: 0; }
}

body.booting .bios,
body.booting .energy-star {
  animation: boot-flash .45s steps(5) forwards;
}

body.booting .crt {
  animation: crt-power-off 1s .3s cubic-bezier(.55,0,.45,1) forwards;
}

@keyframes boot-flash {
  0%  { filter: brightness(1) url(#crt-chroma); }
  30% { filter: brightness(3.5) url(#crt-chroma); }
  60% { filter: brightness(.4) url(#crt-chroma); }
  to  { filter: brightness(2.8) url(#crt-chroma); }
}

@keyframes crt-power-off {
  0%  { filter: brightness(1); }
  55% { filter: brightness(6); }
  to  { filter: brightness(0); opacity: 0; }
}

/* ---- Stage 2: kernel mount log ---- */

.mount-log {
  position: relative;
  z-index: 5;
  padding: 8vh 5.5vw;
  color: #3ddc6a;
  font-family: var(--font-terminal);
  font-size: clamp(15px, 1.6vw, 23px);
  line-height: 1.5;
}

.mount-log[hidden] { display: none; }

.mount-log pre { font-family: inherit; font-size: inherit; white-space: pre-wrap; }

.mount-log .title { color: var(--boot-fg); display: block; margin-bottom: 1em; }

.mount-log .line {
  display: flex;
  justify-content: space-between;
  max-width: 640px;
}

.mount-log .ok { color: #3ddc6a; }

/* ---- Stage 3: interactive login shell ---- */

.shell {
  position: relative;
  z-index: 5;
  padding: 8vh 5.5vw;
  color: var(--boot-fg);
  font-family: var(--font-terminal);
  font-size: clamp(15px, 1.6vw, 23px);
  line-height: 1.5;
}

.shell[hidden] { display: none; }

.shell__output { font-family: inherit; font-size: inherit; white-space: pre-wrap; margin-bottom: 0; }

.shell__output .dim { opacity: .6; }
.shell__output .accent { color: #6ee7ff; }
.shell__output .err { color: #ff7a6e; }

.shell__prompt-line { display: flex; align-items: baseline; }

.shell__prompt {
  margin-right: .6ch;
  white-space: pre;
}

.prompt-path { color: #6ee7ff; }
.prompt-branch { color: #d7c86b; }
.prompt-glyph { color: #ff79c6; }

.cmd-known { color: #3ddc6a; }
.cmd-unknown { color: #ff7a6e; }

.shell__typed { white-space: pre; }

.shell__cursor {
  display: inline-block;
  width: .55em;
  height: 1em;
  background: var(--boot-fg);
  margin-left: 2px;
  animation: blink 1.05s steps(1) infinite;
  vertical-align: -2px;
}

/* ---- Stage 4: loader ---- */

.loading-screen {
  position: relative;
  z-index: 5;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  color: var(--boot-fg);
  font-family: var(--font-terminal);
}

.loading-screen[hidden] { display: none; }

.loading-screen__label {
  font-size: clamp(16px, 2vw, 24px);
  letter-spacing: .08em;
}

.loading-bar {
  width: min(220px, 40vw);
  height: 12px;
  border: 2px solid var(--boot-fg);
}

.loading-bar__fill {
  height: 100%;
  width: 0%;
  background: var(--boot-fg);
  box-shadow: 0 0 10px var(--boot-fg);
  transition: width .1s linear;
}

/* ---- Desktop ---- */

.desktop {
  position: absolute;
  inset: 0;
  background: var(--wallpaper-blue);
  transition: background-color .25s ease-out;
}

.desktop[hidden] { display: none; }

.desktop--blue  { background: #1b17d6; }
.desktop--teal  { background: #0e6b64; }
.desktop--cream { background: #ddd3ba; }
.desktop--night { background: #101014; }

.desktop:before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background:
    radial-gradient(ellipse 55% 45% at 26% 20%, rgba(255,255,255,.14) 0%, transparent 62%),
    radial-gradient(ellipse 60% 50% at 80% 12%, rgba(255,255,255,.06) 0%, transparent 60%),
    radial-gradient(ellipse 75% 65% at 82% 88%, rgba(0,0,0,.30) 0%, transparent 65%),
    radial-gradient(ellipse 65% 55% at 10% 92%, rgba(0,0,0,.20) 0%, transparent 60%),
    radial-gradient(ellipse 130% 110% at 50% 48%, transparent 38%, rgba(0,0,0,.38) 100%);
  mix-blend-mode: soft-light;
}

.desktop:after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  opacity: .05;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  background-size: 180px 180px;
}

/* ---- Desktop icons ---- */

.desktop-icons {
  position: absolute;
  inset: 0;
  z-index: 8;
  pointer-events: none;
}

.desktop-icon {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 84px;
  padding: 6px;
  border-radius: 10px;
  touch-action: none;
  pointer-events: auto;
}

.desktop-icon.is-admin-editable { cursor: grab; }
.desktop-icon.is-admin-editable:active { cursor: grabbing; }
.desktop-icon.is-dragging { z-index: 9; opacity: .88; }
.desktop-icon.is-admin-editable:hover { background: rgba(0,0,0,.12); }

.desktop-icon__rename {
  width: 100%;
  background: rgba(0,0,0,.55);
  border: 1px solid rgba(255,255,255,.6);
  border-radius: 5px;
  color: #fff;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  padding: 1px 3px;
}

/* ---- Desktop right-click context menu (admin only) ---- */

.desktop-context-menu {
  position: absolute;
  z-index: 60;
  background: var(--cream);
  border-radius: 10px;
  box-shadow: 0 16px 34px rgba(0,0,0,.28), 0 4px 10px rgba(0,0,0,.16);
  padding: 6px;
  min-width: 190px;
}

.desktop-context-menu[hidden] { display: none; }
.desktop-context-menu__item[hidden] { display: none; }

.desktop-context-menu__item {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 8px 10px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 600;
  text-align: left;
}

.desktop-context-menu__item:hover { background: rgba(23,19,15,.08); }
.desktop-context-menu__item img.icon { width: 15px; height: 15px; }

.desktop-icon__tile {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: var(--cream);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform .15s var(--ease-spring);
}

.desktop-icon:active .desktop-icon__tile {
  transform: scale(.9);
}

.desktop-icon__tile img.icon {
  width: 24px;
  height: 24px;
}

.desktop-icon__label {
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  text-shadow: 0 1px 4px rgba(0,0,0,.35);
}

/* ---- Cookie banner ---- */

.cookie-note {
  position: fixed;
  left: 50%;
  bottom: calc(3vh + 64px + 16px);
  transform: translateX(-50%);
  z-index: 200;
  width: min(300px, calc(100vw - 40px));
  padding: 11px 12px 9px;
  background: #1fa8a8;
  color: #0d0d0d;
  border: 2px solid #fff;
  border-radius: 10px;
  box-shadow: 0 0 0 1px #111, 4px 4px #111;
  font-family: var(--font-mono);
  text-align: center;
}

.cookie-note[hidden] { display: none; }

.cookie-note__chip {
  position: absolute;
  top: -11px;
  left: 50%;
  transform: translateX(-50%);
  padding: 2px 8px;
  background: #111;
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .04em;
  border-radius: 3px;
}

.cookie-note__text {
  margin: 3px 0 8px;
  font-size: 10px;
  font-weight: 500;
  line-height: 1.5;
}

.cookie-note__actions {
  display: flex;
  justify-content: center;
  gap: 8px;
}

.cookie-note__btn {
  font-family: inherit;
  font-size: 10px;
  font-weight: 700;
  padding: 4px 13px;
  cursor: pointer;
  background: #fff;
  color: #0d0d0d;
  border: 1px solid #111;
  border-radius: 4px;
  box-shadow: 2px 2px #111;
  transition: transform .06s ease-out, box-shadow .06s ease-out;
}

.cookie-note__btn--accept { background: #f9ee3e; }

.cookie-note__btn:hover  { transform: translate(1px,1px); box-shadow: 1px 1px #111; }
.cookie-note__btn:active { transform: translate(2px,2px); box-shadow: 0 0 #111; }

/* ---- Start menu panel ---- */

.start-menu {
  position: absolute;
  top: 4.2%;
  left: 3.6%;
  width: min(420px, 30%);
  height: calc(92.8% - 80px);
  max-height: calc(92.8% - 80px);
  display: flex;
  flex-direction: column;
  background: var(--cream);
  border-radius: 16px;
  padding: 30px 30px 26px;
  z-index: 45;
  box-shadow: 0 16px 34px rgba(0,0,0,.22), 0 4px 10px rgba(0,0,0,.14);
  transform-origin: top left;
  transform: scale(.94) translateY(-8px);
  opacity: 0;
  pointer-events: none;
  transition: transform .28s var(--ease-spring), opacity .16s ease-out;
}

.start-menu.is-open {
  transform: scale(1) translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.start-menu__body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

.start-menu__close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 34px;
  height: 34px;
  background: var(--ink);
  color: var(--cream);
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  line-height: 1;
}

.start-menu__clock {
  margin-bottom: 22px;
}

.start-menu__time {
  display: block;
  font-size: clamp(28px, 3vw, 34px);
  font-weight: 700;
  letter-spacing: -.01em;
}

.start-menu__date {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-soft);
  margin-top: 2px;
}

.start-menu__label {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 20px 0 9px;
}

.start-menu__section:first-of-type .start-menu__label {
  margin-top: 0;
}

.start-menu__list {
  list-style: none;
}

.start-menu__item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 7px 6px;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  text-align: left;
  transition: background-color .12s ease-out;
}

.start-menu__item:hover,
.start-menu__item:focus-visible {
  background: rgba(23, 19, 15, .08);
}

.start-menu__item img.icon {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
}

/* ---- Taskbar ---- */

.taskbar {
  position: absolute;
  left: 3.6%;
  right: 3.6%;
  bottom: 3%;
  height: 64px;
  background: var(--cream);
  border-radius: 16px;
  display: flex;
  align-items: stretch;
  z-index: 45;
  box-shadow: 0 16px 34px rgba(0,0,0,.22), 0 4px 10px rgba(0,0,0,.14);
}

.taskbar[hidden] { display: none; }

.taskbar__btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.taskbar__btn:not(:last-child):after {
  content: "";
  position: absolute;
  right: 0;
  top: 18px;
  bottom: 18px;
  width: 1px;
  background: var(--divider);
}

.taskbar__btn img.icon {
  width: 20px;
  height: 20px;
}

.taskbar__btn:hover img.icon,
.taskbar__btn:focus-visible img.icon {
  opacity: .6;
}

.taskbar__btn.is-active {
  background: rgba(23, 19, 15, .06);
}

.taskbar__btn {
  transition: transform .15s var(--ease-spring);
}

.taskbar__btn:active {
  transform: scale(.88);
}

/* ---- App window ---- */

.window {
  position: absolute;
  top: 5%;
  right: 3.6%;
  width: min(560px, 30%);
  max-height: calc(89% - 80px);
  background: var(--cream);
  border-radius: 16px;
  z-index: 50;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 46px rgba(0,0,0,.26), 0 6px 14px rgba(0,0,0,.16);
  transform-origin: center top;
  transform: scale(.9) translateY(10px);
  opacity: 0;
  pointer-events: none;
  transition: transform .3s var(--ease-spring), opacity .18s ease-out, width .2s ease-out, max-height .2s ease-out;
}

.window.is-open {
  transform: scale(1) translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.window--wide {
  left: 50%;
  right: auto;
  transform: translateX(-50%) scale(.9) translateY(10px);
  width: 88%;
  height: 66%;
  max-height: 66%;
}

.window--wide.is-open {
  transform: translateX(-50%) scale(1) translateY(0);
}

.window__close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 34px;
  height: 34px;
  background: var(--ink);
  color: var(--cream);
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  line-height: 1;
  z-index: 5;
}

.window__body {
  padding: 24px 26px 28px;
  overflow-y: auto;
  overflow-x: hidden;
  border-radius: inherit;
  font-size: 15px;
  line-height: 1.6;
  flex: 1;
  min-height: 0;
}

.window__body h2:first-child {
  font-size: 25px;
  font-weight: 700;
  margin-bottom: 14px;
}

.window__body--flush { padding: 0; position: relative; }

/* ---- Settings app ---- */

.settings__heading {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 18px;
}

.settings__section-label {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 22px 0 10px;
}

.settings__section:first-of-type .settings__section-label { margin-top: 0; }

.settings__wallpapers {
  display: flex;
  gap: 14px;
}

.wallpaper-swatch {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.wallpaper-swatch__chip {
  width: 46px;
  height: 46px;
  border-radius: 10px;
  border: 2px solid transparent;
  transition: border-color .12s ease-out, transform .12s var(--ease-spring);
}

.wallpaper-swatch:hover .wallpaper-swatch__chip { transform: scale(1.05); }

.wallpaper-swatch.is-active .wallpaper-swatch__chip {
  border-color: var(--ink);
}

.wallpaper-swatch__label {
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-soft);
}

.settings__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 0;
  border-bottom: 1px solid var(--divider);
  font-size: 14px;
  font-weight: 600;
}

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

.settings__row-controls {
  display: flex;
  align-items: center;
  gap: 9px;
}

.settings__toggle-state {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .04em;
  color: var(--ink-soft);
  width: 24px;
  text-align: right;
}

.settings__row-label { display: flex; align-items: center; gap: 9px; }
.settings__row-label img.icon { width: 16px; height: 16px; }

.toggle-switch {
  width: 38px;
  height: 22px;
  border-radius: 11px;
  background: var(--divider);
  position: relative;
  flex-shrink: 0;
  transition: background-color .15s ease-out;
}

.toggle-switch:before {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  transition: transform .15s var(--ease-spring);
}

.toggle-switch.is-on { background: #2fae66; }
.toggle-switch.is-on:before { transform: translateX(16px); }

.settings__action-btn {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  padding: 5px 12px;
  border-radius: 6px;
  background: var(--ink);
  color: var(--cream);
}

.settings__action-btn:hover { opacity: .85; }

.settings__link { color: var(--ink); text-decoration: underline; text-underline-offset: 2px; }

/* ---- Terminal app ---- */

.tapp {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  background: #050505;
  border-radius: inherit;
}

.tapp__tab {
  position: absolute;
  top: 12px;
  left: 14px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 16px 7px 12px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  color: #cfcfcf;
  background: #111;
  box-shadow: 0 6px 14px rgba(0,0,0,.3);
}

.tapp__tab img.icon { width: 13px; height: 13px; filter: invert(1); opacity: .8; }

.tapp__body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 52px 18px 14px;
}

.tapp__output {
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.7;
  color: #d8d8d8;
  white-space: pre-wrap;
}

.tapp__output .dim { opacity: .55; }
.tapp__output .accent { color: #6ee7ff; }
.tapp__output .err { color: #ff7a6e; }

.tapp__prompt-line {
  display: flex;
  align-items: baseline;
  font-family: var(--font-mono);
  font-size: 14px;
  color: #d8d8d8;
}

.tapp__prompt { margin-right: .6ch; white-space: pre; }
.tapp__typed { white-space: pre; }
.tapp__cursor {
  display: inline-block;
  width: .5em;
  height: 1em;
  background: #e8dfc3;
  margin-left: 2px;
  animation: blink 1.05s steps(1) infinite;
  vertical-align: -2px;
}

/* ---- Files app ---- */

.fapp {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.fapp__toolbar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--divider);
  flex-shrink: 0;
}

.fapp__nav-btn {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: rgba(23,19,15,.06);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.fapp__nav-btn img.icon { width: 14px; height: 14px; }

.fapp__nav-btn:hover:not(:disabled) { background: rgba(23,19,15,.11); }
.fapp__nav-btn:disabled { opacity: .3; cursor: default; }

.fapp__crumbs {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: 8px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  overflow: hidden;
  white-space: nowrap;
}

.fapp__crumb { color: var(--ink-soft); font-weight: 600; }
.fapp__crumb:hover { text-decoration: underline; cursor: pointer; }
.fapp__crumb-sep { color: var(--ink-soft); opacity: .5; }
.fapp__crumb.is-current { color: var(--ink); font-weight: 700; }

.fapp__body { display: flex; flex: 1; min-height: 0; }

.fapp__sidebar {
  width: 168px;
  flex-shrink: 0;
  padding: 16px 10px;
  border-right: 1px solid var(--divider);
  font-size: 13px;
  overflow-y: auto;
}

.fapp__sidebar-label {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 14px 0 6px 8px;
}

.fapp__sidebar-label:first-child { margin-top: 0; }

.fapp__sidebar-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 6px 8px;
  border-radius: 7px;
  font-weight: 600;
}

.fapp__sidebar-item img.icon { width: 14px; height: 14px; }
.fapp__sidebar-item.is-active { background: rgba(23,19,15,.08); }
.fapp__sidebar-item.is-disabled { color: var(--ink-soft); opacity: .55; }

.fapp__list { flex: 1; overflow-y: auto; }

.fapp__row-head {
  display: flex;
  align-items: center;
  padding: 8px 18px;
  border-bottom: 1px solid var(--divider);
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ink-soft);
  position: sticky;
  top: 0;
  background: var(--cream);
}

.fapp__col-name { flex: 1 1 auto; display: flex; align-items: center; gap: 4px; }
.fapp__col-date { flex: 0 0 170px; }
.fapp__col-type { flex: 0 0 140px; }
.fapp__col-size { flex: 0 0 90px; text-align: right; }

.fapp__row {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 9px 18px;
  font-size: 13px;
  font-weight: 600;
  text-align: left;
  border-bottom: 1px solid transparent;
}

.fapp__row:hover { background: rgba(23,19,15,.05); }

.fapp__row .fapp__col-name { gap: 10px; }
.fapp__row img.icon { width: 15px; height: 15px; flex-shrink: 0; }
.fapp__row .fapp__col-date,
.fapp__row .fapp__col-type { font-family: var(--font-mono); font-size: 11.5px; font-weight: 500; color: var(--ink-soft); }
.fapp__row .fapp__col-size { font-family: var(--font-mono); font-size: 11.5px; font-weight: 500; color: var(--ink-soft); text-align: right; }
.fapp__row.is-admin { color: #b8471f; }
.fapp__row.is-admin .fapp__col-type { color: #b8471f; opacity: .8; }

.fapp__empty { padding: 40px 18px; color: var(--ink-soft); font-size: 13px; }

/* file preview pane */
.fapp__preview { padding: 26px 30px; overflow-y: auto; height: 100%; }
.fapp__preview h3 { font-family: var(--font-display); font-size: 22px; font-weight: 700; margin-bottom: 12px; }
.fapp__preview p { margin-bottom: 10px; line-height: 1.6; font-size: 14px; }

.fapp__row.is-network .fapp__col-type { font-family: var(--font-mono); }

/* ---- Network auth modal (flavor easter egg, no real backend) ---- */

.fapp__modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(23,19,15,.28);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20;
}

.fapp__modal-backdrop[hidden] { display: none; }

.fapp__modal {
  width: min(420px, 80%);
  background: var(--cream);
  border-radius: 12px;
  padding: 26px 28px;
  box-shadow: 0 20px 50px rgba(0,0,0,.25);
}

.fapp__modal h3 {
  font-family: var(--font-mono);
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 6px;
}

.fapp__modal p { font-size: 13px; color: var(--ink-soft); margin-bottom: 14px; }
.fapp__modal p strong { color: var(--ink); font-weight: 600; }

.fapp__modal-input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 7px;
  border: 1px solid var(--divider);
  background: #fff;
  font-family: var(--font-mono);
  font-size: 13px;
  margin-bottom: 6px;
}

.fapp__modal-error {
  color: #b8471f;
  font-size: 12px;
  margin: 4px 0 0;
}

.fapp__modal-error[hidden] { display: none; }

.fapp__modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 16px;
}

.fapp__modal-btn {
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 7px;
  background: rgba(23,19,15,.08);
}

.fapp__modal-btn--primary { background: var(--ink); color: var(--cream); }
.fapp__modal-btn:hover { opacity: .85; }

/* ---- Notepad app ---- */

.napp {
  display: flex;
  flex-direction: column;
  height: 100%;
  position: relative;
}

.napp__titlebar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--divider);
  flex-shrink: 0;
}

.napp__titlebar img.icon { width: 15px; height: 15px; }

.napp__title { font-weight: 700; font-size: 14px; }

.napp__menu { display: flex; gap: 4px; }

.napp__menu-btn {
  font-size: 13px;
  font-weight: 600;
  padding: 4px 9px;
  border-radius: 6px;
}

.napp__menu-btn:hover, .napp__menu-btn.is-open { background: rgba(23,19,15,.08); }

.napp__filename {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-soft);
}

.napp__dropdown {
  position: absolute;
  top: 44px;
  background: var(--cream);
  border-radius: 10px;
  box-shadow: 0 12px 30px rgba(0,0,0,.18);
  padding: 6px;
  z-index: 10;
  min-width: 170px;
}

.napp__dropdown[hidden] { display: none; }
.napp__dropdown--file { left: 84px; min-width: 220px; }
.napp__dropdown--format { left: 148px; }

.napp__dropdown-label {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ink-soft);
  padding: 6px 10px 4px;
}

.napp__dropdown-sep { height: 1px; background: var(--divider); margin: 4px 0; }

.napp__dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 7px 10px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  text-align: left;
}

.napp__dropdown-item:hover { background: rgba(23,19,15,.07); }
.napp__dropdown-item .check { width: 13px; flex-shrink: 0; opacity: 0; }
.napp__dropdown-item:disabled { opacity: .4; cursor: default; }
.napp__dropdown-item:disabled:hover { background: none; }

/* ---- Notepad: Open… / Save as Copy… dialogs ---- */

.napp__modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(23,19,15,.28);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20;
}

.napp__modal-backdrop[hidden] { display: none; }

.napp__modal {
  width: min(640px, 86%);
  max-height: 80%;
  overflow-y: auto;
  background: var(--cream);
  border-radius: 12px;
  padding: 26px 28px;
  box-shadow: 0 20px 50px rgba(0,0,0,.25);
}

.napp__modal--sm { width: min(420px, 80%); }

.napp__modal h3 { font-family: var(--font-display); font-size: 22px; font-weight: 700; margin-bottom: 14px; }

.napp__modal-crumbs {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--ink-soft);
  margin-bottom: 16px;
}

.napp__modal-label {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 6px;
}

.napp__modal-input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 7px;
  border: 1px solid var(--divider);
  background: #fff;
  font-family: var(--font-mono);
  font-size: 13px;
  margin-bottom: 18px;
}

.napp__modal-browser { display: flex; gap: 16px; margin-bottom: 8px; }
.napp__modal-col { flex: 1; min-width: 0; }

.napp__modal-list {
  border: 1px solid var(--divider);
  border-radius: 8px;
  max-height: 220px;
  overflow-y: auto;
}

.napp__modal-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 7px 10px;
  font-size: 13px;
  font-weight: 600;
  text-align: left;
}

.napp__modal-item:hover { background: rgba(23,19,15,.06); }
.napp__modal-item.is-selected { background: rgba(23,19,15,.1); }
.napp__modal-item img.icon { width: 14px; height: 14px; flex-shrink: 0; }

.napp__modal-empty { padding: 14px 10px; font-size: 12.5px; color: var(--ink-soft); }

.napp__modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }

.napp__modal-btn {
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 7px;
  background: rgba(23,19,15,.08);
}

.napp__modal-btn--primary { background: var(--ink); color: var(--cream); }
.napp__modal-btn:disabled { opacity: .4; cursor: default; }
.napp__modal-btn:hover:not(:disabled) { opacity: .85; }
.napp__dropdown-item.is-active .check { opacity: 1; }

.napp__text {
  flex: 1;
  width: 100%;
  min-height: 0;
  overflow-y: auto;
  padding: 24px 28px;
  font-family: var(--font-display);
  font-size: 15px;
  line-height: 1.7;
  white-space: pre-wrap;
  background: transparent;
  border: none;
  outline: none;
  resize: none;
  color: var(--ink);
}

.napp__text::placeholder { color: var(--ink-soft); font-style: italic; }

/* ---- Settings: image wallpapers ---- */

.settings__wallpaper-images {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 12px;
}

.wallpaper-image-swatch {
  width: 64px;
  height: 46px;
  border-radius: 8px;
  background-size: cover;
  background-position: center;
  border: 2px solid transparent;
  flex-shrink: 0;
}

.wallpaper-image-swatch.is-active { border-color: var(--ink); }
.wallpaper-image-swatch:hover { transform: scale(1.04); }

.settings__upload-btn {
  width: 64px;
  height: 46px;
  border-radius: 8px;
  border: 1.5px dashed var(--ink-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: var(--ink-soft);
  flex-shrink: 0;
}

.settings__upload-btn:hover { border-color: var(--ink); color: var(--ink); }
.settings__upload-status { font-size: 11.5px; color: var(--ink-soft); margin-top: 8px; }

/* ---- About app ---- */

.aapp {
  display: flex;
  height: 100%;
  border-radius: inherit;
  overflow: hidden;
}

.aapp__text {
  flex: 1 1 48%;
  min-width: 0;
  padding: 34px 36px;
  overflow-y: auto;
  position: relative;
}

.aapp__name { font-size: 28px; font-weight: 700; margin-bottom: 6px; }

.aapp__role {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--ink-soft);
  margin-bottom: 22px;
}

.aapp__bio p { margin-bottom: 14px; line-height: 1.7; font-size: 15px; }
.aapp__bio p.dim { color: var(--ink-soft); font-style: italic; }

.aapp__btn {
  position: absolute;
  top: 20px;
  right: 20px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .04em;
  padding: 6px 13px;
  border-radius: 6px;
  background: rgba(23,19,15,.08);
}

.aapp__btn--primary { background: var(--ink); color: var(--cream); }
.aapp__btn:hover { opacity: .8; }

.aapp__edit-btn { position: absolute; top: 20px; right: 20px; }

.aapp__edit-row { margin-bottom: 14px; }
.aapp__edit-row label {
  display: block;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 5px;
}

.aapp__edit-row input,
.aapp__edit-row textarea {
  width: 100%;
  padding: 8px 10px;
  border-radius: 7px;
  border: 1px solid var(--divider);
  background: #fff;
  font-family: var(--font-display);
  font-size: 14px;
  resize: vertical;
}

.aapp__edit-row textarea { min-height: 80px; line-height: 1.5; }
.aapp__edit-textarea--tall { min-height: 160px; }

.aapp__edit-actions { display: flex; gap: 10px; margin-top: 4px; margin-bottom: 10px; }
.aapp__edit-actions .aapp__btn { position: static; }
.aapp__edit-row .aapp__btn { position: static; margin-top: 4px; }

.aapp__edit-status { font-size: 12px; color: var(--ink-soft); }

.aapp__photo {
  flex: 1 1 52%;
  min-width: 0;
  background: #d8d0bd;
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.aapp__photo-placeholder {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.aapp__photo--editable { cursor: pointer; }

.aapp__photo-hint {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 20px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 600;
  color: #fff;
  background: rgba(23,19,15,.45);
  opacity: 0;
  transition: opacity .15s ease-out;
}

.aapp__photo--editable:hover .aapp__photo-hint { opacity: 1; }

/* ---- About app: skills / timeline / services ---- */

.aapp__section { margin-top: 28px; }

.aapp__section-label {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 14px;
}

.aapp__skills { display: flex; flex-direction: column; gap: 12px; }

.aapp__skill-row { display: flex; justify-content: space-between; font-size: 13px; font-weight: 600; margin-bottom: 5px; }
.aapp__skill-row span:last-child { color: var(--ink-soft); font-weight: 500; }

.aapp__skill-bar { height: 5px; border-radius: 3px; background: rgba(23,19,15,.08); overflow: hidden; }
.aapp__skill-fill { height: 100%; background: var(--ink); border-radius: 3px; }

.aapp__timeline-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }

.aapp__timeline-heading {
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--divider);
}

.aapp__timeline-entry { display: flex; gap: 12px; margin-bottom: 16px; }

.aapp__timeline-years {
  flex: 0 0 66px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--ink-soft);
  padding-top: 2px;
}

.aapp__timeline-body strong { display: block; font-size: 13.5px; }
.aapp__timeline-org { display: block; font-size: 11.5px; color: var(--ink-soft); margin-bottom: 4px; }
.aapp__timeline-body p { font-size: 12.5px; line-height: 1.6; color: var(--ink-soft); }

.aapp__services { display: flex; flex-direction: column; gap: 14px; }

.aapp__service { display: flex; gap: 12px; align-items: flex-start; }
.aapp__service img.icon { width: 18px; height: 18px; flex-shrink: 0; margin-top: 2px; }
.aapp__service strong { display: block; font-size: 13.5px; margin-bottom: 2px; }
.aapp__service p { font-size: 12.5px; line-height: 1.6; color: var(--ink-soft); }

/* ---- About app: inline list editors (skills / timeline / services) ---- */

.aapp__list-editor { display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; }

.aapp__list-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px;
  border-radius: 8px;
  background: rgba(23,19,15,.04);
}

.aapp__list-row--timeline, .aapp__list-row--service { flex-direction: column; align-items: stretch; }
.aapp__list-row-top { display: flex; align-items: center; gap: 6px; }

.aapp__list-input {
  flex: 1;
  min-width: 0;
  padding: 6px 8px;
  border-radius: 6px;
  border: 1px solid var(--divider);
  background: #fff;
  font-family: var(--font-display);
  font-size: 13px;
}

.aapp__list-input--num { flex: 0 0 60px; }
.aapp__list-input--type { flex: 0 0 84px; }
.aapp__list-input--year { flex: 0 0 64px; }
.aapp__list-input--icon { flex: 0 0 100px; font-family: var(--font-mono); font-size: 11px; }

.aapp__list-textarea {
  width: 100%;
  min-height: 50px;
  margin-top: 6px;
  padding: 6px 8px;
  border-radius: 6px;
  border: 1px solid var(--divider);
  background: #fff;
  font-family: var(--font-display);
  font-size: 12.5px;
  resize: vertical;
}

.aapp__list-remove {
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(178,42,30,.12);
  color: #8a1f16;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.aapp__list-remove:hover { background: rgba(178,42,30,.2); }

/* ---- Collection app (bigger than the other wide windows) ---- */

.window--full.window--wide {
  width: 93%;
  top: 4%;
  height: calc(93% - 80px);
  max-height: calc(93% - 80px);
  background: transparent;
  box-shadow: none;
}

.capp {
  display: flex;
  flex-direction: column;
  height: 100%;
  width: 100%;
  border-radius: inherit;
  overflow: hidden;
  position: relative;
  background: transparent;
}

.capp__loading { padding: 40px; font-family: var(--font-mono); font-size: 13px; color: var(--ink-soft); }

/* -- shelf view -- */

.capp__shelf-view { display: flex; height: 100%; min-height: 0; gap: 24px; padding: 24px; }

.capp__intro {
  flex: 0 0 336px;
  padding: 40px 32px;
  overflow-y: auto;
  position: relative;
  border-radius: 16px;
  background: var(--cream);
  box-shadow: 0 16px 32px rgba(0,0,0,.24);
  z-index: 2;
}

.capp__intro-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--ink);
  color: var(--cream);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  line-height: 1;
  z-index: 5;
}

.capp__intro-close:hover { opacity: .82; }

.capp__intro-title { font-size: 34px; font-weight: 800; line-height: 1.08; margin-bottom: 14px; padding-right: 34px; }

.capp__intro-tagline {
  font-style: italic;
  font-size: 15px;
  color: var(--ink-soft);
  line-height: 1.5;
  margin-bottom: 22px;
}

.capp__intro-body p { font-size: 14px; line-height: 1.7; margin-bottom: 14px; }
.capp__intro-body p.dim { color: var(--ink-soft); font-style: italic; font-size: 12.5px; }

.capp__shelf-card {
  flex: 1;
  min-width: 0;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 16px 32px rgba(0,0,0,.3);
}

.capp__wall {
  height: 100%;
  overflow-y: auto;
  padding: 34px 34px 0;
  background:
    repeating-linear-gradient(180deg,
      transparent 0px, transparent 232px,
      rgba(255,255,255,.20) 232px 235px,
      rgba(128,92,54,.95) 235px 256px,
      rgba(0,0,0,.32) 256px 264px,
      transparent 264px 272px),
    repeating-linear-gradient(90deg, rgba(255,255,255,.03) 0 1px, transparent 1px 6px),
    linear-gradient(180deg, #93673a, #764c27);
}

.capp__shelf {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  column-gap: 26px;
  row-gap: 40px;
  grid-auto-rows: 232px;
  padding-bottom: 24px;
}

.capp__empty { font-family: var(--font-mono); font-size: 13px; color: rgba(255,255,255,.75); padding: 20px 4px; }

.capp__item {
  position: relative;
  display: block;
  height: 100%;
  border-radius: 4px;
  box-shadow: 0 6px 10px rgba(0,0,0,.4);
  transition: transform .18s var(--ease-spring), box-shadow .18s ease;
}

.capp__item:hover, .capp__item:focus-visible {
  transform: translateY(-10px);
  box-shadow: 0 20px 24px rgba(0,0,0,.5);
  z-index: 3;
  outline: none;
}

.capp__item-frame {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 4px;
  overflow: hidden;
}

.capp__item-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(255,255,255,.10) 0%, transparent 6%, transparent 90%, rgba(0,0,0,.30) 100%);
  pointer-events: none;
}

.capp__item-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  display: block;
}

.capp__item-label {
  position: absolute;
  left: 50%;
  bottom: -4px;
  width: max-content;
  max-width: 168px;
  text-align: center;
  transform: translate(-50%, 0);
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
  background: var(--ink);
  color: var(--cream);
  font-family: var(--font-mono);
  padding: 5px 9px;
  border-radius: 6px;
  z-index: 4;
}

.capp__item-label strong { display: block; font-size: 10.5px; font-weight: 600; line-height: 1.3; }
.capp__item-label span { display: block; font-size: 8.5px; text-transform: uppercase; letter-spacing: .05em; opacity: .65; margin-top: 2px; }

.capp__item:hover .capp__item-label, .capp__item:focus-visible .capp__item-label {
  opacity: 1;
  transform: translate(-50%, 8px);
}

/* -- detail view -- */

.capp__detail { display: flex; flex-direction: column; height: 100%; min-height: 0; background: var(--cream); border-radius: inherit; box-shadow: 0 20px 46px rgba(0,0,0,.26), 0 6px 14px rgba(0,0,0,.16); }

.capp__detail-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 26px;
  border-bottom: 1px solid var(--divider);
  flex: 0 0 auto;
}

.capp__back-btn {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: rgba(23,19,15,.08);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.capp__back-btn:hover { background: rgba(23,19,15,.14); }
.capp__back-btn .icon { width: 16px; height: 16px; }

.capp__detail-title { font-size: 21px; font-weight: 700; padding-right: 100px; }

.capp__detail-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  gap: 36px;
  padding: 28px 26px 36px;
}

.capp__media { flex: 0 0 42%; min-width: 0; display: flex; flex-direction: column; gap: 14px; }

.capp__media-frame {
  background: #141210;
  border-radius: 10px;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  display: flex;
  align-items: center;
  justify-content: center;
}

.capp__media-img { width: 100%; height: 100%; object-fit: contain; }

.capp__media-controls { display: flex; gap: 8px; justify-content: center; }

.capp__media-btn {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: rgba(23,19,15,.08);
  display: flex;
  align-items: center;
  justify-content: center;
}

.capp__media-btn:hover { background: rgba(23,19,15,.14); }
.capp__media-btn .icon { width: 15px; height: 15px; }

.capp__info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 22px; }

.capp__info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 24px; }

.capp__info-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 4px;
}

.capp__info-value { font-size: 15px; font-weight: 600; }

.capp__chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }

.capp__chip {
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(23,19,15,.08);
}

.capp__synopsis p { font-size: 14px; line-height: 1.7; margin-top: 8px; }
.capp__synopsis p:first-child { margin-top: 2px; }

.capp__gallery { display: flex; gap: 10px; margin-top: 2px; flex-wrap: wrap; }

.capp__gallery-thumb {
  width: 84px;
  height: 64px;
  border-radius: 6px;
  overflow: hidden;
  flex: 0 0 auto;
  box-shadow: 0 0 0 1px rgba(0,0,0,.15);
  transition: transform .15s ease, box-shadow .15s ease;
}

.capp__gallery-thumb:hover { transform: translateY(-3px); box-shadow: 0 6px 14px rgba(0,0,0,.25); }
.capp__gallery-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

.capp__action-btn {
  position: absolute;
  top: 16px;
  right: 60px;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--ink);
  color: var(--cream);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
}

.capp__action-btn:hover { opacity: .82; }
.capp__action-btn .icon { width: 15px; height: 15px; filter: invert(1); }

/* -- nested image viewer -- */

.capp__viewer {
  position: absolute;
  inset: 0;
  background: var(--cream);
  border-radius: inherit;
  z-index: 20;
  display: flex;
  flex-direction: column;
}

.capp__viewer[hidden] { display: none; }
.capp__viewer:focus { outline: none; }

.capp__viewer-titlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--divider);
  font-family: var(--font-mono);
  font-size: 13px;
}

.capp__viewer-title { display: flex; align-items: center; gap: 9px; font-weight: 600; }
.capp__viewer-title .icon { width: 14px; height: 14px; }
.capp__viewer-menu { color: var(--ink-soft); font-weight: 400; margin-left: 14px; }

.capp__viewer-title-right { display: flex; align-items: center; gap: 14px; }
.capp__viewer-filename { color: var(--ink-soft); }

.capp__viewer-close {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  line-height: 1;
}

.capp__viewer-close:hover { background: rgba(23,19,15,.08); }

.capp__viewer-body {
  flex: 1;
  min-height: 0;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 96px;
}

.capp__viewer-img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 6px; box-shadow: 0 12px 30px rgba(0,0,0,.25); }

.capp__viewer-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(23,19,15,.75);
  display: flex;
  align-items: center;
  justify-content: center;
}

.capp__viewer-nav:hover { background: rgba(23,19,15,.92); }
.capp__viewer-nav .icon { width: 16px; height: 16px; filter: invert(1); }
.capp__viewer-nav--prev { left: 18px; }
.capp__viewer-nav--next { right: 18px; }

/* -- Collection admin: shelf affordances -- */

.capp__item--hidden { opacity: .45; }

.capp__item-flag {
  position: absolute;
  top: 6px;
  left: 6px;
  background: var(--ink);
  color: var(--cream);
  font-family: var(--font-mono);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: .05em;
  padding: 3px 7px;
  border-radius: 5px;
  z-index: 4;
}

.capp__item-noimg {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 10px;
  background: rgba(0,0,0,.2);
  color: rgba(255,255,255,.8);
  font-size: 12px;
  font-weight: 600;
}

.capp__item--add .capp__item-frame--add {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 2px dashed rgba(255,255,255,.35);
  border-radius: 4px;
  color: rgba(255,255,255,.75);
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .05em;
  transition: background .15s ease, border-color .15s ease;
}

.capp__item--add .icon { width: 22px; height: 22px; filter: invert(1); opacity: .7; }
.capp__item--add:hover .capp__item-frame--add { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.6); }
.capp__item--add { box-shadow: none; }
.capp__item--add:hover, .capp__item--add:focus-visible { box-shadow: none; transform: translateY(-6px); }

/* -- Collection admin: edit toggle + form -- */

.capp__edit-btn {
  position: absolute;
  top: 16px;
  right: 104px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .04em;
  padding: 8px 14px;
  border-radius: 9px;
  background: rgba(23,19,15,.08);
  z-index: 5;
}

.capp__edit-btn:hover { background: rgba(23,19,15,.14); }

.capp__media-placeholder {
  color: rgba(255,255,255,.6);
  font-family: var(--font-mono);
  font-size: 12.5px;
  text-align: center;
  padding: 30px;
}

.capp__form-hint { font-size: 11.5px; color: var(--ink-soft); margin-top: 6px; }
#capp-cover-btn { margin-top: 12px; }

.capp__form-row { margin-bottom: 14px; }
.capp__form-row-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 14px; }
.capp__form-row-pair .capp__form-row { margin-bottom: 0; }

.capp__form-row label {
  display: block;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 5px;
}

.capp__form-row input,
.capp__form-row textarea {
  width: 100%;
  padding: 8px 10px;
  border-radius: 7px;
  border: 1px solid var(--divider);
  background: #fff;
  font-family: var(--font-display);
  font-size: 14px;
  resize: vertical;
}

.capp__form-row textarea { min-height: 70px; line-height: 1.5; }
.capp__form-textarea--tall { min-height: 140px; }

.capp__form-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  margin-bottom: 18px;
}

.capp__gallery--edit { align-items: center; }

.capp__gallery-thumb--edit { position: relative; width: 84px; height: 64px; border-radius: 6px; overflow: hidden; flex: 0 0 auto; box-shadow: 0 0 0 1px rgba(0,0,0,.15); }
.capp__gallery-thumb--edit img { width: 100%; height: 100%; object-fit: cover; display: block; }

.capp__gallery-remove {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(23,19,15,.85);
  color: #fff;
  font-size: 12px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.capp__gallery-remove:hover { background: var(--ink); }

.capp__gallery-add {
  width: 84px;
  height: 64px;
  border-radius: 6px;
  border: 2px dashed var(--divider);
  color: var(--ink-soft);
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.capp__gallery-add:hover { border-color: var(--ink-soft); color: var(--ink); }

.capp__form-actions { display: flex; align-items: center; gap: 10px; margin-top: 8px; flex-wrap: wrap; }

.capp__form-btn {
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .04em;
  padding: 9px 16px;
  border-radius: 8px;
  background: rgba(23,19,15,.08);
}

.capp__form-btn:hover { opacity: .82; }
.capp__form-btn--primary { background: var(--ink); color: var(--cream); }
.capp__form-btn--danger { background: rgba(178,42,30,.12); color: #8a1f16; }
.capp__form-btn--danger:hover { background: rgba(178,42,30,.2); }
.capp__form-btn:disabled { opacity: .5; }

.capp__form-status { font-size: 12px; color: var(--ink-soft); }

/* -- Collection: testimonial (read view) -- */

.capp__testimonial-body { display: flex; gap: 14px; margin-top: 6px; align-items: flex-start; }

.capp__testimonial-photo {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.capp__testimonial-photo--placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(23,19,15,.08);
}
.capp__testimonial-photo--placeholder .icon { width: 18px; height: 18px; opacity: .5; }

.capp__testimonial-quote { font-style: italic; font-size: 14px; line-height: 1.6; margin-bottom: 6px; }
.capp__testimonial-author { font-size: 12px; font-weight: 600; color: var(--ink-soft); }

/* -- Collection: testimonial (admin edit) -- */

.capp__testimonial-edit {
  display: flex;
  gap: 12px;
  padding: 12px;
  border-radius: 10px;
  background: rgba(23,19,15,.04);
  margin-bottom: 10px;
}

.capp__testimonial-edit-photo {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(23,19,15,.08);
}
.capp__testimonial-edit-photo img { width: 100%; height: 100%; object-fit: cover; }
.capp__testimonial-edit-photo .icon { width: 16px; height: 16px; opacity: .5; }

.capp__testimonial-edit-fields { flex: 1; min-width: 0; }
.capp__testimonial-edit-fields .capp__form-row-pair { margin-bottom: 8px; }
.capp__testimonial-edit-fields .aapp__list-textarea { min-height: 60px; }

/* ---- Admin app ---- */

.adminapp__form-row { margin-bottom: 12px; }

.adminapp__form-row label {
  display: block;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 5px;
}

.adminapp__form-row input {
  width: 100%;
  padding: 8px 10px;
  border-radius: 7px;
  border: 1px solid var(--divider);
  background: #fff;
  font-family: var(--font-display);
  font-size: 14px;
}

.adminapp__form-actions { display: flex; align-items: center; gap: 10px; margin-top: 10px; flex-wrap: wrap; }

.adminapp__cards { display: flex; gap: 12px; flex-wrap: wrap; }

.adminapp__card {
  flex: 1 1 160px;
  padding: 14px;
  border-radius: 10px;
  border: 1px solid var(--divider);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.adminapp__card-title { font-weight: 700; font-size: 14px; }
.adminapp__card-stat { font-size: 12px; color: var(--ink-soft); }
.adminapp__card .settings__action-btn { align-self: flex-start; }

.adminapp__wp-colors { display: flex; gap: 12px; margin: 10px 0 16px; }

.adminapp__wp-color {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 4px;
  border-radius: 8px;
}

.adminapp__wp-color .wallpaper-swatch__chip { border: 2px solid transparent; }
.adminapp__wp-color.is-default .wallpaper-swatch__chip { border-color: var(--ink); }
.adminapp__wp-color .wallpaper-swatch__label { font-size: 10.5px; color: var(--ink-soft); }

.adminapp__wp-thumb {
  position: relative;
  width: 64px;
  height: 46px;
  border-radius: 8px;
  background-size: cover;
  background-position: center;
  border: 2px solid transparent;
  flex-shrink: 0;
}

.adminapp__wp-thumb.is-default { border-color: var(--ink); }

.adminapp__wp-badge {
  position: absolute;
  bottom: 2px;
  left: 2px;
  background: var(--ink);
  color: var(--cream);
  font-family: var(--font-mono);
  font-size: 8px;
  text-transform: uppercase;
  letter-spacing: .04em;
  padding: 2px 4px;
  border-radius: 4px;
}

.adminapp__wp-star {
  position: absolute;
  bottom: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 5px;
  background: rgba(23,19,15,.75);
  color: #f5c344;
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity .12s ease;
}

.adminapp__wp-thumb:hover .adminapp__wp-star { opacity: 1; }

.adminapp__wp-remove {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: rgba(23,19,15,.75);
  color: #fff;
  font-size: 11px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity .12s ease;
}

.adminapp__wp-thumb:hover .adminapp__wp-remove { opacity: 1; }

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

.adminapp__link-row { display: grid; grid-template-columns: 1fr 2fr auto; gap: 8px; align-items: center; }

.adminapp__link-row input {
  padding: 7px 9px;
  border-radius: 7px;
  border: 1px solid var(--divider);
  background: #fff;
  font-family: var(--font-display);
  font-size: 13px;
}

.adminapp__link-remove {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  background: rgba(178,42,30,.12);
  color: #8a1f16;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.adminapp__link-remove:hover { background: rgba(178,42,30,.2); }

.adminapp__message {
  padding: 14px;
  border-radius: 10px;
  border: 1px solid var(--divider);
  margin-bottom: 10px;
}

.adminapp__message--unread { border-color: rgba(23,19,15,.35); background: rgba(23,19,15,.03); }

.adminapp__message-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 6px; flex-wrap: wrap; }
.adminapp__message-head strong { margin-right: 8px; }

.adminapp__message-badge {
  margin-left: 8px;
  background: var(--ink);
  color: var(--cream);
  font-family: var(--font-mono);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: .05em;
  padding: 2px 6px;
  border-radius: 4px;
}

.adminapp__message-date { font-size: 11px; color: var(--ink-soft); white-space: nowrap; }
.adminapp__message-subject { font-weight: 700; font-size: 13px; margin-bottom: 4px; }
.adminapp__message-body { font-size: 13px; line-height: 1.6; color: var(--ink-soft); margin-bottom: 8px; white-space: pre-wrap; }

/* ---- Contact app ---- */

.ctapp__intro { font-size: 14px; color: var(--ink-soft); margin-bottom: 20px; }
.ctapp__textarea { min-height: 120px; }
.ctapp__status { font-size: 12px; color: var(--ink-soft); margin-top: 4px; }
.ctapp__success { font-size: 15px; line-height: 1.6; margin-top: 20px; }

/* ---- Blog app ---- */

.blogapp { height: 100%; overflow-y: auto; padding: 34px 36px; }

.blogapp__header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 26px; padding-right: 90px; }
.blogapp__title { font-size: 26px; font-weight: 800; margin-bottom: 6px; }
.blogapp__subtitle { font-size: 13.5px; color: var(--ink-soft); max-width: 480px; }

.blogapp__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 22px; }
.blogapp__empty { color: var(--ink-soft); font-size: 14px; }

.blogapp__card {
  display: flex;
  flex-direction: column;
  text-align: left;
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 6px 16px rgba(0,0,0,.08);
  transition: transform .15s var(--ease-spring), box-shadow .15s ease;
}

.blogapp__card:hover { transform: translateY(-4px); box-shadow: 0 14px 26px rgba(0,0,0,.14); }
.blogapp__card--hidden { opacity: .5; }

.blogapp__card-cover {
  position: relative;
  height: 130px;
  background-size: cover;
  background-position: center;
  background-color: rgba(23,19,15,.08);
  display: flex;
  align-items: center;
  justify-content: center;
}
.blogapp__card-cover .icon { width: 22px; height: 22px; opacity: .35; }

.blogapp__card-body { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px 18px; }
.blogapp__card-category { font-family: var(--font-mono); font-size: 10px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-soft); }
.blogapp__card-title { font-size: 15px; line-height: 1.35; }
.blogapp__card-excerpt { font-size: 12.5px; color: var(--ink-soft); line-height: 1.5; }
.blogapp__card-date { font-family: var(--font-mono); font-size: 10.5px; color: var(--ink-soft); margin-top: 4px; }

.blogapp__detail { height: 100%; display: flex; flex-direction: column; }
.blogapp__article-body { flex: 1; min-height: 0; overflow-y: auto; padding: 28px 36px 40px; }

.blogapp__cover { width: 100%; height: 220px; border-radius: 12px; background-size: cover; background-position: center; background-color: #141210; margin-bottom: 22px; }
.blogapp__cover--edit { display: flex; align-items: center; justify-content: center; cursor: default; }

.blogapp__meta { display: flex; gap: 14px; align-items: center; font-family: var(--font-mono); font-size: 11.5px; color: var(--ink-soft); margin-bottom: 20px; flex-wrap: wrap; }
.blogapp__meta-chip { background: rgba(23,19,15,.08); padding: 3px 9px; border-radius: 999px; text-transform: uppercase; letter-spacing: .05em; }

.blogapp__article { max-width: 680px; font-size: 15px; line-height: 1.75; }
.blogapp__article h3 { font-size: 18px; font-weight: 700; margin: 22px 0 10px; }
.blogapp__article h3:first-child { margin-top: 0; }
.blogapp__article p { margin-bottom: 14px; }
.blogapp__article ul { margin: 0 0 14px 20px; }
.blogapp__article li { margin-bottom: 6px; line-height: 1.6; }

.capp__form-select {
  width: 100%;
  padding: 8px 10px;
  border-radius: 7px;
  border: 1px solid var(--divider);
  background: #fff;
  font-family: var(--font-display);
  font-size: 14px;
}

/* ---- Pricing (Tarifs) app ---- */

.pricingapp { height: 100%; overflow-y: auto; padding: 34px 36px; }
.pricingapp__view { max-width: 100%; }

.pricingapp__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px; margin-top: 10px; }

.pricingapp__card {
  position: relative;
  padding: 24px 22px;
  border-radius: 14px;
  border: 1px solid var(--divider);
  display: flex;
  flex-direction: column;
}

.pricingapp__card--featured { border-color: var(--ink); box-shadow: 0 12px 26px rgba(0,0,0,.12); }

.pricingapp__badge {
  position: absolute;
  top: -11px;
  left: 22px;
  background: var(--ink);
  color: var(--cream);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  padding: 4px 10px;
  border-radius: 999px;
}

.pricingapp__plan-title { font-size: 17px; font-weight: 700; margin-bottom: 6px; }
.pricingapp__price { font-size: 24px; font-weight: 800; margin-bottom: 10px; }
.pricingapp__desc { font-size: 13px; color: var(--ink-soft); line-height: 1.6; margin-bottom: 16px; }

.pricingapp__features { list-style: none; display: flex; flex-direction: column; gap: 9px; }
.pricingapp__features li { display: flex; align-items: flex-start; gap: 8px; font-size: 13px; line-height: 1.5; }
.pricingapp__features .icon { width: 14px; height: 14px; flex-shrink: 0; margin-top: 2px; }
