* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 10px;
    padding-bottom: 80px;
}

.container {
    max-width: 600px;
    margin: 0 auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    text-align: center;
}

header h1 {
    font-size: 1.5em;
    margin-bottom: 5px;
}

.subtitle {
    font-size: 0.9em;
    opacity: 0.9;
}

.section {
    padding: 15px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.section-header h2 {
    font-size: 1.2em;
    color: #333;
}

.hint {
    color: #666;
    font-size: 0.85em;
    margin-bottom: 10px;
}

textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    resize: vertical;
    min-height: 150px;
    line-height: 1.6;
}

textarea:focus {
    outline: none;
    border-color: #667eea;
}

.btn {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 10px;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-secondary {
    background: white;
    color: #667eea;
    border: 2px solid #667eea;
}

.btn-success {
    background: #4caf50;
    color: white;
}

.note-list {
    max-height: 300px;
    overflow-y: auto;
    background: #f9f9f9;
    border-radius: 8px;
    padding: 10px;
    margin: 10px 0;
}

.note-item {
    background: white;
    padding: 12px;
    margin-bottom: 8px;
    border-radius: 6px;
    border-left: 3px solid #667eea;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.note-item.has-content {
    border-left-color: #4caf50;
}

.note-item.has-warning {
    border-left-color: #e67e22;
    background: #fff8f0;
}

.note-level-1 { margin-left: 15px; }
.note-level-2 { margin-left: 30px; }
.note-level-3 { margin-left: 45px; }
.note-level-4 { margin-left: 60px; }
.note-level-5 { margin-left: 75px; }

.note-title {
    flex: 1;
    font-weight: 500;
    color: #333;
}

.note-path {
    font-size: 0.8em;
    color: #666;
}

.edit-indicator {
    color: #4caf50;
    font-size: 0.9em;
}

.warning-indicator {
    color: #e67e22;
    font-size: 0.9em;
}

.empty-state {
    color: #999;
    text-align: center;
    padding: 30px;
    font-style: italic;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
}

.modal.active {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 20px;
    overflow-y: auto;
}

.modal-content {
    background: white;
    border-radius: 12px;
    width: 100%;
    max-width: 500px;
    margin: auto;
}

.modal-header {
    padding: 15px 20px;
    border-bottom: 2px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    font-size: 1.2em;
    color: #333;
}

.close-btn {
    background: none;
    border: none;
    font-size: 2em;
    color: #999;
    cursor: pointer;
    line-height: 1;
}

.modal-body {
    padding: 20px;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #333;
}

.form-group input[type="text"] {
    width: 100%;
    padding: 10px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 1em;
}

.form-group input[type="text"]:focus {
    outline: none;
    border-color: #667eea;
}

.form-group textarea {
    min-height: 200px;
}

.modal-footer {
    padding: 15px 20px;
    border-top: 2px solid #e0e0e0;
}

/* Fixed bottom bar */
.bottom-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    padding: 10px;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    display: flex;
    gap: 10px;
}

.bottom-bar .btn {
    margin: 0;
    flex: 1;
}

.status-msg {
    text-align: center;
    padding: 10px;
    margin: 10px 0;
    border-radius: 8px;
    font-weight: 500;
}

.status-msg.success {
    background: #d4edda;
    color: #155724;
}

.status-msg.error {
    background: #f8d7da;
    color: #721c24;
}

.button-group {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.button-group .btn {
    margin: 0;
    flex: 1;
}

.btn-small {
    padding: 10px;
    font-size: 0.9em;
}
