:root {
  --xdc-blue: #0b57d0;
  --xdc-blue-dark: #0846a8;
  --xdc-purple: #5b21b6;
  --xdc-bg: #fff;
  --xdc-nav: #fafafa;
  --xdc-line: #e8eaed;
  --xdc-text: #202124;
  --xdc-muted: #5f6368;
  --xdc-folder: #fbbc04;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; font-family: "Segoe UI", system-ui, sans-serif; color: var(--xdc-text); background: #fff; }
button, input, select { font: inherit; }
.xdc-login-body { min-height: 100%; background: linear-gradient(180deg, #eef4ff 0%, #fff 45%); display: flex; align-items: center; justify-content: center; }
.xdc-login { width: 100%; max-width: 420px; padding: 24px; }
.xdc-login-card { background: #fff; border: 1px solid var(--xdc-line); border-radius: 16px; padding: 28px; box-shadow: 0 12px 40px rgba(11,87,208,.08); }
.xdc-login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.xdc-login-logo { height: 40px; width: auto; max-width: 160px; object-fit: contain; }
.xdc-login-brand strong { display: block; font-size: 1.05rem; }
.xdc-login-brand span { color: var(--xdc-muted); font-size: .9rem; }
.xdc-login-co { margin: 0 0 12px; color: var(--xdc-muted); font-size: .9rem; }
.xdc-login h1 { margin: 8px 0 6px; font-size: 1.45rem; }
.xdc-login-sub, .xdc-login-foot { color: var(--xdc-muted); font-size: .88rem; }
.xdc-login-err { background: #fef2f2; color: #b91c1c; border-radius: 8px; padding: 8px 10px; margin: 10px 0; }
.xdc-login label { display: block; margin: 12px 0 4px; font-weight: 600; font-size: .88rem; }
.xdc-in { width: 100%; border: 1px solid #c4c7cc; border-radius: 8px; padding: 10px 12px; }
.xdc-in:focus { outline: 2px solid #c5d8ff; border-color: var(--xdc-blue); }
.xdc-btn-primary { background: var(--xdc-blue); color: #fff; border: 0; border-radius: 8px; padding: 10px 16px; cursor: pointer; font-weight: 600; }
.xdc-btn-primary:hover { background: var(--xdc-blue-dark); }
.xdc-btn-block { width: 100%; margin-top: 16px; }
.xdc-app-body { display: flex; flex-direction: column; height: 100%; overflow: hidden; }
.xdc-top { display: flex; justify-content: space-between; align-items: center; height: 56px; padding: 0 16px; border-bottom: 2px solid var(--xdc-blue); background: linear-gradient(180deg, #f7f9ff, #fff); flex: 0 0 56px; }
.xdc-top-left, .xdc-top-right { display: flex; align-items: center; gap: 10px; }
.xdc-top-logo { height: 32px; width: auto; max-width: 140px; object-fit: contain; }
.xdc-word { font-weight: 700; }
.xdc-pill { font-size: 11px; border: 1px solid #c5d8ff; color: var(--xdc-blue); border-radius: 99px; padding: 1px 8px; }
.xdc-sep { width: 1px; height: 18px; background: #dadce0; }
.xdc-drive-title { font-weight: 600; }
.xdc-avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--xdc-blue); color: #fff; display: grid; place-items: center; font-size: 12px; font-weight: 700; }
.xdc-logout { margin: 0; }
.xdc-logout button { border: 0; background: transparent; color: var(--xdc-muted); cursor: pointer; }
.xdc-shell { display: flex; flex: 1; min-height: 0; }
.xdc-nav { width: 232px; background: var(--xdc-nav); border-right: 1px solid var(--xdc-line); padding: 10px 8px; display: flex; flex-direction: column; gap: 2px; overflow: auto; }
.xdc-nav button { text-align: left; border: 0; background: transparent; padding: 9px 12px; border-radius: 8px; cursor: pointer; color: #3c4043; }
.xdc-nav button:hover { background: #eef1f5; }
.xdc-nav button.is-on { background: #e8eaed; font-weight: 600; color: var(--xdc-blue); }
.xdc-nav hr { border: 0; border-top: 1px solid var(--xdc-line); margin: 10px 8px; }
.xdc-main { flex: 1; min-width: 0; overflow: auto; padding: 22px 28px 40px; }
.xdc-h { font-size: 1.45rem; margin: 0 0 6px; }
.xdc-muted { color: var(--xdc-muted); }
.xdc-home-welcome { text-align: center; padding: 28px 12px 12px; }
.xdc-home-welcome h2 { font-size: 1.8rem; font-weight: 500; margin: 18px 0 18px; }
.xdc-search { display: flex; gap: 8px; max-width: 640px; margin: 0 auto 18px; }
.xdc-search input { flex: 1; border: 1px solid #dadce0; border-radius: 8px; padding: 10px 12px; }
.xdc-chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-bottom: 28px; }
.xdc-chips button { border: 1px solid #dadce0; background: #fff; border-radius: 99px; padding: 6px 14px; cursor: pointer; }
.xdc-chips button.is-on { background: var(--xdc-blue); color: #fff; border-color: var(--xdc-blue); }
.xdc-empty { text-align: center; color: var(--xdc-muted); padding: 48px 12px; }
.xdc-empty strong { display: block; color: var(--xdc-text); font-size: 1.15rem; margin-bottom: 6px; }
.xdc-folder-row { display: flex; gap: 28px; justify-content: center; margin-bottom: 8px; }
.xdc-folder-row button { border: 0; background: transparent; cursor: pointer; }
.xdc-folder-ico { width: 36px; height: 28px; background: var(--xdc-folder); border-radius: 3px 3px 2px 2px; margin: 0 auto 6px; position: relative; }
.xdc-folder-ico:before { content: ""; position: absolute; left: 0; top: -6px; width: 14px; height: 8px; background: #f4b400; border-radius: 2px 2px 0 0; }
.xdc-files { display: flex; min-height: 100%; margin: -22px -28px; }
.xdc-tree { width: 240px; border-right: 1px solid var(--xdc-line); padding: 12px; overflow: auto; background: #fcfcfd; }
.xdc-tree button { display: block; width: 100%; text-align: left; border: 0; background: transparent; padding: 6px 8px; border-radius: 6px; cursor: pointer; }
.xdc-tree button.is-on { background: #e8f0fe; color: var(--xdc-blue); }
.xdc-files-main { flex: 1; padding: 18px 22px; min-width: 0; }
.xdc-toolbar { display: flex; gap: 8px; align-items: center; margin: 10px 0 14px; }
.xdc-up { margin: 0 0 14px; padding: 12px 14px; border: 1px solid #d2e3fc; background: #f8fbff; border-radius: 12px; }
.xdc-up-head { display: flex; justify-content: space-between; align-items: center; font-size: .9rem; margin-bottom: 8px; }
.xdc-up-head strong { font-weight: 700; }
.xdc-up-bar { height: 10px; background: #e8eaed; border-radius: 99px; overflow: hidden; }
.xdc-up-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #0b57d0, #4285f4); border-radius: 99px; transition: width .15s linear; }
.xdc-up.is-run .xdc-up-bar i { animation: xdc-up-pulse 1.1s ease-in-out infinite; }
.xdc-up.is-done { border-color: #ceead6; background: #e6f4ea; }
.xdc-up.is-done .xdc-up-bar i { width: 100% !important; background: #137333; animation: none; }
.xdc-up.is-done .xdc-up-head strong:before { content: "✓ "; }
.xdc-up.is-err { border-color: #fad2cf; background: #fce8e6; }
.xdc-up.is-err .xdc-up-bar i { background: #c5221f; animation: none; }
.xdc-up-msg { margin-top: 8px; color: var(--xdc-muted); font-size: .82rem; word-break: break-all; }
@keyframes xdc-up-pulse {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.18); }
}
.xdc-create { background: var(--xdc-blue); color: #fff; border: 0; border-radius: 8px; padding: 8px 14px; cursor: pointer; font-weight: 600; }
.xdc-act-wrap { overflow: auto; }
.xdc-table { width: 100%; border-collapse: collapse; }
.xdc-table th { text-align: left; font-weight: 600; font-size: .82rem; color: var(--xdc-muted); border-bottom: 1px solid var(--xdc-line); padding: 8px; }
.xdc-table td { padding: 10px 8px; border-bottom: 1px solid #f1f3f4; }
.xdc-table tr:hover { background: #f8fafc; }
.xdc-name { display: flex; align-items: center; gap: 10px; }
.xdc-menu-btn { border: 0; background: transparent; cursor: pointer; padding: 4px 8px; }
.xdc-menu { position: absolute; right: 24px; background: #fff; border: 1px solid #dadce0; border-radius: 10px; box-shadow: 0 8px 28px rgba(0,0,0,.12); min-width: 240px; z-index: 20; padding: 6px 0; }
.xdc-menu button { display: block; width: 100%; text-align: left; border: 0; background: transparent; padding: 8px 14px; cursor: pointer; }
.xdc-menu button:hover { background: #f1f3f4; }
.xdc-menu .danger { color: #d93025; }
.xdc-modal { position: fixed; inset: 0; background: rgba(32,33,36,.45); display: grid; place-items: center; z-index: 40; }
.xdc-modal[hidden] { display: none; }
.xdc-modal-card { background: #fff; border-radius: 12px; width: min(520px, 92vw); padding: 18px 20px 16px; box-shadow: 0 16px 48px rgba(0,0,0,.2); }
.xdc-modal-card h3 { margin: 0 0 12px; }
.xdc-modal-card label { display: block; margin: 10px 0 4px; font-size: .88rem; }
.xdc-modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.xdc-btn { border: 1px solid #dadce0; background: #fff; border-radius: 8px; padding: 8px 14px; cursor: pointer; }
.xdc-ai { max-width: 720px; margin: 24px auto; padding: 0 12px 24px; text-align: center; }
.xdc-ai h2 { font-weight: 500; }
.xdc-ai-box { border: 1px solid #dadce0; border-radius: 16px; padding: 12px; text-align: left; margin-top: 24px; }
.xdc-ai-box textarea { width: 100%; border: 0; resize: none; min-height: 52px; outline: none; }
.xdc-ai-actions { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 8px; flex-wrap: wrap; }
.xdc-ai-save { margin-top: 8px; font-size: .85rem; }
.xdc-ai-file { margin-top: 10px; padding: 8px 10px; background: #fff; border: 1px solid #dadce0; border-radius: 8px; font-size: .9rem; text-align: left; }
.xdc-ai-file a { color: #0b57d0; font-weight: 600; }
.xdc-ai-log { text-align: left; margin: 16px 0; }
.xdc-ai-log .me { background: #e8f0fe; border-radius: 10px; padding: 8px 10px; margin: 6px 0; white-space: pre-wrap; }
.xdc-ai-log .bot { background: #f8fafc; border-radius: 10px; padding: 8px 10px; margin: 6px 0; white-space: pre-wrap; }
.xdc-ai-log .bot.wait { color: #888; font-style: italic; }
.xdc-btn-primary:disabled { opacity: .55; cursor: wait; }
.xdc-filters { display: flex; gap: 8px; margin: 12px 0; flex-wrap: wrap; }
.xdc-filters button { border: 1px solid #dadce0; background: #fff; border-radius: 8px; padding: 6px 10px; cursor: pointer; }
.xdc-filters button.is-on { background: var(--xdc-blue); color: #fff; border-color: var(--xdc-blue); }
.xdc-crumb { color: var(--xdc-muted); margin: 0 0 8px; }
.xdc-crumb button { border: 0; background: transparent; color: var(--xdc-blue); cursor: pointer; }
.xdc-nav-toggle {
  display: none !important;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border-radius: 10px;
  border: 1px solid #dadce0;
  background: #fff;
  cursor: pointer;
  flex-shrink: 0;
}
.xdc-nav-toggle-bars {
  display: block;
  width: 18px;
  height: 2px;
  background: #202124;
  border-radius: 2px;
  position: relative;
}
.xdc-nav-toggle-bars::before,
.xdc-nav-toggle-bars::after {
  content: "";
  position: absolute;
  left: 0;
  width: 18px;
  height: 2px;
  background: #202124;
  border-radius: 2px;
}
.xdc-nav-toggle-bars::before { top: -6px; }
.xdc-nav-toggle-bars::after { top: 6px; }
body.xdc-nav-open .xdc-nav-toggle-bars { background: transparent; }
body.xdc-nav-open .xdc-nav-toggle-bars::before { top: 0; transform: rotate(45deg); }
body.xdc-nav-open .xdc-nav-toggle-bars::after { top: 0; transform: rotate(-45deg); }
.xdc-nav-overlay { display: none; }
.xdc-nav-phone-extra { display: none; }

/* Phone only: hamburger for Home / Files / Recent / AI / … */
@media (max-width: 768px) {
  .xdc-nav-toggle { display: inline-flex !important; }
  .xdc-sep, .xdc-drive-title, .xdc-desk-only { display: none !important; }
  .xdc-word { font-size: .92rem; }
  .xdc-pill { display: none; }
  .xdc-top { padding: 0 10px; gap: 8px; }
  .xdc-top-left { min-width: 0; gap: 8px; }
  .xdc-top-right { gap: 8px; }
  .xdc-nav-overlay {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, .45);
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease;
    z-index: 90;
  }
  body.xdc-nav-open .xdc-nav-overlay {
    opacity: 1;
    pointer-events: auto;
  }
  .xdc-nav {
    position: fixed;
    top: 56px;
    left: 0;
    bottom: 0;
    width: min(280px, 88vw);
    z-index: 120;
    transform: translateX(-105%);
    transition: transform .2s ease;
    box-shadow: 8px 0 28px rgba(0,0,0,.18);
    border-right: 0;
    padding: 12px 10px 24px;
  }
  body.xdc-nav-open .xdc-nav { transform: translateX(0); }
  .xdc-nav button {
    font-size: 1rem;
    padding: 12px 14px;
    width: 100%;
  }
  .xdc-nav-phone-extra {
    display: block;
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid var(--xdc-line);
  }
  .xdc-nav-phone-extra a,
  .xdc-nav-phone-extra button {
    display: block;
    width: 100%;
    text-align: left;
    border: 0;
    background: transparent;
    padding: 12px 14px;
    border-radius: 8px;
    color: #3c4043;
    text-decoration: none;
    cursor: pointer;
  }
  .xdc-main { padding: 14px 14px 36px; }
  .xdc-home-welcome { padding: 16px 4px 8px; }
  .xdc-home-welcome h2 { font-size: 1.35rem; }
  .xdc-search { max-width: none; }
  .xdc-folder-row { gap: 16px; flex-wrap: wrap; }
  .xdc-files { flex-direction: column; margin: -14px; }
  .xdc-tree { width: 100%; max-height: 140px; border-right: 0; border-bottom: 1px solid var(--xdc-line); }
  .xdc-files-main { padding: 12px 14px; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .xdc-toolbar { flex-wrap: wrap; }
  .xdc-table { min-width: 520px; }
  .xdc-ai { margin: 8px auto; padding: 0 0 16px; }
  .xdc-ai-actions { flex-direction: column; align-items: stretch; }
  .xdc-modal-card { width: calc(100vw - 24px); }
  body.xdc-nav-open { overflow: hidden; }
}

/* Laptop / desktop: sidebar tabs, never hamburger */
@media (min-width: 769px) {
  .xdc-nav-toggle { display: none !important; }
  .xdc-nav-overlay { display: none !important; }
  .xdc-nav-phone-extra { display: none !important; }
}
