@import url('https://fonts.googleapis.com/css2?family=Sarabun:wght@400&display=swap');

:root {
  --bg-color: #ffffff;
  --text-color: #000000;
  --font-size: 16px;
  --gap: 12px;
  --icon-filter: none;
  --selection-bg: #cce8ff;
  --selection-text: #000000;
}

[data-theme="dark"] {
  --bg-color: #000000;
  --text-color: #ffffff;
  --icon-filter: invert(1);
  --selection-bg: #0066cc;
  --selection-text: #ffffff;
}

* {
  box-sizing: border-box;
  font-size: inherit;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  background: var(--bg-color);
  color: var(--text-color);
  font-family: "Sarabun", sans-serif;
  font-size: var(--font-size);
  display: flex;
  flex-direction: column;
}

a {
  color: var(--text-color);
  text-decoration: none;
  border-bottom: 1px solid var(--text-color);
  padding-bottom: 2px;
}


button,
input,
select,
textarea {
  font: inherit;
  color: var(--text-color);
  background: var(--bg-color);
  border: 1px solid var(--text-color);
}

button {
  padding: 8px 12px;
  cursor: pointer;
}

input,
select {
  padding: 8px 10px;
}

select {
  appearance: none;
}

select::-ms-expand {
  display: none;
}

textarea {
  width: 100%;
  height: 100%;
  padding: 16px;
  line-height: 1.5;
  resize: none;
  border: 0;
  flex: 1;
}

::placeholder {
  color: var(--text-color);
}

::selection {
  background: var(--selection-bg);
  color: var(--selection-text);
}

::-moz-selection {
  background: var(--selection-bg);
  color: var(--selection-text);
}

button:focus,
input:focus,
select:focus,
textarea:focus,
a:focus {
  outline: 1px solid var(--text-color);
  outline-offset: 2px;
}

input[type=\"checkbox\"],
input[type=\"radio\"] {
  accent-color: var(--text-color);
}

.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--text-color);
  gap: var(--gap);
  flex-wrap: wrap;
}

.top-left,
.top-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.app-icon {
  width: 36px;
  height: 36px;
  filter: var(--icon-filter);
}

.editor-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 16px;
  border-bottom: 1px solid var(--text-color);
}

.status {
  min-width: 160px;
}

.page {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--gap);
  padding: 16px;
}

.panel {
  border: 1px solid var(--text-color);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: var(--gap);
}

.inline {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.table {
  width: 100%;
  border-collapse: collapse;
}

.table th,
.table td {
  border: 1px solid var(--text-color);
  padding: 8px;
  vertical-align: top;
  text-align: left;
}

.table th {
  font-weight: 400;
}

.login-page {
  justify-content: center;
  align-items: center;
}

.auth-card {
  width: 360px;
  max-width: 90vw;
  border: 1px solid var(--text-color);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: var(--gap);
}

.auth-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.form-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.note {
  border: 1px solid var(--text-color);
  padding: 8px;
}