/* フクログ：黒をベースに、青とエメラルドのグラデーション */
:root {
  --bg: #05070c;
  --bg2: #0a0f19;
  --card: #0d1420;
  --card2: #111a29;
  --glass: rgba(16, 24, 38, 0.62);
  --line: rgba(120, 160, 230, 0.14);
  --line2: rgba(120, 160, 230, 0.26);
  --ink: #e9f0fc;
  --muted: #8797b2;
  --blue: #3b7bff;
  --em: #10e0a8;
  --grad: linear-gradient(135deg, #3b7bff 0%, #10e0a8 100%);
  --pos: #22e3a9;
  --neg: #ff6b8a;
  --warn: #ffb547;
  --tabs-h: 64px;
  --num: "Outfit", "Zen Kaku Gothic New", sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { font-size: clamp(14px, 4vw, 16px); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: "Zen Kaku Gothic New", "Hiragino Sans", "Yu Gothic", system-ui, sans-serif;
  line-height: 1.7;
  padding-bottom: calc(var(--tabs-h) + env(safe-area-inset-bottom) + 24px);
  -webkit-tap-highlight-color: transparent;
}
body.no-tabs { padding-bottom: calc(env(safe-area-inset-bottom) + 32px); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--em); outline-offset: 2px; }
.ic { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.ic .f { fill: currentColor; stroke: none; }
.pos { color: var(--pos); }
.neg { color: var(--neg); }
.hint { margin: 0; font-size: .8rem; color: var(--muted); line-height: 1.6; }
.center { text-align: center; }
.empty { margin: 0; padding: 28px 0; text-align: center; color: var(--muted); font-size: .9rem; }

/* ---------- ヘッダー ---------- */
.top {
  position: sticky; top: 0; z-index: 20;
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
  background: rgba(5, 7, 12, .78);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.top-title { display: flex; align-items: center; gap: 8px; min-width: 0; }
.top-title b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-title .ic { color: var(--em); }
.logo { display: inline-flex; align-items: center; gap: 8px; }
.logo svg { width: 26px; height: 26px; }
.logo b { font-weight: 700; letter-spacing: .06em; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.menu-btn { width: 40px; height: 40px; border: 1px solid var(--line2); border-radius: 12px; background: var(--card); display: grid; place-content: center; gap: 4px; padding: 0; }
.menu-btn span { display: block; width: 18px; height: 2px; border-radius: 2px; background: var(--ink); transition: transform .3s, opacity .3s; }
.menu-btn span:nth-child(2) { width: 12px; background: var(--em); }
.drawer-open .menu-btn span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.drawer-open .menu-btn span:nth-child(2) { opacity: 0; }
.drawer-open .menu-btn span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
.ynav { position: relative; display: flex; align-items: center; gap: 2px; border: 1px solid var(--line2); border-radius: 999px; padding: 2px; background: var(--card); }
.yarr { width: 30px; height: 30px; border: 0; background: none; border-radius: 50%; font-size: 1.1rem; color: var(--muted); }
.ycur { display: flex; align-items: baseline; gap: 1px; border: 0; background: none; padding: 4px 6px; border-radius: 999px; font-family: var(--num); font-weight: 600; font-size: .95rem; }
.ycur:hover, .ycur[aria-expanded="true"] { background: rgba(255, 255, 255, .06); }
.ycur small { font-size: .7rem; color: var(--muted); }
.ycur i { font-style: normal; font-size: .6rem; color: var(--em); margin-left: 4px; }
.ypop { position: absolute; right: 0; top: calc(100% + 8px); z-index: 30; width: 220px; max-height: 60vh; overflow-y: auto; padding: 6px; display: grid; gap: 2px; border-radius: 16px; background: var(--card); border: 1px solid var(--line2); box-shadow: 0 24px 48px -16px rgba(0, 0, 0, .8); }
.ypop[hidden] { display: none; }
.ypop p { margin: 0; padding: 6px 10px 4px; font-size: .72rem; color: var(--muted); }
.ypop button { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; padding: 10px 12px; border: 0; border-radius: 10px; background: none; text-align: left; }
.ypop button:hover { background: rgba(255, 255, 255, .05); }
.ypop button.on { background: linear-gradient(90deg, rgba(59, 123, 255, .22), rgba(16, 224, 168, .12)); box-shadow: inset 0 0 0 1px var(--line2); }
.ypop b { font-family: var(--num); font-weight: 600; }
.ypop em { font-style: normal; font-family: var(--num); font-size: .78rem; color: var(--muted); }
.ypop em.pos { color: var(--pos); } .ypop em.neg { color: var(--neg); }
.sample-bar { position: relative; z-index: 2; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px 12px; padding: 8px 16px; font-size: .78rem; text-align: center; color: #05070c; background: linear-gradient(90deg, #ffb547, #ffd27a); }
.sample-bar[hidden] { display: none; }
.sample-bar button { border: 0; background: rgba(5, 7, 12, .85); color: #ffd27a; font-size: .74rem; font-weight: 700; padding: 3px 12px; border-radius: 999px; white-space: nowrap; }

/* ---------- ハンバーガーメニュー ---------- */
.scrim { position: fixed; inset: 0; z-index: 30; background: rgba(0, 0, 0, .55); opacity: 0; pointer-events: none; transition: opacity .3s; }
.drawer {
  position: fixed; top: 0; bottom: 0; left: 0; z-index: 31;
  width: min(300px, 84vw);
  padding: calc(16px + env(safe-area-inset-top)) 12px calc(16px + env(safe-area-inset-bottom));
  background: linear-gradient(180deg, #0b1220, #070a12);
  border-right: 1px solid var(--line2);
  transform: translateX(-102%); transition: transform .35s cubic-bezier(.2, .8, .2, 1);
  overflow-y: auto; display: flex; flex-direction: column; gap: 4px;
}
.drawer::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 2px; background: var(--grad); opacity: .6; }
.drawer-open .scrim { opacity: 1; pointer-events: auto; }
.drawer-open .drawer { transform: none; }
.d-head { display: grid; gap: 2px; padding: 4px 10px 14px; }
.d-head small { color: var(--muted); font-size: .75rem; }
.d-label { font-size: .72rem; letter-spacing: .14em; color: var(--muted); padding: 12px 10px 4px; }
.d-sep { height: 1px; background: var(--line); margin: 10px 6px; }
.d-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 11px 12px; border: 0; border-radius: 12px; background: none; text-align: left; font-size: .95rem; transition: background .2s; }
.d-item span { flex: 1; min-width: 0; }
.d-item em { font-style: normal; font-family: var(--num); font-size: .85rem; }
.d-item .ic { color: var(--muted); }
.d-item:hover { background: rgba(255, 255, 255, .04); }
.d-item.on { background: linear-gradient(90deg, rgba(59, 123, 255, .2), rgba(16, 224, 168, .1)); box-shadow: inset 0 0 0 1px var(--line2); }
.d-item.on .ic { color: var(--em); }

/* ---------- 下のタブ（副業ごとの画面） ---------- */
.tabs {
  position: fixed; left: 0; right: 0; bottom: var(--badge-h, 0px); z-index: 10;
  display: grid; grid-template-columns: repeat(4, 1fr);
  height: calc(var(--tabs-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: rgba(7, 10, 17, .88);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
}
.no-tabs .tabs { display: none; }
.tabs button { position: relative; border: 0; background: none; display: grid; place-items: center; align-content: center; gap: 2px; color: var(--muted); font-size: .72rem; }
.tabs button .ic { width: 22px; height: 22px; }
.tabs button.on { color: var(--ink); }
.tabs button.on .ic { color: var(--em); }
.tabs button.on::before { content: ""; position: absolute; top: 0; left: 28%; right: 28%; height: 2px; border-radius: 2px; background: var(--grad); }
body.has-badge { --badge-h: 64px; padding-bottom: calc(var(--tabs-h) + 64px + env(safe-area-inset-bottom) + 16px); }
body.has-badge::after { content: ""; position: fixed; left: 0; right: 0; bottom: 0; height: 64px; background: var(--bg); z-index: 9; }
body.has-badge .tabs { padding-bottom: 0; height: var(--tabs-h); }
body.has-badge.no-tabs { padding-bottom: 96px; }

/* ---------- 副業ごとの画面（入力しやすさ優先） ---------- */
main { position: relative; z-index: 1; max-width: 640px; margin: 0 auto; padding: 16px; }
.scr { display: grid; gap: 14px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 16px; display: grid; gap: 12px; min-width: 0; }
.h { margin: 10px 2px 0; font-size: .95rem; }
.h0 { margin: 0; font-size: .92rem; font-weight: 700; }
.big { font-family: var(--num); font-size: 2rem; font-weight: 700; line-height: 1.1; }
.editing { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; border-radius: 12px; background: rgba(59, 123, 255, .12); border: 1px solid rgba(59, 123, 255, .35); font-size: .88rem; }
.link { border: 0; background: none; color: var(--em); font-weight: 700; padding: 4px; font-size: .85rem; }

.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; padding: 4px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); }
.seg button { border: 0; border-radius: 10px; padding: 10px; background: none; color: var(--muted); font-weight: 700; transition: background .2s, color .2s; }
.seg button.on { background: var(--grad); color: #05070c; }
.seg button.sell.on { background: linear-gradient(135deg, #ff6b8a, #ff9d6b); }
.seg button:disabled { cursor: default; }
.seg button:disabled:not(.on) { opacity: .35; }

.form { gap: 14px; }
.f { display: grid; gap: 6px; min-width: 0; }
.f > span:first-child { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: .82rem; font-weight: 500; color: var(--muted); }
.req { font-style: normal; font-size: .68rem; color: var(--em); border: 1px solid rgba(16, 224, 168, .4); border-radius: 999px; padding: 0 8px; margin-right: auto; margin-left: 6px; }
input, select, textarea {
  width: 100%; min-width: 0; max-width: 100%;
  padding: 11px 12px; border-radius: 12px;
  background: var(--bg2); border: 1px solid var(--line2);
  font-size: 1rem; line-height: 1.4;
  -webkit-appearance: none; appearance: none;
}
input[type="date"] { min-height: 46px; display: block; }
input[type="date"]::-webkit-date-and-time-value { text-align: left; }
input[type="checkbox"] { width: 20px; height: 20px; padding: 0; border-radius: 6px; flex: none; display: grid; place-content: center; }
input[type="checkbox"]:checked { background: var(--grad); border-color: transparent; }
input[type="checkbox"]:checked::after { content: "✓"; color: #05070c; font-size: 13px; font-weight: 700; }
select { background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 32px; }
textarea { resize: vertical; line-height: 1.6; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--em); box-shadow: 0 0 0 3px rgba(16, 224, 168, .15); }
::placeholder { color: #4d5b74; }
.yen-in { position: relative; display: block; }
.yen-in::before { content: "¥"; position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.yen-in input { padding-left: 26px; font-family: var(--num); }
.hm { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto; gap: 8px; align-items: center; }
.hm i { font-style: normal; font-size: .85rem; color: var(--muted); }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.code-name { grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); }
@media (max-width: 359px) { .grid3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid3 > :last-child { grid-column: 1 / -1; } }
.mini { border: 1px solid var(--line2); background: var(--card2); border-radius: 999px; padding: 2px 10px; font-size: .72rem; color: var(--em); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 13px 18px; border-radius: 14px; border: 1px solid var(--line2); background: var(--card2); font-weight: 700; font-size: .95rem; transition: transform .15s, box-shadow .2s, filter .2s; }
.btn:active { transform: scale(.98); }
.btn.primary { border: 0; background: var(--grad); color: #05070c; box-shadow: 0 8px 24px -10px rgba(16, 224, 168, .6); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; }
.btn.danger { background: transparent; color: var(--neg); border-color: rgba(255, 107, 138, .35); }
.btn.sm { padding: 7px 14px; font-size: .82rem; border-radius: 10px; }
.row-btns { display: flex; gap: 8px; justify-content: flex-end; }
.row-btns.wrap { flex-wrap: wrap; justify-content: flex-start; }
.row-btns.wrap .btn { flex: 1 1 140px; }
.row-btns.two { display: grid; grid-template-columns: 1fr 1fr; }
.row-btns .btn { white-space: nowrap; }
input[role="switch"] { position: relative; display: block; width: 48px; height: 28px; padding: 0; border-radius: 999px; background: var(--bg2); cursor: pointer; transition: background .2s; }
input[role="switch"]::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--muted); transition: transform .2s, background .2s; }
input[role="switch"]:checked { background: var(--grad); }
input[role="switch"]:checked::after { content: ""; transform: translateX(20px); background: #05070c; }
.danger-zone { display: flex; justify-content: center; padding-top: 4px; }
.danger-link { border: 0; background: none; padding: 6px 8px; font-size: .76rem; color: var(--neg); opacity: .75; text-decoration: underline; text-underline-offset: 3px; }
.danger-link:hover { opacity: 1; }

.rows { display: grid; gap: 6px; }
.row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; width: 100%; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--card); text-align: left; transition: border-color .2s; }
.row:hover { border-color: var(--line2); }
.r-date { font-family: var(--num); font-size: .8rem; color: var(--muted); }
.r-main { display: grid; min-width: 0; }
.r-main b { font-weight: 500; font-size: .92rem; }
.r-main small { font-size: .75rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row em { font-style: normal; font-family: var(--num); font-weight: 600; }

.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.stats.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 400px) { .stats.three { grid-template-columns: 1fr; } }
.stat { display: grid; gap: 2px; padding: 12px; border-radius: 12px; background: var(--bg2); border: 1px solid var(--line); min-width: 0; }
.stat small { font-size: .74rem; color: var(--muted); }
.stat b { font-family: var(--num); font-size: 1.15rem; font-weight: 600; overflow-wrap: anywhere; }
.stat span { font-size: .72rem; color: var(--muted); }
.mnav { display: flex; align-items: center; justify-content: space-between; padding: 4px; border-radius: 14px; border: 1px solid var(--line); background: var(--card); }
.mnav button { width: 40px; height: 36px; border: 0; background: none; color: var(--muted); font-size: 1.2rem; border-radius: 10px; }
.mnav b { font-size: .95rem; }
.month-sum { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; padding: 0 4px; font-size: .8rem; color: var(--muted); }
.month-sum b { font-family: var(--num); color: var(--ink); font-weight: 600; }
.month-sum b.pos { color: var(--pos); } .month-sum b.neg { color: var(--neg); }

.tbl { width: 100%; border-collapse: collapse; font-size: .88rem; }
.tbl th, .tbl td { padding: 10px 2px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl th { text-align: left; font-weight: 500; }
.tbl th small { display: block; font-size: .72rem; color: var(--muted); font-weight: 400; }
.tbl td { text-align: right; font-family: var(--num); white-space: nowrap; padding-left: 10px; }
.tbl tr.sum th, .tbl tr.sum td { border-bottom: 0; font-weight: 700; font-size: .95rem; }
.tbl tr.sum td { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.tbl-cols tr:first-child th, .tbl-cols tr:first-child td { font-size: .74rem; color: var(--muted); font-family: inherit; }

/* グラフ */
.bars { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 4px; align-items: end; }
.b { display: grid; gap: 4px; }
.b-track { position: relative; height: 130px; border-radius: 6px; background: rgba(255, 255, 255, .025); }
.bars.has-neg .b-track { background: linear-gradient(transparent calc(50% - .5px), var(--line2) calc(50% - .5px), var(--line2) calc(50% + .5px), transparent calc(50% + .5px)), rgba(255, 255, 255, .025); }
.b-track i { position: absolute; left: 12%; right: 12%; height: var(--h); border-radius: 4px; background: linear-gradient(0deg, var(--blue), var(--em)); transition: height .8s cubic-bezier(.2, .8, .2, 1) var(--d, 0ms); }
.b-track i.n { background: linear-gradient(180deg, #ff6b8a, #a1365a); }
.bars.pre .b-track i { height: 0; }
.b span { text-align: center; font-family: var(--num); font-size: .66rem; color: var(--muted); }
.hbars { display: grid; gap: 10px; }
.hb { display: grid; grid-template-columns: minmax(0, 7em) minmax(0, 1fr) auto; gap: 10px; align-items: center; font-size: .85rem; }
.hb-k { display: grid; overflow: hidden; }
.hb-k small { font-size: .7rem; color: var(--muted); }
.hb-bar { height: 8px; border-radius: 99px; background: rgba(255, 255, 255, .05); overflow: hidden; }
.hb-bar i { display: block; height: 100%; border-radius: 99px; background: var(--grad); }
.hb-bar i.n { background: linear-gradient(90deg, #a1365a, #ff6b8a); }
.hb b { font-family: var(--num); font-weight: 600; }

/* 項目の編集 */
.le-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.le-head h3 { margin: 0; font-size: .92rem; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px; border: 1px solid var(--line2); background: var(--bg2); font-size: .8rem; }
.chip i { font-style: normal; font-size: .66rem; color: var(--em); }
button.chip { color: var(--muted); transition: all .2s; }
button.chip.on { color: #05070c; background: var(--grad); border-color: transparent; font-weight: 700; }
.chips.sm .chip { padding: 2px 9px; font-size: .72rem; color: var(--muted); }
.chips.filter { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.chips.filter::-webkit-scrollbar { display: none; }
.chips.filter .chip { flex: none; }
.le-rows { display: grid; gap: 8px; }
.le-row { display: flex; align-items: center; gap: 8px; }
.le-row input:not([type]) { flex: 1; }
.chk { display: flex; align-items: center; gap: 6px; font-size: .75rem; color: var(--muted); white-space: nowrap; }
.x { width: 38px; height: 38px; flex: none; border-radius: 10px; border: 1px solid var(--line2); background: none; color: var(--muted); }
.le-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.le-foot span { display: flex; gap: 8px; }
.addtag { display: flex; gap: 8px; margin-top: 4px; }
.addtag input { padding: 7px 12px; font-size: .9rem; }

/* 株：取引ノート */
.preview { display: flex; flex-wrap: wrap; gap: 4px 16px; padding: 10px 12px; border-radius: 12px; background: rgba(59, 123, 255, .08); border: 1px dashed rgba(59, 123, 255, .4); font-size: .82rem; color: var(--muted); }
.preview b { font-family: var(--num); color: var(--ink); }
.preview b.pos { color: var(--pos); } .preview b.neg { color: var(--neg); }
.similar { display: grid; gap: 8px; padding: 14px; border-radius: 14px; background: linear-gradient(135deg, rgba(59, 123, 255, .1), rgba(16, 224, 168, .06)); border: 1px solid var(--line2); }
.similar h4 { display: flex; align-items: center; gap: 8px; margin: 0; font-size: .88rem; }
.similar h4 .ic { color: var(--em); }
.sim { padding: 10px 12px; border-radius: 10px; background: rgba(5, 7, 12, .5); display: grid; gap: 4px; font-size: .82rem; }
.sim p { margin: 0; color: var(--muted); }
.sim .sim-ref { color: var(--ink); border-left: 2px solid var(--em); padding-left: 8px; }
.sim-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sim-top time { font-family: var(--num); font-size: .72rem; color: var(--muted); }
.sim-top em { margin-left: auto; font-style: normal; font-family: var(--num); font-weight: 600; }
.side { font-size: .66rem; font-weight: 700; padding: 1px 8px; border-radius: 6px; background: rgba(59, 123, 255, .2); color: #8fb2ff; flex: none; }
.side.sell, .trade.sell .side { background: rgba(255, 107, 138, .16); color: #ff9db2; }
.search { position: relative; }
.search .ic { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); width: 18px; height: 18px; }
.search input { padding-left: 38px; }
#trade-list { display: grid; gap: 10px; }
.trade { display: grid; gap: 8px; padding: 14px; border-radius: 16px; background: var(--card); border: 1px solid var(--line); border-left: 3px solid var(--blue); }
.trade.sell { border-left-color: var(--neg); }
.trade header { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.trade header small { font-family: var(--num); color: var(--muted); font-size: .75rem; }
.trade header time { margin-left: auto; font-family: var(--num); font-size: .78rem; color: var(--muted); }
.t-nums { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font-family: var(--num); font-size: .9rem; }
.t-nums em { font-style: normal; font-weight: 700; font-size: 1.1rem; }
.t-meta { font-size: .74rem; color: var(--muted); }
.t-reason, .t-market, .t-reflect { margin: 0; font-size: .88rem; display: grid; gap: 2px; }
.t-reason span, .t-market span, .t-reflect span { font-size: .7rem; color: var(--muted); letter-spacing: .08em; }
.t-reflect { padding: 10px 12px; border-radius: 10px; background: rgba(16, 224, 168, .07); border: 1px solid rgba(16, 224, 168, .25); }
.t-reflect span { color: var(--em); }
.t-reflect small { font-size: .7rem; color: var(--muted); }
.t-act { display: flex; gap: 8px; justify-content: flex-end; }
.reflect-edit { display: grid; gap: 8px; }
.holds { display: grid; gap: 8px; }
.hold { display: grid; gap: 1px; padding: 10px 12px; border-radius: 12px; background: var(--bg2); border: 1px solid var(--line); font-size: .85rem; }
.hold b small { font-family: var(--num); font-weight: 400; color: var(--muted); margin-left: 8px; font-size: .75rem; }
.hold > small { color: var(--muted); font-size: .74rem; }
.nudge { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 14px; border: 1px solid rgba(16, 224, 168, .35); background: rgba(16, 224, 168, .07); text-align: left; font-size: .85rem; }
.nudge .ic { color: var(--em); }

/* 全体設定 */
.radios { display: grid; gap: 8px; }
.radio { display: grid; gap: 2px; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line2); background: var(--bg2); text-align: left; transition: border-color .2s, box-shadow .2s; }
.radio small { color: var(--muted); font-size: .76rem; }
.radio.on { border-color: var(--em); box-shadow: inset 0 0 0 1px var(--em), 0 0 24px -12px var(--em); }
.toggles { display: grid; }
.tog { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 2px; border-bottom: 1px solid var(--line); font-size: .9rem; }
.tog:last-child { border-bottom: 0; }
.tog span { display: flex; align-items: center; gap: 10px; }
.tog .ic { color: var(--muted); width: 18px; height: 18px; }
.tog small { font-size: .74rem; color: var(--muted); }
.notes { margin: 0; display: grid; gap: 4px; }
.notes dt { font-weight: 700; font-size: .88rem; margin-top: 8px; }
.notes dt:first-child { margin-top: 0; }
.notes dd { margin: 0; color: var(--muted); font-size: .82rem; line-height: 1.7; }

.modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px; background: rgba(0, 0, 0, .6); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.modal[hidden] { display: none; }
.m-box { width: min(420px, 100%); display: grid; gap: 12px; padding: 20px; border-radius: 18px; background: var(--card); border: 1px solid var(--line2); box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .8); }
.m-box h3, .m-box p { margin: 0; }
.m-box textarea { font-size: .8rem; font-family: ui-monospace, Menlo, monospace; }

.toast {
  position: fixed; left: 50%; bottom: calc(var(--tabs-h) + env(safe-area-inset-bottom) + var(--badge-h, 0px) + 16px); z-index: 60;
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  max-width: calc(100% - 32px); padding: 10px 18px; border-radius: 999px;
  background: #e9f0fc; color: #05070c; font-size: .85rem; font-weight: 700; text-align: center;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  transition: opacity .25s, transform .25s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.no-tabs .toast { bottom: calc(env(safe-area-inset-bottom) + var(--badge-h, 0px) + 24px); }

/* ---------- 全副業の管理（演出あり） ---------- */
#fx { position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: 0; transition: opacity .8s; }
.aurora { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; opacity: 0; transition: opacity .8s; }
.ov-mode #fx, .ov-mode .aurora { opacity: 1; }
.aurora i { position: absolute; border-radius: 50%; filter: blur(80px); opacity: .45; animation: drift 22s ease-in-out infinite alternate; }
.aurora i:nth-child(1) { width: 60vmax; height: 60vmax; left: -25vmax; top: -25vmax; background: radial-gradient(circle, #1d4ed8, transparent 65%); }
.aurora i:nth-child(2) { width: 55vmax; height: 55vmax; right: -25vmax; top: 15vh; background: radial-gradient(circle, #0ea37a, transparent 65%); animation-duration: 28s; animation-direction: alternate-reverse; }
.aurora i:nth-child(3) { width: 40vmax; height: 40vmax; left: 20vw; bottom: -20vmax; background: radial-gradient(circle, #1e3a8a, transparent 65%); animation-duration: 34s; }
@keyframes drift { to { transform: translate(8vmax, 6vmax) scale(1.15); } }

.ov { display: grid; gap: 16px; }
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s ease var(--d, 0ms), transform .7s cubic-bezier(.2, .8, .2, 1) var(--d, 0ms); }
.reveal.in { opacity: 1; transform: none; }
.grad-text { background: linear-gradient(100deg, #8fb2ff 0%, #ffffff 40%, #5ff0c6 80%); -webkit-background-clip: text; background-clip: text; color: transparent; }

@property --a { syntax: "<angle>"; initial-value: 0deg; inherits: false; }
.hero {
  position: relative; overflow: hidden; isolation: isolate;
  display: grid; gap: 10px; padding: 22px 20px 20px; border-radius: 24px;
  border: 1.5px solid transparent;
  background:
    radial-gradient(400px circle at var(--x, 80%) var(--y, 0%), rgba(16, 224, 168, .14), transparent 60%) padding-box,
    linear-gradient(160deg, #0d1626, #070b14) padding-box,
    conic-gradient(from var(--a), #3b7bff, #10e0a8, rgba(16, 224, 168, 0) 35%, rgba(59, 123, 255, 0) 65%, #3b7bff) border-box;
  animation: spin 6s linear infinite;
  box-shadow: 0 30px 60px -30px rgba(16, 224, 168, .35), 0 0 0 1px rgba(255, 255, 255, .02);
}
@keyframes spin { to { --a: 360deg; } }
.hero-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.eyebrow { font-size: .78rem; letter-spacing: .12em; color: var(--muted); }
.live { display: inline-flex; align-items: center; gap: 6px; font-size: .7rem; color: var(--em); }
.live::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--em); box-shadow: 0 0 0 0 rgba(16, 224, 168, .6); animation: ping 2s infinite; }
@keyframes ping { 70% { box-shadow: 0 0 0 8px rgba(16, 224, 168, 0); } 100% { box-shadow: 0 0 0 0 rgba(16, 224, 168, 0); } }
.hero-num { font-family: var(--num); font-weight: 700; font-size: clamp(2.3rem, 11vw, 3.4rem); line-height: 1.05; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.hero-split { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; padding-top: 12px; border-top: 1px solid var(--line); }
.hero-split div { display: grid; min-width: 0; }
.hero-split small { font-size: .7rem; color: var(--muted); }
.hero-split b { font-family: var(--num); font-size: .95rem; font-weight: 600; overflow-wrap: anywhere; }
.shine { position: absolute; inset: 0; z-index: -1; background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, .06) 45%, transparent 60%); transform: translateX(-100%); animation: sweep 5s ease-in-out infinite; }
@keyframes sweep { 0%, 40% { transform: translateX(-100%); } 80%, 100% { transform: translateX(100%); } }

.glass {
  position: relative; overflow: hidden;
  background: var(--glass);
  backdrop-filter: blur(16px) saturate(140%); -webkit-backdrop-filter: blur(16px) saturate(140%);
  border: 1px solid var(--line2); border-radius: 20px;
}
.glass::before { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(260px circle at var(--x, -100px) var(--y, -100px), rgba(59, 123, 255, .16), transparent 70%); transition: opacity .3s; }
.card-pad { padding: 18px; display: grid; gap: 14px; }
.ov-h { margin: 8px 2px -4px; font-size: 1rem; }
.ov-h3 { margin: 0; font-size: .92rem; }

.judge { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 16px 18px; align-items: center; padding: 18px; }
.ring { position: relative; width: 132px; height: 132px; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 9; }
.r-bg { stroke: rgba(255, 255, 255, .06); }
.ring::before { content: ""; position: absolute; inset: 6px; border-radius: 50%; box-shadow: 0 0 28px -6px rgba(16, 224, 168, .45), inset 0 0 24px -10px rgba(59, 123, 255, .5); }
.v-need .ring::before { box-shadow: 0 0 28px -6px rgba(255, 181, 71, .5); }
.r-fg { stroke: url(#g-ring); stroke-linecap: round; transition: stroke-dashoffset 1.6s cubic-bezier(.2, .8, .2, 1) .2s; }
.r-fg.over { stroke: var(--warn); }
.ring-c { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.ring-c small { font-size: .62rem; color: var(--muted); }
.ring-c b { font-family: var(--num); font-size: 1.05rem; font-weight: 700; }
.j-body { display: grid; gap: 6px; min-width: 0; }
.j-body h2 { margin: 0; font-size: 1.1rem; line-height: 1.4; }
.j-body p { margin: 0; font-size: .82rem; color: var(--muted); }
.j-left b { font-family: var(--num); color: var(--ink); }
.verdict { justify-self: start; position: relative; overflow: hidden; font-size: .72rem; font-weight: 700; padding: 3px 12px; border-radius: 999px; color: #05070c; background: var(--grad); }
.verdict::after { content: ""; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 35%, rgba(255, 255, 255, .6) 50%, transparent 65%); transform: translateX(-120%); animation: sweep 3s ease-in-out infinite; }
.v-need .verdict { background: linear-gradient(135deg, #ffb547, #ff7a59); }
.v-none .verdict { background: rgba(255, 255, 255, .12); color: var(--ink); }
.j-notes { grid-column: 1 / -1; margin: 0; padding: 12px 0 0; list-style: none; display: grid; gap: 6px; border-top: 1px solid var(--line); font-size: .8rem; color: var(--muted); }
.j-notes li { position: relative; padding-left: 16px; }
.j-notes li::before { content: ""; position: absolute; left: 2px; top: .65em; width: 6px; height: 6px; border-radius: 50%; background: var(--em); }
@media (max-width: 380px) { .judge { grid-template-columns: 1fr; justify-items: center; text-align: center; } .verdict { justify-self: center; } .j-notes { text-align: left; } }

.tcards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 360px) { .tcards { grid-template-columns: 1fr; } }
.tcard { display: grid; gap: 6px; padding: 14px; text-align: left; transition: transform .25s, border-color .25s, box-shadow .25s, opacity .7s ease var(--d, 0ms); }
.tcard:hover { transform: translateY(-3px); border-color: rgba(16, 224, 168, .45); box-shadow: 0 18px 40px -20px rgba(16, 224, 168, .45); }
.tcard:active { transform: scale(.98); }
.tc-top { display: flex; align-items: center; gap: 8px; min-width: 0; }
.tc-ic { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: linear-gradient(135deg, rgba(59, 123, 255, .25), rgba(16, 224, 168, .2)); color: var(--em); flex: none; }
.tc-ic .ic { width: 18px; height: 18px; }
.tc-name { display: grid; flex: 1; min-width: 0; font-size: .85rem; font-weight: 700; line-height: 1.3; }
.tc-name small { font-size: .66rem; color: var(--muted); font-weight: 400; }
.tc-go { color: var(--muted); font-size: 1.1rem; }
.tc-amt { font-family: var(--num); font-size: 1.25rem; font-weight: 700; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.tc-sub { font-size: .7rem; color: var(--muted); }
.spark { width: 100%; height: 30px; display: block; }
.spark polyline { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 1.8s cubic-bezier(.2, .8, .2, 1) .3s forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }

@media (min-width: 720px) {
  main { max-width: 760px; }
  .tcards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
  .spark polyline { stroke-dashoffset: 0; }
}

/* 手数料の自動計算 */
.fees { display: grid; gap: 8px; }
.fee-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 6px 10px; align-items: center; font-size: .85rem; }
.fee-row select { padding-top: 8px; padding-bottom: 8px; font-size: .85rem; }
.fee-v { grid-column: 2; display: flex; align-items: center; gap: 6px; }
.fee-v input { padding: 7px 10px; font-family: var(--num); }
.fee-v i { font-style: normal; font-size: .78rem; color: var(--muted); white-space: nowrap; }
.req { color: #8fb2ff; border-color: rgba(59, 123, 255, .45); }

/* 自分ルールと損切り・利確ライン */
.seg button.div.on { background: linear-gradient(135deg, #ffb547, #ffd27a); }
.rules { display: grid; gap: 8px; padding: 14px 16px; border-radius: 16px; border: 1px solid rgba(16, 224, 168, .35); background: linear-gradient(135deg, rgba(16, 224, 168, .08), rgba(59, 123, 255, .06)); }
.rules-head { display: flex; justify-content: space-between; align-items: center; }
.rules h4 { display: flex; align-items: center; gap: 8px; margin: 0; font-size: .9rem; }
.rules h4 .ic { color: var(--em); }
.rules ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 4px; font-size: .86rem; }
.rules li { position: relative; padding-left: 18px; }
.rules li::before { content: "✓"; position: absolute; left: 0; color: var(--em); font-weight: 700; }
.r-lines { display: flex; flex-wrap: wrap; gap: 4px 14px; padding-top: 8px; border-top: 1px dashed var(--line2); font-size: .82rem; color: var(--muted); }
.r-lines b { font-family: var(--num); }
.rule-chip { justify-self: start; font-size: .7rem; font-weight: 700; padding: 2px 10px; border-radius: 999px; border: 1px solid var(--line2); color: var(--muted); white-space: nowrap; }
.rule-chip.r-take { color: var(--pos); border-color: rgba(34, 227, 169, .4); }
.rule-chip.r-stop { color: var(--neg); border-color: rgba(255, 107, 138, .4); }
.rule-chip.r-inside { color: var(--warn); border-color: rgba(255, 181, 71, .4); }
.rule-check { margin: 8px 0 0; padding: 8px 12px; border-radius: 10px; font-size: .8rem; background: rgba(255, 181, 71, .1); color: #ffd27a; }
.rule-check.r-take, .rule-check.r-stop { background: rgba(16, 224, 168, .08); color: var(--pos); }
.pct-in { position: relative; display: block; }
.pct-in i { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); font-style: normal; color: var(--muted); }
.pct-in input { padding-right: 30px; font-family: var(--num); }

/* 保有中の銘柄 */
.hold { gap: 6px; }
.h-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.pill { font-size: .68rem; font-weight: 700; padding: 2px 10px; border-radius: 999px; background: rgba(255, 255, 255, .08); color: var(--muted); white-space: nowrap; }
.pill.neg { background: rgba(255, 107, 138, .16); color: var(--neg); }
.pill.pos { background: rgba(34, 227, 169, .14); color: var(--pos); }
.pill.warn { background: rgba(255, 181, 71, .16); color: var(--warn); }
.gauge { display: grid; gap: 4px; margin-top: 4px; }
.g-bar { position: relative; height: 8px; border-radius: 99px; background: linear-gradient(90deg, rgba(255, 107, 138, .55), rgba(255, 255, 255, .08) 50%, rgba(34, 227, 169, .55)); }
.g-bar i { position: absolute; top: 50%; width: 12px; height: 12px; margin-left: -6px; border-radius: 50%; transform: translateY(-50%); }
.g-avg { background: var(--card); border: 2px solid var(--muted); }
.g-now { background: var(--ink); box-shadow: 0 0 0 3px rgba(233, 240, 252, .25); }
.g-lbl { display: flex; justify-content: space-between; font-size: .7rem; }
.g-lbl em { font-style: normal; font-family: var(--num); }
.h-now { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 8px; font-size: .78rem; color: var(--muted); }
.h-now input { padding: 7px 10px 7px 26px; font-size: .9rem; }
.h-div { font-size: .78rem; color: var(--muted); }
.h-div b { font-family: var(--num); color: var(--ink); }
.h-edit { display: grid; gap: 8px; padding-top: 8px; border-top: 1px dashed var(--line2); }
.div-sum { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0 10px; align-items: baseline; padding-top: 10px; border-top: 1px solid var(--line); font-size: .82rem; color: var(--muted); }
.div-sum b { font-family: var(--num); font-size: 1.05rem; }
.div-sum small { grid-column: 1 / -1; font-size: .72rem; }
.side.div, .trade.div .side { background: rgba(255, 181, 71, .16); color: #ffd27a; }
.trade.div { border-left-color: var(--warn); }
.warn-txt { color: var(--warn); font-weight: 700; }
