:root {
  font-family: "Aptos", "Segoe UI", ui-sans-serif, system-ui, sans-serif;
  color: #172438;
  background: #f7f7f5;
  font-synthesis: none;
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; }
[hidden] { display: none !important; }
header {
  min-height: 72px; padding: 14px max(24px, calc((100vw - 1240px)/2));
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  color: white; background: linear-gradient(110deg, #101b2d 0%, #172a42 70%, #233a56 100%);
  box-shadow: 0 4px 18px #172b5320;
}
header strong { display: block; font-size: 21px; letter-spacing: -.035em; }
header small { display: block; color: #b8c8e9; font-size: 12px; margin-top: 2px; }
#identity { font-size: 14px; color: #d7e4ff; overflow-wrap: anywhere; }
main { max-width: 1240px; margin: 34px auto 80px; padding: 0 20px; }
#workspace:has(.adminNav:not([hidden])) { display: grid; grid-template-columns: 220px minmax(0,1fr); gap: 28px; }
main:has(.adminNav:not([hidden])) { max-width: 1600px; }
.workspaceContent { min-width: 0; }
.adminNav { align-self: start; position: sticky; top: 18px; min-height: 70vh; background: #111a2b; color: #d9e6ff;
  border-radius: 14px; padding: 20px 10px; box-shadow: 0 12px 30px #10233e20; }
.adminNav .navBrand { display: block; padding: 7px 13px 22px; margin-bottom: 10px; border-bottom: 1px solid #ffffff18; }
.adminNav .navBrand strong { display: block; color: #fff; font-size: 17px; }
.adminNav .navBrand small { display: block; color: #a4b5d0; margin-top: 3px; }
.adminNav button { display: block; width: 100%; text-align: left; padding: 12px 14px; margin: 4px 0;
  background: transparent; color: #c7d5ee; }
.adminNav button:hover,.adminNav button.navActive { background: #284a70; color: white; box-shadow: none; }
.adminNav button.navActive { border-left: 3px solid #d8b36c; }
h1,h2,h3,p { margin-top: 0; }
h1,h2,h3 { font-family: Georgia, "Times New Roman", serif; font-weight: 700; }
h1 { font-size: clamp(25px,3vw,32px); letter-spacing: -.045em; margin-bottom: 7px; }
h2 { font-size: 19px; letter-spacing: -.025em; margin-bottom: 14px; }
h3 { font-size: 16px; }
.card {
  background: #fff; border: 1px solid #e3e7eb; border-radius: 16px;
  box-shadow: 0 14px 34px #14243b09; padding: 24px; margin: 20px 0;
}
.card > p,.topline p,#detailMeta,#webPublish > p { color: #667692; line-height: 1.5; }
.login { max-width: 430px; margin: 76px auto; padding: 32px; }
.topline,.row,.actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.topline,.between { justify-content: space-between; }
.topline { margin-bottom: 24px; }
.topline p { margin-bottom: 0; }
label { display: block; font-size: 13px; font-weight: 650; color: #3d4b65; margin: 13px 0; }
input,textarea,select {
  display: block; width: 100%; margin-top: 7px; padding: 11px 13px;
  border: 1px solid #cbd6e7; border-radius: 9px; background: #fff;
  color: #17233b; font: inherit; font-size: 14px; outline: none;
  transition: border-color .16s ease, box-shadow .16s ease;
}
input:focus,textarea:focus,select:focus { border-color: #3266df; box-shadow: 0 0 0 3px #3266df1c; }
input::placeholder,textarea::placeholder { color: #92a0b4; }
textarea { resize: vertical; line-height: 1.55; }
button,.upload {
  display: inline-flex; justify-content: center; align-items: center; gap: 7px;
  border: 1px solid transparent; border-radius: 9px; background: #183c66; color: #fff;
  padding: 10px 15px; font: 650 14px/1.3 inherit; cursor: pointer;
  transition: background .15s ease, box-shadow .15s ease, transform .15s ease;
  white-space: nowrap;
}
button:hover,.upload:hover { background: #235481; box-shadow: 0 4px 12px #173e642b; transform: translateY(-1px); }
button:active { transform: translateY(0); }
button:focus-visible,.upload:focus-visible { outline: 3px solid #93b4ff; outline-offset: 2px; }
button:disabled { opacity: .46; cursor: not-allowed; transform: none; box-shadow: none; }
.secondary { background: #f4f6f7; color: #27445e; border-color: #e1e6eb; }
.secondary:hover { background: #e8edf1; box-shadow: none; }
.danger { background: #c33e4b; }
.danger:hover { background: #a72836; }
.upload { margin: 0; }
.row input:not([type=checkbox]) { width: auto; flex: 1; min-width: 160px; margin: 0; }
.row select { width: auto; margin: 0; }
.filters { margin: 18px 0 14px; }
.filters input { flex: 2 !important; min-width: 230px !important; }
.filters select { min-width: 145px; }
.tabs { gap: 7px; margin: 8px 0 16px; padding: 5px; width: fit-content; background: #eef3fb; border-radius: 11px; }
.tabs button { border-radius: 8px; padding: 9px 14px; }
.tabActive { background: white; color: #183c66; box-shadow: 0 2px 8px #152d5d15; }
.tabActive:hover { background: white; box-shadow: 0 2px 8px #152d5d15; }
.tableWrap { overflow: auto; border: 1px solid #e5ebf4; border-radius: 11px; }
table { width: 100%; min-width: 840px; border-collapse: collapse; }
th,td { text-align: left; padding: 14px 13px; border-bottom: 1px solid #ebeff5; vertical-align: middle; }
th { color: #64738d; font-size: 11px; letter-spacing: .05em; text-transform: uppercase; background: #f8faff; }
td { font-size: 13px; color: #42516b; }
td strong { color: #203b75; font-size: 14px; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #f8fbff; }
td button { padding: 7px 11px; }
.status { display: inline-block; border-radius: 20px; background: #edf3fb; color: #45628c; padding: 5px 10px; font-size: 12px; font-weight: 650; }
.status.done,.status.published { background: #e0f6e9; color: #137344; }
.status.failed,.status.needs_attention { background: #fff0e6; color: #a44b21; }
.status.running { background: #e7efff; color: #2657c7; }
.pagination { margin-top: 15px; color: #63728b; font-size: 13px; }
.result { border: 1px solid #e2e9f4; border-radius: 12px; margin: 16px 0; padding: 18px; background: #fbfcff; }
.result .row { justify-content: space-between; }
.result h3 { font-size: 15px; margin: 0; }
.result pre,#raw { white-space: pre-wrap; overflow-wrap: anywhere; max-height: 540px; overflow: auto; font: 14px/1.65 Georgia,serif; }
.result pre { margin-bottom: 0; }
.actions { margin: 18px 0; }
#webPublish .row { justify-content: flex-start; }
#webPublish input[type=search] { width: 220px; flex: 0; }
#publishSite { min-width: 220px; max-width: 400px; }
#webPublications p { overflow-wrap: anywhere; margin: 13px 0 0; }
.link,a { color: #215c8c; overflow-wrap: anywhere; }
a:hover { color: #123ba4; }
.siteGrid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 0 16px; }
fieldset { border: 1px solid #dbe4f1; border-radius: 10px; padding: 12px 16px; margin: 15px 0; }
legend { color: #344767; font-size: 13px; font-weight: 700; }
.checkGrid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 2px 16px; max-height: 210px; overflow: auto; margin-top: 8px; }
.checkGrid label { font-weight: 450; margin: 4px 0; }
.checkGrid input { width: auto; display: inline-block; margin: 0 5px 0 0; accent-color: #245ad9; }
#siteAdminSearch { margin: 20px 0 8px; max-width: 420px; }
.siteRow { display: flex; justify-content: space-between; align-items: center; gap: 15px; padding: 14px 3px; border-bottom: 1px solid #edf0f5; }
.siteRow:last-child { border-bottom: 0; }
.siteRow strong { color: #203b75; }
.siteThumbMini { width: 42px; height: 42px; object-fit: cover; border-radius: 8px; vertical-align: middle; margin-right: 10px; }
.siteThumbBox { display: flex; align-items: center; gap: 12px; padding: 10px 0; }
.siteThumbBox img { width: 90px; height: 66px; object-fit: cover; border: 1px solid #dbe4f1; border-radius: 8px; }
.detailOverlay { position: fixed; inset: 0; z-index: 50; padding: min(4vh,36px) 16px;
  background: #0d1c32ad; display: flex; align-items: center; justify-content: center; backdrop-filter: blur(5px); }
.detailDialog { width: min(1120px,100%); max-height: 92vh; overflow: auto; background: #f7f7f5;
  border: 1px solid #f0efe9; border-radius: 18px; box-shadow: 0 24px 75px #09182c5c; padding: 0 24px 24px; }
.detailDialog #detail { margin: 0; border: 0; background: transparent; box-shadow: none; padding: 26px 0 0; }
.detailDialog #editor { margin: 18px 0; }
#detail .row:first-child { border-bottom: 1px solid #e4e8e8; padding-bottom: 15px; }
#detailTitle { max-width: 85%; line-height: 1.35; }
#detail .actions { border-top: 1px solid #e4e8e8; border-bottom: 1px solid #e4e8e8; padding: 16px 0; }
thead th { background: #f7f8f8; color: #54647a; }
td strong { color: #172e49; line-height: 1.35; }
tbody tr:hover { background: #f8faf9; }
.siteRow span { color: #6b7a93; font-size: 13px; }
#notice { position: fixed; right: 22px; bottom: 18px; z-index: 70; display: none; max-width: 420px; padding: 13px 18px; border-radius: 10px; background: #182c52; box-shadow: 0 10px 25px #09152e3b; color: white; font-size: 14px; }
#notice.show { display: block; animation: slideIn .2s ease-out; }
@keyframes slideIn { from { opacity: 0; transform: translateY(9px); } to { opacity: 1; transform: translateY(0); } }
details { margin-top: 25px; color: #667692; }
@media(max-width:720px) {
  #workspace:has(.adminNav:not([hidden])) { display: block; }
  .adminNav { position: static; display: flex; min-height: 0; overflow-x: auto; align-items: center; gap: 6px; margin-bottom: 18px; padding: 10px; }
  .adminNav .navBrand { display: none; }
  .adminNav button { width: auto; flex: 0 0 auto; margin: 0; }
  .detailOverlay { padding: 0; }
  .detailDialog { max-height: 100vh; min-height: 100vh; border-radius: 0; padding: 0 16px 22px; }
  header { padding: 14px 18px; } main { margin: 20px auto 60px; padding: 0 12px; }
  .card { padding: 18px; margin: 14px 0; } .siteGrid,.checkGrid { grid-template-columns: 1fr; }
  .siteRow { align-items: flex-start; flex-direction: column; }
  .filters input,.filters select,.filters button,#webPublish input[type=search],#publishSite { width: 100%; max-width: none; }
  .tabs { width: 100%; } .tabs button { flex: 1; }
  .topline { align-items: flex-start; } #identity { max-width: 45%; text-align: right; }
}
.modalOverlay { position: fixed; inset: 0; z-index: 30; background: #10213d9c; display: flex; align-items: center; justify-content: center; padding: 18px; backdrop-filter: blur(3px); }
.modalPanel { width: min(100%, 720px); max-height: min(92vh, 940px); overflow: auto; padding: 26px; background: white; border-radius: 16px; box-shadow: 0 24px 70px #0c1d3a50; }
.modalPanel h2 { margin-bottom: 18px; }
.modalPanel small { display: block; color: #8290a6; font-weight: 400; margin-top: 5px; }
@media(max-width:720px) { .modalPanel { padding: 18px; } }
.bulkBar { margin: 15px 0; padding: 12px 14px; border: 1px solid #dce6f7; border-radius: 11px; background: #f6f9ff; }
.bulkBar strong { margin-right: 8px; min-width: 90px; color: #284473; font-size: 13px; }
.bulkBar input[type=search] { width: 180px; flex: 0; }
.bulkBar select { min-width: 220px; }
th input[type=checkbox],td input[type=checkbox] { width: 17px; height: 17px; margin: 0; accent-color: #245ad9; cursor: pointer; }
th:first-child,td:first-child { width: 42px; text-align: center; }
@media(max-width:720px) { .bulkBar input[type=search],.bulkBar select,.bulkBar button { width: 100%; } }
#newJob > .row { align-items: center; }
#newJob > .row h2 { margin-bottom: 0; }
#batchForm > p { color: #667692; line-height: 1.55; }
#batchForm code { border-radius: 5px; background: #eef3fc; color: #204a9b; padding: 2px 5px; }
#batchText { font: 13px/1.5 ui-monospace, SFMono-Regular, Consolas, monospace; }
#batchCount { color: #5e718e; font-size: 13px; font-weight: 600; }
