/* 원본 디자인 + 최신 보정 통합 CSS */

:root{
  --bg-deep:#f2f4f8;--panel:#ffffff;--cell:#ffffff;--cell-hover:#f5f7fb;
  --gold:#2f6fed;--gold-bright:#1d4ed8;--gold-dim:#93c5fd;
  --line:rgba(15,23,42,.10);--line-soft:rgba(15,23,42,.07);
  --txt:#1f2937;--txt-dim:#5b6472;--txt-faint:#98a2b3;
  --sat:#2563eb;--sun:#e4483d;--up:#16a34a;--down:#dc2626;
  --radius:14px;--shadow:0 8px 24px rgba(15,23,42,.06);
}
*{box-sizing:border-box;margin:0;padding:0}
html,body{height:100%}
body{
  font-family:'Noto Sans KR',system-ui,sans-serif;color:var(--txt);
  background:var(--bg-deep);
  min-height:100vh;position:relative;overflow-x:hidden;overflow-y:scroll;
}
.wrap{position:relative;z-index:1;max-width:1200px;margin:0 auto;padding:22px 20px 40px}

/* Header */
.topbar{display:flex;gap:16px;align-items:center;flex-wrap:wrap;border:1px solid var(--line);border-radius:var(--radius);
  background:var(--panel);box-shadow:var(--shadow);padding:18px 26px;margin-bottom:18px;}
.brand-icon{width:52px;height:52px;flex:none;border-radius:14px;display:grid;place-items:center;font-size:24px;color:#fff;
  background:linear-gradient(135deg,#3b82f6,#1d4ed8);box-shadow:0 6px 16px rgba(37,99,235,.28)}
.brand{display:flex;flex-direction:column;justify-content:center;flex:1;min-width:220px}
.brand h1{font-weight:800;font-size:clamp(21px,3vw,29px);letter-spacing:-.5px;line-height:1.25;color:var(--txt)}
.brand p{margin-top:5px;color:var(--txt-faint);font-size:13px;letter-spacing:.2px;font-weight:600}

/* stat cards row */
.stat-row{display:flex;gap:14px;flex-wrap:wrap;margin-bottom:18px}
.stat-card{flex:1;min-width:158px;display:flex;gap:12px;align-items:flex-start;background:var(--panel);
  border:1px solid var(--line);border-radius:var(--radius);box-shadow:var(--shadow);padding:16px 18px}
.stat-card.wide{flex:1.7;min-width:230px}
.stat-icon{width:38px;height:38px;border-radius:10px;display:grid;place-items:center;font-size:18px;flex:none}
.stat-icon.c-blue{background:#eaf1ff;color:#2f6fed}
.stat-icon.c-amber{background:#fff4e0;color:#b8860b}
.stat-icon.c-indigo{background:#eef0ff;color:#5b5fc7}
.stat-icon.c-green{background:#e8f9ee;color:#16a34a}
.stat-icon.c-red{background:#fdeaea;color:#dc2626}
.stat-info{min-width:0;flex:1}
.stat-label{font-size:13px;color:var(--txt-dim);font-weight:700;display:flex;align-items:center;gap:5px;flex-wrap:wrap}
.stat-period{color:var(--txt-faint);font-weight:500;font-size:12px}
.stat-value{margin-top:5px;font-size:21px;font-weight:800;color:var(--txt);letter-spacing:-.2px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.stat-value.sm{font-size:18px}
.stat-value.up{color:var(--up)}.stat-value.down{color:var(--down)}
.stat-sub{margin-top:3px;font-size:12.5px;color:var(--txt-faint);font-weight:600}
.stat-conv{margin-top:3px;font-size:12.5px;color:#2f80ed;font-weight:700;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.stat-sub2{margin-top:2px;font-size:11.5px;color:var(--txt-faint)}
.edit-inline-btn{border:none;background:transparent;color:var(--txt-faint);cursor:pointer;font-size:12px;padding:0 2px;line-height:1;border-radius:4px}
.edit-inline-btn:hover{color:var(--txt);background:rgba(0,0,0,.06)}
.stat-value.manual{position:relative}
.stat-sub2.manual-tag{color:#b8860b;font-weight:700}
.stat-refresh{cursor:pointer;border:none;background:none;color:var(--txt-faint);font-size:13px;margin-left:2px;padding:0 2px}
.stat-refresh:hover{color:var(--gold)}
.stat-refresh.spin{animation:spin .8s linear infinite}
@keyframes spin{to{transform:rotate(360deg)}}
@media(max-width:900px){.stat-row{flex-direction:column}.stat-card,.stat-card.wide{flex:1 1 auto}}

.fs-banner{display:none;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;border:1px solid #fdba74;border-radius:12px;
  background:#fff7ed;padding:11px 18px;margin-bottom:18px;font-size:14.5px;color:#9a3412}
.fs-banner.show{display:flex}
.fs-banner b{color:#7c2d12}

.panel{border:1px solid var(--line);border-radius:var(--radius);background:var(--panel);box-shadow:var(--shadow);}
.main{display:flex;flex-direction:column;gap:18px}

/* calendar */
.cal-head{display:flex;align-items:center;justify-content:space-between;gap:14px;padding:15px 18px;border-bottom:1px solid var(--line-soft);flex-wrap:wrap}
.cal-title{display:flex;align-items:center;gap:10px;color:var(--txt);font-weight:800;font-size:17px}
.cal-title .lg{color:var(--txt-dim);font-weight:600;font-size:15px;margin-left:4px}
.nav{display:flex;align-items:stretch;gap:8px;flex-wrap:wrap}
.nav button{font-family:inherit;cursor:pointer;color:var(--txt-dim);border:1px solid var(--line);background:#f8fafc;border-radius:10px;
  padding:8px 13px;font-size:14.5px;transition:.15s;min-width:42px}
.nav button:hover{background:#eef2ff;color:var(--gold);border-color:var(--gold-dim)}
.nav .label-btn{display:flex;align-items:center;justify-content:center;gap:7px;font-weight:700;white-space:nowrap}
.nav .nav-step{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:1px;min-width:54px;padding:5px 11px}
.nav .nav-step .arrow{font-size:20px;line-height:1;font-weight:700;color:var(--txt)}
.nav .nav-step .caption{font-size:10.5px;line-height:1.2;color:var(--txt-faint);font-weight:600}
.view-toggle{display:flex;align-items:stretch;border:1px solid var(--line);background:#f8fafc;border-radius:11px;padding:3px;margin-left:2px}
.nav .view-btn{border:none;background:transparent;border-radius:8px;padding:7px 14px;min-width:auto;font-size:13.5px;font-weight:700;color:var(--txt-dim)}
.nav .view-btn:hover{border:none;background:#eef2ff;color:var(--gold)}
.nav .view-btn.active{background:linear-gradient(180deg,#3b82f6,#2563eb);color:#fff;box-shadow:0 3px 8px rgba(37,99,235,.2)}
.nav .view-btn.active:hover{color:#fff;background:linear-gradient(180deg,#3b82f6,#2563eb)}

.grid-days{display:grid;grid-template-columns:repeat(7,1fr);border-bottom:1px solid var(--line-soft)}
.grid-days div{text-align:center;padding:12px 0;font-size:14.5px;font-weight:700;color:var(--txt-faint)}
.grid-days div.sat{color:var(--sat)}.grid-days div.sun{color:var(--sun)}
.grid{display:grid;grid-template-columns:repeat(7,1fr)}
.cell{position:relative;min-height:112px;border-right:1px solid var(--line-soft);border-bottom:1px solid var(--line-soft);
  padding:9px 11px;cursor:pointer;transition:.12s;overflow:hidden;display:flex;flex-direction:column}
.cell:nth-child(7n){border-right:none}
.cell:hover{background:var(--cell-hover)}
.cell.out{opacity:.4;cursor:default}.cell.out:hover{background:transparent}
.cell-top{display:flex;align-items:center;justify-content:space-between;gap:6px;flex-wrap:wrap}
.cell .dnum{font-size:15.5px;font-weight:600;color:var(--txt)}
.cell.sat .dnum{color:var(--sat)}.cell.sun .dnum{color:var(--sun)}
.cell.today .dnum{background:linear-gradient(135deg,#3b82f6,#1d4ed8);color:#fff;font-weight:700;width:26px;height:26px;border-radius:50%;display:grid;place-items:center}
.cell .daybadge{background:#eef1f6;color:var(--txt-dim);font-size:11px;font-weight:700;padding:3px 8px;border-radius:20px;white-space:nowrap;cursor:pointer;transition:.15s}
.cell .daybadge:hover{background:#e2e8f5;color:var(--gold)}
.cell .pnl{margin-top:8px;font-size:16px;font-weight:700}
.cell .pnl.up{color:var(--up)}.cell .pnl.down{color:var(--down)}
.cell .pnl-krw{margin-top:2px;font-size:12px;font-weight:600;color:#5b9cff;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.cell .applied-rate{margin-top:2px;font-size:11px;font-weight:500;color:#a8b0bd;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.cell .tags{margin-top:auto;padding-top:6px;display:flex;gap:4px;flex-wrap:wrap;align-items:center}
.dot{width:7px;height:7px;border-radius:50%}
.cell .sumdot{position:absolute;top:11px;right:11px;color:var(--gold);font-size:12.5px}

/* bottom trio */
.trio{display:grid;grid-template-columns:1fr 1fr 1.3fr;gap:18px}
@media(max-width:900px){.trio{grid-template-columns:1fr}}
.mini-h{display:flex;align-items:center;gap:8px;color:var(--txt);font-weight:800;font-size:15.5px;padding:14px 16px 4px}
.mini-h .ic{font-size:18px}
.mini-h .addbtn{margin-left:auto;cursor:pointer;border:1px solid var(--line);background:#f8fafc;color:var(--gold);
  width:26px;height:26px;border-radius:8px;font-size:18px;line-height:1;display:grid;place-items:center;transition:.15s}
.mini-h .addbtn:hover{background:#eef2ff}
.sym-list{padding:10px 16px 16px;display:flex;flex-direction:column;gap:9px}
.sym{display:flex;align-items:center;gap:11px;border:1px solid var(--line-soft);border-radius:10px;padding:11px 14px;font-size:15px;font-weight:600;background:#f8fafc}
.sym .sd{width:11px;height:11px;border-radius:50%;flex:none}
.sym .sc{margin-left:auto;font-size:13px;color:var(--txt-faint);font-weight:500}
.sym .sx{cursor:pointer;background:none;border:none;color:var(--txt-faint);font-size:17px;padding:2px 5px;border-radius:6px}
.sym .sx:hover{color:var(--down);background:rgba(220,38,38,.08)}
.sym-empty{color:var(--txt-faint);font-size:14px;text-align:center;padding:14px 0;border:1px dashed var(--line-soft);border-radius:10px}
.addrow{display:flex;gap:8px;padding:0 16px 14px}
.addrow input{flex:1;font-family:inherit;font-size:14.5px;color:var(--txt);background:#f8fafc;border:1px solid var(--line-soft);border-radius:9px;padding:9px 11px}
.addrow input:focus{outline:none;border-color:var(--gold-dim)}

.summary-box{padding:12px 16px 16px}
.summary-box .sm-date{font-size:13px;color:var(--txt-dim);margin-bottom:8px}
.summary-box textarea{width:100%;min-height:132px;resize:vertical;font-family:inherit;font-size:15px;line-height:1.6;color:var(--txt);
  background:#f8fafc;border:1px solid var(--line-soft);border-radius:10px;padding:12px 14px}
.summary-box textarea:focus{outline:none;border-color:var(--gold-dim)}
.summary-box textarea::placeholder{color:var(--txt-faint)}
.creed{padding:8px 18px 18px;counter-reset:c}
.creed li{list-style:none;position:relative;padding:7px 0 7px 30px;font-size:14px;color:var(--txt-dim);line-height:1.5;border-bottom:1px dashed var(--line-soft)}
.creed li:last-child{border-bottom:none}
.creed li::before{counter-increment:c;content:counter(c);position:absolute;left:0;top:7px;width:20px;height:20px;border-radius:6px;font-size:12px;font-weight:700;
  display:grid;place-items:center;background:#eaf1ff;color:var(--gold);border:1px solid var(--line)}

/* Modal */
.overlay{position:fixed;inset:0;background:rgba(15,23,42,.45);backdrop-filter:blur(3px);z-index:100;display:none;padding:24px;overflow:auto}
.overlay.show{display:grid;place-items:start center}
.modal{width:100%;max-width:540px;margin-top:5vh;border:1px solid var(--line);border-radius:16px;background:#ffffff;box-shadow:0 30px 80px rgba(15,23,42,.2);animation:pop .18s ease}
@keyframes pop{from{transform:translateY(12px);opacity:0}to{transform:translateY(0);opacity:1}}
.modal-h{display:flex;align-items:center;justify-content:space-between;padding:18px 22px;border-bottom:1px solid var(--line-soft)}
.modal-h h3{color:var(--txt);font-size:18px;font-weight:800;display:flex;align-items:center;gap:9px}
.modal-h .x{cursor:pointer;background:none;border:none;color:var(--txt-dim);font-size:24.5px;line-height:1;padding:4px 8px;border-radius:8px}
.modal-h .x:hover{background:#f1f5f9;color:var(--txt)}
.modal-b{padding:20px 22px;max-height:74vh;overflow:auto}
.field{margin-bottom:15px}
.field label{display:block;font-size:14px;color:var(--txt-dim);margin-bottom:7px;font-weight:600}
.field input,.field select,.field textarea{width:100%;font-family:inherit;font-size:15px;color:var(--txt);background:#f8fafc;border:1px solid var(--line-soft);border-radius:10px;padding:11px 13px}
.field input:focus,.field select:focus,.field textarea:focus{outline:none;border-color:var(--gold-dim)}
.field textarea{min-height:74px;resize:vertical;line-height:1.6}
.result-pick{display:flex;gap:8px}
.result-pick .rbtn{flex:1;font-family:inherit;cursor:pointer;font-size:14.5px;font-weight:700;padding:10px 8px;border-radius:10px;
  border:1px solid var(--line-soft);background:#f8fafc;color:var(--txt-dim);transition:.15s}
.result-pick .rbtn:hover{border-color:var(--line)}
.result-pick .rbtn.win.active{background:#e8f9ee;border-color:#16a34a;color:#16a34a}
.result-pick .rbtn.loss.active{background:#fdeaea;border-color:#dc2626;color:#dc2626}
.result-pick .rbtn.even.active{background:#eef2ff;border-color:#94a3b8;color:#475569}

.direction-pick{display:flex;gap:8px}
.direction-pick .dbtn{flex:1;font-family:inherit;cursor:pointer;font-size:14.5px;font-weight:800;padding:10px 8px;border-radius:10px;border:1px solid var(--line-soft);background:#f8fafc;color:var(--txt-dim);transition:.15s}
.direction-pick .dbtn:hover{border-color:var(--line)}
.direction-pick .dbtn.buy.active{background:#e8f9ee;border-color:#16a34a;color:#16a34a}
.direction-pick .dbtn.sell.active{background:#fdeaea;border-color:#dc2626;color:#dc2626}
.trade .tdir{font-family:inherit;font-size:12px;font-weight:800;padding:7px 10px;border-radius:8px;border:1px solid var(--line-soft);background:#fff;cursor:pointer;display:inline-flex;align-items:center;justify-content:center;gap:4px;white-space:nowrap;line-height:1;writing-mode:horizontal-tb;min-width:64px;flex:0 0 auto}
.trade .tdir.buy{color:var(--up)}.trade .tdir.sell{color:var(--down)}
.trade .tpnl-edit{width:82px;font-family:inherit;font-size:14px;font-weight:700;text-align:right;background:#fff;border:1px solid var(--line-soft);border-radius:8px;padding:6px 8px}
.trade .tpnl-auto{min-width:82px;text-align:right;font-size:13px;font-weight:800;color:var(--txt-dim);white-space:nowrap}
.auto-calc-box{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:8px;padding:10px 12px;border:1px solid #dbeafe;border-radius:10px;background:#f8fbff;font-size:13px;color:#475569}
.auto-calc-box b{font-size:15px;color:#0f172a}
.auto-result{font-weight:800}.auto-result.win{color:var(--up)}.auto-result.loss{color:var(--down)}.auto-result.even{color:#64748b}
.trade .tpnl-edit:focus,.trade .tmemo-edit:focus{outline:none;border-color:var(--gold-dim);box-shadow:0 0 0 3px rgba(47,111,237,.08)}
.trade-memo-box{margin-top:7px;border:1px solid var(--line-soft);border-radius:10px;background:#f8fafc;padding:9px 11px 10px;transition:.15s}
.trade-memo-box:focus-within{border-color:var(--gold-dim);background:#fff;box-shadow:0 0 0 3px rgba(47,111,237,.07)}
.trade-memo-label{display:flex;align-items:center;gap:5px;margin-bottom:5px;font-size:11.5px;font-weight:800;color:var(--txt-faint)}
.tmemo-edit{display:block;width:100%;min-height:46px;max-height:110px;resize:vertical;font-family:inherit;font-size:13px;line-height:1.55;color:var(--txt);background:transparent;border:0!important;border-radius:0;padding:0;outline:0!important;box-shadow:none!important;appearance:none;-webkit-appearance:none}
.tmemo-edit::placeholder{color:#b0b8c5}
.tmemo-edit:focus,.tmemo-edit:focus-visible{outline:0!important;border:0!important;box-shadow:none!important;background:transparent}
.trade .tresult{margin-left:8px;font-family:inherit;font-size:11.5px;font-weight:700;padding:4px 10px;border-radius:20px;white-space:nowrap;cursor:pointer;border:1px solid transparent;transition:.15s}
.trade .tresult:hover{filter:brightness(.95)}
.trade .tresult.win{background:#e8f9ee;color:#16a34a}
.trade .tresult.loss{background:#fdeaea;color:#dc2626}
.trade .tresult.even{background:#eef2ff;color:#475569}
.sym-pick{display:flex;gap:8px}
.sym-pick select{flex:1}
.sym-pick .addsym{cursor:pointer;border:1px solid var(--line);background:#eaf1ff;color:var(--gold);border-radius:10px;width:46px;font-size:21.5px;transition:.15s}
.sym-pick .addsym:hover{background:#dbe8ff}
.add-sym-row{display:none;gap:8px;margin-top:9px}
.add-sym-row.show{display:flex}
.add-sym-row input{flex:1}
.btn{font-family:inherit;cursor:pointer;font-size:15px;font-weight:700;padding:12px 18px;border-radius:11px;border:1px solid #2563eb;
  background:linear-gradient(180deg,#3b82f6,#2563eb);color:#fff;transition:.15s}
.btn:hover{filter:brightness(1.08)}
.btn.ghost{background:transparent;color:var(--txt-dim);border-color:var(--line-soft)}
.btn.ghost:hover{color:var(--txt);border-color:var(--line)}
.btn.sm{padding:9px 14px;font-size:14px}
.btn.danger{background:transparent;border-color:rgba(220,38,38,.4);color:var(--down)}
.btn.danger:hover{background:rgba(220,38,38,.08)}
.btn-row{display:flex;gap:10px;justify-content:flex-end;margin-top:8px}
.day-total{display:flex;align-items:center;justify-content:space-between;padding:12px 15px;border-radius:11px;background:#eef2ff;border:1px solid var(--line-soft);margin-bottom:16px}
.day-total .lbl{font-size:14px;color:var(--txt-dim);font-weight:700}
.day-total.up .v{color:var(--up)}
.day-total.down .v{color:var(--down)}
.day-total .v{font-weight:800;font-size:20px}
.day-total .v .v-krw{font-size:14px;font-weight:600;color:inherit;margin-left:8px}
.tlist{margin:4px 0 18px;display:flex;flex-direction:column;gap:9px}
.trade-wrap{display:flex;flex-direction:column}
.trade{display:flex;align-items:center;gap:10px;border:1px solid var(--line-soft);border-radius:11px;padding:11px 12px;background:#f8fafc;max-width:100%;min-width:0;overflow:hidden}
.trade>*{min-width:0}
.trade-wrap{min-width:0;max-width:100%;overflow:hidden}
.trade-memo-box{max-width:100%;min-width:0}
.trade .tsym{display:flex;align-items:center;gap:8px;font-weight:600;font-size:15px}
.trade .tsym .sd{width:9px;height:9px;border-radius:50%}
.trade .sd{width:9px;height:9px;border-radius:50%;flex:none}
.trade select.tsym-edit{font-family:inherit;font-weight:600;font-size:14px;color:var(--txt);background:#f0f3f8;border:1px solid var(--line-soft);border-radius:8px;padding:6px 8px;cursor:pointer;max-width:150px}
.trade select.tsym-edit:focus{outline:none;border-color:var(--gold-dim)}

.trade .ttime-edit{font-family:inherit;font-size:13px;color:var(--txt);background:#f8fafc;border:1px solid var(--line-soft);border-radius:8px;padding:6px 7px;width:92px;flex:none}
.trade .ttime-edit:focus{outline:none;border-color:var(--gold-dim);box-shadow:0 0 0 3px rgba(47,111,237,.08)}
.nextday-check{display:flex;align-items:center;gap:8px;margin-top:8px;font-size:13px;font-weight:700;color:var(--txt-muted);cursor:pointer;user-select:none}.nextday-check input{width:16px;height:16px;accent-color:#2f6fed}.nextday-badge{display:block;width:max-content;margin:0 auto 3px;padding:2px 6px;border-radius:6px;background:#eef4ff;color:#2f6fed;font-size:10px;line-height:1.15;font-weight:800;white-space:nowrap}.day-time-cell{text-align:center;white-space:nowrap;line-height:1.15;font-variant-numeric:tabular-nums}.tnext-edit{height:30px;padding:0 8px;border:1px solid var(--line-soft);border-radius:8px;background:#fff;color:var(--txt-muted);font:700 11px inherit;cursor:pointer;white-space:nowrap}.tnext-edit.active{border-color:#8bb3ff;background:#eef4ff;color:#2f6fed}
.day-table .symbol-cell{white-space:normal;line-height:1.2}
.day-table .symbol-name{display:block;font-weight:700;color:#0f172a}
.day-table .symbol-code{display:block;margin-top:3px;font-size:11px;color:#64748b;font-weight:600}

/* unified dropdown styling — 기능은 기존 select 그대로 유지 */
.field select,
.trade select.tsym-edit{
  appearance:none;
  -webkit-appearance:none;
  cursor:pointer;
  padding-right:42px;
  background-color:#f8fafc;
  background-image:
    linear-gradient(45deg,transparent 50%,#64748b 50%),
    linear-gradient(135deg,#64748b 50%,transparent 50%),
    linear-gradient(to right,rgba(15,23,42,.08),rgba(15,23,42,.08));
  background-position:
    calc(100% - 18px) 50%,
    calc(100% - 13px) 50%,
    calc(100% - 36px) 50%;
  background-size:5px 5px,5px 5px,1px 22px;
  background-repeat:no-repeat;
  transition:border-color .15s,box-shadow .15s,background-color .15s;
}
.field select:hover,
.trade select.tsym-edit:hover{
  border-color:var(--gold-dim);
  background-color:#f4f7ff;
}
.field select:focus,
.trade select.tsym-edit:focus{
  outline:none;
  border-color:var(--gold);
  box-shadow:0 0 0 3px rgba(47,111,237,.10);
  background-color:#fff;
}
.field select option,
.trade select.tsym-edit option{
  color:var(--txt);
  background:#fff;
  font-family:'Noto Sans KR',system-ui,sans-serif;
  font-size:14px;
}
.trade .tpnl{margin-left:auto;font-weight:700;font-size:15.5px}
.tpnl.up{color:var(--up)}.tpnl.down{color:var(--down)}
.trade .tdel{cursor:pointer;background:none;border:none;color:var(--txt-faint);font-size:18px;padding:4px 6px;border-radius:6px}
.trade .tdel:hover{color:var(--down);background:rgba(220,38,38,.08)}
.trade .tmemo{width:100%;font-size:13px;color:var(--txt-faint);margin-top:3px}
.empty{color:var(--txt-faint);font-size:14.5px;text-align:center;padding:22px 0;border:1px dashed var(--line-soft);border-radius:11px;margin-bottom:16px}
.guide p{font-size:15px;line-height:1.8;color:var(--txt-dim);margin-bottom:10px}
.guide b{color:var(--gold)}
.toast{position:fixed;bottom:26px;left:50%;transform:translateX(-50%) translateY(20px);z-index:200;background:#1f2937;border:1px solid #111827;color:#fff;
  padding:11px 20px;border-radius:12px;font-size:15px;font-weight:600;opacity:0;transition:.25s;pointer-events:none;box-shadow:0 12px 30px rgba(15,23,42,.25)}
.toast.show{opacity:1;transform:translateX(-50%) translateY(0)}
::-webkit-scrollbar{width:10px;height:10px}
::-webkit-scrollbar-thumb{background:rgba(15,23,42,.15);border-radius:6px}
::-webkit-scrollbar-track{background:transparent}


/* ===== Dashboard split layout (reference UI) ===== */
body{background:linear-gradient(135deg,#edf3fa 0%,#f8fbff 52%,#eef4fb 100%);}
.wrap{max-width:none;width:100%;padding:16px 18px 18px;}
.dashboard-shell{display:grid;grid-template-columns:minmax(0,2.05fr) minmax(360px,.95fr);gap:16px;align-items:start;}
.dashboard-left{min-width:0;}
.dashboard-right{min-width:0;position:sticky;top:16px;height:calc(100vh - 32px);}
.topbar{padding:18px 28px;margin-bottom:14px;min-height:108px;border-radius:14px;}
.brand-icon{width:54px;height:54px;border-radius:13px;}
.brand h1{font-size:clamp(22px,2.2vw,31px);}
.stat-row{display:grid;grid-template-columns:1.45fr 1fr 1fr 1fr;gap:12px;margin-bottom:14px;}
.stat-card,.stat-card.wide{min-width:0;padding:15px 17px;}
.stat-value{font-size:23px}.stat-value.sm{font-size:19px}
.main{gap:14px}.cal-head{padding:14px 18px}.cell{min-height:134px;padding:11px 10px;}
.grid-days div{padding:11px 0}.panel{border-radius:13px}
.trio{display:grid !important;}

.day-side{height:100%;display:flex;flex-direction:column;background:rgba(255,255,255,.97);border:1px solid var(--line);border-radius:14px;box-shadow:0 10px 28px rgba(15,23,42,.08);overflow:hidden;}
.day-side-head{display:flex;align-items:center;gap:12px;padding:22px 22px 18px;border-bottom:1px solid var(--line-soft);flex:none;}
.day-side-icon{width:38px;height:38px;border-radius:10px;display:grid;place-items:center;background:#eaf1ff;color:#2f6fed;font-size:21px;flex:none;}
.day-side-title{font-weight:900;font-size:21px;letter-spacing:-.4px;color:#111827;flex:1;}
.day-side-close{border:none;background:transparent;font-size:31px;line-height:1;color:#334155;cursor:pointer;padding:2px 5px;border-radius:8px;}
.day-side-close:hover{background:#f1f5f9}
.day-side-body{padding:18px 20px 20px;display:flex;flex-direction:column;gap:16px;flex:1;min-height:0;overflow-y:auto;overflow-x:hidden;overscroll-behavior:contain;}
.day-kpi{border:1px solid #cfe0ff;border-radius:12px;background:linear-gradient(180deg,#f7fbff,#f4f8ff);padding:20px 22px;}
.day-kpi-label{font-size:17px;font-weight:800;color:#334155;margin-bottom:7px;}
.day-kpi-value{font-size:34px;font-weight:900;letter-spacing:-.6px;color:var(--up);}
.day-kpi-value.down{color:var(--down)}
.day-kpi-conv{margin-top:3px;font-size:15px;font-weight:800;color:#2f80ed;}
.day-kpi-meta{margin-top:9px;font-size:15px;color:#334155;line-height:1.8}.day-kpi-meta b{color:#111827}.day-kpi-meta .up{color:var(--up);font-weight:800}.day-kpi-meta .down{color:var(--down);font-weight:800}
.day-table-wrap{border:1px solid var(--line-soft);border-radius:12px;background:#fff;max-height:min(46vh,520px);overflow-y:auto;overflow-x:hidden;overscroll-behavior:contain;scrollbar-gutter:auto;}
.day-table-wrap .day-table thead{position:sticky;top:0;z-index:2;}
.day-table{width:100%;border-collapse:collapse;table-layout:fixed;font-size:13px;}
.day-table th{background:#f5f7fb;color:#475569;font-weight:800;padding:13px 10px;border-bottom:1px solid var(--line-soft);}
.day-table td{padding:12px 10px;border-bottom:1px solid var(--line-soft);text-align:center;color:#0f172a;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.day-table tr:last-child td{border-bottom:none}.day-table .memo{text-align:left}.day-table .up{color:var(--up);font-weight:800}.day-table .down{color:var(--down);font-weight:800}.day-table .buy{color:var(--up);font-weight:800}.day-table .sell{color:var(--down);font-weight:800}
.day-empty{padding:28px 18px;text-align:center;color:var(--txt-faint);font-size:14px;}
.day-memo{border:1px solid var(--line-soft);border-radius:12px;background:#fbfcff;padding:15px 16px;}
.day-memo-head{display:flex;align-items:center;gap:9px;font-size:16px;font-weight:800;color:#111827;margin-bottom:12px}.day-memo-head .spacer{flex:1}.day-memo-edit{border:1px solid #bcd2ff;background:#fff;color:#2563eb;border-radius:8px;padding:7px 11px;font-family:inherit;font-weight:700;cursor:pointer}.day-memo-edit:hover{background:#f4f8ff}
.day-memo-text{min-height:64px;white-space:pre-wrap;color:#334155;font-size:14px;line-height:1.8;}
.day-actions{display:flex;justify-content:flex-end;gap:8px}.day-actions .btn{padding:10px 14px;font-size:13px}
.cell.selected-day{outline:2px solid #2f6fed;outline-offset:-2px;background:#f6f9ff;}


/* ===== Weekly view ===== */
.week-view{display:none;background:#fff;}
body.week-mode .dashboard-shell{grid-template-columns:1fr;}
body.week-mode .dashboard-right{display:none;}
body.week-mode .grid-days,body.week-mode #grid{display:none;}
body.week-mode .week-view{display:block;}
body.week-mode .cal-title #cal-label{font-size:18px;font-weight:800;color:#111827;margin-left:12px;}
.week-days{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));border-top:1px solid var(--line-soft);border-bottom:1px solid var(--line-soft);}
.week-day{min-width:0;border-right:1px solid var(--line-soft);cursor:pointer;background:#fff;transition:.15s;}
.week-day:last-child{border-right:none}.week-day:hover{background:#f8fbff}.week-day.selected{outline:2px solid #2f6fed;outline-offset:-2px;background:#f5f9ff;}
.week-day.weekend-empty{cursor:default;background:#fff}.week-day.weekend-empty:hover{background:#fff}.week-day.weekend-empty.selected{outline:none;background:#fff;}
.week-day-head{text-align:center;padding:14px 6px 11px;border-bottom:1px solid var(--line-soft);font-weight:800;color:#0f172a;line-height:1.45;}
.week-day-head .dow{display:block;font-size:15px}.week-day-head .date{display:block;font-size:14px}.week-day.sun .week-day-head,.week-day.sun .week-day-head .dow,.week-day.sun .week-day-head .date{color:#ef4444!important}.week-day.sat .week-day-head,.week-day.sat .week-day-head .dow,.week-day.sat .week-day-head .date{color:#1683ff!important}
.week-day-main{padding:11px 10px 14px;text-align:center;min-height:176px;display:flex;flex-direction:column;justify-content:center;align-items:center;}
.week-count{width:100%;border-radius:9px;background:linear-gradient(180deg,#f7f9fc,#f2f5f9);padding:10px 6px;margin-bottom:10px;font-size:14px;font-weight:700;color:#334155;}
.week-pnl{font-size:20px;font-weight:900;letter-spacing:-.25px;color:#0f172a;white-space:nowrap}.week-pnl.up{color:var(--up)}.week-pnl.down{color:var(--down)}
.week-conv{margin-top:4px;color:#1683ff;font-size:13px;font-weight:800;white-space:nowrap}
.week-metrics{display:grid;grid-template-columns:150px repeat(7,minmax(0,1fr));border-bottom:1px solid var(--line-soft);font-size:13px;}
.week-metrics>div{padding:10px 8px;border-right:1px solid var(--line-soft);border-top:1px solid var(--line-soft);text-align:center;min-width:0}.week-metrics>div:nth-child(8n){border-right:none}
.week-metrics .label{text-align:left;font-weight:800;color:#172554;padding-left:16px;background:#fbfcff}.week-metrics .up{color:var(--up)}.week-metrics .down{color:var(--down)}
.week-metrics .metric-head{background:#f8fafc;font-weight:800;color:#334155;line-height:1.35;padding-top:9px;padding-bottom:9px}
.week-metrics .metric-head .metric-dow{display:block;font-size:13px}
.week-metrics .metric-head .metric-date{display:block;margin-top:2px;font-size:11px;font-weight:600;color:#94a3b8}
.week-metrics .metric-head.sun .metric-dow,.week-metrics .metric-head.sun .metric-date{color:#ef4444}
.week-metrics .metric-head.sat .metric-dow,.week-metrics .metric-head.sat .metric-date{color:#1683ff}
.week-day-head .dow{font-size:16px!important;font-weight:900}
.week-day-head .date{margin-top:2px;font-size:12px!important;color:#64748b}
.week-day.sun .week-day-head .date{color:#ef4444!important}.week-day.sat .week-day-head .date{color:#1683ff!important}
.week-note{margin:14px 16px 16px;border:1px solid #bfdbfe;background:#eff6ff;border-radius:10px;padding:12px 16px;display:flex;gap:12px;align-items:flex-start;color:#1e3a8a;line-height:1.55;font-size:13px}.week-note .info{width:28px;height:28px;border-radius:50%;display:grid;place-items:center;background:#1683ff;color:#fff;font-weight:900;flex:none}.week-note b{display:block;color:#1683ff;font-size:14px;margin-bottom:2px}
@media(max-width:900px){.week-view{overflow-x:auto}.week-days,.week-metrics{min-width:900px}}

@media(max-width:1180px){
  .dashboard-shell{grid-template-columns:1fr;}
  .dashboard-right{position:relative;top:auto;height:auto;}
  .stat-row{grid-template-columns:repeat(2,1fr)}
}
@media(max-width:700px){
  .wrap{padding:10px}.topbar{padding:15px 18px;min-height:auto}.stat-row{grid-template-columns:1fr}.cell{min-height:105px}.dashboard-right{display:block}.day-side-title{font-size:18px}
}


/* weekly applied FX rate */
.week-rate{margin-top:5px;font-size:11px;font-weight:600;color:var(--txt-faint);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.weekend-empty .week-day-main{display:none}


/* weekly weekend header colors */
.week-day-head.sun, .week-day-head.sun .week-dow, .week-day-head.sun .week-date { color:#ff2d2d !important; }
.week-day-head.sat, .week-day-head.sat .week-dow, .week-day-head.sat .week-date { color:#1683ff !important; }
.week-col.sun .week-dow, .week-col.sun .week-date { color:#ff2d2d !important; }
.week-col.sat .week-dow, .week-col.sat .week-date { color:#1683ff !important; }

/* ===== Full day detail page ===== */
.day-expand-btn{border:1px solid #bfdbfe;background:#eff6ff;color:#1d4ed8;border-radius:9px;padding:8px 11px;font-family:inherit;font-size:12px;font-weight:800;cursor:pointer;white-space:nowrap}
.day-expand-btn:hover{background:#dbeafe;border-color:#93c5fd}
.day-detail-page{display:none;min-height:100vh;padding:22px;background:linear-gradient(135deg,#edf3fa 0%,#f8fbff 52%,#eef4fb 100%)}
body.day-detail-mode{overflow-y:auto}
body.day-detail-mode>.wrap{display:none}
body.day-detail-mode>.day-detail-page{display:block}
.day-detail-shell{width:min(1500px,100%);margin:0 auto;display:flex;flex-direction:column;gap:18px}
.day-detail-top{display:flex;align-items:center;gap:18px;flex-wrap:wrap;background:#fff;border:1px solid var(--line);border-radius:16px;padding:20px 24px;box-shadow:var(--shadow)}
.day-detail-back{width:34px;height:34px;display:grid;place-items:center;border:0;background:transparent;color:#94a3b8;border-radius:50%;padding:0;font:500 23px/1 inherit;cursor:pointer;opacity:.72;transition:.15s}
.day-detail-back:hover{background:#f1f5f9;color:#475569;opacity:1}
.day-detail-title-wrap{display:flex;align-items:center;gap:13px;flex:1;min-width:280px}
.day-detail-icon{width:48px;height:48px;border-radius:12px;display:grid;place-items:center;background:#eaf1ff;color:#2f6fed;font-size:24px}
.day-detail-eyebrow{font-size:11px;font-weight:900;letter-spacing:1.2px;color:#94a3b8;margin-bottom:3px}
.day-detail-title-wrap h2{font-size:25px;line-height:1.3;color:#0f172a;letter-spacing:-.4px}
.day-detail-kpi{display:grid;grid-template-columns:minmax(280px,.8fr) minmax(360px,1.2fr);gap:28px;align-items:center;background:linear-gradient(180deg,#f8fbff,#f2f7ff);border:1px solid #cfe0ff;border-radius:16px;padding:26px 30px}
.day-detail-total{font-size:44px;font-weight:900;letter-spacing:-1px;color:var(--up);line-height:1.15}.day-detail-total.down{color:var(--down)}
.day-detail-meta{font-size:16px;color:#334155;line-height:2;border-left:1px solid #dbeafe;padding-left:28px}.day-detail-meta b{color:#111827}.day-detail-meta .up{color:var(--up);font-weight:800}.day-detail-meta .down{color:var(--down);font-weight:800}
.day-detail-card{background:#fff;border:1px solid var(--line);border-radius:16px;box-shadow:var(--shadow);overflow:hidden}
.day-detail-card-head{display:flex;align-items:center;gap:12px;padding:18px 22px;border-bottom:1px solid var(--line-soft)}
.day-detail-card-head h3{font-size:18px;color:#111827}.day-detail-card-head>span{margin-left:auto;color:#64748b;font-size:13px;font-weight:800}.day-detail-card-head .day-memo-edit{margin-left:auto}
.day-detail-table-wrap{overflow-x:auto;overflow-y:visible}
.day-detail-table{width:100%;border-collapse:collapse;table-layout:fixed;font-size:14px}
.day-detail-table th{background:#f8fafc;color:#475569;font-weight:800;padding:14px 16px;border-bottom:1px solid var(--line-soft);text-align:center}.day-detail-table th:nth-child(1){width:11%}.day-detail-table th:nth-child(2){width:18%}.day-detail-table th:nth-child(3){width:11%}.day-detail-table th:nth-child(4){width:11%}.day-detail-table th:nth-child(5){width:16%}.day-detail-table th:nth-child(6){width:33%;text-align:left}
.day-detail-table td{padding:15px 16px;border-bottom:1px solid var(--line-soft);text-align:center;color:#0f172a;vertical-align:middle}.day-detail-table tr:last-child td{border-bottom:none}.day-detail-table td.memo{text-align:left;white-space:normal;line-height:1.65;word-break:break-word}.day-detail-table .up,.day-detail-table .buy{color:var(--up);font-weight:800}.day-detail-table .down,.day-detail-table .sell{color:var(--down);font-weight:800}
.day-detail-empty{padding:44px 20px;text-align:center;color:#94a3b8;font-size:15px}
.day-detail-memo{min-height:120px;padding:22px 24px;white-space:pre-wrap;color:#334155;font-size:15px;line-height:1.9;word-break:break-word}
.day-detail-actions{display:flex;align-items:center;gap:9px;flex-wrap:wrap}
.day-detail-stats{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}
.day-detail-stat{background:#fff;border:1px solid var(--line);border-radius:14px;padding:16px 18px;box-shadow:var(--shadow);text-align:center}
.day-detail-stat-label{font-size:13px;font-weight:800;color:#64748b}
.day-detail-stat-value{margin-top:5px;font-size:28px;font-weight:900;color:#0f172a}.day-detail-stat-value.win{color:var(--up)}.day-detail-stat-value.loss{color:var(--down)}
body.day-capture-mode .day-detail-actions,body.day-capture-mode .day-detail-back,body.day-capture-mode #detail-memo-edit{display:none!important}
body.day-capture-mode .day-detail-page{padding:22px!important}
body.day-capture-mode .day-detail-card,body.day-capture-mode .day-detail-top{box-shadow:0 4px 14px rgba(15,23,42,.08)!important}
@media(max-width:760px){.day-detail-stats{grid-template-columns:repeat(3,1fr)}.day-detail-stat{padding:13px 8px}.day-detail-stat-value{font-size:23px}}
@media(max-width:760px){.day-detail-page{padding:10px}.day-detail-top{padding:16px}.day-detail-kpi{grid-template-columns:1fr;padding:20px}.day-detail-meta{border-left:0;border-top:1px solid #dbeafe;padding:18px 0 0}.day-detail-total{font-size:36px}.day-detail-table{min-width:760px}.day-expand-btn{padding:7px 9px}}

/* 월간/주간 고화질 캡처 */
.capture-btn{display:inline-flex;align-items:center;gap:6px;height:36px;padding:0 13px;border:1px solid #bfdbfe;border-radius:9px;background:#eff6ff;color:#1d4ed8;font:inherit;font-size:13px;font-weight:800;cursor:pointer;white-space:nowrap;transition:.15s}
.capture-btn:hover{background:#dbeafe;border-color:#93c5fd}
.capture-btn:disabled{opacity:.55;cursor:wait}
body.capture-mode .dashboard-right{position:relative!important;top:auto!important;height:auto!important}
body.capture-mode .day-side-body{overflow:visible!important;max-height:none!important}
body.capture-mode .wrap{overflow:visible!important}
body.capture-mode #capture-excluded-tools{display:none!important}
body.capture-mode #btn-capture{visibility:hidden!important}
body.capture-mode .dashboard-shell{align-items:start!important}
body.capture-mode .dashboard-left{min-width:0!important}
body.capture-mode .panel,body.capture-mode .day-side{box-shadow:0 4px 14px rgba(15,23,42,.08)!important}
.capture-toast{position:fixed;right:22px;bottom:22px;z-index:99999;padding:11px 15px;border-radius:10px;background:#0f172a;color:#fff;font-size:13px;font-weight:700;box-shadow:0 8px 24px rgba(15,23,42,.22);opacity:0;pointer-events:none;transform:translateY(8px);transition:.2s}
.capture-toast.show{opacity:1;transform:translateY(0)}
@media(max-width:900px){.capture-btn{height:34px;padding:0 10px;font-size:12px}}

/* 매매 기록 추가/수정: 모든 항목을 한 줄에 표시 */
.trade{
  flex-wrap:nowrap !important;
  overflow:visible !important;
  gap:8px !important;
}
.trade .ttime-edit{width:92px;flex:0 0 92px}
.trade select.tsym-edit{width:150px;max-width:150px;flex:0 1 150px}
.trade .tdir{flex:0 0 auto;white-space:nowrap}
.trade .tpnl-edit{width:100px;flex:0 0 100px}
.trade .tresult{flex:0 0 auto;white-space:nowrap;margin-left:0}
.trade .tdel{flex:0 0 auto}
.trade-wrap{overflow:visible !important}
@media(max-width:1180px){
  .trade{overflow-x:auto !important;scrollbar-width:thin}
}

/* 2026-09 session form visibility / Windows desktop polish */
#ov-day .modal{max-width:760px;width:min(760px,calc(100vw - 40px))}
#ov-day .modal-b{max-height:78vh;padding:22px 24px}
#ov-day .tlist{overflow:visible}
#ov-day .trade-wrap{overflow:visible !important}
#ov-day .trade{
  display:grid !important;
  grid-template-columns:104px minmax(150px,1fr) auto 110px auto 38px;
  align-items:center;
  gap:8px !important;
  overflow:visible !important;
  padding:11px 12px;
}
#ov-day .trade .sd{display:none}
#ov-day .trade .ttime-edit{width:104px;min-width:104px;box-sizing:border-box;font-size:14px;padding:7px 8px}
#ov-day .trade select.tsym-edit{width:100%;max-width:none;min-width:150px}
#ov-day .trade .tpnl-edit{width:110px;min-width:110px;box-sizing:border-box}
#ov-day .trade .tdir,#ov-day .trade .tresult,#ov-day .trade .tdel{white-space:nowrap}

/* 익일 거래 체크박스: 기존 폼 분위기에 맞춘 토글형 디자인 */
#ov-day .nextday-check{
  width:max-content;display:flex;align-items:center;gap:9px;margin-top:9px;
  padding:8px 11px;border:1px solid var(--line-soft);border-radius:9px;
  background:#f8fafc;color:var(--txt-dim);font-size:13px;font-weight:700;
}
#ov-day .nextday-check input{
  appearance:none;-webkit-appearance:none;width:32px;height:18px;margin:0;
  border-radius:999px;background:#cbd5e1;position:relative;cursor:pointer;
  transition:.15s;flex:none;
}
#ov-day .nextday-check input::after{
  content:"";position:absolute;width:14px;height:14px;left:2px;top:2px;
  border-radius:50%;background:#fff;box-shadow:0 1px 3px rgba(15,23,42,.25);transition:.15s;
}
#ov-day .nextday-check input:checked{background:#2f6fed}
#ov-day .nextday-check input:checked::after{transform:translateX(14px)}

@media(max-width:820px){
  #ov-day .modal{width:calc(100vw - 24px)}
  #ov-day .trade{display:flex !important;overflow-x:auto !important;min-width:0}
  #ov-day .trade .sd{display:block}
}

/* 거래 수정 목록 너비 미세 조정: 시간 확대 / 종목 축소 */
#ov-day .trade{
  grid-template-columns:128px minmax(125px,.85fr) auto 110px auto 38px;
}
#ov-day .trade .ttime-edit{
  width:128px;min-width:128px;padding:7px 10px;
}
#ov-day .trade select.tsym-edit{
  min-width:125px;max-width:145px;
}

/* 포인트 + 실현손익 한 줄 입력 */
#ov-day .point-pnl-row{display:grid;grid-template-columns:1fr 1fr;gap:12px;align-items:end}
#ov-day .point-pnl-col{min-width:0}
#ov-day .point-pnl-col label{display:block;font-size:14px;color:var(--txt-dim);margin-bottom:7px;font-weight:600}
#ov-day #f-pnl-preview[readonly]{background:#f1f5f9;color:#0f172a;font-weight:800;cursor:default;user-select:text}
#ov-day .point-pnl-hint{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-top:8px;padding:7px 10px;border:1px solid #dbeafe;border-radius:9px;background:#f8fbff;font-size:12.5px;color:#64748b}
@media(max-width:560px){#ov-day .point-pnl-row{grid-template-columns:1fr}}

/* 거래 삭제 버튼: 한 줄 오른쪽 끝의 미니멀 × 버튼 */
#ov-day .trade{
  grid-template-columns:128px minmax(125px,.85fr) auto 88px 92px auto 30px !important;
}
#ov-day .trade .tpnl-edit{width:88px;min-width:88px}
#ov-day .trade .tpnl-auto{white-space:nowrap;text-align:right;font-size:13px;font-weight:800;color:#475569}
#ov-day .trade .tdel{
  width:28px;height:28px;min-width:28px;padding:0;
  display:grid;place-items:center;align-self:center;
  border:0;border-radius:7px;background:transparent;
  color:#b0b8c5;font:500 20px/1 Arial,sans-serif;
  cursor:pointer;opacity:.72;transition:.15s;
}
#ov-day .trade .tdel:hover{
  color:#dc2626;background:#fee2e2;opacity:1;
}
#ov-day .trade .tdel:focus-visible{
  outline:2px solid #fecaca;outline-offset:2px;color:#dc2626;
}
@media(max-width:820px){
  #ov-day .trade .tdel{flex:0 0 28px}
}
