* { box-sizing: border-box; }
body { margin: 0; font-family: "Hiragino Sans", "Noto Sans JP", sans-serif; background: #14161a; color: #e8eaed; height: 100vh; display: flex; flex-direction: column; }
.hidden { display: none !important; }
.center { margin: auto; text-align: center; padding: 2rem; }
.error { color: #ff7676; min-height: 1.2em; }

header { display: flex; align-items: center; gap: .7rem; padding: .5rem .8rem; background: #1d2026; border-bottom: 1px solid #2c313a; flex-wrap: wrap; }
header a { color: #8ab4f8; text-decoration: none; }
#me-email { color: #9aa0a6; font-size: .85rem; }

button { background: #2b3444; color: #e8eaed; border: 1px solid #3c4043; border-radius: 6px; padding: .35rem .8rem; cursor: pointer; font-size: .85rem; }
button:hover { background: #38445a; }
button:disabled { opacity: .4; cursor: default; }
button.danger { background: #5c2b2b; border-color: #7a3b3b; }
button.ghost { background: transparent; }

.badge { padding: .15rem .6rem; border-radius: 10px; font-size: .8rem; background: #444; }
.badge.ok { background: #1e5631; }
.badge.bad { background: #8b2635; }
.badge.warn { background: #7a5b1e; }

#app-view { display: flex; flex-direction: column; height: 100vh; }
main { flex: 1; display: grid; grid-template-columns: 240px 1fr 380px; min-height: 0; }
@media (max-width: 900px) { main { grid-template-columns: 1fr; grid-template-rows: auto 1fr auto; } }

.pane-head { display: flex; align-items: center; gap: .5rem; padding: .4rem .6rem; background: #1d2026; border-bottom: 1px solid #2c313a; font-size: .85rem; }
.pane-head span:first-child { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

#files-pane { border-right: 1px solid #2c313a; display: flex; flex-direction: column; min-height: 0; }
#file-list { list-style: none; margin: 0; padding: 0; overflow-y: auto; flex: 1; }
#file-list li { padding: .3rem .7rem; cursor: pointer; font-size: .85rem; font-family: ui-monospace, monospace; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#file-list li:hover { background: #262b33; }
#file-list li.active { background: #2b3d55; }
#file-list li.dir { color: #9aa0a6; cursor: default; }
#file-list li.datafile { color: #8fb3d9; }
#drop-zone { margin: .5rem; padding: .8rem; border: 2px dashed #3c4043; border-radius: 8px; text-align: center; color: #9aa0a6; font-size: .75rem; }
#upload-dest-label { display: block; margin-top: .5rem; }
#upload-dest { font-size: .75rem; max-width: 100%; }
#drop-zone.over { border-color: #8ab4f8; color: #8ab4f8; }

#editor-pane { display: flex; flex-direction: column; min-height: 0; }
#editor-wrap { flex: 1; position: relative; min-height: 0; background: #0f1114; }
#editor-hl, #editor {
  position: absolute; inset: 0; margin: 0; padding: .8rem;
  font-family: ui-monospace, "SF Mono", Consolas, monospace; font-size: .85rem;
  line-height: 1.5; tab-size: 2; white-space: pre; overflow: auto;
}
#editor-hl { pointer-events: none; color: #d4d8de; }
#editor-hl code { font: inherit; }
#editor { background: transparent; color: transparent; caret-color: #8ab4f8; border: 0; resize: none; outline: none; }
#editor::placeholder { color: #5f6a76; }
.tok-c { color: #7ea16b; }
.tok-s { color: #d8a06a; }
.tok-k { color: #6cb2f0; }
.tok-n { color: #c8ae82; }
.tok-a { color: #9cdcfe; }
.line-lock { background: rgba(229, 72, 77, .18); box-shadow: 0 0 0 2px rgba(229, 72, 77, .18); border-radius: 2px; }

#log-pane { border-left: 1px solid #2c313a; display: flex; flex-direction: column; min-height: 0; }
#log-body { flex: 1; margin: 0; padding: .6rem; overflow: auto; font-size: .75rem; line-height: 1.4; background: #0f1114; color: #b8bcc2; white-space: pre-wrap; word-break: break-all; }

#toast { position: fixed; bottom: 1.2rem; left: 50%; transform: translateX(-50%); background: #2b3444; border: 1px solid #3c4043; padding: .6rem 1.2rem; border-radius: 8px; z-index: 10; max-width: 80vw; }
#toast.err { background: #5c2b2b; }
select { background: #2b3444; color: #e8eaed; border: 1px solid #3c4043; border-radius: 6px; padding: .3rem; }
