:root { color-scheme: dark; font-family: ui-sans-serif, system-ui, sans-serif; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100vh; color: #edf5f7; background: radial-gradient(circle at 88% 0, #123a4d, transparent 38rem), #090d12; }
button { font: inherit; cursor: pointer; }
.app-shell { width: 100%; height: 100vh; height: 100dvh; min-height: 520px; display: grid; grid-template-columns: 238px minmax(0, 1fr); grid-template-rows: 64px minmax(0, 1fr); }
.topbar { grid-column: 1 / -1; grid-row: 1; display: flex; align-items: center; justify-content: space-between; padding: 0 22px; border-bottom: 1px solid #29424e; background: #0b141a; }
.topbar-brand { display: flex; align-items: center; gap: 10px; font-size: 1.23rem; font-weight: 800; letter-spacing: -.04em; }
.topbar-context { color: #819aa7; font-size: .74rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.topbar-actions { display: flex; align-items: center; gap: 22px; }
.account-button { display: flex; align-items: center; gap: 9px; min-height: 38px; padding: 5px 12px 5px 5px; border: 1px solid #31515f; border-radius: 999px; color: #eaf6f8; background: #162832; font-size: .84rem; font-weight: 700; }
.account-button:hover { background: #203946; }
.account-button:focus-visible, .account-close:focus-visible, .account-tab:focus-visible, .account-primary:focus-visible, .account-signout:focus-visible { outline: 2px solid #7be3ef; outline-offset: 2px; }
.account-avatar { display: grid; place-items: center; width: 27px; height: 27px; color: #7be3ef; }
.account-avatar svg { display: block; width: 21px; height: 21px; }
.sidebar { grid-column: 1; grid-row: 2; min-height: 0; display: flex; flex-direction: column; padding: 22px 12px 16px; border-right: 1px solid #29424e; background: #0e171e; }
.brand-mark { display: block; width: 31px; height: 31px; flex: none; }
.sidebar-sections { min-height: 0; overflow: auto; }
.nav-section + .nav-section { margin-top: 28px; }
.nav-section h2 { margin: 0 10px 9px; color: #819aa7; font-size: .69rem; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.page-link { display: flex; align-items: center; gap: 11px; width: 100%; margin: 2px 0; padding: 10px 11px; border: 1px solid transparent; border-radius: 10px; color: #afc1c9; background: transparent; text-align: left; font-size: .88rem; }
.page-link:hover { color: #f4fcff; background: #1a303b; }
.page-link:focus-visible { outline: 2px solid #7be3ef; outline-offset: 2px; }
.page-link.active { border-color: #315362; color: #eafcff; background: #193744; font-weight: 700; }
.page-icon { display: inline-grid; place-items: center; width: 19px; color: #7bd9e8; font-size: 1rem; font-weight: 700; }
.language-icon { font-size: .68rem; font-weight: 800; letter-spacing: -.06em; }
.workspace { grid-column: 2; grid-row: 2; min-width: 0; min-height: 0; display: flex; flex-direction: column; background: #111a21; }
.page-header { flex: none; min-height: 68px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 24px; border-bottom: 1px solid #29424e; background: #12232d; }
.page-header-actions { display: flex; align-items: center; gap: 18px; flex: none; }
.eyebrow { margin: 0 0 5px; color: #78d9ee; font-size: .72rem; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
h1 { min-width: 0; margin: 0; font-size: clamp(1.1rem, 2vw, 1.45rem); line-height: 1.2; letter-spacing: -.035em; }
#editor-form { flex: 1; min-height: 0; display: grid; grid-template-rows: minmax(0, 3fr) 38px minmax(0, 1fr); }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
label { font-size: .84rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
textarea { display: block; width: 100%; height: 100%; min-height: 0; resize: none; border: 1px solid #2a4857; border-radius: 14px; padding: 14px 16px; color: #eaf6f8; background: #111a21; font: 15px/1.6 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; outline: none; }
textarea:focus { border-color: #69d1e8; box-shadow: 0 0 0 3px #69d1e824; }
.code-editor { --gutter-width: 52px; position: relative; min-height: 0; height: 100%; background: #111a21; overflow: hidden; }
#line-numbers { position: absolute; inset: 0 auto 0 0; width: var(--gutter-width); margin: 0; padding: 14px 9px 14px 0; overflow: hidden; border-right: 1px solid #2a4857; color: #8298a4; background: #0d171d; font: 15px/1.6 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; text-align: right; user-select: none; pointer-events: none; }
#code, #highlight { width: calc(100% - var(--gutter-width)); height: 100%; margin: 0; padding: 14px 16px; border: 0; border-radius: 0; font: 15px/1.6 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: normal; tab-size: 4; white-space: pre; overflow-wrap: normal; }
#highlight { position: absolute; inset: 0 0 0 var(--gutter-width); overflow: hidden; pointer-events: none; color: #eaf6f8; }
#code { position: relative; z-index: 1; margin-left: var(--gutter-width); overflow: auto; background: transparent; color: transparent; caret-color: #eaf6f8; -webkit-text-fill-color: transparent; scrollbar-width: none; }
#code::-webkit-scrollbar { display: none; }
#code:focus { border: 0; box-shadow: none; }
#code::selection { background: #37648b88; }
.syntax-keyword { color: #c5a5ff; }
.syntax-builtin { color: #7bdcef; }
.syntax-string { color: #b8e9a0; }
.syntax-number { color: #f4bb87; }
.syntax-comment { color: #8499a3; }
.syntax-constant { color: #e6a8d7; }
.syntax-operator { color: #f0d58d; }
.console-divider { display: flex; align-items: center; padding: 0 24px; border-top: 1px solid #36515e; border-bottom: 1px solid #36515e; background: #162631; }
.console-divider label { color: #b8cbd3; font-size: .7rem; letter-spacing: .12em; }
#output { border: 0; border-radius: 0; padding: 18px 24px; color: #b8eac8; background: #0c1419; }
#output:focus { border: 0; box-shadow: none; }
#run { border: 0; border-radius: 8px; padding: 9px 17px; color: #04212a; background: #7be3ef; font-weight: 800; white-space: nowrap; }
#run:hover { background: #a6f3f4; }
#run:focus-visible { outline: 2px solid #eafcff; outline-offset: 2px; }
#run:disabled { opacity: .55; cursor: wait; }
#status { color: #9aabb4; font-size: .8rem; }
#save-status { color: #8fc4bf; font-size: .8rem; white-space: nowrap; }
#save-status.error { color: #f2acaf; }
.account-dialog { width: min(1100px, calc(100vw - 40px)); height: min(760px, calc(100dvh - 40px)); max-width: none; max-height: none; margin: auto; padding: 0; overflow: auto; border: 1px solid #365562; border-radius: 20px; color: #edf5f7; background: #101a22; box-shadow: 0 28px 90px #0009; }
.account-dialog.signed-in { height: fit-content; max-height: calc(100dvh - 24px); }
.account-dialog::backdrop { background: #03080bc9; backdrop-filter: blur(5px); }
.account-modal { min-height: 100%; padding: clamp(20px, 3vw, 38px); }
.account-dialog.signed-in .account-modal { min-height: 0; padding-block: clamp(20px, 2.5vw, 30px); }
.account-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; padding-bottom: 24px; border-bottom: 1px solid #2a4653; }
.account-heading h2 { margin: 0; font-size: clamp(1.8rem, 3vw, 2.5rem); letter-spacing: -.05em; }
.account-intro { margin: 8px 0 0; color: #a8b8c0; }
.account-close { width: 38px; height: 38px; flex: none; border: 1px solid #365562; border-radius: 10px; color: #dcecf0; background: #1a2b35; font-size: 1.55rem; line-height: 1; }
.account-close:hover { background: #28414e; }
.account-message { margin: 20px 0 0; padding: 12px 15px; border: 1px solid #3b746a; border-radius: 10px; color: #c6f1d9; background: #19352f; font-size: .9rem; }
.account-message.error { border-color: #8b4c54; color: #ffd7dc; background: #3a2229; }
.account-tabs { display: flex; width: min(460px, 100%); gap: 5px; margin: 28px auto 0; padding: 5px; border: 1px solid #294652; border-radius: 12px; background: #0b151b; }
.account-tab { flex: 1; border: 0; border-radius: 8px; padding: 10px 14px; color: #a6bdc7; background: transparent; font-weight: 700; }
.account-tab.active { color: #eafcff; background: #1d3a48; }
#account-signed-out .account-form { width: min(460px, 100%); margin: 22px auto 0; }
.account-form { display: flex; flex-direction: column; gap: 10px; padding: 24px; border: 1px solid #294652; border-radius: 15px; background: #14222b; }
.account-form h3 { margin: 0; font-size: 1.13rem; }
.account-form p { margin: 0 0 8px; color: #9eb3be; font-size: .88rem; }
.account-form label { margin-top: 8px; color: #bdcdd4; font-size: .78rem; font-weight: 700; }
.account-form input { width: 100%; min-height: 42px; padding: 10px 12px; border: 1px solid #3b5966; border-radius: 9px; outline: none; color: #edf5f7; background: #0c171e; font: inherit; }
.account-form input:focus { border-color: #7be3ef; box-shadow: 0 0 0 3px #69d1e824; }
.account-primary { align-self: flex-start; margin-top: 12px; padding: 11px 17px; border: 0; border-radius: 9px; color: #06232d; background: #7be3ef; font-weight: 800; }
.account-primary:hover { background: #a6f3f4; }
.account-primary:disabled, .account-signout:disabled { opacity: .55; cursor: wait; }
.account-summary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin: 28px 0 18px; }
.account-dialog.signed-in .account-summary { margin: 22px 0 16px; }
.account-summary > div { display: flex; flex-direction: column; gap: 8px; padding: 18px 20px; border: 1px solid #294652; border-radius: 12px; background: #14222b; }
.account-detail-label { color: #8fa8b4; font-size: .74rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.account-summary strong { font-size: 1.02rem; overflow-wrap: anywhere; }
.account-settings { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.account-settings .account-form { min-width: 0; }
.account-bottom-actions { display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: 16px; margin-top: 24px; padding-top: 22px; border-top: 1px solid #294652; }
.account-dialog.signed-in .account-bottom-actions { margin-top: 18px; padding-top: 18px; }
.account-signout { flex: none; padding: 10px 15px; border: 1px solid #52717e; border-radius: 9px; color: #e5f0f3; background: transparent; font-weight: 700; }
.account-signout:hover { background: #203440; }
.account-delete-open { flex: none; margin-left: auto; padding: 10px 15px; border: 1px solid #8b4c54; border-radius: 9px; color: #ffd7dc; background: #342027; font-size: .88rem; font-weight: 700; }
.account-delete-open:hover { background: #47252d; }
.account-delete-open:focus-visible, .account-delete-submit:focus-visible { outline: 2px solid #f2acaf; outline-offset: 2px; }
.delete-account-dialog { width: min(480px, calc(100vw - 32px)); max-width: none; max-height: calc(100dvh - 32px); margin: auto; padding: 24px; overflow: auto; border: 1px solid #73434a; border-radius: 16px; color: #edf5f7; background: #101a22; box-shadow: 0 28px 90px #000b; }
.delete-account-dialog::backdrop { background: #03080ba8; backdrop-filter: blur(3px); }
.delete-account-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.delete-account-heading h2 { margin: 0; font-size: 1.5rem; }
.delete-account-dialog > p { color: #bdcdd4; font-size: .9rem; line-height: 1.5; }
.delete-account-dialog .account-form { padding: 0; border: 0; background: transparent; }
.delete-account-dialog .account-message { color: #ffd7dc; }
.account-delete-submit { align-self: flex-start; margin-top: 12px; padding: 11px 17px; border: 0; border-radius: 9px; color: #fff1f2; background: #a74452; font-weight: 800; }
.account-delete-submit:hover { background: #bf5161; }
.account-delete-submit:disabled { opacity: .55; cursor: wait; }
@media (max-width: 760px) {
  .app-shell { grid-template-columns: 62px minmax(0, 1fr); }
  .topbar { padding: 0 12px; }
  .topbar-context { font-size: .65rem; }
  .topbar-actions { gap: 8px; }
  .topbar-context { display: none; }
  .account-dialog { width: calc(100vw - 16px); height: calc(100dvh - 16px); border-radius: 12px; }
  .account-dialog.signed-in { max-height: calc(100dvh - 16px); }
  .account-summary, .account-settings { grid-template-columns: 1fr; }
  .sidebar { padding: 14px 7px; }
  .sidebar-sections { overflow: auto; }
  .nav-section + .nav-section { margin-top: 16px; padding-top: 16px; border-top: 1px solid #29424e; }
  .nav-section h2 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .page-link { justify-content: center; gap: 0; padding: 10px 0; font-size: 0; }
  .page-icon { width: 20px; font-size: 1.05rem; }
  .language-icon { font-size: .68rem; }
  .page-header { min-height: 60px; padding: 8px 12px; }
  .page-header-actions { gap: 8px; }
  #status, #save-status { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
  #run { padding: 8px 11px; }
  .console-divider { padding: 0 12px; }
  #output { padding: 14px 12px; }
}
@media (max-width: 500px) {
  .account-button { padding-right: 9px; }
  .account-heading { padding-bottom: 18px; }
  .account-form { padding: 18px; }
  textarea { font-size: 14px; padding: 12px; }
  .code-editor { --gutter-width: 42px; }
  #code, #highlight, #line-numbers { font-size: 14px; padding-top: 12px; padding-bottom: 12px; }
  #code, #highlight { padding-left: 12px; padding-right: 12px; }
}
