:root {
  color-scheme: light;
  --bg: #f3f2f1;
  --card: #ffffff;
  --text: #242424;
  --muted: #605e5c;
  --line: #edebe9;
  --accent: #0f6cbd;
  --accent-hover: #115ea3;
  --danger: #c50f1f;
  --ok: #0e7c3a;
  --warn: #8a6116;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", "Segoe UI Variable", sans-serif;
  font-size: 13px;
  line-height: 1.45;
}

.pane {
  height: 100%;
  min-height: 0;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow: hidden;
}

.view {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.topbar h1,
.section-title {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
}

.section-title {
  margin: 8px 0 2px;
}

.icon-button {
  appearance: none;
  width: 28px;
  height: 28px;
  border: 1px solid #d1d1d1;
  border-radius: 4px;
  background: #fff;
  color: var(--text);
  font: inherit;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}

.icon-button:hover {
  background: #f5f5f5;
}

.hint {
  margin: 0;
  color: var(--muted);
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px;
}

.project-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.project-item {
  display: flex;
  align-items: center;
  gap: 4px;
}

.project-row {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-width: 0;
  flex: 1 1 auto;
  border: 1px solid transparent;
  background: #f3f2f1;
  color: var(--text);
  font: inherit;
  font-weight: 600;
  text-align: left;
  padding: 11px 6px;
  border-radius: 4px;
  cursor: pointer;
}

button.project-row:hover:not(:disabled) {
  background: #e1dfdd;
  color: var(--text);
}

.save-mail-icon {
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  padding: 0;
  display: grid;
  place-items: center;
  background: transparent;
  color: var(--accent);
  border: 1px solid transparent;
}

.save-mail-icon:hover:not(:disabled) {
  background: #e1dfdd;
  color: var(--accent-hover);
}

.save-mail-icon svg {
  display: block;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #c8c6c4;
  flex: 0 0 auto;
}

.dot.fresh {
  background: var(--ok);
}

.dot.due {
  background: #eaa300;
}

.project-name {
  font-weight: 600;
}

.folder-meta {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.banner {
  flex: 0 0 auto;
  margin: 0;
  padding: 8px 10px;
  border-radius: 4px;
  background: #fff;
  border: 1px solid var(--line);
}

.banner.error {
  color: var(--danger);
  border-color: #e6bec0;
  background: #fdf3f4;
}

.banner.warn {
  color: var(--warn);
  border-color: #eadcb3;
  background: #fff9eb;
}

.banner.ok {
  color: var(--ok);
  border-color: #b9d9c4;
  background: #f3faf5;
}

label,
.field-label {
  display: grid;
  gap: 4px;
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 12px;
}

label.choice {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

label.choice input {
  width: auto;
  flex: 0 0 auto;
  margin-top: 3px;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid #d1d1d1;
  border-radius: 4px;
  padding: 6px 8px;
  font: inherit;
  color: var(--text);
  background: #fff;
}

textarea {
  min-height: 64px;
  resize: vertical;
}

#project-description {
  min-height: 160px;
}

#comment-input {
  min-height: 7.5rem;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.form-actions {
  flex-direction: column;
  align-items: stretch;
}

.form-actions > button {
  width: 100%;
}

.save-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0 0 12px;
}

.save-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.save-label {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.save-row select,
.save-row input {
  width: auto;
  min-width: 0;
  flex: 1 1 auto;
  margin: 0;
}

#dialog-progress-select {
  flex: 0 0 5.6rem;
  width: 5.6rem;
}

.save-block > button {
  width: 100%;
}

.dialog-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(36, 36, 36, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 10;
}

.dialog-card {
  width: min(100%, 360px);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 12px;
}

.dialog-card .section-title {
  margin: 0 0 8px;
}

#comment-dialog-title {
  white-space: pre-line;
}

#comment-dialog .dialog-card {
  width: min(100%, 420px);
}

.comment-images {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.comment-images:empty {
  display: none;
}

.comment-thumb {
  position: relative;
}

.comment-thumb img {
  display: block;
  max-width: 120px;
  max-height: 80px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
}

.comment-thumb button {
  position: absolute;
  top: 2px;
  right: 2px;
  padding: 0 5px;
  line-height: 1.4;
}

.dialog-card .actions {
  justify-content: flex-end;
}

button {
  appearance: none;
  border: 1px solid transparent;
  background: var(--accent);
  color: #fff;
  border-radius: 4px;
  padding: 7px 10px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

button:hover:not(:disabled) {
  background: var(--accent-hover);
}

button.secondary {
  background: #fff;
  color: var(--text);
  border-color: #d1d1d1;
}

button.secondary:hover:not(:disabled) {
  background: #f5f5f5;
}

button.danger {
  background: #fff;
  color: var(--danger);
  border-color: #e6bec0;
}

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.mail-preview {
  margin: 0 0 8px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fafafa;
}

.preview-subject {
  margin: 0;
  font-weight: 600;
}

.mail-preview-body {
  margin: 8px 0 0;
  max-height: 140px;
  overflow: auto;
  white-space: pre-wrap;
  font: inherit;
  color: var(--muted);
}

[hidden] {
  display: none !important;
}
