/* Forms, panels, tables */
.parchment-panel{position:relative;padding:clamp(1rem,2.4vw,2rem);color:#261204;background:radial-gradient(circle at 20% 15%,rgba(255,255,255,.35),transparent 28%),radial-gradient(circle at 78% 75%,rgba(120,55,12,.15),transparent 38%),linear-gradient(135deg,#f0d8a1,#c8954d);border:10px solid transparent;border-image:linear-gradient(135deg,#4d240b,#b8752b,#3b1b08) 1;box-shadow:inset 0 0 35px rgba(92,42,10,.32),0 18px 45px rgba(0,0,0,.72);margin-bottom:1rem}.parchment-panel::before{content:"";position:absolute;inset:.45rem;border:1px solid rgba(83,38,10,.24);pointer-events:none}.parchment-panel>*{position:relative}.parchment-panel h1,.parchment-panel h2,.parchment-panel h3{color:#1b0b03;-webkit-text-fill-color:#1b0b03;margin-top:0;text-shadow:1px 1px 0 rgba(255,255,255,.22)}.parchment-panel p,.parchment-panel label,.parchment-panel li{font-weight:700}.parchment-panel a,.link-button{color:#4a1603;font-weight:900}.form-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(230px,1fr));gap:1rem;align-items:end}.form-grid.clean-form{align-items:start}.form-row{display:grid;gap:.35rem}.full-span,.form-row.full-span{grid-column:1/-1}.check-row,.mini-check{display:flex;align-items:center;gap:.45rem;font-weight:900}.check-row input,.mini-check input{width:auto!important}.form-row input,.form-row select,.form-row textarea,.parchment-panel input:not([type="checkbox"]):not([type="radio"]),.parchment-panel select,.parchment-panel textarea{width:100%;min-height:42px;padding:.7rem .8rem;border:2px solid #5b2b0e;border-radius:8px;color:#1e0c03!important;-webkit-text-fill-color:#1e0c03!important;background:rgba(255,238,190,.88);font:inherit;font-weight:700}.parchment-panel textarea{min-height:110px}.form-row input:focus,.form-row select:focus,.form-row textarea:focus{outline:3px solid rgba(125,70,20,.35)}.button-row,.table-actions,.inline-form{display:flex;flex-wrap:wrap;gap:.65rem;align-items:center}.btn,button.btn{display:inline-flex;align-items:center;justify-content:center;gap:.35rem;padding:.7rem 1rem;border:2px solid #3b1b08;border-radius:9px;color:#ffe7aa!important;-webkit-text-fill-color:#ffe7aa!important;background:linear-gradient(#7e3e13,#351707);box-shadow:0 5px 12px rgba(0,0,0,.45);text-decoration:none;font:inherit;font-weight:900;cursor:pointer}.btn.secondary{color:#2b1305!important;-webkit-text-fill-color:#2b1305!important;background:linear-gradient(#e3bf78,#9c6727)}.link-button{border:0;background:transparent;font:inherit;font-weight:900;text-decoration:underline;cursor:pointer;padding:0}.link-button.danger{color:#7e1605}.sort-btn{width:34px;height:34px;display:inline-grid;place-items:center;border:2px solid #5b2b0e;border-radius:7px;background:linear-gradient(#e3bf78,#9c6727);color:#2b1305;font-weight:900;cursor:pointer}.alert{margin-bottom:1rem;padding:.85rem 1rem;border-radius:9px;border:2px solid rgba(74,28,5,.45);background:rgba(255,239,190,.92);color:#2b1305;font-weight:900}.alert.error{background:rgba(255,205,190,.94)}.alert.success{background:rgba(215,255,205,.94)}.alert.warning{background:rgba(255,234,170,.94)}.table-wrap{overflow-x:auto}.app-table{width:100%;border-collapse:separate;border-spacing:0;background:rgba(255,238,190,.55);border:1px solid rgba(55,24,7,.32);border-radius:10px;overflow:hidden}.app-table th,.app-table td{padding:.72rem .8rem;border-bottom:1px solid rgba(55,24,7,.28);text-align:left;vertical-align:top}.app-table th{color:#1b0b03;background:rgba(75,31,8,.18);font-weight:900}.app-table tr:last-child td{border-bottom:0}.app-table td:last-child{white-space:nowrap}.admin-grid,.account-grid,.plans-grid,.guild-grid,.character-list{display:grid;grid-template-columns:repeat(auto-fit,minmax(250px,1fr));gap:1rem}.admin-card,.account-card,.message-card,.guide-row,.faq-row,.character-card,.guild-card{padding:1rem;border:1px solid rgba(55,24,7,.25);background:rgba(255,238,190,.34);border-radius:8px}.clean-table-actions{display:flex;gap:.45rem;align-items:center;justify-content:flex-end}.kicker{margin:0 0 .35rem;font-weight:900;letter-spacing:.15em;text-transform:uppercase;color:#5b2209}.tag,.danger-tag,.feature-tag,.plan-lock-badge{display:inline-flex;align-items:center;gap:.25rem;padding:.22rem .45rem;border:1px solid rgba(68,30,8,.35);border-radius:999px;background:rgba(255,235,175,.62);color:#2a1004;font-size:.75rem;font-weight:900;vertical-align:middle}.danger-tag{background:rgba(255,170,150,.72)}.plan-lock-plus{background:#5b4214;color:#ffe7aa}.plan-lock-pro{background:#351451;color:#ffe7ff}.is-disabled,.feature-locked{opacity:.58}.tab-nav{display:flex;flex-wrap:wrap;gap:.4rem;margin:0 0 1rem}.tab-nav a{padding:.55rem .75rem;border-radius:8px;border:1px solid rgba(55,24,7,.28);background:rgba(255,238,190,.34);text-decoration:none}.tab-nav a.active{background:rgba(80,38,13,.72);color:#ffe7aa!important;-webkit-text-fill-color:#ffe7aa!important}


/* Unified form/table polish */
.form-grid,.filter-form,.admin-search-form{display:grid;grid-template-columns:repeat(auto-fit,minmax(230px,1fr));gap:1rem;align-items:end}.form-row{display:grid;gap:.35rem}.form-row input,.form-row select,.form-row textarea,.search-input,input[type=text],input[type=email],input[type=password],input[type=number],input[type=date],input[type=url],select,textarea{width:100%;padding:.72rem .85rem;border:2px solid #5b2b0e;border-radius:8px;color:#1e0c03!important;-webkit-text-fill-color:#1e0c03!important;background:rgba(255,238,190,.9);font:inherit;font-weight:700}.check-row,.mini-check{display:flex;align-items:center;gap:.45rem;font-weight:900}.check-row input,.mini-check input{width:auto}.full-span{grid-column:1/-1}.button-row{display:flex;flex-wrap:wrap;gap:.65rem;align-items:center}.btn,.sort-btn,button.btn{display:inline-block;padding:.68rem 1rem;border:2px solid #3b1b08;border-radius:9px;color:#ffe7aa!important;-webkit-text-fill-color:#ffe7aa!important;background:linear-gradient(#7e3e13,#351707);box-shadow:0 5px 12px rgba(0,0,0,.45);text-decoration:none;font-weight:900;cursor:pointer}.btn.secondary,.sort-btn{color:#2b1305!important;-webkit-text-fill-color:#2b1305!important;background:linear-gradient(#e3bf78,#9c6727)}.sort-actions,.editor-row-actions{display:flex;flex-wrap:wrap;gap:.35rem;align-items:center}.sort-btn{min-width:2.35rem;text-align:center;padding:.45rem .65rem}.table-wrap{overflow-x:auto}.app-table{width:100%;border-collapse:separate;border-spacing:0;background:rgba(255,238,190,.64);border:1px solid rgba(55,24,7,.35);border-radius:12px;overflow:hidden}.app-table th,.app-table td{padding:.72rem .8rem;border-bottom:1px solid rgba(55,24,7,.28);text-align:left;vertical-align:top}.app-table th{color:#1b0b03;background:rgba(74,32,8,.14);font-weight:900}.app-table tr:last-child td{border-bottom:0}.config-tabs{display:flex;flex-wrap:wrap;gap:.5rem;margin:.75rem 0 1rem}.config-tabs a{padding:.55rem .8rem;border:1px solid rgba(55,24,7,.28);border-radius:999px;background:rgba(255,238,190,.44);font-weight:900;text-decoration:none;color:#3b1605}.config-tabs a.active{background:linear-gradient(#7e3e13,#351707);color:#ffe7aa}.admin-table-actions{display:flex;gap:.4rem;flex-wrap:wrap}.clean-card-grid{display:grid;gap:1rem}.editor-row{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:1rem;align-items:center;padding:.75rem;border:1px solid rgba(55,24,7,.25);background:rgba(255,238,190,.34);border-radius:10px;margin:.55rem 0}@media(max-width:760px){.editor-row{grid-template-columns:1fr}.editor-row-actions{justify-content:flex-start}.app-table{font-size:.9rem}}


/* 20260625-30 polish */
.guild-grid .guild-card,
.guild-card {
    background: rgba(239, 216, 167, .86) !important;
    color: #2a1004 !important;
    -webkit-text-fill-color: currentColor !important;
    opacity: 1 !important;
}
.site-footer {
    position: fixed;
    z-index: 130;
    left: 0; right: 0; bottom: 0;
    min-height: 34px;
    padding: .35rem 1rem;
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    color: rgba(241,208,138,.82);
    background: linear-gradient(to top, rgba(0,0,0,.82), transparent);
    font-size: .85rem;
    pointer-events: none;
}
.site-footer .site-provided-by { font-weight: 900; }
@media (max-width:760px){.site-footer{position:relative;display:grid;text-align:center;background:#050302}}
.card-image-preview img,.guild-image-card img { max-width: min(100%, 520px); height:auto; border:4px solid #5b2b0e; border-radius:8px; box-shadow:0 10px 24px rgba(0,0,0,.35); }
.guild-card-editor .card-image-field { display:none; }
.guild-card-editor[data-selected-card-type="image"] .card-image-field { display:grid; }
.guild-card-editor[data-selected-card-type="image"] .card-body-field { display:none !important; }
.guild-card-editor[data-selected-card-type="roster"] .card-body-field,
.guild-card-editor[data-selected-card-type="shoutbox"] .card-body-field,
.guild-card-editor[data-selected-card-type="forum_preview"] .card-body-field,
.guild-card-editor[data-selected-card-type="gallery_preview"] .card-body-field { display:none!important; }

/* 20260628 follow-up: keep move-arrow table cells aligned */
.sort-actions,
.app-table td.sort-actions { width: 84px !important; min-width: 84px !important; white-space: nowrap !important; vertical-align: middle !important; }
.sort-actions form { display: inline-flex !important; align-items: center !important; justify-content: center !important; gap: .35rem !important; margin: 0 !important; }
.sort-actions button,
.sort-arrow,
.sort-btn {
  width: 34px !important; height: 34px !important; min-width: 34px !important; padding: 0 !important;
  display: inline-grid !important; place-items: center !important; line-height: 1 !important;
}
.admin-game-logo { display:block; max-width:90px; max-height:56px; object-fit:contain; margin:.15rem 0; }
.admin-checkbox-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(170px,1fr)); gap:.45rem .75rem; }

/* 20260628-2: keep sort-arrow table columns tight and aligned */
.app-table td.sort-actions {
  width: 88px !important;
  min-width: 88px !important;
}
.app-table td.sort-actions {
  display: table-cell !important;
  white-space: nowrap !important;
  vertical-align: middle !important;
  padding: .55rem .65rem !important;
}
.app-table td.sort-actions form {
  display: inline-flex !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  justify-content: center !important;
  gap: .35rem !important;
  margin: 0 !important;
  padding: 0 !important;
}
.app-table td.sort-actions button,
.app-table td.sort-actions .sort-arrow,
.app-table td.sort-actions .sort-btn {
  width: 34px !important;
  height: 34px !important;
  min-width: 34px !important;
  padding: 0 !important;
  display: inline-grid !important;
  place-items: center !important;
  line-height: 1 !important;
}
.app-table td.table-actions,
.app-table .table-actions {
  white-space: nowrap;
  vertical-align: middle;
}

/* 20260628-5 modal cards, filtered forms, and scroll editor */
.ttz-modal-card { display: none; }
.ttz-modal-card.is-open {
  display: block;
  position: fixed;
  z-index: 1200;
  inset: clamp(.75rem, 4vw, 3rem);
  width: min(980px, calc(100vw - 1.5rem));
  max-height: calc(100vh - 1.5rem);
  margin: auto;
  overflow: auto;
  overscroll-behavior: contain;
  box-shadow: 0 28px 70px rgba(0,0,0,.72), inset 0 0 22px rgba(70,30,8,.16);
}
.ttz-modal-card.is-open::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background: radial-gradient(circle at 50% 20%, rgba(142,82,30,.22), transparent 35%), rgba(0,0,0,.7);
}
.ttz-modal-close {
  position: sticky;
  top: .25rem;
  float: right;
  z-index: 2;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 999px;
  border: 2px solid #3b1b08;
  background: linear-gradient(#e3bf78,#9c6727);
  color: #1d0b03;
  -webkit-text-fill-color: #1d0b03;
  font-weight: 1000;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(0,0,0,.35);
}
.scroll-editor-form { align-items: start; }
.scroll-editor-top {
  display: grid;
  grid-template-columns: minmax(170px,.7fr) minmax(210px,1fr) minmax(260px,1.25fr);
  gap: 1rem;
  align-items: end;
}
.scroll-editor-bottom {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: space-between;
  align-items: end;
}
.wysiwyg-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  margin-bottom: .45rem;
}
.wysiwyg-toolbar button {
  min-height: 34px;
  padding: .35rem .65rem;
  border: 1px solid rgba(70,31,8,.55);
  border-radius: 8px;
  background: linear-gradient(#e8c884,#b77731);
  color: #1b0b03;
  -webkit-text-fill-color: #1b0b03;
  font-weight: 900;
  cursor: pointer;
}
.wysiwyg-editor {
  min-height: 420px;
  width: 100%;
  padding: .8rem;
  border: 2px solid #6b310e;
  border-radius: 9px;
  background: rgba(255,238,190,.74);
  color: #1f0c03;
  -webkit-text-fill-color: #1f0c03;
  overflow: auto;
  box-shadow: inset 0 0 12px rgba(70,30,8,.18);
}
.wysiwyg-editor:focus { outline: 3px solid rgba(142,82,30,.35); }
.wysiwyg-editor blockquote { margin: .6rem 0; padding: .45rem .75rem; border-left: 4px solid #7e3e13; background: rgba(255,255,255,.22); }
@media (max-width: 850px) {
  .scroll-editor-top { grid-template-columns: 1fr; }
  .ttz-modal-card.is-open { inset: .5rem; width: calc(100vw - 1rem); max-height: calc(100vh - 1rem); }
}


/* 20260628-7: modal placement and full scroll editor */
.ttz-modal-card.is-open {
  top: clamp(6.4rem, 13vh, 9rem) !important;
  bottom: clamp(1rem, 4vh, 2.5rem) !important;
  left: 50% !important;
  right: auto !important;
  transform: translateX(-50%);
  width: min(1040px, calc(100vw - 1.5rem)) !important;
  max-height: calc(100vh - clamp(7.7rem, 16vh, 11.5rem)) !important;
  margin: 0 !important;
}
.ttz-modal-card.is-open .form-grid { align-items: start; }
.wysiwyg-toolbar button.active,
.wysiwyg-toolbar button[aria-pressed="true"] { outline: 3px solid rgba(55,20,6,.35); background: linear-gradient(#7e3e13,#351707); color:#ffe7aa; -webkit-text-fill-color:#ffe7aa; }
.wysiwyg-source { min-height: 420px; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; line-height: 1.35; }
.rich-scroll-editor table,
.scroll-body table { width: 100%; border-collapse: collapse; margin: .8rem 0; background: rgba(255,245,210,.34); }
.rich-scroll-editor th,.rich-scroll-editor td,
.scroll-body th,.scroll-body td { border: 1px solid rgba(60,25,7,.42); padding: .45rem .55rem; vertical-align: top; }
.rich-scroll-editor img,
.scroll-body img { max-width: 100%; height: auto; border-radius: 8px; box-shadow: 0 8px 18px rgba(0,0,0,.28); }
.rich-scroll-editor pre,
.scroll-body pre { overflow:auto; padding:.75rem; border-radius:8px; background:rgba(35,13,4,.82); color:#ffe9b8; -webkit-text-fill-color:#ffe9b8; }
.rich-scroll-editor code,
.scroll-body code { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
.ttz-popup-launch-row { display:flex; flex-wrap:wrap; gap:.65rem; margin:.75rem 0 1rem; }
@media (max-width: 850px) {
  .ttz-modal-card.is-open {
    top: 5.8rem !important;
    bottom: .5rem !important;
    width: calc(100vw - 1rem) !important;
    max-height: calc(100vh - 6.4rem) !important;
  }
}

/* 20260628-8: lower modal cards below the tavern beam and polish auto-popups */
.ttz-modal-card.is-open {
  top: clamp(9.8rem, 21vh, 14rem) !important;
  bottom: clamp(1rem, 4vh, 2.5rem) !important;
  max-height: calc(100vh - clamp(11rem, 24vh, 16.5rem)) !important;
}
.ttz-auto-modal-host { margin-top: .75rem; }
.ttz-auto-modal-card > h2 { margin-right: 3rem; }
.ttz-modal-active { overflow: hidden; }
@media (max-width: 850px) {
  .ttz-modal-card.is-open {
    top: 7.6rem !important;
    bottom: .5rem !important;
    width: calc(100vw - 1rem) !important;
    max-height: calc(100vh - 8.25rem) !important;
  }
}
@media (max-width: 520px) {
  .ttz-modal-card.is-open {
    top: 7.1rem !important;
    max-height: calc(100vh - 7.75rem) !important;
  }
}
.site-footer, .site-footer a { pointer-events: auto; }

/* 20260628-9: push popup cards clearly below the beam */
.ttz-modal-card.is-open{
  top:clamp(12.5rem,24vh,16rem) !important;
  max-height:calc(100vh - clamp(14rem,27vh,18.5rem)) !important;
}
@media(max-width:850px){.ttz-modal-card.is-open{top:8.8rem !important;max-height:calc(100vh - 9.5rem) !important}}
@media(max-width:520px){.ttz-modal-card.is-open{top:8rem !important;max-height:calc(100vh - 8.7rem) !important}}

/* 20260628-10: stronger parchment popup surface + hide source card for edit popups */
.ttz-modal-card.is-open {
  background:
    radial-gradient(circle at 20% 15%, rgba(255,255,255,.35), transparent 28%),
    radial-gradient(circle at 78% 75%, rgba(120,55,12,.15), transparent 38%),
    linear-gradient(135deg,#f0d8a1,#c8954d) !important;
  color:#261204 !important;
  -webkit-text-fill-color:#261204 !important;
}
.ttz-modal-card.is-open h1,
.ttz-modal-card.is-open h2,
.ttz-modal-card.is-open h3,
.ttz-modal-card.is-open label,
.ttz-modal-card.is-open p,
.ttz-modal-card.is-open small,
.ttz-modal-card.is-open span {
  color:#1b0b03;
  -webkit-text-fill-color:#1b0b03;
}
.ttz-modal-card.is-open .btn,
.ttz-modal-card.is-open button.btn,
.ttz-modal-card.is-open .wysiwyg-toolbar button {
  -webkit-text-fill-color: initial;
}
.ttz-modal-source-hidden { display:none !important; }

/* 20260628-11: keep popup parchment solid; move the dark veil outside the card */
body.ttz-modal-active::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 1190;
  pointer-events: none;
  background: radial-gradient(circle at 50% 22%, rgba(142,82,30,.18), transparent 34%), rgba(0,0,0,.68);
}
.ttz-modal-card.is-open {
  z-index: 1200 !important;
  isolation: isolate;
  background-color: #d2a35b !important;
  background-image:
    radial-gradient(circle at 20% 15%, rgba(255,255,255,.45), transparent 30%),
    radial-gradient(circle at 78% 76%, rgba(112,48,8,.14), transparent 38%),
    linear-gradient(135deg,#f2dda9 0%,#d2a35b 58%,#b98238 100%) !important;
  background-attachment: scroll !important;
}
.ttz-modal-card.is-open::before {
  display: none !important;
}
.ttz-modal-card.is-open > * {
  position: relative;
  z-index: 1;
}


/* 20260630-44 admin tabs: even button grid */
.config-tabs {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(145px, 1fr)) !important;
  align-items: stretch !important;
}
.config-tabs a {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-height: 2.65rem !important;
  text-align: center !important;
  line-height: 1.15 !important;
}
@media (max-width: 560px) {
  .config-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}


/* 20260630-45 popup modal restore */
body.ttz-modal-active {
  overflow: hidden;
}
body.ttz-modal-active::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 899;
  background: rgba(0, 0, 0, .68);
  backdrop-filter: blur(2px);
}
.ttz-popup-launch-row {
  display: flex;
  flex-wrap: wrap;
  gap: .65rem;
  align-items: center;
  margin: .75rem 0 1rem;
}
.ttz-modal-card,
.ttz-modal-card[aria-hidden="true"] {
  display: none !important;
}
.ttz-modal-card.is-open {
  display: block !important;
  position: fixed !important;
  z-index: 900 !important;
  top: 50% !important;
  left: 50% !important;
  transform: translate(-50%, -50%) !important;
  width: min(980px, calc(100vw - 2rem)) !important;
  max-height: min(88vh, calc(100dvh - 2rem)) !important;
  overflow: auto !important;
  padding: clamp(1rem, 2vw, 1.45rem) !important;
  border-radius: 18px !important;
  box-shadow: 0 24px 80px rgba(0,0,0,.72), inset 0 0 28px rgba(82,38,10,.14) !important;
}
.ttz-modal-card.is-open > h1,
.ttz-modal-card.is-open > h2,
.ttz-modal-card.is-open > h3 {
  padding-right: 3rem;
}
.ttz-modal-close {
  position: sticky;
  top: 0;
  float: right;
  z-index: 2;
  display: inline-grid;
  place-items: center;
  width: 2.45rem;
  height: 2.45rem;
  margin: -.35rem -.35rem .35rem .75rem;
  border: 2px solid rgba(59,27,8,.82);
  border-radius: 999px;
  background: linear-gradient(#7e3e13,#351707);
  color: #ffe7aa !important;
  -webkit-text-fill-color: #ffe7aa !important;
  font-size: 1.45rem;
  font-weight: 900;
  line-height: 1;
  box-shadow: 0 8px 18px rgba(0,0,0,.38), inset 0 0 10px rgba(255,235,178,.18);
  cursor: pointer;
}
.ttz-modal-close:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}
.ttz-modal-source-hidden {
  display: none !important;
}
@media (max-width: 760px) {
  .ttz-modal-card.is-open {
    width: calc(100vw - 1rem) !important;
    max-height: calc(100dvh - 1rem) !important;
    padding: .9rem !important;
  }
}
