/* Pod Manager. Tokens follow the MathSecr design system (DS.MathSecr). */
@font-face {
  font-family: "Pretendard Variable";
  font-display: swap;
  src: url("https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/packages/pretendard/dist/web/variable/woff2/PretendardVariable.woff2") format("woff2-variations");
}
:root {
  --g050: #f5f5f7; --g100: #e5e5e8; --g200: #cacacf; --g300: #afafb8; --g400: #9494a0; --g500: #797988; --g600: #61616d; --g700: #494952; --g800: #313138; --g900: #19191c;
  --b025: #f4f6ff; --b050: #e6e6ff; --b500: #2d34ff; --b700: #0008ea; --b075: #b2b2c9;
  --red: #e64747; --red-bg: #fff3f3; --green: #1f9d55; --amber: #c27a00; --orange: #ff8000;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body { display: flex; min-height: 100vh; font: 14px/22px "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, system-ui, "Apple SD Gothic Neo", "Noto Sans KR", sans-serif; color: var(--g900); background: #fff; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
h1 { font-size: 24px; line-height: 32px; font-weight: 700; margin: 0; letter-spacing: -.02em; }
h2 { font-size: 15px; line-height: 22px; font-weight: 700; margin: 0; }
p { margin: 0; }
code { font: 13px/20px var(--mono); }
svg { display: block; }

/* side navigation */
.side-nav { position: sticky; top: 0; height: 100vh; width: 80px; flex-shrink: 0; border-right: 1px solid var(--g100); display: flex; flex-direction: column; padding: 28px 10px 20px; z-index: 20; background: #fff; }
.logo { width: 36px; height: 36px; margin: 0 auto 24px; border-radius: 10px; background: var(--b500); color: #fff; display: grid; place-items: center; }
.logo svg { width: 20px; height: 20px; }
.side-nav nav { flex: 1; display: grid; gap: 6px; align-content: start; }
.nav-item { height: 58px; border-radius: 10px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--g400); font-size: 11.5px; font-weight: 500; transition: background .12s, color .12s; }
.nav-item svg { width: 22px; height: 22px; }
.nav-item:hover { background: var(--g050); color: var(--g700); }
.nav-item.on { background: var(--b050); color: var(--b500); font-weight: 700; }
.side-nav .gap { height: 1px; background: var(--g100); margin: 6px 8px; }
.acct { position: relative; display: flex; justify-content: center; }
.acct > button { border: 0; background: none; padding: 0; cursor: pointer; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--g050); color: var(--g700); display: grid; place-items: center; font-weight: 700; font-size: 14px; }
.acct .pop { left: calc(100% + 14px); right: auto; bottom: 0; top: auto; min-width: 240px; }

/* page */
.content { flex: 1; min-width: 0; }
main { max-width: 1040px; margin: 0 auto; padding: 40px 40px 96px; }
main.narrow { max-width: 800px; }
.head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 28px; min-height: 40px; }
.head .l { display: flex; align-items: center; gap: 12px; min-width: 0; }
.head .r { display: flex; align-items: center; gap: 8px; }
.crumb { font-size: 13px; color: var(--g400); margin-bottom: 6px; }
.crumb a:hover { color: var(--g700); }
.sub { font-size: 13px; line-height: 20px; color: var(--g500); }
.muted { color: var(--g500); }
.bad { color: var(--red); }
.mono { font-family: var(--mono); font-size: 13px; }
.grow { flex: 1; min-width: 0; }
.row { display: flex; align-items: center; gap: 8px; }
/* minmax(0, 1fr): a child with long unbreakable content shrinks instead of widening the column */
.stack { display: grid; grid-template-columns: minmax(0, 1fr); gap: 32px; align-content: start; }
.cols { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 48px; align-items: start; }
.cols > * { min-width: 0; }
.clip { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* an address fills what is left of the row, right-aligned; when it does not fit, its end is cut, not its start */
.addr { flex: 1; text-align: right; }
@media (max-width: 900px) { .cols { grid-template-columns: 1fr; gap: 32px; } main { padding: 24px 20px 72px; } }

/* sections and lists */
.sec-h { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; min-height: 28px; }
.box { border: 1px solid var(--g100); border-radius: 12px; }
.box > :first-child { border-top-left-radius: 11px; border-top-right-radius: 11px; }
.box > :last-child { border-bottom-left-radius: 11px; border-bottom-right-radius: 11px; }
.box table { border-radius: 11px; overflow: hidden; }
.item { display: flex; align-items: center; gap: 16px; padding: 14px 16px; min-height: 56px; }
.item + .item { border-top: 1px solid var(--g100); }
a.item:hover, .item.link:hover { background: var(--g050); cursor: pointer; }
.item b { font-weight: 600; }
.empty { padding: 28px 16px; text-align: center; color: var(--g400); font-size: 13px; }
.blank { padding: 96px 0; text-align: center; }
.blank h2 { font-size: 18px; margin-bottom: 6px; }
.blank .btn { margin-top: 20px; }

/* status */
.st { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 500; color: var(--g600); white-space: nowrap; }
.st i { width: 8px; height: 8px; border-radius: 50%; background: var(--g300); }
.st.Running i { background: var(--green); }
.st.Failed { color: var(--red); } .st.Failed i { background: var(--red); }
.st.Pending i, .st.Starting i, .st.Creating i, .st.Stopping i { background: var(--amber); animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { opacity: .25; } }
.tag { display: inline-block; font-size: 12px; line-height: 18px; font-weight: 500; padding: 1px 7px; border-radius: 6px; background: var(--g050); color: var(--g600); white-space: nowrap; }
.tag.blue { background: var(--b050); color: var(--b500); }
.tag.red { background: var(--red-bg); color: var(--red); }

/* buttons */
.btn { font: inherit; font-weight: 600; height: 36px; padding: 0 14px; border: 1px solid var(--g100); border-radius: 10px; background: #fff; color: var(--g800); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap; transition: background .12s; }
.btn:hover { background: var(--g050); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: var(--b500); border-color: var(--b500); color: #fff; }
.btn.primary:hover { background: var(--b700); border-color: var(--b700); }
.btn.primary:disabled { background: var(--b075); border-color: var(--b075); opacity: 1; }
.btn.danger { color: var(--red); }
.btn.danger.solid { background: var(--red); border-color: var(--red); color: #fff; }
.btn.sm { height: 30px; padding: 0 10px; font-size: 13px; border-radius: 8px; }
.tbtn { font: inherit; font-size: 13px; font-weight: 600; color: var(--b500); background: none; border: 0; padding: 4px 6px; border-radius: 6px; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; }
.tbtn:hover { background: var(--b025); }
.ibtn { width: 28px; height: 28px; border: 0; background: none; border-radius: 7px; color: var(--g400); cursor: pointer; display: inline-grid; place-items: center; flex-shrink: 0; }
.ibtn:hover { background: var(--g100); color: var(--g800); }
.ibtn svg { width: 16px; height: 16px; }

/* command line */
.cmd { display: flex; align-items: center; gap: 4px; background: var(--g050); border-radius: 8px; padding: 0 4px 0 12px; height: 36px; min-width: 0; }
.cmd code { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--g800); }
pre.block { margin: 0; background: var(--g900); color: #dcdce2; border-radius: 12px; padding: 14px 16px; font: 12.5px/19px var(--mono); white-space: pre-wrap; word-break: break-all; max-height: 520px; overflow: auto; }
.term-wrap { position: relative; }
.term { height: 560px; background: var(--g900); border-radius: 12px; padding: 10px; overflow: hidden; }
.term .xterm-viewport { scrollbar-width: thin; scrollbar-color: #4a4a52 transparent; }
.term .xterm-viewport::-webkit-scrollbar { width: 8px; }
.term .xterm-viewport::-webkit-scrollbar-track { background: transparent; }
.term .xterm-viewport::-webkit-scrollbar-thumb { background: #4a4a52; border-radius: 4px; }
.term-end { position: absolute; left: 0; right: 0; bottom: 0; display: flex; align-items: center; justify-content: center; gap: 12px; padding: 14px; border-radius: 0 0 12px 12px; background: rgba(25, 25, 28, .92); color: #cfcfd6; font-size: 13.5px; }
.term-end[hidden] { display: none; }

/* forms */
input, select, textarea { font: inherit; height: 40px; padding: 0 12px; border: 1px solid var(--g200); border-radius: 10px; background: #fff; color: var(--g900); width: 100%; min-width: 0; }
textarea { height: auto; min-height: 88px; padding: 10px 12px; font: 13px/20px var(--mono); resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--b500); box-shadow: 0 0 0 3px var(--b050); }
input::placeholder, textarea::placeholder { color: var(--g300); }
input[readonly] { background: var(--g050); color: var(--g500); }
.field { display: grid; gap: 6px; }
.field > span { font-size: 13px; font-weight: 600; color: var(--g700); }
.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.fields.two { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: end; }
.hint { font-size: 12.5px; line-height: 18px; color: var(--g400); }
/* a value shown blurred until clicked */
.veil { filter: blur(4.5px); opacity: .7; cursor: pointer; user-select: none; transition: filter .25s ease, opacity .25s ease; }
.veil:hover { filter: blur(3.5px); opacity: .85; }
.veil.shown { filter: none; opacity: 1; user-select: text; }
.keyline { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.keyline.open { white-space: normal; word-break: break-all; }
.check { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.check input { width: 16px; height: 16px; }
.opts { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 8px; }
.opt { text-align: left; font: inherit; border: 1px solid var(--g200); border-radius: 12px; background: #fff; padding: 12px 14px; cursor: pointer; color: var(--g900); display: grid; gap: 2px; }
.opt:hover { border-color: var(--g400); }
.opt:disabled { cursor: not-allowed; background: var(--g050, #f7f7f8); color: var(--g500); }
.opt:disabled:hover { border-color: var(--g200); }
.opt.on { border-color: var(--b500); box-shadow: inset 0 0 0 1px var(--b500); background: var(--b025); }
.opt b { font-weight: 600; }
.opt span { font-size: 12.5px; line-height: 18px; color: var(--g500); }
.seg { display: inline-flex; background: var(--g050); border-radius: 10px; padding: 3px; }
.seg button { font: inherit; font-size: 13px; font-weight: 600; border: 0; background: none; height: 30px; padding: 0 14px; border-radius: 8px; color: var(--g500); cursor: pointer; }
.seg button.on { background: #fff; color: var(--g900); box-shadow: 0 1px 2px rgba(25, 25, 28, .12); }
.form { display: grid; gap: 36px; }
.form-foot { position: sticky; bottom: 0; background: #fff; border-top: 1px solid var(--g100); margin-top: 40px; padding: 16px 0; display: flex; align-items: center; gap: 20px; }

/* tabs, meters, key-values */
.tabs { display: flex; gap: 24px; border-bottom: 1px solid var(--g100); margin-bottom: 32px; }
.tabs a { padding: 10px 0; font-weight: 600; color: var(--g400); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a:hover { color: var(--g700); }
.tabs a.on { color: var(--g900); border-color: var(--g900); }
.meter { display: grid; gap: 6px; min-width: 0; }
.meter .lbl { display: flex; justify-content: space-between; gap: 8px; font-size: 12.5px; line-height: 18px; color: var(--g500); white-space: nowrap; }
.meter .lbl b { color: var(--g900); font-weight: 600; }
.bar { height: 4px; border-radius: 99px; background: var(--g100); position: relative; overflow: hidden; }
.bar > i { position: absolute; top: 0; bottom: 0; left: 0; background: var(--b500); border-radius: 99px; }
.bar > i.add { opacity: .3; }
.bar > i.used { background: var(--g900); }
.bar.over > i { background: var(--red); }
.kv { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 10px 12px; font-size: 13px; line-height: 20px; margin: 0; }
.kv dt { color: var(--g400); }
.kv dd { margin: 0; min-width: 0; word-break: break-all; }
.steps { display: flex; gap: 4px; }
.step { flex: 1; display: grid; gap: 6px; font-size: 12px; color: var(--g400); }
.step i { height: 3px; border-radius: 99px; background: var(--g100); }
.step.done { color: var(--g700); } .step.done i { background: var(--g900); }
.step.now { color: var(--amber); font-weight: 600; } .step.now i { background: var(--amber); animation: pulse 1.2s infinite; }
.notice { border-radius: 12px; padding: 14px 16px; background: var(--g050); display: grid; gap: 8px; }
.notice.bad { background: var(--red-bg); color: var(--red); }
.notice.blue { background: var(--b025); }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--g100); border-radius: 12px; }
.stats > div { padding: 18px 20px; }
.stats > div + div { border-left: 1px solid var(--g100); }
.stats b { display: block; font-size: 26px; line-height: 34px; font-weight: 700; letter-spacing: -.02em; }
.stats b small { font-size: 15px; font-weight: 500; color: var(--g400); }
.stats span { font-size: 13px; color: var(--g500); }

/* tables */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 12px 16px; vertical-align: middle; }
th { font-size: 12.5px; font-weight: 500; color: var(--g400); border-bottom: 1px solid var(--g100); white-space: nowrap; }
tr + tr td { border-top: 1px solid var(--g100); }
tr.link { cursor: pointer; }
tr.link:hover td { background: var(--g050); }
td.r { text-align: right; white-space: nowrap; }

/* workspace list */
.ws-row { display: grid; grid-template-columns: minmax(180px, 1fr) minmax(0, 1.2fr) auto; gap: 20px; align-items: center; padding: 14px 16px; min-height: 68px; }
.ws-row + .ws-row { border-top: 1px solid var(--g100); }
.ws-id { display: flex; align-items: center; gap: 12px; min-width: 0; }
.ws-id b { font-size: 15px; font-weight: 600; }
.ws-id:hover b { color: var(--b500); }
@media (max-width: 760px) { .ws-row { grid-template-columns: 1fr auto; } .ws-row .mid { grid-column: 1 / -1; grid-row: 2; } }

/* popovers, dialogs, toast */
.menu { position: relative; display: inline-block; }
.pop { position: absolute; right: 0; top: calc(100% + 4px); background: #fff; border: 1px solid var(--g100); border-radius: 12px; box-shadow: 0 8px 28px rgba(25, 25, 28, .14); min-width: 150px; padding: 6px; z-index: 30; }
.pop .who { padding: 8px 10px 10px; }
.pop .item { display: block; width: 100%; min-height: 0; text-align: left; border: 0; background: none; padding: 8px 10px; border-radius: 8px; font: inherit; color: var(--g800); cursor: pointer; }
.pop .item + .item { border-top: 0; }
.pop .item:hover { background: var(--g050); }
.pop .item.danger { color: var(--red); }
.pop .sep { height: 1px; background: var(--g100); margin: 6px 0; }
.modal-bg { position: fixed; inset: 0; background: rgba(25, 25, 28, .5); display: grid; place-items: center; z-index: 50; padding: 16px; }
.modal { background: #fff; border-radius: 20px; width: min(440px, 100%); max-height: calc(100vh - 32px); overflow: auto; padding: 28px; display: grid; gap: 20px; box-shadow: 0 16px 48px rgba(25, 25, 28, .24); }
.modal h2 { font-size: 18px; line-height: 26px; }
.modal .desc { color: var(--g500); margin-top: 6px; }
.modal-b { display: grid; gap: 14px; }
.modal-f { display: flex; justify-content: flex-end; gap: 8px; }
.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); padding: 10px 16px; border-radius: 10px; background: var(--g900); color: #fff; z-index: 60; font-weight: 500; max-width: 560px; }
.toast.bad { background: var(--red); }
