:root{font-family:Tahoma,Arial,sans-serif;color:#172b3b;background:#f3f6f9;font-size:14px}*{box-sizing:border-box}body{margin:0}header{height:86px;padding:0 max(24px,calc((100vw - 1400px)/2));display:flex;align-items:center;justify-content:space-between;background:white;border-bottom:1px solid #dfe7ec}.brand{display:flex;gap:12px;align-items:center}.mark{display:grid;place-items:center;background:#ef7c32;color:white;width:44px;height:44px;border-radius:12px;font-size:18px;font-weight:bold}.brand small{display:block;color:#718394;margin-top:5px}main{max-width:1400px;margin:32px auto;padding:0 24px}.heading{display:flex;justify-content:space-between;align-items:center;gap:20px;margin-bottom:24px}h1{font-size:30px;line-height:1.65;margin:8px 0}h2{font-size:17px;margin:0 0 16px}.eyebrow{color:#b95a1b;font-size:12px;font-weight:bold}.muted,.hint{color:#647889;line-height:1.9}.hint{font-size:12px;margin:10px 0}.card{background:white;border:1px solid #e1e8ee;border-radius:14px;padding:24px;margin-bottom:20px}.stats{display:grid;grid-template-columns:repeat(4,1fr);gap:16px}.stats .card{padding:20px 24px}.stats span{display:block;color:#647889}.stats strong{display:block;font-size:32px;margin-top:14px;color:#173d4e}.layout{display:grid;grid-template-columns:330px 1fr;gap:24px;align-items:start}label{display:block;font-size:13px;margin-bottom:16px}input,select{display:block;width:100%;padding:12px;border:1px solid #d4dfe6;border-radius:8px;margin-top:8px;background:white;color:#183346;font:inherit}input:focus,select:focus{outline:2px solid #e2a476;outline-offset:1px}button{background:#173f50;color:white;border:0;border-radius:8px;padding:13px 18px;cursor:pointer;font:inherit;line-height:1.4}button:hover{background:#22586d}button:disabled{opacity:.45;cursor:wait}.quiet{background:#edf2f6;color:#29485a}.quiet:hover{background:#dce7ee}form>button{width:100%}.table-wrap{overflow-x:auto}table{width:100%;border-collapse:collapse;text-align:right;white-space:nowrap;margin-top:18px}th{font-size:12px;color:#708190;font-weight:normal;padding:12px 10px;background:#f5f8fa}td{padding:15px 10px;border-bottom:1px solid #edf1f4}td:first-child{font-family:monospace;font-size:14px;direction:ltr;text-align:right}td button{padding:8px 13px;color:#aa4a0c;background:#fff1e7}td button:hover{background:#ffe0ca}.empty{padding:50px 20px;text-align:center;color:#738593;line-height:1.8}.section-head{display:flex;align-items:center;justify-content:space-between;gap:16px}.section-head h2{margin-bottom:4px}.account{padding:14px 0;border-bottom:1px solid #edf1f4;overflow-wrap:anywhere}.account strong{display:block;margin-bottom:5px}.account button{font-size:11px;padding:5px 10px;margin-top:8px}.account .error{color:#b5372c}.account small{display:block;line-height:1.8;color:#748391}.job{border-bottom:1px solid #edf1f4;padding:14px 0;line-height:1.8}.job time{display:block;font-size:11px;color:#8495a1}.badge{font-size:11px;display:inline-block;background:#edf4f3;color:#176654;padding:2px 8px;border-radius:5px;margin-left:8px}.job.running .badge{background:#fff0dd;color:#9d6016}.job.failed .badge,.job.interrupted .badge{background:#fff0ed;color:#ad3628}#notice{background:#fff3e7;border:1px solid #e9c398;padding:15px 20px;border-radius:10px;line-height:1.8;margin-bottom:20px}dialog{width:min(650px,95vw);border:0;border-radius:16px;padding:26px;color:#173346;box-shadow:0 20px 90px #162c3d55}dialog::backdrop{background:#152e3d88}dialog details{margin:20px 0}.host-list{max-height:240px;overflow:auto;font-family:monospace;line-height:1.9;margin-top:12px;overflow-wrap:anywhere}.host-row{border-bottom:1px solid #e8eff3;padding:7px 0}summary{cursor:pointer;line-height:1.8}details form{margin-top:20px}.login{max-width:470px;margin:60px auto;padding:40px}.login form{margin-top:30px}.login button{background:#d86a24}.login h1{font-size:34px}footer{text-align:center;padding:30px;color:#8a9aa6;font-size:12px}#search{margin-bottom:6px}[hidden]{display:none!important}@media(max-width:1000px){.layout{grid-template-columns:280px 1fr}.card{padding:18px}}@media(max-width:760px){header{height:72px;padding:0 18px}main{padding:0 14px;margin-top:24px}.heading{display:block}.heading button{width:100%;margin:12px 0}.layout{grid-template-columns:1fr}.stats{grid-template-columns:repeat(2,1fr);gap:10px}.stats .card{margin-bottom:0;padding:16px}.stats{margin-bottom:20px}h1{font-size:25px}.login{margin:25px auto;padding:25px}.login h1{font-size:29px}.section-head{align-items:start}td,th{padding:12px 8px}}

/* Responsive layouts: flexible desktop grid, tablet panels, mobile IP cards. */
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 20px; }
body { min-width: 280px; }
.layout { grid-template-columns: 320px minmax(0, 1fr); }
.layout > *, .section-head > *, .heading > *, .brand > * { min-width: 0; }
.card, .job, #notice { overflow-wrap: anywhere; }
.account-panel > summary { font-weight: bold; font-size: 16px; }
.account-panel[open] > summary { margin-bottom: 18px; }
.account-panel > summary::marker { color: #be5d20; }
.account-panel form { margin-top: 0; }
input, select { min-width: 0; font-size: 16px; }
button, summary { touch-action: manipulation; }
button { min-height: 44px; }
button:focus-visible, summary:focus-visible { outline: 3px solid #c57b40; outline-offset: 3px; }
.brand .mark, #logout, #refresh, #close-dialog { flex-shrink: 0; }
.account button { min-height: 44px; font-size: 13px; }
summary { min-height: 44px; align-content: center; }
#old-ip { display: inline-block; max-width: 100%; overflow-wrap: anywhere; vertical-align: middle; }
dialog { max-width: calc(100vw - 24px); max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); overflow-y: auto; overscroll-behavior: contain; }
dialog .section-head { align-items: flex-start; }
dialog .host-list { max-height: min(240px, 35dvh); }
footer { padding-bottom: max(24px, env(safe-area-inset-bottom)); }
@media (min-width: 1100px) {
  main { max-width: 1480px; }
}
@media (max-width: 1099px) {
  .layout { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .account-sidebar { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
  .heading h1 { font-size: clamp(24px, 3.7vw, 30px); }
  .heading button { white-space: normal; }
}
@media (max-width: 640px) {
  header { min-height: 72px; height: auto; padding: 12px 14px; gap: 10px; }
  .brand { gap: 8px; }
  .brand strong { font-size: 13px; }
  .brand small { font-size: 10px; }
  .brand .mark { width: 36px; height: 36px; border-radius: 10px; font-size: 15px; }
  #logout { padding: 10px; font-size: 12px; }
  main { margin-top: 20px; padding-inline: max(12px, env(safe-area-inset-left)); }
  .heading { margin-bottom: 16px; }
  h1 { line-height: 1.55; }
  .heading p { font-size: 13px; margin-bottom: 10px; }
  .card { padding: 16px; border-radius: 12px; }
  .stats { gap: 8px; }
  .stats .card { padding: 14px; }
  .stats span { font-size: 12px; }
  .stats strong { font-size: 28px; margin-top: 8px; }
  .account-sidebar { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .account-panel { padding: 10px 16px; margin-bottom: 10px; }
  .account-sidebar { margin-bottom: 10px; }
  .account-panel > summary { font-size: 14px; }
  .table-wrap { overflow: visible; }
  table { display: block; margin-top: 16px; white-space: normal; }
  table thead { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  #groups { display: grid; gap: 12px; }
  #groups tr { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid #dde7ed; border-radius: 12px; padding: 14px; background: #fcfdfe; gap: 12px 6px; }
  #groups td { display: block; border: 0; padding: 0; text-align: center; font-weight: bold; min-width: 0; }
  #groups td[data-label]::before { content: attr(data-label); display: block; font: normal 11px Tahoma, Arial, sans-serif; color: #647889; margin-bottom: 6px; direction: rtl; }
  #groups td:first-child { grid-column: 1 / -1; text-align: right; overflow-wrap: anywhere; font-size: 16px; border-bottom: 1px solid #e7edf1; padding-bottom: 12px; }
  #groups td:last-child { grid-column: 1 / -1; }
  #groups button { width: 100%; min-height: 46px; font-size: 14px; }
  dialog { width: calc(100vw - 20px); max-width: calc(100vw - 20px); padding: 18px; border-radius: 14px; max-height: calc(100dvh - 20px); }
  dialog h2 { font-size: 16px; line-height: 1.7; }
  dialog .section-head { gap: 12px; }
  dialog .hint { font-size: 12px; }
  dialog #replace-button { min-height: 48px; }
  .login { padding: 24px 20px; margin: 24px auto; }
  .login h1 { font-size: clamp(26px, 8vw, 34px); }
  footer { padding-inline: 16px; line-height: 1.8; }
}
@media (max-height: 540px) and (orientation: landscape) {
  dialog { max-height: calc(100dvh - 16px); margin-block: 8px; }
  .login { margin-block: 12px; }
}

/* Cloudflare proxy controls and independent record details. */
.cloud-on { color: #b9550a; }
.cloud-off { color: #647889; }
.cloud-button, td button.cloud-button { background: #fff0df; color: #a34b08; border: 1px solid #edc49d; }
.cloud-button:hover, td button.cloud-button:hover { background: #ffe0bd; }
.ip-cloud-status { display: block; font: normal 11px Tahoma,Arial,sans-serif; direction: rtl; color: #647889; margin-top: 8px; line-height: 1.8; white-space: normal; }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-start; }
.row-actions button { padding: 9px 10px; font-size: 12px; }
.row-actions .quiet { background: #edf2f6; color: #29485a; }
#bulk-cloud { max-width: 245px; font-size: 13px; }
.cloud-options { display: flex; flex-wrap: wrap; gap: 8px; border: 1px solid #dfe7ed; border-radius: 10px; margin: 18px 0; padding: 12px; min-width: 0; }
.cloud-options legend { font-size: 13px; padding: 0 6px; }
.cloud-options label { display: flex; flex: 1 1 90px; align-items: center; justify-content: center; gap: 6px; border: 1px solid #d9e1e7; border-radius: 8px; padding: 10px 8px; min-height: 48px; margin: 0; cursor: pointer; }
.cloud-options input { width: 17px; height: 17px; flex: 0 0 17px; margin: 0; accent-color: #d76616; }
.cloud-options label:has(input:checked) { border-color: #366c81; background: #edf5f8; }
.cloud-options .cloud-choice-on:has(input:checked) { border-color: #df8f4e; background: #fff0df; color: #a34b08; }
#details-dialog { width: min(800px, 95vw); }
#detail-ip { overflow-wrap: anywhere; }
.detail-records { margin-top: 16px; overflow-wrap: anywhere; font-size: 13px; }
.detail-records .host-row { padding: 12px 0; line-height: 1.9; }
.domain-names { font-size: 13px; line-height: 2; overflow-wrap: anywhere; }
#detail-more { width: 100%; margin-top: 16px; }
#proxy-impact { background: #f4f7fa; border-radius: 8px; padding: 12px; }
@media (min-width: 641px) { .row-actions { max-width: 230px; min-width: 125px; } }
@media (max-width: 640px) {
 .workspace > .card > .section-head { flex-wrap: wrap; }
 #bulk-cloud { width: 100%; max-width: none; }
 #groups .row-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; }
 #groups .row-actions button { font-size: 12px; padding: 8px 4px; }
 #details-dialog { width: calc(100vw - 20px); }
 .cloud-options { padding: 10px; }
}
