* { box-sizing: border-box; }
html, body {
  margin: 0; height: 100%;
  font: 14px -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif;
  color: #1d1d1f;
  background: linear-gradient(180deg, #a9d3f0 0%, #7ab7e0 45%, #4a90c9 100%);
  background-attachment: fixed;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }

/* --- Top chrome --------------------------------------------------------- */
#chrome { position: sticky; top: 0; z-index: 20; }
#topbar {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 20px;
  background: rgba(255,255,255,0.35);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid rgba(255,255,255,0.4);
}
.app-title { font-size: 17px; font-weight: 600; letter-spacing: -0.2px; color: #1d1d1f; }
.spacer { flex: 1; }
.icon-btn {
  width: 32px; height: 32px; padding: 0;
  display: grid; place-items: center;
  background: transparent; border: none; border-radius: 8px; cursor: pointer;
  color: #1d1d1f;
}
.icon-btn:hover { background: rgba(255,255,255,0.5); }
.icon-btn svg { width: 20px; height: 20px; }
.avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg, #ff9500, #ff2d55);
  color: #fff; font-weight: 600; font-size: 13px;
  border: none; cursor: pointer;
  display: grid; place-items: center;
}

/* --- Dropdown menus ----------------------------------------------------- */
.menu {
  position: absolute; top: 50px; right: 20px;
  background: rgba(245,245,247,0.9);
  backdrop-filter: blur(30px) saturate(180%);
  -webkit-backdrop-filter: blur(30px) saturate(180%);
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 14px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
  padding: 12px;
  min-width: 260px;
}
.menu[hidden] { display: none; }
#apps-menu { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; width: 300px; }
.app-tile {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 10px 6px; border-radius: 10px; cursor: pointer;
  text-align: center; font-size: 11px; color: #1d1d1f;
}
.app-tile:hover { background: rgba(0,0,0,0.06); }
.app-tile .app-icon {
  width: 44px; height: 44px; border-radius: 10px;
  display: grid; place-items: center; color: #fff; font-size: 20px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}
.create-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 8px; cursor: pointer;
  font-size: 13px;
}
.create-item:hover { background: rgba(0,0,0,0.06); }

/* --- Main view ---------------------------------------------------------- */
#view { padding: 24px 32px 48px; max-width: 1400px; margin: 0 auto; }

/* --- Home dashboard ----------------------------------------------------- */
.dash-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.card {
  background: rgba(255,255,255,0.7);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-radius: 18px;
  padding: 20px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
  border: 1px solid rgba(255,255,255,0.5);
  min-height: 200px;
  display: flex; flex-direction: column;
}
.card.wide { grid-column: span 2; }
.card-head {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 14px;
}
.card-head h3 { margin: 0; font-size: 13px; font-weight: 600; color: #6e6e73; text-transform: none; letter-spacing: 0.2px; }
.card-head .card-icon {
  width: 22px; height: 22px; border-radius: 6px;
  display: grid; place-items: center; color: #fff; font-size: 13px;
}
.card-body { flex: 1; }
.card-empty {
  flex: 1; display: grid; place-items: center;
  color: #86868b; font-size: 13px; text-align: center;
}

/* Profile card */
.profile-card {
  background: linear-gradient(160deg, rgba(255,255,255,0.85), rgba(255,255,255,0.55));
}
.profile-avatar {
  width: 72px; height: 72px; border-radius: 50%;
  background: linear-gradient(135deg, #ff9500, #ff2d55);
  color: #fff; display: grid; place-items: center;
  font-size: 30px; font-weight: 600;
  margin: 8px 0 14px;
}
.profile-name { font-size: 22px; font-weight: 600; margin: 0 0 2px; color: #1d1d1f; text-transform: none; letter-spacing: -0.3px; }
.info-headline { font-size: 15px; color: #1d1d1f; margin-bottom: 6px; }
.info-sub { font-size: 13px; color: #6e6e73; line-height: 1.4; }
.card.clickable { cursor: pointer; transition: transform 120ms ease, box-shadow 120ms ease; }
.card.clickable:hover { transform: translateY(-2px); box-shadow: 0 8px 30px rgba(0,0,0,0.12); }
.card.tall { min-height: 400px; }
.coming-title { font-size: 20px; color: #1d1d1f; margin-bottom: 8px; }
.plan-line .ok { color: #34c759; }
.profile-mail { color: #6e6e73; font-size: 13px; margin: 0 0 16px; }
.plan-line { display: flex; justify-content: space-between; padding: 6px 0; font-size: 13px; border-top: 1px solid rgba(0,0,0,0.06); }
.plan-line:first-of-type { border-top: none; }
.plan-line .k { color: #6e6e73; }

/* Apps card */
.apps-card-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.apps-card-grid .app-tile { padding: 8px 4px; }
.apps-card-grid .app-icon { width: 40px; height: 40px; font-size: 18px; }

/* Customize row */
.customize-row {
  display: flex; align-items: center; justify-content: space-between;
  margin: 4px 4px 20px;
}
.customize-row h2 { margin: 0; font-size: 22px; font-weight: 600; letter-spacing: -0.3px; color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,0.15); }
.pill-btn {
  background: rgba(255,255,255,0.9); color: #0071e3;
  border: none; border-radius: 100px; padding: 6px 14px;
  font-size: 12px; font-weight: 500; cursor: pointer;
}
.pill-btn:hover { background: #fff; }

/* --- Drive route -------------------------------------------------------- */
.drive-wrap {
  display: grid; grid-template-columns: 220px 1fr; gap: 16px;
}
.drive-sidebar {
  background: rgba(255,255,255,0.7);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-radius: 18px;
  padding: 12px 8px;
  border: 1px solid rgba(255,255,255,0.5);
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
  height: fit-content;
}
.side-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px; margin: 2px 0; border-radius: 8px;
  font-size: 13px; cursor: pointer; color: #1d1d1f;
}
.side-item:hover { background: rgba(0,0,0,0.06); }
.side-item.active { background: #0071e3; color: #fff; }
.side-item.active .side-icon { color: #fff; }
.side-icon { width: 16px; height: 16px; color: #6e6e73; }
.side-section { padding: 8px 12px 4px; font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; color: #86868b; font-weight: 600; }

.drive-main {
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,0.5);
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
  min-height: 500px;
  display: flex; flex-direction: column;
  overflow: hidden;
}
.drive-toolbar {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid rgba(0,0,0,0.08);
}
.crumbs { font-size: 15px; font-weight: 500; }
.crumbs .sep { color: #86868b; margin: 0 6px; }
.crumbs .crumb { cursor: pointer; }
.crumbs .crumb:hover { color: #0071e3; }
.tool-btn {
  border: none; background: rgba(0,0,0,0.06); border-radius: 8px;
  padding: 6px 12px; font-size: 12px; cursor: pointer;
}
.tool-btn:hover { background: rgba(0,0,0,0.1); }
.tool-btn.primary { background: #0071e3; color: #fff; }
.tool-btn.primary:hover { background: #0077ed; }
.tool-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.drive-body { flex: 1; display: flex; min-height: 0; }
.drive-list {
  flex: 1; overflow: auto; padding: 8px 0;
  border-right: 1px solid rgba(0,0,0,0.08);
  min-width: 260px;
}
.file-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 20px; cursor: pointer; font-size: 13px;
}
.file-row:hover { background: rgba(0,0,0,0.04); }
.file-row.active { background: rgba(0,113,227,0.12); }
.file-row .file-icon { width: 18px; text-align: center; color: #6e6e73; }
.file-row .file-name { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.drive-viewer { flex: 2; display: flex; flex-direction: column; overflow: hidden; }
.viewer-empty {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  color: #86868b; padding: 40px;
}
.viewer-empty h2 { color: #1d1d1f; font-size: 22px; font-weight: 500; margin: 0 0 8px; }
.viewer-empty p { margin: 0; font-size: 13px; max-width: 320px; text-align: center; line-height: 1.5; }
.viewer-empty .big-icon {
  width: 60px; height: 60px; border-radius: 14px;
  background: rgba(0,0,0,0.06);
  display: grid; place-items: center; margin-bottom: 20px;
  color: #86868b;
}

#editor {
  flex: 1; width: 100%;
  background: #fff; color: #1d1d1f;
  border: none; outline: none; padding: 16px 20px;
  font: 13px ui-monospace, "SF Mono", Menlo, monospace;
  resize: none;
}
#media {
  flex: 1; overflow: auto; display: grid; place-items: center;
  padding: 20px; background: #fafafa;
}
#media img, #media video { max-width: 100%; max-height: 100%; border-radius: 6px; }
#media embed { width: 100%; height: 100%; min-height: 500px; }
