
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: 20px;
  background: #e8e8e8;
  color: #1e1e1e;
  display: flex;
  justify-content: center;
  padding: 24px 16px;
  min-height: 100vh;
}

.window {
  width: 100%;
  max-width: 640px;
  background: #f0f0f0;
  border: 1px solid #b0b0b0;
  border-radius: 8px;
  box-shadow: 0 2px 12px rgba(0,0,0,.18), 0 0 0 1px rgba(0,0,0,.04);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.titlebar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: linear-gradient(180deg, #e4e4e4 0%, #d6d6d6 100%);
  border-bottom: 1px solid #b8b8b8;
  user-select: none;
}
.titlebar-dots { display: flex; gap: 7px; }
.titlebar-dot { width: 12px; height: 12px; border-radius: 50%; border: 1px solid rgba(0,0,0,.12); }
.titlebar-dot.red { background: #ff5f57; }
.titlebar-dot.yellow { background: #febc2e; }
.titlebar-dot.green { background: #28c840; }
.titlebar-title {
  flex: 1;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  color: #3c3c3c;
  margin-right: 56px;
}

.body { padding: 16px; display: flex; flex-direction: column; gap: 14px; }

.groupbox {
  border: 1px solid #c4c4c4;
  border-radius: 4px;
  background: #fafafa;
  overflow: hidden;
}
.groupbox-title {
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 600;
  color: #3c3c3c;
  background: #ececec;
  border-bottom: 1px solid #d4d4d4;
}
.groupbox-content { padding: 12px; }

.equation {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.word-input {
  width: 110px;
  padding: 5px 8px;
  font-size: 13px;
  font-family: inherit;
  border: 1px solid #c0c0c0;
  border-radius: 3px;
  background: #fff;
  color: #1e1e1e;
}
.word-input:focus {
  outline: none;
  border-color: #3a8fd4;
  box-shadow: 0 0 0 1px #3a8fd4;
}
.op { font-size: 16px; font-weight: 700; color: #555; user-select: none; padding: 0 2px; }
.op-select {
  font-size: 14px;
  font-weight: 700;
  color: #555;
  background: #fff;
  border: 1px solid #c0c0c0;
  border-radius: 3px;
  padding: 3px 4px;
  cursor: pointer;
  font-family: inherit;
}
.op-select:focus {
  outline: none;
  border-color: #3a8fd4;
  box-shadow: 0 0 0 1px #3a8fd4;
}
.eq { font-size: 16px; font-weight: 700; color: #555; user-select: none; padding: 0 2px; }

.solve-btn {
  padding: 5px 18px;
  font-size: 13px;
  font-family: inherit;
  font-weight: 500;
  border: 1px solid #a8a8a8;
  border-radius: 3px;
  background: linear-gradient(180deg, #fafafa 0%, #e6e6e6 100%);
  color: #1e1e1e;
  cursor: pointer;
}
.solve-btn:hover:not(:disabled) { background: linear-gradient(180deg, #fff 0%, #edeDED 100%); border-color: #888; }
.solve-btn:active:not(:disabled) { background: linear-gradient(180deg, #d4d4d4 0%, #e0e0e0 100%); }
.solve-btn:disabled { opacity: 0.45; cursor: default; }

.presets { display: flex; flex-wrap: wrap; gap: 5px; }
.preset-btn {
  font-size: 12px;
  font-family: inherit;
  padding: 3px 10px;
  border: 1px solid #c0c0c0;
  border-radius: 3px;
  background: linear-gradient(180deg, #fafafa 0%, #eaeaea 100%);
  color: #3c3c3c;
  cursor: pointer;
}
.preset-btn:hover { background: linear-gradient(180deg, #e8f0fa 0%, #d0e0f4 100%); border-color: #8ab4e0; }

.status {
  font-size: 12px;
  color: #555;
  padding: 4px 0;
  min-height: 18px;
}

.results-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  table-layout: fixed;
}
.results-table thead th {
  text-align: left;
  padding: 4px 8px;
  font-weight: 600;
  color: #3c3c3c;
  background: #ececec;
  border: 1px solid #d0d0d0;
  font-size: 11px;
}
.results-table tbody td {
  padding: 4px 8px;
  border: 1px solid #ddd;
  background: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.results-table tbody tr:first-child td { background: #e8f0fa; font-weight: 500; }
.results-table tbody tr:nth-child(even) td { background: #f8f8f8; }
.col-rank { width: 36px; text-align: center; color: #888; }
.col-word { color: #1e1e1e; }
.col-bar { width: 130px; }
.col-score { width: 56px; text-align: right; font-variant-numeric: tabular-nums; color: #555; }

.sim-bar-wrap {
  height: 8px;
  background: #e4e4e4;
  border-radius: 2px;
  overflow: hidden;
  border: 1px solid #ccc;
}
.sim-bar { height: 100%; border-radius: 1px; background: #4a90d9; }

.progress-wrap { }
.progress-bar {
  height: 14px;
  background: #fff;
  border: 1px solid #c0c0c0;
  border-radius: 3px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(180deg, #6db3f2 0%, #4a90d9 100%);
  width: 0%;
  transition: width 0.3s;
  border-radius: 2px;
}
.progress-label { font-size: 11px; color: #666; margin-top: 4px; }

.subtitle { font-size: 12px; color: #666; line-height: 1.4; }
