/* Onz 포털 — Onz노트·Onz일정관리와 같은 코랄 톤 */
:root { --bg:#fff8f6; --card:#fff; --ink:#2b2321; --sub:#7a6a66; --line:#f0e2de; --accent:#F0705B; --accent2:#E0559A;
        --soft:#fde9e4; --ok:#2e9d6a; --warn:#d97706; --navw:248px; --talkw:380px; --toph:54px;
        --p0:#3b82f6; --p1:#e0559a; --p2:#22a06b; --p3:#e8a317; --p4:#8b5cf6; --fam:#F0705B; --par:#7c5cd6; }
@media (prefers-color-scheme: dark) {
  :root { --bg:#1b1716; --card:#262120; --ink:#f3ebe9; --sub:#b5a7a3; --line:#3a3230; --accent:#ff8a75; --accent2:#ff7fbc;
          --soft:#3a2723; --ok:#5fcf98; --p0:#6aa5ff; --p1:#ff7fbc; --p2:#4fd397; --p3:#ffc24d; --p4:#a98bff; --fam:#ff8a75; --par:#a58cff; }
}
* { box-sizing:border-box; }
html,body { margin:0; height:100%; background:var(--bg); color:var(--ink);
  font:15px/1.5 Pretendard,system-ui,-apple-system,"Apple SD Gothic Neo","Malgun Gothic",sans-serif; }
button { font:inherit; color:inherit; cursor:pointer; }
a { color:var(--accent); }
[hidden] { display:none !important; }

/* ---------- 로그인 ---------- */
.login-page { display:flex; align-items:center; justify-content:center; min-height:100vh; padding:16px;
  background:radial-gradient(1200px 600px at 10% -10%, #ffd9cf 0, transparent 60%), radial-gradient(900px 500px at 110% 110%, #ffd1e6 0, transparent 60%), var(--bg); }
.login-card { background:var(--card); border-radius:20px; padding:36px 28px; width:100%; max-width:380px; text-align:center; box-shadow:0 10px 40px #0000001a; }
.login-logo { width:72px; height:72px; }
.login-card h1 { margin:8px 0 4px; font-size:30px; letter-spacing:-.5px; }
.login-sub { color:var(--sub); margin:0 0 24px; }
.kakao-btn { display:flex; align-items:center; justify-content:center; gap:8px; height:48px; border-radius:12px; background:#FEE500; color:#000;
  text-decoration:none; font-weight:700; }
.login-note { color:var(--sub); font-size:13px; margin-top:16px; }

/* ---------- 위 막대 ---------- */
.top { position:fixed; inset:0 0 auto 0; height:var(--toph); display:flex; align-items:center; gap:10px; padding:0 12px;
  background:var(--card); border-bottom:1px solid var(--line); z-index:30; }
.brand { display:flex; align-items:center; gap:8px; text-decoration:none; color:var(--ink); font-weight:800; font-size:19px; }
.brand img { width:30px; height:30px; }
.crumb { flex:1; min-width:0; color:var(--sub); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; font-weight:600; }
.top-actions { display:flex; align-items:center; gap:6px; }
.icon-btn { border:0; background:transparent; width:36px; height:36px; border-radius:10px; font-size:18px; display:inline-flex; align-items:center; justify-content:center; }
.icon-btn:hover { background:var(--soft); }
.pill-btn { border:1px solid var(--line); background:var(--card); border-radius:999px; padding:5px 12px; display:inline-flex; gap:6px; align-items:center; }
.pill-btn.on { background:var(--soft); border-color:var(--accent); }
.badge { background:var(--accent); color:#fff; border-radius:999px; font-size:11px; min-width:18px; height:18px; padding:0 5px; display:inline-flex; align-items:center; justify-content:center; font-weight:700; }
.user { position:relative; }
.user-btn { border:0; background:transparent; display:flex; align-items:center; gap:6px; padding:4px 6px; border-radius:999px; }
.user-btn:hover { background:var(--soft); }
.avatar { width:30px; height:30px; border-radius:50%; background:linear-gradient(135deg,#FF8A6B,#E0559A); color:#fff; display:inline-flex; align-items:center; justify-content:center; font-weight:700; font-size:14px; flex:none; }
.uname { font-weight:600; max-width:120px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.user-menu { position:absolute; right:0; top:44px; background:var(--card); border:1px solid var(--line); border-radius:12px; box-shadow:0 8px 24px #0002; min-width:190px; padding:6px; z-index:40; }
.user-menu button { display:block; width:100%; text-align:left; border:0; background:transparent; padding:9px 10px; border-radius:8px; }
.user-menu button:hover { background:var(--soft); }
.um-role { color:var(--sub); font-size:13px; padding:6px 10px; border-bottom:1px solid var(--line); margin-bottom:4px; }

/* ---------- 틀 ---------- */
.shell { position:fixed; inset:var(--toph) 0 0 0; display:flex; }
.nav { width:var(--navw); flex:none; background:var(--card); border-right:1px solid var(--line); overflow-y:auto; display:flex; flex-direction:column; }
.content { flex:1; min-width:0; position:relative; overflow:hidden; }
.resizer { width:6px; flex:none; cursor:col-resize; background:transparent; border-left:1px solid var(--line); position:relative; }
.resizer:hover, .resizer.drag { background:var(--soft); }
.resizer::after { content:""; position:absolute; top:50%; left:1px; width:3px; height:36px; margin-top:-18px; border-radius:3px; background:var(--line); }
.talk { width:var(--talkw); flex:none; background:var(--card); display:flex; flex-direction:column; min-width:0; }
body.talk-off .talk, body.talk-off .resizer { display:none; }
body.dragging iframe { pointer-events:none; }
body.dragging { user-select:none; cursor:col-resize; }

/* ---------- 메뉴 트리 ---------- */
.tree { list-style:none; margin:0; padding:10px 8px; flex:1; }
.tree li { margin:1px 0; }
.tree .row { display:flex; align-items:center; gap:8px; width:100%; border:0; background:transparent; text-align:left; padding:8px 10px; border-radius:10px; font-weight:600; }
.tree .row:hover { background:var(--soft); }
.tree .row.on { background:var(--soft); color:var(--accent); }
.tree .ico { width:22px; text-align:center; flex:none; }
.tree .lbl { flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.tree .caret { color:var(--sub); font-size:12px; transition:transform .15s; }
.tree li.open > .row .caret { transform:rotate(90deg); }
.tree ul { list-style:none; margin:0 0 4px; padding:0 0 0 22px; display:none; }
.tree li.open > ul { display:block; }
.tree ul .row { font-weight:500; padding:6px 10px; font-size:14px; border-left:2px solid var(--line); border-radius:0 10px 10px 0; }
.tree ul .row.on { border-left-color:var(--accent); }
.tag { font-size:11px; border-radius:6px; padding:0 6px; background:#ece6ff; color:var(--par); font-weight:700; }
@media (prefers-color-scheme: dark) { .tag { background:#2f2648; } }
.ext { color:var(--sub); font-size:12px; }
.nav-foot { color:var(--sub); font-size:12px; padding:12px 16px; border-top:1px solid var(--line); }
.nav-head { display:flex; align-items:center; justify-content:space-between; padding:10px 12px 0 16px; }

/* ---------- 서비스 화면 (iframe) ---------- */
.frames { position:absolute; inset:0; display:none; }
.content.svc .frames { display:block; }
.content.svc .dash { display:none; }
.frames iframe { position:absolute; inset:0; width:100%; height:100%; border:0; background:var(--bg); display:none; }
.frames iframe.on { display:block; }
.frame-msg { position:absolute; inset:0; display:flex; align-items:center; justify-content:center; text-align:center; padding:20px; color:var(--sub); }

/* ---------- 대시보드 ---------- */
.dash { position:absolute; inset:0; overflow-y:auto; padding:20px; container-type:inline-size; }
.hello { display:flex; align-items:flex-end; justify-content:space-between; gap:12px; flex-wrap:wrap; margin:0 0 16px; }
.hello h1 { margin:0; font-size:24px; letter-spacing:-.4px; }
.hello p { margin:2px 0 0; color:var(--sub); }
.cards { display:grid; grid-template-columns:repeat(auto-fill,minmax(290px,1fr)); gap:16px; align-items:start; }
.card { background:var(--card); border:1px solid var(--line); border-radius:16px; padding:14px 16px 16px; min-width:0; }
.card.wide { grid-column:span 2; }
@container (max-width: 640px) { .card.wide { grid-column:auto; } }
.card h2 { font-size:15px; margin:0 0 10px; display:flex; align-items:center; gap:8px; }
.card h2 .more { margin-left:auto; font-size:13px; font-weight:500; border:0; background:transparent; color:var(--accent); padding:2px 4px; }
.card .empty { color:var(--sub); font-size:14px; padding:6px 0; }
.card .err { color:var(--warn); font-size:14px; }
.skel { height:14px; border-radius:6px; background:linear-gradient(90deg,var(--line),var(--soft),var(--line)); background-size:200% 100%; animation:sk 1.2s infinite; margin:8px 0; }
@keyframes sk { to { background-position:-200% 0; } }
.list { list-style:none; margin:0; padding:0; }
.list li { display:flex; gap:10px; align-items:flex-start; padding:7px 0; border-top:1px solid var(--line); min-width:0; }
.list li:first-child { border-top:0; }
.list .main { flex:1; min-width:0; }
.list .t { font-weight:600; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.list .s { color:var(--sub); font-size:13px; overflow:hidden; text-overflow:ellipsis; }
.list button.link { all:unset; cursor:pointer; display:block; min-width:0; }
.list button.link:hover .t { color:var(--accent); }
.dot { width:9px; height:9px; border-radius:50%; flex:none; margin-top:7px; background:var(--fam); }
.dot.parents { background:var(--par); } .dot.me { background:var(--p0); } .dot.ext { background:#9a8f8b; }
.when { flex:none; color:var(--sub); font-size:13px; min-width:46px; }

/* 날씨 */
.wx { display:flex; align-items:center; gap:14px; }
.wx .big { font-size:42px; line-height:1; }
.wx .temp { font-size:30px; font-weight:800; }
.wx .desc { color:var(--sub); font-size:14px; }
.wx-days { display:grid; grid-template-columns:repeat(3,1fr); gap:6px; margin-top:12px; }
.wx-days div { background:var(--bg); border-radius:10px; padding:6px; text-align:center; font-size:13px; }
.wx-days b { display:block; font-size:20px; font-weight:400; }

/* 달력 */
.cal-head { display:flex; align-items:center; gap:6px; margin-bottom:8px; }
.cal-head b { flex:1; }
.cal-head button { border:1px solid var(--line); background:var(--card); border-radius:8px; padding:2px 10px; }
.cal { display:grid; grid-template-columns:repeat(7,1fr); gap:2px; }
.cal .wd { text-align:center; font-size:12px; color:var(--sub); padding:2px 0; }
.cal .wd:first-child, .cal .d.sun .n { color:#e5484d; }
.cal .wd:last-child, .cal .d.sat .n { color:#3b82f6; }
.cal .d { border:0; background:transparent; border-radius:10px; padding:4px 2px 6px; min-height:46px; display:flex; flex-direction:column; align-items:center; gap:2px; }
.cal .d:hover { background:var(--soft); }
.cal .d.out { opacity:.35; }
.cal .d.today .n { background:var(--accent); color:#fff !important; }
.cal .d.sel { background:var(--soft); outline:1.5px solid var(--accent); }
.cal .n { font-size:13px; width:24px; height:24px; border-radius:50%; display:flex; align-items:center; justify-content:center; font-weight:600; }
.cal .dots { display:flex; gap:2px; flex-wrap:wrap; justify-content:center; max-width:100%; }
.cal .dots i { width:5px; height:5px; border-radius:50%; background:var(--fam); }
.cal .dots i.parents { background:var(--par); } .cal .dots i.me { background:var(--p0); } .cal .dots i.ext { background:#9a8f8b; }
.cal-split { display:grid; grid-template-columns:minmax(0,1.2fr) minmax(0,1fr); gap:16px; }
@container (max-width: 760px) { .cal-split { grid-template-columns:1fr; } }
.day-title { font-weight:700; margin:0 0 4px; }

/* 공지 */
.notice-form { display:flex; flex-direction:column; gap:6px; margin-bottom:8px; }
.notice-form textarea { width:100%; resize:vertical; min-height:44px; border:1px solid var(--line); border-radius:10px; padding:8px 10px; font:inherit; background:var(--bg); color:var(--ink); }
.notice-form .opts { display:flex; gap:10px; align-items:center; flex-wrap:wrap; font-size:13px; color:var(--sub); }
.notice-form .opts label { display:flex; gap:4px; align-items:center; }
.btn { border:0; background:var(--accent); color:#fff; border-radius:10px; padding:6px 14px; font-weight:700; }
.btn.ghost { background:transparent; color:var(--accent); border:1px solid var(--line); }
.btn:disabled { opacity:.5; }
.notice .txt { white-space:pre-wrap; word-break:break-word; }
.notice .pin { color:var(--accent); }
.notice .x { border:0; background:transparent; color:var(--sub); padding:0 4px; }

/* 위치·하루 */
.person { display:flex; align-items:center; gap:10px; }
.person .avatar { width:34px; height:34px; }
.batt { font-size:12px; color:var(--sub); }
.summary { white-space:pre-wrap; font-size:14px; display:-webkit-box; -webkit-line-clamp:4; -webkit-box-orient:vertical; overflow:hidden; }
.progress { height:6px; background:var(--line); border-radius:6px; overflow:hidden; margin-top:4px; }
.progress i { display:block; height:100%; background:var(--ok); }
.todo-items { margin:4px 0 0; padding-left:18px; color:var(--sub); font-size:13px; }
.money { font-size:26px; font-weight:800; }
.money.neg { color:#e5484d; }
.kv { display:flex; justify-content:space-between; gap:8px; font-size:14px; padding:3px 0; }
.kv span:first-child { color:var(--sub); }

/* ---------- 톡 ---------- */
.talk-head { display:flex; align-items:center; gap:6px; padding:8px 8px 8px 12px; border-bottom:1px solid var(--line); min-height:50px; }
.talk-head b { flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.talk-body { flex:1; min-height:0; display:flex; flex-direction:column; }
.rooms { list-style:none; margin:0; padding:6px; overflow-y:auto; flex:1; }
.rooms li button { display:flex; gap:10px; align-items:center; width:100%; border:0; background:transparent; text-align:left; padding:8px; border-radius:12px; }
.rooms li button:hover { background:var(--soft); }
.rooms .ravatar { width:40px; height:40px; border-radius:14px; display:flex; align-items:center; justify-content:center; font-size:19px; background:var(--soft); flex:none; }
.rooms .rmain { flex:1; min-width:0; }
.rooms .rname { font-weight:700; display:flex; gap:6px; align-items:center; }
.rooms .rname span { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.rooms .rlast { color:var(--sub); font-size:13px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.rooms .rtime { color:var(--sub); font-size:12px; flex:none; align-self:flex-start; margin-top:2px; }
.rooms .sep { color:var(--sub); font-size:12px; padding:10px 8px 2px; }
.tl { flex:1; min-height:0; overflow-y:auto; padding:10px 12px; display:flex; flex-direction:column; gap:2px; }
.tl .older { align-self:center; font-size:13px; margin:4px 0 8px; }
.tl .daysep { align-self:center; color:var(--sub); font-size:12px; margin:10px 0 4px; background:var(--bg); border-radius:999px; padding:1px 10px; }
.msg { display:flex; flex-direction:column; align-items:flex-start; max-width:88%; margin-top:6px; }
.msg.cont { margin-top:1px; }
.msg.me { align-self:flex-end; align-items:flex-end; }
.msg .who { font-size:12px; color:var(--sub); margin:0 0 2px 4px; }
.msg .bub { background:var(--bg); border:1px solid var(--line); border-radius:16px; padding:7px 11px; white-space:pre-wrap; word-break:break-word; font-size:14px; max-width:100%; }
.msg.me .bub { background:linear-gradient(135deg,#FF8A6B,#E0559A); color:#fff; border-color:transparent; }
.msg.me .bub a { color:#fff; }
.msg.notice .bub { background:var(--soft); }
.msg .bub code { background:#0000000f; border-radius:4px; padding:0 3px; font-size:13px; }
.msg .meta { font-size:11px; color:var(--sub); margin:1px 6px 0; }
.msg img.pic { max-width:240px; max-height:260px; border-radius:12px; display:block; cursor:zoom-in; }
.msg.pending { opacity:.6; }
.msg.fail .meta { color:#e5484d; }
.composer { display:flex; gap:6px; align-items:flex-end; padding:8px; border-top:1px solid var(--line); }
.composer textarea { flex:1; resize:none; border:1px solid var(--line); border-radius:14px; padding:8px 12px; font:inherit; font-size:14px; max-height:140px; background:var(--bg); color:var(--ink); }
.composer .send { width:38px; height:38px; border-radius:50%; border:0; background:linear-gradient(135deg,#FF8A6B,#E0559A); color:#fff; font-size:16px; flex:none; }
.composer .attach { width:38px; height:38px; flex:none; }
.talk-msg { padding:24px 18px; text-align:center; color:var(--sub); }
.talk-msg .btn { margin-top:10px; }
.hint { color:var(--sub); font-size:12px; padding:0 12px 6px; }

/* ---------- 휴대폰 ---------- */
.only-mobile { display:none !important; }
.tabbar { position:fixed; inset:auto 0 0 0; height:58px; padding-bottom:env(safe-area-inset-bottom); background:var(--card); border-top:1px solid var(--line); z-index:30; }
.tabbar button { flex:1; border:0; background:transparent; display:flex; flex-direction:column; align-items:center; justify-content:center; font-size:12px; color:var(--sub); position:relative; }
.tabbar button span { font-size:19px; line-height:1.2; }
.tabbar button.on { color:var(--accent); font-weight:700; }
.tabbar .badge { position:absolute; top:4px; left:calc(50% + 6px); }
.scrim { display:none; }
.toast { position:fixed; left:50%; bottom:80px; transform:translateX(-50%); background:#2b2321; color:#fff; padding:9px 16px; border-radius:12px; z-index:60; font-size:14px; max-width:90vw; }

@media (max-width: 899px) {
  .only-mobile { display:inherit !important; }
  .only-mobile.tabbar { display:flex !important; }
  .only-desktop { display:none !important; }
  .shell { bottom:58px; }
  .nav { position:fixed; top:0; bottom:0; left:0; width:min(84vw,320px); z-index:50; transform:translateX(-105%); transition:transform .2s; box-shadow:4px 0 24px #0003; }
  .nav .nav-head { display:flex !important; }
  body.nav-open .nav { transform:none; }
  body.nav-open .shell { z-index:40; bottom:0; }
  body.nav-open .scrim { display:block; position:fixed; inset:0; background:#0006; z-index:45; }
  .talk { position:absolute; inset:0; width:auto !important; z-index:20; display:none; }
  body.tab-talk .talk { display:flex; }
  body.talk-off.tab-talk .talk { display:flex; }
  .dash { padding:14px; }
  .cards { grid-template-columns:1fr; }
  .uname { display:none; }
  .crumb { font-size:14px; }
}
