/* Terra OS apps: Explorer, project pages, case studies, TerraDM, About, Notepad, Settings. */

/* ---------- Shared app parts ---------- */
.pad {
  padding: 22px 26px 30px;
}
.row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 34px;
  padding: 0 16px;
  border-radius: 6px;
  background: var(--win-3);
  border: 1px solid var(--line-2);
  font-size: 13px;
  text-decoration: none;
  color: var(--text);
  white-space: nowrap;
}
.btn:hover {
  filter: brightness(1.12);
}
.btn:active {
  filter: brightness(0.95);
}
.btn.primary {
  background: var(--accent);
  border-color: transparent;
  color: var(--accent-ink);
  font-weight: 600;
}
.btn svg {
  width: 16px;
  height: 16px;
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.chip {
  padding: 3px 10px;
  border-radius: 99px;
  font-size: 12px;
  background: var(--win-3);
  border: 1px solid var(--line);
  color: var(--text-2);
}
.status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
}
.status::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 8px currentColor;
}
.bar {
  height: 6px;
  border-radius: 99px;
  background: var(--win-3);
  overflow: hidden;
}
.muted {
  color: var(--text-2);
}
.small {
  font-size: 12px;
}
h1,
h2,
h3,
h4 {
  margin: 0;
  line-height: 1.2;
}
.label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-3);
  margin: 22px 0 10px;
}

/* ---------- File Explorer ---------- */
.fx {
  display: grid;
  grid-template-rows: auto 1fr auto;
  height: 100%;
}
.fx-tools {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  background: var(--win-2);
}
.fx-tools .icon-btn {
  width: 32px;
  height: 32px;
}
.fx-tools .icon-btn:disabled {
  opacity: 0.35;
}
.fx-path {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 2px;
  height: 32px;
  padding: 0 10px;
  border-radius: 6px;
  background: var(--win);
  border: 1px solid var(--line);
  overflow: hidden;
  font-size: 13px;
}
.fx-path button {
  padding: 2px 6px;
  border-radius: 4px;
  white-space: nowrap;
}
.fx-path button:hover {
  background: var(--hover);
}
.fx-path svg {
  width: 12px;
  height: 12px;
  color: var(--text-3);
  flex: none;
}
.fx-find {
  width: 190px;
  height: 32px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  border-radius: 6px;
  background: var(--win);
  border: 1px solid var(--line);
}
.fx-find svg {
  width: 15px;
  height: 15px;
  color: var(--text-3);
  flex: none;
}
.fx-find input {
  border: 0;
  background: none;
  outline: none;
  width: 100%;
  min-width: 0;
  font-size: 13px;
}
.fx-main {
  display: grid;
  grid-template-columns: 196px 1fr;
  min-height: 0;
}
.fx-nav {
  overflow-y: auto;
  padding: 8px 6px;
  border-right: 1px solid var(--line);
}
.fx-nav button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  border-radius: 5px;
  font-size: 13px;
  text-align: left;
}
.fx-nav button:hover {
  background: var(--hover);
}
.fx-nav button[aria-current='true'] {
  background: var(--win-3);
  box-shadow: inset 3px 0 0 var(--accent);
}
.fx-nav .ico {
  width: 20px;
  height: 20px;
  flex: none;
}
.fx-nav hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 8px 6px;
}
.fx-view {
  overflow-y: auto;
  padding: 12px 14px;
}
.fx-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
  gap: 4px;
}
.fx-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px 6px 10px;
  border-radius: 6px;
  border: 1px solid transparent;
  text-align: center;
  font-size: 12.5px;
}
.fx-item:hover {
  background: var(--hover);
}
.fx-item[aria-selected='true'] {
  background: rgba(34, 197, 94, 0.16);
  border-color: rgba(34, 197, 94, 0.4);
}
.fx-item .ico {
  width: 54px;
  height: 54px;
}
.fx-item small {
  color: var(--text-3);
}
.fx-list {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.fx-list th {
  text-align: left;
  font-weight: 400;
  color: var(--text-2);
  font-size: 12px;
  padding: 6px 10px;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: -12px;
  background: var(--win);
}
.fx-list td {
  padding: 7px 10px;
  white-space: nowrap;
}
.fx-list tr.item:hover td {
  background: var(--hover);
}
.fx-list tr.item[aria-selected='true'] td {
  background: rgba(34, 197, 94, 0.16);
}
.fx-list .nm {
  display: flex;
  align-items: center;
  gap: 10px;
}
.fx-list .ico {
  width: 22px;
  height: 22px;
  flex: none;
}
.fx-list .prog {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 150px;
}
.fx-list .prog .bar {
  flex: none;
  width: 96px;
  height: 5px;
}
.fx-list td:last-child {
  max-width: 230px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.fx-status {
  padding: 5px 14px;
  font-size: 12px;
  color: var(--text-2);
  border-top: 1px solid var(--line);
}
.fx-home h4 {
  font-size: 13px;
  font-weight: 600;
  margin: 6px 4px 10px;
}
.fx-empty {
  padding: 40px;
  text-align: center;
  color: var(--text-2);
}

/* ---------- Project page ---------- */
.proj-hero {
  position: relative;
  height: 190px;
  background: linear-gradient(135deg, hsl(var(--h, 150) 50% 22%), #050a08);
  overflow: hidden;
}
.proj-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.85;
}
.proj-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 30%, var(--win));
}
.proj-head {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 18px;
  align-items: flex-end;
  margin: -54px 26px 0;
}
.proj-head .ico {
  width: 86px;
  height: 86px;
  flex: none;
  filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.4));
}
.proj-head h2 {
  font-size: 24px;
}
.proj-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 6px;
}
.progress-card {
  margin-top: 18px;
  padding: 14px 16px;
  border-radius: 10px;
  background: var(--win-2);
  border: 1px solid var(--line);
}
.progress-card .row {
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 13px;
}
.progress-card .bar {
  height: 8px;
}
.cols {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 26px;
}
.ticks {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
}
.ticks li {
  display: flex;
  gap: 10px;
  font-size: 13.5px;
}
.ticks svg {
  width: 16px;
  height: 16px;
  flex: none;
  margin-top: 2px;
  color: var(--accent);
}
.gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.gallery img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #000;
}

/* ---------- Case study ---------- */
.client {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px 5px 6px;
  border-radius: 99px;
  background: rgba(220, 38, 38, 0.12);
  border: 1px solid rgba(248, 113, 113, 0.3);
  font-size: 12.5px;
  font-weight: 600;
}
.client i {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: conic-gradient(#e11d48 0 33%, #2563eb 0 66%, #16a34a 0);
}
.mods {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 8px;
}
.mod {
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--win-2);
  border: 1px solid var(--line);
  font-size: 13px;
}
.mock {
  margin-top: 4px;
  display: grid;
  grid-template-columns: 150px 1fr;
  height: 250px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--line-2);
  background: #f4f6f8;
  color: #1e293b;
  font-size: 11px;
}
.mock-side {
  background: #0f2a4a;
  color: #cbd5e1;
  padding: 10px 8px;
  display: grid;
  align-content: start;
  gap: 4px;
}
.mock-side b {
  color: #fff;
  font-size: 12px;
  margin-bottom: 6px;
}
.mock-side span {
  padding: 4px 6px;
  border-radius: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mock-side span:first-of-type {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}
.mock-main {
  padding: 12px;
  display: grid;
  grid-template-rows: auto auto 1fr;
  gap: 10px;
  min-width: 0;
}
.mock-kpis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.mock-kpis div {
  background: #fff;
  border-radius: 6px;
  padding: 8px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}
.mock-kpis b {
  display: block;
  font-size: 16px;
}
.mock-table {
  background: #fff;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}
.mock-table div {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 0.8fr;
  padding: 6px 8px;
  border-top: 1px solid #eef2f6;
}
.mock-table div:first-child {
  background: #e8eef6;
  font-weight: 600;
  border: 0;
}
.pill {
  justify-self: start;
  padding: 1px 7px;
  border-radius: 99px;
  font-size: 10px;
  font-weight: 600;
}
.pill.ok {
  background: #dcfce7;
  color: #166534;
}
.pill.due {
  background: #fef3c7;
  color: #92400e;
}
.pill.hi {
  background: #fee2e2;
  color: #991b1b;
}
.note {
  font-size: 12px;
  color: var(--text-3);
  margin-top: 8px;
}

/* ---------- TerraDM ---------- */
.tdm {
  display: grid;
  grid-template-rows: auto 1fr auto;
  height: 100%;
  background: var(--win);
}
.tdm-tools {
  display: flex;
  gap: 2px;
  padding: 6px 8px;
  border-bottom: 1px solid var(--line);
  background: var(--win-2);
  overflow-x: auto;
}
.tdm-tools button {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  min-width: 64px;
  padding: 6px 8px;
  border-radius: 6px;
  font-size: 11.5px;
}
.tdm-tools button:hover:not(:disabled) {
  background: var(--hover);
}
.tdm-tools button:disabled {
  opacity: 0.4;
}
.tdm-tools svg {
  width: 20px;
  height: 20px;
}
.tdm-main {
  display: grid;
  grid-template-columns: 170px 1fr;
  min-height: 0;
}
.tdm-cats {
  padding: 8px 6px;
  border-right: 1px solid var(--line);
  font-size: 13px;
}
.tdm-cats button {
  width: 100%;
  text-align: left;
  padding: 6px 10px;
  border-radius: 5px;
  display: flex;
  justify-content: space-between;
}
.tdm-cats button:hover {
  background: var(--hover);
}
.tdm-cats button[aria-current='true'] {
  background: var(--win-3);
}
.tdm-cats small {
  color: var(--text-3);
}
.tdm-table {
  overflow: auto;
}
.tdm-table table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.tdm-table th {
  text-align: left;
  font-weight: 400;
  font-size: 12px;
  color: var(--text-2);
  padding: 7px 10px;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  background: var(--win);
}
.tdm-table td {
  padding: 8px 10px;
  white-space: nowrap;
  border-bottom: 1px solid var(--line);
}
.tdm-table tr.item:hover td {
  background: var(--hover);
}
.tdm-table tr.item[aria-selected='true'] td {
  background: rgba(34, 197, 94, 0.14);
}
.tdm-table .st {
  min-width: 160px;
}
.tdm-table .bar {
  height: 5px;
  margin-top: 4px;
}
.tdm-detail {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 14px;
  border-top: 1px solid var(--line);
  background: var(--win-2);
  font-size: 12.5px;
}
.tdm-detail p {
  flex: 1;
  margin: 0;
  min-width: 0;
}
.dl {
  padding: 18px 20px;
}
.dl-file {
  display: flex;
  gap: 14px;
  align-items: center;
}
.dl-file .ico {
  width: 44px;
  height: 44px;
  flex: none;
}
.dl-file b {
  display: block;
  font-size: 14px;
  word-break: break-all;
}
.dl .bar {
  height: 10px;
  margin: 16px 0 8px;
}
.blocks {
  display: grid;
  grid-template-columns: repeat(32, 1fr);
  gap: 2px;
  margin: 12px 0;
}
.blocks i {
  aspect-ratio: 1;
  border-radius: 2px;
  background: var(--win-3);
  transition: background 0.15s;
}
.blocks i.on {
  background: var(--accent);
  box-shadow: 0 0 6px var(--glow);
}
.blocks i.on2 {
  background: var(--accent-2);
}
.dl-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  font-size: 12px;
  color: var(--text-2);
}
.dl-stats b {
  display: block;
  color: var(--text);
  font-size: 13px;
  font-family: var(--mono);
}
.dl-foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
}

/* ---------- About ---------- */
.about-head {
  display: flex;
  gap: 20px;
  align-items: center;
  padding: 26px 26px 0;
}
.about-head .avatar {
  width: 88px;
  height: 88px;
  font-size: 30px;
  box-shadow: 0 0 0 4px var(--win-2), 0 0 28px var(--glow);
}
.about-head h2 {
  font-size: 26px;
}
.cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.card {
  padding: 14px 16px;
  border-radius: 10px;
  background: var(--win-2);
  border: 1px solid var(--line);
}
.card h4 {
  font-size: 13px;
  margin-bottom: 4px;
}
.card .row {
  justify-content: space-between;
  margin-top: 8px;
}
.timeline {
  margin: 0;
  padding: 0;
  list-style: none;
  border-left: 2px solid var(--line-2);
  display: grid;
  gap: 16px;
}
.timeline li {
  position: relative;
  padding-left: 18px;
}
.timeline li::before {
  content: '';
  position: absolute;
  left: -6px;
  top: 4px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--win);
}
.timeline small {
  color: var(--text-3);
  font-family: var(--mono);
  font-size: 11.5px;
}
.timeline p {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--text-2);
}
.skill-group {
  margin-bottom: 10px;
}
.skill-group b {
  display: block;
  font-size: 12px;
  color: var(--text-2);
  margin-bottom: 6px;
  font-weight: 600;
}

/* ---------- Notepad, settings, reel ---------- */
.notepad {
  height: 100%;
  display: grid;
  grid-template-rows: auto 1fr;
}
.notepad nav {
  display: flex;
  gap: 2px;
  padding: 4px 8px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}
.notepad nav span {
  padding: 4px 10px;
  border-radius: 4px;
}
.notepad pre {
  margin: 0;
  padding: 16px 20px;
  overflow: auto;
  font: 13.5px/1.6 var(--mono);
  white-space: pre-wrap;
}
.set-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 8px;
  background: var(--win-2);
  border: 1px solid var(--line);
  margin-bottom: 8px;
}
.set-row p {
  margin: 2px 0 0;
  font-size: 12px;
  color: var(--text-2);
}
.switch {
  position: relative;
  width: 42px;
  height: 22px;
  border-radius: 99px;
  border: 1px solid var(--text-2);
  flex: none;
}
.switch::after {
  content: '';
  position: absolute;
  top: 4px;
  left: 4px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--text-2);
  transition: transform 0.15s var(--ease);
}
.switch[aria-checked='true'] {
  background: var(--accent);
  border-color: var(--accent);
}
.switch[aria-checked='true']::after {
  transform: translateX(20px);
  background: var(--accent-ink);
}
.math {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.math th,
.math td {
  padding: 8px 10px;
  text-align: right;
  border-bottom: 1px solid var(--line);
}
.math th:first-child,
.math td:first-child {
  text-align: left;
}
.math th {
  color: var(--text-2);
  font-weight: 600;
  font-size: 12px;
}


/* ---------- A game loading in its window ---------- */
.loading {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 14px;
  background: radial-gradient(500px 360px at 50% 45%, #0b2418, #030806);
  color: #e9fff3;
}
.loading .ico {
  width: 64px;
  height: 64px;
}
.loading .bar {
  width: 220px;
}
.bar.indeterminate > span {
  width: 40%;
  transform: none;
  animation: slide 1.1s ease-in-out infinite;
}
@keyframes slide {
  from {
    margin-left: -40%;
  }
  to {
    margin-left: 100%;
  }
}
