body{margin:0;background:#0f1115;color:#e5e7eb;font:14px/1.5 system-ui,Segoe UI,Roboto,Helvetica,Arial}
.banner{background:rgba(234,179,8,.12);border-bottom:1px solid rgba(250,204,21,.35);color:#facc15;padding:10px 16px;text-align:center;font-weight:600;font-size:13px}
.header{padding:16px;text-align:center}
.header h1{margin:0;font-size:24px}
.toolbar{margin:8px auto;max-width:1100px;background:#101520;border:1px solid #2a2f3f;border-radius:12px;padding:6px 10px;display:flex;align-items:flex-start;gap:8px}
.left{display:flex;flex-direction:column;gap:6px;flex:1;min-width:0}
.row{display:flex;gap:8px;align-items:center;flex-wrap:nowrap}
.input{background:#0f1320;border:1px solid #2a3146;color:#e5e7eb;border-radius:10px;padding:6px 8px}
.input.sm{width:50px}
.input.name{width:200px;font-size:15px;padding:8px 10px}
.input.ac{width:60px;text-align:center}
.input.hp{width:70px}
.btn{appearance:none;border:1px solid #2a3146;background:#161a27;color:#e5e7eb;padding:6px 10px;border-radius:10px;cursor:pointer}
.btn.primary{background:#1e293b}
.btn.small{padding:5px 8px;font-size:12px}
.helper{color:#9aa0aa;font-size:13px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.text-damage{color:#f87171}
.text-heal{color:#4ade80}
.text-statblock{color:#60a5fa}
.hidden-file-input{display:none}
.stack{display:grid;grid-template-columns:repeat(2,max-content);gap:6px 8px;justify-content:end;align-items:center}
.tablewrap{max-width:1100px;margin:8px auto;background:#101520;border:1px solid #2a2f3f;border-radius:14px;overflow:hidden;position:relative;min-height:320px;display:flex;flex-direction:column}
table{width:100%;border-collapse:separate;border-spacing:0;position:relative;z-index:1}
th,td{padding:10px;border-bottom:1px solid #2a2f3f;text-align:center}
thead th{background:#151b27;color:#cfd5e4}
.table-empty-hint{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;padding:clamp(28px,6vw,56px);text-align:left;pointer-events:none;opacity:0;transition:opacity .3s ease;z-index:3;box-sizing:border-box;overflow:hidden}
.table-empty-hint--visible{opacity:1;pointer-events:auto}
.table-empty-hint__inner{max-width:min(520px,calc(100% - 32px));width:100%;margin:auto;background:rgba(15,19,32,.9);border:1px dashed #2f3a55;border-radius:18px;padding:clamp(20px,4vw,28px) clamp(22px,5vw,36px);box-shadow:0 20px 40px rgba(15,23,42,.45);box-sizing:border-box;max-height:100%;overflow:auto}
.table-empty-hint__list{margin:0;padding-left:18px;display:flex;flex-direction:column;gap:10px;color:#cdd3e4;font-size:14px;line-height:1.6}
.table-empty-hint__list li strong{color:#f1f5f9}
.drag{display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;border-radius:8px;background:#0f1320;border:1px solid #2a3146;color:#9aa3b2}
.is-dragging{opacity:.5}
.cell-input{background:#0f1320;border:1px solid #2a3146;color:#e5e7eb;border-radius:8px;padding:6px 8px;width:100%}
.cell-input--sm{max-width:70px}
.cell-input--md{max-width:80px}
.ac-input{text-align:center}
.init-cell{display:flex;align-items:center;justify-content:center}
.color-picker-input{position:absolute;opacity:0;width:1px;height:1px;padding:0;margin:0;border:0;clip:rect(0 0 0 0);clip-path:inset(50%);overflow:hidden;white-space:nowrap}
.handle-cell{padding:0}
.handle-cell__wrap{display:flex;align-items:stretch;justify-content:flex-start;gap:8px;width:100%;padding-right:14px}
.color-bar{position:relative;appearance:none;border:0;background:transparent;padding:0;width:12px;cursor:pointer;display:flex;align-items:stretch;justify-content:center;align-self:stretch}
.color-bar::before{content:"";display:block;width:100%;height:100%;background:var(--color-bar,#101520);border:1px solid var(--color-bar-border,var(--monster-color-border,#2a2f3f));border-radius:0 6px 6px 0;box-sizing:border-box}
.color-bar::before{content:"";display:block;width:100%;height:100%;background:var(--color-bar,#101520);border:1px solid var(--color-bar-border,rgba(15,23,42,.55));border-radius:0 6px 6px 0;box-sizing:border-box}
.drag{align-self:center}
.color-bar:hover::before{border-color:rgba(59,130,246,.65)}
.color-bar:focus-visible::after{content:"";position:absolute;inset:-4px;border-radius:999px;box-shadow:0 0 0 2px rgba(96,165,250,.9)}
.hp-split{display:flex;align-items:center;justify-content:center;gap:6px}
.hp-split .slash{opacity:.6}
.dmgRow{display:flex;align-items:center;justify-content:center;gap:8px}
.dmgRow .box{width:60px}
.damage-input{color:#f87171;border-color:#991b1b;background:#1b0f12}
.damage-input::placeholder{color:#fca5a5}
.damage-btn{background:#7f1d1d;border-color:#991b1b;color:#fee2e2}
.damage-btn:hover{background:#991b1b}
.heal-input{color:#4ade80;border-color:#15803d;background:#0f1b14}
.heal-input::placeholder{color:#86efac}
.heal-btn{background:#166534;border-color:#15803d;color:#dcfce7}
.heal-btn:hover{background:#15803d}
.overlay{--overlay-gap:clamp(16px,4vh,36px);position:fixed;inset:0;background:rgba(15,23,42,.7);backdrop-filter:blur(4px);display:none;align-items:stretch;justify-content:center;padding:var(--overlay-gap);z-index:2000}
.overlay.show{display:flex}
.monster-row td{position:relative;transition:background-color .2s ease,box-shadow .2s ease;background:var(--monster-color-tint,transparent);border-bottom-color:var(--monster-color-border,#2a2f3f)}
.active-turn-indicator{position:absolute;top:0;left:0;transform:translateY(-50%);font-size:20px;color:#9333ea;pointer-events:none;opacity:0;transition:top .25s ease,left .25s ease,opacity .2s ease;z-index:5}
.name-cell{display:flex;align-items:center;justify-content:center;gap:8px;flex-wrap:nowrap;position:relative}
.name-input{max-width:180px;min-width:140px;flex:1 1 160px;text-align:left}
.name-input:focus{border-color:#3b82f6;box-shadow:0 0 0 2px rgba(59,130,246,.25)}
.statblock-btn.has-csv{border-color:#2563eb;color:#93c5fd;background:rgba(37,99,235,.12)}
.statblock-btn.has-csv:hover{background:rgba(37,99,235,.24)}
.statblock-btn--notes{border-color:#334155;background:rgba(30,41,59,.4);color:#cbd5f5}
.statblock-btn--notes:hover{background:rgba(30,41,59,.55)}
.stat-card{background:#0f1320;border:1px solid #1f2937;border-radius:18px;box-shadow:0 24px 60px rgba(15,23,42,.6);width:min(780px,calc(100vw - 48px));max-height:min(90vh,760px);display:flex;flex-direction:column;overflow:hidden;color:#e5e7eb}
.stat-card__header{display:flex;justify-content:space-between;align-items:flex-start;gap:16px;padding:20px 24px 12px;border-bottom:1px solid #1f2937;background:linear-gradient(180deg,#1a2236,#101522)}
.stat-card__title-block{display:flex;flex-direction:column;gap:4px;flex:1;min-width:0}
.stat-card__name{margin:0;font-size:24px;font-weight:700;color:#f1f5f9}
.stat-card__meta{font-size:14px;color:#9aa6c2;line-height:1.4}
.stat-card__source{font-size:12px;color:#7c8aa9;text-transform:uppercase;letter-spacing:.12em}
.stat-card__close{background:transparent;border:1px solid #273346;border-radius:999px;color:#cbd5f5;width:32px;height:32px;display:flex;align-items:center;justify-content:center;font-size:20px;cursor:pointer;transition:background .2s,border-color .2s}
.stat-card__close:hover{background:#1f2937;border-color:#334155}
.stat-card__body{padding:18px 24px 24px;overflow:auto;display:flex;flex-direction:column;gap:18px;flex:1}
.stat-card__body--notes{gap:12px}
.stat-card--notes .stat-card__body{overflow:hidden}
.stat-card__notes{flex:1;display:flex}
.stat-card__notes-input{flex:1;min-height:0;background:#111a2c;border:1px solid #1e293b;border-radius:12px;color:#dbeafe;font-size:15px;line-height:1.6;padding:16px;resize:none;box-shadow:inset 0 0 0 1px rgba(148,163,184,.1)}
.stat-card__notes-input:focus{border-color:#3b82f6;box-shadow:inset 0 0 0 1px rgba(59,130,246,.35)}
.stat-card__notes-input::placeholder{color:#94a3b8}
.stat-card__notes-hint{font-size:13px;color:#94a3b8;text-align:right}
.stat-card--notes{width:min(420px,calc(100vw - 64px));max-height:min(85vh,560px);min-height:420px}
.stat-card--notes .stat-card__header{padding:18px 24px}
.stat-card--notes .stat-card__body{padding:20px 24px 24px;gap:14px;justify-content:space-between}
.stat-card--notes .stat-card__notes{flex:1}
.stat-card--notes .stat-card__notes-input{min-height:280px;height:100%}
.stat-card--notes .stat-card__notes-hint{text-align:center;margin-top:6px}
@media (max-width:520px){
  .stat-card--notes{width:calc(100vw - 32px);min-height:360px;max-height:80vh}
  .stat-card--notes .stat-card__body{padding:18px 20px 20px}
}
.stat-card__image{align-self:center;max-width:100%;border-radius:14px;overflow:hidden;border:1px solid #1f2937;background:#0b1120}
.stat-card__image img{display:block;width:100%;height:auto}
.stat-card__challenge{align-self:flex-start;background:#132235;border:1px solid #1f3a5f;color:#93c5fd;padding:6px 12px;border-radius:999px;font-size:13px;font-weight:600;letter-spacing:.05em}
.stat-section{display:flex;flex-direction:column;gap:10px}
.stat-section__title{margin:0;font-size:15px;font-weight:700;color:#e2e8f0;text-transform:uppercase;letter-spacing:.1em}
.stat-list{display:grid;grid-template-columns:minmax(140px,200px) 1fr;gap:6px 16px;margin:0}
.stat-list dt{font-weight:600;color:#94a3b8;text-align:left;text-transform:uppercase;font-size:12px;letter-spacing:.08em}
.stat-list dd{margin:0;color:#e2e8f0;text-align:left;white-space:pre-wrap}
.ability-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(90px,1fr));gap:12px}
.ability-grid__cell{background:#131a2f;border:1px solid #1f2937;border-radius:12px;padding:12px 8px;text-align:center;display:flex;flex-direction:column;gap:6px}
.ability-grid__label{font-size:12px;color:#94a3b8;text-transform:uppercase;letter-spacing:.08em}
.ability-grid__value{font-size:20px;font-weight:700;color:#f8fafc}
.stat-text{background:#111a2c;border:1px solid #1e293b;border-radius:12px;padding:12px 14px;color:#dbeafe;white-space:pre-wrap;line-height:1.6}
.stat-text--list{display:flex;flex-direction:column;gap:8px;white-space:normal}
.stat-text__line{position:relative;padding:2px 0}
.stat-text__line+.stat-text__line{padding-top:10px;margin-top:8px;border-top:1px solid rgba(148,163,184,.2)}
.stat-tags{display:flex;flex-wrap:wrap;gap:8px}
.stat-tag{background:#1d2c47;border:1px solid #294368;color:#bfdbfe;padding:4px 10px;border-radius:999px;font-size:12px;letter-spacing:.05em;text-transform:uppercase}
.stat-card__empty{padding:28px;border:1px dashed #334155;border-radius:16px;background:rgba(15,23,42,.6);text-align:center;color:#cbd5f5;font-size:15px}
.sheet-modal{background:#0f1320;border:1px solid #1f2937;border-radius:18px;box-shadow:0 24px 60px rgba(15,23,42,.6);width:min(960px,calc(100vw - 32px));height:min(960px,calc(100dvh - var(--overlay-gap)*2));max-height:calc(100dvh - var(--overlay-gap)*2);display:flex;flex-direction:column;color:#e5e7eb}
.sheet-modal__header{display:flex;flex-direction:column;gap:4px;padding:20px 24px 16px;border-bottom:1px solid #1f2937;background:linear-gradient(180deg,#1a2236,#101522);position:relative}
.sheet-modal__title{margin:0;font-size:24px;font-weight:700;color:#f1f5f9}
.sheet-modal__subtitle{font-size:13px;color:#9aa6c2}
.sheet-modal__close{position:absolute;top:16px;right:16px;background:transparent;border:1px solid #273346;border-radius:999px;color:#cbd5f5;width:32px;height:32px;display:flex;align-items:center;justify-content:center;font-size:20px;cursor:pointer;transition:background .2s,border-color .2s}
.sheet-modal__close:hover{background:#1f2937;border-color:#334155}
.sheet-modal__body{display:flex;flex:1 1 auto;min-height:0;overflow:hidden;background:#0b1120}
.sheet-modal__body iframe,.sheet-modal__body embed{display:block;flex:1 1 auto;min-height:0;width:100%;border:0}
.sheet-modal__embed{display:block;flex:1 1 auto;min-height:0;border:0;background:#0b1120}
.statblock-btn--sheet{background:#1f3a5f;border-color:#1f3a5f;color:#cde4ff}
.statblock-btn--sheet:hover{background:#25507e;border-color:#25507e;color:#e0f2ff}
.csv-modal{background:#0f1320;border:1px solid #1f2937;border-radius:16px;box-shadow:0 20px 40px rgba(15,23,42,.6);width:min(460px,calc(100vw - 48px));max-height:min(80vh,560px);display:flex;flex-direction:column;overflow:hidden}
.csv-modal__header{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:16px 20px;border-bottom:1px solid #1f2937;background:linear-gradient(180deg,#1a2335,#101524)}
.csv-modal__title{margin:0;font-size:18px;font-weight:600;color:#e2e8f0}
.csv-modal__close{background:transparent;border:1px solid #273346;border-radius:999px;color:#cbd5f5;width:28px;height:28px;display:flex;align-items:center;justify-content:center;font-size:18px;cursor:pointer;transition:background .2s,border-color .2s}
.csv-modal__close:hover{background:#1f2937;border-color:#334155}
.csv-modal__body{padding:16px 20px;display:flex;flex-direction:column;gap:12px;overflow:auto}
.csv-modal__controls{display:flex;flex-direction:column;gap:10px}
.csv-modal__search{display:flex;flex-direction:column;gap:6px;font-size:12px;color:#94a3b8}
.csv-modal__search-input{padding:10px 12px;border-radius:10px;border:1px solid #1f2937;background:#0b101d;color:#e2e8f0;font-size:14px;outline:none;transition:border-color .2s,box-shadow .2s}
.csv-modal__search-input:focus{border-color:#3b82f6;box-shadow:0 0 0 2px rgba(59,130,246,.25)}
.examples-modal__body{gap:16px}
.examples-modal__intro{color:#94a3b8;font-size:13px;line-height:1.6;margin:0}
.examples-modal__actions{display:flex;flex-direction:column;gap:12px}
.examples-modal__button{display:flex;flex-direction:column;align-items:flex-start;gap:6px;padding:14px 16px;border-radius:12px;border:1px solid #243048;background:#121a2d;color:#e5e7eb;font-size:14px;font-weight:500;cursor:pointer;text-align:left;transition:background .2s,border-color .2s,transform .2s}
.examples-modal__button:hover,.examples-modal__button:focus{background:#182544;border-color:#3b82f6;transform:translateY(-1px);outline:none}
.examples-modal__button-label{font-size:15px;font-weight:600;color:#f8fafc}
.examples-modal__button-desc{font-size:13px;color:#94a3b8;line-height:1.5}
.csv-modal__clear-all{align-self:flex-start;padding:8px 14px;border-radius:999px;border:1px solid #273346;background:#111829;color:#e2e8f0;font-size:12px;font-weight:500;cursor:pointer;transition:background .2s,border-color .2s,color .2s,transform .2s}
.csv-modal__clear-all:disabled{opacity:.5;cursor:default;transform:none}
.csv-modal__clear-all:not(:disabled):hover{background:#1b2436;border-color:#3b82f6;color:#f8fafc}
.csv-modal__intro{color:#a5adc3;font-size:13px;line-height:1.6}
.csv-modal__intro--success{color:#34d399}
.csv-modal__list{display:flex;flex-direction:column;gap:10px}
.csv-modal__item{display:flex;flex-direction:column;align-items:flex-start;gap:4px;width:100%;border-radius:12px;border:1px solid #243048;background:#121a2d;color:#e5e7eb;padding:12px 14px;cursor:pointer;text-align:left;transition:background .2s,border-color .2s,transform .2s}
.csv-modal__item:hover{background:#182544;border-color:#3b82f6;transform:translateY(-1px)}
.csv-modal__item-title{font-size:15px;font-weight:600;color:#f1f5f9}
.csv-modal__item-meta{font-size:12px;color:#94a3b8}
.csv-modal__empty{padding:24px;border:1px dashed #334155;border-radius:14px;text-align:center;color:#cbd5f5;font-size:14px}
.import-modal__tabs{display:flex;gap:8px;flex-wrap:wrap}
.import-modal__tab{flex:1 1 auto;padding:8px 10px;border-radius:10px;border:1px solid #243048;background:#121a2d;color:#d1d8ed;font-size:13px;font-weight:600;cursor:pointer;transition:background .2s,border-color .2s,color .2s}
.import-modal__tab:hover{border-color:#3b82f6;color:#e0e7ff}
.import-modal__tab--active{background:#1e293b;border-color:#3b82f6;color:#f8fafc}
.import-modal__panels{display:flex;flex-direction:column;gap:12px}
.import-modal__panel{display:none;flex-direction:column;gap:10px}
.import-modal__panel--active{display:flex}
.import-modal__file-info{font-size:12px;color:#9aa6c2}
.import-modal__textarea{width:100%;min-height:140px;border-radius:12px;border:1px solid #1f2937;background:#0b101d;color:#e2e8f0;padding:12px;font-size:14px;resize:vertical}
.import-modal__textarea:focus{border-color:#3b82f6;box-shadow:0 0 0 2px rgba(59,130,246,.25)}
.import-modal__status{display:flex;flex-direction:column;gap:6px;font-size:12px}
.import-modal__error{display:none;color:#fca5a5;background:rgba(239,68,68,.12);border:1px solid rgba(239,68,68,.35);border-radius:10px;padding:8px 10px}
.import-modal__error.show{display:block}
.import-modal__info{color:#9aa6c2;font-size:12px}
.import-modal__preview{display:flex;flex-direction:column;gap:10px;max-height:220px;overflow:auto}
.import-preview-table{width:100%;border-collapse:collapse}
.import-preview-table th,.import-preview-table td{border:1px solid #1f2937;padding:8px;font-size:12px;text-align:left;vertical-align:top}
.import-preview-table thead th{background:#161f2f;color:#e2e8f0;position:sticky;top:0}
.import-preview-table tbody tr:nth-child(even){background:rgba(15,23,42,.45)}


/* ===== EZ Tracker Overrides & Shared Nav Integration ===== */

/* Make global nav fixed and prevent overlap */
.site-header{
  position: static;
  width: 100%;
  z-index: 1000;
}

/* Offset page content for fixed header height */
body, body.has-fixed-header{
  padding-top: 0;
}

/* Warning banner sits directly under header */
.banner{
  position: relative;
  z-index: 900;
  margin: 0; /* remove stray margins that can create gaps */
  padding: 10px 16px;
  background: rgba(234,179,8,.12);
  border-bottom: 1px solid rgba(234,179,8,.35);
  text-align: center;
  font-weight: 600;
  font-size: 13px;
}

/* App-specific sub-header (title bar) */
.sub-header{
  background: var(--panel, #121217);
  border-bottom: 1px solid var(--border, #1f2430);
  padding: 14px 0;
  text-align: center;
}
.sub-header h1{
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  color: var(--text, #e9ecf1);
}

/* Ensure main containers line up with shared nav width */
.wrap{
  max-width: 1100px;
  margin: 0 auto;
  padding-left: 20px;
  padding-right: 20px;
}

/* Avoid clipping of sticky/fixed elements inside containers */
.tablewrap, .toolbar{
  position: relative;
  z-index: 1;
  margin-top: 10px;
}

/* Overlay should appear above everything */
.overlay{
  z-index: 2000;
}

.link-button{
  background:transparent;
  border:0;
  color:#cbd5f5;
  font:inherit;
  cursor:pointer;
  text-decoration:underline;
  padding:0;
}

.link-button:hover{
  color:#f1f5f9;
}

.about-modal__body{
  gap:14px;
}

.about-modal__license{
  width:100%;
  background:#0b101d;
  border:1px solid #1f2937;
  border-radius:12px;
  color:#e2e8f0;
  padding:12px;
  font-family:monospace;
  font-size:13px;
  resize:vertical;
}

/* Improve focus visibility for keyboard users */
:focus-visible{
  outline: 2px solid #60a5fa;
  outline-offset: 2px;
}

/* Make small screens safer: prevent horizontal overflow */
html, body{ overflow-x: hidden; }
