
@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,600;9..144,700&family=Space+Grotesk:wght@400;500;600;700&display=swap');

/* TinyPixels — retro-inspired light theme */

:root{
  --bg: #f4f6f8;
  --tile: #eef1f4;
  --tile2:#e4e8ee;
  --ink:#1f2933;
  --muted:#5b6b79;
  --card:#ffffff;
  --card2:#f7f9fb;
  --line:#d6dde5;
  --accent:#1aa6a0;
  --accent2:#f2b94b;
  --warn:#f2b94b;
  --danger:#e0585b;
  --shadow: rgba(15,23,42,.12);
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  color:var(--ink);
  background: var(--bg);
  font-family: "Space Grotesk", "Helvetica Neue", Arial, sans-serif;
  letter-spacing: -0.01em;
}
h1, h2, h3, h4{
  font-family: "Fraunces", "Space Grotesk", serif;
  font-weight: 700;
  letter-spacing: -0.02em;
}
img{
  max-width: 100%;
  height: auto;
}
.is-embed .topbar,
.is-embed .sky{
  display:none;
}
.is-embed .wrap{
  max-width: 100%;
  margin: 0;
  padding: 12px;
}
.is-embed .grid{
  display: block;
}
.is-embed .grid > .card{
  width: 100%;
  margin: 0;
}

/* Pixel-ish floor tiles */
.wrap{
  max-width: 1140px;
  margin: 22px auto 48px;
  padding: 0 20px 28px;
}
.wrap::before{
  content:"";
  display:block;
  height:10px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(26,166,160,.22) 0%, rgba(242,185,75,.22) 55%, rgba(26,166,160,.12) 100%);
  box-shadow: 0 8px 24px var(--shadow);
  margin-bottom: 18px;
}

/* sky + clouds */
.sky{
  position:fixed;
  inset:0;
  pointer-events:none;
  background:
    radial-gradient(circle at 12% 8%, rgba(242,185,75,.18), transparent 50%),
    radial-gradient(circle at 88% 0%, rgba(26,166,160,.16), transparent 45%),
    linear-gradient(180deg, #f7f8fb 0%, #eef2f6 55%, #f4f6f8 100%);
  z-index:-2;
}
.cloud{
  position:absolute;
  top:60px;
  width:240px;
  height:72px;
  background: rgba(255,255,255,.55);
  border-radius: 999px;
  filter: blur(0.6px);
  box-shadow: 0 14px 30px rgba(15,23,42,.08);
  opacity:.9;
  animation: floaty 40s linear infinite;
  display: none;
}
.cloud::before,.cloud::after{
  content:"";
  position:absolute;
  background: rgba(255,255,255,.55);
  border-radius: 50%;
}
.cloud::before{ width:96px;height:96px; left:22px; top:-40px;}
.cloud::after{ width:120px;height:120px; left:110px; top:-62px;}
.c1{ left:-260px; top:70px; animation-duration: 55s;}
.c2{ left:-260px; top:150px; width:300px; animation-duration: 72s; opacity:.85;}
.c3{ left:-260px; top:250px; width:220px; animation-duration: 62s; opacity:.75;}
@keyframes floaty{
  from{ transform: translateX(0); }
  to{ transform: translateX(calc(100vw + 520px)); }
}
@keyframes card-rise{
  from{ opacity: 0; transform: translateY(6px); }
  to{ opacity: 1; transform: translateY(0); }
}
@keyframes pulse{
  0%{ transform: scale(.9); opacity: .9; }
  50%{ transform: scale(1); opacity: 1; }
  100%{ transform: scale(.9); opacity: .85; }
}

/* topbar */
.topbar{
  position:sticky;
  top:0;
  z-index:5;
  background: rgba(255,255,255,.9);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(31,41,51,.08);
  padding: 14px 18px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  flex-wrap: wrap;
  gap:14px;
  box-shadow: 0 10px 30px rgba(15,23,42,.08);
}
.topbar__left{
  display:flex;
  align-items:center;
  gap:14px;
  flex-wrap: wrap;
}
.brand{
  display:flex;
  align-items:center;
  gap:10px;
}
.brand__logo{ width:44px; height:44px; image-rendering: auto; }
.brand__name{ font-family: "Fraunces", "Space Grotesk", serif; font-weight:700; letter-spacing:.1px; }
.brand__tag{ color:var(--muted); font-size:12px; margin-top:2px; }
.topbar__right{ display:flex; gap:10px; align-items:center; }
.nav{
  position: relative;
  display:flex;
  align-items:flex-start;
  gap:8px;
  flex-wrap: wrap;
}
.nav-toggle{
  display:none;
  align-items:center;
  gap:10px;
  padding: 9px 12px;
  border-radius: 12px;
  border: 1px solid rgba(31,41,51,.12);
  background: rgba(255,255,255,.95);
  color: var(--ink);
  font-weight: 700;
  box-shadow: 0 10px 20px var(--shadow);
  cursor: pointer;
}
.nav-toggle__icon{
  width: 20px;
  height: 2px;
  background: currentColor;
  position: relative;
  border-radius: 999px;
}
.nav-toggle__icon::before,
.nav-toggle__icon::after{
  content:"";
  position:absolute;
  left:0;
  width:20px;
  height:2px;
  background: currentColor;
  border-radius: 999px;
}
.nav-toggle__icon::before{ top:-6px; }
.nav-toggle__icon::after{ top:6px; }
.nav-toggle.is-open .nav-toggle__icon{
  background: transparent;
}
.nav-toggle.is-open .nav-toggle__icon::before{
  top:0;
  transform: rotate(45deg);
}
.nav-toggle.is-open .nav-toggle__icon::after{
  top:0;
  transform: rotate(-45deg);
}
.nav-toggle__label{
  font-size: 13px;
  letter-spacing: .2px;
}
.nav__link{
  text-decoration:none;
  padding: 9px 12px;
  border-radius: 12px;
  border: 1px solid rgba(31,41,51,.12);
  background: rgba(255,255,255,.9);
  color: var(--ink);
  font-weight: 600;
  box-shadow: 0 8px 20px var(--shadow);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
  position: relative;
  z-index: 1;
}
.nav__link:hover{ transform: translateY(-1px); }
.nav__link--active{
  background: linear-gradient(180deg, #1db7b1 0%, #14938e 100%);
  color: #fff;
  border-color: rgba(0,0,0,.12);
}
.nav__group{
  position: relative;
  display:flex;
  flex-direction:column;
  padding-bottom: 10px;
  z-index: 1;
}
.nav__group:hover,
.nav__group:focus-within{
  z-index: 50;
}
.nav__group::after{
  content:"";
  position:absolute;
  left:0;
  top:100%;
  width:100%;
  height: 12px;
  pointer-events: none;
}
.nav__link--group{
  cursor: pointer;
  appearance: none;
  font: inherit;
  text-align: left;
  font-weight: 800;
}
.nav__submenu{
  display:none;
  position:absolute;
  top:100%;
  left:0;
  flex-direction:column;
  gap:8px;
  padding:10px;
  margin-top: 2px;
  background: #ffffff;
  border-radius: 14px;
  border: 1px solid rgba(26,166,160,.35);
  box-shadow: 0 18px 36px rgba(15,23,42,.18);
  min-width: 180px;
  z-index: 60;
}
.nav__group:hover .nav__submenu,
.nav__group:focus-within .nav__submenu,
.nav__group.is-open .nav__submenu{
  display:flex;
}
.nav__group.is-open{
  z-index: 50;
}
.nav__group.is-open .nav__link--group{
  z-index: 55;
}
.nav__sublink{
  text-decoration:none;
  padding: 9px 12px;
  border-radius: 12px;
  border: 1px solid rgba(26,166,160,.35);
  background: linear-gradient(180deg, rgba(29,183,177,.14) 0%, rgba(20,147,142,.08) 100%);
  color: var(--ink);
  font-weight: 700;
}
.nav__sublink:hover{ transform: translateY(-1px); }
.nav__sublink--active{
  background: linear-gradient(180deg, #1db7b1 0%, #14938e 100%);
  color: #fff;
  border-color: rgba(0,0,0,.12);
}

.tp-select{ position: relative; width: 100%; flex: 1 1 100%; }
.tp-select__trigger{ width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border-radius: 12px; border: 1px solid rgba(0,0,0,.08); background: #fff; box-shadow: 0 6px 18px rgba(29,33,51,.08); text-align: left; cursor: pointer; }
.tp-select__label{ font-weight: 900; }
.tp-select__desc{ font-size: 12px; opacity: .75; font-style: italic; }
.tp-select__chev{ width: 10px; height: 10px; border-right: 2px solid rgba(0,0,0,.45); border-bottom: 2px solid rgba(0,0,0,.45); transform: rotate(45deg); transition: transform .15s ease; }
.tp-select.is-open .tp-select__chev{ transform: rotate(225deg); }
.tp-select__menu{ position: absolute; z-index: 40; top: calc(100% + 6px); left: 0; right: 0; background: #fff; border-radius: 14px; border: 1px solid rgba(0,0,0,.08); box-shadow: 0 12px 26px rgba(22,28,45,.15); padding: 6px; display: none; max-height: 320px; overflow: auto; }
.tp-select.is-open .tp-select__menu{ display: block; }
.tp-select__option{ width: 100%; display: block; text-align: left; padding: 10px 12px; border-radius: 10px; border: none; background: transparent; cursor: pointer; }
.tp-select__option:hover{ background: rgba(31,86,255,.08); }
.tp-select__option-label{ font-weight: 800; }
.tp-select__option-desc{ font-size: 12px; opacity: .7; font-style: italic; }

.tp-row{ display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }

.tp-tags{ position: relative; background: #fff; border: 1px solid rgba(0,0,0,.08); border-radius: 12px; padding: 10px; box-shadow: 0 6px 18px rgba(29,33,51,.08); }
.tp-tags__list{ display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.tp-tags__chip{ display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 999px; border: 1px solid rgba(0,0,0,.08); background: rgba(31,86,255,.08); color: #1f2b3a; font-size: 12px; cursor: pointer; }
.tp-tags__chip span{ font-weight: 900; }
.tp-tags__input{ width: 100%; border: none; outline: none; font-size: 14px; padding: 4px 2px; }
.tp-tags__menu{ position: absolute; z-index: 45; left: 0; right: 0; top: calc(100% + 6px); background: #fff; border-radius: 12px; border: 1px solid rgba(0,0,0,.08); box-shadow: 0 12px 26px rgba(22,28,45,.15); padding: 6px; display: none; max-height: 260px; overflow: auto; }
.tp-tags__menu.is-open{ display: block; }
.tp-tags__option{ width: 100%; text-align: left; padding: 8px 10px; border-radius: 10px; border: none; background: transparent; cursor: pointer; display: flex; flex-direction: column; gap: 2px; }
.tp-tags__option strong{ font-weight: 800; }
.tp-tags__option span{ font-size: 12px; opacity: .7; font-style: italic; }
.tp-tags__option:hover{ background: rgba(31,86,255,.08); }

.tp-details{ margin-top: 10px; }
.tp-details summary{ cursor: pointer; font-weight: 700; }

.chip{
  display:flex; align-items:center; gap:8px;
  padding: 8px 12px;
  border:1px solid var(--line);
  background: rgba(255,255,255,.95);
  border-radius: 999px;
  box-shadow: 0 6px 14px var(--shadow);
  font-size: 13px;
}
.chip__dot{
  width:10px;height:10px;border-radius:50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(26,166,160,.15);
}
.chip__role{
  margin-left:6px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(242,185,75,.2);
  color: #7a4f00;
  font-weight:700;
  font-size: 11px;
}

/* cards */
.card{
  border-radius: 18px;
  background: linear-gradient(180deg, var(--card) 0%, var(--card2) 100%);
  border: 1px solid rgba(31,41,51,.08);
  box-shadow: 0 14px 30px var(--shadow);
  padding: 18px;
  margin: 14px 0;
  animation: card-rise .4s ease both;
}
.card__title{
  display:flex; align-items:center; justify-content:space-between; gap:10px;
  margin: 0 0 10px;
}
.card__title h2{ margin:0; font-size: 18px; font-family: "Fraunces", "Space Grotesk", serif; font-weight:700; }
.badge{
  font-size: 12px;
  font-weight:700;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(242,185,75,.2);
  color: #7a4f00;
  border: 1px dashed rgba(122, 90, 0, .3);
}

.template-gallery{
  display:grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 14px;
}
.template-gallery-wrap{
  display:flex;
  flex-direction:column;
  gap:12px;
}
.template-gallery__pager{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:12px;
}
.template-card{
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(180deg, var(--card) 0%, #fff 100%);
  padding: 12px;
  display:flex;
  flex-direction:column;
  gap:10px;
  box-shadow: 0 10px 22px var(--shadow);
}
.template-card--wide{ grid-column: 1 / -1; }
.template-card__head{ display:flex; flex-direction:column; gap:2px; }
.template-card__title{ font-weight:800; }
.template-card__meta{ font-size:12px; color:#6a8292; }
.template-card__preview{
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 8px;
  display:flex;
  align-items:center;
  justify-content:center;
  aspect-ratio: 2 / 1;
  min-height: 0;
}
.template-card--blank .template-card__preview{
  background: linear-gradient(135deg, #ffe7f2, #e6f4ff 45%, #e7f7ef);
  border-color: rgba(26,166,160,.2);
}
.template-card--blank .template-card__preview iframe{
  background: transparent;
}
.template-card__preview iframe{
  width: 100%;
  height: 100%;
  border: 0;
  background: #fff;
}
.template-card__preview.is-mobile iframe{
  width: 100%;
  height: 100%;
}
.template-card__preview.is-mobile{
  max-width: 72%;
  margin: 0 auto;
}
.template-card__actions{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  flex-wrap:wrap;
}
.template-card__toggle{ display:flex; gap:6px; }
.template-card__toggle .btn{ padding: 6px 10px; font-size: 12px; }
.template-card.is-selected{
  border-color: rgba(26,166,160,.45);
  box-shadow: 0 0 0 2px rgba(26,166,160,.2), 0 10px 22px var(--shadow);
}

.disclaimer-list{
  display:flex;
  flex-direction:column;
  gap:8px;
}
.disclaimer-card{
  display:block;
  border:1px solid var(--line);
  border-radius:12px;
  padding:10px 12px;
  background: rgba(255,255,255,.9);
  text-decoration:none;
  color: inherit;
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.disclaimer-card:hover{
  border-color: rgba(26,166,160,.4);
  box-shadow: 0 6px 16px var(--shadow);
  transform: translateY(-1px);
}
.disclaimer-card.is-active{
  border-color: rgba(26,166,160,.45);
  box-shadow: 0 0 0 2px rgba(26,166,160,.2), 0 6px 16px var(--shadow);
}
.disclaimer-card__title{ font-weight:800; }
.disclaimer-card__meta{ font-size:12px; color:#6a8292; }
.disclaimer-templates{
  display:grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap:12px;
}
.disclaimer-template{
  border:1px solid var(--line);
  border-radius:14px;
  padding:12px;
  background: var(--card);
  display:flex;
  flex-direction:column;
  gap:8px;
}
.disclaimer-template__title{ font-weight:800; }

.grid{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
@media (max-width: 860px){
  .grid{ grid-template-columns: 1fr; }
  .nav-toggle{ display:inline-flex; }
  .nav{
    display:none;
    width:100%;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 12px;
    border-radius: 14px;
    border: 1px solid rgba(0,0,0,.08);
    background: rgba(255,255,255,.92);
    box-shadow: 0 16px 30px var(--shadow);
  }
  .nav.nav--open{ display:flex; }
  .nav__group{
    position: static;
    padding-bottom: 0;
  }
  .nav__link{
    width:100%;
  }
  .nav__submenu{
    position: relative;
    margin-top: 8px;
    padding: 8px;
    border: 1px solid rgba(26,166,160,.25);
    box-shadow: 0 10px 18px rgba(15,23,42,.12);
    background: rgba(255,255,255,.98);
    z-index: 5;
  }
  .nav__sublink{
    margin-left: 12px;
  }
  .nav__group:focus-within .nav__submenu{ display: none; }
  .nav__group.is-open .nav__submenu{ display: flex; }
}
@media (hover: none) and (pointer: coarse){
  .nav__group:hover .nav__submenu{ display: none; }
  .nav__group.is-open .nav__submenu{ display: flex; }
}
@media (max-width: 860px) and (hover: none) and (pointer: coarse){
  .nav__group.is-open > .nav__link--group{
    pointer-events: none;
  }
}
@media (max-width: 860px) and (hover: hover) and (pointer: fine){
  .nav__group:hover .nav__submenu,
  .nav__group:focus-within .nav__submenu{
    display: flex;
  }
}

label{
  display:block;
  font-size: 13px;
  font-weight: 600;
  margin: 0 0 6px;
  color: var(--ink);
}
input[type="text"], input[type="email"], input[type="password"], textarea, select{
  width:100%;
  padding: 11px 12px;
  border-radius: 12px;
  border:1px solid var(--line);
  background: rgba(255,255,255,.98);
  outline:none;
  box-shadow: inset 0 1px 0 rgba(15,23,42,.04);
  transition: border-color .2s ease, box-shadow .2s ease;
}
input[type="text"]:focus, input[type="email"]:focus, input[type="password"]:focus, textarea:focus, select:focus{
  border-color: rgba(26,166,160,.6);
  box-shadow: 0 0 0 3px rgba(26,166,160,.15);
}
textarea{ min-height: 140px; resize: vertical; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace; font-size: 13px; }

.row{ display:flex; gap:10px; flex-wrap:wrap; align-items:center; }
.row--end{ justify-content:flex-end; }

.status{
  display:flex;
  align-items:center;
  gap:12px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.95);
  box-shadow: inset 0 1px 0 rgba(15,23,42,.04);
}
.status__dot{
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 0 6px rgba(26,166,160,.18);
  animation: pulse 2.6s ease-in-out infinite;
}
.status__dot--ok{
  background: var(--accent);
  box-shadow: 0 0 0 6px rgba(26,166,160,.18);
}
.status__dot--warn{
  background: var(--warn);
  box-shadow: 0 0 0 6px rgba(242,185,75,.2);
}
.status__dot--error{
  background: var(--danger);
  box-shadow: 0 0 0 6px rgba(224,88,91,.2);
  animation: pulse 2.1s ease-in-out infinite;
}

.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  border-radius: 12px;
  padding: 10px 14px;
  text-decoration:none;
  border: 1px solid rgba(31,41,51,.12);
  background: white;
  color: var(--ink);
  font-weight: 700;
  box-shadow: 0 10px 22px var(--shadow);
  cursor:pointer;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.btn:hover{ transform: translateY(-1px); }
.btn:active{ transform: translateY(0); }
.btn--primary{
  background: linear-gradient(180deg, #1db7b1 0%, #14938e 100%);
  border-color: rgba(0,0,0,.12);
  color: #fff;
}
.btn--success{
  background: linear-gradient(180deg, #46c9a1 0%, #2ea987 100%);
  border-color: rgba(0,0,0,.12);
  color: #073226;
}
.btn--danger{
  background: linear-gradient(180deg, #ee6c6f 0%, #d84f53 100%);
  border-color: rgba(0,0,0,.12);
  color: #fff;
}
.btn--ghost{
  background: rgba(255,255,255,.7);
}

.hr{
  height:1px;
  background: rgba(0,0,0,.08);
  margin: 14px 0;
}

.flash{
  padding: 12px 14px;
  border-radius: 12px;
  margin: 12px 0;
  font-weight: 700;
  border: 1px solid rgba(31,41,51,.08);
  box-shadow: 0 10px 22px var(--shadow);
}
.flash--success{ background: rgba(70,201,161,.18); }
.flash--error{ background: rgba(224,88,91,.16); }
.flash--info{ background: rgba(242,185,75,.18); }

.table{
  width:100%;
  border-collapse: collapse;
  overflow:hidden;
  border-radius: 14px;
  border:1px solid rgba(31,41,51,.1);
  background: #fff;
}
.table th,.table td{
  padding: 10px 10px;
  border-bottom: 1px solid rgba(0,0,0,.06);
  vertical-align: top;
}
.table th{
  text-align:left;
  font-size:12px;
  letter-spacing:.4px;
  text-transform: uppercase;
  background: rgba(15,23,42,.04);
}
.table tr:last-child td{ border-bottom:none; }
.kbd{
  display:inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  border: 1px solid rgba(31,41,51,.12);
  background: rgba(255,255,255,.9);
  font-weight:700;
  font-size: 12px;
}
.small{ color:var(--muted); font-size: 12px; line-height: 1.4; }
.mono{ font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace; }

.preview{
  width:100%;
  height: 260px;
  border-radius: 14px;
  border:1px solid rgba(0,0,0,.10);
  background: #fff;
}

.footer{
  margin-top: 44px;
  padding: 20px 16px 28px;
  border-top: 1px solid rgba(31,41,51,.08);
  background: rgba(255,255,255,.8);
}
.footer__inner{
  max-width: 1080px;
  margin: 0 auto;
  display:flex;
  justify-content:space-between;
  gap:12px;
  flex-wrap: wrap;
}
.footer__small{ color: var(--muted); font-size: 12px; max-width: 680px; }

/* retro speech bubble */
.bubble{
  position: relative;
  background: rgba(255,255,255,.98);
  border: 1px solid rgba(31,41,51,.1);
  border-radius: 16px;
  padding: 12px 14px;
  box-shadow: 0 12px 28px var(--shadow);
}
.bubble::after{
  content:"";
  position:absolute;
  left: 26px;
  bottom:-10px;
  width: 18px;
  height: 18px;
  background: rgba(255,255,255,.98);
  border-left: 1px solid rgba(31,41,51,.1);
  border-bottom: 1px solid rgba(31,41,51,.1);
  transform: rotate(45deg);
}

.editor-toolbar{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  margin: 0 0 10px;
  padding: 10px;
  border-radius: 16px;
  border: 1px solid rgba(31,41,51,.12);
  background: linear-gradient(180deg, rgba(255,255,255,.96) 0%, rgba(244,248,252,.92) 100%);
  box-shadow: 0 12px 26px rgba(15,23,42,.08);
}
.editor-toolbar__group{
  display:flex;
  align-items:center;
  gap:6px;
  padding: 6px;
  border-radius: 12px;
  border: 1px solid rgba(31,41,51,.08);
  background: rgba(255,255,255,.92);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.8), 0 6px 14px rgba(15,23,42,.06);
}
.editor-toolbar__label{
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--muted);
  letter-spacing: .08em;
  padding: 0 6px;
}
.editor-select{
  appearance: none;
  padding: 7px 28px 7px 10px;
  border-radius: 10px;
  border:1px solid rgba(31,41,51,.15);
  background:
    linear-gradient(180deg, #ffffff 0%, #f1f5f9 100%),
    linear-gradient(45deg, transparent 50%, rgba(31,41,51,.6) 50%),
    linear-gradient(135deg, rgba(31,41,51,.6) 50%, transparent 50%);
  background-repeat: no-repeat;
  background-position: right 10px center, right 14px center, right 10px center;
  background-size: auto, 6px 6px, 6px 6px;
  font-weight: 700;
  font-size: 12px;
}
#format_block{ min-width: 140px; }
.editor-btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:6px;
  height: 32px;
  min-width: 32px;
  padding: 0 10px;
  border-radius: 10px;
  border: 1px solid rgba(31,41,51,.15);
  background: linear-gradient(180deg, #ffffff 0%, #eef3f7 100%);
  color: var(--ink);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: .02em;
  cursor: pointer;
  transition: transform .08s ease, box-shadow .08s ease, border-color .08s ease, background .08s ease;
}
.editor-btn--icon{
  width: 32px;
  padding: 0;
}
.editor-btn--label{
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: .08em;
}
.editor-btn__glyph{
  font-size: 14px;
  line-height: 1;
}
.editor-btn__glyph.is-underline{ text-decoration: underline; }
.editor-btn__glyph.is-strike{ text-decoration: line-through; }
.editor-icon{
  display:inline-block;
  width: 16px;
  height: 12px;
  background:
    linear-gradient(currentColor, currentColor) left top / 100% 2px no-repeat,
    linear-gradient(currentColor, currentColor) left center / 72% 2px no-repeat,
    linear-gradient(currentColor, currentColor) left bottom / 86% 2px no-repeat;
}
.editor-icon--align-center{
  background-position: center top, center center, center bottom;
}
.editor-icon--align-right{
  background-position: right top, right center, right bottom;
}
.editor-btn:hover{
  transform: translateY(-1px);
  border-color: rgba(26,166,160,.5);
  box-shadow: 0 6px 12px rgba(15,23,42,.12);
}
.editor-btn:active{
  transform: translateY(0);
  box-shadow: inset 0 2px 4px rgba(15,23,42,.12);
}
.editor-btn.is-active{
  border-color: rgba(26,166,160,.7);
  box-shadow: 0 0 0 2px rgba(26,166,160,.2);
}
.editor-color{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding: 6px 8px;
  border-radius: 10px;
  border:1px solid rgba(31,41,51,.12);
  background: rgba(255,255,255,.9);
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .06em;
}
.editor-color__label{ font-size: 10px; }
.editor-toolbar__colors input[type="color"]{
  width: 28px;
  height: 28px;
  padding:0;
  background: transparent;
  border: none;
  cursor: pointer;
}
.editor{
  min-height: 240px;
  border-radius: 12px;
  border:1px solid var(--line);
  background: rgba(255,255,255,.98);
  padding: 12px;
  box-shadow: inset 0 2px 0 rgba(15,23,42,.04);
  overflow:auto;
}
.editor:focus{ outline: 2px solid rgba(26,166,160,.25); }
.editor-frame{
  width:100%;
  min-height: 260px;
  border-radius: 12px;
  border:1px solid var(--line);
  background: rgba(255,255,255,.98);
  box-shadow: inset 0 2px 0 rgba(15,23,42,.04);
}
.editor-frame:focus{ outline: 2px solid rgba(26,166,160,.25); }
.editor-code{
  width:100%;
  min-height: 240px;
  border-radius: 12px;
  border:1px dashed var(--line);
  background: rgba(255,255,255,.98);
  padding: 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 13px;
  box-shadow: inset 0 2px 0 rgba(15,23,42,.04);
}
.link{ color: var(--accent); font-weight:700; text-decoration: none; }
.link:hover{ text-decoration: underline; }
.user-pills{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
}
.editor-hints{ margin: 8px 0; }
.chip--btn{
  cursor: pointer;
  border: none;
  background: transparent;
  padding: 0;
}
.chip--btn:hover{ transform: translateY(-1px); }
.btn.is-active{ box-shadow: 0 0 0 2px rgba(26,166,160,.28); }
.modal{
  position: fixed;
  inset:0;
  display:none;
  align-items:center;
  justify-content:center;
  z-index: 20;
}
.modal.is-open{ display:flex; }
body.modal-open .card{
  transform: none;
  animation: none;
}
.modal__backdrop{
  position:absolute;
  inset:0;
  background: rgba(0,0,0,.35);
  backdrop-filter: blur(2px);
}
.modal__dialog{
  position: relative;
  background: #fff;
  border-radius: 18px;
  padding: 18px;
  width: min(460px, 92vw);
  box-shadow: 0 22px 50px rgba(15,23,42,.22);
  border: 1px solid rgba(31,41,51,.1);
  z-index: 1;
}
.modal__dialog--xl{
  width: min(1100px, 96vw);
  height: min(86vh, 980px);
  padding: 16px 16px 12px;
}
.org-edit-frame{
  width: 100%;
  height: calc(100% - 44px);
  border: 0;
  border-radius: 12px;
  background: #fff;
}
.org-edit-loading{
  position: absolute;
  inset: 56px 16px 16px 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,.9);
  border-radius: 12px;
  border: 1px dashed rgba(0,0,0,.08);
  z-index: 2;
}
.tp-loading-overlay{
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,.85);
  z-index: 10000;
  opacity: 1;
  transition: opacity .2s ease;
}
.tp-loading-overlay.is-hidden{
  display: none;
}
.tp-loading-overlay svg{
  width: 120px;
  height: 30px;
  fill: var(--accent);
}
.tp-loading-overlay svg circle{
  animation: org-bounce 1.1s infinite ease-in-out both;
}
.tp-loading-overlay svg circle:nth-child(1){ animation-delay: -0.22s; }
.tp-loading-overlay svg circle:nth-child(2){ animation-delay: -0.11s; }
.tp-loading-overlay svg circle:nth-child(3){ animation-delay: 0s; }
.tp-btn-loading{
  display: inline-flex;
  align-items: center;
  margin-left: 10px;
}
.tp-btn-loading svg{
  width: 36px;
  height: 12px;
  fill: currentColor;
}
.tp-btn-loading svg circle{
  animation: org-bounce 1.1s infinite ease-in-out both;
}
.tp-btn-loading svg circle:nth-child(1){ animation-delay: -0.22s; }
.tp-btn-loading svg circle:nth-child(2){ animation-delay: -0.11s; }
.tp-btn-loading svg circle:nth-child(3){ animation-delay: 0s; }
.loading-btn{
  position:relative;
  pointer-events:none;
  opacity:.7;
}
.org-edit-loading.is-hidden{
  display: none;
}
.org-edit-loading svg{
  width: 120px;
  height: 30px;
  fill: var(--org-accent);
}
.org-edit-loading svg circle{
  animation: org-bounce 1.1s infinite ease-in-out both;
}
.org-edit-loading svg circle:nth-child(1){ animation-delay: -0.22s; }
.org-edit-loading svg circle:nth-child(2){ animation-delay: -0.11s; }
.org-edit-loading svg circle:nth-child(3){ animation-delay: 0s; }
.user-dir-loading{
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,.85);
  z-index: 9999;
}
.user-dir-loading.is-hidden{
  display: none;
}
.user-dir-loading svg{
  width: 120px;
  height: 30px;
  fill: var(--org-accent);
}
.user-dir-loading svg circle{
  animation: org-bounce 1.1s infinite ease-in-out both;
}
.user-dir-loading svg circle:nth-child(1){ animation-delay: -0.22s; }
.user-dir-loading svg circle:nth-child(2){ animation-delay: -0.11s; }
.user-dir-loading svg circle:nth-child(3){ animation-delay: 0s; }
@keyframes org-bounce{
  0%, 80%, 100%{ transform: scale(0.6); opacity: 0.55; }
  40%{ transform: scale(1); opacity: 1; }
}
.modal__header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-bottom: 10px;
}
.modal__title{ font-weight:900; font-size: 16px; }
.modal__close{ padding: 8px 10px; }

/* Org chart */
:root{
  --org-bg: #e7f6ed;
  --org-bg2: #f2fbf5;
  --org-ink: #1f3d2c;
  --org-muted: #4d6b58;
  --org-line: rgba(56,132,90,.3);
  --org-glow: rgba(92,179,120,.25);
  --org-card: #ffffff;
  --org-card2: #f7fff9;
  --org-accent: #4aa96c;
  --org-accent2: #8fd3a2;
}
.org-chart__canvas,
.org-card,
.org-tooltip,
.org-chart__controls,
.org-chart__status{
  font-family: "Sora", "Space Grotesk", "DM Sans", "Helvetica Neue", Arial, sans-serif;
}
.org-chart__canvas{
  --org-card-width: 350px;
  --org-card-height: 152px;
  --org-card-gap-x: 48px;
  --org-card-gap-y: 90px;
  --org-card-list-gap-y: 32px;
  --org-chart-margin: 80px;
  height: 70vh;
  min-height: 420px;
  border-radius: 16px;
  border: 1px solid var(--org-line);
  background:
    radial-gradient(circle at 18% 18%, rgba(74,169,108,.12), transparent 55%),
    radial-gradient(circle at 85% 0%, rgba(143,211,162,.15), transparent 45%),
    linear-gradient(180deg, var(--org-bg) 0%, var(--org-bg2) 100%);
  overflow: hidden;
  position: relative;
}
.org-chart__controls{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
}
.org-chart__controls .btn{
  white-space: nowrap;
}
.org-chart-toolbar{
  display:grid;
  grid-template-columns: minmax(280px, 1fr) auto;
  gap: 10px;
  align-items:end;
  margin-bottom: 10px;
}
.org-chart-toolbar label.small{
  display:block;
  margin-bottom: 4px;
}
.org-chart-toolbar input[type="search"],
.org-chart-toolbar select{
  width: 100%;
  height: 40px;
  padding-top: 0;
  padding-bottom: 0;
  border-radius: 10px;
  box-sizing: border-box;
}
.org-chart-toolbar__actions{
  display:flex;
  align-items:flex-end;
  gap: 10px;
}
.org-chart-toolbar .btn{
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
}
.org-menu-wrap{
  position: relative;
}
.org-menu-btn{
  min-width: 140px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
}
.org-menu-btn__count{
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  font-size: 11px;
  font-weight: 900;
  background: rgba(74,169,108,.14);
  color: #2b7d50;
  border: 1px solid rgba(74,169,108,.35);
}
.org-menu-btn__count.is-active{
  background: linear-gradient(135deg, #4aa96c 0%, #2f8a53 100%);
  color: #fff;
  border-color: transparent;
}
.org-menu,
.org-filter-panel{
  position:absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 210px;
  border-radius: 14px;
  border: 1px solid rgba(74,169,108,.28);
  background: linear-gradient(180deg, #ffffff 0%, #f5fff8 100%);
  box-shadow: 0 18px 40px rgba(18,64,40,.18);
  padding: 8px;
  z-index: 20;
  display: none;
}
.org-menu.is-open,
.org-filter-panel.is-open{
  display:block;
}
.org-menu__item{
  width:100%;
  border: 0;
  background: transparent;
  border-radius: 10px;
  padding: 10px 12px;
  text-align: left;
  font-weight: 700;
  color: var(--org-ink);
  cursor: pointer;
}
.org-menu__item:hover{
  background: rgba(74,169,108,.12);
}
.org-filter-panel{
  width: 420px;
  padding: 12px;
}
.org-filter-panel__title{
  font-weight: 900;
  color: var(--org-ink);
  margin-bottom: 10px;
}
.org-filter-grid{
  display:grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.org-chart-toolbar__check{
  display:flex;
  align-items:center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--org-ink);
  margin: 2px 2px 0 2px;
  white-space: nowrap;
  height: 40px;
  border: 1px solid rgba(74,169,108,.24);
  border-radius: 10px;
  padding: 0 10px;
  background: rgba(74,169,108,.06);
}
.org-filter-panel__actions{
  display:flex;
  justify-content:flex-end;
  gap:10px;
  margin-top: 10px;
}
.org-chart__summary{
  margin-bottom: 8px;
  color: var(--org-muted);
  font-weight: 700;
}
@media (max-width: 1180px){
  .org-chart-toolbar{
    grid-template-columns: minmax(220px, 1fr) auto;
  }
}
.org-chart__status{
  border: 1px solid rgba(56,132,90,.22);
  background: rgba(255,255,255,.9);
  color: var(--org-ink);
  margin-bottom: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  font-size: 13px;
}
.org-chart__status--loading{ border-color: rgba(74,169,108,.4); background: rgba(74,169,108,.08); }
.org-chart__status--success{ border-color: rgba(143,211,162,.5); background: rgba(143,211,162,.12); }
.org-chart__status--error{ border-color: rgba(255,75,75,.35); background: rgba(255,75,75,.08); }
.org-chart__status--info{ border-color: rgba(56,132,90,.25); background: rgba(56,132,90,.08); }
.org-link{
  fill: none;
  stroke: rgba(74,169,108,.45);
  stroke-width: 2.5;
}
.org-link--focus{
  stroke: rgba(40, 132, 82, .78);
  stroke-width: 3.4;
}
.org-link--dim{
  opacity: .2;
}
.org-node{
  cursor: grab;
  animation: org-fade-in .35s ease-out both;
  transition: opacity .2s ease;
}
.org-card{
  border-radius: 14px;
  border: 1px solid rgba(74,169,108,.35);
  background: linear-gradient(180deg, var(--org-card) 0%, var(--org-card2) 100%);
  box-shadow:
    0 16px 30px rgba(18,64,40,.14),
    0 0 0 1px rgba(74,169,108,.12);
  color: var(--org-ink);
  display:flex;
  flex-direction:column;
  gap:8px;
  padding: 10px;
  touch-action: none;
  width:100%;
  height:100%;
}
.org-card:hover{
  transform: translateY(-2px);
  box-shadow:
    0 22px 50px rgba(18,64,40,.18),
    0 0 0 2px var(--org-glow);
}
.org-card--root{
  background: linear-gradient(130deg, #58b678 0%, #3d9460 55%, #236b45 100%);
  color: #fff;
  border-color: rgba(255,255,255,.25);
  box-shadow: 0 20px 50px rgba(28,87,57,.35);
}
.org-card__root{
  font-size: 18px;
  letter-spacing: .2px;
  font-weight: 800;
  text-align:center;
  padding-top: 34px;
}
.org-card__header{
  display:flex;
  align-items:center;
  gap:10px;
}
.org-card__avatar{
  width:40px;
  height:40px;
  border-radius: 14px;
  background: rgba(74,169,108,.18);
  border: 1px solid rgba(74,169,108,.2);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.7);
  position: relative;
  overflow: hidden;
  flex: 0 0 auto;
}
.org-card__avatar img{
  width:100%;
  height:100%;
  object-fit: cover;
  display:block;
  opacity: 0;
}
.org-card__avatar img.is-loaded{
  opacity: 1;
}
.org-card__avatar img.is-error{
  display:none;
}
.org-card__avatar span{
  position:absolute;
  inset:0;
  display:flex;
  align-items:center;
  justify-content:center;
  color: #2f7a4e;
}
.org-card__avatar img.is-loaded + span{
  opacity: 0;
}
.org-card__summary{
  flex:1;
  min-width:0;
}
.org-card__name{
  font-weight: 700;
  font-size: 15px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.org-card__title{
  color: var(--org-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.org-card__toggle{
  border-radius: 10px;
  border: 1px solid rgba(74,169,108,.25);
  background: rgba(255,255,255,.9);
  color: var(--org-ink);
  font-weight: 900;
  width: 28px;
  height: 28px;
  cursor: pointer;
}
.org-card__toggle:hover{
  border-color: rgba(74,169,108,.55);
}
.org-card__toggle[disabled]{
  opacity: .4;
  cursor: default;
}
.org-card__meta{
  display:flex;
  flex-direction:column;
  gap:4px;
  font-size: 12px;
  margin-top: auto;
  min-height: 0;
}
.org-card__relationship{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  border-radius: 8px;
  border: 1px solid rgba(74,169,108,.22);
  background: rgba(74,169,108,.08);
  padding: 3px 8px;
  font-size: 11px;
  color: #2b7d50;
}
.org-card__relationship strong{
  color: #1f6a43;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.org-card__dept{
  color: var(--org-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.org-card__email{
  font-weight: 700;
  font-size: 11px;
  color: var(--org-ink);
}
.org-card__office{
  font-size: 11px;
  font-weight: 700;
  color: #286944;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.org-card__reports{
  align-self:flex-start;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid rgba(36,106,68,.18);
  background: rgba(255,255,255,.92);
  color: #235f3d;
  font-size: 11px;
  font-weight: 800;
}
.org-card__badge{
  align-self:flex-start;
  padding: 2px 8px;
  background: rgba(74,169,108,.14);
  color: #236b45;
  border: 1px solid rgba(74,169,108,.35);
  border-radius: 999px;
  font-weight: 700;
  font-size: 11px;
}
.org-card__owner{
  align-self:flex-start;
  padding: 2px 8px;
  background: rgba(53,170,113,.14);
  color: #1d6e45;
  border: 1px solid rgba(53,170,113,.35);
  border-radius: 999px;
  font-weight: 800;
  font-size: 11px;
}
.org-card--unit{
  align-items:flex-start;
  justify-content:center;
  padding: 14px 16px;
  border-style: dashed;
  background: linear-gradient(180deg, rgba(74,169,108,.08) 0%, rgba(74,169,108,.03) 100%);
}
.org-card__unit-label{
  font-weight: 800;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: rgba(74,169,108,.75);
}
.org-card__unit-name{
  font-weight: 800;
  font-size: 16px;
  margin-top: 6px;
  word-break: break-word;
}
.org-tooltip{
  position: fixed;
  z-index: 30;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(23,61,43,.96);
  color: #fff;
  font-size: 12px;
  box-shadow: 0 12px 30px rgba(0,0,0,.22);
  display: none;
  max-width: 260px;
}
.org-tooltip__name{
  font-weight: 700;
  margin-bottom: 4px;
}
.org-tooltip__line{
  opacity: .9;
}
.org-tooltip.is-visible{
  display:block;
}
.org-node--dim{
  opacity: .32;
}
.org-node--focus .org-card{
  border-color: rgba(35,112,70,.72);
  box-shadow:
    0 22px 55px rgba(20,74,46,.22),
    0 0 0 3px rgba(92,179,120,.35);
}
.org-node--manager .org-card{
  border-color: rgba(38,117,73,.5);
}
.org-node--report .org-card{
  border-color: rgba(54,132,88,.45);
}
@keyframes org-fade-in{
  from{ opacity: 0; }
  to{ opacity: 1; }
}
@media (max-width: 720px){
  .card__title{
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .org-chart__controls{
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
  .org-chart__controls .btn{
    width: 100%;
    justify-content: center;
  }
  .org-chart-toolbar{
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .org-chart-toolbar__actions{
    width: 100%;
    justify-content: space-between;
  }
  .org-menu-btn{
    min-width: 0;
    width: calc(50% - 5px);
  }
  .org-filter-panel{
    width: min(92vw, 420px);
    right: 0;
  }
  .org-filter-grid{
    grid-template-columns: 1fr;
  }
  .org-chart-toolbar__check{
    margin: 2px 2px 0 2px;
  }
  .org-chart__canvas{
    --org-card-width: 280px;
    --org-card-height: 142px;
    --org-card-gap-x: 24px;
    --org-card-gap-y: 70px;
    --org-card-list-gap-y: 24px;
    --org-chart-margin: 48px;
    height: 75vh;
    min-height: 420px;
  }
  .org-card{
    padding: 8px;
  }
  .org-card__name{
    font-size: 13px;
  }
  .org-card__title{
    font-size: 11px;
  }
  .org-card__meta{
    font-size: 11px;
  }
  .table{
    display: block;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .table th,
  .table td{
    white-space: nowrap;
  }
}
.org-chart__svg{
  width:100%;
  height:100%;
  touch-action: none;
}
.org-node.is-dragging{
  cursor: grabbing;
  pointer-events: none;
}
.org-node--root{
  cursor: default;
}
.org-card-wrap{
  width:100%;
  height:100%;
}
