/* ===========================================================
   音声カッター — momintools.tech
   プロオーディオ機材のような暗色ワークスペース。
   ライト/ダークどちらも [data-theme] で切り替わる。
   =========================================================== */

:root {
  color-scheme: dark;

  --bg:        #0d0f14;
  --bg-glow:   radial-gradient(1200px 600px at 50% -10%, rgba(76, 141, 255, .13), transparent 62%);
  --panel:     #14171e;
  --panel-2:   #191d26;
  --elev:      #1f2430;
  --elev-2:    #272d3b;
  --line:      rgba(255, 255, 255, .075);
  --line-2:    rgba(255, 255, 255, .14);

  --tx:        #eef1f7;
  --tx-2:      #a4acbd;
  --tx-3:      #6d7588;

  --blue:      #4c8dff;
  --blue-soft: rgba(76, 141, 255, .16);
  --accent:    #f69946;
  --accent-2:  #ffb268;
  --green:     #37d29a;
  --red:       #ff5f57;

  --wave-top:  #83b4ff;
  --wave-bot:  #5d97f2;
  --wave-rms:  #2a63c4;
  --lane-bg:   #10131a;
  --sel-fill:  rgba(76, 141, 255, .17);
  --sel-line:  rgba(120, 172, 255, .85);
  --ruler-bg:  #12151c;

  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 18px;

  --shadow-1: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-2: 0 10px 34px rgba(0, 0, 0, .45);
  --shadow-pop: 0 24px 70px rgba(0, 0, 0, .6);

  --ease: cubic-bezier(.4, 0, .2, 1);
  --font: 'Inter', 'Noto Sans JP', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --mono: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace;
}

[data-theme="light"] {
  color-scheme: light;

  --bg:        #eef0f5;
  --bg-glow:   radial-gradient(1200px 600px at 50% -10%, rgba(19, 73, 138, .10), transparent 62%);
  --panel:     #ffffff;
  --panel-2:   #f7f8fb;
  --elev:      #f0f2f7;
  --elev-2:    #e4e8f0;
  --line:      rgba(10, 20, 40, .09);
  --line-2:    rgba(10, 20, 40, .18);

  --tx:        #131726;
  --tx-2:      #545a6d;
  --tx-3:      #878ea1;

  --blue:      #1f6fe0;
  --blue-soft: rgba(31, 111, 224, .12);
  --accent:    #e8852e;
  --accent-2:  #f69946;

  --wave-top:  #8fbcf7;
  --wave-bot:  #6ea6ef;
  --wave-rms:  #1a5cb8;
  --lane-bg:   #f4f6fa;
  --sel-fill:  rgba(31, 111, 224, .13);
  --sel-line:  rgba(31, 111, 224, .8);
  --ruler-bg:  #eceff5;

  --shadow-1: 0 1px 2px rgba(16, 30, 60, .08);
  --shadow-2: 0 10px 30px rgba(16, 30, 60, .10);
  --shadow-pop: 0 24px 70px rgba(16, 30, 60, .22);
}

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

html, body { height: 100%; }

body {
  font-family: var(--font);
  background: var(--bg);
  background-image: var(--bg-glow);
  background-repeat: no-repeat;
  color: var(--tx);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  transition: background-color .3s var(--ease), color .3s var(--ease);
}

a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; color: inherit; }
.ic { width: 18px; height: 18px; flex: none; stroke-width: 1.75; }
.hide { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- App shell ---------- */
.app { min-height: 100dvh; display: flex; flex-direction: column; }

.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 16px;
  height: 56px; padding: 0 18px;
  background: color-mix(in srgb, var(--panel) 86%, transparent);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--line);
}

.brand { display: inline-flex; align-items: center; gap: 9px; font-weight: 700; letter-spacing: -.02em; font-size: 15px; }
.brand:hover .brand-text { color: var(--tx); }
.brand-mark {
  width: 22px; height: 22px; border-radius: 7px; flex: none;
  background: linear-gradient(135deg, var(--blue), #7db1ff 55%, var(--accent));
  box-shadow: 0 2px 8px rgba(76, 141, 255, .35);
}
.brand-text { color: var(--tx-2); transition: color .2s var(--ease); }
.brand-text b { color: var(--tx); font-weight: 700; }
.brand-accent { color: var(--accent); }

.topbar-div { width: 1px; height: 22px; background: var(--line-2); flex: none; }

.apptitle { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.apptitle h1 { font-size: 15px; font-weight: 650; letter-spacing: -.01em; white-space: nowrap; }
.apptitle .sub { font-size: 12px; color: var(--tx-3); white-space: nowrap; }

.topbar-spacer { flex: 1; }

.chip-privacy {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11.5px; font-weight: 600; letter-spacing: .01em;
  padding: 5px 11px; border-radius: 999px;
  color: var(--green);
  background: color-mix(in srgb, var(--green) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--green) 26%, transparent);
}
.chip-privacy .ic { width: 13px; height: 13px; }

.iconbtn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 10px;
  background: transparent; border: 1px solid transparent; color: var(--tx-2);
  cursor: pointer; transition: all .18s var(--ease);
}
.iconbtn:hover { background: var(--elev); color: var(--tx); border-color: var(--line); }
.iconbtn:active { transform: scale(.94); }
.iconbtn.on { background: var(--blue-soft); color: var(--blue); border-color: color-mix(in srgb, var(--blue) 35%, transparent); }

/* ---------- Drop stage ---------- */
.stage-drop {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 48px 22px 64px; text-align: center;
}
.hero-eyebrow {
  font-size: 12px; font-weight: 650; letter-spacing: .16em; text-transform: uppercase;
  color: var(--blue); margin-bottom: 14px;
}
.hero-title {
  font-size: clamp(30px, 5.2vw, 46px); font-weight: 700; letter-spacing: -.035em; line-height: 1.15;
}
.hero-title .grad {
  background: linear-gradient(105deg, var(--blue), #8ab6ff 40%, var(--accent-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-lead { margin: 14px auto 0; max-width: 560px; color: var(--tx-2); font-size: 15px; line-height: 1.75; }

.dropzone {
  margin-top: 34px; width: min(760px, 100%);
  border: 1.5px dashed var(--line-2); border-radius: var(--r-lg);
  background: linear-gradient(180deg, color-mix(in srgb, var(--panel) 70%, transparent), var(--panel));
  padding: 46px 26px 40px; cursor: pointer;
  transition: border-color .22s var(--ease), background .22s var(--ease), transform .22s var(--ease), box-shadow .22s var(--ease);
  position: relative; overflow: hidden;
}
.dropzone::after {
  content: ''; position: absolute; inset: 0; pointer-events: none; opacity: 0;
  background: radial-gradient(420px 200px at 50% 0%, var(--blue-soft), transparent 70%);
  transition: opacity .25s var(--ease);
}
.dropzone:hover, .dropzone.over { border-color: color-mix(in srgb, var(--blue) 60%, transparent); transform: translateY(-2px); box-shadow: var(--shadow-2); }
.dropzone:hover::after, .dropzone.over::after { opacity: 1; }

.dz-bars { display: flex; align-items: flex-end; justify-content: center; gap: 4px; height: 46px; margin-bottom: 20px; }
.dz-bars i {
  display: block; width: 4px; border-radius: 2px;
  background: linear-gradient(180deg, var(--wave-top), var(--wave-bot));
  animation: dzb 1.5s var(--ease) infinite alternate;
}
@keyframes dzb { from { height: 9px; opacity: .5; } to { height: 100%; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .dz-bars i { animation: none; } }

.dz-title { font-size: 17px; font-weight: 650; letter-spacing: -.01em; }
.dz-sub { margin-top: 7px; font-size: 13.5px; color: var(--tx-3); }
.dz-btn {
  margin-top: 20px; display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 22px; border-radius: 999px; border: none; cursor: pointer;
  font-size: 14.5px; font-weight: 650; color: #fff;
  background: linear-gradient(180deg, #5b96ff, var(--blue));
  box-shadow: 0 6px 18px rgba(76, 141, 255, .32), inset 0 1px 0 rgba(255, 255, 255, .25);
  transition: transform .16s var(--ease), box-shadow .2s var(--ease), filter .2s var(--ease);
}
.dz-btn:hover { transform: translateY(-1px); filter: brightness(1.06); }
.dz-btn:active { transform: scale(.98); }

.fmt-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 22px; }
.fmt-chips span {
  font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
  padding: 4px 10px; border-radius: 6px; color: var(--tx-3);
  background: var(--elev); border: 1px solid var(--line);
}

.hero-feats {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px;
  width: min(760px, 100%); margin-top: 26px;
}
.feat {
  text-align: left; padding: 16px 16px 15px; border-radius: var(--r-md);
  background: color-mix(in srgb, var(--panel) 55%, transparent); border: 1px solid var(--line);
}
.feat .ic { color: var(--blue); margin-bottom: 8px; }
.feat h3 { font-size: 13.5px; font-weight: 650; letter-spacing: -.01em; }
.feat p { font-size: 12.5px; color: var(--tx-3); line-height: 1.65; margin-top: 3px; }

/* ---------- Editor ---------- */
.editor { flex: 1; display: grid; grid-template-columns: minmax(0, 1fr) 336px; gap: 16px; padding: 16px 18px 22px; align-items: start; }

.stage { display: flex; flex-direction: column; gap: 12px; min-width: 0; }

.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-md);
  box-shadow: var(--shadow-1);
}

/* toolbar */
.toolbar { display: flex; align-items: center; gap: 10px; padding: 9px 12px; flex-wrap: wrap; }

.filechip { display: flex; align-items: center; gap: 9px; min-width: 0; padding-right: 4px; }
.filechip .fc-icon {
  width: 30px; height: 30px; border-radius: 9px; flex: none; display: grid; place-items: center;
  background: var(--blue-soft); color: var(--blue);
}
.filechip .fc-name { font-size: 13px; font-weight: 600; max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.filechip .fc-meta { font-size: 11px; color: var(--tx-3); font-family: var(--mono); letter-spacing: -.01em; }

.tb-spacer { flex: 1; }
.tb-group { display: flex; align-items: center; gap: 2px; padding: 2px; background: var(--elev); border: 1px solid var(--line); border-radius: 10px; }
.tb-group .iconbtn { width: 30px; height: 28px; border-radius: 8px; }
.tb-group .iconbtn:hover { background: var(--elev-2); }
.tb-group .iconbtn:disabled { opacity: .3; cursor: default; background: transparent; }

.togglebtn {
  display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 11px;
  border-radius: 9px; border: 1px solid var(--line); background: var(--elev);
  color: var(--tx-2); font-size: 12.5px; font-weight: 600; cursor: pointer;
  transition: all .18s var(--ease); white-space: nowrap;
}
.togglebtn:hover { background: var(--elev-2); color: var(--tx); }
.togglebtn.on { background: var(--blue-soft); border-color: color-mix(in srgb, var(--blue) 40%, transparent); color: var(--blue); }
.togglebtn .ic { width: 15px; height: 15px; }

/* viewer */
.viewer { padding: 10px 10px 8px; display: flex; flex-direction: column; gap: 0; user-select: none; }

.overview-wrap { position: relative; border-radius: var(--r-sm); overflow: hidden; border: 1px solid var(--line); background: var(--lane-bg); }
#cvOverview { display: block; width: 100%; height: 44px; cursor: pointer; }

.wave-wrap { position: relative; margin-top: 9px; border-radius: var(--r-sm); overflow: hidden; border: 1px solid var(--line); background: var(--lane-bg); }
#cvRuler { display: block; width: 100%; height: 26px; cursor: text; background: var(--ruler-bg); }
#cvWave  { display: block; width: 100%; height: clamp(230px, 44vh, 460px); touch-action: none; cursor: crosshair; }
#cvWave.grabbing { cursor: grabbing; }
#cvWave.resize-h { cursor: ew-resize; }

.wave-empty {
  position: absolute; inset: 26px 0 0 0; display: grid; place-items: center;
  font-size: 13px; color: var(--tx-3); pointer-events: none;
}

/* horizontal scrollbar */
.hscroll { height: 12px; margin-top: 8px; border-radius: 999px; background: var(--elev); position: relative; cursor: pointer; }
.hscroll-thumb {
  position: absolute; top: 2px; bottom: 2px; left: 0; width: 40%;
  border-radius: 999px; background: var(--elev-2); border: 1px solid var(--line-2);
  transition: background .18s var(--ease);
}
.hscroll:hover .hscroll-thumb { background: color-mix(in srgb, var(--blue) 45%, var(--elev-2)); }

/* transport */
.transport { display: flex; align-items: center; gap: 14px; padding: 10px 14px; flex-wrap: wrap; }
.tp-buttons { display: flex; align-items: center; gap: 7px; }

.playbtn {
  width: 46px; height: 46px; border-radius: 50%; border: none; cursor: pointer;
  display: grid; place-items: center; color: #fff;
  background: linear-gradient(180deg, #5b96ff, var(--blue));
  box-shadow: 0 5px 16px rgba(76, 141, 255, .35), inset 0 1px 0 rgba(255, 255, 255, .25);
  transition: transform .15s var(--ease), filter .2s var(--ease);
}
.playbtn:hover { filter: brightness(1.08); }
.playbtn:active { transform: scale(.94); }
.playbtn .ic { width: 21px; height: 21px; }

.tpbtn {
  width: 36px; height: 36px; border-radius: 10px; cursor: pointer;
  border: 1px solid var(--line); background: var(--elev); color: var(--tx-2);
  display: grid; place-items: center; transition: all .18s var(--ease);
}
.tpbtn:hover { background: var(--elev-2); color: var(--tx); }
.tpbtn:active { transform: scale(.94); }
.tpbtn.on { background: var(--blue-soft); border-color: color-mix(in srgb, var(--blue) 40%, transparent); color: var(--blue); }
.tpbtn:disabled { opacity: .35; cursor: default; }

.timecode { font-family: var(--mono); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.tc-now { font-size: 25px; font-weight: 600; color: var(--tx); line-height: 1.1; }
.tc-total { font-size: 12px; color: var(--tx-3); margin-top: 1px; }

.vol { display: flex; align-items: center; gap: 8px; color: var(--tx-3); min-width: 150px; }

input[type=range] {
  -webkit-appearance: none; appearance: none; height: 4px; border-radius: 999px;
  background: var(--elev-2); outline: none; cursor: pointer; flex: 1; min-width: 70px;
}
input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; width: 15px; height: 15px; border-radius: 50%;
  background: #fff; border: 1px solid rgba(0, 0, 0, .2); box-shadow: 0 1px 4px rgba(0, 0, 0, .4); cursor: grab;
}
input[type=range]::-moz-range-thumb {
  width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 1px solid rgba(0, 0, 0, .2); cursor: grab;
}
input[type=range]:focus-visible { box-shadow: 0 0 0 3px var(--blue-soft); }

/* ---------- Sidebar ---------- */
.sidebar { display: flex; flex-direction: column; gap: 12px; min-width: 0; }

.panel { padding: 14px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.panel-title {
  font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--tx-3);
  display: inline-flex; align-items: center; gap: 7px;
}
.panel-title .ic { width: 13px; height: 13px; }

.selgrid { display: grid; grid-template-columns: auto 1fr; gap: 8px 10px; align-items: center; }
.selgrid label { font-size: 12px; color: var(--tx-3); }
.tcinput {
  width: 100%; height: 32px; padding: 0 10px; border-radius: var(--r-sm);
  background: var(--elev); border: 1px solid var(--line);
  font-family: var(--mono); font-size: 13px; font-variant-numeric: tabular-nums; letter-spacing: -.02em;
  transition: border-color .18s var(--ease), box-shadow .18s var(--ease);
}
.tcinput:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
.tcinput:disabled { opacity: .45; }

.selbar { display: flex; gap: 6px; margin-top: 11px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 34px; padding: 0 12px; border-radius: var(--r-sm); cursor: pointer;
  border: 1px solid var(--line); background: var(--elev); color: var(--tx);
  font-size: 12.5px; font-weight: 600; white-space: nowrap;
  transition: background .18s var(--ease), border-color .18s var(--ease), transform .12s var(--ease), opacity .18s var(--ease);
}
.btn:hover:not(:disabled) { background: var(--elev-2); border-color: var(--line-2); }
.btn:active:not(:disabled) { transform: scale(.975); }
.btn:disabled { opacity: .35; cursor: default; }
.btn .ic { width: 15px; height: 15px; color: var(--tx-2); }
.btn--wide { width: 100%; }
.btn--sm { height: 29px; padding: 0 10px; font-size: 12px; }
.btn--primary {
  border: none; color: #fff;
  background: linear-gradient(180deg, #5b96ff, var(--blue));
  box-shadow: 0 4px 14px rgba(76, 141, 255, .3), inset 0 1px 0 rgba(255, 255, 255, .22);
}
.btn--primary:hover:not(:disabled) { filter: brightness(1.07); background: linear-gradient(180deg, #5b96ff, var(--blue)); }
.btn--primary .ic { color: #fff; }
.btn--accent {
  border: none; color: #fff; height: 40px; font-size: 13.5px;
  background: linear-gradient(180deg, var(--accent-2), var(--accent));
  box-shadow: 0 5px 16px rgba(246, 153, 70, .3), inset 0 1px 0 rgba(255, 255, 255, .25);
}
.btn--accent:hover:not(:disabled) { filter: brightness(1.06); }
.btn--accent .ic { color: #fff; }
.btn--danger:hover:not(:disabled) { border-color: color-mix(in srgb, var(--red) 45%, transparent); color: var(--red); }
.btn--danger:hover:not(:disabled) .ic { color: var(--red); }

.editgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.editgrid .btn { justify-content: flex-start; }

.subhead {
  font-size: 11px; font-weight: 650; color: var(--tx-3); letter-spacing: .04em;
  margin: 14px 0 8px; padding-top: 12px; border-top: 1px solid var(--line);
}
.subhead:first-child { margin-top: 0; padding-top: 0; border-top: none; }

.row { display: flex; align-items: center; gap: 9px; }
.row + .row { margin-top: 9px; }
.row label { font-size: 12px; color: var(--tx-3); white-space: nowrap; }
.row .val { font-family: var(--mono); font-size: 12px; color: var(--tx-2); min-width: 52px; text-align: right; font-variant-numeric: tabular-nums; }

select {
  height: 32px; padding: 0 30px 0 10px; border-radius: var(--r-sm); cursor: pointer;
  background-color: var(--elev); border: 1px solid var(--line); color: var(--tx);
  font-size: 12.5px; -webkit-appearance: none; appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'><path d='M2.5 4.5L6 8l3.5-3.5' stroke='%238b93a6' stroke-width='1.6' fill='none' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat; background-position: right 9px center;
  transition: border-color .18s var(--ease), box-shadow .18s var(--ease);
}
select:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
select:disabled { opacity: .45; cursor: default; }

.seg { display: inline-flex; padding: 2px; background: var(--elev); border: 1px solid var(--line); border-radius: 9px; gap: 2px; }
.seg button {
  border: none; background: transparent; color: var(--tx-2); cursor: pointer;
  padding: 5px 12px; border-radius: 7px; font-size: 12px; font-weight: 600;
  transition: all .18s var(--ease);
}
.seg button:hover { color: var(--tx); }
.seg button.on { background: var(--panel); color: var(--tx); box-shadow: var(--shadow-1); }
.seg button:disabled { opacity: .35; cursor: default; }

.exp-name { display: flex; align-items: center; gap: 0; margin-top: 4px; }
.exp-name input {
  flex: 1; min-width: 0; height: 32px; padding: 0 10px;
  border-radius: var(--r-sm) 0 0 var(--r-sm); background: var(--elev);
  border: 1px solid var(--line); border-right: none; font-size: 12.5px;
}
.exp-name input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); position: relative; z-index: 1; }
.exp-name .ext {
  height: 32px; display: grid; place-items: center; padding: 0 10px;
  border-radius: 0 var(--r-sm) var(--r-sm) 0; background: var(--elev-2);
  border: 1px solid var(--line); font-family: var(--mono); font-size: 12px; color: var(--tx-3);
}

.est { font-size: 11.5px; color: var(--tx-3); margin-top: 9px; text-align: center; font-family: var(--mono); }

.infolist { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 12px; }
.infolist dt { color: var(--tx-3); }
.infolist dd { text-align: right; font-family: var(--mono); font-size: 11.5px; color: var(--tx-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.history { max-height: 190px; overflow-y: auto; margin: -4px -6px -4px -6px; padding: 4px 6px; }
.hist-item {
  display: flex; align-items: center; gap: 9px; width: 100%;
  padding: 6px 8px; border-radius: 7px; border: none; background: transparent;
  color: var(--tx-2); font-size: 12.5px; cursor: pointer; text-align: left;
  transition: background .15s var(--ease), color .15s var(--ease);
}
.hist-item:hover { background: var(--elev); color: var(--tx); }
.hist-item.cur { background: var(--blue-soft); color: var(--blue); font-weight: 600; }
.hist-item.future { opacity: .42; }
.hist-item .dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; flex: none; opacity: .7; }
.hist-item .ht { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hist-item .hd { font-family: var(--mono); font-size: 10.5px; opacity: .65; }

/* ---------- Footer ---------- */
.appfoot {
  display: flex; align-items: center; justify-content: center; gap: 18px; flex-wrap: wrap;
  padding: 20px 18px 26px; font-size: 12px; color: var(--tx-3); border-top: 1px solid var(--line);
}
.appfoot a { color: var(--tx-3); transition: color .18s var(--ease); }
.appfoot a:hover { color: var(--tx-2); }

/* ---------- Toast ---------- */
.toasts {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%);
  z-index: 90; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none;
}
.toast {
  display: flex; align-items: center; gap: 9px; max-width: min(92vw, 460px);
  padding: 10px 16px; border-radius: 999px; font-size: 13px; font-weight: 500;
  background: color-mix(in srgb, var(--elev-2) 92%, transparent);
  border: 1px solid var(--line-2); color: var(--tx);
  box-shadow: var(--shadow-pop); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  animation: toastIn .3s var(--ease);
}
.toast.out { animation: toastOut .25s var(--ease) forwards; }
.toast .ic { width: 16px; height: 16px; }
.toast.ok .ic { color: var(--green); }
.toast.err .ic { color: var(--red); }
.toast.warn .ic { color: var(--accent); }
@keyframes toastIn { from { opacity: 0; transform: translateY(12px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateY(8px) scale(.97); } }

/* ---------- Context menu ---------- */
.ctxmenu {
  position: fixed; z-index: 95; min-width: 244px; max-width: 92vw; padding: 6px;
  background: color-mix(in srgb, var(--elev) 94%, transparent);
  backdrop-filter: blur(26px) saturate(180%);
  -webkit-backdrop-filter: blur(26px) saturate(180%);
  border: 1px solid var(--line-2); border-radius: 13px;
  box-shadow: var(--shadow-pop);
  animation: ctxIn .13s var(--ease);
  transform-origin: top left;
}
@keyframes ctxIn { from { opacity: 0; transform: scale(.96) translateY(-3px); } to { opacity: 1; transform: none; } }

.ctxmenu button {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 7px 10px; border: none; border-radius: 7px; background: transparent;
  color: var(--tx); font-size: 13px; text-align: left; cursor: pointer;
  transition: background .1s var(--ease), color .1s var(--ease);
}
.ctxmenu button .ic { width: 15px; height: 15px; color: var(--tx-3); flex: none; }
.ctxmenu button .lb { flex: 1; white-space: nowrap; }
.ctxmenu button .hint {
  font-family: var(--mono); font-size: 11px; color: var(--tx-3); letter-spacing: -.02em; flex: none;
}
.ctxmenu button:hover:not(:disabled),
.ctxmenu button:focus-visible:not(:disabled) {
  background: var(--blue); color: #fff; outline: none;
}
.ctxmenu button:hover:not(:disabled) .ic,
.ctxmenu button:hover:not(:disabled) .hint,
.ctxmenu button:focus-visible:not(:disabled) .ic,
.ctxmenu button:focus-visible:not(:disabled) .hint { color: rgba(255, 255, 255, .82); }
.ctxmenu button:disabled { opacity: .34; cursor: default; }
.ctxmenu hr { border: none; height: 1px; background: var(--line); margin: 5px 8px; }

/* ---------- Modal / progress ---------- */
.scrim {
  position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 22px;
  background: rgba(4, 6, 10, .62); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  animation: fade .2s var(--ease);
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.modal {
  width: min(560px, 100%); max-height: 84dvh; overflow-y: auto;
  background: var(--panel); border: 1px solid var(--line-2); border-radius: var(--r-lg);
  box-shadow: var(--shadow-pop); padding: 22px; animation: pop .26s var(--ease);
}
@keyframes pop { from { opacity: 0; transform: translateY(14px) scale(.97); } to { opacity: 1; transform: none; } }
.modal h2 { font-size: 17px; font-weight: 650; letter-spacing: -.015em; }
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }

.progress-wrap { text-align: center; padding: 6px 4px 2px; }
.progress-label { font-size: 14px; font-weight: 600; }
.progress-sub { font-size: 12px; color: var(--tx-3); margin-top: 4px; font-family: var(--mono); }
.progress-track { height: 6px; border-radius: 999px; background: var(--elev-2); overflow: hidden; margin-top: 16px; }
.progress-bar { height: 100%; width: 0%; border-radius: 999px; background: linear-gradient(90deg, var(--blue), #86b5ff); transition: width .2s var(--ease); }
.progress-bar.indet { width: 35%; animation: indet 1.1s var(--ease) infinite; }
@keyframes indet { 0% { margin-left: -35%; } 100% { margin-left: 100%; } }

.kbd-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px 26px; }
.kbd-grid section h3 { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--tx-3); margin-bottom: 9px; }
.kbd-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 4px 0; font-size: 13px; }
.kbd-row span { color: var(--tx-2); }
kbd {
  font-family: var(--mono); font-size: 11px; padding: 3px 7px; border-radius: 6px;
  background: var(--elev); border: 1px solid var(--line-2); color: var(--tx);
  box-shadow: 0 1px 0 var(--line-2); white-space: nowrap;
}

/* ---------- Responsive ---------- */
/* 横に余裕がある画面では、サイドバーを送っても波形が見えたままになるよう固定する */
@media (min-width: 1081px) {
  .stage { position: sticky; top: 72px; }
}
@media (max-width: 1080px) {
  .editor { grid-template-columns: minmax(0, 1fr); }
  .sidebar { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); align-items: start; }
}
@media (max-width: 720px) {
  .topbar { padding: 0 12px; gap: 10px; }
  .apptitle .sub, .topbar-div { display: none; }
  .chip-privacy span { display: none; }
  .chip-privacy { padding: 6px; }
  .editor { padding: 12px 12px 18px; }
  #cvWave { height: 200px; }
  .hero-feats { grid-template-columns: 1fr; }
  .filechip .fc-name { max-width: 150px; }
  .kbd-grid { grid-template-columns: 1fr; }
  .tc-now { font-size: 21px; }
}
