/* News Frost Web — すりガラス調デザイン(Android 版 News Frost / Calc Frost と同じ配色・寸法)
 * © 2026 compact */
:root {
  --accent: #00E5FF;
  --accent-rgb: 0, 229, 255;
  --on-accent: #06101A;
  --card-fill: rgba(10, 15, 30, .63);
  --bg-opacity: .75;
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --sal: env(safe-area-inset-left, 0px);
  --sar: env(safe-area-inset-right, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: #060A16; color: #fff; overflow: hidden; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Segoe UI", sans-serif;
  font-size: 15px; line-height: 1.35;
  -webkit-text-size-adjust: 100%; text-size-adjust: 100%;
  overscroll-behavior: none;
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
}
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; margin: 0; cursor: pointer; }
input { font: inherit; }
.selectable { -webkit-user-select: text; user-select: text; -webkit-touch-callout: default; }

/* ------------------------------------------------------------ 背景 */
.bg { position: absolute; inset: 0; overflow: hidden; z-index: 0; pointer-events: none;
  background:
    radial-gradient(100vmax circle at 10% 10%, rgba(var(--accent-rgb), .38), rgba(var(--accent-rgb), 0) 100%),
    radial-gradient(100vmax circle at 95% 88%, rgba(124, 77, 255, .40), rgba(124, 77, 255, 0) 100%),
    linear-gradient(155deg, #060A16 0%, #130F2B 50%, #07182A 100%);
}
.bg-img { position: absolute; inset: 0; background-size: cover; background-position: center; opacity: var(--bg-opacity); }
.bg-scrim { position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,.25) 0%, rgba(0,0,0,.06) 45%, rgba(0,0,0,.44) 100%); }
.bg:not(.has-img) .bg-img, .bg:not(.has-img) .bg-scrim { display: none; }

/* ------------------------------------------------------------ 画面 */
.screen { position: fixed; inset: 0; display: flex; flex-direction: column; overflow: hidden; background: #060A16;
  transition: transform .24s cubic-bezier(.2, .8, .2, 1), opacity .24s; }
.screen.enter { transform: translateX(100%); }
.screen.leave { transform: translateX(100%); }
.screen.fade.enter, .screen.fade.leave { transform: none; opacity: 0; }
.screen > .content { position: relative; z-index: 1; flex: 1; display: flex; flex-direction: column; min-height: 0;
  padding: var(--sat) var(--sar) 0 var(--sal); }
.scroll { overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.col { padding: 0 16px calc(16px + var(--sab)); }

/* ------------------------------------------------------------ ヘッダー */
.head { display: flex; align-items: center; height: 64px; flex: none; }
.head.main { padding: 0 12px 0 18px; }
.head-title { flex: 1; min-width: 0; font-size: 24px; font-weight: 300; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.head .ib + .ib { margin-left: 6px; }
.head.sub .head-title { padding-left: 14px; }
.head-right { display: flex; align-items: center; gap: 8px; }

/* 丸いガラス風アイコンボタン */
.ib { width: 44px; height: 44px; flex: none; position: relative; border-radius: 50%; }
.ib svg { width: 100%; height: 100%; display: block; }
.ib .c { fill: rgba(0,0,0,.25); stroke: rgba(255,255,255,.22); stroke-width: 1; }
.ib .hl1, .ib .hl2 { display: none; }
.ib.highlight .c { display: none; }
.ib.highlight .hl1 { display: block; fill: rgba(var(--accent-rgb), .28); }
.ib.highlight .hl2 { display: block; fill: var(--accent); }
.ib .g { stroke: #fff; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.ib .g .f { fill: #fff; stroke: none; }
.ib.highlight .g { stroke: var(--on-accent); }
.ib.highlight .g .f { fill: var(--on-accent); }
.ib .star.on { fill: var(--accent); stroke: var(--accent); }
.ib:active .c { fill: rgba(255,255,255,.22); }
.ib:active .hl2 { opacity: .8; }
.ib.spin svg .g { animation: spin 1s linear infinite; transform-origin: 22px 22px; }
.ib.small { width: 36px; height: 36px; }
.ib.mid { width: 40px; height: 40px; }
.ib.nobtn { pointer-events: none; width: 34px; height: 34px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ------------------------------------------------------------ タブ */
.strip { display: flex; align-items: center; height: 46px; flex: none; padding-right: 12px; }
.tabs { flex: 1; min-width: 0; height: 100%; display: flex; align-items: center; overflow-x: auto; overflow-y: hidden;
  padding: 0 4px 0 12px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.tabs::-webkit-scrollbar { display: none; }
.chip { height: 34px; flex: none; display: inline-flex; align-items: center; justify-content: center; padding: 0 16px; margin-right: 8px;
  border-radius: 17px; font-size: 14px; white-space: nowrap; color: #fff;
  background: rgba(255,255,255,.2); border: 1px solid rgba(255,255,255,.25); }
.chip:active { background: rgba(255,255,255,.4); }
.chip .op { font-size: .72em; margin-left: .5em; }
.chip.on { background: rgba(var(--accent-rgb), .92); border-color: transparent; color: var(--on-accent); font-weight: 600; }
.chip.fav { width: 42px; padding: 0; margin: 0; font-size: 17px; color: var(--accent); }
.chip.fav.on { color: var(--on-accent); }
.strip .sep { width: 1px; height: 22px; background: rgba(255,255,255,.2); margin-right: 8px; flex: none; }

.status { padding: 6px 20px 2px; font-size: 12px; color: rgba(255,255,255,.6); white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis; flex: none; min-height: 24px; }
.status.err { color: #FF8A80; }

/* ------------------------------------------------------------ ボタン類 */
.btn { height: 46px; padding: 0 14px; display: flex; align-items: center; justify-content: center; border-radius: 14px;
  background: rgba(255,255,255,.2); border: 1px solid rgba(255,255,255,.25); color: #fff; font-size: 15px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.btn:active { background: rgba(255,255,255,.4); }
.btn.accent { background: rgba(var(--accent-rgb), .92); border-color: transparent; color: var(--on-accent); font-weight: 600; }
.btn.accent:active { filter: brightness(1.15); }
.btn.danger { color: #FF8A80; }
.btn.sm { height: 38px; font-size: 13px; }
.btn-row { display: flex; gap: 8px; margin-top: 4px; }
.btn-row > * { flex: 1; min-width: 0; }

.done-bar { margin: 6px 14px 2px; flex: none; font-size: 16px; }

/* ------------------------------------------------------------ 見出し一覧 */
.list-wrap { position: relative; flex: 1; min-height: 0; }
.list { position: absolute; inset: 0; padding: 6px 14px calc(16px + var(--sab)); }
.card { display: flex; align-items: center; padding: 14px; margin-bottom: 10px; border-radius: 18px;
  background: var(--card-fill); border: 1px solid rgba(255,255,255,.15); transition: background .12s; }
.card.tap:active, .card.pressed { background: rgba(60, 66, 84, .75); }
.card .txt { flex: 1; min-width: 0; }
.card .meta { font-size: 12px; font-weight: 600; color: var(--accent); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card .title { margin-top: 5px; font-size: 16px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card .more { margin-top: 6px; font-size: 12px; color: rgba(255,255,255,.6); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.thumb { width: 87px; height: 65px; margin-left: 12px; border-radius: 12px; flex: none; object-fit: cover;
  background: rgba(255,255,255,.1); overflow: hidden; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; opacity: 0; transition: opacity .2s; }
.thumb img.ok { opacity: 1; }
.ctrl { display: flex; margin-left: 10px; flex: none; }
.ctrl button { width: 40px; height: 40px; border-radius: 20px; font-size: 18px; display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.2); border: 1px solid rgba(255,255,255,.25); }
.ctrl button:active { background: rgba(255,255,255,.4); }
.ctrl button:disabled { opacity: .25; background: rgba(255,255,255,.08); border-color: transparent; }
.ctrl button + button { margin-left: 4px; }
.ctrl .del { margin-left: 10px !important; color: #FF8A80; }

.empty { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 0 32px 60px;
  text-align: center; font-size: 15px; color: rgba(255,255,255,.8); white-space: pre-line; pointer-events: none; }
.undo { position: absolute; left: 14px; right: 14px; bottom: calc(14px + var(--sab)); display: flex; align-items: center;
  padding: 6px 6px 6px 16px; border-radius: 16px; background: rgba(26,32,54,.94); border: 1px solid rgba(255,255,255,.25); }
.undo span { flex: 1; font-size: 14px; }
.undo .btn { height: 40px; }

/* ------------------------------------------------------------ カード(設定・記事) */
.panel { padding: 16px; margin-bottom: 14px; border-radius: 22px; background: rgba(10,15,30,.6); border: 1px solid rgba(255,255,255,.15); }
.panel.fill { background: var(--card-fill); }
.panel-title { font-size: 13px; font-weight: 600; letter-spacing: .06em; color: var(--accent); padding-bottom: 10px; }
.hint { font-size: 12px; color: rgba(255,255,255,.6); margin-top: 2px; }
.label { font-size: 16px; }
.row { display: flex; align-items: center; }
.row > .grow { flex: 1; min-width: 0; }
.row.h48 { min-height: 48px; }
.mt8 { margin-top: 8px; } .mt12 { margin-top: 12px; } .mt14 { margin-top: 14px; } .mt16 { margin-top: 16px; }

.field { width: 100%; height: 44px; padding: 8px 2px; background: transparent; border: 0; border-bottom: 1px solid rgba(255,255,255,.4);
  color: #fff; font-size: 16px; outline: none; border-radius: 0; -webkit-user-select: text; user-select: text; }
.field::placeholder { color: rgba(255,255,255,.4); }
.field:focus { border-bottom: 2px solid var(--accent); }

/* スイッチ */
.switch { position: relative; width: 52px; height: 32px; flex: none; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: 16px; background: rgba(255,255,255,.25); transition: background .18s; }
.switch span::after { content: ""; position: absolute; left: 3px; top: 3px; width: 26px; height: 26px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,.4); transition: transform .18s; }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { transform: translateX(20px); }

/* スライダー */
input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 36px; background: transparent; margin: 4px 0 0; }
input[type=range]::-webkit-slider-runnable-track { height: 4px; border-radius: 2px;
  background: linear-gradient(to right, var(--accent) 0, var(--accent) var(--p, 50%), rgba(255,255,255,.25) var(--p, 50%)); }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 22px; height: 22px; border-radius: 50%; background: var(--accent);
  margin-top: -9px; box-shadow: 0 1px 4px rgba(0,0,0,.4); }
input[type=range]::-moz-range-track { height: 4px; border-radius: 2px; background: rgba(255,255,255,.25); }
input[type=range]::-moz-range-progress { height: 4px; border-radius: 2px; background: var(--accent); }
input[type=range]::-moz-range-thumb { width: 22px; height: 22px; border-radius: 50%; background: var(--accent); border: 0; }

/* セグメント */
.seg { display: flex; height: 42px; margin: 6px 0 4px; }
.seg button { flex: 1; min-width: 0; margin: 0 2px; border-radius: 12px; font-size: 13px; background: rgba(255,255,255,.15);
  border: 1px solid rgba(255,255,255,.2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.seg button.on { background: rgba(var(--accent-rgb), .92); border-color: transparent; color: var(--on-accent); font-weight: 600; }
.seg.dim button { color: rgba(255,255,255,.5); }
.seg.dim button.on { background: rgba(255,255,255,.15); border: 1px solid rgba(255,255,255,.2); color: rgba(255,255,255,.5); font-weight: 400; }

.swatches { display: flex; align-items: center; height: 52px; }
.swatches button { flex: 1; height: 44px; margin: 0 3px; border-radius: 50%; max-width: 44px; margin-left: auto; margin-right: auto; border: 3px solid transparent; }
.swatches button.on { border-color: #fff; }

.list-row { display: flex; align-items: center; margin-top: 8px; padding: 6px 4px 6px 12px; border-radius: 14px;
  background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.15); }
.list-row.tap:active { background: rgba(255,255,255,.3); }
.list-row .t1 { font-size: 15px; }
.list-row .t2 { font-size: 12px; color: rgba(255,255,255,.6); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.arrow { width: 40px; height: 40px; border-radius: 20px; font-size: 18px; flex: none; }
.arrow:active { background: rgba(255,255,255,.3); }
.arrow:disabled { color: rgba(255,255,255,.2); }
.ver { text-align: center; font-size: 12px; color: rgba(255,255,255,.5); padding: 8px 0; white-space: pre-line; }

/* タブ編集 */
.kw-row { display: flex; align-items: center; height: 46px; padding: 0 4px 0 14px; border-radius: 14px; background: rgba(255,255,255,.15);
  border: 1px solid rgba(255,255,255,.2); }
.kw-row span { flex: 1; min-width: 0; font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kw-op { text-align: center; font-size: 11px; color: var(--accent); padding: 4px 0; }
.add-row { display: flex; align-items: center; min-height: 52px; gap: 8px; }
.add-row .btn { height: 42px; flex: none; }
.bottom-btns { display: flex; gap: 8px; height: 50px; }
.bottom-btns .btn { height: 50px; flex: 1; }
.bottom-btns .btn.accent { flex: 1.6; }

/* ------------------------------------------------------------ 要約記事 */
.hero { position: relative; height: 214px; border-radius: 22px; overflow: hidden; background: rgba(10,15,30,.2); border: 1px solid rgba(255,255,255,.15); }
.hero img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .22s; }
.hero img.ok { opacity: 1; }
.placeholder { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: radial-gradient(90% 120% at 20% 15%, rgba(var(--accent-rgb), .45), rgba(var(--accent-rgb), 0)),
    linear-gradient(135deg, #0B1124, #1A1440 50%, #07182A); }
.placeholder .big { font-weight: 300; font-size: 40px; max-width: 90%; text-align: center; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.placeholder .small { margin-top: 10px; font-size: 11px; font-weight: 600; letter-spacing: .3em; color: var(--accent); }
.thumbs { display: flex; gap: 8px; height: 62px; margin-top: 8px; overflow-x: auto; scrollbar-width: none; }
.thumbs::-webkit-scrollbar { display: none; }
.thumbs img { width: 88px; height: 62px; flex: none; object-fit: cover; border-radius: 12px; background: rgba(255,255,255,.13); }
.a-meta { margin-top: 14px; font-size: 13px; font-weight: 600; color: var(--accent); }
.a-title { margin: 4px 0 14px; font-size: 21px; line-height: 1.3; }
.summary { margin-top: 10px; font-size: 16px; line-height: 1.6; white-space: pre-wrap; }
.summary.dim { color: rgba(255,255,255,.7); }
.summary.err { color: #FF8A80; }
.note { margin-top: 10px; font-size: 12px; color: #FFD180; }
.engine { margin-top: 10px; font-size: 11px; color: rgba(255,255,255,.5); }
.diag { margin-top: 6px; font-size: 11px; color: rgba(255,255,255,.6); white-space: pre-line; }
.src-row { display: flex; align-items: center; margin-top: 8px; padding: 10px 8px 10px 12px; border-radius: 14px;
  background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.15); }
.src-row:active { background: rgba(255,255,255,.3); }
.src-row .txt { flex: 1; min-width: 0; }
.src-row .n { font-size: 13px; color: var(--accent); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.src-row .ti { font-size: 15px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.src-row .u { font-size: 11px; color: rgba(255,255,255,.5); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.src-row .ib { margin-left: 8px; }

/* ------------------------------------------------------------ アプリ内ブラウザ */
.web-head { display: flex; align-items: center; height: 56px; padding: 0 12px; flex: none; }
.web-head .tcol { flex: 1; min-width: 0; padding-left: 12px; }
.web-head .t { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.web-head .b { font-size: 11px; color: var(--accent); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.progress { height: 3px; flex: none; position: relative; overflow: hidden; background: rgba(255,255,255,.13); }
.progress::after { content: ""; position: absolute; top: 0; bottom: 0; width: 40%; background: var(--accent); animation: prog 1.1s ease-in-out infinite; }
.progress.off { visibility: hidden; }
@keyframes prog { from { left: -40%; } to { left: 100%; } }
.web-body { flex: 1; min-height: 0; position: relative; background: #fff; overflow: auto; -webkit-overflow-scrolling: touch; }
.web-body iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; display: block; background: #fff; }
.web-msg { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 32px;
  text-align: center; color: #333; font-size: 15px; background: #fff; white-space: pre-line; }
.web-bar { display: flex; align-items: center; padding: 10px 14px calc(10px + var(--sab)); background: rgba(10,15,30,.9); flex: none; }
.web-bar .btn { flex: 1; margin-left: 10px; font-size: 16px; }

/* ------------------------------------------------------------ 背景の位置調整 */
.crop { position: absolute; inset: 0; overflow: hidden; background: #000; touch-action: none; }
.crop img { position: absolute; left: 0; top: 0; transform-origin: 0 0; max-width: none; pointer-events: none; }
.crop-ui { position: absolute; inset: 0; display: flex; flex-direction: column; padding: calc(12px + var(--sat)) 12px calc(12px + var(--sab)); pointer-events: none; }
.crop-ui > * { pointer-events: auto; }
.crop-top { display: flex; align-items: center; gap: 8px; }
.crop-hint { flex: 1; font-size: 13px; padding: 8px 12px; border-radius: 14px; background: rgba(0,0,0,.4); text-shadow: 0 1px 3px rgba(0,0,0,.8); }
.crop-top .btn { height: 38px; font-size: 13px; background: rgba(0,0,0,.4); border-color: rgba(255,255,255,.33); }
.crop-panel { margin-top: auto; padding: 12px 16px 14px; border-radius: 22px; background: rgba(10,15,30,.7); border: 1px solid rgba(255,255,255,.2); }
.crop-panel .row { height: 44px; }
.crop-panel input[type=range] { flex: 1; margin: 0 8px; }
.crop-panel .zl { min-width: 48px; text-align: right; }
.crop-btns { display: flex; gap: 8px; height: 48px; margin-top: 8px; }
.crop-btns .btn { height: 48px; flex: 1; }
.crop-btns .btn.accent { flex: 1.3; }
.crop-ui.preview .crop-hint, .crop-ui.preview .crop-panel { visibility: hidden; }

/* ------------------------------------------------------------ ダイアログ・トースト */
.dlg-back { position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,.5); display: flex; align-items: center; justify-content: center;
  padding: 24px; animation: fadein .15s; }
.dlg { width: 100%; max-width: 360px; max-height: 80vh; overflow: auto; padding: 20px 20px 10px; border-radius: 22px;
  background: rgba(26,32,54,.97); border: 1px solid rgba(255,255,255,.2); box-shadow: 0 10px 40px rgba(0,0,0,.5); }
.dlg h3 { margin: 0 0 10px; font-size: 18px; font-weight: 600; }
.dlg .msg { font-size: 15px; line-height: 1.5; white-space: pre-line; word-break: break-word; -webkit-user-select: text; user-select: text; }
.dlg .acts { display: flex; justify-content: flex-end; gap: 4px; margin-top: 14px; }
.dlg .acts button { padding: 10px 14px; border-radius: 12px; color: var(--accent); font-size: 15px; font-weight: 600; }
.dlg .acts button:active { background: rgba(255,255,255,.12); }
.dlg .spin { display: flex; align-items: center; gap: 14px; padding: 6px 0 14px; }
.dlg .spin i { width: 26px; height: 26px; border-radius: 50%; border: 3px solid rgba(255,255,255,.2); border-top-color: var(--accent); animation: spin2 .8s linear infinite; }
@keyframes spin2 { to { transform: rotate(360deg); } }
@keyframes fadein { from { opacity: 0; } }
.toast { position: fixed; left: 50%; bottom: calc(40px + var(--sab)); z-index: 60; transform: translateX(-50%); max-width: 86vw;
  padding: 10px 18px; border-radius: 20px; background: rgba(40,44,60,.95); color: #fff; font-size: 14px; text-align: center;
  box-shadow: 0 4px 18px rgba(0,0,0,.4); animation: fadein .15s; pointer-events: none; }
