/* 링클래식 봇 관리 - 화이트 테마, 반응형 (PC/태블릿/모바일) */
:root{
  --bg:#f5f6f8; --card:#ffffff; --line:#e7e8ec; --line2:#f0f1f4;
  --text:#1d1d1f; --text2:#6e6e73; --text3:#9a9aa0;
  --blue:#0a84ff; --blue-d:#0060df; --green:#30b350; --orange:#ff9500;
  --red:#ff3b30; --amber:#c98a00;
  --radius:16px; --radius-s:11px;
  --shadow:0 1px 2px rgba(0,0,0,.04),0 8px 24px rgba(0,0,0,.06);
  --font:-apple-system,BlinkMacSystemFont,"Segoe UI","Malgun Gothic",sans-serif;
}
*{box-sizing:border-box}
html,body{margin:0;padding:0}
body{
  font-family:var(--font); background:var(--bg); color:var(--text);
  -webkit-font-smoothing:antialiased; line-height:1.45;
  min-height:100vh; min-height:100dvh;
}
.hidden{display:none !important}
.screen{min-height:100vh; min-height:100dvh}

/* ---- 카드 ---- */
.card{
  background:var(--card); border:1px solid var(--line);
  border-radius:var(--radius); box-shadow:var(--shadow);
}

/* ---- 버튼 ---- */
.btn{
  font-family:inherit; font-size:15px; font-weight:600;
  border:none; border-radius:999px; padding:11px 20px;
  cursor:pointer; transition:.15s; white-space:nowrap;
}
.btn.primary{background:var(--blue); color:#fff}
.btn.primary:hover{background:var(--blue-d)}
.btn.primary:disabled{opacity:.5; cursor:default}
.btn.ghost{background:transparent; color:var(--text2); padding:8px 14px; font-size:14px}
.btn.ghost:hover{background:var(--line2)}
.btn.danger{background:#fff0ef; color:var(--red)}
.btn.danger:hover{background:#ffe1df}
.btn.mini{padding:7px 14px; font-size:13.5px}

/* ---- 로그인 ---- */
#login{display:flex; align-items:center; justify-content:center; padding:24px}
.login-card{width:100%; max-width:380px; padding:36px 30px}
.brand{display:flex; align-items:center; gap:12px}
.brand .logo{
  width:42px;height:42px;border-radius:12px;display:grid;place-items:center;
  background:linear-gradient(135deg,#0a84ff,#5e5ce6); color:#fff; font-size:20px;
}
.brand.small .logo{width:30px;height:30px;font-size:15px;border-radius:9px}
.brand h1{font-size:22px; margin:0; font-weight:700}
.brand h1 span{color:var(--text3); font-weight:600}
.login-card .sub{color:var(--text2); margin:16px 0 22px; font-size:14.5px}
form label{display:block; font-size:13px; color:var(--text2); margin-bottom:14px; font-weight:600}
form input{
  width:100%; margin-top:6px; padding:12px 14px; font-size:16px;
  border:1px solid var(--line); border-radius:var(--radius-s);
  background:#fbfbfd; font-family:inherit; transition:.15s; color:var(--text);
}
form input:focus{outline:none; border-color:var(--blue); background:#fff;
  box-shadow:0 0 0 3px rgba(10,132,255,.12)}
.login-card .btn{width:100%; margin-top:6px}
.err{color:var(--red); font-size:13.5px; margin:12px 0 0; min-height:1px}

/* ---- 상단바 ---- */
.topbar{
  position:sticky; top:0; z-index:5;
  display:flex; align-items:center; justify-content:space-between;
  padding:14px 20px; background:rgba(255,255,255,.85);
  backdrop-filter:saturate(180%) blur(16px);
  border-bottom:1px solid var(--line);
  padding-top:max(14px,env(safe-area-inset-top));
}
.topbar .brand strong{font-size:16px}
.who{display:flex; align-items:center; gap:10px}
#whoName{font-size:14.5px; font-weight:600}
.badge{
  font-size:11.5px; font-weight:700; color:#fff; background:var(--blue);
  padding:3px 9px; border-radius:999px;
}

/* ---- 본문 ---- */
.wrap{max-width:760px; margin:0 auto; padding:22px 16px 60px;
  padding-bottom:max(60px,calc(40px + env(safe-area-inset-bottom)))}
.card + .card{margin-top:18px}
.add-card,.list-card{padding:22px}
h2{font-size:17px; margin:0 0 4px}
.hint{color:var(--text2); font-size:13px; margin:2px 0 16px}
.add-card .row{display:flex; gap:12px; align-items:flex-end; flex-wrap:wrap}
.add-card .row label{flex:1; min-width:150px; margin-bottom:0}
.add-card .row .btn{flex:0 0 auto}

/* ---- 봇 목록 ---- */
.list-head{display:flex; align-items:baseline; justify-content:space-between; margin-bottom:14px}
.count{color:var(--text3); font-size:13px; font-weight:600}
.bot-list{display:flex; flex-direction:column; gap:12px}
.bot{
  border:1px solid var(--line); border-radius:var(--radius-s);
  padding:16px; display:flex; align-items:center; gap:14px; flex-wrap:wrap;
}
.bot .dot{width:10px;height:10px;border-radius:50%;background:var(--text3); flex:0 0 auto}
.bot.on .dot{background:var(--green); box-shadow:0 0 0 3px rgba(48,179,80,.15)}
.bot.wait .dot{background:var(--amber); box-shadow:0 0 0 3px rgba(201,138,0,.15)}
.bot.err .dot{background:var(--red)}
.bot .main{flex:1; min-width:140px}
.bot .nm{font-size:16px; font-weight:700; display:flex; align-items:center; gap:8px}
.bot .meta{font-size:12.5px; color:var(--text2); margin-top:2px}
.bot .st{font-size:12.5px; margin-top:3px; font-weight:600}
.bot .st.on{color:var(--green)} .bot .st.wait{color:var(--amber)}
.bot .st.err{color:var(--red)} .bot .st.off{color:var(--text3)}
.bot .actions{display:flex; align-items:center; gap:8px; flex:0 0 auto}

/* 토글 스위치 */
.switch{position:relative; width:46px; height:28px; flex:0 0 auto; cursor:pointer}
.switch input{opacity:0; width:0; height:0; position:absolute}
.switch .sl{position:absolute; inset:0; background:#d7d8dd; border-radius:999px; transition:.2s}
.switch .sl::before{content:""; position:absolute; width:22px; height:22px; left:3px; top:3px;
  background:#fff; border-radius:50%; transition:.2s; box-shadow:0 1px 3px rgba(0,0,0,.25)}
.switch input:checked + .sl{background:var(--green)}
.switch input:checked + .sl::before{transform:translateX(18px)}
/* 쿨다운(연타 방지) 잠금 상태 */
.switch.cooling{cursor:default; opacity:.55}
.switch.cooling .sl{filter:grayscale(.3)}
.btn.mini:disabled{opacity:.55; cursor:default; min-width:52px}
.cool-hint{color:var(--amber); font-weight:600}

.empty{text-align:center; color:var(--text3); padding:30px 0; font-size:14px}
.muted{color:var(--text3); font-size:12.5px}

/* 내 정보 카드 */
.me-card{padding:20px 22px}
.me-head{display:flex; align-items:baseline; gap:10px; margin-bottom:12px}
.me-head h2{margin:0}

/* 태그 */
.tags{display:flex; flex-wrap:wrap; gap:6px; margin-bottom:12px}
.tag{font-size:12px; font-weight:600; color:var(--text2); background:var(--line2);
  padding:3px 10px; border-radius:999px}
.tag.green{background:#e6f8ec; color:#1c7c3f}
.tag.red{background:#ffeceb; color:var(--red)}
.tag.blue{background:#e8f2ff; color:var(--blue-d)}

/* 스탯 그리드 */
.stats{display:grid; grid-template-columns:repeat(auto-fill,minmax(140px,1fr)); gap:10px 16px}
.stat{display:flex; flex-direction:column; gap:1px; min-width:0}
.stat span{font-size:11.5px; color:var(--text3); font-weight:600}
.stat b{font-size:14px; font-weight:700; color:var(--text); overflow:hidden; text-overflow:ellipsis; white-space:nowrap}
.stat b .dim{color:var(--text3); font-weight:600; font-size:12px}

/* 봇 상세 */
.bot{flex-direction:column; align-items:stretch; gap:0; padding:0}
.bot-row{display:flex; align-items:center; gap:14px; flex-wrap:wrap; padding:16px}
.bot .owner{font-size:12px; color:var(--text3); font-weight:500; margin-left:6px}
.bot-detail{padding:0 16px 16px; border-top:1px solid var(--line2); padding-top:14px}

/* ---- 토스트 ---- */
.toast{
  position:fixed; left:50%; bottom:26px; transform:translateX(-50%) translateY(10px);
  background:#1d1d1f; color:#fff; padding:12px 20px; border-radius:999px;
  font-size:14px; font-weight:600; box-shadow:0 8px 30px rgba(0,0,0,.25);
  opacity:0; transition:.25s; z-index:50; max-width:90vw; text-align:center;
  bottom:max(26px,calc(20px + env(safe-area-inset-bottom)));
}
.toast.show{opacity:1; transform:translateX(-50%) translateY(0)}
.toast.ok{background:#1c7c3f} .toast.bad{background:#b02a22} .toast.warn{background:#9a6800}

/* ---- 반응형 ---- */
@media (max-width:560px){
  .add-card .row{flex-direction:column; align-items:stretch}
  .add-card .row .btn{width:100%}
  .bot .actions{width:100%; justify-content:flex-end; margin-top:4px}
  .topbar{padding-left:14px; padding-right:14px}
  h2{font-size:16px}
}
