* {
  box-sizing: border-box;
  font-family: system-ui, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
}

body {
  margin: 0;
  background: #f9f7f3;
  color: #2c3e2f;
}

header {
  background: #2e5e3b;
  color: white;
  padding: 1.5rem;
  text-align: center;
}

header h1 { margin: 0; font-size: 1.8rem; }
header p { margin: 0.5rem 0 0; opacity: 0.9; }

.container {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  max-width: 1400px;
  margin: 2rem auto;
  padding: 0 1rem;
}

main {
  flex: 3;
  min-width: 250px;
}

aside {
  flex: 1.2;
  min-width: 260px;
  background: white;
  border-radius: 24px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
  padding: 1rem;
  position: sticky;
  top: 1rem;
  align-self: start;
  max-height: 85vh;
  overflow-y: auto;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-bottom: 1.5rem;
  align-items: center;
}

#searchInput {
  flex: 2;
  padding: 0.6rem 1rem;
  border: 1px solid #ccc;
  border-radius: 40px;
  font-size: 1rem;
}

button {
  background: #2e5e3b;
  border: none;
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 40px;
  cursor: pointer;
  font-weight: 500;
  transition: 0.2s;
}

button:hover { background: #1f4228; transform: scale(0.98); }
button:active { transform: scale(0.96); }

.table-wrapper {
  overflow-x: auto;
  border-radius: 20px;
  background: white;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

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

th, td {
  text-align: left;
  padding: 0.8rem;
  border-bottom: 1px solid #eee;
}

th {
  background: #e9f0e6;
  color: #2c3e2f;
}

tr:hover { background: #fef9e6; }

td button {
  padding: 0.3rem 0.8rem;
  margin-right: 0.5rem;
  font-size: 0.8rem;
  background: #5a7c5e;
}

td button:first-child { background: #2e5e3b; }
td button:last-child { background: #b08968; }

#playlist {
  list-style: none;
  padding: 0;
  margin: 0 0 1rem 0;
  max-height: 300px;
  overflow-y: auto;
}

#playlist li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem;
  border-bottom: 1px solid #ddd;
  cursor: grab;
}

#playlist li.dragging { opacity: 0.5; }
#playlist li span { flex: 1; cursor: pointer; }
#playlist li button { background: #c97e5a; padding: 0.2rem 0.6rem; margin-left: 0.5rem; }

.player-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1rem 0;
  justify-content: center;
}

.player-controls button { background: #4a6b4e; }

#nowPlaying {
  background: #f0ebe1;
  padding: 0.6rem;
  border-radius: 20px;
  font-size: 0.9rem;
  text-align: center;
}

.single-idiom {
  max-width: 700px;
  margin: 2rem auto;
  background: white;
  border-radius: 28px;
  padding: 2rem;
  box-shadow: 0 8px 20px rgba(0,0,0,0.1);
}

.single-idiom h2 { font-size: 2.2rem; margin-top: 0; color: #2e5e3b; }
.playlist-btn, .share-row button { background: #b08968; margin-top: 1rem; margin-right: 1rem; }
.copy-message { margin-left: 1rem; color: green; font-size: 0.8rem; }

@media (max-width: 800px) {
  .container { flex-direction: column; }
  aside { position: static; max-height: none; }
}