:root{
  --fs: .8;

  --bg:        #f6f7f9;
  --bg-deep:   #eceff3;
  --surface:   #ffffff;
  --surface-2: #f2f4f7;
  --line:      #dfe3e8;
  --text:      #1b2230;
  --muted:     #5b6472;
  --muted-2:   #8a939f;
  --accent:    #2f6fd0;
  --accent-fg: #ffffff;
  --accent-soft:#e8f0fc;
  --danger:    #c8372d;
  --danger-fg: #8e241c;
  --danger-bg: #fdecea;
  --danger-line:#f5c6c2;
  --unread:    #d94f3d;

  --done:      #a55a0c;
  --done-bg:   #fdf2e4;

  --leave:     #6b4fa8;
  --leave-bg:  #f1ecfa;
  --leave-line:#a98fd8;
}

*,*::before,*::after{ box-sizing:border-box; }

[hidden]{ display:none !important; }

html,body{ height:100%; }
body{
  margin:0;
  background:var(--bg);
  color:var(--text);
  font-size:calc(13px * var(--fs));
  line-height:1.55;

  font-family:"Malgun Gothic","맑은 고딕",-apple-system,"Apple SD Gothic Neo",
              "Noto Sans KR","Nanum Gothic",sans-serif;
  -webkit-text-size-adjust:100%;
}

label{ display:block; font-size:calc(12px * var(--fs)); font-weight:600; color:var(--muted); margin-bottom:5px; }

.input,.select,textarea{
  width:100%; padding:9px 11px;
  border:1px solid var(--line); border-radius:8px;
  background:var(--surface); color:var(--text);
  font:inherit; outline:none;
}
.input:focus,.select:focus,textarea:focus{
  border-color:var(--accent);
  box-shadow:0 0 0 3px var(--accent-soft);
}
.select{ appearance:none; padding-right:30px;

  background-image:linear-gradient(45deg,transparent 50%,var(--muted) 50%),
                   linear-gradient(135deg,var(--muted) 50%,transparent 50%);
  background-position:calc(100% - 16px) 51%, calc(100% - 11px) 51%;
  background-size:5px 5px,5px 5px;
  background-repeat:no-repeat;
}

.btn{
  display:inline-flex; align-items:center; justify-content:center; gap:6px;
  padding:8px 14px; border:1px solid var(--line); border-radius:8px;
  background:var(--surface); color:var(--text);
  font:inherit; font-weight:600; cursor:pointer;
  text-decoration:none; white-space:nowrap;
}
.btn:hover{ background:var(--surface-2); }

.logout-form{ display:contents; }

.btn-primary{ background:var(--accent); border-color:var(--accent); color:var(--accent-fg); }
.btn-primary:hover{
  background:var(--accent); border-color:var(--accent); color:var(--accent-fg);
  filter:brightness(1.07);
}
.btn-danger{ background:var(--danger); border-color:var(--danger); color:#fff; }
.btn-danger:hover{
  background:var(--danger); border-color:var(--danger); color:#fff;
  filter:brightness(1.07);
}

.btn-done{ background:var(--done); border-color:var(--done); color:#fff; }
.btn-done:hover{
  background:var(--done); border-color:var(--done); color:#fff;
  filter:brightness(1.07);
}

.btn-done-soft{ border-color:var(--done); color:var(--done); }
.btn-done-soft:hover{ background:var(--done-bg); color:var(--done); }
.btn.lg{ padding:11px 16px; font-size:calc(13.5px * var(--fs)); }
.btn.block{ width:100%; }

.ask-back{
  position:fixed; inset:0; z-index:9000;
  display:flex; align-items:center; justify-content:center; padding:18px;
  background:rgba(12,18,28,.42);
}
.ask{
  width:100%; max-width:320px; padding:20px 18px 14px;
  background:var(--surface); border-radius:12px;
  box-shadow:0 18px 50px rgba(10,16,28,.28);
}
.ask-text{ margin:0 0 16px; font-size:calc(13px * var(--fs)); line-height:1.65; white-space:pre-line; }
.ask-field{ display:block; margin:0 0 16px; font-size:calc(12px * var(--fs)); color:var(--muted); }
.ask-field span{ display:block; margin-bottom:5px; }
.ask-field select{ width:100%; }

.ask-area{ resize:none; line-height:1.55; }
.ask-foot{ display:flex; justify-content:flex-end; gap:6px; flex-wrap:wrap; }
.ask-foot .btn{ min-width:64px; justify-content:center; }

.card{
  background:var(--surface); border:1px solid var(--line);
  border-radius:12px; padding:18px;
}
.row{ display:flex; align-items:center; }
.muted{ color:var(--muted); }

.msg-body{ word-break:break-word; }

.msg-body img{ width:auto; height:auto; max-width:100%; max-height:70vh; }
.msg-body table{
  border-collapse:collapse; margin:8px 0;

  max-width:100%;
}
.msg-body th,.msg-body td{
  border:1px solid var(--line); padding:4px 8px; text-align:left; vertical-align:top;
}
.msg-body th{ background:var(--surface-2); font-weight:600; }

.msg-body .table-scroll{ overflow-x:auto; }
.msg-body p{ margin:0 0 6px; }
.msg-body ul,.msg-body ol{ margin:0 0 6px; padding-left:22px; }

.notice{
  flex:0 0 auto; display:flex; align-items:center; gap:6px;
  padding:6px 10px; border-bottom:1px solid var(--line);
  background:#fff8e1; color:#7a5c00; font-size:calc(11.5px * var(--fs)); line-height:1.45;
}
.notice[hidden]{ display:none; }
.notice span{ flex:1; min-width:0; }
.btn.xs{ flex:0 0 auto; padding:3px 8px; font-size:calc(11px * var(--fs)); border-radius:6px; }

.msg-body a, .msg-text a, .talk-text a{
  color:var(--accent); text-decoration:underline;

  word-break:break-all;
}
.msg-body a:hover, .msg-text a:hover, .talk-text a:hover{ text-decoration:none; }

.unc-link{
  color:var(--muted); text-decoration:underline dotted;
  cursor:pointer;
}
.unc-link:hover{ color:var(--text); text-decoration:underline; }
