/* ==========================================================================
   DORAEMON HOSTING — Page-Specific Layouts (Auth, Servers, Workspace, Files)
   ========================================================================== */
.auth-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 20px 16px; position: relative;
  background: radial-gradient(ellipse 80% 55% at 50% -12%, var(--accent-soft), transparent 68%), var(--bg);
}
.auth-theme-toggle { position: fixed; top: 16px; right: 16px; z-index: 10; }
.auth-shell {
  width: 100%; max-width: 920px; display: grid; grid-template-columns: 1fr;
  border-radius: 16px; border: 1px solid var(--border); background: var(--surface); overflow: hidden;
}
@media (min-width: 820px) { .auth-shell { grid-template-columns: 1fr 1fr; } }
.auth-left {
  display: none; flex-direction: column; justify-content: space-between; padding: 38px 34px;
  background: linear-gradient(160deg, #0b0f17 0%, #111827 100%);
  border-right: 1px solid var(--border); color: #fafafa;
}
@media (min-width: 820px) { .auth-left { display: flex; } }
.auth-brand { display: flex; align-items: center; gap: 11px; }
.auth-brand img { width: 36px; height: 36px; border-radius: 9px; }
.auth-brand-title { font-size: 16px; font-weight: 700; }
.auth-brand-title span { color: var(--accent-fg); }
.auth-brand-sub { font-size: 12px; color: #a1a1aa; }
.auth-headline { font-size: 26px; font-weight: 700; line-height: 1.2; letter-spacing: -0.025em; margin-top: 28px; }
.auth-copy { font-size: 13.5px; color: #a1a1aa; margin-top: 10px; line-height: 1.6; }
.auth-points { display: flex; flex-direction: column; gap: 14px; margin: 28px 0; }
.auth-point { display: flex; align-items: flex-start; gap: 11px; }
.auth-point-ic {
  width: 32px; height: 32px; border-radius: 8px; background: var(--accent-soft);
  border: 1px solid var(--border-strong); display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.auth-point-ic .ic { filter: invert(100%) brightness(200%); }
.auth-point strong { display: block; font-size: 13px; color: #fafafa; }
.auth-point span { display: block; font-size: 12px; color: #a1a1aa; }

.auth-right { padding: 34px 26px; display: flex; flex-direction: column; justify-content: center; }
@media (min-width: 600px) { .auth-right { padding: 40px 36px; } }
.auth-mobile-logo { display: flex; align-items: center; gap: 10px; margin-bottom: 20px; }
.auth-mobile-logo img { width: 32px; height: 32px; border-radius: 8px; }
@media (min-width: 820px) { .auth-mobile-logo { display: none; } }
.auth-title { font-size: 23px; font-weight: 700; letter-spacing: -0.02em; }
.auth-sub { font-size: 13.5px; color: var(--text-2); margin: 4px 0 20px; }
.auth-err { background: var(--red-soft); border: 1px solid rgba(239, 68, 68, 0.3); color: var(--red); padding: 9px 12px; border-radius: var(--radius-sm); font-size: 12.5px; margin-bottom: 14px; }
.verify-card {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 12px; margin: 12px 0 16px; border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong); background: var(--bg); cursor: pointer; user-select: none;
}
.verify-card.is-verified { border-color: var(--green); background: var(--green-soft); }
.verify-box {
  width: 20px; height: 20px; border-radius: 5px; border: 2px solid var(--border-strong);
  display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 800; color: var(--green);
}
.verify-card.is-verifying .verify-box { border-color: var(--accent); border-top-color: transparent; border-radius: 50%; animation: spin 0.65s linear infinite; }
.verify-card.is-verified .verify-box { border-color: var(--green); }
.auth-sep { display: flex; align-items: center; gap: 10px; margin: 18px 0 12px; font-size: 11px; color: var(--text-3); font-weight: 600; letter-spacing: 0.06em; }
.auth-sep::before, .auth-sep::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.auth-links { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.auth-legal { display: flex; justify-content: center; gap: 10px; margin-top: 16px; font-size: 12px; color: var(--text-3); }
.link-btn { background: none; border: none; color: var(--text-2); font-family: var(--font); font-size: 12px; cursor: pointer; text-decoration: underline; }
.link-btn:hover { color: var(--accent-fg); }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 20px; }
.page-title { font-size: clamp(22px, 3vw, 28px); font-weight: 700; letter-spacing: -0.025em; line-height: 1.18; }
.page-desc { font-size: 13.5px; color: var(--text-2); margin-top: 4px; }

.kpi-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 20px; }
@media (min-width: 900px) { .kpi-grid { grid-template-columns: repeat(4, 1fr); } }
.kpi-card {
  padding: 16px; border-radius: var(--radius-md); background: var(--surface); border: 1px solid var(--border);
  display: flex; align-items: flex-start; justify-content: space-between; gap: 10px;
}
.kpi-lbl { font-size: 11.5px; font-weight: 500; color: var(--text-2); }
.kpi-val { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; margin-top: 4px; line-height: 1.15; }
.kpi-val small { font-size: 12px; font-weight: 500; color: var(--text-2); }
.kpi-sub { font-size: 11.5px; color: var(--text-3); margin-top: 4px; }
.kpi-ic { width: 34px; height: 34px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }

.srv-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 720px) { .srv-grid { grid-template-columns: repeat(2, 1fr); } }
.srv-card {
  padding: 16px; border-radius: var(--radius-md); background: var(--surface); border: 1px solid var(--border);
  cursor: pointer; transition: border-color 0.14s ease, transform 0.14s ease;
}
.srv-card:hover { border-color: var(--accent); transform: translateY(-1px); }
.srv-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.srv-card-id { display: flex; align-items: center; gap: 11px; min-width: 0; }
.srv-rt-box { width: 40px; height: 40px; border-radius: 9px; background: var(--surface-2); border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.srv-name { font-size: 15.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.srv-meta { font-size: 12px; color: var(--text-2); margin-top: 2px; }
.srv-card-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap;
  margin-top: 14px; padding-top: 11px; border-top: 1px solid var(--border);
  font-family: var(--mono); font-size: 11.5px; color: var(--text-2);
}

.ws-hero {
  padding: 18px; border-radius: var(--radius-md); background: var(--surface); border: 1px solid var(--border);
  margin-bottom: 14px; display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap;
}
.ws-hero-l { display: flex; align-items: center; gap: 12px; min-width: 0; }
.ws-hero-r { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.addr-chip {
  display: inline-flex; align-items: center; gap: 6px; max-width: 100%;
  padding: 3px 9px; border-radius: 6px; background: var(--bg); border: 1px solid var(--border);
  font-family: var(--mono); font-size: 11.5px; color: var(--text-2); cursor: pointer;
}
.addr-chip:hover { border-color: var(--border-strong); color: var(--text); }

.tab-bar {
  display: flex; align-items: center; gap: 6px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 16px;
  border-bottom: 1px solid var(--border); scrollbar-width: none;
}
.tab-bar::-webkit-scrollbar { display: none; }
.tab-pill {
  display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 12px;
  border-radius: var(--radius-xs); border: 1px solid transparent; background: transparent;
  color: var(--text-2); font-family: var(--font); font-size: 12.5px; font-weight: 500;
  cursor: pointer; white-space: nowrap; flex-shrink: 0;
}
.tab-pill:hover { background: var(--surface-2); color: var(--text); }
.tab-pill.active { background: var(--accent-soft); border-color: rgba(99, 102, 241, 0.28); color: var(--accent-fg); font-weight: 600; }

.metrics-3 { display: grid; grid-template-columns: 1fr; gap: 12px; margin-bottom: 16px; }
@media (min-width: 720px) { .metrics-3 { grid-template-columns: repeat(3, 1fr); } }
.metric-box { padding: 15px; border-radius: var(--radius-md); background: var(--surface); border: 1px solid var(--border); }
.metric-top { display: flex; align-items: center; justify-content: space-between; font-size: 12px; color: var(--text-2); }
.metric-num { font-size: 20px; font-weight: 700; margin: 6px 0 8px; }
.metric-num small { font-size: 12px; font-weight: 500; color: var(--text-3); }
.bar-track { height: 5px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.bar-fill { height: 100%; border-radius: 99px; background: var(--accent); transition: width 0.25s ease; }

.term-box { border-radius: var(--radius-md); border: 1px solid var(--border); background: #09090b; overflow: hidden; margin-bottom: 16px; }
.term-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; padding: 9px 12px; background: #111114; border-bottom: 1px solid #232329; font-size: 12.5px; font-weight: 600; color: #fafafa; }
.term-out { font-family: var(--mono); font-size: 12px; line-height: 1.6; color: #e4e4e7; padding: 12px 14px; height: 280px; overflow-y: auto; white-space: pre-wrap; word-break: break-word; }
.term-chips { display: flex; gap: 6px; padding: 7px 12px; overflow-x: auto; background: #0d0d10; border-top: 1px solid #232329; }
.chip { padding: 3px 9px; border-radius: 99px; border: 1px solid #27272a; background: #18181c; color: #d4d4d8; font-family: var(--mono); font-size: 11px; cursor: pointer; white-space: nowrap; }
.chip:hover { border-color: var(--accent); color: #ffffff; }
.term-in-bar { display: flex; align-items: center; gap: 8px; padding: 8px 12px; background: #111114; border-top: 1px solid #232329; }
.term-in { flex: 1; background: transparent; border: none; color: #ffffff; font-family: var(--mono); font-size: 12.5px; outline: none; }

.dropzone { border: 1.5px dashed var(--border-strong); border-radius: var(--radius-sm); padding: 14px; text-align: center; font-size: 12.5px; color: var(--text-2); margin-bottom: 12px; }
.dropzone.over { border-color: var(--accent); background: var(--accent-soft); color: var(--text); }
.path-bar { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; padding: 7px 10px; margin-bottom: 10px; border-radius: var(--radius-xs); background: var(--bg-subtle); border: 1px solid var(--border); font-family: var(--mono); font-size: 12px; }
.path-btn { background: none; border: none; color: var(--text-2); font-family: var(--mono); font-size: 12px; cursor: pointer; padding: 2px 5px; border-radius: 4px; }
.path-btn:hover { color: var(--accent-fg); background: var(--surface-2); }

.plans-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.plan-card { padding: 16px; border-radius: var(--radius-md); background: var(--bg-subtle); border: 1px solid var(--border); display: flex; flex-direction: column; gap: 8px; }
.plan-card.popular { border-color: var(--accent); }
.plan-price { font-size: 22px; font-weight: 700; }
.plan-price small { font-size: 12px; font-weight: 500; color: var(--text-2); }
.plan-list { list-style: none; font-size: 12.5px; color: var(--text-2); display: flex; flex-direction: column; gap: 5px; margin: 4px 0 8px; }

/* Reference-Video Console Fullscreen & Color-Coded Stream Lines */
.term-box.is-full {
  position: fixed; inset: 12px; z-index: 950; display: flex; flex-direction: column; margin: 0;
}
.term-box.is-full .term-out { flex: 1; height: auto !important; }
.log-daemon { color: #facc15; font-weight: 600; }
.log-container { color: #f8fafc; font-weight: 700; }
.log-err { color: #f87171; font-weight: 600; }
.log-notice { color: #38bdf8; }

/* AI Help Responsive Chat Interface */
.ai-chat-wrap {
  display: flex; flex-direction: column; border-radius: var(--radius-md);
  border: 1px solid var(--border); background: var(--surface); overflow: hidden;
  min-height: 440px; max-height: calc(100vh - 210px);
}
.ai-chat-msgs {
  flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 12px;
}
.ai-bubble {
  max-width: 86%; padding: 11px 14px; border-radius: 12px; font-size: 13.5px;
  line-height: 1.55; white-space: pre-wrap; word-break: break-word;
}
.ai-bubble-user {
  align-self: flex-end; background: var(--accent); color: #ffffff; border-bottom-right-radius: 4px;
}
.ai-bubble-bot {
  align-self: flex-start; background: var(--bg-subtle); border: 1px solid var(--border);
  color: var(--text); border-bottom-left-radius: 4px;
}
.ai-bubble-err {
  align-self: flex-start; background: var(--red-soft); border: 1px solid rgba(239, 68, 68, 0.3);
  color: var(--red); border-bottom-left-radius: 4px;
}
.ai-chat-form {
  display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--border); background: var(--bg-subtle);
}

/* Redesigned Auth Shell Elevation & Warm Light Mode */
.auth-shell {
  box-shadow: var(--shadow-modal);
  border: 1px solid var(--border-strong);
}
.auth-right .btn-primary {
  background: var(--accent);
  color: var(--accent-on);
  font-weight: 600;
}
.auth-right .btn-primary:hover:not(:disabled) {
  background: var(--accent-hover);
}
.auth-right .btn-primary .ic {
  filter: invert(6%) sepia(12%) saturate(750%) hue-rotate(185deg) brightness(95%) contrast(98%) !important;
}
html[data-theme="light"] .auth-right .btn-primary .ic {
  filter: invert(100%) brightness(200%) !important;
}
html[data-theme="light"] .auth-left {
  background: linear-gradient(160deg, #291810 0%, #1c130e 100%);
  color: #fffaf3;
}
