/* ==========================================================================
   로우메이트 — 상용 버전 스타일 확장
   base.css(프로토타입 디자인 토큰·컴포넌트) 위에 실서비스용 화면을 얹는다.
   ========================================================================== */

/* ---------- 레이아웃 보정 ---------- */
html, body { height: auto; min-height: 100%; }
.app { height: 100vh; }
.hidden { display: none !important; }

/* ---------- 로그인 / 회원가입 ---------- */
.gate {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 32px 20px; background:
    radial-gradient(900px 500px at 12% -10%, #E3E0FB 0%, transparent 60%),
    radial-gradient(800px 520px at 105% 110%, #DDE7FA 0%, transparent 62%),
    var(--bg);
}
.gatebox {
  width: 100%; max-width: 940px; display: flex; background: var(--panel);
  border: 1px solid var(--line); border-radius: 20px; overflow: hidden;
  box-shadow: 0 30px 70px -32px rgba(13, 20, 36, .45);
}
.gateside {
  flex: 0 0 44%; background: linear-gradient(160deg, #121930 0%, #0B1120 45%, #201B57 100%);
  color: #fff; padding: 40px 36px; display: flex; flex-direction: column;
}
.gateside .mark {
  width: 46px; height: 46px; border-radius: 13px; background: linear-gradient(135deg, #5B4BE8, #8C6BFF);
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 19px; margin-bottom: 22px;
}
.gateside h2 { font-size: 25px; font-weight: 700; line-height: 1.4; letter-spacing: -.6px; }
.gateside > p { color: #9AA5C0; font-size: 13px; line-height: 1.8; margin-top: 12px; }
.gatefeat { margin-top: auto; padding-top: 26px; }
.gatefeat div { display: flex; gap: 11px; padding: 9px 0; color: #C3CCE2; font-size: 12.5px; align-items: flex-start; }
.gatefeat div i {
  flex: 0 0 20px; width: 20px; height: 20px; border-radius: 7px; background: #2A2270; color: #B9AEFF;
  font-style: normal; font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center;
}
.gatemain { flex: 1; padding: 44px 42px; min-width: 0; }
.gatemain h1 { font-size: 22px; font-weight: 700; letter-spacing: -.4px; }
.gatemain > p { color: var(--sub); font-size: 13px; margin: 8px 0 22px; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12.5px; font-weight: 600; color: var(--sub); margin-bottom: 6px; }
.field input {
  width: 100%; border: 1px solid var(--line); border-radius: 11px; padding: 11px 13px;
  font-size: 14px; background: #FCFDFE; color: var(--ink);
}
.field input:focus { border-color: var(--acc); background: #fff; box-shadow: 0 0 0 3px rgba(67, 56, 202, .09); }
/* 가입 코드는 어깨너머로 보이지 않게 가려 두되, 오타 확인용으로 잠깐 펼칠 수 있게 한다 */
.reveal { position: relative; }
.reveal input { padding-right: 62px; }
.reveal button {
  position: absolute; right: 5px; top: 50%; transform: translateY(-50%);
  padding: 6px 9px; border-radius: 8px;
  font-size: 12px; font-weight: 600; color: var(--mut);
}
.reveal button:hover { color: var(--acc); background: var(--accL); }
.reveal button:focus-visible { outline: 2px solid var(--acc); outline-offset: 1px; }

.gatemain .btn { width: 100%; padding: 12px; font-size: 14px; margin-top: 6px; }
.gateswap { margin-top: 18px; text-align: center; font-size: 12.5px; color: var(--mut); }
.gateswap button { color: var(--acc); font-weight: 600; }
.formerr {
  background: var(--redL); color: var(--red); border-radius: 10px; padding: 10px 13px;
  font-size: 12.5px; line-height: 1.6; margin-bottom: 14px;
}

/* ---------- 공통 상태 ---------- */
.loading { display: flex; align-items: center; gap: 10px; color: var(--sub); font-size: 13px; padding: 16px 0; }
.spin {
  width: 15px; height: 15px; border: 2px solid #D6DBE8; border-top-color: var(--acc);
  border-radius: 50%; animation: spin .7s linear infinite; flex: 0 0 15px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.banner {
  display: flex; gap: 11px; align-items: flex-start; border-radius: 12px;
  padding: 12px 15px; font-size: 12.5px; line-height: 1.7; margin-bottom: 14px;
}
.banner.warn { background: var(--amberL); color: #7A4E05; border: 1px solid #F2DFB6; }
.banner.err { background: var(--redL); color: var(--red); border: 1px solid #F3D3D0; }
.banner.info { background: var(--accL); color: var(--accD); border: 1px solid #D5D1F8; }
.banner b { display: block; margin-bottom: 3px; }
.banner .x { margin-left: auto; flex: 0 0 auto; opacity: .55; font-size: 15px; }

/* ---------- 사이드바 사용자 ---------- */
.sideuser { position: absolute; left: 16px; right: 16px; bottom: 16px; }
.sideuser .box {
  background: var(--side2); border: 1px solid var(--sideLine); border-radius: 12px; padding: 12px 13px;
}
.sideuser b { display: block; color: #fff; font-size: 12.5px; }
.sideuser span { display: block; color: #7D89A5; font-size: 11px; margin-top: 3px; }
.sideuser .out { margin-top: 10px; width: 100%; text-align: left; color: #8E9AB6; font-size: 11.5px; }
.sideuser .out:hover { color: #C7D0E4; }
.sync { display: flex; align-items: center; gap: 6px; color: #6C7794; font-size: 10.5px; margin-top: 9px; }
.sync .dot { width: 6px; height: 6px; border-radius: 50%; background: #31C48D; flex: 0 0 6px; }
.sync .dot.bad { background: #E5934D; }

/* ---------- 상담 ---------- */
.bub .md { font-size: 14px; line-height: 1.85; }
.bub .md strong { font-weight: 700; color: var(--accD); }
.msg.u .bub .md strong { color: #fff; }
.bub .md p { margin-bottom: 9px; }
.bub .md p:last-child { margin-bottom: 0; }
.bub .md ul { margin: 6px 0 9px; padding-left: 3px; list-style: none; }
.bub .md li { position: relative; padding-left: 13px; margin-bottom: 5px; }
.bub .md li::before {
  content: ''; position: absolute; left: 2px; top: 10px; width: 4px; height: 4px;
  border-radius: 50%; background: #A9B2C6;
}
.bub .md em { font-style: normal; color: var(--mut); font-size: 13px; }
.srcitem { display: block; margin-top: 6px; }
.srcitem .t {
  display: inline-block; font-size: 10px; font-weight: 700; border-radius: 5px;
  padding: 2px 6px; margin-right: 6px; vertical-align: 1px;
}
.srcitem .t.law { background: var(--accL); color: var(--accD); }
.srcitem .t.bill { background: var(--okL); color: var(--ok); }
.chatlist { max-height: 260px; overflow-y: auto; margin: -4px -6px; padding: 0 6px; }
.chatrow {
  display: block; width: 100%; text-align: left; border-radius: 10px; padding: 9px 10px;
  font-size: 12.5px; color: var(--sub); transition: .12s;
}
.chatrow:hover { background: #F5F6FB; }
.chatrow.on { background: var(--accL); color: var(--accD); font-weight: 600; }
.chatrow span { display: block; color: var(--mut); font-size: 11px; margin-top: 3px; font-weight: 400; }

/* ---------- 검토 ---------- */
.riskbar { display: flex; gap: 7px; margin-top: 12px; }
.riskbar div {
  flex: 1; border-radius: 9px; padding: 9px 11px; text-align: center;
  background: rgba(255, 255, 255, .09); border: 1px solid rgba(255, 255, 255, .13);
}
.riskbar b { display: block; font-size: 18px; font-weight: 700; }
.riskbar span { display: block; font-size: 10.5px; color: #A7B2CC; margin-top: 2px; }
.finding .cur {
  background: #FCF6F5; border: 1px solid #F0DEDC; border-radius: 9px; padding: 9px 11px;
  margin-top: 9px; font-size: 12.5px; color: #6A4A47; line-height: 1.7; white-space: pre-wrap;
}
.finding .fix { white-space: pre-wrap; }
.finding .basis { margin-top: 8px; color: var(--mut); font-size: 11.5px; line-height: 1.6; }
.finding .lbl { font-size: 11px; font-weight: 700; color: var(--mut); display: block; margin-bottom: 4px; }
.finding .fix .lbl { color: var(--acc); }
.revised {
  background: #FBFCFE; border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px;
  max-height: 520px; overflow-y: auto; font-size: 13px; line-height: 1.95; color: #33405C;
  white-space: pre-wrap; word-break: break-word;
}
.histrow {
  display: flex; align-items: center; gap: 11px; width: 100%; text-align: left;
  padding: 11px 0; border-bottom: 1px solid var(--line2);
}
.histrow:last-child { border-bottom: none; }
.histrow .fi {
  flex: 0 0 30px; width: 30px; height: 30px; border-radius: 8px; background: var(--accL);
  color: var(--accD); display: flex; align-items: center; justify-content: center;
  font-size: 9.5px; font-weight: 700;
}
.histrow b { font-size: 12.5px; display: block; word-break: break-all; }
.histrow span { display: block; color: var(--mut); font-size: 11px; margin-top: 3px; }

/* ---------- 개정소식 ---------- */
.billrow { display: block; width: 100%; text-align: left; padding: 15px 2px; border-bottom: 1px solid var(--line2); transition: .12s; }
.billrow:last-child { border-bottom: none; }
.billrow:hover { background: #FAFBFE; }
.billrow .ttl { font-size: 14.5px; font-weight: 600; margin-top: 8px; line-height: 1.5; }
.billrow.unread .ttl::before {
  content: ''; display: inline-block; width: 6px; height: 6px; border-radius: 50%;
  background: var(--accS); margin-right: 7px; vertical-align: 2px;
}
.billrow .sub { color: var(--sub); font-size: 12.5px; margin-top: 6px; line-height: 1.65; }
.billrow .meta { color: var(--mut); font-size: 11.5px; margin-top: 7px; }
.chgrow { padding: 12px 0; border-bottom: 1px solid var(--line2); }
.chgrow:last-child { border-bottom: none; }
.chgrow b { display: block; font-size: 13.5px; margin-bottom: 5px; }
.chgrow p { color: var(--sub); font-size: 12.5px; line-height: 1.8; }
.actrow { display: flex; gap: 11px; padding: 11px 0; border-bottom: 1px solid var(--line2); }
.actrow:last-child { border-bottom: none; }
.actrow .n {
  flex: 0 0 22px; width: 22px; height: 22px; border-radius: 7px; background: var(--accL);
  color: var(--accD); font-size: 11px; font-weight: 700; display: flex;
  align-items: center; justify-content: center; margin-top: 1px;
}
.actrow b { font-size: 13px; font-weight: 600; display: block; line-height: 1.6; }
.actrow span { display: block; color: var(--mut); font-size: 11.5px; margin-top: 4px; }
.checkrow { display: flex; gap: 9px; padding: 9px 0; font-size: 12.5px; color: var(--sub); line-height: 1.7; }
.checkrow i {
  flex: 0 0 15px; width: 15px; height: 15px; border: 1.5px solid #C3CAD8; border-radius: 4px; margin-top: 3px;
}
.kwchip {
  display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--accD);
  background: var(--accL); border-radius: 7px; padding: 5px 7px 5px 9px; margin: 0 5px 6px 0;
}
.kwchip button { color: #8981D8; font-size: 13px; line-height: 1; padding: 0 2px; }
.kwchip button:hover { color: var(--red); }

/* ---------- 법령 조회 ---------- */
.artrow { padding: 14px 0; border-bottom: 1px solid var(--line2); }
.artrow:last-child { border-bottom: none; }
.artrow > b { display: block; font-size: 14px; margin-bottom: 6px; }
.artrow p { font-size: 13px; color: #3B4661; line-height: 1.9; white-space: pre-wrap; }
.artrow.hit { background: #FCFBFF; border-radius: 9px; padding-left: 11px; padding-right: 11px; }
.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.tabs button {
  padding: 9px 14px; font-size: 13px; font-weight: 600; color: var(--mut);
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tabs button.on { color: var(--acc); border-bottom-color: var(--acc); }
.tbl td.b { background: #FDF8F8; }
.tbl td.a { background: #F6FCF9; }
.tbl.cmp td { width: 33.33%; font-size: 11.5px; }

/* ---------- 진단 ---------- */
.diag { display: flex; align-items: flex-start; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--line2); }
.diag:last-child { border-bottom: none; }
.diag .st {
  flex: 0 0 9px; width: 9px; height: 9px; border-radius: 50%; margin-top: 6px; background: #31C48D;
}
.diag .st.bad { background: #E5484D; }
.diag b { font-size: 13.5px; }
.diag p { color: var(--sub); font-size: 12px; margin-top: 4px; line-height: 1.7; }
.diag .ms { margin-left: auto; color: var(--mut); font-size: 11.5px; flex: 0 0 auto; }
code.ip {
  background: #F0F2F7; border-radius: 5px; padding: 2px 6px; font-size: 12px;
  font-family: Consolas, monospace; color: var(--accD);
}

/* ---------- 반응형 ---------- */
@media (max-width: 1180px) {
  .grid { flex-wrap: wrap; }
  .gR { flex: 1 1 100%; width: 100%; }
  .grid .gL { margin-right: 0; }
}
@media (max-width: 860px) {
  .side { width: 100%; height: auto; bottom: auto; padding-bottom: 10px; }
  .side .navlab, .sideuser { display: none; }
  .side .nav { display: flex; overflow-x: auto; }
  .side .nav a { border-left: none; border-bottom: 3px solid transparent; white-space: nowrap; padding: 10px 14px; }
  .side .nav a.on { border-left-color: transparent; border-bottom-color: var(--accS); }
  .main { left: 0; top: 148px; }
  .app { height: auto; min-height: 100vh; overflow: visible; }
  .gatebox { flex-direction: column; }
  .gateside { flex: 0 0 auto; padding: 28px; }
  .gatefeat { display: none; }
  .gatemain { padding: 28px; }
  .scroll { padding: 18px 16px 24px; }
  .head .act { float: none; margin-bottom: 12px; }
  .lawchk { width: calc(50% - 5px); }
}
