:root {
  color-scheme: light;
  --desktop: #83a9ad;
  --window: #d5dde0;
  --window-light: #f8fbfb;
  --window-dark: #6f8488;
  --title: #007f78;
  --title-dark: #01544f;
  --ink: #11181b;
  --muted: #4c5d61;
  --danger: #a12323;
  --ok: #0b6f37;
  font-family: Tahoma, Verdana, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--desktop);
  color: var(--ink);
  font-size: 14px;
}

[hidden] { display: none !important; }

button, input, select, textarea { font: inherit; }
button { cursor: pointer; }

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 18px;
}

.desktop {
  min-height: 100vh;
  display: grid;
  grid-template-rows: 42px minmax(0, 1fr);
}

.taskbar {
  display: grid;
  grid-template-columns: max-content 1fr max-content max-content;
  align-items: center;
  gap: 12px;
  padding: 4px 8px;
  border-bottom: 2px solid var(--window-dark);
  background: #cbd5d8;
}

.tabs {
  display: flex;
  gap: 4px;
  min-width: 0;
}

.tab {
  min-height: 30px;
  min-width: 88px;
  border: 2px solid;
  border-color: var(--window-light) var(--window-dark) var(--window-dark) var(--window-light);
  background: var(--window);
}

.tab.active {
  background: #edf3f4;
  font-weight: 700;
}

.workspace {
  min-width: 0;
  padding: 12px;
}

.ce-window {
  border: 2px solid;
  border-color: var(--window-light) var(--window-dark) var(--window-dark) var(--window-light);
  background: var(--window);
  box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.18);
}

.login-window {
  width: min(420px, 100%);
}

.titlebar {
  min-height: 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 3px 8px;
  color: white;
  background: linear-gradient(90deg, var(--title-dark), var(--title));
  font-weight: 700;
}

.window-buttons {
  letter-spacing: 0;
  opacity: 0.9;
}

.window-body {
  padding: 12px;
}

.grid-two {
  display: grid;
  grid-template-columns: minmax(240px, 360px) minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.pane {
  min-width: 0;
  border: 1px solid var(--window-dark);
  background: #eef3f4;
  padding: 10px;
}

.detail-pane {
  display: grid;
  gap: 12px;
}

.toolbar,
.button-row,
.row-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.toolbar {
  justify-content: space-between;
  margin-bottom: 10px;
}

.toolbar h2 {
  margin: 0;
}

.form-grid,
.link-grid {
  display: grid;
  gap: 10px;
}

label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  min-height: 32px;
  border: 2px solid;
  border-color: var(--window-dark) var(--window-light) var(--window-light) var(--window-dark);
  border-radius: 0;
  background: white;
  color: var(--ink);
  padding: 5px 7px;
}

textarea {
  resize: vertical;
}

.ce-button {
  min-height: 31px;
  border: 2px solid;
  border-color: var(--window-light) var(--window-dark) var(--window-dark) var(--window-light);
  background: var(--window);
  color: var(--ink);
  padding: 4px 10px;
  font-weight: 700;
}

.ce-button:active {
  border-color: var(--window-dark) var(--window-light) var(--window-light) var(--window-dark);
}

.ce-button.primary {
  color: #062b2a;
  background: #a7e4df;
}

.ce-button.danger {
  color: white;
  background: var(--danger);
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.list {
  display: grid;
  gap: 6px;
  max-height: calc(100vh - 150px);
  overflow: auto;
}

.list-item {
  width: 100%;
  display: grid;
  gap: 3px;
  text-align: left;
  border: 1px solid #6f8488;
  background: #fff;
  padding: 8px;
}

.list-item.selected {
  outline: 2px solid var(--title);
  background: #dff7f4;
}

.list-item span,
.photo-row span,
.empty {
  color: var(--muted);
}

.link-panel,
.photo-panel {
  border: 1px solid var(--window-dark);
  background: #fbfdfd;
  padding: 10px;
}

.link-panel h2,
.photo-panel h2 {
  font-size: 1rem;
  margin: 0 0 8px;
}

.photo-table {
  display: grid;
  gap: 8px;
}

.photo-row {
  display: grid;
  grid-template-columns: 92px minmax(180px, 1fr) 150px 170px max-content;
  gap: 8px;
  align-items: start;
  border: 1px solid #91a3a7;
  background: #fff;
  padding: 8px;
}

.photo-row img {
  width: 92px;
  height: 72px;
  object-fit: cover;
  border: 1px solid #6f8488;
  background: #d5dde0;
}

.photo-row strong,
.photo-row span {
  display: block;
}

.error {
  min-height: 20px;
  color: var(--danger);
  font-weight: 700;
}

@media (max-width: 980px) {
  .taskbar,
  .grid-two {
    grid-template-columns: 1fr;
  }

  .taskbar {
    min-height: auto;
  }

  .photo-row {
    grid-template-columns: 86px minmax(0, 1fr);
  }

  .photo-row label,
  .photo-row .row-actions {
    grid-column: 1 / -1;
  }
}

