.btn--auto { width: auto; }

.dash {
  position: relative;
  z-index: 1;
  max-width: 860px;
  margin: 0 auto;
  padding: 24px 16px 48px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.dash__bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.dash__baractions { display: flex; gap: 8px; }

.tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--card-border);
  border-radius: 12px;
}
.tab {
  flex: 1;
  padding: 9px 12px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
  border-radius: 9px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.tab.is-active { background: var(--accent-grad); color: #fff; }

.panel {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(24px) saturate(140%);
  -webkit-backdrop-filter: blur(24px) saturate(140%);
  padding: 20px;
}
.panel__head { margin-bottom: 14px; }
.panel__head h2 { margin: 0 0 3px; font-size: 1rem; font-weight: 600; }
.panel__head p { margin: 0; }

.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.toolbar__right { display: flex; gap: 14px; white-space: nowrap; }
.filters { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.fchip {
  padding: 7px 13px;
  border-radius: 999px;
  border: 1px solid var(--field-border);
  background: rgba(255,255,255,0.03);
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.fchip:hover { color: var(--text); }
.fchip.is-active { background: rgba(59,130,246,0.16); border-color: var(--accent); color: var(--text); }

.filters select, .filters input[type="text"] {
  padding: 8px 11px;
  border-radius: 9px;
  border: 1px solid var(--field-border);
  background: var(--field-bg);
  color: var(--text);
  font-size: 0.8rem;
}
.filters input[type="text"] { min-width: 180px; }
.chk { display: flex; align-items: center; gap: 6px; font-size: 0.78rem; color: var(--muted); cursor: pointer; }

.count {
  display: inline-block; min-width: 20px; padding: 1px 8px; margin-left: 4px;
  border-radius: 999px; background: rgba(255,255,255,0.08);
  font-size: 0.72rem; color: var(--muted); vertical-align: middle;
}

.records { display: flex; flex-direction: column; gap: 10px; }
.rec {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px;
  border-radius: 13px;
  border: 1px solid var(--field-border);
  background: var(--field-bg);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, transform 0.1s;
}
.rec:hover { border-color: var(--accent); background: rgba(255,255,255,0.05); }
.rec:active { transform: translateY(1px); }

.iconbadge {
  display: grid; place-items: center;
  width: 40px; height: 40px; border-radius: 11px;
  background: rgba(255,255,255,0.06);
  flex-shrink: 0;
}
.iconbadge svg { width: 22px; height: 22px; }
.iconpair { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.iconmini { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 7px; background: rgba(255,255,255,0.05); }
.iconmini svg { width: 16px; height: 16px; }

.rec__body { flex: 1; min-width: 0; }
.rec__title { display: flex; align-items: center; gap: 9px; }
.rec__user { font-weight: 600; font-size: 0.9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rec__meta { font-size: 0.74rem; color: var(--muted); margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rec__chev { color: var(--faint); flex-shrink: 0; }

.badge {
  font-size: 0.66rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
  padding: 3px 8px; border-radius: 999px; white-space: nowrap;
}
.badge--success { background: rgba(52,211,153,0.16); color: var(--success); }
.badge--failed  { background: rgba(248,113,113,0.16); color: var(--danger); }
.badge--in_progress { background: rgba(251,191,36,0.16); color: #fbbf24; }

.link-btn.danger { color: var(--danger); opacity: 0.85; }
.link-btn.danger:hover { opacity: 1; }
.empty { color: var(--muted); text-align: center; padding: 28px; }

.redirect { display: flex; gap: 10px; }
.redirect input {
  flex: 1; padding: 12px 14px; border-radius: 12px;
  border: 1px solid var(--field-border); background: var(--field-bg); color: var(--text); font-size: 0.9rem;
}
.redirect input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(59,130,246,0.18); }
.hint { font-size: 0.78rem; color: var(--success); margin: 10px 0 0; }
.hint.danger { color: var(--danger); }

.logtable { display: flex; flex-direction: column; gap: 2px; font-family: ui-monospace, "Cascadia Code", Menlo, monospace; }
.logrow {
  display: grid;
  grid-template-columns: 74px 58px 1fr 62px 150px;
  gap: 10px; align-items: center;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 0.75rem;
}
.logrow:hover { background: rgba(255,255,255,0.04); }
.logrow--head { color: var(--faint); font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.05em; position: sticky; top: 0; }
.logrow__time { color: var(--muted); }
.meth { font-weight: 700; padding: 2px 6px; border-radius: 5px; text-align: center; font-size: 0.68rem; }
.meth--GET { background: rgba(59,130,246,0.16); color: #7fb0ff; }
.meth--POST { background: rgba(52,211,153,0.16); color: var(--success); }
.meth--PUT { background: rgba(251,191,36,0.16); color: #fbbf24; }
.meth--DELETE { background: rgba(248,113,113,0.16); color: var(--danger); }
.meth--HEAD, .meth--OPTIONS { background: rgba(255,255,255,0.08); color: var(--muted); }
.logrow__path { color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dirtag { font-size: 0.6rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; padding: 1px 6px; border-radius: 5px; margin-right: 4px; }
.dirtag.in { background: rgba(255,255,255,0.08); color: var(--muted); }
.dirtag.out { background: rgba(99,102,241,0.18); color: #a5b4fc; }
.st { font-weight: 700; }
.st--2 { color: var(--success); }
.st--3 { color: #7fb0ff; }
.st--4 { color: #fbbf24; }
.st--5 { color: var(--danger); }
.logrow__dev { display: flex; align-items: center; gap: 6px; color: var(--muted); }
.logrow__dev svg { width: 14px; height: 14px; }

.detail { display: flex; flex-direction: column; gap: 16px; }
#detailBody, #projectBody { display: flex; flex-direction: column; gap: 16px; }
.detail__hero {
  display: flex; align-items: center; gap: 16px;
  background: var(--card); border: 1px solid var(--card-border);
  border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow);
}
.detail__hero .iconbadge { width: 52px; height: 52px; border-radius: 14px; }
.detail__hero .iconbadge svg { width: 28px; height: 28px; }
.detail__heroinfo { flex: 1; min-width: 0; }
.detail__heroinfo h2 { margin: 0 0 4px; font-size: 1.05rem; word-break: break-all; }
.detail__heroinfo .sub { color: var(--muted); font-size: 0.8rem; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.cell { background: var(--card); border: 1px solid var(--card-border); border-radius: 12px; padding: 13px 15px; box-shadow: var(--shadow); }
.cell__k { font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--faint); margin-bottom: 4px; }
.cell__v { font-size: 0.85rem; word-break: break-word; }
.cell__v.mono { font-family: ui-monospace, Menlo, monospace; font-size: 0.76rem; }
.cell__v .reveal { margin-left: 8px; }
.projlink { color: var(--accent); cursor: pointer; font-weight: 600; }
.projlink:hover { text-decoration: underline; }
.clickable { cursor: pointer; transition: background 0.12s; }
.clickable:hover { background: rgba(255,255,255,0.04); border-radius: 8px; }
.tl.clickable:hover, .logrow.clickable:hover { background: rgba(255,255,255,0.05); }

.section { background: var(--card); border: 1px solid var(--card-border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.section > h3 { margin: 0 0 14px; font-size: 0.92rem; font-weight: 600; }

.timeline { display: flex; flex-direction: column; }
.tl {
  display: grid; grid-template-columns: 84px 22px 1fr; gap: 10px; align-items: start;
  padding-bottom: 14px;
}
.tl__time { font-size: 0.7rem; color: var(--faint); font-family: ui-monospace, Menlo, monospace; padding-top: 1px; text-align: right; }
.tl__rail { position: relative; display: flex; justify-content: center; }
.tl__dot { width: 11px; height: 11px; border-radius: 50%; background: var(--accent); margin-top: 3px; z-index: 1; box-shadow: 0 0 0 3px rgba(59,130,246,0.15); }
.tl__dot--ok { background: var(--success); box-shadow: 0 0 0 3px rgba(52,211,153,0.15); }
.tl__dot--bad { background: var(--danger); box-shadow: 0 0 0 3px rgba(248,113,113,0.15); }
.tl__dot--apple { background: var(--muted); box-shadow: 0 0 0 3px rgba(255,255,255,0.06); }
.tl__line { position: absolute; top: 3px; bottom: -14px; width: 2px; background: var(--card-border); }
.tl:last-child .tl__line { display: none; }
.tl__label { font-size: 0.82rem; }
.tl__detail { font-size: 0.72rem; color: var(--muted); margin-top: 2px; word-break: break-word; }
.tl__tag { font-size: 0.62rem; font-family: ui-monospace, Menlo, monospace; color: var(--faint); background: rgba(255,255,255,0.05); padding: 1px 6px; border-radius: 5px; margin-left: 6px; }

.reqlist { display: flex; flex-direction: column; gap: 2px; font-family: ui-monospace, Menlo, monospace; font-size: 0.74rem; max-height: 320px; overflow: auto; }

.seg { display: flex; padding: 4px; gap: 4px; background: rgba(255,255,255,0.04); border: 1px solid var(--field-border); border-radius: 12px; margin-bottom: 12px; }
.seg__btn { flex: 1; padding: 8px 10px; border: none; background: transparent; color: var(--muted); font-size: 0.78rem; font-weight: 600; border-radius: 9px; cursor: pointer; }
.seg__btn.is-active { background: var(--accent-grad); color: #fff; }
.section .actions { display: flex; gap: 10px; margin-top: 12px; }
.section .actions .btn { width: auto; flex: 1; }

.tl__dot--ip { background: var(--accent-2); box-shadow: 0 0 0 3px rgba(99,102,241,0.18); }

.ipwrap { display: grid; grid-template-columns: 1fr 1.1fr; gap: 16px; align-items: start; }
.ipleft { display: flex; flex-direction: column; }
.ipleft h3 { margin: 0 0 12px; font-size: 0.92rem; font-weight: 600; }
.ipchips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.ipchip {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 11px; border-radius: 10px;
  border: 1px solid var(--field-border); background: var(--field-bg);
  font-family: ui-monospace, Menlo, monospace; font-size: 0.76rem;
  color: var(--text); cursor: pointer; transition: all 0.15s;
}
.ipchip:hover { border-color: var(--accent); }
.ipchip.is-active { background: rgba(59,130,246,0.16); border-color: var(--accent); }
.ipchip .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--success); }
.ipchip .dot--private { background: var(--faint); }
.ipchip .n { color: var(--faint); font-size: 0.68rem; }

.ipinfo { display: flex; flex-direction: column; gap: 9px; }
.ipinfo__row { display: flex; justify-content: space-between; gap: 12px; font-size: 0.8rem; }
.ipinfo__k { color: var(--faint); }
.ipinfo__v { color: var(--text); text-align: right; word-break: break-word; }
.ipinfo__place { font-size: 0.95rem; font-weight: 600; margin-bottom: 2px; }
.ipinfo__muted { color: var(--muted); font-size: 0.8rem; }

.ipmap {
  height: 300px; min-height: 300px;
  border-radius: 14px; overflow: hidden;
  border: 1px solid var(--card-border);
  background: #0d1117;
}
.leaflet-container { background: #0d1117; font-family: inherit; height: 100%; }

.ipmap .leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) brightness(0.92) contrast(0.9) saturate(0.75); }
.leaflet-control-zoom a { background: rgba(20,22,30,0.92) !important; color: #fff !important; border-color: var(--card-border) !important; }
.leaflet-control-attribution { background: rgba(10,12,18,0.6) !important; color: var(--faint) !important; font-size: 0.62rem; }
.leaflet-control-attribution a { color: var(--muted) !important; }

.modal { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; background: rgba(4,6,12,0.62); backdrop-filter: blur(4px); padding: 16px; }
.modal[hidden] { display: none; }
.modal__box {
  width: 100%; max-width: 560px; max-height: 82vh; overflow: auto;
  background: var(--card); border: 1px solid var(--card-border);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px;
  animation: rise 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}
.modal__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.modal__head h3 { margin: 0; font-size: 1rem; font-weight: 600; word-break: break-all; }
.icon-btn { background: none; border: none; color: var(--muted); font-size: 1rem; cursor: pointer; padding: 4px 8px; border-radius: 8px; }
.icon-btn:hover { color: var(--text); background: rgba(255,255,255,0.06); }
.kv { display: grid; grid-template-columns: 130px 1fr; gap: 8px 12px; font-size: 0.82rem; }
.kv dt { color: var(--faint); }
.kv dd { margin: 0; word-break: break-word; }
.kv dd.mono { font-family: ui-monospace, Menlo, monospace; font-size: 0.76rem; }

.rec__tags { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-top: 4px; }
.ptag { font-size: 0.62rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em;
  padding: 2px 7px; border-radius: 5px; background: rgba(99,102,241,0.16); color: #a5b4fc; }
.proj__meta { font-size: 0.74rem; color: var(--muted); margin-top: 3px; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; }
.stat { background: var(--card); border: 1px solid var(--card-border); border-radius: 12px; padding: 14px 16px; }
.stat__v { font-size: 1.4rem; font-weight: 700; }
.stat__k { font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--faint); margin-top: 2px; }
.stat__v.ok { color: var(--success); } .stat__v.bad { color: var(--danger); } .stat__v.wait { color: #fbbf24; }

.checkrow { display: flex; gap: 8px; flex-wrap: wrap; }
.checkpill { display: flex; align-items: center; gap: 6px; font-size: 0.74rem; padding: 6px 10px;
  border-radius: 8px; border: 1px solid var(--field-border); background: var(--field-bg); }
.checkpill .d { width: 7px; height: 7px; border-radius: 50%; }
.checkpill .d.ok { background: var(--success); } .checkpill .d.warn { background: #fbbf24; }

.stepeditor { display: flex; flex-direction: column; gap: 12px; }
.filetabs { display: flex; gap: 4px; padding: 4px; background: rgba(255,255,255,0.04);
  border: 1px solid var(--field-border); border-radius: 10px; }
.filetab { flex: 1; padding: 7px; border: none; background: transparent; color: var(--muted);
  font-size: 0.74rem; font-weight: 600; border-radius: 7px; cursor: pointer; font-family: ui-monospace, Menlo, monospace; }
.filetab.is-active { background: var(--accent-grad); color: #fff; }
.codearea {
  width: 100%; min-height: 300px; resize: vertical;
  padding: 14px; border-radius: 12px; border: 1px solid var(--field-border);
  background: rgba(0,0,0,0.35); color: #cbd5e1; tab-size: 2;
  font-family: ui-monospace, "Cascadia Code", Menlo, monospace; font-size: 0.78rem; line-height: 1.55;
}
.codearea:focus { outline: none; border-color: var(--accent); }
.editorbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.stepchips { display: flex; gap: 6px; }
.uploadbar { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }

.chip-btn {
  display: inline-flex; align-items: center; gap: 5px;
  border: 1px solid var(--field-border);
  background: rgba(255,255,255,0.05);
  color: var(--text);
  font-size: 0.76rem; font-weight: 600;
  padding: 7px 12px; border-radius: 9px;
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background .15s, border-color .15s, transform .1s, color .15s;
}
.chip-btn:hover { background: rgba(255,255,255,0.1); border-color: var(--accent); color: var(--text); }
.chip-btn:active { transform: translateY(1px); }
.chip-btn.danger { color: var(--danger); }
.chip-btn.danger:hover { border-color: var(--danger); }

.btn, a.btn { text-decoration: none; }
.rules { margin: 4px 0 0; padding-left: 18px; color: var(--muted); font-size: 0.82rem; line-height: 1.6; }
.rules code, .cell__v code, .sub code, .proj__meta code, .detail__heroinfo code {
  background: rgba(0,0,0,0.3); padding: 1px 6px; border-radius: 5px;
  font-family: ui-monospace, Menlo, monospace; font-size: 0.9em; color: var(--text); }
.uplist { display: flex; flex-direction: column; gap: 4px; max-height: 220px; overflow: auto; }
.uprow { display: flex; align-items: center; gap: 9px; font-size: 0.82rem; padding: 6px 8px;
  border-radius: 8px; background: var(--field-bg); border: 1px solid var(--field-border); cursor: pointer; }
.uprow code { font-family: ui-monospace, Menlo, monospace; }
.tplrow { display: flex; flex-direction: column; gap: 3px; text-align: left; width: 100%;
  padding: 12px 14px; border-radius: 11px; border: 1px solid var(--field-border);
  background: var(--field-bg); color: var(--text); cursor: pointer; transition: background .15s, border-color .15s; }
.tplrow:hover { background: rgba(255,255,255,0.07); border-color: var(--accent); }
.tplrow__name { font-weight: 600; font-size: 0.9rem; display: flex; align-items: center; gap: 8px; }
.tplrow__desc { font-size: 0.76rem; color: var(--muted); }

@media (max-width: 720px) { .ipwrap { grid-template-columns: 1fr; } .ipmap { min-height: 220px; } }
@media (max-width: 620px) {
  .logrow { grid-template-columns: 60px 48px 1fr 44px; }
  .logrow__dev { display: none; }
  .tl { grid-template-columns: 64px 20px 1fr; }
  .dash__bar { flex-direction: column; align-items: stretch; }
  .tabs { flex-wrap: wrap; }
  .tab { flex: 1 1 auto; white-space: nowrap; padding: 9px 10px; font-size: 0.8rem; }
}
